logo

G6

  • Docs
  • API
  • Playground
  • Community
  • Productsantv logo arrow
  • 5.0.45
  • Introduction
  • Data
  • Getting Started
    • Quick Start
    • Installation
    • Integration
      • react
      • vue
      • angular
    • Step-by-step guide
  • Graph
    • Extensions En
    • Graph
    • Options
    • extension
  • Element
    • Element Overview
    • Element State
    • Node
      • Node Overview
      • Build-in Node
        • Common Node Configurations
        • Diamond
        • Donut
        • Ellipse
        • Hexagon
        • Html
        • Image
        • Rect
        • Star
        • Triangle
        • Circle
      • Custom Node
      • Define Nodes with React
    • Edge
      • Edge Overview
      • Build-in Edge
        • Common Edge Configurations
        • Cubic Bezier Curve
        • CubicHorizontal Bezier Curve
        • CubicVertical Bezier Curve
        • Line
        • Polyline
        • Quadratic Bezier Curve
      • Custom Edge
    • Combo
      • Combo Overview
      • Build-in Combo
        • Circle
        • Combo Configuration Options
        • Rect
      • Custom Combo
    • Shape
      • Shape Overview
      • Shape Properties
  • Layout
    • Layout Overview
    • Build-in Layout
      • AntvDagre
      • Circular
      • ComboCombined
      • Common Layout Configuration Options
      • CompactBox
      • Concentric
      • D3Force
      • D3Force3D
      • Dagre
      • Dendrogram
      • Fishbone
      • Force
      • ForceAtlas2
      • Fruchterman
      • Grid Layout
      • Indented
      • Mds
      • Mindmap
      • Radial
      • Random
      • Snake
    • Custom Layout
  • Behavior
    • Behavior Overview
    • Build-in Behavior
      • AutoAdaptLabel
      • BrushSelect
      • ClickSelect
      • CollapseExpand
      • CreateEdge
      • DragCanvas
      • DragElement
      • DragElementForce
      • FixElementSize
      • FocusElement
      • HoverActivate
      • LassoSelect
      • OptimizeViewportTransform
      • ScrollCanvas
      • ZoomCanvas
    • Custom Behavior
  • Plugin
    • Plugin Overview
    • Build-in Plugin
      • Background
      • BubbleSets
      • Contextmenu
      • EdgeBundling
      • EdgeFilterLens
      • Fisheye
      • Fullscreen
      • GridLine
      • History
      • Hull
      • Legend
      • Minimap
      • Snapline
      • Timebar
      • Toolbar
      • Tooltip
      • Watermark
    • Custom Plugin
  • Transform
    • Data Transformation Overview
    • Build-in Transform
      • MapNodeSize
      • PlaceRadialLabels
      • ProcessParallelEdges
    • Custom Transform
  • Theme
    • Theme Overview
    • Custom Theme
    • Palette
    • Custom Palette
  • Animation
    • Animation Overview
    • Custom Animation
  • Further Reading
    • Event
    • renderer
    • coordinate
    • download-image
    • Using Iconfont
    • Use 3D
    • Bundle Project
  • What's new
    • Feature
    • Upgrade To 5.0
  • FAQ
  • contribute

AntvDagre

Previous
Layout Overview
Next
Circular

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...

Options

align

DagreAlign Default: 'UL'

节点对齐方式 U:upper(上);D:down(下);L:left(左);R:right(右)

  • 'UL':对齐到左上角

  • 'UR':对齐到右上角

  • 'DL':对齐到左下角

  • 'DR':对齐到右下角

  • undefined:默认,中间对齐 The alignment of the nodes U: upper; D: down; L: left; R: right

  • 'UL':align to left top

  • 'UR':align to right top

  • 'DL':align to left bottom

  • 'DR':align to right bottom

  • undefined:default, align to center

begin

PointTuple Default: undefined

The position of the layout's top-left corner

controlPoints

boolean Default: false

Whether to calculate the control point position of the edge at the same time

It only takes effect when the built-in polyline edge (type: 'polyline-edge') is used in the edge configuration, or any edge that consumes data.controlPoints as the control point position. In essence, it adds data.controlPoints to the edge data

edgeLabelSpace

boolean Default: true

Whether to leave space for the label of the edge

It will affect whether to add a dummy node in the middle of the edge

focusNode

ID | Node | null

The focused node

  • ID: node id

  • Node: node instance

  • null: cancel focus

It takes effect when radial is true

nodeOrder

string[] Default: false

The reference array of the order of the nodes in the same layer, storing the node id value

If not specified, the same layer node order will be arranged according to the mechanism of dagre itself

nodesep

number Default: 50

The horizontal gap between nodes (px)

The horizontal gap between nodes (px) in the case of rankdir is 'TB' or 'BT'. The vertical gap between nodes (px) in the case of rankdir is 'LR' or 'RL'. nodesepFunc has a higher priority

nodesepFunc

(d?: Node) => number

The callback function of the node spacing (px), which can be used to set different node spacing for different nodes

The horizontal spacing of the node in the case of rankdir is 'TB' or 'BT', and the vertical spacing of the node in the case of rankdir is 'LR' or 'RL'. The priority is higher than nodesep, that is, if nodesepFunc is set, nodesep does not take effect

nodeSize

Size | ((nodeData: Node) => Size) Default: undefined

The diameter of the node

Used for collision detection when nodes overlap

preset

OutNode[] Default: undefined

The reference node position when calculating the layout

It is generally used to ensure the continuity of the layout when switching data. In G6, if you update the data, the existing layout result data will be used as input automatically

radial

boolean

Whether to use dagre for radial layout

rankdir

DagreRankdir Default: 'TB'

布局的方向。T:top(上);B:bottom(下);L:left(左);R:right(右)

  • 'TB':从上至下布局

  • 'BT':从下至上布局

  • 'LR':从左至右布局

  • 'RL':从右至左布局 The direction of the layout. T: top; B: bottom; L: left; R: right

  • 'TB':from top to bottom

  • 'BT':from bottom to top

  • 'LR':from left to right

  • 'RL':from right to left

ranker

'network-simplex' | 'tight-tree' | 'longest-path'

The mode of the layout

ranksep

number Default: 50

The vertical gap between levels (px)

The vertical gap between levels (px) in the case of rankdir is 'TB' or 'BT'. The horizontal gap between levels (px) in the case of rankdir is 'LR' or 'RL'. ranksepFunc has a higher priority

ranksepFunc

(d?: Node) => number

The callback function of the layer spacing (px)

The vertical spacing of adjacent layers in the case of rankdir is 'TB' or 'BT', and the horizontal spacing of adjacent layers in the case of rankdir is 'LR' or 'RL'. The priority is higher than nodesep, that is, if nodesepFunc is set, nodesep does not take effect

sortByCombo

boolean Default: false

Whether to sort nodes in the same layer according to the parentId in each node data to prevent Combo overlapping

It is recommended to configure when there is a Combo