Represents a diagram node.
Namespace: MindFusion.Diagramming
File: DiagramNode.js
JavaScript
![]() |
---|
// class |
DiagramNode objects can represent graph vertices, nodes in organizational or flow diagrams, entities in ER diagrams, and so on. DiagramNode is an abstract class. You cannot instantiate it directly, but instead use objects from specific classes such as ShapeNode, TableNode, ContainerNode, CompositeNode. You can also define your own node type by deriving from DiagramNode or its descendants.
Use the bounds property to get or change the location and size of a node. Constraints upon how users are allowed to modify a node are set through the constraints and enabledHandles properties. The former specifies constraints on move direction and node size. The latter enables or disables specific manipulation handles of a node.
The main textual content of a node is set using its text property and can be customized by setting font and textAlignment. Supplementary labels can be created by calling addLabel.
Relations between nodes are indicated by connecting the nodes with DiagramLink instances. Links are considered directed graph edges, so each node has two collections referring to links: incomingLinks and outgoingLinks. anchorPattern lets you specify the points of a node to which incoming or outgoing links can be connected. The allowIncomingLinks property lets you specify whether incoming links can be drawn to a node. The allowOutgoingLinks property lets you do that for outgoing links.
A user is allowed to expand or collapse the tree starting from a node if expandable is set to true. The expanded property gets or sets whether the subtree starting from a node is expanded or not.
Nodes can be attached to other items, and be used as simple labels, image-holders or other kinds of UI elements. The attachTo method overloads provide various options for that.
Nodes can be rotated, either interactively using the rotation handle above a node, or programmatically by setting the rotationAngle property.
MindFusion.Diagramming.CaptionedNode
MindFusion.Diagramming.CompositeNode
MindFusion.Diagramming.ControlNode
MindFusion.Diagramming.DummyNode
MindFusion.Diagramming.FreeFormNode
MindFusion.Diagramming.ShapeNode
MindFusion.Diagramming.VideoNode