dagrejs / dagre-d3

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

adding additional node shapes #326

Open seanpue opened 6 years ago

seanpue commented 6 years ago

I am interested in adding some additional node shapes. I am coming to this great project from graphviz, so I am trying to match up with its shapes: http://www.graphviz.org/doc/info/shapes.html

For a current project I have made a "rectangle" (which is oblong, unlike the internal "rect", which is not necessarily), a "square", an "Mdiamond" (chorded diamond), and an "Msquare" (chorded square). I may also need a "doublecircle".

I think it would be cool to add these node shapes to dagre-d3, and hopefully the rest later. An easy transition from graphviz would be useful. I am sure there are other issues, but these node-shape ones were the ones I hit immediately for my current project.

Should I do a pull request? Also, has anyone does this already?

jsommr commented 6 years ago

Would be awesome if you did that. One thing this library really needs is a way to add shapes without having to modify the library itself though. Perhaps something that can be passed as an argument when initializing the render method.