@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,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scales: domain values to pixel positions.
|
|
3
|
+
*
|
|
4
|
+
* PURE. No React, no SVG — enforced by the ESLint override in `.eslintrc.js`
|
|
5
|
+
* and by geometryPurity.test.ts.
|
|
6
|
+
*/
|
|
7
|
+
export interface Range {
|
|
8
|
+
readonly min: number;
|
|
9
|
+
readonly max: number;
|
|
10
|
+
}
|
|
11
|
+
export interface LinearScale {
|
|
12
|
+
readonly domain: Range;
|
|
13
|
+
readonly rangePx: Range;
|
|
14
|
+
readonly project: (value: number) => number;
|
|
15
|
+
readonly invert: (px: number) => number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Nudges a zero-width domain outward so an all-identical dataset still gets a
|
|
19
|
+
* usable axis. Without this the projection divides by zero and every point
|
|
20
|
+
* lands on the same pixel — or on NaN.
|
|
21
|
+
*/
|
|
22
|
+
export declare function widenDegenerateDomain(domain: Range): Range;
|
|
23
|
+
export declare function linearScale(domain: Range, rangePx: Range): LinearScale;
|
|
24
|
+
export interface BandScale {
|
|
25
|
+
readonly categories: readonly string[];
|
|
26
|
+
readonly bandWidth: number;
|
|
27
|
+
readonly step: number;
|
|
28
|
+
readonly project: (category: string) => number | undefined;
|
|
29
|
+
readonly centerOf: (category: string) => number | undefined;
|
|
30
|
+
readonly invert: (px: number) => string | undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Discrete positions for category axes.
|
|
34
|
+
*
|
|
35
|
+
* `padding` is the fraction of each step left as gap, so 0.2 means bars occupy
|
|
36
|
+
* 80% of their slot.
|
|
37
|
+
*/
|
|
38
|
+
export declare function bandScale(categories: readonly string[], rangePx: Range, padding?: number): BandScale;
|
|
39
|
+
/**
|
|
40
|
+
* Time is just a linear scale over epoch milliseconds. Kept as a named
|
|
41
|
+
* function so call sites read clearly and so tick generation can branch on it.
|
|
42
|
+
*/
|
|
43
|
+
export declare function timeScale(domain: Range, rangePx: Range): LinearScale;
|
|
44
|
+
/**
|
|
45
|
+
* Domain from known values, padded so marks do not touch the plot edges.
|
|
46
|
+
*
|
|
47
|
+
* `includeZero` matters for bar charts: a bar's length is only meaningful when
|
|
48
|
+
* measured from zero. Time-series charts leave it off so a narrow band of
|
|
49
|
+
* values stays legible.
|
|
50
|
+
*/
|
|
51
|
+
export declare function domainFrom(values: readonly number[], options?: {
|
|
52
|
+
includeZero?: boolean;
|
|
53
|
+
padFraction?: number;
|
|
54
|
+
}): Range;
|
|
55
|
+
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../../src/geometry/scale.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACr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E;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3D,KAAK,CAuBP"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tick generation and label thinning (FR-070).
|
|
3
|
+
*
|
|
4
|
+
* React Native offers no synchronous text measurement, and an `onLayout`
|
|
5
|
+
* round-trip per label would cost a second layout pass — enough to breach the
|
|
6
|
+
* first-paint budget. So we estimate width from character count and thin ticks
|
|
7
|
+
* to fit.
|
|
8
|
+
*
|
|
9
|
+
* The estimate is deliberately generous: over-estimating drops one tick too
|
|
10
|
+
* many, which is legible. Under-estimating produces overlapping text, which is
|
|
11
|
+
* the failure FR-070 exists to prevent. See research.md R6.
|
|
12
|
+
*
|
|
13
|
+
* PURE. No React, no SVG.
|
|
14
|
+
*/
|
|
15
|
+
import type { Range } from './scale';
|
|
16
|
+
/**
|
|
17
|
+
* Average glyph advance as a fraction of font size, for the Latin digits and
|
|
18
|
+
* letters that dominate axis labels. Rounded up from the ~0.5-0.55 typical of
|
|
19
|
+
* the platform sans-serif faces.
|
|
20
|
+
*/
|
|
21
|
+
export declare const AVERAGE_ADVANCE_RATIO = 0.62;
|
|
22
|
+
/** Minimum breathing room between two adjacent labels, in px. */
|
|
23
|
+
export declare const LABEL_GUTTER = 8;
|
|
24
|
+
export declare function estimateTextWidth(text: string, fontSize: number): number;
|
|
25
|
+
export interface Tick {
|
|
26
|
+
/** Domain value this tick represents. */
|
|
27
|
+
readonly value: number;
|
|
28
|
+
/** Pixel position along the axis. */
|
|
29
|
+
readonly position: number;
|
|
30
|
+
readonly label: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function niceTickValues(domain: Range, targetCount: number): number[];
|
|
33
|
+
/**
|
|
34
|
+
* Drops ticks until no two labels can overlap.
|
|
35
|
+
*
|
|
36
|
+
* Thinning is preferred over rotation as the default: rotated labels are harder
|
|
37
|
+
* to read on a phone and cost vertical space a mobile chart cannot spare.
|
|
38
|
+
* Rotation stays available as an opt-in for dense category axes.
|
|
39
|
+
*
|
|
40
|
+
* The first tick is always kept, so an axis never renders empty.
|
|
41
|
+
*/
|
|
42
|
+
export declare function thinTicks(ticks: readonly Tick[], fontSize: number, axisLengthPx: number): Tick[];
|
|
43
|
+
/**
|
|
44
|
+
* How much space an axis must reserve for its labels, at the current system
|
|
45
|
+
* font scale (FR-071).
|
|
46
|
+
*/
|
|
47
|
+
export declare function reserveAxisSpace(labels: readonly string[], fontSize: number, orientation: 'horizontal' | 'vertical'): number;
|
|
48
|
+
//# sourceMappingURL=ticks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../src/geometry/ticks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,iEAAiE;AACjE,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,MAAM,WAAW,IAAI;IACpB,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAyBD,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAiB3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,CAkBhG;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,YAAY,GAAG,UAAU,GACpC,MAAM,CAcR"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-series geometry: one stroked path per series over an instant domain.
|
|
3
|
+
*
|
|
4
|
+
* Gaps are the interesting part. A non-known value contributes `null` to the
|
|
5
|
+
* point list, `linePath` lifts the pen there, and the line simply does not
|
|
6
|
+
* exist across the gap (FR-012).
|
|
7
|
+
*
|
|
8
|
+
* PURE. No React, no SVG.
|
|
9
|
+
*/
|
|
10
|
+
import type { ChartDatasource } from '../contract/datasource';
|
|
11
|
+
import type { GeometryInput, ResolvedGeometry } from './types';
|
|
12
|
+
export interface TimeSeriesOptions {
|
|
13
|
+
/** Window supplied by the app. Users cannot draw one (pan/zoom out of scope). */
|
|
14
|
+
readonly range?: {
|
|
15
|
+
readonly from: number;
|
|
16
|
+
readonly to: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function buildTimeSeriesGeometry<M>(datasource: ChartDatasource<M>, input: GeometryInput, options?: TimeSeriesOptions): ResolvedGeometry;
|
|
20
|
+
//# sourceMappingURL=timeSeries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeSeries.d.ts","sourceRoot":"","sources":["../../../../src/geometry/timeSeries.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAU,MAAM,wBAAwB,CAAC;AAQtE,OAAO,KAAK,EAAE,aAAa,EAAY,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEzE,MAAM,WAAW,iBAAiB;IACjC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAChE;AAqBD,wBAAgB,uBAAuB,CAAC,CAAC,EACxC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,iBAAsB,GAC7B,gBAAgB,CA6HlB"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single memoized artefact each chart produces.
|
|
3
|
+
*
|
|
4
|
+
* `ResolvedGeometry` is keyed on datasource identity, plot rectangle, theme
|
|
5
|
+
* identity, and formatter identity — and deliberately **not** on selection.
|
|
6
|
+
* Highlighting a point must repaint the highlight, not recompute every scale
|
|
7
|
+
* and path string (research.md R3, FR-073).
|
|
8
|
+
*
|
|
9
|
+
* PURE. No React, no SVG.
|
|
10
|
+
*/
|
|
11
|
+
import type { SeriesPattern } from '../contract/datasource';
|
|
12
|
+
import type { NonValueTexture } from '../contract/theme';
|
|
13
|
+
import type { HitRegion } from './hitTest';
|
|
14
|
+
import type { PlotRect } from './layout';
|
|
15
|
+
import type { Tick } from './ticks';
|
|
16
|
+
/** One drawable group. Element count scales with these, never with points. */
|
|
17
|
+
export interface MarkPath {
|
|
18
|
+
readonly key: string;
|
|
19
|
+
readonly seriesId: string;
|
|
20
|
+
readonly d: string;
|
|
21
|
+
readonly color: string;
|
|
22
|
+
readonly pattern: SeriesPattern;
|
|
23
|
+
/** Filled shapes (bars, arcs, cells) versus stroked ones (lines). */
|
|
24
|
+
readonly filled: boolean;
|
|
25
|
+
/** Set on marks standing in for a non-value class: texture, not hue. */
|
|
26
|
+
readonly texture?: NonValueTexture;
|
|
27
|
+
readonly opacity?: number;
|
|
28
|
+
}
|
|
29
|
+
/** A target, baseline, or threshold drawn across the plot. */
|
|
30
|
+
export interface MarkerLine {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly d: string;
|
|
33
|
+
readonly label?: string;
|
|
34
|
+
readonly kind: 'target' | 'baseline' | 'threshold';
|
|
35
|
+
}
|
|
36
|
+
/** Text the chart draws itself, such as progress values or segment labels. */
|
|
37
|
+
export interface GeometryLabel {
|
|
38
|
+
readonly key: string;
|
|
39
|
+
readonly text: string;
|
|
40
|
+
readonly x: number;
|
|
41
|
+
readonly y: number;
|
|
42
|
+
readonly anchor: 'start' | 'middle' | 'end';
|
|
43
|
+
readonly muted?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** What a colour ramp runs from and to, for the legend that explains it. */
|
|
46
|
+
export interface ColorScale {
|
|
47
|
+
readonly min: number;
|
|
48
|
+
readonly max: number;
|
|
49
|
+
readonly colors: readonly string[];
|
|
50
|
+
}
|
|
51
|
+
export interface ResolvedGeometry {
|
|
52
|
+
readonly plot: PlotRect;
|
|
53
|
+
readonly paths: readonly MarkPath[];
|
|
54
|
+
readonly markers: readonly MarkerLine[];
|
|
55
|
+
readonly labels: readonly GeometryLabel[];
|
|
56
|
+
readonly xTicks: readonly Tick[];
|
|
57
|
+
readonly yTicks: readonly Tick[];
|
|
58
|
+
readonly hitRegions: readonly HitRegion[];
|
|
59
|
+
/** Present when colour encodes a value, as in a heatmap. */
|
|
60
|
+
readonly colorScale?: ColorScale;
|
|
61
|
+
/**
|
|
62
|
+
* True when something was excluded from a total or proportion, so the chart
|
|
63
|
+
* can say so rather than presenting a partial figure as whole (FR-013).
|
|
64
|
+
*/
|
|
65
|
+
readonly incomplete: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare const EMPTY_GEOMETRY: ResolvedGeometry;
|
|
68
|
+
/** Inputs every family geometry builder needs. */
|
|
69
|
+
export interface GeometryInput {
|
|
70
|
+
readonly plot: PlotRect;
|
|
71
|
+
readonly fontSize: number;
|
|
72
|
+
/** Resolved per series, so geometry never reaches into the theme itself. */
|
|
73
|
+
readonly seriesColors: Readonly<Record<string, string>>;
|
|
74
|
+
/**
|
|
75
|
+
* Distribution segment colours keyed by `segmentKey(seriesId, pointId)`.
|
|
76
|
+
* Only resolved for the distribution family. Point colours used to share
|
|
77
|
+
* `seriesColors`, so a point id equal to a series id overwrote that series.
|
|
78
|
+
*/
|
|
79
|
+
readonly segmentColors?: Readonly<Record<string, string>>;
|
|
80
|
+
readonly nonValueTextures: Readonly<Record<'unknown' | 'notApplicable' | 'withheld', NonValueTexture>>;
|
|
81
|
+
readonly heatmapRamp: readonly string[];
|
|
82
|
+
/** Corner radii from the theme, for bars and heatmap cells. */
|
|
83
|
+
readonly radius?: {
|
|
84
|
+
readonly bar: number;
|
|
85
|
+
readonly cell: number;
|
|
86
|
+
};
|
|
87
|
+
readonly formatValue: (value: number) => string;
|
|
88
|
+
readonly formatCategory: (raw: string) => string;
|
|
89
|
+
readonly formatInstant: (at: number) => string;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/geometry/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,8EAA8E;AAC9E,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;I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
* This is the single public entrypoint (LIB-003). Modules under `geometry/`,
|
|
6
|
+
* `render/`, `validation/`, and the internals of `react/` are private; import
|
|
7
|
+
* them only through this file. Keeping them private is what lets the geometry,
|
|
8
|
+
* the layout maths, and the rendering substrate change without a breaking
|
|
9
|
+
* release.
|
|
10
|
+
*
|
|
11
|
+
* The package makes no network request, calls no AI service, reads no
|
|
12
|
+
* database, persists nothing, and logs no data value or series label. It
|
|
13
|
+
* renders numeric data and app-supplied labels — nothing else.
|
|
14
|
+
*
|
|
15
|
+
* There is deliberately **no insight, message, or narrative surface**: apps
|
|
16
|
+
* render their own text around a chart, and a chart imposes no outer margin
|
|
17
|
+
* that would fight that layout.
|
|
18
|
+
*/
|
|
19
|
+
export type { KnownValue, NotApplicableValue, TotalResult, UnknownValue, ValueKind, ValueState, WithheldValue, } from './contract/value';
|
|
20
|
+
export { isKnown, isWithheld, known, notApplicable, participatesInTotals, sumKnown, unknown, withheld, } from './contract/value';
|
|
21
|
+
export type { CategoryPosition, ChartDatasource, ChartFamily, DataPoint, InstantPosition, MatrixPosition, Position, PositionKind, Series, SeriesPattern, } from './contract/datasource';
|
|
22
|
+
export { FAMILY_POSITION_KINDS, familyAcceptsPositionKind, resolveFormat, resolveUnit, } from './contract/datasource';
|
|
23
|
+
export type { DistributionValues } from './contract/distribution';
|
|
24
|
+
export type { MarkerKind, ProgressReading, ReferenceMarker } from './contract/marker';
|
|
25
|
+
export { findTarget, isUsableTarget, readProgress } from './contract/marker';
|
|
26
|
+
export type { ChartFormatters, FormatContext, FormatHint, SeriesRef } from './contract/format';
|
|
27
|
+
export { NON_VALUE_TEXT, formatLegendDefault, formatPositionDefault, formatValueDefault, seriesRef, } from './contract/format';
|
|
28
|
+
export type { ChartStateContent, ChartStatus, DeclarableChartStatus, StatusInputs, } from './contract/state';
|
|
29
|
+
export { STATUS_PRECEDENCE, drawsData, resolveStatus, suppressesInteraction, } from './contract/state';
|
|
30
|
+
export type { ChartError, ChartErrorCategory, ChartErrorCode, ChartFailureHandler, ChartFailureReport, } from './contract/errors';
|
|
31
|
+
export { isChartError } from './contract/errors';
|
|
32
|
+
export type { ChartInteractionEvent, InteractionProps, PointInteractionEvent, SelectionRef, SeriesInteractionEvent, } from './contract/interaction';
|
|
33
|
+
export { sameSelection } from './contract/interaction';
|
|
34
|
+
export type { ChartTheme, LegendEntry, NonValueTexture, TextStyleTokens } from './contract/theme';
|
|
35
|
+
export { defaultChartTheme, resolveSeriesColor } from './contract/theme';
|
|
36
|
+
export type { BaseChartProps, ChartAccessibility, ValueFormatter } from './contract/props';
|
|
37
|
+
export type { BudgetCheck, DatasetBudget } from './validation/budgets';
|
|
38
|
+
export { DATASET_BUDGETS, checkBudget } from './validation/budgets';
|
|
39
|
+
export type { BarChartProps, DistributionChartProps, HeatmapChartProps, ProgressChartProps, TimeSeriesChartProps, } from './react/charts';
|
|
40
|
+
export { BarChart, DistributionChart, HeatmapChart, ProgressChart, TimeSeriesChart, } from './react/charts';
|
|
41
|
+
export { ChartLegend, ColorScaleLegend, buildLegendEntries } from './react/ChartLegend';
|
|
42
|
+
export type { ColorScale } from './geometry/types';
|
|
43
|
+
export { ChartThemeProvider, useChartTheme } from './react/ChartThemeProvider';
|
|
44
|
+
export { buildChartSummary, buildPointAnnouncement, buildTotalAnnouncement } from './a11y/summary';
|
|
45
|
+
export { chartStrings } from './contract/strings';
|
|
46
|
+
export type { ChartStringKey, ChartStrings } from './contract/strings';
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,YAAY,EACX,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,aAAa,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,OAAO,EACP,UAAU,EACV,KAAK,EACL,aAAa,EAC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,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKzE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAK3F,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKpE,YAAY,EACX,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,GACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxF,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAK/E,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAGnG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-chart render-failure containment (FR-038a, FR-038b).
|
|
3
|
+
*
|
|
4
|
+
* React 19 still has no hook equivalent of an error boundary —
|
|
5
|
+
* `getDerivedStateFromError` and `componentDidCatch` remain class-only — so
|
|
6
|
+
* this is a class. Forty lines beats adding a dependency for it.
|
|
7
|
+
*
|
|
8
|
+
* Three behaviours are deliberate:
|
|
9
|
+
*
|
|
10
|
+
* - **Reset only on a real change.** The boundary clears its error when the
|
|
11
|
+
* datasource identity or chart key changes, never on an unrelated parent
|
|
12
|
+
* re-render. A deterministic geometry defect therefore cannot pin the CPU in
|
|
13
|
+
* a render-fail-render loop.
|
|
14
|
+
* - **Report once per distinct failure.** De-duplicated by signature, so a
|
|
15
|
+
* chart re-rendered by a sibling's state change does not re-report.
|
|
16
|
+
* - **Redact.** The report carries the chart identity and a catalogue message.
|
|
17
|
+
* A third-party exception's own text is never copied in, because we cannot
|
|
18
|
+
* promise it is free of data (POL-011).
|
|
19
|
+
*/
|
|
20
|
+
import React from 'react';
|
|
21
|
+
import type { ChartFamily } from '../contract/datasource';
|
|
22
|
+
import { type ChartError, type ChartFailureHandler } from '../contract/errors';
|
|
23
|
+
interface Props {
|
|
24
|
+
readonly family: ChartFamily;
|
|
25
|
+
readonly chartId?: string;
|
|
26
|
+
readonly onFailure?: ChartFailureHandler;
|
|
27
|
+
/** Changing this clears a contained failure. */
|
|
28
|
+
readonly resetKey: unknown;
|
|
29
|
+
readonly renderFallback: (error: ChartError) => React.ReactNode;
|
|
30
|
+
readonly children: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
interface State {
|
|
33
|
+
readonly error?: ChartError;
|
|
34
|
+
readonly resetKey: unknown;
|
|
35
|
+
readonly reportedSignature?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare class ChartBoundary extends React.Component<Props, State> {
|
|
38
|
+
constructor(props: Props);
|
|
39
|
+
static getDerivedStateFromProps(props: Props, state: State): State | null;
|
|
40
|
+
static getDerivedStateFromError(): Partial<State>;
|
|
41
|
+
componentDidCatch(error: unknown, info: {
|
|
42
|
+
componentStack?: string;
|
|
43
|
+
}): void;
|
|
44
|
+
render(): React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=ChartBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AAS;CAMlC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared chart shell.
|
|
3
|
+
*
|
|
4
|
+
* Every family routes through here, so validation, status resolution, budget
|
|
5
|
+
* checks, theming, layout, selection, accessibility, and failure containment
|
|
6
|
+
* are written once and behave identically across all five. The pieces live in
|
|
7
|
+
* their own hooks and components; this file is the order they run in.
|
|
8
|
+
*
|
|
9
|
+
* Layout note (FR-039): the frame imposes **no outer margin**. Insight text is
|
|
10
|
+
* out of scope for this package, so apps render their own text directly above
|
|
11
|
+
* or below a chart and must not have to fight a margin they cannot control.
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import type { ChartDatasource, ChartFamily } from '../contract/datasource';
|
|
15
|
+
import type { DistributionValues } from '../contract/distribution';
|
|
16
|
+
import type { BaseChartProps } from '../contract/props';
|
|
17
|
+
import type { GeometryInput, ResolvedGeometry } from '../geometry/types';
|
|
18
|
+
import { type ChartAxes } from './ChartPlot';
|
|
19
|
+
export interface ChartFrameProps<M> extends BaseChartProps<M> {
|
|
20
|
+
readonly family: ChartFamily;
|
|
21
|
+
readonly buildGeometry: (datasource: ChartDatasource<M>, input: GeometryInput) => ResolvedGeometry;
|
|
22
|
+
/** Time-series selection tracks the x axis; other families use proximity. */
|
|
23
|
+
readonly hitTestMode?: 'nearest' | 'byX';
|
|
24
|
+
/** `full` by default: axis lines, grid and tick labels. */
|
|
25
|
+
readonly axes?: ChartAxes;
|
|
26
|
+
readonly defaultLegend?: boolean;
|
|
27
|
+
/** What a distribution's values mean, when the app says. */
|
|
28
|
+
readonly distributionValues?: DistributionValues;
|
|
29
|
+
}
|
|
30
|
+
export declare function ChartFrame<M>(props: ChartFrameProps<M>): React.JSX.Element;
|
|
31
|
+
//# sourceMappingURL=ChartFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartFrame.d.ts","sourceRoot":"","sources":["../../../../src/react/ChartFrame.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAyB,MAAM,OAAO,CAAC;AAI9C,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKzE,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxD,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,CACvB,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,aAAa,KAChB,gBAAgB,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACjD;AAID,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,qBAiRtD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChartDatasource, ChartFamily } from '../contract/datasource';
|
|
3
|
+
import type { SeriesRef } from '../contract/format';
|
|
4
|
+
import { type ChartStrings } from '../contract/strings';
|
|
5
|
+
import { type ChartTheme, type LegendEntry } from '../contract/theme';
|
|
6
|
+
import type { ColorScale } from '../geometry/types';
|
|
7
|
+
/**
|
|
8
|
+
* Legend model. A distribution chart gets one entry per segment, in the colour
|
|
9
|
+
* its arc is drawn in; it used to get one per series, so a one-series donut of
|
|
10
|
+
* four segments showed a single entry (CHT-02).
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildLegendEntries<M>(datasource: ChartDatasource<M>, theme: ChartTheme, hidden: ReadonlySet<string>, toggleable: boolean, family?: ChartFamily,
|
|
13
|
+
/** The app's `legendLabel` formatter, when it has one. */
|
|
14
|
+
formatLabel?: (series: SeriesRef) => string): LegendEntry[];
|
|
15
|
+
export declare function ChartLegend({ entries, theme, onToggle, strings, }: {
|
|
16
|
+
readonly entries: readonly LegendEntry[];
|
|
17
|
+
readonly theme: ChartTheme;
|
|
18
|
+
readonly onToggle?: (seriesId: string) => void;
|
|
19
|
+
readonly strings?: ChartStrings;
|
|
20
|
+
}): React.JSX.Element | null;
|
|
21
|
+
/**
|
|
22
|
+
* The key to a colour ramp: its lowest and highest value around the colours
|
|
23
|
+
* between them. Without it a heatmap's shades meant nothing (CHT-15).
|
|
24
|
+
*/
|
|
25
|
+
export declare function ColorScaleLegend({ scale, theme, formatValue, strings, }: {
|
|
26
|
+
readonly scale: ColorScale;
|
|
27
|
+
readonly theme: ChartTheme;
|
|
28
|
+
readonly formatValue: (value: number) => string;
|
|
29
|
+
readonly strings?: ChartStrings;
|
|
30
|
+
}): React.JSX.Element;
|
|
31
|
+
//# sourceMappingURL=ChartLegend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../../src/react/ChartLegend.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,qBA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ting a point re-renders the frame and moves
|
|
5
|
+
* the highlight, and this subtree — the long path strings — is skipped
|
|
6
|
+
* (CHT-08). It used to be reconciled again on every tap.
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { ChartTheme } from '../contract/theme';
|
|
10
|
+
import type { ResolvedGeometry } from '../geometry/types';
|
|
11
|
+
/** `labels` names rows and columns without drawing axis lines or a grid. */
|
|
12
|
+
export type ChartAxes = 'full' | 'labels' | 'none';
|
|
13
|
+
export declare const ChartPlot: React.NamedExoticComponent<{
|
|
14
|
+
readonly geometry: ResolvedGeometry;
|
|
15
|
+
readonly theme: ChartTheme;
|
|
16
|
+
readonly fontSize: number;
|
|
17
|
+
readonly axes: ChartAxes;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=ChartPlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartPlot.d.ts","sourceRoot":"","sources":["../../../../src/react/ChartPlot.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnD,eAAO,MAAM,SAAS;uBAMF,gBAAgB;oBACnB,UAAU;uBACP,MAAM;mBACV,SAAS;EA8BvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a chart shows in place of data: the app's own content for the state,
|
|
3
|
+
* or a terse built-in line. Apps are expected to supply their own copy — the
|
|
4
|
+
* package must not impose product voice.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { ChartError } from '../contract/errors';
|
|
8
|
+
import type { ChartStatus } from '../contract/state';
|
|
9
|
+
import type { ChartStrings } from '../contract/strings';
|
|
10
|
+
import type { ChartTheme } from '../contract/theme';
|
|
11
|
+
export declare function ChartStateOverlay({ status, supplied, strings, theme, error, }: {
|
|
12
|
+
readonly status: ChartStatus;
|
|
13
|
+
/** The app's content for this state, when it gave any. */
|
|
14
|
+
readonly supplied?: React.ReactNode;
|
|
15
|
+
readonly strings: ChartStrings;
|
|
16
|
+
readonly theme: ChartTheme;
|
|
17
|
+
readonly error?: ChartError;
|
|
18
|
+
}): React.JSX.Element | null;
|
|
19
|
+
/** The message a contained render failure shows where the plot was. */
|
|
20
|
+
export declare function ChartFailureOverlay({ supplied, theme, error, }: {
|
|
21
|
+
readonly supplied?: React.ReactNode;
|
|
22
|
+
readonly theme: ChartTheme;
|
|
23
|
+
readonly error: ChartError;
|
|
24
|
+
}): React.JSX.Element;
|
|
25
|
+
//# sourceMappingURL=ChartStateOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartStateOverlay.d.ts","sourceRoot":"","sources":["../../../../src/react/ChartStateOverlay.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAqBpD,wBAAgB,iBAAiB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,GACL,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;CAC5B,4BAeA;AAED,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,EACnC,QAAQ,EACR,KAAK,EACL,KAAK,GACL,EAAE;IACF,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC3B,qBAUA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme resolution: prop -> context -> built-in default keyed on the OS scheme.
|
|
3
|
+
*
|
|
4
|
+
* The dependency is inverted on purpose. The package declares a `ChartTheme`
|
|
5
|
+
* value type and any design system can satisfy it, which is what keeps
|
|
6
|
+
* `@chipmobilesdk/rn-theme` and `react-native-unistyles` out of this package
|
|
7
|
+
* entirely (FR-065, LIB-004).
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { type ChartTheme } from '../contract/theme';
|
|
11
|
+
export declare function ChartThemeProvider({ theme, children, }: {
|
|
12
|
+
readonly theme: ChartTheme;
|
|
13
|
+
readonly children: React.ReactNode;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* An explicit prop wins, then context, then the built-in default for the
|
|
17
|
+
* current OS colour scheme — so a chart renders correctly with no theme
|
|
18
|
+
* configuration at all.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useChartTheme(explicit?: ChartTheme): ChartTheme;
|
|
21
|
+
//# sourceMappingURL=ChartThemeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/react/ChartThemeProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAA6C,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIvE,wBAAgB,kBAAkB,CAAC,EAClC,KAAK,EACL,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC,qBAEA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,CAa/D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The five chart family components.
|
|
3
|
+
*
|
|
4
|
+
* Each is a thin wrapper over `ChartFrame` plus its own geometry builder, so
|
|
5
|
+
* validation, state handling, theming, selection, accessibility, and failure
|
|
6
|
+
* containment behave identically across every family.
|
|
7
|
+
*
|
|
8
|
+
* All five are wrapped in `React.memo`: value-identical props stop at the memo
|
|
9
|
+
* boundary and never reach geometry (FR-073, SC-017).
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import type { DistributionValues } from '../contract/distribution';
|
|
13
|
+
import type { BaseChartProps } from '../contract/props';
|
|
14
|
+
import { type BarGrouping } from '../geometry/bar';
|
|
15
|
+
import { type DistributionShape } from '../geometry/distribution';
|
|
16
|
+
export type ProgressChartProps<M = unknown> = BaseChartProps<M>;
|
|
17
|
+
export interface DistributionChartProps<M = unknown> extends BaseChartProps<M> {
|
|
18
|
+
readonly shape?: DistributionShape;
|
|
19
|
+
readonly innerRadiusRatio?: number;
|
|
20
|
+
/**
|
|
21
|
+
* What the values mean. `proportions`: shares of a whole in 0..1, drawn short
|
|
22
|
+
* and marked incomplete when they do not reach 1. `absolute`: counts or
|
|
23
|
+
* amounts, normalised by their total. Inferred from the data when omitted;
|
|
24
|
+
* say it when small counts (1 and 1) could be read as shares.
|
|
25
|
+
*/
|
|
26
|
+
readonly valuesAre?: DistributionValues;
|
|
27
|
+
}
|
|
28
|
+
export interface TimeSeriesChartProps<M = unknown> extends BaseChartProps<M> {
|
|
29
|
+
/** A window the app supplies. Users cannot pan or zoom (out of scope). */
|
|
30
|
+
readonly range?: {
|
|
31
|
+
readonly from: number;
|
|
32
|
+
readonly to: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface BarChartProps<M = unknown> extends BaseChartProps<M> {
|
|
36
|
+
readonly grouping?: BarGrouping;
|
|
37
|
+
}
|
|
38
|
+
export interface HeatmapChartProps<M = unknown> extends BaseChartProps<M> {
|
|
39
|
+
readonly buckets?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `React.memo` erases the generic parameter, so each component is re-cast to a
|
|
43
|
+
* generic function type. This keeps `<BarChart<MyMeta> ... />` working for
|
|
44
|
+
* consumers while still getting the memo boundary.
|
|
45
|
+
*/
|
|
46
|
+
export declare const ProgressChart: <M = unknown>(props: ProgressChartProps<M>) => React.ReactElement;
|
|
47
|
+
export declare const DistributionChart: <M = unknown>(props: DistributionChartProps<M>) => React.ReactElement;
|
|
48
|
+
export declare const TimeSeriesChart: <M = unknown>(props: TimeSeriesChartProps<M>) => React.ReactElement;
|
|
49
|
+
export declare const BarChart: <M = unknown>(props: BarChartProps<M>) => React.ReactElement;
|
|
50
|
+
export declare const HeatmapChart: <M = unknown>(props: HeatmapChartProps<M>) => React.ReactElement;
|
|
51
|
+
//# sourceMappingURL=charts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"charts.d.ts","sourceRoot":"","sources":["../../../../src/react/charts.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,iBAAiB,C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AC;AAExB,eAAO,MAAM,eAAe,EAAsC,CAAC,CAAC,GAAG,OAAO,EAC7E,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAC1B,KAAK,CAAC,YAAY,CAAC;AAExB,eAAO,MAAM,QAAQ,EAA+B,CAAC,CAAC,GAAG,OAAO,EAC/D,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KACnB,KAAK,CAAC,YAAY,CAAC;AAExB,eAAO,MAAM,YAAY,EAAmC,CAAC,CAAC,GAAG,OAAO,EACvE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,KACvB,KAAK,CAAC,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The event a selected point is reported with. One place builds it, for a tap
|
|
3
|
+
* and for a screen-reader step alike.
|
|
4
|
+
*/
|
|
5
|
+
import type { ChartDatasource, DataPoint, Series } from '../contract/datasource';
|
|
6
|
+
import type { PointInteractionEvent } from '../contract/interaction';
|
|
7
|
+
export interface ResolvedPoint<M> {
|
|
8
|
+
readonly series: Series<M>;
|
|
9
|
+
readonly point: DataPoint<M>;
|
|
10
|
+
}
|
|
11
|
+
export declare function findPoint<M>(datasource: ChartDatasource<M>, seriesId: string, pointId: string | undefined): ResolvedPoint<M> | undefined;
|
|
12
|
+
export declare function pointEventFor<M>(datasource: ChartDatasource<M>, seriesId: string, pointId: string): PointInteractionEvent<M> | undefined;
|
|
13
|
+
//# sourceMappingURL=pointEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointEvent.d.ts","sourceRoot":"","sources":["../../../../src/react/pointEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CAC7B;AAED,wBAAgB,SAAS,CAAC,CAAC,EAC1B,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GAAG,SAAS,GACzB,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAI9B;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC9B,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACb,qBAAqB,CAAC,CAAC,CAAC,GAAG,SAAS,CAatC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ChartDatasource, ChartFamily } from '../contract/datasource';
|
|
2
|
+
import type { ChartAccessibility } from '../contract/props';
|
|
3
|
+
import type { ChartStatus } from '../contract/state';
|
|
4
|
+
import type { ChartStrings } from '../contract/strings';
|
|
5
|
+
import type { HitRegion } from '../geometry/hitTest';
|
|
6
|
+
import type { ResolvedFormatters } from './useChartFormatters';
|
|
7
|
+
import type { ChartSelectionApi } from './useChartSelection';
|
|
8
|
+
export interface UseChartA11yArgs<M> {
|
|
9
|
+
readonly datasource: ChartDatasource<M>;
|
|
10
|
+
readonly family: ChartFamily;
|
|
11
|
+
readonly status: ChartStatus;
|
|
12
|
+
readonly title?: string;
|
|
13
|
+
readonly accessibility?: ChartAccessibility<M>;
|
|
14
|
+
readonly interactive: boolean;
|
|
15
|
+
readonly incomplete: boolean;
|
|
16
|
+
readonly hitRegions: readonly HitRegion[];
|
|
17
|
+
readonly selection: ChartSelectionApi<M>;
|
|
18
|
+
readonly formatters: ResolvedFormatters;
|
|
19
|
+
readonly strings: ChartStrings;
|
|
20
|
+
}
|
|
21
|
+
export interface ChartA11y {
|
|
22
|
+
readonly summary: string;
|
|
23
|
+
readonly value: {
|
|
24
|
+
readonly text: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
readonly actions: readonly {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly label: string;
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
readonly onAction: ((event: {
|
|
31
|
+
nativeEvent: {
|
|
32
|
+
actionName: string;
|
|
33
|
+
};
|
|
34
|
+
}) => void) | undefined;
|
|
35
|
+
}
|
|
36
|
+
export declare function useChartA11y<M>(args: UseChartA11yArgs<M>): ChartA11y;
|
|
37
|
+
//# sourceMappingURL=useChartA11y.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChartA11y.d.ts","sourceRoot":"","sources":["../../../../src/react/useChartA11y.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC/C,QAAQ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