NorthwoodsSoftware / GoJS

JavaScript diagramming library for interactive flowcharts, org charts, design tools, planning tools, visual languages.
http://gojs.net
Other
7.7k stars 2.86k forks source link

The Circular layout spreads out the nodes in opposite direction #213

Closed postulkam closed 3 months ago

postulkam commented 4 months ago

The circular layout spreads out the nodes in the opposite direction than selected (clockwise vs. counterclockwise). I think it depends on the order of adding nodes.

Try the examples with full cycles in the diagram, and then try to remove the link with the linkDA key. Even without a cycle in the diagram, there are still some problems.

Example with nodes in group: https://jsfiddle.net/Mi_Po/uzxkncye/13/ Example with nodes on plain canvas: https://jsfiddle.net/Mi_Po/9qcenysw/10/

WalterNorthwoods commented 3 months ago

You need to set CircularLayout.sorting to be either Ascending or Descending, as desired. https://gojs.net/latest/api/symbols/CircularLayout.html#sorting