Skip to content
Multidimensional, network & hierarchyGenerated from the public API

GraphChart

Follow the relationship rather than the value — hover a mark to read its row.

@luc/ui/charts

What it shows

Explore relationships and clusters in a network, where node placement is a visual aid rather than a coordinate measurement.

Live preview

Six nodes in three groups; the node size is the caller's weight and the layout is a restrained force simulation.

<GraphChart
  nodes={[
    { id: "ingest", name: "Ingest", group: "Data", value: 3 },
    { id: "store", name: "Store", group: "Data", value: 4 },
    { id: "model", name: "Model", group: "Compute", value: 5 },
    { id: "serve", name: "Serve", group: "Serve", value: 4 },
    { id: "api", name: "API", group: "Serve", value: 3 },
    { id: "web", name: "Web", group: "Serve", value: 2 },
  ]}
  links={[
    { source: "ingest", target: "store", value: 2 },
    { source: "store", target: "model", value: 3 },
    { source: "model", target: "serve", value: 3 },
    { source: "serve", target: "api", value: 2 },
    { source: "api", target: "web", value: 2 },
    { source: "store", target: "serve", value: 1 },
  ]}
  groups={["Data", "Compute", "Serve"]}
  layout="force"
  format={{ kind: "integer" }}
  height={380}
  ariaLabel="Pipeline graph"
/>

Controls

Height

380px

A chart measures its container, so it always needs a definite height.

State

The surface the chart is in — loading, empty and error are drawn by the component.

Accessible name

A drawing is not readable by a screen reader, so it needs a name that states what it shows.

The same fixture as the live preview above; the controls change how it is drawn, not what it measures.

Code
import { GraphChart } from "@luc/ui/charts";

<GraphChart
  nodes={[
    { id: "ingest", name: "Ingest", group: "Data", value: 3 },
    { id: "store", name: "Store", group: "Data", value: 4 },
    { id: "model", name: "Model", group: "Compute", value: 5 },
    { id: "serve", name: "Serve", group: "Serve", value: 4 },
    { id: "api", name: "API", group: "Serve", value: 3 },
    { id: "web", name: "Web", group: "Serve", value: 2 },
  ]}
  links={[
    { source: "ingest", target: "store", value: 2 },
    { source: "store", target: "model", value: 3 },
    { source: "model", target: "serve", value: 3 },
    { source: "serve", target: "api", value: 2 },
    { source: "api", target: "web", value: 2 },
    { source: "store", target: "serve", value: 1 },
  ]}
  groups={["Data", "Compute", "Serve"]}
  layout="force"
  format={{ kind: "integer" }}
  height={380}
  ariaLabel="Pipeline graph"
  state="ready"
/>

Not controllable here

  • series / rows — The numbers are the caller's; the fixture above is the example.
Copy for an AI agentA specification an agent can act on: the import, the setup, the chosen props, the data contract and the accessibility expectation.
Implement `GraphChart` from Luc UI. It is: Follow the relationship rather than the value — hover a mark to read its row.

Import it with: import { GraphChart } from "@luc/ui/charts";
Requires: react ^19.0.0; react-dom ^19.0.0; react-hook-form ^7.0.0 (optional, for @luc/ui/forms/react-hook-form); tailwindcss ^4.0.0; node >= 22 (repository tools). Import the stylesheet once at the app root and wrap the tree in `LucProvider`. Both come from the package that publishes @luc.

Chosen configuration: `height={380}`, `state="ready"`, `ariaLabel="Pipeline graph"`.

Accessibility: keep the component's own semantics. Do not re-implement its ARIA wiring, do not add roles it does not declare, and make sure every interactive element is reachable and operable from the keyboard with a visible focus state.
Styling: use Luc UI design tokens and the component's own props. Do not restyle with raw colour literals and do not override the component's internal structure with page CSS.
Motion: respect `prefers-reduced-motion`. The component already does, so do not disable it.

Reproduce this state:
```tsx
<GraphChart
  nodes={[
    { id: "ingest", name: "Ingest", group: "Data", value: 3 },
    { id: "store", name: "Store", group: "Data", value: 4 },
    { id: "model", name: "Model", group: "Compute", value: 5 },
    { id: "serve", name: "Serve", group: "Serve", value: 4 },
    { id: "api", name: "API", group: "Serve", value: 3 },
    { id: "web", name: "Web", group: "Serve", value: 2 },
  ]}
  links={[
    { source: "ingest", target: "store", value: 2 },
    { source: "store", target: "model", value: 3 },
    { source: "model", target: "serve", value: 3 },
    { source: "serve", target: "api", value: 2 },
    { source: "api", target: "web", value: 2 },
    { source: "store", target: "serve", value: 1 },
  ]}
  groups={["Data", "Compute", "Serve"]}
  layout="force"
  format={{ kind: "integer" }}
  height={380}
  ariaLabel="Pipeline graph"
  state="ready"
/>
```

Usage

The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.

It is drawn by the ECharts engine.

Worked examples with real data are on the family overview: Multidimensional, network & hierarchy

import { GraphChart } from "@luc/ui/charts";
<GraphChart
  nodes={[
    { id: "ingest", name: "Ingest", group: "Data", value: 3 },
    { id: "store", name: "Store", group: "Data", value: 4 },
    { id: "model", name: "Model", group: "Compute", value: 5 },
    { id: "serve", name: "Serve", group: "Serve", value: 4 },
    { id: "api", name: "API", group: "Serve", value: 3 },
    { id: "web", name: "Web", group: "Serve", value: 2 },
  ]}
  links={[
    { source: "ingest", target: "store", value: 2 },
    { source: "store", target: "model", value: 3 },
    { source: "model", target: "serve", value: 3 },
    { source: "serve", target: "api", value: 2 },
    { source: "api", target: "web", value: 2 },
    { source: "store", target: "serve", value: 1 },
  ]}
  groups={["Data", "Compute", "Serve"]}
  layout="force"
  format={{ kind: "integer" }}
  height={380}
  ariaLabel="Pipeline graph"
/>

Data contract

`nodes` contain unique ids plus optional name/group/value; `links` contain source/target/value; `groups` names the groups and `layout` selects the placement strategy.

Important configuration

Choose `layout`, declare `groups` so colour has meaning, and use `format` for link or node weights; keep ids stable across renders.

Guidelines

When not to use

Do not read precise distances or angles from a force layout, and do not infer a causal direction from an undirected edge.

Configuration

Exported symbols
ExportKindSignature
GraphChart14 documented props({ nodes, links, groups, layout, format, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, }: GraphChartProps) => import("@types/react").JSX.Element

GraphChart props

Type: GraphChartProps

Values the compiler reads from the declaration.

GraphChart props
PropTypeDefaultNotes
ariaDescription?string | undefined—
ariaLabel?string | undefined—
className?string | undefined—
description?string | undefined—
format?ChartFormat | undefined—
groups?readonly string[] | undefined—
height?string | number | undefined—
layout?"force" | "circular" | undefined—
linksreadonly GraphLink[]—
nodesreadonly GraphNode[]—
onEvent?((event: EChartEvent) => void) | undefined—
onReady?((chart: EChartsInstance) => void) | undefined—
state?ChartState | undefined—
title?string | undefined—

Accessibility

A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.

What happens on the server, and when hydration changes it.

Family

Multidimensional, network & hierarchy

When the relationship, not the value, is the finding.

Luc UI v1.0GraphChartdark theme