@ledgerhq/lumen-ui-rnative-visualization 0.1.13 → 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/ChartTooltipItem.js +52 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.js.map +1 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js +81 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js.map +1 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.test.js +340 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.test.js.map +1 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/constants.js +12 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/constants.js.map +1 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js +166 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.js.map +1 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.test.js +253 -0
- package/dist/module/lib/Components/Scrubber/DefaultScrubberTooltip/utils.test.js.map +1 -0
- package/dist/module/lib/Components/Scrubber/Scrubber.js +40 -21
- package/dist/module/lib/Components/Scrubber/Scrubber.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/Scrubber.stories.js +80 -30
- package/dist/module/lib/Components/Scrubber/Scrubber.stories.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/Scrubber.test.js +10 -5
- package/dist/module/lib/Components/Scrubber/Scrubber.test.js.map +1 -1
- package/dist/module/lib/Components/Scrubber/ScrubberProvider.js +81 -29
- 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/ChartTooltipItem.d.ts +9 -0
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts +12 -0
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/constants.d.ts +10 -0
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/constants.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.d.ts +69 -0
- package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/Scrubber/Scrubber.d.ts +14 -2
- package/dist/typescript/src/lib/Components/Scrubber/Scrubber.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/index.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Scrubber/types.d.ts +116 -4
- 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 -24
- 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/ChartTooltipItem.tsx +54 -0
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.test.tsx +259 -0
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.tsx +105 -0
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/constants.ts +9 -0
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.test.ts +264 -0
- package/src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts +243 -0
- package/src/lib/Components/Scrubber/Scrubber.stories.tsx +104 -42
- package/src/lib/Components/Scrubber/Scrubber.test.tsx +7 -5
- package/src/lib/Components/Scrubber/Scrubber.tsx +47 -24
- package/src/lib/Components/Scrubber/ScrubberProvider.tsx +92 -28
- package/src/lib/Components/Scrubber/index.ts +10 -1
- package/src/lib/Components/Scrubber/types.ts +122 -4
- 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
|
@@ -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"}
|
package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChartTooltipItemProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Memoized so it only re-renders when one of its primitive props actually
|
|
4
|
+
* changes. Combined with the stable per-index ref callbacks built in
|
|
5
|
+
* `DefaultScrubberTooltip`, this keeps the row out of the per-scrub-frame
|
|
6
|
+
* reconciliation path when its label / value / position have not changed.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ChartTooltipItem: import("react").NamedExoticComponent<Readonly<ChartTooltipItemProps>>;
|
|
9
|
+
//# sourceMappingURL=ChartTooltipItem.d.ts.map
|
package/dist/typescript/src/lib/Components/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartTooltipItem.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Scrubber/DefaultScrubberTooltip/ChartTooltipItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGtD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,uEAwC3B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ScrubberTooltipProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Default structured tooltip anchored to the scrubber line.
|
|
4
|
+
*
|
|
5
|
+
* The tooltip auto-fits its width to the rendered content via `getBBox`,
|
|
6
|
+
* with `minWidth` acting as an optional minimum width override. Use with
|
|
7
|
+
* {@link ScrubberProps.tooltip}; layout options (`offset`, `minWidth`) belong
|
|
8
|
+
* on the object returned from the `tooltip` callback. Return `{ items: [] }`
|
|
9
|
+
* from the callback to hide the tooltip at a given index.
|
|
10
|
+
*/
|
|
11
|
+
export declare function DefaultScrubberTooltip({ pixelX, drawingArea, title, items, offset, minWidth, }: Readonly<ScrubberTooltipProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=DefaultScrubberTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultScrubberTooltip.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAoBrD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,WAAW,EACX,KAAK,EACL,KAAK,EACL,MAAuB,EACvB,QAAoC,GACrC,EAAE,QAAQ,CAAC,oBAAoB,CAAC,kDAiEhC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DEFAULT_OFFSET = 10;
|
|
2
|
+
export declare const DEFAULT_TOOLTIP_MIN_WIDTH = 80;
|
|
3
|
+
export declare const PADDING_X = 8;
|
|
4
|
+
export declare const PADDING_Y = 8;
|
|
5
|
+
export declare const ROW_HEIGHT = 16;
|
|
6
|
+
export declare const ROW_GAP = 6;
|
|
7
|
+
export declare const TITLE_GAP = 6;
|
|
8
|
+
export declare const BORDER_RADIUS = 4;
|
|
9
|
+
export declare const LABEL_VALUE_GAP = 12;
|
|
10
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Scrubber/DefaultScrubberTooltip/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { DrawingArea } from '../../../utils/types';
|
|
3
|
+
import type { ChartTooltipItemData, SvgBBoxElement } from '../types';
|
|
4
|
+
type Widths = {
|
|
5
|
+
title: number;
|
|
6
|
+
labels: number[];
|
|
7
|
+
values: number[];
|
|
8
|
+
};
|
|
9
|
+
type UseTooltipMeasurementReturn = {
|
|
10
|
+
widths: Widths | null;
|
|
11
|
+
titleRef: RefObject<SvgBBoxElement | null>;
|
|
12
|
+
labelRefs: RefObject<(SvgBBoxElement | null)[]>;
|
|
13
|
+
valueRefs: RefObject<(SvgBBoxElement | null)[]>;
|
|
14
|
+
};
|
|
15
|
+
export declare const safeGetBBoxWidth: (el: SvgBBoxElement | null) => Promise<number>;
|
|
16
|
+
/**
|
|
17
|
+
* Derive the auto-fit tooltip width from measured text widths,
|
|
18
|
+
* clamped to a minimum floor.
|
|
19
|
+
*/
|
|
20
|
+
export declare const computeTooltipWidth: (widths: Widths | null, hasTitle: boolean, minWidth: number) => number;
|
|
21
|
+
/**
|
|
22
|
+
* Compute the tooltip's horizontal position, flipping to the left
|
|
23
|
+
* of the scrubber line when it would overflow the drawing area.
|
|
24
|
+
* Also clamps from above to prevent overflow on the right edge.
|
|
25
|
+
*/
|
|
26
|
+
export declare const computeTooltipX: (pixelX: number, offset: number, tooltipWidth: number, drawingArea: DrawingArea) => number;
|
|
27
|
+
/**
|
|
28
|
+
* Compute the total tooltip height from item count and title presence.
|
|
29
|
+
*/
|
|
30
|
+
export declare const computeTooltipHeight: (itemCount: number, hasTitle: boolean) => number;
|
|
31
|
+
/**
|
|
32
|
+
* Vertical offset where tooltip rows begin, accounting for title presence.
|
|
33
|
+
*/
|
|
34
|
+
export declare const computeItemsBaseY: (drawingAreaY: number, hasTitle: boolean) => number;
|
|
35
|
+
/**
|
|
36
|
+
* Reads the rendered widths of all tooltip text elements via async `getBBox`.
|
|
37
|
+
* Defers until the next animation frame so layout has settled.
|
|
38
|
+
* Returns a cancel function so callers can abort the pending RAF.
|
|
39
|
+
*/
|
|
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
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Manages SVG text measurement for the tooltip via async `getBBox`.
|
|
46
|
+
*
|
|
47
|
+
* Uses `requestAnimationFrame` to defer measurement until after layout, with a
|
|
48
|
+
* cancellation flag to prevent stale state updates when items change rapidly.
|
|
49
|
+
*
|
|
50
|
+
* The effect's dependency is a shape signature (labels + title + count) rather
|
|
51
|
+
* than the raw `items` reference, so high-frequency value updates during a
|
|
52
|
+
* scrub do not trigger a fresh measurement chain. Value-width auto-fit is
|
|
53
|
+
* handled by `minWidth`; consumers that need pixel-perfect value fitting
|
|
54
|
+
* should set a `minWidth` large enough to cover the widest value.
|
|
55
|
+
*/
|
|
56
|
+
export declare function useTooltipMeasurement(items: ChartTooltipItemData[], hasTitle: boolean, title: string | number | undefined): UseTooltipMeasurementReturn;
|
|
57
|
+
type RefSetter = (el: SvgBBoxElement | null) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Builds stable per-index ref-callback arrays that mutate the given refs in
|
|
60
|
+
* place. Recomputed only when `length` changes, so the same callback identity
|
|
61
|
+
* is passed to each `ChartTooltipItem` across scrub frames. This unlocks
|
|
62
|
+
* `React.memo` on `ChartTooltipItem` and avoids the per-frame detach /
|
|
63
|
+
* re-attach dance of inline arrow ref callbacks.
|
|
64
|
+
*/
|
|
65
|
+
export declare const useBuildRefSetters: (refs: {
|
|
66
|
+
current: (SvgBBoxElement | null)[];
|
|
67
|
+
}, length: number) => RefSetter[];
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Scrubber/DefaultScrubberTooltip/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAUrE,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC3C,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAChD,SAAS,EAAE,SAAS,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,IAAI,cAAc,GAAG,IAAI,KACxB,OAAO,CAAC,MAAM,CAQhB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,MAAM,GAAG,IAAI,EACrB,UAAU,OAAO,EACjB,UAAU,MAAM,KACf,MAUF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,cAAc,MAAM,EACpB,aAAa,WAAW,KACvB,MAWF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,WAAW,MAAM,EACjB,UAAU,OAAO,KAChB,MAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,UAAU,OAAO,KAChB,MAGF,CAAC;AAaF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ScrubberProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Renders the scrubber visuals: vertical reference line, future-data overlay
|
|
4
|
-
* rect, per-series beacon dots,
|
|
4
|
+
* rect, per-series beacon dots, optional label above the line, and an optional
|
|
5
|
+
* tooltip when {@link ScrubberProps.tooltip} is set, using {@link DefaultScrubberTooltip}.
|
|
5
6
|
*
|
|
6
7
|
* Must be used as a child of `LineChart` (or `CartesianChart`) with
|
|
7
8
|
* `enableScrubbing` enabled. Renders nothing when no scrubber position is active.
|
|
@@ -12,6 +13,17 @@ import type { ScrubberProps } from './types';
|
|
|
12
13
|
* <Scrubber label={(i) => data[i].date} />
|
|
13
14
|
* </LineChart>
|
|
14
15
|
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Tooltip
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Scrubber
|
|
20
|
+
* tooltip={(i) => ({
|
|
21
|
+
* title: `${counts[i]} Transactions`,
|
|
22
|
+
* items: [{ label: 'Index', value: String(i) }],
|
|
23
|
+
* minWidth: 160,
|
|
24
|
+
* })}
|
|
25
|
+
* />
|
|
26
|
+
* ```
|
|
15
27
|
*/
|
|
16
|
-
export declare function Scrubber({
|
|
28
|
+
export declare function Scrubber({ hideLine, hideOverlay, showBeacons, tooltip, }: Readonly<ScrubberProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
17
29
|
//# sourceMappingURL=Scrubber.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/Scrubber.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/Scrubber.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAgB,EAChB,WAAmB,EACnB,WAAmB,EACnB,OAAO,GACR,EAAE,QAAQ,CAAC,aAAa,CAAC,kDA0JzB"}
|
|
@@ -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,4 @@
|
|
|
1
1
|
export { Scrubber } from './Scrubber';
|
|
2
2
|
export { useScrubberContext } from './context';
|
|
3
|
-
export type {
|
|
3
|
+
export type { ChartTooltipItemData, ChartTooltipItemProps, ScrubberContextValue, ScrubberProps, ScrubberTooltipContent, ScrubberTooltipProps, SvgBBoxElement, } from './types';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Scrubber/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { DrawingArea } from '../../utils/types';
|
|
2
4
|
export type ScrubberContextValue = {
|
|
3
5
|
/**
|
|
4
6
|
* Whether scrubbing interactions are enabled.
|
|
@@ -31,13 +33,117 @@ export type ScrubberProviderProps = {
|
|
|
31
33
|
* Optional external callback fired whenever the scrubber position changes.
|
|
32
34
|
*/
|
|
33
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>;
|
|
34
48
|
};
|
|
35
|
-
export type
|
|
49
|
+
export type ChartTooltipItemData = {
|
|
50
|
+
/**
|
|
51
|
+
* Label displayed on the left side of the row.
|
|
52
|
+
*/
|
|
53
|
+
label: string | number;
|
|
54
|
+
/**
|
|
55
|
+
* Value displayed on the right side of the row.
|
|
56
|
+
*/
|
|
57
|
+
value: string | number;
|
|
58
|
+
};
|
|
59
|
+
export type ChartTooltipItemProps = ChartTooltipItemData & {
|
|
60
|
+
/**
|
|
61
|
+
* X position in SVG coordinate space.
|
|
62
|
+
* @default 0
|
|
63
|
+
*/
|
|
64
|
+
x?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Y midline position in SVG coordinate space.
|
|
67
|
+
* @default 0
|
|
68
|
+
*/
|
|
69
|
+
y?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Width allocated to this row, used to right-align the value text.
|
|
72
|
+
*/
|
|
73
|
+
width: number;
|
|
36
74
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
75
|
+
* Optional callback ref forwarded to the label `<Text>` element.
|
|
76
|
+
* Useful to measure the label's natural width via `getBBox` for auto-fit layouts.
|
|
39
77
|
*/
|
|
40
|
-
|
|
78
|
+
labelRef?: (el: SvgBBoxElement | null) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Optional callback ref forwarded to the value `<Text>` element.
|
|
81
|
+
* Useful to measure the value's natural width via `getBBox` for auto-fit layouts.
|
|
82
|
+
*/
|
|
83
|
+
valueRef?: (el: SvgBBoxElement | null) => void;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Minimal interface for an SVG element that supports `getBBox`.
|
|
87
|
+
* Handles both react-native-svg (returns `Rect | undefined`) and web DOM SVG
|
|
88
|
+
* (returns `DOMRect` synchronously or a Promise on native bridge).
|
|
89
|
+
*/
|
|
90
|
+
export type SvgBBoxElement = {
|
|
91
|
+
getBBox: () => {
|
|
92
|
+
width: number;
|
|
93
|
+
} | undefined | Promise<{
|
|
94
|
+
width: number;
|
|
95
|
+
} | undefined>;
|
|
96
|
+
};
|
|
97
|
+
export type ScrubberTooltipLayoutProps = {
|
|
98
|
+
/**
|
|
99
|
+
* Horizontal gap in pixels between the scrubber line and the tooltip box.
|
|
100
|
+
* @default 10
|
|
101
|
+
*/
|
|
102
|
+
offset?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Minimum width in pixels. The tooltip auto-fits to the rendered content
|
|
105
|
+
* but never collapses below this floor; raise it to avoid jitter when
|
|
106
|
+
* value length changes between indices.
|
|
107
|
+
* @default 80
|
|
108
|
+
*/
|
|
109
|
+
minWidth?: number;
|
|
110
|
+
};
|
|
111
|
+
export type ScrubberTooltipProps = ScrubberTooltipLayoutProps & {
|
|
112
|
+
/**
|
|
113
|
+
* Horizontal pixel position of the scrubber line within the SVG coordinate
|
|
114
|
+
* space. Used to place the tooltip left or right of the line.
|
|
115
|
+
*/
|
|
116
|
+
pixelX: number;
|
|
117
|
+
/**
|
|
118
|
+
* Bounding box of the chart's drawing area (x, y, width, height). Used to
|
|
119
|
+
* constrain the tooltip so it never overflows the chart boundaries.
|
|
120
|
+
*/
|
|
121
|
+
drawingArea: DrawingArea;
|
|
122
|
+
/**
|
|
123
|
+
* Optional title displayed at the top of the tooltip. Omit to render
|
|
124
|
+
* the tooltip without a title row.
|
|
125
|
+
*/
|
|
126
|
+
title?: string | number;
|
|
127
|
+
/**
|
|
128
|
+
* List of label/value pairs rendered as rows inside the tooltip body.
|
|
129
|
+
*/
|
|
130
|
+
items: ChartTooltipItemData[];
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Return value of the `tooltip` callback on {@link ScrubberProps}.
|
|
134
|
+
*/
|
|
135
|
+
export type ScrubberTooltipContent = ScrubberTooltipLayoutProps & {
|
|
136
|
+
/**
|
|
137
|
+
* Optional header. Static value or callback per data index.
|
|
138
|
+
* A callback may return `undefined` to suppress the title.
|
|
139
|
+
*/
|
|
140
|
+
title?: string | number | ((index: number) => string | number | undefined);
|
|
141
|
+
/**
|
|
142
|
+
* Tooltip rows for this index. Return an empty array to hide the tooltip.
|
|
143
|
+
*/
|
|
144
|
+
items: ChartTooltipItemData[];
|
|
145
|
+
};
|
|
146
|
+
export type ScrubberProps = {
|
|
41
147
|
/**
|
|
42
148
|
* Hides the vertical reference line.
|
|
43
149
|
* @default false
|
|
@@ -53,5 +159,11 @@ export type ScrubberProps = {
|
|
|
53
159
|
* @default false
|
|
54
160
|
*/
|
|
55
161
|
showBeacons?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Produces tooltip content for the active data index. When set, {@link DefaultScrubberTooltip}
|
|
164
|
+
* is rendered. Optional `offset` and `minWidth` on the returned object tune layout.
|
|
165
|
+
* Return `{ items: [] }` to hide the tooltip at an index.
|
|
166
|
+
*/
|
|
167
|
+
tooltip?: (dataIndex: number) => ScrubberTooltipContent;
|
|
56
168
|
};
|
|
57
169
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MACL;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GACjB,SAAS,GACT,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG;IAC9D;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,GAAG;IAChE;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3E;;OAEG;IACH,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,QAAQ,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,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgCF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,QAAQ,MAAM,EACd,OAAO,kBAAkB,EACzB,YAAY,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,EAC9C,YAAY,MAAM,KACjB,MAmCF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,WAAW,MAAM,EACjB,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,SAAS,EACzC,WAAW,0BAA0B,CAAC,WAAW,CAAC,KACjD,MAAM,GAAG,SASX,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,WAAW,MAAM,EACjB,WAAW,0BAA0B,CAAC,WAAW,CAAC,EAClD,aAAa,aAAa,KACzB,MAAM,GAAG,SAMX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,wCAGhC;IACD,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CACzD,KAAG,WAAW,EAad,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,eAAe,SAAS,WAAW,EAAE,EACrC,QAAQ,MAAM,KACb,MAsBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,yDAKhC;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;CACtB,KAAG,MAWH,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseAxisProps } from '../../Components/Axis';
|
|
2
|
+
import type { ChartScaleFunction, DrawingArea } from '../types';
|
|
2
3
|
export declare const APPROXIMATE_TICK_COUNT = 5;
|
|
3
4
|
export type TickData = {
|
|
4
5
|
position: number;
|
|
@@ -7,9 +8,16 @@ export type TickData = {
|
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* Resolves which numeric tick values should appear on the axis.
|
|
10
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* Priority:
|
|
13
|
+
* 1. Explicit `ticks` provided by the consumer.
|
|
14
|
+
* 2. Axis `data` — when provided, ticks come from the data itself (numeric
|
|
15
|
+
* values for numeric data, indices for string data) so the rendered ticks
|
|
16
|
+
* mirror exactly what the consumer asked for, with no d3-invented
|
|
17
|
+
* intermediate values.
|
|
18
|
+
* 3. Scale-specific defaults (band domain, or `scale.ticks()` for numeric).
|
|
11
19
|
*/
|
|
12
|
-
export declare const getTickValues: (scale: ChartScaleFunction, explicitTicks?: number[]) => number[];
|
|
20
|
+
export declare const getTickValues: (scale: ChartScaleFunction, explicitTicks?: number[], axisData?: BaseAxisProps["data"]) => number[];
|
|
13
21
|
/**
|
|
14
22
|
* Converts a tick value to its pixel position on the axis.
|
|
15
23
|
* Band scales are centered within the band.
|
|
@@ -19,11 +27,11 @@ export declare const getTickPosition: (scale: ChartScaleFunction, tick: number)
|
|
|
19
27
|
* Resolves the display label for a tick value.
|
|
20
28
|
* Priority: formatter > string label lookup > raw value.
|
|
21
29
|
*/
|
|
22
|
-
export declare const getTickLabel: (tick: number, axisData:
|
|
30
|
+
export declare const getTickLabel: (tick: number, axisData: BaseAxisProps["data"], formatter?: (value: number | string) => string) => string;
|
|
23
31
|
/**
|
|
24
32
|
* Builds the complete tick data array from a scale and axis configuration.
|
|
25
33
|
*/
|
|
26
|
-
export declare const buildTicksData: (scale: ChartScaleFunction, axisConfig?:
|
|
34
|
+
export declare const buildTicksData: (scale: ChartScaleFunction, axisConfig?: BaseAxisProps, explicitTicks?: number[], formatter?: (value: number | string) => string) => TickData[];
|
|
27
35
|
/**
|
|
28
36
|
* Excludes the X grid line at the Y-axis origin (left edge)
|
|
29
37
|
* to prevent overlap with the Y-axis solid line.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,kBAAkB,EACzB,gBAAgB,MAAM,EAAE,EACxB,WAAW,aAAa,CAAC,MAAM,CAAC,KAC/B,MAAM,EAUR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,kBAAkB,EACzB,MAAM,MAAM,KACX,MAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,UAAU,aAAa,CAAC,MAAM,CAAC,EAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,MAeF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,EACzB,aAAa,aAAa,EAC1B,gBAAgB,MAAM,EAAE,EACxB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,QAAQ,EASV,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,QAAQ,EACd,aAAa,WAAW,KACvB,OAEF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,QAAQ,EACd,aAAa,WAAW,KACvB,OAEF,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { ScaleBand, ScaleLinear, ScaleLogarithmic } from 'd3-scale';
|
|
2
|
-
|
|
3
|
-
min: number;
|
|
4
|
-
max: number;
|
|
5
|
-
};
|
|
2
|
+
import type { BaseAxisProps } from '../Components/Axis';
|
|
6
3
|
export type ChartInset = {
|
|
7
4
|
top: number;
|
|
8
5
|
right: number;
|
|
@@ -36,28 +33,6 @@ export type Series = {
|
|
|
36
33
|
*/
|
|
37
34
|
stroke: string;
|
|
38
35
|
};
|
|
39
|
-
export type AxisConfigProps = {
|
|
40
|
-
/**
|
|
41
|
-
* Scale algorithm used by this axis.
|
|
42
|
-
* @default 'linear'
|
|
43
|
-
*/
|
|
44
|
-
scaleType?: 'linear' | 'log' | 'band';
|
|
45
|
-
/**
|
|
46
|
-
* Explicit data values for band scales or category labels.
|
|
47
|
-
* For band scales, provides the discrete domain. For numeric scales, string values
|
|
48
|
-
* are used as tick labels at corresponding indices.
|
|
49
|
-
*/
|
|
50
|
-
data?: string[] | number[];
|
|
51
|
-
/**
|
|
52
|
-
* Fixed domain bounds or a function that adjusts the computed bounds.
|
|
53
|
-
* A partial object overrides only the specified bound(s).
|
|
54
|
-
* A function receives the auto-computed bounds and returns adjusted ones.
|
|
55
|
-
*
|
|
56
|
-
* The final domain is always rounded to nice boundaries via d3's `.nice()`,
|
|
57
|
-
* ensuring tick marks land on clean values (e.g. `[4, 98]` becomes `[0, 100]`).
|
|
58
|
-
*/
|
|
59
|
-
domain?: Partial<AxisBounds> | ((bounds: AxisBounds) => AxisBounds);
|
|
60
|
-
};
|
|
61
36
|
export type NumericScale = ScaleLinear<number, number> | ScaleLogarithmic<number, number>;
|
|
62
37
|
export type CategoricalScale = ScaleBand<number>;
|
|
63
38
|
export type ChartScaleFunction = NumericScale | CategoricalScale;
|
|
@@ -81,11 +56,11 @@ export type CartesianChartContextValue = {
|
|
|
81
56
|
/**
|
|
82
57
|
* Returns the x-axis config. Accepts an optional axis ID for future multi-axis support.
|
|
83
58
|
*/
|
|
84
|
-
getXAxisConfig: (id?: string) =>
|
|
59
|
+
getXAxisConfig: (id?: string) => BaseAxisProps | undefined;
|
|
85
60
|
/**
|
|
86
61
|
* Returns the y-axis config. Accepts an optional axis ID for future multi-axis support.
|
|
87
62
|
*/
|
|
88
|
-
getYAxisConfig: (id?: string) =>
|
|
63
|
+
getYAxisConfig: (id?: string) => BaseAxisProps | undefined;
|
|
89
64
|
/**
|
|
90
65
|
* Pixel bounds of the drawable region.
|
|
91
66
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|