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