Chord Diagram

A beautiful circular chart representing flows between categories. Supports directed and undirected modes.

Example

Relationship Flow

Visualize complex relational data and migration flows with elegant ribbons and circular transitions.

BlackberryAppleHTCSamsung
Blackberry
Apple
HTC
Samsung
classic MODE

Installation

./components/charts/ChordDiagram.tsx

Key Features

Directed Support

Toggle between standard and directed modes. Directed mode uses d3.chordDirected and ribbonArrow for asymmetrical flows.

Premium Gradients

Ribbons use color gradients transitions between source and target, making it easy to trace flows.

Seamless Transitions

Built with useD3GroupTransition for smooth, animated updates when switching between modes or updating data.

Data Format

ChordData interface
export interface ChordRibbon {
  label: string; // Target label
  sourceValue: number; // Flow from source to target
  targetValue: number; // Flow from target back to source
  color?: string; // Optional custom color
}

export interface ChordSeries extends Omit<SeriesBase, "color"> {
  color?: string;
  ribbons: ChordRibbon[];
}

export type ChordData = ChordSeries[];

Components Reference

  • ChordDiagram.Container – Sets up the chord layout and scale.
    Prop: directed?: boolean, width?: number, height?: number
  • ChordDiagram.Groups – Renders the circular arcs for each category. Supports tooltips.
  • ChordDiagram.Ribbons – Renders the connection paths in the center. Supports tooltips and automated gradients.
  • ChordDiagram.Legend – Displays the names and colors.