A grafcet diagram is similar to a sequential function chart.

Select a Node to show a list of Buttons that enable creating new Nodes or drawing new Links. These buttons are defined as an adornment that is used in a common Part.selectionAdornmentTemplate. This diagram uses many custom functions, including an overridden LinkingTool and a special Link class, BarLink.

Diagram Model saved in JSON format:
{ "class": "go.GraphLinksModel", "nodeDataArray": [ {"key":1, "category":"Start", "location":"300 50", "step":"1", "text":"Action 1"}, {"key":2, "category":"Parallel", "location":"300 100"}, {"key":3, "location":"225 125", "step":"3", "text":"Action 2"}, {"key":4, "location":"325 150", "step":"4", "text":"Action 3"}, {"key":5, "location":"225 175", "step":"5", "text":"Action 4"}, {"key":6, "category":"Parallel", "location":"300 200"}, {"key":7, "location":"300 250", "step":"7", "text":"Action 6"}, {"key":11, "category":"Start", "location":"300 350", "step":"11", "text":"Action 1"}, {"key":12, "category":"Exclusive", "location":"300 400"}, {"key":13, "location":"225 450", "step":"13", "text":"Action 2"}, {"key":14, "location":"325 475", "step":"14", "text":"Action 3"}, {"key":15, "location":"225 500", "step":"15", "text":"Action 4"}, {"key":16, "category":"Exclusive", "location":"300 550"}, {"key":17, "location":"300 600", "step":"17", "text":"Action 6"}, {"key":21, "location":"500 50", "step":"21", "text":"Act 1"}, {"key":22, "location":"500 100", "step":"22", "text":"Act 2"}, {"key":23, "location":"500 150", "step":"23", "text":"Act 3"}, {"key":24, "location":"500 200", "step":"24", "text":"Act 4"}, {"key":31, "location":"500 400", "step":"31", "text":"Act 1"}, {"key":32, "location":"500 450", "step":"32", "text":"Act 2"}, {"key":33, "location":"500 500", "step":"33", "text":"Act 3"}, {"key":34, "location":"500 550", "step":"34", "text":"Act 4"} ], "linkDataArray": [ {"from":1, "to":2, "text":"condition 1"}, {"from":2, "to":3}, {"from":2, "to":4}, {"from":3, "to":5, "text":"condition 2"}, {"from":4, "to":6}, {"from":5, "to":6}, {"from":6, "to":7, "text":"condition 5"}, {"from":11, "to":12, "text":"condition 1"}, {"from":12, "to":13, "text":"condition 12"}, {"from":12, "to":14, "text":"condition 13"}, {"from":13, "to":15, "text":"condition 2"}, {"from":14, "to":16, "text":"condition 14"}, {"from":15, "to":16, "text":"condition 15"}, {"from":16, "to":17, "text":"condition 5"}, {"from":21, "to":22, "text":"c1"}, {"from":22, "to":23, "text":"c2"}, {"from":23, "to":24, "text":"c3"}, {"from":21, "to":24, "text":"c14", "category":"Skip"}, {"from":31, "to":32, "text":"c1"}, {"from":32, "to":33, "text":"c2"}, {"from":33, "to":34, "text":"c3"}, {"from":33, "to":32, "text":"c14", "category":"Repeat"} ]}

### GoJS Features in this sample

#### Links

The Link class is used to implement a visual relationship between nodes. Links are normally created by the presence of link data objects in the GraphLinksModel.linkDataArray or by a parent key reference as the value of the TreeModel.nodeParentKeyProperty of a node data object in a TreeModel. More information can be found in the GoJS Intro.

Related samples

#### ToolTips

A tooltip is an Adornment that is shown when the mouse hovers over an object that has its GraphObject.toolTip set. The tooltip part is bound to the same data as the part itself.

It is typical to implement a tooltip as a "ToolTip" Panel holding a TextBlock or a Panel of TextBlocks and other objects. Each "ToolTip" is just an "Auto" Panel Adornment that is shadowed, and where the border is a rectangular Shape with a light gray fill. However you can implement the tooltip as any arbitrarily complicated Adornment.

More information can be found in the GoJS Intro.

Related samples

#### Tools

Tools handle all input events, such as mouse and keyboard interactions, in a Diagram. There are many kinds of predefined Tool classes that implement all of the common operations that users do.

For flexibility and simplicity, all input events are canonicalized as InputEvents and redirected by the diagram to go to the Diagram.currentTool. By default the Diagram.currentTool is an instance of ToolManager held as the Diagram.toolManager. The ToolManager implements support for all mode-less tools. The ToolManager is responsible for finding another tool that is ready to run and then making it the new current tool. This causes the new tool to process all of the input events (mouse, keyboard, and touch) until the tool decides that it is finished, at which time the diagram's current tool reverts back to the Diagram.defaultTool, which is normally the ToolManager, again.

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

#### Geometry Path Strings

The GoJS Geometry class controls the "shape" of a Shape, whereas the Shape.fill and Shape.stroke and other shape properties control the colors and appearance of the shape. For common shape figures, there are predefined geometries that can be used by setting Shape.figure. However one can also define custom geometries.

One can construct any Geometry by allocating and initializing a Geometry of at least one PathFigure holding some PathSegments. But you may find that using the string representation of a Geometry is easier to write and save in a database. Use the static method Geometry.parse or the Shape.geometryString property to transform a geometry path string into a Geometry object.

More information can be found in the GoJS Intro.

Related samples