process-analytics / bpmn-layout-generators

Tools for generating missing BPMNDiagram elements in BPMN files
Apache License 2.0
34 stars 4 forks source link

Review the "Manhattan" layout algorithm #58

Open tbouffard opened 3 years ago

tbouffard commented 3 years ago

This is the way we are building the graph under the hood: The Manhattan distance function computes the distance that would be traveled to get from one data point to the other if a grid-like path is followed.

resources

mxgraph java implementation

used by bpmn.io for autolayout (there are refs to this algorithm described in diagram-js)

tbouffard commented 1 year ago

I found this JS lib that manages the Manhattan layout greatly!

Manhattan layout

demo: https://x6.antv.vision/zh/docs/api/registry/router#manhattan

x6_layout_manhattan

Metro layout

demo: https://x6.antv.vision/zh/docs/api/registry/router#metro

x6_layout_metro