NorthwoodsSoftware / GoJS

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

Suggestion: Double tree layout alternateAngle #125

Closed aszokalski closed 3 years ago

aszokalski commented 3 years ago

I noticed that when using DoubleTreeLayout with treeStyle: go.TreeLayout.StyleRootOnly (and probably other styles) the angled tree started growing in the wrong direction. I quickly figured that setting alternateAngle: 180 would fix it and it did.

It's not really a bug but it's just an unexpected (or more like unwanted) behaviour you might want to look into. I suggest setting alternateAngle to the same value as 'angle' by default on the angled tree.

WalterNorthwoods commented 3 years ago

Setting TreeLayout.treeStyle means that you are explicitly asking for the use of the "alternate" TreeVertex values, instead of the regular default vertex property values.

If you do not set treeStyle, vertexes will inherit property values from their parent vertex. https://gojs.net/latest/api/symbols/TreeLayout.html#static-StyleLayered

This lists the vertex properties that are inherited: https://gojs.net/latest/api/symbols/TreeLayout.html#rootDefaults