Edge Model Properties

2 min read

Common Property

Except for the common properties, there are special configurations for each type of built-in Edges. The styles of them depend on their keyShape. The common properties for built-in Edges can be refered to:

id

String required

The id of the edge, MUST be a unique string

source

String | Number optional

The id of the source node.

target

String | Number optional

The id of the target node.

type

String optional default: 'line'

The type of the edge. It can be the type of a Built-in Edge, or a custom Edge. 'line' by default

sourceAnchor

Number optional

The index of link points on the source node. The link point is the intersection of the edge and related node.

targetAnchor

Number optional

The index of link points on the target node. The link point is the intersection of the edge and related node.

style

Object optional

The edge style. style is an object to configure the stroke color, shadow, and so on. The complete configurations is listed in: Shape Properties

label

String optional

label is a string which indicates the content of the label.

labelCfg

labelCfg is an object to configure the label. The commonly used configurations of labelCfg:

NameRequiredTypeRemark
refXfalseNumberx offset of the label
refYfalseNumbery offset of the label
positionfalseStringThe relative position to the edge. Options: start, middle, and end. middle by default.
autoRotatefalseBooleanWhether to activate ratating according to the edge automatically. false by default
stylefalseObjectThe style property of the label. The complete configurations for the label style is listed in Shape Style Properties - Text

Properties for Specific Built-in Edges

The special properties for each built-in Edges can be found in the subdocuments of Built-in Edges.