@ledgerhq/lumen-ui-react-visualization 0.1.18 → 0.1.20
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/lib/Components/Axis/Axis.types.d.ts +6 -0
- package/dist/lib/Components/Axis/Axis.types.d.ts.map +1 -1
- package/dist/lib/Components/Axis/XAxis/XAxis.d.ts +1 -1
- package/dist/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -1
- package/dist/lib/Components/Axis/XAxis/XAxis.js +24 -23
- package/dist/lib/Components/Axis/YAxis/YAxis.d.ts +1 -1
- package/dist/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -1
- package/dist/lib/Components/Axis/YAxis/YAxis.js +36 -35
- package/dist/lib/Components/CartesianChart/CartesianChart.d.ts +1 -1
- package/dist/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/CartesianChart.js +89 -82
- package/dist/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts +11 -0
- package/dist/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js +21 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts +3 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.js +41 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/context.d.ts +15 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/context.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/context.js +10 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/index.d.ts +3 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/index.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/types.d.ts +57 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/types.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/utils.d.ts +31 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/utils.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/RevealAnimation/utils.js +67 -0
- package/dist/lib/Components/CartesianChart/hooks/useShimmerAnimation.d.ts +18 -0
- package/dist/lib/Components/CartesianChart/hooks/useShimmerAnimation.d.ts.map +1 -0
- package/dist/lib/Components/CartesianChart/hooks/useShimmerAnimation.js +14 -0
- package/dist/lib/Components/CartesianChart/types.d.ts +11 -0
- package/dist/lib/Components/CartesianChart/types.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/utils.d.ts +1 -24
- package/dist/lib/Components/CartesianChart/utils.d.ts.map +1 -1
- package/dist/lib/Components/CartesianChart/utils.js +12 -23
- package/dist/lib/Components/Line/Line.d.ts +1 -1
- package/dist/lib/Components/Line/Line.d.ts.map +1 -1
- package/dist/lib/Components/Line/Line.js +43 -36
- package/dist/lib/Components/Line/constants.d.ts +4 -0
- package/dist/lib/Components/Line/constants.d.ts.map +1 -0
- package/dist/lib/Components/Line/constants.js +7 -0
- package/dist/lib/Components/Line/index.d.ts +1 -1
- package/dist/lib/Components/Line/index.d.ts.map +1 -1
- package/dist/lib/Components/Line/types.d.ts +15 -0
- package/dist/lib/Components/Line/types.d.ts.map +1 -1
- package/dist/lib/Components/Line/utils.d.ts +11 -6
- package/dist/lib/Components/Line/utils.d.ts.map +1 -1
- package/dist/lib/Components/Line/utils.js +36 -18
- package/dist/lib/Components/LineChart/LineChart.d.ts +1 -1
- package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/lib/Components/LineChart/LineChart.js +152 -69
- package/dist/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts +9 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.d.ts.map +1 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/LineChartEmptyState.js +51 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/index.d.ts +3 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/index.d.ts.map +1 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/types.d.ts +3 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/types.d.ts.map +1 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/utils.d.ts +14 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/utils.d.ts.map +1 -0
- package/dist/lib/Components/LineChart/LineChartEmptyState/utils.js +9 -0
- package/dist/lib/Components/LineChart/__stories__/chartStoryFixtures.d.ts +57 -3
- package/dist/lib/Components/LineChart/__stories__/chartStoryFixtures.d.ts.map +1 -1
- package/dist/lib/Components/LineChart/types.d.ts +39 -1
- package/dist/lib/Components/LineChart/types.d.ts.map +1 -1
- package/dist/lib/Components/LineChart/utils.d.ts +43 -0
- package/dist/lib/Components/LineChart/utils.d.ts.map +1 -0
- package/dist/lib/Components/LineChart/utils.js +37 -0
- package/dist/lib/Components/Point/Point.d.ts.map +1 -1
- package/dist/lib/Components/Point/Point.js +29 -27
- package/dist/lib/Components/ReferenceLine/ReferenceLine.d.ts.map +1 -1
- package/dist/lib/Components/ReferenceLine/ReferenceLine.js +16 -16
- package/dist/lib/Components/ReferenceLine/constants.d.ts +3 -3
- package/dist/lib/Components/ReferenceLine/constants.d.ts.map +1 -1
- package/dist/lib/Components/ReferenceLine/constants.js +5 -5
- package/dist/lib/Components/ReferenceLine/utils.d.ts.map +1 -1
- package/dist/lib/Components/ReferenceLine/utils.js +15 -14
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/DefaultScrubberTooltip/DefaultScrubberTooltip.js +4 -2
- package/dist/lib/Components/Scrubber/Scrubber.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/Scrubber.js +34 -29
- package/dist/lib/Components/Scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/ScrubberProvider.js +68 -67
- package/dist/lib/Components/Scrubber/utils.d.ts.map +1 -1
- package/dist/lib/Components/Scrubber/utils.js +30 -32
- package/dist/lib/utils/index.d.ts +1 -1
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/numbers.d.ts +13 -0
- package/dist/lib/utils/numbers.d.ts.map +1 -0
- package/dist/lib/utils/numbers.js +5 -0
- package/dist/lib/utils/ticks/ticks.d.ts +1 -11
- package/dist/lib/utils/ticks/ticks.d.ts.map +1 -1
- package/dist/lib/utils/ticks/ticks.js +19 -21
- package/dist/lib/utils/types.d.ts +26 -1
- package/dist/lib/utils/types.d.ts.map +1 -1
- package/dist/node_modules/d3-shape/src/curve/monotone.js +69 -0
- package/dist/node_modules/d3-shape/src/curve/natural.js +41 -0
- package/dist/node_modules/d3-shape/src/curve/step.js +51 -0
- package/dist/package.json +3 -3
- package/package.json +3 -3
- package/dist/lib/Components/CartesianChart/RevealClip/RevealClipDefs.d.ts +0 -3
- package/dist/lib/Components/CartesianChart/RevealClip/RevealClipDefs.d.ts.map +0 -1
- package/dist/lib/Components/CartesianChart/RevealClip/RevealClipDefs.js +0 -41
- package/dist/lib/Components/CartesianChart/RevealClip/context.d.ts +0 -7
- package/dist/lib/Components/CartesianChart/RevealClip/context.d.ts.map +0 -1
- package/dist/lib/Components/CartesianChart/RevealClip/context.js +0 -6
- package/dist/lib/Components/CartesianChart/RevealClip/index.d.ts +0 -3
- package/dist/lib/Components/CartesianChart/RevealClip/index.d.ts.map +0 -1
- package/dist/lib/Components/CartesianChart/RevealClip/types.d.ts +0 -37
- package/dist/lib/Components/CartesianChart/RevealClip/types.d.ts.map +0 -1
- package/dist/lib/Components/CartesianChart/RevealClip/utils.d.ts +0 -17
- package/dist/lib/Components/CartesianChart/RevealClip/utils.d.ts.map +0 -1
- package/dist/lib/Components/CartesianChart/RevealClip/utils.js +0 -23
|
@@ -23,6 +23,12 @@ export type BaseAxisProps = {
|
|
|
23
23
|
* @default false
|
|
24
24
|
*/
|
|
25
25
|
showTickMark?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to render the tick labels along the axis.
|
|
28
|
+
* Set to `false` to keep ticks/grid while hiding their text labels.
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
showLabels?: boolean;
|
|
26
32
|
/**
|
|
27
33
|
* Explicit tick positions along the axis.
|
|
28
34
|
* When omitted, ticks are computed automatically from the scale.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Axis.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Axis/Axis.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAAC;IACxD;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC;IACpE;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Axis.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Axis/Axis.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAAC;IACxD;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC;IACpE;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { XAxisProps } from './types';
|
|
2
|
-
export declare function XAxis({ gridLineStyle, position, showGrid, showLine, showTickMark, ticks: ticksProp, tickLabelFormatter, }: XAxisProps): import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare function XAxis({ gridLineStyle, position, showGrid, showLine, showTickMark, showLabels, ticks: ticksProp, tickLabelFormatter, }: XAxisProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=XAxis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/XAxis/XAxis.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/XAxis/XAxis.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,KAAK,CAAC,EACpB,aAAuB,EACvB,QAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,UAAiB,EACjB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAsFZ"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { buildTicksData as
|
|
4
|
-
import { TICK_MARK_SIZE as y, TICK_LABEL_OFFSET as
|
|
5
|
-
import { useCartesianChartContext as
|
|
1
|
+
import { jsxs as C, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as $ } from "react";
|
|
3
|
+
import { buildTicksData as S } from "../../../utils/ticks/ticks.js";
|
|
4
|
+
import { TICK_MARK_SIZE as y, TICK_LABEL_OFFSET as T } from "../Axis.constants.js";
|
|
5
|
+
import { useCartesianChartContext as D } from "../../CartesianChart/context/cartesianChartContext.js";
|
|
6
6
|
import { cssVar as o } from "../../../../libs/design-core/dist/lib/cssVar/cssVar.js";
|
|
7
|
-
function
|
|
8
|
-
gridLineStyle:
|
|
7
|
+
function X({
|
|
8
|
+
gridLineStyle: u = "solid",
|
|
9
9
|
position: l = "bottom",
|
|
10
|
-
showGrid:
|
|
10
|
+
showGrid: h = !1,
|
|
11
11
|
showLine: c = !1,
|
|
12
12
|
showTickMark: g = !1,
|
|
13
|
+
showLabels: v = !0,
|
|
13
14
|
ticks: d,
|
|
14
15
|
tickLabelFormatter: m
|
|
15
16
|
}) {
|
|
16
|
-
const { getXScale:
|
|
17
|
-
() =>
|
|
18
|
-
[
|
|
17
|
+
const { getXScale: b, getXAxisConfig: k, drawingArea: e } = D(), i = b(), x = k(), n = $(
|
|
18
|
+
() => i ? S(i, x, d, m) : [],
|
|
19
|
+
[i, x, d, m]
|
|
19
20
|
);
|
|
20
|
-
if (!
|
|
21
|
+
if (!i || e.width <= 0)
|
|
21
22
|
return null;
|
|
22
|
-
const f = l === "top", s = f ? e.y : e.y + e.height, p = f ? -1 : 1,
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
|
|
23
|
+
const f = l === "top", s = f ? e.y : e.y + e.height, p = f ? -1 : 1, A = s + p * (y + T);
|
|
24
|
+
return /* @__PURE__ */ C("g", { "data-testid": "x-axis", children: [
|
|
25
|
+
h && n.map((t, r) => /* @__PURE__ */ a(
|
|
25
26
|
"line",
|
|
26
27
|
{
|
|
27
28
|
x1: t.position,
|
|
@@ -32,9 +33,9 @@ function W({
|
|
|
32
33
|
stroke: o("var(--border-muted-subtle-transparent)")
|
|
33
34
|
},
|
|
34
35
|
strokeWidth: o("var(--stroke-1)"),
|
|
35
|
-
strokeDasharray:
|
|
36
|
+
strokeDasharray: u === "dashed" ? "3 3" : void 0
|
|
36
37
|
},
|
|
37
|
-
`grid-${t.value}-${
|
|
38
|
+
`grid-${t.value}-${r}`
|
|
38
39
|
)),
|
|
39
40
|
c && /* @__PURE__ */ a(
|
|
40
41
|
"line",
|
|
@@ -49,7 +50,7 @@ function W({
|
|
|
49
50
|
strokeLinecap: "square"
|
|
50
51
|
}
|
|
51
52
|
),
|
|
52
|
-
g && n.map((t,
|
|
53
|
+
g && n.map((t, r) => /* @__PURE__ */ a(
|
|
53
54
|
"line",
|
|
54
55
|
{
|
|
55
56
|
x1: t.position,
|
|
@@ -59,13 +60,13 @@ function W({
|
|
|
59
60
|
style: { stroke: o("var(--border-muted)") },
|
|
60
61
|
strokeWidth: o("var(--stroke-1)")
|
|
61
62
|
},
|
|
62
|
-
`tick-${t.value}-${
|
|
63
|
+
`tick-${t.value}-${r}`
|
|
63
64
|
)),
|
|
64
|
-
n.map((t,
|
|
65
|
+
v && n.map((t, r) => /* @__PURE__ */ a(
|
|
65
66
|
"text",
|
|
66
67
|
{
|
|
67
68
|
x: t.position,
|
|
68
|
-
y:
|
|
69
|
+
y: A,
|
|
69
70
|
textAnchor: "middle",
|
|
70
71
|
dominantBaseline: l === "top" ? "auto" : "hanging",
|
|
71
72
|
style: {
|
|
@@ -75,10 +76,10 @@ function W({
|
|
|
75
76
|
},
|
|
76
77
|
children: t.label
|
|
77
78
|
},
|
|
78
|
-
`label-${t.value}-${
|
|
79
|
+
`label-${t.value}-${r}`
|
|
79
80
|
))
|
|
80
81
|
] });
|
|
81
82
|
}
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
X as XAxis
|
|
84
85
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { YAxisProps } from './types';
|
|
2
|
-
export declare function YAxis({ gridLineStyle, position, showGrid, showLine, showTickMark, ticks: ticksProp, tickLabelFormatter, }: YAxisProps): import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare function YAxis({ gridLineStyle, position, showGrid, showLine, showTickMark, showLabels, ticks: ticksProp, tickLabelFormatter, }: YAxisProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
//# sourceMappingURL=YAxis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/YAxis/YAxis.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/YAxis/YAxis.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,KAAK,CAAC,EACpB,aAAuB,EACvB,QAAkB,EAClB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,UAAiB,EACjB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAsFZ"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { buildTicksData as
|
|
4
|
-
import { TICK_MARK_SIZE as
|
|
1
|
+
import { jsxs as C, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as S } from "react";
|
|
3
|
+
import { buildTicksData as $ } from "../../../utils/ticks/ticks.js";
|
|
4
|
+
import { TICK_MARK_SIZE as p, TICK_LABEL_OFFSET as D } from "../Axis.constants.js";
|
|
5
5
|
import { useCartesianChartContext as E } from "../../CartesianChart/context/cartesianChartContext.js";
|
|
6
|
-
import { cssVar as
|
|
7
|
-
function
|
|
8
|
-
gridLineStyle:
|
|
6
|
+
import { cssVar as r } from "../../../../libs/design-core/dist/lib/cssVar/cssVar.js";
|
|
7
|
+
function Y({
|
|
8
|
+
gridLineStyle: u = "solid",
|
|
9
9
|
position: l = "start",
|
|
10
|
-
showGrid:
|
|
11
|
-
showLine:
|
|
10
|
+
showGrid: c = !1,
|
|
11
|
+
showLine: h = !1,
|
|
12
12
|
showTickMark: v = !1,
|
|
13
|
+
showLabels: g = !0,
|
|
13
14
|
ticks: d,
|
|
14
15
|
tickLabelFormatter: x
|
|
15
16
|
}) {
|
|
16
|
-
const { getYScale:
|
|
17
|
-
() =>
|
|
18
|
-
[
|
|
17
|
+
const { getYScale: b, getYAxisConfig: k, drawingArea: e } = E(), a = b(), m = k(), n = S(
|
|
18
|
+
() => a ? $(a, m, d, x) : [],
|
|
19
|
+
[a, m, d, x]
|
|
19
20
|
);
|
|
20
|
-
if (!
|
|
21
|
+
if (!a || e.height <= 0)
|
|
21
22
|
return null;
|
|
22
|
-
const
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
|
|
23
|
+
const y = l === "start", s = y ? e.x : e.x + e.width, f = y ? -1 : 1, A = s + f * (p + D);
|
|
24
|
+
return /* @__PURE__ */ C("g", { "data-testid": "y-axis", children: [
|
|
25
|
+
c && n.map((t, o) => /* @__PURE__ */ i(
|
|
25
26
|
"line",
|
|
26
27
|
{
|
|
27
28
|
x1: e.x,
|
|
@@ -29,49 +30,49 @@ function W({
|
|
|
29
30
|
x2: e.x + e.width,
|
|
30
31
|
y2: t.position,
|
|
31
32
|
style: {
|
|
32
|
-
stroke:
|
|
33
|
+
stroke: r("var(--border-muted-subtle-transparent)")
|
|
33
34
|
},
|
|
34
|
-
strokeWidth:
|
|
35
|
-
strokeDasharray:
|
|
35
|
+
strokeWidth: r("var(--stroke-1)"),
|
|
36
|
+
strokeDasharray: u === "dashed" ? "3 3" : void 0
|
|
36
37
|
},
|
|
37
38
|
`grid-${t.value}-${o}`
|
|
38
39
|
)),
|
|
39
|
-
|
|
40
|
+
h && /* @__PURE__ */ i(
|
|
40
41
|
"line",
|
|
41
42
|
{
|
|
42
|
-
x1:
|
|
43
|
+
x1: s,
|
|
43
44
|
y1: e.y,
|
|
44
|
-
x2:
|
|
45
|
+
x2: s,
|
|
45
46
|
y2: e.y + e.height,
|
|
46
|
-
style: { stroke:
|
|
47
|
-
strokeWidth:
|
|
47
|
+
style: { stroke: r("var(--border-muted)") },
|
|
48
|
+
strokeWidth: r("var(--stroke-1)"),
|
|
48
49
|
shapeRendering: "crispEdges",
|
|
49
50
|
strokeLinecap: "square"
|
|
50
51
|
}
|
|
51
52
|
),
|
|
52
|
-
v && n.map((t, o) => /* @__PURE__ */
|
|
53
|
+
v && n.map((t, o) => /* @__PURE__ */ i(
|
|
53
54
|
"line",
|
|
54
55
|
{
|
|
55
|
-
x1:
|
|
56
|
+
x1: s,
|
|
56
57
|
y1: t.position,
|
|
57
|
-
x2:
|
|
58
|
+
x2: s + f * p,
|
|
58
59
|
y2: t.position,
|
|
59
|
-
style: { stroke:
|
|
60
|
-
strokeWidth:
|
|
60
|
+
style: { stroke: r("var(--border-muted)") },
|
|
61
|
+
strokeWidth: r("var(--stroke-1)")
|
|
61
62
|
},
|
|
62
63
|
`tick-${t.value}-${o}`
|
|
63
64
|
)),
|
|
64
|
-
n.map((t, o) => /* @__PURE__ */
|
|
65
|
+
g && n.map((t, o) => /* @__PURE__ */ i(
|
|
65
66
|
"text",
|
|
66
67
|
{
|
|
67
|
-
x:
|
|
68
|
+
x: A,
|
|
68
69
|
y: t.position,
|
|
69
70
|
textAnchor: l === "start" ? "end" : "start",
|
|
70
71
|
dominantBaseline: "central",
|
|
71
72
|
style: {
|
|
72
|
-
fill:
|
|
73
|
-
fontSize:
|
|
74
|
-
fontFamily:
|
|
73
|
+
fill: r("var(--text-muted)"),
|
|
74
|
+
fontSize: r("var(--font-style-body-4-size)"),
|
|
75
|
+
fontFamily: r("var(--font-family-font)")
|
|
75
76
|
},
|
|
76
77
|
children: t.label
|
|
77
78
|
},
|
|
@@ -80,5 +81,5 @@ function W({
|
|
|
80
81
|
] });
|
|
81
82
|
}
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
Y as YAxis
|
|
84
85
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CartesianChartProps } from './types';
|
|
2
|
-
export declare function CartesianChart({ series, xAxis, yAxis, width, height, inset, axisPadding, ariaLabel, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, children, }: CartesianChartProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function CartesianChart({ series, xAxis, yAxis, width, height, inset, axisPadding, ariaLabel, ariaBusy, overlay: htmlOverlay, enableScrubbing, onScrubberPositionChange, animate, magnetRadius, children, }: 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":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CartesianChart/CartesianChart.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuB,EACvB,KAAK,EACL,WAAW,EACX,SAAmB,EACnB,QAAgB,EAChB,OAAO,EAAE,WAAW,EACpB,eAAuB,EACvB,wBAAwB,EACxB,OAAc,EACd,YAAY,EACZ,QAAQ,GACT,EAAE,mBAAmB,2CAuGrB"}
|
|
@@ -1,99 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { ScrubberProvider as
|
|
4
|
-
import { resolveInset as
|
|
5
|
-
import { useBuildChartContext as
|
|
6
|
-
import { CartesianChartProvider as
|
|
7
|
-
import { MagneticPointsProvider as
|
|
8
|
-
import {
|
|
9
|
-
function
|
|
10
|
-
series:
|
|
11
|
-
xAxis:
|
|
12
|
-
yAxis:
|
|
1
|
+
import { jsx as r, jsxs as j, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as h, useState as F, useCallback as H, useEffect as O, useMemo as b } from "react";
|
|
3
|
+
import { ScrubberProvider as T } from "../Scrubber/ScrubberProvider.js";
|
|
4
|
+
import { resolveInset as B, resolveAxisPadding as D, DEFAULT_HEIGHT as G } from "./utils.js";
|
|
5
|
+
import { useBuildChartContext as L } from "./context/useBuildChartContext.js";
|
|
6
|
+
import { CartesianChartProvider as U } from "./context/cartesianChartContext.js";
|
|
7
|
+
import { MagneticPointsProvider as V } from "../Point/pointContext/MagneticPointsProvider.js";
|
|
8
|
+
import { RevealAnimationProvider as _ } from "./RevealAnimation/RevealAnimationProvider.js";
|
|
9
|
+
function Z({
|
|
10
|
+
series: d,
|
|
11
|
+
xAxis: y,
|
|
12
|
+
yAxis: C,
|
|
13
13
|
width: e = "100%",
|
|
14
|
-
height:
|
|
15
|
-
inset:
|
|
16
|
-
axisPadding:
|
|
14
|
+
height: n = G,
|
|
15
|
+
inset: l,
|
|
16
|
+
axisPadding: c,
|
|
17
17
|
ariaLabel: x = "Chart",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
ariaBusy: R = !1,
|
|
19
|
+
overlay: g,
|
|
20
|
+
enableScrubbing: s = !1,
|
|
21
|
+
onScrubberPositionChange: P,
|
|
22
|
+
animate: A = !0,
|
|
23
|
+
magnetRadius: w,
|
|
24
|
+
children: I
|
|
23
25
|
}) {
|
|
24
|
-
const
|
|
26
|
+
const a = h(null), v = h(null), [M, W] = F(
|
|
25
27
|
typeof e == "number" ? e : void 0
|
|
26
|
-
),
|
|
27
|
-
const [
|
|
28
|
-
|
|
28
|
+
), t = typeof e != "number", f = H((i) => {
|
|
29
|
+
const [p] = i;
|
|
30
|
+
p && W(p.contentRect.width);
|
|
29
31
|
}, []);
|
|
30
|
-
|
|
31
|
-
if (!
|
|
32
|
+
O(() => {
|
|
33
|
+
if (!t || !a.current || typeof ResizeObserver > "u")
|
|
32
34
|
return;
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
}, [
|
|
36
|
-
const o = typeof e == "number" ? e :
|
|
37
|
-
() =>
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
series:
|
|
41
|
-
xAxis:
|
|
42
|
-
yAxis:
|
|
43
|
-
width:
|
|
44
|
-
height:
|
|
45
|
-
inset:
|
|
46
|
-
axisPadding:
|
|
35
|
+
const i = new ResizeObserver(f);
|
|
36
|
+
return i.observe(a.current), () => i.disconnect();
|
|
37
|
+
}, [t, f]);
|
|
38
|
+
const o = typeof e == "number" ? e : M ?? 0, u = o > 0 ? o : 0, z = b(() => B(l), [l]), E = b(
|
|
39
|
+
() => D(c),
|
|
40
|
+
[c]
|
|
41
|
+
), m = L({
|
|
42
|
+
series: d,
|
|
43
|
+
xAxis: y,
|
|
44
|
+
yAxis: C,
|
|
45
|
+
width: u,
|
|
46
|
+
height: n,
|
|
47
|
+
inset: z,
|
|
48
|
+
axisPadding: E
|
|
47
49
|
});
|
|
48
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ r(
|
|
49
51
|
"div",
|
|
50
52
|
{
|
|
51
|
-
ref:
|
|
53
|
+
ref: t ? a : void 0,
|
|
52
54
|
"data-testid": "chart-container",
|
|
53
55
|
style: {
|
|
54
|
-
width:
|
|
55
|
-
height:
|
|
56
|
-
overflow: "visible"
|
|
56
|
+
width: t ? e : o,
|
|
57
|
+
height: n,
|
|
58
|
+
overflow: "visible",
|
|
59
|
+
position: "relative"
|
|
57
60
|
},
|
|
58
|
-
children: o > 0 && /* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
61
|
+
children: o > 0 && /* @__PURE__ */ j(k, { children: [
|
|
62
|
+
/* @__PURE__ */ r(
|
|
63
|
+
"svg",
|
|
64
|
+
{
|
|
65
|
+
ref: v,
|
|
66
|
+
"data-testid": "chart-svg",
|
|
67
|
+
width: u,
|
|
68
|
+
height: n,
|
|
69
|
+
role: "img",
|
|
70
|
+
"aria-label": x || "Chart",
|
|
71
|
+
"aria-busy": R || void 0,
|
|
72
|
+
tabIndex: s ? 0 : void 0,
|
|
73
|
+
style: {
|
|
74
|
+
display: "block",
|
|
75
|
+
overflow: "visible",
|
|
76
|
+
position: "relative",
|
|
77
|
+
outline: s ? "none" : void 0
|
|
78
|
+
},
|
|
79
|
+
children: /* @__PURE__ */ r(U, { value: m, children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(
|
|
80
|
+
T,
|
|
81
|
+
{
|
|
82
|
+
svgRef: v,
|
|
83
|
+
enableScrubbing: s,
|
|
84
|
+
onScrubberPositionChange: P,
|
|
85
|
+
magnetRadius: w,
|
|
86
|
+
children: /* @__PURE__ */ r(
|
|
87
|
+
_,
|
|
88
|
+
{
|
|
89
|
+
drawingArea: m.drawingArea,
|
|
90
|
+
series: d,
|
|
91
|
+
animate: A,
|
|
92
|
+
children: I
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
) }) })
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
g
|
|
100
|
+
] })
|
|
94
101
|
}
|
|
95
102
|
);
|
|
96
103
|
}
|
|
97
104
|
export {
|
|
98
|
-
|
|
105
|
+
Z as CartesianChart
|
|
99
106
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
type ChartEmptyLabelProps = PropsWithChildren;
|
|
3
|
+
/**
|
|
4
|
+
* Centred HTML overlay label shown when a chart has no data (and is not
|
|
5
|
+
* loading). Rendered through the `overlay` prop of `CartesianChart` so it shares
|
|
6
|
+
* the chart's positioned container and aligns with the chart footprint. Shared
|
|
7
|
+
* across cartesian charts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ChartEmptyLabel({ children }: Readonly<ChartEmptyLabelProps>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ChartEmptyLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartEmptyLabel.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CartesianChart/ChartEmptyLabel/ChartEmptyLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,KAAK,oBAAoB,GAAG,iBAAiB,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,oBAAoB,CAAC,2CAc3E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function n({ children: t }) {
|
|
3
|
+
return /* @__PURE__ */ e(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
"aria-hidden": "true",
|
|
7
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
8
|
+
children: /* @__PURE__ */ e(
|
|
9
|
+
"span",
|
|
10
|
+
{
|
|
11
|
+
"data-testid": "chart-empty-label",
|
|
12
|
+
className: "animate-fade-in rounded-xs bg-muted px-12 py-6 body-3 text-muted",
|
|
13
|
+
children: t
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
n as ChartEmptyLabel
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RevealAnimationProvider.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CartesianChart/RevealAnimation/RevealAnimationProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAMpD,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,WAAW,EACX,MAAM,EACN,OAAc,EACd,WAAW,GACZ,EAAE,oBAAoB,2CA0CtB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as e, Fragment as f, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as v } from "react";
|
|
3
|
+
import { RevealAnimationContext as x } from "./context.js";
|
|
4
|
+
import { useDataFingerprint as P, useRevealAnimation as A } from "./utils.js";
|
|
5
|
+
const D = 0.8, R = "linear";
|
|
6
|
+
function I({
|
|
7
|
+
children: n,
|
|
8
|
+
drawingArea: t,
|
|
9
|
+
series: l,
|
|
10
|
+
animate: s = !0,
|
|
11
|
+
transitions: o
|
|
12
|
+
}) {
|
|
13
|
+
const c = !s, m = o?.enter?.duration ?? D, h = o?.enter?.easing ?? R, d = P({ series: l }), { clipId: p, clipPathAttr: r, clipPathAnimation: a, fadeAnimation: i } = A({
|
|
14
|
+
duration: m,
|
|
15
|
+
easing: h,
|
|
16
|
+
drawingArea: t
|
|
17
|
+
}), u = v(
|
|
18
|
+
() => ({
|
|
19
|
+
clipPathAttr: r,
|
|
20
|
+
getPointRevealStyle: i.getPointRevealStyle
|
|
21
|
+
}),
|
|
22
|
+
[r, i]
|
|
23
|
+
);
|
|
24
|
+
return c ? /* @__PURE__ */ e(f, { children: n }) : /* @__PURE__ */ y(x.Provider, { value: u, children: [
|
|
25
|
+
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("clipPath", { id: p, children: /* @__PURE__ */ e(
|
|
26
|
+
"rect",
|
|
27
|
+
{
|
|
28
|
+
x: t.x,
|
|
29
|
+
y: t.y,
|
|
30
|
+
height: t.height,
|
|
31
|
+
width: t.width,
|
|
32
|
+
style: { animation: a.style }
|
|
33
|
+
}
|
|
34
|
+
) }) }),
|
|
35
|
+
/* @__PURE__ */ e("style", { children: `${a.keyframe} ${i.keyframe}` }),
|
|
36
|
+
n
|
|
37
|
+
] }, d);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
I as RevealAnimationProvider
|
|
41
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { RevealAnimationContextValue } from './types';
|
|
3
|
+
export declare const RevealAnimationContext: import('react').Context<RevealAnimationContextValue | undefined>;
|
|
4
|
+
/**
|
|
5
|
+
* Clip-path attribute for path-based consumers (e.g. `Line`).
|
|
6
|
+
* Returns `undefined` when the reveal animation is disabled.
|
|
7
|
+
*/
|
|
8
|
+
export declare const usePathReveal: () => string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Opacity fade-in style for accessory consumers (e.g. `Point`). Returns
|
|
11
|
+
* `undefined` when the reveal animation is disabled, leaving the consumer fully
|
|
12
|
+
* visible.
|
|
13
|
+
*/
|
|
14
|
+
export declare const usePointReveal: () => CSSProperties | undefined;
|
|
15
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CartesianChart/RevealAnimation/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,sBAAsB,kEAEvB,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,MAAM,GAAG,SAEzC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAO,aAAa,GAAG,SAGjD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as e, createContext as n, useMemo as r } from "react";
|
|
2
|
+
const o = n(void 0), s = () => e(o)?.clipPathAttr, c = () => {
|
|
3
|
+
const t = e(o);
|
|
4
|
+
return r(() => t?.getPointRevealStyle(), [t]);
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
o as RevealAnimationContext,
|
|
8
|
+
s as usePathReveal,
|
|
9
|
+
c as usePointReveal
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CartesianChart/RevealAnimation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|