Skip to main content

API Reference

Size

PropertyDescriptionType
widthNode widthnumber
heightNode heightnumber

Point

PropertyDescriptionType
xnumber
ynumber

Padding

PropertyDescriptionTypeDefault Value
topPadding topnumber
bottomPadding bottomnumber
leftPadding leftnumber
rightPadding rightnumber

NiceDagMode (enum)

PropertyDescriptionValue
DEFAULTDefault mode"DEFAULT"
WITH_JOINT_NODES"WITH_JOINT_NODES"

EdgeAttributes

PropertyDescriptionType
colorEdge colorstring
hideArrowChoose whether to hide the arrow in the edgesboolean

GraphLabel

PropertyDescriptionType
widthnumber
heightnumber
compoundboolean
rankdirstring
alignstring
nodesepnumber
edgesepnumber
ranksepnumber
marginxnumber
marginynumber
acyclicerstring
rankerstring

GridConfig

PropertyDescriptionType
gridSizegrid sizenumber
colorgrid colorstring

NiceDagModelType (enum)

PropertyValue
HIERARCHY"HIERARCHY"
FLATTEN"FLATTEN"

NiceDagDirection (enum)

PropertyValueDescription
LR"LR"From left to right
RL"RL"From right to left
TB"TB"From top to button
BT"BT"From button to top

EdgeConnectorType (enum)

PropertyDescriptionValue
CENTER_OF_BORDER"CENTER_OF_BORDER"
CENTER"CENTER"

MinimapConfig

PropertyDescriptionType
classNamestring
viewBoxClassNamestring

NiceDag

PropertyDescriptionType
idstring
render() => void
destory() => void
setScale(scale: number) => void
center(size: Size) => niceDag
scrollTo(id: string) => void
setDirection(direction: NiceDagDirection) => void
getScrollPosition() => Point
getAllNodes() => IViewNode[]
getAllEdges() => IEdge[]
getElementByNodeId(id: string) => HTMLElement
getEdgeLabel(sourceId: string, targetId: string) => HTMLElement
withNodes(nodes: Node[]) => niceDag
findNodeById(id: String) => IViewNode
fireNiceDagChange() => void
fireMinimapChange() => void
configNiceDagConfig