Usage guidesLayout

Concentric layout

Place nodes in rings by a ranking metric, with higher values near the center.

Overview

Place nodes in rings by a ranking metric, with higher values near the center.

When to use it

Use it to emphasize hubs by their number of connections.

Basic usage

Set the layout type with layout.type.

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

Options

OptionDescriptionTypeDefault
sortByRanking metric. 'degree' ranks by node degree.'degree' | (node) => number'degree'
maxLevelDiffRanking values in the same ring differ by less than this threshold.numberComputed automatically
preventOverlapWhether to space nodes to avoid overlap.booleanfalse
nodeSpacingGap reserved between nodes when preventing overlap.number10

Common layout options · Layout reference

Code example

Nodes are grouped by degree. The purple hub has five connections and sits at the center. Each blue node has three connections and sits on the inner ring. Each green node has one connection and sits on the outer ring.

Loading example…
Drag to pan or scroll to zoom.
const layout = {
  type: 'concentric',
  sortBy: 'degree',
  maxLevelDiff: 1,
  preventOverlap: true,
  nodeSize: 24,
  nodeSpacing: 28,
};

Compare network layouts