@chipmobilesdk/rn-chart 0.4.0 → 0.5.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 +111 -0
- package/README.md +1 -1
- package/lib/commonjs/a11y/summary.js +190 -0
- package/lib/commonjs/a11y/summary.js.map +1 -0
- package/lib/commonjs/contract/datasource.js +64 -0
- package/lib/commonjs/contract/datasource.js.map +1 -0
- package/lib/commonjs/contract/distribution.js +45 -0
- package/lib/commonjs/contract/distribution.js.map +1 -0
- package/lib/commonjs/contract/errors.js +88 -0
- package/lib/commonjs/contract/errors.js.map +1 -0
- package/lib/commonjs/contract/format.js +133 -0
- package/lib/commonjs/contract/format.js.map +1 -0
- package/lib/commonjs/contract/interaction.js +24 -0
- package/lib/commonjs/contract/interaction.js.map +1 -0
- package/lib/commonjs/contract/marker.js +55 -0
- package/lib/commonjs/contract/marker.js.map +1 -0
- package/lib/commonjs/contract/props.js +6 -0
- package/lib/commonjs/contract/props.js.map +1 -0
- package/lib/commonjs/contract/state.js +68 -0
- package/lib/commonjs/contract/state.js.map +1 -0
- package/lib/commonjs/contract/strings.js +54 -0
- package/lib/commonjs/contract/strings.js.map +1 -0
- package/lib/commonjs/contract/theme.js +116 -0
- package/lib/commonjs/contract/theme.js.map +1 -0
- package/lib/commonjs/contract/value.js +112 -0
- package/lib/commonjs/contract/value.js.map +1 -0
- package/lib/commonjs/geometry/bar.js +257 -0
- package/lib/commonjs/geometry/bar.js.map +1 -0
- package/lib/commonjs/geometry/distribution.js +197 -0
- package/lib/commonjs/geometry/distribution.js.map +1 -0
- package/lib/commonjs/geometry/heatmap.js +186 -0
- package/lib/commonjs/geometry/heatmap.js.map +1 -0
- package/lib/commonjs/geometry/hitTest.js +117 -0
- package/lib/commonjs/geometry/hitTest.js.map +1 -0
- package/lib/commonjs/geometry/layout.js +134 -0
- package/lib/commonjs/geometry/layout.js.map +1 -0
- package/lib/commonjs/geometry/markers.js +59 -0
- package/lib/commonjs/geometry/markers.js.map +1 -0
- package/lib/commonjs/geometry/path.js +166 -0
- package/lib/commonjs/geometry/path.js.map +1 -0
- package/lib/commonjs/geometry/progress.js +203 -0
- package/lib/commonjs/geometry/progress.js.map +1 -0
- package/lib/commonjs/geometry/scale.js +127 -0
- package/lib/commonjs/geometry/scale.js.map +1 -0
- package/lib/commonjs/geometry/ticks.js +120 -0
- package/lib/commonjs/geometry/ticks.js.map +1 -0
- package/lib/commonjs/geometry/timeSeries.js +157 -0
- package/lib/commonjs/geometry/timeSeries.js.map +1 -0
- package/lib/commonjs/geometry/types.js +43 -0
- package/lib/commonjs/geometry/types.js.map +1 -0
- package/lib/commonjs/index.js +284 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/react/ChartBoundary.js +82 -0
- package/lib/commonjs/react/ChartBoundary.js.map +1 -0
- package/lib/commonjs/react/ChartFrame.js +270 -0
- package/lib/commonjs/react/ChartFrame.js.map +1 -0
- package/lib/commonjs/react/ChartLegend.js +242 -0
- package/lib/commonjs/react/ChartLegend.js.map +1 -0
- package/lib/commonjs/react/ChartPlot.js +62 -0
- package/lib/commonjs/react/ChartPlot.js.map +1 -0
- package/lib/commonjs/react/ChartStateOverlay.js +89 -0
- package/lib/commonjs/react/ChartStateOverlay.js.map +1 -0
- package/lib/commonjs/react/ChartThemeProvider.js +51 -0
- package/lib/commonjs/react/ChartThemeProvider.js.map +1 -0
- package/lib/commonjs/react/charts.js +108 -0
- package/lib/commonjs/react/charts.js.map +1 -0
- package/lib/commonjs/react/pointEvent.js +35 -0
- package/lib/commonjs/react/pointEvent.js.map +1 -0
- package/lib/commonjs/react/useChartA11y.js +97 -0
- package/lib/commonjs/react/useChartA11y.js.map +1 -0
- package/lib/commonjs/react/useChartFormatters.js +66 -0
- package/lib/commonjs/react/useChartFormatters.js.map +1 -0
- package/lib/commonjs/react/useChartLayout.js +100 -0
- package/lib/commonjs/react/useChartLayout.js.map +1 -0
- package/lib/commonjs/react/useChartSelection.js +131 -0
- package/lib/commonjs/react/useChartSelection.js.map +1 -0
- package/lib/commonjs/react/useChartStatus.js +74 -0
- package/lib/commonjs/react/useChartStatus.js.map +1 -0
- package/lib/commonjs/render/Axis.js +88 -0
- package/lib/commonjs/render/Axis.js.map +1 -0
- package/lib/commonjs/render/Marks.js +184 -0
- package/lib/commonjs/render/Marks.js.map +1 -0
- package/lib/commonjs/validation/budgets.js +106 -0
- package/lib/commonjs/validation/budgets.js.map +1 -0
- package/lib/commonjs/validation/validateDatasource.js +189 -0
- package/lib/commonjs/validation/validateDatasource.js.map +1 -0
- package/lib/module/a11y/summary.js +184 -0
- package/lib/module/a11y/summary.js.map +1 -0
- package/lib/module/contract/datasource.js +57 -0
- package/lib/module/contract/datasource.js.map +1 -0
- package/lib/module/contract/distribution.js +40 -0
- package/lib/module/contract/distribution.js.map +1 -0
- package/lib/module/contract/errors.js +80 -0
- package/lib/module/contract/errors.js.map +1 -0
- package/lib/module/contract/format.js +123 -0
- package/lib/module/contract/format.js.map +1 -0
- package/lib/module/contract/interaction.js +20 -0
- package/lib/module/contract/interaction.js.map +1 -0
- package/lib/module/contract/marker.js +49 -0
- package/lib/module/contract/marker.js.map +1 -0
- package/lib/module/contract/props.js +4 -0
- package/lib/module/contract/props.js.map +1 -0
- package/lib/module/contract/state.js +61 -0
- package/lib/module/contract/state.js.map +1 -0
- package/lib/module/contract/strings.js +49 -0
- package/lib/module/contract/strings.js.map +1 -0
- package/lib/module/contract/theme.js +109 -0
- package/lib/module/contract/theme.js.map +1 -0
- package/lib/module/contract/value.js +101 -0
- package/lib/module/contract/value.js.map +1 -0
- package/lib/module/geometry/bar.js +253 -0
- package/lib/module/geometry/bar.js.map +1 -0
- package/lib/module/geometry/distribution.js +193 -0
- package/lib/module/geometry/distribution.js.map +1 -0
- package/lib/module/geometry/heatmap.js +182 -0
- package/lib/module/geometry/heatmap.js.map +1 -0
- package/lib/module/geometry/hitTest.js +110 -0
- package/lib/module/geometry/hitTest.js.map +1 -0
- package/lib/module/geometry/layout.js +122 -0
- package/lib/module/geometry/layout.js.map +1 -0
- package/lib/module/geometry/markers.js +53 -0
- package/lib/module/geometry/markers.js.map +1 -0
- package/lib/module/geometry/path.js +157 -0
- package/lib/module/geometry/path.js.map +1 -0
- package/lib/module/geometry/progress.js +199 -0
- package/lib/module/geometry/progress.js.map +1 -0
- package/lib/module/geometry/scale.js +119 -0
- package/lib/module/geometry/scale.js.map +1 -0
- package/lib/module/geometry/ticks.js +112 -0
- package/lib/module/geometry/ticks.js.map +1 -0
- package/lib/module/geometry/timeSeries.js +153 -0
- package/lib/module/geometry/timeSeries.js.map +1 -0
- package/lib/module/geometry/types.js +39 -0
- package/lib/module/geometry/types.js.map +1 -0
- package/lib/module/index.js +85 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/react/ChartBoundary.js +75 -0
- package/lib/module/react/ChartBoundary.js.map +1 -0
- package/lib/module/react/ChartFrame.js +263 -0
- package/lib/module/react/ChartFrame.js.map +1 -0
- package/lib/module/react/ChartLegend.js +234 -0
- package/lib/module/react/ChartLegend.js.map +1 -0
- package/lib/module/react/ChartPlot.js +56 -0
- package/lib/module/react/ChartPlot.js.map +1 -0
- package/lib/module/react/ChartStateOverlay.js +82 -0
- package/lib/module/react/ChartStateOverlay.js.map +1 -0
- package/lib/module/react/ChartThemeProvider.js +44 -0
- package/lib/module/react/ChartThemeProvider.js.map +1 -0
- package/lib/module/react/charts.js +102 -0
- package/lib/module/react/charts.js.map +1 -0
- package/lib/module/react/pointEvent.js +30 -0
- package/lib/module/react/pointEvent.js.map +1 -0
- package/lib/module/react/useChartA11y.js +92 -0
- package/lib/module/react/useChartA11y.js.map +1 -0
- package/lib/module/react/useChartFormatters.js +61 -0
- package/lib/module/react/useChartFormatters.js.map +1 -0
- package/lib/module/react/useChartLayout.js +95 -0
- package/lib/module/react/useChartLayout.js.map +1 -0
- package/lib/module/react/useChartSelection.js +125 -0
- package/lib/module/react/useChartSelection.js.map +1 -0
- package/lib/module/react/useChartStatus.js +69 -0
- package/lib/module/react/useChartStatus.js.map +1 -0
- package/lib/module/render/Axis.js +80 -0
- package/lib/module/render/Axis.js.map +1 -0
- package/lib/module/render/Marks.js +173 -0
- package/lib/module/render/Marks.js.map +1 -0
- package/lib/module/validation/budgets.js +97 -0
- package/lib/module/validation/budgets.js.map +1 -0
- package/lib/module/validation/validateDatasource.js +184 -0
- package/lib/module/validation/validateDatasource.js.map +1 -0
- package/lib/typescript/commonjs/a11y/summary.d.ts +38 -0
- package/lib/typescript/commonjs/a11y/summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/datasource.d.ts +94 -0
- package/lib/typescript/commonjs/contract/datasource.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/distribution.d.ts +17 -0
- package/lib/typescript/commonjs/contract/distribution.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/errors.d.ts +53 -0
- package/lib/typescript/commonjs/contract/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/format.d.ts +63 -0
- package/lib/typescript/commonjs/contract/format.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/interaction.d.ts +53 -0
- package/lib/typescript/commonjs/contract/interaction.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/marker.d.ts +39 -0
- package/lib/typescript/commonjs/contract/marker.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/props.d.ts +58 -0
- package/lib/typescript/commonjs/contract/props.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/state.d.ts +45 -0
- package/lib/typescript/commonjs/contract/state.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/strings.d.ts +39 -0
- package/lib/typescript/commonjs/contract/strings.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/theme.d.ts +85 -0
- package/lib/typescript/commonjs/contract/theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/contract/value.d.ts +69 -0
- package/lib/typescript/commonjs/contract/value.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/bar.d.ts +18 -0
- package/lib/typescript/commonjs/geometry/bar.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/distribution.d.ts +23 -0
- package/lib/typescript/commonjs/geometry/distribution.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/heatmap.d.ts +24 -0
- package/lib/typescript/commonjs/geometry/heatmap.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/hitTest.d.ts +68 -0
- package/lib/typescript/commonjs/geometry/hitTest.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/layout.d.ts +67 -0
- package/lib/typescript/commonjs/geometry/layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/markers.d.ts +29 -0
- package/lib/typescript/commonjs/geometry/markers.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/path.d.ts +66 -0
- package/lib/typescript/commonjs/geometry/path.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/progress.d.ts +17 -0
- package/lib/typescript/commonjs/geometry/progress.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/scale.d.ts +55 -0
- package/lib/typescript/commonjs/geometry/scale.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/ticks.d.ts +48 -0
- package/lib/typescript/commonjs/geometry/ticks.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/timeSeries.d.ts +20 -0
- package/lib/typescript/commonjs/geometry/timeSeries.d.ts.map +1 -0
- package/lib/typescript/commonjs/geometry/types.d.ts +91 -0
- package/lib/typescript/commonjs/geometry/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +47 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/react/ChartBoundary.d.ts +47 -0
- package/lib/typescript/commonjs/react/ChartBoundary.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/ChartFrame.d.ts +31 -0
- package/lib/typescript/commonjs/react/ChartFrame.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/ChartLegend.d.ts +31 -0
- package/lib/typescript/commonjs/react/ChartLegend.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/ChartPlot.d.ts +19 -0
- package/lib/typescript/commonjs/react/ChartPlot.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/ChartStateOverlay.d.ts +25 -0
- package/lib/typescript/commonjs/react/ChartStateOverlay.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/ChartThemeProvider.d.ts +21 -0
- package/lib/typescript/commonjs/react/ChartThemeProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/charts.d.ts +51 -0
- package/lib/typescript/commonjs/react/charts.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/pointEvent.d.ts +13 -0
- package/lib/typescript/commonjs/react/pointEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/useChartA11y.d.ts +37 -0
- package/lib/typescript/commonjs/react/useChartA11y.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/useChartFormatters.d.ts +21 -0
- package/lib/typescript/commonjs/react/useChartFormatters.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/useChartLayout.d.ts +27 -0
- package/lib/typescript/commonjs/react/useChartLayout.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/useChartSelection.d.ts +52 -0
- package/lib/typescript/commonjs/react/useChartSelection.d.ts.map +1 -0
- package/lib/typescript/commonjs/react/useChartStatus.d.ts +22 -0
- package/lib/typescript/commonjs/react/useChartStatus.d.ts.map +1 -0
- package/lib/typescript/commonjs/render/Axis.d.ts +31 -0
- package/lib/typescript/commonjs/render/Axis.d.ts.map +1 -0
- package/lib/typescript/commonjs/render/Marks.d.ts +44 -0
- package/lib/typescript/commonjs/render/Marks.d.ts.map +1 -0
- package/lib/typescript/commonjs/validation/budgets.d.ts +24 -0
- package/lib/typescript/commonjs/validation/budgets.d.ts.map +1 -0
- package/lib/typescript/commonjs/validation/validateDatasource.d.ts +26 -0
- package/lib/typescript/commonjs/validation/validateDatasource.d.ts.map +1 -0
- package/lib/typescript/module/a11y/summary.d.ts +38 -0
- package/lib/typescript/module/a11y/summary.d.ts.map +1 -0
- package/lib/typescript/module/contract/datasource.d.ts +94 -0
- package/lib/typescript/module/contract/datasource.d.ts.map +1 -0
- package/lib/typescript/module/contract/distribution.d.ts +17 -0
- package/lib/typescript/module/contract/distribution.d.ts.map +1 -0
- package/lib/typescript/module/contract/errors.d.ts +53 -0
- package/lib/typescript/module/contract/errors.d.ts.map +1 -0
- package/lib/typescript/module/contract/format.d.ts +63 -0
- package/lib/typescript/module/contract/format.d.ts.map +1 -0
- package/lib/typescript/module/contract/interaction.d.ts +53 -0
- package/lib/typescript/module/contract/interaction.d.ts.map +1 -0
- package/lib/typescript/module/contract/marker.d.ts +39 -0
- package/lib/typescript/module/contract/marker.d.ts.map +1 -0
- package/lib/typescript/module/contract/props.d.ts +58 -0
- package/lib/typescript/module/contract/props.d.ts.map +1 -0
- package/lib/typescript/module/contract/state.d.ts +45 -0
- package/lib/typescript/module/contract/state.d.ts.map +1 -0
- package/lib/typescript/module/contract/strings.d.ts +39 -0
- package/lib/typescript/module/contract/strings.d.ts.map +1 -0
- package/lib/typescript/module/contract/theme.d.ts +85 -0
- package/lib/typescript/module/contract/theme.d.ts.map +1 -0
- package/lib/typescript/module/contract/value.d.ts +69 -0
- package/lib/typescript/module/contract/value.d.ts.map +1 -0
- package/lib/typescript/module/geometry/bar.d.ts +18 -0
- package/lib/typescript/module/geometry/bar.d.ts.map +1 -0
- package/lib/typescript/module/geometry/distribution.d.ts +23 -0
- package/lib/typescript/module/geometry/distribution.d.ts.map +1 -0
- package/lib/typescript/module/geometry/heatmap.d.ts +24 -0
- package/lib/typescript/module/geometry/heatmap.d.ts.map +1 -0
- package/lib/typescript/module/geometry/hitTest.d.ts +68 -0
- package/lib/typescript/module/geometry/hitTest.d.ts.map +1 -0
- package/lib/typescript/module/geometry/layout.d.ts +67 -0
- package/lib/typescript/module/geometry/layout.d.ts.map +1 -0
- package/lib/typescript/module/geometry/markers.d.ts +29 -0
- package/lib/typescript/module/geometry/markers.d.ts.map +1 -0
- package/lib/typescript/module/geometry/path.d.ts +66 -0
- package/lib/typescript/module/geometry/path.d.ts.map +1 -0
- package/lib/typescript/module/geometry/progress.d.ts +17 -0
- package/lib/typescript/module/geometry/progress.d.ts.map +1 -0
- package/lib/typescript/module/geometry/scale.d.ts +55 -0
- package/lib/typescript/module/geometry/scale.d.ts.map +1 -0
- package/lib/typescript/module/geometry/ticks.d.ts +48 -0
- package/lib/typescript/module/geometry/ticks.d.ts.map +1 -0
- package/lib/typescript/module/geometry/timeSeries.d.ts +20 -0
- package/lib/typescript/module/geometry/timeSeries.d.ts.map +1 -0
- package/lib/typescript/module/geometry/types.d.ts +91 -0
- package/lib/typescript/module/geometry/types.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +47 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/react/ChartBoundary.d.ts +47 -0
- package/lib/typescript/module/react/ChartBoundary.d.ts.map +1 -0
- package/lib/typescript/module/react/ChartFrame.d.ts +31 -0
- package/lib/typescript/module/react/ChartFrame.d.ts.map +1 -0
- package/lib/typescript/module/react/ChartLegend.d.ts +31 -0
- package/lib/typescript/module/react/ChartLegend.d.ts.map +1 -0
- package/lib/typescript/module/react/ChartPlot.d.ts +19 -0
- package/lib/typescript/module/react/ChartPlot.d.ts.map +1 -0
- package/lib/typescript/module/react/ChartStateOverlay.d.ts +25 -0
- package/lib/typescript/module/react/ChartStateOverlay.d.ts.map +1 -0
- package/lib/typescript/module/react/ChartThemeProvider.d.ts +21 -0
- package/lib/typescript/module/react/ChartThemeProvider.d.ts.map +1 -0
- package/lib/typescript/module/react/charts.d.ts +51 -0
- package/lib/typescript/module/react/charts.d.ts.map +1 -0
- package/lib/typescript/module/react/pointEvent.d.ts +13 -0
- package/lib/typescript/module/react/pointEvent.d.ts.map +1 -0
- package/lib/typescript/module/react/useChartA11y.d.ts +37 -0
- package/lib/typescript/module/react/useChartA11y.d.ts.map +1 -0
- package/lib/typescript/module/react/useChartFormatters.d.ts +21 -0
- package/lib/typescript/module/react/useChartFormatters.d.ts.map +1 -0
- package/lib/typescript/module/react/useChartLayout.d.ts +27 -0
- package/lib/typescript/module/react/useChartLayout.d.ts.map +1 -0
- package/lib/typescript/module/react/useChartSelection.d.ts +52 -0
- package/lib/typescript/module/react/useChartSelection.d.ts.map +1 -0
- package/lib/typescript/module/react/useChartStatus.d.ts +22 -0
- package/lib/typescript/module/react/useChartStatus.d.ts.map +1 -0
- package/lib/typescript/module/render/Axis.d.ts +31 -0
- package/lib/typescript/module/render/Axis.d.ts.map +1 -0
- package/lib/typescript/module/render/Marks.d.ts +44 -0
- package/lib/typescript/module/render/Marks.d.ts.map +1 -0
- package/lib/typescript/module/validation/budgets.d.ts +24 -0
- package/lib/typescript/module/validation/budgets.d.ts.map +1 -0
- package/lib/typescript/module/validation/validateDatasource.d.ts +26 -0
- package/lib/typescript/module/validation/validateDatasource.d.ts.map +1 -0
- package/package.json +40 -15
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interaction contract (FR-048 to FR-054a).
|
|
3
|
+
*
|
|
4
|
+
* The package reports what the user touched and does nothing else: no
|
|
5
|
+
* navigation, no fetching, no datasource mutation, no business rules.
|
|
6
|
+
*
|
|
7
|
+
* Selection is **uncontrolled by default and controlled when the app supplies a
|
|
8
|
+
* value** — the standard React pattern. The same callbacks fire either way, so
|
|
9
|
+
* a consumer can move between the two without rewriting handlers.
|
|
10
|
+
*/
|
|
11
|
+
import type { Position } from './datasource.js';
|
|
12
|
+
import type { ValueState } from './value.js';
|
|
13
|
+
export interface SelectionRef {
|
|
14
|
+
readonly seriesId: string;
|
|
15
|
+
/** Absent for a whole-series selection. */
|
|
16
|
+
readonly pointId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PointInteractionEvent<M = unknown> {
|
|
19
|
+
readonly type: 'pointSelect';
|
|
20
|
+
readonly seriesId: string;
|
|
21
|
+
readonly pointId: string;
|
|
22
|
+
readonly value: ValueState;
|
|
23
|
+
readonly position: Position;
|
|
24
|
+
readonly metadata?: M;
|
|
25
|
+
}
|
|
26
|
+
export interface SeriesInteractionEvent<M = unknown> {
|
|
27
|
+
readonly type: 'visibilityChange';
|
|
28
|
+
readonly seriesId: string;
|
|
29
|
+
readonly visible?: boolean;
|
|
30
|
+
readonly metadata?: M;
|
|
31
|
+
}
|
|
32
|
+
export type ChartInteractionEvent<M = unknown> = PointInteractionEvent<M> | SeriesInteractionEvent<M>;
|
|
33
|
+
export interface InteractionProps<M = unknown> {
|
|
34
|
+
/**
|
|
35
|
+
* Omit for uncontrolled selection. Supply — including `null` — to take
|
|
36
|
+
* ownership; the chart then renders exactly what this says.
|
|
37
|
+
*/
|
|
38
|
+
readonly selection?: SelectionRef | null;
|
|
39
|
+
readonly onSelectionChange?: (next: SelectionRef | null, event: PointInteractionEvent<M> | null) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Fires when an app-controlled selection no longer resolves against the
|
|
42
|
+
* current datasource, so the app can correct its own state rather than
|
|
43
|
+
* having the package silently ignore it.
|
|
44
|
+
*/
|
|
45
|
+
readonly onSelectionUnresolvable?: (ref: SelectionRef) => void;
|
|
46
|
+
/** Omit for uncontrolled visibility. Supply to take ownership. */
|
|
47
|
+
readonly hiddenSeriesIds?: readonly string[];
|
|
48
|
+
readonly onVisibilityChange?: (event: SeriesInteractionEvent<M>) => void;
|
|
49
|
+
/** Series toggling stays off unless the app opts in (FR-049). */
|
|
50
|
+
readonly seriesToggleEnabled?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare function sameSelection(a: SelectionRef | null | undefined, b: SelectionRef | null | undefined): boolean;
|
|
53
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../../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qB,CAAC,CAAC,CAAC,GAAG,IAAI,KAClC,IAAI,CAAC;IACV;;;;OAIG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/D,kEAAkE;IAClE,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACzE,iEAAiE;IACjE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,wBAAgB,aAAa,CAC5B,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EAClC,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GAChC,OAAO,CAKT"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference markers: targets, baselines, and thresholds (FR-008, FR-021, FR-022).
|
|
3
|
+
*
|
|
4
|
+
* The important rule lives here: a marker whose value is not `known`, or whose
|
|
5
|
+
* target is zero or negative, produces **no completion proportion**. A chart
|
|
6
|
+
* shows the current value alone rather than inventing a percentage.
|
|
7
|
+
*/
|
|
8
|
+
import type { FormatHint } from './format.js';
|
|
9
|
+
import { type ValueState } from './value.js';
|
|
10
|
+
export type MarkerKind = 'target' | 'baseline' | 'threshold';
|
|
11
|
+
export interface ReferenceMarker {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly kind: MarkerKind;
|
|
14
|
+
readonly value: ValueState;
|
|
15
|
+
readonly label?: string;
|
|
16
|
+
readonly format?: FormatHint;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A target only supports a proportion when it is known and strictly positive.
|
|
20
|
+
* Zero and negative targets make "percent complete" meaningless, so we decline
|
|
21
|
+
* to compute one rather than divide and produce a nonsense figure.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isUsableTarget(marker: ReferenceMarker | undefined): boolean;
|
|
24
|
+
export interface ProgressReading {
|
|
25
|
+
/** The current value, when known. */
|
|
26
|
+
readonly current: ValueState;
|
|
27
|
+
/** The target, when one was supplied. */
|
|
28
|
+
readonly target?: ReferenceMarker;
|
|
29
|
+
/**
|
|
30
|
+
* Completion as a ratio of current to target. `undefined` whenever no
|
|
31
|
+
* proportion can honestly be computed — this is never defaulted to 0 or 1.
|
|
32
|
+
*/
|
|
33
|
+
readonly proportion?: number;
|
|
34
|
+
/** True when the current value exceeds the target: shown, never clamped. */
|
|
35
|
+
readonly overshoot: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function readProgress(current: ValueState, target: ReferenceMarker | undefined): ProgressReading;
|
|
38
|
+
export declare function findTarget(markers: readonly ReferenceMarker[] | undefined, id?: string): ReferenceMarker | undefined;
|
|
39
|
+
//# sourceMappingURL=marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../../../src/contract/marker.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAU,CAAC;AAC3C,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,YAAS,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,GAAG,OAAO,CAK3E;AAED,MAAM,WAAW,eAAe;IAC/B,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,YAAY,CAC3B,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,eAAe,GAAG,SAAS,GACjC,eAAe,CAejB;AAED,wBAAgB,UAAU,CACzB,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAC/C,EAAE,CAAC,EAAE,MAAM,GACT,eAAe,GAAG,SAAS,CAK7B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props shared by every chart family.
|
|
3
|
+
*
|
|
4
|
+
* See specs/007-rn-chart-package/contracts/public-api.md §2 for the contract
|
|
5
|
+
* behind each field.
|
|
6
|
+
*/
|
|
7
|
+
import type { ChartStrings } from './strings.js';
|
|
8
|
+
import type { ReactNode } from 'react';
|
|
9
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
10
|
+
import type { ChartDatasource } from './datasource.js';
|
|
11
|
+
import type { ChartFailureHandler } from './errors.js';
|
|
12
|
+
import type { ChartFormatters, FormatContext } from './format.js';
|
|
13
|
+
import type { InteractionProps } from './interaction.js';
|
|
14
|
+
import type { ChartStateContent, DeclarableChartStatus } from './state.js';
|
|
15
|
+
import type { ChartTheme } from './theme.js';
|
|
16
|
+
import type { ValueState } from './value.js';
|
|
17
|
+
export interface ChartAccessibility<M = unknown> {
|
|
18
|
+
/** Replaces the composed summary entirely. */
|
|
19
|
+
readonly label?: string;
|
|
20
|
+
readonly summaryFormatter?: (datasource: ChartDatasource<M>, ctx: FormatContext) => string;
|
|
21
|
+
/** Defaults to true when `onSelectionChange` is supplied. */
|
|
22
|
+
readonly interactive?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface BaseChartProps<M = unknown> extends InteractionProps<M> {
|
|
25
|
+
/**
|
|
26
|
+
* Must be referentially stable across renders, or memoization is defeated.
|
|
27
|
+
* Hold it in state or a memo rather than building it inline.
|
|
28
|
+
*/
|
|
29
|
+
readonly datasource: ChartDatasource<M>;
|
|
30
|
+
/**
|
|
31
|
+
* `empty` and `partial` are derived from the data and are not accepted here
|
|
32
|
+
* (FR-036).
|
|
33
|
+
*/
|
|
34
|
+
readonly status?: DeclarableChartStatus;
|
|
35
|
+
readonly stateContent?: ChartStateContent;
|
|
36
|
+
readonly chartId?: string;
|
|
37
|
+
readonly onFailure?: ChartFailureHandler;
|
|
38
|
+
readonly theme?: ChartTheme;
|
|
39
|
+
readonly formatters?: ChartFormatters;
|
|
40
|
+
readonly title?: string;
|
|
41
|
+
readonly legend?: boolean | {
|
|
42
|
+
readonly position: 'top' | 'bottom';
|
|
43
|
+
};
|
|
44
|
+
readonly accessibility?: ChartAccessibility<M>;
|
|
45
|
+
/**
|
|
46
|
+
* The package's own texts in the app's language: summaries, announcements,
|
|
47
|
+
* action labels, built-in state text, legend hints (`chartStrings` holds the
|
|
48
|
+
* keys and English defaults).
|
|
49
|
+
*/
|
|
50
|
+
readonly strings?: Partial<ChartStrings>;
|
|
51
|
+
/** Width always comes from the container. */
|
|
52
|
+
readonly height?: number;
|
|
53
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
54
|
+
/** Rendered below the plot, inside the chart's own bounds. */
|
|
55
|
+
readonly footer?: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
export type ValueFormatter = (value: ValueState) => string;
|
|
58
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/contract/props.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAW,CAA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,CAAC;IAEzC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAA;KAAE,CAAC;IAEpE,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzC,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart status contract (FR-029 to FR-038).
|
|
3
|
+
*
|
|
4
|
+
* Ownership is split on a simple principle: the package derives what only the
|
|
5
|
+
* data can determine, and the app declares what only the app can know.
|
|
6
|
+
*
|
|
7
|
+
* empty, partial -> derived from the datasource
|
|
8
|
+
* loading, stale, -> declared by the app: it alone knows about its own
|
|
9
|
+
* noPermission, fetches, cache age, access rules, and failures
|
|
10
|
+
* error
|
|
11
|
+
*/
|
|
12
|
+
import type { ReactNode } from 'react';
|
|
13
|
+
import type { ChartError } from './errors.js';
|
|
14
|
+
export type ChartStatus = 'loading' | 'empty' | 'ready' | 'error' | 'stale' | 'noPermission' | 'partial';
|
|
15
|
+
/** The statuses an app may declare. `empty` and `partial` are derived. */
|
|
16
|
+
export type DeclarableChartStatus = Exclude<ChartStatus, 'empty' | 'partial'>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolution precedence, highest first.
|
|
19
|
+
*
|
|
20
|
+
* `noPermission` outranks everything so restricted values can never slip
|
|
21
|
+
* through some other state. `stale` and `partial` sit below the blocking
|
|
22
|
+
* states because they are modifiers on a chart that still draws its data.
|
|
23
|
+
*/
|
|
24
|
+
export declare const STATUS_PRECEDENCE: readonly ChartStatus[];
|
|
25
|
+
export interface StatusInputs {
|
|
26
|
+
/** What the app declared, if anything. */
|
|
27
|
+
readonly declared?: DeclarableChartStatus;
|
|
28
|
+
/** True when the datasource carries no points at all. */
|
|
29
|
+
readonly isEmpty: boolean;
|
|
30
|
+
/** True when some points are valid and others are unknown/n-a/withheld. */
|
|
31
|
+
readonly isPartial: boolean;
|
|
32
|
+
/** A validation failure or a contained render exception. */
|
|
33
|
+
readonly error?: ChartError;
|
|
34
|
+
}
|
|
35
|
+
export declare function resolveStatus(inputs: StatusInputs): ChartStatus;
|
|
36
|
+
/** Statuses in which the chart draws its data (possibly with an indicator). */
|
|
37
|
+
export declare function drawsData(status: ChartStatus): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Statuses in which no data-selection callback may fire, because the chart is
|
|
40
|
+
* not displaying the values a callback would carry (FR-053).
|
|
41
|
+
*/
|
|
42
|
+
export declare function suppressesInteraction(status: ChartStatus): boolean;
|
|
43
|
+
/** Per-status content the app supplies, replacing any package wording (FR-035). */
|
|
44
|
+
export type ChartStateContent = Partial<Record<ChartStatus, ReactNode>>;
|
|
45
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/contract/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAU,CAAC;AAE3C,MAAM,MAAM,WAAW,GACtB,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AAEhF,0EAA0E;AAC1E,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,WAAW,EAQnD,CAAC;AAEF,MAAM,WAAW,YAAY;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAC1C,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;CAC5B;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAsB/D;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAElE;AAED,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const chartStrings: import("@chipmobilesdk/rn-core").MessageSet<{
|
|
2
|
+
'chart.family.progress': string;
|
|
3
|
+
'chart.family.distribution': string;
|
|
4
|
+
'chart.family.timeSeries': string;
|
|
5
|
+
'chart.family.bar': string;
|
|
6
|
+
'chart.family.heatmap': string;
|
|
7
|
+
'chart.status.loading': string;
|
|
8
|
+
'chart.status.empty': string;
|
|
9
|
+
'chart.status.error': string;
|
|
10
|
+
'chart.status.stale': string;
|
|
11
|
+
'chart.status.noPermission': string;
|
|
12
|
+
'chart.status.partial': string;
|
|
13
|
+
'chart.summary.heading': string;
|
|
14
|
+
'chart.summary.headingUntitled': string;
|
|
15
|
+
'chart.summary.scale': string;
|
|
16
|
+
'chart.summary.scaleSingle': string;
|
|
17
|
+
'chart.summary.single': string;
|
|
18
|
+
'chart.summary.extremes': string;
|
|
19
|
+
'chart.summary.marker': string;
|
|
20
|
+
'chart.summary.incomplete': string;
|
|
21
|
+
'chart.point.withheld': string;
|
|
22
|
+
'chart.point.noData': string;
|
|
23
|
+
'chart.point.value': string;
|
|
24
|
+
'chart.total': string;
|
|
25
|
+
'chart.total.incomplete': string;
|
|
26
|
+
'chart.action.next': string;
|
|
27
|
+
'chart.action.previous': string;
|
|
28
|
+
'chart.state.loading': string;
|
|
29
|
+
'chart.state.empty': string;
|
|
30
|
+
'chart.state.error': string;
|
|
31
|
+
'chart.state.noPermission': string;
|
|
32
|
+
'chart.legend.hide': string;
|
|
33
|
+
'chart.legend.show': string;
|
|
34
|
+
'chart.legend.scale': string;
|
|
35
|
+
'chart.note.incomplete': string;
|
|
36
|
+
}, Record<never, string>>;
|
|
37
|
+
export type ChartStrings = typeof chartStrings.defaults;
|
|
38
|
+
export type ChartStringKey = keyof ChartStrings;
|
|
39
|
+
//# sourceMappingURL=strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../../src/contract/strings.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAqCvB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,QAAQ,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme contract (FR-060 to FR-065).
|
|
3
|
+
*
|
|
4
|
+
* A plain value type rather than a dependency. The package declares what it
|
|
5
|
+
* needs and any design system can satisfy it — which is what keeps
|
|
6
|
+
* `@chipmobilesdk/rn-theme` and `react-native-unistyles` out of this package's
|
|
7
|
+
* dependency list entirely. The demo app owns the mapping adapter.
|
|
8
|
+
*
|
|
9
|
+
* Non-colour encodings are first-class here, because meaning must never ride on
|
|
10
|
+
* hue alone (FR-064).
|
|
11
|
+
*/
|
|
12
|
+
import type { ValueKind } from './value.js';
|
|
13
|
+
export interface TextStyleTokens {
|
|
14
|
+
readonly fontSize: number;
|
|
15
|
+
readonly fontWeight?: '400' | '500' | '600' | '700';
|
|
16
|
+
readonly color: string;
|
|
17
|
+
readonly letterSpacing?: number;
|
|
18
|
+
}
|
|
19
|
+
/** How the three non-value classes are drawn: texture, never a hue difference. */
|
|
20
|
+
export type NonValueTexture = 'gap' | 'hatch' | 'lockedHatch';
|
|
21
|
+
export interface ChartTheme {
|
|
22
|
+
readonly colorScheme: 'light' | 'dark';
|
|
23
|
+
/** Categorical fallback, at least 8 entries, distinguishable in greyscale. */
|
|
24
|
+
readonly palette: readonly string[];
|
|
25
|
+
readonly surface: string;
|
|
26
|
+
readonly onSurface: string;
|
|
27
|
+
readonly axis: string;
|
|
28
|
+
readonly grid: string;
|
|
29
|
+
readonly muted: string;
|
|
30
|
+
readonly typography: {
|
|
31
|
+
readonly axisLabel: TextStyleTokens;
|
|
32
|
+
readonly legendLabel: TextStyleTokens;
|
|
33
|
+
readonly valueLabel: TextStyleTokens;
|
|
34
|
+
};
|
|
35
|
+
readonly spacing: {
|
|
36
|
+
readonly xs: number;
|
|
37
|
+
readonly sm: number;
|
|
38
|
+
readonly md: number;
|
|
39
|
+
};
|
|
40
|
+
readonly radius: {
|
|
41
|
+
readonly bar: number;
|
|
42
|
+
readonly cell: number;
|
|
43
|
+
};
|
|
44
|
+
readonly nonValue: Readonly<Record<Exclude<ValueKind, 'known'>, NonValueTexture>>;
|
|
45
|
+
/** Ramp for heatmap intensity, low to high. */
|
|
46
|
+
readonly heatmapRamp: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
export interface LegendEntry {
|
|
49
|
+
readonly seriesId: string;
|
|
50
|
+
/** Set on distribution entries, which describe one segment rather than a series. */
|
|
51
|
+
readonly pointId?: string;
|
|
52
|
+
readonly label: string;
|
|
53
|
+
readonly color: string;
|
|
54
|
+
readonly pattern: 'solid' | 'dashed' | 'dotted' | 'dashDot';
|
|
55
|
+
readonly visible: boolean;
|
|
56
|
+
readonly toggleable: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare function defaultChartTheme(colorScheme?: 'light' | 'dark'): ChartTheme;
|
|
59
|
+
/**
|
|
60
|
+
* Assigns a colour to a series: explicit override wins, otherwise the palette
|
|
61
|
+
* cycles by index so the remaining series stay distinguishable (FR-062, FR-063).
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveSeriesColor(theme: ChartTheme, index: number, override?: string): string;
|
|
64
|
+
/** Key of one distribution segment: point ids are only unique within a series. */
|
|
65
|
+
export declare function segmentKey(seriesId: string, pointId: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Colours for distribution segments, keyed by `segmentKey`. The single source
|
|
68
|
+
* for both the arcs and the legend, so the two cannot disagree (CHT-02).
|
|
69
|
+
*
|
|
70
|
+
* Segments take palette entries in order across the whole datasource, so one
|
|
71
|
+
* series of four points and four series of one point both give four colours.
|
|
72
|
+
* A point's own `color` wins; a series with a single point is that segment, so
|
|
73
|
+
* the series `color` applies to it.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveSegmentColors(datasource: {
|
|
76
|
+
readonly series: readonly {
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly color?: string;
|
|
79
|
+
readonly points: readonly {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly color?: string;
|
|
82
|
+
}[];
|
|
83
|
+
}[];
|
|
84
|
+
}, theme: ChartTheme): Record<string, string>;
|
|
85
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
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,EAAE,SAAS;YAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC7E,EAAE,CAAC;CACJ,EACD,KAAK,EAAE,UAAU,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Value semantics for @chipmobilesdk/rn-chart.
|
|
3
|
+
*
|
|
4
|
+
* The foundation of the whole contract. Four value classes, carried as a
|
|
5
|
+
* discriminated union with **no numeric field on the three non-value cases**.
|
|
6
|
+
*
|
|
7
|
+
* That shape is deliberate: with a nullable `number`, `value ?? 0` would
|
|
8
|
+
* compile, and turning a gap into a zero is the single most damaging thing a
|
|
9
|
+
* charting library can do to someone's data. Here there is simply no number to
|
|
10
|
+
* read unless the value is known.
|
|
11
|
+
*
|
|
12
|
+
* See specs/007-rn-chart-package/data-model.md §1 (FR-011, FR-012).
|
|
13
|
+
*/
|
|
14
|
+
/** A real observation, including a genuine `0`. */
|
|
15
|
+
export interface KnownValue {
|
|
16
|
+
readonly kind: 'known';
|
|
17
|
+
readonly value: number;
|
|
18
|
+
}
|
|
19
|
+
/** We do not know this value. Never rendered as zero, never interpolated. */
|
|
20
|
+
export interface UnknownValue {
|
|
21
|
+
readonly kind: 'unknown';
|
|
22
|
+
}
|
|
23
|
+
/** This value does not apply here. Excluded from totals and proportions. */
|
|
24
|
+
export interface NotApplicableValue {
|
|
25
|
+
readonly kind: 'notApplicable';
|
|
26
|
+
}
|
|
27
|
+
/** Hidden from this viewer: permission, or not enough data to disclose. */
|
|
28
|
+
export interface WithheldValue {
|
|
29
|
+
readonly kind: 'withheld';
|
|
30
|
+
}
|
|
31
|
+
export type ValueState = KnownValue | UnknownValue | NotApplicableValue | WithheldValue;
|
|
32
|
+
export type ValueKind = ValueState['kind'];
|
|
33
|
+
export declare function known(value: number): KnownValue;
|
|
34
|
+
/**
|
|
35
|
+
* Note: shadows the `unknown` *type* keyword in value position only. TypeScript
|
|
36
|
+
* keeps type and value namespaces separate, so `x: unknown` still means the
|
|
37
|
+
* type even in modules that import this helper.
|
|
38
|
+
*/
|
|
39
|
+
export declare function unknown(): UnknownValue;
|
|
40
|
+
export declare function notApplicable(): NotApplicableValue;
|
|
41
|
+
export declare function withheld(): WithheldValue;
|
|
42
|
+
export declare function isKnown(v: ValueState): v is KnownValue;
|
|
43
|
+
/**
|
|
44
|
+
* True when the value must never reach a rendering, a label, a summary, or an
|
|
45
|
+
* interaction callback (FR-033, FR-053). Withheld values carry no number at
|
|
46
|
+
* all, so this is about intent rather than data hiding.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isWithheld(v: ValueState): v is WithheldValue;
|
|
49
|
+
/**
|
|
50
|
+
* True when the point takes part in totals, proportions, and axis domains.
|
|
51
|
+
* `notApplicable` and `withheld` are excluded; excluding either makes a total
|
|
52
|
+
* incomplete (FR-013).
|
|
53
|
+
*/
|
|
54
|
+
export declare function participatesInTotals(v: ValueState): boolean;
|
|
55
|
+
export interface TotalResult {
|
|
56
|
+
readonly total: number;
|
|
57
|
+
/** True when any point was excluded, so the total is not the whole picture. */
|
|
58
|
+
readonly incomplete: boolean;
|
|
59
|
+
readonly countedPoints: number;
|
|
60
|
+
readonly excludedPoints: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Sums known values and reports whether anything was left out (FR-013).
|
|
64
|
+
*
|
|
65
|
+
* `unknown` also excludes and marks the total incomplete: we cannot claim a sum
|
|
66
|
+
* is complete when part of the data is missing.
|
|
67
|
+
*/
|
|
68
|
+
export declare function sumKnown(values: readonly ValueState[]): TotalResult;
|
|
69
|
+
//# sourceMappingURL=value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../../src/contract/value.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAE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Q,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,WAAW,CAoBnE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bar geometry: one batched path per series, grouped or stacked.
|
|
3
|
+
*
|
|
4
|
+
* Bars measure length from zero, so the domain always includes it — otherwise
|
|
5
|
+
* a bar's length means nothing. Negative values place the baseline correctly
|
|
6
|
+
* rather than clamping to the plot floor.
|
|
7
|
+
*
|
|
8
|
+
* PURE. No React, no SVG.
|
|
9
|
+
*/
|
|
10
|
+
import type { ChartDatasource } from '../contract/datasource.js';
|
|
11
|
+
import type { GeometryInput, ResolvedGeometry } from './types.js';
|
|
12
|
+
export type BarGrouping = 'grouped' | 'stacked';
|
|
13
|
+
export interface BarOptions {
|
|
14
|
+
readonly grouping?: BarGrouping;
|
|
15
|
+
readonly radius?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function buildBarGeometry<M>(datasource: ChartDatasource<M>, input: GeometryInput, options?: BarOptions): ResolvedGeometry;
|
|
18
|
+
//# sourceMappingURL=bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../../../src/geometry/bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,2BAAwB,CAAC;AAQhF,OAAO,KAAK,EAAE,aAAa,EAAY,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAEzE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAEhD,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AA8GD,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,UAAe,GACtB,gBAAgB,CA+IlB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distribution geometry: proportions between groups.
|
|
3
|
+
*
|
|
4
|
+
* Segments that do not sum to the whole are **not** rescaled to force a full
|
|
5
|
+
* circle (FR-024). The arc stops short and the geometry reports `incomplete`,
|
|
6
|
+
* so the chart can say the data is partial rather than quietly implying it is
|
|
7
|
+
* complete.
|
|
8
|
+
*
|
|
9
|
+
* PURE. No React, no SVG.
|
|
10
|
+
*/
|
|
11
|
+
import type { ChartDatasource } from '../contract/datasource.js';
|
|
12
|
+
import { type DistributionValues } from '../contract/distribution.js';
|
|
13
|
+
import type { GeometryInput, ResolvedGeometry } from './types.js';
|
|
14
|
+
export type DistributionShape = 'donut' | 'pie' | 'segmentedBar';
|
|
15
|
+
export interface DistributionOptions {
|
|
16
|
+
readonly shape?: DistributionShape;
|
|
17
|
+
/** Donut hole as a fraction of the outer radius. */
|
|
18
|
+
readonly innerRadiusRatio?: number;
|
|
19
|
+
/** What the values mean; inferred from the data when omitted. */
|
|
20
|
+
readonly valuesAre?: DistributionValues;
|
|
21
|
+
}
|
|
22
|
+
export declare function buildDistributionGeometry<M>(datasource: ChartDatasource<M>, input: GeometryInput, options?: DistributionOptions): ResolvedGeometry;
|
|
23
|
+
//# sourceMappingURL=distribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../../../src/geometry/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAAwB,CAAC;AAC9D,OAAO,EAA6B,KAAK,kBAAkB,EAAE,MAAM,6BAA0B,CAAC;AAK9F,OAAO,KAAK,EAAE,aAAa,EAA2B,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAExF,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,KAAK,GAAG,cAAc,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,oDAAoD;IACpD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAID,wBAAgB,yBAAyB,CAAC,CAAC,EAC1C,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,mBAAwB,GAC/B,gBAAgB,CAuKlB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heatmap geometry: a matrix of cells, batched by intensity bucket.
|
|
3
|
+
*
|
|
4
|
+
* This is where batching pays off most. A thousand cells become roughly eight
|
|
5
|
+
* paths — one per intensity bucket, plus one per non-value class — instead of a
|
|
6
|
+
* thousand elements. Cell count no longer drives element count at all
|
|
7
|
+
* (research.md R2).
|
|
8
|
+
*
|
|
9
|
+
* Empty, zero, and unavailable cells are distinct by construction (FR-027): a
|
|
10
|
+
* genuine zero lands in the lowest ramp bucket, while unknown, not-applicable,
|
|
11
|
+
* and withheld each get their own texture.
|
|
12
|
+
*
|
|
13
|
+
* PURE. No React, no SVG.
|
|
14
|
+
*/
|
|
15
|
+
import type { ChartDatasource } from '../contract/datasource.js';
|
|
16
|
+
import type { GeometryInput, ResolvedGeometry } from './types.js';
|
|
17
|
+
export interface HeatmapOptions {
|
|
18
|
+
/** Intensity buckets. More buckets means finer shading, more paths. */
|
|
19
|
+
readonly buckets?: number;
|
|
20
|
+
readonly cellGap?: number;
|
|
21
|
+
readonly cellRadius?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildHeatmapGeometry<M>(datasource: ChartDatasource<M>, input: GeometryInput, options?: HeatmapOptions): ResolvedGeometry;
|
|
24
|
+
//# sourceMappingURL=heatmap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heatmap.d.ts","sourceRoot":"","sources":["../../../../src/geometry/heatmap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAAwB,CAAC;AAM9D,OAAO,KAAK,EAAE,aAAa,EAAY,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAEzE,MAAM,WAAW,cAAc;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EACrC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,cAAmB,GAC1B,gBAAgB,CA4KlB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hit-testing for batched marks.
|
|
3
|
+
*
|
|
4
|
+
* Because marks are batched into one path per series, there are no per-element
|
|
5
|
+
* press handlers to rely on — a touch is resolved against geometry instead.
|
|
6
|
+
* That work would be needed anyway (a mobile time-series chart needs
|
|
7
|
+
* nearest-point search regardless of how it is drawn), and doing it in one
|
|
8
|
+
* place means a single implementation serves every family.
|
|
9
|
+
*
|
|
10
|
+
* PURE. No React, no SVG.
|
|
11
|
+
*/
|
|
12
|
+
export interface HitRegion {
|
|
13
|
+
readonly seriesId: string;
|
|
14
|
+
readonly pointId: string;
|
|
15
|
+
/** Mark centre, used for nearest-point search and for highlight placement. */
|
|
16
|
+
readonly x: number;
|
|
17
|
+
readonly y: number;
|
|
18
|
+
/** Optional bounds, for marks where containment beats proximity. */
|
|
19
|
+
readonly bounds?: {
|
|
20
|
+
readonly x: number;
|
|
21
|
+
readonly y: number;
|
|
22
|
+
readonly width: number;
|
|
23
|
+
readonly height: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* An arc segment: containment by radius and angle. Angles are radians,
|
|
27
|
+
* clockwise from twelve o'clock, as the distribution geometry draws them.
|
|
28
|
+
* A region with an arc is hit only inside it, never by proximity.
|
|
29
|
+
*/
|
|
30
|
+
readonly arc?: {
|
|
31
|
+
readonly cx: number;
|
|
32
|
+
readonly cy: number;
|
|
33
|
+
readonly innerRadius: number;
|
|
34
|
+
readonly outerRadius: number;
|
|
35
|
+
readonly startAngle: number;
|
|
36
|
+
readonly endAngle: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* False for points that must never be selectable: withheld values, and
|
|
40
|
+
* anything the chart is not currently drawing (FR-053).
|
|
41
|
+
*/
|
|
42
|
+
readonly selectable: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface HitResult {
|
|
45
|
+
readonly seriesId: string;
|
|
46
|
+
readonly pointId: string;
|
|
47
|
+
readonly distance: number;
|
|
48
|
+
}
|
|
49
|
+
/** Touch slop: how far from a mark a tap still counts, in px. */
|
|
50
|
+
export declare const DEFAULT_HIT_RADIUS = 44;
|
|
51
|
+
/**
|
|
52
|
+
* Resolves a touch to a mark.
|
|
53
|
+
*
|
|
54
|
+
* Containment wins over proximity where bounds exist — tapping inside a bar
|
|
55
|
+
* should select that bar even if a neighbouring bar's centre happens to be
|
|
56
|
+
* closer. Otherwise the nearest selectable mark within the hit radius wins.
|
|
57
|
+
*/
|
|
58
|
+
export declare function hitTest(regions: readonly HitRegion[], x: number, y: number, hitRadius?: number): HitResult | null;
|
|
59
|
+
/**
|
|
60
|
+
* Nearest mark by horizontal distance only.
|
|
61
|
+
*
|
|
62
|
+
* The right model for a time-series chart: a user aiming at "that Tuesday
|
|
63
|
+
* spike" cares about the x position, and demanding vertical accuracy on a line
|
|
64
|
+
* that may sit anywhere in the plot makes selection frustrating.
|
|
65
|
+
*/
|
|
66
|
+
export declare function hitTestByX(regions: readonly HitRegion[], x: number): HitResult | null;
|
|
67
|
+
export declare function findRegion(regions: readonly HitRegion[], seriesId: string, pointId?: string): HitRegion | undefined;
|
|
68
|
+
//# sourceMappingURL=hitTest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hitTest.d.ts","sourceRoot":"","sources":["../../../../src/geometry/hitTest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACxB,CAAC;IACF;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE;QACd,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CA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