Usage guidesLayoutRecommended optional layouts

Radial layout

Place nodes in rings by shortest-path distance from a focal node.

Overview

Place nodes in rings by shortest-path distance from a focal node.

When to use it

Use it to see the direct and indirect relationships of an account, service, or device.

Basic usage

This layout is optional. Import and register it before setting layout.type. For CDN usage, see Optional layouts.

import { Graph, register } from '@antv/g6-lite';
import radial from '@antv/g6-lite/layouts/radial';

register('layout', 'radial', radial);

const graph = new Graph({
  container,
  data,
  layout: { type: 'radial' },
});

Options

OptionDescriptionTypeDefault
focusNodeID of the focal node.stringFirst node
unitRadiusDistance between neighboring rings.numberComputed automatically
linkDistanceReference edge length used by the layout.number50
preventOverlapWhether to try to prevent nodes in a ring from overlapping.booleanfalse

Common layout options · Layout reference

Code example

The purple node 0 sits at the center, with 68 units between rings.

Loading example…
Drag to pan or scroll to zoom.
import { register } from '@antv/g6-lite';

import radial from '@antv/g6-lite/layouts/radial';

register('layout', 'radial', radial);

const layout = { type: 'radial', focusNode: '0', unitRadius: 68 };

Compare network layouts