g6/packages/site/docs/api/Items/edgeProperties.en.md
2023-02-02 10:31:36 +08:00

2.3 KiB

title order
Edge Model Properties 7

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:

Name Required Type Remark
refX false Number x offset of the label
refY false Number y offset of the label
position false String The relative position to the edge. Options: start, middle, and end. middle by default.
autoRotate false Boolean Whether to activate ratating according to the edge automatically. false by default
style false Object The 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.