@canplot/react 0.4.1 → 0.5.1
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/FrameDrawer.d.ts +6 -6
- package/dist/FrameDrawer.d.ts.map +1 -1
- package/dist/canplot.cjs +4 -4
- package/dist/canplot.cjs.map +1 -1
- package/dist/canplot.mjs +676 -597
- package/dist/canplot.mjs.map +1 -1
- package/dist/helpers.d.ts +9 -10
- package/dist/helpers.d.ts.map +1 -1
- package/dist/interactions/ChartAreaInteractions.d.ts.map +1 -1
- package/dist/interactions/TooltipsX.d.ts.map +1 -1
- package/dist/interactions/TooltipsXY.d.ts.map +1 -1
- package/dist/interactions/positioning.d.ts +1 -1
- package/dist/interactions/positioning.d.ts.map +1 -1
- package/dist/plot/AreaPlot.d.ts.map +1 -1
- package/dist/plot/BarPlot.d.ts.map +1 -1
- package/dist/plot/LinePlot.d.ts.map +1 -1
- package/dist/plot/ScatterPlot.d.ts.map +1 -1
- package/dist/plot/SparklinePlot.d.ts.map +1 -1
- package/dist/plot/Ticks.d.ts.map +1 -1
- package/dist/tickUtils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/canplot.mjs
CHANGED
|
@@ -1,53 +1,68 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsxs as pe, jsx as R, Fragment as
|
|
5
|
-
import D, { version as
|
|
6
|
-
const
|
|
1
|
+
var Ke = Object.defineProperty;
|
|
2
|
+
var Ye = (e, t, n) => t in e ? Ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var F = (e, t, n) => Ye(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { jsxs as pe, jsx as R, Fragment as Be } from "react/jsx-runtime";
|
|
5
|
+
import D, { version as ze, createContext as ye, forwardRef as Ne, useRef as A, useState as B, useMemo as Z, useLayoutEffect as $, useCallback as $e, useContext as q, useId as je, useEffect as Ve } from "react";
|
|
6
|
+
const ie = (e, t, n) => Math.min(Math.max(e, t), n), kt = (e) => e.reduce((t, n) => t + (n ?? 0), 0), At = (e, t) => {
|
|
7
7
|
let n = 0;
|
|
8
8
|
for (let s = 0; s < e.length; s++)
|
|
9
9
|
Math.abs(e[s] - t) < Math.abs(e[n] - t) && (n = s);
|
|
10
10
|
return n;
|
|
11
|
-
},
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return n;
|
|
19
|
-
}, U = (e, t) => {
|
|
11
|
+
}, He = (e, t, n, s) => {
|
|
12
|
+
const o = X(e, n);
|
|
13
|
+
if (!o)
|
|
14
|
+
return null;
|
|
15
|
+
const i = s === "canvas" ? e.chartAreaCanvasPX : e.chartAreaCSS, r = (o.origin === "x" ? i.width : i.height) / (o.max - o.min);
|
|
16
|
+
return t / r;
|
|
17
|
+
}, X = (e, t) => e.scales.find((n) => n.id === t) ?? null, U = (e, t) => {
|
|
20
18
|
const n = window.devicePixelRatio || 1;
|
|
21
19
|
e.lineCap = t?.lineCap ?? "butt", e.lineDashOffset = n * (t?.lineDashOffset ?? 0), e.lineJoin = t?.lineJoin ?? "miter", e.lineWidth = n * (t?.lineWidth ?? 1), e.miterLimit = n * (t?.miterLimit ?? 10), e.strokeStyle = t?.strokeStyle ?? "black", e.fillStyle = t?.fillStyle ?? e.strokeStyle, e.font = t?.font ?? `${10 * n}px sans-serif`, e.textAlign = t?.textAlign ?? "start", e.direction = t?.direction ?? "inherit", e.textBaseline = t?.textBaseline ?? "alphabetic", e.fontKerning = t?.fontKerning ?? "auto";
|
|
22
20
|
}, ge = (e, t, n, s) => {
|
|
23
|
-
const o = s === "canvas" ? e.chartAreaCanvasPX : e.chartAreaCSS,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
const o = s === "canvas" ? e.chartAreaCanvasPX : e.chartAreaCSS, i = X(e, n);
|
|
22
|
+
if (!i)
|
|
23
|
+
return null;
|
|
24
|
+
const r = (i.origin === "x" ? o.width : o.height) / (i.max - i.min);
|
|
25
|
+
return t * r;
|
|
26
|
+
}, G = (e, t, n, s) => {
|
|
27
|
+
const o = X(e, n);
|
|
28
|
+
if (!o)
|
|
29
|
+
return null;
|
|
30
|
+
const i = s === "canvas" ? e.chartAreaCanvasPX : e.chartAreaCSS, r = ge(
|
|
31
|
+
e,
|
|
32
|
+
t - o.min,
|
|
33
|
+
n,
|
|
34
|
+
s
|
|
35
|
+
);
|
|
36
|
+
return r === null ? null : o.origin === "x" ? ie(
|
|
37
|
+
i.x + r,
|
|
38
|
+
i.x - 10 * i.width,
|
|
39
|
+
i.x + 11 * i.width
|
|
40
|
+
) : ie(
|
|
41
|
+
i.y + i.height - r,
|
|
42
|
+
i.y - 10 * i.height,
|
|
43
|
+
i.y + 11 * i.height
|
|
35
44
|
);
|
|
36
|
-
}, kt = (e, t, n) => {
|
|
37
|
-
const { min: s, max: o } = X(e, n);
|
|
38
|
-
return G(t, s, o);
|
|
39
45
|
}, V = (e, t, n) => {
|
|
46
|
+
if (t === null)
|
|
47
|
+
return null;
|
|
40
48
|
const s = n === "canvas" ? e.chartAreaCanvasPX : e.chartAreaCSS;
|
|
41
|
-
return
|
|
49
|
+
return ie(t, s.x, s.x + s.width);
|
|
42
50
|
}, H = (e, t, n) => {
|
|
51
|
+
if (t === null)
|
|
52
|
+
return null;
|
|
43
53
|
const s = n === "canvas" ? e.chartAreaCanvasPX : e.chartAreaCSS;
|
|
44
|
-
return
|
|
54
|
+
return ie(t, s.y, s.y + s.height);
|
|
45
55
|
}, fe = (e, t, n) => {
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
if (t === null)
|
|
57
|
+
return !1;
|
|
58
|
+
const s = X(e, n);
|
|
59
|
+
return s ? t >= s.min && t <= s.max : !1;
|
|
48
60
|
}, _ = (e, t, n, s) => {
|
|
49
|
-
const
|
|
50
|
-
|
|
61
|
+
const o = X(e, n);
|
|
62
|
+
if (!o)
|
|
63
|
+
return null;
|
|
64
|
+
const i = s === "canvas" ? e.chartAreaCanvasPX : e.chartAreaCSS, r = o.origin === "x" ? (t - i.x) / i.width : (i.height - t + i.y) / i.height;
|
|
65
|
+
return o.min + r * (o.max - o.min);
|
|
51
66
|
}, O = (e, t) => {
|
|
52
67
|
if (e === t) return !0;
|
|
53
68
|
if (e == null || t == null || typeof e != typeof t || typeof e != "object" || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
@@ -62,7 +77,7 @@ const G = (e, t, n) => Math.min(Math.max(e, t), n), Mt = (e) => e.reduce((t, n)
|
|
|
62
77
|
for (const o of n)
|
|
63
78
|
if (!Object.prototype.hasOwnProperty.call(t, o) || !O(e[o], t[o])) return !1;
|
|
64
79
|
return !0;
|
|
65
|
-
},
|
|
80
|
+
}, We = (e) => {
|
|
66
81
|
const { ctx: t, scales: n } = e;
|
|
67
82
|
for (const s of n) {
|
|
68
83
|
if (!s.axis) continue;
|
|
@@ -77,27 +92,27 @@ const G = (e, t, n) => Math.min(Math.max(e, t), n), Mt = (e) => e.reduce((t, n)
|
|
|
77
92
|
if (s.axis.position === "bottom")
|
|
78
93
|
t.beginPath(), t.moveTo(o.x, o.y), t.lineTo(o.x + o.width, o.y), t.stroke();
|
|
79
94
|
else if (s.axis.position === "top") {
|
|
80
|
-
const
|
|
81
|
-
t.beginPath(), t.moveTo(o.x,
|
|
95
|
+
const i = o.y + o.height;
|
|
96
|
+
t.beginPath(), t.moveTo(o.x, i), t.lineTo(o.x + o.width, i), t.stroke();
|
|
82
97
|
}
|
|
83
98
|
} else if (s.axis.position === "left") {
|
|
84
|
-
const
|
|
85
|
-
t.beginPath(), t.moveTo(
|
|
99
|
+
const i = o.x + o.width;
|
|
100
|
+
t.beginPath(), t.moveTo(i, o.y), t.lineTo(i, o.y + o.height), t.stroke();
|
|
86
101
|
} else s.axis.position === "right" && (t.beginPath(), t.moveTo(o.x, o.y), t.lineTo(o.x, o.y + o.height), t.stroke());
|
|
87
102
|
t.restore();
|
|
88
103
|
}
|
|
89
104
|
};
|
|
90
|
-
function
|
|
105
|
+
function qe(e) {
|
|
91
106
|
return (t) => {
|
|
92
107
|
for (const n of e) me(n, t);
|
|
93
108
|
};
|
|
94
109
|
}
|
|
95
|
-
function
|
|
110
|
+
function Ge(e) {
|
|
96
111
|
return (t) => {
|
|
97
112
|
const n = [];
|
|
98
113
|
for (const s of e) {
|
|
99
|
-
const o = me(s, t),
|
|
100
|
-
n.push(
|
|
114
|
+
const o = me(s, t), i = typeof o == "function";
|
|
115
|
+
n.push(i ? o : () => me(s, null));
|
|
101
116
|
}
|
|
102
117
|
return () => {
|
|
103
118
|
for (const s of n) s();
|
|
@@ -109,38 +124,38 @@ function me(e, t) {
|
|
|
109
124
|
return e(t);
|
|
110
125
|
e && (e.current = t);
|
|
111
126
|
}
|
|
112
|
-
var
|
|
113
|
-
const
|
|
127
|
+
var Ze = parseInt(ze.split(".")[0], 10) >= 19 ? Ge : qe;
|
|
128
|
+
const Ae = ye({
|
|
114
129
|
listeners: [],
|
|
115
130
|
subscribe: () => () => {
|
|
116
131
|
},
|
|
117
132
|
notifyListeners: () => {
|
|
118
133
|
}
|
|
119
|
-
}),
|
|
134
|
+
}), Je = () => {
|
|
120
135
|
const e = [];
|
|
121
|
-
return { listeners: e, subscribe: (s, o) => (e.push([o, s]), e.sort((
|
|
122
|
-
const
|
|
123
|
-
|
|
136
|
+
return { listeners: e, subscribe: (s, o) => (e.push([o, s]), e.sort((i, r) => i[0] - r[0]), () => {
|
|
137
|
+
const i = e.findIndex(([, r]) => r === s);
|
|
138
|
+
i !== -1 && e.splice(i, 1);
|
|
124
139
|
}), notifyListeners: () => {
|
|
125
140
|
for (const [, s] of e)
|
|
126
141
|
s();
|
|
127
142
|
} };
|
|
128
|
-
}, ve = ye(null),
|
|
129
|
-
}),
|
|
143
|
+
}, ve = ye(null), Re = ye(() => {
|
|
144
|
+
}), De = {
|
|
130
145
|
TOP: 400,
|
|
131
146
|
MIDDLE: 300,
|
|
132
147
|
BOTTOM: 200,
|
|
133
148
|
BACKGROUND: 100
|
|
134
149
|
};
|
|
135
|
-
class
|
|
150
|
+
class Ie {
|
|
136
151
|
constructor() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
152
|
+
F(this, "_frame", null);
|
|
153
|
+
F(this, "clampXPosToChartArea", (t, n = "canvas") => V(this.frame, t, n));
|
|
154
|
+
F(this, "clampYPosToChartArea", (t, n = "canvas") => H(this.frame, t, n));
|
|
155
|
+
F(this, "valToPos", (t, n, s = "canvas") => G(this.frame, t, n, s));
|
|
156
|
+
F(this, "valToPxDistance", (t, n, s = "canvas") => ge(this.frame, t, n, s));
|
|
157
|
+
F(this, "valFits", (t, n) => fe(this.frame, t, n));
|
|
158
|
+
F(this, "getScale", (t) => X(this.frame, t));
|
|
144
159
|
}
|
|
145
160
|
_updateFrame(t) {
|
|
146
161
|
this._frame = t;
|
|
@@ -154,19 +169,19 @@ class Re {
|
|
|
154
169
|
return this.frame.ctx;
|
|
155
170
|
}
|
|
156
171
|
}
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
() =>
|
|
160
|
-
[e,
|
|
172
|
+
const Rt = Ne(({ configuration: e, children: t, style: n, className: s }, o) => {
|
|
173
|
+
const i = A(null), r = A(null), c = et(r), [l, u] = B(null), f = Z(
|
|
174
|
+
() => tt(e, c, l),
|
|
175
|
+
[e, c, l]
|
|
161
176
|
);
|
|
162
177
|
$(() => {
|
|
163
|
-
u(
|
|
164
|
-
}, [
|
|
165
|
-
const
|
|
178
|
+
u(i.current?.getContext("2d") || null);
|
|
179
|
+
}, [i]);
|
|
180
|
+
const m = window.devicePixelRatio || 1;
|
|
166
181
|
return /* @__PURE__ */ pe(
|
|
167
182
|
"div",
|
|
168
183
|
{
|
|
169
|
-
ref:
|
|
184
|
+
ref: Ze([o, r]),
|
|
170
185
|
className: s,
|
|
171
186
|
style: {
|
|
172
187
|
position: "relative",
|
|
@@ -178,66 +193,66 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
178
193
|
/* @__PURE__ */ R(
|
|
179
194
|
"canvas",
|
|
180
195
|
{
|
|
181
|
-
ref:
|
|
182
|
-
width:
|
|
183
|
-
height:
|
|
196
|
+
ref: i,
|
|
197
|
+
width: c.width * m,
|
|
198
|
+
height: c.height * m,
|
|
184
199
|
style: {
|
|
185
200
|
inset: 0,
|
|
186
201
|
position: "absolute",
|
|
187
|
-
width: `${
|
|
188
|
-
height: `${
|
|
202
|
+
width: `${c.width}px`,
|
|
203
|
+
height: `${c.height}px`
|
|
189
204
|
}
|
|
190
205
|
}
|
|
191
206
|
),
|
|
192
|
-
|
|
207
|
+
f && /* @__PURE__ */ R(Qe, { frame: f, children: t })
|
|
193
208
|
]
|
|
194
209
|
}
|
|
195
210
|
);
|
|
196
|
-
}),
|
|
211
|
+
}), Qe = ({
|
|
197
212
|
frame: e,
|
|
198
213
|
children: t
|
|
199
214
|
}) => {
|
|
200
|
-
const n =
|
|
215
|
+
const n = Z(Je, []), [s, o] = B(0);
|
|
201
216
|
$(() => {
|
|
202
217
|
e?.ctx.clearRect(0, 0, e.ctx.canvas.width, e.ctx.canvas.height);
|
|
203
218
|
}, [e, s]);
|
|
204
|
-
const
|
|
205
|
-
|
|
219
|
+
const i = A(null);
|
|
220
|
+
i.current = e, $(() => {
|
|
206
221
|
n.subscribe(() => {
|
|
207
|
-
|
|
208
|
-
},
|
|
222
|
+
i.current && We(i.current);
|
|
223
|
+
}, De.BOTTOM);
|
|
209
224
|
}, [n]), $(() => {
|
|
210
|
-
let
|
|
211
|
-
return
|
|
212
|
-
|
|
225
|
+
let c = null;
|
|
226
|
+
return c = window.requestAnimationFrame(() => {
|
|
227
|
+
c = null, n.notifyListeners();
|
|
213
228
|
}), () => {
|
|
214
|
-
|
|
229
|
+
c && cancelAnimationFrame(c);
|
|
215
230
|
};
|
|
216
231
|
}, [s, e, n]);
|
|
217
|
-
const r =
|
|
218
|
-
o((
|
|
232
|
+
const r = $e(() => {
|
|
233
|
+
o((c) => c + 1);
|
|
219
234
|
}, [o]);
|
|
220
|
-
return /* @__PURE__ */ R(
|
|
221
|
-
},
|
|
235
|
+
return /* @__PURE__ */ R(Ae.Provider, { value: n, children: /* @__PURE__ */ R(Re.Provider, { value: r, children: /* @__PURE__ */ R(ve.Provider, { value: e, children: t }) }) });
|
|
236
|
+
}, et = (e) => {
|
|
222
237
|
const [t, n] = B({
|
|
223
238
|
width: 0,
|
|
224
239
|
height: 0
|
|
225
240
|
}), [s] = B(() => new ResizeObserver((o) => {
|
|
226
|
-
for (const
|
|
227
|
-
const r = Math.round(
|
|
241
|
+
for (const i of o) {
|
|
242
|
+
const r = Math.round(i.contentRect.width), c = Math.round(i.contentRect.height);
|
|
228
243
|
n(
|
|
229
|
-
(
|
|
244
|
+
(l) => l.width !== r || l.height !== c ? { ...l, width: r, height: c } : l
|
|
230
245
|
);
|
|
231
246
|
}
|
|
232
247
|
}));
|
|
233
248
|
return $(() => {
|
|
234
249
|
if (!e.current) return;
|
|
235
|
-
const o = e.current.clientWidth,
|
|
250
|
+
const o = e.current.clientWidth, i = e.current.clientHeight;
|
|
236
251
|
return n(
|
|
237
|
-
(r) => r.width !== o || r.height !==
|
|
252
|
+
(r) => r.width !== o || r.height !== i ? { ...r, width: o, height: i } : r
|
|
238
253
|
), s.observe(e.current, { box: "border-box" }), () => s.disconnect();
|
|
239
254
|
}, [s, e]), t;
|
|
240
|
-
},
|
|
255
|
+
}, tt = (e, t, n) => {
|
|
241
256
|
if (!n)
|
|
242
257
|
return null;
|
|
243
258
|
const s = window.devicePixelRatio || 1;
|
|
@@ -249,40 +264,40 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
249
264
|
width: t.width - e.padding.left - e.padding.right,
|
|
250
265
|
height: t.height - e.padding.top - e.padding.bottom
|
|
251
266
|
};
|
|
252
|
-
for (const
|
|
253
|
-
|
|
267
|
+
for (const a of e.scales)
|
|
268
|
+
a.axis && (a.origin === "x" ? (a.axis.position === "bottom" || a.axis.position === "top") && (o.height = Math.max(
|
|
254
269
|
0,
|
|
255
|
-
o.height -
|
|
256
|
-
),
|
|
257
|
-
const
|
|
270
|
+
o.height - a.axis.size
|
|
271
|
+
), a.axis.position === "top" && (o.y += a.axis.size)) : (a.axis.position === "left" || a.axis.position === "right") && (o.width = Math.max(0, o.width - a.axis.size), a.axis.position === "left" && (o.x += a.axis.size)));
|
|
272
|
+
const i = {
|
|
258
273
|
x: o.x * s,
|
|
259
274
|
y: o.y * s,
|
|
260
275
|
width: o.width * s,
|
|
261
276
|
height: o.height * s
|
|
262
277
|
}, r = [];
|
|
263
|
-
let
|
|
264
|
-
for (const
|
|
265
|
-
if (!
|
|
266
|
-
r.push({ ...
|
|
278
|
+
let c = e.padding.left * s, l = t.width * s - e.padding.right * s, u = t.height * s - e.padding.bottom * s, f = e.padding.top * s;
|
|
279
|
+
for (const a of e.scales) {
|
|
280
|
+
if (!a.axis) {
|
|
281
|
+
r.push({ ...a, axis: null });
|
|
267
282
|
continue;
|
|
268
283
|
}
|
|
269
284
|
let p;
|
|
270
|
-
if (
|
|
271
|
-
switch (
|
|
285
|
+
if (a.origin === "x")
|
|
286
|
+
switch (a.axis.position) {
|
|
272
287
|
case "bottom":
|
|
273
|
-
u -=
|
|
288
|
+
u -= a.axis.size * s, p = {
|
|
274
289
|
x: o.x,
|
|
275
290
|
y: u / s,
|
|
276
291
|
width: o.width,
|
|
277
|
-
height:
|
|
292
|
+
height: a.axis.size
|
|
278
293
|
};
|
|
279
294
|
break;
|
|
280
295
|
case "top":
|
|
281
|
-
|
|
296
|
+
f += a.axis.size * s, p = {
|
|
282
297
|
x: o.x,
|
|
283
|
-
y:
|
|
298
|
+
y: f / s - a.axis.size,
|
|
284
299
|
width: o.width,
|
|
285
|
-
height:
|
|
300
|
+
height: a.axis.size
|
|
286
301
|
};
|
|
287
302
|
break;
|
|
288
303
|
case "left":
|
|
@@ -290,20 +305,20 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
290
305
|
throw new Error("Invalid axis position for x origin");
|
|
291
306
|
}
|
|
292
307
|
else
|
|
293
|
-
switch (
|
|
308
|
+
switch (a.axis.position) {
|
|
294
309
|
case "left":
|
|
295
|
-
|
|
296
|
-
x:
|
|
310
|
+
c += a.axis.size * s, p = {
|
|
311
|
+
x: c / s - a.axis.size,
|
|
297
312
|
y: o.y,
|
|
298
|
-
width:
|
|
313
|
+
width: a.axis.size,
|
|
299
314
|
height: o.height
|
|
300
315
|
};
|
|
301
316
|
break;
|
|
302
317
|
case "right":
|
|
303
|
-
|
|
304
|
-
x:
|
|
318
|
+
l -= a.axis.size * s, p = {
|
|
319
|
+
x: l / s,
|
|
305
320
|
y: o.y,
|
|
306
|
-
width:
|
|
321
|
+
width: a.axis.size,
|
|
307
322
|
height: o.height
|
|
308
323
|
};
|
|
309
324
|
break;
|
|
@@ -311,18 +326,18 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
311
326
|
case "bottom":
|
|
312
327
|
throw new Error("Invalid axis position for y origin");
|
|
313
328
|
}
|
|
314
|
-
const
|
|
329
|
+
const h = {
|
|
315
330
|
x: p.x * s,
|
|
316
331
|
y: p.y * s,
|
|
317
332
|
width: p.width * s,
|
|
318
333
|
height: p.height * s
|
|
319
334
|
};
|
|
320
335
|
r.push({
|
|
321
|
-
...
|
|
336
|
+
...a,
|
|
322
337
|
axis: {
|
|
323
|
-
...
|
|
338
|
+
...a.axis,
|
|
324
339
|
cssRect: p,
|
|
325
|
-
canvasRect:
|
|
340
|
+
canvasRect: h
|
|
326
341
|
}
|
|
327
342
|
});
|
|
328
343
|
}
|
|
@@ -332,225 +347,273 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
332
347
|
padding: e.padding,
|
|
333
348
|
scales: r,
|
|
334
349
|
chartAreaCSS: o,
|
|
335
|
-
chartAreaCanvasPX:
|
|
350
|
+
chartAreaCanvasPX: i
|
|
336
351
|
};
|
|
337
352
|
}, j = (e, t, n) => {
|
|
338
|
-
const s = q(ve), o = q(
|
|
353
|
+
const s = q(ve), o = q(Re), i = q(Ae);
|
|
339
354
|
if (!s || !o)
|
|
340
355
|
throw new Error("useFrame must be used within a CanPlot component");
|
|
341
|
-
const [r] = B(() => new
|
|
356
|
+
const [r] = B(() => new Ie());
|
|
342
357
|
r._updateFrame(s);
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
|
|
358
|
+
const c = A(r);
|
|
359
|
+
c.current = r;
|
|
360
|
+
const l = A(t);
|
|
361
|
+
l.current = t, $(() => i.subscribe(
|
|
347
362
|
() => {
|
|
348
|
-
|
|
363
|
+
l.current(r);
|
|
349
364
|
},
|
|
350
|
-
typeof e == "number" ? e :
|
|
351
|
-
), [
|
|
365
|
+
typeof e == "number" ? e : De[e]
|
|
366
|
+
), [i, e, r]), $(() => {
|
|
352
367
|
o();
|
|
353
368
|
}, [o, ...n]);
|
|
354
|
-
},
|
|
369
|
+
}, Le = () => {
|
|
355
370
|
const e = q(ve);
|
|
356
371
|
if (!e)
|
|
357
372
|
throw new Error("useFrame must be used within a CanPlot component");
|
|
358
|
-
return
|
|
359
|
-
const t = new
|
|
373
|
+
return Z(() => {
|
|
374
|
+
const t = new Ie();
|
|
360
375
|
return t._updateFrame(e), t;
|
|
361
376
|
}, [e]);
|
|
362
|
-
},
|
|
377
|
+
}, nt = ({ layer: e = "MIDDLE", data: t, xScaleId: n, yScaleId: s, style: o }) => (j(
|
|
363
378
|
e,
|
|
364
|
-
({ ctx:
|
|
365
|
-
|
|
379
|
+
({ ctx: i, clampXPosToChartArea: r, clampYPosToChartArea: c, valToPos: l }) => {
|
|
380
|
+
i.save(), i.beginPath(), U(i, o);
|
|
366
381
|
for (const u of t) {
|
|
367
|
-
const
|
|
368
|
-
|
|
382
|
+
const f = r(l(u.x, n, "canvas")), m = c(l(u.y, s, "canvas"));
|
|
383
|
+
f === null || m === null || i.lineTo(f, m);
|
|
369
384
|
}
|
|
370
|
-
|
|
385
|
+
i.stroke(), i.restore();
|
|
371
386
|
},
|
|
372
387
|
[t, n, s, o]
|
|
373
|
-
), null),
|
|
388
|
+
), null), Dt = D.memo(nt, O), st = ({
|
|
374
389
|
layer: e = "MIDDLE",
|
|
375
390
|
data: t,
|
|
376
391
|
xScaleId: n,
|
|
377
392
|
yScaleId: s,
|
|
378
393
|
xStrategy: o = "clip",
|
|
379
|
-
yStrategy:
|
|
394
|
+
yStrategy: i = "clip",
|
|
380
395
|
radius: r = 5,
|
|
381
|
-
style:
|
|
382
|
-
globalAlpha:
|
|
396
|
+
style: c,
|
|
397
|
+
globalAlpha: l
|
|
383
398
|
}) => (j(
|
|
384
399
|
e,
|
|
385
400
|
({
|
|
386
401
|
ctx: u,
|
|
387
|
-
valToPos:
|
|
388
|
-
valFits:
|
|
389
|
-
clampXPosToChartArea:
|
|
402
|
+
valToPos: f,
|
|
403
|
+
valFits: m,
|
|
404
|
+
clampXPosToChartArea: a,
|
|
390
405
|
clampYPosToChartArea: p
|
|
391
406
|
}) => {
|
|
392
407
|
u.save(), u.beginPath();
|
|
393
|
-
const
|
|
394
|
-
U(u,
|
|
408
|
+
const h = new Path2D();
|
|
409
|
+
U(u, c), l !== void 0 && (u.globalAlpha = l);
|
|
395
410
|
for (const y of t) {
|
|
396
|
-
let
|
|
411
|
+
let d, g;
|
|
397
412
|
switch (o) {
|
|
398
413
|
case "clip":
|
|
399
|
-
if (!
|
|
414
|
+
if (!m(y.x, n))
|
|
400
415
|
continue;
|
|
401
|
-
|
|
416
|
+
d = f(y.x, n);
|
|
402
417
|
break;
|
|
403
|
-
case "clamp":
|
|
404
|
-
|
|
418
|
+
case "clamp": {
|
|
419
|
+
if (f(y.x, n) === null)
|
|
420
|
+
continue;
|
|
421
|
+
d = a(f(y.x, n), "canvas");
|
|
405
422
|
break;
|
|
423
|
+
}
|
|
406
424
|
}
|
|
407
|
-
switch (
|
|
425
|
+
switch (i) {
|
|
408
426
|
case "clip":
|
|
409
|
-
if (!
|
|
427
|
+
if (!m(y.y, s))
|
|
410
428
|
continue;
|
|
411
|
-
g =
|
|
429
|
+
g = f(y.y, s);
|
|
412
430
|
break;
|
|
413
431
|
case "clamp":
|
|
414
|
-
g = p(
|
|
432
|
+
g = p(f(y.y, s), "canvas");
|
|
415
433
|
break;
|
|
416
434
|
}
|
|
417
|
-
d.moveTo(
|
|
435
|
+
d === null || g === null || (h.moveTo(d + r, g), h.arc(d, g, r, 0, Math.PI * 2));
|
|
418
436
|
}
|
|
419
|
-
u.fill(
|
|
437
|
+
u.fill(h), u.stroke(h), u.restore();
|
|
420
438
|
},
|
|
421
|
-
[t, n, s, r,
|
|
422
|
-
), null),
|
|
439
|
+
[t, n, s, r, c, l]
|
|
440
|
+
), null), It = D.memo(st, O), ot = ({
|
|
423
441
|
data: e,
|
|
424
442
|
xScaleId: t,
|
|
425
443
|
yScaleId: n,
|
|
426
444
|
style: s,
|
|
427
445
|
barWidth: o,
|
|
428
|
-
xPositionOffset:
|
|
446
|
+
xPositionOffset: i,
|
|
429
447
|
radius: r,
|
|
430
|
-
layer:
|
|
448
|
+
layer: c = "MIDDLE"
|
|
431
449
|
}) => (j(
|
|
432
|
-
|
|
450
|
+
c,
|
|
433
451
|
({
|
|
434
|
-
ctx:
|
|
452
|
+
ctx: l,
|
|
435
453
|
valToPxDistance: u,
|
|
436
|
-
valToPos:
|
|
437
|
-
clampXPosToChartArea:
|
|
438
|
-
clampYPosToChartArea:
|
|
454
|
+
valToPos: f,
|
|
455
|
+
clampXPosToChartArea: m,
|
|
456
|
+
clampYPosToChartArea: a
|
|
439
457
|
}) => {
|
|
440
458
|
if (e.length === 0) return;
|
|
441
|
-
|
|
442
|
-
const p = u(o, t);
|
|
443
|
-
|
|
444
|
-
for (const
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
459
|
+
l.save(), U(l, s);
|
|
460
|
+
const p = u(o, t) ?? 0;
|
|
461
|
+
l.beginPath();
|
|
462
|
+
for (const h of e) {
|
|
463
|
+
const y = f(h.x, t);
|
|
464
|
+
if (y === null)
|
|
465
|
+
continue;
|
|
466
|
+
const d = y - p / 2 + i * p, g = a(
|
|
467
|
+
f(0, n, "canvas"),
|
|
468
|
+
"canvas"
|
|
469
|
+
);
|
|
470
|
+
if (g === null)
|
|
471
|
+
continue;
|
|
472
|
+
const w = a(
|
|
473
|
+
f(h.y, n, "canvas"),
|
|
474
|
+
"canvas"
|
|
475
|
+
);
|
|
476
|
+
if (w === null)
|
|
477
|
+
continue;
|
|
478
|
+
const x = g - w, b = m(d, "canvas"), v = m(d + p, "canvas") - b;
|
|
479
|
+
r ? l.roundRect(
|
|
480
|
+
b,
|
|
448
481
|
w,
|
|
449
482
|
v,
|
|
450
|
-
|
|
483
|
+
x,
|
|
451
484
|
r
|
|
452
|
-
) :
|
|
485
|
+
) : l.rect(b, w, v, x);
|
|
453
486
|
}
|
|
454
|
-
|
|
487
|
+
l.closePath(), l.fill(), s?.strokeStyle && l.stroke(), l.restore();
|
|
455
488
|
},
|
|
456
|
-
[e, t, n, s, o,
|
|
457
|
-
), null),
|
|
489
|
+
[e, t, n, s, o, i, r]
|
|
490
|
+
), null), Lt = D.memo(ot, O), it = ({ layer: e = "MIDDLE", data: t, xScaleId: n, yScaleId: s, style: o }) => (j(
|
|
458
491
|
e,
|
|
459
|
-
({ ctx:
|
|
492
|
+
({ ctx: i, clampXPosToChartArea: r, clampYPosToChartArea: c, valToPos: l }) => {
|
|
460
493
|
const u = [];
|
|
461
|
-
for (const
|
|
462
|
-
const
|
|
463
|
-
|
|
494
|
+
for (const m of t) {
|
|
495
|
+
const a = r(l(m.x, n));
|
|
496
|
+
if (a === null)
|
|
497
|
+
continue;
|
|
498
|
+
const p = c(l(m.y[0], s));
|
|
499
|
+
if (p === null)
|
|
500
|
+
continue;
|
|
501
|
+
const h = c(l(m.y[1], s));
|
|
502
|
+
h !== null && (u.push({ x: a, y: p }), u.unshift({ x: a, y: h }));
|
|
464
503
|
}
|
|
465
|
-
const
|
|
466
|
-
if (
|
|
467
|
-
|
|
468
|
-
for (const
|
|
469
|
-
|
|
470
|
-
|
|
504
|
+
const f = u[0];
|
|
505
|
+
if (f) {
|
|
506
|
+
i.save(), i.beginPath(), U(i, o), i.moveTo(f.x, f.y);
|
|
507
|
+
for (const m of u)
|
|
508
|
+
i.lineTo(m.x, m.y);
|
|
509
|
+
i.closePath(), i.fill(), i.restore();
|
|
471
510
|
}
|
|
472
511
|
},
|
|
473
512
|
[t, n, s, o]
|
|
474
|
-
), null),
|
|
513
|
+
), null), Ut = D.memo(it, O), rt = ({ layer: e = "MIDDLE", data: t, stroked: n, xScaleId: s, yScaleId: o, style: i }) => (j(
|
|
475
514
|
e,
|
|
476
|
-
({ ctx: r, clampXPosToChartArea:
|
|
477
|
-
const
|
|
478
|
-
for (const
|
|
479
|
-
const y =
|
|
480
|
-
|
|
515
|
+
({ ctx: r, clampXPosToChartArea: c, clampYPosToChartArea: l, valToPos: u }) => {
|
|
516
|
+
const f = [];
|
|
517
|
+
for (const h of t) {
|
|
518
|
+
const y = c(u(h.x, s)), d = l(u(h.y, o));
|
|
519
|
+
y === null || d === null || f.push({ x: y, y: d });
|
|
481
520
|
}
|
|
482
|
-
const
|
|
483
|
-
if (!
|
|
521
|
+
const m = f.at(0), a = f.at(-1);
|
|
522
|
+
if (!m || !a)
|
|
484
523
|
return;
|
|
485
|
-
const p =
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
r.
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
524
|
+
const p = l(u(0, o));
|
|
525
|
+
if (p !== null) {
|
|
526
|
+
r.save(), r.beginPath(), U(r, i), r.moveTo(m.x, p);
|
|
527
|
+
for (const h of f)
|
|
528
|
+
r.lineTo(h.x, h.y);
|
|
529
|
+
if (r.lineTo(a.x, p), r.closePath(), r.fill(), n) {
|
|
530
|
+
r.beginPath(), r.moveTo(m.x, m.y);
|
|
531
|
+
for (const h of f)
|
|
532
|
+
r.lineTo(h.x, h.y);
|
|
533
|
+
r.stroke();
|
|
534
|
+
}
|
|
535
|
+
r.restore();
|
|
494
536
|
}
|
|
495
|
-
r.restore();
|
|
496
537
|
},
|
|
497
|
-
[t, n, s, o,
|
|
498
|
-
), null),
|
|
538
|
+
[t, n, s, o, i]
|
|
539
|
+
), null), _t = D.memo(rt, O), ct = ({
|
|
540
|
+
layer: e = "BOTTOM",
|
|
541
|
+
scaleId: t,
|
|
542
|
+
tickStyle: n,
|
|
543
|
+
labelStyle: s,
|
|
544
|
+
labelGap: o,
|
|
545
|
+
tickSize: i,
|
|
546
|
+
ticks: r
|
|
547
|
+
}) => (j(
|
|
499
548
|
e,
|
|
500
|
-
({ ctx:
|
|
501
|
-
const
|
|
502
|
-
if (!
|
|
503
|
-
const
|
|
504
|
-
|
|
549
|
+
({ ctx: c, valToPos: l, getScale: u, frame: f }) => {
|
|
550
|
+
const m = u(t);
|
|
551
|
+
if (!m || !m.axis || m.origin !== "x") return;
|
|
552
|
+
const a = m.axis, p = a.position === "top" ? a.canvasRect.y + a.canvasRect.height : a.canvasRect.y, h = window.devicePixelRatio || 1, y = p, d = (i ?? 6) * h, g = a.position === "top" ? p - d : p + d, w = (o ?? 12) * h;
|
|
553
|
+
c.save(), c.fontKerning = "auto", U(c, {
|
|
505
554
|
...n
|
|
506
|
-
}),
|
|
507
|
-
const
|
|
508
|
-
for (const { value:
|
|
509
|
-
const v =
|
|
510
|
-
|
|
555
|
+
}), c.beginPath();
|
|
556
|
+
const x = Array.isArray(r) ? r : r({ ...m, axis: a }, f);
|
|
557
|
+
for (const { value: b } of x) {
|
|
558
|
+
const v = l(b, t, "canvas");
|
|
559
|
+
v !== null && (c.moveTo(v, y), c.lineTo(v, g));
|
|
511
560
|
}
|
|
512
|
-
|
|
513
|
-
textBaseline:
|
|
561
|
+
c.stroke(), c.restore(), c.save(), U(c, {
|
|
562
|
+
textBaseline: a.position === "top" ? "bottom" : "top",
|
|
514
563
|
textAlign: "center",
|
|
515
564
|
...n,
|
|
516
565
|
...s
|
|
517
566
|
});
|
|
518
|
-
for (const { value:
|
|
519
|
-
const
|
|
567
|
+
for (const { value: b, label: v } of x) {
|
|
568
|
+
const T = l(b, t, "canvas");
|
|
569
|
+
if (T === null)
|
|
570
|
+
continue;
|
|
571
|
+
const S = v.split(`
|
|
520
572
|
`);
|
|
521
573
|
for (let E = 0; E < S.length; E++)
|
|
522
|
-
|
|
574
|
+
c.fillText(S[E], T, g + h * 2 + E * w);
|
|
523
575
|
}
|
|
524
|
-
|
|
576
|
+
c.restore();
|
|
525
577
|
},
|
|
526
578
|
[r, t, n, s]
|
|
527
|
-
), null),
|
|
579
|
+
), null), Xt = D.memo(ct, O), at = ({
|
|
580
|
+
layer: e = "BOTTOM",
|
|
581
|
+
scaleId: t,
|
|
582
|
+
tickStyle: n,
|
|
583
|
+
labelStyle: s,
|
|
584
|
+
labelGap: o,
|
|
585
|
+
tickSize: i,
|
|
586
|
+
ticks: r
|
|
587
|
+
}) => (j(
|
|
528
588
|
e,
|
|
529
|
-
({ ctx:
|
|
530
|
-
const
|
|
531
|
-
if (!
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
for (const { value:
|
|
535
|
-
const
|
|
536
|
-
|
|
589
|
+
({ ctx: c, valToPos: l, getScale: u, frame: f }) => {
|
|
590
|
+
const m = u(t);
|
|
591
|
+
if (!m || !m.axis || m.origin !== "y") return;
|
|
592
|
+
const a = m.axis, p = a.position === "left" ? a.canvasRect.x + a.canvasRect.width : a.canvasRect.x, h = p, y = i ?? 6, d = a.position === "left" ? p - y : p + y, g = o ?? 12, w = Array.isArray(r) ? r : r({ ...m, axis: a }, f);
|
|
593
|
+
c.save(), c.fontKerning = "auto", U(c, { ...n }), c.beginPath();
|
|
594
|
+
for (const { value: x } of w) {
|
|
595
|
+
const b = l(x, t, "canvas");
|
|
596
|
+
b !== null && (c.moveTo(h, b), c.lineTo(d, b));
|
|
537
597
|
}
|
|
538
|
-
|
|
598
|
+
c.stroke(), c.restore(), c.save(), U(c, {
|
|
539
599
|
textBaseline: "middle",
|
|
540
|
-
textAlign:
|
|
600
|
+
textAlign: a.position === "left" ? "right" : "left",
|
|
541
601
|
...n,
|
|
542
602
|
...s
|
|
543
603
|
});
|
|
544
|
-
for (const { value:
|
|
545
|
-
const v =
|
|
604
|
+
for (const { value: x, label: b } of w) {
|
|
605
|
+
const v = l(x, t, "canvas");
|
|
606
|
+
if (v === null)
|
|
607
|
+
continue;
|
|
608
|
+
const T = b.split(`
|
|
546
609
|
`);
|
|
547
|
-
for (let S = 0; S <
|
|
548
|
-
|
|
610
|
+
for (let S = 0; S < T.length; S++)
|
|
611
|
+
c.fillText(` ${T[S]} `, d, v + S * g);
|
|
549
612
|
}
|
|
550
|
-
|
|
613
|
+
c.restore();
|
|
551
614
|
},
|
|
552
615
|
[r, t, n, s]
|
|
553
|
-
), null),
|
|
616
|
+
), null), Ot = D.memo(at, O), I = () => {
|
|
554
617
|
const e = [];
|
|
555
618
|
return {
|
|
556
619
|
addEventListener: (t, n) => (e.push({
|
|
@@ -580,56 +643,59 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
580
643
|
const s = D.useRef(n);
|
|
581
644
|
s.current = n, D.useEffect(() => M[e].addEventListener(
|
|
582
645
|
t,
|
|
583
|
-
(
|
|
584
|
-
s.current(r,
|
|
646
|
+
(i, r) => {
|
|
647
|
+
s.current(r, i);
|
|
585
648
|
}
|
|
586
649
|
), [t, e, s]);
|
|
587
650
|
}, we = D.createContext(""), xe = (e, t) => {
|
|
588
651
|
const n = D.useContext(we);
|
|
589
652
|
return L(e, n, t);
|
|
590
|
-
},
|
|
653
|
+
}, lt = (e, t, n, s, o) => {
|
|
591
654
|
if (!t) return;
|
|
592
|
-
const
|
|
593
|
-
scaleId:
|
|
594
|
-
value: _(n,
|
|
595
|
-
} : null, u = e.clientY - t.top,
|
|
655
|
+
const i = s ?? n.scales.find((m) => m.origin === "x")?.id, r = o ?? n.scales.find((m) => m.origin === "y")?.id, c = e.clientX - t.left, l = i ? {
|
|
656
|
+
scaleId: i,
|
|
657
|
+
value: _(n, c, i, "css")
|
|
658
|
+
} : null, u = e.clientY - t.top, f = r ? {
|
|
596
659
|
scaleId: r,
|
|
597
660
|
value: _(n, u, r, "css")
|
|
598
661
|
} : null;
|
|
599
|
-
return { pointerSyncPosition: { x:
|
|
662
|
+
return { pointerSyncPosition: { x: l, y: f }, cssX: c, cssY: u };
|
|
600
663
|
}, N = (e, t) => {
|
|
601
|
-
const { x: n, y: s } = e, o = n && t.scales.some((r) => r.id === n.scaleId) ?
|
|
664
|
+
const { x: n, y: s } = e, o = n && t.scales.some((r) => r.id === n.scaleId) ? G(t, n.value, n.scaleId, "css") : null, i = s && t.scales.some((r) => r.id === s.scaleId) ? G(t, s.value, s.scaleId, "css") : null;
|
|
602
665
|
return {
|
|
603
666
|
cssX: o,
|
|
604
|
-
cssY:
|
|
667
|
+
cssY: i,
|
|
605
668
|
scaled: Object.fromEntries(
|
|
606
669
|
t.scales.flatMap((r) => {
|
|
607
|
-
const
|
|
608
|
-
return
|
|
670
|
+
const c = r.origin === "y" ? i : o;
|
|
671
|
+
return c === null ? [] : [[r.id, _(t, c, r.id, "css")]];
|
|
609
672
|
})
|
|
610
673
|
)
|
|
611
674
|
};
|
|
612
|
-
},
|
|
613
|
-
const s =
|
|
675
|
+
}, Ee = (e, t, n) => {
|
|
676
|
+
const s = G(
|
|
614
677
|
n,
|
|
615
678
|
t.from,
|
|
616
679
|
t.scaleId,
|
|
617
680
|
"css"
|
|
618
|
-
), o =
|
|
681
|
+
), o = G(
|
|
619
682
|
n,
|
|
620
683
|
t.to,
|
|
621
684
|
t.scaleId,
|
|
622
685
|
"css"
|
|
623
|
-
)
|
|
686
|
+
);
|
|
687
|
+
if (s === null || o === null)
|
|
688
|
+
return null;
|
|
689
|
+
const i = n.scales.flatMap(
|
|
624
690
|
(r) => {
|
|
625
691
|
if (r.origin !== e)
|
|
626
692
|
return [];
|
|
627
|
-
const
|
|
628
|
-
return [
|
|
693
|
+
const c = _(n, s, r.id, "css"), l = _(n, o, r.id, "css");
|
|
694
|
+
return c === null || l === null ? [] : [
|
|
629
695
|
{
|
|
630
696
|
scaleId: r.id,
|
|
631
|
-
from:
|
|
632
|
-
to:
|
|
697
|
+
from: c,
|
|
698
|
+
to: l
|
|
633
699
|
}
|
|
634
700
|
];
|
|
635
701
|
}
|
|
@@ -637,71 +703,71 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
637
703
|
return {
|
|
638
704
|
fromCSS: s,
|
|
639
705
|
toCSS: o,
|
|
640
|
-
scaled:
|
|
706
|
+
scaled: i
|
|
641
707
|
};
|
|
642
|
-
},
|
|
708
|
+
}, Ft = ({
|
|
643
709
|
id: e,
|
|
644
710
|
onClick: t,
|
|
645
711
|
onDblClick: n,
|
|
646
712
|
onMouseMove: s,
|
|
647
713
|
onMouseDown: o,
|
|
648
|
-
onMouseUp:
|
|
714
|
+
onMouseUp: i,
|
|
649
715
|
onDocumentMouseUp: r,
|
|
650
|
-
onSpanSelect:
|
|
651
|
-
onContextMenu:
|
|
716
|
+
onSpanSelect: c,
|
|
717
|
+
onContextMenu: l,
|
|
652
718
|
className: u,
|
|
653
|
-
style:
|
|
654
|
-
sync:
|
|
655
|
-
innerChildren:
|
|
719
|
+
style: f,
|
|
720
|
+
sync: m,
|
|
721
|
+
innerChildren: a,
|
|
656
722
|
children: p
|
|
657
723
|
}) => {
|
|
658
|
-
const
|
|
659
|
-
return L("dblclick",
|
|
724
|
+
const h = je();
|
|
725
|
+
return L("dblclick", h, (y) => {
|
|
660
726
|
n?.(y);
|
|
661
|
-
}), L("click",
|
|
727
|
+
}), L("click", h, (y) => {
|
|
662
728
|
t?.(y);
|
|
663
|
-
}), L("move",
|
|
729
|
+
}), L("move", h, (y) => {
|
|
664
730
|
s?.(y);
|
|
665
|
-
}), L("mousedown",
|
|
731
|
+
}), L("mousedown", h, (y) => {
|
|
666
732
|
o?.(y);
|
|
667
|
-
}), L("mouseup",
|
|
668
|
-
c?.(y);
|
|
669
|
-
}), L("documentmouseup", d, (y) => {
|
|
670
|
-
r?.(y);
|
|
671
|
-
}), L("spanselect", d, (y) => {
|
|
733
|
+
}), L("mouseup", h, (y) => {
|
|
672
734
|
i?.(y);
|
|
673
|
-
}), L("
|
|
674
|
-
|
|
675
|
-
}),
|
|
735
|
+
}), L("documentmouseup", h, (y) => {
|
|
736
|
+
r?.(y);
|
|
737
|
+
}), L("spanselect", h, (y) => {
|
|
738
|
+
c?.(y);
|
|
739
|
+
}), L("contextmenu", h, (y) => {
|
|
740
|
+
l?.(y);
|
|
741
|
+
}), /* @__PURE__ */ pe(we.Provider, { value: h, children: [
|
|
676
742
|
/* @__PURE__ */ R(
|
|
677
|
-
|
|
743
|
+
ut,
|
|
678
744
|
{
|
|
679
745
|
id: e,
|
|
680
746
|
className: u,
|
|
681
|
-
style:
|
|
682
|
-
sync:
|
|
683
|
-
children:
|
|
747
|
+
style: f,
|
|
748
|
+
sync: m,
|
|
749
|
+
children: a
|
|
684
750
|
}
|
|
685
751
|
),
|
|
686
752
|
p
|
|
687
753
|
] });
|
|
688
|
-
},
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
const
|
|
693
|
-
if (
|
|
694
|
-
if (
|
|
754
|
+
}, ut = ({ id: e, className: t, style: n, sync: s, children: o }) => {
|
|
755
|
+
const i = A(null), r = Le().frame, c = A(r);
|
|
756
|
+
c.current = r;
|
|
757
|
+
const l = q(we), u = s?.key || l, f = A(null), m = A(null), a = A(null), p = () => {
|
|
758
|
+
const d = i.current?.parentElement;
|
|
759
|
+
if (d) {
|
|
760
|
+
if (d.dataset.canplotroot === void 0)
|
|
695
761
|
throw new Error(
|
|
696
762
|
"ChartAreaInteractions must be used within a CanPlot component"
|
|
697
763
|
);
|
|
698
|
-
return
|
|
764
|
+
return d.getBoundingClientRect();
|
|
699
765
|
}
|
|
700
|
-
},
|
|
701
|
-
const w =
|
|
702
|
-
|
|
766
|
+
}, h = (d, g) => {
|
|
767
|
+
const w = lt(
|
|
768
|
+
d,
|
|
703
769
|
p(),
|
|
704
|
-
|
|
770
|
+
c.current,
|
|
705
771
|
s?.xViaScaleId,
|
|
706
772
|
s?.yViaScaleId
|
|
707
773
|
);
|
|
@@ -709,21 +775,21 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
709
775
|
w.pointerSyncPosition,
|
|
710
776
|
{ cssX: w.cssX, cssY: w.cssY },
|
|
711
777
|
{
|
|
712
|
-
ctrlKey:
|
|
713
|
-
altKey:
|
|
714
|
-
shiftKey:
|
|
715
|
-
metaKey:
|
|
778
|
+
ctrlKey: d.ctrlKey,
|
|
779
|
+
altKey: d.altKey,
|
|
780
|
+
shiftKey: d.shiftKey,
|
|
781
|
+
metaKey: d.metaKey
|
|
716
782
|
}
|
|
717
783
|
);
|
|
718
|
-
}, y = A(
|
|
719
|
-
return y.current =
|
|
720
|
-
const
|
|
721
|
-
const
|
|
722
|
-
|
|
723
|
-
...
|
|
784
|
+
}, y = A(h);
|
|
785
|
+
return y.current = h, Ve(() => {
|
|
786
|
+
const d = (v) => {
|
|
787
|
+
const T = m.current;
|
|
788
|
+
T && M.spanselect.dispatchEvent(l, {
|
|
789
|
+
...T,
|
|
724
790
|
completed: !0
|
|
725
|
-
}), M.documentmouseup.dispatchEvent(
|
|
726
|
-
frame:
|
|
791
|
+
}), M.documentmouseup.dispatchEvent(l, {
|
|
792
|
+
frame: c.current,
|
|
727
793
|
keys: {
|
|
728
794
|
ctrlKey: v.ctrlKey,
|
|
729
795
|
altKey: v.altKey,
|
|
@@ -732,107 +798,118 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
732
798
|
}
|
|
733
799
|
});
|
|
734
800
|
}, g = (v) => {
|
|
735
|
-
const
|
|
801
|
+
const T = {
|
|
736
802
|
ctrlKey: v.ctrlKey,
|
|
737
803
|
altKey: v.altKey,
|
|
738
804
|
shiftKey: v.shiftKey,
|
|
739
805
|
metaKey: v.metaKey
|
|
740
|
-
}, S =
|
|
741
|
-
if (S && Object.entries(
|
|
806
|
+
}, S = a.current;
|
|
807
|
+
if (S && Object.entries(T).some(
|
|
742
808
|
([C, P]) => S.keys[C] !== P
|
|
743
809
|
)) {
|
|
744
|
-
const C = { ...S, keys:
|
|
745
|
-
|
|
810
|
+
const C = { ...S, keys: T };
|
|
811
|
+
a.current = C, M.sync_move.dispatchEvent(u, C);
|
|
746
812
|
}
|
|
747
|
-
const E =
|
|
748
|
-
if (E && Object.entries(
|
|
813
|
+
const E = m.current;
|
|
814
|
+
if (E && Object.entries(T).some(
|
|
749
815
|
([C, P]) => E.keys[C] !== P
|
|
750
816
|
)) {
|
|
751
817
|
v.stopPropagation(), v.preventDefault();
|
|
752
|
-
const C = { ...E, keys:
|
|
753
|
-
|
|
818
|
+
const C = { ...E, keys: T };
|
|
819
|
+
m.current = C, M.spanselect.dispatchEvent(l, C);
|
|
754
820
|
}
|
|
755
821
|
}, w = (v) => {
|
|
756
822
|
y.current(
|
|
757
823
|
v,
|
|
758
|
-
(
|
|
759
|
-
const P =
|
|
760
|
-
if (!P || !
|
|
761
|
-
const k =
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
824
|
+
(T, { cssX: S, cssY: E }, C) => {
|
|
825
|
+
const P = f.current;
|
|
826
|
+
if (!P || !T.x || !T.y) return;
|
|
827
|
+
const k = c.current, z = P.xRangeCss.start, ae = S, le = P.yRangeCss.start, ue = E, J = X(k, T.x.scaleId);
|
|
828
|
+
if (!J) return;
|
|
829
|
+
const Q = X(k, T.y.scaleId);
|
|
830
|
+
if (!Q) return;
|
|
831
|
+
f.current = {
|
|
832
|
+
xRangeCss: { start: z, end: ae },
|
|
833
|
+
yRangeCss: { start: le, end: ue }
|
|
765
834
|
};
|
|
766
835
|
let W = "below_threshold";
|
|
767
|
-
const he = Math.abs(
|
|
836
|
+
const he = Math.abs(le - ue), de = Math.abs(z - ae);
|
|
768
837
|
he < 10 && de < 10 ? W = "below_threshold" : he > 30 && de > 30 ? W = "box" : he > de ? W = "y" : W = "x";
|
|
769
|
-
const Te =
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
838
|
+
const Te = _(
|
|
839
|
+
k,
|
|
840
|
+
V(c.current, z, "css"),
|
|
841
|
+
J.id,
|
|
842
|
+
"css"
|
|
843
|
+
);
|
|
844
|
+
if (Te === null) return;
|
|
845
|
+
const Se = _(
|
|
846
|
+
k,
|
|
847
|
+
V(c.current, ae, "css"),
|
|
848
|
+
J.id,
|
|
849
|
+
"css"
|
|
850
|
+
);
|
|
851
|
+
if (Se === null) return;
|
|
852
|
+
const Ce = _(
|
|
853
|
+
k,
|
|
854
|
+
H(c.current, le, "css"),
|
|
855
|
+
Q.id,
|
|
856
|
+
"css"
|
|
857
|
+
);
|
|
858
|
+
if (Ce === null) return;
|
|
859
|
+
const Pe = _(
|
|
860
|
+
k,
|
|
861
|
+
H(c.current, ue, "css"),
|
|
862
|
+
Q.id,
|
|
863
|
+
"css"
|
|
864
|
+
);
|
|
865
|
+
if (Pe === null) return;
|
|
866
|
+
const ee = Ee(
|
|
867
|
+
"x",
|
|
868
|
+
{ scaleId: J.id, from: Te, to: Se },
|
|
869
|
+
c.current
|
|
870
|
+
), te = Ee(
|
|
871
|
+
"y",
|
|
872
|
+
{ scaleId: Q.id, from: Ce, to: Pe },
|
|
873
|
+
c.current
|
|
874
|
+
), Oe = ee?.scaled, Fe = te?.scaled, Me = {
|
|
798
875
|
mode: W,
|
|
799
|
-
frame:
|
|
876
|
+
frame: c.current,
|
|
800
877
|
completed: !1,
|
|
801
878
|
x: {
|
|
802
|
-
css:
|
|
803
|
-
from: Q.fromCSS,
|
|
804
|
-
to: Q.toCSS
|
|
805
|
-
},
|
|
806
|
-
scaled: _e ?? []
|
|
807
|
-
},
|
|
808
|
-
y: {
|
|
809
|
-
css: ee && {
|
|
879
|
+
css: ee ? {
|
|
810
880
|
from: ee.fromCSS,
|
|
811
881
|
to: ee.toCSS
|
|
812
|
-
},
|
|
813
|
-
scaled:
|
|
882
|
+
} : void 0,
|
|
883
|
+
scaled: Oe ?? []
|
|
884
|
+
},
|
|
885
|
+
y: {
|
|
886
|
+
css: te ? {
|
|
887
|
+
from: te.fromCSS,
|
|
888
|
+
to: te.toCSS
|
|
889
|
+
} : void 0,
|
|
890
|
+
scaled: Fe ?? []
|
|
814
891
|
},
|
|
815
892
|
keys: C
|
|
816
893
|
};
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
894
|
+
m.current = Me, M.spanselect.dispatchEvent(
|
|
895
|
+
l,
|
|
896
|
+
Me
|
|
820
897
|
);
|
|
821
898
|
}
|
|
822
899
|
);
|
|
823
|
-
},
|
|
824
|
-
y.current(v, (
|
|
900
|
+
}, x = (v) => {
|
|
901
|
+
y.current(v, (T, S, E) => {
|
|
825
902
|
const C = N(
|
|
826
|
-
|
|
827
|
-
|
|
903
|
+
T,
|
|
904
|
+
c.current
|
|
828
905
|
);
|
|
829
906
|
if (!C) return;
|
|
830
907
|
if (Object.values(E).some((k) => k)) {
|
|
831
908
|
v.preventDefault();
|
|
832
909
|
const k = Math.abs(v.deltaY) > Math.abs(v.deltaX) ? v.deltaY : v.deltaX;
|
|
833
|
-
M.pressandwheel.dispatchEvent(
|
|
910
|
+
M.pressandwheel.dispatchEvent(l, {
|
|
834
911
|
pointer: C,
|
|
835
|
-
frame:
|
|
912
|
+
frame: c.current,
|
|
836
913
|
keys: E,
|
|
837
914
|
deltaX: v.deltaX,
|
|
838
915
|
deltaY: v.deltaY,
|
|
@@ -841,28 +918,28 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
841
918
|
}
|
|
842
919
|
});
|
|
843
920
|
};
|
|
844
|
-
document.addEventListener("mouseup",
|
|
845
|
-
const
|
|
846
|
-
return
|
|
921
|
+
document.addEventListener("mouseup", d), document.addEventListener("keydown", g), document.addEventListener("keyup", g), document.addEventListener("mousemove", w);
|
|
922
|
+
const b = i.current;
|
|
923
|
+
return b?.addEventListener("wheel", x, {
|
|
847
924
|
passive: !1
|
|
848
925
|
}), () => {
|
|
849
|
-
document.removeEventListener("mouseup",
|
|
926
|
+
document.removeEventListener("mouseup", d), document.removeEventListener("keydown", g), document.removeEventListener("keyup", g), document.removeEventListener("mousemove", w), b?.removeEventListener("wheel", x);
|
|
850
927
|
};
|
|
851
|
-
}, [
|
|
852
|
-
const g =
|
|
853
|
-
|
|
854
|
-
|
|
928
|
+
}, [c, l, u, y]), L("sync_move", u, (d) => {
|
|
929
|
+
const g = d.positions ? N(
|
|
930
|
+
d.positions,
|
|
931
|
+
c.current
|
|
855
932
|
) : null;
|
|
856
|
-
|
|
857
|
-
frame:
|
|
933
|
+
a.current = d, M.move.dispatchEvent(l, {
|
|
934
|
+
frame: c.current,
|
|
858
935
|
pointer: g ?? null,
|
|
859
|
-
keys:
|
|
860
|
-
source:
|
|
936
|
+
keys: d.keys,
|
|
937
|
+
source: d.originInteractionsId === l ? "own" : "sync"
|
|
861
938
|
});
|
|
862
939
|
}), /* @__PURE__ */ R(
|
|
863
940
|
"div",
|
|
864
941
|
{
|
|
865
|
-
ref:
|
|
942
|
+
ref: i,
|
|
866
943
|
id: e,
|
|
867
944
|
className: t,
|
|
868
945
|
style: {
|
|
@@ -874,107 +951,107 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
874
951
|
zIndex: 25,
|
|
875
952
|
...n
|
|
876
953
|
},
|
|
877
|
-
onDragStart: (
|
|
878
|
-
|
|
954
|
+
onDragStart: (d) => {
|
|
955
|
+
d.preventDefault();
|
|
879
956
|
},
|
|
880
|
-
onClick: (
|
|
881
|
-
d
|
|
882
|
-
const
|
|
957
|
+
onClick: (d) => {
|
|
958
|
+
h(d, (g, w, x) => {
|
|
959
|
+
const b = N(
|
|
883
960
|
g,
|
|
884
|
-
|
|
961
|
+
c.current
|
|
885
962
|
);
|
|
886
|
-
|
|
887
|
-
pointer:
|
|
888
|
-
frame:
|
|
889
|
-
keys:
|
|
963
|
+
b && M.click.dispatchEvent(l, {
|
|
964
|
+
pointer: b,
|
|
965
|
+
frame: c.current,
|
|
966
|
+
keys: x
|
|
890
967
|
});
|
|
891
968
|
});
|
|
892
969
|
},
|
|
893
|
-
onMouseLeave: (
|
|
894
|
-
d
|
|
970
|
+
onMouseLeave: (d) => {
|
|
971
|
+
h(d, (g, w, x) => {
|
|
895
972
|
M.sync_move.dispatchEvent(u, {
|
|
896
973
|
positions: null,
|
|
897
|
-
keys:
|
|
898
|
-
originInteractionsId:
|
|
974
|
+
keys: x,
|
|
975
|
+
originInteractionsId: l
|
|
899
976
|
});
|
|
900
977
|
});
|
|
901
978
|
},
|
|
902
|
-
onMouseMove: (
|
|
903
|
-
d
|
|
979
|
+
onMouseMove: (d) => {
|
|
980
|
+
h(d, (g, w, x) => {
|
|
904
981
|
M.sync_move.dispatchEvent(u, {
|
|
905
982
|
positions: g,
|
|
906
|
-
keys:
|
|
907
|
-
originInteractionsId:
|
|
983
|
+
keys: x,
|
|
984
|
+
originInteractionsId: l
|
|
908
985
|
});
|
|
909
986
|
});
|
|
910
987
|
},
|
|
911
|
-
onMouseDown: (
|
|
912
|
-
d
|
|
988
|
+
onMouseDown: (d) => {
|
|
989
|
+
h(d, (g, { cssX: w, cssY: x }, b) => {
|
|
913
990
|
const v = N(
|
|
914
991
|
g,
|
|
915
|
-
|
|
992
|
+
c.current
|
|
916
993
|
);
|
|
917
|
-
v && (M.mousedown.dispatchEvent(
|
|
994
|
+
v && (M.mousedown.dispatchEvent(l, {
|
|
918
995
|
pointer: v,
|
|
919
|
-
frame:
|
|
920
|
-
keys:
|
|
921
|
-
}),
|
|
996
|
+
frame: c.current,
|
|
997
|
+
keys: b
|
|
998
|
+
}), f.current = {
|
|
922
999
|
xRangeCss: { start: w, end: w },
|
|
923
|
-
yRangeCss: { start:
|
|
1000
|
+
yRangeCss: { start: x, end: x }
|
|
924
1001
|
});
|
|
925
1002
|
});
|
|
926
1003
|
},
|
|
927
|
-
onMouseUp: (
|
|
928
|
-
d
|
|
929
|
-
const
|
|
1004
|
+
onMouseUp: (d) => {
|
|
1005
|
+
h(d, (g, w, x) => {
|
|
1006
|
+
const b = N(
|
|
930
1007
|
g,
|
|
931
|
-
|
|
1008
|
+
c.current
|
|
932
1009
|
);
|
|
933
|
-
if (!
|
|
934
|
-
M.mouseup.dispatchEvent(
|
|
935
|
-
frame:
|
|
936
|
-
pointer:
|
|
937
|
-
keys:
|
|
1010
|
+
if (!b) return;
|
|
1011
|
+
M.mouseup.dispatchEvent(l, {
|
|
1012
|
+
frame: c.current,
|
|
1013
|
+
pointer: b,
|
|
1014
|
+
keys: x
|
|
938
1015
|
});
|
|
939
|
-
const v =
|
|
940
|
-
|
|
941
|
-
const
|
|
942
|
-
if (
|
|
1016
|
+
const v = m.current;
|
|
1017
|
+
m.current = null;
|
|
1018
|
+
const T = f.current;
|
|
1019
|
+
if (f.current = null, T && v) {
|
|
943
1020
|
const S = {
|
|
944
1021
|
...v,
|
|
945
|
-
keys:
|
|
1022
|
+
keys: x,
|
|
946
1023
|
completed: !0
|
|
947
1024
|
};
|
|
948
|
-
|
|
949
|
-
|
|
1025
|
+
m.current = null, M.spanselect.dispatchEvent(
|
|
1026
|
+
l,
|
|
950
1027
|
S
|
|
951
1028
|
);
|
|
952
1029
|
}
|
|
953
1030
|
});
|
|
954
1031
|
},
|
|
955
|
-
onContextMenu: (
|
|
956
|
-
|
|
957
|
-
const
|
|
1032
|
+
onContextMenu: (d) => {
|
|
1033
|
+
d.preventDefault(), h(d, (g, w, x) => {
|
|
1034
|
+
const b = N(
|
|
958
1035
|
g,
|
|
959
|
-
|
|
1036
|
+
c.current
|
|
960
1037
|
);
|
|
961
|
-
|
|
962
|
-
frame:
|
|
963
|
-
pointer:
|
|
964
|
-
keys:
|
|
1038
|
+
b && M.contextmenu.dispatchEvent(l, {
|
|
1039
|
+
frame: c.current,
|
|
1040
|
+
pointer: b,
|
|
1041
|
+
keys: x
|
|
965
1042
|
});
|
|
966
1043
|
});
|
|
967
1044
|
},
|
|
968
|
-
onDoubleClick: (
|
|
969
|
-
d
|
|
970
|
-
const
|
|
1045
|
+
onDoubleClick: (d) => {
|
|
1046
|
+
h(d, (g, w, x) => {
|
|
1047
|
+
const b = N(
|
|
971
1048
|
g,
|
|
972
|
-
|
|
1049
|
+
c.current
|
|
973
1050
|
);
|
|
974
|
-
|
|
975
|
-
frame:
|
|
976
|
-
pointer:
|
|
977
|
-
keys:
|
|
1051
|
+
b && M.dblclick.dispatchEvent(l, {
|
|
1052
|
+
frame: c.current,
|
|
1053
|
+
pointer: b,
|
|
1054
|
+
keys: x
|
|
978
1055
|
});
|
|
979
1056
|
});
|
|
980
1057
|
},
|
|
@@ -986,64 +1063,64 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
986
1063
|
xe("move", (r) => {
|
|
987
1064
|
o(r);
|
|
988
1065
|
});
|
|
989
|
-
const
|
|
1066
|
+
const i = Z(() => {
|
|
990
1067
|
if (!s)
|
|
991
1068
|
return null;
|
|
992
|
-
const { frame: r, pointer:
|
|
993
|
-
if (
|
|
1069
|
+
const { frame: r, pointer: c } = s, l = c?.scaled[n];
|
|
1070
|
+
if (l === void 0 || !X(r, n))
|
|
994
1071
|
return null;
|
|
995
|
-
const
|
|
996
|
-
let m =
|
|
997
|
-
for (const
|
|
998
|
-
let
|
|
999
|
-
for (const [
|
|
1000
|
-
if (!fe(r,
|
|
1072
|
+
const f = [];
|
|
1073
|
+
let m = l;
|
|
1074
|
+
for (const a of e) {
|
|
1075
|
+
let p = null, h = 1 / 0;
|
|
1076
|
+
for (const [g, w] of a.points.entries()) {
|
|
1077
|
+
if (!fe(r, w.x, n) || !fe(r, w.y, a.yScaleId))
|
|
1001
1078
|
continue;
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1079
|
+
const x = Math.abs(w.x - l);
|
|
1080
|
+
x < h && (h = x, p = g);
|
|
1004
1081
|
}
|
|
1005
|
-
const
|
|
1006
|
-
if (!
|
|
1007
|
-
|
|
1082
|
+
const y = a.points[p ?? -1], d = ge(r, h, n, "css");
|
|
1083
|
+
if (!y || d === null || d > 30) {
|
|
1084
|
+
f.push({ seriesId: a.seriesId, y: null });
|
|
1008
1085
|
continue;
|
|
1009
1086
|
}
|
|
1010
|
-
m =
|
|
1011
|
-
seriesId:
|
|
1012
|
-
y:
|
|
1087
|
+
m = y.x, f.push({
|
|
1088
|
+
seriesId: a.seriesId,
|
|
1089
|
+
y: y.y
|
|
1013
1090
|
});
|
|
1014
1091
|
}
|
|
1015
1092
|
return {
|
|
1016
1093
|
frame: r,
|
|
1017
1094
|
x: m,
|
|
1018
|
-
points:
|
|
1095
|
+
points: f
|
|
1019
1096
|
};
|
|
1020
1097
|
}, [e, s, n]);
|
|
1021
|
-
return t(
|
|
1022
|
-
},
|
|
1023
|
-
const [o,
|
|
1024
|
-
if (xe("move", (
|
|
1025
|
-
|
|
1098
|
+
return t(i);
|
|
1099
|
+
}, Yt = ({ makeXStyle: e, makeXClassName: t, makeYStyle: n, makeYClassName: s }) => {
|
|
1100
|
+
const [o, i] = B(null);
|
|
1101
|
+
if (xe("move", (a) => {
|
|
1102
|
+
i(a);
|
|
1026
1103
|
}), !o)
|
|
1027
1104
|
return null;
|
|
1028
|
-
const { frame: r, pointer:
|
|
1029
|
-
return /* @__PURE__ */ pe(
|
|
1105
|
+
const { frame: r, pointer: c } = o, l = c?.cssX ?? null, u = c?.cssY ?? null, f = l ? V(r, l, "css") : 0, m = u ? H(r, u, "css") : 0;
|
|
1106
|
+
return /* @__PURE__ */ pe(Be, { children: [
|
|
1030
1107
|
/* @__PURE__ */ R(
|
|
1031
1108
|
"div",
|
|
1032
1109
|
{
|
|
1033
|
-
"data-show": !!
|
|
1110
|
+
"data-show": !!c,
|
|
1034
1111
|
className: t?.(o),
|
|
1035
1112
|
style: {
|
|
1036
1113
|
position: "absolute",
|
|
1037
1114
|
left: 0,
|
|
1038
|
-
visibility:
|
|
1115
|
+
visibility: l === null ? "hidden" : "visible",
|
|
1039
1116
|
top: r.chartAreaCSS.y,
|
|
1040
1117
|
height: r.chartAreaCSS.height,
|
|
1041
1118
|
borderColor: "red",
|
|
1042
1119
|
borderLeftWidth: "1px",
|
|
1043
1120
|
borderLeftStyle: "solid",
|
|
1044
1121
|
pointerEvents: "none",
|
|
1045
|
-
opacity:
|
|
1046
|
-
transform: `translateX(${
|
|
1122
|
+
opacity: c ? 1 : 0,
|
|
1123
|
+
transform: `translateX(${f}px)`,
|
|
1047
1124
|
...e?.(o)
|
|
1048
1125
|
}
|
|
1049
1126
|
}
|
|
@@ -1052,7 +1129,7 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
1052
1129
|
"div",
|
|
1053
1130
|
{
|
|
1054
1131
|
className: s?.(o),
|
|
1055
|
-
"data-show": !!
|
|
1132
|
+
"data-show": !!c,
|
|
1056
1133
|
style: {
|
|
1057
1134
|
position: "absolute",
|
|
1058
1135
|
visibility: u === null ? "hidden" : "visible",
|
|
@@ -1062,25 +1139,25 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
1062
1139
|
left: r.chartAreaCSS.x,
|
|
1063
1140
|
width: r.chartAreaCSS.width,
|
|
1064
1141
|
pointerEvents: "none",
|
|
1065
|
-
opacity:
|
|
1066
|
-
transform: `translateY(${
|
|
1142
|
+
opacity: c ? 1 : 0,
|
|
1143
|
+
transform: `translateY(${m}px)`,
|
|
1067
1144
|
...n?.(o)
|
|
1068
1145
|
}
|
|
1069
1146
|
}
|
|
1070
1147
|
)
|
|
1071
1148
|
] });
|
|
1072
|
-
},
|
|
1149
|
+
}, Bt = ({ makeClassName: e, makeStyle: t }) => {
|
|
1073
1150
|
const [n, s] = B(null);
|
|
1074
|
-
xe("spanselect", (
|
|
1151
|
+
xe("spanselect", (i) => {
|
|
1075
1152
|
s(
|
|
1076
|
-
|
|
1153
|
+
i.mode === "below_threshold" || i.completed ? null : i
|
|
1077
1154
|
);
|
|
1078
1155
|
});
|
|
1079
|
-
const o =
|
|
1156
|
+
const o = Z(() => {
|
|
1080
1157
|
if (!n || n.mode === "below_threshold")
|
|
1081
1158
|
return null;
|
|
1082
|
-
const
|
|
1083
|
-
return { leftPx: p, topPx:
|
|
1159
|
+
const i = n.mode === "y" ? -1 / 0 : n.x.css?.from ?? -1 / 0, r = n.mode === "y" ? 1 / 0 : n.x.css?.to ?? 1 / 0, c = n.mode === "x" ? -1 / 0 : n.y.css?.from ?? -1 / 0, l = n.mode === "x" ? 1 / 0 : n.y.css?.to ?? 1 / 0, u = V(n.frame, i, "css"), f = V(n.frame, r, "css"), m = H(n.frame, c, "css"), a = H(n.frame, l, "css"), p = Math.min(u, f), h = Math.min(m, a), y = Math.abs(f - u), d = Math.abs(a - m);
|
|
1160
|
+
return { leftPx: p, topPx: h, widthPx: y, heightPx: d };
|
|
1084
1161
|
}, [n]);
|
|
1085
1162
|
return /* @__PURE__ */ R(
|
|
1086
1163
|
"div",
|
|
@@ -1098,8 +1175,8 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
1098
1175
|
}
|
|
1099
1176
|
}
|
|
1100
1177
|
);
|
|
1101
|
-
},
|
|
1102
|
-
const o =
|
|
1178
|
+
}, zt = ({ style: e, children: t, scaleId: n, ...s }) => {
|
|
1179
|
+
const o = Le().getScale(n)?.axis;
|
|
1103
1180
|
return o ? /* @__PURE__ */ R(
|
|
1104
1181
|
"div",
|
|
1105
1182
|
{
|
|
@@ -1116,32 +1193,35 @@ const At = Be(({ configuration: e, children: t, style: n, className: s }, o) =>
|
|
|
1116
1193
|
children: t
|
|
1117
1194
|
}
|
|
1118
1195
|
) : null;
|
|
1119
|
-
},
|
|
1196
|
+
}, Ue = 60, ht = 30, _e = "UTC", dt = "en-GB", Nt = ({
|
|
1120
1197
|
space: e,
|
|
1121
1198
|
formatter: t,
|
|
1122
1199
|
acceptableIncrements: n
|
|
1123
1200
|
} = {}) => (s, o) => {
|
|
1124
|
-
const { min:
|
|
1201
|
+
const { min: i, max: r } = s, c = [], l = window.devicePixelRatio || 1, u = (e ?? (s.origin === "x" ? Ue : ht)) * l, f = He(
|
|
1125
1202
|
o,
|
|
1126
1203
|
u,
|
|
1127
1204
|
s.id,
|
|
1128
1205
|
"canvas"
|
|
1129
|
-
)
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1206
|
+
);
|
|
1207
|
+
if (f === null)
|
|
1208
|
+
return [];
|
|
1209
|
+
const m = n ?? ne, a = m.find((h) => h > f) ?? m.at(-1) ?? 1;
|
|
1210
|
+
let p = i;
|
|
1211
|
+
if (Math.abs(p % a) > Number.EPSILON) {
|
|
1212
|
+
const h = (a - p % a) % a;
|
|
1213
|
+
p += h;
|
|
1134
1214
|
}
|
|
1135
|
-
for (; p <= r &&
|
|
1136
|
-
|
|
1137
|
-
return (t ??
|
|
1138
|
-
},
|
|
1215
|
+
for (; p <= r && c.length < 1e3; )
|
|
1216
|
+
c.push(p), p += a;
|
|
1217
|
+
return (t ?? ft)(c);
|
|
1218
|
+
}, ft = (e) => {
|
|
1139
1219
|
const t = Math.max(0, Math.ceil(-Math.log10(e[1] - e[0])));
|
|
1140
1220
|
return e.map((n) => ({ value: n, label: n.toFixed(t) }));
|
|
1141
|
-
},
|
|
1221
|
+
}, ne = [];
|
|
1142
1222
|
for (let e = -12; e <= 12; e++)
|
|
1143
|
-
|
|
1144
|
-
const
|
|
1223
|
+
ne.push(1 * 10 ** e), ne.push(2 * 10 ** e), ne.push(5 * 10 ** e);
|
|
1224
|
+
const mt = 1, Xe = 1e3 * mt, be = 60 * Xe, re = 60 * be, ce = 24 * re, pt = 30 * ce, yt = 365 * ce, gt = [
|
|
1145
1225
|
// second divisors
|
|
1146
1226
|
[1, "milliseconds"],
|
|
1147
1227
|
[2, "milliseconds"],
|
|
@@ -1193,93 +1273,93 @@ const dt = 1, Ue = 1e3 * dt, be = 60 * Ue, oe = 60 * be, re = 24 * oe, ft = 30 *
|
|
|
1193
1273
|
[25, "years"],
|
|
1194
1274
|
[50, "years"],
|
|
1195
1275
|
[100, "years"]
|
|
1196
|
-
],
|
|
1276
|
+
], se = (e) => {
|
|
1197
1277
|
const [t, n] = e;
|
|
1198
1278
|
switch (n) {
|
|
1199
1279
|
case "milliseconds":
|
|
1200
1280
|
return t;
|
|
1201
1281
|
case "seconds":
|
|
1202
|
-
return t *
|
|
1282
|
+
return t * Xe;
|
|
1203
1283
|
case "minutes":
|
|
1204
1284
|
return t * be;
|
|
1205
1285
|
case "hours":
|
|
1206
|
-
return t * oe;
|
|
1207
|
-
case "days":
|
|
1208
1286
|
return t * re;
|
|
1287
|
+
case "days":
|
|
1288
|
+
return t * ce;
|
|
1209
1289
|
case "months":
|
|
1210
|
-
return t *
|
|
1290
|
+
return t * pt;
|
|
1211
1291
|
case "years":
|
|
1212
|
-
return t *
|
|
1292
|
+
return t * yt;
|
|
1213
1293
|
}
|
|
1214
|
-
},
|
|
1294
|
+
}, vt = (e, t) => {
|
|
1215
1295
|
const n = new Date(e);
|
|
1216
1296
|
return n.setUTCMilliseconds(n.getUTCMilliseconds() + t), n.getTime();
|
|
1217
|
-
},
|
|
1297
|
+
}, wt = (e, t) => {
|
|
1218
1298
|
const n = new Date(e);
|
|
1219
1299
|
return n.setUTCSeconds(n.getUTCSeconds() + t), n.getTime();
|
|
1220
|
-
},
|
|
1300
|
+
}, xt = (e, t) => {
|
|
1221
1301
|
const n = new Date(e);
|
|
1222
1302
|
return n.setUTCMinutes(n.getUTCMinutes() + t), n.getTime();
|
|
1223
|
-
},
|
|
1303
|
+
}, bt = (e, t) => {
|
|
1224
1304
|
const n = new Date(e);
|
|
1225
1305
|
return n.setUTCHours(n.getUTCHours() + t), n.getTime();
|
|
1226
|
-
},
|
|
1306
|
+
}, Tt = (e, t) => {
|
|
1227
1307
|
const n = new Date(e);
|
|
1228
1308
|
return n.setUTCDate(n.getUTCDate() + t), n.getTime();
|
|
1229
|
-
},
|
|
1309
|
+
}, ke = (e, t) => {
|
|
1230
1310
|
const n = new Date(e);
|
|
1231
1311
|
return n.setUTCMonth(n.getUTCMonth() + t), n.getTime();
|
|
1232
1312
|
}, Y = (e, t) => {
|
|
1233
1313
|
const [n, s] = t;
|
|
1234
1314
|
switch (s) {
|
|
1235
1315
|
case "milliseconds":
|
|
1236
|
-
return
|
|
1316
|
+
return vt(e, n);
|
|
1237
1317
|
case "seconds":
|
|
1238
|
-
return
|
|
1318
|
+
return wt(e, n);
|
|
1239
1319
|
case "minutes":
|
|
1240
|
-
return
|
|
1320
|
+
return xt(e, n);
|
|
1241
1321
|
case "hours":
|
|
1242
|
-
return
|
|
1322
|
+
return bt(e, n);
|
|
1243
1323
|
case "days":
|
|
1244
|
-
return
|
|
1324
|
+
return Tt(e, n);
|
|
1245
1325
|
case "months":
|
|
1246
|
-
return
|
|
1326
|
+
return ke(e, n);
|
|
1247
1327
|
case "years":
|
|
1248
|
-
return
|
|
1328
|
+
return ke(e, n * 12);
|
|
1249
1329
|
}
|
|
1250
1330
|
};
|
|
1251
|
-
function
|
|
1331
|
+
function oe(e, t) {
|
|
1252
1332
|
const n = new Date(e), s = new Date(n.toLocaleString("en-US", { timeZone: t })), o = new Date(n.toLocaleString("en-US", { timeZone: "UTC" }));
|
|
1253
1333
|
return (s.getTime() - o.getTime()) / (3600 * 1e3);
|
|
1254
1334
|
}
|
|
1255
|
-
const
|
|
1335
|
+
const St = (e, t, n = "UTC") => {
|
|
1256
1336
|
const [s, o] = t;
|
|
1257
|
-
let
|
|
1337
|
+
let i = new Date(e);
|
|
1258
1338
|
const r = () => {
|
|
1259
|
-
|
|
1339
|
+
i.setUTCHours(-oe(i, n), 0, 0, 0);
|
|
1260
1340
|
};
|
|
1261
1341
|
switch (o) {
|
|
1262
1342
|
case "milliseconds":
|
|
1263
|
-
|
|
1264
|
-
Math.ceil(
|
|
1343
|
+
i.setUTCMilliseconds(
|
|
1344
|
+
Math.ceil(i.getUTCMilliseconds() / s) * s
|
|
1265
1345
|
);
|
|
1266
1346
|
break;
|
|
1267
1347
|
case "seconds":
|
|
1268
|
-
|
|
1269
|
-
Math.ceil(
|
|
1348
|
+
i.setUTCSeconds(
|
|
1349
|
+
Math.ceil(i.getUTCSeconds() / s) * s,
|
|
1270
1350
|
0
|
|
1271
1351
|
);
|
|
1272
1352
|
break;
|
|
1273
1353
|
case "minutes":
|
|
1274
|
-
|
|
1275
|
-
Math.ceil(
|
|
1354
|
+
i.setUTCMinutes(
|
|
1355
|
+
Math.ceil(i.getTime() % re / be / s) * s,
|
|
1276
1356
|
0,
|
|
1277
1357
|
0
|
|
1278
1358
|
);
|
|
1279
1359
|
break;
|
|
1280
1360
|
case "hours":
|
|
1281
|
-
|
|
1282
|
-
Math.ceil(
|
|
1361
|
+
i.setUTCHours(
|
|
1362
|
+
Math.ceil(i.getTime() % ce / re / s) * s,
|
|
1283
1363
|
0,
|
|
1284
1364
|
0,
|
|
1285
1365
|
0
|
|
@@ -1288,20 +1368,20 @@ const bt = (e, t, n = "UTC") => {
|
|
|
1288
1368
|
case "days":
|
|
1289
1369
|
case "months":
|
|
1290
1370
|
case "years":
|
|
1291
|
-
o === "months" ?
|
|
1371
|
+
o === "months" ? i.setUTCDate(1) : o === "years" && i.setUTCMonth(0, 1), r(), i.getTime() < e && (i = new Date(Y(i, [1, o])));
|
|
1292
1372
|
break;
|
|
1293
1373
|
}
|
|
1294
|
-
return
|
|
1295
|
-
},
|
|
1296
|
-
timeZone: e =
|
|
1297
|
-
space: t =
|
|
1374
|
+
return i.getTime();
|
|
1375
|
+
}, $t = ({
|
|
1376
|
+
timeZone: e = _e,
|
|
1377
|
+
space: t = Ue,
|
|
1298
1378
|
formatter: n,
|
|
1299
1379
|
locale: s,
|
|
1300
1380
|
showTimezone: o
|
|
1301
|
-
} = {}) => (
|
|
1302
|
-
const { min:
|
|
1303
|
-
(w) =>
|
|
1304
|
-
) ?? [1, "milliseconds"],
|
|
1381
|
+
} = {}) => (i, r) => {
|
|
1382
|
+
const { min: c, max: l } = i, u = Math.floor(r.chartAreaCanvasPX.width / t) + 1, m = (l - c) / u, [a, p] = gt.find(
|
|
1383
|
+
(w) => se(w) >= m
|
|
1384
|
+
) ?? [1, "milliseconds"], h = St(c, [a, p], e), y = oe(h, e), d = [h];
|
|
1305
1385
|
let g;
|
|
1306
1386
|
for (; ; ) {
|
|
1307
1387
|
switch (p) {
|
|
@@ -1309,16 +1389,16 @@ const bt = (e, t, n = "UTC") => {
|
|
|
1309
1389
|
case "seconds":
|
|
1310
1390
|
case "minutes":
|
|
1311
1391
|
case "hours": {
|
|
1312
|
-
g = Y(
|
|
1392
|
+
g = Y(h, [d.length * a, p]);
|
|
1313
1393
|
break;
|
|
1314
1394
|
}
|
|
1315
1395
|
case "days": {
|
|
1316
|
-
const w = Y(
|
|
1317
|
-
|
|
1396
|
+
const w = Y(h, [
|
|
1397
|
+
d.length * a,
|
|
1318
1398
|
p
|
|
1319
1399
|
]);
|
|
1320
1400
|
g = Y(w, [
|
|
1321
|
-
y -
|
|
1401
|
+
y - oe(w, e),
|
|
1322
1402
|
"hours"
|
|
1323
1403
|
]);
|
|
1324
1404
|
break;
|
|
@@ -1326,31 +1406,31 @@ const bt = (e, t, n = "UTC") => {
|
|
|
1326
1406
|
case "months":
|
|
1327
1407
|
case "years": {
|
|
1328
1408
|
const w = Y(
|
|
1329
|
-
Y(Y(
|
|
1330
|
-
|
|
1409
|
+
Y(Y(h, [y, "hours"]), [
|
|
1410
|
+
d.length * a,
|
|
1331
1411
|
p
|
|
1332
1412
|
]),
|
|
1333
1413
|
[-y, "hours"]
|
|
1334
1414
|
);
|
|
1335
1415
|
g = Y(w, [
|
|
1336
|
-
y -
|
|
1416
|
+
y - oe(w, e),
|
|
1337
1417
|
"hours"
|
|
1338
1418
|
]);
|
|
1339
1419
|
break;
|
|
1340
1420
|
}
|
|
1341
1421
|
}
|
|
1342
|
-
if (g >
|
|
1422
|
+
if (g > l)
|
|
1343
1423
|
break;
|
|
1344
|
-
|
|
1424
|
+
d.push(g);
|
|
1345
1425
|
}
|
|
1346
|
-
return (n ??
|
|
1426
|
+
return (n ?? Ct({
|
|
1347
1427
|
locale: s,
|
|
1348
1428
|
showTimezone: o,
|
|
1349
1429
|
timeZone: e
|
|
1350
|
-
}))(
|
|
1351
|
-
},
|
|
1352
|
-
timeZone: e =
|
|
1353
|
-
locale: t =
|
|
1430
|
+
}))(d);
|
|
1431
|
+
}, K = (e, t, n) => e.find((s) => s.type === n)?.value !== t.find((s) => s.type === n)?.value, Ct = ({
|
|
1432
|
+
timeZone: e = _e,
|
|
1433
|
+
locale: t = dt,
|
|
1354
1434
|
showTimezone: n = !0
|
|
1355
1435
|
}) => {
|
|
1356
1436
|
const s = new Intl.DateTimeFormat(t, {
|
|
@@ -1366,71 +1446,70 @@ const bt = (e, t, n = "UTC") => {
|
|
|
1366
1446
|
timeZone: e
|
|
1367
1447
|
});
|
|
1368
1448
|
return (o) => {
|
|
1369
|
-
const
|
|
1370
|
-
return o.map((u) => ({ value: u, label: s.formatToParts(new Date(u)) })).map((u,
|
|
1371
|
-
const
|
|
1372
|
-
if (r && (
|
|
1373
|
-
const
|
|
1449
|
+
const i = o[1] - o[0], r = i < se([1, "days"]), c = i < se([1, "minutes"]), l = i < se([1, "seconds"]);
|
|
1450
|
+
return o.map((u) => ({ value: u, label: s.formatToParts(new Date(u)) })).map((u, f, m) => {
|
|
1451
|
+
const a = m[f - 1], p = f === 0 || K(u.label, a.label, "year"), h = f === 0 || K(u.label, a.label, "day"), y = f === 0 || K(u.label, a.label, "month"), d = f === 0 || K(u.label, a.label, "hour"), g = f === 0 || K(u.label, a.label, "timeZoneName"), w = f === 0 || K(u.label, a.label, "minute"), x = f === 0 || K(u.label, a.label, "second"), b = f === 0 || K(u.label, a.label, "fractionalSecond"), v = [];
|
|
1452
|
+
if (r && (d || w || g || x || b)) {
|
|
1453
|
+
const T = u.label.find((P) => P.type === "hour")?.value, S = u.label.find((P) => P.type === "minute")?.value, E = u.label.find((P) => P.type === "timeZoneName")?.value;
|
|
1374
1454
|
let C = "";
|
|
1375
|
-
if (
|
|
1455
|
+
if (c) {
|
|
1376
1456
|
const P = u.label.find((z) => z.type === "second")?.value, k = u.label.find(
|
|
1377
1457
|
(z) => z.type === "fractionalSecond"
|
|
1378
1458
|
)?.value;
|
|
1379
|
-
C = `:${P}` + (
|
|
1459
|
+
C = `:${P}` + (l ? `.${k}` : "");
|
|
1380
1460
|
}
|
|
1381
1461
|
v.push(
|
|
1382
|
-
`${
|
|
1462
|
+
`${T}:${S}${C}` + (n && g ? ` ${E}` : "")
|
|
1383
1463
|
);
|
|
1384
1464
|
}
|
|
1385
|
-
return (
|
|
1465
|
+
return (h || y) && v.push(
|
|
1386
1466
|
[
|
|
1387
|
-
u.label.find((
|
|
1388
|
-
|
|
1467
|
+
u.label.find((T) => T.type === "month")?.value,
|
|
1468
|
+
h && u.label.find((T) => T.type === "day")?.value
|
|
1389
1469
|
].filter(Boolean).join(" ")
|
|
1390
|
-
), p && v.push(u.label.find((
|
|
1470
|
+
), p && v.push(u.label.find((T) => T.type === "year")?.value), {
|
|
1391
1471
|
value: u.value,
|
|
1392
|
-
label: v.filter((
|
|
1472
|
+
label: v.filter((T) => T).join(`
|
|
1393
1473
|
`)
|
|
1394
1474
|
};
|
|
1395
1475
|
});
|
|
1396
1476
|
};
|
|
1397
1477
|
};
|
|
1398
1478
|
export {
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1479
|
+
Ut as AreaPlot,
|
|
1480
|
+
zt as AxisOverlay,
|
|
1481
|
+
Lt as BarPlot,
|
|
1482
|
+
De as CANPLOT_LAYER,
|
|
1483
|
+
Rt as CanPlot,
|
|
1484
|
+
Ft as ChartAreaInteractions,
|
|
1485
|
+
Yt as Crosshair,
|
|
1486
|
+
Ie as FrameDrawer,
|
|
1487
|
+
Dt as LinePlot,
|
|
1488
|
+
It as ScatterPlot,
|
|
1489
|
+
Bt as SelectBox,
|
|
1490
|
+
_t as SparklinePlot,
|
|
1411
1491
|
Kt as TooltipsX,
|
|
1412
|
-
|
|
1413
|
-
|
|
1492
|
+
Xt as XTicks,
|
|
1493
|
+
Ot as YTicks,
|
|
1414
1494
|
U as applyStyles,
|
|
1415
|
-
|
|
1416
|
-
kt as clampUnfit,
|
|
1495
|
+
ie as clamp,
|
|
1417
1496
|
V as clampXPosToChartArea,
|
|
1418
1497
|
H as clampYPosToChartArea,
|
|
1419
1498
|
O as deepEqual,
|
|
1420
|
-
|
|
1421
|
-
|
|
1499
|
+
ft as defaultNumericalTicksFormatter,
|
|
1500
|
+
At as findClosestIndex,
|
|
1422
1501
|
X as getScale,
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1502
|
+
Nt as makeLinearTicks,
|
|
1503
|
+
Ct as makeTimeTickFormat,
|
|
1504
|
+
$t as makeTimeTicks,
|
|
1426
1505
|
_ as posToVal,
|
|
1427
|
-
|
|
1428
|
-
|
|
1506
|
+
He as pxToValDistance,
|
|
1507
|
+
kt as sum,
|
|
1429
1508
|
j as useDrawEffect,
|
|
1430
|
-
|
|
1509
|
+
Le as useFrameState,
|
|
1431
1510
|
xe as useInteractionsEvent,
|
|
1432
1511
|
fe as valFits,
|
|
1433
|
-
|
|
1512
|
+
G as valToPos,
|
|
1434
1513
|
ge as valToPxDistance
|
|
1435
1514
|
};
|
|
1436
1515
|
//# sourceMappingURL=canplot.mjs.map
|