@automattic/charts 1.12.0 → 2.0.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 +14 -0
- package/TOKENS.md +8 -1
- package/dist/index.cjs +4038 -5207
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +15 -18
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +113 -1281
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/charts/area-chart/area-chart.tsx +3 -2
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +7 -7
- package/src/charts/line-chart/line-chart.module.scss +3 -3
- package/src/charts/line-chart/line-chart.tsx +3 -2
- package/src/charts/line-chart/test/line-chart.test.tsx +44 -4
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +1 -1
- package/src/charts/private/test/time-axis.test.ts +182 -0
- package/src/charts/private/time-axis.ts +84 -5
- package/src/charts/private/x-zoom/test/x-zoom.test.tsx +52 -7
- package/src/charts/private/x-zoom/x-zoom.module.scss +7 -15
- package/src/charts/private/x-zoom/x-zoom.tsx +29 -40
- package/src/components/legend/private/base-legend.module.scss +1 -1
- package/src/components/tooltip/base-tooltip.module.scss +1 -1
- package/src/components/trend-indicator/trend-indicator.module.scss +1 -1
- package/src/index.ts +1 -0
- package/src/types.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.0] - 2026-08-10
|
|
9
|
+
### Added
|
|
10
|
+
- Time axis: Accept a tickResolution hint on the x-axis options so callers that know the data's bucket size can set tick formats directly instead of relying on inference. [#51017]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Time axis: Pick tick formats by bucket resolution as well as span — hour ticks (with the date at midnight boundaries) for sub-daily series spanning up to a week, and month ticks (with the year at January) instead of full dates for month-or-coarser buckets. [#51010]
|
|
14
|
+
- Update package dependencies. [#50509]
|
|
15
|
+
- Zoom: Expose the reset button's shadow as `--a8c-charts-elevation-xs`, replacing the `--wpds-elevation-xs` token removed in `@wordpress/theme` 1.0.0. [#50509]
|
|
16
|
+
- Zoom: Restore the accessible tooltip on the reset control. `@wordpress/ui` is no longer bundled into the package output, so each consumer's bundler now resolves it. It remains a dependency and resolves from node_modules by default, but a bundler that externalizes `@wordpress/*` to `window.wp.*` must bundle `@wordpress/ui` instead — `window.wp.ui` does not exist. [#51016]
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Time axis: Show date ticks rather than hour ticks for a daily-bucket pair spanning exactly one day. [#51013]
|
|
20
|
+
|
|
8
21
|
## [1.12.0] - 2026-08-03
|
|
9
22
|
### Added
|
|
10
23
|
- New `legend.collapseGroups` option folds series that share a `group` into a single legend item, labelled by the group's primary series; with `legend.interactive` that item toggles the whole group in one click. Off by default, so legends keep one item per series unless you opt in. Available on the bar, line and area charts. The line chart gains a `rescaleYOnVisibilityChange` prop (matching the area chart) to pin the value axis to the full data range while series are hidden; and when every series is hidden, the grid and axes are dropped so the empty state stands on its own. The area chart's `rescaleYOnLegendToggle` prop is deprecated in favour of `rescaleYOnVisibilityChange` (still honoured as an alias). [#50194]
|
|
@@ -952,6 +965,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
952
965
|
- Fixed lints following ESLint rule changes for TS [#40584]
|
|
953
966
|
- Fixing a bug in Chart storybook data. [#40640]
|
|
954
967
|
|
|
968
|
+
[2.0.0]: https://github.com/Automattic/charts/compare/v1.12.0...v2.0.0
|
|
955
969
|
[1.12.0]: https://github.com/Automattic/charts/compare/v1.11.0...v1.12.0
|
|
956
970
|
[1.11.0]: https://github.com/Automattic/charts/compare/v1.10.3...v1.11.0
|
|
957
971
|
[1.10.3]: https://github.com/Automattic/charts/compare/v1.10.2...v1.10.3
|
package/TOKENS.md
CHANGED
|
@@ -50,18 +50,25 @@ Instance styling knobs, on the same convention but not shared semantic roles:
|
|
|
50
50
|
`--a8c-charts-dimension-leaderboard-bar-hover-inset`,
|
|
51
51
|
`--a8c-charts-color-heatmap-*`, `--a8c-charts-dimension-heatmap-*`,
|
|
52
52
|
`--a8c-charts-heatmap-cell-intensity`,
|
|
53
|
-
`--a8c-charts-color-zoom-selection`, `--a8c-charts-color-zoom-selection-stroke
|
|
53
|
+
`--a8c-charts-color-zoom-selection`, `--a8c-charts-color-zoom-selection-stroke`,
|
|
54
|
+
`--a8c-charts-elevation-xs`.
|
|
54
55
|
|
|
55
56
|
| Role | Maps to `--wpds-*` | Fallback |
|
|
56
57
|
|---|---|---|
|
|
57
58
|
| `--a8c-charts-color-zoom-selection` | `--wpds-color-background-interactive-brand-strong` | `#3858e9` |
|
|
58
59
|
| `--a8c-charts-color-zoom-selection-stroke` | `--wpds-color-stroke-interactive-brand` | `#3858e9` |
|
|
60
|
+
| `--a8c-charts-elevation-xs` | _(none — `--wpds-elevation-*` removed in theme 1.0.0)_ | `0 1px 1px 0 #00000008, 0 1px 2px 0 #00000005, 0 3px 3px 0 #00000005, 0 4px 4px 0 #00000003` |
|
|
59
61
|
|
|
60
62
|
The zoom selection roles carry the drag-to-zoom rectangle's fill and border. Their
|
|
61
63
|
translucency is not part of the role: it lives in the `fill-opacity` /
|
|
62
64
|
`stroke-opacity` properties, so overriding either role sets an opaque colour and
|
|
63
65
|
keeps the intended transparency.
|
|
64
66
|
|
|
67
|
+
`--a8c-charts-elevation-xs` carries the zoom reset button's shadow. It has no
|
|
68
|
+
`--wpds-*` mapping: `@wordpress/theme` 1.0.0 removed the whole
|
|
69
|
+
`--wpds-elevation-*` group without a replacement, so the fallback holds the value
|
|
70
|
+
`--wpds-elevation-xs` used to resolve to.
|
|
71
|
+
|
|
65
72
|
`--a8c-charts-heatmap-cell-intensity` is the one variable without a `{category}`
|
|
66
73
|
segment: it holds a unitless 0–1 scalar consumed inside `color-mix()`, not a colour.
|
|
67
74
|
|