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

This workflow diagram uses the LayeredDigraphLayout to display some data about the flow of a fictional web site. You can add to the Diagram by dragging Nodes from the Palette and by buttons that appear when clicking on the Page (yellow) and Drop (red) Nodes.

All nodes in this sample have editable text. To activate the TextEditingTool, click on a node to select it and click on its text once selected.

Several Link relationships are defined. Hovering over the sides of many nodes changes the mouse cursor to a pointer. Clicking and dragging in these areas creates a new link with the LinkingTool. The node definitions contain several rules, for instance you cannot drag links to Source (blue) Nodes, only from them, and you cannot have multiple links between the same two nodes, among others.

Most of the source code for this sample is in defining pleasing Node templates. Much of the functionality seen is done with built-in GoJS components. This is by no means an exhaustive sample, so be sure to check out the other samples to the left, or take a look at the Introductory Documents for a more structured tutorial on different GoJS concepts.

Diagram Model saved in JSON format:

GoJS Features in this sample

Item Arrays

It is sometimes useful to display a variable number of elements in a node by data binding to a JavaScript Array. In GoJS, this is simply achieved by binding (or setting) Panel.itemArray. The Panel will create an element in the panel for each value in the Array. More information can be found in the GoJS Intro.

Related samples


Layered Digraph Layout

This predefined layout is used for placing Nodes of a general directed graph in layers (rows or columns). This is more general than TreeLayout, as it does not require that the graph be tree-structured. More information can be found in the GoJS Intro.

Related samples


Palette

A Palette is a subclass of Diagram that is used to display a number of Parts that can be dragged into the diagram that is being modified by the user. The initialization of a Palette is just like the initialization of any Diagram. Like Diagrams, you can have more than one Palette on the page at the same time.

More information can be found in the GoJS Intro.

Related samples


Buttons

GoJS defines several Panels for common uses. These include "Button", "TreeExpanderButton", "SubGraphExpanderButton", "PanelExpanderButton", "ContextMenuButton", and "CheckBoxButton". "ContextMenuButton"s are typically used inside of "ContextMenu" Panels; "CheckBoxButton"s are used in the implementation of "CheckBox" Panels.

These predefined panels can be used as if they were Panel-derived classes in calls to GraphObject.make. They are implemented as simple visual trees of GraphObjects in Panels, with pre-set properties and event handlers.

More information can be found in the GoJS Intro.

Related samples