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