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

Dendrogram

Previous
IndentedTree
Next
OrganizationChart

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 dendrogram breaks down items or phenomena into a tree-like structure to systematically display their composition or internal logic.

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

When to Use

It is suitable for displaying hierarchical data relationships, clarifying key points of an issue, and outlining logical steps to achieve a goal.

Examples

API

For general graph properties, refer to: General Graph Properties

Dendrogram

PropertyDescriptionTypeDefault Value
dataThe datasetData-
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
directionSyntactic sugar for setting the arrangement direction of tree nodes. When layout.direction is set, it will take precedencevertical | horizontal | radialhorizontal
compactWhether to enable compact modebooleanfalse
defaultExpandLevelThe default expansion level; if not specified, all levels will be expandednumber-
layoutConfiguration for the dendrogram layoutLayout-

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

Dendrogram layout properties are as follows:

PropertyDescriptionTypeDefault Value
typeLayout typestringdendrogram
directionLayout directionLR | RL | TB | BT | H | VRL
nodeSepNode separationnumber40
rankSepSeparation between layersnumber200
radialWhether to arrange nodes in a radial layout. If radial is true, it is recommended to set direction to LR or RL
Basic Usage

A simple demonstration.

Arrangement Direction

Use the syntax sugar direction to set the arrangement of child nodes as vertical or radial. If direction is not set, the default is horizontal. Note that the label placement will adjust based on the direction, but if node.style.labelPlacement is set, it takes precedence.

Compact Mode

Use the compact configuration for compact mode.

Expand/Collapse Nodes

Add G6's built-in CollapseExpand interaction, allowing nodes to expand/collapse on double-click. For detailed configuration instructions, refer to CollapseExpandOptions.