BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/EvilCharts/echarts-sankey-chart

echarts-sankey-chart

evilcharts/echarts-sankey-chart
FreeComponent

Sankey chart component rendered with Apache ECharts

Install it

npx shadcn@latest add https://evilcharts.com/r/echarts-sankey-chart.json

Source

src/registry/charts/echarts-sankey-chart.tsxevilcharts.com/r/echarts-sankey-chart.json · first 6 KB
1"use client";
2
3import {
4 resolveTooltipPosition,
5 roundnessClass,
6 tooltipIndicatorHtml,
7 tooltipRow,
8 tooltipVariantClass,
9 type TooltipPosition,
10 type TooltipRoundness,
11 type TooltipVariant,
12} from "@/registry/ui/echarts-tooltip";
13import {
14 buildChartCss,
15 getColorsCount,
16 resolveColors,
17 withAlpha,
18 type ChartConfig,
19 type ResolvedColors,
20} from "@/registry/ui/echarts-chart";
21import {
22 Children,
23 isValidElement,
24 useCallback,
25 useEffect,
26 useId,
27 useMemo,
28 useRef,
29 useState,
30 type FC,
31 type ReactNode,
32} from "react";
33import { TooltipComponent, type TooltipComponentOption } from "echarts/components";
34import { SankeyChart, type SankeySeriesOption } from "echarts/charts";
35import { motion, useReducedMotion } from "motion/react";
36import { CanvasRenderer } from "echarts/renderers";
37import type { ComposeOption } from "echarts/core";
38import * as echarts from "echarts/core";
39
40// Re-export the shared types that were previously declared inline here, so
41// existing consumers/examples keep importing them from the chart module.
42export type { ChartConfig, TooltipPosition, TooltipRoundness, TooltipVariant };
43
44// Modular registration keeps the bundle lean — only the pieces this chart needs.
45// A sankey draws its own node/link geometry, so there is no grid, axis, or
46// dataZoom here; the tooltip is the one extra component. GraphicComponent is
47// deliberately NOT registered — this chart adds no raw graphic overlays.
48echarts.use([SankeyChart, TooltipComponent, CanvasRenderer]);
49
50type EChartsInstance = ReturnType<typeof echarts.init>;
51
52// The exact option surface this chart uses — a sankey series plus the tooltip.
53// Narrower than echarts' full EChartsOption, so a misspelled key fails the
54// compile instead of silently reaching setOption.
55type EChartsOption = ComposeOption<SankeySeriesOption | TooltipComponentOption>;
56
57// Single-item views of the composed series' node/link arrays — the modular entry
58// points don't export the sankey node/edge item option types directly, so derive
59// them from the composed series to keep the builders fully type-checked.
60type SankeyNodeItem = NonNullable<SankeySeriesOption["data"]>[number];
61type SankeyEdgeItem = NonNullable<SankeySeriesOption["links"]>[number];
62
63// ─────────────────────────────────────────────────────────────────────────────
64// Constants
65// … truncated

What it pulls in

npm packages

  • echarts
  • motion

Other registry items

  • @evilcharts/echarts-chart
  • @evilcharts/echarts-tooltip

Files it writes

  • src/registry/charts/echarts-sankey-chart.tsx

Facts

Registry
EvilCharts
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

evilcharts.com legions-developer/evilcharts on GitHub Raw registry item This item as JSON

More from EvilCharts

All 271 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
echarts-area-chartecharts-area-chartEvilChartsComponentsFree2 deps
echarts-bar-chartecharts-bar-chartEvilChartsComponentsFree2 deps
echarts-brushecharts-brushEvilChartsComponentsFree1 dep
echarts-chartecharts-chartEvilChartsComponentsFree1 dep
echarts-composed-chartecharts-composed-chartEvilChartsComponentsFree2 deps
echarts-dotecharts-dotEvilChartsComponentsFree1 dep
echarts-legendecharts-legendEvilChartsComponentsFreeno deps
echarts-line-chartecharts-line-chartEvilChartsComponentsFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex