This sample is exactly like the Double Tree sample, but this gets its data by getting JSON content from the server. In this case the data is in a static file named doubleTree.json.

This sample displays a diagram of two trees sharing a single root node growing in opposite directions. The immediate child data of the ROOT node have a "dir" property that describes the direction that subtree should grow.

The Diagram.layout is an instance of the DoubleTreeLayout extension layout, defined in extensions/DoubleTreeLayout.js. The layout requires a DoubleTreeLayout.directionFunction predicate to decide for a child node of the root node which way the subtree should grow.

加入 GoJS 交流群
GoJS 交流群 (769862113)