This is a minimalist HTML and JavaScript skeleton of the GoJS Sample doubleTree.html. It was automatically generated from a button on the sample page, and does not contain the full HTML. It is intended as a starting point to adapt for your own usage. For many samples, you may need to inspect the full source on Github and copy other files or scripts.

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

This sample displays a bow-tie 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 version 2.2.5. Copyright 1998-2022 by Northwoods Software.

View this sample page's source on GitHub