Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Diagrams/Dev/Arrows
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Drawing arrows == At the most basic level one could imagine an API like <code>arrow :: Arrowhead -> P2 -> P2 -> Diagram</code> and we probably should indeed have such a function, but we'll need to also generalize along several axes. First, the most frequent use case will be drawing an arrow ''on top of'' an existing diagram in order to connect two points. So we want something like <code>arrow :: IsName n => Arrowhead -> n -> n -> (Diagram -> Diagram)</code> which draws an arrow between the named points on the given diagram. There are several ways this can be generalized: # Instead of drawing an arrow between the named ''points'' one could draw the arrow between the named ''subdiagrams'' (using their traces to find the edges). # There should also be a way to leave gaps, ''i.e.'' don't draw the arrow precisely from point to point or edge to edge, but leave a gap of a certain absolute size or a certain percentage of the arrow length on either end of the arrow. Re: leaving gaps, this will require some generic code to shrink paths. There is already some code to shrink/extend individual segments (and compute the length of segments) [https://github.com/diagrams/diagrams-lib/blob/master/src/Diagrams/Segment.hs#L249 in Diagrams.Segment]. This would need to be extended to shrinking/extending trails and paths appropriately. One might also want to have control over the middle of the arrow -- i.e. whether it curves, and if so how much and in which direction, etc.
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width