-
Notifications
You must be signed in to change notification settings - Fork 63
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
allow trail sections as arrow shafts #151
Comments
Can you provide an example diagram to us help understand what you are trying to do. |
Does this help? -Ed On 2014-01-31 5:10 PM, Jeffrey Rosenbluth wrote:
compile with: Suppose I choose a shaft that I would like to use for arrows from things to themselves:
It would be convenient to just be able to say something like: try_1 = circle 0.25 # named "p_1" # connectOutside' (with & arrowShaft .~ shaft) "p_1" "p_1" And have Diagrams figure out for me which section of the shaft trail But this fails with, Maybe.fromJust: Nothing So instead of connectOutside' I can just use connect' with head and tail gaps:
But connect' doesn't use the section of the trail beyond the gaps for the shaft,
And now it should work, right?
Except now the two endpoints aren't the same so it doesn't seem fair This is what I meant by "fiddly". Is there a way to do what I want -- basically
|
I ran the examples and I understand the problem. Let me think about it and see it there is some way to get the semantics you are looking for. |
Have you thought about using the connecPerim' funcition as in the dfa example in the tutorial, |
Ed, I had a chance to look into the this issue a bit more, and I'm afraid the current implementation of arrows does not cover this case. The length of an arrow is defined to be the linear distance from its tip to its tail and the entire arrow is scaled to a give length. An arrow that starts and ends at the same point has zero length. You could do something like what I do in the DFA example in the tutorial as I mentioned above, but I'm not sure it will suffice for what you are trying to do. Another possible work around is to use two arrows, one with no head starting at the dot and going to some point off the dot, and one with no tail starting at the point off the dot and ending at the dot. The functionality you are looking for would be nice to have and I will look into adding it. |
Hi Jeffrey, Thanks for taking the time to look into this. Yes, I certainly can use connectPerim' in the manner of the DFA example I humbly submit that a natural use case with curved arrows is to have I believe (but am not completely sure) that this is what TikZ does by Anyway, thanks again for looking into this. I was hoping that there was With best wishes, -Ed On 2014-02-01 11:20 AM, Jeffrey Rosenbluth wrote:
|
I've been trying to use Diagrams' named subdiagrams and arrows to draw commuting (categorical) diagrams using connect and friends, and found that the arrows don't behave the way I expected.
For shafts that are not straight lines, when using connectOutside(') or head and tail gaps with connect('), I would like the trail that I specify for the shaft to connect the origins of the source and target diagrams, but only the section (as in Diagrams.Parametric) outside of their boundaries (in the case of connectOutside) or the gap distances away from their origins (in the case of gaps) to be stroked.
The problem with the current behavior is that it is very fiddly to get curved arrows, and especially self-loops, to look right. Is the mode of use described above something that might be supported in the future?
The text was updated successfully, but these errors were encountered: