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

Add curve & arrow edge rendering #219

Merged
merged 7 commits into from Apr 2, 2014

Conversation

ssidorchik
Copy link
Contributor

In previous library version there was ability to render edges both curve with arrow head. I have restored this feature for the recent version. The edge type can be chosen by specifying 2 parameters: edge.type & edge.head. At the moment there are four edge types:

  • straight
edge.type = 'def' || '' || undefined
edge.head = 'def' || '' || undefined
  • curve
edge.type = 'curve'
edge.head = 'def' || '' || undefined
  • straight with arrow head
edge.type = 'def' || '' || undefined
edge.head = 'arrow'
  • curve with arrow head
edge.type = 'curve'
edge.head = 'arrow'

@jacomyal
Copy link
Owner

Thanks a lot for the pull request, I looked at it and it looks great. However, I have a small problem with it:

With your modifications, if I set an edge type to 'arrow', it will be displayed as a straight arrow with the WebGL renderer, but as a simple line with the Canvas renderer. I would prefer to keep the edge renderers as a one-level object, with 'def', 'arrow', 'curve' and 'curvedArrow', such that the API works the same for WebGL and Canvas, edges and nodes.

@ssidorchik
Copy link
Contributor Author

At first thought that edges line and head rendering can be separated, but then realize that it's hard to accomplish. So, having one parameter is better than two and also it's consistent with WebGL renderer.
Returned the edge rendering selection mechanism to default.

@jacomyal jacomyal merged commit 0a03079 into jacomyal:master Apr 2, 2014
@jacomyal
Copy link
Owner

jacomyal commented Apr 2, 2014

I just merged it, thanks a lot!

@ssidorchik ssidorchik deleted the add-curve-arrow-edge-rendering branch April 9, 2014 13:55
@antonioaltamura
Copy link

i dont get if with this i can choose the arrow orientation: source or target.
can i?

@sebastialonso
Copy link

Is this documented somewhere?

@walkerlala
Copy link

the default of minArrowSize should not be 0 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants