Skip to main content

Node

Node is the unit of DAG diagram, which can represent an activity like a batch process, a task, etc.

Properties

PropertyOptionalDescriptionTypeDefault
idNoNode Identifierstring
dependenciesYesList of ID list which represents the node depends onstring[]
dataYesData object of nodeA flexible JSON Object
childrenYesChild NodesNode[]
parentIdYesParent Node Idstring
collapseYesBoolean indicator shows if children are hiddenboolean
edgeConnectorTypeYesPosition of edge connectorEdgeConnectorTypeCENTER_OF_BORDER

API (IViewNode)

After the DAG initialization, all Node objects given by the uses are wrapped with a set of API that can control node behavior. The wrap object is called IViewNode.

NameDescriptionType
shrinkHide child nodes()=>void
expandShow all child nodes()=>void
removeRemove the node()=>void
withChildrenCall the method can change the children of the node (promise: Promise<Node[]>, useCache?: boolean) => void
jointIndicator which shows the node is a joint nodeboolean
setPointSet node position(point: Point) => void
connectCreate an Edge with the given node(node: IViewNode) => void
addChildNodeAdd a child node(node: Node, point: Point) => void

Enums

EdgeConnectorType

EnumDescription
CENTER_OF_BORDERCenter position of the node border
CENTERCenter position of the node