jgraph / mxgraph

mxGraph is a fully client side JavaScript diagramming library
Other
6.79k stars 2.06k forks source link

How adjust the order of cells in a layout? #451

Closed hbzb168 closed 3 years ago

hbzb168 commented 4 years ago

The maxgraph is a great tool. I used the mxCompactTreeLayout to automatically layout after created cells. But I can not find a way to adjust the order of cells. Hope your help. Thanks.

girumasfaw commented 4 years ago

If you are trying to move a given cells to the front or back, you can actually use the orderCells function. To disable the ordering just set the back parameter to false after the vertex is inserted. this.graph.orderCells(false,[cells])