@wizeworks/silicaui-charts 0.55.0 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +61 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -11,6 +11,54 @@ function readVar(cs, name, fallback) {
|
|
|
11
11
|
const v = cs.getPropertyValue(name).trim();
|
|
12
12
|
return v || fallback;
|
|
13
13
|
}
|
|
14
|
+
var SERIES_COUNT = 6;
|
|
15
|
+
function parseOklch(value) {
|
|
16
|
+
const open = value.indexOf("(");
|
|
17
|
+
const close = value.lastIndexOf(")");
|
|
18
|
+
if (!value.trim().startsWith("oklch") || open < 0 || close < open) return null;
|
|
19
|
+
const parts = value.slice(open + 1, close).replace(/%/g, " ").split(/[\s,/]+/).filter(Boolean).map(Number);
|
|
20
|
+
const [L, C, h] = parts;
|
|
21
|
+
if (L === void 0 || C === void 0 || h === void 0) return null;
|
|
22
|
+
if (Number.isNaN(L) || Number.isNaN(C) || Number.isNaN(h)) return null;
|
|
23
|
+
return { L, C, h };
|
|
24
|
+
}
|
|
25
|
+
var RESERVED_ARC = 22;
|
|
26
|
+
function hueGap(a, b) {
|
|
27
|
+
const d = Math.abs((a % 360 + 360) % 360 - (b % 360 + 360) % 360);
|
|
28
|
+
return Math.min(d, 360 - d);
|
|
29
|
+
}
|
|
30
|
+
function spreadHues(startHue, reserved, count) {
|
|
31
|
+
const free = [];
|
|
32
|
+
for (let h = 0; h < 360; h++) {
|
|
33
|
+
if (reserved.every((r) => hueGap(h, r) > RESERVED_ARC)) free.push(h);
|
|
34
|
+
}
|
|
35
|
+
if (free.length < count) {
|
|
36
|
+
return Array.from({ length: count }, (_, i) => (startHue + i * 360 / count) % 360);
|
|
37
|
+
}
|
|
38
|
+
let from = 0;
|
|
39
|
+
let best = 999;
|
|
40
|
+
for (let i = 0; i < free.length; i++) {
|
|
41
|
+
const g = hueGap(free[i], startHue);
|
|
42
|
+
if (g < best) {
|
|
43
|
+
best = g;
|
|
44
|
+
from = i;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const stride = free.length / count;
|
|
48
|
+
return Array.from({ length: count }, (_, i) => free[(from + Math.round(i * stride)) % free.length]);
|
|
49
|
+
}
|
|
50
|
+
function categoricalPalette(primary, reservedHues) {
|
|
51
|
+
const base = parseOklch(primary);
|
|
52
|
+
if (!base) return null;
|
|
53
|
+
const L = Math.min(92, Math.max(38, base.L));
|
|
54
|
+
const C = Math.max(0.08, Math.min(0.2, base.C));
|
|
55
|
+
const hues = spreadHues(base.h, reservedHues, SERIES_COUNT);
|
|
56
|
+
return hues.map((h, i) => {
|
|
57
|
+
if (i === 0) return primary;
|
|
58
|
+
const l = Math.min(94, Math.max(34, L + (i % 2 === 0 ? -6 : 6)));
|
|
59
|
+
return `oklch(${Math.round(l * 10) / 10}% ${Math.round(C * 1e3) / 1e3} ${Math.round(h)})`;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
14
62
|
function buildSilicaEChartsTheme(el) {
|
|
15
63
|
const root = el ?? (typeof document !== "undefined" ? document.documentElement : null);
|
|
16
64
|
if (!root || typeof getComputedStyle === "undefined") {
|
|
@@ -20,15 +68,10 @@ function buildSilicaEChartsTheme(el) {
|
|
|
20
68
|
const base100 = readVar(cs, "--color-base-100", "#ffffff");
|
|
21
69
|
const base300 = readVar(cs, "--color-base-300", "#e5e7eb");
|
|
22
70
|
const content = readVar(cs, "--color-base-content", "#1f2937");
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"--color-info",
|
|
28
|
-
"--color-success",
|
|
29
|
-
"--color-warning",
|
|
30
|
-
"--color-error"
|
|
31
|
-
].map((n) => readVar(cs, n, "")).filter(Boolean);
|
|
71
|
+
const primary = readVar(cs, "--color-primary", "");
|
|
72
|
+
const reservedHues = ["--color-success", "--color-warning", "--color-error"].map((n) => parseOklch(readVar(cs, n, ""))).filter((c) => c !== null).map((c) => c.h);
|
|
73
|
+
const palette = categoricalPalette(primary, reservedHues) ?? // Fallback, for a theme whose primary is not an `oklch()` value.
|
|
74
|
+
["--color-primary", "--color-secondary", "--color-accent", "--color-info", "--color-success", "--color-warning", "--color-error"].map((n) => readVar(cs, n, "")).filter(Boolean);
|
|
32
75
|
const faint = (pct) => `color-mix(in oklab, ${content} ${pct}%, transparent)`;
|
|
33
76
|
const label = faint(70);
|
|
34
77
|
const axisLine = faint(22);
|
|
@@ -51,6 +94,15 @@ function buildSilicaEChartsTheme(el) {
|
|
|
51
94
|
borderColor: base300,
|
|
52
95
|
borderWidth: 1,
|
|
53
96
|
textStyle: { color: content },
|
|
97
|
+
// Keep the tooltip inside the chart's own box.
|
|
98
|
+
//
|
|
99
|
+
// ECharts places it beside the cursor and lets it run off the edge. On a
|
|
100
|
+
// 278px-wide chart on a phone that clipped the SERIES NAMES off the left --
|
|
101
|
+
// "Kaiho Line" read as "o Line", "Pacific Bridge" as "c Bridge" -- which is
|
|
102
|
+
// the one thing the tooltip exists to say. Measured on a 360px screen
|
|
103
|
+
// (P07 act 9). A tooltip that leaves its container is never what anyone
|
|
104
|
+
// wanted, so this is a default rather than an option.
|
|
105
|
+
confine: true,
|
|
54
106
|
axisPointer: {
|
|
55
107
|
lineStyle: { color: axisLine },
|
|
56
108
|
crossStyle: { color: axisLine },
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme.ts","../src/chart.tsx","../src/sparkline.tsx"],"names":["Chart","React2","Sparkline","jsx"],"mappings":";;;;;;;;AAcA,SAAS,OAAA,CAAQ,EAAA,EAAyB,IAAA,EAAc,QAAA,EAA0B;AAChF,EAAA,MAAM,CAAA,GAAI,EAAA,CAAG,gBAAA,CAAiB,IAAI,EAAE,IAAA,EAAK;AACzC,EAAA,OAAO,CAAA,IAAK,QAAA;AACd;AAMO,SAAS,wBACd,EAAA,EACyB;AACzB,EAAA,MAAM,OAC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AAA,EAAU,MAAA,EAAgB,KAAA,EAAO,EAAE,MAAA,EAAQ,MAAA,EAAQ,GAAG,KAAA,EAAM,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAEpF;AACF","file":"index.js","sourcesContent":["/**\n * Builds an Apache ECharts theme from the live Silica design tokens.\n *\n * ECharts bakes its theme in at `init()` time and reads plain color strings, not\n * CSS variables — so we resolve the current `--color-*` custom properties off a\n * live element with `getComputedStyle` and hand ECharts concrete values. Because\n * we read from a real element, a prefixed / nested-theme subtree (a client site\n * embedded in the platform shell) yields that subtree's palette, and the\n * `<Chart>` wrapper re-runs this whenever the ambient theme flips light↔dark.\n *\n * The resolved values may be `oklch(…)` / `color-mix(…)` strings; modern canvas\n * and SVG renderers accept those directly.\n */\n\nfunction readVar(cs: CSSStyleDeclaration, name: string, fallback: string): string {\n const v = cs.getPropertyValue(name).trim();\n return v || fallback;\n}\n\n/**\n * @param el - element to read tokens from; defaults to `document.documentElement`.\n * @returns an ECharts theme object (safe to pass to `echarts.registerTheme`).\n */\nexport function buildSilicaEChartsTheme(\n el?: HTMLElement | null,\n): Record<string, unknown> {\n const root =\n el ?? (typeof document !== \"undefined\" ? document.documentElement : null);\n\n // No DOM (SSR): a neutral, transparent theme so nothing crashes.\n if (!root || typeof getComputedStyle === \"undefined\") {\n return { backgroundColor: \"transparent\" };\n }\n\n const cs = getComputedStyle(root);\n const base100 = readVar(cs, \"--color-base-100\", \"#ffffff\");\n const base300 = readVar(cs, \"--color-base-300\", \"#e5e7eb\");\n const content = readVar(cs, \"--color-base-content\", \"#1f2937\");\n\n const palette = [\n \"--color-primary\",\n \"--color-secondary\",\n \"--color-accent\",\n \"--color-info\",\n \"--color-success\",\n \"--color-warning\",\n \"--color-error\",\n ]\n .map((n) => readVar(cs, n, \"\"))\n .filter(Boolean);\n\n // Translucent washes of the text color for axes/gridlines — oklab, never oklch\n // (oklch rotates hue toward 0° when mixing with transparent → tinted grey).\n const faint = (pct: number) =>\n `color-mix(in oklab, ${content} ${pct}%, transparent)`;\n const label = faint(70);\n const axisLine = faint(22);\n const splitLine = faint(9);\n\n const axis = {\n axisLine: { show: true, lineStyle: { color: axisLine } },\n axisTick: { show: true, lineStyle: { color: axisLine } },\n axisLabel: { color: label },\n splitLine: { show: true, lineStyle: { color: splitLine } },\n splitArea: { show: false },\n };\n\n return {\n color: palette.length ? palette : undefined,\n backgroundColor: \"transparent\",\n textStyle: { color: content },\n title: { textStyle: { color: content }, subtextStyle: { color: label } },\n legend: { textStyle: { color: label } },\n tooltip: {\n backgroundColor: base100,\n borderColor: base300,\n borderWidth: 1,\n textStyle: { color: content },\n axisPointer: {\n lineStyle: { color: axisLine },\n crossStyle: { color: axisLine },\n shadowStyle: { color: faint(6) },\n },\n },\n grid: { borderColor: base300, containLabel: true },\n categoryAxis: axis,\n valueAxis: axis,\n logAxis: axis,\n timeAxis: axis,\n line: {\n symbol: \"circle\",\n symbolSize: 7,\n lineStyle: { width: 2 },\n smooth: false,\n },\n bar: { itemStyle: { borderRadius: [4, 4, 0, 0] } },\n pie: {\n itemStyle: { borderColor: base100, borderWidth: 2 },\n label: { color: content },\n },\n scatter: { symbolSize: 10 },\n };\n}\n","import * as React from \"react\";\nimport * as echarts from \"echarts\";\nimport type { EChartsOption } from \"echarts\";\nimport { cx, useSilicaClass } from \"@wizeworks/silicaui-react\";\nimport { buildSilicaEChartsTheme } from \"./theme\";\n\n/** The live ECharts instance type (whatever `echarts.init` returns). */\nexport type EChartsInstance = ReturnType<typeof echarts.init>;\n\nexport interface ChartProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onClick\"> {\n /** The ECharts option (series, axes, tooltip, legend, …) — full ECharts API. */\n option: EChartsOption;\n /** Replace the whole option instead of merging on update. Default `true`. */\n notMerge?: boolean;\n /** Toggle ECharts' built-in loading spinner. */\n loading?: boolean;\n /** Renderer backend. Default `\"canvas\"`. */\n renderer?: \"canvas\" | \"svg\";\n /** Called with the instance right after it's created (and after each re-init). */\n onInit?: (chart: EChartsInstance) => void;\n}\n\n/**\n * A thin, fully-featured wrapper over Apache ECharts that auto-themes to the\n * active Silica tokens.\n *\n * ECharts owns all rendering; Silica supplies the palette. The chart re-reads\n * the tokens (and re-inits, since ECharts themes are fixed at `init`) whenever\n * the ambient theme changes — a `data-theme` flip on `<html>` or an OS\n * light/dark switch — so charts track the rest of the UI automatically. It also\n * resizes with its container via a `ResizeObserver`.\n *\n * Give the container a height (defaults to 20rem); ECharts cannot measure a\n * zero-height box.\n */\nexport const Chart = React.forwardRef<HTMLDivElement, ChartProps>(function Chart(\n {\n option,\n notMerge = true,\n loading = false,\n renderer = \"canvas\",\n onInit,\n className,\n style,\n ...rest\n },\n forwardedRef,\n) {\n const sc = useSilicaClass();\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const chartRef = React.useRef<EChartsInstance | null>(null);\n const onInitRef = React.useRef(onInit);\n onInitRef.current = onInit;\n\n // A DOM-safe, stable theme name unique to this instance so concurrent charts\n // don't clobber one another's registered theme.\n const themeName = `silica-${React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n\n // Bumped whenever the ambient Silica theme changes → forces a re-init below.\n const [themeTick, setThemeTick] = React.useState(0);\n\n const setRefs = React.useCallback(\n (node: HTMLDivElement | null) => {\n containerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n // Watch for theme changes: attribute flips on <html> + OS scheme changes.\n React.useEffect(() => {\n if (typeof window === \"undefined\") return;\n const bump = () => setThemeTick((t) => t + 1);\n const html = document.documentElement;\n const mo = new MutationObserver(bump);\n mo.observe(html, {\n attributes: true,\n attributeFilter: [\"data-theme\", \"class\", \"style\"],\n });\n const mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n mq.addEventListener(\"change\", bump);\n return () => {\n mo.disconnect();\n mq.removeEventListener(\"change\", bump);\n };\n }, []);\n\n // Create / recreate the chart instance (re-runs on theme change).\n React.useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n echarts.registerTheme(themeName, buildSilicaEChartsTheme(el));\n const chart = echarts.init(el, themeName, { renderer });\n chartRef.current = chart;\n onInitRef.current?.(chart);\n const ro = new ResizeObserver(() => chart.resize());\n ro.observe(el);\n return () => {\n ro.disconnect();\n chart.dispose();\n chartRef.current = null;\n };\n }, [themeName, renderer, themeTick]);\n\n // Push option updates.\n React.useEffect(() => {\n chartRef.current?.setOption(option, notMerge);\n }, [option, notMerge, themeTick]);\n\n // Loading overlay.\n React.useEffect(() => {\n const chart = chartRef.current;\n if (!chart) return;\n if (loading) chart.showLoading();\n else chart.hideLoading();\n }, [loading, themeTick]);\n\n return (\n <div\n ref={setRefs}\n className={cx(sc(\"chart\"), className)}\n style={{ width: \"100%\", height: \"20rem\", ...style }}\n {...rest}\n />\n );\n});\n","import * as React from \"react\";\nimport type { EChartsOption } from \"echarts\";\nimport { Chart } from \"./chart\";\nimport type { ChartProps } from \"./chart\";\n\nexport interface SparklineProps extends Omit<ChartProps, \"option\"> {\n /** The series values. */\n data: number[];\n /** `\"line\"` (default) or `\"bar\"`. */\n type?: \"line\" | \"bar\";\n /** Fill under a line sparkline. */\n area?: boolean;\n /** Series color. Defaults to the Silica primary via the theme palette. */\n color?: string;\n /** Show a tooltip on hover. Default `false` — sparklines are glanceable. */\n tooltip?: boolean;\n /** Optional category labels (used only in the tooltip). */\n labels?: (string | number)[];\n}\n\n/**\n * A compact, axis-less trend line/bar for inline metrics (KPI cards, table\n * cells). It builds the ECharts option for you and renders through {@link Chart},\n * so it inherits Silica theming and container-resize behavior.\n */\nexport const Sparkline = React.forwardRef<HTMLDivElement, SparklineProps>(\n function Sparkline(\n { data, type = \"line\", area = false, color, tooltip = false, labels, style, ...rest },\n ref,\n ) {\n const option = React.useMemo<EChartsOption>(\n () => ({\n grid: { left: 1, right: 1, top: 3, bottom: 3 },\n xAxis: {\n type: \"category\",\n show: false,\n boundaryGap: type === \"bar\",\n data: labels ?? data.map((_, i) => i),\n },\n yAxis: { type: \"value\", show: false, scale: true },\n tooltip: tooltip\n ? { trigger: \"axis\", axisPointer: { type: \"line\" } }\n : undefined,\n series: [\n {\n type,\n data,\n symbol: \"none\",\n smooth: type === \"line\",\n lineStyle: { width: 2 },\n areaStyle: area && type === \"line\" ? { opacity: 0.18 } : undefined,\n itemStyle: color ? { color } : undefined,\n barCategoryGap: type === \"bar\" ? \"30%\" : undefined,\n } as never,\n ],\n }),\n [data, type, area, color, tooltip, labels],\n );\n\n return (\n <Chart ref={ref} option={option} style={{ height: \"3rem\", ...style }} {...rest} />\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme.ts","../src/chart.tsx","../src/sparkline.tsx"],"names":["Chart","React2","Sparkline","jsx"],"mappings":";;;;;;;;AAcA,SAAS,OAAA,CAAQ,EAAA,EAAyB,IAAA,EAAc,QAAA,EAA0B;AAChF,EAAA,MAAM,CAAA,GAAI,EAAA,CAAG,gBAAA,CAAiB,IAAI,EAAE,IAAA,EAAK;AACzC,EAAA,OAAO,CAAA,IAAK,QAAA;AACd;AA6CA,IAAM,YAAA,GAAe,CAAA;AAErB,SAAS,WAAW,KAAA,EAA2D;AAC7E,EAAA,MAAM,IAAA,GAAO,KAAA,CAAM,OAAA,CAAQ,GAAG,CAAA;AAC9B,EAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,WAAA,CAAY,GAAG,CAAA;AACnC,EAAA,IAAI,CAAC,KAAA,CAAM,IAAA,EAAK,CAAE,UAAA,CAAW,OAAO,CAAA,IAAK,IAAA,GAAO,CAAA,IAAK,KAAA,GAAQ,IAAA,EAAM,OAAO,IAAA;AAC1E,EAAA,MAAM,QAAQ,KAAA,CACX,KAAA,CAAM,OAAO,CAAA,EAAG,KAAK,EACrB,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAA,CACjB,MAAM,SAAS,CAAA,CACf,OAAO,OAAO,CAAA,CACd,IAAI,MAAM,CAAA;AACb,EAAA,MAAM,CAAC,CAA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ACL,IAAA,EAAM,UAAA;AAAA,UACN,IAAA,EAAM,KAAA;AAAA,UACN,aAAa,IAAA,KAAS,KAAA;AAAA,UACtB,MAAM,MAAA,IAAU,IAAA,CAAK,IAAI,CAAC,CAAA,EAAG,MAAM,CAAC;AAAA,SACtC;AAAA,QACA,OAAO,EAAE,IAAA,EAAM,SAAS,IAAA,EAAM,KAAA,EAAO,OAAO,IAAA,EAAK;AAAA,QACjD,OAAA,EAAS,OAAA,GACL,EAAE,OAAA,EAAS,MAAA,EAAQ,aAAa,EAAE,IAAA,EAAM,MAAA,EAAO,EAAE,GACjD,MAAA;AAAA,QACJ,MAAA,EAAQ;AAAA,UACN;AAAA,YACE,IAAA;AAAA,YACA,IAAA;AAAA,YACA,MAAA,EAAQ,MAAA;AAAA,YACR,QAAQ,IAAA,KAAS,MAAA;AAAA,YACjB,SAAA,EAAW,EAAE,KAAA,EAAO,CAAA,EAAE;AAAA,YACtB,WAAW,IAAA,IAAQ,IAAA,KAAS,SAAS,EAAE,OAAA,EAAS,MAAK,GAAI,MAAA;AAAA,YACzD,SAAA,EAAW,KAAA,GAAQ,EAAE,KAAA,EAAM,GAAI,MAAA;AAAA,YAC/B,cAAA,EAAgB,IAAA,KAAS,KAAA,GAAQ,KAAA,GAAQ;AAAA;AAC3C;AACF,OACF,CAAA;AAAA,MACA,CAAC,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,KAAA,EAAO,SAAS,MAAM;AAAA,KAC3C;AAEA,IAAA,uBACEE,GAAAA,CAAC,KAAA,EAAA,EAAM,GAAA,EAAU,MAAA,EAAgB,KAAA,EAAO,EAAE,MAAA,EAAQ,MAAA,EAAQ,GAAG,KAAA,EAAM,EAAI,GAAG,IAAA,EAAM,CAAA;AAAA,EAEpF;AACF","file":"index.js","sourcesContent":["/**\n * Builds an Apache ECharts theme from the live Silica design tokens.\n *\n * ECharts bakes its theme in at `init()` time and reads plain color strings, not\n * CSS variables — so we resolve the current `--color-*` custom properties off a\n * live element with `getComputedStyle` and hand ECharts concrete values. Because\n * we read from a real element, a prefixed / nested-theme subtree (a client site\n * embedded in the platform shell) yields that subtree's palette, and the\n * `<Chart>` wrapper re-runs this whenever the ambient theme flips light↔dark.\n *\n * The resolved values may be `oklch(…)` / `color-mix(…)` strings; modern canvas\n * and SVG renderers accept those directly.\n */\n\nfunction readVar(cs: CSSStyleDeclaration, name: string, fallback: string): string {\n const v = cs.getPropertyValue(name).trim();\n return v || fallback;\n}\n\n/**\n * A CATEGORICAL series palette: N colours a person can tell apart.\n *\n * NOT the semantic roles, which is what this used to be\n * (`primary, secondary, accent, info, success, warning, error`). Two reasons,\n * both found by measuring a real four-line chart — see\n * docs/personas/issues/087.\n *\n * **The roles mean things.** `success` is green because something is good and\n * `error` is red because something is wrong. Handing them to series 5 and 7\n * tells an operations room that the fifth shipping line is fine and the seventh\n * is in trouble — a sentence nobody wrote and nobody can unsee.\n *\n * **And the roles do not spread.** A theme that declares one brand colour has\n * its `secondary`/`accent`/`info` derived from that colour, so four series came\n * out inside a 44-degree arc of a 360-degree wheel, two of them 13 degrees\n * apart. On a wall screen at the end of a dark room that is the same colour\n * twice.\n *\n * So the palette is built instead of borrowed: anchor on the theme's own\n * `primary` — series one still looks like the brand — and walk the hue wheel\n * from there, nudging lightness alternately so neighbours differ in more than\n * hue alone (which is what a person with a colour-vision deficiency reads).\n *\n * A theme whose `primary` is not an `oklch()` value falls back to the old role\n * list, because guessing a hue out of `color-mix()` or a named colour would be\n * worse than a palette that is merely narrow.\n */\n/**\n * Six, not eight.\n *\n * Once `success`, `warning` and `error` are off limits (see `RESERVED_ARC`),\n * about 228 of the 360 degrees are left. Eight series across 228 degrees is 28\n * degrees apart -- measurably distinguishable, but only three degrees above the\n * bar, which is no margin at all for a theme whose brand colour sits somewhere\n * else. Six is 38 degrees apart.\n *\n * The seventh series repeats the first, and that is the better failure: a\n * repeated colour is obviously wrong, while two series 28 degrees apart are\n * quietly confusable, which is the exact defect this palette was built to fix\n * (issue 087). A chart with seven categories needs a different design, not a\n * seventh colour.\n */\nconst SERIES_COUNT = 6;\n\nfunction parseOklch(value: string): { L: number; C: number; h: number } | null {\n const open = value.indexOf(\"(\");\n const close = value.lastIndexOf(\")\");\n if (!value.trim().startsWith(\"oklch\") || open < 0 || close < open) return null;\n const parts = value\n .slice(open + 1, close)\n .replace(/%/g, \" \")\n .split(/[\\s,/]+/)\n .filter(Boolean)\n .map(Number);\n const [L, C, h] = parts;\n if (L === undefined || C === undefined || h === undefined) return null;\n if (Number.isNaN(L) || Number.isNaN(C) || Number.isNaN(h)) return null;\n return { L, C, h };\n}\n\n/**\n * How wide a berth to give `success`, `warning` and `error`, in degrees either\n * side of each.\n *\n * A categorical series is a NAME, not a judgement. Walking the whole hue wheel\n * for eight distinguishable colours necessarily walks through the reds and the\n * ambers, and a shipping line painted two degrees from the theme's own \"this is\n * critical\" red is saying something nobody wrote. Found on the Kaiho dashboard,\n * where colour is supposed to mean exactly one thing: how late a ship is.\n * (P07, docs/personas/issues/094.)\n */\nconst RESERVED_ARC = 22;\n\n/** Shortest distance between two hue angles, in degrees. */\nfunction hueGap(a: number, b: number): number {\n const d = Math.abs(((a % 360) + 360) % 360 - (((b % 360) + 360) % 360));\n return Math.min(d, 360 - d);\n}\n\n/**\n * Hue angles for the series, evenly spread over the part of the wheel that is\n * not already spoken for.\n *\n * The reserved hues come from the THEME, not from a constant: a theme is free to\n * make its `error` orange, and then orange is what has to be avoided.\n */\nfunction spreadHues(startHue: number, reserved: number[], count: number): number[] {\n const free: number[] = [];\n for (let h = 0; h < 360; h++) {\n if (reserved.every((r) => hueGap(h, r) > RESERVED_ARC)) free.push(h);\n }\n // Every hue reserved (a theme with roles all over the wheel): fall back to an\n // even spread rather than returning nothing.\n if (free.length < count) {\n return Array.from({ length: count }, (_, i) => (startHue + (i * 360) / count) % 360);\n }\n // Start walking from wherever the brand colour sits, so series two follows\n // series one round the wheel rather than jumping to an arbitrary origin.\n let from = 0;\n let best = 999;\n for (let i = 0; i < free.length; i++) {\n const g = hueGap(free[i]!, startHue);\n if (g < best) {\n best = g;\n from = i;\n }\n }\n const stride = free.length / count;\n return Array.from({ length: count }, (_, i) => free[(from + Math.round(i * stride)) % free.length]!);\n}\n\nfunction categoricalPalette(primary: string, reservedHues: number[]): string[] | null {\n const base = parseOklch(primary);\n if (!base) return null;\n // Keep the theme's own weight: a dark theme's primary is light and a light\n // theme's is dark, and the series have to sit on that theme's surface.\n const L = Math.min(92, Math.max(38, base.L));\n const C = Math.max(0.08, Math.min(0.2, base.C));\n const hues = spreadHues(base.h, reservedHues, SERIES_COUNT);\n return hues.map((h, i) => {\n if (i === 0) return primary;\n // Alternate the lightness a little, so adjacent series differ on a second\n // axis as well as hue.\n const l = Math.min(94, Math.max(34, L + (i % 2 === 0 ? -6 : 6)));\n return `oklch(${Math.round(l * 10) / 10}% ${Math.round(C * 1000) / 1000} ${Math.round(h)})`;\n });\n}\n\n/**\n * @param el - element to read tokens from; defaults to `document.documentElement`.\n * @returns an ECharts theme object (safe to pass to `echarts.registerTheme`).\n */\nexport function buildSilicaEChartsTheme(\n el?: HTMLElement | null,\n): Record<string, unknown> {\n const root =\n el ?? (typeof document !== \"undefined\" ? document.documentElement : null);\n\n // No DOM (SSR): a neutral, transparent theme so nothing crashes.\n if (!root || typeof getComputedStyle === \"undefined\") {\n return { backgroundColor: \"transparent\" };\n }\n\n const cs = getComputedStyle(root);\n const base100 = readVar(cs, \"--color-base-100\", \"#ffffff\");\n const base300 = readVar(cs, \"--color-base-300\", \"#e5e7eb\");\n const content = readVar(cs, \"--color-base-content\", \"#1f2937\");\n\n const primary = readVar(cs, \"--color-primary\", \"\");\n // What colour already MEANS in this theme, so the series can stay off it.\n const reservedHues = [\"--color-success\", \"--color-warning\", \"--color-error\"]\n .map((n) => parseOklch(readVar(cs, n, \"\")))\n .filter((c): c is { L: number; C: number; h: number } => c !== null)\n .map((c) => c.h);\n const palette =\n categoricalPalette(primary, reservedHues) ??\n // Fallback, for a theme whose primary is not an `oklch()` value.\n [\"--color-primary\", \"--color-secondary\", \"--color-accent\", \"--color-info\", \"--color-success\", \"--color-warning\", \"--color-error\"]\n .map((n) => readVar(cs, n, \"\"))\n .filter(Boolean);\n\n // Translucent washes of the text color for axes/gridlines — oklab, never oklch\n // (oklch rotates hue toward 0° when mixing with transparent → tinted grey).\n const faint = (pct: number) =>\n `color-mix(in oklab, ${content} ${pct}%, transparent)`;\n const label = faint(70);\n const axisLine = faint(22);\n const splitLine = faint(9);\n\n const axis = {\n axisLine: { show: true, lineStyle: { color: axisLine } },\n axisTick: { show: true, lineStyle: { color: axisLine } },\n axisLabel: { color: label },\n splitLine: { show: true, lineStyle: { color: splitLine } },\n splitArea: { show: false },\n };\n\n return {\n color: palette.length ? palette : undefined,\n backgroundColor: \"transparent\",\n textStyle: { color: content },\n title: { textStyle: { color: content }, subtextStyle: { color: label } },\n legend: { textStyle: { color: label } },\n tooltip: {\n backgroundColor: base100,\n borderColor: base300,\n borderWidth: 1,\n textStyle: { color: content },\n // Keep the tooltip inside the chart's own box.\n //\n // ECharts places it beside the cursor and lets it run off the edge. On a\n // 278px-wide chart on a phone that clipped the SERIES NAMES off the left --\n // \"Kaiho Line\" read as \"o Line\", \"Pacific Bridge\" as \"c Bridge\" -- which is\n // the one thing the tooltip exists to say. Measured on a 360px screen\n // (P07 act 9). A tooltip that leaves its container is never what anyone\n // wanted, so this is a default rather than an option.\n confine: true,\n axisPointer: {\n lineStyle: { color: axisLine },\n crossStyle: { color: axisLine },\n shadowStyle: { color: faint(6) },\n },\n },\n grid: { borderColor: base300, containLabel: true },\n categoryAxis: axis,\n valueAxis: axis,\n logAxis: axis,\n timeAxis: axis,\n line: {\n symbol: \"circle\",\n symbolSize: 7,\n lineStyle: { width: 2 },\n smooth: false,\n },\n bar: { itemStyle: { borderRadius: [4, 4, 0, 0] } },\n pie: {\n itemStyle: { borderColor: base100, borderWidth: 2 },\n label: { color: content },\n },\n scatter: { symbolSize: 10 },\n };\n}\n","import * as React from \"react\";\nimport * as echarts from \"echarts\";\nimport type { EChartsOption } from \"echarts\";\nimport { cx, useSilicaClass } from \"@wizeworks/silicaui-react\";\nimport { buildSilicaEChartsTheme } from \"./theme\";\n\n/** The live ECharts instance type (whatever `echarts.init` returns). */\nexport type EChartsInstance = ReturnType<typeof echarts.init>;\n\nexport interface ChartProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onClick\"> {\n /** The ECharts option (series, axes, tooltip, legend, …) — full ECharts API. */\n option: EChartsOption;\n /** Replace the whole option instead of merging on update. Default `true`. */\n notMerge?: boolean;\n /** Toggle ECharts' built-in loading spinner. */\n loading?: boolean;\n /** Renderer backend. Default `\"canvas\"`. */\n renderer?: \"canvas\" | \"svg\";\n /** Called with the instance right after it's created (and after each re-init). */\n onInit?: (chart: EChartsInstance) => void;\n}\n\n/**\n * A thin, fully-featured wrapper over Apache ECharts that auto-themes to the\n * active Silica tokens.\n *\n * ECharts owns all rendering; Silica supplies the palette. The chart re-reads\n * the tokens (and re-inits, since ECharts themes are fixed at `init`) whenever\n * the ambient theme changes — a `data-theme` flip on `<html>` or an OS\n * light/dark switch — so charts track the rest of the UI automatically. It also\n * resizes with its container via a `ResizeObserver`.\n *\n * Give the container a height (defaults to 20rem); ECharts cannot measure a\n * zero-height box.\n */\nexport const Chart = React.forwardRef<HTMLDivElement, ChartProps>(function Chart(\n {\n option,\n notMerge = true,\n loading = false,\n renderer = \"canvas\",\n onInit,\n className,\n style,\n ...rest\n },\n forwardedRef,\n) {\n const sc = useSilicaClass();\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const chartRef = React.useRef<EChartsInstance | null>(null);\n const onInitRef = React.useRef(onInit);\n onInitRef.current = onInit;\n\n // A DOM-safe, stable theme name unique to this instance so concurrent charts\n // don't clobber one another's registered theme.\n const themeName = `silica-${React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n\n // Bumped whenever the ambient Silica theme changes → forces a re-init below.\n const [themeTick, setThemeTick] = React.useState(0);\n\n const setRefs = React.useCallback(\n (node: HTMLDivElement | null) => {\n containerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n // Watch for theme changes: attribute flips on <html> + OS scheme changes.\n React.useEffect(() => {\n if (typeof window === \"undefined\") return;\n const bump = () => setThemeTick((t) => t + 1);\n const html = document.documentElement;\n const mo = new MutationObserver(bump);\n mo.observe(html, {\n attributes: true,\n attributeFilter: [\"data-theme\", \"class\", \"style\"],\n });\n const mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n mq.addEventListener(\"change\", bump);\n return () => {\n mo.disconnect();\n mq.removeEventListener(\"change\", bump);\n };\n }, []);\n\n // Create / recreate the chart instance (re-runs on theme change).\n React.useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n echarts.registerTheme(themeName, buildSilicaEChartsTheme(el));\n const chart = echarts.init(el, themeName, { renderer });\n chartRef.current = chart;\n onInitRef.current?.(chart);\n const ro = new ResizeObserver(() => chart.resize());\n ro.observe(el);\n return () => {\n ro.disconnect();\n chart.dispose();\n chartRef.current = null;\n };\n }, [themeName, renderer, themeTick]);\n\n // Push option updates.\n React.useEffect(() => {\n chartRef.current?.setOption(option, notMerge);\n }, [option, notMerge, themeTick]);\n\n // Loading overlay.\n React.useEffect(() => {\n const chart = chartRef.current;\n if (!chart) return;\n if (loading) chart.showLoading();\n else chart.hideLoading();\n }, [loading, themeTick]);\n\n return (\n <div\n ref={setRefs}\n className={cx(sc(\"chart\"), className)}\n style={{ width: \"100%\", height: \"20rem\", ...style }}\n {...rest}\n />\n );\n});\n","import * as React from \"react\";\nimport type { EChartsOption } from \"echarts\";\nimport { Chart } from \"./chart\";\nimport type { ChartProps } from \"./chart\";\n\nexport interface SparklineProps extends Omit<ChartProps, \"option\"> {\n /** The series values. */\n data: number[];\n /** `\"line\"` (default) or `\"bar\"`. */\n type?: \"line\" | \"bar\";\n /** Fill under a line sparkline. */\n area?: boolean;\n /** Series color. Defaults to the Silica primary via the theme palette. */\n color?: string;\n /** Show a tooltip on hover. Default `false` — sparklines are glanceable. */\n tooltip?: boolean;\n /** Optional category labels (used only in the tooltip). */\n labels?: (string | number)[];\n}\n\n/**\n * A compact, axis-less trend line/bar for inline metrics (KPI cards, table\n * cells). It builds the ECharts option for you and renders through {@link Chart},\n * so it inherits Silica theming and container-resize behavior.\n */\nexport const Sparkline = React.forwardRef<HTMLDivElement, SparklineProps>(\n function Sparkline(\n { data, type = \"line\", area = false, color, tooltip = false, labels, style, ...rest },\n ref,\n ) {\n const option = React.useMemo<EChartsOption>(\n () => ({\n grid: { left: 1, right: 1, top: 3, bottom: 3 },\n xAxis: {\n type: \"category\",\n show: false,\n boundaryGap: type === \"bar\",\n data: labels ?? data.map((_, i) => i),\n },\n yAxis: { type: \"value\", show: false, scale: true },\n tooltip: tooltip\n ? { trigger: \"axis\", axisPointer: { type: \"line\" } }\n : undefined,\n series: [\n {\n type,\n data,\n symbol: \"none\",\n smooth: type === \"line\",\n lineStyle: { width: 2 },\n areaStyle: area && type === \"line\" ? { opacity: 0.18 } : undefined,\n itemStyle: color ? { color } : undefined,\n barCategoryGap: type === \"bar\" ? \"30%\" : undefined,\n } as never,\n ],\n }),\n [data, type, area, color, tooltip, labels],\n );\n\n return (\n <Chart ref={ref} option={option} style={{ height: \"3rem\", ...style }} {...rest} />\n );\n },\n);\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wizeworks/silicaui-charts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Silica UI charts — Apache ECharts wrapped and auto-themed to Silica's design tokens.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-dom": "^19.0.0",
|
|
40
40
|
"tsup": "^8.3.0",
|
|
41
41
|
"typescript": "^5.6.0",
|
|
42
|
-
"@wizeworks/silicaui-react": "0.
|
|
42
|
+
"@wizeworks/silicaui-react": "0.57.0"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"react",
|