@umriss-ui/charts 0.41.1 → 0.42.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 CHANGED
@@ -4,11 +4,12 @@ This document describes what changes for **callers** of the package: exports,
4
4
  props, behaviour.
5
5
 
6
6
  **The numbers.** The middle digit rises when something is added; the last one
7
- when something is repaired. As long as the first digit is `0`, no number
8
- promises compatibility — which is why a rule stronger than the figure applies as
9
- well: **whatever changes existing behaviour stands under a heading "Changed" of
10
- its own**, no matter which digit rose. Whoever reads only one section before an
11
- upgrade reads that one.
7
+ when something is repaired. The six packages are released in step, and a rename
8
+ keeps its old name for one further minor, with a warning, before the minor after
9
+ it removes the name ([the upgrade promise, ADR-0066](../../docs/adr/0066-one-number-peers-over-the-minor-a-rename-lives-one-minor.md)).
10
+ **Whatever changes existing behaviour stands under a heading "Changed" of its
11
+ own**, no matter which digit rose, with a `Migration:` line. Whoever reads only
12
+ one section before an upgrade reads that one.
12
13
 
13
14
  From 0.34.0 the packages share one number - five, and six from 0.40.0, when the dashboard joined: they are released together, and a package without a change of its own still gets a heading for it.
14
15
 
@@ -29,12 +30,22 @@ interface was still expected to move before `0.3.0`.
29
30
 
30
31
  ---
31
32
 
33
+ ## 0.42.0 – A chart under test in jsdom (Oct. 2026)
34
+
35
+ ### Added
36
+
37
+ - **A chart is testable in jsdom.** The new "Testing" section gives the Vitest and Jest lines in full - a charts-only application installs no core - with a setup file whose ResizeObserver reports a fixed size and whose `getContext` stub keeps jsdom quiet; `.` and `./wording/de` carry a `default` condition for Jest's resolver. The release check runs a test of a legend and the data table from those blocks under both runners.
38
+ - **The README names `--u-chart-1` to `--u-chart-6`** as the palette a brand changes, beside core's brand file.
39
+ - **TypeScript 5.4 or newer**, stated in the Install section (the declarations use `NoInfer`); the release check compiles a strict consumer under 5.4 as well as the current TypeScript.
40
+
32
41
  ## 0.41.1 – The documentation runs where the code is (Oct. 2026)
33
42
 
34
43
  ### Changed
35
44
 
36
45
  - **The documentation is no longer hosted.** The site on GitHub Pages is gone, and the package's `homepage` now names its README on GitHub. The running documentation of this version opens from a checkout of the tag `charts-v0.41.1` with `pnpm install` and `pnpm start`, at `http://localhost:4170/umriss-ui/` - the repository README says how, under "See it running".
46
+ - Migration: nothing to change; a bookmark or link to the old hosted site no longer resolves - open the documentation from a checkout of the tag, as described above.
37
47
  - **`docs/llms-full.md` in the package stands on its own:** a link to another page points at that page's heading in the same file, a link to a place on the site that the file does not hold keeps only its text, and ADR-0032 is linked at this version's tag.
48
+ - Migration: nothing to change; look at any tool that read `docs/llms-full.md` and followed its links to the site, which now find the heading in the same file.
38
49
 
39
50
  ## 0.41.0 – Limits read as values, and Jest loads the charts (Oct. 2026)
40
51
 
package/README.md CHANGED
@@ -16,7 +16,7 @@ lint rule over `packages/charts/src/**` holds that fast.
16
16
  pnpm add @umriss-ui/charts
17
17
  ```
18
18
 
19
- React 19 or newer as a peer, and nothing else. `@umriss-ui/core` is **not** a
19
+ React 19 or newer as a peer, and nothing else. TypeScript 5.4 or newer (the declarations use `NoInfer`). `@umriss-ui/core` is **not** a
20
20
  dependency and not a peer dependency — if an application uses both packages, it
21
21
  does so because it chose to, not because this one required it (ADR-0020).
22
22
 
@@ -24,8 +24,11 @@ The package ships ES2022 syntax; an application that serves older browsers
24
24
  transpiles it itself.
25
25
 
26
26
  Every entry, `./wording/de` included, begins with `"use client"`, the directive a framework
27
- with Server Components reads to treat a module as client code. No test runs
28
- inside such a framework: the charts are rendered to a string in a test.
27
+ with Server Components reads to treat a module as client code. A chart is declared by its hook,
28
+ `useChart`, so the declaration lives in a Client Component file: a Server Component renders that
29
+ file and hands it the rows. On a server a chart gives its labelled frame and an empty canvas; the
30
+ drawing arrives after mount. No test runs inside such a framework: the charts are rendered to a
31
+ string in a test.
29
32
 
30
33
  ## The smallest chart that runs
31
34
 
@@ -98,7 +101,8 @@ wins. `@umriss-ui/charts/styles.css` stays exported for setups that link
98
101
  stylesheets by hand.
99
102
 
100
103
  **Colours** come from `--uc-*` variables that fall back to the tokens of
101
- `@umriss-ui/core` where they exist and to literals where they do not. **Light and
104
+ `@umriss-ui/core` where they exist and to literals where they do not. The palette is `--u-chart-1` to
105
+ `--u-chart-6`; core's README holds a brand file that sets them, light and dark. **Light and
102
106
  dark** follow the application's `color-scheme`: the canvas colours are resolved
103
107
  anew when the root element's attributes or the system preference change;
104
108
  `invalidateTheme()` covers a switch made on another ancestor. **Fonts** are not
@@ -164,6 +168,80 @@ next kind to come (ADR-0059).
164
168
  * [`../../docs/design-language.md`](../../docs/design-language.md) — the design
165
169
  language all five packages share.
166
170
 
171
+ ## Testing
172
+
173
+ Tested: Vitest 5 and Jest 30 (with babel-jest), both on jsdom. happy-dom and Jest 29 may work and are
174
+ not promised. `check:dist` runs a test of the installed package in a Vitest project and a Jest project
175
+ that hold exactly the files below. A chart-only application installs no core, so the lines are given in
176
+ full here.
177
+
178
+ **Vitest** needs one line, `server.deps.inline`: Vitest hands a dependency to Node, and Node cannot
179
+ import the stylesheet that the package's JavaScript imports (`Unknown file extension ".css"`). Inlined,
180
+ Vitest's own pipeline handles it.
181
+
182
+ ```ts vitest.config.ts
183
+ import { defineConfig } from "vitest/config";
184
+
185
+ export default defineConfig({
186
+ test: {
187
+ environment: "jsdom",
188
+ globals: true,
189
+ setupFiles: ["./umriss.setup.js"],
190
+ server: { deps: { inline: [/@umriss-ui/] } },
191
+ },
192
+ });
193
+ ```
194
+
195
+ **Jest** needs two settings: `moduleNameMapper` maps every stylesheet to an empty module, and
196
+ `transformIgnorePatterns` lets babel-jest compile the package, which ships ES modules. Babel's config
197
+ must apply to `node_modules`, so it is a root `babel.config.*`, not a `.babelrc`.
198
+
199
+ ```js jest.config.cjs
200
+ module.exports = {
201
+ testEnvironment: "jsdom",
202
+ setupFilesAfterEnv: ["<rootDir>/umriss.setup.js"],
203
+ moduleNameMapper: { "\\.css$": "<rootDir>/css-stub.cjs" },
204
+ transformIgnorePatterns: ["/node_modules/(?!(@umriss-ui)/)"],
205
+ };
206
+ ```
207
+
208
+ ```js css-stub.cjs
209
+ module.exports = {};
210
+ ```
211
+
212
+ ```js babel.config.cjs
213
+ module.exports = {
214
+ presets: [
215
+ ["@babel/preset-env", { targets: { node: "current" } }],
216
+ ["@babel/preset-react", { runtime: "automatic" }],
217
+ ],
218
+ };
219
+ ```
220
+
221
+ **Next.js** with `next/jest`: put the umriss packages in `transpilePackages`; the preset stubs the
222
+ stylesheets and compiles the packages itself.
223
+
224
+ **The setup file** gives jsdom what a chart needs to lay out. jsdom measures nothing, so the
225
+ `ResizeObserver` reports a fixed size (600 x 280) for whatever it observes; without a size the chart
226
+ stays empty, and neither the legend nor "Show data" appears. jsdom has no canvas, so `getContext`
227
+ returns `null`, which a chart copes with. The file is the same for both runners:
228
+
229
+ ```js umriss.setup.js
230
+ globalThis.ResizeObserver = class {
231
+ constructor(callback) {
232
+ this.callback = callback;
233
+ }
234
+ observe(target) {
235
+ const box = { inlineSize: 600, blockSize: 280 };
236
+ this.callback([{ target, contentRect: { width: 600, height: 280 }, contentBoxSize: [box] }], this);
237
+ }
238
+ unobserve() {}
239
+ disconnect() {}
240
+ };
241
+
242
+ HTMLCanvasElement.prototype.getContext = () => null;
243
+ ```
244
+
167
245
  ## Licence
168
246
 
169
247
  MIT — see [`LICENSE`](LICENSE).
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/charts 0.41.1
1
+ # @umriss-ui/charts 0.42.0
2
2
 
3
3
  > React canvas chart library for data-dense dashboards - line, area, bar, box plot, scatter, control and Pareto charts. Few chart kinds, drawn well, fast.
4
4
 
@@ -2267,9 +2267,9 @@ Measurements of the instrumentation for the benchmark page.
2267
2267
  #### Known limits
2268
2268
 
2269
2269
  - No error state of its own: where the rows could not be loaded, show an `Alert` from @umriss-ui/core. Waiting for them is `loading`.
2270
- - No pie, donut, radar or candlestick, no smoothing, animation or export, no WebGL ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md)).
2270
+ - No pie, donut, radar or candlestick, no smoothing, animation or export, no WebGL ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md)).
2271
2271
 
2272
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
2272
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md).
2273
2273
 
2274
2274
  ### Axis
2275
2275
 
@@ -3024,10 +3024,10 @@ schedule's shape.
3024
3024
 
3025
3025
  #### Known limits
3026
3026
 
3027
- - No logarithmic and no band scale: compute the logarithm in `value`; a category is a place on the linear scale ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md), [ADR-0052](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0052-a-chart-reads-its-rows-as-they-come.md)).
3027
+ - No logarithmic and no band scale: compute the logarithm in `value`; a category is a place on the linear scale ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md), [ADR-0052](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0052-a-chart-reads-its-rows-as-they-come.md)).
3028
3028
  - umriss shows the reader's time ([ADR-0060](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0060-validation-and-a-layout-editor-are-never-time-zones-not-yet.md)).
3029
3029
 
3030
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
3030
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md).
3031
3031
 
3032
3032
  ### Zoom and pan
3033
3033
 
@@ -3697,7 +3697,7 @@ The optional numbers of a box by name.
3697
3697
 
3698
3698
  - No zoom along y, no rectangle zoom and no navigator: the x span is the one zoom there is.
3699
3699
 
3700
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
3700
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md).
3701
3701
 
3702
3702
  ### View
3703
3703
 
@@ -3966,7 +3966,7 @@ The optional numbers of a box by name.
3966
3966
 
3967
3967
  - The active point and the open data table are not part of the view: they are where the reader is, not how the chart is looked at.
3968
3968
 
3969
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
3969
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md).
3970
3970
 
3971
3971
  ## Series
3972
3972
 
@@ -4482,9 +4482,9 @@ type ValueFunction<T> = (d: T, index: number) => number | null | undefined;
4482
4482
 
4483
4483
  #### Known limits
4484
4484
 
4485
- - No smoothing: a curve between two readings would invent values nobody measured ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md)).
4485
+ - No smoothing: a curve between two readings would invent values nobody measured ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md)).
4486
4486
 
4487
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
4487
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md).
4488
4488
 
4489
4489
  ### Area
4490
4490
 
@@ -5229,7 +5229,7 @@ type ValueFunction<T> = (d: T, index: number) => number | null | undefined;
5229
5229
 
5230
5230
  - Horizontal bars are the next kind to come ([ADR-0059](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0059-the-set-of-chart-kinds-is-open.md)); until then a `Matrix` or a `Table` ranks by name.
5231
5231
 
5232
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
5232
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md).
5233
5233
 
5234
5234
  ### Scatter
5235
5235
 
@@ -6100,7 +6100,7 @@ type ListFunction<T> = (d: T, index: number) => readonly number[] | null | undef
6100
6100
 
6101
6101
  - No horizontal boxes, no violin or jittered points, no box width by count: a density is smoothing, a jitter a picture that does not repeat.
6102
6102
 
6103
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.41.1/docs/adr/0032-what-umriss-is-not.md).
6103
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/charts-v0.42.0/docs/adr/0032-what-umriss-is-not.md).
6104
6104
 
6105
6105
  ### StateBand
6106
6106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/charts",
3
- "version": "0.41.1",
3
+ "version": "0.42.0",
4
4
  "description": "React canvas chart library for data-dense dashboards - line, area, bar, box plot, scatter, control and Pareto charts. Few chart kinds, drawn well, fast.",
5
5
  "license": "MIT",
6
6
  "author": "Roman Händler",
@@ -56,11 +56,13 @@
56
56
  "exports": {
57
57
  ".": {
58
58
  "types": "./dist/index.d.ts",
59
- "import": "./dist/charts.js"
59
+ "import": "./dist/charts.js",
60
+ "default": "./dist/charts.js"
60
61
  },
61
62
  "./wording/de": {
62
63
  "types": "./dist/de.d.ts",
63
- "import": "./dist/wording/de.js"
64
+ "import": "./dist/wording/de.js",
65
+ "default": "./dist/wording/de.js"
64
66
  },
65
67
  "./styles.css": {
66
68
  "types": "./dist/styles.d.ts",
@@ -84,7 +86,7 @@
84
86
  "vite": "^6.0.0",
85
87
  "vite-plugin-dts": "^4.3.0",
86
88
  "@umriss-ui/demo": "0.0.0",
87
- "@umriss-ui/core": "0.41.1"
89
+ "@umriss-ui/core": "0.42.0"
88
90
  },
89
91
  "scripts": {
90
92
  "props": "node --disable-warning=ExperimentalWarning --experimental-strip-types demo/props.ts",