Skip to main content

NiceDagConfig

NiceDagConfig is a configuration object of DAG diagram.

Properties

PropertyOptionalDescriptionTypeDefault Value
modeYesType of DAG diagram. Currently, there are only 2 mode, if DAG diagram should create joint node automatically.NiceDagModeNiceDagMode.DEFAULT
graphLabelYesGraphLabel is the object derived from dagreGraphLabel{rankdir: "LR", ranksep: 60, edgesep: 10}
gridConfigYesGird Config. It is only applicable when DAG view is editable.Sizecolor: "blue", size: 40}
modelTypeYesNiceDagModelTypeNiceDagModelType.HIERARCHY
edgeConnectorTypeYesDefault edge connector type, which deterimines the position of node edgesEdgeConnectorTypeEdgeConnectorType.CENTER_OF_BORDER
edgeConnectorTypeYesDefault edge connector type, which deterimines the position of joint node edgesEdgeConnectorTypeEdgeConnectorType.CENTER
subViewPaddingYesPadding of subviewPadding{top: 40,bottom:20,left:20,right: 20}
minimapConfigYesMini-map configurationMinimapConfig{top: 40,bottom:20,left:20,right: 20}
getNodeSizeNoThe method asks users to implementGetNodeSize

Interfaces

getNodeSize

(node: Node) => Size;

The method is MANDATORY. The key of input is the node object. You can have different renders according to the content which the node contains.

Enums

NiceDagMode

PropertyDescription
DEFAULTNo joint nodes created in default
WITH_JOINT_NODESCreate joint nodes in default

NiceDagModelType

PropertyDescription
HIERARCHYchildren of nodes represent a node group
FLATTENparentId of nodes associate nodes as a node group

NiceDagDirection

It is used to define DAG diagram direction

PropertyDescription
LRFrom left to right
RLFrom right to left
TBFrom top to button
BTFrom button to top

Configurations

GridConfig

Grid configuration object is used by editable view only.

PropertyDescriptionType
gridSizewidth & height of the gridnumber
colorlink color (hex)string

MinimapConfig

PropertyDescriptionType
classNameClass name of minimap containerstring
viewBoxClassNameClass name of view box in the minimap containerstring

GraphLabel

The graph label type is defined by dagre. For most cases, you can focus the following fields.

PropertyDescriptionTypeDefault
ranksepDistance of two nodesnumber60
edgesepDistance of two edgesnumber10
rankdirDirection of diagram LR RL TB BTstringLR

For others, you can check it from dagre official website.