jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Other
41.07k stars 7.62k forks source link

An extension for Draw.io that uses Viz.js to update the layout #1340

Closed mararad closed 2 years ago

mararad commented 3 years ago

It would seem that nodes and edges could have the Graphviz Auto Layout applied by using an extension. Iterate through and build up a compatible node connectivity structure then have vis.js output something that gave you the updated node locations. The edge routing probably gets weird rather quickly.

bollwyvl commented 3 years ago

as always, thanks for drawio!

another alternative is elkjs, which, like viz.js, runs in a WebWorker. From a routing perspective, it's good enough to do circuit board planning, and its JSON format is at least partially documented... though there are many many more layout options, which can only really be fully understood through a thorough reading of the java source.

bollwyvl commented 2 years ago

None of my business, as I haven't had time to explore anything in this regard, but is elk being considered?

davidjgraph commented 2 years ago

@bollwyvl I'm not exactly sure what elk provides. The main layout seems to be a Sugiyama that supports groups, are there any others?

bollwyvl commented 2 years ago

I am not a student off the field, but a quick scan reveals that yes, Sugiyama, is the base. We have gotten a lot of use out of how this plays with nesting and ports, and its support for handling very specific constraints/settings, down to the shape level.

http://rtsys.informatik.uni-kiel.de/elklive/examples.html?e=user-hints%2Flayered%2FhorizontalOrder

(unfortunately that doesn't show both)