@ledgerhq/lumen-ui-rnative-visualization 0.1.14 → 0.1.15
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/module/lib/Components/Axis/Axis.constants.js +21 -0
- package/dist/module/lib/Components/Axis/Axis.constants.js.map +1 -0
- package/dist/module/lib/Components/Axis/index.js +5 -0
- package/dist/module/lib/Components/Axis/index.js.map +1 -0
- package/dist/module/lib/Components/CartesianChart/CartesianChart.js +34 -22
- package/dist/module/lib/Components/CartesianChart/CartesianChart.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/context/useBuildChartContext.js +5 -4
- package/dist/module/lib/Components/CartesianChart/context/useBuildChartContext.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/context/useBuildChartContext.test.js +54 -0
- package/dist/module/lib/Components/CartesianChart/context/useBuildChartContext.test.js.map +1 -1
- package/dist/module/lib/Components/CartesianChart/utils.js +18 -8
- package/dist/module/lib/Components/CartesianChart/utils.js.map +1 -1
- package/dist/module/lib/Components/Line/utils.js +6 -1
- package/dist/module/lib/Components/Line/utils.js.map +1 -1
- package/dist/module/lib/Components/Line/utils.test.js +88 -0
- package/dist/module/lib/Components/Line/utils.test.js.map +1 -0
- package/dist/module/lib/Components/LineChart/LineChart.js +19 -31
- package/dist/module/lib/Components/LineChart/LineChart.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.stories.js +38 -0
- package/dist/module/lib/Components/LineChart/LineChart.stories.js.map +1 -1
- package/dist/module/lib/Components/LineChart/LineChart.test.js +192 -0
- package/dist/module/lib/Components/LineChart/LineChart.test.js.map +1 -1
- package/dist/module/lib/Components/Point/Point.js +8 -2
- package/dist/module/lib/Components/Point/Point.js.map +1 -1
- package/dist/module/lib/Components/Point/constants.js +9 -0
- package/dist/module/lib/Components/Point/constants.js.map +1 -0
- package/dist/module/lib/Components/Point/pointContext/MagneticPointsProvider.js +35 -0
- package/dist/module/lib/Components/Point/pointContext/MagneticPointsProvider.js.map +1 -0
- package/dist/module/lib/Components/Point/pointContext/MagneticPointsProvider.test.js +153 -0
- package/dist/module/lib/Components/Point/pointContext/MagneticPointsProvider.test.js.map +1 -0
- package/dist/module/lib/Components/Point/pointContext/index.js +5 -0
- package/dist/module/lib/Components/Point/pointContext/index.js.map +1 -0
- package/dist/module/lib/Components/Point/pointContext/magneticPointsContext.js +10 -0
- package/dist/module/lib/Components/Point/pointContext/magneticPointsContext.js.map +1 -0
- package/dist/module/lib/Components/Point/utils.js +26 -6
- package/dist/module/lib/Components/Point/utils.js.map +1 -1
- package/dist/module/lib/Components/Point/utils.test.js +84 -2
- package/dist/module/lib/Components/Point/utils.test.js.map +1 -1
- package/dist/module/lib/Components/ReferenceLine/utils.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.test.js +4 -4
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js +31 -10
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.test.js +4 -4
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.test.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js +35 -7
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/utils.js +64 -0
- package/dist/module/lib/Components/Scrubber/utils.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/utils.test.js +128 -1
- package/dist/module/lib/Components/Scrubber/utils.test.js.map +1 -1
- package/dist/module/lib/utils/domain/domain.js.map +1 -1
- package/dist/module/lib/utils/scales/scales.js +13 -4
- package/dist/module/lib/utils/scales/scales.js.map +1 -1
- package/dist/module/lib/utils/scales/scales.test.js +29 -0
- package/dist/module/lib/utils/scales/scales.test.js.map +1 -1
- package/dist/module/lib/utils/ticks/ticks.js +13 -3
- package/dist/module/lib/utils/ticks/ticks.js.map +1 -1
- package/dist/module/lib/utils/ticks/ticks.test.js +34 -0
- package/dist/module/lib/utils/ticks/ticks.test.js.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/Axis.constants.d.ts +5 -0
- package/dist/typescript/src/lib/Components/Axis/Axis.constants.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Axis/Axis.types.d.ts +39 -0
- package/dist/typescript/src/lib/Components/Axis/Axis.types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Axis/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/Axis/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/CartesianChart/CartesianChart.d.ts +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/context/useBuildChartContext.d.ts +5 -4
- package/dist/typescript/src/lib/Components/CartesianChart/context/useBuildChartContext.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/types.d.ts +11 -3
- package/dist/typescript/src/lib/Components/CartesianChart/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CartesianChart/utils.d.ts +18 -8
- package/dist/typescript/src/lib/Components/CartesianChart/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Line/utils.d.ts +4 -0
- package/dist/typescript/src/lib/Components/Line/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts +1 -1
- package/dist/typescript/src/lib/Components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts +10 -3
- package/dist/typescript/src/lib/Components/LineChart/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Point/Point.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Point/Point.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Point/constants.d.ts +7 -0
- package/dist/typescript/src/lib/Components/Point/constants.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Point/pointContext/MagneticPointsProvider.d.ts +7 -0
- package/dist/typescript/src/lib/Components/Point/pointContext/MagneticPointsProvider.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Point/pointContext/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/Point/pointContext/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Point/pointContext/magneticPointsContext.d.ts +13 -0
- package/dist/typescript/src/lib/Components/Point/pointContext/magneticPointsContext.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Point/types.d.ts +7 -0
- package/dist/typescript/src/lib/Components/Point/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Point/utils.d.ts +8 -6
- package/dist/typescript/src/lib/Components/Point/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ReferenceLine/utils.d.ts +3 -2
- package/dist/typescript/src/lib/Components/ReferenceLine/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.d.ts +5 -1
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/ScrubberProvider.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/types.d.ts +13 -0
- package/dist/typescript/src/lib/Components/Scrubber/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/utils.d.ts +33 -3
- package/dist/typescript/src/lib/Components/Scrubber/utils.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/domain/domain.d.ts +5 -4
- package/dist/typescript/src/lib/utils/domain/domain.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/index.d.ts +1 -1
- package/dist/typescript/src/lib/utils/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/scales/scales.d.ts +11 -5
- package/dist/typescript/src/lib/utils/scales/scales.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/ticks/ticks.d.ts +13 -5
- package/dist/typescript/src/lib/utils/ticks/ticks.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/types.d.ts +3 -28
- package/dist/typescript/src/lib/utils/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/lib/Components/Axis/Axis.constants.ts +23 -0
- package/src/lib/Components/Axis/Axis.types.ts +40 -0
- package/src/lib/Components/Axis/index.ts +2 -0
- package/src/lib/Components/CartesianChart/CartesianChart.tsx +39 -23
- package/src/lib/Components/CartesianChart/context/useBuildChartContext.test.ts +56 -0
- package/src/lib/Components/CartesianChart/context/useBuildChartContext.ts +8 -8
- package/src/lib/Components/CartesianChart/types.ts +11 -3
- package/src/lib/Components/CartesianChart/utils.ts +18 -8
- package/src/lib/Components/Line/utils.test.ts +90 -0
- package/src/lib/Components/Line/utils.ts +6 -1
- package/src/lib/Components/LineChart/LineChart.stories.tsx +36 -0
- package/src/lib/Components/LineChart/LineChart.test.tsx +156 -0
- package/src/lib/Components/LineChart/LineChart.tsx +30 -40
- package/src/lib/Components/LineChart/types.ts +10 -3
- package/src/lib/Components/Point/Point.tsx +9 -3
- package/src/lib/Components/Point/constants.ts +6 -0
- package/src/lib/Components/Point/pointContext/MagneticPointsProvider.test.tsx +162 -0
- package/src/lib/Components/Point/pointContext/MagneticPointsProvider.tsx +45 -0
- package/src/lib/Components/Point/pointContext/index.ts +5 -0
- package/src/lib/Components/Point/pointContext/magneticPointsContext.ts +19 -0
- package/src/lib/Components/Point/types.ts +7 -0
- package/src/lib/Components/Point/utils.test.ts +95 -5
- package/src/lib/Components/Point/utils.ts +35 -7
- package/src/lib/Components/ReferenceLine/utils.ts +4 -7
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.test.tsx +4 -4
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.test.ts +4 -4
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts +29 -15
- package/src/lib/Components/Scrubber/ScrubberProvider.tsx +41 -5
- package/src/lib/Components/Scrubber/types.ts +13 -0
- package/src/lib/Components/Scrubber/utils.test.ts +150 -0
- package/src/lib/Components/Scrubber/utils.ts +93 -3
- package/src/lib/utils/domain/domain.ts +6 -5
- package/src/lib/utils/index.ts +0 -2
- package/src/lib/utils/scales/scales.test.ts +19 -0
- package/src/lib/utils/scales/scales.ts +15 -9
- package/src/lib/utils/ticks/ticks.test.ts +45 -0
- package/src/lib/utils/ticks/ticks.ts +19 -9
- package/src/lib/utils/types.ts +3 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Axis/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CartesianChartProps } from './types';
|
|
2
|
-
export declare function CartesianChart({ series, xAxis, yAxis, width, height, inset, axisPadding, ariaLabel, children, enableScrubbing, onScrubberPositionChange, animate, }: Readonly<CartesianChartProps>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function CartesianChart({ series, xAxis, yAxis, width, height, inset, axisPadding, ariaLabel, children, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, }: Readonly<CartesianChartProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=CartesianChart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/CartesianChart/CartesianChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/CartesianChart/CartesianChart.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AASnD,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAuB,EACvB,KAAK,EACL,WAAW,EACX,SAAmB,EACnB,QAAQ,EACR,eAAuB,EACvB,wBAAwB,EACxB,OAAc,EACd,YAAY,GACb,EAAE,QAAQ,CAAC,mBAAmB,CAAC,2CAmF/B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CartesianChartContextValue, ChartInset, ChartScaleFunction, DrawingArea, Series } from '../../../utils/types';
|
|
2
|
+
import type { AxisBounds, BaseAxisProps } from '../../Axis';
|
|
2
3
|
type UseBuildChartContextParams = {
|
|
3
4
|
series: Series[];
|
|
4
|
-
xAxis?: Partial<
|
|
5
|
-
yAxis?: Partial<
|
|
5
|
+
xAxis?: Partial<BaseAxisProps>;
|
|
6
|
+
yAxis?: Partial<BaseAxisProps>;
|
|
6
7
|
width: number;
|
|
7
8
|
height: number;
|
|
8
9
|
inset: ChartInset;
|
|
@@ -16,7 +17,7 @@ export declare const computeAxisRange: (drawingArea: DrawingArea) => {
|
|
|
16
17
|
xRange: AxisRange;
|
|
17
18
|
yRange: AxisRange;
|
|
18
19
|
};
|
|
19
|
-
export declare const buildScale: (domain: AxisBounds, range: AxisRange, scaleType?:
|
|
20
|
+
export declare const buildScale: (domain: AxisBounds, range: AxisRange, scaleType?: BaseAxisProps["scaleType"], nice?: boolean) => ChartScaleFunction;
|
|
20
21
|
export declare const computeDrawingArea: (width: number, height: number, inset: ChartInset, axisPadding: ChartInset) => DrawingArea;
|
|
21
22
|
export declare const useBuildChartContext: ({ series, xAxis, yAxis, width, height, inset, axisPadding, }: UseBuildChartContextParams) => CartesianChartContextValue;
|
|
22
23
|
export {};
|
package/dist/typescript/src/lib/Components/CartesianChart/context/useBuildChartContext.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuildChartContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/CartesianChart/context/useBuildChartContext.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"useBuildChartContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/CartesianChart/context/useBuildChartContext.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,0BAA0B,EAC1B,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,MAAM,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE5D,KAAK,0BAA0B,GAAG;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9C,eAAO,MAAM,gBAAgB,GAC3B,aAAa,WAAW,KACvB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAMvC,CAAC;AAEH,eAAO,MAAM,UAAU,GACrB,QAAQ,UAAU,EAClB,OAAO,SAAS,EAChB,YAAW,aAAa,CAAC,WAAW,CAAY,EAChD,OAAO,OAAO,KACb,kBAGsD,CAAC;AAE1D,eAAO,MAAM,kBAAkB,GAC7B,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,OAAO,UAAU,EACjB,aAAa,UAAU,KACtB,WAaF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,8DAQlC,0BAA0B,KAAG,0BAiC/B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartInset, Series } from '../../utils/types';
|
|
3
|
+
import type { BaseAxisProps } from '../Axis';
|
|
3
4
|
export type CartesianChartProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Data series provided to child components via context.
|
|
@@ -8,11 +9,11 @@ export type CartesianChartProps = {
|
|
|
8
9
|
/**
|
|
9
10
|
* Scale and domain configuration for the x-axis.
|
|
10
11
|
*/
|
|
11
|
-
xAxis?: Partial<
|
|
12
|
+
xAxis?: Partial<BaseAxisProps>;
|
|
12
13
|
/**
|
|
13
14
|
* Scale and domain configuration for the y-axis.
|
|
14
15
|
*/
|
|
15
|
-
yAxis?: Partial<
|
|
16
|
+
yAxis?: Partial<BaseAxisProps>;
|
|
16
17
|
/**
|
|
17
18
|
* Width of the chart in pixels.
|
|
18
19
|
* When omitted, the component auto-measures via `onLayout`.
|
|
@@ -61,5 +62,12 @@ export type CartesianChartProps = {
|
|
|
61
62
|
* @default true
|
|
62
63
|
*/
|
|
63
64
|
animate?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Pixel radius within which the scrubber magnetically snaps to registered
|
|
67
|
+
* magnetic `<Point>` components. Requires `enableScrubbing` to be `true`.
|
|
68
|
+
* Set to `0` to disable magnetisation.
|
|
69
|
+
* @default 6
|
|
70
|
+
*/
|
|
71
|
+
magnetRadius?: number;
|
|
64
72
|
};
|
|
65
73
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/CartesianChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/CartesianChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -2,16 +2,26 @@ import type { ChartInset } from '../../utils/types';
|
|
|
2
2
|
import type { CartesianChartProps } from './types';
|
|
3
3
|
export declare const DEFAULT_HEIGHT = 160;
|
|
4
4
|
/**
|
|
5
|
-
* Internal buffer
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Internal buffer added around the drawing area so SVG content (labels, points,
|
|
6
|
+
* ticks) drawn at the edges is not clipped. The SVG canvas is enlarged by this
|
|
7
|
+
* buffer on every side and shifted back by {@link OVERFLOW_OFFSET} so
|
|
8
|
+
* the chart's layout footprint (and the drawing area) stays exactly the
|
|
9
|
+
* consumer-provided width/height.
|
|
8
10
|
*/
|
|
9
11
|
export declare const OVERFLOW_BUFFER: ChartInset;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Top/left offset applied to the (enlarged) SVG group so its drawing area aligns
|
|
14
|
+
* with the container's top-left. The extra width/height added to the SVG
|
|
15
|
+
* overflows symmetrically on every side via `overflow: visible`.
|
|
16
|
+
*
|
|
17
|
+
* Uses `position: relative` to keep parity with the web implementation, where a
|
|
18
|
+
* negative `margin-top` would collapse through the container instead of
|
|
19
|
+
* offsetting the SVG inside it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const OVERFLOW_OFFSET: {
|
|
22
|
+
position: "relative";
|
|
23
|
+
top: number;
|
|
24
|
+
left: number;
|
|
15
25
|
};
|
|
16
26
|
export declare const ZERO_PADDING: ChartInset;
|
|
17
27
|
export declare const resolveInset: (inset: CartesianChartProps["inset"]) => ChartInset;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/CartesianChart/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/CartesianChart/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,UAK7B,CAAC;AACF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AACF,eAAO,MAAM,YAAY,EAAE,UAK1B,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,OAAO,mBAAmB,CAAC,OAAO,CAAC,KAClC,UAqBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,mBAAmB,CAAC,aAAa,CAAC,KAC1C,UAQF,CAAC"}
|
|
@@ -5,6 +5,10 @@ type Point = [x: number, y: number];
|
|
|
5
5
|
*
|
|
6
6
|
* When `xData` contains numeric values, those values are fed into the scale
|
|
7
7
|
* instead of the array index so the points honour a numeric X domain.
|
|
8
|
+
*
|
|
9
|
+
* When `xData` is provided, iteration is capped at `xData.length` so a series
|
|
10
|
+
* with more points than the axis has labels does not overflow past the right
|
|
11
|
+
* edge of the chart. The axis is treated as authoritative for the X domain.
|
|
8
12
|
*/
|
|
9
13
|
export declare const toScaledPoints: (data: (number | null)[], xScale: ChartScaleFunction, yScale: NumericScale, xData?: readonly (string | number)[]) => Point[] | null;
|
|
10
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,KAAK,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAEpC
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Line/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,KAAK,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAEpC;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EACvB,QAAQ,kBAAkB,EAC1B,QAAQ,YAAY,EACpB,QAAQ,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KACnC,KAAK,EAAE,GAAG,IAoBZ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,KAAG,MAAM,GAAG,IAOxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,KAAK,EAAE,EACf,aAAa,WAAW,KACvB,MAAM,GAAG,IAUX,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LineChartProps } from './types';
|
|
2
|
-
export declare const LineChart: ({ series, showArea, areaType, showXAxis, showYAxis, xAxis, yAxis, width, height, inset, children, enableScrubbing, onScrubberPositionChange, animate, }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const LineChart: ({ series, showArea, areaType, showXAxis, showYAxis, xAxis, yAxis, width, height, inset, children, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/LineChart.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/LineChart.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,SAAS,GAAI,uKAgBvB,cAAc,4CA8DhB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartInset, Series } from '../../utils/types';
|
|
3
3
|
import type { XAxisProps } from '../Axis/XAxis';
|
|
4
4
|
import type { YAxisProps } from '../Axis/YAxis';
|
|
5
5
|
export type LineChartProps = {
|
|
@@ -33,12 +33,12 @@ export type LineChartProps = {
|
|
|
33
33
|
* Combined axis configuration and visual props for the x-axis.
|
|
34
34
|
* Includes scale/domain settings as well as visual options like `showGrid` and `showLine`.
|
|
35
35
|
*/
|
|
36
|
-
xAxis?:
|
|
36
|
+
xAxis?: XAxisProps;
|
|
37
37
|
/**
|
|
38
38
|
* Combined axis configuration and visual props for the y-axis.
|
|
39
39
|
* Includes scale/domain settings as well as visual options like `showGrid` and `showLine`.
|
|
40
40
|
*/
|
|
41
|
-
yAxis?:
|
|
41
|
+
yAxis?: YAxisProps;
|
|
42
42
|
/**
|
|
43
43
|
* Width of the chart in pixels.
|
|
44
44
|
* When omitted, the component auto-measures via `onLayout`.
|
|
@@ -74,5 +74,12 @@ export type LineChartProps = {
|
|
|
74
74
|
* @default true
|
|
75
75
|
*/
|
|
76
76
|
animate?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Pixel radius within which the scrubber magnetically snaps to registered
|
|
79
|
+
* magnetic `<Point>` components. Requires `enableScrubbing` to be `true`.
|
|
80
|
+
* Set to `0` to disable magnetisation.
|
|
81
|
+
* @default 6
|
|
82
|
+
*/
|
|
83
|
+
magnetRadius?: number;
|
|
77
84
|
};
|
|
78
85
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/LineChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { PointLabelProps, PointProps } from './types';
|
|
2
2
|
export declare function PointLabel({ textAnchor, ...props }: Readonly<PointLabelProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare function Point({ dataX, dataY, color, label, LabelComponent, labelPosition, hidePoint, showLabelArrow, size, onPress, }: Readonly<PointProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export declare function Point({ dataX, dataY, color, label, LabelComponent, labelPosition, hidePoint, showLabelArrow, size, onPress, magnetic, }: Readonly<PointProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
//# sourceMappingURL=Point.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/Point.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/Point.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAS3D,wBAAgB,UAAU,CAAC,EACzB,UAAqB,EACrB,GAAG,KAAK,EACT,EAAE,QAAQ,CAAC,eAAe,CAAC,2CAa3B;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,cAAc,EACd,aAAqB,EACrB,SAAiB,EACjB,cAAqB,EACrB,IAAmB,EACnB,OAAO,EACP,QAAgB,GACjB,EAAE,QAAQ,CAAC,UAAU,CAAC,kDA0DtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DEFAULT_SIZE = 10;
|
|
2
|
+
export declare const STROKE_WIDTH = 2;
|
|
3
|
+
export declare const LABEL_FONT_SIZE = 10;
|
|
4
|
+
export declare const ARROW_WIDTH = 6;
|
|
5
|
+
export declare const ARROW_HEIGHT = 4;
|
|
6
|
+
export declare const GAP = 4;
|
|
7
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type MagneticPointsProviderProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare function MagneticPointsProvider({ children, }: Readonly<MagneticPointsProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=MagneticPointsProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MagneticPointsProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Point/pointContext/MagneticPointsProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,KAAK,2BAA2B,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,GACT,EAAE,QAAQ,CAAC,2BAA2B,CAAC,2CA8BvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Point/pointContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MagneticPointsContextValue = {
|
|
2
|
+
register: (dataIndex: number) => void;
|
|
3
|
+
unregister: (dataIndex: number) => void;
|
|
4
|
+
version: number;
|
|
5
|
+
getMagneticPoints: () => ReadonlySet<number>;
|
|
6
|
+
};
|
|
7
|
+
declare const MagneticPointsContextProvider: import("react").FC<{
|
|
8
|
+
children: import("react").ReactNode;
|
|
9
|
+
value: MagneticPointsContextValue;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const useMagneticPointsContext: () => MagneticPointsContextValue;
|
|
12
|
+
export { MagneticPointsContextProvider };
|
|
13
|
+
//# sourceMappingURL=magneticPointsContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magneticPointsContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Point/pointContext/magneticPointsContext.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAO,6BAA6B;;;EAC6B,CAAC;AAElE,eAAO,MAAM,wBAAwB,QAAO,0BAIxC,CAAC;AAEL,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
|
|
@@ -70,5 +70,12 @@ export type PointProps = {
|
|
|
70
70
|
* Called when the point is pressed.
|
|
71
71
|
*/
|
|
72
72
|
onPress?: (event: GestureResponderEvent) => void;
|
|
73
|
+
/**
|
|
74
|
+
* When `true`, the scrubber magnetically snaps to this point within the
|
|
75
|
+
* chart's `magnetRadius`. Requires `enableScrubbing` to be set on the
|
|
76
|
+
* parent chart.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
magnetic?: boolean;
|
|
73
80
|
};
|
|
74
81
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,UAAU,CAAC,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEjE,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IACjD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/types.ts"],"names":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export declare const LABEL_FONT_SIZE = 10;
|
|
5
|
-
export declare const ARROW_WIDTH = 6;
|
|
6
|
-
export declare const ARROW_HEIGHT = 4;
|
|
7
|
-
export declare const GAP = 4;
|
|
2
|
+
import type { BaseAxisProps } from '../Axis';
|
|
3
|
+
import type { MagneticPointsContextValue } from './pointContext/magneticPointsContext';
|
|
8
4
|
export declare const isWithinBounds: (px: number, py: number, area: DrawingArea) => boolean;
|
|
9
5
|
/**
|
|
10
6
|
* Builds the three SVG points of the arrow triangle.
|
|
@@ -17,6 +13,12 @@ export declare const buildArrowPoints: (cx: number, cy: number, radius: number,
|
|
|
17
13
|
* Resolves the label prop to a string or undefined.
|
|
18
14
|
*/
|
|
19
15
|
export declare const resolveLabel: (label: string | ((dataIndex: number) => string) | undefined, dataX: number) => string | undefined;
|
|
16
|
+
export declare const resolveDataXToIndex: (dataX: number, axisConfig: BaseAxisProps | undefined) => number | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Registers/unregisters a data index as a magnetic snap target
|
|
19
|
+
* when the Point has `magnetic` enabled.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useMagneticRegistration: (magnetic: boolean, dataX: number, getXAxisConfig: () => BaseAxisProps | undefined, { register, unregister }: MagneticPointsContextValue) => void;
|
|
20
22
|
/**
|
|
21
23
|
* Computes the vertical position of the label text baseline.
|
|
22
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Point/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAEvF,eAAO,MAAM,cAAc,GACzB,IAAI,MAAM,EACV,IAAI,MAAM,EACV,MAAM,WAAW,KAChB,OAIyB,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,EACV,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,UAAU,KAAK,GAAG,QAAQ,KACzB,MAYF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,EAC3D,OAAO,MAAM,KACZ,MAAM,GAAG,SAGX,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,MAAM,EACb,YAAY,aAAa,GAAG,SAAS,KACpC,MAAM,GAAG,SAMX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,OAAO,EACjB,OAAO,MAAM,EACb,gBAAgB,MAAM,aAAa,GAAG,SAAS,EAC/C,0BAA0B,0BAA0B,KACnD,IAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,eAAe,KAAK,GAAG,QAAQ,EAC/B,aAAa,OAAO,KACnB,MAMF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartScaleFunction, DrawingArea } from '../../utils/types';
|
|
2
|
+
import type { BaseAxisProps } from '../Axis';
|
|
2
3
|
import type { LabelAlignment, LabelPosition } from './types';
|
|
3
4
|
type LabelCoordinates = {
|
|
4
5
|
x: number;
|
|
@@ -11,7 +12,7 @@ type ResolvePixelParams = {
|
|
|
11
12
|
scale: ChartScaleFunction | undefined;
|
|
12
13
|
axis: 'x' | 'y';
|
|
13
14
|
drawingArea: DrawingArea;
|
|
14
|
-
axisConfig?:
|
|
15
|
+
axisConfig?: BaseAxisProps;
|
|
15
16
|
};
|
|
16
17
|
type LabelParams = {
|
|
17
18
|
pixel: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ReferenceLine/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7D,KAAK,gBAAgB,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD,CAAC;AAQF,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACtC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mBAAmB,CAAC,EAAE,cAAc,CAAC;IACrC,iBAAiB,CAAC,EAAE,cAAc,CAAC;CACpC,CAAC;AAuBF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,gBAAgB,CAAC,kBAAkB,CAAC,EAC9C,UAAU,MAAM,KACf,MAAuC,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,EACb,MAAM,GAAG,GAAG,GAAG,EACf,aAAa,WAAW,KACvB,OAKF,CAAC;AAqBF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,sDAM1B,kBAAkB,KAAG,MAAM,GAAG,SAehC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,wFAQ/C,WAAW,KAAG,gBAKf,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,+BAA+B,GAAI,wFAQ7C,WAAW,KAAG,gBAKf,CAAC"}
|
|
@@ -35,8 +35,12 @@ export declare const computeItemsBaseY: (drawingAreaY: number, hasTitle: boolean
|
|
|
35
35
|
/**
|
|
36
36
|
* Reads the rendered widths of all tooltip text elements via async `getBBox`.
|
|
37
37
|
* Defers until the next animation frame so layout has settled.
|
|
38
|
+
* Returns a cancel function so callers can abort the pending RAF.
|
|
38
39
|
*/
|
|
39
|
-
export declare const measureWidths: (items: ChartTooltipItemData[], hasTitle: boolean, titleRef: RefObject<SvgBBoxElement | null>, labelRefs: RefObject<(SvgBBoxElement | null)[]>, valueRefs: RefObject<(SvgBBoxElement | null)[]>) =>
|
|
40
|
+
export declare const measureWidths: (items: ChartTooltipItemData[], hasTitle: boolean, titleRef: RefObject<SvgBBoxElement | null>, labelRefs: RefObject<(SvgBBoxElement | null)[]>, valueRefs: RefObject<(SvgBBoxElement | null)[]>) => {
|
|
41
|
+
promise: Promise<Widths>;
|
|
42
|
+
cancel: () => void;
|
|
43
|
+
};
|
|
40
44
|
/**
|
|
41
45
|
* Manages SVG text measurement for the tooltip via async `getBBox`.
|
|
42
46
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts"],"names":[],"mappings":"A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ACxB,OAAO,oBAAoB,EAAE,EAC7B,UAAU,OAAO,EACjB,UAAU,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,EAC1C,WAAW,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,EAC/C,WAAW,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,KAC9C;IAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAahD,CAAC;AAsBF;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,oBAAoB,EAAE,EAC7B,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GACjC,2BAA2B,CAoC7B;AAED,KAAK,SAAS,GAAG,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM;IAAE,OAAO,EAAE,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAA;CAAE,EAC5C,QAAQ,MAAM,KACb,SAAS,EAUX,CAAC"}
|
|
@@ -12,5 +12,5 @@ import type { ScrubberProviderProps } from './types';
|
|
|
12
12
|
* `FlatList`. The `isScrubbing` shared value gates the pan via manual activation
|
|
13
13
|
* so scroll and scrub gestures never compete.
|
|
14
14
|
*/
|
|
15
|
-
export declare function ScrubberProvider({ children, width, height, enableScrubbing, onScrubberPositionChange, }: Readonly<ScrubberProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function ScrubberProvider({ children, width, height, enableScrubbing, onScrubberPositionChange, magnetRadius, style, }: Readonly<ScrubberProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
//# sourceMappingURL=ScrubberProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAUrD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,MAAM,EACN,eAAe,EACf,wBAAwB,EACxB,YAAgB,EAChB,KAAK,GACN,EAAE,QAAQ,CAAC,qBAAqB,CAAC,2CA2JjC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
3
|
import type { DrawingArea } from '../../utils/types';
|
|
3
4
|
export type ScrubberContextValue = {
|
|
4
5
|
/**
|
|
@@ -32,6 +33,18 @@ export type ScrubberProviderProps = {
|
|
|
32
33
|
* Optional external callback fired whenever the scrubber position changes.
|
|
33
34
|
*/
|
|
34
35
|
onScrubberPositionChange?: (index: number | undefined) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Pixel radius within which the scrubber magnetically snaps to registered
|
|
38
|
+
* magnetic points. Set to `0` to disable magnetisation.
|
|
39
|
+
* @default 6
|
|
40
|
+
*/
|
|
41
|
+
magnetRadius?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Optional style applied to the wrapping `View` that holds the chart and the
|
|
44
|
+
* gesture overlay.Used to offset the(enlarged) SVG group so its drawing area
|
|
45
|
+
* aligns with the container footprint.
|
|
46
|
+
*/
|
|
47
|
+
style?: StyleProp<ViewStyle>;
|
|
35
48
|
};
|
|
36
49
|
export type ChartTooltipItemData = {
|
|
37
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG;IACzD;;;OAGG;IACH,CAAC,CAAC,EAA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,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,sBAAsB,CAAC;CACzD,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CartesianChartContextValue, ChartScaleFunction } from '../../utils/types';
|
|
2
|
+
import type { BaseAxisProps } from '../Axis';
|
|
3
|
+
export type MagnetEntry = {
|
|
4
|
+
index: number;
|
|
5
|
+
pixelX: number;
|
|
6
|
+
};
|
|
2
7
|
/**
|
|
3
8
|
* Converts a pixel position along the x-axis into the nearest data index.
|
|
4
9
|
*
|
|
@@ -6,7 +11,7 @@ import type { AxisConfigProps, CartesianChartContextValue, ChartScaleFunction }
|
|
|
6
11
|
* `pixelX`. For numeric scales, uses `scale.invert()` and rounds to the
|
|
7
12
|
* nearest integer, clamped to the valid index range.
|
|
8
13
|
*/
|
|
9
|
-
export declare const getDataIndexFromPosition: (pixelX: number, scale: ChartScaleFunction, axisConfig: Partial<
|
|
14
|
+
export declare const getDataIndexFromPosition: (pixelX: number, scale: ChartScaleFunction, axisConfig: Partial<BaseAxisProps> | undefined, dataLength: number) => number;
|
|
10
15
|
/**
|
|
11
16
|
* Resolves the pixel y-coordinate for a given series data point at a data index.
|
|
12
17
|
* Returns undefined when the value is null/missing or the scale is unavailable.
|
|
@@ -18,5 +23,30 @@ export declare const resolvePixelY: (dataIndex: number, seriesData: (number | nu
|
|
|
18
23
|
* otherwise the data index is used as the x input.
|
|
19
24
|
* Returns undefined only when the scale is unavailable.
|
|
20
25
|
*/
|
|
21
|
-
export declare const resolvePixelX: (dataIndex: number, getXScale: CartesianChartContextValue["getXScale"], axisConfig?:
|
|
26
|
+
export declare const resolvePixelX: (dataIndex: number, getXScale: CartesianChartContextValue["getXScale"], axisConfig?: BaseAxisProps) => number | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Resolves each magnetic index to its pixel position and returns them sorted
|
|
29
|
+
* by `pixelX` ascending. Indices that cannot be projected are filtered out.
|
|
30
|
+
* The sorted output enables early-exit in {@link applyMagnetisation}.
|
|
31
|
+
*/
|
|
32
|
+
export declare const buildSortedMagnets: ({ magneticIndices, getPixelForIndex, }: {
|
|
33
|
+
magneticIndices: ReadonlySet<number>;
|
|
34
|
+
getPixelForIndex: (index: number) => number | undefined;
|
|
35
|
+
}) => MagnetEntry[];
|
|
36
|
+
/**
|
|
37
|
+
* Binary search for the magnet whose `pixelX` is closest to `pixelX`.
|
|
38
|
+
* Returns -1 when the array is empty. Favors the left neighbor on ties.
|
|
39
|
+
*/
|
|
40
|
+
export declare const nearestIndex: (sortedMagnets: readonly MagnetEntry[], pixelX: number) => number;
|
|
41
|
+
/**
|
|
42
|
+
* Given a resolved data index and the raw pixel position, checks whether any
|
|
43
|
+
* magnetic point is within `magnetRadius` pixels of `pixelX`. If so, returns
|
|
44
|
+
* the closest magnetic index; otherwise returns the original `resolvedIndex`.
|
|
45
|
+
*/
|
|
46
|
+
export declare const applyMagnetisation: ({ resolvedIndex, pixelX, sortedMagnets, magnetRadius, }: {
|
|
47
|
+
resolvedIndex: number;
|
|
48
|
+
pixelX: number;
|
|
49
|
+
sortedMagnets: readonly MagnetEntry[];
|
|
50
|
+
magnetRadius: number;
|
|
51
|
+
}) => number;
|
|
22
52
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,0BAA0B,EAC1B,kBAAkB,EACnB,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
-
import type { AxisBounds,
|
|
1
|
+
import type { AxisBounds, BaseAxisProps } from '../../Components/Axis';
|
|
2
|
+
import type { Series } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Compute the X domain (index-based) from series data and axis config.
|
|
4
5
|
* For the X axis the domain is typically 0..N-1 where N = longest series length,
|
|
5
6
|
* unless explicit `data` is provided on the axis config.
|
|
6
7
|
*/
|
|
7
|
-
export declare const computeXDomain: (series: Series[], axisConfig?: Partial<
|
|
8
|
+
export declare const computeXDomain: (series: Series[], axisConfig?: Partial<BaseAxisProps>) => AxisBounds;
|
|
8
9
|
/**
|
|
9
10
|
* Compute the Y domain (value-based) from series data and axis config.
|
|
10
11
|
* Scans all non-null values across all series to find min/max.
|
|
11
12
|
*/
|
|
12
|
-
export declare const computeYDomain: (series: Series[], axisConfig?: Partial<
|
|
13
|
+
export declare const computeYDomain: (series: Series[], axisConfig?: Partial<BaseAxisProps>) => AxisBounds;
|
|
13
14
|
/**
|
|
14
15
|
* Compute the data length (number of discrete positions on the index axis).
|
|
15
16
|
*/
|
|
16
|
-
export declare const computeDataLength: (series: Series[], axisConfig?: Partial<
|
|
17
|
+
export declare const computeDataLength: (series: Series[], axisConfig?: Partial<BaseAxisProps>) => number;
|
|
17
18
|
//# sourceMappingURL=domain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/domain/domain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/domain/domain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EAAE,EAChB,aAAa,OAAO,CAAC,aAAa,CAAC,KAClC,UA4BF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EAAE,EAChB,aAAa,OAAO,CAAC,aAAa,CAAC,KAClC,UAwBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,EAAE,EAChB,aAAa,OAAO,CAAC,aAAa,CAAC,KAClC,MAKF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { CartesianChartContextValue, CategoricalScale, ChartInset, ChartScaleFunction, DrawingArea, NumericScale, Series, } from './types';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,MAAM,GACP,MAAM,SAAS,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { AxisBounds,
|
|
1
|
+
import type { AxisBounds, BaseAxisProps } from '../../Components/Axis';
|
|
2
|
+
import type { CategoricalScale, ChartScaleFunction, NumericScale } from '../types';
|
|
2
3
|
/**
|
|
3
|
-
* Creates a numeric scale
|
|
4
|
-
*
|
|
4
|
+
* Creates a numeric scale.
|
|
5
|
+
*
|
|
6
|
+
* When `nice` is `true` (default), the domain is rounded outward to clean
|
|
7
|
+
* boundaries via d3's `.nice()` (e.g. `[4, 98]` → `[0, 100]`). Set `nice` to
|
|
8
|
+
* `false` to keep the domain exactly as provided so data fills the range
|
|
9
|
+
* boundary-to-boundary.
|
|
5
10
|
*/
|
|
6
|
-
export declare const getNumericScale: ({ scaleType, domain, range, }: {
|
|
11
|
+
export declare const getNumericScale: ({ scaleType, domain, range, nice, }: {
|
|
7
12
|
scaleType: "linear" | "log";
|
|
8
13
|
domain: AxisBounds;
|
|
9
14
|
range: AxisBounds;
|
|
15
|
+
nice?: boolean;
|
|
10
16
|
}) => NumericScale;
|
|
11
17
|
export declare const getCategoricalScale: ({ domain, range, padding, }: {
|
|
12
18
|
domain: AxisBounds;
|
|
@@ -16,7 +22,7 @@ export declare const getCategoricalScale: ({ domain, range, padding, }: {
|
|
|
16
22
|
/**
|
|
17
23
|
* Checks if a scale type config value refers to a band (categorical) scale.
|
|
18
24
|
*/
|
|
19
|
-
export declare const isBandScaleType: (scaleType:
|
|
25
|
+
export declare const isBandScaleType: (scaleType: BaseAxisProps["scaleType"]) => scaleType is "band";
|
|
20
26
|
/**
|
|
21
27
|
* Checks if a scale is a categorical scale.
|
|
22
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/scales/scales.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/scales/scales.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,qCAK7B;IACD,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,KAAG,YAOH,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,6BAIjC;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,gBAUH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,aAAa,CAAC,WAAW,CAAC,KACpC,SAAS,IAAI,MAA8B,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,kBAAkB,KACxB,KAAK,IAAI,gBAEX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,KACxB,KAAK,IAAI,YAEX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,EACjB,OAAO,kBAAkB,KACxB,MAKF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,OAAO,MAAM,EACb,QAAQ,kBAAkB,EAC1B,QAAQ,kBAAkB,KACzB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAGvB,CAAC"}
|