dagrejs / dagre-d3

A D3-based renderer for Dagre
MIT License
2.86k stars 592 forks source link

changing node representation #28

Open marina83 opened 10 years ago

marina83 commented 10 years ago

Hi I start using dagre and it has really awsom capabilities. However I have a question. I need to create custom nodes visualization so that every node will be a circle with some text label near it. Also I need to achieve that every edge will start after the text finishes. Please advise what is the best way to do so?

cpettitt commented 10 years ago

To draw a circle and a label next to the circle, override the drawNodes function in the Renderer. See demo/tcp-state-diagram.html for an example of overriding drawNodes. The edges may work out the way you want with the existing algorithm. If not you can override positionEdgePaths in a similar manner.