Arc diagram
Names on a line, joined by arcs. Good for links between things that have an order.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'arc',
links: [
{ source: 'Search', target: 'Home', value: 35 },
{ source: 'Social', target: 'Home', value: 28 },
{ source: 'E-mail', target: 'Product', value: 17 },
{ source: 'Search', target: 'Product', value: 33 },
{ source: 'Home', target: 'Product', value: 14 },
{ source: 'Home', target: 'Exit', value: 14 },
{ source: 'Product', target: 'Basket', value: 40 },
{ source: 'Product', target: 'Exit', value: 36 },
{ source: 'Basket', target: 'Order', value: 19 },
{ source: 'Basket', target: 'Exit', value: 20 },
],
};
export default function Example() {
return <Chart spec={spec} style={{ height: 340 }} />;
}Or import this chart alone: what each import weighs.
Options
Beside the fields shared by every chart (title, format, heading, export…), type arc takes:
interface ArcSpec extends Base {
type: 'arc';
links: SankeyLink[];
colors?: Record<string, string>;
}
interface SankeyLink {
source: string;Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More