@blueprint-chart/lib 1.8.1 → 1.8.3
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/dist/charts/number-parse.d.ts +17 -0
- package/dist/charts/plugins/annotations/position-helpers.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +101 -101
- package/dist/lib/lib.iife.js +9 -8
- package/dist/node-backend/index.js +110 -97
- package/dist/{render-bpc-Bp2OTJmu.js → render-bpc-Bgb7rsgM.js} +156 -143
- package/dist/runtime.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove the whitespace that groups digits in a written-out number, so that
|
|
3
|
+
* "1 559 275" reads as 1559275. Only whitespace sitting between two digits is
|
|
4
|
+
* removed: no locale uses a space as a decimal marker, which makes this
|
|
5
|
+
* unambiguous, and it leaves labels like "North 1" untouched.
|
|
6
|
+
*
|
|
7
|
+
* The `\s` class already covers the separators locales and spreadsheets emit
|
|
8
|
+
* (plain space, no-break space U+00A0, narrow no-break space U+202F, thin space
|
|
9
|
+
* U+2009, figure space U+2007), so none of them need special casing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function stripDigitGroupSpaces(value: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Parse a single numeric cell, returning `undefined` for empty/missing/non-finite
|
|
14
|
+
* inputs so consumers can distinguish "no data" from a literal zero.
|
|
15
|
+
* Callers continue to coalesce via `?? 0` when a numeric fallback is needed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseNumericCell(raw: string | undefined): number | undefined;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
export declare function resolvePosition(value: number | string, size: number): number;
|
|
2
|
+
/**
|
|
3
|
+
* Fraction of the chart width an annotation wraps at when the BPC sets no
|
|
4
|
+
* explicit `maxWidth`. Unwrapped text runs off the canvas and drags the whole
|
|
5
|
+
* chart down with it, because `expandSvgToFitAnnotations` grows the viewBox to
|
|
6
|
+
* cover the overflow and `preserveAspectRatio` then scales everything to fit.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_MAX_WIDTH_RATIO = 0.4;
|
|
2
9
|
export declare function resolveMaxWidth(maxWidth: number | string | undefined, chartWidth: number): number | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { renderHorizontalAxis } from './charts/axis/horizontal-axis';
|
|
|
10
10
|
export { renderLegend } from './charts/legend/legend';
|
|
11
11
|
export { registerChart, getChart, getChartOptions, listCharts } from './charts/registry';
|
|
12
12
|
export { parseData, buildChartOptions } from './charts/chart-helpers';
|
|
13
|
+
export { stripDigitGroupSpaces } from './charts/number-parse';
|
|
13
14
|
export { recommendCharts } from './recommendations/recommend';
|
|
14
15
|
export { classifyIntent } from './recommendations/intent';
|
|
15
16
|
export { shapeOf } from './recommendations/shape';
|