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