@chipmobilesdk/rn-chart 0.2.0 → 0.3.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 +164 -115
- package/README.md +391 -381
- package/package.json +49 -49
- package/skills/sdk-rn-chart/SKILL.md +68 -69
- package/src/a11y/summary.ts +190 -177
- package/src/contract/datasource.ts +126 -136
- package/src/contract/errors.ts +129 -133
- package/src/contract/format.ts +168 -168
- package/src/contract/interaction.ts +70 -71
- package/src/contract/marker.ts +75 -75
- package/src/contract/props.ts +64 -60
- package/src/contract/state.ts +88 -94
- package/src/contract/strings.ts +48 -0
- package/src/contract/theme.ts +169 -177
- package/src/contract/value.ts +121 -125
- package/src/geometry/bar.ts +271 -273
- package/src/geometry/distribution.ts +197 -203
- package/src/geometry/heatmap.ts +189 -195
- package/src/geometry/hitTest.ts +117 -120
- package/src/geometry/layout.ts +162 -173
- package/src/geometry/markers.ts +55 -57
- package/src/geometry/path.ts +193 -199
- package/src/geometry/progress.ts +223 -230
- package/src/geometry/scale.ts +140 -146
- package/src/geometry/ticks.ts +145 -153
- package/src/geometry/timeSeries.ts +168 -168
- package/src/geometry/types.ts +94 -94
- package/src/index.ts +162 -176
- package/src/react/ChartBoundary.tsx +96 -96
- package/src/react/ChartFrame.tsx +596 -622
- package/src/react/ChartLegend.tsx +216 -215
- package/src/react/ChartThemeProvider.tsx +44 -48
- package/src/react/charts.tsx +154 -161
- package/src/react/useChartLayout.ts +124 -124
- package/src/react/useChartSelection.ts +152 -170
- package/src/render/Axis.tsx +120 -122
- package/src/render/Marks.tsx +173 -205
- package/src/validation/budgets.ts +113 -110
- package/src/validation/validateDatasource.ts +174 -174
package/CHANGELOG.md
CHANGED
|
@@ -1,115 +1,164 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- **
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- **
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
1
|
+
# @chipmobilesdk/rn-chart
|
|
2
|
+
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- One diagnostic stream: install a sink with `installSdkSink` from
|
|
8
|
+
`@chipmobilesdk/rn-core` and it receives what every package observes (events,
|
|
9
|
+
failures, warnings) as `SdkDiagnostic`s, redacted. Listeners are notified through
|
|
10
|
+
rn-core, so a listener that throws no longer stops the others nor fails the call that
|
|
11
|
+
notified, and its error is reported rather than swallowed. ([#17](https://github.com/operationd8979/chip-mobile-sdk/pull/17))
|
|
12
|
+
|
|
13
|
+
- rn-ads: a banner's auto-refresh is a new cycle, so its `loaded` and `impression`
|
|
14
|
+
events are no longer deduplicated away; the dedupe memory is bounded. A throwing
|
|
15
|
+
status, consent or placement listener is reported as an `internal_error` event.
|
|
16
|
+
- rn-i18n: new `onDiagnostic` config receives every diagnostic (`I18nDiagnostic`,
|
|
17
|
+
with a stable `code`); without it, warnings go to `console.warn` in development
|
|
18
|
+
builds only. The warn-once memory is bounded.
|
|
19
|
+
- rn-chart: now depends on rn-core for its diagnostics.
|
|
20
|
+
- rn-payment: status, entitlement and pending listeners report a throw to the logger
|
|
21
|
+
instead of swallowing it.
|
|
22
|
+
|
|
23
|
+
- Every package's own copy is an rn-core message catalog that an app can translate. ([#17](https://github.com/operationd8979/chip-mobile-sdk/pull/17))
|
|
24
|
+
|
|
25
|
+
- rn-i18n: new `runtimeEntriesFromCatalog(catalog)` registers any SDK catalog in one
|
|
26
|
+
line, converting `{name}` variables to `{{name}}`.
|
|
27
|
+
- rn-ai: new `messageKeyForError(error)` gives the copy for every error code, and
|
|
28
|
+
`aiMessageSet`. The input placeholder default is neutral ("Type a message…"), and
|
|
29
|
+
two keys were added for errors that had none (`ai.error.signIn`, `ai.error.generic`).
|
|
30
|
+
- rn-auth: new `authMessages`, the catalog split into user and developer copy.
|
|
31
|
+
- rn-payment: new `paymentMessages`.
|
|
32
|
+
- rn-chart: summaries, announcements, adjustable-action labels, built-in state text
|
|
33
|
+
and legend hints come from `chartStrings`; pass `strings` to translate them. The
|
|
34
|
+
`accessibility.summaryFormatter` prop, declared before, now replaces the summary.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies ([#17](https://github.com/operationd8979/chip-mobile-sdk/pull/17), [#17](https://github.com/operationd8979/chip-mobile-sdk/pull/17), [#17](https://github.com/operationd8979/chip-mobile-sdk/pull/17)):
|
|
39
|
+
- @chipmobilesdk/rn-core@0.1.0
|
|
40
|
+
|
|
41
|
+
## 0.2.1
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Packaging only; no code change. The package no longer declares `engines.node`: a
|
|
46
|
+
React Native package does not run on Node, so the field only produced install
|
|
47
|
+
warnings in apps on another Node version. rn-i18n's command-line tooling does run
|
|
48
|
+
on Node; its README's compatibility table states the version it needs. ([#14](https://github.com/operationd8979/chip-mobile-sdk/pull/14))
|
|
49
|
+
|
|
50
|
+
## [0.2.0] - 2026-11-01
|
|
51
|
+
|
|
52
|
+
Three drawing defects on the production path. **No code change is required.**
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- **Axis labels are no longer clipped.** The frame handed every builder the
|
|
57
|
+
full container, so Y labels (right-aligned left of the plot) were drawn at
|
|
58
|
+
negative x and X labels fell below the bottom of the SVG: on a device a bar
|
|
59
|
+
or time-series chart showed no value scale and cut-off dates. Builders now
|
|
60
|
+
reserve room for their own labels before projecting anything, in one pass.
|
|
61
|
+
- **Distribution legends match their segments.** Segments were coloured by
|
|
62
|
+
point index while the legend listed series, so a one-series donut of four
|
|
63
|
+
segments had four colours and one legend entry; four one-point series all
|
|
64
|
+
drew in the first palette colour. Segment colours now come from one resolver
|
|
65
|
+
shared by the arcs and the legend, which has one entry per segment. Point
|
|
66
|
+
colours also had their own map: they shared the series map, so a point id
|
|
67
|
+
equal to a series id overwrote that series' colour, in every family.
|
|
68
|
+
- **Reference markers are drawn.** Every builder returned no markers, so
|
|
69
|
+
targets, baselines and thresholds reached the accessibility summary only.
|
|
70
|
+
Bar and time-series charts now draw them across the plot (with the domain
|
|
71
|
+
stretched to include them); progress draws its target on each bar.
|
|
72
|
+
- **Progress overshoot stays inside the plot.** It started at the plot's
|
|
73
|
+
right edge and was clipped, so 118% looked like 100%. The track is now scaled
|
|
74
|
+
so the target sits inside the plot and the excess is visible beyond it.
|
|
75
|
+
|
|
76
|
+
- **No phantom axis below zero on all-positive bars.** The domain was padded
|
|
77
|
+
past zero on both sides, so a bar chart with no negative value printed a
|
|
78
|
+
negative tick (`-5.5`) on top of the `0` label once labels became visible.
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
- `DataPoint.color`, a per-segment colour for distribution charts.
|
|
83
|
+
- `LegendEntry.pointId`, set on distribution entries.
|
|
84
|
+
- `buildLegendEntries(..., family)`: pass `'distribution'` for segment entries.
|
|
85
|
+
|
|
86
|
+
### Changed
|
|
87
|
+
|
|
88
|
+
- The plot area of bar and time-series charts is smaller by the space its axis
|
|
89
|
+
labels need, and `ResolvedGeometry.plot` reports that inner rectangle.
|
|
90
|
+
|
|
91
|
+
## [0.1.1] - 2026-08-01
|
|
92
|
+
|
|
93
|
+
### Changed
|
|
94
|
+
|
|
95
|
+
- The package now ships its agent skill (`skills/`), which consuming apps
|
|
96
|
+
copy in with `scripts/sync-sdk-skills.mjs`. No code change.
|
|
97
|
+
|
|
98
|
+
## [0.1.0] - 2026-08-01
|
|
99
|
+
|
|
100
|
+
### Added
|
|
101
|
+
|
|
102
|
+
Initial release. A domain-agnostic charting package for ChipMobileSdk-family
|
|
103
|
+
apps.
|
|
104
|
+
|
|
105
|
+
- **One datasource contract** across five chart families, with a shared point
|
|
106
|
+
envelope and a discriminated `Position` (category, instant, matrix). Families
|
|
107
|
+
accepting the same position kind interchange without changing the datasource.
|
|
108
|
+
- **Four-way value semantics** — `known` (including a real zero), `unknown`,
|
|
109
|
+
`notApplicable`, `withheld` — carried as a discriminated union with no numeric
|
|
110
|
+
field on the three non-value cases, so a gap cannot be coerced to zero.
|
|
111
|
+
- **Chart families**: `ProgressChart`, `DistributionChart`, `TimeSeriesChart`,
|
|
112
|
+
`BarChart`, `HeatmapChart`, plus `ChartLegend`.
|
|
113
|
+
- **Seven chart states** per family — loading, empty, ready, error, stale,
|
|
114
|
+
no-permission, partial — with per-chart failure containment and an
|
|
115
|
+
app-supplied failure-report callback that carries no data values.
|
|
116
|
+
- **Interaction callbacks** for point selection, series selection, segment
|
|
117
|
+
press, and series visibility. Uncontrolled by default; app-controlled when
|
|
118
|
+
the corresponding value prop is supplied. The package never navigates,
|
|
119
|
+
fetches, or mutates.
|
|
120
|
+
- **Theming** through a `ChartTheme` value type resolved from prop, context, or
|
|
121
|
+
a built-in light/dark default. No dependency on `@chipmobilesdk/rn-theme` or
|
|
122
|
+
`react-native-unistyles`.
|
|
123
|
+
- **Formatting** through app-supplied formatters for axis labels, values,
|
|
124
|
+
legend entries, and summaries, with documented locale-neutral defaults.
|
|
125
|
+
- **Accessibility**: composed per-chart summaries, state announcements, and
|
|
126
|
+
`adjustable` selection traversal for assistive technology.
|
|
127
|
+
- **Dataset budgets** (`DATASET_BUDGETS`) with a dev-only, once-per-chart
|
|
128
|
+
over-budget warning. Over-budget datasets still render.
|
|
129
|
+
|
|
130
|
+
### Release notes for consuming apps
|
|
131
|
+
|
|
132
|
+
What a team adopting this package needs to know and do:
|
|
133
|
+
|
|
134
|
+
- **Install two things, not one.** `@chipmobilesdk/rn-chart` and its required
|
|
135
|
+
peer `react-native-svg` (>= 15.15), then `pod install` on iOS.
|
|
136
|
+
- **No permissions, no manifest changes, no store-declaration changes.** The
|
|
137
|
+
package requests nothing and collects nothing. Note that its *no-permission
|
|
138
|
+
chart state* is an app-level data-access concept, not an OS permission.
|
|
139
|
+
- **Screenshots may need updating** wherever charts change how a screen looks.
|
|
140
|
+
No other store metadata is affected.
|
|
141
|
+
- **If you chart sensitive data**, read the data-behaviour note in the README
|
|
142
|
+
before completing Apple App Privacy or Google Play Data Safety. The package
|
|
143
|
+
introduces no collection of its own, but anything your app transmits is yours
|
|
144
|
+
to declare.
|
|
145
|
+
- **If you render narrative or AI-sourced text near a chart**, moderation and
|
|
146
|
+
content obligations are entirely yours — this package ships no free-text
|
|
147
|
+
surface.
|
|
148
|
+
- **One API habit to adopt**: keep your datasource referentially stable (state
|
|
149
|
+
or `useMemo`). Rebuilding it inline every render defeats the package's
|
|
150
|
+
memoization, and no library can fix that from the inside.
|
|
151
|
+
|
|
152
|
+
### Notes
|
|
153
|
+
|
|
154
|
+
- **Peer dependencies**: `react` >= 19, `react-native` >= 0.85,
|
|
155
|
+
`react-native-svg` >= 15.15. No runtime dependencies.
|
|
156
|
+
- **Native code**: none is authored in this package. `react-native-svg` is a
|
|
157
|
+
native-backed peer; see the README for install and setup.
|
|
158
|
+
- **Stability**: the value, datasource, state, error, and interaction contracts
|
|
159
|
+
are stable. `ChartTheme`, `LegendEntry`, family-specific props, and the
|
|
160
|
+
`DATASET_BUDGETS` values are experimental and may change in a minor release —
|
|
161
|
+
see `specs/007-rn-chart-package/contracts/public-api.md` §6.
|
|
162
|
+
- **Out of scope, reserved for a future additive minor**: insight/narrative
|
|
163
|
+
presentation and composable chart primitives. Neither will change the
|
|
164
|
+
datasource, state, or interaction contracts when it lands.
|