basalt-ui 2.9.1 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -38
- package/MIGRATING.md +34 -12
- package/agent/rules/basalt-charts.md +2 -2
- package/agent/skills/basalt-charts/SKILL.md +16 -17
- package/dist/charts/BandStrip.d.ts +9 -6
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +8 -8
- package/dist/charts/CartesianChart.d.ts +3 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +13 -6
- package/dist/charts/DualPanel.d.ts.map +1 -1
- package/dist/charts/DualPanel.js +20 -15
- package/dist/charts/Heatmap.d.ts +33 -3
- package/dist/charts/Heatmap.d.ts.map +1 -1
- package/dist/charts/Heatmap.js +111 -68
- package/dist/charts/MirroredBars.d.ts +16 -5
- package/dist/charts/MirroredBars.d.ts.map +1 -1
- package/dist/charts/MirroredBars.js +46 -9
- package/dist/charts/Sparkline.d.ts +12 -0
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +68 -5
- package/dist/charts/band-fold.d.ts +13 -0
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +11 -1
- package/dist/charts/compile.d.ts +4 -1
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +22 -14
- package/dist/charts/heatmap-fill.d.ts +15 -0
- package/dist/charts/heatmap-fill.d.ts.map +1 -0
- package/dist/charts/heatmap-fill.js +13 -0
- package/dist/charts/host.d.ts +5 -1
- package/dist/charts/host.d.ts.map +1 -1
- package/dist/charts/host.js +37 -1
- package/dist/charts/index.d.ts +1 -1
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/legend.d.ts +2 -0
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +14 -10
- package/dist/charts/marks.d.ts +1 -1
- package/dist/charts/marks.d.ts.map +1 -1
- package/dist/charts/marks.js +28 -13
- package/dist/charts/panel.d.ts +7 -1
- package/dist/charts/panel.d.ts.map +1 -1
- package/dist/charts/panel.js +9 -4
- package/dist/charts/plot-context.d.ts +42 -0
- package/dist/charts/plot-context.d.ts.map +1 -0
- package/dist/charts/plot-context.js +64 -0
- package/dist/charts/scales.d.ts +3 -1
- package/dist/charts/scales.d.ts.map +1 -1
- package/dist/charts/scales.js +23 -5
- package/dist/charts/types.d.ts +36 -4
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/controls/enum-filter.d.ts +4 -1
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +2 -1
- package/dist/controls/number-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.js +2 -0
- package/dist/tokens/core.d.ts +6 -0
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +5 -3
- package/llms.txt +17 -8
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +19 -20
- package/src/charts/CartesianChart.tsx +16 -4
- package/src/charts/DualPanel.tsx +21 -16
- package/src/charts/Heatmap.tsx +181 -76
- package/src/charts/MirroredBars.tsx +71 -18
- package/src/charts/Sparkline.tsx +106 -5
- package/src/charts/band-fold.ts +32 -0
- package/src/charts/compile.ts +26 -14
- package/src/charts/heatmap-fill.ts +19 -0
- package/src/charts/host.tsx +59 -0
- package/src/charts/index.ts +1 -1
- package/src/charts/legend.tsx +21 -12
- package/src/charts/marks.ts +31 -14
- package/src/charts/panel.tsx +18 -5
- package/src/charts/plot-context.ts +109 -0
- package/src/charts/scales.ts +33 -5
- package/src/charts/types.ts +36 -4
- package/src/controls/enum-filter.tsx +5 -1
- package/src/controls/number-filter.tsx +6 -1
- package/src/tokens/core.ts +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,59 +1,82 @@
|
|
|
1
|
-
|
|
1
|
+
# [2.11.0](https://github.com/jkrumm/basalt-ui/compare/v2.10.0...v2.11.0) (2026-10-15)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* shell-less apps get no nav seed ([9944893](https://github.com/jkrumm/basalt-ui/commit/994489391b46ee944acb57032de99746aae35019))
|
|
6
|
+
* keep stated heatmap cells out of the domain and the state legend stable ([4f95cc7](https://github.com/jkrumm/basalt-ui/commit/4f95cc74ed7695b256c82644708fc9cc32173778))
|
|
7
|
+
* never close a sparkline gap when pooling, and harden the x domain ([c92e37b](https://github.com/jkrumm/basalt-ui/commit/c92e37b0b1372e8d7e8f615e84e54664fb8f82a9))
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* align charts on a shared x domain ([b0e037a](https://github.com/jkrumm/basalt-ui/commit/b0e037a10b8d8c79dbb9f9fa86fe90c683e50daf))
|
|
13
|
+
* give chart marks the plot area, the rows and per-datum cursor dots ([fb2b68b](https://github.com/jkrumm/basalt-ui/commit/fb2b68b2b68820f763546a2cb2f032f433079213))
|
|
14
|
+
* report the measured plot area from one builder for every chart kind ([ca26afe](https://github.com/jkrumm/basalt-ui/commit/ca26afea1837ed650e790388793f08e0ffc544d3))
|
|
15
|
+
|
|
16
|
+
# [2.10.0](https://github.com/jkrumm/basalt-ui/compare/v2.9.1...v2.10.0) (2026-10-15)
|
|
11
17
|
|
|
12
18
|
|
|
13
19
|
### Bug Fixes
|
|
14
20
|
|
|
15
|
-
*
|
|
16
|
-
* address review of the 1.x compat removal ([8c7918f](https://github.com/jkrumm/basalt-ui/commit/8c7918f08fa66ef1712111ab2ef15a47ea41014e))
|
|
17
|
-
* clear a shell-less page bar from section anchors ([9df0585](https://github.com/jkrumm/basalt-ui/commit/9df0585ccd493fc65372fdc8d4a933db32ea5666)), closes [#anchor](https://github.com/jkrumm/basalt-ui/issues/anchor)
|
|
18
|
-
* guide a settings-row selection to a bound filter ([e1136b7](https://github.com/jkrumm/basalt-ui/commit/e1136b7d4ab362bf094209d0f8752d8a5f9106f4))
|
|
19
|
-
* home a settings-row control prop in the raw-selection-control scan ([d2b955c](https://github.com/jkrumm/basalt-ui/commit/d2b955ca7a38c9982705be285df6db91fac40dca))
|
|
20
|
-
* let sync run from a workspace app and name its bin ([5cf854f](https://github.com/jkrumm/basalt-ui/commit/5cf854f2a0613b3b1a8503d33b94ec95487a7a10))
|
|
21
|
-
* print unions in an llms.txt glossary instead of rewriting signatures ([6b8d917](https://github.com/jkrumm/basalt-ui/commit/6b8d91792781266581c11a4b7dddd39b9ca8e2ab))
|
|
22
|
-
* re-aim a cold hash load once the page bar is measured ([a218a89](https://github.com/jkrumm/basalt-ui/commit/a218a8948a316933b360e98a3b5b39caf0e48a4b))
|
|
23
|
-
* settle a toc click on a quiet scroller, not a fixed deadline ([e14cb8d](https://github.com/jkrumm/basalt-ui/commit/e14cb8d53726d9f18082b7bf28883e93344ee1ae))
|
|
24
|
-
* share one install-root predicate between sync and doctor ([9d85846](https://github.com/jkrumm/basalt-ui/commit/9d858467bd4d71f55b62d0404b0607cc201d3f9f))
|
|
25
|
-
* spell out unions, token maps and constants in llms.txt ([ec1a4e1](https://github.com/jkrumm/basalt-ui/commit/ec1a4e14e328a5caaa513485438e6fe23a2b8156))
|
|
21
|
+
* name the unset state of a preset number filter ([ed43eeb](https://github.com/jkrumm/basalt-ui/commit/ed43eeb0cde5a1ff1bc42ae118ab637d08007d64))
|
|
26
22
|
|
|
27
23
|
|
|
28
24
|
### Features
|
|
29
25
|
|
|
30
|
-
*
|
|
31
|
-
* name the unset state of a number filter ([02ed3ba](https://github.com/jkrumm/basalt-ui/commit/02ed3bacc5094fca61401795a6440513754150aa))
|
|
32
|
-
* remove the 1.x compatibility layer from 2.x ([66f4517](https://github.com/jkrumm/basalt-ui/commit/66f4517df998f5a304a90d2cd9824654772de31d))
|
|
26
|
+
* band charts hide a pending legend and mirror their fills ([22a491e](https://github.com/jkrumm/basalt-ui/commit/22a491ef5cfdbcd9bfac1c5284c8566f453b50af))
|
|
33
27
|
|
|
34
|
-
## [2.
|
|
28
|
+
## [2.9.1](https://github.com/jkrumm/basalt-ui/compare/v2.9.0...v2.9.1) (2026-10-15)
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
35
31
|
|
|
32
|
+
- declare shell-less apps with basalt.shell, scope the route override ([0ea148d](https://github.com/jkrumm/basalt-ui/commit/0ea148d8949a37a65e91b5d0cf9ffaa04c6f98c7))
|
|
33
|
+
- route files lint clean under the shipped preset ([a51c1ee](https://github.com/jkrumm/basalt-ui/commit/a51c1ee4e9f6c1b9d81902e74d87340be73caaaa))
|
|
34
|
+
- shell-less apps get no nav seed ([9944893](https://github.com/jkrumm/basalt-ui/commit/994489391b46ee944acb57032de99746aae35019))
|
|
35
|
+
|
|
36
|
+
# [2.9.0](https://github.com/jkrumm/basalt-ui/compare/v2.8.1...v2.9.0) (2026-10-15)
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
- activate the last toc entry at the end of the scroll ([797f41d](https://github.com/jkrumm/basalt-ui/commit/797f41df602cd8835629f430ae26fc03a3c14909))
|
|
41
|
+
- address review of the 1.x compat removal ([8c7918f](https://github.com/jkrumm/basalt-ui/commit/8c7918f08fa66ef1712111ab2ef15a47ea41014e))
|
|
42
|
+
- clear a shell-less page bar from section anchors ([9df0585](https://github.com/jkrumm/basalt-ui/commit/9df0585ccd493fc65372fdc8d4a933db32ea5666)), closes [#anchor](https://github.com/jkrumm/basalt-ui/issues/anchor)
|
|
43
|
+
- guide a settings-row selection to a bound filter ([e1136b7](https://github.com/jkrumm/basalt-ui/commit/e1136b7d4ab362bf094209d0f8752d8a5f9106f4))
|
|
44
|
+
- home a settings-row control prop in the raw-selection-control scan ([d2b955c](https://github.com/jkrumm/basalt-ui/commit/d2b955ca7a38c9982705be285df6db91fac40dca))
|
|
45
|
+
- let sync run from a workspace app and name its bin ([5cf854f](https://github.com/jkrumm/basalt-ui/commit/5cf854f2a0613b3b1a8503d33b94ec95487a7a10))
|
|
46
|
+
- print unions in an llms.txt glossary instead of rewriting signatures ([6b8d917](https://github.com/jkrumm/basalt-ui/commit/6b8d91792781266581c11a4b7dddd39b9ca8e2ab))
|
|
47
|
+
- re-aim a cold hash load once the page bar is measured ([a218a89](https://github.com/jkrumm/basalt-ui/commit/a218a8948a316933b360e98a3b5b39caf0e48a4b))
|
|
48
|
+
- settle a toc click on a quiet scroller, not a fixed deadline ([e14cb8d](https://github.com/jkrumm/basalt-ui/commit/e14cb8d53726d9f18082b7bf28883e93344ee1ae))
|
|
49
|
+
- share one install-root predicate between sync and doctor ([9d85846](https://github.com/jkrumm/basalt-ui/commit/9d858467bd4d71f55b62d0404b0607cc201d3f9f))
|
|
50
|
+
- spell out unions, token maps and constants in llms.txt ([ec1a4e1](https://github.com/jkrumm/basalt-ui/commit/ec1a4e14e328a5caaa513485438e6fe23a2b8156))
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
- export foldBands for testing a band merge ([8343f19](https://github.com/jkrumm/basalt-ui/commit/8343f1985fffef07447ce202f512b17ebbf3ce7c))
|
|
55
|
+
- name the unset state of a number filter ([02ed3ba](https://github.com/jkrumm/basalt-ui/commit/02ed3bacc5094fca61401795a6440513754150aa))
|
|
56
|
+
- remove the 1.x compatibility layer from 2.x ([66f4517](https://github.com/jkrumm/basalt-ui/commit/66f4517df998f5a304a90d2cd9824654772de31d))
|
|
57
|
+
|
|
58
|
+
## [2.8.1](https://github.com/jkrumm/basalt-ui/compare/v2.8.0...v2.8.1) (2026-10-15)
|
|
36
59
|
|
|
37
60
|
### Bug Fixes
|
|
38
61
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
62
|
+
- anchor code-routed detection to real imports and calls ([115f8b4](https://github.com/jkrumm/basalt-ui/commit/115f8b40b2013b5dc613c83c6ec112b4e8b7e111))
|
|
63
|
+
- bound the mermaid import matcher and widen sanitizer tests ([4f6f39a](https://github.com/jkrumm/basalt-ui/commit/4f6f39a4469527277b5f0d3ec476d5f7c597858f))
|
|
64
|
+
- classify code-routed apps by wiring, keep seeds self-healing ([e07d38b](https://github.com/jkrumm/basalt-ui/commit/e07d38b13436485d13f07ceb4e5f6029e77aa5b9))
|
|
65
|
+
- keep dev-only chunks out of production builds ([fab9b09](https://github.com/jkrumm/basalt-ui/commit/fab9b0927aadbc0bbf93d88466ed15dd2dbadba4))
|
|
66
|
+
- keep the code block copy button clear of the first line ([c02498a](https://github.com/jkrumm/basalt-ui/commit/c02498aab9c1c38f5fb1f195a2aa02d10cabd09c))
|
|
67
|
+
- let sync and doctor accept a code-defined route tree ([9bb8571](https://github.com/jkrumm/basalt-ui/commit/9bb857153a2a441293dec3271fa3db45f11ed561))
|
|
68
|
+
- move router detection into a leaf module and require calls ([fb147a7](https://github.com/jkrumm/basalt-ui/commit/fb147a7ff571afe9a47c6f4f237cd2a937c98d9c))
|
|
69
|
+
- one code-routed predicate for init, sync and doctor ([9611d34](https://github.com/jkrumm/basalt-ui/commit/9611d34ecee1bcdf1c8e9c9260d52037403efd0c))
|
|
70
|
+
- paint the stored color scheme before the app boots ([14dd4ff](https://github.com/jkrumm/basalt-ui/commit/14dd4ff1dac2fbd8feaf8258594c60e349afd0b1))
|
|
71
|
+
- reset the fallback pre margin and pin the copy button reserve ([4955f4f](https://github.com/jkrumm/basalt-ui/commit/4955f4f1e30a88c7f64bb02c4b0259f4390c974d))
|
|
72
|
+
- run dropped-subpaths for tokens-only consumers in doctor ([2da07a7](https://github.com/jkrumm/basalt-ui/commit/2da07a7497e1c1c2bcdb72f8c9cd8ad6858118d9))
|
|
73
|
+
- scope the boot script, move the boot subsystem to vite-boot.ts ([b37a44e](https://github.com/jkrumm/basalt-ui/commit/b37a44e1dd9acdd6243ad1cdd592597cd40f4d12))
|
|
74
|
+
- scope the mermaid font sanitizer to style blocks ([e0dacfe](https://github.com/jkrumm/basalt-ui/commit/e0dacfefc3e6afa40794d27b58494c20e9f9c1f2))
|
|
75
|
+
- stop calling a code-defined route tree generated in doctor output ([838e3f3](https://github.com/jkrumm/basalt-ui/commit/838e3f3cee83ceaa3f5ad1b3b05fdd3ebf7d2e47))
|
|
76
|
+
- strip the remote font import from mermaid diagrams ([5e5fc8f](https://github.com/jkrumm/basalt-ui/commit/5e5fc8f3c346c58aadc5640ad87e429379a92bc7))
|
|
77
|
+
- tighten the boot subsystem types and share the plugin test fixtures ([d3f828a](https://github.com/jkrumm/basalt-ui/commit/d3f828a5598e9c0a98e9cff597ce5caf76ea2761))
|
|
78
|
+
- tighten the dev-chunk gate and the provider ceiling ([0b280b0](https://github.com/jkrumm/basalt-ui/commit/0b280b0bf15034d7edfebab567a5877afdea99fb))
|
|
79
|
+
- unquote the font-family var in mermaid diagrams ([9c2e485](https://github.com/jkrumm/basalt-ui/commit/9c2e485c415d6c3df4eefd4e3d5406e415c71d47))
|
|
57
80
|
|
|
58
81
|
# [2.8.0](https://github.com/jkrumm/basalt-ui/compare/v2.7.3...v2.8.0) (2026-10-15)
|
|
59
82
|
|
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 | 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 | 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,6 +1046,28 @@ 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.0 — Heatmap cells carry a state, a shared x domain, a self-pooling sparkline, visible reference lines
|
|
1050
|
+
|
|
1051
|
+
- **`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.**
|
|
1052
|
+
- **`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.**
|
|
1053
|
+
- **`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.**
|
|
1054
|
+
- **`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.**
|
|
1055
|
+
- **`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.**
|
|
1056
|
+
- **`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.**
|
|
1057
|
+
- **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`.**
|
|
1058
|
+
|
|
1059
|
+
## 2.10.0 — preset filters honour `.labels()`
|
|
1060
|
+
|
|
1061
|
+
- `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.**
|
|
1062
|
+
- **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.**
|
|
1063
|
+
- **`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.
|
|
1064
|
+
- **`BandStrip` legend swatches mirror a state's `fillOpacity`** (a state at 0.14 no longer draws a solid swatch over a pale plot).
|
|
1065
|
+
- **`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).
|
|
1066
|
+
- **`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.
|
|
1067
|
+
- **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.
|
|
1068
|
+
- **`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.
|
|
1069
|
+
- **`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.
|
|
1070
|
+
|
|
1049
1071
|
## 2.9.1
|
|
1050
1072
|
|
|
1051
1073
|
_Nothing to migrate in this release._
|
|
@@ -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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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 })`.
|
|
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 {
|
|
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> =
|
|
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").
|
|
@@ -42,8 +43,10 @@ export type BandFold<T> = {
|
|
|
42
43
|
*/
|
|
43
44
|
merge: (group: T[]) => T;
|
|
44
45
|
};
|
|
45
|
-
export type BandStripProps<T, X extends ChartX = ChartX> = Omit<CartesianChartProps<T, X>, 'marks' | 'series' | 'y' | 'y2' | 'zones' | 'xZones' | 'refLines'> & {
|
|
46
|
-
states: readonly BandStripSeries<T>
|
|
46
|
+
export type BandStripProps<T, X extends ChartX = ChartX, K extends string = string> = Omit<CartesianChartProps<T, X>, 'marks' | 'series' | 'y' | 'y2' | 'zones' | 'xZones' | 'refLines'> & {
|
|
47
|
+
states: readonly (BandStripSeries<T> & {
|
|
48
|
+
key: K;
|
|
49
|
+
})[];
|
|
47
50
|
/** Which state, fill and marker each datum has. Memoize it: a new function recompiles the chart. */
|
|
48
51
|
getBand: (d: T) => BandSpan;
|
|
49
52
|
fold?: BandFold<T> | undefined;
|
|
@@ -53,7 +56,7 @@ export type BandStripProps<T, X extends ChartX = ChartX> = Omit<CartesianChartPr
|
|
|
53
56
|
* tooltip adds this state's row. Absent stays a legended, flat state, never a
|
|
54
57
|
* hatch: it reads as "no data" by hue and by sitting at the band's right edge, not as zero.
|
|
55
58
|
*/
|
|
56
|
-
absentState?:
|
|
59
|
+
absentState?: K | undefined;
|
|
57
60
|
};
|
|
58
|
-
export declare function BandStrip<T, X extends ChartX = ChartX>(props: BandStripProps<T, X>): ReactElement;
|
|
61
|
+
export declare function BandStrip<T, X extends ChartX = ChartX, K extends string = string>(props: BandStripProps<T, X, K>): ReactElement;
|
|
59
62
|
//# sourceMappingURL=BandStrip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BandStrip.d.ts","sourceRoot":"","sources":["../../src/charts/BandStrip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BandStrip.d.ts","sourceRoot":"","sources":["../../src/charts/BandStrip.tsx"],"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G,OAAO,GAAG,QAAQ,GAAG,UAAU,CAClE,GAAG;IACF,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,EAAE,CAAC,CAAA;KAAE,CAAC,EAAE,CAAA;IACpD,oGAAoG;IACpG,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAA;IAC3B,IAAI,CAAC,EAAE,QAAQ,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"}
|
package/dist/charts/BandStrip.js
CHANGED
|
@@ -7,7 +7,7 @@ import { oneOf, requiredProp } from "../common/errors.js";
|
|
|
7
7
|
import { NON_FINITE } from "../format/shared.js";
|
|
8
8
|
import { VX, alpha } from "../tokens/index.js";
|
|
9
9
|
import { CartesianRung } from "./CartesianChart.js";
|
|
10
|
-
import { groupsOf } from "./band-fold.js";
|
|
10
|
+
import { groupsOf, resolveNamedState } from "./band-fold.js";
|
|
11
11
|
import { emphasis } from "./marks.js";
|
|
12
12
|
import { rowX } from "./types.js";
|
|
13
13
|
const DEFAULT_MIN_BAND_PX = 3;
|
|
@@ -119,19 +119,19 @@ function BandStrip(props) {
|
|
|
119
119
|
...rest
|
|
120
120
|
} = props;
|
|
121
121
|
const { data, x } = rest;
|
|
122
|
-
const absentKey =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
);
|
|
122
|
+
const absentKey = resolveNamedState(
|
|
123
|
+
"BandStrip",
|
|
124
|
+
"BandStrip.absentState",
|
|
125
|
+
absentState,
|
|
126
|
+
states.map((s) => s.key)
|
|
127
|
+
);
|
|
129
128
|
const series = useMemo(
|
|
130
129
|
() => states.map((s) => ({
|
|
131
130
|
key: s.key,
|
|
132
131
|
label: s.label,
|
|
133
132
|
color: s.color,
|
|
134
133
|
mark: "bar",
|
|
134
|
+
...s.fillOpacity !== void 0 && { fillOpacity: s.fillOpacity },
|
|
135
135
|
...s.tooltip !== void 0 && { tooltip: s.tooltip },
|
|
136
136
|
...s.legend !== void 0 && { legend: s.legend },
|
|
137
137
|
...s.note !== void 0 && { note: s.note },
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/charts/CartesianCh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E,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;
|
|
@@ -48,6 +53,7 @@ function ChartShell(props) {
|
|
|
48
53
|
return next;
|
|
49
54
|
});
|
|
50
55
|
}, []);
|
|
56
|
+
const resolved = resolveChartState(state);
|
|
51
57
|
const legendNode = useMemo(
|
|
52
58
|
() => shown ? /* @__PURE__ */ jsx(
|
|
53
59
|
ChartLegend,
|
|
@@ -58,14 +64,14 @@ function ChartShell(props) {
|
|
|
58
64
|
groups: config?.groups === true,
|
|
59
65
|
toggle,
|
|
60
66
|
onToggle,
|
|
61
|
-
onHighlight: setHighlighted
|
|
67
|
+
onHighlight: setHighlighted,
|
|
68
|
+
concealed: resolved !== null
|
|
62
69
|
}
|
|
63
70
|
) : null,
|
|
64
|
-
[shown, series, hidden, config?.groups, toggle, onToggle]
|
|
71
|
+
[shown, series, hidden, config?.groups, toggle, onToggle, resolved]
|
|
65
72
|
);
|
|
66
73
|
const atTop = config?.placement === "top" || config?.placement === "header";
|
|
67
74
|
const asHeaderRow = config?.placement === "header" && inCard;
|
|
68
|
-
const resolved = resolveChartState(state);
|
|
69
75
|
return /* @__PURE__ */ jsxs(
|
|
70
76
|
"div",
|
|
71
77
|
{
|
|
@@ -82,7 +88,8 @@ function ChartShell(props) {
|
|
|
82
88
|
ariaLabel,
|
|
83
89
|
height,
|
|
84
90
|
idPrefix: idPrefixOf(chartId),
|
|
85
|
-
coarse
|
|
91
|
+
coarse,
|
|
92
|
+
onPlot
|
|
86
93
|
}
|
|
87
94
|
) : /* @__PURE__ */ jsx(ChartPlaceholder, { state, height }),
|
|
88
95
|
!atTop && legendNode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DualPanel.d.ts","sourceRoot":"","sources":["../../src/charts/DualPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,K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
|
package/dist/charts/DualPanel.js
CHANGED
|
@@ -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,27 @@ 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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
+
y2: void 0,
|
|
127
|
+
yDomain: topDomain,
|
|
128
|
+
y2Domain: void 0
|
|
117
129
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
containerClass: cls,
|
|
121
|
-
width,
|
|
122
|
-
height: h,
|
|
123
|
-
y2: void 0,
|
|
124
|
-
yDomain: topDomain,
|
|
125
|
-
y2Domain: void 0
|
|
126
|
-
};
|
|
130
|
+
access
|
|
131
|
+
);
|
|
127
132
|
return {
|
|
128
133
|
marks: [
|
|
129
134
|
...fill ? [
|
package/dist/charts/Heatmap.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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":"
|
|
1
|
+
{"version":3,"file":"Heatmap.d.ts","sourceRoot":"","sources":["../../src/charts/Heatmap.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAMlD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAQlD,OAAO,KAAK,EAAe,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE9F;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC,eAAe,EAAE,KAAK,GAAG,SAAS,CAAC,GAAG;IAC/F,GAAG,EAAE,CAAC,CAAA;CACP,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,WAAW,GAAG;IACrE,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,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;IACjC,0DAA0D;IAC1D,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACpC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACpC,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,6EAA6E;IAC7E,MAAM,CAA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