mirror of
https://gitee.com/antv/g6.git
synced 2024-12-05 13:18:40 +08:00
1.2 KiB
1.2 KiB
title | order |
---|---|
Random | 1 |
Random is the default layout in G6. It will take effect when layout
is not assigned to the Graph instance and there is no position information in node data.
const graph = new G6.Graph({
container: 'mountNode',
width: 1000,
height: 600,
layout: {
type: 'random',
width: 300,
height: 300,
},
});
layoutCfg.center
Type: Array
Example: [ 0, 0 ]
Default: The center of the graph
Required: false
Description: The center of the layout
layoutCfg.width
Type: Number
Default: The width of the graph
Required: false
Description: The width of the layout
layoutCfg.height
Type: Number
Default: The height of the graph
Required: false
Description: The height of the layout
layoutCfg.workerEnabled
Type: Boolean
Default: false
Required: false
Description: Whether to enable the web-worker in case layout calculation takes too long to block page interaction