Arrow icon
See all demos

Tree graph and cycles

Trees are graphs that do not contain cycles. Each node of a tree has exactly one parent (except the root, which has none). This demo shows how to maintain a tree with automatic tree layout, and also how to allow users to add special backlinks that may create cycles but are not taken into account by automatic layout.
Demo instructions
Add child elements and watch the layout adapt. To create special backlinks, hover over an element and use the element tools to connect it to another one.

Made with JointJS+

Only available with the JointJS+ commercial license in the apps/ directory of your package. Don't have a license yet? Start a trial and use the source code of all our demos for free, with no strings attached, for 30 days.

Made with JointJS

Available in the JointJS open-source library which helps developers create simple visual applications in less time.

Speed up your development with aย powerful library

Leverage a time-tested JavaScript diagramming library using the best of HTML5 and SVG to accelerate your development.