logo

G6

  • Docs
  • API
  • Playground
  • Community
  • Productsantv logo arrow
  • 5.0.47
  • 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 and KeyShape
      • Atomic Shapes and Their Properties
      • Design and Implementation of Composite Shape
  • Layout
    • Layout Overview
    • Build-in Layout
      • 3D Force-Directed Layout
      • AntvDagre Layout
      • Circular Layout
      • ComboCombined Layout
      • Common Layout Configuration Options
      • CompactBox
      • Concentric Layout
      • D3 Force-Directed Layout
      • Dagre Layout
      • Dendrogram Layout
      • Fishbone Layout
      • Force Force-directed Layout
      • ForceAtlas2 Force-directed Layout
      • Fruchterman Force-directed Layout
      • Grid Layout
      • Indented Tree
      • MDS High-dimensional Data Dimensionality Reduction Layout
      • Mindmap Tree
      • Radial Layout
      • Random Layout
      • Snake Layout
    • 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

Radial Layout

Previous
Mindmap Tree
Next
Random Layout

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

Overview

Radial layout is a graph layout algorithm that arranges nodes in concentric circles by layers. It is commonly used to display hierarchical relationships, community structures, and more. This layout supports advanced features such as node overlap prevention and group sorting, making it suitable for visualizing various network structures.

Use Cases

  • Displaying hierarchical structures (e.g., organizational charts, family trees)
  • Community structure analysis
  • Scenarios that need to highlight the central node and its radiating relationships
  • Complex networks requiring node grouping and sorting

Online Demo

createGraph(
{
autoFit: 'view',
data: {
nodes: [
{ id: '0' },
{ id: '1' },
{ id: '2' },
{ id: '3' },
{ id: '4' },
{ id: '5' },
{ id: '6' },
{ id: '7' },
{ id: '8' },
{ id: '9' },
{ id: '10' },
{ id: '11' },
{ id: '12' },
{ id: '13' },
{ id: '14' },
{ id: '15' },
{ id: '16' },
{ id: '17' },
{ id: '18' },
{ id: '19' },
{ id: '20' },
{ id: '21' },
{ id: '22' },
{ id: '23' },
{ id: '24' },
{ id: '25' },
{ id: '26' },
{ id: '27' },
{ id: '28' },
{ id: '29' },
{ id: '30' },
{ id: '31' },
{ id: '32' },
{ id: '33' },
],
edges: [
{ source: '0', target: '1' },
{ source: '0', target: '2' },
{ source: '0', target: '3' },
{ source: '0', target: '4' },
{ source: '0', target: '5' },
{ source: '0', target: '7' },
{ source: '0', target: '8' },
{ source: '0', target: '9' },
{ source: '0', target: '10' },
{ source: '0', target: '11' },
{ source: '0', target: '13' },
{ source: '0', target: '14' },
{ source: '0', target: '15' },
{ source: '0', target: '16' },
{ source: '2', target: '3' },
{ source: '4', target: '5' },
{ source: '4', target: '6' },
{ source: '5', target: '6' },
{ source: '7', target: '13' },
{ source: '8', target: '14' },
{ source: '10', target: '22' },
{ source: '10', target: '14' },
{ source: '10', target: '12' },
{ source: '10', target: '24' },
{ source: '10', target: '21' },
{ source: '10', target: '20' },
{ source: '11', target: '24' },
{ source: '11', target: '22' },
{ source: '11', target: '14' },
{ source: '12', target: '13' },
{ source: '16', target: '17' },
{ source: '16', target: '18' },
{ source: '16', target: '21' },
{ source: '16', target: '22' },
{ source: '17', target: '18' },
{ source: '17', target: '20' },
{ source: '18', target: '19' },
{ source: '19', target: '20' },
{ source: '19', target: '33' },
{ source: '19', target: '22' },
{ source: '19', target: '23' },
{ source: '20', target: '21' },
{ source: '21', target: '22' },
{ source: '22', target: '24' },
{ source: '22', target: '26' },
{ source: '22', target: '23' },
{ source: '22', target: '28' },
{ source: '22', target: '30' },
{ source: '22', target: '31' },
{ source: '22', target: '32' },
{ source: '22', target: '33' },
{ source: '23', target: '28' },
{ source: '23', target: '27' },
{ source: '23', target: '29' },
{ source: '23', target: '30' },
{ source: '23', target: '31' },
{ source: '23', target: '33' },
{ source: '32', target: '33' },
],
},
node: {
style: {
labelFill: '#fff',
labelPlacement: 'center',
labelText: (d) => d.id,
},
},
layout: {
type: 'radial',
nodeSize: 32,
unitRadius: 100,
linkDistance: 200,
},
behaviors: ['drag-canvas', 'drag-element'],
},
{ width: 600, height: 400 },
(gui, graph) => {
const options = {
nodeSize: 32,
unitRadius: 100,
linkDistance: 200,
preventOverlap: false,
strictRadial: true,
sortBy: undefined,
sortStrength: 10,
};
const optionFolder = gui.addFolder('Radial Layout Options');
optionFolder.add(options, 'nodeSize', 1, 100, 1);
optionFolder.add(options, 'unitRadius', 10, 300, 1);
optionFolder.add(options, 'linkDistance', 10, 400, 1);
optionFolder.add(options, 'preventOverlap');
optionFolder.add(options, 'strictRadial');
optionFolder.add(options, 'sortStrength', 1, 100, 1);
optionFolder.add(options, 'sortBy', [undefined, 'data', 'id']);
optionFolder.onChange(async ({ property, value }) => {
graph.setLayout(
Object.assign({}, graph.getLayout(), {
[property]: value,
}),
);
await graph.layout();
graph.fitView();
});
},
);

Configuration

const graph = new Graph({
layout: {
type: 'radial',
nodeSize: 32,
unitRadius: 100,
linkDistance: 200,
},
// other configurations...
});

Options

PropertyDescriptionTypeDefaultRequired
typeLayout typestringradial✓
centerCenter coordinates[number, number]-
focusNodeRadiating center nodestring | Node | nullnull
heightCanvas heightnumber-
widthCanvas widthnumber-
nodeSizeNode size (diameter)number-
nodeSpacingMinimum node spacing (effective when preventing overlap)number | (nodeData: Node) => number10
linkDistanceEdge lengthnumber50
unitRadiusRadius per circlenumber | null100
maxIterationMaximum number of iterationsnumber1000
maxPreventOverlapIterationMax iterations for overlap preventionnumber200
preventOverlapWhether to prevent node overlapbooleanfalse
sortByField for sorting nodes in the same layerstring-
sortStrengthSorting strength for nodes in the same layernumber10
strictRadialStrictly place nodes in the same layer on the same ringbooleantrue

Code Example

Basic Usage

import { Graph } from '@antv/g6';
fetch('https://assets.antv.antgroup.com/g6/radial.json')
.then((res) => res.json())
.then((data) => {
const graph = new Graph({
container: 'container',
data,
autoFit: 'center',
layout: {
type: 'radial',
nodeSize: 32,
unitRadius: 100,
linkDistance: 200,
},
node: {
style: {
labelFill: '#fff',
labelPlacement: 'center',
labelText: (d) => d.id,
},
},
behaviors: ['drag-canvas', 'drag-element'],
});
graph.render();
});

Result:

Basic Radial Layout

Real Cases

  • Basic Radial Layout
  • Strict Overlap Prevention Radial Layout
  • Non-strict Overlap Prevention Radial Layout
  • Cluster Sorting