Loading...
CentripetalOptions
Centripetal force configuration, including the center and strength for leaf nodes, isolated nodes, and other nodes.
boolean Default:
false
Whether to cluster all nodes.
If true, the field specified by nodeClusterBy in node data will be used for clustering. centripetalOptions.single, centripetalOptions.leaf, and centripetalOptions.others will use the value returned by getClusterNodeStrength; leaf and centripetalOptions.center will use the average center of all nodes in the current cluster.
number | ((node: Node) => number) Default:
20
Used with clustering and nodeClusterBy to specify the strength of the cluster centripetal force.
number Default:
1
Strength of anti-overlap force, range [0, 1].
number Default:
0.005
Coulomb coefficient, a factor for repulsion. The larger the value, the greater the repulsion between nodes.
number Default:
0.9
Damping coefficient, range [0, 1]. The larger the value, the slower the speed decreases.
number | ((d?: Edge) => number) Default:
50
Strength of edge force (attraction).
number Default:
1
Repulsion coefficient. The larger the value, the greater the repulsion.
(node?: Node, degree?: number) => number[]
Callback for the x, y, and strength of the centripetal force for each node. If not specified, no extra centripetal force is applied.
(node?: Node) => number
Callback for the mass of each node. The parameter is the node's internal data, and the return value is the mass.
number Default:
10
Strength of the central force, i.e., the force attracting all nodes to the center. The larger the value, the more compact the layout.
number
Layout height, defaults to canvas height.
number Default:
0.02
Controls the movement speed of each node per iteration.
boolean Default:
false
Whether to cluster leaf nodes.
If true, centripetalOptions.single will be 100; centripetalOptions.leaf will use the value returned by getClusterNodeStrength; getClusterNodeStrength.center will return the average center of all leaf nodes.
number | ((edge?: Edge, source?: any, target?: any) => number) Default:
200
Edge length.
number Default:
200
Maximum movement length per iteration.
(params: { energy: number; nodes: Node[]; edges: Edge[]; iterations: number; }) => void
Callback for monitoring each iteration. energy indicates the convergence energy of the layout. May incur extra computation if configured; if not configured, no computation is performed.
string
Specifies the field name in node data for clustering. Takes effect when clustering is true. Automatically generates centripetalOptions, can be used with clusterNodeStrength.
Size | ((d?: Node) => Size)
Node size (diameter). Used for collision detection to prevent node overlap.
number | ((d?: Node) => number)
Takes effect when preventOverlap is true. Minimum spacing between node edges to prevent overlap. Can be a callback to set different spacing for different nodes.
number | ((d?: Node) => number) Default:
1000
Node force. Positive means attraction, negative means repulsion.
(data: LayoutMapping) => void
Callback for each iteration.
boolean Default:
true
Whether to prevent overlap. Must be used with nodeSize or data.size in node data. Only when data.size is set in the data or nodeSize is configured in the layout with the same value as the node size in the graph, collision detection for node overlap can be performed.
number
Layout width, defaults to canvas width.