Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update manual and arrow tutorial for new semantics of lc w.r.t arrows #40

Merged
merged 2 commits into from
Nov 14, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions doc/arrow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be updated to reflect lenses and the change of field type. Eg, headStyle %~ fc blue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, there's lots of that sort of thing that needs updating (much more than just this sentence). I thought I would leave that to another day.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

blue` or `tailStyle = fc orange . opacity 0.5`.

.. class:: lhs

Expand Down Expand Up @@ -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.
the gallery.
3 changes: 2 additions & 1 deletion doc/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down