CentripetalOptions
Centripetal configuration, including the centripetal center of leaf nodes, discrete points, and the centripetal center of other nodes
boolean Default:
false
Whether to cluster all nodes
If it is true, the node data configured by nodeClusterBy will be used as the clustering basis. centripetalOptions.single, centripetalOptions.leaf, centripetalOptions.others will use the return value of getClusterNodeStrength; leaf、centripetalOptions.center will use the average center of all nodes in the current cluster
number | ((node: Node__) => number) Default:
20
Use it with clustering and nodeClusterBy to specify the size of the centripetal force of the cluster
number Default:
1
The strength of the force that prevents overlap, range [0, 1]
number Default:
0.005
Coulomb's coefficient, a coefficient of repulsion, the larger the number, the larger the repulsion between nodes
number Default:
0.9
Damping coefficient, the range of the value is [0, 1]. The larger the number, the slower the speed will decrease
number | ((d?: Edge__) => number) Default:
50
The size of the force of the edge (attraction)
number Default:
1
The repulsion coefficient, the larger the number, the larger the repulsion
(node?: Node__, degree?: number) => number[]
The callback function for the center force of each node, if not specified, there will be no additional center force
(node?: Node__) => number
The callback function for the mass of each node, if the parameter is the internal circulation data of the node, the return value is the size of the mass
number Default:
10
The size of the center force, which attracts all nodes to the center. The larger the number, the more compact the layout
number
The height of the layout, default to the height of the canvas
number Default:
0.02
Control the movement speed of each iteration node
boolean Default:
false
Whether to cluster leaf nodes
If it is true, centripetalOptions.single will be 100; centripetalOptions.leaf will use the return value of getClusterNodeStrength; getClusterNodeStrength.center will be the average center of all leaf nodes
number | ((edge?: Edge__, source?: any, target?: any) => number) Default:
200
边的长度
number: 固定长度
((edge?: Edge, source?: any, target?: any) => number): 根据边的信息返回长度 The length of the edge
number: fixed length
((edge?: Edge, source?: any, target?: any) => number): return length according to the edge information
number Default:
200
The maximum movement length of one iteration
(params: { energy: number; nodes: Node__[]; edges: Edge__[]; iterations: number; }) => void
The callback function for monitoring information of each iteration, energy indicates the convergence energy of the layout. If not configured, it will not calculate
string
Specify the field name of the node data as the clustering basis for the node, and it takes effect when clustering is true. You can combine it with clusterNodeStrength to use it
Size | ((d?: Node__) => Size__)
The size of the node (diameter). Used for collision detection when preventing node overlap
number | ((d?: Node__) => number)
It is effective when preventOverlap is true. The minimum spacing of the node edge when preventing overlap. It can be a callback function to set different minimum spacing for different nodes
number | ((d?: Node__) => number) Default:
1000
The force of the node, positive numbers represent the attraction force between nodes, and negative numbers represent the repulsion force between nodes
(data: LayoutMapping__) => void
The callback function for each iteration
boolean Default:
true
Whether to prevent overlap, must be used with the following properties nodeSize or data.size in the node data, and only when the data.size is set in the data or the nodeSize value is configured with the same value as the current graph node size in the layout configuration, can the node overlap collision detection be performed
number
The width of the layout, default to the width of the canvas