@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.
Files changed (30) hide show
  1. package/dist/lib/Components/CartesianChart/RevealAnimation/context.js +1 -1
  2. package/dist/lib/Components/Line/Line.d.ts +1 -1
  3. package/dist/lib/Components/Line/Line.d.ts.map +1 -1
  4. package/dist/lib/Components/Line/Line.js +16 -16
  5. package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
  6. package/dist/lib/Components/LineChart/LineChart.js +69 -63
  7. package/dist/lib/Components/Point/Point.d.ts +1 -1
  8. package/dist/lib/Components/Point/Point.d.ts.map +1 -1
  9. package/dist/lib/Components/Point/Point.js +95 -66
  10. package/dist/lib/Components/Point/constants.d.ts +2 -0
  11. package/dist/lib/Components/Point/constants.d.ts.map +1 -1
  12. package/dist/lib/Components/Point/constants.js +8 -7
  13. package/dist/lib/Components/Point/pointContext/MagneticPointsProvider.d.ts.map +1 -1
  14. package/dist/lib/Components/Point/pointContext/MagneticPointsProvider.js +14 -11
  15. package/dist/lib/Components/Point/pointContext/index.d.ts +1 -1
  16. package/dist/lib/Components/Point/pointContext/index.d.ts.map +1 -1
  17. package/dist/lib/Components/Point/pointContext/magneticPointsContext.d.ts +22 -5
  18. package/dist/lib/Components/Point/pointContext/magneticPointsContext.d.ts.map +1 -1
  19. package/dist/lib/Components/Point/pointContext/magneticPointsContext.js +10 -5
  20. package/dist/lib/Components/Point/types.d.ts +32 -0
  21. package/dist/lib/Components/Point/types.d.ts.map +1 -1
  22. package/dist/lib/Components/Point/usePointGeometry.d.ts +33 -0
  23. package/dist/lib/Components/Point/usePointGeometry.d.ts.map +1 -0
  24. package/dist/lib/Components/Point/usePointGeometry.js +30 -0
  25. package/dist/lib/Components/Point/utils.d.ts +29 -4
  26. package/dist/lib/Components/Point/utils.d.ts.map +1 -1
  27. package/dist/lib/Components/Point/utils.js +47 -31
  28. package/dist/lib/Components/Scrubber/ScrubberProvider.js +40 -40
  29. package/dist/package.json +4 -4
  30. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import { useContext as e, createContext as n, useMemo as r } from "react";
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 function Line({ seriesId, stroke, showArea, areaType: _areaType, curve, connectNulls, }: LineProps): import("react/jsx-runtime").JSX.Element | null;
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,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,MAAM,EACN,QAAgB,EAChB,QAAQ,EAAE,SAAsB,EAChC,KAAK,EACL,YAAY,GACb,EAAE,SAAS,kDAwFX"}
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 { useId as k, useMemo as d } from "react";
3
- import { isNumericScale as y } from "../../utils/scales/scales.js";
4
- import { LINE_DEFAULT_STROKE_COLOR as A, LINE_AREA_GRADIENT_OPACITY as N, LINE_STROKE_WIDTH as O } from "./constants.js";
5
- import { toScaledPoints as v, buildLinePath as R, buildAreaPath as D } from "./utils.js";
6
- import { useCartesianChartContext as j } from "../CartesianChart/context/cartesianChartContext.js";
7
- import { usePathReveal as b } from "../CartesianChart/RevealAnimation/context.js";
8
- function U({
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: F = "gradient",
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 } = j(), P = b(), l = S(), n = _(), p = E(), u = k(), t = I.get(g), r = (C ?? t?.stroke) || A, a = x ?? t?.curve, f = L ?? t?.connectNulls ?? !1, e = d(
17
- () => t?.data && l && n && y(n) ? v(
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 ? R(e, a) : null,
26
+ () => e ? D(e, a) : null,
27
27
  [e, a]
28
28
  ), h = d(
29
- () => s && e && i ? D(e, i, a) : null,
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: N
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: O,
73
+ strokeWidth: v,
74
74
  strokeLinecap: "round",
75
75
  strokeLinejoin: "round"
76
76
  }
77
77
  )
78
78
  ] }) : null;
79
- }
79
+ });
80
80
  export {
81
- U as Line
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,2CAgF1B"}
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 A, Fragment as g } from "react/jsx-runtime";
2
- import { useMemo as I } from "react";
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 P, defaultYAxisProps as h } from "../Axis/Axis.constants.js";
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 k = ({
13
+ const b = ({
14
14
  series: o,
15
15
  showArea: r,
16
16
  areaType: a,
17
- connectNulls: s,
17
+ connectNulls: e,
18
18
  stroke: n
19
- }) => /* @__PURE__ */ i(g, { children: o.map((t) => /* @__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: s
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: s
33
+ connectNulls: e
34
34
  }) => {
35
35
  const { animationStyle: n, keyframe: t } = R();
36
- return /* @__PURE__ */ A(g, { children: [
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
- k,
39
+ b,
40
40
  {
41
41
  series: o,
42
42
  showArea: r,
43
43
  areaType: a,
44
- connectNulls: s,
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: s,
53
+ connectNulls: e,
54
54
  showXAxis: n,
55
55
  showYAxis: t,
56
- xAxisConfig: d,
57
- yAxisConfig: e,
56
+ xAxisConfig: m,
57
+ yAxisConfig: s,
58
58
  isTransitionLoading: c,
59
59
  children: f
60
- }) => /* @__PURE__ */ A(g, { children: [
61
- n && /* @__PURE__ */ i(H, { ...d }),
62
- t && /* @__PURE__ */ i(J, { ...e }),
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: s
69
+ connectNulls: e
70
70
  }
71
71
  ) : /* @__PURE__ */ i(
72
- k,
72
+ b,
73
73
  {
74
74
  series: o,
75
75
  showArea: r,
76
76
  areaType: a,
77
- connectNulls: s
77
+ connectNulls: e
78
78
  }
79
79
  ),
80
80
  f
81
81
  ] });
82
- function ei({
82
+ function si({
83
83
  series: o,
84
84
  showArea: r = !1,
85
85
  areaType: a = "gradient",
86
- connectNulls: s,
86
+ connectNulls: e,
87
87
  showXAxis: n = !1,
88
88
  showYAxis: t = !1,
89
- xAxis: d,
90
- yAxis: e,
89
+ xAxis: m,
90
+ yAxis: s,
91
91
  width: c = "100%",
92
92
  height: f = 240,
93
- inset: S,
94
- enableScrubbing: b,
95
- onScrubberPositionChange: v,
96
- animate: j,
97
- magnetRadius: D,
98
- loading: u = !1,
99
- emptyLabel: C = "No data",
100
- children: E
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
- ...P,
104
- ...d,
105
- position: d?.position ?? P.position
106
- }, l = {
107
- ...h,
108
- ...e,
109
- position: e?.position ?? h.position,
110
- width: e?.width ?? h.width
111
- }, L = p.position, x = l.position, y = l.width, T = I(
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: L,
121
+ xAxisPosition: y,
116
122
  yAxisPosition: x,
117
- yAxisWidth: y
123
+ yAxisWidth: P
118
124
  }),
119
- [n, t, L, x, y]
120
- ), B = W(o, p.data), { status: m, ariaLabel: F } = q({
121
- loading: u,
122
- hasData: B,
123
- emptyLabel: C
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: S,
134
- axisPadding: T,
135
- enableScrubbing: b,
136
- onScrubberPositionChange: v,
137
- animate: j,
138
- magnetRadius: D,
139
- ariaLabel: F,
140
- ariaBusy: u,
141
- overlay: m === "empty" ? /* @__PURE__ */ i(M, { children: C }) : void 0,
142
- children: m === "initial-loading" || m === "empty" ? /* @__PURE__ */ i(G, { loading: m === "initial-loading" }) : /* @__PURE__ */ i(
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: s,
154
+ connectNulls: e,
149
155
  showXAxis: n,
150
156
  showYAxis: t,
151
157
  xAxisConfig: p,
152
158
  yAxisConfig: l,
153
- isTransitionLoading: m === "transition-loading",
154
- children: E
159
+ isTransitionLoading: d === "transition-loading",
160
+ children: T
155
161
  }
156
162
  )
157
163
  }
158
164
  );
159
165
  }
160
166
  export {
161
- ei as LineChart
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 function Point({ dataX, dataY, color, label, LabelComponent, labelPosition, hidePoint, showLabelArrow, size, onClick, magnetic, }: Readonly<PointProps>): import("react/jsx-runtime").JSX.Element | null;
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":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAS3D,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,UAAqB,EACrB,gBAAyB,EACzB,GAAG,KAAK,EACT,EAAE,QAAQ,CAAC,eAAe,CAAC,2CAe3B;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,cAAc,EACd,aAAqB,EACrB,SAAiB,EACjB,cAAqB,EACrB,IAAmB,EACnB,OAAO,EACP,QAAgB,GACjB,EAAE,QAAQ,CAAC,UAAU,CAAC,kDAmEtB"}
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 k, jsx as n } from "react/jsx-runtime";
2
- import { useMemo as E } from "react";
3
- import { projectPoint as M } from "../../utils/scales/scales.js";
4
- import { STROKE_WIDTH as R, DEFAULT_SIZE as T } from "./constants.js";
5
- import { useMagneticRegistration as z, isWithinBounds as D, resolveLabel as F, buildArrowPoints as I, computeLabelY as Y } from "./utils.js";
6
- import { useCartesianChartContext as _ } from "../CartesianChart/context/cartesianChartContext.js";
7
- import { useMagneticPointsContext as B } from "./pointContext/magneticPointsContext.js";
8
- import { usePointReveal as H } from "../CartesianChart/RevealAnimation/context.js";
9
- import { cssVar as e } from "../../../libs/design-core/dist/lib/cssVar/cssVar.js";
10
- function K({
11
- style: o,
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: r,
20
- dominantBaseline: i,
16
+ textAnchor: t,
17
+ dominantBaseline: o,
21
18
  style: {
22
- fill: e("var(--text-base)"),
23
- fontSize: e("var(--font-style-body-4-size)"),
24
- fontWeight: e("var(--font-style-body-4-weight-medium)"),
25
- fontFamily: e("var(--font-family-font)"),
26
- ...o
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
- ...s
25
+ ...e
29
26
  }
30
27
  );
31
28
  }
32
- function $({
33
- dataX: o,
34
- dataY: r,
35
- color: i,
36
- label: s,
37
- LabelComponent: p,
38
- labelPosition: m = "top",
39
- hidePoint: y = !1,
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: g = T,
42
- onClick: u,
43
- magnetic: v = !1
65
+ size: u = S,
66
+ onClick: y,
67
+ magnetic: b = !1,
68
+ labelAlignment: v = "auto"
44
69
  }) {
45
- const { getXScale: b, getYScale: h, getXAxisConfig: S, drawingArea: L } = _(), w = B();
46
- z(v, o, S, w);
47
- const l = b(), a = h(), c = g / 2, A = i ?? e("var(--background-muted-strong)"), t = E(() => {
48
- if (!(!l || !a))
49
- return M(o, r, l, a);
50
- }, [o, r, l, a]), C = H();
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 f = F(s, o), P = f != null, d = x && P, W = Y(t.y, c, m, d), j = p ?? K;
54
- return /* @__PURE__ */ k(
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: u,
91
+ onClick: y,
59
92
  style: {
60
- ...C,
61
- ...u ? { cursor: "pointer" } : void 0
93
+ ...L,
94
+ ...y ? { cursor: "pointer" } : void 0
62
95
  },
63
96
  children: [
64
- !y && /* @__PURE__ */ n(
65
- "circle",
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
- "data-testid": "point-circle",
68
- cx: t.x,
69
- cy: t.y,
70
- r: c,
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
- d && /* @__PURE__ */ n(
79
- "polygon",
107
+ a != null && s && /* @__PURE__ */ n(
108
+ A,
80
109
  {
81
- "data-testid": "point-arrow",
82
- points: I(t.x, t.y, c, m),
83
- style: { fill: e("var(--text-base)") }
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
- $ as Point,
93
- K as PointLabel
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 o = 10, t = 2, c = 6, n = 4, s = 4, E = 10;
1
+ const _ = 10, o = 2, t = 6, A = 4, T = 4, c = 10, n = 0.6;
2
2
  export {
3
- n as ARROW_HEIGHT,
4
- c as ARROW_WIDTH,
5
- o as DEFAULT_SIZE,
6
- s as GAP,
7
- E as LABEL_FONT_SIZE,
8
- t as STROKE_WIDTH
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;AAOvC,KAAK,2BAA2B,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,GACT,EAAE,QAAQ,CAAC,2BAA2B,CAAC,2CA8BvC"}
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 g, useState as p, useCallback as n, useMemo as P } from "react";
3
- import { MagneticPointsContextProvider as l } from "./magneticPointsContext.js";
4
- function C({
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 = g(/* @__PURE__ */ new Set()), [o, s] = p(0), i = n((r) => {
8
- e.current.has(r) || (e.current.add(r), s((t) => t + 1));
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), s((t) => t + 1));
11
- }, []), u = n(() => e.current, []), m = P(
12
- () => ({ register: i, unregister: c, getMagneticPoints: u, version: o }),
13
- [i, c, u, o]
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(l, { value: m, children: f });
18
+ return /* @__PURE__ */ a(h, { value: m, children: /* @__PURE__ */ a(M, { value: p, children: f }) });
16
19
  }
17
20
  export {
18
- C as MagneticPointsProvider
21
+ S as MagneticPointsProvider
19
22
  };
@@ -1,3 +1,3 @@
1
- export { useMagneticPointsContext, type MagneticPointsContextValue, } from './magneticPointsContext';
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,wBAAwB,EACxB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
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
- export type MagneticPointsContextValue = {
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 MagneticPointsContextProvider: import('react').FC<{
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: MagneticPointsContextValue;
25
+ value: MagneticSnapshotValue;
10
26
  }>;
11
- export declare const useMagneticPointsContext: () => MagneticPointsContextValue;
12
- export { MagneticPointsContextProvider };
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,0BAA0B,GAAG;IACvC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAO,6BAA6B;;;EAC6B,CAAC;AAElE,eAAO,MAAM,wBAAwB,QAAO,0BAIxC,CAAC;AAEL,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
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 t } from "../../../../libs/utils-shared/dist/index.js";
2
- const [o, e] = t("MagneticPoints"), i = () => e({
3
- consumerName: "useMagneticPointsContext",
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
- o as MagneticPointsContextProvider,
8
- i as useMagneticPointsContext
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;CACpB,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 { MagneticPointsContextValue } from './pointContext/magneticPointsContext';
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
- * Registers/unregisters a data index as a magnetic snap target
19
- * when the Point has `magnetic` enabled.
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 useMagneticRegistration: (magnetic: boolean, dataX: number, getXAxisConfig: () => BaseAxisProps | undefined, { register, unregister }: MagneticPointsContextValue) => void;
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":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAEvF,eAAO,MAAM,cAAc,GACzB,IAAI,MAAM,EACV,IAAI,MAAM,EACV,MAAM,WAAW,KAChB,OAIyB,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,EACV,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,UAAU,KAAK,GAAG,QAAQ,KACzB,MAYF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,EAC3D,OAAO,MAAM,KACZ,MAAM,GAAG,SAGX,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,MAAM,EACb,YAAY,aAAa,GAAG,SAAS,KACpC,MAAM,GAAG,SAMX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,OAAO,EACjB,OAAO,MAAM,EACb,gBAAgB,MAAM,aAAa,GAAG,SAAS,EAC/C,0BAA0B,0BAA0B,KACnD,IAQF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,eAAe,KAAK,GAAG,QAAQ,EAC/B,aAAa,OAAO,KACnB,MAMF,CAAC"}
1
+ {"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 { useEffect as d } from "react";
2
- import { GAP as i, LABEL_FONT_SIZE as p, ARROW_HEIGHT as f, ARROW_WIDTH as v } from "./constants.js";
3
- const R = (t, n, o) => t >= o.x && t <= o.x + o.width && n >= o.y && n <= o.y + o.height, W = (t, n, o, r) => {
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 c = n - o - i, $ = c - f;
7
- return `${t},${c} ${t - s},${$} ${t + s},${$}`;
5
+ const f = o - n - i, u = f - d;
6
+ return `${t},${f} ${t - e},${u} ${t + e},${u}`;
8
7
  }
9
- const e = n + o + i, u = e + f;
10
- return `${t},${e} ${t - s},${u} ${t + s},${u}`;
11
- }, b = (t, n) => {
12
- const o = typeof t == "function" ? t(n) : t;
13
- return o === "" ? void 0 : o;
14
- }, h = (t, n) => {
15
- const o = n?.data;
16
- if (!o || typeof o[0] != "number") return t;
17
- const r = o.indexOf(t);
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
- }, A = (t, n, o, { register: r, unregister: s }) => {
21
- d(() => {
22
- if (!t) return;
23
- const e = h(n, o());
24
- if (e !== void 0)
25
- return r(e), () => s(e);
26
- }, [t, n, o, r, s]);
27
- }, E = (t, n, o, r) => {
28
- const s = r ? f + i : i;
29
- return o === "top" ? t - n - s - i : t + n + s + i + p;
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
- W as buildArrowPoints,
33
- E as computeLabelY,
34
- R as isWithinBounds,
35
- h as resolveDataXToIndex,
36
- b as resolveLabel,
37
- A as useMagneticRegistration
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 { useMagneticPointsContext as G } from "../Point/pointContext/magneticPointsContext.js";
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 t = w();
20
+ const e = w();
21
21
  return z({
22
- magneticIndices: t,
23
- getPixelForIndex: (e) => N(e, f, v())
22
+ magneticIndices: e,
23
+ getPixelForIndex: (t) => N(t, f, v())
24
24
  });
25
25
  }, [T, w, f, v]), i = c(
26
- (t) => {
27
- const e = t === void 0 || n <= 0 ? void 0 : p(t, 0, n - 1);
28
- B(e), y?.(e);
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
- (t) => {
33
- const e = f();
34
- if (!e || !r || n <= 0) return;
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: t,
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
- (t) => {
60
- g.current = t, l.current || (l.current = requestAnimationFrame(() => {
59
+ (e) => {
60
+ g.current = e, l.current || (l.current = requestAnimationFrame(() => {
61
61
  l.current = 0;
62
- const e = g.current;
63
- e !== null && (g.current = null, I(e));
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
- (t) => {
71
- const a = t.currentTarget.getBoundingClientRect();
72
- u(t.clientX - a.left);
70
+ (e) => {
71
+ const a = e.currentTarget.getBoundingClientRect();
72
+ u(e.clientX - a.left);
73
73
  },
74
74
  [u]
75
75
  ), x = c(
76
- (t) => {
77
- if (!r || !t.touches.length) return;
78
- const e = t.touches[0], o = t.currentTarget.getBoundingClientRect();
79
- u(e.clientX - o.left);
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
- (t) => {
84
- if (!t.touches.length) return;
85
- t.preventDefault();
86
- const e = t.touches[0], o = t.currentTarget.getBoundingClientRect();
87
- u(e.clientX - o.left);
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
- (t) => {
91
+ (e) => {
92
92
  if (!r || n <= 0) return;
93
- const e = n - 1, a = h.current ?? e, o = t.shiftKey ? p(Math.floor(e * 0.1), 1, 10) : 1;
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 (t.key) {
95
+ switch (e.key) {
96
96
  case "ArrowLeft":
97
- t.preventDefault(), d = p(a - o, 0, e);
97
+ e.preventDefault(), d = p(a - o, 0, t);
98
98
  break;
99
99
  case "ArrowRight":
100
- t.preventDefault(), d = p(a + o, 0, e);
100
+ e.preventDefault(), d = p(a + o, 0, t);
101
101
  break;
102
102
  case "Home":
103
- t.preventDefault(), d = 0;
103
+ e.preventDefault(), d = 0;
104
104
  break;
105
105
  case "End":
106
- t.preventDefault(), d = e;
106
+ e.preventDefault(), d = t;
107
107
  break;
108
108
  case "Escape":
109
- t.preventDefault(), d = void 0;
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 t = D.current;
122
- if (!(!t || !r))
123
- return t.addEventListener("mousemove", L), t.addEventListener("mouseleave", s), t.addEventListener("touchstart", x, { passive: !1 }), t.addEventListener("touchmove", P, { passive: !1 }), t.addEventListener("touchend", s), t.addEventListener("touchcancel", s), t.addEventListener("keydown", C), t.addEventListener("blur", M), () => {
124
- t.removeEventListener("mousemove", L), t.removeEventListener("mouseleave", s), t.removeEventListener("touchstart", x), t.removeEventListener("touchmove", P), t.removeEventListener("touchend", s), t.removeEventListener("touchcancel", s), t.removeEventListener("keydown", C), t.removeEventListener("blur", M), cancelAnimationFrame(l.current), l.current = 0;
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.20",
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.17",
37
- "@ledgerhq/lumen-ui-react": "0.1.41",
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.5",
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.21",
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.17",
37
- "@ledgerhq/lumen-ui-react": "0.1.42",
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.5",
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"