From c558ed31d76a252b1b765157ed0bc80b62389aec Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Wed, 13 Nov 2013 16:14:38 -0500 Subject: [PATCH 1/2] update manual and arrow tutorial for new semantics of lc w.r.t arrows --- doc/arrow.rst | 43 ++++++++++++++++++++++++++----------------- doc/manual.rst | 3 ++- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/doc/arrow.rst b/doc/arrow.rst index 9eb22c4d..f5d831f9 100644 --- a/doc/arrow.rst +++ b/doc/arrow.rst @@ -156,17 +156,17 @@ is the definition for reference: :: data ArrowOpts = ArrowOpts - { arrowHead :: ArrowHT - , arrowTail :: ArrowHT - , arrowShaft :: Trail R2 - , headSize :: Double - , tailSize :: Double - , headGap :: Double -- amount of space to leave after arrowhead - , tailGap :: Double -- amount of space ot leave before arrowtail - , headStyle :: HasStyle c => c -> c - , tailStyle :: HasStyle c => c -> c - , shaftStyle :: HasStyle c => c -> c } - + { _arrowHead :: ArrowHT + , _arrowTail :: ArrowHT + , _arrowShaft :: Trail R2 + , _headSize :: Double + , _tailSize :: Double + , _headGap :: Double + , _tailGap :: Double + , _headStyle :: Style R2 + , _tailStyle :: Style R2 + , _shaftStyle :: Style R2 + } Don't worry if some of the field types in this record are not yet clear, we will walk through each field @@ -376,11 +376,20 @@ the following example. The default gaps are 0. The style options ----------------- -The styles of the head, tail and shaft are manipulated using -`headStyle`, `tailStyle`, and `shaftStyle`. We change the attributes -of the arrow parts by setting one of these parameters equal to a -function that applies the attributes, *e.g.* `headStyle = fc blue` or -`tailStyle = fc orange . opacity 0.5`. +By default, arrows are drawn using the current line color (including +the head and tail). For example: + +.. class:: dia-lhs + +:: + +> dia = square 1 <> arrowAt origin unitX # lc blue # centerXY + +The styles of the head, tail and shaft may be individually overridden +using `headStyle`, `tailStyle`, and `shaftStyle`. We change the +attributes of the arrow parts by setting one of these parameters equal +to a function that applies the attributes, *e.g.* `headStyle = fc +blue` or `tailStyle = fc orange . opacity 0.5`. .. class:: lhs @@ -605,4 +614,4 @@ In the following exercise you can try `connectPerim'` for yourself. .. container:: todo Add a paragraph about connectOutside and refrence the Symmetry cube in - the gallery. \ No newline at end of file + the gallery. diff --git a/doc/manual.rst b/doc/manual.rst index dca5862b..c601dc14 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -2805,7 +2805,8 @@ to `connect` is `connect'`. These companion functions take an extra * `headStyle`, `tailStyle` and `shaftStyle` are used to pass in style functions like `fc blue . opacity 0.75` to customize parts of the - arrow. + arrow. (By default, the entire arrow, including head and tail, is + drawn using the current line color.) The following example demonstrates the use of various `ArrowOpts`. From 7f9fb283c9dd75c7101394d7ed2163eff8267cbb Mon Sep 17 00:00:00 2001 From: Daniel Bergey Date: Thu, 14 Nov 2013 03:04:51 +0000 Subject: [PATCH 2/2] Example must be called `example` --- doc/arrow.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/arrow.rst b/doc/arrow.rst index f5d831f9..e7b680ce 100644 --- a/doc/arrow.rst +++ b/doc/arrow.rst @@ -383,7 +383,7 @@ the head and tail). For example: :: -> dia = square 1 <> arrowAt origin unitX # lc blue # centerXY +> example = square 1 <> arrowAt origin unitX # lc blue # centerXY The styles of the head, tail and shaft may be individually overridden using `headStyle`, `tailStyle`, and `shaftStyle`. We change the