@ledgerhq/lumen-ui-react-visualization 0.1.21 → 0.1.23
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/CartesianChart/RevealAnimation/context.js +1 -1
- 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 +16 -16
- package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/lib/Components/LineChart/LineChart.js +69 -63
- package/dist/lib/Components/Point/Point.d.ts +1 -1
- package/dist/lib/Components/Point/Point.d.ts.map +1 -1
- package/dist/lib/Components/Point/Point.js +95 -66
- package/dist/lib/Components/Point/constants.d.ts +2 -0
- package/dist/lib/Components/Point/constants.d.ts.map +1 -1
- package/dist/lib/Components/Point/constants.js +8 -7
- package/dist/lib/Components/Point/pointContext/MagneticPointsProvider.d.ts.map +1 -1
- package/dist/lib/Components/Point/pointContext/MagneticPointsProvider.js +14 -11
- package/dist/lib/Components/Point/pointContext/index.d.ts +1 -1
- package/dist/lib/Components/Point/pointContext/index.d.ts.map +1 -1
- package/dist/lib/Components/Point/pointContext/magneticPointsContext.d.ts +22 -5
- package/dist/lib/Components/Point/pointContext/magneticPointsContext.d.ts.map +1 -1
- package/dist/lib/Components/Point/pointContext/magneticPointsContext.js +10 -5
- package/dist/lib/Components/Point/types.d.ts +32 -0
- package/dist/lib/Components/Point/types.d.ts.map +1 -1
- package/dist/lib/Components/Point/usePointGeometry.d.ts +33 -0
- package/dist/lib/Components/Point/usePointGeometry.d.ts.map +1 -0
- package/dist/lib/Components/Point/usePointGeometry.js +30 -0
- package/dist/lib/Components/Point/utils.d.ts +29 -4
- package/dist/lib/Components/Point/utils.d.ts.map +1 -1
- package/dist/lib/Components/Point/utils.js +47 -31
- package/dist/lib/Components/Scrubber/ScrubberProvider.js +40 -40
- package/dist/package.json +4 -4
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createContext as n, useContext as e, useMemo as r } from "react";
|
|
2
2
|
const o = n(void 0), s = () => e(o)?.clipPathAttr, c = () => {
|
|
3
3
|
const t = e(o);
|
|
4
4
|
return r(() => t?.getPointRevealStyle(), [t]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LineProps } from './types';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const Line: import('react').NamedExoticComponent<LineProps>;
|
|
3
3
|
//# sourceMappingURL=Line.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Line/Line.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,
|
|
1
|
+
{"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Line/Line.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,eAAO,MAAM,IAAI,iDA+Ff,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as c, jsx as o, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { isNumericScale as
|
|
4
|
-
import { LINE_DEFAULT_STROKE_COLOR as
|
|
5
|
-
import { toScaledPoints as
|
|
6
|
-
import { useCartesianChartContext as
|
|
7
|
-
import { usePathReveal as
|
|
8
|
-
|
|
2
|
+
import { memo as k, useId as y, useMemo as d } from "react";
|
|
3
|
+
import { isNumericScale as A } from "../../utils/scales/scales.js";
|
|
4
|
+
import { LINE_DEFAULT_STROKE_COLOR as N, LINE_AREA_GRADIENT_OPACITY as O, LINE_STROKE_WIDTH as v } from "./constants.js";
|
|
5
|
+
import { toScaledPoints as R, buildLinePath as D, buildAreaPath as j } from "./utils.js";
|
|
6
|
+
import { useCartesianChartContext as b } from "../CartesianChart/context/cartesianChartContext.js";
|
|
7
|
+
import { usePathReveal as F } from "../CartesianChart/RevealAnimation/context.js";
|
|
8
|
+
const q = k(function({
|
|
9
9
|
seriesId: g,
|
|
10
10
|
stroke: C,
|
|
11
11
|
showArea: s = !1,
|
|
12
|
-
areaType:
|
|
12
|
+
areaType: K = "gradient",
|
|
13
13
|
curve: x,
|
|
14
14
|
connectNulls: L
|
|
15
15
|
}) {
|
|
16
|
-
const { getXScale: S, getYScale: _, getXAxisConfig: E, drawingArea: i, seriesMap: I } =
|
|
17
|
-
() => t?.data && l && n &&
|
|
16
|
+
const { getXScale: S, getYScale: _, getXAxisConfig: E, drawingArea: i, seriesMap: I } = b(), P = F(), l = S(), n = _(), p = E(), u = y(), t = I.get(g), r = (C ?? t?.stroke) || N, a = x ?? t?.curve, f = L ?? t?.connectNulls ?? !1, e = d(
|
|
17
|
+
() => t?.data && l && n && A(n) ? R(
|
|
18
18
|
t.data,
|
|
19
19
|
l,
|
|
20
20
|
n,
|
|
@@ -23,10 +23,10 @@ function U({
|
|
|
23
23
|
) : null,
|
|
24
24
|
[t, l, n, p, f]
|
|
25
25
|
), m = d(
|
|
26
|
-
() => e ?
|
|
26
|
+
() => e ? D(e, a) : null,
|
|
27
27
|
[e, a]
|
|
28
28
|
), h = d(
|
|
29
|
-
() => s && e && i ?
|
|
29
|
+
() => s && e && i ? j(e, i, a) : null,
|
|
30
30
|
[s, e, i, a]
|
|
31
31
|
);
|
|
32
32
|
return m ? /* @__PURE__ */ c("g", { clipPath: P, children: [
|
|
@@ -46,7 +46,7 @@ function U({
|
|
|
46
46
|
{
|
|
47
47
|
offset: "0%",
|
|
48
48
|
stopColor: r,
|
|
49
|
-
stopOpacity:
|
|
49
|
+
stopOpacity: O
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
52
|
/* @__PURE__ */ o("stop", { offset: "100%", stopColor: r, stopOpacity: 0 })
|
|
@@ -70,13 +70,13 @@ function U({
|
|
|
70
70
|
d: m,
|
|
71
71
|
fill: "none",
|
|
72
72
|
stroke: r,
|
|
73
|
-
strokeWidth:
|
|
73
|
+
strokeWidth: v,
|
|
74
74
|
strokeLinecap: "round",
|
|
75
75
|
strokeLinejoin: "round"
|
|
76
76
|
}
|
|
77
77
|
)
|
|
78
78
|
] }) : null;
|
|
79
|
-
}
|
|
79
|
+
});
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
q as Line
|
|
82
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/LineChart/LineChart.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,SAAS,CAAC;AA0FjB,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,QAAgB,EAChB,QAAqB,EACrB,YAAY,EACZ,SAAiB,EACjB,SAAiB,EACjB,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAY,EACZ,KAAK,EACL,eAAe,EACf,wBAAwB,EACxB,OAAO,EACP,YAAY,EACZ,OAAe,EACf,UAAsB,EACtB,QAAQ,GACT,EAAE,QAAQ,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/LineChart/LineChart.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,SAAS,CAAC;AA0FjB,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,QAAgB,EAChB,QAAqB,EACrB,YAAY,EACZ,SAAiB,EACjB,SAAiB,EACjB,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAY,EACZ,KAAK,EACL,eAAe,EACf,wBAAwB,EACxB,OAAO,EACP,YAAY,EACZ,OAAe,EACf,UAAsB,EACtB,QAAQ,GACT,EAAE,QAAQ,CAAC,cAAc,CAAC,2CAsF1B"}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as i, jsxs as S, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as h } from "react";
|
|
3
3
|
import { ChartEmptyLabel as M } from "../CartesianChart/ChartEmptyLabel/ChartEmptyLabel.js";
|
|
4
4
|
import { useShimmerAnimation as R } from "../CartesianChart/hooks/useShimmerAnimation.js";
|
|
5
5
|
import { computeAxisPadding as V, canRenderLine as W, getChartDisplayState as q } from "./utils.js";
|
|
6
|
-
import { defaultXAxisProps as
|
|
6
|
+
import { defaultXAxisProps as k, defaultYAxisProps as g } from "../Axis/Axis.constants.js";
|
|
7
7
|
import { CartesianChart as z } from "../CartesianChart/CartesianChart.js";
|
|
8
8
|
import { LineChartEmptyState as G } from "./LineChartEmptyState/LineChartEmptyState.js";
|
|
9
9
|
import { XAxis as H } from "../Axis/XAxis/XAxis.js";
|
|
10
10
|
import { YAxis as J } from "../Axis/YAxis/YAxis.js";
|
|
11
11
|
import { Line as K } from "../Line/Line.js";
|
|
12
12
|
import { cssVar as N } from "../../../libs/design-core/dist/lib/cssVar/cssVar.js";
|
|
13
|
-
const
|
|
13
|
+
const b = ({
|
|
14
14
|
series: o,
|
|
15
15
|
showArea: r,
|
|
16
16
|
areaType: a,
|
|
17
|
-
connectNulls:
|
|
17
|
+
connectNulls: e,
|
|
18
18
|
stroke: n
|
|
19
|
-
}) => /* @__PURE__ */ i(
|
|
19
|
+
}) => /* @__PURE__ */ i(u, { children: o.map((t) => /* @__PURE__ */ i(
|
|
20
20
|
K,
|
|
21
21
|
{
|
|
22
22
|
seriesId: t.id,
|
|
23
23
|
stroke: n ?? t.stroke,
|
|
24
24
|
showArea: r,
|
|
25
25
|
areaType: a,
|
|
26
|
-
connectNulls:
|
|
26
|
+
connectNulls: e
|
|
27
27
|
},
|
|
28
28
|
t.id
|
|
29
29
|
)) }), O = ({
|
|
30
30
|
series: o,
|
|
31
31
|
showArea: r,
|
|
32
32
|
areaType: a,
|
|
33
|
-
connectNulls:
|
|
33
|
+
connectNulls: e
|
|
34
34
|
}) => {
|
|
35
35
|
const { animationStyle: n, keyframe: t } = R();
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ S(u, { children: [
|
|
37
37
|
/* @__PURE__ */ i("style", { children: t }),
|
|
38
38
|
/* @__PURE__ */ i("g", { style: { animation: n }, children: /* @__PURE__ */ i(
|
|
39
|
-
|
|
39
|
+
b,
|
|
40
40
|
{
|
|
41
41
|
series: o,
|
|
42
42
|
showArea: r,
|
|
43
43
|
areaType: a,
|
|
44
|
-
connectNulls:
|
|
44
|
+
connectNulls: e,
|
|
45
45
|
stroke: N("var(--border-muted-subtle)")
|
|
46
46
|
}
|
|
47
47
|
) })
|
|
@@ -50,77 +50,83 @@ const k = ({
|
|
|
50
50
|
series: o,
|
|
51
51
|
showArea: r,
|
|
52
52
|
areaType: a,
|
|
53
|
-
connectNulls:
|
|
53
|
+
connectNulls: e,
|
|
54
54
|
showXAxis: n,
|
|
55
55
|
showYAxis: t,
|
|
56
|
-
xAxisConfig:
|
|
57
|
-
yAxisConfig:
|
|
56
|
+
xAxisConfig: m,
|
|
57
|
+
yAxisConfig: s,
|
|
58
58
|
isTransitionLoading: c,
|
|
59
59
|
children: f
|
|
60
|
-
}) => /* @__PURE__ */
|
|
61
|
-
n && /* @__PURE__ */ i(H, { ...
|
|
62
|
-
t && /* @__PURE__ */ i(J, { ...
|
|
60
|
+
}) => /* @__PURE__ */ S(u, { children: [
|
|
61
|
+
n && /* @__PURE__ */ i(H, { ...m }),
|
|
62
|
+
t && /* @__PURE__ */ i(J, { ...s }),
|
|
63
63
|
c ? /* @__PURE__ */ i(
|
|
64
64
|
O,
|
|
65
65
|
{
|
|
66
66
|
series: o,
|
|
67
67
|
showArea: r,
|
|
68
68
|
areaType: a,
|
|
69
|
-
connectNulls:
|
|
69
|
+
connectNulls: e
|
|
70
70
|
}
|
|
71
71
|
) : /* @__PURE__ */ i(
|
|
72
|
-
|
|
72
|
+
b,
|
|
73
73
|
{
|
|
74
74
|
series: o,
|
|
75
75
|
showArea: r,
|
|
76
76
|
areaType: a,
|
|
77
|
-
connectNulls:
|
|
77
|
+
connectNulls: e
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
80
|
f
|
|
81
81
|
] });
|
|
82
|
-
function
|
|
82
|
+
function si({
|
|
83
83
|
series: o,
|
|
84
84
|
showArea: r = !1,
|
|
85
85
|
areaType: a = "gradient",
|
|
86
|
-
connectNulls:
|
|
86
|
+
connectNulls: e,
|
|
87
87
|
showXAxis: n = !1,
|
|
88
88
|
showYAxis: t = !1,
|
|
89
|
-
xAxis:
|
|
90
|
-
yAxis:
|
|
89
|
+
xAxis: m,
|
|
90
|
+
yAxis: s,
|
|
91
91
|
width: c = "100%",
|
|
92
92
|
height: f = 240,
|
|
93
|
-
inset:
|
|
94
|
-
enableScrubbing:
|
|
95
|
-
onScrubberPositionChange:
|
|
96
|
-
animate:
|
|
97
|
-
magnetRadius:
|
|
98
|
-
loading:
|
|
99
|
-
emptyLabel:
|
|
100
|
-
children:
|
|
93
|
+
inset: v,
|
|
94
|
+
enableScrubbing: A,
|
|
95
|
+
onScrubberPositionChange: j,
|
|
96
|
+
animate: D,
|
|
97
|
+
magnetRadius: E,
|
|
98
|
+
loading: C = !1,
|
|
99
|
+
emptyLabel: L = "No data",
|
|
100
|
+
children: T
|
|
101
101
|
}) {
|
|
102
|
-
const p =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
const p = h(
|
|
103
|
+
() => ({
|
|
104
|
+
...k,
|
|
105
|
+
...m,
|
|
106
|
+
position: m?.position ?? k.position
|
|
107
|
+
}),
|
|
108
|
+
[m]
|
|
109
|
+
), l = h(
|
|
110
|
+
() => ({
|
|
111
|
+
...g,
|
|
112
|
+
...s,
|
|
113
|
+
position: s?.position ?? g.position,
|
|
114
|
+
width: s?.width ?? g.width
|
|
115
|
+
}),
|
|
116
|
+
[s]
|
|
117
|
+
), y = p.position, x = l.position, P = l.width, B = h(
|
|
112
118
|
() => V({
|
|
113
119
|
showXAxis: n,
|
|
114
120
|
showYAxis: t,
|
|
115
|
-
xAxisPosition:
|
|
121
|
+
xAxisPosition: y,
|
|
116
122
|
yAxisPosition: x,
|
|
117
|
-
yAxisWidth:
|
|
123
|
+
yAxisWidth: P
|
|
118
124
|
}),
|
|
119
|
-
[n, t,
|
|
120
|
-
),
|
|
121
|
-
loading:
|
|
122
|
-
hasData:
|
|
123
|
-
emptyLabel:
|
|
125
|
+
[n, t, y, x, P]
|
|
126
|
+
), F = W(o, p.data), { status: d, ariaLabel: I } = q({
|
|
127
|
+
loading: C,
|
|
128
|
+
hasData: F,
|
|
129
|
+
emptyLabel: L
|
|
124
130
|
});
|
|
125
131
|
return /* @__PURE__ */ i(
|
|
126
132
|
z,
|
|
@@ -130,33 +136,33 @@ function ei({
|
|
|
130
136
|
yAxis: l,
|
|
131
137
|
width: c,
|
|
132
138
|
height: f,
|
|
133
|
-
inset:
|
|
134
|
-
axisPadding:
|
|
135
|
-
enableScrubbing:
|
|
136
|
-
onScrubberPositionChange:
|
|
137
|
-
animate:
|
|
138
|
-
magnetRadius:
|
|
139
|
-
ariaLabel:
|
|
140
|
-
ariaBusy:
|
|
141
|
-
overlay:
|
|
142
|
-
children:
|
|
139
|
+
inset: v,
|
|
140
|
+
axisPadding: B,
|
|
141
|
+
enableScrubbing: A,
|
|
142
|
+
onScrubberPositionChange: j,
|
|
143
|
+
animate: D,
|
|
144
|
+
magnetRadius: E,
|
|
145
|
+
ariaLabel: I,
|
|
146
|
+
ariaBusy: C,
|
|
147
|
+
overlay: d === "empty" ? /* @__PURE__ */ i(M, { children: L }) : void 0,
|
|
148
|
+
children: d === "initial-loading" || d === "empty" ? /* @__PURE__ */ i(G, { loading: d === "initial-loading" }) : /* @__PURE__ */ i(
|
|
143
149
|
Q,
|
|
144
150
|
{
|
|
145
151
|
series: o ?? [],
|
|
146
152
|
showArea: r,
|
|
147
153
|
areaType: a,
|
|
148
|
-
connectNulls:
|
|
154
|
+
connectNulls: e,
|
|
149
155
|
showXAxis: n,
|
|
150
156
|
showYAxis: t,
|
|
151
157
|
xAxisConfig: p,
|
|
152
158
|
yAxisConfig: l,
|
|
153
|
-
isTransitionLoading:
|
|
154
|
-
children:
|
|
159
|
+
isTransitionLoading: d === "transition-loading",
|
|
160
|
+
children: T
|
|
155
161
|
}
|
|
156
162
|
)
|
|
157
163
|
}
|
|
158
164
|
);
|
|
159
165
|
}
|
|
160
166
|
export {
|
|
161
|
-
|
|
167
|
+
si as LineChart
|
|
162
168
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PointLabelProps, PointProps } from './types';
|
|
2
2
|
export declare function PointLabel({ style, textAnchor, dominantBaseline, ...props }: Readonly<PointLabelProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare
|
|
3
|
+
export declare const Point: import('react').NamedExoticComponent<Readonly<PointProps>>;
|
|
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":"AAKA,OAAO,KAAK,EAEV,eAAe,EAEf,UAAU,EACX,MAAM,SAAS,CAAC;AAKjB,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,UAAqB,EACrB,gBAAyB,EACzB,GAAG,KAAK,EACT,EAAE,QAAQ,CAAC,eAAe,CAAC,2CAe3B;AA+BD,eAAO,MAAM,KAAK,4DAwEhB,CAAC"}
|
|
@@ -1,94 +1,123 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
textAnchor: r = "middle",
|
|
13
|
-
dominantBaseline: i = "auto",
|
|
14
|
-
...s
|
|
1
|
+
import { jsxs as P, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E } from "react";
|
|
3
|
+
import { DEFAULT_SIZE as S, LABEL_FONT_SIZE as T, STROKE_WIDTH as k } from "./constants.js";
|
|
4
|
+
import { usePointGeometry as _ } from "./usePointGeometry.js";
|
|
5
|
+
import { resolveLabel as w, computeLabelGeometry as F, buildArrowPoints as G } from "./utils.js";
|
|
6
|
+
import { cssVar as l } from "../../../libs/design-core/dist/lib/cssVar/cssVar.js";
|
|
7
|
+
function I({
|
|
8
|
+
style: i,
|
|
9
|
+
textAnchor: t = "middle",
|
|
10
|
+
dominantBaseline: o = "auto",
|
|
11
|
+
...e
|
|
15
12
|
}) {
|
|
16
13
|
return /* @__PURE__ */ n(
|
|
17
14
|
"text",
|
|
18
15
|
{
|
|
19
|
-
textAnchor:
|
|
20
|
-
dominantBaseline:
|
|
16
|
+
textAnchor: t,
|
|
17
|
+
dominantBaseline: o,
|
|
21
18
|
style: {
|
|
22
|
-
fill:
|
|
23
|
-
fontSize:
|
|
24
|
-
fontWeight:
|
|
25
|
-
fontFamily:
|
|
26
|
-
...
|
|
19
|
+
fill: l("var(--text-base)"),
|
|
20
|
+
fontSize: T,
|
|
21
|
+
fontWeight: l("var(--font-style-body-4-weight-medium)"),
|
|
22
|
+
fontFamily: l("var(--font-family-font)"),
|
|
23
|
+
...i
|
|
27
24
|
},
|
|
28
|
-
...
|
|
25
|
+
...e
|
|
29
26
|
}
|
|
30
27
|
);
|
|
31
28
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
function V({ x: i, y: t, size: o, color: e }) {
|
|
30
|
+
const c = o / 2, m = e ?? l("var(--background-muted-strong)");
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
32
|
+
"circle",
|
|
33
|
+
{
|
|
34
|
+
"data-testid": "point-circle",
|
|
35
|
+
cx: i,
|
|
36
|
+
cy: t,
|
|
37
|
+
r: c,
|
|
38
|
+
style: {
|
|
39
|
+
fill: m,
|
|
40
|
+
stroke: l("var(--background-canvas)")
|
|
41
|
+
},
|
|
42
|
+
strokeWidth: k
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function W({ x: i, y: t, size: o, position: e }) {
|
|
47
|
+
return /* @__PURE__ */ n(
|
|
48
|
+
"polygon",
|
|
49
|
+
{
|
|
50
|
+
"data-testid": "point-arrow",
|
|
51
|
+
points: G(i, t, o / 2, e),
|
|
52
|
+
style: { fill: l("var(--text-base)") }
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
const K = E(function({
|
|
57
|
+
dataX: t,
|
|
58
|
+
dataY: o,
|
|
59
|
+
color: e,
|
|
60
|
+
label: c,
|
|
61
|
+
LabelComponent: m,
|
|
62
|
+
labelPosition: f = "top",
|
|
63
|
+
hidePoint: p = !1,
|
|
40
64
|
showLabelArrow: x = !0,
|
|
41
|
-
size:
|
|
42
|
-
onClick:
|
|
43
|
-
magnetic:
|
|
65
|
+
size: u = S,
|
|
66
|
+
onClick: y,
|
|
67
|
+
magnetic: b = !1,
|
|
68
|
+
labelAlignment: v = "auto"
|
|
44
69
|
}) {
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (!t || !D(t.x, t.y, L))
|
|
70
|
+
const { pixel: r, drawingArea: g, revealStyle: L, isVisible: h } = _({
|
|
71
|
+
dataX: t,
|
|
72
|
+
dataY: o,
|
|
73
|
+
magnetic: b
|
|
74
|
+
});
|
|
75
|
+
if (!h || !r)
|
|
52
76
|
return null;
|
|
53
|
-
const
|
|
54
|
-
|
|
77
|
+
const a = w(c, t), d = a !== void 0, s = d ? F({
|
|
78
|
+
text: a,
|
|
79
|
+
pixelX: r.x,
|
|
80
|
+
pixelY: r.y,
|
|
81
|
+
size: u,
|
|
82
|
+
labelPosition: f,
|
|
83
|
+
showLabelArrow: x,
|
|
84
|
+
area: g,
|
|
85
|
+
alignment: v
|
|
86
|
+
}) : null, A = m ?? I;
|
|
87
|
+
return /* @__PURE__ */ P(
|
|
55
88
|
"g",
|
|
56
89
|
{
|
|
57
90
|
"data-testid": "point-group",
|
|
58
|
-
onClick:
|
|
91
|
+
onClick: y,
|
|
59
92
|
style: {
|
|
60
|
-
...
|
|
61
|
-
...
|
|
93
|
+
...L,
|
|
94
|
+
...y ? { cursor: "pointer" } : void 0
|
|
62
95
|
},
|
|
63
96
|
children: [
|
|
64
|
-
!
|
|
65
|
-
|
|
97
|
+
!p && /* @__PURE__ */ n(V, { x: r.x, y: r.y, size: u, color: e }),
|
|
98
|
+
d && x && /* @__PURE__ */ n(
|
|
99
|
+
W,
|
|
66
100
|
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
style: {
|
|
72
|
-
fill: A,
|
|
73
|
-
stroke: e("var(--background-canvas)")
|
|
74
|
-
},
|
|
75
|
-
strokeWidth: R
|
|
101
|
+
x: r.x,
|
|
102
|
+
y: r.y,
|
|
103
|
+
size: u,
|
|
104
|
+
position: f
|
|
76
105
|
}
|
|
77
106
|
),
|
|
78
|
-
|
|
79
|
-
|
|
107
|
+
a != null && s && /* @__PURE__ */ n(
|
|
108
|
+
A,
|
|
80
109
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
110
|
+
x: s.x,
|
|
111
|
+
y: s.y,
|
|
112
|
+
textAnchor: s.textAnchor,
|
|
113
|
+
children: a
|
|
84
114
|
}
|
|
85
|
-
)
|
|
86
|
-
f != null && /* @__PURE__ */ n(j, { x: t.x, y: W, children: f })
|
|
115
|
+
)
|
|
87
116
|
]
|
|
88
117
|
}
|
|
89
118
|
);
|
|
90
|
-
}
|
|
119
|
+
});
|
|
91
120
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
121
|
+
K as Point,
|
|
122
|
+
I as PointLabel
|
|
94
123
|
};
|
|
@@ -4,4 +4,6 @@ export declare const ARROW_WIDTH = 6;
|
|
|
4
4
|
export declare const ARROW_HEIGHT = 4;
|
|
5
5
|
export declare const GAP = 4;
|
|
6
6
|
export declare const LABEL_FONT_SIZE = 10;
|
|
7
|
+
/** Approximate width of a character in the label font, as a ratio of the font size. */
|
|
8
|
+
export declare const LABEL_CHAR_WIDTH_RATIO = 0.6;
|
|
7
9
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +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,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAO,MAAM,eAAe,KAAK,CAAC"}
|
|
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,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,MAAM,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _ = 10, o = 2, t = 6, A = 4, T = 4, c = 10, n = 0.6;
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
A as ARROW_HEIGHT,
|
|
4
|
+
t as ARROW_WIDTH,
|
|
5
|
+
_ as DEFAULT_SIZE,
|
|
6
|
+
T as GAP,
|
|
7
|
+
n as LABEL_CHAR_WIDTH_RATIO,
|
|
8
|
+
c as LABEL_FONT_SIZE,
|
|
9
|
+
o as STROKE_WIDTH
|
|
9
10
|
};
|
|
@@ -1 +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;
|
|
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;AASvC,KAAK,2BAA2B,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,GACT,EAAE,QAAQ,CAAC,2BAA2B,CAAC,2CAwCvC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
2
|
+
import { useRef as l, useState as v, useCallback as n, useMemo as g } from "react";
|
|
3
|
+
import { MagneticRegistryProvider as h, MagneticSnapshotProvider as M } from "./magneticPointsContext.js";
|
|
4
|
+
function S({
|
|
5
5
|
children: f
|
|
6
6
|
}) {
|
|
7
|
-
const e =
|
|
8
|
-
e.current.has(r) || (e.current.add(r),
|
|
7
|
+
const e = l(/* @__PURE__ */ new Set()), [s, o] = v(0), i = n((r) => {
|
|
8
|
+
e.current.has(r) || (e.current.add(r), o((t) => t + 1));
|
|
9
9
|
}, []), c = n((r) => {
|
|
10
|
-
e.current.has(r) && (e.current.delete(r),
|
|
11
|
-
}, []), u = n(() => e.current, []), m =
|
|
12
|
-
() => ({ register: i, unregister: c
|
|
13
|
-
[i, c
|
|
10
|
+
e.current.has(r) && (e.current.delete(r), o((t) => t + 1));
|
|
11
|
+
}, []), u = n(() => e.current, []), m = g(
|
|
12
|
+
() => ({ register: i, unregister: c }),
|
|
13
|
+
[i, c]
|
|
14
|
+
), p = g(
|
|
15
|
+
() => ({ version: s, getMagneticPoints: u }),
|
|
16
|
+
[s, u]
|
|
14
17
|
);
|
|
15
|
-
return /* @__PURE__ */ a(
|
|
18
|
+
return /* @__PURE__ */ a(h, { value: m, children: /* @__PURE__ */ a(M, { value: p, children: f }) });
|
|
16
19
|
}
|
|
17
20
|
export {
|
|
18
|
-
|
|
21
|
+
S as MagneticPointsProvider
|
|
19
22
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { useMagneticRegistry, useMagneticSnapshot, type MagneticRegistryValue, type MagneticSnapshotValue, } from './magneticPointsContext';
|
|
2
2
|
export { MagneticPointsProvider } from './MagneticPointsProvider';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Point/pointContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Point/pointContext/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Stable registration API for magnetic points. Its identity never changes for
|
|
3
|
+
* the provider's lifetime, so consumers (every `Point`) do not re-render when
|
|
4
|
+
* the magnetic set changes — only when they mount/unmount.
|
|
5
|
+
*/
|
|
6
|
+
export type MagneticRegistryValue = {
|
|
2
7
|
register: (dataIndex: number) => void;
|
|
3
8
|
unregister: (dataIndex: number) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Mutable snapshot of the registered magnetic points. Changes on every
|
|
12
|
+
* register/unregister (via `version`) and is consumed only by the scrubber,
|
|
13
|
+
* which needs to recompute its snap targets when the set changes.
|
|
14
|
+
*/
|
|
15
|
+
export type MagneticSnapshotValue = {
|
|
4
16
|
version: number;
|
|
5
17
|
getMagneticPoints: () => ReadonlySet<number>;
|
|
6
18
|
};
|
|
7
|
-
declare const
|
|
19
|
+
declare const MagneticRegistryProvider: import('react').FC<{
|
|
20
|
+
children: import('react').ReactNode;
|
|
21
|
+
value: MagneticRegistryValue;
|
|
22
|
+
}>;
|
|
23
|
+
declare const MagneticSnapshotProvider: import('react').FC<{
|
|
8
24
|
children: import('react').ReactNode;
|
|
9
|
-
value:
|
|
25
|
+
value: MagneticSnapshotValue;
|
|
10
26
|
}>;
|
|
11
|
-
export declare const
|
|
12
|
-
export
|
|
27
|
+
export declare const useMagneticRegistry: () => MagneticRegistryValue;
|
|
28
|
+
export declare const useMagneticSnapshot: () => MagneticSnapshotValue;
|
|
29
|
+
export { MagneticRegistryProvider, MagneticSnapshotProvider };
|
|
13
30
|
//# sourceMappingURL=magneticPointsContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magneticPointsContext.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Point/pointContext/magneticPointsContext.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"magneticPointsContext.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Point/pointContext/magneticPointsContext.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAO,wBAAwB;;;EAC+B,CAAC;AAE/D,QAAA,MAAO,wBAAwB;;;EAC+B,CAAC;AAE/D,eAAO,MAAM,mBAAmB,QAAO,qBAInC,CAAC;AAEL,eAAO,MAAM,mBAAmB,QAAO,qBAInC,CAAC;AAEL,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { createSafeContext as
|
|
2
|
-
const [o,
|
|
3
|
-
consumerName: "
|
|
1
|
+
import { createSafeContext as e } from "../../../../libs/utils-shared/dist/index.js";
|
|
2
|
+
const [a, t] = e("MagneticRegistry"), [o, n] = e("MagneticSnapshot"), i = () => t({
|
|
3
|
+
consumerName: "useMagneticRegistry",
|
|
4
|
+
contextRequired: !0
|
|
5
|
+
}), c = () => n({
|
|
6
|
+
consumerName: "useMagneticSnapshot",
|
|
4
7
|
contextRequired: !0
|
|
5
8
|
});
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
a as MagneticRegistryProvider,
|
|
11
|
+
o as MagneticSnapshotProvider,
|
|
12
|
+
i as useMagneticRegistry,
|
|
13
|
+
c as useMagneticSnapshot
|
|
9
14
|
};
|
|
@@ -5,6 +5,28 @@ export type PointLabelProps = {
|
|
|
5
5
|
children: string;
|
|
6
6
|
} & Omit<SVGProps<SVGTextElement>, 'x' | 'y' | 'children'>;
|
|
7
7
|
export type PointLabelComponent = ComponentType<PointLabelProps>;
|
|
8
|
+
/**
|
|
9
|
+
* Horizontal alignment strategy for a point's label.
|
|
10
|
+
*
|
|
11
|
+
* - `'auto'`: keep the label inside the drawing area, anchoring it to the
|
|
12
|
+
* nearest edge when it would overflow.
|
|
13
|
+
* - `'center'`: always centre the label on the point.
|
|
14
|
+
*/
|
|
15
|
+
export type LabelAlignment = 'center' | 'auto';
|
|
16
|
+
/**
|
|
17
|
+
* Pixel position and styling inputs shared by the point's rendered glyphs. Each
|
|
18
|
+
* glyph picks the subset it needs and derives its own pixel geometry (e.g.
|
|
19
|
+
* radius from `size`).
|
|
20
|
+
*/
|
|
21
|
+
type PointGlyphProps = {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
size: number;
|
|
25
|
+
color?: string;
|
|
26
|
+
position: 'top' | 'bottom';
|
|
27
|
+
};
|
|
28
|
+
export type PointMarkerProps = Pick<PointGlyphProps, 'x' | 'y' | 'size' | 'color'>;
|
|
29
|
+
export type PointArrowProps = Pick<PointGlyphProps, 'x' | 'y' | 'size' | 'position'>;
|
|
8
30
|
export type PointProps = {
|
|
9
31
|
/**
|
|
10
32
|
* X coordinate in data space (index or explicit value).
|
|
@@ -74,5 +96,15 @@ export type PointProps = {
|
|
|
74
96
|
* @default false
|
|
75
97
|
*/
|
|
76
98
|
magnetic?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Horizontal alignment of the label relative to the chart's drawing area.
|
|
101
|
+
* With `'auto'`, a label that would overflow the left/right edge is anchored
|
|
102
|
+
* to that edge and grows inward instead of being clipped, while the arrow
|
|
103
|
+
* keeps pointing at the exact data point. Use `'center'` to always centre the
|
|
104
|
+
* label on the point.
|
|
105
|
+
* @default 'auto'
|
|
106
|
+
*/
|
|
107
|
+
labelAlignment?: LabelAlignment;
|
|
77
108
|
};
|
|
109
|
+
export {};
|
|
78
110
|
//# 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,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,UAAU,CAAC,CAAC;AAE3D,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;;;;;;;;;;;;;OAaG;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,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,UAAU,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C;;;;GAIG;AACH,KAAK,eAAe,GAAG;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,eAAe,EACf,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,OAAO,CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,eAAe,EACf,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,UAAU,CAChC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;OAaG;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,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { DrawingArea } from '../../utils/types';
|
|
3
|
+
import { BaseAxisProps } from '../Axis';
|
|
4
|
+
import { MagneticRegistryValue } from './pointContext/magneticPointsContext';
|
|
5
|
+
type Pixel = {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
type UsePointGeometryParams = {
|
|
10
|
+
dataX: number;
|
|
11
|
+
dataY: number;
|
|
12
|
+
magnetic: boolean;
|
|
13
|
+
};
|
|
14
|
+
type PointGeometry = {
|
|
15
|
+
pixel: Pixel | undefined;
|
|
16
|
+
drawingArea: DrawingArea;
|
|
17
|
+
revealStyle: CSSProperties | undefined;
|
|
18
|
+
isVisible: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Resolves a point's chart geometry and behaviour: projects its data
|
|
22
|
+
* coordinates to pixels, registers it as a magnetic snap target when enabled,
|
|
23
|
+
* exposes the reveal-animation style, and reports whether it falls inside the
|
|
24
|
+
* drawing area.
|
|
25
|
+
*/
|
|
26
|
+
export declare const usePointGeometry: ({ dataX, dataY, magnetic, }: UsePointGeometryParams) => PointGeometry;
|
|
27
|
+
/**
|
|
28
|
+
* Registers/unregisters a data index as a magnetic snap target
|
|
29
|
+
* when the Point has `magnetic` enabled.
|
|
30
|
+
*/
|
|
31
|
+
export declare const useMagneticRegistration: (magnetic: boolean, dataX: number, getXAxisConfig: () => BaseAxisProps | undefined, { register, unregister }: MagneticRegistryValue) => void;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=usePointGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePointGeometry.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/usePointGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAGlF,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,aAAa,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,6BAI9B,sBAAsB,KAAG,aAqB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,OAAO,EACjB,OAAO,MAAM,EACb,gBAAgB,MAAM,aAAa,GAAG,SAAS,EAC/C,0BAA0B,qBAAqB,KAC9C,IAQF,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useMemo as a, useEffect as x } from "react";
|
|
2
|
+
import { projectPoint as g } from "../../utils/scales/scales.js";
|
|
3
|
+
import { isWithinBounds as v, resolveDataXToIndex as y } from "./utils.js";
|
|
4
|
+
import { useCartesianChartContext as S } from "../CartesianChart/context/cartesianChartContext.js";
|
|
5
|
+
import { useMagneticRegistry as R } from "./pointContext/magneticPointsContext.js";
|
|
6
|
+
import { usePointReveal as d } from "../CartesianChart/RevealAnimation/context.js";
|
|
7
|
+
const A = ({
|
|
8
|
+
dataX: e,
|
|
9
|
+
dataY: t,
|
|
10
|
+
magnetic: r
|
|
11
|
+
}) => {
|
|
12
|
+
const { getXScale: i, getYScale: n, getXAxisConfig: o, drawingArea: u } = S(), f = R();
|
|
13
|
+
C(r, e, o, f);
|
|
14
|
+
const c = i(), m = n(), s = a(() => {
|
|
15
|
+
if (!(!c || !m))
|
|
16
|
+
return g(e, t, c, m);
|
|
17
|
+
}, [e, t, c, m]), l = d(), p = s !== void 0 && v(s.x, s.y, u);
|
|
18
|
+
return { pixel: s, drawingArea: u, revealStyle: l, isVisible: p };
|
|
19
|
+
}, C = (e, t, r, { register: i, unregister: n }) => {
|
|
20
|
+
x(() => {
|
|
21
|
+
if (!e) return;
|
|
22
|
+
const o = y(t, r());
|
|
23
|
+
if (o !== void 0)
|
|
24
|
+
return i(o), () => n(o);
|
|
25
|
+
}, [e, t, r, i, n]);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
C as useMagneticRegistration,
|
|
29
|
+
A as usePointGeometry
|
|
30
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DrawingArea } from '../../utils/types';
|
|
2
2
|
import { BaseAxisProps } from '../Axis';
|
|
3
|
-
import {
|
|
3
|
+
import { LabelAlignment } from './types';
|
|
4
|
+
export type LabelTextAnchor = 'start' | 'middle' | 'end';
|
|
4
5
|
export declare const isWithinBounds: (px: number, py: number, area: DrawingArea) => boolean;
|
|
5
6
|
/**
|
|
6
7
|
* Builds the three SVG points of the arrow triangle.
|
|
@@ -15,12 +16,36 @@ export declare const buildArrowPoints: (cx: number, cy: number, radius: number,
|
|
|
15
16
|
export declare const resolveLabel: (label: string | ((dataIndex: number) => string) | undefined, dataX: number) => string | undefined;
|
|
16
17
|
export declare const resolveDataXToIndex: (dataX: number, axisConfig: BaseAxisProps | undefined) => number | undefined;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* Computes the label's horizontal placement, keeping it inside the drawing area
|
|
20
|
+
* near the left/right edges. Centred on the point when it fits; otherwise
|
|
21
|
+
* anchored to the edge and aligned with the arrow's outer vertex (offset by half
|
|
22
|
+
* the arrow width from the point, when an arrow is rendered).
|
|
20
23
|
*/
|
|
21
|
-
export declare const
|
|
24
|
+
export declare const computeLabelX: (pixelX: number, label: string, area: DrawingArea, alignment: LabelAlignment, hasArrow: boolean) => {
|
|
25
|
+
x: number;
|
|
26
|
+
textAnchor: LabelTextAnchor;
|
|
27
|
+
};
|
|
22
28
|
/**
|
|
23
29
|
* Computes the vertical position of the label text baseline.
|
|
24
30
|
*/
|
|
25
31
|
export declare const computeLabelY: (pixelY: number, radius: number, labelPosition: "top" | "bottom", renderArrow: boolean) => number;
|
|
32
|
+
/**
|
|
33
|
+
* Computes where a point's label is drawn: the (optionally clamped) horizontal
|
|
34
|
+
* placement and the vertical baseline. Label content is resolved separately via
|
|
35
|
+
* {@link resolveLabel}.
|
|
36
|
+
*/
|
|
37
|
+
export declare const computeLabelGeometry: ({ text, pixelX, pixelY, size, labelPosition, showLabelArrow, area, alignment, }: {
|
|
38
|
+
text: string;
|
|
39
|
+
pixelX: number;
|
|
40
|
+
pixelY: number;
|
|
41
|
+
size: number;
|
|
42
|
+
labelPosition: "top" | "bottom";
|
|
43
|
+
showLabelArrow: boolean;
|
|
44
|
+
area: DrawingArea;
|
|
45
|
+
alignment: LabelAlignment;
|
|
46
|
+
}) => {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
textAnchor: LabelTextAnchor;
|
|
50
|
+
};
|
|
26
51
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -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":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzD,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;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,MAAM,WAAW,EACjB,WAAW,cAAc,EACzB,UAAU,OAAO,KAChB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,eAAe,CAAA;CAgB1C,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;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,iFASlC;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,cAAc,CAAC;CAC3B,KAAG;IACF,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,eAAe,CAAC;CAY7B,CAAC"}
|
|
@@ -1,38 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const s = v / 2;
|
|
1
|
+
import { GAP as i, LABEL_FONT_SIZE as h, LABEL_CHAR_WIDTH_RATIO as x, ARROW_WIDTH as A, ARROW_HEIGHT as d } from "./constants.js";
|
|
2
|
+
const _ = (t, o, n) => t >= n.x && t <= n.x + n.width && o >= n.y && o <= n.y + n.height, I = (t, o, n, r) => {
|
|
3
|
+
const e = A / 2;
|
|
5
4
|
if (r === "top") {
|
|
6
|
-
const
|
|
7
|
-
return `${t},${
|
|
5
|
+
const f = o - n - i, u = f - d;
|
|
6
|
+
return `${t},${f} ${t - e},${u} ${t + e},${u}`;
|
|
8
7
|
}
|
|
9
|
-
const
|
|
10
|
-
return `${t},${
|
|
11
|
-
},
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
17
|
-
const r =
|
|
8
|
+
const s = o + n + i, c = s + d;
|
|
9
|
+
return `${t},${s} ${t - e},${c} ${t + e},${c}`;
|
|
10
|
+
}, R = (t, o) => {
|
|
11
|
+
const n = typeof t == "function" ? t(o) : t;
|
|
12
|
+
return n === "" ? void 0 : n;
|
|
13
|
+
}, T = (t, o) => {
|
|
14
|
+
const n = o?.data;
|
|
15
|
+
if (!n || typeof n[0] != "number") return t;
|
|
16
|
+
const r = n.indexOf(t);
|
|
18
17
|
if (r !== -1)
|
|
19
18
|
return r;
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
}, L = (t, o, n, r, e) => {
|
|
20
|
+
if (r === "center")
|
|
21
|
+
return { x: t, textAnchor: "middle" };
|
|
22
|
+
const s = o.length * h * x / 2, c = e ? A / 2 : 0;
|
|
23
|
+
return t - s < n.x ? { x: t - c, textAnchor: "start" } : t + s > n.x + n.width ? { x: t + c, textAnchor: "end" } : { x: t, textAnchor: "middle" };
|
|
24
|
+
}, O = (t, o, n, r) => {
|
|
25
|
+
const e = r ? d + i : i;
|
|
26
|
+
return n === "top" ? t - o - e - i : t + o + e + i + h;
|
|
27
|
+
}, b = ({
|
|
28
|
+
text: t,
|
|
29
|
+
pixelX: o,
|
|
30
|
+
pixelY: n,
|
|
31
|
+
size: r,
|
|
32
|
+
labelPosition: e,
|
|
33
|
+
showLabelArrow: s,
|
|
34
|
+
area: c,
|
|
35
|
+
alignment: f
|
|
36
|
+
}) => {
|
|
37
|
+
const { x: u, textAnchor: $ } = L(
|
|
38
|
+
o,
|
|
39
|
+
t,
|
|
40
|
+
c,
|
|
41
|
+
f,
|
|
42
|
+
s
|
|
43
|
+
), m = O(n, r / 2, e, s);
|
|
44
|
+
return { x: u, y: m, textAnchor: $ };
|
|
30
45
|
};
|
|
31
46
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
I as buildArrowPoints,
|
|
48
|
+
b as computeLabelGeometry,
|
|
49
|
+
L as computeLabelX,
|
|
50
|
+
O as computeLabelY,
|
|
51
|
+
_ as isWithinBounds,
|
|
52
|
+
T as resolveDataXToIndex,
|
|
53
|
+
R as resolveLabel
|
|
38
54
|
};
|
|
@@ -3,7 +3,7 @@ import { useState as K, useRef as k, useMemo as X, useCallback as c, useEffect a
|
|
|
3
3
|
import { clamp as p } from "../../utils/numbers.js";
|
|
4
4
|
import { buildSortedMagnets as z, getDataIndexFromPosition as H, resolvePixelX as N, applyMagnetization as U } from "./utils.js";
|
|
5
5
|
import { useCartesianChartContext as V } from "../CartesianChart/context/cartesianChartContext.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useMagneticSnapshot as G } from "../Point/pointContext/magneticPointsContext.js";
|
|
7
7
|
import { ScrubberContextProvider as J } from "./context/scrubberContext.js";
|
|
8
8
|
function S({
|
|
9
9
|
children: R,
|
|
@@ -17,31 +17,31 @@ function S({
|
|
|
17
17
|
), h = k(m);
|
|
18
18
|
h.current = m;
|
|
19
19
|
const g = k(null), l = k(0), A = X(() => {
|
|
20
|
-
const
|
|
20
|
+
const e = w();
|
|
21
21
|
return z({
|
|
22
|
-
magneticIndices:
|
|
23
|
-
getPixelForIndex: (
|
|
22
|
+
magneticIndices: e,
|
|
23
|
+
getPixelForIndex: (t) => N(t, f, v())
|
|
24
24
|
});
|
|
25
25
|
}, [T, w, f, v]), i = c(
|
|
26
|
-
(
|
|
27
|
-
const
|
|
28
|
-
B(
|
|
26
|
+
(e) => {
|
|
27
|
+
const t = e === void 0 || n <= 0 ? void 0 : p(e, 0, n - 1);
|
|
28
|
+
B(t), y?.(t);
|
|
29
29
|
},
|
|
30
30
|
[n, y]
|
|
31
31
|
), I = c(
|
|
32
|
-
(
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
32
|
+
(e) => {
|
|
33
|
+
const t = f();
|
|
34
|
+
if (!t || !r || n <= 0) return;
|
|
35
35
|
const a = v();
|
|
36
36
|
let o = H(
|
|
37
|
-
t,
|
|
38
37
|
e,
|
|
38
|
+
t,
|
|
39
39
|
a,
|
|
40
40
|
n
|
|
41
41
|
);
|
|
42
42
|
E > 0 && (o = U({
|
|
43
43
|
resolvedIndex: o,
|
|
44
|
-
pixelX:
|
|
44
|
+
pixelX: e,
|
|
45
45
|
sortedMagnets: A,
|
|
46
46
|
magnetRadius: E
|
|
47
47
|
})), o !== h.current && i(o);
|
|
@@ -56,57 +56,57 @@ function S({
|
|
|
56
56
|
i
|
|
57
57
|
]
|
|
58
58
|
), u = c(
|
|
59
|
-
(
|
|
60
|
-
g.current =
|
|
59
|
+
(e) => {
|
|
60
|
+
g.current = e, l.current || (l.current = requestAnimationFrame(() => {
|
|
61
61
|
l.current = 0;
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const t = g.current;
|
|
63
|
+
t !== null && (g.current = null, I(t));
|
|
64
64
|
}));
|
|
65
65
|
},
|
|
66
66
|
[I]
|
|
67
67
|
), s = c(() => {
|
|
68
68
|
r && i(void 0);
|
|
69
69
|
}, [r, i]), L = c(
|
|
70
|
-
(
|
|
71
|
-
const a =
|
|
72
|
-
u(
|
|
70
|
+
(e) => {
|
|
71
|
+
const a = e.currentTarget.getBoundingClientRect();
|
|
72
|
+
u(e.clientX - a.left);
|
|
73
73
|
},
|
|
74
74
|
[u]
|
|
75
75
|
), x = c(
|
|
76
|
-
(
|
|
77
|
-
if (!r || !
|
|
78
|
-
const
|
|
79
|
-
u(
|
|
76
|
+
(e) => {
|
|
77
|
+
if (!r || !e.touches.length) return;
|
|
78
|
+
const t = e.touches[0], o = e.currentTarget.getBoundingClientRect();
|
|
79
|
+
u(t.clientX - o.left);
|
|
80
80
|
},
|
|
81
81
|
[r, u]
|
|
82
82
|
), P = c(
|
|
83
|
-
(
|
|
84
|
-
if (!
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
u(
|
|
83
|
+
(e) => {
|
|
84
|
+
if (!e.touches.length) return;
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
const t = e.touches[0], o = e.currentTarget.getBoundingClientRect();
|
|
87
|
+
u(t.clientX - o.left);
|
|
88
88
|
},
|
|
89
89
|
[u]
|
|
90
90
|
), C = c(
|
|
91
|
-
(
|
|
91
|
+
(e) => {
|
|
92
92
|
if (!r || n <= 0) return;
|
|
93
|
-
const
|
|
93
|
+
const t = n - 1, a = h.current ?? t, o = e.shiftKey ? p(Math.floor(t * 0.1), 1, 10) : 1;
|
|
94
94
|
let d;
|
|
95
|
-
switch (
|
|
95
|
+
switch (e.key) {
|
|
96
96
|
case "ArrowLeft":
|
|
97
|
-
|
|
97
|
+
e.preventDefault(), d = p(a - o, 0, t);
|
|
98
98
|
break;
|
|
99
99
|
case "ArrowRight":
|
|
100
|
-
|
|
100
|
+
e.preventDefault(), d = p(a + o, 0, t);
|
|
101
101
|
break;
|
|
102
102
|
case "Home":
|
|
103
|
-
|
|
103
|
+
e.preventDefault(), d = 0;
|
|
104
104
|
break;
|
|
105
105
|
case "End":
|
|
106
|
-
|
|
106
|
+
e.preventDefault(), d = t;
|
|
107
107
|
break;
|
|
108
108
|
case "Escape":
|
|
109
|
-
|
|
109
|
+
e.preventDefault(), d = void 0;
|
|
110
110
|
break;
|
|
111
111
|
default:
|
|
112
112
|
return;
|
|
@@ -118,10 +118,10 @@ function S({
|
|
|
118
118
|
!r || h.current === void 0 || s();
|
|
119
119
|
}, [r, s]);
|
|
120
120
|
j(() => {
|
|
121
|
-
const
|
|
122
|
-
if (!(!
|
|
123
|
-
return
|
|
124
|
-
|
|
121
|
+
const e = D.current;
|
|
122
|
+
if (!(!e || !r))
|
|
123
|
+
return e.addEventListener("mousemove", L), e.addEventListener("mouseleave", s), e.addEventListener("touchstart", x, { passive: !1 }), e.addEventListener("touchmove", P, { passive: !1 }), e.addEventListener("touchend", s), e.addEventListener("touchcancel", s), e.addEventListener("keydown", C), e.addEventListener("blur", M), () => {
|
|
124
|
+
e.removeEventListener("mousemove", L), e.removeEventListener("mouseleave", s), e.removeEventListener("touchstart", x), e.removeEventListener("touchmove", P), e.removeEventListener("touchend", s), e.removeEventListener("touchcancel", s), e.removeEventListener("keydown", C), e.removeEventListener("blur", M), cancelAnimationFrame(l.current), l.current = 0;
|
|
125
125
|
};
|
|
126
126
|
}, [
|
|
127
127
|
D,
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react-visualization",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
37
|
-
"@ledgerhq/lumen-ui-react": "0.1.
|
|
36
|
+
"@ledgerhq/lumen-design-core": "0.1.18",
|
|
37
|
+
"@ledgerhq/lumen-ui-react": "0.1.43",
|
|
38
38
|
"class-variance-authority": "^0.7.1",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tailwind-merge": "^2.6.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ledgerhq/lumen-utils-shared": "0.1.
|
|
45
|
+
"@ledgerhq/lumen-utils-shared": "0.1.6",
|
|
46
46
|
"d3-array": "^3.2.4",
|
|
47
47
|
"d3-scale": "^4.0.2",
|
|
48
48
|
"d3-shape": "^3.2.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react-visualization",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
37
|
-
"@ledgerhq/lumen-ui-react": "0.1.
|
|
36
|
+
"@ledgerhq/lumen-design-core": "0.1.18",
|
|
37
|
+
"@ledgerhq/lumen-ui-react": "0.1.44",
|
|
38
38
|
"class-variance-authority": "^0.7.1",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tailwind-merge": "^2.6.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ledgerhq/lumen-utils-shared": "0.1.
|
|
45
|
+
"@ledgerhq/lumen-utils-shared": "0.1.6",
|
|
46
46
|
"d3-array": "^3.2.4",
|
|
47
47
|
"d3-scale": "^4.0.2",
|
|
48
48
|
"d3-shape": "^3.2.0"
|