This sample demonstrates labeled ports on nodes, arranged as a data flow or workflow. These ports are set up as panels, created within the makePort function. This function sets various properties of the Shape and TextBlock that make up the panel, and properties of the panel itself. Most notable are GraphObject.portId to declare the shape as a port, and GraphObject.fromLinkable and GraphObject.toLinkable to set the way the ports can be linked.

The diagram also uses the makeTemplate function to create the node templates with shared features. This function takes a type, an image, a background color, and arrays of ports to create the node to be added to the Diagram.nodeTemplateMap.

For the same data model rendered somewhat differently, see the Data Flow (vertical) sample.

Diagram Model saved in JSON format: