This sample is derived from the State Chart sample. This makes use of the new GraphLinksModel.linkKeyProperty property and the Model.toIncrementalJson and Model.applyIncrementalJson methods. It also demonstrates custom functions for Model.makeUniqueKeyFunction and GraphLinksModel.makeUniqueLinkKeyFunction, which assign odd numbers to new node data and even numbers to new link data. Unlike most models, this example uses "id" as the name of the Model.nodeKeyProperty rather than "key".

Last Transaction saved in incremental JSON format: Diagram Model saved in JSON format:

GoJS Features in this sample

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


HTML Interaction

GoJS Diagrams can be used alongside other HTML elements in a webapp. For custom Text Editors, Context Menus, and ToolTips, which are invoked and hidden via GoJS tool operations, it is best to use the HTMLInfo class.

More information can be found in the GoJS Intro.

Related samples