@krizaka/charts 0.6.1 → 0.6.2
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/native.js +6 -0
- package/dist/native.js.map +1 -1
- package/package.json +6 -6
- package/registry/index.json +1 -1
package/dist/native.js
CHANGED
|
@@ -462,10 +462,13 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
462
462
|
"borderSubtle": "rgba(231,240,230,0.07)",
|
|
463
463
|
"borderDefault": "rgba(231,240,230,0.12)",
|
|
464
464
|
"borderStrong": "rgba(231,240,230,0.2)",
|
|
465
|
+
"borderControl": "rgba(231,240,230,0.2)",
|
|
466
|
+
"borderHover": "rgba(231,240,230,0.2)",
|
|
465
467
|
"textPrimary": "#ecf0ea",
|
|
466
468
|
"textSecondary": "#bcc8c0",
|
|
467
469
|
"textMuted": "#a7b4ab",
|
|
468
470
|
"textOnMedia": "#ffffff",
|
|
471
|
+
"textTitle": "#ecf0ea",
|
|
469
472
|
"accent": "#3e76a8",
|
|
470
473
|
"accentHover": "#346793",
|
|
471
474
|
"accentSoft": "rgba(62,118,168,0.12)",
|
|
@@ -512,10 +515,13 @@ var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze
|
|
|
512
515
|
"borderSubtle": "rgba(31,59,91,0.1)",
|
|
513
516
|
"borderDefault": "rgba(31,59,91,0.17)",
|
|
514
517
|
"borderStrong": "rgba(31,59,91,0.28)",
|
|
518
|
+
"borderControl": "rgba(31,59,91,0.28)",
|
|
519
|
+
"borderHover": "rgba(31,59,91,0.28)",
|
|
515
520
|
"textPrimary": "#1d3654",
|
|
516
521
|
"textSecondary": "#405064",
|
|
517
522
|
"textMuted": "#4f5b69",
|
|
518
523
|
"textOnMedia": "#ffffff",
|
|
524
|
+
"textTitle": "#1d3654",
|
|
519
525
|
"accent": "#2a5f8d",
|
|
520
526
|
"accentHover": "#1f4d75",
|
|
521
527
|
"accentSoft": "rgba(42,95,141,0.08)",
|
package/dist/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/labels.ts","../src/needs/statuses.ts","../src/native/cartesian.tsx","../src/core/data.ts","../src/core/describe.ts","../src/core/format.ts","../src/core/scale.ts","../src/core/shape.ts","../../tokens/dist/native.js","../src/native/frame.tsx","../src/core/palette.ts","../src/native/needs.tsx","../src/needs/labels.ts","../src/needs/model.ts","../src/needs/ticker.ts","../src/native/round.tsx"],"sourcesContent":["// The words a chart says on its own: its controls, its states and its written summary. English by default; an app\n// passes its own (translated through its catalogue) once, to `ChartsProvider labels`, or to one chart's `labels`.\n// Placeholders are written `{name}`.\n\nexport interface ChartLabels {\n /** The button that shows the data table. */\n showData: string;\n /** The button that hides it. */\n hideData: string;\n /** The caption of the data table: `{title}`. */\n tableCaption: string;\n /** The export buttons. */\n exportPng: string;\n exportSvg: string;\n exportCsv: string;\n /** The actions menu (⋯) of a chart: its accessible name, and its entries. */\n actions: string;\n viewTable: string;\n downloadCsv: string;\n downloadPng: string;\n downloadSvg: string;\n copyData: string;\n /** Announced once the data is on the clipboard. */\n copied: string;\n /** The close button of the table sheet. */\n close: string;\n /** The sheet's description: `{count}` rows. */\n tableRows: string;\n /** Legend chips filter: the chip's accessible name, `{label}`. */\n toggleSeries: string;\n /** Sparse data: under the chart, `{count}` periods with data out of `{total}`. */\n sparse: string;\n /** A KPI's change: `{change}` (`+12 %`) against the previous period. */\n trendVsPrevious: string;\n /** Announced while the data loads. */\n loading: string;\n /** Shown when there is nothing to draw. */\n empty: string;\n /** Shown when the data could not be loaded. */\n error: string;\n /** The keyboard hint, read once when the plot takes the focus. */\n keyboardHint: string;\n /** The role description of the plot (`chart`). */\n roleDescription: string;\n /** Summary pieces. `{kind}` is the chart's name (`Line chart`), `{count}` a number of points or series. */\n summaryIntro: string;\n summarySeries: string;\n summaryRange: string;\n summaryTrendUp: string;\n summaryTrendDown: string;\n summaryTrendFlat: string;\n summaryTotal: string;\n summaryThreshold: string;\n summaryShare: string;\n /** Scatter: the correlation of x and y (Pearson's r). */\n summaryCorrelation: string;\n /** Funnel: from one stage to the next, and from the first to the last. */\n summaryConversion: string;\n summaryOverall: string;\n /** Heatmap, calendar: the largest cell and the number of cells with a value. */\n summaryPeak: string;\n summaryActive: string;\n /** Candlestick: the period's range. */\n summaryOhlc: string;\n /** The names of the charts, read first in the summary. */\n kinds: Record<ChartKind, string>;\n /** The column of the values, when the chart has no value label. */\n value: string;\n /** The column of the categories in the data table, when the chart has no x label. */\n category: string;\n /** The total row of a stacked chart, a pie, a funnel. */\n total: string;\n /** What a missing value reads as. */\n noValue: string;\n}\n\nexport type ChartKind =\n | \"line\"\n | \"area\"\n | \"bar\"\n | \"pie\"\n | \"donut\"\n | \"gauge\"\n | \"sparkline\"\n | \"radar\"\n | \"heatmap\"\n | \"calendar\"\n | \"sankey\"\n | \"funnel\"\n | \"candlestick\"\n | \"treemap\"\n | \"scatter\"\n | \"map\"\n | \"globe\"\n | \"chart\";\n\nexport const DEFAULT_LABELS: ChartLabels = {\n showData: \"Show data\",\n hideData: \"Hide data\",\n tableCaption: \"{title} — data\",\n exportPng: \"PNG\",\n exportSvg: \"SVG\",\n exportCsv: \"CSV\",\n actions: \"Chart actions\",\n viewTable: \"View as table\",\n downloadCsv: \"Download CSV\",\n downloadPng: \"Download PNG\",\n downloadSvg: \"Download SVG\",\n copyData: \"Copy data\",\n copied: \"Data copied\",\n close: \"Close\",\n tableRows: \"{count} rows\",\n toggleSeries: \"Show or hide {label}\",\n sparse: \"{count} of {total} periods have data.\",\n trendVsPrevious: \"{change} vs previous period\",\n loading: \"Loading chart…\",\n empty: \"No data for this period yet.\",\n error: \"The chart could not be loaded.\",\n keyboardHint: \"Use the arrow keys to move between points, Home and End to jump to the ends.\",\n roleDescription: \"chart\",\n summaryIntro: \"{kind}, {count}.\",\n summarySeries: \"{label}: from {first} to {last}\",\n summaryRange: \"lowest {min} ({minAt}), highest {max} ({maxAt})\",\n summaryTrendUp: \"up {change}\",\n summaryTrendDown: \"down {change}\",\n summaryTrendFlat: \"stable\",\n summaryTotal: \"total {total}\",\n summaryThreshold: \"{label} at {value}\",\n summaryShare: \"{label} {value} ({share})\",\n summaryCorrelation: \"correlation {r}\",\n summaryConversion: \"{from} → {to} {rate}\",\n summaryOverall: \"overall {rate}\",\n summaryPeak: \"peak {value} ({at})\",\n summaryActive: \"{count} with a value\",\n summaryOhlc: \"opened at {open}, closed at {close}, low {low}, high {high}\",\n kinds: {\n line: \"Line chart\",\n area: \"Area chart\",\n bar: \"Bar chart\",\n pie: \"Pie chart\",\n donut: \"Donut chart\",\n gauge: \"Gauge\",\n sparkline: \"Sparkline\",\n radar: \"Radar chart\",\n heatmap: \"Heatmap\",\n calendar: \"Calendar heatmap\",\n sankey: \"Flow diagram\",\n funnel: \"Funnel\",\n candlestick: \"Candlestick chart\",\n treemap: \"Treemap\",\n scatter: \"Scatter chart\",\n map: \"Map\",\n globe: \"Globe\",\n chart: \"Chart\",\n },\n category: \"Category\",\n value: \"Value\",\n total: \"Total\",\n noValue: \"—\",\n};\n\n/** The words an app or a chart passes: any of them, and any of the chart names. */\nexport type ChartLabelsInput = Partial<Omit<ChartLabels, \"kinds\">> & { kinds?: Partial<Record<ChartKind, string>> };\n\n/** The default labels with an app's and a chart's on top (`kinds` merged too). */\nexport function mergeLabels(...layers: (ChartLabelsInput | undefined)[]): ChartLabels {\n let out = DEFAULT_LABELS;\n for (const layer of layers) {\n if (!layer) continue;\n out = { ...out, ...layer, kinds: { ...out.kinds, ...layer.kinds } };\n }\n return out;\n}\n\n/** A sentence's first letter in upper case (a template that may open a sentence: `total {total}`). */\nexport function capitalize(text: string): string {\n return text.charAt(0).toLocaleUpperCase() + text.slice(1);\n}\n\n/** `{name}` → its value; an unknown placeholder stays as written. */\nexport function fill(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match, name: string) => (name in values ? String(values[name]) : match));\n}\n","import type { Tone } from \"../core/types\";\n\n/** A status of a job: the field holding its count per period, its name, its tone, and its part in the success rate. */\nexport interface JobStatus {\n /** The field of the row holding the count (`\"completed\"`). */\n readonly key: string;\n /** Its name, passed translated (`\"Completed\"`). */\n readonly label: string;\n /** Its tone: the status colours (`success`, `danger`, `info`, `neutral`). */\n readonly tone: Tone;\n /** `succeeded` or `failed`: counted in the success rate. Absent: still running or waiting. */\n readonly outcome?: \"succeeded\" | \"failed\";\n}\n\n/** The four statuses of an Orazaka job, in English: pass your own (translated) `statuses`. */\nexport const DEFAULT_STATUSES: readonly JobStatus[] = [\n { key: \"completed\", label: \"Completed\", tone: \"success\", outcome: \"succeeded\" },\n { key: \"failed\", label: \"Failed\", tone: \"danger\", outcome: \"failed\" },\n { key: \"running\", label: \"Running\", tone: \"info\" },\n { key: \"queued\", label: \"Queued\", tone: \"neutral\" },\n];\n","// LineChart, AreaChart and BarChart for React Native: the web's props (data, x, y / series, format, xFormat,\n// thresholds) and the same geometry (src/core), drawn with react-native-svg. The active point (a tap, or the screen\n// reader's swipe) is marked on the plot and written under it.\nimport { useMemo, useState } from \"react\";\nimport Svg, { Circle, G, Line, Path, Text as SvgText } from \"react-native-svg\";\n\nimport { extent, normalizeSeries, stack, tabulate } from \"../core/data\";\nimport { describeSeries } from \"../core/describe\";\nimport { categoryFormatter, shareFormatter, valueFormatter } from \"../core/format\";\nimport { bandScale, linearScale, niceDomain, pointScale, thinLabels } from \"../core/scale\";\nimport { areaPath, barPath, type Curve, linePath, type Point, segments } from \"../core/shape\";\nimport type { Accessor, CategoryFormat, Datum, SeriesSpec, Threshold, ValueFormat } from \"../core/types\";\nimport { NativeFrame, type NativeFrameProps, NativeLegend, useNativeSettings } from \"./frame\";\n\nexport interface NativeCartesianProps<T extends Datum> extends NativeFrameProps {\n /** The rows, in the order of the x axis. */\n data: readonly T[];\n /** The field (or function) of the category. */\n x?: Accessor<T, unknown>;\n /** A single series: its field. */\n y?: Accessor<T, number | null | undefined>;\n /** The name of the single `y` series. */\n yLabel?: string;\n /** The series, each with its field and name. */\n series?: readonly SeriesSpec<T>[];\n /** How the values are written. */\n format?: ValueFormat;\n /** How the categories are written. */\n xFormat?: CategoryFormat;\n /** Horizontal lines at a value. */\n thresholds?: readonly Threshold[];\n}\n\ntype Mode = { kind: \"line\" | \"area\" | \"bar\"; curve?: Curve; stacked?: boolean };\n\nconst textWidth = (text: string) => Math.ceil(text.length * 6.4);\n\nfunction NativeCartesian<T extends Datum>({ props, mode }: { props: NativeCartesianProps<T>; mode: Mode }) {\n const { data, x, y, yLabel, series: seriesProp, format, xFormat, thresholds = [] } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, theme, color } = resolved;\n const specs = useMemo(() => normalizeSeries(seriesProp, y, yLabel), [seriesProp, y, yLabel]);\n const table = useMemo(() => tabulate(data, x, specs), [data, x, specs]);\n const fmt = useMemo(\n () => ({ value: valueFormatter(format, locale, labels.noValue), axis: valueFormatter(format, locale, labels.noValue, true), category: categoryFormatter(xFormat, locale), share: shareFormatter(locale) }),\n [format, xFormat, locale, labels.noValue],\n );\n const isEmpty = table.series.length === 0 || table.series.every((s) => s.values.every((v) => v == null));\n const summary = isEmpty ? labels.empty : describeSeries(table, { kind: mode.kind, labels, value: fmt.value, category: fmt.category, share: fmt.share, thresholds });\n const points = table.categories.map((c, i) => `${fmt.category(c)}: ${table.series.map((s) => `${s.label} ${fmt.value(s.values[i])}`).join(\", \")}`);\n const [active, setActive] = useState<number | null>(null);\n const colors = table.series.map((s) => color(s.color, s.slot));\n const count = table.categories.length;\n const stacked = Boolean(mode.stacked);\n\n return (\n <NativeFrame\n frame={props}\n defaultHeight={220}\n resolved={resolved}\n summary={summary}\n isEmpty={isEmpty}\n points={points}\n active={active}\n onActive={setActive}\n legend={<NativeLegend theme={theme} items={table.series.map((s, i) => ({ label: s.label, color: colors[i]! }))} />}\n indexAt={(px, width) => {\n if (!count) return null;\n const left = 44;\n return Math.max(0, Math.min(count - 1, mode.kind === \"bar\" ? Math.floor(((px - left) / (width - left - 8)) * count) : Math.round(((px - left) / (width - left - 8)) * (count - 1))));\n }}\n >\n {(width, height) => {\n let [lo, hi] = extent(table.series, stacked);\n for (const t of thresholds) {\n lo = Math.min(lo, t.value);\n hi = Math.max(hi, t.value);\n }\n lo = Math.min(0, lo);\n hi = Math.max(0, hi);\n const nice = niceDomain(lo, hi, 4);\n const ticks = nice.ticks.map((t) => fmt.axis(t));\n const x0 = Math.max(...ticks.map(textWidth)) + 8;\n const x1 = width - 8;\n const y0 = 8;\n const y1 = height - 22;\n const value = linearScale(nice.domain, [y1, y0], nice.ticks);\n const band = bandScale(count, [x0, x1], 0.3);\n const at = mode.kind === \"bar\" ? (i: number) => band(i) + band.bandwidth / 2 : pointScale(count, [x0, x1]);\n const stacks = stacked ? stack(table.series) : null;\n const widest = Math.max(...table.categories.map((c) => textWidth(fmt.category(c))));\n const labelsAt = thinLabels(count, Math.max(2, Math.floor((x1 - x0) / (widest + 16))));\n const groups = stacked ? 1 : table.series.length;\n const thickness = Math.min(20, Math.max(2, (band.bandwidth - (groups - 1) * 2) / groups));\n return (\n <Svg width={width} height={height}>\n {nice.ticks.map((t, i) => (\n <G key={t}>\n <Line x1={x0} x2={x1} y1={value(t)} y2={value(t)} stroke={t === 0 ? theme.borderDefault : theme.borderSubtle} strokeWidth={1} />\n <SvgText x={x0 - 6} y={value(t) + 4} fontSize={11} fill={theme.textSecondary} textAnchor=\"end\">\n {ticks[i]}\n </SvgText>\n </G>\n ))}\n {labelsAt.map((i) => (\n <SvgText key={i} x={at(i)} y={y1 + 16} fontSize={11} fill={theme.textSecondary} textAnchor={mode.kind !== \"bar\" && i === 0 ? \"start\" : mode.kind !== \"bar\" && i === count - 1 ? \"end\" : \"middle\"}>\n {fmt.category(table.categories[i])}\n </SvgText>\n ))}\n {active !== null && <Line x1={at(active)} x2={at(active)} y1={y0} y2={y1} stroke={theme.borderDefault} strokeWidth={1} />}\n {table.series.map((s, k) => {\n if (mode.kind === \"bar\") {\n return s.values.map((v, i) => {\n const seg = stacks?.[k]?.[i];\n const from = seg ? seg.base : 0;\n const to = seg ? seg.top : (v ?? 0);\n if (from === to) return null;\n const isTop = !stacked || k === table.series.length - 1;\n const top = Math.min(value(from), value(to));\n const size = Math.abs(value(to) - value(from)) - (isTop ? 0 : 2);\n const left = band(i) + (band.bandwidth - (thickness * groups + (groups - 1) * 2)) / 2 + (stacked ? 0 : k * (thickness + 2));\n return <Path key={`${k}-${i}`} d={barPath(left, isTop ? top : top + 2, thickness, Math.max(0, size), isTop ? 4 : 0, false, to < from)} fill={colors[k]} opacity={active !== null && active !== i ? 0.4 : 1} />;\n });\n }\n const pts = s.values.map((v, i) => (v == null ? null : ([at(i), value(stacks ? stacks[k]![i]!.top : v)] as Point)));\n return segments(pts).map((seg) => (\n <G key={`${k}-${seg[0]![0]}`}>\n {mode.kind === \"area\" && <Path d={areaPath(seg, stacks && k > 0 ? seg.map(([px]) => [px, value(stacks[k]![Math.round(((px - x0) / (x1 - x0)) * (count - 1))]!.base)] as Point) : value(0), mode.curve)} fill={colors[k]} opacity={stacked ? 0.5 : 0.14} />}\n <Path d={linePath(seg, mode.curve)} stroke={colors[k]} strokeWidth={2} fill=\"none\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeDasharray={s.dashed ? \"6 4\" : undefined} />\n </G>\n ));\n })}\n {thresholds.map((t, i) => (\n <G key={`t-${i}`}>\n <Line x1={x0} x2={x1} y1={value(t.value)} y2={value(t.value)} stroke={color(t.tone ?? \"neutral\", 1)} strokeWidth={1.5} strokeDasharray=\"6 4\" />\n <SvgText x={x1} y={value(t.value) - 6} fontSize={11} fontWeight=\"600\" fill={theme.textPrimary} textAnchor=\"end\">\n {t.label}\n </SvgText>\n </G>\n ))}\n {active !== null &&\n mode.kind !== \"bar\" &&\n table.series.map((s, k) => {\n const v = s.values[active];\n if (v == null) return null;\n return <Circle key={k} cx={at(active)} cy={value(stacks ? stacks[k]![active]!.top : v)} r={5} fill={colors[k]} stroke={theme.surface1} strokeWidth={2} />;\n })}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n\nexport interface NativeLineChartProps<T extends Datum> extends NativeCartesianProps<T> {\n /** `monotone` (default), `linear` or `step`. */\n curve?: Curve;\n}\n\n/** Change over time (React Native): one line per series. */\nexport function LineChart<T extends Datum>({ curve = \"monotone\", ...props }: NativeLineChartProps<T>) {\n return <NativeCartesian props={props} mode={{ kind: \"line\", curve }} />;\n}\n\nexport interface NativeAreaChartProps<T extends Datum> extends NativeLineChartProps<T> {\n /** Stack the series: the parts of a total over time. */\n stacked?: boolean;\n}\n\nexport interface NativeBarChartProps<T extends Datum> extends NativeCartesianProps<T> {\n /** Stack the series in one bar per category; default: grouped side by side. */\n stacked?: boolean;\n}\n\n/** A volume over time (React Native): a line over a wash; `stacked` for the parts of a total. */\nexport function AreaChart<T extends Datum>({ curve = \"monotone\", stacked, ...props }: NativeAreaChartProps<T>) {\n return <NativeCartesian props={props} mode={{ kind: \"area\", curve, stacked }} />;\n}\n\n/** Amounts across categories (React Native): grouped or `stacked` bars. */\nexport function BarChart<T extends Datum>({ stacked, ...props }: NativeBarChartProps<T>) {\n return <NativeCartesian props={props} mode={{ kind: \"bar\", stacked }} />;\n}\n","// From the app's rows to what a chart draws: the categories (x) and, per series, one value per category. Missing\n// values stay `null` (a gap), never a zero.\nimport type { Accessor, Datum, SeriesColor, SeriesSpec, SeriesSummary } from \"./types\";\n\n/** Reads a field or calls the accessor. */\nexport function read<T, V>(accessor: Accessor<T, V>, datum: T, index: number): V {\n return typeof accessor === \"function\" ? accessor(datum, index) : (datum[accessor as keyof T] as V);\n}\n\nexport interface Series {\n readonly id: string;\n readonly label: string;\n readonly values: readonly (number | null)[];\n readonly color?: SeriesColor;\n readonly dashed?: boolean;\n /** Its palette slot (1–8), in the order the series were given: a series keeps its colour whatever is filtered. */\n readonly slot: number;\n}\n\nexport interface Table {\n readonly categories: readonly unknown[];\n readonly series: readonly Series[];\n}\n\nconst toNumber = (value: unknown): number | null => (typeof value === \"number\" && Number.isFinite(value) ? value : null);\n\n/** `series`, or a single series from `y` and `label`. */\nexport function normalizeSeries<T extends Datum>(series: readonly SeriesSpec<T>[] | undefined, y: Accessor<T, number | null | undefined> | undefined, label: string | undefined): readonly SeriesSpec<T>[] {\n if (series?.length) return series;\n if (y !== undefined) return [{ key: y, label: label ?? (typeof y === \"string\" ? y : \"\") }];\n return [];\n}\n\n/** The categories and the series' values, row by row. */\nexport function tabulate<T extends Datum>(data: readonly T[], x: Accessor<T, unknown> | undefined, series: readonly SeriesSpec<T>[]): Table {\n return {\n categories: data.map((datum, i) => (x === undefined ? i + 1 : read(x, datum, i))),\n series: series.map((spec, s) => ({\n id: typeof spec.key === \"string\" ? spec.key : `series-${s}`,\n label: spec.label,\n values: data.map((datum, i) => toNumber(read(spec.key, datum, i))),\n color: spec.color,\n dashed: spec.dashed,\n slot: (s % 8) + 1,\n })),\n };\n}\n\n/** The smallest and largest value of the series, `stacked` summing them per category (positives and negatives apart). */\nexport function extent(series: readonly Series[], stacked = false): [number, number] {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n const count = series[0]?.values.length ?? 0;\n if (stacked) {\n for (let i = 0; i < count; i += 1) {\n let pos = 0;\n let neg = 0;\n for (const s of series) {\n const v = s.values[i] ?? 0;\n if (v >= 0) pos += v;\n else neg += v;\n }\n min = Math.min(min, neg);\n max = Math.max(max, pos);\n }\n } else {\n for (const s of series) {\n for (const v of s.values) {\n if (v == null) continue;\n min = Math.min(min, v);\n max = Math.max(max, v);\n }\n }\n }\n if (min === Number.POSITIVE_INFINITY) return [0, 0];\n return [min, max];\n}\n\n/** Per category and series, the base and top of a stacked mark (positives up, negatives down). */\nexport function stack(series: readonly Series[]): { base: number; top: number }[][] {\n const count = series[0]?.values.length ?? 0;\n const out = series.map(() => [] as { base: number; top: number }[]);\n for (let i = 0; i < count; i += 1) {\n let pos = 0;\n let neg = 0;\n series.forEach((s, k) => {\n const v = s.values[i] ?? 0;\n if (v >= 0) {\n out[k]!.push({ base: pos, top: pos + v });\n pos += v;\n } else {\n out[k]!.push({ base: neg, top: neg + v });\n neg += v;\n }\n });\n }\n return out;\n}\n\n/** What a series says: its extremes, its first and last values, its total and its trend (±1 % is flat). */\nexport function summarize(series: Series, categories: readonly unknown[], writeCategory: (c: unknown) => string): SeriesSummary {\n let min: SeriesSummary[\"min\"] = null;\n let max: SeriesSummary[\"max\"] = null;\n let first: number | null = null;\n let last: number | null = null;\n let total = 0;\n let count = 0;\n series.values.forEach((v, i) => {\n if (v == null) return;\n count += 1;\n total += v;\n if (first === null) first = v;\n last = v;\n if (!min || v < min.value) min = { value: v, category: writeCategory(categories[i]) };\n if (!max || v > max.value) max = { value: v, category: writeCategory(categories[i]) };\n });\n const change = first !== null && last !== null && first !== 0 && count > 1 ? (last as number) / first - 1 : null;\n const trend = count < 2 || change === null ? (count < 2 ? \"none\" : last! > first! ? \"up\" : last! < first! ? \"down\" : \"flat\") : Math.abs(change) < 0.01 ? \"flat\" : change > 0 ? \"up\" : \"down\";\n return { label: series.label, count, min, max, first, last, total, change, trend };\n}\n\n/**\n * The period that has data: the categories before the first and after the last value other than 0 or null are\n * dropped, but never below `min` categories (the window grows backwards first — the recent past gives a short burst\n * its scale — then forwards). `start` is the index of the first kept category in the table given; `active` the number\n * of categories with a value; `total` the number given. Nothing to trim, or no activity at all: the table as is.\n */\nexport function trimToActivity(table: Table, min = 7): { table: Table; start: number; active: number; total: number } {\n const total = table.categories.length;\n const has = (i: number) => table.series.some((s) => {\n const v = s.values[i];\n return v != null && v !== 0;\n });\n let first = -1;\n let last = -1;\n let active = 0;\n for (let i = 0; i < total; i += 1) {\n if (!has(i)) continue;\n active += 1;\n if (first < 0) first = i;\n last = i;\n }\n if (first < 0) return { table, start: 0, active: 0, total };\n let from = first;\n let to = last;\n const want = Math.min(total, Math.max(1, min));\n while (to - from + 1 < want) {\n if (from > 0) from -= 1;\n else if (to < total - 1) to += 1;\n else break;\n }\n if (from === 0 && to === total - 1) return { table, start: 0, active, total };\n return { table: { categories: table.categories.slice(from, to + 1), series: table.series.map((s) => ({ ...s, values: s.values.slice(from, to + 1) })) }, start: from, active, total };\n}\n","// The written summary of a chart — what a sighted reader takes in at a glance, said in words for a screen reader (and\n// shown under the chart when `summary=\"visible\"`): the kind, the size, then per series its range, extremes and trend.\nimport { summarize, type Table } from \"./data\";\nimport type { CategoryFormatter, ValueFormatter } from \"./format\";\nimport { capitalize, type ChartKind, type ChartLabels, fill } from \"./labels\";\nimport type { Threshold } from \"./types\";\n\nexport interface DescribeOptions {\n readonly kind: ChartKind;\n readonly labels: ChartLabels;\n readonly value: ValueFormatter;\n readonly category: CategoryFormatter;\n readonly share: (ratio: number) => string;\n readonly thresholds?: readonly Threshold[];\n}\n\n/** A cartesian chart (line, area, bar, sparkline): one sentence per series. */\nexport function describeSeries(table: Table, { kind, labels, value, category, share, thresholds = [] }: DescribeOptions): string {\n const points = table.categories.length;\n const first = points ? category(table.categories[0]) : \"\";\n const last = points ? category(table.categories[points - 1]) : \"\";\n const count = table.series.length > 1 ? `${table.series.length} × ${points}` : String(points);\n const intro = fill(labels.summaryIntro, { kind: labels.kinds[kind], count: points > 1 ? `${count} (${first} – ${last})` : count });\n const sentences = table.series.map((series) => {\n const s = summarize(series, table.categories, category);\n if (!s.count) return `${s.label}: ${labels.noValue}.`;\n const parts = [fill(labels.summarySeries, { label: s.label, first: value(s.first), last: value(s.last) })];\n if (s.min && s.max && s.count > 2) parts.push(fill(labels.summaryRange, { min: value(s.min.value), minAt: s.min.category, max: value(s.max.value), maxAt: s.max.category }));\n if (s.trend === \"up\" || s.trend === \"down\") {\n const template = s.trend === \"up\" ? labels.summaryTrendUp : labels.summaryTrendDown;\n if (s.change !== null) parts.push(fill(template, { change: share(Math.abs(s.change)) }));\n } else if (s.trend === \"flat\") parts.push(labels.summaryTrendFlat);\n return `${parts.join(\", \")}.`;\n });\n const marks = thresholds.map((t) => fill(labels.summaryThreshold, { label: t.label, value: value(t.value) }));\n return [intro, ...sentences, ...(marks.length ? [`${marks.join(\", \")}.`] : [])].join(\" \");\n}\n\n/** A part-to-whole chart (pie, donut, funnel, treemap): the parts, largest first, with their share. */\nexport function describeParts(kind: ChartKind, parts: readonly { label: string; value: number }[], { labels, value, share }: Omit<DescribeOptions, \"kind\" | \"category\">): string {\n const total = parts.reduce((sum, p) => sum + Math.max(0, p.value), 0);\n const intro = fill(labels.summaryIntro, { kind: labels.kinds[kind], count: parts.length });\n const sorted = [...parts].sort((a, b) => b.value - a.value);\n const items = sorted.map((p) => fill(labels.summaryShare, { label: p.label, value: value(p.value), share: share(total ? p.value / total : 0) }));\n return `${intro} ${items.join(\", \")}. ${capitalize(fill(labels.summaryTotal, { total: value(total) }))}.`;\n}\n","// Values and categories written the same way in the axes, the tooltips, the data table and the summary, through\n// @krizaka/intl (one cached Intl formatter per locale and options).\nimport { currencyDigits, formatCompact, formatDate, formatMoney, formatNumber, formatPercent, getDateTimeFormat, getNumberFormat } from \"@krizaka/intl\";\n\nimport type { CategoryFormat, Locale, ValueFormat } from \"./types\";\n\nexport type ValueFormatter = (value: number | null | undefined) => string;\n\n/**\n * A formatter for `format`. `axis` asks for the short form of the axis ticks (money and units go compact past 10 000).\n * A missing value is written `noValue`.\n */\nexport function valueFormatter(format: ValueFormat = \"number\", locale: Locale, noValue = \"—\", axis = false): ValueFormatter {\n const write = writerOf(format, locale, axis);\n return (value) => (value == null || Number.isNaN(value) ? noValue : write(value));\n}\n\nfunction writerOf(format: ValueFormat, locale: Locale, axis: boolean): (value: number) => string {\n if (typeof format === \"function\") return (value) => format(value, locale);\n if (format === \"integer\") return (value) => formatNumber(Math.round(value), { locale, maximumFractionDigits: 0 });\n if (format === \"compact\") return (value) => formatCompact(value, { locale });\n if (format === \"percent\") return (value) => formatPercent(value, { locale, maximumFractionDigits: axis ? 0 : 1 });\n if (format === \"number\") {\n return (value) => (axis && Math.abs(value) >= 10_000 ? formatCompact(value, { locale }) : formatNumber(value, { locale, maximumFractionDigits: 2 }));\n }\n if (format.style === \"money\") {\n const { currency } = format;\n const digits = currencyDigits(currency);\n return (value) => {\n const minor = Math.round(value);\n // Compact money on the axes (`€12K`): the amount in major units, Intl's compact currency notation.\n if ((axis || format.compact) && Math.abs(minor) >= 1_000_000) {\n const options = { style: \"currency\", currency, currencyDisplay: \"narrowSymbol\", notation: \"compact\", minimumFractionDigits: 0, maximumFractionDigits: 1 } as const;\n return getNumberFormat(locale, options).format(minor / 10 ** digits);\n }\n // An axis tick is a round amount: no cents to write (`€2,500`, not `€2,500.00`).\n if (axis && minor % 10 ** digits === 0) {\n return getNumberFormat(locale, { style: \"currency\", currency, minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(minor / 10 ** digits);\n }\n return formatMoney(minor, { currency, locale });\n };\n }\n if (format.style === \"unit\") {\n const { unit } = format;\n const compact = axis || format.compact;\n const options: Intl.NumberFormatOptions = { style: \"unit\", unit, unitDisplay: \"short\", ...(compact ? { notation: \"compact\" } : {}), maximumFractionDigits: compact ? 1 : 2 };\n return (value) => getNumberFormat(locale, options).format(value);\n }\n const { options } = format;\n return (value) => formatNumber(value, { locale, ...options });\n}\n\n/** An ISO date (`2026-04`, `2026-04-12`, `2026-04-12T14:30Z`), a `Date` or an epoch → a `Date`; anything else → null. */\nexport function asDate(value: unknown): Date | null {\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;\n if (typeof value === \"number\" && value > 10_000_000_000) return new Date(value);\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}(-\\d{2})?([T ][\\d:.]+(Z|[+-]\\d{2}:?\\d{2})?)?$/.test(value)) {\n // `2026-04` is the first of April, at midnight UTC: a month never slips to March in a negative time zone.\n const iso = value.length === 7 ? `${value}-01T00:00:00Z` : value.length === 10 ? `${value}T00:00:00Z` : value;\n const date = new Date(iso);\n return Number.isNaN(date.getTime()) ? null : date;\n }\n return null;\n}\n\nconst DATE_OPTIONS: Record<Exclude<CategoryFormat, \"text\" | ((category: unknown, locale: Locale) => string)>, Intl.DateTimeFormatOptions> = {\n year: { year: \"numeric\", timeZone: \"UTC\" },\n month: { month: \"short\", year: \"numeric\", timeZone: \"UTC\" },\n day: { month: \"short\", day: \"numeric\", timeZone: \"UTC\" },\n date: { dateStyle: \"medium\", timeZone: \"UTC\" },\n time: { timeStyle: \"short\", timeZone: \"UTC\" },\n datetime: { dateStyle: \"medium\", timeStyle: \"short\", timeZone: \"UTC\" },\n};\n\nexport type CategoryFormatter = (category: unknown) => string;\n\n/**\n * A formatter for the categories. Without a format, a date category is written by its precision (`2026-04` → a month,\n * `2026-04-12` → a day) and anything else as text. Dates are written in UTC, the zone of an ISO date without one:\n * pass a function for a local time.\n */\nexport function categoryFormatter(format: CategoryFormat | undefined, locale: Locale): CategoryFormatter {\n if (typeof format === \"function\") return (category) => format(category, locale);\n if (format === \"text\") return (category) => String(category ?? \"\");\n return (category) => {\n const date = asDate(category);\n if (!date) return String(category ?? \"\");\n const kind = format ?? guessPrecision(category);\n if (kind === \"date\") return formatDate(date, { locale, style: \"medium\", timeZone: \"UTC\" });\n return getDateTimeFormat(locale, DATE_OPTIONS[kind]).format(date);\n };\n}\n\nfunction guessPrecision(category: unknown): \"month\" | \"date\" | \"datetime\" {\n if (typeof category === \"string\") {\n if (category.length === 7) return \"month\";\n if (category.length === 10) return \"date\";\n return \"datetime\";\n }\n const date = asDate(category);\n return date && date.getUTCHours() === 0 && date.getUTCMinutes() === 0 ? \"date\" : \"datetime\";\n}\n\n/** A ratio for the summary and the shares: `0.236` → `24%` (one decimal under 10 %). */\nexport function shareFormatter(locale: Locale): (ratio: number) => string {\n return (ratio) => formatPercent(ratio, { locale, maximumFractionDigits: Math.abs(ratio) < 0.1 ? 1 : 0 });\n}\n","// Scales and ticks: the few functions a cartesian chart needs, without d3-scale (the charts draw a handful of shapes;\n// a full scale library would weigh more than the charts themselves).\n\nexport interface LinearScale {\n (value: number): number;\n readonly domain: readonly [number, number];\n readonly range: readonly [number, number];\n readonly ticks: readonly number[];\n}\n\n/** A step of 1, 2, 2.5 or 5 × 10ⁿ near `span / count`: ticks a reader counts without effort (0, 250, 500…). */\nexport function niceStep(span: number, count: number): number {\n if (!(span > 0) || !(count > 0)) return 1;\n const raw = span / count;\n const power = 10 ** Math.floor(Math.log10(raw));\n const fraction = raw / power;\n const nice = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 2.5 ? 2.5 : fraction <= 5 ? 5 : 10;\n return nice * power;\n}\n\n/**\n * A domain stretched to round ticks: `[0, 4870]` with about 5 ticks → `[0, 5000]`, ticks `0 1000 … 5000`. A single\n * value is padded towards zero, so a lone point never sits on the edge.\n */\nexport function niceDomain(min: number, max: number, count = 5): { domain: [number, number]; ticks: number[] } {\n if (!Number.isFinite(min) || !Number.isFinite(max)) return { domain: [0, 1], ticks: [0, 1] };\n if (min === max) {\n if (min === 0) return { domain: [0, 1], ticks: [0, 0.5, 1] };\n const pad = Math.abs(min) * 0.5;\n [min, max] = min > 0 ? [0, max + pad] : [min - pad, 0];\n }\n const step = niceStep(max - min, count);\n const lo = Math.floor(min / step) * step;\n const hi = Math.ceil(max / step) * step;\n const ticks: number[] = [];\n // Rounded to the step's precision: 0.1 + 0.2 must read 0.3.\n const digits = Math.max(0, -Math.floor(Math.log10(step)) + 2);\n for (let v = lo; v <= hi + step / 2; v += step) ticks.push(Number(v.toFixed(digits)));\n return { domain: [lo, hi], ticks };\n}\n\n/** A linear scale from a domain to pixels, with its round ticks. */\nexport function linearScale(domain: readonly [number, number], range: readonly [number, number], ticks: readonly number[] = domain): LinearScale {\n const [d0, d1] = domain;\n const [r0, r1] = range;\n const k = d1 === d0 ? 0 : (r1 - r0) / (d1 - d0);\n const scale = ((value: number) => r0 + (value - d0) * k) as LinearScale;\n return Object.assign(scale, { domain, range, ticks });\n}\n\nexport interface BandScale {\n (index: number): number;\n /** The width of one band (the bars of a category share it). */\n readonly bandwidth: number;\n /** The distance between the starts of two bands. */\n readonly step: number;\n readonly count: number;\n}\n\n/** `count` bands over the range, with an inner padding between them (a ratio of the step). */\nexport function bandScale(count: number, range: readonly [number, number], padding = 0.3): BandScale {\n const [r0, r1] = range;\n const step = count > 0 ? (r1 - r0) / count : 0;\n const bandwidth = step * (1 - padding);\n const scale = ((index: number) => r0 + index * step + (step - bandwidth) / 2) as BandScale;\n return Object.assign(scale, { bandwidth, step, count });\n}\n\n/** A point scale: `count` points from one end of the range to the other (lines, areas). */\nexport function pointScale(count: number, range: readonly [number, number]): (index: number) => number {\n const [r0, r1] = range;\n if (count <= 1) return () => (r0 + r1) / 2;\n const step = (r1 - r0) / (count - 1);\n return (index) => r0 + index * step;\n}\n\n/** At most `max` of `count` labels, evenly spaced, the last one always kept: which indexes to write on an axis. */\nexport function thinLabels(count: number, max: number): number[] {\n if (count <= max) return Array.from({ length: count }, (_, i) => i);\n const every = Math.ceil(count / Math.max(1, max));\n const out: number[] = [];\n for (let i = 0; i < count; i += every) out.push(i);\n if (out[out.length - 1] !== count - 1) {\n // The last label is always written; the one before it gives way when they would touch.\n if (count - 1 - out[out.length - 1]! < every) out.pop();\n out.push(count - 1);\n }\n return out;\n}\n","// SVG path data for the marks: lines (linear, monotone, step), areas, bars with a rounded data end, arcs. Shared by\n// the web (`<path d>`) and React Native (react-native-svg's `<Path d>`): the same geometry on both platforms.\n\nexport type Point = readonly [number, number];\nexport type Curve = \"linear\" | \"monotone\" | \"step\";\n\nconst r = (n: number) => Math.round(n * 100) / 100;\n\n/** The segments of a line, split where a value is missing (a gap stays a gap, never a fake zero). */\nexport function segments(points: readonly (Point | null)[]): Point[][] {\n const out: Point[][] = [];\n let current: Point[] = [];\n for (const point of points) {\n if (point) current.push(point);\n else if (current.length) {\n out.push(current);\n current = [];\n }\n }\n if (current.length) out.push(current);\n return out;\n}\n\n/** The path of one segment. `monotone` (Fritsch–Carlson) never overshoots: a curve that never invents a peak. */\nexport function linePath(points: readonly Point[], curve: Curve = \"monotone\"): string {\n if (points.length === 0) return \"\";\n const [x0, y0] = points[0]!;\n if (points.length === 1) return `M${r(x0)},${r(y0)}`;\n if (curve === \"step\") {\n let d = `M${r(x0)},${r(y0)}`;\n for (let i = 1; i < points.length; i += 1) {\n const [px] = points[i - 1]!;\n const [x, y] = points[i]!;\n const mid = (px + x) / 2;\n d += `H${r(mid)}V${r(y)}H${r(x)}`;\n }\n return d;\n }\n if (curve === \"linear\" || points.length === 2) return points.map(([x, y], i) => `${i ? \"L\" : \"M\"}${r(x)},${r(y)}`).join(\"\");\n const tangents = monotoneTangents(points);\n let d = `M${r(x0)},${r(y0)}`;\n for (let i = 1; i < points.length; i += 1) {\n const [xa, ya] = points[i - 1]!;\n const [xb, yb] = points[i]!;\n const h = (xb - xa) / 3;\n d += `C${r(xa + h)},${r(ya + h * tangents[i - 1]!)} ${r(xb - h)},${r(yb - h * tangents[i]!)} ${r(xb)},${r(yb)}`;\n }\n return d;\n}\n\nfunction monotoneTangents(points: readonly Point[]): number[] {\n const n = points.length;\n const slopes: number[] = [];\n for (let i = 0; i < n - 1; i += 1) {\n const [xa, ya] = points[i]!;\n const [xb, yb] = points[i + 1]!;\n slopes.push(xb === xa ? 0 : (yb - ya) / (xb - xa));\n }\n const tangents = [slopes[0]!];\n for (let i = 1; i < n - 1; i += 1) {\n const a = slopes[i - 1]!;\n const b = slopes[i]!;\n tangents.push(a * b <= 0 ? 0 : (3 * a * b) / (Math.max(a, b) * 2 + Math.min(a, b)) || 0);\n }\n tangents.push(slopes[n - 2]!);\n return tangents;\n}\n\n/** An area under (or between) lines: the top points left to right, then the base right to left. */\nexport function areaPath(top: readonly Point[], base: readonly Point[] | number, curve: Curve = \"monotone\"): string {\n if (top.length === 0) return \"\";\n const line = linePath(top, curve);\n const bottom: Point[] = typeof base === \"number\" ? [top[top.length - 1]!, top[0]!].map(([x]) => [x, base] as Point) : [...base].reverse();\n if (typeof base === \"number\") return `${line}L${r(bottom[0]![0])},${r(base)}L${r(bottom[1]![0])},${r(base)}Z`;\n return `${line}L${linePath(bottom, curve).slice(1)}Z`;\n}\n\n/**\n * A bar from its baseline to its value, the data end rounded (`radius`, 4 px by default), square on the baseline.\n * `horizontal` bars grow to the right (or left for a negative value).\n */\nexport function barPath(x: number, y: number, width: number, height: number, radius = 4, horizontal = false, negative = false): string {\n if (width <= 0 || height <= 0) return \"\";\n const rad = Math.min(radius, horizontal ? height / 2 : width / 2, horizontal ? width : height);\n if (!horizontal) {\n if (!negative) {\n // Rounded at the top, square at the baseline (bottom).\n return `M${r(x)},${r(y + height)}V${r(y + rad)}Q${r(x)},${r(y)} ${r(x + rad)},${r(y)}H${r(x + width - rad)}Q${r(x + width)},${r(y)} ${r(x + width)},${r(y + rad)}V${r(y + height)}Z`;\n }\n return `M${r(x)},${r(y)}V${r(y + height - rad)}Q${r(x)},${r(y + height)} ${r(x + rad)},${r(y + height)}H${r(x + width - rad)}Q${r(x + width)},${r(y + height)} ${r(x + width)},${r(y + height - rad)}V${r(y)}Z`;\n }\n if (!negative) {\n return `M${r(x)},${r(y)}H${r(x + width - rad)}Q${r(x + width)},${r(y)} ${r(x + width)},${r(y + rad)}V${r(y + height - rad)}Q${r(x + width)},${r(y + height)} ${r(x + width - rad)},${r(y + height)}H${r(x)}Z`;\n }\n return `M${r(x + width)},${r(y)}H${r(x + rad)}Q${r(x)},${r(y)} ${r(x)},${r(y + rad)}V${r(y + height - rad)}Q${r(x)},${r(y + height)} ${r(x + rad)},${r(y + height)}H${r(x + width)}Z`;\n}\n\n/** A point on a circle, the angle in radians from twelve o'clock, clockwise. */\nexport function polar(cx: number, cy: number, radius: number, angle: number): Point {\n return [cx + radius * Math.sin(angle), cy - radius * Math.cos(angle)];\n}\n\n/**\n * A ring sector (a pie slice when `inner` is 0), from `start` to `end` (radians, clockwise from twelve o'clock).\n * A full turn is drawn as two halves: an SVG arc cannot start and end on the same point.\n */\nexport function arcPath(cx: number, cy: number, inner: number, outer: number, start: number, end: number): string {\n const sweep = end - start;\n if (sweep <= 0 || outer <= 0) return \"\";\n if (sweep >= Math.PI * 2 - 1e-6) {\n const mid = start + Math.PI;\n return `${arcPath(cx, cy, inner, outer, start, mid)}${arcPath(cx, cy, inner, outer, mid, start + Math.PI * 2)}`;\n }\n const large = sweep > Math.PI ? 1 : 0;\n const [ox0, oy0] = polar(cx, cy, outer, start);\n const [ox1, oy1] = polar(cx, cy, outer, end);\n let d = `M${r(ox0)},${r(oy0)}A${r(outer)},${r(outer)} 0 ${large} 1 ${r(ox1)},${r(oy1)}`;\n if (inner > 0) {\n const [ix1, iy1] = polar(cx, cy, inner, end);\n const [ix0, iy0] = polar(cx, cy, inner, start);\n d += `L${r(ix1)},${r(iy1)}A${r(inner)},${r(inner)} 0 ${large} 0 ${r(ix0)},${r(iy0)}Z`;\n } else d += `L${r(cx)},${r(cy)}Z`;\n return d;\n}\n\n/** An open arc (a gauge's track), stroked rather than filled. */\nexport function strokeArcPath(cx: number, cy: number, radius: number, start: number, end: number): string {\n if (end - start <= 0) return \"\";\n const [x0, y0] = polar(cx, cy, radius, start);\n const [x1, y1] = polar(cx, cy, radius, end);\n return `M${r(x0)},${r(y0)}A${r(radius)},${r(radius)} 0 ${end - start > Math.PI ? 1 : 0} 1 ${r(x1)},${r(y1)}`;\n}\n","// @krizaka/tokens — GÉNÉRÉ depuis src/tokens/*.tokens.json par scripts/build.mjs : ne pas éditer.\n\n/** Colour roles per theme, resolved for React Native (`#rrggbb`, `rgba()` when translucent). */\nexport const themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze({\n \"surface0\": \"#151b18\",\n \"surface1\": \"#191f1c\",\n \"surface2\": \"#1c221f\",\n \"surface3\": \"#262e2a\",\n \"media\": \"#1e2521\",\n \"borderSubtle\": \"rgba(231,240,230,0.07)\",\n \"borderDefault\": \"rgba(231,240,230,0.12)\",\n \"borderStrong\": \"rgba(231,240,230,0.2)\",\n \"textPrimary\": \"#ecf0ea\",\n \"textSecondary\": \"#bcc8c0\",\n \"textMuted\": \"#a7b4ab\",\n \"textOnMedia\": \"#ffffff\",\n \"accent\": \"#3e76a8\",\n \"accentHover\": \"#346793\",\n \"accentSoft\": \"rgba(62,118,168,0.12)\",\n \"accentText\": \"#8ebde1\",\n \"accent2\": \"#3e76a8\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#3e76a8\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\",\n \"success\": \"#10b77f\",\n \"successText\": \"#36d399\",\n \"successSoft\": \"rgba(16,183,127,0.14)\",\n \"warning\": \"#f59f0a\",\n \"warningText\": \"#f6a823\",\n \"warningSoft\": \"rgba(245,159,10,0.14)\",\n \"danger\": \"#ef4343\",\n \"dangerText\": \"#f87272\",\n \"dangerSoft\": \"rgba(239,67,67,0.14)\",\n \"info\": \"#3e76a8\",\n \"infoText\": \"#8ebde1\",\n \"scrim\": \"rgba(0,0,0,0.6)\",\n \"scrimStrong\": \"rgba(0,0,0,0.8)\",\n \"overlay\": \"rgba(0,0,0,0.7)\",\n \"paperRuleMajor\": \"rgba(217,232,222,0.09)\",\n \"paperRuleMinor\": \"rgba(217,232,222,0.045)\",\n \"paperRuleMargin\": \"#e08071\",\n \"paperTag\": \"#2d3932\",\n \"paperTagEdge\": \"#586a5f\",\n \"paperTagInk\": \"#e9eee7\",\n \"surfaceSheen\": \"rgba(255,255,255,0)\",\n \"fillShade\": \"rgba(0,0,0,0.12)\",\n \"edgeLight\": \"rgba(255,255,255,0)\",\n \"edgeOnFill\": \"rgba(255,255,255,0.22)\",\n \"edgeWell\": \"rgba(4,4,7,0.5)\",\n \"glassBg\": \"#191f1c\",\n \"glassBorder\": \"rgba(255,255,255,0.1)\"\n}), light: /* @__PURE__ */ Object.freeze({\n \"surface0\": \"#f4f6f3\",\n \"surface1\": \"#fbfcfb\",\n \"surface2\": \"#f0f3ef\",\n \"surface3\": \"#dfe3de\",\n \"media\": \"#e5e8e3\",\n \"borderSubtle\": \"rgba(31,59,91,0.1)\",\n \"borderDefault\": \"rgba(31,59,91,0.17)\",\n \"borderStrong\": \"rgba(31,59,91,0.28)\",\n \"textPrimary\": \"#1d3654\",\n \"textSecondary\": \"#405064\",\n \"textMuted\": \"#4f5b69\",\n \"textOnMedia\": \"#ffffff\",\n \"accent\": \"#2a5f8d\",\n \"accentHover\": \"#1f4d75\",\n \"accentSoft\": \"rgba(42,95,141,0.08)\",\n \"accentText\": \"#275782\",\n \"accent2\": \"#2a5f8d\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#2a5f8d\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\",\n \"success\": \"#10b77f\",\n \"successText\": \"#0a714e\",\n \"successSoft\": \"rgba(16,183,127,0.1)\",\n \"warning\": \"#f59f0a\",\n \"warningText\": \"#955104\",\n \"warningSoft\": \"rgba(245,159,10,0.12)\",\n \"danger\": \"#ef4343\",\n \"dangerText\": \"#af1d1d\",\n \"dangerSoft\": \"rgba(239,67,67,0.1)\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"scrim\": \"rgba(0,0,0,0.6)\",\n \"scrimStrong\": \"rgba(0,0,0,0.8)\",\n \"overlay\": \"rgba(0,0,0,0.7)\",\n \"paperRuleMajor\": \"rgba(69,109,161,0.24)\",\n \"paperRuleMinor\": \"rgba(69,109,161,0.1)\",\n \"paperRuleMargin\": \"#a53127\",\n \"paperTag\": \"#eadfc2\",\n \"paperTagEdge\": \"#b4a274\",\n \"paperTagInk\": \"#282620\",\n \"surfaceSheen\": \"rgba(255,255,255,0)\",\n \"fillShade\": \"rgba(0,0,0,0.12)\",\n \"edgeLight\": \"rgba(255,255,255,0)\",\n \"edgeOnFill\": \"rgba(255,255,255,0.22)\",\n \"edgeWell\": \"rgba(48,52,80,0.08)\",\n \"glassBg\": \"#fbfcfb\",\n \"glassBorder\": \"rgba(0,0,0,0.08)\"\n}) });\n\n/** Corner radii, in dp. */\nexport const radius = /* @__PURE__ */ Object.freeze({\n \"xs\": 2,\n \"sm\": 2,\n \"md\": 2,\n \"lg\": 0,\n \"xl\": 0,\n \"2xl\": 0,\n \"full\": 9999\n});\n\n/** Font families: the first family of each web stack (React Native takes a single name). */\nexport const typography = /* @__PURE__ */ Object.freeze({\n \"sans\": \"Atkinson Hyperlegible Next\",\n \"text\": \"Atkinson Hyperlegible Next\",\n \"display\": \"Young Serif\",\n \"mono\": \"Courier Prime\",\n \"cahier\": \"Krizaka Cahier\"\n});\n\n/**\n * Motion: the cubic-bezier control points (`Easing.bezier(...motion.ease)`), the short spring of what answers the hand\n * (`motion.spring`) and the micro-interaction durations in ms (`motion.duration.fast`) — 0 when the system reduces motion.\n */\nexport const motion = /* @__PURE__ */ Object.freeze({ ease: /* @__PURE__ */ Object.freeze([0.45,0,0.2,1]), spring: /* @__PURE__ */ Object.freeze([0.34,1.36,0.64,1]), duration: /* @__PURE__ */ Object.freeze({\"instant\":90,\"fast\":150,\"base\":200}) });\n\n/**\n * The type scale in dp: fontSize, lineHeight and letterSpacing absolute (React Native has no em), fontWeight as a string,\n * and the role whose family sets it — with @krizaka/fonts: `{ ...typeScale.bodyMd, fontFamily: fontFamily(role, weight) }`.\n */\nexport const typeScale = /* @__PURE__ */ Object.freeze({\n \"display2xl\": {\n \"role\": \"display\",\n \"fontSize\": 72,\n \"lineHeight\": 80,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.72\n },\n \"displayXl\": {\n \"role\": \"display\",\n \"fontSize\": 56,\n \"lineHeight\": 64,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.56\n },\n \"displayLg\": {\n \"role\": \"display\",\n \"fontSize\": 44,\n \"lineHeight\": 48,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.44\n },\n \"displayMd\": {\n \"role\": \"display\",\n \"fontSize\": 34,\n \"lineHeight\": 40,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.34\n },\n \"displaySm\": {\n \"role\": \"display\",\n \"fontSize\": 26,\n \"lineHeight\": 32,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"titleLg\": {\n \"role\": \"display\",\n \"fontSize\": 20,\n \"lineHeight\": 24,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"titleMd\": {\n \"role\": \"text\",\n \"fontSize\": 17,\n \"lineHeight\": 24,\n \"fontWeight\": \"600\",\n \"letterSpacing\": -0.2\n },\n \"bodyLg\": {\n \"role\": \"text\",\n \"fontSize\": 18,\n \"lineHeight\": 29,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.25\n },\n \"bodyMd\": {\n \"role\": \"text\",\n \"fontSize\": 16,\n \"lineHeight\": 24,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.18\n },\n \"bodySm\": {\n \"role\": \"text\",\n \"fontSize\": 14,\n \"lineHeight\": 20,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.08\n },\n \"caption\": {\n \"role\": \"text\",\n \"fontSize\": 12,\n \"lineHeight\": 17,\n \"fontWeight\": \"500\",\n \"letterSpacing\": 0\n },\n \"overline\": {\n \"role\": \"mono\",\n \"fontSize\": 11,\n \"lineHeight\": 16,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"monoMd\": {\n \"role\": \"mono\",\n \"fontSize\": 14,\n \"lineHeight\": 22,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"monoSm\": {\n \"role\": \"mono\",\n \"fontSize\": 12,\n \"lineHeight\": 18,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n }\n});\n\n/**\n * The shadows per theme as React Native `boxShadow` strings (RN ≥ 0.76): `raised` (a button, a card), `floating`\n * (a menu, a popover), `overlay` (a sheet, a toast) — ink-tinted, several layers, as on the web.\n */\nexport const shadows = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze({\n \"sm\": \"0 1px 0 0 rgba(5,10,8,0.6)\",\n \"md\": \"0 1px 0 0 rgba(5,10,8,0.6), 4px 5px 0 -2px rgba(7,13,10,0.55)\",\n \"lg\": \"0 1px 0 0 rgba(5,10,8,0.6), 6px 8px 0 -2px rgba(7,13,10,0.55)\",\n \"raised\": \"0 1px 0 0 rgba(5,10,8,0.6)\",\n \"floating\": \"0 1px 0 0 rgba(5,10,8,0.6), 4px 5px 0 -2px rgba(7,13,10,0.55)\",\n \"overlay\": \"0 1px 0 0 rgba(5,10,8,0.6), 8px 10px 0 -3px rgba(7,13,10,0.55)\"\n}), light: /* @__PURE__ */ Object.freeze({\n \"sm\": \"0 1px 0 0 rgba(31,59,91,0.12)\",\n \"md\": \"0 1px 0 0 rgba(31,59,91,0.12), 4px 5px 0 -2px rgba(46,74,107,0.14)\",\n \"lg\": \"0 1px 0 0 rgba(31,59,91,0.12), 6px 8px 0 -2px rgba(46,74,107,0.14)\",\n \"raised\": \"0 1px 0 0 rgba(31,59,91,0.12)\",\n \"floating\": \"0 1px 0 0 rgba(31,59,91,0.12), 4px 5px 0 -2px rgba(46,74,107,0.14)\",\n \"overlay\": \"0 1px 0 0 rgba(31,59,91,0.12), 8px 10px 0 -3px rgba(46,74,107,0.14)\"\n}) });\n\n/** The griffe (BRAND.md §6.1): the size of the 45° cut corner of a control, in dp. */\nexport const cut = /* @__PURE__ */ Object.freeze({\n \"size\": 10\n});\n\n/** The brand themes as ThemeProvider overrides (`overrides={brands.orazaka}`): the accent family per theme. */\nexport const brands = /* @__PURE__ */ Object.freeze({\n \"krizaka\": {\n \"dark\": {\n \"accent\": \"#3e76a8\",\n \"accentHover\": \"#346793\",\n \"accentSoft\": \"rgba(62,118,168,0.12)\",\n \"accentText\": \"#8ebde1\",\n \"accent2\": \"#3e76a8\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#3e76a8\",\n \"info\": \"#3e76a8\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#2a5f8d\",\n \"accentHover\": \"#1f4d75\",\n \"accentSoft\": \"rgba(42,95,141,0.08)\",\n \"accentText\": \"#275782\",\n \"accent2\": \"#2a5f8d\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#2a5f8d\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"orazaka\": {\n \"dark\": {\n \"accent\": \"#f67e23\",\n \"accentHover\": \"#f79245\",\n \"accentSoft\": \"rgba(246,126,35,0.12)\",\n \"accentText\": \"#f78c3b\",\n \"accent2\": \"#f59e0b\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#f67e23\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#b45309\",\n \"accentHover\": \"#964608\",\n \"accentSoft\": \"rgba(180,83,9,0.08)\",\n \"accentText\": \"#9b4808\",\n \"accent2\": \"#a45904\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#b45309\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"orochia\": {\n \"dark\": {\n \"accent\": \"#7c3aed\",\n \"accentHover\": \"#6d28d9\",\n \"accentSoft\": \"rgba(139,92,246,0.12)\",\n \"accentText\": \"#a78bfa\",\n \"accent2\": \"#db2777\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#a78bfa\",\n \"info\": \"#7c3aed\",\n \"infoText\": \"#a78bfa\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#7c3aed\",\n \"accentHover\": \"#6d28d9\",\n \"accentSoft\": \"rgba(124,58,237,0.08)\",\n \"accentText\": \"#6d28d9\",\n \"accent2\": \"#db2777\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#7c3aed\",\n \"info\": \"#7c3aed\",\n \"infoText\": \"#6d28d9\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"yasakia\": {\n \"dark\": {\n \"accent\": \"#24dbc9\",\n \"accentHover\": \"#47e1d2\",\n \"accentSoft\": \"rgba(36,219,201,0.12)\",\n \"accentText\": \"#3ee0cf\",\n \"accent2\": \"#22c378\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#24dbc9\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#097169\",\n \"accentHover\": \"#085e57\",\n \"accentSoft\": \"rgba(9,113,105,0.08)\",\n \"accentText\": \"#096d64\",\n \"accent2\": \"#107546\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#097169\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"yororis\": {\n \"dark\": {\n \"accent\": \"#98b587\",\n \"accentHover\": \"#adc69f\",\n \"accentSoft\": \"rgba(152,181,135,0.12)\",\n \"accentText\": \"#a7c497\",\n \"accent2\": \"#c3a579\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#98b587\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#456237\",\n \"accentHover\": \"#39532d\",\n \"accentSoft\": \"rgba(69,98,55,0.08)\",\n \"accentText\": \"#415b33\",\n \"accent2\": \"#745834\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#456237\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"yomizaka\": {\n \"dark\": {\n \"accent\": \"#8888f2\",\n \"accentHover\": \"#a2a2f6\",\n \"accentSoft\": \"rgba(136,136,242,0.12)\",\n \"accentText\": \"#9797f7\",\n \"accent2\": \"#8d9aec\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#8888f2\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#3c38b2\",\n \"accentHover\": \"#322e9e\",\n \"accentSoft\": \"rgba(60,56,178,0.08)\",\n \"accentText\": \"#3a36ab\",\n \"accent2\": \"#2d3c9f\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#3c38b2\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"kachizaka\": {\n \"dark\": {\n \"accent\": \"#fbcf23\",\n \"accentHover\": \"#fddb53\",\n \"accentSoft\": \"rgba(251,207,35,0.12)\",\n \"accentText\": \"#fbd84b\",\n \"accent2\": \"#7695f9\",\n \"onAccent\": \"#0c0e17\",\n \"ring\": \"#fbcf23\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#fac905\",\n \"accentHover\": \"#dcb104\",\n \"accentSoft\": \"rgba(250,193,5,0.14)\",\n \"accentText\": \"#1d3faf\",\n \"accent2\": \"#6285f8\",\n \"onAccent\": \"#0c0e17\",\n \"ring\": \"#1743d3\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"akinaza\": {\n \"dark\": {\n \"accent\": \"#65c374\",\n \"accentHover\": \"#7fd28d\",\n \"accentSoft\": \"rgba(101,195,116,0.12)\",\n \"accentText\": \"#7dd48b\",\n \"accent2\": \"#dc946a\",\n \"onAccent\": \"#0a0f0c\",\n \"ring\": \"#65c374\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#21692f\",\n \"accentHover\": \"#195726\",\n \"accentSoft\": \"rgba(33,105,47,0.08)\",\n \"accentText\": \"#20652e\",\n \"accent2\": \"#954923\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#21692f\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n }\n});\n/** The marks' emblem gradients: [offset, #rrggbb] stops, the same in both themes. */\nexport const marks = /* @__PURE__ */ Object.freeze({\n \"krizaka\": [\n [\n \"0%\",\n \"#3e76a8\"\n ],\n [\n \"100%\",\n \"#8ebde1\"\n ]\n ],\n \"orazaka\": [\n [\n \"0%\",\n \"#b45309\"\n ],\n [\n \"100%\",\n \"#dc6509\"\n ]\n ],\n \"orochia\": [\n [\n \"0%\",\n \"#7c3aed\"\n ],\n [\n \"55%\",\n \"#d946ef\"\n ],\n [\n \"100%\",\n \"#f472b6\"\n ]\n ],\n \"yasakia\": [\n [\n \"0%\",\n \"#079d61\"\n ],\n [\n \"100%\",\n \"#089b96\"\n ]\n ],\n \"yororis\": [\n [\n \"0%\",\n \"#a4773d\"\n ],\n [\n \"100%\",\n \"#5d894d\"\n ]\n ],\n \"yomizaka\": [\n [\n \"0%\",\n \"#5362c6\"\n ],\n [\n \"100%\",\n \"#6d5ec9\"\n ]\n ],\n \"kachizaka\": [\n [\n \"0%\",\n \"#355fe9\"\n ],\n [\n \"100%\",\n \"#a27807\"\n ]\n ],\n \"akinaza\": [\n [\n \"0%\",\n \"#2d8049\"\n ],\n [\n \"100%\",\n \"#bc632f\"\n ]\n ]\n});\n","// The native frame: the chart's title, its readout (the active point, written), a plot measured with onLayout, and\n// the accessibility the web gets from its table — the plot is one `adjustable` element whose label is the title and\n// the written summary, and whose increment / decrement (swipe up / down with VoiceOver and TalkBack) walk the points,\n// each one read as its value. A tap selects the nearest point. StyleSheet and the token roles only.\nimport { themes as tokenThemes } from \"@krizaka/tokens/native\";\nimport { createContext, type ReactNode, useContext, useMemo, useState } from \"react\";\nimport { type LayoutChangeEvent, Pressable, StyleSheet, Text, useColorScheme, View, type ViewStyle } from \"react-native\";\n\nimport { type ChartLabels, type ChartLabelsInput, mergeLabels } from \"../core/labels\";\nimport { type Mode, palette } from \"../core/palette\";\nimport type { BrandId, Locale, SeriesColor, Tone } from \"../core/types\";\n\n/** The colour roles a chart reads (a subset of @krizaka/tokens/native's `Theme`; `useTheme().theme` of @krizaka/ui/native fits). */\nexport type ChartTheme = {\n readonly surface1: string;\n readonly surface2: string;\n readonly surface3: string;\n readonly borderSubtle: string;\n readonly borderDefault: string;\n readonly textPrimary: string;\n readonly textSecondary: string;\n readonly textMuted: string;\n readonly accent: string;\n readonly success: string;\n readonly warning: string;\n readonly danger: string;\n readonly info: string;\n};\n\nconst THEMES: Readonly<Record<Mode, ChartTheme>> = tokenThemes;\n\nexport interface NativeChartsSettings {\n /** The locale of every figure and date. Default `\"en-US\"`. */\n locale?: Locale;\n /** The brand whose palette leads. Default Krizaka. */\n brand?: BrandId;\n /** The words: the readout, the summary. */\n labels?: ChartLabelsInput;\n /** Dark or light. Default: the device's (pass `useTheme().scheme` of @krizaka/ui/native to follow the app). */\n scheme?: Mode;\n /** The app's colour roles (`useTheme().theme` of @krizaka/ui/native): a product's brand overrides apply. */\n theme?: Partial<ChartTheme>;\n}\n\nconst Context = createContext<NativeChartsSettings>({});\n\n/** Sets the locale, brand, words, scheme and theme of every chart below it. */\nexport function ChartsProvider({ children, ...settings }: NativeChartsSettings & { children: ReactNode }) {\n const parent = useContext(Context);\n const value = useMemo(() => ({ ...parent, ...Object.fromEntries(Object.entries(settings).filter(([, v]) => v !== undefined)) }), [parent, settings]);\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\nexport interface Resolved {\n readonly locale: Locale;\n readonly labels: ChartLabels;\n readonly theme: ChartTheme;\n readonly palette: readonly string[];\n readonly color: (color: SeriesColor | undefined, slot: number) => string;\n}\n\nexport function useNativeSettings(own: NativeChartsSettings): Resolved {\n const shared = useContext(Context);\n const device = useColorScheme();\n const scheme: Mode = own.scheme ?? shared.scheme ?? (device === \"light\" ? \"light\" : \"dark\");\n const brand = own.brand ?? shared.brand ?? \"krizaka\";\n return useMemo(() => {\n const theme = { ...THEMES[scheme], ...shared.theme, ...own.theme };\n const colors = palette(brand, scheme);\n const tones: Record<Tone, string> = { neutral: theme.textSecondary, accent: theme.accent, success: theme.success, warning: theme.warning, danger: theme.danger, info: theme.info };\n return {\n locale: own.locale ?? shared.locale ?? \"en-US\",\n labels: mergeLabels(shared.labels, own.labels),\n theme,\n palette: colors,\n color: (color, slot) => (color === undefined ? colors[(slot - 1) % 8]! : typeof color === \"number\" ? colors[color - 1]! : color in tones ? tones[color as Tone] : color),\n };\n }, [scheme, brand, shared, own.locale, own.labels, own.theme]);\n}\n\nexport interface NativeFrameProps extends NativeChartsSettings {\n /** What the chart shows: its heading and accessible name. */\n title: string;\n /** Hide the heading (it stays the accessible name). */\n hideTitle?: boolean;\n /** The plot's height. */\n height?: number;\n /** The data is on its way. */\n loading?: boolean;\n /** Shown instead of the plot when there is nothing to draw. Default: the `empty` label. */\n empty?: ReactNode;\n /** The style of the chart's container (layout only: colours come from the theme). */\n style?: ViewStyle;\n}\n\ninterface FrameInternals {\n readonly frame: NativeFrameProps;\n readonly defaultHeight: number;\n readonly resolved: Resolved;\n readonly summary: string;\n readonly isEmpty: boolean;\n /** The points the screen reader walks, already written. */\n readonly points: readonly string[];\n readonly active: number | null;\n readonly onActive: (index: number | null) => void;\n /** The index nearest to a tap at `x` on a plot `width` wide. */\n readonly indexAt?: (x: number, width: number) => number | null;\n readonly legend?: ReactNode;\n readonly children: (width: number, height: number) => ReactNode;\n}\n\nexport function NativeFrame({ frame, defaultHeight, resolved, summary, isEmpty, points, active, onActive, indexAt, legend, children }: FrameInternals) {\n const { title, hideTitle, height = defaultHeight, loading, empty, style } = frame;\n const { theme, labels } = resolved;\n const [width, setWidth] = useState(0);\n const onLayout = (event: LayoutChangeEvent) => setWidth(Math.round(event.nativeEvent.layout.width));\n const readout = active !== null ? points[active] : null;\n const n = points.length;\n\n let body: ReactNode;\n if (loading) body = <View style={[styles.state, { backgroundColor: theme.surface2 }]} role=\"progressbar\" aria-label={labels.loading} />;\n else if (isEmpty)\n body = empty ?? (\n <View style={[styles.state, { borderColor: theme.borderDefault, borderWidth: StyleSheet.hairlineWidth, borderStyle: \"dashed\" }]}>\n <Text style={[styles.small, { color: theme.textSecondary }]}>{labels.empty}</Text>\n </View>\n );\n else body = width > 0 ? children(width, height) : null;\n\n return (\n <View style={[styles.root, style]}>\n {!hideTitle && (\n <Text style={[styles.title, { color: theme.textPrimary }]} role=\"heading\">\n {title}\n </Text>\n )}\n {legend}\n <Pressable\n onLayout={onLayout}\n style={{ height }}\n disabled={isEmpty || loading}\n onPress={(event) => indexAt && onActive(indexAt(event.nativeEvent.locationX, width))}\n accessible\n // With points to walk, an adjustable element (a slider on the web): its value is the active point.\n accessibilityRole={n ? \"adjustable\" : \"image\"}\n accessibilityLabel={`${title}. ${summary}`}\n accessibilityValue={n ? { min: 0, max: n - 1, now: active ?? 0, ...(readout ? { text: readout } : {}) } : undefined}\n // react-native-web reads the ARIA props (the slider's required value), React Native the accessibility ones.\n aria-valuemin={n ? 0 : undefined}\n aria-valuemax={n ? n - 1 : undefined}\n aria-valuenow={n ? (active ?? 0) : undefined}\n aria-valuetext={readout ?? undefined}\n accessibilityActions={n ? [{ name: \"increment\" }, { name: \"decrement\" }] : []}\n onAccessibilityAction={(event) => {\n if (!n) return;\n if (event.nativeEvent.actionName === \"increment\") onActive(Math.min(n - 1, (active ?? -1) + 1));\n if (event.nativeEvent.actionName === \"decrement\") onActive(Math.max(0, (active ?? n) - 1));\n }}\n >\n {body}\n </Pressable>\n {readout ? (\n <Text style={[styles.small, { color: theme.textSecondary }]} aria-hidden>\n {readout}\n </Text>\n ) : null}\n </View>\n );\n}\n\n/** The legend: a key in the series' colour beside its name in the text colour (two series or more). */\nexport function NativeLegend({ items, theme }: { items: readonly { label: string; color: string }[]; theme: ChartTheme }) {\n if (items.length < 2) return null;\n return (\n <View style={styles.legend} aria-hidden>\n {items.map((item) => (\n <View key={item.label} style={styles.legendItem}>\n <View style={[styles.key, { backgroundColor: item.color }]} />\n <Text style={[styles.small, { color: theme.textSecondary }]}>{item.label}</Text>\n </View>\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n root: { gap: 8 },\n title: { fontSize: 14, fontWeight: \"600\", lineHeight: 20 },\n small: { fontSize: 12, lineHeight: 16, fontVariant: [\"tabular-nums\"] },\n state: { flex: 1, borderRadius: 10, alignItems: \"center\", justifyContent: \"center\", padding: 16 },\n legend: { flexDirection: \"row\", flexWrap: \"wrap\", columnGap: 14, rowGap: 4 },\n legendItem: { flexDirection: \"row\", alignItems: \"center\", gap: 6 },\n key: { width: 10, height: 10, borderRadius: 3 },\n});\n","// The data palettes. One categorical set of eight hues, stepped for each theme (the dark steps are chosen for the\n// dark surface, not flipped), ordered per brand so that the first series wears the brand's own hue — Krizaka blue,\n// Orazaka orange, Orochia violet then magenta, its gradient. Every order was chosen among the ones that pass the\n// colour-vision checks (scripts/palette.test: lightness band, chroma floor, adjacent ΔE under protan/deutan ≥ 8 —\n// Orochia light 7.2, inside the 6–8 band that requires the secondary encoding every chart carries: legend, direct\n// labels, data table —, normal-vision ΔE ≥ 15, ≥ 3:1 on the surface, the first three slots distinct all-pairs).\n// A 9th series never gets a generated hue: it folds into “Other” or a second chart.\nimport type { BrandId } from \"./types\";\n\nexport type Mode = \"dark\" | \"light\";\n\n/** The eight hues, light and dark steps. */\nexport const HUES = {\n blue: { light: \"#2a78d6\", dark: \"#3987e5\" },\n orange: { light: \"#eb6834\", dark: \"#d95926\" },\n aqua: { light: \"#1baf7a\", dark: \"#199e70\" },\n yellow: { light: \"#eda100\", dark: \"#c98500\" },\n magenta: { light: \"#e87ba4\", dark: \"#d55181\" },\n green: { light: \"#008300\", dark: \"#008300\" },\n violet: { light: \"#6250d6\", dark: \"#9085e9\" },\n red: { light: \"#e34948\", dark: \"#e66767\" },\n} as const;\n\nexport type Hue = keyof typeof HUES;\n\n/** The order of the hues for each brand: slot 1 is the brand. */\nexport const ORDERS: Record<BrandId, readonly Hue[]> = {\n krizaka: [\"blue\", \"green\", \"magenta\", \"yellow\", \"aqua\", \"orange\", \"violet\", \"red\"],\n orazaka: [\"orange\", \"blue\", \"aqua\", \"yellow\", \"magenta\", \"green\", \"violet\", \"red\"],\n orochia: [\"violet\", \"magenta\", \"yellow\", \"aqua\", \"orange\", \"blue\", \"green\", \"red\"],\n};\n\n/** The categorical palette of a brand in a theme: eight hex colours, slot 1 first. */\nexport function palette(brand: BrandId, mode: Mode): string[] {\n return ORDERS[brand].map((hue) => HUES[hue][mode]);\n}\n\n/** The diverging poles (below / above the midpoint): blue ↔ red, a neutral grey between them. */\nexport const DIVERGING = {\n light: { low: HUES.blue.light, high: HUES.red.light },\n dark: { low: HUES.blue.dark, high: HUES.red.dark },\n} as const;\n\n// --- Colour arithmetic (OKLab), for the sequential ramps the canvas engine needs as plain colours. ---------------\n\ntype Rgb = [number, number, number];\n\n/** `#rrggbb`, `#rgb`, `rgb(r, g, b)` / `rgba(…)` or `rgb(r g b / a)` → [r, g, b] in 0–255; null otherwise. */\nexport function parseColor(color: string): Rgb | null {\n const hex = color.trim().match(/^#([\\da-f]{3}|[\\da-f]{6})$/i);\n if (hex) {\n const h = hex[1]!.length === 3 ? [...hex[1]!].map((c) => c + c).join(\"\") : hex[1]!;\n return [0, 2, 4].map((i) => Number.parseInt(h.slice(i, i + 2), 16)) as Rgb;\n }\n const rgb = color.trim().match(/^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)/i);\n if (rgb) return [Number(rgb[1]), Number(rgb[2]), Number(rgb[3])];\n return null;\n}\n\nconst toLinear = (c: number) => {\n const v = c / 255;\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;\n};\nconst fromLinear = (v: number) => {\n const c = v <= 0.0031308 ? v * 12.92 : 1.055 * v ** (1 / 2.4) - 0.055;\n return Math.round(Math.min(1, Math.max(0, c)) * 255);\n};\n\nfunction toOklab([r8, g8, b8]: Rgb): Rgb {\n const [r, g, b] = [toLinear(r8), toLinear(g8), toLinear(b8)];\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n return [0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s, 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s, 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s];\n}\n\nfunction fromOklab([L, a, b]: Rgb): Rgb {\n const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;\n const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;\n const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;\n return [\n fromLinear(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n fromLinear(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n fromLinear(-0.0041960863 * l - 0.7034186147 * m + 1.707614031 * s),\n ];\n}\n\nconst hex = ([r, g, b]: Rgb) => `#${[r, g, b].map((c) => c.toString(16).padStart(2, \"0\")).join(\"\")}`;\n\n/** `a` → `b` at `t` (0–1), interpolated in OKLab (even steps to the eye). Unparseable colours return `b`. */\nexport function mix(a: string, b: string, t: number): string {\n const ca = parseColor(a);\n const cb = parseColor(b);\n if (!ca || !cb) return b;\n const la = toOklab(ca);\n const lb = toOklab(cb);\n return hex(fromOklab([0, 1, 2].map((i) => la[i]! + (lb[i]! - la[i]!) * t) as Rgb));\n}\n\n/**\n * A sequential ramp of `steps` colours, one hue from near the surface (`0`, “almost nothing”) to the full hue: the\n * magnitude of a heatmap, a calendar or a choropleth. The first step is still distinct from the surface.\n */\nexport function sequential(hue: string, surface: string, steps = 5): string[] {\n return Array.from({ length: steps }, (_, i) => mix(surface, hue, 0.22 + (0.78 * i) / Math.max(1, steps - 1)));\n}\n\n/** WCAG contrast ratio between two colours (for the tests and the labels drawn inside a mark). */\nexport function contrast(a: string, b: string): number {\n const lum = (c: string) => {\n const rgb = parseColor(c);\n if (!rgb) return 0;\n const [r, g, bl] = rgb.map(toLinear) as Rgb;\n return 0.2126 * r + 0.7152 * g + 0.0722 * bl;\n };\n const [hi, lo] = [lum(a), lum(b)].sort((x, y) => y - x) as [number, number];\n return (hi + 0.05) / (lo + 0.05);\n}\n","// The ready-made charts for React Native, with the web's names and props: EarningsChart, JobThroughput, LatencyChart,\n// CreditUsage, GoalProgress, PriceTicker. Each one is a heading, its key figure in large (the first thing a phone\n// shows: the number before the chart) and the native chart under it — the same arithmetic as the web (src/needs).\nimport { StyleSheet, Text, View, type ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nimport { categoryFormatter, valueFormatter } from \"../core/format\";\nimport type { Accessor, CategoryFormat, Datum, SeriesSpec, Threshold, Tone, ValueFormat } from \"../core/types\";\nimport {\n CREDIT_LABELS,\n type CreditLabels,\n EARNINGS_LABELS,\n type EarningsLabels,\n GOAL_LABELS,\n type GoalLabels,\n LATENCY_LABELS,\n type LatencyLabels,\n THROUGHPUT_LABELS,\n type ThroughputLabels,\n TICKER_LABELS,\n type TickerLabels,\n} from \"../needs/labels\";\nimport { addDays, daysLeft, direction, fillIn, formatDuration, lastChange, numberOf, quotaLevel, roundMoney, signedPercent, successRate, total } from \"../needs/model\";\nimport { DEFAULT_STATUSES, type JobStatus } from \"../needs/statuses\";\nimport { type Bid, tickerModel } from \"../needs/ticker\";\nimport { BarChart, LineChart, type NativeCartesianProps } from \"./cartesian\";\nimport { type NativeChartsSettings, type NativeFrameProps, type Resolved, useNativeSettings } from \"./frame\";\nimport { Gauge, Sparkline } from \"./round\";\n\nconst ARROW = { up: \"M7 17 17 7M8 7h9v9\", down: \"M7 7l10 10M17 8v9H8\", flat: \"M5 12h14M13 6l6 6-6 6\" } as const;\n\nfunction toneColor(resolved: Resolved, tone: Tone) {\n return resolved.color(tone, 1);\n}\n\n/** The heading and the key figure of a ready-made chart: the value, what it is, the change in words (arrow decorative). */\nfunction Headline({\n resolved,\n title,\n hideTitle,\n value,\n label,\n delta,\n way,\n tone = \"neutral\",\n}: {\n resolved: Resolved;\n title: string;\n hideTitle?: boolean;\n value: string;\n label?: string;\n delta?: string | null;\n way?: \"up\" | \"down\" | \"flat\" | null;\n tone?: Tone;\n}) {\n const { theme } = resolved;\n return (\n <View style={styles.head}>\n {!hideTitle ? (\n <Text role=\"heading\" style={[styles.title, { color: theme.textPrimary }]}>\n {title}\n </Text>\n ) : null}\n <View style={styles.kpi}>\n <Text style={[styles.value, { color: theme.textPrimary }]}>{value}</Text>\n {label ? <Text style={[styles.small, { color: theme.textSecondary }]}>{label}</Text> : null}\n </View>\n {delta ? (\n <View style={styles.delta}>\n {way ? (\n <Svg width={12} height={12} viewBox=\"0 0 24 24\" aria-hidden>\n <Path d={ARROW[way]} fill=\"none\" stroke={toneColor(resolved, tone)} strokeWidth={2.5} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </Svg>\n ) : null}\n <Text style={[styles.small, styles.strong, { color: theme.textPrimary }]}>{delta}</Text>\n </View>\n ) : null}\n </View>\n );\n}\n\nconst good = (way: \"up\" | \"down\" | \"flat\" | null, up: boolean): Tone => (!way || way === \"flat\" ? \"neutral\" : (way === \"up\") === up ? \"success\" : \"danger\");\n\ntype Base<T extends Datum> = Omit<NativeCartesianProps<T>, \"y\" | \"yLabel\" | \"series\" | \"format\" | \"x\" | \"xFormat\" | \"thresholds\" | \"labels\">;\n\nexport interface NativeEarningsChartProps<T extends Datum> extends Base<T> {\n /** The field (or function) of the period. Default `\"month\"`. */\n x?: Accessor<T, unknown>;\n /** The net amount of each period, in minor units. */\n net: Accessor<T, number | null | undefined>;\n /** The gross amount, drawn beside the net. */\n gross?: Accessor<T, number | null | undefined>;\n /** The ISO 4217 currency. */\n currency: string;\n /** How the periods are written. Default `\"month\"`. */\n period?: CategoryFormat;\n /** The payout threshold, drawn as a line. */\n payoutThreshold?: Threshold;\n /** The words, passed translated. */\n labels?: Partial<EarningsLabels>;\n}\n\n/** Earnings per period in money (React Native): the total and the change first, the bars under them. */\nexport function EarningsChart<T extends Datum>({ x = \"month\" as Accessor<T, unknown>, net, gross, currency, period = \"month\", payoutThreshold, labels: given, title, hideTitle, data, ...props }: NativeEarningsChartProps<T>) {\n const words = { ...EARNINGS_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const format = { style: \"money\", currency } as const;\n const change = lastChange(data.map((row, i) => numberOf(row, net, i)));\n const way = direction(change);\n const series: SeriesSpec<T>[] = gross ? [{ key: gross, label: words.gross, color: 2 }, { key: net, label: words.net, color: 1 }] : [{ key: net, label: words.net, color: 1 }];\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={valueFormatter(format, resolved.locale)(total(data, net))}\n label={fillIn(words.total, { count: data.length })}\n delta={change == null ? null : fillIn(words.change, { change: signedPercent(change, resolved.locale) })}\n way={way}\n tone={good(way, true)}\n />\n <BarChart {...props} title={title} hideTitle data={data} x={x} series={series} format={format} xFormat={period} thresholds={payoutThreshold ? [{ tone: \"success\", ...payoutThreshold }] : undefined} />\n </View>\n );\n}\n\nexport interface NativeJobThroughputProps<T extends Datum> extends Base<T> {\n /** The field of the period. Default `\"day\"`. */\n x?: Accessor<T, unknown>;\n /** How the periods are written. Default `\"day\"`. */\n period?: CategoryFormat;\n /** The statuses, in stacking order. Default: completed, failed, running, queued. */\n statuses?: readonly JobStatus[];\n /** The words, passed translated. */\n labels?: Partial<ThroughputLabels>;\n}\n\n/** Jobs per period stacked by status (React Native): the total and the success rate first. */\nexport function JobThroughput<T extends Datum>({ x = \"day\" as Accessor<T, unknown>, period = \"day\", statuses = DEFAULT_STATUSES, labels: given, title, hideTitle, data, ...props }: NativeJobThroughputProps<T>) {\n const words = { ...THROUGHPUT_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const sum = (outcome?: \"succeeded\" | \"failed\") => statuses.filter((s) => outcome === undefined || s.outcome === outcome).reduce((n, s) => n + total(data, s.key as Accessor<T, number>), 0);\n const rate = successRate(sum(\"succeeded\"), sum(\"failed\"));\n const series = statuses.map((s) => ({ key: s.key as Accessor<T, number | null | undefined>, label: s.label, color: s.tone }));\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={valueFormatter(\"integer\", resolved.locale)(sum())}\n label={fillIn(words.total, { count: data.length })}\n delta={rate == null ? null : fillIn(words.success, { rate: valueFormatter(\"percent\", resolved.locale)(rate) })}\n />\n <BarChart {...props} title={title} hideTitle data={data} x={x} xFormat={period} series={series} format=\"integer\" stacked />\n </View>\n );\n}\n\nexport interface NativeLatencyChartProps<T extends Datum> extends Base<T> {\n /** The field naming what is measured. Default `\"name\"`. */\n x?: Accessor<T, unknown>;\n /** The median, in milliseconds. Default `\"p50\"`. */\n p50?: Accessor<T, number | null | undefined>;\n /** The 95th percentile, in milliseconds. Default `\"p95\"`; `null` for the median alone. */\n p95?: Accessor<T, number | null | undefined> | null;\n /** The service objective, in milliseconds. */\n objective?: { readonly value: number; readonly label: string };\n /** The words, passed translated. */\n labels?: Partial<LatencyLabels>;\n}\n\n/** Median and p95 latency per item (React Native, vertical bars): the slowest p95 first. */\nexport function LatencyChart<T extends Datum>({\n x = \"name\" as Accessor<T, unknown>,\n p50 = \"p50\" as Accessor<T, number | null | undefined>,\n p95 = \"p95\" as Accessor<T, number | null | undefined>,\n objective,\n labels: given,\n title,\n hideTitle,\n data,\n ...props\n}: NativeLatencyChartProps<T>) {\n const words = { ...LATENCY_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const tail = p95 ?? p50;\n const measured = data.map((row, i) => ({ row, i, value: numberOf(row, tail, i) ?? 0 }));\n const slowest = measured.reduce<(typeof measured)[number] | null>((a, m) => (!a || m.value > a.value ? m : a), null);\n const over = objective ? measured.filter((m) => m.value > objective.value).length : 0;\n const nameOf = (row: T, i: number) => String(typeof x === \"function\" ? x(row, i) : (row as Record<string, unknown>)[x]);\n const series: SeriesSpec<T>[] = [{ key: p50, label: words.p50, color: \"neutral\" }, ...(p95 ? [{ key: p95, label: words.p95, color: 1 as const }] : [])];\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={slowest ? formatDuration(slowest.value, resolved.locale) : \"—\"}\n label={slowest ? fillIn(words.slowest, { name: nameOf(slowest.row, slowest.i) }) : undefined}\n delta={objective ? (over > 0 ? fillIn(words.over, { count: over }) : words.within) : null}\n way={objective ? (over > 0 ? \"up\" : \"flat\") : null}\n tone={over > 0 ? \"danger\" : \"success\"}\n />\n <BarChart\n {...props}\n title={title}\n hideTitle\n data={data}\n x={x}\n series={series}\n format={(value, l) => formatDuration(value, l)}\n thresholds={objective ? [{ ...objective, tone: \"danger\" }] : undefined}\n />\n </View>\n );\n}\n\nexport interface NativeCreditUsageProps extends Omit<NativeChartsSettings, \"labels\"> {\n /** What the allowance is: the heading and the meter's name. */\n title: string;\n /** Hide the heading (it stays the accessible name). */\n hideTitle?: boolean;\n /** How much is used. */\n used: number;\n /** The allowance. */\n limit: number;\n /** How the amounts are written. Default `\"integer\"`. */\n format?: ValueFormat;\n /** The use of each recent day, oldest first. */\n daily?: readonly (number | null)[];\n /** When the allowance renews. */\n renewsAt?: string | Date;\n /** Today, for the projection. Default: now. */\n now?: Date;\n /** The shares where the meter turns to warning, then danger. Default `[0.8, 0.95]`. */\n levels?: readonly [number, number];\n /** The words, passed translated. */\n labels?: Partial<CreditLabels>;\n /** The style of the container (layout only). */\n style?: ViewStyle;\n}\n\n/** What is left of an allowance (React Native): the remaining amount, a meter in tones, the use per day, the run-out date. */\nexport function CreditUsage({ title, hideTitle, used, limit, format = \"integer\", daily, renewsAt, now, levels = [0.8, 0.95], labels: given, style, ...settings }: NativeCreditUsageProps) {\n const words = { ...CREDIT_LABELS, ...given };\n const resolved = useNativeSettings(settings);\n const { theme, locale } = resolved;\n const write = valueFormatter(format, locale);\n const date = categoryFormatter(\"date\", locale);\n const ratio = limit > 0 ? Math.min(1, Math.max(0, used / limit)) : 0;\n const level = quotaLevel(ratio, levels[0], levels[1]);\n const remaining = Math.max(0, limit - used);\n const usedText = fillIn(words.used, { used: write(used), percent: valueFormatter(\"percent\", locale)(ratio) });\n const left = daily ? daysLeft(remaining, daily) : null;\n const runOut = left == null ? null : addDays(now ?? new Date(), left);\n const renews = renewsAt ? new Date(renewsAt) : null;\n const projection = daily ? (runOut && (!renews || runOut < renews) ? fillIn(words.runsOut, { date: date(runOut) }) : left == null ? words.steady : null) : null;\n const fill = level === \"danger\" ? theme.danger : level === \"warning\" ? theme.warning : theme.accent;\n return (\n <View style={[styles.root, style]}>\n <Headline resolved={resolved} title={title} hideTitle={hideTitle} value={write(remaining)} label={fillIn(words.remaining, { limit: write(limit) })} />\n <View\n role=\"meter\"\n aria-label={title}\n aria-valuemin={0}\n aria-valuemax={limit}\n aria-valuenow={Math.min(limit, Math.max(0, used))}\n aria-valuetext={usedText}\n accessible\n style={[styles.meter, { backgroundColor: theme.surface3 }]}\n >\n <View style={[styles.meterFill, { width: `${ratio * 100}%`, backgroundColor: fill }]} />\n </View>\n <View style={styles.row}>\n <Text style={[styles.small, { color: theme.textSecondary }]}>{usedText}</Text>\n {renews ? <Text style={[styles.small, { color: theme.textSecondary }]}>{fillIn(words.renews, { date: date(renews) })}</Text> : null}\n </View>\n {daily && daily.length > 1 ? <Sparkline {...settings} title={words.daily} data={daily} variant=\"bar\" format={format} height={36} /> : null}\n {projection ? <Text style={[styles.small, styles.strong, { color: theme.textPrimary }]}>{projection}</Text> : null}\n </View>\n );\n}\n\nexport interface NativeGoalProgressProps extends Omit<NativeFrameProps, \"loading\" | \"empty\" | \"labels\"> {\n /** The amount raised, in minor units. */\n raised: number;\n /** The goal, in minor units. */\n goal: number;\n /** The ISO 4217 currency. */\n currency: string;\n /** How many people chipped in. */\n supporters?: number;\n /** The time left, written by the app (“2 days”). */\n timeLeft?: string;\n /** The words, passed translated. */\n labels?: Partial<GoalLabels>;\n}\n\n/** A pot towards its goal, in money (React Native): the arc fills, the words say how much of what. */\nexport function GoalProgress({ raised, goal, currency, supporters, timeLeft, labels: given, ...props }: NativeGoalProgressProps) {\n const words = { ...GOAL_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const format = roundMoney(currency);\n const reached = goal > 0 && raised >= goal;\n const facts = [\n supporters != null ? fillIn(words.supporters, { count: valueFormatter(\"integer\", resolved.locale)(supporters) }) : null,\n reached ? words.reached : null,\n timeLeft ? fillIn(words.left, { time: timeLeft }) : null,\n ].filter(Boolean);\n return (\n <View style={styles.root}>\n <Gauge {...props} value={raised} max={goal} format={format} caption={fillIn(words.raised, { goal: valueFormatter(format, resolved.locale)(goal) })} tone={reached ? \"success\" : \"accent\"} />\n {facts.length > 0 ? <Text style={[styles.small, { color: resolved.theme.textSecondary, textAlign: \"center\" }]}>{facts.join(\" · \")}</Text> : null}\n </View>\n );\n}\n\nexport interface NativePriceTickerProps extends Omit<NativeFrameProps, \"loading\" | \"labels\"> {\n /** The bids, in any order. */\n bids: readonly Bid[];\n /** The opening price, in minor units. */\n opening: number;\n /** When the auction opened. */\n openedAt?: string | Date;\n /** The ISO 4217 currency. */\n currency: string;\n /** The reserve price, drawn as a line until it is met. */\n reserve?: number;\n /** How the times are written. Default `\"time\"`. */\n timeFormat?: CategoryFormat;\n /** The words, passed translated. */\n labels?: Partial<TickerLabels>;\n}\n\n/** A live auction's price (React Native): the current bid in large, the change since the opening, the steps of the bids. */\nexport function PriceTicker({ bids, opening, openedAt, currency, reserve, timeFormat = \"time\", labels: given, title, hideTitle, ...props }: NativePriceTickerProps) {\n const words = { ...TICKER_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const format = { style: \"money\", currency } as const;\n const write = valueFormatter(format, resolved.locale);\n const model = tickerModel(bids, opening, openedAt);\n const way = model.count > 0 ? direction(model.ratio) : null;\n const signed = `${model.change > 0 ? \"+\" : \"\"}${write(model.change)}`;\n const change = model.ratio == null ? signed : `${signed} (${signedPercent(model.ratio, resolved.locale)})`;\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={write(model.current)}\n label={model.count > 0 ? words.current : words.opening}\n delta={model.count > 0 ? fillIn(words.change, { change, count: model.count }) : null}\n way={way}\n tone={good(way, true)}\n />\n <LineChart\n {...props}\n title={title}\n hideTitle\n data={model.points as { at: string | Date; amount: number }[]}\n x=\"at\"\n y=\"amount\"\n yLabel={words.price}\n xFormat={timeFormat}\n format={format}\n curve=\"step\"\n thresholds={reserve != null && model.current < reserve ? [{ value: reserve, label: words.reserve, tone: \"warning\" }] : undefined}\n />\n </View>\n );\n}\n\n\nconst styles = StyleSheet.create({\n root: { gap: 8 },\n head: { gap: 2 },\n title: { fontSize: 14, fontWeight: \"600\", lineHeight: 20 },\n kpi: { flexDirection: \"row\", flexWrap: \"wrap\", alignItems: \"baseline\", columnGap: 8 },\n value: { fontSize: 24, lineHeight: 30, fontWeight: \"800\", fontVariant: [\"tabular-nums\"] },\n delta: { flexDirection: \"row\", alignItems: \"center\", gap: 4 },\n small: { fontSize: 12, lineHeight: 16, fontVariant: [\"tabular-nums\"] },\n strong: { fontWeight: \"600\" },\n meter: { height: 10, borderRadius: 999, overflow: \"hidden\" },\n meterFill: { height: \"100%\", borderRadius: 999 },\n row: { flexDirection: \"row\", flexWrap: \"wrap\", justifyContent: \"space-between\", columnGap: 12 },\n});\n","// The words of the ready-made charts: English by default, an app passes its own (translated) through `labels`.\n// Placeholders are written `{name}`.\n\nexport interface EarningsLabels {\n /** Under the total: `earned over {count} months`. `{count}` is the number of periods. */\n total: string;\n /** The change of the last period: `{change} vs the previous month`. */\n change: string;\n /** The gross series' name. */\n gross: string;\n /** The net series' name. */\n net: string;\n}\n\nexport const EARNINGS_LABELS: EarningsLabels = {\n total: \"earned over {count} periods\",\n change: \"{change} vs the previous period\",\n gross: \"Gross\",\n net: \"Net\",\n};\n\nexport interface ThroughputLabels {\n /** Under the total: `jobs over {count} days`. */\n total: string;\n /** The success rate of the finished jobs: `{rate} succeeded`. */\n success: string;\n}\n\nexport const THROUGHPUT_LABELS: ThroughputLabels = { total: \"jobs over {count} periods\", success: \"{rate} succeeded\" };\n\nexport interface LatencyLabels {\n /** The median series. */\n p50: string;\n /** The 95th percentile series. */\n p95: string;\n /** The slowest p95: `slowest: {name}`. */\n slowest: string;\n /** How many go past the objective: `{count} over the objective`. */\n over: string;\n /** All within the objective. */\n within: string;\n}\n\nexport const LATENCY_LABELS: LatencyLabels = {\n p50: \"Median (p50)\",\n p95: \"p95\",\n slowest: \"p95 of {name}, the slowest\",\n over: \"{count} over the objective\",\n within: \"all within the objective\",\n};\n\nexport interface CreditLabels {\n /** Under the remaining amount: `left of {limit}`. */\n remaining: string;\n /** The used part: `{used} used ({percent})`. */\n used: string;\n /** The projection: `at this pace, runs out on {date}`. */\n runsOut: string;\n /** No use lately: it does not run out. */\n steady: string;\n /** The renewal: `renews on {date}`. */\n renews: string;\n /** The daily use sparkline's title. */\n daily: string;\n}\n\nexport const CREDIT_LABELS: CreditLabels = {\n remaining: \"left of {limit}\",\n used: \"{used} used ({percent})\",\n runsOut: \"At this pace, runs out on {date}\",\n steady: \"No use lately\",\n renews: \"Renews on {date}\",\n daily: \"Use per day\",\n};\n\nexport interface GoalLabels {\n /** Under the amount: `raised of {goal}`. */\n raised: string;\n /** Reached: `goal reached`. */\n reached: string;\n /** The supporters: `{count} supporters`. */\n supporters: string;\n /** The time left: `{time} left`. */\n left: string;\n}\n\nexport const GOAL_LABELS: GoalLabels = { raised: \"raised of {goal}\", reached: \"Goal reached\", supporters: \"{count} supporters\", left: \"{time} left\" };\n\nexport interface TickerLabels {\n /** Under the price: `current bid`. */\n current: string;\n /** The change since the opening: `{change} since the opening ({count} bids)`. */\n change: string;\n /** No bid yet: `opening price`. */\n opening: string;\n /** The reserve line. */\n reserve: string;\n /** The series' name. */\n price: string;\n}\n\nexport const TICKER_LABELS: TickerLabels = {\n current: \"current bid\",\n change: \"{change} since the opening · {count} bids\",\n opening: \"opening price, no bid yet\",\n reserve: \"Reserve price\",\n price: \"Price\",\n};\n","// The arithmetic of the ready-made charts (EarningsChart, JobThroughput, LatencyChart, CreditUsage, GoalProgress,\n// PriceTicker), shared by the web and React Native: totals, the change between the last two periods, a success rate,\n// the day a balance runs out at the current pace. Pure functions: no React, no DOM.\nimport { currencyDigits, getNumberFormat } from \"@krizaka/intl\";\n\nimport type { Accessor, Datum, Locale } from \"../core/types\";\n\n/** Reads a field (or calls a function) of a row; `null` for anything that is not a finite number. */\nexport function numberOf<T extends Datum>(row: T, accessor: Accessor<T, number | null | undefined>, index: number): number | null {\n const value = typeof accessor === \"function\" ? accessor(row, index) : (row as Record<string, unknown>)[accessor];\n return typeof value === \"number\" && Number.isFinite(value) ? value : null;\n}\n\n/** The sum of a column, `null` values left out. */\nexport function total<T extends Datum>(rows: readonly T[], accessor: Accessor<T, number | null | undefined>): number {\n return rows.reduce((sum, row, i) => sum + (numberOf(row, accessor, i) ?? 0), 0);\n}\n\n/**\n * The change of the last period against the one before, as a ratio (`0.12` = +12 %): `null` when it cannot be said\n * (fewer than two periods, a previous period at zero or missing).\n */\nexport function lastChange(values: readonly (number | null)[]): number | null {\n if (values.length < 2) return null;\n const last = values[values.length - 1];\n const previous = values[values.length - 2];\n if (last == null || previous == null || previous === 0) return null;\n return last / previous - 1;\n}\n\n/** `up`, `down` or `flat` (within ±0.5 %): the direction of a change, `null` when there is none. */\nexport function direction(change: number | null): \"up\" | \"down\" | \"flat\" | null {\n if (change == null) return null;\n return Math.abs(change) < 0.005 ? \"flat\" : change > 0 ? \"up\" : \"down\";\n}\n\n/** Succeeded out of finished (succeeded + failed); `null` when nothing finished. */\nexport function successRate(succeeded: number, failed: number): number | null {\n const finished = succeeded + failed;\n return finished > 0 ? succeeded / finished : null;\n}\n\n/**\n * When a balance runs out at the pace of the last `days` days of use (oldest first): the number of whole days left,\n * or `null` when nothing is being used (it never runs out) or there is no history.\n */\nexport function daysLeft(remaining: number, daily: readonly (number | null)[], days = 7): number | null {\n const recent = daily.slice(-days).filter((v): v is number => v != null && v >= 0);\n if (recent.length === 0) return null;\n const pace = recent.reduce((a, b) => a + b, 0) / recent.length;\n if (pace <= 0) return null;\n return Math.max(0, Math.floor(remaining / pace));\n}\n\n/** `from` + `days` days, at the same time of day. */\nexport const addDays = (from: Date, days: number) => new Date(from.getTime() + days * 86_400_000);\n\n/** The level of a quota: `ok` below `warning` (default 0.8), `warning` below `danger` (0.95), then `danger`. */\nexport function quotaLevel(ratio: number, warning = 0.8, danger = 0.95): \"ok\" | \"warning\" | \"danger\" {\n return ratio >= danger ? \"danger\" : ratio >= warning ? \"warning\" : \"ok\";\n}\n\n/** Replaces `{name}` placeholders. */\nexport function fillIn(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match, key: string) => (key in values ? String(values[key]) : match));\n}\n\n/** A signed ratio as a percentage for a change (`+12 %`, `−3 %`), in the locale's way. */\nexport function signedPercent(change: number, locale: Locale): string {\n return getNumberFormat(locale, { style: \"percent\", signDisplay: \"exceptZero\", maximumFractionDigits: Math.abs(change) < 0.1 ? 1 : 0 }).format(change);\n}\n\n/** Milliseconds as a duration: `840 ms`, `1.2 s`, `2.5 min` — the unit follows the size, through Intl. */\nexport function formatDuration(ms: number, locale: Locale): string {\n const unit = (value: number, name: string, digits: number) =>\n getNumberFormat(locale, { style: \"unit\", unit: name, unitDisplay: \"short\", maximumFractionDigits: digits }).format(value);\n const abs = Math.abs(ms);\n if (abs < 1000) return unit(Math.round(ms), \"millisecond\", 0);\n if (abs < 60_000) return unit(ms / 1000, \"second\", abs < 10_000 ? 1 : 0);\n if (abs < 3_600_000) return unit(ms / 60_000, \"minute\", 1);\n return unit(ms / 3_600_000, \"hour\", 1);\n}\n\n/** Money in minor units, without the cents of a round amount (`$500`, `$262.50`): a goal reads as people say it. */\nexport function roundMoney(currency: string): (value: number, locale: Locale) => string {\n const digits = currencyDigits(currency);\n return (value, locale) => {\n const minor = Math.round(value);\n const whole = minor % 10 ** digits === 0;\n return getNumberFormat(locale, { style: \"currency\", currency, minimumFractionDigits: whole ? 0 : digits, maximumFractionDigits: whole ? 0 : digits }).format(minor / 10 ** digits);\n };\n}\n","// The price of a live auction, shared by the web and React Native: the points to draw (the opening, then each bid)\n// and what the headline says (the current price, the change since the opening, the number of bids).\n\n/** A bid: when (an ISO date-time or a `Date`) and how much, in money minor units. */\nexport interface Bid {\n readonly at: string | Date;\n readonly amount: number;\n}\n\nexport interface TickerModel {\n readonly points: readonly { readonly at: string | Date; readonly amount: number }[];\n readonly current: number;\n readonly change: number;\n readonly ratio: number | null;\n readonly count: number;\n}\n\n/** The opening point (when `openedAt` is known), then the bids in time order. */\nexport function tickerModel(bids: readonly Bid[], opening: number, openedAt?: string | Date): TickerModel {\n const sorted = [...bids].sort((a, b) => new Date(a.at).getTime() - new Date(b.at).getTime());\n const points = [...(openedAt ? [{ at: openedAt, amount: opening }] : []), ...sorted];\n const current = sorted.length > 0 ? sorted[sorted.length - 1].amount : opening;\n return { points, current, change: current - opening, ratio: opening > 0 ? current / opening - 1 : null, count: sorted.length };\n}\n","// PieChart, DonutChart, Gauge and Sparkline for React Native: the web's props, the same geometry (src/core).\nimport { useMemo, useState } from \"react\";\nimport Svg, { Circle, Line, Path, Text as SvgText } from \"react-native-svg\";\n\nimport { read } from \"../core/data\";\nimport { describeParts, describeSeries } from \"../core/describe\";\nimport { categoryFormatter, shareFormatter, valueFormatter } from \"../core/format\";\nimport { arcPath, areaPath, barPath, linePath, type Point, polar, segments, strokeArcPath } from \"../core/shape\";\nimport type { Accessor, Datum, SeriesColor, Threshold, Tone, ValueFormat } from \"../core/types\";\nimport { NativeFrame, type NativeFrameProps, NativeLegend, useNativeSettings } from \"./frame\";\n\nexport interface NativePieChartProps<T extends Datum> extends NativeFrameProps {\n/** One row per part. */\n data: readonly T[];\n /** The field naming the part. */\n label: Accessor<T, string>;\n /** The field of its amount. */\n value: Accessor<T, number>;\n/** How the amounts are written. */\n format?: ValueFormat;\n /** A ring with the total in its hole. */\n donut?: boolean;\n /** The words under the total of a donut. */\n centerLabel?: string;\n /** At most this many slices; the rest fold into `otherLabel`. Default 6. */\n maxSlices?: number;\n/** The name of the folded slice. Default “Other”. */\n otherLabel?: string;\n}\n\n/** Part of a whole (React Native). */\nexport function PieChart<T extends Datum>(props: NativePieChartProps<T>) {\n const { data, label, value, format, donut, centerLabel, maxSlices = 6, otherLabel = \"Other\" } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, theme, color } = resolved;\n const fmt = useMemo(() => ({ value: valueFormatter(format, locale, labels.noValue), share: shareFormatter(locale) }), [format, locale, labels.noValue]);\n const slices = useMemo(() => {\n const rows = data.map((d, i) => ({ label: read(label, d, i), value: Math.max(0, Number(read(value, d, i)) || 0) })).sort((a, b) => b.value - a.value);\n const kept = rows.length > maxSlices ? rows.slice(0, maxSlices - 1) : rows;\n const out = kept.map((r, i) => ({ ...r, color: color(undefined, i + 1) }));\n if (rows.length > maxSlices) out.push({ label: otherLabel, value: rows.slice(maxSlices - 1).reduce((s, r) => s + r.value, 0), color: theme.textMuted });\n return out;\n }, [data, label, value, maxSlices, otherLabel, color, theme.textMuted]);\n const total = slices.reduce((s, x) => s + x.value, 0);\n const [active, setActive] = useState<number | null>(null);\n const isEmpty = total <= 0;\n const summary = isEmpty ? labels.empty : describeParts(donut ? \"donut\" : \"pie\", slices, { labels, value: fmt.value, share: fmt.share });\n return (\n <NativeFrame\n frame={props}\n defaultHeight={200}\n resolved={resolved}\n summary={summary}\n isEmpty={isEmpty}\n points={slices.map((s) => `${s.label}: ${fmt.value(s.value)} (${fmt.share(total ? s.value / total : 0)})`)}\n active={active}\n onActive={setActive}\n legend={<NativeLegend theme={theme} items={slices.map((s) => ({ label: `${s.label} · ${fmt.share(total ? s.value / total : 0)}`, color: s.color }))} />}\n >\n {(width, height) => {\n const radius = Math.max(10, Math.min(width, height) / 2 - 6);\n const inner = donut ? radius * 0.64 : 0;\n let angle = 0;\n return (\n <Svg width={width} height={height}>\n {slices.map((s, i) => {\n const start = angle;\n angle += total ? (s.value / total) * Math.PI * 2 : 0;\n return <Path key={s.label} d={arcPath(width / 2, height / 2, inner, radius, start, angle)} fill={s.color} stroke={theme.surface1} strokeWidth={slices.length > 1 ? 2 : 0} opacity={active !== null && active !== i ? 0.4 : 1} />;\n })}\n {donut && (\n <SvgText x={width / 2} y={height / 2 + (centerLabel ? 0 : 7)} fontSize={Math.max(14, Math.min(24, inner / 3))} fontWeight=\"600\" fill={theme.textPrimary} textAnchor=\"middle\">\n {fmt.value(total)}\n </SvgText>\n )}\n {donut && centerLabel ? (\n <SvgText x={width / 2} y={height / 2 + 18} fontSize={11} fill={theme.textSecondary} textAnchor=\"middle\">\n {centerLabel}\n </SvgText>\n ) : null}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n\n/** A pie with a hole (React Native). */\nexport function DonutChart<T extends Datum>(props: Omit<NativePieChartProps<T>, \"donut\">) {\n return <PieChart {...props} donut />;\n}\n\nexport interface NativeGaugeProps extends NativeFrameProps {\n/** The value. */\n value: number;\n/** The start of the range. Default 0. */\n min?: number;\n/** The end of the range. Default 100. */\n max?: number;\n/** How the value is written. */\n format?: ValueFormat;\n /** The words under the value. */\n caption?: string;\n /** A tick on the arc: the objective. */\n target?: Threshold;\n /** Zones: the value takes the tone of the zone it is in. */\n zones?: readonly { readonly to: number; readonly tone: Tone; readonly label?: string }[];\n/** The tone of the value without zones. Default `\"accent\"`. */\n tone?: Tone;\n}\n\nconst START = (-120 * Math.PI) / 180;\nconst END = (120 * Math.PI) / 180;\n\n/** One figure against its range (React Native). */\nexport function Gauge(props: NativeGaugeProps) {\n const { value, min = 0, max = 100, format, caption, target, zones = [], tone = \"accent\" } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, theme, color } = resolved;\n const fmt = valueFormatter(format, locale, labels.noValue);\n const clamped = Math.min(max, Math.max(min, value));\n const zone = zones.find((z) => clamped <= z.to) ?? zones[zones.length - 1];\n const at = (v: number) => START + ((Math.min(max, Math.max(min, v)) - min) / (max - min || 1)) * (END - START);\n const text = fmt(value);\n return (\n <NativeFrame\n frame={props}\n defaultHeight={170}\n resolved={resolved}\n summary={`${labels.kinds.gauge}: ${text} / ${fmt(max)}${zone?.label ? `, ${zone.label}` : \"\"}.`}\n isEmpty={false}\n points={[]}\n active={null}\n onActive={() => {}}\n >\n {(width, height) => {\n const radius = Math.max(20, Math.min(width / 2 - 12, (height - 16) / 1.58));\n const cx = width / 2;\n const cy = 8 + radius;\n const stroke = Math.max(8, radius * 0.16);\n const [tx0, ty0] = target ? polar(cx, cy, radius - stroke, at(target.value)) : [0, 0];\n const [tx1, ty1] = target ? polar(cx, cy, radius + stroke, at(target.value)) : [0, 0];\n return (\n <Svg width={width} height={height}>\n <Path d={strokeArcPath(cx, cy, radius, START, END)} stroke={theme.surface3} strokeWidth={stroke} strokeLinecap=\"round\" fill=\"none\" />\n {clamped > min && <Path d={strokeArcPath(cx, cy, radius, START, at(clamped))} stroke={color(zone?.tone ?? tone, 1)} strokeWidth={stroke} strokeLinecap=\"round\" fill=\"none\" />}\n {target && <Line x1={tx0} y1={ty0} x2={tx1} y2={ty1} stroke={theme.textPrimary} strokeWidth={2} strokeLinecap=\"round\" />}\n <SvgText x={cx} y={cy + 8} fontSize={Math.max(12, Math.min(30, radius / 2.6, (radius * 1.45) / (text.length * 0.58)))} fontWeight=\"600\" fill={theme.textPrimary} textAnchor=\"middle\">\n {text}\n </SvgText>\n {caption ? (\n <SvgText x={cx} y={cy + Math.max(26, radius / 2.4)} fontSize={11} fill={theme.textSecondary} textAnchor=\"middle\">\n {caption}\n </SvgText>\n ) : null}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n\nexport interface NativeSparklineProps extends Omit<NativeFrameProps, \"hideTitle\"> {\n /** The values, oldest first (`null` for a gap). */\n data: readonly (number | null)[];\n/** The labels of the values (dates), for the summary. */\n categories?: readonly unknown[];\n/** `line` (default), `area` or `bar`. */\n variant?: \"line\" | \"area\" | \"bar\";\n/** A palette slot, a tone or a colour. */\n color?: SeriesColor;\n /** Colour by the trend (success up, danger down; `\"inverse\"` for costs). */\n trendTone?: boolean | \"inverse\";\n/** How the values are written in the summary. */\n format?: ValueFormat;\n /** A fixed width. Default: the container's. */\n width?: number;\n}\n\n/** A word-sized trend (React Native). */\nexport function Sparkline(props: NativeSparklineProps) {\n const { data, categories, variant = \"line\", color: own, trendTone, format, width: fixed, height = 32 } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, color } = resolved;\n const fmt = useMemo(() => ({ value: valueFormatter(format, locale, labels.noValue), category: categoryFormatter(undefined, locale), share: shareFormatter(locale) }), [format, locale, labels.noValue]);\n const values = data.filter((v): v is number => v != null);\n const table = { categories: categories ?? data.map((_, i) => i + 1), series: [{ id: \"v\", label: props.title, values: data, slot: 1 }] };\n const isEmpty = values.length === 0;\n const up = (values[values.length - 1] ?? 0) >= (values[0] ?? 0);\n const stroke = color(own ?? (trendTone ? ((trendTone === \"inverse\" ? !up : up) ? \"success\" : \"danger\") : undefined), 1);\n return (\n <NativeFrame\n frame={{ ...props, hideTitle: true, height, style: { ...(fixed ? { width: fixed } : {}), ...props.style } }}\n defaultHeight={32}\n resolved={resolved}\n summary={isEmpty ? labels.empty : describeSeries(table, { kind: \"sparkline\", labels, value: fmt.value, category: fmt.category, share: fmt.share })}\n isEmpty={isEmpty}\n points={[]}\n active={null}\n onActive={() => {}}\n >\n {(width, h) => {\n const lo = variant === \"bar\" ? Math.min(0, ...values) : Math.min(...values);\n const hi = variant === \"bar\" ? Math.max(0, ...values) : Math.max(...values);\n const yOf = (v: number) => 3 + (1 - (v - lo) / (hi - lo || 1)) * (h - 6);\n const n = data.length;\n const xOf = (i: number) => (variant === \"bar\" ? (i + 0.5) * (width / n) : n > 1 ? 3 + (i / (n - 1)) * (width - 6) : width / 2);\n const pts = data.map((v, i) => (v == null ? null : ([xOf(i), yOf(v)] as Point)));\n const last = [...pts].reverse().find(Boolean);\n return (\n <Svg width={width} height={h}>\n {variant === \"bar\"\n ? data.map((v, i) => (v == null || v === 0 ? null : <Path key={i} d={barPath(xOf(i) - Math.min(4, width / n / 3), Math.min(yOf(v), yOf(0)), Math.min(8, (width / n) * 0.7), Math.abs(yOf(v) - yOf(0)), 1.5)} fill={stroke} />))\n : segments(pts).map((seg) => [\n variant === \"area\" ? <Path key={`a${seg[0]![0]}`} d={areaPath(seg, h)} fill={stroke} opacity={0.14} /> : null,\n <Path key={`l${seg[0]![0]}`} d={linePath(seg)} stroke={stroke} strokeWidth={1.75} fill=\"none\" strokeLinecap=\"round\" />,\n ])}\n {variant !== \"bar\" && last ? <Circle cx={last[0]} cy={last[1]} r={2.75} fill={stroke} /> : null}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n"],"mappings":";AAgGO,IAAM,iBAA8B;AAAA,EACzC,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA,IACX,OAAO;AAAA,IACP,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAAS;AAAA,IACT,SAAS;AAAA,IACT,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAA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Q,IAAI,cAAc,KAAK,UAAU,SAAS;AAAA,EAC3D,WAAW,EAAE,QAAQ,QAAQ,cAAc,IAAI;AAAA,EAC/C,KAAK,EAAE,eAAe,OAAO,UAAU,QAAQ,gBAAgB,iBAAiB,WAAW,GAAG;AAChG,CAAC;","names":["useMemo","useState","total","total","options","d","jsx","jsxs","useMemo","useState","StyleSheet","Text","View","Svg","Path","currencyDigits","getNumberFormat","useMemo","useState","Svg","Circle","Line","Path","SvgText","jsx","jsxs","useMemo","r","total","useState","Svg","Path","SvgText","Line","Circle","jsx","jsxs","View","styles","Text","Svg","Path","fill","StyleSheet"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/labels.ts","../src/needs/statuses.ts","../src/native/cartesian.tsx","../src/core/data.ts","../src/core/describe.ts","../src/core/format.ts","../src/core/scale.ts","../src/core/shape.ts","../../tokens/dist/native.js","../src/native/frame.tsx","../src/core/palette.ts","../src/native/needs.tsx","../src/needs/labels.ts","../src/needs/model.ts","../src/needs/ticker.ts","../src/native/round.tsx"],"sourcesContent":["// The words a chart says on its own: its controls, its states and its written summary. English by default; an app\n// passes its own (translated through its catalogue) once, to `ChartsProvider labels`, or to one chart's `labels`.\n// Placeholders are written `{name}`.\n\nexport interface ChartLabels {\n /** The button that shows the data table. */\n showData: string;\n /** The button that hides it. */\n hideData: string;\n /** The caption of the data table: `{title}`. */\n tableCaption: string;\n /** The export buttons. */\n exportPng: string;\n exportSvg: string;\n exportCsv: string;\n /** The actions menu (⋯) of a chart: its accessible name, and its entries. */\n actions: string;\n viewTable: string;\n downloadCsv: string;\n downloadPng: string;\n downloadSvg: string;\n copyData: string;\n /** Announced once the data is on the clipboard. */\n copied: string;\n /** The close button of the table sheet. */\n close: string;\n /** The sheet's description: `{count}` rows. */\n tableRows: string;\n /** Legend chips filter: the chip's accessible name, `{label}`. */\n toggleSeries: string;\n /** Sparse data: under the chart, `{count}` periods with data out of `{total}`. */\n sparse: string;\n /** A KPI's change: `{change}` (`+12 %`) against the previous period. */\n trendVsPrevious: string;\n /** Announced while the data loads. */\n loading: string;\n /** Shown when there is nothing to draw. */\n empty: string;\n /** Shown when the data could not be loaded. */\n error: string;\n /** The keyboard hint, read once when the plot takes the focus. */\n keyboardHint: string;\n /** The role description of the plot (`chart`). */\n roleDescription: string;\n /** Summary pieces. `{kind}` is the chart's name (`Line chart`), `{count}` a number of points or series. */\n summaryIntro: string;\n summarySeries: string;\n summaryRange: string;\n summaryTrendUp: string;\n summaryTrendDown: string;\n summaryTrendFlat: string;\n summaryTotal: string;\n summaryThreshold: string;\n summaryShare: string;\n /** Scatter: the correlation of x and y (Pearson's r). */\n summaryCorrelation: string;\n /** Funnel: from one stage to the next, and from the first to the last. */\n summaryConversion: string;\n summaryOverall: string;\n /** Heatmap, calendar: the largest cell and the number of cells with a value. */\n summaryPeak: string;\n summaryActive: string;\n /** Candlestick: the period's range. */\n summaryOhlc: string;\n /** The names of the charts, read first in the summary. */\n kinds: Record<ChartKind, string>;\n /** The column of the values, when the chart has no value label. */\n value: string;\n /** The column of the categories in the data table, when the chart has no x label. */\n category: string;\n /** The total row of a stacked chart, a pie, a funnel. */\n total: string;\n /** What a missing value reads as. */\n noValue: string;\n}\n\nexport type ChartKind =\n | \"line\"\n | \"area\"\n | \"bar\"\n | \"pie\"\n | \"donut\"\n | \"gauge\"\n | \"sparkline\"\n | \"radar\"\n | \"heatmap\"\n | \"calendar\"\n | \"sankey\"\n | \"funnel\"\n | \"candlestick\"\n | \"treemap\"\n | \"scatter\"\n | \"map\"\n | \"globe\"\n | \"chart\";\n\nexport const DEFAULT_LABELS: ChartLabels = {\n showData: \"Show data\",\n hideData: \"Hide data\",\n tableCaption: \"{title} — data\",\n exportPng: \"PNG\",\n exportSvg: \"SVG\",\n exportCsv: \"CSV\",\n actions: \"Chart actions\",\n viewTable: \"View as table\",\n downloadCsv: \"Download CSV\",\n downloadPng: \"Download PNG\",\n downloadSvg: \"Download SVG\",\n copyData: \"Copy data\",\n copied: \"Data copied\",\n close: \"Close\",\n tableRows: \"{count} rows\",\n toggleSeries: \"Show or hide {label}\",\n sparse: \"{count} of {total} periods have data.\",\n trendVsPrevious: \"{change} vs previous period\",\n loading: \"Loading chart…\",\n empty: \"No data for this period yet.\",\n error: \"The chart could not be loaded.\",\n keyboardHint: \"Use the arrow keys to move between points, Home and End to jump to the ends.\",\n roleDescription: \"chart\",\n summaryIntro: \"{kind}, {count}.\",\n summarySeries: \"{label}: from {first} to {last}\",\n summaryRange: \"lowest {min} ({minAt}), highest {max} ({maxAt})\",\n summaryTrendUp: \"up {change}\",\n summaryTrendDown: \"down {change}\",\n summaryTrendFlat: \"stable\",\n summaryTotal: \"total {total}\",\n summaryThreshold: \"{label} at {value}\",\n summaryShare: \"{label} {value} ({share})\",\n summaryCorrelation: \"correlation {r}\",\n summaryConversion: \"{from} → {to} {rate}\",\n summaryOverall: \"overall {rate}\",\n summaryPeak: \"peak {value} ({at})\",\n summaryActive: \"{count} with a value\",\n summaryOhlc: \"opened at {open}, closed at {close}, low {low}, high {high}\",\n kinds: {\n line: \"Line chart\",\n area: \"Area chart\",\n bar: \"Bar chart\",\n pie: \"Pie chart\",\n donut: \"Donut chart\",\n gauge: \"Gauge\",\n sparkline: \"Sparkline\",\n radar: \"Radar chart\",\n heatmap: \"Heatmap\",\n calendar: \"Calendar heatmap\",\n sankey: \"Flow diagram\",\n funnel: \"Funnel\",\n candlestick: \"Candlestick chart\",\n treemap: \"Treemap\",\n scatter: \"Scatter chart\",\n map: \"Map\",\n globe: \"Globe\",\n chart: \"Chart\",\n },\n category: \"Category\",\n value: \"Value\",\n total: \"Total\",\n noValue: \"—\",\n};\n\n/** The words an app or a chart passes: any of them, and any of the chart names. */\nexport type ChartLabelsInput = Partial<Omit<ChartLabels, \"kinds\">> & { kinds?: Partial<Record<ChartKind, string>> };\n\n/** The default labels with an app's and a chart's on top (`kinds` merged too). */\nexport function mergeLabels(...layers: (ChartLabelsInput | undefined)[]): ChartLabels {\n let out = DEFAULT_LABELS;\n for (const layer of layers) {\n if (!layer) continue;\n out = { ...out, ...layer, kinds: { ...out.kinds, ...layer.kinds } };\n }\n return out;\n}\n\n/** A sentence's first letter in upper case (a template that may open a sentence: `total {total}`). */\nexport function capitalize(text: string): string {\n return text.charAt(0).toLocaleUpperCase() + text.slice(1);\n}\n\n/** `{name}` → its value; an unknown placeholder stays as written. */\nexport function fill(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match, name: string) => (name in values ? String(values[name]) : match));\n}\n","import type { Tone } from \"../core/types\";\n\n/** A status of a job: the field holding its count per period, its name, its tone, and its part in the success rate. */\nexport interface JobStatus {\n /** The field of the row holding the count (`\"completed\"`). */\n readonly key: string;\n /** Its name, passed translated (`\"Completed\"`). */\n readonly label: string;\n /** Its tone: the status colours (`success`, `danger`, `info`, `neutral`). */\n readonly tone: Tone;\n /** `succeeded` or `failed`: counted in the success rate. Absent: still running or waiting. */\n readonly outcome?: \"succeeded\" | \"failed\";\n}\n\n/** The four statuses of an Orazaka job, in English: pass your own (translated) `statuses`. */\nexport const DEFAULT_STATUSES: readonly JobStatus[] = [\n { key: \"completed\", label: \"Completed\", tone: \"success\", outcome: \"succeeded\" },\n { key: \"failed\", label: \"Failed\", tone: \"danger\", outcome: \"failed\" },\n { key: \"running\", label: \"Running\", tone: \"info\" },\n { key: \"queued\", label: \"Queued\", tone: \"neutral\" },\n];\n","// LineChart, AreaChart and BarChart for React Native: the web's props (data, x, y / series, format, xFormat,\n// thresholds) and the same geometry (src/core), drawn with react-native-svg. The active point (a tap, or the screen\n// reader's swipe) is marked on the plot and written under it.\nimport { useMemo, useState } from \"react\";\nimport Svg, { Circle, G, Line, Path, Text as SvgText } from \"react-native-svg\";\n\nimport { extent, normalizeSeries, stack, tabulate } from \"../core/data\";\nimport { describeSeries } from \"../core/describe\";\nimport { categoryFormatter, shareFormatter, valueFormatter } from \"../core/format\";\nimport { bandScale, linearScale, niceDomain, pointScale, thinLabels } from \"../core/scale\";\nimport { areaPath, barPath, type Curve, linePath, type Point, segments } from \"../core/shape\";\nimport type { Accessor, CategoryFormat, Datum, SeriesSpec, Threshold, ValueFormat } from \"../core/types\";\nimport { NativeFrame, type NativeFrameProps, NativeLegend, useNativeSettings } from \"./frame\";\n\nexport interface NativeCartesianProps<T extends Datum> extends NativeFrameProps {\n /** The rows, in the order of the x axis. */\n data: readonly T[];\n /** The field (or function) of the category. */\n x?: Accessor<T, unknown>;\n /** A single series: its field. */\n y?: Accessor<T, number | null | undefined>;\n /** The name of the single `y` series. */\n yLabel?: string;\n /** The series, each with its field and name. */\n series?: readonly SeriesSpec<T>[];\n /** How the values are written. */\n format?: ValueFormat;\n /** How the categories are written. */\n xFormat?: CategoryFormat;\n /** Horizontal lines at a value. */\n thresholds?: readonly Threshold[];\n}\n\ntype Mode = { kind: \"line\" | \"area\" | \"bar\"; curve?: Curve; stacked?: boolean };\n\nconst textWidth = (text: string) => Math.ceil(text.length * 6.4);\n\nfunction NativeCartesian<T extends Datum>({ props, mode }: { props: NativeCartesianProps<T>; mode: Mode }) {\n const { data, x, y, yLabel, series: seriesProp, format, xFormat, thresholds = [] } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, theme, color } = resolved;\n const specs = useMemo(() => normalizeSeries(seriesProp, y, yLabel), [seriesProp, y, yLabel]);\n const table = useMemo(() => tabulate(data, x, specs), [data, x, specs]);\n const fmt = useMemo(\n () => ({ value: valueFormatter(format, locale, labels.noValue), axis: valueFormatter(format, locale, labels.noValue, true), category: categoryFormatter(xFormat, locale), share: shareFormatter(locale) }),\n [format, xFormat, locale, labels.noValue],\n );\n const isEmpty = table.series.length === 0 || table.series.every((s) => s.values.every((v) => v == null));\n const summary = isEmpty ? labels.empty : describeSeries(table, { kind: mode.kind, labels, value: fmt.value, category: fmt.category, share: fmt.share, thresholds });\n const points = table.categories.map((c, i) => `${fmt.category(c)}: ${table.series.map((s) => `${s.label} ${fmt.value(s.values[i])}`).join(\", \")}`);\n const [active, setActive] = useState<number | null>(null);\n const colors = table.series.map((s) => color(s.color, s.slot));\n const count = table.categories.length;\n const stacked = Boolean(mode.stacked);\n\n return (\n <NativeFrame\n frame={props}\n defaultHeight={220}\n resolved={resolved}\n summary={summary}\n isEmpty={isEmpty}\n points={points}\n active={active}\n onActive={setActive}\n legend={<NativeLegend theme={theme} items={table.series.map((s, i) => ({ label: s.label, color: colors[i]! }))} />}\n indexAt={(px, width) => {\n if (!count) return null;\n const left = 44;\n return Math.max(0, Math.min(count - 1, mode.kind === \"bar\" ? Math.floor(((px - left) / (width - left - 8)) * count) : Math.round(((px - left) / (width - left - 8)) * (count - 1))));\n }}\n >\n {(width, height) => {\n let [lo, hi] = extent(table.series, stacked);\n for (const t of thresholds) {\n lo = Math.min(lo, t.value);\n hi = Math.max(hi, t.value);\n }\n lo = Math.min(0, lo);\n hi = Math.max(0, hi);\n const nice = niceDomain(lo, hi, 4);\n const ticks = nice.ticks.map((t) => fmt.axis(t));\n const x0 = Math.max(...ticks.map(textWidth)) + 8;\n const x1 = width - 8;\n const y0 = 8;\n const y1 = height - 22;\n const value = linearScale(nice.domain, [y1, y0], nice.ticks);\n const band = bandScale(count, [x0, x1], 0.3);\n const at = mode.kind === \"bar\" ? (i: number) => band(i) + band.bandwidth / 2 : pointScale(count, [x0, x1]);\n const stacks = stacked ? stack(table.series) : null;\n const widest = Math.max(...table.categories.map((c) => textWidth(fmt.category(c))));\n const labelsAt = thinLabels(count, Math.max(2, Math.floor((x1 - x0) / (widest + 16))));\n const groups = stacked ? 1 : table.series.length;\n const thickness = Math.min(20, Math.max(2, (band.bandwidth - (groups - 1) * 2) / groups));\n return (\n <Svg width={width} height={height}>\n {nice.ticks.map((t, i) => (\n <G key={t}>\n <Line x1={x0} x2={x1} y1={value(t)} y2={value(t)} stroke={t === 0 ? theme.borderDefault : theme.borderSubtle} strokeWidth={1} />\n <SvgText x={x0 - 6} y={value(t) + 4} fontSize={11} fill={theme.textSecondary} textAnchor=\"end\">\n {ticks[i]}\n </SvgText>\n </G>\n ))}\n {labelsAt.map((i) => (\n <SvgText key={i} x={at(i)} y={y1 + 16} fontSize={11} fill={theme.textSecondary} textAnchor={mode.kind !== \"bar\" && i === 0 ? \"start\" : mode.kind !== \"bar\" && i === count - 1 ? \"end\" : \"middle\"}>\n {fmt.category(table.categories[i])}\n </SvgText>\n ))}\n {active !== null && <Line x1={at(active)} x2={at(active)} y1={y0} y2={y1} stroke={theme.borderDefault} strokeWidth={1} />}\n {table.series.map((s, k) => {\n if (mode.kind === \"bar\") {\n return s.values.map((v, i) => {\n const seg = stacks?.[k]?.[i];\n const from = seg ? seg.base : 0;\n const to = seg ? seg.top : (v ?? 0);\n if (from === to) return null;\n const isTop = !stacked || k === table.series.length - 1;\n const top = Math.min(value(from), value(to));\n const size = Math.abs(value(to) - value(from)) - (isTop ? 0 : 2);\n const left = band(i) + (band.bandwidth - (thickness * groups + (groups - 1) * 2)) / 2 + (stacked ? 0 : k * (thickness + 2));\n return <Path key={`${k}-${i}`} d={barPath(left, isTop ? top : top + 2, thickness, Math.max(0, size), isTop ? 4 : 0, false, to < from)} fill={colors[k]} opacity={active !== null && active !== i ? 0.4 : 1} />;\n });\n }\n const pts = s.values.map((v, i) => (v == null ? null : ([at(i), value(stacks ? stacks[k]![i]!.top : v)] as Point)));\n return segments(pts).map((seg) => (\n <G key={`${k}-${seg[0]![0]}`}>\n {mode.kind === \"area\" && <Path d={areaPath(seg, stacks && k > 0 ? seg.map(([px]) => [px, value(stacks[k]![Math.round(((px - x0) / (x1 - x0)) * (count - 1))]!.base)] as Point) : value(0), mode.curve)} fill={colors[k]} opacity={stacked ? 0.5 : 0.14} />}\n <Path d={linePath(seg, mode.curve)} stroke={colors[k]} strokeWidth={2} fill=\"none\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeDasharray={s.dashed ? \"6 4\" : undefined} />\n </G>\n ));\n })}\n {thresholds.map((t, i) => (\n <G key={`t-${i}`}>\n <Line x1={x0} x2={x1} y1={value(t.value)} y2={value(t.value)} stroke={color(t.tone ?? \"neutral\", 1)} strokeWidth={1.5} strokeDasharray=\"6 4\" />\n <SvgText x={x1} y={value(t.value) - 6} fontSize={11} fontWeight=\"600\" fill={theme.textPrimary} textAnchor=\"end\">\n {t.label}\n </SvgText>\n </G>\n ))}\n {active !== null &&\n mode.kind !== \"bar\" &&\n table.series.map((s, k) => {\n const v = s.values[active];\n if (v == null) return null;\n return <Circle key={k} cx={at(active)} cy={value(stacks ? stacks[k]![active]!.top : v)} r={5} fill={colors[k]} stroke={theme.surface1} strokeWidth={2} />;\n })}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n\nexport interface NativeLineChartProps<T extends Datum> extends NativeCartesianProps<T> {\n /** `monotone` (default), `linear` or `step`. */\n curve?: Curve;\n}\n\n/** Change over time (React Native): one line per series. */\nexport function LineChart<T extends Datum>({ curve = \"monotone\", ...props }: NativeLineChartProps<T>) {\n return <NativeCartesian props={props} mode={{ kind: \"line\", curve }} />;\n}\n\nexport interface NativeAreaChartProps<T extends Datum> extends NativeLineChartProps<T> {\n /** Stack the series: the parts of a total over time. */\n stacked?: boolean;\n}\n\nexport interface NativeBarChartProps<T extends Datum> extends NativeCartesianProps<T> {\n /** Stack the series in one bar per category; default: grouped side by side. */\n stacked?: boolean;\n}\n\n/** A volume over time (React Native): a line over a wash; `stacked` for the parts of a total. */\nexport function AreaChart<T extends Datum>({ curve = \"monotone\", stacked, ...props }: NativeAreaChartProps<T>) {\n return <NativeCartesian props={props} mode={{ kind: \"area\", curve, stacked }} />;\n}\n\n/** Amounts across categories (React Native): grouped or `stacked` bars. */\nexport function BarChart<T extends Datum>({ stacked, ...props }: NativeBarChartProps<T>) {\n return <NativeCartesian props={props} mode={{ kind: \"bar\", stacked }} />;\n}\n","// From the app's rows to what a chart draws: the categories (x) and, per series, one value per category. Missing\n// values stay `null` (a gap), never a zero.\nimport type { Accessor, Datum, SeriesColor, SeriesSpec, SeriesSummary } from \"./types\";\n\n/** Reads a field or calls the accessor. */\nexport function read<T, V>(accessor: Accessor<T, V>, datum: T, index: number): V {\n return typeof accessor === \"function\" ? accessor(datum, index) : (datum[accessor as keyof T] as V);\n}\n\nexport interface Series {\n readonly id: string;\n readonly label: string;\n readonly values: readonly (number | null)[];\n readonly color?: SeriesColor;\n readonly dashed?: boolean;\n /** Its palette slot (1–8), in the order the series were given: a series keeps its colour whatever is filtered. */\n readonly slot: number;\n}\n\nexport interface Table {\n readonly categories: readonly unknown[];\n readonly series: readonly Series[];\n}\n\nconst toNumber = (value: unknown): number | null => (typeof value === \"number\" && Number.isFinite(value) ? value : null);\n\n/** `series`, or a single series from `y` and `label`. */\nexport function normalizeSeries<T extends Datum>(series: readonly SeriesSpec<T>[] | undefined, y: Accessor<T, number | null | undefined> | undefined, label: string | undefined): readonly SeriesSpec<T>[] {\n if (series?.length) return series;\n if (y !== undefined) return [{ key: y, label: label ?? (typeof y === \"string\" ? y : \"\") }];\n return [];\n}\n\n/** The categories and the series' values, row by row. */\nexport function tabulate<T extends Datum>(data: readonly T[], x: Accessor<T, unknown> | undefined, series: readonly SeriesSpec<T>[]): Table {\n return {\n categories: data.map((datum, i) => (x === undefined ? i + 1 : read(x, datum, i))),\n series: series.map((spec, s) => ({\n id: typeof spec.key === \"string\" ? spec.key : `series-${s}`,\n label: spec.label,\n values: data.map((datum, i) => toNumber(read(spec.key, datum, i))),\n color: spec.color,\n dashed: spec.dashed,\n slot: (s % 8) + 1,\n })),\n };\n}\n\n/** The smallest and largest value of the series, `stacked` summing them per category (positives and negatives apart). */\nexport function extent(series: readonly Series[], stacked = false): [number, number] {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n const count = series[0]?.values.length ?? 0;\n if (stacked) {\n for (let i = 0; i < count; i += 1) {\n let pos = 0;\n let neg = 0;\n for (const s of series) {\n const v = s.values[i] ?? 0;\n if (v >= 0) pos += v;\n else neg += v;\n }\n min = Math.min(min, neg);\n max = Math.max(max, pos);\n }\n } else {\n for (const s of series) {\n for (const v of s.values) {\n if (v == null) continue;\n min = Math.min(min, v);\n max = Math.max(max, v);\n }\n }\n }\n if (min === Number.POSITIVE_INFINITY) return [0, 0];\n return [min, max];\n}\n\n/** Per category and series, the base and top of a stacked mark (positives up, negatives down). */\nexport function stack(series: readonly Series[]): { base: number; top: number }[][] {\n const count = series[0]?.values.length ?? 0;\n const out = series.map(() => [] as { base: number; top: number }[]);\n for (let i = 0; i < count; i += 1) {\n let pos = 0;\n let neg = 0;\n series.forEach((s, k) => {\n const v = s.values[i] ?? 0;\n if (v >= 0) {\n out[k]!.push({ base: pos, top: pos + v });\n pos += v;\n } else {\n out[k]!.push({ base: neg, top: neg + v });\n neg += v;\n }\n });\n }\n return out;\n}\n\n/** What a series says: its extremes, its first and last values, its total and its trend (±1 % is flat). */\nexport function summarize(series: Series, categories: readonly unknown[], writeCategory: (c: unknown) => string): SeriesSummary {\n let min: SeriesSummary[\"min\"] = null;\n let max: SeriesSummary[\"max\"] = null;\n let first: number | null = null;\n let last: number | null = null;\n let total = 0;\n let count = 0;\n series.values.forEach((v, i) => {\n if (v == null) return;\n count += 1;\n total += v;\n if (first === null) first = v;\n last = v;\n if (!min || v < min.value) min = { value: v, category: writeCategory(categories[i]) };\n if (!max || v > max.value) max = { value: v, category: writeCategory(categories[i]) };\n });\n const change = first !== null && last !== null && first !== 0 && count > 1 ? (last as number) / first - 1 : null;\n const trend = count < 2 || change === null ? (count < 2 ? \"none\" : last! > first! ? \"up\" : last! < first! ? \"down\" : \"flat\") : Math.abs(change) < 0.01 ? \"flat\" : change > 0 ? \"up\" : \"down\";\n return { label: series.label, count, min, max, first, last, total, change, trend };\n}\n\n/**\n * The period that has data: the categories before the first and after the last value other than 0 or null are\n * dropped, but never below `min` categories (the window grows backwards first — the recent past gives a short burst\n * its scale — then forwards). `start` is the index of the first kept category in the table given; `active` the number\n * of categories with a value; `total` the number given. Nothing to trim, or no activity at all: the table as is.\n */\nexport function trimToActivity(table: Table, min = 7): { table: Table; start: number; active: number; total: number } {\n const total = table.categories.length;\n const has = (i: number) => table.series.some((s) => {\n const v = s.values[i];\n return v != null && v !== 0;\n });\n let first = -1;\n let last = -1;\n let active = 0;\n for (let i = 0; i < total; i += 1) {\n if (!has(i)) continue;\n active += 1;\n if (first < 0) first = i;\n last = i;\n }\n if (first < 0) return { table, start: 0, active: 0, total };\n let from = first;\n let to = last;\n const want = Math.min(total, Math.max(1, min));\n while (to - from + 1 < want) {\n if (from > 0) from -= 1;\n else if (to < total - 1) to += 1;\n else break;\n }\n if (from === 0 && to === total - 1) return { table, start: 0, active, total };\n return { table: { categories: table.categories.slice(from, to + 1), series: table.series.map((s) => ({ ...s, values: s.values.slice(from, to + 1) })) }, start: from, active, total };\n}\n","// The written summary of a chart — what a sighted reader takes in at a glance, said in words for a screen reader (and\n// shown under the chart when `summary=\"visible\"`): the kind, the size, then per series its range, extremes and trend.\nimport { summarize, type Table } from \"./data\";\nimport type { CategoryFormatter, ValueFormatter } from \"./format\";\nimport { capitalize, type ChartKind, type ChartLabels, fill } from \"./labels\";\nimport type { Threshold } from \"./types\";\n\nexport interface DescribeOptions {\n readonly kind: ChartKind;\n readonly labels: ChartLabels;\n readonly value: ValueFormatter;\n readonly category: CategoryFormatter;\n readonly share: (ratio: number) => string;\n readonly thresholds?: readonly Threshold[];\n}\n\n/** A cartesian chart (line, area, bar, sparkline): one sentence per series. */\nexport function describeSeries(table: Table, { kind, labels, value, category, share, thresholds = [] }: DescribeOptions): string {\n const points = table.categories.length;\n const first = points ? category(table.categories[0]) : \"\";\n const last = points ? category(table.categories[points - 1]) : \"\";\n const count = table.series.length > 1 ? `${table.series.length} × ${points}` : String(points);\n const intro = fill(labels.summaryIntro, { kind: labels.kinds[kind], count: points > 1 ? `${count} (${first} – ${last})` : count });\n const sentences = table.series.map((series) => {\n const s = summarize(series, table.categories, category);\n if (!s.count) return `${s.label}: ${labels.noValue}.`;\n const parts = [fill(labels.summarySeries, { label: s.label, first: value(s.first), last: value(s.last) })];\n if (s.min && s.max && s.count > 2) parts.push(fill(labels.summaryRange, { min: value(s.min.value), minAt: s.min.category, max: value(s.max.value), maxAt: s.max.category }));\n if (s.trend === \"up\" || s.trend === \"down\") {\n const template = s.trend === \"up\" ? labels.summaryTrendUp : labels.summaryTrendDown;\n if (s.change !== null) parts.push(fill(template, { change: share(Math.abs(s.change)) }));\n } else if (s.trend === \"flat\") parts.push(labels.summaryTrendFlat);\n return `${parts.join(\", \")}.`;\n });\n const marks = thresholds.map((t) => fill(labels.summaryThreshold, { label: t.label, value: value(t.value) }));\n return [intro, ...sentences, ...(marks.length ? [`${marks.join(\", \")}.`] : [])].join(\" \");\n}\n\n/** A part-to-whole chart (pie, donut, funnel, treemap): the parts, largest first, with their share. */\nexport function describeParts(kind: ChartKind, parts: readonly { label: string; value: number }[], { labels, value, share }: Omit<DescribeOptions, \"kind\" | \"category\">): string {\n const total = parts.reduce((sum, p) => sum + Math.max(0, p.value), 0);\n const intro = fill(labels.summaryIntro, { kind: labels.kinds[kind], count: parts.length });\n const sorted = [...parts].sort((a, b) => b.value - a.value);\n const items = sorted.map((p) => fill(labels.summaryShare, { label: p.label, value: value(p.value), share: share(total ? p.value / total : 0) }));\n return `${intro} ${items.join(\", \")}. ${capitalize(fill(labels.summaryTotal, { total: value(total) }))}.`;\n}\n","// Values and categories written the same way in the axes, the tooltips, the data table and the summary, through\n// @krizaka/intl (one cached Intl formatter per locale and options).\nimport { currencyDigits, formatCompact, formatDate, formatMoney, formatNumber, formatPercent, getDateTimeFormat, getNumberFormat } from \"@krizaka/intl\";\n\nimport type { CategoryFormat, Locale, ValueFormat } from \"./types\";\n\nexport type ValueFormatter = (value: number | null | undefined) => string;\n\n/**\n * A formatter for `format`. `axis` asks for the short form of the axis ticks (money and units go compact past 10 000).\n * A missing value is written `noValue`.\n */\nexport function valueFormatter(format: ValueFormat = \"number\", locale: Locale, noValue = \"—\", axis = false): ValueFormatter {\n const write = writerOf(format, locale, axis);\n return (value) => (value == null || Number.isNaN(value) ? noValue : write(value));\n}\n\nfunction writerOf(format: ValueFormat, locale: Locale, axis: boolean): (value: number) => string {\n if (typeof format === \"function\") return (value) => format(value, locale);\n if (format === \"integer\") return (value) => formatNumber(Math.round(value), { locale, maximumFractionDigits: 0 });\n if (format === \"compact\") return (value) => formatCompact(value, { locale });\n if (format === \"percent\") return (value) => formatPercent(value, { locale, maximumFractionDigits: axis ? 0 : 1 });\n if (format === \"number\") {\n return (value) => (axis && Math.abs(value) >= 10_000 ? formatCompact(value, { locale }) : formatNumber(value, { locale, maximumFractionDigits: 2 }));\n }\n if (format.style === \"money\") {\n const { currency } = format;\n const digits = currencyDigits(currency);\n return (value) => {\n const minor = Math.round(value);\n // Compact money on the axes (`€12K`): the amount in major units, Intl's compact currency notation.\n if ((axis || format.compact) && Math.abs(minor) >= 1_000_000) {\n const options = { style: \"currency\", currency, currencyDisplay: \"narrowSymbol\", notation: \"compact\", minimumFractionDigits: 0, maximumFractionDigits: 1 } as const;\n return getNumberFormat(locale, options).format(minor / 10 ** digits);\n }\n // An axis tick is a round amount: no cents to write (`€2,500`, not `€2,500.00`).\n if (axis && minor % 10 ** digits === 0) {\n return getNumberFormat(locale, { style: \"currency\", currency, minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(minor / 10 ** digits);\n }\n return formatMoney(minor, { currency, locale });\n };\n }\n if (format.style === \"unit\") {\n const { unit } = format;\n const compact = axis || format.compact;\n const options: Intl.NumberFormatOptions = { style: \"unit\", unit, unitDisplay: \"short\", ...(compact ? { notation: \"compact\" } : {}), maximumFractionDigits: compact ? 1 : 2 };\n return (value) => getNumberFormat(locale, options).format(value);\n }\n const { options } = format;\n return (value) => formatNumber(value, { locale, ...options });\n}\n\n/** An ISO date (`2026-04`, `2026-04-12`, `2026-04-12T14:30Z`), a `Date` or an epoch → a `Date`; anything else → null. */\nexport function asDate(value: unknown): Date | null {\n if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;\n if (typeof value === \"number\" && value > 10_000_000_000) return new Date(value);\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}(-\\d{2})?([T ][\\d:.]+(Z|[+-]\\d{2}:?\\d{2})?)?$/.test(value)) {\n // `2026-04` is the first of April, at midnight UTC: a month never slips to March in a negative time zone.\n const iso = value.length === 7 ? `${value}-01T00:00:00Z` : value.length === 10 ? `${value}T00:00:00Z` : value;\n const date = new Date(iso);\n return Number.isNaN(date.getTime()) ? null : date;\n }\n return null;\n}\n\nconst DATE_OPTIONS: Record<Exclude<CategoryFormat, \"text\" | ((category: unknown, locale: Locale) => string)>, Intl.DateTimeFormatOptions> = {\n year: { year: \"numeric\", timeZone: \"UTC\" },\n month: { month: \"short\", year: \"numeric\", timeZone: \"UTC\" },\n day: { month: \"short\", day: \"numeric\", timeZone: \"UTC\" },\n date: { dateStyle: \"medium\", timeZone: \"UTC\" },\n time: { timeStyle: \"short\", timeZone: \"UTC\" },\n datetime: { dateStyle: \"medium\", timeStyle: \"short\", timeZone: \"UTC\" },\n};\n\nexport type CategoryFormatter = (category: unknown) => string;\n\n/**\n * A formatter for the categories. Without a format, a date category is written by its precision (`2026-04` → a month,\n * `2026-04-12` → a day) and anything else as text. Dates are written in UTC, the zone of an ISO date without one:\n * pass a function for a local time.\n */\nexport function categoryFormatter(format: CategoryFormat | undefined, locale: Locale): CategoryFormatter {\n if (typeof format === \"function\") return (category) => format(category, locale);\n if (format === \"text\") return (category) => String(category ?? \"\");\n return (category) => {\n const date = asDate(category);\n if (!date) return String(category ?? \"\");\n const kind = format ?? guessPrecision(category);\n if (kind === \"date\") return formatDate(date, { locale, style: \"medium\", timeZone: \"UTC\" });\n return getDateTimeFormat(locale, DATE_OPTIONS[kind]).format(date);\n };\n}\n\nfunction guessPrecision(category: unknown): \"month\" | \"date\" | \"datetime\" {\n if (typeof category === \"string\") {\n if (category.length === 7) return \"month\";\n if (category.length === 10) return \"date\";\n return \"datetime\";\n }\n const date = asDate(category);\n return date && date.getUTCHours() === 0 && date.getUTCMinutes() === 0 ? \"date\" : \"datetime\";\n}\n\n/** A ratio for the summary and the shares: `0.236` → `24%` (one decimal under 10 %). */\nexport function shareFormatter(locale: Locale): (ratio: number) => string {\n return (ratio) => formatPercent(ratio, { locale, maximumFractionDigits: Math.abs(ratio) < 0.1 ? 1 : 0 });\n}\n","// Scales and ticks: the few functions a cartesian chart needs, without d3-scale (the charts draw a handful of shapes;\n// a full scale library would weigh more than the charts themselves).\n\nexport interface LinearScale {\n (value: number): number;\n readonly domain: readonly [number, number];\n readonly range: readonly [number, number];\n readonly ticks: readonly number[];\n}\n\n/** A step of 1, 2, 2.5 or 5 × 10ⁿ near `span / count`: ticks a reader counts without effort (0, 250, 500…). */\nexport function niceStep(span: number, count: number): number {\n if (!(span > 0) || !(count > 0)) return 1;\n const raw = span / count;\n const power = 10 ** Math.floor(Math.log10(raw));\n const fraction = raw / power;\n const nice = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 2.5 ? 2.5 : fraction <= 5 ? 5 : 10;\n return nice * power;\n}\n\n/**\n * A domain stretched to round ticks: `[0, 4870]` with about 5 ticks → `[0, 5000]`, ticks `0 1000 … 5000`. A single\n * value is padded towards zero, so a lone point never sits on the edge.\n */\nexport function niceDomain(min: number, max: number, count = 5): { domain: [number, number]; ticks: number[] } {\n if (!Number.isFinite(min) || !Number.isFinite(max)) return { domain: [0, 1], ticks: [0, 1] };\n if (min === max) {\n if (min === 0) return { domain: [0, 1], ticks: [0, 0.5, 1] };\n const pad = Math.abs(min) * 0.5;\n [min, max] = min > 0 ? [0, max + pad] : [min - pad, 0];\n }\n const step = niceStep(max - min, count);\n const lo = Math.floor(min / step) * step;\n const hi = Math.ceil(max / step) * step;\n const ticks: number[] = [];\n // Rounded to the step's precision: 0.1 + 0.2 must read 0.3.\n const digits = Math.max(0, -Math.floor(Math.log10(step)) + 2);\n for (let v = lo; v <= hi + step / 2; v += step) ticks.push(Number(v.toFixed(digits)));\n return { domain: [lo, hi], ticks };\n}\n\n/** A linear scale from a domain to pixels, with its round ticks. */\nexport function linearScale(domain: readonly [number, number], range: readonly [number, number], ticks: readonly number[] = domain): LinearScale {\n const [d0, d1] = domain;\n const [r0, r1] = range;\n const k = d1 === d0 ? 0 : (r1 - r0) / (d1 - d0);\n const scale = ((value: number) => r0 + (value - d0) * k) as LinearScale;\n return Object.assign(scale, { domain, range, ticks });\n}\n\nexport interface BandScale {\n (index: number): number;\n /** The width of one band (the bars of a category share it). */\n readonly bandwidth: number;\n /** The distance between the starts of two bands. */\n readonly step: number;\n readonly count: number;\n}\n\n/** `count` bands over the range, with an inner padding between them (a ratio of the step). */\nexport function bandScale(count: number, range: readonly [number, number], padding = 0.3): BandScale {\n const [r0, r1] = range;\n const step = count > 0 ? (r1 - r0) / count : 0;\n const bandwidth = step * (1 - padding);\n const scale = ((index: number) => r0 + index * step + (step - bandwidth) / 2) as BandScale;\n return Object.assign(scale, { bandwidth, step, count });\n}\n\n/** A point scale: `count` points from one end of the range to the other (lines, areas). */\nexport function pointScale(count: number, range: readonly [number, number]): (index: number) => number {\n const [r0, r1] = range;\n if (count <= 1) return () => (r0 + r1) / 2;\n const step = (r1 - r0) / (count - 1);\n return (index) => r0 + index * step;\n}\n\n/** At most `max` of `count` labels, evenly spaced, the last one always kept: which indexes to write on an axis. */\nexport function thinLabels(count: number, max: number): number[] {\n if (count <= max) return Array.from({ length: count }, (_, i) => i);\n const every = Math.ceil(count / Math.max(1, max));\n const out: number[] = [];\n for (let i = 0; i < count; i += every) out.push(i);\n if (out[out.length - 1] !== count - 1) {\n // The last label is always written; the one before it gives way when they would touch.\n if (count - 1 - out[out.length - 1]! < every) out.pop();\n out.push(count - 1);\n }\n return out;\n}\n","// SVG path data for the marks: lines (linear, monotone, step), areas, bars with a rounded data end, arcs. Shared by\n// the web (`<path d>`) and React Native (react-native-svg's `<Path d>`): the same geometry on both platforms.\n\nexport type Point = readonly [number, number];\nexport type Curve = \"linear\" | \"monotone\" | \"step\";\n\nconst r = (n: number) => Math.round(n * 100) / 100;\n\n/** The segments of a line, split where a value is missing (a gap stays a gap, never a fake zero). */\nexport function segments(points: readonly (Point | null)[]): Point[][] {\n const out: Point[][] = [];\n let current: Point[] = [];\n for (const point of points) {\n if (point) current.push(point);\n else if (current.length) {\n out.push(current);\n current = [];\n }\n }\n if (current.length) out.push(current);\n return out;\n}\n\n/** The path of one segment. `monotone` (Fritsch–Carlson) never overshoots: a curve that never invents a peak. */\nexport function linePath(points: readonly Point[], curve: Curve = \"monotone\"): string {\n if (points.length === 0) return \"\";\n const [x0, y0] = points[0]!;\n if (points.length === 1) return `M${r(x0)},${r(y0)}`;\n if (curve === \"step\") {\n let d = `M${r(x0)},${r(y0)}`;\n for (let i = 1; i < points.length; i += 1) {\n const [px] = points[i - 1]!;\n const [x, y] = points[i]!;\n const mid = (px + x) / 2;\n d += `H${r(mid)}V${r(y)}H${r(x)}`;\n }\n return d;\n }\n if (curve === \"linear\" || points.length === 2) return points.map(([x, y], i) => `${i ? \"L\" : \"M\"}${r(x)},${r(y)}`).join(\"\");\n const tangents = monotoneTangents(points);\n let d = `M${r(x0)},${r(y0)}`;\n for (let i = 1; i < points.length; i += 1) {\n const [xa, ya] = points[i - 1]!;\n const [xb, yb] = points[i]!;\n const h = (xb - xa) / 3;\n d += `C${r(xa + h)},${r(ya + h * tangents[i - 1]!)} ${r(xb - h)},${r(yb - h * tangents[i]!)} ${r(xb)},${r(yb)}`;\n }\n return d;\n}\n\nfunction monotoneTangents(points: readonly Point[]): number[] {\n const n = points.length;\n const slopes: number[] = [];\n for (let i = 0; i < n - 1; i += 1) {\n const [xa, ya] = points[i]!;\n const [xb, yb] = points[i + 1]!;\n slopes.push(xb === xa ? 0 : (yb - ya) / (xb - xa));\n }\n const tangents = [slopes[0]!];\n for (let i = 1; i < n - 1; i += 1) {\n const a = slopes[i - 1]!;\n const b = slopes[i]!;\n tangents.push(a * b <= 0 ? 0 : (3 * a * b) / (Math.max(a, b) * 2 + Math.min(a, b)) || 0);\n }\n tangents.push(slopes[n - 2]!);\n return tangents;\n}\n\n/** An area under (or between) lines: the top points left to right, then the base right to left. */\nexport function areaPath(top: readonly Point[], base: readonly Point[] | number, curve: Curve = \"monotone\"): string {\n if (top.length === 0) return \"\";\n const line = linePath(top, curve);\n const bottom: Point[] = typeof base === \"number\" ? [top[top.length - 1]!, top[0]!].map(([x]) => [x, base] as Point) : [...base].reverse();\n if (typeof base === \"number\") return `${line}L${r(bottom[0]![0])},${r(base)}L${r(bottom[1]![0])},${r(base)}Z`;\n return `${line}L${linePath(bottom, curve).slice(1)}Z`;\n}\n\n/**\n * A bar from its baseline to its value, the data end rounded (`radius`, 4 px by default), square on the baseline.\n * `horizontal` bars grow to the right (or left for a negative value).\n */\nexport function barPath(x: number, y: number, width: number, height: number, radius = 4, horizontal = false, negative = false): string {\n if (width <= 0 || height <= 0) return \"\";\n const rad = Math.min(radius, horizontal ? height / 2 : width / 2, horizontal ? width : height);\n if (!horizontal) {\n if (!negative) {\n // Rounded at the top, square at the baseline (bottom).\n return `M${r(x)},${r(y + height)}V${r(y + rad)}Q${r(x)},${r(y)} ${r(x + rad)},${r(y)}H${r(x + width - rad)}Q${r(x + width)},${r(y)} ${r(x + width)},${r(y + rad)}V${r(y + height)}Z`;\n }\n return `M${r(x)},${r(y)}V${r(y + height - rad)}Q${r(x)},${r(y + height)} ${r(x + rad)},${r(y + height)}H${r(x + width - rad)}Q${r(x + width)},${r(y + height)} ${r(x + width)},${r(y + height - rad)}V${r(y)}Z`;\n }\n if (!negative) {\n return `M${r(x)},${r(y)}H${r(x + width - rad)}Q${r(x + width)},${r(y)} ${r(x + width)},${r(y + rad)}V${r(y + height - rad)}Q${r(x + width)},${r(y + height)} ${r(x + width - rad)},${r(y + height)}H${r(x)}Z`;\n }\n return `M${r(x + width)},${r(y)}H${r(x + rad)}Q${r(x)},${r(y)} ${r(x)},${r(y + rad)}V${r(y + height - rad)}Q${r(x)},${r(y + height)} ${r(x + rad)},${r(y + height)}H${r(x + width)}Z`;\n}\n\n/** A point on a circle, the angle in radians from twelve o'clock, clockwise. */\nexport function polar(cx: number, cy: number, radius: number, angle: number): Point {\n return [cx + radius * Math.sin(angle), cy - radius * Math.cos(angle)];\n}\n\n/**\n * A ring sector (a pie slice when `inner` is 0), from `start` to `end` (radians, clockwise from twelve o'clock).\n * A full turn is drawn as two halves: an SVG arc cannot start and end on the same point.\n */\nexport function arcPath(cx: number, cy: number, inner: number, outer: number, start: number, end: number): string {\n const sweep = end - start;\n if (sweep <= 0 || outer <= 0) return \"\";\n if (sweep >= Math.PI * 2 - 1e-6) {\n const mid = start + Math.PI;\n return `${arcPath(cx, cy, inner, outer, start, mid)}${arcPath(cx, cy, inner, outer, mid, start + Math.PI * 2)}`;\n }\n const large = sweep > Math.PI ? 1 : 0;\n const [ox0, oy0] = polar(cx, cy, outer, start);\n const [ox1, oy1] = polar(cx, cy, outer, end);\n let d = `M${r(ox0)},${r(oy0)}A${r(outer)},${r(outer)} 0 ${large} 1 ${r(ox1)},${r(oy1)}`;\n if (inner > 0) {\n const [ix1, iy1] = polar(cx, cy, inner, end);\n const [ix0, iy0] = polar(cx, cy, inner, start);\n d += `L${r(ix1)},${r(iy1)}A${r(inner)},${r(inner)} 0 ${large} 0 ${r(ix0)},${r(iy0)}Z`;\n } else d += `L${r(cx)},${r(cy)}Z`;\n return d;\n}\n\n/** An open arc (a gauge's track), stroked rather than filled. */\nexport function strokeArcPath(cx: number, cy: number, radius: number, start: number, end: number): string {\n if (end - start <= 0) return \"\";\n const [x0, y0] = polar(cx, cy, radius, start);\n const [x1, y1] = polar(cx, cy, radius, end);\n return `M${r(x0)},${r(y0)}A${r(radius)},${r(radius)} 0 ${end - start > Math.PI ? 1 : 0} 1 ${r(x1)},${r(y1)}`;\n}\n","// @krizaka/tokens — GÉNÉRÉ depuis src/tokens/*.tokens.json par scripts/build.mjs : ne pas éditer.\n\n/** Colour roles per theme, resolved for React Native (`#rrggbb`, `rgba()` when translucent). */\nexport const themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze({\n \"surface0\": \"#151b18\",\n \"surface1\": \"#191f1c\",\n \"surface2\": \"#1c221f\",\n \"surface3\": \"#262e2a\",\n \"media\": \"#1e2521\",\n \"borderSubtle\": \"rgba(231,240,230,0.07)\",\n \"borderDefault\": \"rgba(231,240,230,0.12)\",\n \"borderStrong\": \"rgba(231,240,230,0.2)\",\n \"borderControl\": \"rgba(231,240,230,0.2)\",\n \"borderHover\": \"rgba(231,240,230,0.2)\",\n \"textPrimary\": \"#ecf0ea\",\n \"textSecondary\": \"#bcc8c0\",\n \"textMuted\": \"#a7b4ab\",\n \"textOnMedia\": \"#ffffff\",\n \"textTitle\": \"#ecf0ea\",\n \"accent\": \"#3e76a8\",\n \"accentHover\": \"#346793\",\n \"accentSoft\": \"rgba(62,118,168,0.12)\",\n \"accentText\": \"#8ebde1\",\n \"accent2\": \"#3e76a8\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#3e76a8\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\",\n \"success\": \"#10b77f\",\n \"successText\": \"#36d399\",\n \"successSoft\": \"rgba(16,183,127,0.14)\",\n \"warning\": \"#f59f0a\",\n \"warningText\": \"#f6a823\",\n \"warningSoft\": \"rgba(245,159,10,0.14)\",\n \"danger\": \"#ef4343\",\n \"dangerText\": \"#f87272\",\n \"dangerSoft\": \"rgba(239,67,67,0.14)\",\n \"info\": \"#3e76a8\",\n \"infoText\": \"#8ebde1\",\n \"scrim\": \"rgba(0,0,0,0.6)\",\n \"scrimStrong\": \"rgba(0,0,0,0.8)\",\n \"overlay\": \"rgba(0,0,0,0.7)\",\n \"paperRuleMajor\": \"rgba(217,232,222,0.09)\",\n \"paperRuleMinor\": \"rgba(217,232,222,0.045)\",\n \"paperRuleMargin\": \"#e08071\",\n \"paperTag\": \"#2d3932\",\n \"paperTagEdge\": \"#586a5f\",\n \"paperTagInk\": \"#e9eee7\",\n \"surfaceSheen\": \"rgba(255,255,255,0)\",\n \"fillShade\": \"rgba(0,0,0,0.12)\",\n \"edgeLight\": \"rgba(255,255,255,0)\",\n \"edgeOnFill\": \"rgba(255,255,255,0.22)\",\n \"edgeWell\": \"rgba(4,4,7,0.5)\",\n \"glassBg\": \"#191f1c\",\n \"glassBorder\": \"rgba(255,255,255,0.1)\"\n}), light: /* @__PURE__ */ Object.freeze({\n \"surface0\": \"#f4f6f3\",\n \"surface1\": \"#fbfcfb\",\n \"surface2\": \"#f0f3ef\",\n \"surface3\": \"#dfe3de\",\n \"media\": \"#e5e8e3\",\n \"borderSubtle\": \"rgba(31,59,91,0.1)\",\n \"borderDefault\": \"rgba(31,59,91,0.17)\",\n \"borderStrong\": \"rgba(31,59,91,0.28)\",\n \"borderControl\": \"rgba(31,59,91,0.28)\",\n \"borderHover\": \"rgba(31,59,91,0.28)\",\n \"textPrimary\": \"#1d3654\",\n \"textSecondary\": \"#405064\",\n \"textMuted\": \"#4f5b69\",\n \"textOnMedia\": \"#ffffff\",\n \"textTitle\": \"#1d3654\",\n \"accent\": \"#2a5f8d\",\n \"accentHover\": \"#1f4d75\",\n \"accentSoft\": \"rgba(42,95,141,0.08)\",\n \"accentText\": \"#275782\",\n \"accent2\": \"#2a5f8d\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#2a5f8d\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\",\n \"success\": \"#10b77f\",\n \"successText\": \"#0a714e\",\n \"successSoft\": \"rgba(16,183,127,0.1)\",\n \"warning\": \"#f59f0a\",\n \"warningText\": \"#955104\",\n \"warningSoft\": \"rgba(245,159,10,0.12)\",\n \"danger\": \"#ef4343\",\n \"dangerText\": \"#af1d1d\",\n \"dangerSoft\": \"rgba(239,67,67,0.1)\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"scrim\": \"rgba(0,0,0,0.6)\",\n \"scrimStrong\": \"rgba(0,0,0,0.8)\",\n \"overlay\": \"rgba(0,0,0,0.7)\",\n \"paperRuleMajor\": \"rgba(69,109,161,0.24)\",\n \"paperRuleMinor\": \"rgba(69,109,161,0.1)\",\n \"paperRuleMargin\": \"#a53127\",\n \"paperTag\": \"#eadfc2\",\n \"paperTagEdge\": \"#b4a274\",\n \"paperTagInk\": \"#282620\",\n \"surfaceSheen\": \"rgba(255,255,255,0)\",\n \"fillShade\": \"rgba(0,0,0,0.12)\",\n \"edgeLight\": \"rgba(255,255,255,0)\",\n \"edgeOnFill\": \"rgba(255,255,255,0.22)\",\n \"edgeWell\": \"rgba(48,52,80,0.08)\",\n \"glassBg\": \"#fbfcfb\",\n \"glassBorder\": \"rgba(0,0,0,0.08)\"\n}) });\n\n/** Corner radii, in dp. */\nexport const radius = /* @__PURE__ */ Object.freeze({\n \"xs\": 2,\n \"sm\": 2,\n \"md\": 2,\n \"lg\": 0,\n \"xl\": 0,\n \"2xl\": 0,\n \"full\": 9999\n});\n\n/** Font families: the first family of each web stack (React Native takes a single name). */\nexport const typography = /* @__PURE__ */ Object.freeze({\n \"sans\": \"Atkinson Hyperlegible Next\",\n \"text\": \"Atkinson Hyperlegible Next\",\n \"display\": \"Young Serif\",\n \"mono\": \"Courier Prime\",\n \"cahier\": \"Krizaka Cahier\",\n \"productDisplay\": \"Plus Jakarta Sans\",\n \"monoMeta\": \"Courier Prime\"\n});\n\n/**\n * Motion: the cubic-bezier control points (`Easing.bezier(...motion.ease)`), the short spring of what answers the hand\n * (`motion.spring`) and the micro-interaction durations in ms (`motion.duration.fast`) — 0 when the system reduces motion.\n */\nexport const motion = /* @__PURE__ */ Object.freeze({ ease: /* @__PURE__ */ Object.freeze([0.45,0,0.2,1]), spring: /* @__PURE__ */ Object.freeze([0.34,1.36,0.64,1]), duration: /* @__PURE__ */ Object.freeze({\"instant\":90,\"fast\":150,\"base\":200}) });\n\n/**\n * The type scale in dp: fontSize, lineHeight and letterSpacing absolute (React Native has no em), fontWeight as a string,\n * and the role whose family sets it — with @krizaka/fonts: `{ ...typeScale.bodyMd, fontFamily: fontFamily(role, weight) }`.\n */\nexport const typeScale = /* @__PURE__ */ Object.freeze({\n \"display2xl\": {\n \"role\": \"display\",\n \"fontSize\": 72,\n \"lineHeight\": 80,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.72\n },\n \"displayXl\": {\n \"role\": \"display\",\n \"fontSize\": 56,\n \"lineHeight\": 64,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.56\n },\n \"displayLg\": {\n \"role\": \"display\",\n \"fontSize\": 44,\n \"lineHeight\": 48,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.44\n },\n \"displayMd\": {\n \"role\": \"display\",\n \"fontSize\": 34,\n \"lineHeight\": 40,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.34\n },\n \"displaySm\": {\n \"role\": \"display\",\n \"fontSize\": 26,\n \"lineHeight\": 32,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"titleLg\": {\n \"role\": \"display\",\n \"fontSize\": 20,\n \"lineHeight\": 24,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"titleMd\": {\n \"role\": \"text\",\n \"fontSize\": 17,\n \"lineHeight\": 24,\n \"fontWeight\": \"600\",\n \"letterSpacing\": -0.2\n },\n \"bodyLg\": {\n \"role\": \"text\",\n \"fontSize\": 18,\n \"lineHeight\": 29,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.25\n },\n \"bodyMd\": {\n \"role\": \"text\",\n \"fontSize\": 16,\n \"lineHeight\": 24,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.18\n },\n \"bodySm\": {\n \"role\": \"text\",\n \"fontSize\": 14,\n \"lineHeight\": 20,\n \"fontWeight\": \"400\",\n \"letterSpacing\": -0.08\n },\n \"caption\": {\n \"role\": \"text\",\n \"fontSize\": 12,\n \"lineHeight\": 17,\n \"fontWeight\": \"500\",\n \"letterSpacing\": 0\n },\n \"overline\": {\n \"role\": \"mono\",\n \"fontSize\": 11,\n \"lineHeight\": 16,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"monoMd\": {\n \"role\": \"mono\",\n \"fontSize\": 14,\n \"lineHeight\": 22,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n },\n \"monoSm\": {\n \"role\": \"mono\",\n \"fontSize\": 12,\n \"lineHeight\": 18,\n \"fontWeight\": \"400\",\n \"letterSpacing\": 0\n }\n});\n\n/**\n * The shadows per theme as React Native `boxShadow` strings (RN ≥ 0.76): `raised` (a button, a card), `floating`\n * (a menu, a popover), `overlay` (a sheet, a toast) — ink-tinted, several layers, as on the web.\n */\nexport const shadows = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze({\n \"sm\": \"0 1px 0 0 rgba(5,10,8,0.6)\",\n \"md\": \"0 1px 0 0 rgba(5,10,8,0.6), 4px 5px 0 -2px rgba(7,13,10,0.55)\",\n \"lg\": \"0 1px 0 0 rgba(5,10,8,0.6), 6px 8px 0 -2px rgba(7,13,10,0.55)\",\n \"raised\": \"0 1px 0 0 rgba(5,10,8,0.6)\",\n \"floating\": \"0 1px 0 0 rgba(5,10,8,0.6), 4px 5px 0 -2px rgba(7,13,10,0.55)\",\n \"overlay\": \"0 1px 0 0 rgba(5,10,8,0.6), 8px 10px 0 -3px rgba(7,13,10,0.55)\",\n \"hover\": \"0 1px 0 0 rgba(5,10,8,0.6)\"\n}), light: /* @__PURE__ */ Object.freeze({\n \"sm\": \"0 1px 0 0 rgba(31,59,91,0.12)\",\n \"md\": \"0 1px 0 0 rgba(31,59,91,0.12), 4px 5px 0 -2px rgba(46,74,107,0.14)\",\n \"lg\": \"0 1px 0 0 rgba(31,59,91,0.12), 6px 8px 0 -2px rgba(46,74,107,0.14)\",\n \"raised\": \"0 1px 0 0 rgba(31,59,91,0.12)\",\n \"floating\": \"0 1px 0 0 rgba(31,59,91,0.12), 4px 5px 0 -2px rgba(46,74,107,0.14)\",\n \"overlay\": \"0 1px 0 0 rgba(31,59,91,0.12), 8px 10px 0 -3px rgba(46,74,107,0.14)\",\n \"hover\": \"0 1px 0 0 rgba(31,59,91,0.12)\"\n}) });\n\n/** The griffe (BRAND.md §6.1): the size of the 45° cut corner of a control, in dp. */\nexport const cut = /* @__PURE__ */ Object.freeze({\n \"size\": 10\n});\n\n/** The brand themes as ThemeProvider overrides (`overrides={brands.orazaka}`): the accent family per theme. */\nexport const brands = /* @__PURE__ */ Object.freeze({\n \"krizaka\": {\n \"dark\": {\n \"accent\": \"#3e76a8\",\n \"accentHover\": \"#346793\",\n \"accentSoft\": \"rgba(62,118,168,0.12)\",\n \"accentText\": \"#8ebde1\",\n \"accent2\": \"#3e76a8\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#3e76a8\",\n \"info\": \"#3e76a8\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#2a5f8d\",\n \"accentHover\": \"#1f4d75\",\n \"accentSoft\": \"rgba(42,95,141,0.08)\",\n \"accentText\": \"#275782\",\n \"accent2\": \"#2a5f8d\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#2a5f8d\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"orazaka\": {\n \"dark\": {\n \"accent\": \"#f67e23\",\n \"accentHover\": \"#f79245\",\n \"accentSoft\": \"rgba(246,126,35,0.12)\",\n \"accentText\": \"#f78c3b\",\n \"accent2\": \"#f59e0b\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#f67e23\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#b45309\",\n \"accentHover\": \"#964608\",\n \"accentSoft\": \"rgba(180,83,9,0.08)\",\n \"accentText\": \"#9b4808\",\n \"accent2\": \"#a45904\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#b45309\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"orochia\": {\n \"dark\": {\n \"accent\": \"#7c3aed\",\n \"accentHover\": \"#6d28d9\",\n \"accentSoft\": \"rgba(139,92,246,0.12)\",\n \"accentText\": \"#a78bfa\",\n \"accent2\": \"#db2777\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#a78bfa\",\n \"info\": \"#7c3aed\",\n \"infoText\": \"#a78bfa\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#7c3aed\",\n \"accentHover\": \"#6d28d9\",\n \"accentSoft\": \"rgba(124,58,237,0.08)\",\n \"accentText\": \"#6d28d9\",\n \"accent2\": \"#db2777\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#7c3aed\",\n \"info\": \"#7c3aed\",\n \"infoText\": \"#6d28d9\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"yasakia\": {\n \"dark\": {\n \"accent\": \"#24dbc9\",\n \"accentHover\": \"#47e1d2\",\n \"accentSoft\": \"rgba(36,219,201,0.12)\",\n \"accentText\": \"#3ee0cf\",\n \"accent2\": \"#22c378\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#24dbc9\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#097169\",\n \"accentHover\": \"#085e57\",\n \"accentSoft\": \"rgba(9,113,105,0.08)\",\n \"accentText\": \"#096d64\",\n \"accent2\": \"#107546\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#097169\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"yororis\": {\n \"dark\": {\n \"accent\": \"#98b587\",\n \"accentHover\": \"#adc69f\",\n \"accentSoft\": \"rgba(152,181,135,0.12)\",\n \"accentText\": \"#a7c497\",\n \"accent2\": \"#c3a579\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#98b587\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#456237\",\n \"accentHover\": \"#39532d\",\n \"accentSoft\": \"rgba(69,98,55,0.08)\",\n \"accentText\": \"#415b33\",\n \"accent2\": \"#745834\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#456237\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"yomizaka\": {\n \"dark\": {\n \"accent\": \"#8888f2\",\n \"accentHover\": \"#a2a2f6\",\n \"accentSoft\": \"rgba(136,136,242,0.12)\",\n \"accentText\": \"#9797f7\",\n \"accent2\": \"#8d9aec\",\n \"onAccent\": \"#0c0c0e\",\n \"ring\": \"#8888f2\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#3c38b2\",\n \"accentHover\": \"#322e9e\",\n \"accentSoft\": \"rgba(60,56,178,0.08)\",\n \"accentText\": \"#3a36ab\",\n \"accent2\": \"#2d3c9f\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#3c38b2\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"kachizaka\": {\n \"dark\": {\n \"accent\": \"#fbcf23\",\n \"accentHover\": \"#fddb53\",\n \"accentSoft\": \"rgba(251,207,35,0.12)\",\n \"accentText\": \"#fbd84b\",\n \"accent2\": \"#7695f9\",\n \"onAccent\": \"#0c0e17\",\n \"ring\": \"#fbcf23\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#fac905\",\n \"accentHover\": \"#dcb104\",\n \"accentSoft\": \"rgba(250,193,5,0.14)\",\n \"accentText\": \"#1d3faf\",\n \"accent2\": \"#6285f8\",\n \"onAccent\": \"#0c0e17\",\n \"ring\": \"#1743d3\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n },\n \"akinaza\": {\n \"dark\": {\n \"accent\": \"#65c374\",\n \"accentHover\": \"#7fd28d\",\n \"accentSoft\": \"rgba(101,195,116,0.12)\",\n \"accentText\": \"#7dd48b\",\n \"accent2\": \"#dc946a\",\n \"onAccent\": \"#0a0f0c\",\n \"ring\": \"#65c374\",\n \"info\": \"#5e99c9\",\n \"infoText\": \"#8ebde1\",\n \"brandGradientFrom\": \"#151b18\",\n \"brandGradientVia\": \"#151b18\",\n \"brandGradientTo\": \"#151b18\"\n },\n \"light\": {\n \"accent\": \"#21692f\",\n \"accentHover\": \"#195726\",\n \"accentSoft\": \"rgba(33,105,47,0.08)\",\n \"accentText\": \"#20652e\",\n \"accent2\": \"#954923\",\n \"onAccent\": \"#ffffff\",\n \"ring\": \"#21692f\",\n \"info\": \"#2a5f8d\",\n \"infoText\": \"#275782\",\n \"brandGradientFrom\": \"#f4f6f3\",\n \"brandGradientVia\": \"#f4f6f3\",\n \"brandGradientTo\": \"#f4f6f3\"\n }\n }\n});\n/** The marks' emblem gradients: [offset, #rrggbb] stops, the same in both themes. */\nexport const marks = /* @__PURE__ */ Object.freeze({\n \"krizaka\": [\n [\n \"0%\",\n \"#3e76a8\"\n ],\n [\n \"100%\",\n \"#8ebde1\"\n ]\n ],\n \"orazaka\": [\n [\n \"0%\",\n \"#b45309\"\n ],\n [\n \"100%\",\n \"#dc6509\"\n ]\n ],\n \"orochia\": [\n [\n \"0%\",\n \"#7c3aed\"\n ],\n [\n \"55%\",\n \"#d946ef\"\n ],\n [\n \"100%\",\n \"#f472b6\"\n ]\n ],\n \"yasakia\": [\n [\n \"0%\",\n \"#079d61\"\n ],\n [\n \"100%\",\n \"#089b96\"\n ]\n ],\n \"yororis\": [\n [\n \"0%\",\n \"#a4773d\"\n ],\n [\n \"100%\",\n \"#5d894d\"\n ]\n ],\n \"yomizaka\": [\n [\n \"0%\",\n \"#5362c6\"\n ],\n [\n \"100%\",\n \"#6d5ec9\"\n ]\n ],\n \"kachizaka\": [\n [\n \"0%\",\n \"#355fe9\"\n ],\n [\n \"100%\",\n \"#a27807\"\n ]\n ],\n \"akinaza\": [\n [\n \"0%\",\n \"#2d8049\"\n ],\n [\n \"100%\",\n \"#bc632f\"\n ]\n ]\n});\n","// The native frame: the chart's title, its readout (the active point, written), a plot measured with onLayout, and\n// the accessibility the web gets from its table — the plot is one `adjustable` element whose label is the title and\n// the written summary, and whose increment / decrement (swipe up / down with VoiceOver and TalkBack) walk the points,\n// each one read as its value. A tap selects the nearest point. StyleSheet and the token roles only.\nimport { themes as tokenThemes } from \"@krizaka/tokens/native\";\nimport { createContext, type ReactNode, useContext, useMemo, useState } from \"react\";\nimport { type LayoutChangeEvent, Pressable, StyleSheet, Text, useColorScheme, View, type ViewStyle } from \"react-native\";\n\nimport { type ChartLabels, type ChartLabelsInput, mergeLabels } from \"../core/labels\";\nimport { type Mode, palette } from \"../core/palette\";\nimport type { BrandId, Locale, SeriesColor, Tone } from \"../core/types\";\n\n/** The colour roles a chart reads (a subset of @krizaka/tokens/native's `Theme`; `useTheme().theme` of @krizaka/ui/native fits). */\nexport type ChartTheme = {\n readonly surface1: string;\n readonly surface2: string;\n readonly surface3: string;\n readonly borderSubtle: string;\n readonly borderDefault: string;\n readonly textPrimary: string;\n readonly textSecondary: string;\n readonly textMuted: string;\n readonly accent: string;\n readonly success: string;\n readonly warning: string;\n readonly danger: string;\n readonly info: string;\n};\n\nconst THEMES: Readonly<Record<Mode, ChartTheme>> = tokenThemes;\n\nexport interface NativeChartsSettings {\n /** The locale of every figure and date. Default `\"en-US\"`. */\n locale?: Locale;\n /** The brand whose palette leads. Default Krizaka. */\n brand?: BrandId;\n /** The words: the readout, the summary. */\n labels?: ChartLabelsInput;\n /** Dark or light. Default: the device's (pass `useTheme().scheme` of @krizaka/ui/native to follow the app). */\n scheme?: Mode;\n /** The app's colour roles (`useTheme().theme` of @krizaka/ui/native): a product's brand overrides apply. */\n theme?: Partial<ChartTheme>;\n}\n\nconst Context = createContext<NativeChartsSettings>({});\n\n/** Sets the locale, brand, words, scheme and theme of every chart below it. */\nexport function ChartsProvider({ children, ...settings }: NativeChartsSettings & { children: ReactNode }) {\n const parent = useContext(Context);\n const value = useMemo(() => ({ ...parent, ...Object.fromEntries(Object.entries(settings).filter(([, v]) => v !== undefined)) }), [parent, settings]);\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\nexport interface Resolved {\n readonly locale: Locale;\n readonly labels: ChartLabels;\n readonly theme: ChartTheme;\n readonly palette: readonly string[];\n readonly color: (color: SeriesColor | undefined, slot: number) => string;\n}\n\nexport function useNativeSettings(own: NativeChartsSettings): Resolved {\n const shared = useContext(Context);\n const device = useColorScheme();\n const scheme: Mode = own.scheme ?? shared.scheme ?? (device === \"light\" ? \"light\" : \"dark\");\n const brand = own.brand ?? shared.brand ?? \"krizaka\";\n return useMemo(() => {\n const theme = { ...THEMES[scheme], ...shared.theme, ...own.theme };\n const colors = palette(brand, scheme);\n const tones: Record<Tone, string> = { neutral: theme.textSecondary, accent: theme.accent, success: theme.success, warning: theme.warning, danger: theme.danger, info: theme.info };\n return {\n locale: own.locale ?? shared.locale ?? \"en-US\",\n labels: mergeLabels(shared.labels, own.labels),\n theme,\n palette: colors,\n color: (color, slot) => (color === undefined ? colors[(slot - 1) % 8]! : typeof color === \"number\" ? colors[color - 1]! : color in tones ? tones[color as Tone] : color),\n };\n }, [scheme, brand, shared, own.locale, own.labels, own.theme]);\n}\n\nexport interface NativeFrameProps extends NativeChartsSettings {\n /** What the chart shows: its heading and accessible name. */\n title: string;\n /** Hide the heading (it stays the accessible name). */\n hideTitle?: boolean;\n /** The plot's height. */\n height?: number;\n /** The data is on its way. */\n loading?: boolean;\n /** Shown instead of the plot when there is nothing to draw. Default: the `empty` label. */\n empty?: ReactNode;\n /** The style of the chart's container (layout only: colours come from the theme). */\n style?: ViewStyle;\n}\n\ninterface FrameInternals {\n readonly frame: NativeFrameProps;\n readonly defaultHeight: number;\n readonly resolved: Resolved;\n readonly summary: string;\n readonly isEmpty: boolean;\n /** The points the screen reader walks, already written. */\n readonly points: readonly string[];\n readonly active: number | null;\n readonly onActive: (index: number | null) => void;\n /** The index nearest to a tap at `x` on a plot `width` wide. */\n readonly indexAt?: (x: number, width: number) => number | null;\n readonly legend?: ReactNode;\n readonly children: (width: number, height: number) => ReactNode;\n}\n\nexport function NativeFrame({ frame, defaultHeight, resolved, summary, isEmpty, points, active, onActive, indexAt, legend, children }: FrameInternals) {\n const { title, hideTitle, height = defaultHeight, loading, empty, style } = frame;\n const { theme, labels } = resolved;\n const [width, setWidth] = useState(0);\n const onLayout = (event: LayoutChangeEvent) => setWidth(Math.round(event.nativeEvent.layout.width));\n const readout = active !== null ? points[active] : null;\n const n = points.length;\n\n let body: ReactNode;\n if (loading) body = <View style={[styles.state, { backgroundColor: theme.surface2 }]} role=\"progressbar\" aria-label={labels.loading} />;\n else if (isEmpty)\n body = empty ?? (\n <View style={[styles.state, { borderColor: theme.borderDefault, borderWidth: StyleSheet.hairlineWidth, borderStyle: \"dashed\" }]}>\n <Text style={[styles.small, { color: theme.textSecondary }]}>{labels.empty}</Text>\n </View>\n );\n else body = width > 0 ? children(width, height) : null;\n\n return (\n <View style={[styles.root, style]}>\n {!hideTitle && (\n <Text style={[styles.title, { color: theme.textPrimary }]} role=\"heading\">\n {title}\n </Text>\n )}\n {legend}\n <Pressable\n onLayout={onLayout}\n style={{ height }}\n disabled={isEmpty || loading}\n onPress={(event) => indexAt && onActive(indexAt(event.nativeEvent.locationX, width))}\n accessible\n // With points to walk, an adjustable element (a slider on the web): its value is the active point.\n accessibilityRole={n ? \"adjustable\" : \"image\"}\n accessibilityLabel={`${title}. ${summary}`}\n accessibilityValue={n ? { min: 0, max: n - 1, now: active ?? 0, ...(readout ? { text: readout } : {}) } : undefined}\n // react-native-web reads the ARIA props (the slider's required value), React Native the accessibility ones.\n aria-valuemin={n ? 0 : undefined}\n aria-valuemax={n ? n - 1 : undefined}\n aria-valuenow={n ? (active ?? 0) : undefined}\n aria-valuetext={readout ?? undefined}\n accessibilityActions={n ? [{ name: \"increment\" }, { name: \"decrement\" }] : []}\n onAccessibilityAction={(event) => {\n if (!n) return;\n if (event.nativeEvent.actionName === \"increment\") onActive(Math.min(n - 1, (active ?? -1) + 1));\n if (event.nativeEvent.actionName === \"decrement\") onActive(Math.max(0, (active ?? n) - 1));\n }}\n >\n {body}\n </Pressable>\n {readout ? (\n <Text style={[styles.small, { color: theme.textSecondary }]} aria-hidden>\n {readout}\n </Text>\n ) : null}\n </View>\n );\n}\n\n/** The legend: a key in the series' colour beside its name in the text colour (two series or more). */\nexport function NativeLegend({ items, theme }: { items: readonly { label: string; color: string }[]; theme: ChartTheme }) {\n if (items.length < 2) return null;\n return (\n <View style={styles.legend} aria-hidden>\n {items.map((item) => (\n <View key={item.label} style={styles.legendItem}>\n <View style={[styles.key, { backgroundColor: item.color }]} />\n <Text style={[styles.small, { color: theme.textSecondary }]}>{item.label}</Text>\n </View>\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n root: { gap: 8 },\n title: { fontSize: 14, fontWeight: \"600\", lineHeight: 20 },\n small: { fontSize: 12, lineHeight: 16, fontVariant: [\"tabular-nums\"] },\n state: { flex: 1, borderRadius: 10, alignItems: \"center\", justifyContent: \"center\", padding: 16 },\n legend: { flexDirection: \"row\", flexWrap: \"wrap\", columnGap: 14, rowGap: 4 },\n legendItem: { flexDirection: \"row\", alignItems: \"center\", gap: 6 },\n key: { width: 10, height: 10, borderRadius: 3 },\n});\n","// The data palettes. One categorical set of eight hues, stepped for each theme (the dark steps are chosen for the\n// dark surface, not flipped), ordered per brand so that the first series wears the brand's own hue — Krizaka blue,\n// Orazaka orange, Orochia violet then magenta, its gradient. Every order was chosen among the ones that pass the\n// colour-vision checks (scripts/palette.test: lightness band, chroma floor, adjacent ΔE under protan/deutan ≥ 8 —\n// Orochia light 7.2, inside the 6–8 band that requires the secondary encoding every chart carries: legend, direct\n// labels, data table —, normal-vision ΔE ≥ 15, ≥ 3:1 on the surface, the first three slots distinct all-pairs).\n// A 9th series never gets a generated hue: it folds into “Other” or a second chart.\nimport type { BrandId } from \"./types\";\n\nexport type Mode = \"dark\" | \"light\";\n\n/** The eight hues, light and dark steps. */\nexport const HUES = {\n blue: { light: \"#2a78d6\", dark: \"#3987e5\" },\n orange: { light: \"#eb6834\", dark: \"#d95926\" },\n aqua: { light: \"#1baf7a\", dark: \"#199e70\" },\n yellow: { light: \"#eda100\", dark: \"#c98500\" },\n magenta: { light: \"#e87ba4\", dark: \"#d55181\" },\n green: { light: \"#008300\", dark: \"#008300\" },\n violet: { light: \"#6250d6\", dark: \"#9085e9\" },\n red: { light: \"#e34948\", dark: \"#e66767\" },\n} as const;\n\nexport type Hue = keyof typeof HUES;\n\n/** The order of the hues for each brand: slot 1 is the brand. */\nexport const ORDERS: Record<BrandId, readonly Hue[]> = {\n krizaka: [\"blue\", \"green\", \"magenta\", \"yellow\", \"aqua\", \"orange\", \"violet\", \"red\"],\n orazaka: [\"orange\", \"blue\", \"aqua\", \"yellow\", \"magenta\", \"green\", \"violet\", \"red\"],\n orochia: [\"violet\", \"magenta\", \"yellow\", \"aqua\", \"orange\", \"blue\", \"green\", \"red\"],\n};\n\n/** The categorical palette of a brand in a theme: eight hex colours, slot 1 first. */\nexport function palette(brand: BrandId, mode: Mode): string[] {\n return ORDERS[brand].map((hue) => HUES[hue][mode]);\n}\n\n/** The diverging poles (below / above the midpoint): blue ↔ red, a neutral grey between them. */\nexport const DIVERGING = {\n light: { low: HUES.blue.light, high: HUES.red.light },\n dark: { low: HUES.blue.dark, high: HUES.red.dark },\n} as const;\n\n// --- Colour arithmetic (OKLab), for the sequential ramps the canvas engine needs as plain colours. ---------------\n\ntype Rgb = [number, number, number];\n\n/** `#rrggbb`, `#rgb`, `rgb(r, g, b)` / `rgba(…)` or `rgb(r g b / a)` → [r, g, b] in 0–255; null otherwise. */\nexport function parseColor(color: string): Rgb | null {\n const hex = color.trim().match(/^#([\\da-f]{3}|[\\da-f]{6})$/i);\n if (hex) {\n const h = hex[1]!.length === 3 ? [...hex[1]!].map((c) => c + c).join(\"\") : hex[1]!;\n return [0, 2, 4].map((i) => Number.parseInt(h.slice(i, i + 2), 16)) as Rgb;\n }\n const rgb = color.trim().match(/^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)/i);\n if (rgb) return [Number(rgb[1]), Number(rgb[2]), Number(rgb[3])];\n return null;\n}\n\nconst toLinear = (c: number) => {\n const v = c / 255;\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;\n};\nconst fromLinear = (v: number) => {\n const c = v <= 0.0031308 ? v * 12.92 : 1.055 * v ** (1 / 2.4) - 0.055;\n return Math.round(Math.min(1, Math.max(0, c)) * 255);\n};\n\nfunction toOklab([r8, g8, b8]: Rgb): Rgb {\n const [r, g, b] = [toLinear(r8), toLinear(g8), toLinear(b8)];\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n return [0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s, 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s, 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s];\n}\n\nfunction fromOklab([L, a, b]: Rgb): Rgb {\n const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;\n const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;\n const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;\n return [\n fromLinear(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n fromLinear(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n fromLinear(-0.0041960863 * l - 0.7034186147 * m + 1.707614031 * s),\n ];\n}\n\nconst hex = ([r, g, b]: Rgb) => `#${[r, g, b].map((c) => c.toString(16).padStart(2, \"0\")).join(\"\")}`;\n\n/** `a` → `b` at `t` (0–1), interpolated in OKLab (even steps to the eye). Unparseable colours return `b`. */\nexport function mix(a: string, b: string, t: number): string {\n const ca = parseColor(a);\n const cb = parseColor(b);\n if (!ca || !cb) return b;\n const la = toOklab(ca);\n const lb = toOklab(cb);\n return hex(fromOklab([0, 1, 2].map((i) => la[i]! + (lb[i]! - la[i]!) * t) as Rgb));\n}\n\n/**\n * A sequential ramp of `steps` colours, one hue from near the surface (`0`, “almost nothing”) to the full hue: the\n * magnitude of a heatmap, a calendar or a choropleth. The first step is still distinct from the surface.\n */\nexport function sequential(hue: string, surface: string, steps = 5): string[] {\n return Array.from({ length: steps }, (_, i) => mix(surface, hue, 0.22 + (0.78 * i) / Math.max(1, steps - 1)));\n}\n\n/** WCAG contrast ratio between two colours (for the tests and the labels drawn inside a mark). */\nexport function contrast(a: string, b: string): number {\n const lum = (c: string) => {\n const rgb = parseColor(c);\n if (!rgb) return 0;\n const [r, g, bl] = rgb.map(toLinear) as Rgb;\n return 0.2126 * r + 0.7152 * g + 0.0722 * bl;\n };\n const [hi, lo] = [lum(a), lum(b)].sort((x, y) => y - x) as [number, number];\n return (hi + 0.05) / (lo + 0.05);\n}\n","// The ready-made charts for React Native, with the web's names and props: EarningsChart, JobThroughput, LatencyChart,\n// CreditUsage, GoalProgress, PriceTicker. Each one is a heading, its key figure in large (the first thing a phone\n// shows: the number before the chart) and the native chart under it — the same arithmetic as the web (src/needs).\nimport { StyleSheet, Text, View, type ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nimport { categoryFormatter, valueFormatter } from \"../core/format\";\nimport type { Accessor, CategoryFormat, Datum, SeriesSpec, Threshold, Tone, ValueFormat } from \"../core/types\";\nimport {\n CREDIT_LABELS,\n type CreditLabels,\n EARNINGS_LABELS,\n type EarningsLabels,\n GOAL_LABELS,\n type GoalLabels,\n LATENCY_LABELS,\n type LatencyLabels,\n THROUGHPUT_LABELS,\n type ThroughputLabels,\n TICKER_LABELS,\n type TickerLabels,\n} from \"../needs/labels\";\nimport { addDays, daysLeft, direction, fillIn, formatDuration, lastChange, numberOf, quotaLevel, roundMoney, signedPercent, successRate, total } from \"../needs/model\";\nimport { DEFAULT_STATUSES, type JobStatus } from \"../needs/statuses\";\nimport { type Bid, tickerModel } from \"../needs/ticker\";\nimport { BarChart, LineChart, type NativeCartesianProps } from \"./cartesian\";\nimport { type NativeChartsSettings, type NativeFrameProps, type Resolved, useNativeSettings } from \"./frame\";\nimport { Gauge, Sparkline } from \"./round\";\n\nconst ARROW = { up: \"M7 17 17 7M8 7h9v9\", down: \"M7 7l10 10M17 8v9H8\", flat: \"M5 12h14M13 6l6 6-6 6\" } as const;\n\nfunction toneColor(resolved: Resolved, tone: Tone) {\n return resolved.color(tone, 1);\n}\n\n/** The heading and the key figure of a ready-made chart: the value, what it is, the change in words (arrow decorative). */\nfunction Headline({\n resolved,\n title,\n hideTitle,\n value,\n label,\n delta,\n way,\n tone = \"neutral\",\n}: {\n resolved: Resolved;\n title: string;\n hideTitle?: boolean;\n value: string;\n label?: string;\n delta?: string | null;\n way?: \"up\" | \"down\" | \"flat\" | null;\n tone?: Tone;\n}) {\n const { theme } = resolved;\n return (\n <View style={styles.head}>\n {!hideTitle ? (\n <Text role=\"heading\" style={[styles.title, { color: theme.textPrimary }]}>\n {title}\n </Text>\n ) : null}\n <View style={styles.kpi}>\n <Text style={[styles.value, { color: theme.textPrimary }]}>{value}</Text>\n {label ? <Text style={[styles.small, { color: theme.textSecondary }]}>{label}</Text> : null}\n </View>\n {delta ? (\n <View style={styles.delta}>\n {way ? (\n <Svg width={12} height={12} viewBox=\"0 0 24 24\" aria-hidden>\n <Path d={ARROW[way]} fill=\"none\" stroke={toneColor(resolved, tone)} strokeWidth={2.5} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </Svg>\n ) : null}\n <Text style={[styles.small, styles.strong, { color: theme.textPrimary }]}>{delta}</Text>\n </View>\n ) : null}\n </View>\n );\n}\n\nconst good = (way: \"up\" | \"down\" | \"flat\" | null, up: boolean): Tone => (!way || way === \"flat\" ? \"neutral\" : (way === \"up\") === up ? \"success\" : \"danger\");\n\ntype Base<T extends Datum> = Omit<NativeCartesianProps<T>, \"y\" | \"yLabel\" | \"series\" | \"format\" | \"x\" | \"xFormat\" | \"thresholds\" | \"labels\">;\n\nexport interface NativeEarningsChartProps<T extends Datum> extends Base<T> {\n /** The field (or function) of the period. Default `\"month\"`. */\n x?: Accessor<T, unknown>;\n /** The net amount of each period, in minor units. */\n net: Accessor<T, number | null | undefined>;\n /** The gross amount, drawn beside the net. */\n gross?: Accessor<T, number | null | undefined>;\n /** The ISO 4217 currency. */\n currency: string;\n /** How the periods are written. Default `\"month\"`. */\n period?: CategoryFormat;\n /** The payout threshold, drawn as a line. */\n payoutThreshold?: Threshold;\n /** The words, passed translated. */\n labels?: Partial<EarningsLabels>;\n}\n\n/** Earnings per period in money (React Native): the total and the change first, the bars under them. */\nexport function EarningsChart<T extends Datum>({ x = \"month\" as Accessor<T, unknown>, net, gross, currency, period = \"month\", payoutThreshold, labels: given, title, hideTitle, data, ...props }: NativeEarningsChartProps<T>) {\n const words = { ...EARNINGS_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const format = { style: \"money\", currency } as const;\n const change = lastChange(data.map((row, i) => numberOf(row, net, i)));\n const way = direction(change);\n const series: SeriesSpec<T>[] = gross ? [{ key: gross, label: words.gross, color: 2 }, { key: net, label: words.net, color: 1 }] : [{ key: net, label: words.net, color: 1 }];\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={valueFormatter(format, resolved.locale)(total(data, net))}\n label={fillIn(words.total, { count: data.length })}\n delta={change == null ? null : fillIn(words.change, { change: signedPercent(change, resolved.locale) })}\n way={way}\n tone={good(way, true)}\n />\n <BarChart {...props} title={title} hideTitle data={data} x={x} series={series} format={format} xFormat={period} thresholds={payoutThreshold ? [{ tone: \"success\", ...payoutThreshold }] : undefined} />\n </View>\n );\n}\n\nexport interface NativeJobThroughputProps<T extends Datum> extends Base<T> {\n /** The field of the period. Default `\"day\"`. */\n x?: Accessor<T, unknown>;\n /** How the periods are written. Default `\"day\"`. */\n period?: CategoryFormat;\n /** The statuses, in stacking order. Default: completed, failed, running, queued. */\n statuses?: readonly JobStatus[];\n /** The words, passed translated. */\n labels?: Partial<ThroughputLabels>;\n}\n\n/** Jobs per period stacked by status (React Native): the total and the success rate first. */\nexport function JobThroughput<T extends Datum>({ x = \"day\" as Accessor<T, unknown>, period = \"day\", statuses = DEFAULT_STATUSES, labels: given, title, hideTitle, data, ...props }: NativeJobThroughputProps<T>) {\n const words = { ...THROUGHPUT_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const sum = (outcome?: \"succeeded\" | \"failed\") => statuses.filter((s) => outcome === undefined || s.outcome === outcome).reduce((n, s) => n + total(data, s.key as Accessor<T, number>), 0);\n const rate = successRate(sum(\"succeeded\"), sum(\"failed\"));\n const series = statuses.map((s) => ({ key: s.key as Accessor<T, number | null | undefined>, label: s.label, color: s.tone }));\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={valueFormatter(\"integer\", resolved.locale)(sum())}\n label={fillIn(words.total, { count: data.length })}\n delta={rate == null ? null : fillIn(words.success, { rate: valueFormatter(\"percent\", resolved.locale)(rate) })}\n />\n <BarChart {...props} title={title} hideTitle data={data} x={x} xFormat={period} series={series} format=\"integer\" stacked />\n </View>\n );\n}\n\nexport interface NativeLatencyChartProps<T extends Datum> extends Base<T> {\n /** The field naming what is measured. Default `\"name\"`. */\n x?: Accessor<T, unknown>;\n /** The median, in milliseconds. Default `\"p50\"`. */\n p50?: Accessor<T, number | null | undefined>;\n /** The 95th percentile, in milliseconds. Default `\"p95\"`; `null` for the median alone. */\n p95?: Accessor<T, number | null | undefined> | null;\n /** The service objective, in milliseconds. */\n objective?: { readonly value: number; readonly label: string };\n /** The words, passed translated. */\n labels?: Partial<LatencyLabels>;\n}\n\n/** Median and p95 latency per item (React Native, vertical bars): the slowest p95 first. */\nexport function LatencyChart<T extends Datum>({\n x = \"name\" as Accessor<T, unknown>,\n p50 = \"p50\" as Accessor<T, number | null | undefined>,\n p95 = \"p95\" as Accessor<T, number | null | undefined>,\n objective,\n labels: given,\n title,\n hideTitle,\n data,\n ...props\n}: NativeLatencyChartProps<T>) {\n const words = { ...LATENCY_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const tail = p95 ?? p50;\n const measured = data.map((row, i) => ({ row, i, value: numberOf(row, tail, i) ?? 0 }));\n const slowest = measured.reduce<(typeof measured)[number] | null>((a, m) => (!a || m.value > a.value ? m : a), null);\n const over = objective ? measured.filter((m) => m.value > objective.value).length : 0;\n const nameOf = (row: T, i: number) => String(typeof x === \"function\" ? x(row, i) : (row as Record<string, unknown>)[x]);\n const series: SeriesSpec<T>[] = [{ key: p50, label: words.p50, color: \"neutral\" }, ...(p95 ? [{ key: p95, label: words.p95, color: 1 as const }] : [])];\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={slowest ? formatDuration(slowest.value, resolved.locale) : \"—\"}\n label={slowest ? fillIn(words.slowest, { name: nameOf(slowest.row, slowest.i) }) : undefined}\n delta={objective ? (over > 0 ? fillIn(words.over, { count: over }) : words.within) : null}\n way={objective ? (over > 0 ? \"up\" : \"flat\") : null}\n tone={over > 0 ? \"danger\" : \"success\"}\n />\n <BarChart\n {...props}\n title={title}\n hideTitle\n data={data}\n x={x}\n series={series}\n format={(value, l) => formatDuration(value, l)}\n thresholds={objective ? [{ ...objective, tone: \"danger\" }] : undefined}\n />\n </View>\n );\n}\n\nexport interface NativeCreditUsageProps extends Omit<NativeChartsSettings, \"labels\"> {\n /** What the allowance is: the heading and the meter's name. */\n title: string;\n /** Hide the heading (it stays the accessible name). */\n hideTitle?: boolean;\n /** How much is used. */\n used: number;\n /** The allowance. */\n limit: number;\n /** How the amounts are written. Default `\"integer\"`. */\n format?: ValueFormat;\n /** The use of each recent day, oldest first. */\n daily?: readonly (number | null)[];\n /** When the allowance renews. */\n renewsAt?: string | Date;\n /** Today, for the projection. Default: now. */\n now?: Date;\n /** The shares where the meter turns to warning, then danger. Default `[0.8, 0.95]`. */\n levels?: readonly [number, number];\n /** The words, passed translated. */\n labels?: Partial<CreditLabels>;\n /** The style of the container (layout only). */\n style?: ViewStyle;\n}\n\n/** What is left of an allowance (React Native): the remaining amount, a meter in tones, the use per day, the run-out date. */\nexport function CreditUsage({ title, hideTitle, used, limit, format = \"integer\", daily, renewsAt, now, levels = [0.8, 0.95], labels: given, style, ...settings }: NativeCreditUsageProps) {\n const words = { ...CREDIT_LABELS, ...given };\n const resolved = useNativeSettings(settings);\n const { theme, locale } = resolved;\n const write = valueFormatter(format, locale);\n const date = categoryFormatter(\"date\", locale);\n const ratio = limit > 0 ? Math.min(1, Math.max(0, used / limit)) : 0;\n const level = quotaLevel(ratio, levels[0], levels[1]);\n const remaining = Math.max(0, limit - used);\n const usedText = fillIn(words.used, { used: write(used), percent: valueFormatter(\"percent\", locale)(ratio) });\n const left = daily ? daysLeft(remaining, daily) : null;\n const runOut = left == null ? null : addDays(now ?? new Date(), left);\n const renews = renewsAt ? new Date(renewsAt) : null;\n const projection = daily ? (runOut && (!renews || runOut < renews) ? fillIn(words.runsOut, { date: date(runOut) }) : left == null ? words.steady : null) : null;\n const fill = level === \"danger\" ? theme.danger : level === \"warning\" ? theme.warning : theme.accent;\n return (\n <View style={[styles.root, style]}>\n <Headline resolved={resolved} title={title} hideTitle={hideTitle} value={write(remaining)} label={fillIn(words.remaining, { limit: write(limit) })} />\n <View\n role=\"meter\"\n aria-label={title}\n aria-valuemin={0}\n aria-valuemax={limit}\n aria-valuenow={Math.min(limit, Math.max(0, used))}\n aria-valuetext={usedText}\n accessible\n style={[styles.meter, { backgroundColor: theme.surface3 }]}\n >\n <View style={[styles.meterFill, { width: `${ratio * 100}%`, backgroundColor: fill }]} />\n </View>\n <View style={styles.row}>\n <Text style={[styles.small, { color: theme.textSecondary }]}>{usedText}</Text>\n {renews ? <Text style={[styles.small, { color: theme.textSecondary }]}>{fillIn(words.renews, { date: date(renews) })}</Text> : null}\n </View>\n {daily && daily.length > 1 ? <Sparkline {...settings} title={words.daily} data={daily} variant=\"bar\" format={format} height={36} /> : null}\n {projection ? <Text style={[styles.small, styles.strong, { color: theme.textPrimary }]}>{projection}</Text> : null}\n </View>\n );\n}\n\nexport interface NativeGoalProgressProps extends Omit<NativeFrameProps, \"loading\" | \"empty\" | \"labels\"> {\n /** The amount raised, in minor units. */\n raised: number;\n /** The goal, in minor units. */\n goal: number;\n /** The ISO 4217 currency. */\n currency: string;\n /** How many people chipped in. */\n supporters?: number;\n /** The time left, written by the app (“2 days”). */\n timeLeft?: string;\n /** The words, passed translated. */\n labels?: Partial<GoalLabels>;\n}\n\n/** A pot towards its goal, in money (React Native): the arc fills, the words say how much of what. */\nexport function GoalProgress({ raised, goal, currency, supporters, timeLeft, labels: given, ...props }: NativeGoalProgressProps) {\n const words = { ...GOAL_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const format = roundMoney(currency);\n const reached = goal > 0 && raised >= goal;\n const facts = [\n supporters != null ? fillIn(words.supporters, { count: valueFormatter(\"integer\", resolved.locale)(supporters) }) : null,\n reached ? words.reached : null,\n timeLeft ? fillIn(words.left, { time: timeLeft }) : null,\n ].filter(Boolean);\n return (\n <View style={styles.root}>\n <Gauge {...props} value={raised} max={goal} format={format} caption={fillIn(words.raised, { goal: valueFormatter(format, resolved.locale)(goal) })} tone={reached ? \"success\" : \"accent\"} />\n {facts.length > 0 ? <Text style={[styles.small, { color: resolved.theme.textSecondary, textAlign: \"center\" }]}>{facts.join(\" · \")}</Text> : null}\n </View>\n );\n}\n\nexport interface NativePriceTickerProps extends Omit<NativeFrameProps, \"loading\" | \"labels\"> {\n /** The bids, in any order. */\n bids: readonly Bid[];\n /** The opening price, in minor units. */\n opening: number;\n /** When the auction opened. */\n openedAt?: string | Date;\n /** The ISO 4217 currency. */\n currency: string;\n /** The reserve price, drawn as a line until it is met. */\n reserve?: number;\n /** How the times are written. Default `\"time\"`. */\n timeFormat?: CategoryFormat;\n /** The words, passed translated. */\n labels?: Partial<TickerLabels>;\n}\n\n/** A live auction's price (React Native): the current bid in large, the change since the opening, the steps of the bids. */\nexport function PriceTicker({ bids, opening, openedAt, currency, reserve, timeFormat = \"time\", labels: given, title, hideTitle, ...props }: NativePriceTickerProps) {\n const words = { ...TICKER_LABELS, ...given };\n const resolved = useNativeSettings(props);\n const format = { style: \"money\", currency } as const;\n const write = valueFormatter(format, resolved.locale);\n const model = tickerModel(bids, opening, openedAt);\n const way = model.count > 0 ? direction(model.ratio) : null;\n const signed = `${model.change > 0 ? \"+\" : \"\"}${write(model.change)}`;\n const change = model.ratio == null ? signed : `${signed} (${signedPercent(model.ratio, resolved.locale)})`;\n return (\n <View style={styles.root}>\n <Headline\n resolved={resolved}\n title={title}\n hideTitle={hideTitle}\n value={write(model.current)}\n label={model.count > 0 ? words.current : words.opening}\n delta={model.count > 0 ? fillIn(words.change, { change, count: model.count }) : null}\n way={way}\n tone={good(way, true)}\n />\n <LineChart\n {...props}\n title={title}\n hideTitle\n data={model.points as { at: string | Date; amount: number }[]}\n x=\"at\"\n y=\"amount\"\n yLabel={words.price}\n xFormat={timeFormat}\n format={format}\n curve=\"step\"\n thresholds={reserve != null && model.current < reserve ? [{ value: reserve, label: words.reserve, tone: \"warning\" }] : undefined}\n />\n </View>\n );\n}\n\n\nconst styles = StyleSheet.create({\n root: { gap: 8 },\n head: { gap: 2 },\n title: { fontSize: 14, fontWeight: \"600\", lineHeight: 20 },\n kpi: { flexDirection: \"row\", flexWrap: \"wrap\", alignItems: \"baseline\", columnGap: 8 },\n value: { fontSize: 24, lineHeight: 30, fontWeight: \"800\", fontVariant: [\"tabular-nums\"] },\n delta: { flexDirection: \"row\", alignItems: \"center\", gap: 4 },\n small: { fontSize: 12, lineHeight: 16, fontVariant: [\"tabular-nums\"] },\n strong: { fontWeight: \"600\" },\n meter: { height: 10, borderRadius: 999, overflow: \"hidden\" },\n meterFill: { height: \"100%\", borderRadius: 999 },\n row: { flexDirection: \"row\", flexWrap: \"wrap\", justifyContent: \"space-between\", columnGap: 12 },\n});\n","// The words of the ready-made charts: English by default, an app passes its own (translated) through `labels`.\n// Placeholders are written `{name}`.\n\nexport interface EarningsLabels {\n /** Under the total: `earned over {count} months`. `{count}` is the number of periods. */\n total: string;\n /** The change of the last period: `{change} vs the previous month`. */\n change: string;\n /** The gross series' name. */\n gross: string;\n /** The net series' name. */\n net: string;\n}\n\nexport const EARNINGS_LABELS: EarningsLabels = {\n total: \"earned over {count} periods\",\n change: \"{change} vs the previous period\",\n gross: \"Gross\",\n net: \"Net\",\n};\n\nexport interface ThroughputLabels {\n /** Under the total: `jobs over {count} days`. */\n total: string;\n /** The success rate of the finished jobs: `{rate} succeeded`. */\n success: string;\n}\n\nexport const THROUGHPUT_LABELS: ThroughputLabels = { total: \"jobs over {count} periods\", success: \"{rate} succeeded\" };\n\nexport interface LatencyLabels {\n /** The median series. */\n p50: string;\n /** The 95th percentile series. */\n p95: string;\n /** The slowest p95: `slowest: {name}`. */\n slowest: string;\n /** How many go past the objective: `{count} over the objective`. */\n over: string;\n /** All within the objective. */\n within: string;\n}\n\nexport const LATENCY_LABELS: LatencyLabels = {\n p50: \"Median (p50)\",\n p95: \"p95\",\n slowest: \"p95 of {name}, the slowest\",\n over: \"{count} over the objective\",\n within: \"all within the objective\",\n};\n\nexport interface CreditLabels {\n /** Under the remaining amount: `left of {limit}`. */\n remaining: string;\n /** The used part: `{used} used ({percent})`. */\n used: string;\n /** The projection: `at this pace, runs out on {date}`. */\n runsOut: string;\n /** No use lately: it does not run out. */\n steady: string;\n /** The renewal: `renews on {date}`. */\n renews: string;\n /** The daily use sparkline's title. */\n daily: string;\n}\n\nexport const CREDIT_LABELS: CreditLabels = {\n remaining: \"left of {limit}\",\n used: \"{used} used ({percent})\",\n runsOut: \"At this pace, runs out on {date}\",\n steady: \"No use lately\",\n renews: \"Renews on {date}\",\n daily: \"Use per day\",\n};\n\nexport interface GoalLabels {\n /** Under the amount: `raised of {goal}`. */\n raised: string;\n /** Reached: `goal reached`. */\n reached: string;\n /** The supporters: `{count} supporters`. */\n supporters: string;\n /** The time left: `{time} left`. */\n left: string;\n}\n\nexport const GOAL_LABELS: GoalLabels = { raised: \"raised of {goal}\", reached: \"Goal reached\", supporters: \"{count} supporters\", left: \"{time} left\" };\n\nexport interface TickerLabels {\n /** Under the price: `current bid`. */\n current: string;\n /** The change since the opening: `{change} since the opening ({count} bids)`. */\n change: string;\n /** No bid yet: `opening price`. */\n opening: string;\n /** The reserve line. */\n reserve: string;\n /** The series' name. */\n price: string;\n}\n\nexport const TICKER_LABELS: TickerLabels = {\n current: \"current bid\",\n change: \"{change} since the opening · {count} bids\",\n opening: \"opening price, no bid yet\",\n reserve: \"Reserve price\",\n price: \"Price\",\n};\n","// The arithmetic of the ready-made charts (EarningsChart, JobThroughput, LatencyChart, CreditUsage, GoalProgress,\n// PriceTicker), shared by the web and React Native: totals, the change between the last two periods, a success rate,\n// the day a balance runs out at the current pace. Pure functions: no React, no DOM.\nimport { currencyDigits, getNumberFormat } from \"@krizaka/intl\";\n\nimport type { Accessor, Datum, Locale } from \"../core/types\";\n\n/** Reads a field (or calls a function) of a row; `null` for anything that is not a finite number. */\nexport function numberOf<T extends Datum>(row: T, accessor: Accessor<T, number | null | undefined>, index: number): number | null {\n const value = typeof accessor === \"function\" ? accessor(row, index) : (row as Record<string, unknown>)[accessor];\n return typeof value === \"number\" && Number.isFinite(value) ? value : null;\n}\n\n/** The sum of a column, `null` values left out. */\nexport function total<T extends Datum>(rows: readonly T[], accessor: Accessor<T, number | null | undefined>): number {\n return rows.reduce((sum, row, i) => sum + (numberOf(row, accessor, i) ?? 0), 0);\n}\n\n/**\n * The change of the last period against the one before, as a ratio (`0.12` = +12 %): `null` when it cannot be said\n * (fewer than two periods, a previous period at zero or missing).\n */\nexport function lastChange(values: readonly (number | null)[]): number | null {\n if (values.length < 2) return null;\n const last = values[values.length - 1];\n const previous = values[values.length - 2];\n if (last == null || previous == null || previous === 0) return null;\n return last / previous - 1;\n}\n\n/** `up`, `down` or `flat` (within ±0.5 %): the direction of a change, `null` when there is none. */\nexport function direction(change: number | null): \"up\" | \"down\" | \"flat\" | null {\n if (change == null) return null;\n return Math.abs(change) < 0.005 ? \"flat\" : change > 0 ? \"up\" : \"down\";\n}\n\n/** Succeeded out of finished (succeeded + failed); `null` when nothing finished. */\nexport function successRate(succeeded: number, failed: number): number | null {\n const finished = succeeded + failed;\n return finished > 0 ? succeeded / finished : null;\n}\n\n/**\n * When a balance runs out at the pace of the last `days` days of use (oldest first): the number of whole days left,\n * or `null` when nothing is being used (it never runs out) or there is no history.\n */\nexport function daysLeft(remaining: number, daily: readonly (number | null)[], days = 7): number | null {\n const recent = daily.slice(-days).filter((v): v is number => v != null && v >= 0);\n if (recent.length === 0) return null;\n const pace = recent.reduce((a, b) => a + b, 0) / recent.length;\n if (pace <= 0) return null;\n return Math.max(0, Math.floor(remaining / pace));\n}\n\n/** `from` + `days` days, at the same time of day. */\nexport const addDays = (from: Date, days: number) => new Date(from.getTime() + days * 86_400_000);\n\n/** The level of a quota: `ok` below `warning` (default 0.8), `warning` below `danger` (0.95), then `danger`. */\nexport function quotaLevel(ratio: number, warning = 0.8, danger = 0.95): \"ok\" | \"warning\" | \"danger\" {\n return ratio >= danger ? \"danger\" : ratio >= warning ? \"warning\" : \"ok\";\n}\n\n/** Replaces `{name}` placeholders. */\nexport function fillIn(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match, key: string) => (key in values ? String(values[key]) : match));\n}\n\n/** A signed ratio as a percentage for a change (`+12 %`, `−3 %`), in the locale's way. */\nexport function signedPercent(change: number, locale: Locale): string {\n return getNumberFormat(locale, { style: \"percent\", signDisplay: \"exceptZero\", maximumFractionDigits: Math.abs(change) < 0.1 ? 1 : 0 }).format(change);\n}\n\n/** Milliseconds as a duration: `840 ms`, `1.2 s`, `2.5 min` — the unit follows the size, through Intl. */\nexport function formatDuration(ms: number, locale: Locale): string {\n const unit = (value: number, name: string, digits: number) =>\n getNumberFormat(locale, { style: \"unit\", unit: name, unitDisplay: \"short\", maximumFractionDigits: digits }).format(value);\n const abs = Math.abs(ms);\n if (abs < 1000) return unit(Math.round(ms), \"millisecond\", 0);\n if (abs < 60_000) return unit(ms / 1000, \"second\", abs < 10_000 ? 1 : 0);\n if (abs < 3_600_000) return unit(ms / 60_000, \"minute\", 1);\n return unit(ms / 3_600_000, \"hour\", 1);\n}\n\n/** Money in minor units, without the cents of a round amount (`$500`, `$262.50`): a goal reads as people say it. */\nexport function roundMoney(currency: string): (value: number, locale: Locale) => string {\n const digits = currencyDigits(currency);\n return (value, locale) => {\n const minor = Math.round(value);\n const whole = minor % 10 ** digits === 0;\n return getNumberFormat(locale, { style: \"currency\", currency, minimumFractionDigits: whole ? 0 : digits, maximumFractionDigits: whole ? 0 : digits }).format(minor / 10 ** digits);\n };\n}\n","// The price of a live auction, shared by the web and React Native: the points to draw (the opening, then each bid)\n// and what the headline says (the current price, the change since the opening, the number of bids).\n\n/** A bid: when (an ISO date-time or a `Date`) and how much, in money minor units. */\nexport interface Bid {\n readonly at: string | Date;\n readonly amount: number;\n}\n\nexport interface TickerModel {\n readonly points: readonly { readonly at: string | Date; readonly amount: number }[];\n readonly current: number;\n readonly change: number;\n readonly ratio: number | null;\n readonly count: number;\n}\n\n/** The opening point (when `openedAt` is known), then the bids in time order. */\nexport function tickerModel(bids: readonly Bid[], opening: number, openedAt?: string | Date): TickerModel {\n const sorted = [...bids].sort((a, b) => new Date(a.at).getTime() - new Date(b.at).getTime());\n const points = [...(openedAt ? [{ at: openedAt, amount: opening }] : []), ...sorted];\n const current = sorted.length > 0 ? sorted[sorted.length - 1].amount : opening;\n return { points, current, change: current - opening, ratio: opening > 0 ? current / opening - 1 : null, count: sorted.length };\n}\n","// PieChart, DonutChart, Gauge and Sparkline for React Native: the web's props, the same geometry (src/core).\nimport { useMemo, useState } from \"react\";\nimport Svg, { Circle, Line, Path, Text as SvgText } from \"react-native-svg\";\n\nimport { read } from \"../core/data\";\nimport { describeParts, describeSeries } from \"../core/describe\";\nimport { categoryFormatter, shareFormatter, valueFormatter } from \"../core/format\";\nimport { arcPath, areaPath, barPath, linePath, type Point, polar, segments, strokeArcPath } from \"../core/shape\";\nimport type { Accessor, Datum, SeriesColor, Threshold, Tone, ValueFormat } from \"../core/types\";\nimport { NativeFrame, type NativeFrameProps, NativeLegend, useNativeSettings } from \"./frame\";\n\nexport interface NativePieChartProps<T extends Datum> extends NativeFrameProps {\n/** One row per part. */\n data: readonly T[];\n /** The field naming the part. */\n label: Accessor<T, string>;\n /** The field of its amount. */\n value: Accessor<T, number>;\n/** How the amounts are written. */\n format?: ValueFormat;\n /** A ring with the total in its hole. */\n donut?: boolean;\n /** The words under the total of a donut. */\n centerLabel?: string;\n /** At most this many slices; the rest fold into `otherLabel`. Default 6. */\n maxSlices?: number;\n/** The name of the folded slice. Default “Other”. */\n otherLabel?: string;\n}\n\n/** Part of a whole (React Native). */\nexport function PieChart<T extends Datum>(props: NativePieChartProps<T>) {\n const { data, label, value, format, donut, centerLabel, maxSlices = 6, otherLabel = \"Other\" } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, theme, color } = resolved;\n const fmt = useMemo(() => ({ value: valueFormatter(format, locale, labels.noValue), share: shareFormatter(locale) }), [format, locale, labels.noValue]);\n const slices = useMemo(() => {\n const rows = data.map((d, i) => ({ label: read(label, d, i), value: Math.max(0, Number(read(value, d, i)) || 0) })).sort((a, b) => b.value - a.value);\n const kept = rows.length > maxSlices ? rows.slice(0, maxSlices - 1) : rows;\n const out = kept.map((r, i) => ({ ...r, color: color(undefined, i + 1) }));\n if (rows.length > maxSlices) out.push({ label: otherLabel, value: rows.slice(maxSlices - 1).reduce((s, r) => s + r.value, 0), color: theme.textMuted });\n return out;\n }, [data, label, value, maxSlices, otherLabel, color, theme.textMuted]);\n const total = slices.reduce((s, x) => s + x.value, 0);\n const [active, setActive] = useState<number | null>(null);\n const isEmpty = total <= 0;\n const summary = isEmpty ? labels.empty : describeParts(donut ? \"donut\" : \"pie\", slices, { labels, value: fmt.value, share: fmt.share });\n return (\n <NativeFrame\n frame={props}\n defaultHeight={200}\n resolved={resolved}\n summary={summary}\n isEmpty={isEmpty}\n points={slices.map((s) => `${s.label}: ${fmt.value(s.value)} (${fmt.share(total ? s.value / total : 0)})`)}\n active={active}\n onActive={setActive}\n legend={<NativeLegend theme={theme} items={slices.map((s) => ({ label: `${s.label} · ${fmt.share(total ? s.value / total : 0)}`, color: s.color }))} />}\n >\n {(width, height) => {\n const radius = Math.max(10, Math.min(width, height) / 2 - 6);\n const inner = donut ? radius * 0.64 : 0;\n let angle = 0;\n return (\n <Svg width={width} height={height}>\n {slices.map((s, i) => {\n const start = angle;\n angle += total ? (s.value / total) * Math.PI * 2 : 0;\n return <Path key={s.label} d={arcPath(width / 2, height / 2, inner, radius, start, angle)} fill={s.color} stroke={theme.surface1} strokeWidth={slices.length > 1 ? 2 : 0} opacity={active !== null && active !== i ? 0.4 : 1} />;\n })}\n {donut && (\n <SvgText x={width / 2} y={height / 2 + (centerLabel ? 0 : 7)} fontSize={Math.max(14, Math.min(24, inner / 3))} fontWeight=\"600\" fill={theme.textPrimary} textAnchor=\"middle\">\n {fmt.value(total)}\n </SvgText>\n )}\n {donut && centerLabel ? (\n <SvgText x={width / 2} y={height / 2 + 18} fontSize={11} fill={theme.textSecondary} textAnchor=\"middle\">\n {centerLabel}\n </SvgText>\n ) : null}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n\n/** A pie with a hole (React Native). */\nexport function DonutChart<T extends Datum>(props: Omit<NativePieChartProps<T>, \"donut\">) {\n return <PieChart {...props} donut />;\n}\n\nexport interface NativeGaugeProps extends NativeFrameProps {\n/** The value. */\n value: number;\n/** The start of the range. Default 0. */\n min?: number;\n/** The end of the range. Default 100. */\n max?: number;\n/** How the value is written. */\n format?: ValueFormat;\n /** The words under the value. */\n caption?: string;\n /** A tick on the arc: the objective. */\n target?: Threshold;\n /** Zones: the value takes the tone of the zone it is in. */\n zones?: readonly { readonly to: number; readonly tone: Tone; readonly label?: string }[];\n/** The tone of the value without zones. Default `\"accent\"`. */\n tone?: Tone;\n}\n\nconst START = (-120 * Math.PI) / 180;\nconst END = (120 * Math.PI) / 180;\n\n/** One figure against its range (React Native). */\nexport function Gauge(props: NativeGaugeProps) {\n const { value, min = 0, max = 100, format, caption, target, zones = [], tone = \"accent\" } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, theme, color } = resolved;\n const fmt = valueFormatter(format, locale, labels.noValue);\n const clamped = Math.min(max, Math.max(min, value));\n const zone = zones.find((z) => clamped <= z.to) ?? zones[zones.length - 1];\n const at = (v: number) => START + ((Math.min(max, Math.max(min, v)) - min) / (max - min || 1)) * (END - START);\n const text = fmt(value);\n return (\n <NativeFrame\n frame={props}\n defaultHeight={170}\n resolved={resolved}\n summary={`${labels.kinds.gauge}: ${text} / ${fmt(max)}${zone?.label ? `, ${zone.label}` : \"\"}.`}\n isEmpty={false}\n points={[]}\n active={null}\n onActive={() => {}}\n >\n {(width, height) => {\n const radius = Math.max(20, Math.min(width / 2 - 12, (height - 16) / 1.58));\n const cx = width / 2;\n const cy = 8 + radius;\n const stroke = Math.max(8, radius * 0.16);\n const [tx0, ty0] = target ? polar(cx, cy, radius - stroke, at(target.value)) : [0, 0];\n const [tx1, ty1] = target ? polar(cx, cy, radius + stroke, at(target.value)) : [0, 0];\n return (\n <Svg width={width} height={height}>\n <Path d={strokeArcPath(cx, cy, radius, START, END)} stroke={theme.surface3} strokeWidth={stroke} strokeLinecap=\"round\" fill=\"none\" />\n {clamped > min && <Path d={strokeArcPath(cx, cy, radius, START, at(clamped))} stroke={color(zone?.tone ?? tone, 1)} strokeWidth={stroke} strokeLinecap=\"round\" fill=\"none\" />}\n {target && <Line x1={tx0} y1={ty0} x2={tx1} y2={ty1} stroke={theme.textPrimary} strokeWidth={2} strokeLinecap=\"round\" />}\n <SvgText x={cx} y={cy + 8} fontSize={Math.max(12, Math.min(30, radius / 2.6, (radius * 1.45) / (text.length * 0.58)))} fontWeight=\"600\" fill={theme.textPrimary} textAnchor=\"middle\">\n {text}\n </SvgText>\n {caption ? (\n <SvgText x={cx} y={cy + Math.max(26, radius / 2.4)} fontSize={11} fill={theme.textSecondary} textAnchor=\"middle\">\n {caption}\n </SvgText>\n ) : null}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n\nexport interface NativeSparklineProps extends Omit<NativeFrameProps, \"hideTitle\"> {\n /** The values, oldest first (`null` for a gap). */\n data: readonly (number | null)[];\n/** The labels of the values (dates), for the summary. */\n categories?: readonly unknown[];\n/** `line` (default), `area` or `bar`. */\n variant?: \"line\" | \"area\" | \"bar\";\n/** A palette slot, a tone or a colour. */\n color?: SeriesColor;\n /** Colour by the trend (success up, danger down; `\"inverse\"` for costs). */\n trendTone?: boolean | \"inverse\";\n/** How the values are written in the summary. */\n format?: ValueFormat;\n /** A fixed width. Default: the container's. */\n width?: number;\n}\n\n/** A word-sized trend (React Native). */\nexport function Sparkline(props: NativeSparklineProps) {\n const { data, categories, variant = \"line\", color: own, trendTone, format, width: fixed, height = 32 } = props;\n const resolved = useNativeSettings(props);\n const { locale, labels, color } = resolved;\n const fmt = useMemo(() => ({ value: valueFormatter(format, locale, labels.noValue), category: categoryFormatter(undefined, locale), share: shareFormatter(locale) }), [format, locale, labels.noValue]);\n const values = data.filter((v): v is number => v != null);\n const table = { categories: categories ?? data.map((_, i) => i + 1), series: [{ id: \"v\", label: props.title, values: data, slot: 1 }] };\n const isEmpty = values.length === 0;\n const up = (values[values.length - 1] ?? 0) >= (values[0] ?? 0);\n const stroke = color(own ?? (trendTone ? ((trendTone === \"inverse\" ? !up : up) ? \"success\" : \"danger\") : undefined), 1);\n return (\n <NativeFrame\n frame={{ ...props, hideTitle: true, height, style: { ...(fixed ? { width: fixed } : {}), ...props.style } }}\n defaultHeight={32}\n resolved={resolved}\n summary={isEmpty ? labels.empty : describeSeries(table, { kind: \"sparkline\", labels, value: fmt.value, category: fmt.category, share: fmt.share })}\n isEmpty={isEmpty}\n points={[]}\n active={null}\n onActive={() => {}}\n >\n {(width, h) => {\n const lo = variant === \"bar\" ? Math.min(0, ...values) : Math.min(...values);\n const hi = variant === \"bar\" ? Math.max(0, ...values) : Math.max(...values);\n const yOf = (v: number) => 3 + (1 - (v - lo) / (hi - lo || 1)) * (h - 6);\n const n = data.length;\n const xOf = (i: number) => (variant === \"bar\" ? (i + 0.5) * (width / n) : n > 1 ? 3 + (i / (n - 1)) * (width - 6) : width / 2);\n const pts = data.map((v, i) => (v == null ? null : ([xOf(i), yOf(v)] as Point)));\n const last = [...pts].reverse().find(Boolean);\n return (\n <Svg width={width} height={h}>\n {variant === \"bar\"\n ? data.map((v, i) => (v == null || v === 0 ? null : <Path key={i} d={barPath(xOf(i) - Math.min(4, width / n / 3), Math.min(yOf(v), yOf(0)), Math.min(8, (width / n) * 0.7), Math.abs(yOf(v) - yOf(0)), 1.5)} fill={stroke} />))\n : segments(pts).map((seg) => [\n variant === \"area\" ? <Path key={`a${seg[0]![0]}`} d={areaPath(seg, h)} fill={stroke} opacity={0.14} /> : null,\n <Path key={`l${seg[0]![0]}`} d={linePath(seg)} stroke={stroke} strokeWidth={1.75} fill=\"none\" strokeLinecap=\"round\" />,\n ])}\n {variant !== \"bar\" && last ? <Circle cx={last[0]} cy={last[1]} r={2.75} fill={stroke} /> : null}\n </Svg>\n );\n }}\n </NativeFrame>\n );\n}\n"],"mappings":";AAgGO,IAAM,iBAA8B;AAAA,EACzC,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,c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,GAAE;AAAA,QACF,QAAQ,MAAM;AAAA,QACd,SAAS;AAAA,QACT;AAAA,QACA,OAAM;AAAA,QACN,YAAY,WAAW,QAAQ,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,SAAS,OAAO,MAAM,SAAS,MAAM,UAAU,CAAC,IAAI;AAAA;AAAA,IACzH;AAAA,KACF;AAEJ;AAGA,IAAMG,UAASK,YAAW,OAAO;AAAA,EAC/B,MAAM,EAAE,KAAK,EAAE;AAAA,EACf,MAAM,EAAE,KAAK,EAAE;AAAA,EACf,OAAO,EAAE,UAAU,IAAI,YAAY,OAAO,YAAY,GAAG;AAAA,EACzD,KAAK,EAAE,eAAe,OAAO,UAAU,QAAQ,YAAY,YAAY,WAAW,EAAE;AAAA,EACpF,OAAO,EAAE,UAAU,IAAI,YAAY,IAAI,YAAY,OAAO,aAAa,CAAC,cAAc,EAAE;AAAA,EACxF,OAAO,EAAE,eAAe,OAAO,YAAY,UAAU,KAAK,EAAE;AAAA,EAC5D,OAAO,EAAE,UAAU,IAAI,YAAY,IAAI,aAAa,CAAC,cAAc,EAAE;AAAA,EACrE,QAAQ,EAAE,YAAY,MAAM;AAAA,EAC5B,OAAO,EAAE,QAAQ,IAAI,cAAc,KAAK,UAAU,SAAS;AAAA,EAC3D,WAAW,EAAE,QAAQ,QAAQ,cAAc,IAAI;AAAA,EAC/C,KAAK,EAAE,eAAe,OAAO,UAAU,QAAQ,gBAAgB,iBAAiB,WAAW,GAAG;AAChG,CAAC;","names":["useMemo","useState","total","total","options","d","jsx","jsxs","useMemo","useState","StyleSheet","Text","View","Svg","Path","currencyDigits","getNumberFormat","useMemo","useState","Svg","Circle","Line","Path","SvgText","jsx","jsxs","useMemo","r","total","useState","Svg","Path","SvgText","Line","Circle","jsx","jsxs","View","styles","Text","Svg","Path","fill","StyleSheet"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krizaka/charts",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Krizaka's data visualisation: typed, declarative React charts (line, area, bar, pie, radar, heatmap, calendar, sankey, funnel, gauge, sparkline, candlestick, treemap, scatter, geo map, 3D globe) on the --kz-* tokens and the brand palettes — an accessible data table, a written summary and keyboard navigation in every chart, SSR without layout shift, and React Native for the simple types.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"krizaka",
|
|
@@ -158,14 +158,14 @@
|
|
|
158
158
|
"d3-geo": "^3.1.1",
|
|
159
159
|
"echarts": "^6.1.0",
|
|
160
160
|
"topojson-client": "^3.1.0",
|
|
161
|
-
"@krizaka/intl": "^0.
|
|
161
|
+
"@krizaka/intl": "^0.4.0"
|
|
162
162
|
},
|
|
163
163
|
"peerDependencies": {
|
|
164
164
|
"react": ">=19",
|
|
165
165
|
"react-dom": ">=19",
|
|
166
166
|
"react-native": ">=0.76",
|
|
167
167
|
"react-native-svg": ">=15",
|
|
168
|
-
"@krizaka/ui": "^3.
|
|
168
|
+
"@krizaka/ui": "^3.55.0"
|
|
169
169
|
},
|
|
170
170
|
"peerDependenciesMeta": {
|
|
171
171
|
"react-dom": {
|
|
@@ -217,9 +217,9 @@
|
|
|
217
217
|
"typescript": "^5.9.0",
|
|
218
218
|
"vitest": "^4.1.11",
|
|
219
219
|
"world-atlas": "^2.0.2",
|
|
220
|
-
"@krizaka/
|
|
221
|
-
"@krizaka/config": "0.
|
|
222
|
-
"@krizaka/
|
|
220
|
+
"@krizaka/ui": "3.55.0",
|
|
221
|
+
"@krizaka/config": "0.8.0",
|
|
222
|
+
"@krizaka/tokens": "3.55.0"
|
|
223
223
|
},
|
|
224
224
|
"engines": {
|
|
225
225
|
"node": ">=22"
|