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