Skip to content
WunderUI

Network Chart

Pro

Network chart for relations: a force graph, an arc diagram, a tree and a radial tree.

Playground

Team network

Who works with whom: 30 nodes, 40 links in 4 groups.
Who works with whom, data table
labelGroupConnectionsConnected to
Product leadProduct9Tomás, Clara, Nina, Priya, Sofia, Emma, Nora, Maya
Design leadDesign8Amir, Noah, Leo, Maya, Ben, Paul, Daniel, Emma
Sales leadSales8Sofia, Emma, Nora, Tomás, Clara, Nina, Noah
Support leadSupport9Ben, Paul, Daniel, Amir, Noah, Leo, Sofia, Nora
TomásProduct2Product lead, Daniel
AmirDesign2Design lead, Amir
SofiaSales2Sales lead, Support lead
BenSupport2Support lead
ClaraProduct3Product lead, Paul
NoahDesign3Design lead, Sales lead, Priya
EmmaSales4Sales lead, Design lead, Nina, Leo
PaulSupport2Support lead, Clara
NinaProduct2Product lead, Emma
LeoDesign2Design lead, Emma
NoraSales2Sales lead, Support lead
DanielSupport2Support lead, Tomás
PriyaProduct2Product lead, Noah
MayaDesign2Design lead, Product lead
TomásSales2Sales lead
AmirSupport2Support lead, Amir
SofiaProduct1Product lead
BenDesign1Design lead
ClaraSales1Sales lead
NoahSupport1Support lead
EmmaProduct1Product lead
PaulDesign1Design lead
NinaSales1Sales lead
LeoSupport1Support lead
NoraProduct1Product lead
DanielDesign1Design lead

Installation

Network Chart comes with WunderUI Core and Pro, in the package from your plan. See the plans.

The charts live in their own entry point: import the chart, its card and its hooks from @wunderui/react/charts, not from @wunderui/react.

Then import what you need:

tsx
import {
  NetworkChart,
  NetworkChartProps,
  NetworkChartVariant,
} from "@wunderui/react/charts"

Then use it:

tsx
import { NetworkChart } from "@wunderui/react/charts"

const nodes = [{ id: "Nora" }, { id: "Daniel" }, { id: "Priya" }]
const links = [
  { source: "Nora", target: "Daniel" },
  { source: "Nora", target: "Priya" },
]

export function TeamNetwork() {
  return <NetworkChart nodes={nodes} links={links} label="Who works with whom" />
}

Expected result: You see three nodes, with Nora joined to both of the others.

When to use

Use Network Chart for

  • Relations between things: who works with whom, which service calls which
  • A force graph for clusters, an arc diagram for ordered nodes
  • An organisation or a folder structure as a tree or a radial tree

Use something else for

States

Loading, empty and error keep the chart's size, so the card never jumps. Add a retry handler and the error state offers a Try again button.

Team network

Who works with whom: 30 nodes, 40 links in 4 groups.
Who works with whom, data table
labelGroupConnectionsConnected to
Product leadProduct9Tomás, Clara, Nina, Priya, Sofia, Emma, Nora, Maya
Design leadDesign8Amir, Noah, Leo, Maya, Ben, Paul, Daniel, Emma
Sales leadSales8Sofia, Emma, Nora, Tomás, Clara, Nina, Noah
Support leadSupport9Ben, Paul, Daniel, Amir, Noah, Leo, Sofia, Nora
TomásProduct2Product lead, Daniel
AmirDesign2Design lead, Amir
SofiaSales2Sales lead, Support lead
BenSupport2Support lead
ClaraProduct3Product lead, Paul
NoahDesign3Design lead, Sales lead, Priya
EmmaSales4Sales lead, Design lead, Nina, Leo
PaulSupport2Support lead, Clara
NinaProduct2Product lead, Emma
LeoDesign2Design lead, Emma
NoraSales2Sales lead, Support lead
DanielSupport2Support lead, Tomás
PriyaProduct2Product lead, Noah
MayaDesign2Design lead, Product lead
TomásSales2Sales lead
AmirSupport2Support lead, Amir
SofiaProduct1Product lead
BenDesign1Design lead
ClaraSales1Sales lead
NoahSupport1Support lead
EmmaProduct1Product lead
PaulDesign1Design lead
NinaSales1Sales lead
LeoSupport1Support lead
NoraProduct1Product lead
DanielDesign1Design lead

Keyboard interactions

The plot is focusable: arrow keys step through the nodes in data order and the live region reads each node with its connections by name. A hidden data table adds a Connected to column.

TaborShiftTab
Moves focus to the plot and away from it. The plot is one tab stop; so is every legend badge.
ArrowRightorArrowLeft
Moves to the next or previous node. The tooltip follows, and a live region announces the one you are on. The first press starts at the first one (Left: the last one).
HomeorEnd
Jumps to the first or last node.
Escape
Clears the active point.
EnterorSpace
On a legend badge of a ChartCard: switches its series off or on. The last visible series stays on.

Behavior and motion

What the chart does on its own and what the page decides.

Graphs and trees
Graph variants take nodes (id, label, group, size) and links (source, target, value), and tree variants take a hierarchy of names and children. Groups set colours and legend order.
Layout
The force layout is calculated once per data set and fitted to the frame, so nodes do not jump on resize. Nodes are sized by size, or by their number of links.
Labels
Names stand beside the nodes, shortened to fit. Dense graphs show the labels of the hovered node and its neighbours.
Bad links
Links to unknown nodes and self loops are ignored.
Loading, empty and error
The chart keeps its size while it loads, is empty or fails, so the card never jumps. Add a retry handler to show a Try again button.
Legend
A ChartCard shows the series as badges. With two or more series each badge switches its series off (the last visible one stays on), and a static legend is possible for roles instead of series.
Size
The chart fills its container's width and the height prop sets the plot height. It never scales its text: labels keep their size at every width.

Motion

The enter sequence and the hover follow the motion tokens of the library.

Pop in and draw
Nodes pop in and links draw the first time the chart is in view, after loading, and when the key or the data changes. Turn it off with the animate prop.
Hover
Hovering a node highlights its neighbours and dims the rest.
Reduced motion
With reduced motion the enter sequence is off and the chart appears at once. Tooltip, crosshair and every state still work.

Anatomy

NetworkChart draws relations: a force-directed graph, an arc diagram, a tree and a radial tree. Nodes pop in and links draw; hovering a node highlights its neighbours and dims the rest.

Team network

Who works with whom: 6 nodes, 7 links in 4 groups.
Who works with whom, data table
labelGroupConnectionsConnected to
NoraProduct3Daniel, Priya, Tomás
DanielProduct3Nora, Maya, Support
PriyaDesign2Nora, Maya
MayaDesign2Daniel, Priya
TomásSales2Nora, Support
SupportSupport2Tomás, Daniel
  • Takes nodes (id, label, group, size) and links (source, target, value) for the graph variants, or a tree of name and children for the tree variants. Groups set colours and legend order.

  • data-slot="chart-plot"

    The focusable region. Arrow keys walk its marks and the live region reads each one as the tooltip shows it.

  • data-slot="chart-marks"

    Nodes sized by size (or degree) and links between them. The force layout is calculated once per data set and fitted to the frame, so nodes do not jump on resize.

  • Optional

    Names beside each node, shortened to fit. Dense graphs show labels for the hovered node and its neighbours.

  • data-slot="chart-tooltip"Optional

    The group and the number of links (reports, on the tree variants).

  • data-slot="chart-message"Optional

    Muted dots on the force graph, muted bars on the tree and arc variants. Links to unknown nodes and self loops are ignored.

  • A table of the nodes with group and degree for screen readers.

Best practices

  • Do

    Keep a force graph below about 60 nodes and use size for importance. Above that, filter or aggregate first.

  • Do

    Use a tree for strict hierarchies such as an org chart or file structure, and the arc diagram for ordered nodes with many links.

  • Do

    Colour by group and keep to five groups, with the names in the legend.

  • Don’t

    Don't read distance in a force graph as a measurement. The layout places connected nodes close, but position has no axis.

  • Don’t

    Don't use it for tabular data. If the question is a value per item, a BarChart answers it faster.

API reference

One table for NetworkChart. It is a plain component, so the table lists every prop, and the ChartCard around it takes its own props (the chart works without one).

Takes nodes (id, label, group, size) and links (source, target, value) for the graph variants, or a tree of name and children for the tree variants. Groups set colours and legend order.

PropTypeDefaultDescription
nodesreadonly NetworkNode[][], : the nodes and their links.
linksreadonly NetworkLink[][]
treeTreeDatum—, : the hierarchy.
groupsreadonly { key: string; label?: string; color?: ChartColor }[]—Groups in legend order with colours.
variant"force-graph" | "arc-diagram" | "tree" | "radial-tree""force-graph"Figma variant. Default .
labelstring—
heightnumber—
state"ready" | "loading" | "empty" | "error"—
hiddenSeriesreadonly string[]—
activeIndexnumber | null—The active point (hovered or focused) as an index into , to control it yourself. shows none.
animateboolean—
animationKeystring | number—
defaultActiveIndexnumber | null—The point that is active at first, for an uncontrolled chart. It shows the tooltip without a pointer.
descriptionstring—
onActiveIndexChange(index) => void—Called with the index when the pointer or the arrow keys move to another point, and with when they leave. Use it to show the hovered value in a headline.
onRetry() => void—Shows a Try again button in the error state and calls this when it is pressed.
widthnumber—

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("network-chart")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.