This text is displayed if your browser does not support the Canvas HTML element.

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.

View this sample page's source in-page

View this sample page's source on GitHub