@chipmobilesdk/rn-chart 0.3.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 +129 -0
- package/README.md +45 -3
- 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
- package/skills/sdk-rn-chart/SKILL.md +49 -14
- package/src/a11y/summary.ts +34 -15
- package/src/contract/distribution.ts +44 -0
- package/src/contract/errors.ts +6 -0
- package/src/contract/interaction.ts +2 -2
- package/src/contract/strings.ts +2 -0
- package/src/geometry/bar.ts +27 -16
- package/src/geometry/distribution.ts +11 -6
- package/src/geometry/heatmap.ts +34 -17
- package/src/geometry/hitTest.ts +35 -0
- package/src/geometry/progress.ts +0 -1
- package/src/geometry/ticks.ts +0 -13
- package/src/geometry/timeSeries.ts +7 -2
- package/src/geometry/types.ts +11 -0
- package/src/index.ts +4 -1
- package/src/react/ChartFrame.tsx +126 -373
- package/src/react/ChartLegend.tsx +60 -3
- package/src/react/ChartPlot.tsx +57 -0
- package/src/react/ChartStateOverlay.tsx +94 -0
- package/src/react/charts.tsx +27 -12
- package/src/react/pointEvent.ts +40 -0
- package/src/react/useChartA11y.ts +113 -0
- package/src/react/useChartFormatters.ts +105 -0
- package/src/react/useChartLayout.ts +5 -2
- package/src/react/useChartSelection.ts +77 -40
- package/src/react/useChartStatus.ts +85 -0
- package/src/render/Axis.tsx +26 -22
- package/src/render/Marks.tsx +2 -9
- package/src/validation/budgets.ts +6 -4
- package/src/validation/validateDatasource.ts +38 -14
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EMPTY_GEOMETRY = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* The single memoized artefact each chart produces.
|
|
9
|
+
*
|
|
10
|
+
* `ResolvedGeometry` is keyed on datasource identity, plot rectangle, theme
|
|
11
|
+
* identity, and formatter identity — and deliberately **not** on selection.
|
|
12
|
+
* Highlighting a point must repaint the highlight, not recompute every scale
|
|
13
|
+
* and path string (research.md R3, FR-073).
|
|
14
|
+
*
|
|
15
|
+
* PURE. No React, no SVG.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** One drawable group. Element count scales with these, never with points. */
|
|
19
|
+
|
|
20
|
+
/** A target, baseline, or threshold drawn across the plot. */
|
|
21
|
+
|
|
22
|
+
/** Text the chart draws itself, such as progress values or segment labels. */
|
|
23
|
+
|
|
24
|
+
/** What a colour ramp runs from and to, for the legend that explains it. */
|
|
25
|
+
|
|
26
|
+
const EMPTY_GEOMETRY = exports.EMPTY_GEOMETRY = {
|
|
27
|
+
plot: {
|
|
28
|
+
x: 0,
|
|
29
|
+
y: 0,
|
|
30
|
+
width: 0,
|
|
31
|
+
height: 0
|
|
32
|
+
},
|
|
33
|
+
paths: [],
|
|
34
|
+
markers: [],
|
|
35
|
+
labels: [],
|
|
36
|
+
xTicks: [],
|
|
37
|
+
yTicks: [],
|
|
38
|
+
hitRegions: [],
|
|
39
|
+
incomplete: false
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Inputs every family geometry builder needs. */
|
|
43
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EMPTY_GEOMETRY","exports","plot","x","y","width","height","paths","markers","labels","xTicks","yTicks","hitRegions","incomplete"],"sourceRoot":"../../../src","sources":["geometry/types.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;;AAcA;;AAQA;;AAUA;;AAwBO,MAAMA,cAAgC,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC/CE,IAAI,EAAE;IAAEC,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC;EACzCC,KAAK,EAAE,EAAE;EACTC,OAAO,EAAE,EAAE;EACXC,MAAM,EAAE,EAAE;EACVC,MAAM,EAAE,EAAE;EACVC,MAAM,EAAE,EAAE;EACVC,UAAU,EAAE,EAAE;EACdC,UAAU,EAAE;AACb,CAAC;;AAED","ignoreList":[]}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BarChart", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _charts.BarChart;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ChartLegend", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ChartLegend.ChartLegend;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ChartThemeProvider", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _ChartThemeProvider.ChartThemeProvider;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ColorScaleLegend", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _ChartLegend.ColorScaleLegend;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "DATASET_BUDGETS", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _budgets.DATASET_BUDGETS;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "DistributionChart", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _charts.DistributionChart;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "FAMILY_POSITION_KINDS", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _datasource.FAMILY_POSITION_KINDS;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "HeatmapChart", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _charts.HeatmapChart;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "NON_VALUE_TEXT", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _format.NON_VALUE_TEXT;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "ProgressChart", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _charts.ProgressChart;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "STATUS_PRECEDENCE", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _state.STATUS_PRECEDENCE;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "TimeSeriesChart", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _charts.TimeSeriesChart;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "buildChartSummary", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _summary.buildChartSummary;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "buildLegendEntries", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _ChartLegend.buildLegendEntries;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "buildPointAnnouncement", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _summary.buildPointAnnouncement;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "buildTotalAnnouncement", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _summary.buildTotalAnnouncement;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "chartStrings", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _strings.chartStrings;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "checkBudget", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _budgets.checkBudget;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "defaultChartTheme", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _theme.defaultChartTheme;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "drawsData", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _state.drawsData;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "familyAcceptsPositionKind", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _datasource.familyAcceptsPositionKind;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "findTarget", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _marker.findTarget;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "formatLegendDefault", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _format.formatLegendDefault;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "formatPositionDefault", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _format.formatPositionDefault;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "formatValueDefault", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _format.formatValueDefault;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "isChartError", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _errors.isChartError;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "isKnown", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _value.isKnown;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "isUsableTarget", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _marker.isUsableTarget;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "isWithheld", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _value.isWithheld;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "known", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _value.known;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "notApplicable", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _value.notApplicable;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "participatesInTotals", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _value.participatesInTotals;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "readProgress", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _marker.readProgress;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "resolveFormat", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _datasource.resolveFormat;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "resolveSeriesColor", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _theme.resolveSeriesColor;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "resolveStatus", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _state.resolveStatus;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "resolveUnit", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return _datasource.resolveUnit;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "sameSelection", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _interaction.sameSelection;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "seriesRef", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () {
|
|
237
|
+
return _format.seriesRef;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "sumKnown", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return _value.sumKnown;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(exports, "suppressesInteraction", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () {
|
|
249
|
+
return _state.suppressesInteraction;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(exports, "unknown", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function () {
|
|
255
|
+
return _value.unknown;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(exports, "useChartTheme", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function () {
|
|
261
|
+
return _ChartThemeProvider.useChartTheme;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, "withheld", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: function () {
|
|
267
|
+
return _value.withheld;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
var _value = require("./contract/value.js");
|
|
271
|
+
var _datasource = require("./contract/datasource.js");
|
|
272
|
+
var _marker = require("./contract/marker.js");
|
|
273
|
+
var _format = require("./contract/format.js");
|
|
274
|
+
var _state = require("./contract/state.js");
|
|
275
|
+
var _errors = require("./contract/errors.js");
|
|
276
|
+
var _interaction = require("./contract/interaction.js");
|
|
277
|
+
var _theme = require("./contract/theme.js");
|
|
278
|
+
var _budgets = require("./validation/budgets.js");
|
|
279
|
+
var _charts = require("./react/charts.js");
|
|
280
|
+
var _ChartLegend = require("./react/ChartLegend.js");
|
|
281
|
+
var _ChartThemeProvider = require("./react/ChartThemeProvider.js");
|
|
282
|
+
var _summary = require("./a11y/summary.js");
|
|
283
|
+
var _strings = require("./contract/strings.js");
|
|
284
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_value","require","_datasource","_marker","_format","_state","_errors","_interaction","_theme","_budgets","_charts","_ChartLegend","_ChartThemeProvider","_summary","_strings"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAAA,MAAA,GAAAC,OAAA;AA0BA,IAAAC,WAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AAMA,IAAAG,OAAA,GAAAH,OAAA;AAiBA,IAAAI,MAAA,GAAAJ,OAAA;AAcA,IAAAK,OAAA,GAAAL,OAAA;AAYA,IAAAM,YAAA,GAAAN,OAAA;AAMA,IAAAO,MAAA,GAAAP,OAAA;AAWA,IAAAQ,QAAA,GAAAR,OAAA;AAYA,IAAAS,OAAA,GAAAT,OAAA;AAQA,IAAAU,YAAA,GAAAV,OAAA;AAEA,IAAAW,mBAAA,GAAAX,OAAA;AAKA,IAAAY,QAAA,GAAAZ,OAAA;AAGA,IAAAa,QAAA,GAAAb,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ChartBoundary = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _errors = require("../contract/errors.js");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
/**
|
|
11
|
+
* Per-chart render-failure containment (FR-038a, FR-038b).
|
|
12
|
+
*
|
|
13
|
+
* React 19 still has no hook equivalent of an error boundary —
|
|
14
|
+
* `getDerivedStateFromError` and `componentDidCatch` remain class-only — so
|
|
15
|
+
* this is a class. Forty lines beats adding a dependency for it.
|
|
16
|
+
*
|
|
17
|
+
* Three behaviours are deliberate:
|
|
18
|
+
*
|
|
19
|
+
* - **Reset only on a real change.** The boundary clears its error when the
|
|
20
|
+
* datasource identity or chart key changes, never on an unrelated parent
|
|
21
|
+
* re-render. A deterministic geometry defect therefore cannot pin the CPU in
|
|
22
|
+
* a render-fail-render loop.
|
|
23
|
+
* - **Report once per distinct failure.** De-duplicated by signature, so a
|
|
24
|
+
* chart re-rendered by a sibling's state change does not re-report.
|
|
25
|
+
* - **Redact.** The report carries the chart identity and a catalogue message.
|
|
26
|
+
* A third-party exception's own text is never copied in, because we cannot
|
|
27
|
+
* promise it is free of data (POL-011).
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
class ChartBoundary extends _react.default.Component {
|
|
31
|
+
constructor(props) {
|
|
32
|
+
super(props);
|
|
33
|
+
this.state = {
|
|
34
|
+
resetKey: props.resetKey
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static getDerivedStateFromProps(props, state) {
|
|
38
|
+
if (props.resetKey !== state.resetKey) {
|
|
39
|
+
// New data: give the chart another chance.
|
|
40
|
+
return {
|
|
41
|
+
resetKey: props.resetKey,
|
|
42
|
+
error: undefined
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
static getDerivedStateFromError() {
|
|
48
|
+
// This must set the error, not just acknowledge it. Returning an empty
|
|
49
|
+
// object leaves render() showing the children again, they throw again,
|
|
50
|
+
// and React escalates past the boundary — which is exactly the
|
|
51
|
+
// screen-blanking failure this class exists to prevent.
|
|
52
|
+
//
|
|
53
|
+
// componentDidCatch then refines this into a report carrying the chart
|
|
54
|
+
// identity and family.
|
|
55
|
+
return {
|
|
56
|
+
error: (0, _errors.chartError)('render', 'renderException')
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
componentDidCatch(error, info) {
|
|
60
|
+
const report = (0, _errors.toFailureReport)(this.props.family, error, this.props.chartId, info?.componentStack ?? undefined);
|
|
61
|
+
const signature = (0, _errors.failureSignature)(report);
|
|
62
|
+
if (this.state.reportedSignature === signature) {
|
|
63
|
+
this.setState({
|
|
64
|
+
error: report.error
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this.setState({
|
|
69
|
+
error: report.error,
|
|
70
|
+
reportedSignature: signature
|
|
71
|
+
});
|
|
72
|
+
this.props.onFailure?.(report);
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
if (this.state.error) {
|
|
76
|
+
return this.props.renderFallback(this.state.error);
|
|
77
|
+
}
|
|
78
|
+
return this.props.children;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.ChartBoundary = ChartBoundary;
|
|
82
|
+
//# sourceMappingURL=ChartBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_errors","e","__esModule","default","ChartBoundary","React","Component","constructor","props","state","resetKey","getDerivedStateFromProps","error","undefined","getDerivedStateFromError","chartError","componentDidCatch","info","report","toFailureReport","family","chartId","componentStack","signature","failureSignature","reportedSignature","setState","onFailure","render","renderFallback","children","exports"],"sourceRoot":"../../../src","sources":["react/ChartBoundary.tsx"],"mappings":";;;;;;AAmBA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAM4B,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA5B5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4BO,MAAMG,aAAa,SAASC,cAAK,CAACC,SAAS,CAAe;EAChEC,WAAWA,CAACC,KAAY,EAAE;IACzB,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;MAAEC,QAAQ,EAAEF,KAAK,CAACE;IAAS,CAAC;EAC1C;EAEA,OAAOC,wBAAwBA,CAACH,KAAY,EAAEC,KAAY,EAAgB;IACzE,IAAID,KAAK,CAACE,QAAQ,KAAKD,KAAK,CAACC,QAAQ,EAAE;MACtC;MACA,OAAO;QAAEA,QAAQ,EAAEF,KAAK,CAACE,QAAQ;QAAEE,KAAK,EAAEC;MAAU,CAAC;IACtD;IACA,OAAO,IAAI;EACZ;EAEA,OAAOC,wBAAwBA,CAAA,EAAmB;IACjD;IACA;IACA;IACA;IACA;IACA;IACA;IACA,OAAO;MAAEF,KAAK,EAAE,IAAAG,kBAAU,EAAC,QAAQ,EAAE,iBAAiB;IAAE,CAAC;EAC1D;EAESC,iBAAiBA,CAACJ,KAAc,EAAEK,IAAiC,EAAQ;IACnF,MAAMC,MAAM,GAAG,IAAAC,uBAAe,EAC7B,IAAI,CAACX,KAAK,CAACY,MAAM,EACjBR,KAAK,EACL,IAAI,CAACJ,KAAK,CAACa,OAAO,EAClBJ,IAAI,EAAEK,cAAc,IAAIT,SACzB,CAAC;IAED,MAAMU,SAAS,GAAG,IAAAC,wBAAgB,EAACN,MAAM,CAAC;IAC1C,IAAI,IAAI,CAACT,KAAK,CAACgB,iBAAiB,KAAKF,SAAS,EAAE;MAC/C,IAAI,CAACG,QAAQ,CAAC;QAAEd,KAAK,EAAEM,MAAM,CAACN;MAAM,CAAC,CAAC;MACtC;IACD;IAEA,IAAI,CAACc,QAAQ,CAAC;MAAEd,KAAK,EAAEM,MAAM,CAACN,KAAK;MAAEa,iBAAiB,EAAEF;IAAU,CAAC,CAAC;IACpE,IAAI,CAACf,KAAK,CAACmB,SAAS,GAAGT,MAAM,CAAC;EAC/B;EAESU,MAAMA,CAAA,EAAoB;IAClC,IAAI,IAAI,CAACnB,KAAK,CAACG,KAAK,EAAE;MACrB,OAAO,IAAI,CAACJ,KAAK,CAACqB,cAAc,CAAC,IAAI,CAACpB,KAAK,CAACG,KAAK,CAAC;IACnD;IACA,OAAO,IAAI,CAACJ,KAAK,CAACsB,QAAQ;EAC3B;AACD;AAACC,OAAA,CAAA3B,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ChartFrame = ChartFrame;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeSvg = _interopRequireDefault(require("react-native-svg"));
|
|
10
|
+
var _state = require("../contract/state.js");
|
|
11
|
+
var _strings = require("../contract/strings.js");
|
|
12
|
+
var _hitTest = require("../geometry/hitTest.js");
|
|
13
|
+
var _layout = require("../geometry/layout.js");
|
|
14
|
+
var _types = require("../geometry/types.js");
|
|
15
|
+
var _Marks = require("../render/Marks.js");
|
|
16
|
+
var _ChartBoundary = require("./ChartBoundary.js");
|
|
17
|
+
var _ChartLegend = require("./ChartLegend.js");
|
|
18
|
+
var _ChartPlot = require("./ChartPlot.js");
|
|
19
|
+
var _ChartStateOverlay = require("./ChartStateOverlay.js");
|
|
20
|
+
var _ChartThemeProvider = require("./ChartThemeProvider.js");
|
|
21
|
+
var _pointEvent = require("./pointEvent.js");
|
|
22
|
+
var _useChartA11y = require("./useChartA11y.js");
|
|
23
|
+
var _useChartFormatters = require("./useChartFormatters.js");
|
|
24
|
+
var _useChartLayout = require("./useChartLayout.js");
|
|
25
|
+
var _useChartSelection = require("./useChartSelection.js");
|
|
26
|
+
var _useChartStatus = require("./useChartStatus.js");
|
|
27
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
30
|
+
/**
|
|
31
|
+
* The shared chart shell.
|
|
32
|
+
*
|
|
33
|
+
* Every family routes through here, so validation, status resolution, budget
|
|
34
|
+
* checks, theming, layout, selection, accessibility, and failure containment
|
|
35
|
+
* are written once and behave identically across all five. The pieces live in
|
|
36
|
+
* their own hooks and components; this file is the order they run in.
|
|
37
|
+
*
|
|
38
|
+
* Layout note (FR-039): the frame imposes **no outer margin**. Insight text is
|
|
39
|
+
* out of scope for this package, so apps render their own text directly above
|
|
40
|
+
* or below a chart and must not have to fight a margin they cannot control.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
const DEFAULT_HEIGHT = 220;
|
|
44
|
+
function ChartFrame(props) {
|
|
45
|
+
const family = props.family;
|
|
46
|
+
const theme = (0, _ChartThemeProvider.useChartTheme)(props.theme);
|
|
47
|
+
const strings = (0, _react.useMemo)(() => _strings.chartStrings.resolve(props.strings), [props.strings]);
|
|
48
|
+
const generatedId = (0, _react.useId)();
|
|
49
|
+
const instanceKey = props.chartId ?? generatedId;
|
|
50
|
+
const {
|
|
51
|
+
validation,
|
|
52
|
+
error,
|
|
53
|
+
status
|
|
54
|
+
} = (0, _useChartStatus.useChartStatus)({
|
|
55
|
+
datasource: props.datasource,
|
|
56
|
+
family,
|
|
57
|
+
chartId: props.chartId,
|
|
58
|
+
instanceKey,
|
|
59
|
+
declared: props.status,
|
|
60
|
+
onFailure: props.onFailure,
|
|
61
|
+
distributionValues: props.distributionValues
|
|
62
|
+
});
|
|
63
|
+
const formatters = (0, _useChartFormatters.useChartFormatters)(props.formatters, props.datasource.format, instanceKey);
|
|
64
|
+
const layout = (0, _useChartLayout.useChartLayout)(theme, {
|
|
65
|
+
height: props.height
|
|
66
|
+
});
|
|
67
|
+
const geometryInput = (0, _useChartLayout.useGeometryInput)(props.datasource, theme, layout, formatters.geometry, family);
|
|
68
|
+
const showData = (0, _state.drawsData)(status);
|
|
69
|
+
const visibility = (0, _useChartSelection.useSeriesVisibility)({
|
|
70
|
+
controlled: props.hiddenSeriesIds,
|
|
71
|
+
onVisibilityChange: props.onVisibilityChange,
|
|
72
|
+
enabled: props.seriesToggleEnabled === true,
|
|
73
|
+
initiallyHidden: (0, _react.useMemo)(() => props.datasource.series.filter(s => s.hidden).map(s => s.id), [props.datasource.series])
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Runtime visibility has to reach the geometry, not just the legend —
|
|
77
|
+
// otherwise toggling a series greys out its swatch while the line keeps
|
|
78
|
+
// drawing (FR-049). With nothing hidden the original datasource is returned
|
|
79
|
+
// by identity, so the common case costs nothing.
|
|
80
|
+
const hidden = visibility.hidden;
|
|
81
|
+
const datasource = (0, _react.useMemo)(() => {
|
|
82
|
+
if (hidden.size === 0) {
|
|
83
|
+
return props.datasource;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
...props.datasource,
|
|
87
|
+
series: props.datasource.series.map(s => hidden.has(s.id) ? {
|
|
88
|
+
...s,
|
|
89
|
+
hidden: true
|
|
90
|
+
} : s)
|
|
91
|
+
};
|
|
92
|
+
}, [props.datasource, hidden]);
|
|
93
|
+
|
|
94
|
+
// The single memoized artefact.
|
|
95
|
+
//
|
|
96
|
+
// The dependency list is narrow on purpose. Depending on the whole `props`
|
|
97
|
+
// object would invalidate the memo whenever any callback identity changed —
|
|
98
|
+
// and inline arrow callbacks are the norm in app code, so that would defeat
|
|
99
|
+
// FR-073 in exactly the case it exists for. Selection is absent for the same
|
|
100
|
+
// reason: highlighting repaints the highlight, it does not rebuild scales.
|
|
101
|
+
const buildGeometry = props.buildGeometry;
|
|
102
|
+
const geometry = (0, _react.useMemo)(() => {
|
|
103
|
+
if (!layout.measured || !showData) {
|
|
104
|
+
return _types.EMPTY_GEOMETRY;
|
|
105
|
+
}
|
|
106
|
+
return buildGeometry(datasource, geometryInput);
|
|
107
|
+
}, [layout.measured, showData, buildGeometry, datasource, geometryInput]);
|
|
108
|
+
const selection = (0, _useChartSelection.useChartSelection)({
|
|
109
|
+
controlled: props.selection,
|
|
110
|
+
onSelectionChange: props.onSelectionChange,
|
|
111
|
+
onSelectionUnresolvable: props.onSelectionUnresolvable,
|
|
112
|
+
hitRegions: geometry.hitRegions,
|
|
113
|
+
interactionSuppressed: (0, _state.suppressesInteraction)(status),
|
|
114
|
+
geometryReady: layout.measured && showData && geometry.hitRegions.length > 0
|
|
115
|
+
});
|
|
116
|
+
const handlePress = event => {
|
|
117
|
+
if ((0, _state.suppressesInteraction)(status) || !props.onSelectionChange) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const {
|
|
121
|
+
locationX,
|
|
122
|
+
locationY
|
|
123
|
+
} = event.nativeEvent;
|
|
124
|
+
if (!(0, _layout.containsPoint)(geometry.plot, locationX, locationY)) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const hit = props.hitTestMode === 'byX' ? (0, _hitTest.hitTestByX)(geometry.hitRegions, locationX) : (0, _hitTest.hitTest)(geometry.hitRegions, locationX, locationY);
|
|
128
|
+
if (!hit) {
|
|
129
|
+
selection.select(null, null);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const pointEvent = (0, _pointEvent.pointEventFor)(props.datasource, hit.seriesId, hit.pointId);
|
|
133
|
+
if (pointEvent) {
|
|
134
|
+
selection.select({
|
|
135
|
+
seriesId: hit.seriesId,
|
|
136
|
+
pointId: hit.pointId
|
|
137
|
+
}, pointEvent);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const incomplete = geometry.incomplete || validation.totalIncomplete;
|
|
141
|
+
const interactive = props.accessibility?.interactive ?? Boolean(props.onSelectionChange);
|
|
142
|
+
const a11y = (0, _useChartA11y.useChartA11y)({
|
|
143
|
+
datasource: props.datasource,
|
|
144
|
+
family,
|
|
145
|
+
status,
|
|
146
|
+
title: props.title,
|
|
147
|
+
accessibility: props.accessibility,
|
|
148
|
+
interactive,
|
|
149
|
+
incomplete,
|
|
150
|
+
hitRegions: geometry.hitRegions,
|
|
151
|
+
selection,
|
|
152
|
+
formatters,
|
|
153
|
+
strings
|
|
154
|
+
});
|
|
155
|
+
const legendEnabled = props.legend === undefined ? props.defaultLegend ?? false : props.legend !== false;
|
|
156
|
+
const legendPosition = typeof props.legend === 'object' ? props.legend.position : 'bottom';
|
|
157
|
+
const legendLabel = formatters.legendLabel;
|
|
158
|
+
const legendEntries = (0, _react.useMemo)(() => legendEnabled ? (0, _ChartLegend.buildLegendEntries)(props.datasource, theme, hidden, visibility.enabled, family, legendLabel) : [], [legendEnabled, props.datasource, theme, hidden, visibility.enabled, family, legendLabel]);
|
|
159
|
+
const legend = legendEnabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartLegend.ChartLegend, {
|
|
160
|
+
entries: legendEntries,
|
|
161
|
+
theme: theme,
|
|
162
|
+
onToggle: visibility.enabled ? visibility.toggle : undefined,
|
|
163
|
+
strings: strings
|
|
164
|
+
}) : null;
|
|
165
|
+
const plotHeight = (0, _react.useMemo)(() => ({
|
|
166
|
+
height: props.height ?? DEFAULT_HEIGHT
|
|
167
|
+
}), [props.height]);
|
|
168
|
+
const content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
169
|
+
children: [props.title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
170
|
+
style: [styles.title, {
|
|
171
|
+
color: theme.typography.valueLabel.color,
|
|
172
|
+
fontSize: theme.typography.valueLabel.fontSize
|
|
173
|
+
}],
|
|
174
|
+
accessibilityRole: "header",
|
|
175
|
+
children: props.title
|
|
176
|
+
}) : null, legendPosition === 'top' ? legend : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
177
|
+
accessible: true,
|
|
178
|
+
accessibilityRole: interactive ? 'adjustable' : 'image',
|
|
179
|
+
accessibilityLabel: a11y.summary,
|
|
180
|
+
accessibilityValue: a11y.value,
|
|
181
|
+
accessibilityActions: a11y.actions,
|
|
182
|
+
onAccessibilityAction: a11y.onAction,
|
|
183
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
184
|
+
style: [styles.plotArea, plotHeight],
|
|
185
|
+
onLayout: layout.onLayout,
|
|
186
|
+
children: [layout.measured && showData ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
187
|
+
onPress: handlePress,
|
|
188
|
+
disabled: !props.onSelectionChange,
|
|
189
|
+
style: _reactNative.StyleSheet.absoluteFill,
|
|
190
|
+
accessible: false,
|
|
191
|
+
importantForAccessibility: "no-hide-descendants",
|
|
192
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeSvg.default, {
|
|
193
|
+
width: layout.size.width,
|
|
194
|
+
height: layout.size.height,
|
|
195
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartPlot.ChartPlot, {
|
|
196
|
+
geometry: geometry,
|
|
197
|
+
theme: theme,
|
|
198
|
+
fontSize: layout.fontSize,
|
|
199
|
+
axes: props.axes ?? 'full'
|
|
200
|
+
}), selection.resolved && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Marks.SelectionHighlight, {
|
|
201
|
+
x: selection.resolved.x,
|
|
202
|
+
y: selection.resolved.y,
|
|
203
|
+
color: theme.onSurface
|
|
204
|
+
})]
|
|
205
|
+
})
|
|
206
|
+
}) : null, !showData || error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartStateOverlay.ChartStateOverlay, {
|
|
207
|
+
status: status,
|
|
208
|
+
supplied: props.stateContent?.[status],
|
|
209
|
+
strings: strings,
|
|
210
|
+
theme: theme,
|
|
211
|
+
error: error
|
|
212
|
+
}) : null]
|
|
213
|
+
})
|
|
214
|
+
}), legendPosition === 'bottom' ? legend : null, geometry.colorScale && props.legend !== false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartLegend.ColorScaleLegend, {
|
|
215
|
+
scale: geometry.colorScale,
|
|
216
|
+
theme: theme,
|
|
217
|
+
formatValue: formatters.geometry.formatValue,
|
|
218
|
+
strings: strings
|
|
219
|
+
}) : null, incomplete ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
220
|
+
style: [styles.note, {
|
|
221
|
+
color: theme.muted,
|
|
222
|
+
fontSize: theme.typography.axisLabel.fontSize
|
|
223
|
+
}],
|
|
224
|
+
children: strings['chart.note.incomplete']
|
|
225
|
+
}) : null, props.footer]
|
|
226
|
+
});
|
|
227
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
228
|
+
style: [styles.container, {
|
|
229
|
+
backgroundColor: theme.surface
|
|
230
|
+
}, props.style],
|
|
231
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartBoundary.ChartBoundary, {
|
|
232
|
+
family: props.family,
|
|
233
|
+
chartId: props.chartId,
|
|
234
|
+
onFailure: props.onFailure,
|
|
235
|
+
resetKey: props.datasource,
|
|
236
|
+
renderFallback: containedError => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
237
|
+
accessible: true,
|
|
238
|
+
accessibilityRole: "image",
|
|
239
|
+
accessibilityLabel: a11y.summary,
|
|
240
|
+
style: [styles.plotArea, plotHeight],
|
|
241
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartStateOverlay.ChartFailureOverlay, {
|
|
242
|
+
supplied: props.stateContent?.error,
|
|
243
|
+
theme: theme,
|
|
244
|
+
error: containedError
|
|
245
|
+
})
|
|
246
|
+
}),
|
|
247
|
+
children: content
|
|
248
|
+
})
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const styles = _reactNative.StyleSheet.create({
|
|
252
|
+
// No outer margin: app content must be able to sit flush against a chart.
|
|
253
|
+
container: {
|
|
254
|
+
width: '100%'
|
|
255
|
+
},
|
|
256
|
+
title: {
|
|
257
|
+
fontWeight: '600',
|
|
258
|
+
marginBottom: 4
|
|
259
|
+
},
|
|
260
|
+
plotArea: {
|
|
261
|
+
width: '100%',
|
|
262
|
+
position: 'relative'
|
|
263
|
+
},
|
|
264
|
+
// Colour and type size are applied inline from ChartTheme, so they follow
|
|
265
|
+
// the consuming app's tokens and the system text scale (UX-001).
|
|
266
|
+
note: {
|
|
267
|
+
marginTop: 4
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
//# sourceMappingURL=ChartFrame.js.map
|