logo

Ant Design Charts

  • Manual
  • Options
  • Examples
  • Productsantv logo arrow
  • 2.0.0
  • Component Overview
  • Common Configuration Statistical Charts
    • Chart composition
    • Component
      • 标题(Title)
      • Axis
      • Legend
      • Scrollbar
      • Slider
      • Tooltip
      • Label
    • Core
      • Color En
      • View
      • Data
        • overview
        • custom
        • ema
        • fetch
        • filter
        • fold
        • inline
        • join
        • kde
        • log
        • map
        • pick
        • rename
        • slice
        • sort
        • sortBy
      • Scale
        • overview
        • band
        • linear
        • log
        • ordinal
        • point
        • pow
        • quantile
        • quantize
        • sqrt
        • threshold
        • time
      • Transform
        • overview
        • bin
        • binX
        • diffY
        • dodgeX
        • flexX
        • group
        • groupColor
        • groupX
        • groupY
        • jitter
        • jitterX
        • jitterY
        • normalizeY
        • pack
        • sample
        • select
        • selectX
        • selectX
        • sortColor
        • sortX
        • sortY
        • stackEnter
        • stackY
        • symmetryY
      • Coordinate
        • overview
        • fisheye
        • parallel
        • polar
        • radial
        • theta
        • transpose
        • cartesian3D
      • 样式(Style)
      • Animate
        • overview
        • fadeIn
        • fadeOut
        • growInX
        • growInY
        • morphing
        • pathIn
        • scaleInX
        • scaleInY
        • scaleOutX
        • scaleOutY
        • waveIn
        • zoomIn
        • zoomOut
      • 状态(State)
      • Interaction
        • Overview
        • brushAxisHighlight
        • brushHighlight
        • brushXHighlight
        • brushYHighlight
        • brushFilter
        • brushXFilter
        • brushYFilter
        • chartIndex
        • elementHighlight
        • elementHighlightByColor
        • elementHighlightByX
        • elementSelect
        • elementSelectByColor
        • elementSelectByX
        • fisheye
        • legendFilter
        • legendHighlight
        • poptip
        • scrollbarFilter
        • sliderFilter
      • Composition
        • overview
        • facetCircle
        • facetRect
        • repeatMatrix
        • spaceFlex
        • spaceLayer
        • timingKeyframe
      • Theme
        • overview
        • Academy
        • classic
        • classicDark
      • event
    • Specal Plot
      • Area
      • Bar
      • CirclePacking
      • DualAxes
      • Gauge
      • Line
      • Rose
      • Sankey
      • Scatter
      • Sunburst
      • Treemap
      • Venn
      • WordCloud
      • Column
      • Pie
      • BidirectionalBar
      • Box
      • Bullet
      • Funnel
      • Heatmap
      • Histogram
      • Liquid
      • Radar
      • Stock
      • Tiny
      • Violin
      • Waterfall
      • RadialBar
  • Relation Graph Components
    • Overview
    • MindMap
    • Fishbone
    • IndentedTree
    • Dendrogram
    • OrganizationChart
    • FlowGraph
    • FlowDirectionGraph
    • NetworkGraph
    • FAQ

MindMap

Previous
Overview
Next
Fishbone

Resources

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-互动图形解决方案
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

A mind-mapping tool to help users organize and express their thoughts systematically.

import { MindMap } from '@ant-design/graphs';

When to Use

When information is complex or requires clear logical relationships, organize it into a series of nodes and branches to simplify understanding.

Examples

API

For general graph properties, refer to: General Graph Properties

MindMap

PropertyDescriptionTypeDefault Value
dataThe datasetData-
layoutConfiguration for setting the layoutLayout-
typeSyntactic sugar for setting the display style. When node.component is set, it takes precedence'default' | 'linear' | 'boxed''default'
directionSyntactic sugar for setting the arrangement direction of nodes. When layout.direction is set, it takes precedence'left' | 'right' | 'alternate''alternate'
nodeMinWidthMinimum width of a node; if the text content is insufficient, it will be centerednumber0 (default type)
120 (boxed type)
nodeMaxWidthMaximum width of a node; excess content will automatically wrap to the next linenumber300
defaultExpandLevelThe default expansion level; if not specified, all levels will be expandednumber-

Data

Two data formats are supported:

  1. (👍 Recommended) Tree data

Type Definition:

type TreeData = {
id: string;
children?: TreeData[];
[key: string]: unknown;
};

Example:

const data = {
id: 'root',
children: [
{
id: 'Child 1',
value: 10,
children: [
{ id: 'Sub 1-1', value: 5 },
{ id: 'Sub 1-2', value: 5 },
],
},
{
id: 'Child 2',
value: 20,
children: [
{ id: 'Sub 2-1', value: 10 },
{ id: 'Sub 2-2', value: 10 },
],
},
],
};
  1. Graph data. If the expand-collapse behavior is enabled, make sure the children field is included in the data.
const graphData = {
nodes: [
{ id: '1', data: { label: 'Node 1' }, children: ['2', '3'] },
{ id: '2', data: { label: 'Node 2' }, children: ['4'] },
{ id: '3', data: { label: 'Node 3' } },
{ id: '4', data: { label: 'Node 4' } },
],
edges: [
{ source: '1', target: '2' },
{ source: '1', target: '3' },
{ source: '2', target: '4' },
],
};

Layout

Mind map layout, where nodes at the same depth are placed on the same level. Parameters are as follows:

PropertyDescriptionTypeDefault Value
typeLayout typestringmindmap
labelFieldSpecifies the node label content
- Select a field from the data, and the corresponding field value will be used as the node label
- Dynamically generated: this function will be called with node data as a parameter, and its return value will be used as the node label
string | ((node: NodeData) => string)Node ID
directionDirection of the tree layoutH | VH
getWidthWidth of each node(node: NodeData) => numberDefault is node height
getHeightHeight of each node(node: NodeData) => numberDefault is node width
getHGapHorizontal gap between each node(node: NodeData) => number-
getVGapVertical gap between each node(node: NodeData) => number-
getSideSpecifies whether nodes are arranged on the left/right side of the root node. If set, all nodes will be on the same side of the root node, making direction = 'H' ineffective. If this parameter is a callback function, it can specify whether each node is on the left/right side of the root node.(node: NodeData) => string-
Basic Usage

A simple demonstration.

Styles

Use the type syntax to apply preset styles: linear style and boxed style.

Child Node Distribution

Set direction to right or left to distribute child nodes on the right or left. If direction is not set, the default is free distribution.

Custom Nodes

Customize nodes using node.component, in conjunction with node.size.

Collapse/Expand Child Nodes

Enable the expand/collapse behavior for child nodes by configuring the collapse-expand-react-node behavior. For detailed configuration instructions, refer to CollapseExpandReactNodeOptions. Additionally, configure defaultExpandLevel to control the default expansion level.

Set Branch Colors

assign-color-by-branch As a part of internal data processing, by adjusting the colors configuration, you can assign unique colors to different branches in order to distinguish the branch structure more clearly. Please refer to AssignColorByBranchOptions for detailed configuration instructions.

Linear Style
Boxed Style
Preview
Click Icon to Expand/Collapse
Click Node to Expand/Collapse
Custom Icon