@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,67 @@
|
|
|
1
|
+
export interface PlotRect {
|
|
2
|
+
readonly x: number;
|
|
3
|
+
readonly y: number;
|
|
4
|
+
readonly width: number;
|
|
5
|
+
readonly height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ContainerSize {
|
|
8
|
+
readonly width: number;
|
|
9
|
+
readonly height: number;
|
|
10
|
+
}
|
|
11
|
+
export interface LayoutOptions {
|
|
12
|
+
readonly container: ContainerSize;
|
|
13
|
+
/** Axis label text, used to reserve exactly as much space as is needed. */
|
|
14
|
+
readonly xLabels?: readonly string[];
|
|
15
|
+
readonly yLabels?: readonly string[];
|
|
16
|
+
readonly baseFontSize: number;
|
|
17
|
+
/** System text-size multiplier, from `PixelRatio.getFontScale()` (FR-071). */
|
|
18
|
+
readonly fontScale: number;
|
|
19
|
+
readonly padding?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Ceiling on how far system text scaling may inflate chart labels.
|
|
23
|
+
*
|
|
24
|
+
* Beyond this the plot area collapses faster than the labels become useful, so
|
|
25
|
+
* we cap the growth rather than let the chart squeeze itself out of existence.
|
|
26
|
+
* The cap is documented in the README as the supported dynamic-type range.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MAX_FONT_SCALE = 1.6;
|
|
29
|
+
export declare function effectiveFontSize(baseFontSize: number, fontScale: number): number;
|
|
30
|
+
/** A container that has not been measured yet, or has collapsed (FR-078). */
|
|
31
|
+
export declare function isMeasurable(size: ContainerSize): boolean;
|
|
32
|
+
export declare const EMPTY_PLOT: PlotRect;
|
|
33
|
+
/**
|
|
34
|
+
* Reserves axis space from estimated label widths, then hands back what is
|
|
35
|
+
* left for the marks.
|
|
36
|
+
*
|
|
37
|
+
* If the reservations would leave nothing to draw on, they are scaled back:
|
|
38
|
+
* a cramped axis beats a zero-area plot.
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolvePlotRect(options: LayoutOptions): PlotRect;
|
|
41
|
+
export interface AxisLabels {
|
|
42
|
+
readonly xLabels: readonly string[];
|
|
43
|
+
readonly yLabels: readonly string[];
|
|
44
|
+
readonly fontSize: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Shrinks a plot so its own axis labels fit inside the container.
|
|
48
|
+
*
|
|
49
|
+
* Builders call this once they know their tick labels (which depend only on
|
|
50
|
+
* the data domain) and before projecting anything, so the reservation costs no
|
|
51
|
+
* second pass. Without it the frame handed every builder the full container:
|
|
52
|
+
* Y labels, drawn right-aligned left of the plot, landed at negative x, and X
|
|
53
|
+
* labels below the baseline fell past the bottom of the SVG (CHT-01).
|
|
54
|
+
*
|
|
55
|
+
* - left: the widest Y label plus a gutter, and at least half the widest X
|
|
56
|
+
* label, because the first X label is centred on the plot's left edge;
|
|
57
|
+
* - right: half the widest X label, for the last one;
|
|
58
|
+
* - top: the part of the topmost Y label that rises above its tick;
|
|
59
|
+
* - bottom: one line of X labels plus a gutter.
|
|
60
|
+
*
|
|
61
|
+
* Each side is capped so labels can never squeeze the plot out of existence.
|
|
62
|
+
*/
|
|
63
|
+
export declare function insetForAxes(outer: PlotRect, labels: AxisLabels): PlotRect;
|
|
64
|
+
export declare function plotBottom(plot: PlotRect): number;
|
|
65
|
+
export declare function plotRight(plot: PlotRect): number;
|
|
66
|
+
export declare function containsPoint(plot: PlotRect, x: number, y: number): boolean;
|
|
67
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/geometry/layout.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAGjF;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAIzD;AAED,eAAO,MAAM,UAAU,EAAE,QAA8C,CAAC;AAExE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,QAAQ,CAiChE;AAED,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,QAAQ,CA2B1E;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEjD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEhD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAE3E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference markers on a value axis: thresholds, baselines and targets drawn
|
|
3
|
+
* as horizontal lines across the plot (FR-008, FR-072).
|
|
4
|
+
*
|
|
5
|
+
* Every builder used to return `markers: []`, so a threshold the app supplied
|
|
6
|
+
* reached the accessibility summary and nowhere else (CHT-03).
|
|
7
|
+
*
|
|
8
|
+
* PURE. No React, no SVG.
|
|
9
|
+
*/
|
|
10
|
+
import type { ReferenceMarker } from '../contract/marker.js';
|
|
11
|
+
import { type PlotRect } from './layout.js';
|
|
12
|
+
import type { GeometryLabel, MarkerLine } from './types.js';
|
|
13
|
+
type PlacedMarker = ReferenceMarker & {
|
|
14
|
+
readonly value: {
|
|
15
|
+
kind: 'known';
|
|
16
|
+
value: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/** Markers that can be placed on a value axis: those with a known value. */
|
|
20
|
+
export declare function placeableMarkers(markers: readonly ReferenceMarker[] | undefined): PlacedMarker[];
|
|
21
|
+
/** Values the domain must include so every marker lands inside the plot. */
|
|
22
|
+
export declare function markerDomainValues(markers: readonly ReferenceMarker[] | undefined): number[];
|
|
23
|
+
/** One line per marker across the plot, plus its label when it has one. */
|
|
24
|
+
export declare function horizontalMarkers(markers: readonly ReferenceMarker[] | undefined, plot: PlotRect, project: (value: number) => number): {
|
|
25
|
+
lines: MarkerLine[];
|
|
26
|
+
labels: GeometryLabel[];
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../../src/geometry/markers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAoB,CAAC;AAE1D,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,aAAU,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAS,CAAC;AAEzD,KAAK,YAAY,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AAE3F,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,GAAG,YAAY,EAAE,CAEhG;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAE5F;AAED,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAC/C,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAChC;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,CAuBlD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG path-string builders.
|
|
3
|
+
*
|
|
4
|
+
* This is where the "never bridge a gap" guarantee (FR-012) becomes
|
|
5
|
+
* structural rather than a rule someone has to remember. A missing value does
|
|
6
|
+
* not produce a coordinate — it ends the current subpath. The next known value
|
|
7
|
+
* starts a fresh one with an `M` command. There is physically no line segment
|
|
8
|
+
* spanning the gap, so no amount of downstream carelessness can draw one.
|
|
9
|
+
*
|
|
10
|
+
* Batching into path data is also what keeps element counts flat: one `Path`
|
|
11
|
+
* per series regardless of point count (research.md R2).
|
|
12
|
+
*
|
|
13
|
+
* PURE. No React, no SVG imports — this module emits strings.
|
|
14
|
+
*/
|
|
15
|
+
export interface Pt {
|
|
16
|
+
readonly x: number;
|
|
17
|
+
readonly y: number;
|
|
18
|
+
}
|
|
19
|
+
/** A point that may be absent, mirroring the value contract. */
|
|
20
|
+
export type MaybePt = Pt | null;
|
|
21
|
+
/**
|
|
22
|
+
* Polyline through the known points, broken at every gap.
|
|
23
|
+
*
|
|
24
|
+
* `null` entries are missing values. They terminate the current subpath; they
|
|
25
|
+
* are never interpolated, carried forward, or skipped over.
|
|
26
|
+
*/
|
|
27
|
+
export declare function linePath(points: readonly MaybePt[]): string;
|
|
28
|
+
/**
|
|
29
|
+
* Filled area between the polyline and a baseline, broken at gaps in the same
|
|
30
|
+
* way: each contiguous run of known points becomes its own closed shape.
|
|
31
|
+
*/
|
|
32
|
+
export declare function areaPath(points: readonly MaybePt[], baselineY: number): string;
|
|
33
|
+
export interface RectSpec {
|
|
34
|
+
readonly x: number;
|
|
35
|
+
readonly y: number;
|
|
36
|
+
readonly width: number;
|
|
37
|
+
readonly height: number;
|
|
38
|
+
readonly radius?: number;
|
|
39
|
+
}
|
|
40
|
+
/** One rectangle as a subpath, with optional corner rounding. */
|
|
41
|
+
export declare function rectSubpath(r: RectSpec): string;
|
|
42
|
+
/**
|
|
43
|
+
* Many rectangles batched into one path — how bars and heatmap cells stay at
|
|
44
|
+
* one element per series or per intensity bucket.
|
|
45
|
+
*/
|
|
46
|
+
export declare function rectBatchPath(rects: readonly RectSpec[]): string;
|
|
47
|
+
export interface ArcSpec {
|
|
48
|
+
readonly cx: number;
|
|
49
|
+
readonly cy: number;
|
|
50
|
+
readonly outerRadius: number;
|
|
51
|
+
readonly innerRadius: number;
|
|
52
|
+
/** Radians, clockwise from 12 o'clock. */
|
|
53
|
+
readonly startAngle: number;
|
|
54
|
+
readonly endAngle: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Donut or pie segment. An inner radius of 0 yields a pie wedge.
|
|
58
|
+
*
|
|
59
|
+
* A full-circle segment is drawn as two half-arcs, because SVG cannot express
|
|
60
|
+
* a 360-degree arc in a single command — start and end would coincide and
|
|
61
|
+
* nothing would be drawn.
|
|
62
|
+
*/
|
|
63
|
+
export declare function arcPath(spec: ArcSpec): string;
|
|
64
|
+
/** Straight line, for axes, baselines, and threshold markers. */
|
|
65
|
+
export declare function linearSegment(from: Pt, to: Pt): string;
|
|
66
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/geometry/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,EAAE;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gEAAgE;AAChE,MAAM,MAAM,OAAO,GAAG,EAAE,GAAG,IAAI,CAA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ule that matters (FR-021, FR-022): with no usable target there is **no
|
|
5
|
+
* proportion**. The chart shows the current value and nothing else. And a value
|
|
6
|
+
* beyond its target renders as overshoot rather than a clamped full bar that
|
|
7
|
+
* hides the excess.
|
|
8
|
+
*
|
|
9
|
+
* PURE. No React, no SVG.
|
|
10
|
+
*/
|
|
11
|
+
import type { ChartDatasource } from '../contract/datasource.js';
|
|
12
|
+
import type { GeometryInput, ResolvedGeometry } from './types.js';
|
|
13
|
+
export interface ProgressOptions {
|
|
14
|
+
readonly trackRadius?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildProgressGeometry<M>(datasource: ChartDatasource<M>, input: GeometryInput, options?: ProgressOptions): ResolvedGeometry;
|
|
17
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../../src/geometry/progress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAAwB,CAAC;AAM9D,OAAO,KAAK,EAAE,aAAa,EAAuC,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAEpG,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAKD,wBAAgB,qBAAqB,CAAC,CAAC,EACtC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,eAAoB,GAC3B,gBAAgB,CAgMlB"}
|
|
@@ -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;
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EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,SAAM,GAAG,SAAS,CAiCjG;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,WAAW,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACzB,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,OAAO,GAAE;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.js';
|
|
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,YAAS,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.js';
|
|
11
|
+
import type { GeometryInput, ResolvedGeometry } from './types.js';
|
|
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,2BAAwB,CAAC;AAQtE,OAAO,KAAK,EAAE,aAAa,EAAY,gBAAgB,EAAE,MAAM,YAAS,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.js';
|
|
12
|
+
import type { NonValueTexture } from '../contract/theme.js';
|
|
13
|
+
import type { HitRegion } from './hitTest.js';
|
|
14
|
+
import type { PlotRect } from './layout.js';
|
|
15
|
+
import type { Tick } from './ticks.js';
|
|
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,2BAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAU,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAS,CAAC;AAEpC,8EAA8E;AAC9E,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB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,CAAC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,QAAQ,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @chipmobilesdk/rn-chart — domain-agnostic charting for ChipMobileSdk-family
|
|
3
|
+
* React Native apps.
|
|
4
|
+
*
|
|
5
|
+
* 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.js';
|
|
20
|
+
export { isKnown, isWithheld, known, notApplicable, participatesInTotals, sumKnown, unknown, withheld, } from './contract/value.js';
|
|
21
|
+
export type { CategoryPosition, ChartDatasource, ChartFamily, DataPoint, InstantPosition, MatrixPosition, Position, PositionKind, Series, SeriesPattern, } from './contract/datasource.js';
|
|
22
|
+
export { FAMILY_POSITION_KINDS, familyAcceptsPositionKind, resolveFormat, resolveUnit, } from './contract/datasource.js';
|
|
23
|
+
export type { DistributionValues } from './contract/distribution.js';
|
|
24
|
+
export type { MarkerKind, ProgressReading, ReferenceMarker } from './contract/marker.js';
|
|
25
|
+
export { findTarget, isUsableTarget, readProgress } from './contract/marker.js';
|
|
26
|
+
export type { ChartFormatters, FormatContext, FormatHint, SeriesRef } from './contract/format.js';
|
|
27
|
+
export { NON_VALUE_TEXT, formatLegendDefault, formatPositionDefault, formatValueDefault, seriesRef, } from './contract/format.js';
|
|
28
|
+
export type { ChartStateContent, ChartStatus, DeclarableChartStatus, StatusInputs, } from './contract/state.js';
|
|
29
|
+
export { STATUS_PRECEDENCE, drawsData, resolveStatus, suppressesInteraction, } from './contract/state.js';
|
|
30
|
+
export type { ChartError, ChartErrorCategory, ChartErrorCode, ChartFailureHandler, ChartFailureReport, } from './contract/errors.js';
|
|
31
|
+
export { isChartError } from './contract/errors.js';
|
|
32
|
+
export type { ChartInteractionEvent, InteractionProps, PointInteractionEvent, SelectionRef, SeriesInteractionEvent, } from './contract/interaction.js';
|
|
33
|
+
export { sameSelection } from './contract/interaction.js';
|
|
34
|
+
export type { ChartTheme, LegendEntry, NonValueTexture, TextStyleTokens } from './contract/theme.js';
|
|
35
|
+
export { defaultChartTheme, resolveSeriesColor } from './contract/theme.js';
|
|
36
|
+
export type { BaseChartProps, ChartAccessibility, ValueFormatter } from './contract/props.js';
|
|
37
|
+
export type { BudgetCheck, DatasetBudget } from './validation/budgets.js';
|
|
38
|
+
export { DATASET_BUDGETS, checkBudget } from './validation/budgets.js';
|
|
39
|
+
export type { BarChartProps, DistributionChartProps, HeatmapChartProps, ProgressChartProps, TimeSeriesChartProps, } from './react/charts.js';
|
|
40
|
+
export { BarChart, DistributionChart, HeatmapChart, ProgressChart, TimeSeriesChart, } from './react/charts.js';
|
|
41
|
+
export { ChartLegend, ColorScaleLegend, buildLegendEntries } from './react/ChartLegend.js';
|
|
42
|
+
export type { ColorScale } from './geometry/types.js';
|
|
43
|
+
export { ChartThemeProvider, useChartTheme } from './react/ChartThemeProvider.js';
|
|
44
|
+
export { buildChartSummary, buildPointAnnouncement, buildTotalAnnouncement } from './a11y/summary.js';
|
|
45
|
+
export { chartStrings } from './contract/strings.js';
|
|
46
|
+
export type { ChartStringKey, ChartStrings } from './contract/strings.js';
|
|
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,qBAAkB,CAAC;AAC1B,OAAO,EACN,OAAO,EACP,UAAU,EACV,KAAK,EACL,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,OAAO,EACP,QAAQ,GACR,MAAM,qBAAkB,CAAC;AAK1B,YAAY,EACX,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,SAAS,EACT,eAAe,EACf,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,aAAa,GACb,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EACN,qBAAqB,EACrB,yBAAyB,EACzB,aAAa,EACb,WAAW,GACX,MAAM,0BAAuB,CAAC;AAE/B,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAAyB,CAAC;AAElE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAmB,CAAC;AAK7E,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAmB,CAAC;AAC/F,OAAO,EACN,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,GACT,MAAM,sBAAmB,CAAC;AAK3B,YAAY,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,YAAY,GACZ,MAAM,qBAAkB,CAAC;AAC1B,OAAO,EACN,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,qBAAqB,GACrB,MAA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AAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -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.js';
|
|
22
|
+
import { type ChartError, type ChartFailureHandler } from '../contract/errors.js';
|
|
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
|
+
{"version":3,"file":"ChartBoundary.d.ts","sourceRoot":"","sources":["../../../../src/react/ChartBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAAwB,CAAC;AAC1D,OAAO,EAIN,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,MAAM,uBAAoB,CAAC;AAE5B,UAAU,KAAK;IACd,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IACzC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,KAAK,CAAC,SAAS,CAAC;IAChE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC;AAED,UAAU,KAAK;IACd,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBACnD,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI;IAQzE,MAAM,CAAC,wBAAwB,IAAI,OAAO,CAAC,KAAK,CAAC;IAWxC,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAkB1E,MAAM,IAAI,KAAK,CAAC,SAAS;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.js';
|
|
15
|
+
import type { DistributionValues } from '../contract/distribution.js';
|
|
16
|
+
import type { BaseChartProps } from '../contract/props.js';
|
|
17
|
+
import type { GeometryInput, ResolvedGeometry } from '../geometry/types.js';
|
|
18
|
+
import { type ChartAxes } from './ChartPlot.js';
|
|
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,2BAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAmB,CAAC;AAKxD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAmB,CAAC;AAKzE,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAa,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.js';
|
|
3
|
+
import type { SeriesRef } from '../contract/format.js';
|
|
4
|
+
import { type ChartStrings } from '../contract/strings.js';
|
|
5
|
+
import { type ChartTheme, type LegendEntry } from '../contract/theme.js';
|
|
6
|
+
import type { ColorScale } from '../geometry/types.js';
|
|
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,2BAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAoB,CAAC;AACpD,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,wBAAqB,CAAC;AACtE,OAAO,EAIN,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,MAAM,sBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAmB,CAAC;AAKpD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EACnC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAC3B,UAAU,EAAE,OAAO,EACnB,MAAM,CAAC,EAAE,WAAW;AACpB,0DAA0D;AAC1D,WAAW,GAAE,CAAC,MAAM,EAAE,SAAS,KAAK,MAA+B,GACjE,WAAW,EAAE,CA+Bf;AAkDD,wBAAgB,WAAW,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,QAAQ,EACR,OAA+B,GAC/B,EAAE;IACF,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;CAChC,4BAoDA;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAChC,KAAK,EAC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