basalt-ui 2.10.0 → 2.11.1

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/MIGRATING.md +36 -13
  3. package/agent/rules/basalt-charts.md +2 -2
  4. package/agent/skills/basalt-charts/SKILL.md +16 -17
  5. package/dist/charts/BandStrip.d.ts +3 -2
  6. package/dist/charts/BandStrip.d.ts.map +1 -1
  7. package/dist/charts/CartesianChart.d.ts +3 -0
  8. package/dist/charts/CartesianChart.d.ts.map +1 -1
  9. package/dist/charts/CartesianChart.js +9 -3
  10. package/dist/charts/DualPanel.d.ts.map +1 -1
  11. package/dist/charts/DualPanel.js +21 -15
  12. package/dist/charts/Heatmap.d.ts +33 -3
  13. package/dist/charts/Heatmap.d.ts.map +1 -1
  14. package/dist/charts/Heatmap.js +111 -68
  15. package/dist/charts/Lines.d.ts.map +1 -1
  16. package/dist/charts/Lines.js +7 -45
  17. package/dist/charts/MirroredBars.js +2 -2
  18. package/dist/charts/Sparkline.d.ts +12 -0
  19. package/dist/charts/Sparkline.d.ts.map +1 -1
  20. package/dist/charts/Sparkline.js +68 -5
  21. package/dist/charts/band-fold.d.ts +7 -0
  22. package/dist/charts/band-fold.d.ts.map +1 -1
  23. package/dist/charts/compile.d.ts +4 -1
  24. package/dist/charts/compile.d.ts.map +1 -1
  25. package/dist/charts/compile.js +43 -19
  26. package/dist/charts/heatmap-fill.d.ts +15 -0
  27. package/dist/charts/heatmap-fill.d.ts.map +1 -0
  28. package/dist/charts/heatmap-fill.js +13 -0
  29. package/dist/charts/host.d.ts +5 -1
  30. package/dist/charts/host.d.ts.map +1 -1
  31. package/dist/charts/host.js +37 -1
  32. package/dist/charts/index.d.ts +1 -1
  33. package/dist/charts/index.d.ts.map +1 -1
  34. package/dist/charts/labels.d.ts +34 -0
  35. package/dist/charts/labels.d.ts.map +1 -0
  36. package/dist/charts/labels.js +63 -0
  37. package/dist/charts/marks.d.ts +8 -1
  38. package/dist/charts/marks.d.ts.map +1 -1
  39. package/dist/charts/marks.js +50 -13
  40. package/dist/charts/panel.d.ts +7 -1
  41. package/dist/charts/panel.d.ts.map +1 -1
  42. package/dist/charts/panel.js +9 -4
  43. package/dist/charts/plot-context.d.ts +42 -0
  44. package/dist/charts/plot-context.d.ts.map +1 -0
  45. package/dist/charts/plot-context.js +64 -0
  46. package/dist/charts/scales.d.ts +6 -1
  47. package/dist/charts/scales.d.ts.map +1 -1
  48. package/dist/charts/scales.js +28 -8
  49. package/dist/charts/ticks.d.ts +12 -0
  50. package/dist/charts/ticks.d.ts.map +1 -0
  51. package/dist/charts/ticks.js +42 -0
  52. package/dist/charts/types.d.ts +39 -5
  53. package/dist/charts/types.d.ts.map +1 -1
  54. package/dist/tokens/core.d.ts +6 -0
  55. package/dist/tokens/core.d.ts.map +1 -1
  56. package/dist/tokens/core.js +5 -3
  57. package/llms.txt +12 -4
  58. package/package.json +1 -1
  59. package/src/charts/BandStrip.tsx +2 -5
  60. package/src/charts/CartesianChart.tsx +13 -2
  61. package/src/charts/DualPanel.tsx +22 -16
  62. package/src/charts/Heatmap.tsx +181 -76
  63. package/src/charts/Lines.tsx +11 -57
  64. package/src/charts/MirroredBars.tsx +2 -2
  65. package/src/charts/Sparkline.tsx +106 -5
  66. package/src/charts/band-fold.ts +11 -0
  67. package/src/charts/compile.ts +60 -20
  68. package/src/charts/heatmap-fill.ts +19 -0
  69. package/src/charts/host.tsx +59 -0
  70. package/src/charts/index.ts +1 -1
  71. package/src/charts/labels.ts +118 -0
  72. package/src/charts/marks.ts +72 -14
  73. package/src/charts/panel.tsx +18 -5
  74. package/src/charts/plot-context.ts +109 -0
  75. package/src/charts/scales.ts +41 -11
  76. package/src/charts/ticks.ts +61 -0
  77. package/src/charts/types.ts +39 -5
  78. package/src/tokens/core.ts +10 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ ## [2.11.1](https://github.com/jkrumm/basalt-ui/compare/v2.11.0...v2.11.1) (2026-10-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * end labels read the plot's own x model and plot height ([81780be](https://github.com/jkrumm/basalt-ui/commit/81780be14d37875c445f6f432439b8bb93302f03))
7
+ * end-label room, bucket ticks and lone dots per review ([6011eb6](https://github.com/jkrumm/basalt-ui/commit/6011eb65f304e0de6e6893c5a68a30af69e513ca))
8
+ * lone points, end labels and axis ticks render cleanly ([95f898f](https://github.com/jkrumm/basalt-ui/commit/95f898f16927e209daa11ee2e587267103031b27))
9
+ * mirrored bars reach both plot edges ([d8d6d4a](https://github.com/jkrumm/basalt-ui/commit/d8d6d4a8ddd3a3689b50b8f2213fee9683cf56a4))
10
+
11
+ # [2.11.0](https://github.com/jkrumm/basalt-ui/compare/v2.10.0...v2.11.0) (2026-10-15)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * keep stated heatmap cells out of the domain and the state legend stable ([4f95cc7](https://github.com/jkrumm/basalt-ui/commit/4f95cc74ed7695b256c82644708fc9cc32173778))
17
+ * never close a sparkline gap when pooling, and harden the x domain ([c92e37b](https://github.com/jkrumm/basalt-ui/commit/c92e37b0b1372e8d7e8f615e84e54664fb8f82a9))
18
+
19
+
20
+ ### Features
21
+
22
+ * align charts on a shared x domain ([b0e037a](https://github.com/jkrumm/basalt-ui/commit/b0e037a10b8d8c79dbb9f9fa86fe90c683e50daf))
23
+ * give chart marks the plot area, the rows and per-datum cursor dots ([fb2b68b](https://github.com/jkrumm/basalt-ui/commit/fb2b68b2b68820f763546a2cb2f032f433079213))
24
+ * report the measured plot area from one builder for every chart kind ([ca26afe](https://github.com/jkrumm/basalt-ui/commit/ca26afea1837ed650e790388793f08e0ffc544d3))
25
+
1
26
  # [2.10.0](https://github.com/jkrumm/basalt-ui/compare/v2.9.1...v2.10.0) (2026-10-15)
2
27
 
3
28
 
package/MIGRATING.md CHANGED
@@ -66,18 +66,18 @@ There is one row per SURFACE, not per export, and a surface earns a row once any
66
66
  shipped lefthook preset both changed in 1.30.0 with no row that owned them — which is how a
67
67
  consumer read this index, found nothing, and diffed a KPI row that had silently gone 4-up → 2-up.
68
68
 
69
- | Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | Unreleased |
70
- | ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
71
- | **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — |
72
- | **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — |
73
- | **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — |
74
- | **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
75
- | **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — |
76
- | **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
77
- | **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — |
78
- | **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
79
- | **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — |
80
- | **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — |
69
+ | Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | Unreleased |
70
+ | ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
71
+ | **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
72
+ | **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — |
73
+ | **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — |
74
+ | **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
75
+ | **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
76
+ | **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
77
+ | **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
78
+ | **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
79
+ | **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — |
80
+ | **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — |
81
81
 
82
82
  ---
83
83
 
@@ -1046,13 +1046,36 @@ The `basalt-ui/router-tanstack` subpath is **removed** in 2.x, not moved: an imp
1046
1046
  _Nothing yet. Author the next section under this heading as `## Unreleased — <title>`; the
1047
1047
  release renames it and opens a new one here._
1048
1048
 
1049
+ ## 2.11.1 — lone points, end labels and axis ticks render cleanly
1050
+
1051
+ - **`Lines` draws a lone point.** A series with one finite value (a one-point window, or a value between nulls) drew nothing: a path of one point has no length. It now draws a dot in the series colour, at every isolated finite row (`gaps: 'connect'` bridges the nulls, so only a series with a single finite row is lone there). A point the series' own `getMarker` marks is not doubled. Delete any `getMarker` you added to make a single run visible. **Opt-out: none.**
1052
+ - **`Lines` end labels never clip.** At the `wide` class a label whose room between its last point and the plot's right edge is too small (a last point on the edge cut "Download" to "Downloa") now ends at the point and sits above it. The room is read through the plot's own x mapping (`xDomain`, else the extent of every datum) against an estimated label width (0.85 em per glyph: it errs towards flipping, so a label of the widest capitals can still run long); a string x has no continuous position and keeps the default. Before the engine has measured the plot (the server HTML, the first client frame) the room is taken from the frame, which is wider by the axis gutters, so a label can start on its first frame and flip on the measured one. A label with room is unchanged. **Opt-out: none.**
1053
+ - **Every band Date axis now gets bucket-snapped ticks by default.** `BandStrip`, `MirroredBars`, `Bars` and any other band x of Dates labelled every bucket and let the engine thin the collisions, which left an uneven subset that nearly touched ("18:13 18:17 18:21"). Ticks are now the time scale's own round instants, each snapped to the bucket it falls in (so a label may read 18:13, the bucket nearest 18:15); `xTicks` as a number sets the count. A string band x is unchanged. **Opt-out: pass `xTicks` as an array of the bucket dates to label.**
1054
+ - **The first x tick label no longer sits on the y label.** A tick within 5% of the x domain's start (the first tick of a series whose domain starts on a round instant, or a round tick just inside one that does not) is start-anchored, so at the compact class (gutter y labels) its label stops under the lowest y label instead of centring on the plot's left edge. Later ticks stay centred. **Opt-out: none.**
1055
+ - **`MirroredBars` bars reach both plot edges.** The panes used the padded band scale `Bars` uses (0.1 of a step of outer padding), so the last bar ended a tenth of a step short of the right edge and the first started that far in — 1.2 px at 30 daily buckets on a 390 px phone (0.8 px at 168 hourly buckets on 1440). Bars now sit flush: the first bar's left and the last bar's right edge are the plot's. The gap between bars is unchanged. `BandStrip` already filled the plot (probed at both widths). **Opt-out: none.**
1056
+ - **Docs: only the CURSOR dot reads `getMarker` on consumer `marks`.** The 2.11.0 line "a `CartesianChart` with consumer `marks` can colour the dot" means the cursor dot of a `cursorValue` series, and only its `color`. Always-on per-point markers are `Lines`-only: on consumer `marks`, `getMarker` without `cursorValue` is ignored, so draw a persistent dot in `marks` yourself. The `getMarker` JSDoc and the `basalt-charts` skill say so now.
1057
+
1058
+ ## 2.11.0 — Heatmap cells carry a state, a shared x domain, a self-pooling sparkline, visible reference lines
1059
+
1060
+ - **`Heatmap`: a position with no datum is inert.** Hovering before the window or after `now` used to snap to the neighbouring row's cell (a tooltip titled with another day's hour); it now opens no tooltip. Positions that hold a datum are unchanged. **Opt-out: none.**
1061
+ - **`Heatmap` per-cell state: `getState` + `states`.** A cell whose `getState(d)` names a `states` entry (the `BandStrip` state fields: `key`, `label`, `color`, `fillOpacity`, `note`, `legend`) draws that flat fill instead of the ramp — so "failed" and "not measured" stop being one `null` fill. A stated cell is not a measurement, so it does not stretch the default `[0, max]` domain (pass `domain` to pin it). States are legended after the gradient (`legend={false}` hides both; the legend is concealed, not removed, under a `state` so nothing shifts on arrival), and only when `getState` is set, the tooltip's value row reads the state's label, and a key naming no state throws in dev (the valid set) and paints the plain ramp in production. Unused, the grid is unchanged. **Opt-out: omit both props.**
1062
+ - **`Heatmap`: `formatLegend` and `tooltip.valueLabel`.** The gradient legend labels its two ends (not every step) and shared `formatValue` with the tooltip; `formatLegend` now formats the ends alone (default `formatValue`, so nothing moves until you pass one — only you know the compact form of a unit-bearing format). `tooltip={{ valueLabel }}` renames the fixed "Value" row. **Opt-out: omit both.**
1063
+ - **`Heatmap` ramp floor 14% → 28%, absent fill 12% → 8%.** The lowest ramp step sat ΔE ≈ 4 from the flat absent fill on a tuned accent, so a near-baseline hour read as unmeasured; every step is now ≥ 10 ΔE*ab from absent in both schemes (`heatmap-fill.test.ts`, across line/accent/status inks). The ramp spans a narrower opacity range, so low values read darker than before. **Opt-out: none.**
1064
+ - **`CartesianChart` (and `Lines`, `StackedArea`) take `xDomain: [min, max]`** in `x`'s type (`Date` or number). A time or linear x scale spans the data's own extent by default, so charts of different extents put one instant on different pixel columns under a shared cursor (a run series beside window-spanning buckets: 974 / 1005 / 1042 px at 24 h). Give each the same `xDomain` and they agree to the pixel (layout-probed, ±1 px, crosshair included); rows outside it are clipped by the engine, and `xZones`/`xTicks` read the explicit domain too. A string or band x (`Bars`, `MirroredBars`, `BandStrip`) is categorical and ignores it; a domain that is reversed, flat or not finite falls back to the data extent and warns in dev. **Opt-out: omit the prop.**
1065
+ - **`Sparkline` pools itself to its measured width**: a line keeps each bucket's min and max (peaks and dips survive) at no more than one point per px, a bar series one bar per 2 px (the value furthest from zero), and the last row always stays so `emphasizeLast` lands on it. A gap (a `null`) is never closed: the finite rows beside it are kept, so it stays at its original indices. A series within its cap draws exactly as before. Only an unmeasured width (`<= 0`) pools nothing: the server HTML and the first client frame both draw at the 640 px initial width (a 3,000-row series is pooled to it, so they match; hydration-tested) and the chart redraws at the measured width. **Delete any consumer pooling you wrote to fit a cell; no new prop.**
1066
+ - **Reference lines are stronger on the light scheme**: `--vx-good-ref`/`bad-ref`/`warn-ref` are now the status solid at 60% (were 30/30/20%), which lifts the light-scheme `warn` line from 1.25:1 to 2.07:1 against the page and keeps every status at or above 2:1 at the shipped defaults (1.7:1 at the derive-knob extremes; `ref-line-contrast.test.ts`). Dark lines get stronger too. **Opt-out: pass your own `color` (e.g. `alpha(VX.status.warn, 0.3)`) on the `RefLine`.**
1067
+
1049
1068
  ## 2.10.0 — preset filters honour `.labels()`
1050
1069
 
1051
1070
  - `NumberFilter` with `options`: a value `.labels()` names (`{ 0: 'Any' }`) now reads as that name in the pill though it is not an option, as the stepper form already did; no `Any` row needed. **Opt-out: none — drop the literal row if you added one.**
1052
1071
  - **A `state` chart hides its legend (every kind).** `pending`, `error` and `empty` conceal the legend (`visibility: hidden`, plus `aria-hidden`) instead of listing series over a plot with no marks; its row is kept, so the chart does not shift when the data arrives (layout-probed: `Lines`, `BandStrip`, `MirroredBars`; error and empty on `BandStrip`). **Opt-out: none.**
1053
1072
  - **`MirroredBars` takes `absentState`** (a `series` key, as `BandStrip.absentState`): that entry's colour (and `fillOpacity`) fills the absent share and its legend entry labels it; hiding the entry in the legend widens the measured bars to the full cell. Unset, the share stays `--vx-neutral` with no legend entry. A key naming no entry throws in dev and falls back to unset in production.
1054
1073
  - **`BandStrip` legend swatches mirror a state's `fillOpacity`** (a state at 0.14 no longer draws a solid swatch over a pale plot).
1055
- - **`height` is the frame in every kind** (documented, nothing changes): a `BandStrip` or `MirroredBars` frame is the plot plus the x axis, so a band of a given height is `height` less the axis (about 21 px at the default font and density: a 44 px band is `height: 65`). No `plotHeight` prop.
1074
+ - **`height` is the frame in every kind** (documented, nothing changes): a `BandStrip` or `MirroredBars` frame is the plot plus the x axis, so a band of a given height is `height` less the axis (about 21 px at the default font and density: a 44 px band is `height: 65`). There is no `plotHeight` prop; `marks` reads the plot area from `plot.plotWidth`/`plot.plotHeight` instead (below).
1075
+ - **`PlotContext` gains `plotWidth`, `plotHeight` and `data`** (new fields, no new export; `width`/`height` stay the frame). `plotWidth`/`plotHeight` are the plot area in px, so a mark pinned in px is exact: a 3 px rail along the top is `y1: yMax - 3 * (yMax - yMin) / plot.plotHeight`, drawn from `yMax` (layout-probed at 3 px, three sizes). The engine lays the plot out after `marks` runs, so the first pass (server HTML, first client frame) reports the frame and the chart re-renders once with the measured area; a chart whose `marks` never read them pays nothing. `plot.data` is every row of `data` whatever the legend hides, for bucket-level marks (an absent column, a rail: the slot grid must not vanish with its last visible series); series marks still draw `plot.rows(key)` and gate on `plot.visible`. **Opt-out: none needed.** A composed kind (`DualPanel`, `MirroredBars`) reports each pane's own plot the same way.
1076
+ - **A `cursorValue` series' cursor dot honours `getMarker(d).color`** (the prop `Lines` already has): a `CartesianChart` with consumer `marks` can colour the dot per datum, e.g. the loss colour of the hovered bucket. Each distinct colour is one extra mark, so keep colours a small categorical set. A series whose `getMarker` you already set alongside `cursorValue` now gets those colours on its cursor dot; unset, nothing changes. No opt-out needed for the fleet.
1077
+ - **`fillOpacity` stays one number per `rect`/`dot` mark** (`@tanstack/charts` 1.1.0 types it `number`, not a channel): an opacity that carries a measurement is bucketed into N marks (round to a step, one mark per bucket). `basalt-charts` shows the pattern; no basalt option.
1078
+ - **`tooltip.follow` is gone because 2.x anchors every tooltip to the cursor column** (`anchor: 'group-center'`), not because an option is missing: there is no pointer-following mode left to opt out of.
1056
1079
 
1057
1080
  ## 2.9.1
1058
1081
 
@@ -21,11 +21,11 @@ Every cartesian chart is `CartesianChart` or a kind built on it; props are in th
21
21
  - `ariaLabel` is required on every chart. [type CartesianChartProps]
22
22
  - `marks(plot)` returns engine marks and nothing else; margins, scales, axes, grid, cursor, legend and tooltip are the host's. [type ChartMarks]
23
23
  - Supply `series` once; legend entries and tooltip rows derive from it. [type ChartSeries]
24
- - Draw `plot.rows(key)` and `plot.visible`, never the `series` prop, so a legend toggle hides the mark. [type PlotContext]
24
+ - Draw `plot.rows(key)` and `plot.visible`, never the `series` prop, so a legend toggle hides the mark; `plot.data` is for bucket-level marks only, and a px size reads `plot.plotHeight`, never the frame `plot.height`. [type PlotContext]
25
25
  - A second axis is `y2` with a series `axis: 'right'`; there is no margin prop. [type CartesianChartProps]
26
26
  - Size is `height` (a number or per container class); the host measures the width. [type ResponsiveChartHeight]
27
27
  - A pending, failed or empty query is `state={{ pending, error, empty }}`, never `data ?? []`; a streamed chart's `<Suspense>` fallback is the same chart with `state={{ pending: true }}`, which fills the final box; inside a `ChartCard` the card owns `state` (header kept, body swapped), the kind only when bare. [type ChartState] [type ChartCardProps]
28
- - Zones, thresholds and reference lines are `zones`, `xZones` and `refLines` data. [type ZoneSpec]
28
+ - Zones, thresholds and reference lines are `zones`, `xZones` and `refLines` data; charts sharing a cursor over different extents pass one `xDomain` (time/number x only; a band or string x ignores it). [type ZoneSpec]
29
29
  - Extra tooltip rows are `tooltip.rows` data, never markup. [type ChartTooltipConfig]
30
30
  - Charts share one cursor by default; `cursorGroup` isolates one, `chartCursor(group?)` reads it. [type chartCursor]
31
31
 
@@ -9,32 +9,31 @@ Procedure only; the contract is `.claude/rules/basalt-charts.md`.
9
9
  ## Steps
10
10
 
11
11
  1. Pick the path: a shipped kind fits (`Lines`, `Bars`, `Sparkline`, `StackedArea`, `DualPanel`, `MirroredBars`, `BandStrip`, `Donut`, `Heatmap`) → use it. A second chart of a shape with no kind → extract a kind and migrate both call sites. Otherwise compose `CartesianChart` in the page's own chart file.
12
- 2. Register each new series color in the app's one series file (exempt from `check-theme`):
13
-
14
- ```ts
15
- import { defineSeries, groupTokens } from 'basalt-ui/tokens'
16
-
17
- const HEALTH = defineSeries({ hrv: { light: '…', dark: '…' } }) // lighter on dark, deeper on light
18
- export const SERIES = groupTokens('health', HEALTH)
19
- ```
20
-
21
- 3. Pass the group as `<BasaltProvider paletteOptions={{ groups: [SERIES] }} />` (or `buildPaletteCss` for SSR) so its vars are declared.
22
- 4. Compose the chart; import marks from the allowed `@tanstack/charts/*` subpaths:
12
+ 2. Register each new series color in the app's one series file (exempt from `check-theme`): `groupTokens('health', defineSeries({ hrv: { light, dark } }))` from `basalt-ui/tokens` (lighter on dark, deeper on light), then pass the group as `<BasaltProvider paletteOptions={{ groups: [SERIES] }} />` (or `buildPaletteCss` for SSR).
13
+ 3. Compose the chart; import marks from the allowed `@tanstack/charts/*` subpaths:
23
14
 
24
15
  ```tsx
25
16
  import { lineY } from '@tanstack/charts/line'
17
+ import { rect } from '@tanstack/charts/rect'
26
18
 
19
+ const [RAIL_PX, Y_MIN, Y_MAX] = [3, 0, 100] // px along the top of a [Y_MIN, Y_MAX] plot
20
+ const railTop = (plotHeight: number) => Y_MAX - (RAIL_PX * (Y_MAX - Y_MIN)) / plotHeight
27
21
  ;<CartesianChart
28
22
  ariaLabel="HRV"
29
23
  data={data}
30
24
  x={(d) => d.date}
31
25
  series={[{ key: 'hrv', label: 'HRV', color: SERIES.hrv, getValue: (d) => d.hrv }]}
32
- marks={(plot) =>
33
- plot.visible.map((s) => lineY(plot.rows(s.key), { x: 'x', y: 'y', stroke: s.color }))
34
- }
26
+ marks={(plot) => [
27
+ ...plot.visible.map((s) => lineY(plot.rows(s.key), { x: 'x', y: 'y', stroke: s.color })),
28
+ // `plot.plotHeight` is the plot (`plot.height` the frame); `plot.data` is every raw row; `fillOpacity`
29
+ // is one number per mark, so bucket a measured opacity: one mark per step.
30
+ ...[...Map.groupBy(plot.data, (d) => Math.round(d.loss * 20) / 20)].map(([o, r]) =>
31
+ rect(r, { x1: 'at', y1: railTop(plot.plotHeight), y2: Y_MAX, fillOpacity: o }),
32
+ ),
33
+ ]}
35
34
  />
36
35
  ```
37
36
 
38
- 5. Wrap it in `ChartCard`; pass `state={{ pending, error, empty }}` from the query.
39
- 6. Run the repo's own gate (e.g. `make check`), which runs lint, the theme guard and typecheck; fix every finding at its source.
40
- 7. Check both color schemes and a pending query.
37
+ 4. Wrap it in `ChartCard`; pass `state={{ pending, error, empty }}` from the query. A `cursorValue` series colours its CURSOR dot per datum with `getMarker: (d) => ({ color })`; always-on markers are `Lines`-only, so a consumer-`marks` chart draws its persistent dots itself.
38
+ 5. Run the repo's own gate (e.g. `make check`), which runs lint, the theme guard and typecheck; fix every finding at its source.
39
+ 6. Check both color schemes and a pending query.
@@ -1,7 +1,8 @@
1
1
  import type { ReactElement } from 'react';
2
- import type { CartesianChartProps, ChartSeries, ChartX } from './types.js';
2
+ import type { NamedChartState } from './band-fold.js';
3
+ import type { CartesianChartProps, ChartX } from './types.js';
3
4
  /** A state a strip can draw. A band has no number to plot, so `formatValue` reads the datum. */
4
- export type BandStripSeries<T> = Pick<ChartSeries<T>, 'key' | 'label' | 'color' | 'tooltip' | 'legend' | 'note' | 'fillOpacity'> & {
5
+ export type BandStripSeries<T> = NamedChartState & {
5
6
  /**
6
7
  * The tooltip row's value for a band in this state. `null` is an ABSENT reading and renders an
7
8
  * em dash; omit the function when the state's name is the whole reading ("Not measured").
@@ -1 +1 @@
1
- {"version":3,"file":"BandStrip.d.ts","sourceRoot":"","sources":["../../src/charts/BandStrip.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AASzC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,WAAW,EACX,MAAM,EAGP,MAAM,SAAS,CAAA;AAEhB,gGAAgG;AAChG,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CACnC,WAAW,CAAC,CAAC,CAAC,EACd,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,aAAa,CAC1E,GAAG;IACF;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAAA;CACpD,CAAA;AAED,2DAA2D;AAC3D,MAAM,MAAM,QAAQ,GAAG;IACrB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAA;IACb,oGAAoG;IACpG,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC;;;OAGG;IACH,MAAM,CAAC,EACH;QACE,0CAA0C;QAC1C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC1B,uEAAuE;QACvE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAC3B,GACD,SAAS,CAAA;CACd,CAAA;AAED,yFAAyF;AACzF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;IACxB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,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Q,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAC9B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,SAAS,CAAA;CAC5B,CAAA;AAoMD,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAC/E,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC7B,YAAY,CA+Id"}
@@ -1,5 +1,6 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { CartesianDefinition } from './compile.js';
3
+ import type { PlotSizes } from './plot-context.js';
3
4
  import type { CartesianChartProps, ChartSeries, ChartX } from './types.js';
4
5
  /** Kind-only compile switches, never on the public props. */
5
6
  export type RungOptions = {
@@ -22,6 +23,8 @@ export type ShellContext = {
22
23
  coarse: boolean;
23
24
  /** The measured width; 0 unless the shell was asked to track it (`byWidth`). */
24
25
  width: number;
26
+ /** The plot area of each pane the engine last laid out; `null` until it has. */
27
+ plot: PlotSizes | null;
25
28
  };
26
29
  export type ChartShellProps<T> = Pick<CartesianChartProps<T, ChartX>, 'ariaLabel' | 'legend' | 'height' | 'state' | 'className' | 'style'> & {
27
30
  /** The legend and tooltip source. */
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/charts/CartesianChart.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAiB,YAAY,EAAa,MAAM,OAAO,CAAA;AAGnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAKpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEvE,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GAAG;IACxB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,yDAAyD;IACzD,WAAW,CAAC,EAAE,OAAO,CAAA;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IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,CA+ErE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAC/C,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,WAAW,GAC7C,YAAY,CAwBd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAChD,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,YAAY,CAEd"}
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useId, useMemo, useState } from "react";
3
3
  import { useInChartCard } from "./card-context.js";
4
4
  import { compileCartesian, refLegendSeries } from "./compile.js";
5
+ import { samePlots } from "./plot-context.js";
5
6
  import { ChartEngine, idPrefixOf } from "./host.js";
6
7
  import { ChartLegend, legendEntries } from "./legend.js";
7
8
  import { INITIAL_WIDTH, useChartSize } from "./sizing.js";
@@ -33,9 +34,13 @@ function ChartShell(props) {
33
34
  const [hidden, setHidden] = useState(() => /* @__PURE__ */ new Set());
34
35
  const [highlighted, setHighlighted] = useState(null);
35
36
  const width = byWidth ? measured || INITIAL_WIDTH : 0;
37
+ const [plot, setPlot] = useState(null);
38
+ const onPlot = useCallback((next) => {
39
+ setPlot((prev) => samePlots(prev, next) ? prev : next);
40
+ }, []);
36
41
  const definition = useMemo(
37
- () => compile({ chartId, hidden, highlighted, coarse, width }),
38
- [compile, chartId, hidden, highlighted, coarse, width]
42
+ () => compile({ chartId, hidden, highlighted, coarse, width, plot }),
43
+ [compile, chartId, hidden, highlighted, coarse, width, plot]
39
44
  );
40
45
  const config = legend === false ? null : legend ?? {};
41
46
  const entryCount = legendEntries(series, false)[0]?.length ?? 0;
@@ -83,7 +88,8 @@ function ChartShell(props) {
83
88
  ariaLabel,
84
89
  height,
85
90
  idPrefix: idPrefixOf(chartId),
86
- coarse
91
+ coarse,
92
+ onPlot
87
93
  }
88
94
  ) : /* @__PURE__ */ jsx(ChartPlaceholder, { state, height }),
89
95
  !atTop && legendNode
@@ -1 +1 @@
1
- {"version":3,"file":"DualPanel.d.ts","sourceRoot":"","sources":["../../src/charts/DualPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAUzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAcrF,uBAAuB;AACvB,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,IAAI,CACjC,WAAW,CAAC,CAAC,CAAC,EACZ,KAAK,GACL,OAAO,GACP,OAAO,GACP,UAAU,GACV,aAAa,GACb,SAAS,GACT,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,aAAa,GACb,eAAe,GACf,WAAW,CACd,CAAA;AAED,mEAAmE;AACnE,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;IACjC,iGAAiG;IACjG,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC7B,sDAAsD;IACtD,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IACnD,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,SAA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AAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,EAClE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,YAAY,CA6Od"}
@@ -10,6 +10,7 @@ import { resolveContainerClass } from "../tokens/size-classes.js";
10
10
  import { defaultFormatX, defaultNumberFormat, engineRow, seriesRow, visibleSeries } from "./compile.js";
11
11
  import { barMark, emphasis, lineMark, markersOf, thinFill } from "./marks.js";
12
12
  import { PanelRung, chartHeightOf, paneX, paneY, rowsOf } from "./panel.js";
13
+ import { plotContext } from "./plot-context.js";
13
14
  import { xScaleFor } from "./scales.js";
14
15
  import { rowX } from "./types.js";
15
16
  const BAR_KEY = "__bar";
@@ -107,23 +108,28 @@ function DualPanel(props) {
107
108
  fillRows.push({ x: x(d), from: a, to: b, series: fill.to, datum: d });
108
109
  }
109
110
  }
110
- const topPane = ({ width, height: h }) => {
111
+ const topPane = ({ width, height: h, plot: access }) => {
111
112
  const cls = resolveContainerClass(width);
112
- const plot = {
113
- rows: (key) => {
114
- const s = lines.find((l) => l.key === key);
115
- if (!s) throw new Error(`[basalt] DualPanel: no series "${key}"`);
116
- return rows(s);
113
+ const plot = plotContext(
114
+ {
115
+ rows: (key) => {
116
+ const s = lines.find((l) => l.key === key);
117
+ if (!s) throw new Error(`[basalt] DualPanel: no series "${key}"`);
118
+ return rows(s);
119
+ },
120
+ visible,
121
+ highlighted,
122
+ containerClass: cls,
123
+ width,
124
+ height: h,
125
+ data,
126
+ xFraction: model.fraction,
127
+ y2: void 0,
128
+ yDomain: topDomain,
129
+ y2Domain: void 0
117
130
  },
118
- visible,
119
- highlighted,
120
- containerClass: cls,
121
- width,
122
- height: h,
123
- y2: void 0,
124
- yDomain: topDomain,
125
- y2Domain: void 0
126
- };
131
+ access
132
+ );
127
133
  return {
128
134
  marks: [
129
135
  ...fill ? [
@@ -1,7 +1,17 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { BasaltProps } from '../common/props.js';
3
+ import type { NamedChartState } from './band-fold.js';
3
4
  import type { ChartState, ChartTooltipRow, ResponsiveChartHeight } from './types.js';
4
- export type HeatmapProps<T> = BasaltProps & {
5
+ /**
6
+ * A named cell state, the same base `BandStrip`'s `states` use (`NamedChartState`): `color` and
7
+ * `fillOpacity` (default 1) are its flat fill, `label` its legend entry and tooltip reading, `note`
8
+ * a muted qualifier after the label in the legend, `legend: false` keeps it out of the legend.
9
+ * `tooltip` is omitted: a cell's tooltip always names its state, so there is no row to hide.
10
+ */
11
+ export type HeatmapState<K extends string = string> = Omit<NamedChartState, 'key' | 'tooltip'> & {
12
+ key: K;
13
+ };
14
+ export type HeatmapProps<T, K extends string = string> = BasaltProps & {
5
15
  /** The accessible name. Required. */
6
16
  ariaLabel: string;
7
17
  data: readonly T[];
@@ -18,8 +28,26 @@ export type HeatmapProps<T> = BasaltProps & {
18
28
  color?: string | undefined;
19
29
  /** The value range the color scale spans. Default `[0, max]` of the data. */
20
30
  domain?: readonly [number, number] | undefined;
21
- /** Tooltip, legend-end and `aria` value format. Default: the number as-is. */
31
+ /** Tooltip value format. Default: the number as-is. */
22
32
  formatValue?: ((v: number) => string) | undefined;
33
+ /**
34
+ * The gradient legend's two end labels. Default: `formatValue`. The engine labels only the ends
35
+ * (a 240px ramp), so a unit-bearing `formatValue` ("50.0% below fastest hour") overlaps its
36
+ * neighbour there — pass a compact form ("50%") when the tooltip's reads long.
37
+ */
38
+ formatLegend?: ((v: number) => string) | undefined;
39
+ /**
40
+ * The state a datum is in, a `states` key, or `undefined` for the plain value ramp. A stated cell
41
+ * draws its state's flat fill whatever its value, and — not being a measurement — does NOT
42
+ * contribute to the default `[0, max]` domain; pass `domain` to pin it. Memoize it: a new
43
+ * function recompiles the chart.
44
+ */
45
+ getState?: ((d: T) => K | undefined) | undefined;
46
+ /**
47
+ * The named states `getState` may return, legended after the gradient (hidden with
48
+ * `legend={false}`). Without `getState` they draw and legend nothing.
49
+ */
50
+ states?: readonly HeatmapState<K>[] | undefined;
23
51
  /** Band tick and tooltip header labels. Default: the band key. */
24
52
  formatRow?: ((row: string) => string) | undefined;
25
53
  formatCol?: ((col: string) => string) | undefined;
@@ -30,6 +58,8 @@ export type HeatmapProps<T> = BasaltProps & {
30
58
  /** Rows after the value row, per cell (a sample count, a failure reason). Called with the datum. */
31
59
  tooltip?: (false | {
32
60
  rows?: ((d: T) => readonly ChartTooltipRow[]) | undefined;
61
+ /** The value row's label. Default "Value". */
62
+ valueLabel?: string | undefined;
33
63
  }) | undefined;
34
64
  /** A fixed height, or one per container class. Default: by row count (160–420px). */
35
65
  height?: number | ResponsiveChartHeight | undefined;
@@ -39,5 +69,5 @@ export type HeatmapProps<T> = BasaltProps & {
39
69
  matchHeight?: boolean | undefined;
40
70
  state?: ChartState | undefined;
41
71
  };
42
- export declare function Heatmap<T>(props: HeatmapProps<T>): ReactElement;
72
+ export declare function Heatmap<T, K extends string = string>(props: HeatmapProps<T, K>): ReactElement;
43
73
  //# sourceMappingURL=Heatmap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["../../src/charts/Heatmap.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAUlD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEjF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,GAAG;IAC1C,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,SAAS,CAAC,EAAE,CAAA;IAClB,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAA;IACxB,wCAAwC;IACxC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,CAAA;IACxB,4EAA4E;IAC5E,QAAQ,EAAE,C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