g6/packages/site/docs/apis/layout/MindmapLayoutOptions.en.md
2023-11-09 17:50:23 +08:00

2.2 KiB

title order
Mindmap 16

Mindmap arranged the nodes with same depth on the same level. Different from compactBox, it does not consider the size of nodes while doing layout.

img

direction

Type: String
Options: 'H' | 'V'
Default: 'H'
Required: false
Description: The direction of layout.

  • H —— Root is on the middle, layout in horizontal symmetry.
img
  • V —— Root is on the middle, layout in vertical symmetry.
img

getWidth

Type: Number | Function
Example:

(d) => {
  // d is a node
  if (d.id === 'testId') return 50;
  return 100;
};

Required: false
Description: The width of each node

getHeight

Type: Number | Function
Example:

(d) => {
  // d is a node
  if (d.id === 'testId') return 50;
  return 100;
};

Required: false
Description: The height of each node

getHGap

Type: Number | Function
Example:

(d) => {
  // d is a node
  if (d.id === 'testId') return 50;
  return 100;
};

Default: 18
Required: false
Description: The horizontal separation of nodes

getVGap

Type: Number | Function
Example:

(d) => {
  // d is a node
  if (d.id === 'testId') return 50;
  return 100;
};

Default: 18
Required: false
Description: The vertical separation of nodes

getSide

Type: Function
Example:

(d) => {
  // d is a node
  if (d.id === 'test-child-id') return 'right';
  return 'left';
};

Default: 'right'
Required: false
Description: The callback function of node position(left or right of root node). Only affects the nodes which are connected to the root node directly. And the descendant nodes will be placed according to it