basalt-ui 2.13.1 → 2.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/MIGRATING.md +21 -12
- package/README.md +1 -1
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +6 -5
- package/dist/charts/cursor.d.ts +33 -7
- package/dist/charts/cursor.d.ts.map +1 -1
- package/dist/charts/cursor.js +31 -10
- package/dist/charts/legend.d.ts +19 -3
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +33 -15
- package/dist/charts/marks.d.ts.map +1 -1
- package/dist/charts/marks.js +24 -28
- package/dist/charts/panel.d.ts.map +1 -1
- package/dist/charts/panel.js +4 -4
- package/dist/charts/types.d.ts +3 -2
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +4 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/charts/compile.ts +8 -10
- package/src/charts/cursor.ts +69 -19
- package/src/charts/legend.tsx +40 -19
- package/src/charts/marks.ts +28 -29
- package/src/charts/panel.tsx +4 -4
- package/src/charts/types.ts +3 -2
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -0
- package/src/theme/index.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [2.13.2](https://github.com/jkrumm/basalt-ui/compare/v2.13.1...v2.13.2) (2026-10-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* a line series keeps its dashed legend swatch below 480px ([d711f78](https://github.com/jkrumm/basalt-ui/commit/d711f78b4e0451719ccd87bb9e983479e77abbbf))
|
|
7
|
+
* butt-capped dashed swatches, a paint before update hides, validate options ([c861eb4](https://github.com/jkrumm/basalt-ui/commit/c861eb4ef086c2b95d1a65ea622568bfb111e290))
|
|
8
|
+
* followers draw the cursor dots, one cursor-dot mark per getMarker series ([5a1a70f](https://github.com/jkrumm/basalt-ui/commit/5a1a70fe6d1f7a6d67e144f04f233503cc173c41))
|
|
9
|
+
* give the Modal close button an accessible name ([8e9527f](https://github.com/jkrumm/basalt-ui/commit/8e9527fc6b91431ecd4692d906e465fd2adcb6f7))
|
|
10
|
+
* type the follower contract and narrow the compact line swatch ([45e08e6](https://github.com/jkrumm/basalt-ui/commit/45e08e6537593419cf92a47805d614cb3a393aa3))
|
|
11
|
+
|
|
1
12
|
## [2.13.1](https://github.com/jkrumm/basalt-ui/compare/v2.13.0...v2.13.1) (2026-10-16)
|
|
2
13
|
|
|
3
14
|
|
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 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.0 | 2.13.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 | 2.11.1 | 2.12.0 | 2.13.0 | 2.13.1 | 2.13.2 | 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,15 @@ 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.13.2 — followers draw the cursor dots, a dashed line keeps its key
|
|
1050
|
+
|
|
1051
|
+
### Charts — a follower draws the cursor dots, a dashed line keeps its key, one dot mark per `getMarker` series
|
|
1052
|
+
|
|
1053
|
+
- **Behaviour: a chart following a sibling's cursor draws the leader's dots by default** (the engine's focus ring on its lines, and the `cursorValue` dots, at the shared x; hidden series and `getMarker` colours respected). It used to paint the crosshair only. Its tooltip stays silent unless `tooltip.onFollow`: the host is hidden, not painted, for a follower, so no tooltip text or live-region announcement. **No opt-out.**
|
|
1054
|
+
- **Behaviour: the `cursorValue` cursor dot of a `getMarker` series is one mark, coloured per datum.** It was one mark per distinct colour (`<key>-cursor-<slug>`); it is now a single `<key>-cursor` mark whose focused fill is `getMarker(d).color`, so a continuous palette is fine there (always-on markers still cost one mark per distinct paint). **Opt-out: none** — the old key matches nothing; query `<key>-cursor`.
|
|
1055
|
+
- **Fix: a line series keeps its line swatch in the legend below 480px.** It got a dot there, so a dashed series lost its dashed key. The swatch is now a stroke at both sizes (`LINE_SWATCH` in `legend.tsx`): 8px below 480px (dash `2.5 2`) and 12px from 480px (was 16px; dash `4 3`); a dashed swatch has butt caps so the gap stays open. The line `svg` no longer carries `classes.chip` (it is the `dot` variant below 480px and the `chip` variant above, like the bar swatches), and the swatch is now rendered in `dots` mode. Selectors that expected a `span` dot for a line series, or a 16px svg, match the new `svg`s. Bar and area swatches are unchanged.
|
|
1056
|
+
- **`legend.maxRows` stays gone.** It was deliberately deprecated in 1.31 and removed in 1.32.0 (the legend fits by measured width and folds overflow into the `All N` chip); not restored.
|
|
1057
|
+
|
|
1049
1058
|
## 2.13.1
|
|
1050
1059
|
|
|
1051
1060
|
_Nothing to migrate in this release._
|
package/README.md
CHANGED
|
@@ -458,7 +458,7 @@ reference lines, `y2`) and `Bars` (stacked, grouped or normalised, ± bars, over
|
|
|
458
458
|
|
|
459
459
|
Charts share a cursor with no provider (`cursorGroup="…"` isolates one; `chartCursor(group?)` reads
|
|
460
460
|
it for app code), and only the chart under the pointer or keyboard focus shows a tooltip
|
|
461
|
-
(`tooltip.onFollow` opts a follower in). `x` ticks are `xTicks` (a count or the values) and
|
|
461
|
+
(`tooltip.onFollow` opts a follower in); a follower still draws the leader's focus and cursor-value dots at the shared x. `x` ticks are `xTicks` (a count or the values) and
|
|
462
462
|
collision is the engine's `tickLabels.thin`; labels never rotate.
|
|
463
463
|
|
|
464
464
|
### Query — `unwrap` (root barrel)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/charts/compile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/charts/compile.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEV,aAAa,EAEb,yBAAyB,EACzB,eAAe,IAAI,gBAAgB,EACnC,UAAU,EACV,yBAAyB,EAE1B,MAAM,6BAA6B,CAAA;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAK5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EAEnB,WAAW,EACX,eAAe,EACf,MAAM,EAEN,OAAO,EAEP,QAAQ,EACT,MAAM,SAAS,CAAA;AAEhB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;AAE/F,gGAAgG;AAChG,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,IAAI,CACpD,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EACvB,MAAM,GACN,GAAG,GACH,QAAQ,GACR,OAAO,GACP,GAAG,GACH,I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,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE;IAC7C,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,CAAA;IACzC,MAAM,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,MAAM,CAAA;IACjC,GAAG,EAAE,cAAc,CAAA;IACnB,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CA8BvD;AAED,+FAA+F;AAC/F,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAAgC,CAAA;AAE/E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAYxE;AAKD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GACjC,aAAa,GAAG,IAAI,CAuBtB;AAsbD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAClD,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,mBAAmB,CAwErB"}
|
package/dist/charts/compile.js
CHANGED
|
@@ -4,12 +4,11 @@ import { rect } from "@tanstack/charts/rect";
|
|
|
4
4
|
import { ruleX, ruleY } from "@tanstack/charts/rule";
|
|
5
5
|
import { scaleLinear } from "@tanstack/charts/scales/linear";
|
|
6
6
|
import { scaleUtc } from "d3-scale";
|
|
7
|
-
import { tooltip as tooltipHost } from "@tanstack/charts/tooltip";
|
|
8
7
|
import { portal } from "@tanstack/charts/tooltip/portal";
|
|
9
8
|
import { SHORT_CHART_HEIGHT } from "./box.js";
|
|
10
9
|
import { fmtCompact } from "../format/number.js";
|
|
11
10
|
import { VX } from "../tokens/index.js";
|
|
12
|
-
import { cursorBinding,
|
|
11
|
+
import { cursorBinding, followerOptions, quietWhileFollowing } from "./cursor.js";
|
|
13
12
|
import { cursorDots } from "./marks.js";
|
|
14
13
|
import { bucketTicks, strideEvery } from "./ticks.js";
|
|
15
14
|
import { MAIN_PANE, plotAccess, plotContext } from "./plot-context.js";
|
|
@@ -489,7 +488,8 @@ function tooltipSpec(opts) {
|
|
|
489
488
|
(s) => s.tooltip !== false
|
|
490
489
|
);
|
|
491
490
|
return {
|
|
492
|
-
use:
|
|
491
|
+
use: quietWhileFollowing,
|
|
492
|
+
...followerOptions(input.tooltip, input.cursorGroup, input.chartId),
|
|
493
493
|
portal,
|
|
494
494
|
anchor: "group-center",
|
|
495
495
|
content: (points) => {
|
|
@@ -579,8 +579,9 @@ function compileCartesian(input) {
|
|
|
579
579
|
...labelsInside(cls, height) && { margin: { left: 0, ...axes.right && { right: 0 } } }
|
|
580
580
|
};
|
|
581
581
|
},
|
|
582
|
-
// Followers
|
|
583
|
-
|
|
582
|
+
// Followers resolve the leader's group, so they draw its dots; `quietWhileFollowing` mutes the
|
|
583
|
+
// tooltip unless the chart opts into following tooltips.
|
|
584
|
+
focus: "group-x",
|
|
584
585
|
maxFocusDistance: Number.POSITIVE_INFINITY,
|
|
585
586
|
cursor: cursorBinding({
|
|
586
587
|
group: input.cursorGroup,
|
package/dist/charts/cursor.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ChartCursorController } from '@tanstack/charts/cursor';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartTooltipExtension } from '@tanstack/charts/tooltip';
|
|
3
|
+
import type { ChartCursorBinding } from '@tanstack/charts/types/core';
|
|
3
4
|
import type { ChartX, CursorResolution } from './types.js';
|
|
4
5
|
/**
|
|
5
6
|
* The cursor controller for a group (default `'default'`), for app-side sync — a map timeline that
|
|
@@ -30,13 +31,38 @@ export declare function isForeign(group: string | undefined, chartId: string): b
|
|
|
30
31
|
*/
|
|
31
32
|
export declare function chartCursorView(group: string | undefined, chartId: string, keys: readonly ChartX[], mode: CursorResolution): ChartCursorController;
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* focus strategy. Wrapping `group-x` so it groups nothing while a FOREIGN state is current leaves a
|
|
36
|
-
* follower with the crosshair (painted from the cursor presentation, not from focus) and nothing
|
|
37
|
-
* else.
|
|
34
|
+
* The extra key a chart puts on its tooltip options to name itself to {@link quietWhileFollowing}.
|
|
35
|
+
* Absent, the tooltip paints for followers too.
|
|
38
36
|
*/
|
|
39
|
-
export
|
|
37
|
+
export type TooltipFollowerOptions = {
|
|
38
|
+
readonly follower?: {
|
|
39
|
+
readonly group: string | undefined;
|
|
40
|
+
readonly chartId: string;
|
|
41
|
+
} | undefined;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The tooltip options a chart spreads next to `use: quietWhileFollowing`: its identity, unless the
|
|
45
|
+
* chart opted into following tooltips (`tooltip.onFollow`). The one place `onFollow` is read for
|
|
46
|
+
* this, shared by `compileCartesian` and the panel rung.
|
|
47
|
+
*/
|
|
48
|
+
export declare function followerOptions(tooltip: {
|
|
49
|
+
onFollow?: boolean | undefined;
|
|
50
|
+
} | false | null | undefined, group: string | undefined, chartId: string): TooltipFollowerOptions;
|
|
51
|
+
/**
|
|
52
|
+
* The engine's DOM tooltip host, silent while this chart FOLLOWS another's cursor. A follower
|
|
53
|
+
* resolves the leader's focus group (so the engine draws the same dots at the shared x); the host
|
|
54
|
+
* would then paint a tooltip and fill its `role="status"` live region. Whenever `isForeign` holds,
|
|
55
|
+
* this wrapper calls the host's `hide()` instead of `paint()`: a follower that has never led never
|
|
56
|
+
* creates the element, and one that has led keeps it in the DOM, hidden. Otherwise (leader, no
|
|
57
|
+
* `follower` option, or after the leader clears) it defers to the host.
|
|
58
|
+
*
|
|
59
|
+
* The chart's identity arrives only through `update` (the engine calls it before every `paint`);
|
|
60
|
+
* a `paint` before the first `update` has nothing to tell it who is leading, so it hides.
|
|
61
|
+
*
|
|
62
|
+
* It wraps `create`/`update`/`paint` of the engine's tooltip host, whose lifecycle is undocumented:
|
|
63
|
+
* re-check this wrapper, the live region included, on every `@tanstack/charts` upgrade.
|
|
64
|
+
*/
|
|
65
|
+
export declare const quietWhileFollowing: ChartTooltipExtension;
|
|
40
66
|
export declare function cursorBinding(opts: {
|
|
41
67
|
group: string | undefined;
|
|
42
68
|
chartId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/charts/cursor.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/charts/cursor.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,6BAA6B,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAiEvD;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,SAAY,GAAG,qBAAqB,CAQpE;AAED,yDAAyD;AACzD,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,OAA4B,CAAA;AAc3E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAG7E;AA8ED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,IAAI,EAAE,gBAAgB,GACrB,qBAAqB,CAqBvB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;CACjG,CAAA;AAeD;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,EACtE,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,GACd,sBAAsB,CAGxB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,EAAE,qBAmBjC,CAAA;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IACvB,IAAI,EAAE,gBAAgB,CAAA;IACtB,2FAA2F;IAC3F,GAAG,EAAE,OAAO,CAAA;CACb,GAAG,kBAAkB,CAQrB;AAED,sDAAsD;AACtD,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,SAAS,EAAE,SAAS,MAAM,KAAG,OACvB,CAAA"}
|
package/dist/charts/cursor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createChartCursor, cursorHost } from "@tanstack/charts/cursor";
|
|
2
|
-
import {
|
|
2
|
+
import { tooltip } from "@tanstack/charts/tooltip";
|
|
3
3
|
const groups = /* @__PURE__ */ new Map();
|
|
4
4
|
const facades = /* @__PURE__ */ new Map();
|
|
5
5
|
const INERT = {
|
|
@@ -127,15 +127,35 @@ function chartCursorView(group, chartId, keys, mode) {
|
|
|
127
127
|
sweepWhenIdle(views, id, view);
|
|
128
128
|
return view.controller;
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
};
|
|
130
|
+
const isFollowerOptions = (options) => {
|
|
131
|
+
if (typeof options !== "object" || options === null || !("follower" in options)) return false;
|
|
132
|
+
const { follower } = options;
|
|
133
|
+
return follower === void 0 || typeof follower === "object" && follower !== null && "group" in follower && "chartId" in follower && typeof follower.chartId === "string";
|
|
134
|
+
};
|
|
135
|
+
function followerOptions(tooltip2, group, chartId) {
|
|
136
|
+
const onFollow = typeof tooltip2 === "object" && tooltip2 !== null && tooltip2.onFollow === true;
|
|
137
|
+
return onFollow ? {} : { follower: { group, chartId } };
|
|
138
138
|
}
|
|
139
|
+
const quietWhileFollowing = {
|
|
140
|
+
...tooltip,
|
|
141
|
+
create: (context) => {
|
|
142
|
+
const host = tooltip.create(context);
|
|
143
|
+
let configured = false;
|
|
144
|
+
let follower;
|
|
145
|
+
return {
|
|
146
|
+
...host,
|
|
147
|
+
update: (options) => {
|
|
148
|
+
configured = true;
|
|
149
|
+
follower = isFollowerOptions(options) ? options.follower : void 0;
|
|
150
|
+
host.update(options);
|
|
151
|
+
},
|
|
152
|
+
paint: (paint) => {
|
|
153
|
+
if (!configured || follower && isForeign(follower.group, follower.chartId)) host.hide();
|
|
154
|
+
else host.paint(paint);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
};
|
|
139
159
|
function cursorBinding(opts) {
|
|
140
160
|
return {
|
|
141
161
|
use: cursorHost,
|
|
@@ -150,8 +170,9 @@ export {
|
|
|
150
170
|
chartCursor,
|
|
151
171
|
chartCursorView,
|
|
152
172
|
cursorBinding,
|
|
173
|
+
followerOptions,
|
|
153
174
|
hasCursorGroup,
|
|
154
175
|
hasCursorView,
|
|
155
176
|
isForeign,
|
|
156
|
-
|
|
177
|
+
quietWhileFollowing
|
|
157
178
|
};
|
package/dist/charts/legend.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ import type { ReactElement } from 'react';
|
|
|
8
8
|
import type { ChartSeries } from './types.js';
|
|
9
9
|
/**
|
|
10
10
|
* `auto` renders both swatches and lets the container decide: none, dots or chips (CSS). The
|
|
11
|
-
* swatch SHAPE follows the mode, signed split included: below 480px a dot (8px
|
|
12
|
-
* a chip (10px square) — so one `DualPanel` bar legend is a split circle on a
|
|
13
|
-
* split square on a wide one.
|
|
11
|
+
* swatch SHAPE follows the mode for a filled mark, signed split included: below 480px a dot (8px
|
|
12
|
+
* circle), from 480px a chip (10px square) — so one `DualPanel` bar legend is a split circle on a
|
|
13
|
+
* narrow card and a split square on a wide one. A LINE series swaps a short stroke for a shorter
|
|
14
|
+
* one instead, dash included, so it is never a dot. Not a per-chart prop.
|
|
14
15
|
*/
|
|
15
16
|
export type LegendMode = 'dots' | 'chips' | 'auto';
|
|
16
17
|
/** The entries a series list derives, in display order (by role when `groups`). */
|
|
@@ -23,6 +24,21 @@ export declare function legendEntries<T>(series: readonly ChartSeries<T>[], grou
|
|
|
23
24
|
export type SignedSeries<T> = ChartSeries<T> & {
|
|
24
25
|
colorNegative?: string | undefined;
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* A line series' key: a short stroke with its dash, compact below 480px and wide from 480px. A
|
|
29
|
+
* dashed swatch has BUTT caps: a round cap grows each dash by half the stroke width per end and
|
|
30
|
+
* would close the gap.
|
|
31
|
+
*/
|
|
32
|
+
export declare const LINE_SWATCH: {
|
|
33
|
+
readonly compact: {
|
|
34
|
+
readonly width: 8;
|
|
35
|
+
readonly dash: "2.5 2";
|
|
36
|
+
};
|
|
37
|
+
readonly wide: {
|
|
38
|
+
readonly width: 12;
|
|
39
|
+
readonly dash: "4 3";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
26
42
|
export type ChartLegendProps<T> = {
|
|
27
43
|
series: readonly SignedSeries<T>[];
|
|
28
44
|
hidden: ReadonlySet<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/charts/legend.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C
|
|
1
|
+
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/charts/legend.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAUlD,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,CAAC,EAC7B,MAAM,EAAE,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,EACjC,MAAM,EAAE,OAAO,GACd,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAMpB;AAsDD;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG;IAAE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAWrF;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;CAGd,CAAA;AAqEV,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,MAAM,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;IAClC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACzC,kGAAkG;IAClG,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CA2D9E"}
|
package/dist/charts/legend.js
CHANGED
|
@@ -56,12 +56,44 @@ const buttonStyle = {
|
|
|
56
56
|
};
|
|
57
57
|
const noteStyle = { color: VX.axis };
|
|
58
58
|
const swatchFill = (s) => s.colorNegative ? `linear-gradient(90deg, ${s.color} 50%, ${s.colorNegative} 50%)` : s.color;
|
|
59
|
+
const LINE_SWATCH = {
|
|
60
|
+
compact: { width: 8, dash: "2.5 2" },
|
|
61
|
+
wide: { width: 12, dash: "4 3" }
|
|
62
|
+
};
|
|
63
|
+
function LineSwatch({ s, compact }) {
|
|
64
|
+
const { width, dash } = compact ? LINE_SWATCH.compact : LINE_SWATCH.wide;
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"svg",
|
|
67
|
+
{
|
|
68
|
+
"aria-hidden": true,
|
|
69
|
+
className: compact ? classes.dot : classes.chip,
|
|
70
|
+
width,
|
|
71
|
+
height: 8,
|
|
72
|
+
style: { flex: "none" },
|
|
73
|
+
children: /* @__PURE__ */ jsx(
|
|
74
|
+
"line",
|
|
75
|
+
{
|
|
76
|
+
x1: 1,
|
|
77
|
+
x2: width - 1,
|
|
78
|
+
y1: 4,
|
|
79
|
+
y2: 4,
|
|
80
|
+
stroke: s.color,
|
|
81
|
+
strokeWidth: 2,
|
|
82
|
+
strokeLinecap: s.dash === "dashed" ? "butt" : "round",
|
|
83
|
+
strokeOpacity: s.strokeOpacity ?? 1,
|
|
84
|
+
...s.dash === "dashed" && { strokeDasharray: dash }
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
59
90
|
function Swatch({ s, mode }) {
|
|
60
91
|
if (mode === "auto")
|
|
61
92
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
93
|
/* @__PURE__ */ jsx(Swatch, { s, mode: "dots" }),
|
|
63
94
|
/* @__PURE__ */ jsx(Swatch, { s, mode: "chips" })
|
|
64
95
|
] });
|
|
96
|
+
if ((s.mark ?? "line") === "line") return /* @__PURE__ */ jsx(LineSwatch, { s, compact: mode === "dots" });
|
|
65
97
|
if (mode === "dots")
|
|
66
98
|
return /* @__PURE__ */ jsx(
|
|
67
99
|
"span",
|
|
@@ -79,21 +111,6 @@ function Swatch({ s, mode }) {
|
|
|
79
111
|
}
|
|
80
112
|
}
|
|
81
113
|
);
|
|
82
|
-
if ((s.mark ?? "line") === "line")
|
|
83
|
-
return /* @__PURE__ */ jsx("svg", { "aria-hidden": true, className: classes.chip, width: 16, height: 8, style: { flex: "none" }, children: /* @__PURE__ */ jsx(
|
|
84
|
-
"line",
|
|
85
|
-
{
|
|
86
|
-
x1: 1,
|
|
87
|
-
x2: 15,
|
|
88
|
-
y1: 4,
|
|
89
|
-
y2: 4,
|
|
90
|
-
stroke: s.color,
|
|
91
|
-
strokeWidth: 2,
|
|
92
|
-
strokeLinecap: "round",
|
|
93
|
-
strokeOpacity: s.strokeOpacity ?? 1,
|
|
94
|
-
...s.dash === "dashed" && { strokeDasharray: "4 3" }
|
|
95
|
-
}
|
|
96
|
-
) });
|
|
97
114
|
return /* @__PURE__ */ jsx(
|
|
98
115
|
"span",
|
|
99
116
|
{
|
|
@@ -169,5 +186,6 @@ function ChartLegend(props) {
|
|
|
169
186
|
}
|
|
170
187
|
export {
|
|
171
188
|
ChartLegend,
|
|
189
|
+
LINE_SWATCH,
|
|
172
190
|
legendEntries
|
|
173
191
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marks.d.ts","sourceRoot":"","sources":["../../src/charts/marks.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WA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EACtB,OAAO,GAAE,WAAW,CAAC,MAAM,CAAM,GAChC,UAAU,CAAC,MAAM,CAAC,CAKpB;AAyBD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,EAC7D,IAAI,EAAE,SAAS,CAAC,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GACrB,CAAC,EAAE,CA+CL"}
|
package/dist/charts/marks.js
CHANGED
|
@@ -86,35 +86,31 @@ function markersOf(s, rows, yScale) {
|
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
function cursorDots(s, rows, yScale) {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]
|
|
114
|
-
)
|
|
115
|
-
);
|
|
89
|
+
const { getMarker } = s;
|
|
90
|
+
const colors = getMarker ? new Map(rows.map((r) => [r, getMarker(r.datum)?.color ?? s.color])) : void 0;
|
|
91
|
+
const focused = {
|
|
92
|
+
fillOpacity: 1,
|
|
93
|
+
strokeOpacity: 1,
|
|
94
|
+
...colors && {
|
|
95
|
+
fill: ({ datum }) => colors.get(datum) ?? s.color
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return [
|
|
99
|
+
dot(rows, {
|
|
100
|
+
id: `${s.key}-cursor`,
|
|
101
|
+
x: rowX,
|
|
102
|
+
y: "y",
|
|
103
|
+
r: VX.dotR,
|
|
104
|
+
fill: s.color,
|
|
105
|
+
fillOpacity: 0,
|
|
106
|
+
stroke: VX.surface.panel,
|
|
107
|
+
strokeWidth: 1.5,
|
|
108
|
+
strokeOpacity: 0,
|
|
109
|
+
states: [{ when: { focus: "x" }, style: focused }],
|
|
110
|
+
...yScale !== void 0 && { yScale }
|
|
111
|
+
})
|
|
112
|
+
];
|
|
116
113
|
}
|
|
117
|
-
const colorSlug = (color) => color.replaceAll(/[^\w-]+/g, "_");
|
|
118
114
|
const given = (v) => v !== void 0 && v !== null;
|
|
119
115
|
function barMark(rows, options = {}) {
|
|
120
116
|
const seriesAsked = [options.z, options.color, options.layout].some(given);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/charts/panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/charts/panel.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,iBAAiB,EAEjB,eAAe,IAAI,gBAAgB,EACnC,UAAU,EACV,eAAe,EAChB,MAAM,6BAA6B,CAAA;AAIpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,kBAAkB,CAAA;AAKrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,WAAW,EAEX,MAAM,EACN,OAAO,EACR,MAAM,SAAS,CAAA;AAEhB;+DAC+D;AAC/D,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAA;AAElE,kGAAkG;AAClG,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,WAA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tanstack/charts/crosshair";
|
|
3
|
-
import { tooltip as tooltipHost } from "@tanstack/charts/tooltip";
|
|
4
3
|
import { portal } from "@tanstack/charts/tooltip/portal";
|
|
5
4
|
import { alignX, composeViews, grid } from "@tanstack/charts/view";
|
|
6
5
|
import { useCallback } from "react";
|
|
7
6
|
import { ChartShell } from "./CartesianChart.js";
|
|
8
7
|
import { defaultFormatX, engineRow, utcHeaderDate, visibleSeries, xGuide, yGuide } from "./compile.js";
|
|
9
|
-
import { cursorBinding,
|
|
8
|
+
import { cursorBinding, followerOptions, quietWhileFollowing } from "./cursor.js";
|
|
10
9
|
import { plotAccess } from "./plot-context.js";
|
|
11
10
|
import { CHART_THEME, CROSSHAIR } from "./theme.js";
|
|
12
11
|
const { background: _background, focusRing: _focusRing, ...PANE_THEME } = CHART_THEME;
|
|
@@ -91,7 +90,7 @@ function panelDefinition(props, ctx, plan) {
|
|
|
91
90
|
};
|
|
92
91
|
const definition = {
|
|
93
92
|
chart: () => composed,
|
|
94
|
-
focus:
|
|
93
|
+
focus: "group-x",
|
|
95
94
|
maxFocusDistance: Number.POSITIVE_INFINITY,
|
|
96
95
|
cursor: cursorBinding({
|
|
97
96
|
group: cursorGroup,
|
|
@@ -101,7 +100,8 @@ function panelDefinition(props, ctx, plan) {
|
|
|
101
100
|
pin: ctx.coarse
|
|
102
101
|
}),
|
|
103
102
|
tooltip: props.tooltip === false ? false : {
|
|
104
|
-
use:
|
|
103
|
+
use: quietWhileFollowing,
|
|
104
|
+
...followerOptions(tooltip, cursorGroup, chartId),
|
|
105
105
|
portal,
|
|
106
106
|
anchor: "group-center",
|
|
107
107
|
content: (points) => {
|
package/dist/charts/types.d.ts
CHANGED
|
@@ -68,8 +68,9 @@ export type ChartSeries<T> = {
|
|
|
68
68
|
/** A marker at a point (a PR star, a status dot); `null` for none. Always-on markers are `Lines`'
|
|
69
69
|
* alone. On a `CartesianChart` with consumer `marks` only the CURSOR dot of a `cursorValue`
|
|
70
70
|
* series reads `getMarker` (its `color`): without `cursorValue` it is ignored there, so draw a
|
|
71
|
-
* persistent dot in `marks` yourself. Each distinct color is one extra mark:
|
|
72
|
-
* categorical set (statuses, buckets), never a continuous scale.
|
|
71
|
+
* persistent dot in `marks` yourself. Each distinct color of an always-on marker is one extra mark:
|
|
72
|
+
* keep those a small categorical set (statuses, buckets), never a continuous scale. Only the
|
|
73
|
+
* `cursorValue` cursor dot is ONE mark whatever its colors. */
|
|
73
74
|
getMarker?: ((d: T) => {
|
|
74
75
|
color?: string | undefined;
|
|
75
76
|
r?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/charts/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;8CAC8C;AAC9C,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AAE3C;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb;oGACgG;IAChG,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;IACjC,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;IAC1C,+FAA+F;IAC/F,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA;IACrC;4FACwF;IACxF,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,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C,GAAG,KAAK,GAAG,SAAS,CAAA;CACvD,CAAA;AAED;mBACmB;AACnB,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,CAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EA0CV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAe,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAGpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AASvD;;;;;GAKG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAIvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAMvD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAenE,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,iBAAiB;QACzB,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,WAAW,CAAC,EAAE,iBAAiB,CAAA;QAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,aAAa,CAAC,EAAE,WAAW,CAAA;KAC5B;CACF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EA0CV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAe,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAA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AiB,CAAA;IAE1B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAC7B,CAAA;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,EACrD,OAAO,CAAC,EAAE,wBAAwB,GACjC,oBAAoB,CAiCtB"}
|
package/dist/theme/index.js
CHANGED
|
@@ -693,7 +693,10 @@ function buildTheme(data, options = {}) {
|
|
|
693
693
|
// behind it. Title = head font; close button = the ghost idiom (floating.module.css). Below the
|
|
694
694
|
// `medium` size class the Modal is a bottom sheet (floating.module.css `sheet*`).
|
|
695
695
|
Modal: ext({
|
|
696
|
-
defaultProps: {
|
|
696
|
+
defaultProps: {
|
|
697
|
+
radius: radius.floating,
|
|
698
|
+
closeButtonProps: { ...HIT_ATTR, "aria-label": "Close" }
|
|
699
|
+
},
|
|
697
700
|
classNames: {
|
|
698
701
|
close: floatingClasses.closeButton,
|
|
699
702
|
inner: floatingClasses.sheetInner,
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v2.13.
|
|
1
|
+
# basalt-ui v2.13.2
|
|
2
2
|
# Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets
|
|
3
3
|
#
|
|
4
4
|
# Entry points: use the exact import specifier below; do not guess.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# A subpath's `Install:` line is its required peers; `OptionalPeers:` are import()-only, install on use.
|
|
14
14
|
|
|
15
15
|
Package: basalt-ui
|
|
16
|
-
Version: 2.13.
|
|
16
|
+
Version: 2.13.2
|
|
17
17
|
|
|
18
18
|
## basalt-ui
|
|
19
19
|
Import: import { ... } from 'basalt-ui'
|
package/package.json
CHANGED
package/src/charts/compile.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `compileCartesian` — basalt's chart spec in, a TanStack definition out (`docs/V2-SPEC.md` § 9.2).
|
|
3
3
|
* Pure and React-free: the host memoizes it, the tests call it directly. It owns the scales and
|
|
4
|
-
* domains, the theme bridge, zones / x-zones / reference lines, the crosshair,
|
|
5
|
-
*
|
|
4
|
+
* domains, the theme bridge, zones / x-zones / reference lines, the crosshair, the shared cursor
|
|
5
|
+
* binding, the tooltip content, and the container-class guide ladder.
|
|
6
6
|
* TanStack owns margins (measured), layout, focus and keyboard, the tooltip surface and SSR.
|
|
7
7
|
*/
|
|
8
8
|
import { crosshair } from '@tanstack/charts/crosshair'
|
|
@@ -11,7 +11,6 @@ import { rect } from '@tanstack/charts/rect'
|
|
|
11
11
|
import { ruleX, ruleY } from '@tanstack/charts/rule'
|
|
12
12
|
import { scaleLinear } from '@tanstack/charts/scales/linear'
|
|
13
13
|
import { scaleUtc } from 'd3-scale'
|
|
14
|
-
import { tooltip as tooltipHost } from '@tanstack/charts/tooltip'
|
|
15
14
|
import { portal } from '@tanstack/charts/tooltip/portal'
|
|
16
15
|
import type {
|
|
17
16
|
ChartBuildContext,
|
|
@@ -27,7 +26,7 @@ import { SHORT_CHART_HEIGHT } from './box'
|
|
|
27
26
|
import { fmtCompact } from '../format/number'
|
|
28
27
|
import { VX } from '../tokens'
|
|
29
28
|
import type { ContainerClass } from '../tokens/size-classes'
|
|
30
|
-
import { cursorBinding,
|
|
29
|
+
import { cursorBinding, followerOptions, quietWhileFollowing } from './cursor'
|
|
31
30
|
import { cursorDots } from './marks'
|
|
32
31
|
import { bucketTicks, strideEvery } from './ticks'
|
|
33
32
|
import { MAIN_PANE, plotAccess, plotContext } from './plot-context'
|
|
@@ -805,7 +804,8 @@ function tooltipSpec<T, X extends ChartX>(opts: {
|
|
|
805
804
|
(s) => s.tooltip !== false,
|
|
806
805
|
)
|
|
807
806
|
return {
|
|
808
|
-
use:
|
|
807
|
+
use: quietWhileFollowing,
|
|
808
|
+
...followerOptions(input.tooltip, input.cursorGroup, input.chartId),
|
|
809
809
|
portal,
|
|
810
810
|
anchor: 'group-center',
|
|
811
811
|
content: (points: readonly ChartPoint[]) => {
|
|
@@ -909,11 +909,9 @@ export function compileCartesian<T, X extends ChartX>(
|
|
|
909
909
|
...(labelsInside(cls, height) && { margin: { left: 0, ...(axes.right && { right: 0 }) } }),
|
|
910
910
|
}
|
|
911
911
|
},
|
|
912
|
-
// Followers
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
? 'group-x'
|
|
916
|
-
: sourceOnlyFocus(input.cursorGroup, input.chartId),
|
|
912
|
+
// Followers resolve the leader's group, so they draw its dots; `quietWhileFollowing` mutes the
|
|
913
|
+
// tooltip unless the chart opts into following tooltips.
|
|
914
|
+
focus: 'group-x',
|
|
917
915
|
maxFocusDistance: Number.POSITIVE_INFINITY,
|
|
918
916
|
cursor: cursorBinding({
|
|
919
917
|
group: input.cursorGroup,
|
package/src/charts/cursor.ts
CHANGED
|
@@ -15,12 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { createChartCursor, cursorHost } from '@tanstack/charts/cursor'
|
|
17
17
|
import type { ChartCursorController } from '@tanstack/charts/cursor'
|
|
18
|
-
import {
|
|
19
|
-
import type {
|
|
20
|
-
|
|
21
|
-
ChartFocusStrategy,
|
|
22
|
-
ChartValue,
|
|
23
|
-
} from '@tanstack/charts/types/core'
|
|
18
|
+
import { tooltip } from '@tanstack/charts/tooltip'
|
|
19
|
+
import type { ChartTooltipExtension } from '@tanstack/charts/tooltip'
|
|
20
|
+
import type { ChartCursorBinding, ChartValue } from '@tanstack/charts/types/core'
|
|
24
21
|
import type { ChartX, CursorResolution } from './types'
|
|
25
22
|
|
|
26
23
|
type CursorState = ReturnType<ChartCursorController['getState']>
|
|
@@ -244,20 +241,73 @@ export function chartCursorView(
|
|
|
244
241
|
}
|
|
245
242
|
|
|
246
243
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* focus strategy. Wrapping `group-x` so it groups nothing while a FOREIGN state is current leaves a
|
|
250
|
-
* follower with the crosshair (painted from the cursor presentation, not from focus) and nothing
|
|
251
|
-
* else.
|
|
244
|
+
* The extra key a chart puts on its tooltip options to name itself to {@link quietWhileFollowing}.
|
|
245
|
+
* Absent, the tooltip paints for followers too.
|
|
252
246
|
*/
|
|
253
|
-
export
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
247
|
+
export type TooltipFollowerOptions = {
|
|
248
|
+
readonly follower?: { readonly group: string | undefined; readonly chartId: string } | undefined
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const isFollowerOptions = (options: unknown): options is TooltipFollowerOptions => {
|
|
252
|
+
if (typeof options !== 'object' || options === null || !('follower' in options)) return false
|
|
253
|
+
const { follower } = options
|
|
254
|
+
return (
|
|
255
|
+
follower === undefined ||
|
|
256
|
+
(typeof follower === 'object' &&
|
|
257
|
+
follower !== null &&
|
|
258
|
+
'group' in follower &&
|
|
259
|
+
'chartId' in follower &&
|
|
260
|
+
typeof follower.chartId === 'string')
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The tooltip options a chart spreads next to `use: quietWhileFollowing`: its identity, unless the
|
|
266
|
+
* chart opted into following tooltips (`tooltip.onFollow`). The one place `onFollow` is read for
|
|
267
|
+
* this, shared by `compileCartesian` and the panel rung.
|
|
268
|
+
*/
|
|
269
|
+
export function followerOptions(
|
|
270
|
+
tooltip: { onFollow?: boolean | undefined } | false | null | undefined,
|
|
271
|
+
group: string | undefined,
|
|
272
|
+
chartId: string,
|
|
273
|
+
): TooltipFollowerOptions {
|
|
274
|
+
const onFollow = typeof tooltip === 'object' && tooltip !== null && tooltip.onFollow === true
|
|
275
|
+
return onFollow ? {} : ({ follower: { group, chartId } } satisfies TooltipFollowerOptions)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* The engine's DOM tooltip host, silent while this chart FOLLOWS another's cursor. A follower
|
|
280
|
+
* resolves the leader's focus group (so the engine draws the same dots at the shared x); the host
|
|
281
|
+
* would then paint a tooltip and fill its `role="status"` live region. Whenever `isForeign` holds,
|
|
282
|
+
* this wrapper calls the host's `hide()` instead of `paint()`: a follower that has never led never
|
|
283
|
+
* creates the element, and one that has led keeps it in the DOM, hidden. Otherwise (leader, no
|
|
284
|
+
* `follower` option, or after the leader clears) it defers to the host.
|
|
285
|
+
*
|
|
286
|
+
* The chart's identity arrives only through `update` (the engine calls it before every `paint`);
|
|
287
|
+
* a `paint` before the first `update` has nothing to tell it who is leading, so it hides.
|
|
288
|
+
*
|
|
289
|
+
* It wraps `create`/`update`/`paint` of the engine's tooltip host, whose lifecycle is undocumented:
|
|
290
|
+
* re-check this wrapper, the live region included, on every `@tanstack/charts` upgrade.
|
|
291
|
+
*/
|
|
292
|
+
export const quietWhileFollowing: ChartTooltipExtension = {
|
|
293
|
+
...tooltip,
|
|
294
|
+
create: (context) => {
|
|
295
|
+
const host = tooltip.create(context)
|
|
296
|
+
let configured = false
|
|
297
|
+
let follower: TooltipFollowerOptions['follower']
|
|
298
|
+
return {
|
|
299
|
+
...host,
|
|
300
|
+
update: (options) => {
|
|
301
|
+
configured = true
|
|
302
|
+
follower = isFollowerOptions(options) ? options.follower : undefined
|
|
303
|
+
host.update(options)
|
|
304
|
+
},
|
|
305
|
+
paint: (paint) => {
|
|
306
|
+
if (!configured || (follower && isForeign(follower.group, follower.chartId))) host.hide()
|
|
307
|
+
else host.paint(paint)
|
|
308
|
+
},
|
|
309
|
+
}
|
|
310
|
+
},
|
|
261
311
|
}
|
|
262
312
|
|
|
263
313
|
export function cursorBinding(opts: {
|
package/src/charts/legend.tsx
CHANGED
|
@@ -11,9 +11,10 @@ import type { ChartSeries } from './types'
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* `auto` renders both swatches and lets the container decide: none, dots or chips (CSS). The
|
|
14
|
-
* swatch SHAPE follows the mode, signed split included: below 480px a dot (8px
|
|
15
|
-
* a chip (10px square) — so one `DualPanel` bar legend is a split circle on a
|
|
16
|
-
* split square on a wide one.
|
|
14
|
+
* swatch SHAPE follows the mode for a filled mark, signed split included: below 480px a dot (8px
|
|
15
|
+
* circle), from 480px a chip (10px square) — so one `DualPanel` bar legend is a split circle on a
|
|
16
|
+
* narrow card and a split square on a wide one. A LINE series swaps a short stroke for a shorter
|
|
17
|
+
* one instead, dash included, so it is never a dot. Not a per-chart prop.
|
|
17
18
|
*/
|
|
18
19
|
export type LegendMode = 'dots' | 'chips' | 'auto'
|
|
19
20
|
|
|
@@ -105,6 +106,41 @@ type SwatchStyle = Pick<
|
|
|
105
106
|
const swatchFill = (s: SwatchStyle): string =>
|
|
106
107
|
s.colorNegative ? `linear-gradient(90deg, ${s.color} 50%, ${s.colorNegative} 50%)` : s.color
|
|
107
108
|
|
|
109
|
+
/**
|
|
110
|
+
* A line series' key: a short stroke with its dash, compact below 480px and wide from 480px. A
|
|
111
|
+
* dashed swatch has BUTT caps: a round cap grows each dash by half the stroke width per end and
|
|
112
|
+
* would close the gap.
|
|
113
|
+
*/
|
|
114
|
+
export const LINE_SWATCH = {
|
|
115
|
+
compact: { width: 8, dash: '2.5 2' },
|
|
116
|
+
wide: { width: 12, dash: '4 3' },
|
|
117
|
+
} as const
|
|
118
|
+
|
|
119
|
+
function LineSwatch({ s, compact }: { s: SwatchStyle; compact: boolean }): ReactElement {
|
|
120
|
+
const { width, dash } = compact ? LINE_SWATCH.compact : LINE_SWATCH.wide
|
|
121
|
+
return (
|
|
122
|
+
<svg
|
|
123
|
+
aria-hidden
|
|
124
|
+
className={compact ? classes.dot : classes.chip}
|
|
125
|
+
width={width}
|
|
126
|
+
height={8}
|
|
127
|
+
style={{ flex: 'none' }}
|
|
128
|
+
>
|
|
129
|
+
<line
|
|
130
|
+
x1={1}
|
|
131
|
+
x2={width - 1}
|
|
132
|
+
y1={4}
|
|
133
|
+
y2={4}
|
|
134
|
+
stroke={s.color}
|
|
135
|
+
strokeWidth={2}
|
|
136
|
+
strokeLinecap={s.dash === 'dashed' ? 'butt' : 'round'}
|
|
137
|
+
strokeOpacity={s.strokeOpacity ?? 1}
|
|
138
|
+
{...(s.dash === 'dashed' && { strokeDasharray: dash })}
|
|
139
|
+
/>
|
|
140
|
+
</svg>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
108
144
|
function Swatch({ s, mode }: { s: SwatchStyle; mode: LegendMode }): ReactElement {
|
|
109
145
|
if (mode === 'auto')
|
|
110
146
|
return (
|
|
@@ -113,6 +149,7 @@ function Swatch({ s, mode }: { s: SwatchStyle; mode: LegendMode }): ReactElement
|
|
|
113
149
|
<Swatch s={s} mode="chips" />
|
|
114
150
|
</>
|
|
115
151
|
)
|
|
152
|
+
if ((s.mark ?? 'line') === 'line') return <LineSwatch s={s} compact={mode === 'dots'} />
|
|
116
153
|
if (mode === 'dots')
|
|
117
154
|
return (
|
|
118
155
|
<span
|
|
@@ -129,22 +166,6 @@ function Swatch({ s, mode }: { s: SwatchStyle; mode: LegendMode }): ReactElement
|
|
|
129
166
|
}}
|
|
130
167
|
/>
|
|
131
168
|
)
|
|
132
|
-
if ((s.mark ?? 'line') === 'line')
|
|
133
|
-
return (
|
|
134
|
-
<svg aria-hidden className={classes.chip} width={16} height={8} style={{ flex: 'none' }}>
|
|
135
|
-
<line
|
|
136
|
-
x1={1}
|
|
137
|
-
x2={15}
|
|
138
|
-
y1={4}
|
|
139
|
-
y2={4}
|
|
140
|
-
stroke={s.color}
|
|
141
|
-
strokeWidth={2}
|
|
142
|
-
strokeLinecap="round"
|
|
143
|
-
strokeOpacity={s.strokeOpacity ?? 1}
|
|
144
|
-
{...(s.dash === 'dashed' && { strokeDasharray: '4 3' })}
|
|
145
|
-
/>
|
|
146
|
-
</svg>
|
|
147
|
-
)
|
|
148
169
|
return (
|
|
149
170
|
<span
|
|
150
171
|
aria-hidden
|
package/src/charts/marks.ts
CHANGED
|
@@ -156,38 +156,37 @@ export function cursorDots<T, X extends ChartX>(
|
|
|
156
156
|
rows: readonly PlotRow<T, X>[],
|
|
157
157
|
yScale: 'y2' | undefined,
|
|
158
158
|
): ChartMarks {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
const { getMarker } = s
|
|
160
|
+
// `dot.fill` is constant but a state style's is not: one mark whose focused fill is the datum's
|
|
161
|
+
// own `getMarker` colour, resolved once per row here rather than on every focus repaint. The map
|
|
162
|
+
// is keyed by the row OBJECT: the engine hands the same objects back as the state context's datum.
|
|
163
|
+
const colors = getMarker
|
|
164
|
+
? new Map(rows.map((r) => [r, getMarker(r.datum)?.color ?? s.color]))
|
|
165
|
+
: undefined
|
|
166
|
+
const focused = {
|
|
167
|
+
fillOpacity: 1,
|
|
168
|
+
strokeOpacity: 1,
|
|
169
|
+
...(colors && {
|
|
170
|
+
fill: ({ datum }: { datum: PlotRow<T, X> }): string => colors.get(datum) ?? s.color,
|
|
171
|
+
}),
|
|
166
172
|
}
|
|
167
|
-
return [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
states: [{ when: { focus: 'x' }, style: { fillOpacity: 1, strokeOpacity: 1 } }],
|
|
183
|
-
...(yScale !== undefined && { yScale }),
|
|
184
|
-
}),
|
|
185
|
-
],
|
|
186
|
-
)
|
|
173
|
+
return [
|
|
174
|
+
dot(rows, {
|
|
175
|
+
id: `${s.key}-cursor`,
|
|
176
|
+
x: rowX,
|
|
177
|
+
y: 'y',
|
|
178
|
+
r: VX.dotR,
|
|
179
|
+
fill: s.color,
|
|
180
|
+
fillOpacity: 0,
|
|
181
|
+
stroke: VX.surface.panel,
|
|
182
|
+
strokeWidth: 1.5,
|
|
183
|
+
strokeOpacity: 0,
|
|
184
|
+
states: [{ when: { focus: 'x' }, style: focused }],
|
|
185
|
+
...(yScale !== undefined && { yScale }),
|
|
186
|
+
}),
|
|
187
|
+
]
|
|
187
188
|
}
|
|
188
189
|
|
|
189
|
-
const colorSlug = (color: string): string => color.replaceAll(/[^\w-]+/g, '_')
|
|
190
|
-
|
|
191
190
|
/**
|
|
192
191
|
* A single-series `barY`. The engine stacks every `barY` that has no explicit extent, and a row with
|
|
193
192
|
* no `z`/`color` channel is its own series: an N-by-N matrix (a 5k-row `DualPanel` took 10 s). So
|
package/src/charts/panel.tsx
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* `state`, cursor binding, tooltip surface, guides — is the rung's or lives here once.
|
|
7
7
|
*/
|
|
8
8
|
import { crosshair } from '@tanstack/charts/crosshair'
|
|
9
|
-
import { tooltip as tooltipHost } from '@tanstack/charts/tooltip'
|
|
10
9
|
import { portal } from '@tanstack/charts/tooltip/portal'
|
|
11
10
|
import type {
|
|
12
11
|
ChartBuildContext,
|
|
@@ -23,7 +22,7 @@ import { ChartShell } from './CartesianChart'
|
|
|
23
22
|
import type { ChartShellProps, ShellContext } from './CartesianChart'
|
|
24
23
|
import { defaultFormatX, engineRow, utcHeaderDate, visibleSeries, xGuide, yGuide } from './compile'
|
|
25
24
|
import type { CartesianDefinition } from './compile'
|
|
26
|
-
import { cursorBinding,
|
|
25
|
+
import { cursorBinding, followerOptions, quietWhileFollowing } from './cursor'
|
|
27
26
|
import { plotAccess } from './plot-context'
|
|
28
27
|
import type { PlotAccess } from './plot-context'
|
|
29
28
|
import type { XScaleModel } from './scales'
|
|
@@ -210,7 +209,7 @@ function panelDefinition<T, X extends ChartX>(
|
|
|
210
209
|
}
|
|
211
210
|
const definition: CartesianDefinition = {
|
|
212
211
|
chart: () => composed,
|
|
213
|
-
focus:
|
|
212
|
+
focus: 'group-x',
|
|
214
213
|
maxFocusDistance: Number.POSITIVE_INFINITY,
|
|
215
214
|
cursor: cursorBinding({
|
|
216
215
|
group: cursorGroup,
|
|
@@ -223,7 +222,8 @@ function panelDefinition<T, X extends ChartX>(
|
|
|
223
222
|
props.tooltip === false
|
|
224
223
|
? false
|
|
225
224
|
: {
|
|
226
|
-
use:
|
|
225
|
+
use: quietWhileFollowing,
|
|
226
|
+
...followerOptions(tooltip, cursorGroup, chartId),
|
|
227
227
|
portal,
|
|
228
228
|
anchor: 'group-center',
|
|
229
229
|
content: (points: readonly ChartPoint[]) => {
|
package/src/charts/types.ts
CHANGED
|
@@ -70,8 +70,9 @@ export type ChartSeries<T> = {
|
|
|
70
70
|
/** A marker at a point (a PR star, a status dot); `null` for none. Always-on markers are `Lines`'
|
|
71
71
|
* alone. On a `CartesianChart` with consumer `marks` only the CURSOR dot of a `cursorValue`
|
|
72
72
|
* series reads `getMarker` (its `color`): without `cursorValue` it is ignored there, so draw a
|
|
73
|
-
* persistent dot in `marks` yourself. Each distinct color is one extra mark:
|
|
74
|
-
* categorical set (statuses, buckets), never a continuous scale.
|
|
73
|
+
* persistent dot in `marks` yourself. Each distinct color of an always-on marker is one extra mark:
|
|
74
|
+
* keep those a small categorical set (statuses, buckets), never a continuous scale. Only the
|
|
75
|
+
* `cursorValue` cursor dot is ONE mark whatever its colors. */
|
|
75
76
|
getMarker?:
|
|
76
77
|
| ((d: T) => {
|
|
77
78
|
color?: string | undefined
|
|
@@ -473,6 +473,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
473
473
|
},
|
|
474
474
|
"defaultProps": {
|
|
475
475
|
"closeButtonProps": {
|
|
476
|
+
"aria-label": "Close",
|
|
476
477
|
"data-basalt-hit": true,
|
|
477
478
|
},
|
|
478
479
|
"radius": 8,
|
|
@@ -1565,6 +1566,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1565
1566
|
},
|
|
1566
1567
|
"defaultProps": {
|
|
1567
1568
|
"closeButtonProps": {
|
|
1569
|
+
"aria-label": "Close",
|
|
1568
1570
|
"data-basalt-hit": true,
|
|
1569
1571
|
},
|
|
1570
1572
|
"radius": 11,
|
package/src/theme/index.ts
CHANGED
|
@@ -1018,7 +1018,10 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
1018
1018
|
// behind it. Title = head font; close button = the ghost idiom (floating.module.css). Below the
|
|
1019
1019
|
// `medium` size class the Modal is a bottom sheet (floating.module.css `sheet*`).
|
|
1020
1020
|
Modal: ext<typeof Modal>({
|
|
1021
|
-
defaultProps: {
|
|
1021
|
+
defaultProps: {
|
|
1022
|
+
radius: radius.floating,
|
|
1023
|
+
closeButtonProps: { ...HIT_ATTR, 'aria-label': 'Close' },
|
|
1024
|
+
},
|
|
1022
1025
|
classNames: {
|
|
1023
1026
|
close: floatingClasses.closeButton,
|
|
1024
1027
|
inner: floatingClasses.sheetInner,
|