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

Support markers at start and midpoint of edges #316

Closed
wants to merge 2 commits into from

Conversation

AlanHohn
Copy link

Adds "arrowtail" and "arrowmid" attributes to edges.

Default to "undirected" so default behavior is the same.

Fixes #194

Adds "arrowtail" and "arrowmid" attributes to edges.
@lutzroeder
Copy link
Contributor

Can you resolve conflicts and maybe also a short sample how this is being used?

@AlanHohn
Copy link
Author

Thanks for taking a look. I fixed the merge conflict.

I did make some changes to demos/arrows.html to show how you'd use it; please let me know if you prefer me to add samples somewhere else as well.

Basically it adds the attributes arrowmid and arrowtail to edges so you can place markers there as well. The value of those attributes is identical to arrowhead (i.e. the name of the arrow style).

I did have to do a little update to the standard "normal" and "vee" arrows to detect when they're being used as arrowtail so they can draw themselves upside down (orient: auto on the marker aligns them with the edge but it doesn't flip the point of the arrow). Anyone who wants to use arrowtail with custom arrows would need to do the same but the change doesn't break any existing use of arrowhead.

So long story short you'd make a double-headed arrow edge like this:

g.setEdge("leftNode", "rightNode", {
  arrowhead: "normal",
  arrowtail: "normal"
});

@lutzroeder lutzroeder requested review from cpettitt and removed request for cpettitt March 23, 2018 22:00
@Little-Fan
Copy link

I need this feature,thx!

@mhyleomak
Copy link

Hi all,
Will this feature branch merge to master? It would be a great feature for me.
Thanks!

@clement911
Copy link

I'd love to use this too!

@ralphtq
Copy link

ralphtq commented May 12, 2019

Also keen to have this merge

@ralphtq
Copy link

ralphtq commented May 13, 2019

Did the merge happen?

@lutzroeder
Copy link
Contributor

Updated to #361.

@lutzroeder lutzroeder closed this May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arrows for both sides?
6 participants