@diamondlightsource/davidia 1.3.0-rc.1 → 1.3.1-rc.3
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/README.md +0 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +85 -36
- package/dist/index.js +1595 -1478
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import e from "afterframe";
|
|
2
|
-
import {
|
|
3
|
-
import I from "
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Matrix3 as
|
|
9
|
-
import { useFrame as
|
|
10
|
-
import { useClickOutside as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { Drag as
|
|
13
|
-
import { BsCardHeading as
|
|
14
|
-
import { MdAspectRatio as
|
|
15
|
-
import { TbAxisX as
|
|
2
|
+
import { Fragment as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
3
|
+
import { AXIS_SCALE_TYPES as u, Box as d, Btn as f, COLOR_SCALE_TYPES as p, CellWidthInput as m, ColorMapGradient as h, ColorMapSelector as g, CurveType as _, DataCurve as v, DataToHtml as y, DefaultInteractions as b, DomainControls as x, DomainSlider as S, FloatingControl as C, GlyphType as w, GlyphType as T, HeatmapVis as E, Histogram as D, MatrixVis as O, MouseButton as k, ResetZoomButton as A, RgbVis as j, ScaleSelector as M, ScaleType as N, ScaleType as P, ScatterVis as F, Selector as I, Separator as L, SurfaceVis as R, SvgElement as z, ToggleBtn as ee, ToggleGroup as B, Toolbar as V, TooltipMesh as H, VisCanvas as te, VisMesh as ne, assertDefined as re, getVisDomain as U, useCanvasEvent as ie, useInteraction as ae, useModifierKeyPressed as oe, useSafeDomain as se, useVisCanvasContext as ce, useVisDomain as le } from "@h5web/lib";
|
|
4
|
+
import ue from "ndarray";
|
|
5
|
+
import W from "ndarray-concat-rows";
|
|
6
|
+
import { bin as de } from "d3-array";
|
|
7
|
+
import { scaleLinear as fe } from "d3-scale";
|
|
8
|
+
import { Matrix3 as G, Vector3 as K } from "three";
|
|
9
|
+
import { useFrame as pe, useThree as me } from "@react-three/fiber";
|
|
10
|
+
import { useClickOutside as he, useKeyboardEvent as ge, usePrevious as _e, useRafState as ve, useSyncedRef as ye, useToggle as be } from "@react-hookz/web";
|
|
11
|
+
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
12
|
+
import { Drag as xe } from "@visx/drag";
|
|
13
|
+
import { BsCardHeading as Se, BsSlashLg as Ce } from "react-icons/bs";
|
|
14
|
+
import { MdAspectRatio as we, MdGridOn as Te, MdHorizontalRule as Ee, MdOutlinePolyline as De, MdOutlineRectangle as Oe } from "react-icons/md";
|
|
15
|
+
import { TbAxisX as ke, TbAxisY as Ae, TbCircle as je, TbGridDots as Me, TbOvalVertical as Ne, TbPolygon as Pe, TbQuestionMark as Fe, TbZoomInArea as Ie, TbZoomPan as Le } from "react-icons/tb";
|
|
16
16
|
import "@h5web/lib/styles.css";
|
|
17
|
-
import { IoMdUndo as
|
|
18
|
-
import
|
|
19
|
-
import { format as
|
|
20
|
-
import { HiCursorClick as
|
|
21
|
-
import { IoShapesOutline as
|
|
22
|
-
import { HexColorPicker as
|
|
23
|
-
import { FaCircle as
|
|
24
|
-
import { RxCross1 as
|
|
25
|
-
import { FaSquareFull as
|
|
26
|
-
import
|
|
27
|
-
import { AiOutlineColumnHeight as
|
|
28
|
-
import { BiCircleQuarter as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import { ArcballControls as
|
|
32
|
-
import { decode as
|
|
33
|
-
import
|
|
34
|
-
import { toast as
|
|
35
|
-
|
|
36
|
-
function
|
|
17
|
+
import { IoMdUndo as Re } from "react-icons/io";
|
|
18
|
+
import ze from "react-draggable";
|
|
19
|
+
import { format as Be } from "d3-format";
|
|
20
|
+
import { HiCursorClick as Ve } from "react-icons/hi";
|
|
21
|
+
import { IoShapesOutline as He } from "react-icons/io5";
|
|
22
|
+
import { HexColorPicker as Ue } from "react-colorful";
|
|
23
|
+
import { FaCircle as We } from "react-icons/fa";
|
|
24
|
+
import { RxCross1 as Ge } from "react-icons/rx";
|
|
25
|
+
import { FaSquareFull as Ke } from "react-icons/fa6";
|
|
26
|
+
import qe from "react-select";
|
|
27
|
+
import { AiOutlineColumnHeight as Je, AiOutlineColumnWidth as Ye } from "react-icons/ai";
|
|
28
|
+
import { BiCircleQuarter as Xe } from "react-icons/bi";
|
|
29
|
+
import Ze from "ndarray-unsqueeze";
|
|
30
|
+
import Qe from "ndarray-tile";
|
|
31
|
+
import { ArcballControls as $e, useTexture as et, useVideoTexture as tt } from "@react-three/drei";
|
|
32
|
+
import { decode as nt, encode as rt } from "@msgpack/msgpack";
|
|
33
|
+
import it, { ReadyState as at } from "react-use-websocket";
|
|
34
|
+
import { toast as ot } from "react-toastify";
|
|
35
|
+
// src/utils.ts
|
|
36
|
+
function st(e) {
|
|
37
37
|
let t = Infinity, n = -Infinity;
|
|
38
38
|
if (e.data.forEach((e) => {
|
|
39
39
|
Number.isNaN(e) || (e < t && (t = e), e > n && (n = e));
|
|
40
40
|
}), t > n) throw Error("No valid numbers were compared");
|
|
41
41
|
return [t, n];
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function ct(e, t) {
|
|
44
44
|
if (t == null) {
|
|
45
45
|
if (e === void 0) throw Error("Cannot call with both arguments falsy");
|
|
46
46
|
return e;
|
|
47
47
|
}
|
|
48
48
|
if (e === void 0) return t;
|
|
49
49
|
let n, r = t.x.size, i = t.y.size;
|
|
50
|
-
if (r === i || r === i + 1) n =
|
|
50
|
+
if (r === i || r === i + 1) n = W([e.x, t.x]);
|
|
51
51
|
else return console.log("x ({$xLength}) and y ({$yLength}) axes must be same length", t), e;
|
|
52
|
-
let a =
|
|
52
|
+
let a = W([e.y, t.y]), o = st(n), s = [Math.min(e.yDomain[0], t.yDomain[0]), Math.max(e.yDomain[1], t.yDomain[1])];
|
|
53
53
|
return {
|
|
54
54
|
key: e.key,
|
|
55
55
|
lineParams: e.lineParams,
|
|
@@ -60,17 +60,17 @@ function dt(e, t) {
|
|
|
60
60
|
yDomain: s
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function lt(e) {
|
|
64
64
|
let t = e.map((e) => e.xDomain[0]), n = e.map((e) => e.xDomain[1]);
|
|
65
65
|
return t.length == 1 ? [t[0], n[0]] : [Math.min(...t), Math.max(...n)];
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function ut(e) {
|
|
68
68
|
let t = e.map((e) => e.yDomain[0]), n = e.map((e) => e.yDomain[1]);
|
|
69
69
|
return t.length == 1 ? [t[0], n[0]] : [Math.min(...t), Math.max(...n)];
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
let t = e.values, n =
|
|
73
|
-
if (
|
|
71
|
+
function dt(e) {
|
|
72
|
+
let t = e.values, n = yt(t);
|
|
73
|
+
if (bt(e)) {
|
|
74
74
|
let t = e;
|
|
75
75
|
return {
|
|
76
76
|
domain: t.domain,
|
|
@@ -86,32 +86,32 @@ function mt(e) {
|
|
|
86
86
|
values: n[0]
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
let t = e.heightValues, n =
|
|
89
|
+
function ft(e) {
|
|
90
|
+
let t = e.heightValues, n = yt(t);
|
|
91
91
|
return {
|
|
92
92
|
...e,
|
|
93
93
|
surfaceScale: e.surfaceScale ?? void 0,
|
|
94
94
|
heightValues: n[0]
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let t = e.cellValues, n =
|
|
97
|
+
function pt(e) {
|
|
98
|
+
let t = e.cellValues, n = yt(t);
|
|
99
99
|
return {
|
|
100
100
|
...e,
|
|
101
101
|
displayParams: e.displayParams ?? void 0,
|
|
102
102
|
cellValues: n[0]
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function mt(e) {
|
|
106
106
|
let t, n;
|
|
107
|
-
return e?.xValues != null && (t =
|
|
107
|
+
return e?.xValues != null && (t = yt(e.xValues)[0]), e?.yValues != null && (n = yt(e.yValues)[0]), {
|
|
108
108
|
...e,
|
|
109
109
|
xValues: t,
|
|
110
110
|
yValues: n
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
let t = e.x, n =
|
|
113
|
+
function ht(e) {
|
|
114
|
+
let t = e.x, n = yt(t, !0), r = e.y, i = yt(r, !0);
|
|
115
115
|
return i[0].size == 0 ? null : {
|
|
116
116
|
key: e.key,
|
|
117
117
|
lineParams: e.lineParams,
|
|
@@ -121,8 +121,8 @@ function vt(e) {
|
|
|
121
121
|
yDomain: i[1]
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
let t = e.pointValues, n =
|
|
124
|
+
function gt(e) {
|
|
125
|
+
let t = e.pointValues, n = yt(t), r = e.x, i = yt(r), a = e.y, o = yt(a);
|
|
126
126
|
return {
|
|
127
127
|
...e,
|
|
128
128
|
x: i[0],
|
|
@@ -130,7 +130,7 @@ function yt(e) {
|
|
|
130
130
|
pointValues: n[0]
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function _t(e) {
|
|
134
134
|
return e instanceof Uint8Array ? {
|
|
135
135
|
buffer: e.buffer,
|
|
136
136
|
offset: e.byteOffset
|
|
@@ -139,7 +139,7 @@ function bt(e) {
|
|
|
139
139
|
offset: 0
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
var
|
|
142
|
+
var vt = /* @__PURE__ */ new Map([
|
|
143
143
|
["|i1", Int8Array],
|
|
144
144
|
["<i2", Int16Array],
|
|
145
145
|
["<i4", Int32Array],
|
|
@@ -149,9 +149,9 @@ var xt = /* @__PURE__ */ new Map([
|
|
|
149
149
|
["<f4", Float32Array],
|
|
150
150
|
["<f8", Float64Array]
|
|
151
151
|
]);
|
|
152
|
-
function
|
|
153
|
-
if (e.shape.length === 0 || e.shape[0] === 0) return [
|
|
154
|
-
let n = e.dtype, { buffer: r, offset: i } =
|
|
152
|
+
function yt(e, t = !1) {
|
|
153
|
+
if (e.shape.length === 0 || e.shape[0] === 0) return [ue(/* @__PURE__ */ new Int8Array()), [0, 0]];
|
|
154
|
+
let n = e.dtype, { buffer: r, offset: i } = _t(e.data);
|
|
155
155
|
if (!(r instanceof ArrayBuffer)) throw Error("Shared array buffer not supported");
|
|
156
156
|
let a = e.shape.reduce((e, t) => e * t, 1);
|
|
157
157
|
if (n === "<i8" || n === "<u8") {
|
|
@@ -160,7 +160,7 @@ function J(e, t = !1) {
|
|
|
160
160
|
return t.forEach((e, t) => {
|
|
161
161
|
if (Number.isSafeInteger(e)) o[t] = Number(e);
|
|
162
162
|
else throw Error("Item not safe to convert");
|
|
163
|
-
}), [
|
|
163
|
+
}), [ue(o, e.shape), [0, 0]];
|
|
164
164
|
}
|
|
165
165
|
let o = BigInt(2) ** BigInt(64), s = [o, -o], c = function(e) {
|
|
166
166
|
e < s[0] && (s[0] = e), e > s[1] && (s[1] = e);
|
|
@@ -178,41 +178,41 @@ function J(e, t = !1) {
|
|
|
178
178
|
let d = new Float64Array(l.length);
|
|
179
179
|
return l.forEach((e, t) => {
|
|
180
180
|
d[t] = Number(e);
|
|
181
|
-
}), [
|
|
181
|
+
}), [ue(d, e.shape), [Number(s[0]), Number(s[1])]];
|
|
182
182
|
}
|
|
183
|
-
let o =
|
|
183
|
+
let o = vt.get(n);
|
|
184
184
|
if (o === void 0) throw Error("ndarray of $dtype is not supported");
|
|
185
185
|
let s = o.BYTES_PER_ELEMENT, c;
|
|
186
186
|
i % s == 0 ? c = new o(r, i, a) : (console.warn("Buffer offset not aligned for a typed array so taking copy"), c = new o(r.slice(i, i + a * s)));
|
|
187
|
-
let l =
|
|
188
|
-
return [l, t ?
|
|
187
|
+
let l = ue(c, e.shape);
|
|
188
|
+
return [l, t ? st(l) : [0, 0]];
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function bt(e) {
|
|
191
191
|
return "domain" in e && "heatmapScale" in e;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
return
|
|
193
|
+
function xt(e) {
|
|
194
|
+
return bt(e);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function St(e) {
|
|
197
197
|
return e === "equal" || e === "auto" ? e : "number";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Ct(e) {
|
|
200
200
|
let t = parseFloat(e);
|
|
201
201
|
return [Number.isFinite(t), t];
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function wt(e, t, n, r) {
|
|
204
204
|
let i = parseFloat(e);
|
|
205
205
|
return [Number.isFinite(i) && i >= t && (r ? i <= n : i < n), i];
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Tt(e, t, n) {
|
|
208
208
|
let r = parseFloat(e);
|
|
209
209
|
return [Number.isFinite(r) && r > 0 && (n ? r <= t : r < t), r];
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Et(e, t) {
|
|
212
212
|
let n = parseFloat(e);
|
|
213
213
|
return [Number.isFinite(n) && n >= 0 && !(n === 0 && !t), n];
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Dt(e) {
|
|
216
216
|
let t = e === "panAndWheelZoom", n = e === "selectToZoom";
|
|
217
217
|
return {
|
|
218
218
|
pan: t ? {} : !1,
|
|
@@ -224,9 +224,12 @@ function Ot(e) {
|
|
|
224
224
|
ySelectToZoom: n ? { modifierKey: "Shift" } : !1
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
+
function Ot(e, t) {
|
|
228
|
+
return e.length == t.length && e.every((e, n) => e === t[n]);
|
|
229
|
+
}
|
|
227
230
|
function kt(e, t) {
|
|
228
231
|
if (e && e.length != 0) {
|
|
229
|
-
let n =
|
|
232
|
+
let n = de(), r = t === void 0 ? null : fe().domain(t).nice(), i = e.length, a;
|
|
230
233
|
r !== null && i > 0 && (a = r.ticks(Math.min(i, 20)), n.thresholds(a));
|
|
231
234
|
let o = n(e), s = o.map((e) => e.length);
|
|
232
235
|
if (a === void 0) {
|
|
@@ -254,94 +257,93 @@ function jt() {
|
|
|
254
257
|
var X = /* @__PURE__ */ function(e) {
|
|
255
258
|
return e.panAndWheelZoom = "panAndWheelZoom", e.selectToZoom = "selectToZoom", e.selectRegion = "selectRegion", e;
|
|
256
259
|
}(X || {});
|
|
257
|
-
|
|
258
|
-
//#region src/MulticlickSelectionTool.tsx
|
|
260
|
+
// src/MulticlickSelectionTool.tsx
|
|
259
261
|
function Mt(e) {
|
|
260
|
-
let { id: t = "MulticlickSelection", minPoints: n = 2, maxPoints:
|
|
262
|
+
let { id: t = "MulticlickSelection", minPoints: n = 2, maxPoints: i = n, maxMovement: o = 1, modifierKey: l, disabled: u, transform: d = (e) => e, validate: f = () => !0, onSelectionStart: p, onSelectionChange: m, onSelectionEnd: h, onValidSelection: g, children: _ } = e;
|
|
261
263
|
if (n < 1) throw RangeError(`minPoints must be >= 1, ${n}`);
|
|
262
|
-
if (
|
|
263
|
-
let
|
|
264
|
-
button:
|
|
265
|
-
modifierKey:
|
|
266
|
-
disabled:
|
|
267
|
-
}),
|
|
268
|
-
let t = e.map((e) => S
|
|
269
|
-
|
|
264
|
+
if (i < n && i !== -1) throw RangeError(`maxPoints must be -1 or >= minPoints, ${i} cf ${n}`);
|
|
265
|
+
let v = ye(p), y = ye(m), b = ye(h), x = ye(g), S = me((e) => e.camera), C = ce(), { canvasBox: w, htmlToWorld: T, worldToData: E } = C, [D, O] = ve(), A = c(null), j = c(!0), M = c(!1), N = c(!1), P = oe(l), F = ae(t, {
|
|
266
|
+
button: k.Left,
|
|
267
|
+
modifierKey: l,
|
|
268
|
+
disabled: u
|
|
269
|
+
}), I = r((e) => {
|
|
270
|
+
let t = e.map((e) => T(S, e)), n = t.map(E);
|
|
271
|
+
O({
|
|
270
272
|
html: e,
|
|
271
273
|
world: t,
|
|
272
274
|
data: n
|
|
273
275
|
});
|
|
274
276
|
}, [
|
|
275
|
-
v,
|
|
276
277
|
S,
|
|
277
278
|
T,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
O,
|
|
280
|
+
E
|
|
281
|
+
]), L = r((e, t, n) => {
|
|
282
|
+
j.current ? (A.current = [n], M.current = !1, e.setPointerCapture(t), i === 1 && I([n])) : j.current = !0;
|
|
283
|
+
}, [i, I]), R = r((e, t, n, r) => {
|
|
284
|
+
e.releasePointerCapture(t), j.current = !n, N.current = r, A.current = null;
|
|
283
285
|
}, []);
|
|
284
|
-
function
|
|
285
|
-
let { sourceEvent: t } = e,
|
|
286
|
-
if (
|
|
287
|
-
let { target: s, pointerId: c } = t, l = s, u =
|
|
286
|
+
function z(e) {
|
|
287
|
+
let { sourceEvent: t } = e, r = t.type === "pointerdown", a = F(t);
|
|
288
|
+
if (r && !a) return;
|
|
289
|
+
let { target: s, pointerId: c } = t, l = s, u = A.current, d = w.clampPoint(e.htmlPt);
|
|
288
290
|
if (u === null) {
|
|
289
|
-
|
|
291
|
+
L(l, c, d);
|
|
290
292
|
return;
|
|
291
293
|
}
|
|
292
294
|
let f = u.length, p = !1;
|
|
293
|
-
if (
|
|
295
|
+
if (j.current) {
|
|
294
296
|
let e = u[f - 1];
|
|
295
|
-
(f === 1 ? 0 : Math.max(Math.abs(e.x - d.x), Math.abs(e.y - d.y))) <=
|
|
296
|
-
} else
|
|
297
|
-
(p || f >= n &&
|
|
297
|
+
(f === 1 ? 0 : Math.max(Math.abs(e.x - d.x), Math.abs(e.y - d.y))) <= o ? p = r && M.current : (u.push(d), j.current = !1);
|
|
298
|
+
} else j.current = !0;
|
|
299
|
+
(p || f >= n && i > 0 && f === i) && (O(void 0), R(l, c, r, a));
|
|
298
300
|
}
|
|
299
|
-
function
|
|
300
|
-
let t =
|
|
301
|
+
function ee(e) {
|
|
302
|
+
let t = A.current;
|
|
301
303
|
if (t === null) return;
|
|
302
|
-
let n = t.length, r =
|
|
303
|
-
|
|
304
|
+
let n = t.length, r = w.clampPoint(e.htmlPt);
|
|
305
|
+
j.current ? (t.push(r), j.current = !1) : t[n - 1] = r, I([...t]);
|
|
304
306
|
}
|
|
305
|
-
ie("pointerdown",
|
|
306
|
-
|
|
307
|
-
}, [], { event: "keydown" }),
|
|
308
|
-
|
|
307
|
+
ie("pointerdown", z), ie("pointermove", ee), ie("pointerup", z), ge("Escape", () => {
|
|
308
|
+
A.current = null, O(void 0);
|
|
309
|
+
}, [], { event: "keydown" }), ge("Enter", () => {
|
|
310
|
+
M.current && (N.current = !0, A.current = null, O(void 0));
|
|
309
311
|
}, [], { event: "keydown" });
|
|
310
|
-
let
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
]),
|
|
316
|
-
|
|
317
|
-
if (
|
|
318
|
-
let e =
|
|
319
|
-
|
|
312
|
+
let B = s(() => D && d(D, S, C), [
|
|
313
|
+
D,
|
|
314
|
+
d,
|
|
315
|
+
S,
|
|
316
|
+
C
|
|
317
|
+
]), V = !!B && f(B);
|
|
318
|
+
a(() => {
|
|
319
|
+
if (V) {
|
|
320
|
+
let e = B.html.length;
|
|
321
|
+
M.current = e >= n;
|
|
320
322
|
}
|
|
321
323
|
}, [
|
|
322
|
-
|
|
323
|
-
|
|
324
|
+
M,
|
|
325
|
+
V,
|
|
324
326
|
n,
|
|
325
|
-
|
|
327
|
+
B
|
|
326
328
|
]);
|
|
327
|
-
let
|
|
328
|
-
return
|
|
329
|
-
|
|
329
|
+
let H = _e(B), te = _e(V);
|
|
330
|
+
return a(() => {
|
|
331
|
+
B ? (re(D), H || v.current?.(), y.current?.(P ? B : void 0, D, V)) : H && (re(te), b.current?.(N.current ? H : void 0, te), te && N.current && x.current?.(H), N.current = !1);
|
|
330
332
|
}, [
|
|
333
|
+
B,
|
|
334
|
+
H,
|
|
335
|
+
D,
|
|
336
|
+
V,
|
|
337
|
+
te,
|
|
331
338
|
P,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
m,
|
|
338
|
-
h,
|
|
339
|
-
g,
|
|
340
|
-
_
|
|
341
|
-
]), !P || !A ? null : (re(w), /* @__PURE__ */ K(G, { children: p(P, w, F, O) }));
|
|
339
|
+
v,
|
|
340
|
+
y,
|
|
341
|
+
b,
|
|
342
|
+
x
|
|
343
|
+
]), !B || !P ? null : (re(D), /* @__PURE__ */ J(q, { children: _(B, D, V, M) }));
|
|
342
344
|
}
|
|
343
345
|
function Nt(e) {
|
|
344
|
-
let { n: t, nx: n, ny: r, i, drag: a, ...o } = e,
|
|
346
|
+
let { n: t, nx: n, ny: r, i, drag: a, ...o } = e, c = s(() => ({
|
|
345
347
|
onPointerMove: a?.dragMove,
|
|
346
348
|
onPointerUp: a && ((e) => {
|
|
347
349
|
e.stopPropagation(), e.target.releasePointerCapture(e.pointerId), a.dragEnd(e);
|
|
@@ -349,27 +351,27 @@ function Nt(e) {
|
|
|
349
351
|
onPointerDown: a && ((e) => {
|
|
350
352
|
e.stopPropagation(), e.target.setPointerCapture(e.pointerId), a.dragStart(e);
|
|
351
353
|
})
|
|
352
|
-
}), [a]),
|
|
354
|
+
}), [a]), l = s(() => {
|
|
353
355
|
if ("ref" in o) {
|
|
354
356
|
let { ref: e, ...t } = o;
|
|
355
357
|
return t;
|
|
356
358
|
}
|
|
357
359
|
return o;
|
|
358
360
|
}, [o]);
|
|
359
|
-
return /* @__PURE__ */
|
|
361
|
+
return /* @__PURE__ */ Y("g", {
|
|
360
362
|
transform: `translate(${a?.dx ?? 0}, ${a?.dy ?? 0})`,
|
|
361
363
|
style: { cursor: a ? "move" : void 0 },
|
|
362
|
-
...
|
|
363
|
-
children: [/* @__PURE__ */
|
|
364
|
+
...c,
|
|
365
|
+
children: [/* @__PURE__ */ J("circle", {
|
|
364
366
|
cx: n,
|
|
365
367
|
cy: r,
|
|
366
368
|
r: 8,
|
|
367
369
|
pointerEvents: "visibleFill",
|
|
368
|
-
...
|
|
370
|
+
...l,
|
|
369
371
|
fill: a?.isDragging ? "white" : "transparent",
|
|
370
372
|
fillOpacity: a?.isDragging ? .3 : 1,
|
|
371
373
|
strokeWidth: 1
|
|
372
|
-
}, `${t}-handle-${i}`), /* @__PURE__ */
|
|
374
|
+
}, `${t}-handle-${i}`), /* @__PURE__ */ J("circle", {
|
|
373
375
|
cx: n,
|
|
374
376
|
cy: r,
|
|
375
377
|
r: 16,
|
|
@@ -388,7 +390,7 @@ function Pt(e) {
|
|
|
388
390
|
yMin: a,
|
|
389
391
|
yMax: a,
|
|
390
392
|
...u
|
|
391
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ J(xe, {
|
|
392
394
|
width: n.width,
|
|
393
395
|
height: n.height,
|
|
394
396
|
x: i,
|
|
@@ -401,7 +403,7 @@ function Pt(e) {
|
|
|
401
403
|
console.debug("DE:", e, t, "; delta:", n, i, "; drag:", a), o?.(r, [(e ?? 0) + n, (t ?? 0) + i], !1);
|
|
402
404
|
},
|
|
403
405
|
restrict: u,
|
|
404
|
-
children: (e) => /* @__PURE__ */
|
|
406
|
+
children: (e) => /* @__PURE__ */ J(Nt, {
|
|
405
407
|
n: t,
|
|
406
408
|
i: r,
|
|
407
409
|
nx: i,
|
|
@@ -411,26 +413,25 @@ function Pt(e) {
|
|
|
411
413
|
})
|
|
412
414
|
});
|
|
413
415
|
}
|
|
414
|
-
|
|
415
|
-
//#region src/shapes/DvdAxisBox.tsx
|
|
416
|
+
// src/shapes/DvdAxisBox.tsx
|
|
416
417
|
function Ft(e) {
|
|
417
|
-
let { size: t, coords: n, isFixed: r, axis: i, onHandleChange: a, ...o } = e,
|
|
418
|
-
|
|
419
|
-
new
|
|
420
|
-
new
|
|
421
|
-
new
|
|
422
|
-
new
|
|
423
|
-
new
|
|
418
|
+
let { size: t, coords: n, isFixed: r, axis: i, onHandleChange: a, ...o } = e, c = [n[0].getComponent(i), n[1].getComponent(i)], l = Math.min(c[0], c[1]), u = Math.max(c[0], c[1]), d;
|
|
419
|
+
d = i === 0 ? [
|
|
420
|
+
new K(l, t.height),
|
|
421
|
+
new K(l, 0),
|
|
422
|
+
new K(u, 0),
|
|
423
|
+
new K(u, t.height),
|
|
424
|
+
new K((l + u) / 2, t.height / 2)
|
|
424
425
|
] : [
|
|
425
|
-
new
|
|
426
|
-
new
|
|
427
|
-
new
|
|
428
|
-
new
|
|
429
|
-
new
|
|
426
|
+
new K(0, u),
|
|
427
|
+
new K(t.width, u),
|
|
428
|
+
new K(t.width, l),
|
|
429
|
+
new K(0, l),
|
|
430
|
+
new K(t.width / 2, (l + u) / 2)
|
|
430
431
|
];
|
|
431
|
-
let
|
|
432
|
+
let f = s(() => d.map((e, n) => {
|
|
432
433
|
let r = `'axisbox-drag-${n}`;
|
|
433
|
-
return /* @__PURE__ */
|
|
434
|
+
return /* @__PURE__ */ J(Pt, {
|
|
434
435
|
name: r,
|
|
435
436
|
size: t,
|
|
436
437
|
i: n,
|
|
@@ -442,64 +443,63 @@ function Ft(e) {
|
|
|
442
443
|
...o
|
|
443
444
|
}, r);
|
|
444
445
|
}), [
|
|
445
|
-
|
|
446
|
+
d,
|
|
446
447
|
t,
|
|
447
448
|
a,
|
|
448
449
|
i,
|
|
449
450
|
o
|
|
450
451
|
]);
|
|
451
|
-
|
|
452
|
-
let
|
|
453
|
-
return /* @__PURE__ */ q
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
points:
|
|
452
|
+
d.pop();
|
|
453
|
+
let p = s(() => d.map((e) => `${e.x},${e.y}`).join(" "), [d]);
|
|
454
|
+
return /* @__PURE__ */ Y(q, { children: [
|
|
455
|
+
/* @__PURE__ */ J("polygon", {
|
|
456
|
+
points: p,
|
|
456
457
|
...o,
|
|
457
458
|
stroke: "none"
|
|
458
459
|
}),
|
|
459
|
-
!r &&
|
|
460
|
-
i === 0 && /* @__PURE__ */ q
|
|
461
|
-
x1:
|
|
460
|
+
!r && f,
|
|
461
|
+
i === 0 && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("line", {
|
|
462
|
+
x1: l,
|
|
462
463
|
y1: 0,
|
|
463
|
-
x2:
|
|
464
|
+
x2: l,
|
|
464
465
|
y2: t.height,
|
|
465
466
|
stroke: o.fill,
|
|
466
467
|
strokeDasharray: o.strokeDasharray
|
|
467
|
-
}), /* @__PURE__ */
|
|
468
|
-
x1:
|
|
468
|
+
}), /* @__PURE__ */ J("line", {
|
|
469
|
+
x1: u,
|
|
469
470
|
y1: 0,
|
|
470
|
-
x2:
|
|
471
|
+
x2: u,
|
|
471
472
|
y2: t.height,
|
|
472
473
|
stroke: o.fill,
|
|
473
474
|
strokeDasharray: o.strokeDasharray
|
|
474
475
|
})] }),
|
|
475
|
-
i !== 0 && /* @__PURE__ */ q
|
|
476
|
+
i !== 0 && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("line", {
|
|
476
477
|
x1: 0,
|
|
477
|
-
y1:
|
|
478
|
+
y1: l,
|
|
478
479
|
x2: t.width,
|
|
479
|
-
y2:
|
|
480
|
+
y2: l,
|
|
480
481
|
stroke: o.fill,
|
|
481
482
|
strokeDasharray: o.strokeDasharray
|
|
482
|
-
}), /* @__PURE__ */
|
|
483
|
+
}), /* @__PURE__ */ J("line", {
|
|
483
484
|
x1: 0,
|
|
484
|
-
y1:
|
|
485
|
+
y1: u,
|
|
485
486
|
x2: t.width,
|
|
486
|
-
y2:
|
|
487
|
+
y2: u,
|
|
487
488
|
stroke: o.fill,
|
|
488
489
|
strokeDasharray: o.strokeDasharray
|
|
489
490
|
})] })
|
|
490
491
|
] });
|
|
491
492
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var It = 10, Lt = 20, Rt = new U().identity().rotate(Math.PI / 2).multiplyScalar(Math.sin(Math.PI / 3));
|
|
493
|
+
// src/shapes/DvdPolyline.tsx
|
|
494
|
+
var It = 10, Lt = 20, Rt = new G().identity().rotate(Math.PI / 2).multiplyScalar(Math.sin(Math.PI / 3));
|
|
495
495
|
function zt(e, t) {
|
|
496
|
-
let n = new
|
|
496
|
+
let n = new K().subVectors(t, e), r = Math.hypot(n.x, n.y), i = n.clone().multiplyScalar(.5 + Lt / r);
|
|
497
497
|
n.multiplyScalar(It / r);
|
|
498
498
|
let a, o;
|
|
499
499
|
if (r > 40) {
|
|
500
|
-
let t = new
|
|
501
|
-
a = new
|
|
502
|
-
} else a = t, o = new
|
|
500
|
+
let t = new K().addVectors(e, i);
|
|
501
|
+
a = new K().subVectors(t, n), o = t.add(n);
|
|
502
|
+
} else a = t, o = new K().addVectors(t, n);
|
|
503
503
|
let s = n.applyMatrix3(Rt).add(a);
|
|
504
504
|
return [
|
|
505
505
|
a,
|
|
@@ -508,9 +508,9 @@ function zt(e, t) {
|
|
|
508
508
|
].map((e) => `${e.x},${e.y}`).join(" ");
|
|
509
509
|
}
|
|
510
510
|
function Bt(e) {
|
|
511
|
-
let { size: t, coords: n, isClosed: r = !1, isFixed: i, onHandleChange: a, ...o } = e,
|
|
511
|
+
let { size: t, coords: n, isClosed: r = !1, isFixed: i, onHandleChange: a, ...o } = e, c = n.slice(0, -1), l = s(() => n.map((e, n) => {
|
|
512
512
|
let i = `${r ? "polygon" : "polyline"}-drag-${n}`;
|
|
513
|
-
return /* @__PURE__ */
|
|
513
|
+
return /* @__PURE__ */ J(Pt, {
|
|
514
514
|
name: i,
|
|
515
515
|
size: t,
|
|
516
516
|
i: n,
|
|
@@ -525,26 +525,25 @@ function Bt(e) {
|
|
|
525
525
|
t,
|
|
526
526
|
a,
|
|
527
527
|
o
|
|
528
|
-
]),
|
|
529
|
-
return /* @__PURE__ */ q
|
|
530
|
-
r ? /* @__PURE__ */
|
|
531
|
-
points:
|
|
528
|
+
]), u = s(() => c.map((e) => `${e.x},${e.y}`).join(" "), [c]), d = s(() => zt(n[0], n[1]), [n]);
|
|
529
|
+
return /* @__PURE__ */ Y(q, { children: [
|
|
530
|
+
r ? /* @__PURE__ */ J("polygon", {
|
|
531
|
+
points: u,
|
|
532
532
|
...o
|
|
533
|
-
}) : /* @__PURE__ */
|
|
534
|
-
points:
|
|
533
|
+
}) : /* @__PURE__ */ J("polyline", {
|
|
534
|
+
points: u,
|
|
535
535
|
...o,
|
|
536
536
|
fill: "none"
|
|
537
537
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
points:
|
|
538
|
+
/* @__PURE__ */ J("polygon", {
|
|
539
|
+
points: d,
|
|
540
540
|
...o,
|
|
541
541
|
fill: o.stroke
|
|
542
542
|
}),
|
|
543
|
-
!i &&
|
|
543
|
+
!i && l
|
|
544
544
|
] });
|
|
545
545
|
}
|
|
546
|
-
|
|
547
|
-
//#region src/selections/BaseSelection.tsx
|
|
546
|
+
// src/selections/BaseSelection.tsx
|
|
548
547
|
var Vt = class e {
|
|
549
548
|
id;
|
|
550
549
|
name = "";
|
|
@@ -552,11 +551,12 @@ var Vt = class e {
|
|
|
552
551
|
colour;
|
|
553
552
|
alpha = .3;
|
|
554
553
|
fixed = !1;
|
|
554
|
+
permanent = !1;
|
|
555
555
|
start;
|
|
556
556
|
_asDashed;
|
|
557
557
|
_vStart;
|
|
558
558
|
constructor(e) {
|
|
559
|
-
this.id = crypto.randomUUID().slice(-8), this.start = e, this._vStart = new
|
|
559
|
+
this.id = crypto.randomUUID().slice(-8), this.start = e, this._vStart = new K(...e);
|
|
560
560
|
}
|
|
561
561
|
toString() {
|
|
562
562
|
return "";
|
|
@@ -568,7 +568,7 @@ var Vt = class e {
|
|
|
568
568
|
return [this._vStart.clone()];
|
|
569
569
|
}
|
|
570
570
|
setProperties(e) {
|
|
571
|
-
this.id = e.id, this.name = e.name, this.colour = e.colour, this.alpha = e.alpha, this._asDashed = e._asDashed, this.fixed = e.fixed;
|
|
571
|
+
this.id = e.id, this.name = e.name, this.colour = e.colour, this.alpha = e.alpha, this._asDashed = e._asDashed, this.fixed = e.fixed, this.permanent = e.permanent;
|
|
572
572
|
}
|
|
573
573
|
static createFromSelection(t) {
|
|
574
574
|
let n = new e([...t.start]);
|
|
@@ -594,7 +594,7 @@ var Vt = class e {
|
|
|
594
594
|
super(e), this.length = t, this.dimension = n, this.colour = this._defaultColour;
|
|
595
595
|
}
|
|
596
596
|
_getPoint(e = 1) {
|
|
597
|
-
let t = new
|
|
597
|
+
let t = new K(0, 0, 1);
|
|
598
598
|
return t.setComponent(this.dimension, this.length * e), t.add(this._vStart);
|
|
599
599
|
}
|
|
600
600
|
getPoints() {
|
|
@@ -672,9 +672,9 @@ var Vt = class e {
|
|
|
672
672
|
return "radii" in e;
|
|
673
673
|
}
|
|
674
674
|
static createFromPoints(t) {
|
|
675
|
-
let n = t[0], r = Zt(new
|
|
675
|
+
let n = t[0], r = Zt(new K().subVectors(t[1], n)), i = r[0], a = r[1], o = i, s = a;
|
|
676
676
|
if (t.length > 2) {
|
|
677
|
-
let e = Zt(new
|
|
677
|
+
let e = Zt(new K().subVectors(t[2], n));
|
|
678
678
|
o = e[0], s = e[1];
|
|
679
679
|
}
|
|
680
680
|
let c = i < o ? [i, o] : [o, i], l = a < s ? [a, s] : [s, a];
|
|
@@ -689,10 +689,10 @@ var Vt = class e {
|
|
|
689
689
|
_transform;
|
|
690
690
|
_invTransform;
|
|
691
691
|
constructor(e, t = 0) {
|
|
692
|
-
super(e), this.angle = t, this._transform = new
|
|
692
|
+
super(e), this.angle = t, this._transform = new G().identity().rotate(-this.angle), this._invTransform = new G().identity().rotate(this.angle);
|
|
693
693
|
}
|
|
694
694
|
setAngle(e) {
|
|
695
|
-
this.angle = e, this._transform = new
|
|
695
|
+
this.angle = e, this._transform = new G().identity().rotate(-this.angle), this._invTransform = new G().identity().rotate(this.angle);
|
|
696
696
|
}
|
|
697
697
|
static isShape(e) {
|
|
698
698
|
return "_transform" in e;
|
|
@@ -710,9 +710,9 @@ var Vt = class e {
|
|
|
710
710
|
return "semiAxes" in e;
|
|
711
711
|
}
|
|
712
712
|
static createFromPoints(t) {
|
|
713
|
-
let n = t[0], r = new
|
|
713
|
+
let n = t[0], r = new K().subVectors(t[1], n);
|
|
714
714
|
if (t.length < 3) return new e([n.x, n.y], [Math.abs(r.x), Math.abs(r.y)]);
|
|
715
|
-
let i = Zt(r), a = i[0], o = new
|
|
715
|
+
let i = Zt(r), a = i[0], o = new K().subVectors(t[2], n), s = Math.hypot(o.x, o.y), c = a < s ? [a, s] : [s, a];
|
|
716
716
|
return new e([n.x, n.y], c, i[1]);
|
|
717
717
|
}
|
|
718
718
|
static createFromSelection(t) {
|
|
@@ -726,7 +726,7 @@ var Vt = class e {
|
|
|
726
726
|
super(e, n), this.length = t, this.colour = this._defaultColour;
|
|
727
727
|
}
|
|
728
728
|
_getPoint(e = 1) {
|
|
729
|
-
return new
|
|
729
|
+
return new K(this.length * e, 0, 1).applyMatrix3(this._transform).add(this._vStart);
|
|
730
730
|
}
|
|
731
731
|
getPoints() {
|
|
732
732
|
return [
|
|
@@ -748,7 +748,7 @@ var Vt = class e {
|
|
|
748
748
|
_setFromPoints(e) {
|
|
749
749
|
let t = e[0];
|
|
750
750
|
this.start = [t.x, t.y], this._vStart.x = t.x, this._vStart.y = t.y;
|
|
751
|
-
let n = Zt(new
|
|
751
|
+
let n = Zt(new K().subVectors(e[1], t));
|
|
752
752
|
this.length = n[0], this.setAngle(n[1]);
|
|
753
753
|
}
|
|
754
754
|
static createFromPoints(t) {
|
|
@@ -782,7 +782,7 @@ var Vt = class e {
|
|
|
782
782
|
super(e[0]), this.points = e, this.closed = !!t, this.colour = this.closed ? this._defaultClosedColour : this._defaultOpenColour;
|
|
783
783
|
}
|
|
784
784
|
getPoints() {
|
|
785
|
-
let e = this.points.map((e) => new
|
|
785
|
+
let e = this.points.map((e) => new K(...e)), t = new K();
|
|
786
786
|
return e.forEach((e) => {
|
|
787
787
|
t.add(e);
|
|
788
788
|
}), t.divideScalar(e.length), [...e, t];
|
|
@@ -791,12 +791,12 @@ var Vt = class e {
|
|
|
791
791
|
let t = this.points.length;
|
|
792
792
|
if (e < t) {
|
|
793
793
|
let t = this.points[e];
|
|
794
|
-
return new
|
|
794
|
+
return new K(t[0], t[1]);
|
|
795
795
|
}
|
|
796
796
|
if (e == t) {
|
|
797
|
-
let e = new
|
|
797
|
+
let e = new K();
|
|
798
798
|
return this.points.forEach((t) => {
|
|
799
|
-
e.add(new
|
|
799
|
+
e.add(new K(t[0], t[1]));
|
|
800
800
|
}), e.divideScalar(t), e;
|
|
801
801
|
}
|
|
802
802
|
return null;
|
|
@@ -849,19 +849,19 @@ var Vt = class e {
|
|
|
849
849
|
let t = null;
|
|
850
850
|
switch (e) {
|
|
851
851
|
case 0:
|
|
852
|
-
t = new
|
|
852
|
+
t = new K(0, 0, 1);
|
|
853
853
|
break;
|
|
854
854
|
case 1:
|
|
855
|
-
t = new
|
|
855
|
+
t = new K(this.lengths[0], 0, 1);
|
|
856
856
|
break;
|
|
857
857
|
case 2:
|
|
858
|
-
t = new
|
|
858
|
+
t = new K(...this.lengths, 1);
|
|
859
859
|
break;
|
|
860
860
|
case 3:
|
|
861
|
-
t = new
|
|
861
|
+
t = new K(0, this.lengths[1], 1);
|
|
862
862
|
break;
|
|
863
863
|
case 4:
|
|
864
|
-
t = new
|
|
864
|
+
t = new K(this.lengths[0] * .5, this.lengths[1] * .5, 1);
|
|
865
865
|
break;
|
|
866
866
|
default: return null;
|
|
867
867
|
}
|
|
@@ -879,7 +879,7 @@ var Vt = class e {
|
|
|
879
879
|
return "lengths" in e;
|
|
880
880
|
}
|
|
881
881
|
static createFromPoints(t, n) {
|
|
882
|
-
let r = n[0].clone(), i = new
|
|
882
|
+
let r = n[0].clone(), i = new K().subVectors(n[1], r), a = 0, o = i.x, s = i.y;
|
|
883
883
|
return o < 0 === t[0] ? s < 0 !== t[1] && (a = -Math.PI / 2, i.y = i.x, i.x = -s) : (i.x = -o, s < 0 === t[1] ? (a = Math.PI / 2, i.y = i.x, i.x = s) : (a = Math.PI, i.y = -s)), new e([r.x, r.y], [i.x, i.y], a);
|
|
884
884
|
}
|
|
885
885
|
static createFromSelection(t) {
|
|
@@ -891,21 +891,21 @@ var Vt = class e {
|
|
|
891
891
|
if (i !== null) {
|
|
892
892
|
let e = n[0] ?? 0, a = n[1] ?? 0;
|
|
893
893
|
if (t === 4) {
|
|
894
|
-
let t = new
|
|
894
|
+
let t = new K(e, a).sub(i), n = r._vStart;
|
|
895
895
|
return n.x += t.x, n.y += t.y, r.start[0] = n.x, r.start[1] = n.y, r;
|
|
896
896
|
}
|
|
897
|
-
let o = new
|
|
897
|
+
let o = new K(e, a).sub(i).applyMatrix3(this._invTransform), [s, c] = r.lengths, l, u;
|
|
898
898
|
t === 2 ? (l = Math.max(0, s + o.x), u = Math.max(0, c + o.y)) : (l = Math.max(0, s - o.x), u = Math.max(0, c - o.y));
|
|
899
899
|
let d;
|
|
900
900
|
switch (t) {
|
|
901
901
|
case 0:
|
|
902
|
-
d = new
|
|
902
|
+
d = new K(s - l, c - u);
|
|
903
903
|
break;
|
|
904
904
|
case 1:
|
|
905
|
-
d = new
|
|
905
|
+
d = new K(0, c - u), l = Math.max(0, s + o.x);
|
|
906
906
|
break;
|
|
907
907
|
case 2: break;
|
|
908
|
-
case 3: d = new
|
|
908
|
+
case 3: d = new K(s - l), u = Math.max(0, c + o.y);
|
|
909
909
|
}
|
|
910
910
|
d !== void 0 && (d.applyMatrix3(this._transform).add(this._vStart), r.start[0] = d.x, r.start[1] = d.y, r._vStart.x = d.x, r._vStart.y = d.y), r.lengths[0] = l, r.lengths[1] = u;
|
|
911
911
|
}
|
|
@@ -975,7 +975,7 @@ function an(e, t, n, r, i, a, o, s) {
|
|
|
975
975
|
};
|
|
976
976
|
switch (e) {
|
|
977
977
|
case "rectangle":
|
|
978
|
-
case "polygon": return /* @__PURE__ */
|
|
978
|
+
case "polygon": return /* @__PURE__ */ J(z, { children: /* @__PURE__ */ J(Bt, {
|
|
979
979
|
size: r,
|
|
980
980
|
coords: t,
|
|
981
981
|
isClosed: !0,
|
|
@@ -985,7 +985,7 @@ function an(e, t, n, r, i, a, o, s) {
|
|
|
985
985
|
...c
|
|
986
986
|
}) });
|
|
987
987
|
case "horizontalAxis":
|
|
988
|
-
case "verticalAxis": return /* @__PURE__ */
|
|
988
|
+
case "verticalAxis": return /* @__PURE__ */ J(z, { children: /* @__PURE__ */ J(Ft, {
|
|
989
989
|
size: r,
|
|
990
990
|
coords: t,
|
|
991
991
|
strokeDasharray: a ? "10, 10" : void 0,
|
|
@@ -995,7 +995,7 @@ function an(e, t, n, r, i, a, o, s) {
|
|
|
995
995
|
...c
|
|
996
996
|
}) });
|
|
997
997
|
case "line":
|
|
998
|
-
case "polyline": return /* @__PURE__ */
|
|
998
|
+
case "polyline": return /* @__PURE__ */ J(z, { children: /* @__PURE__ */ J(Bt, {
|
|
999
999
|
size: r,
|
|
1000
1000
|
coords: t,
|
|
1001
1001
|
strokeDasharray: a ? "10, 10" : void 0,
|
|
@@ -1011,29 +1011,27 @@ function on(e, t, n, r, i, a) {
|
|
|
1011
1011
|
return an(e, o.getPoints(), r, i, a ?? o.colour ?? o._defaultColour, void 0, !0);
|
|
1012
1012
|
}
|
|
1013
1013
|
function sn(e) {
|
|
1014
|
-
let { size: t, selection: n, updateSelection:
|
|
1015
|
-
let n =
|
|
1014
|
+
let { size: t, selection: n, updateSelection: i, showHandles: a } = e, o = Qt(n), { htmlToData: s } = ce(), c = me((e) => e.camera), l = r((e, t) => {
|
|
1015
|
+
let n = s(c, new K(e, t));
|
|
1016
1016
|
return [n.x, n.y];
|
|
1017
|
-
}, [
|
|
1017
|
+
}, [s, c]), u = r((e) => {
|
|
1018
1018
|
let t = e.onHandleChange.bind(e);
|
|
1019
|
-
return (e, n,
|
|
1020
|
-
let a =
|
|
1021
|
-
console.debug("UH:", e, n, a);
|
|
1022
|
-
let o = t(e, a);
|
|
1023
|
-
return r(o, i), o;
|
|
1019
|
+
return (e, n, r = !0) => {
|
|
1020
|
+
let a = l(n[0], n[1]), o = t(e, a);
|
|
1021
|
+
return console.debug("UH:", e, n, a), i(o, r), o;
|
|
1024
1022
|
};
|
|
1025
|
-
}, [
|
|
1026
|
-
if (
|
|
1023
|
+
}, [i, l]);
|
|
1024
|
+
if (o !== "unknown") {
|
|
1027
1025
|
let e = n.getPoints();
|
|
1028
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ J(y, {
|
|
1029
1027
|
points: e,
|
|
1030
|
-
children: (...e) => an(
|
|
1028
|
+
children: (...e) => an(o, e, n.alpha, t, n.colour ?? n._defaultColour, n._asDashed, n.fixed || !a, u(n))
|
|
1031
1029
|
}, n.id);
|
|
1032
1030
|
}
|
|
1033
1031
|
return console.error("Unknown selection type or has no points getter", n), null;
|
|
1034
1032
|
}
|
|
1035
1033
|
function cn(e, t, n, r) {
|
|
1036
|
-
return r && t.map((t) => /* @__PURE__ */
|
|
1034
|
+
return r && t.map((t) => /* @__PURE__ */ J(sn, {
|
|
1037
1035
|
size: e,
|
|
1038
1036
|
selection: t,
|
|
1039
1037
|
updateSelection: r,
|
|
@@ -1047,28 +1045,37 @@ function un(e, t, n) {
|
|
|
1047
1045
|
return ln(e.find((e) => e.id === t) ?? null, n);
|
|
1048
1046
|
}
|
|
1049
1047
|
function dn(e, t) {
|
|
1050
|
-
return
|
|
1048
|
+
return d.fromPoints(...e).hasMinSize(t === "horizontalAxis" || t === "verticalAxis" ? 0 : 20);
|
|
1051
1049
|
}
|
|
1052
1050
|
var fn = /* @__PURE__ */ function(e) {
|
|
1053
1051
|
return e.created = "created", e.removed = "removed", e.updated = "updated", e;
|
|
1054
1052
|
}(fn || {});
|
|
1055
1053
|
function pn(e, t) {
|
|
1056
|
-
let [n,
|
|
1054
|
+
let [n, i] = l(e ?? []), o = c(!1), [s, u] = l(!0), d = c(), f = (e) => {
|
|
1055
|
+
d.current = e;
|
|
1056
|
+
};
|
|
1057
|
+
a(() => {
|
|
1058
|
+
t !== void 0 && (d.current = t);
|
|
1059
|
+
}, [t, d]);
|
|
1060
|
+
let [p, m] = l(!0);
|
|
1057
1061
|
return {
|
|
1058
1062
|
selections: n,
|
|
1059
|
-
setSelections:
|
|
1060
|
-
isNewSelection:
|
|
1061
|
-
updateSelection:
|
|
1062
|
-
let
|
|
1063
|
-
return e ? (
|
|
1064
|
-
let
|
|
1065
|
-
if (
|
|
1066
|
-
let
|
|
1067
|
-
return console.debug("Replacing",
|
|
1068
|
-
})) :
|
|
1069
|
-
}, [
|
|
1070
|
-
canSelect:
|
|
1071
|
-
enableSelect:
|
|
1063
|
+
setSelections: i,
|
|
1064
|
+
isNewSelection: o,
|
|
1065
|
+
updateSelection: r((e, t = !1, n = !1) => {
|
|
1066
|
+
let r = null;
|
|
1067
|
+
return e ? (r = e.id, n ? (console.debug("Clearing selection:", r), i((e) => e.filter((e) => e.id !== r)), d.current?.("removed", t, e)) : i((n) => {
|
|
1068
|
+
let i = n.findIndex((e) => e.id === r);
|
|
1069
|
+
if (o.current = i === -1, o.current) return d.current?.("created", t, e), [...n, e];
|
|
1070
|
+
let a = [...n];
|
|
1071
|
+
return console.debug("Replacing", a[i], "with", e), a[i] = e, d.current?.("updated", t, e), a;
|
|
1072
|
+
})) : n && (console.debug("Clearing selections"), i((e) => e.filter((e) => e.permanent))), r;
|
|
1073
|
+
}, [i]),
|
|
1074
|
+
canSelect: s,
|
|
1075
|
+
enableSelect: u,
|
|
1076
|
+
setSelectionsListener: f,
|
|
1077
|
+
editable: p,
|
|
1078
|
+
setEditable: m
|
|
1072
1079
|
};
|
|
1073
1080
|
}
|
|
1074
1081
|
function mn(e) {
|
|
@@ -1077,197 +1084,248 @@ function mn(e) {
|
|
|
1077
1084
|
function hn(e) {
|
|
1078
1085
|
e._asDashed = !0;
|
|
1079
1086
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
function gn(e) {
|
|
1083
|
-
let { disabled: t = !1, selectionMax: n = 0, selectionType: r = Z.rectangle, selections: i = [], updateSelection: a, batonProps: o } = e, s = .3, { canvasBox: c, dataToHtml: l } = se(), u = c.size, d = B(() => {
|
|
1084
|
-
if (a != null) return cn(u, i, o?.hasBaton ?? !0, a);
|
|
1085
|
-
}, [
|
|
1086
|
-
u,
|
|
1087
|
-
i,
|
|
1088
|
-
a,
|
|
1089
|
-
o?.hasBaton
|
|
1090
|
-
]), f = ge((e) => e.camera), p = B(() => {
|
|
1091
|
-
let e = l(f, new W(0, 0)), t = l(f, new W(1, 1)).sub(e);
|
|
1092
|
-
return [t.x < 0, t.y < 0];
|
|
1093
|
-
}, [f, l]), m = B(() => n !== 0 && i.reduce((e, t) => e + +(Qt(t) === r), 0) >= n, [
|
|
1094
|
-
n,
|
|
1095
|
-
r,
|
|
1096
|
-
i
|
|
1097
|
-
]), h = B(() => nn(r), [r]);
|
|
1098
|
-
return /* @__PURE__ */ q(G, { children: [a && (o?.hasBaton ?? !0) && !t && !m && /* @__PURE__ */ K(Mt, {
|
|
1099
|
-
modifierKey: e.modifierKey,
|
|
1100
|
-
validate: ({ html: e }) => dn(e, r),
|
|
1101
|
-
onValidSelection: ({ data: e }) => {
|
|
1102
|
-
let t = rn(i, r, e, s);
|
|
1103
|
-
return a(t);
|
|
1104
|
-
},
|
|
1105
|
-
minPoints: h[0],
|
|
1106
|
-
maxPoints: h[1],
|
|
1107
|
-
children: ({ html: e }, t, n) => on(r, e, p, s, u, n ? void 0 : "#cc6677")
|
|
1108
|
-
}), d] });
|
|
1109
|
-
}
|
|
1110
|
-
//#endregion
|
|
1111
|
-
//#region src/models.ts
|
|
1112
|
-
var _n = {
|
|
1087
|
+
// src/models.ts
|
|
1088
|
+
var gn = {
|
|
1113
1089
|
uuid: "",
|
|
1114
1090
|
batonUuid: "",
|
|
1115
1091
|
others: [],
|
|
1116
1092
|
hasBaton: !0,
|
|
1117
1093
|
requestBaton: () => {},
|
|
1118
1094
|
offerBaton: (e) => {}
|
|
1119
|
-
},
|
|
1120
|
-
function
|
|
1121
|
-
return
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1095
|
+
}, _n = n({ batonProps: gn });
|
|
1096
|
+
function vn() {
|
|
1097
|
+
return i(_n);
|
|
1098
|
+
}
|
|
1099
|
+
function yn(e) {
|
|
1100
|
+
let [t, n] = l(gn), r = {
|
|
1101
|
+
batonProps: t,
|
|
1102
|
+
setBatonProps: n
|
|
1103
|
+
};
|
|
1104
|
+
return /* @__PURE__ */ J(_n.Provider, {
|
|
1105
|
+
value: r,
|
|
1106
|
+
children: e.children
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
// src/SelectionComponent.tsx
|
|
1110
|
+
function bn(e) {
|
|
1111
|
+
let { selectionMax: t = 0, selectionType: n = Z.rectangle, selections: r = [], updateSelection: i, modifierKey: a, disabled: o = !1 } = e, { batonProps: c } = vn(), l = c.hasBaton, u = .3, { canvasBox: d, dataToHtml: f } = ce(), p = d.size, m = s(() => cn(p, r, l, i), [
|
|
1112
|
+
p,
|
|
1113
|
+
r,
|
|
1114
|
+
i,
|
|
1115
|
+
l
|
|
1116
|
+
]), h = me((e) => e.camera), g = s(() => {
|
|
1117
|
+
let e = f(h, new K(0, 0)), t = f(h, new K(1, 1)).sub(e);
|
|
1118
|
+
return [t.x < 0, t.y < 0];
|
|
1119
|
+
}, [h, f]), _ = s(() => t !== 0 && r.reduce((e, t) => e + +(Qt(t) === n), 0) >= t, [
|
|
1120
|
+
t,
|
|
1121
|
+
n,
|
|
1122
|
+
r
|
|
1123
|
+
]), v = s(() => nn(n), [n]);
|
|
1124
|
+
return /* @__PURE__ */ Y(q, { children: [i && l && !o && !_ && /* @__PURE__ */ J(Mt, {
|
|
1125
|
+
modifierKey: a,
|
|
1126
|
+
validate: ({ html: e }) => dn(e, n),
|
|
1127
|
+
onValidSelection: ({ data: e }) => {
|
|
1128
|
+
let t = rn(r, n, e, u);
|
|
1129
|
+
return i(t);
|
|
1130
|
+
},
|
|
1131
|
+
minPoints: v[0],
|
|
1132
|
+
maxPoints: v[1],
|
|
1133
|
+
children: ({ html: e }, t, r) => on(n, e, g, u, p, r ? void 0 : "#cc6677")
|
|
1134
|
+
}), m] });
|
|
1135
|
+
}
|
|
1136
|
+
// src/PlotCustomizationContext.tsx
|
|
1137
|
+
var xn = n({});
|
|
1138
|
+
function Q() {
|
|
1139
|
+
return i(xn);
|
|
1140
|
+
}
|
|
1141
|
+
var Sn = [0, 1], Cn = [null, null];
|
|
1142
|
+
function wn(e) {
|
|
1143
|
+
let [t, n] = be(), [i, o] = l(""), [c, u] = l(X.panAndWheelZoom), [d, f] = l(Z.unknown), [p, m] = l(0), [h, g] = l(Cn), [_, v] = l(Cn), [y, b] = l(""), [x, S] = l(""), [C, w] = l(P.Linear), [T, E] = l(P.Linear), [D, O] = l(Sn), [k, A] = l(Sn), [j, M] = l(Sn), [N, F] = l(Cn), [I, L] = l(P.Linear), [R, z] = l("equal"), [ee, B] = l("Greys"), [V, H] = be(), [te, ne] = be(!1), [re, U] = l(/* @__PURE__ */ new Map()), [ie, ae] = l(null), [oe, se] = l(), [ce, le] = l(10), ue = r((e) => se(() => e), [se]), [W, de] = l();
|
|
1144
|
+
if (d === Z.unknown && W !== void 0 && W) {
|
|
1145
|
+
let [e, t] = Object.entries(W)[0];
|
|
1146
|
+
e !== void 0 && t !== void 0 && (f(Xt(e)), m(t));
|
|
1147
|
+
}
|
|
1148
|
+
let fe = r((e) => {
|
|
1149
|
+
if (f(e), W) {
|
|
1150
|
+
let t = W[e];
|
|
1151
|
+
t !== void 0 && m(t);
|
|
1147
1152
|
}
|
|
1148
|
-
return z;
|
|
1149
1153
|
}, [
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
let n = new Map(
|
|
1158
|
-
n.set(e, { ...t }),
|
|
1159
|
-
}, [
|
|
1154
|
+
f,
|
|
1155
|
+
m,
|
|
1156
|
+
W
|
|
1157
|
+
]), [G, K] = l("Line"), { selections: pe, updateSelection: me, setSelections: he, canSelect: ge, enableSelect: _e, setSelectionsListener: ve, editable: ye, setEditable: q } = pn([]), [Y, xe] = l(), Se = (e) => {
|
|
1158
|
+
let { selections: t, canEditSelections: n, selectionsListener: r, selectionOptions: i } = e, a = !1;
|
|
1159
|
+
t !== void 0 && Y?.selections !== t && (he(t), a = !0), n !== void 0 && Y?.canEditSelections !== n && (q(n), a = !0), r !== void 0 && Y?.selectionsListener !== r && (ve(r), a = !0), i !== void 0 && Y?.selectionOptions !== i && (de(i), m(0), a = !0), a && xe(e);
|
|
1160
|
+
}, Ce = r((e, t) => {
|
|
1161
|
+
let n = new Map(re);
|
|
1162
|
+
n.set(e, { ...t }), U(n);
|
|
1163
|
+
}, [re]), [we, Te] = l(), Ee = (e, t, n) => {
|
|
1164
|
+
n !== void 0 && Ve(n);
|
|
1165
|
+
let r = !1;
|
|
1166
|
+
e !== void 0 && we?.xDomain !== e && (O(e), r = !0), t !== void 0 && we?.yDomain !== t && (A(t), r = !0), r && Te({
|
|
1167
|
+
xDomain: e,
|
|
1168
|
+
yDomain: t
|
|
1169
|
+
}), K("Line");
|
|
1170
|
+
}, [De, Oe] = l(), ke = (e, t) => {
|
|
1171
|
+
Ve(t);
|
|
1172
|
+
let n = e.aspect;
|
|
1173
|
+
n !== void 0 && De?.aspect !== n && (z(n), Oe({ aspect: n })), K("Image");
|
|
1174
|
+
}, [Ae, je] = l(), Me = (e, t) => {
|
|
1175
|
+
Ve(t);
|
|
1176
|
+
let { aspect: n, heatmapScale: r, colourMap: i, domain: a } = e, o = !1;
|
|
1177
|
+
n !== void 0 && Ae?.aspect !== e.aspect && (z(n), o = !0), r !== void 0 && Ae?.scale !== r && (L(r), o = !0), i !== void 0 && Ae?.colourMap !== i && (B(i), o = !0), a !== void 0 && Ae?.domain !== a && (M(a), o = !0), o && je({
|
|
1178
|
+
aspect: n,
|
|
1179
|
+
scale: r,
|
|
1180
|
+
colourMap: i,
|
|
1181
|
+
domain: a
|
|
1182
|
+
}), K("Heatmap");
|
|
1183
|
+
}, [Ne, Pe] = l(), Fe = (e, t) => {
|
|
1184
|
+
Ve(t);
|
|
1185
|
+
let { surfaceScale: n, colourMap: r, domain: i, showPoints: a } = e, o = !1;
|
|
1186
|
+
n !== void 0 && Ne?.scale !== n && (L(n), o = !0), r !== void 0 && Ne?.colourMap !== r && (B(r), o = !0), i !== void 0 && Ne?.domain !== i && (M(i), o = !0), a !== void 0 && Ne?.toggle !== a && (ne(), o = !0), o && Pe({
|
|
1187
|
+
scale: n,
|
|
1188
|
+
colourMap: r,
|
|
1189
|
+
domain: i,
|
|
1190
|
+
toggle: a
|
|
1191
|
+
}), K("Surface");
|
|
1192
|
+
}, [Ie, Le] = l(), Re = (e, t) => {
|
|
1193
|
+
Ve(t);
|
|
1194
|
+
let { colourMap: n, domain: r, pointSize: i } = e, a = !1;
|
|
1195
|
+
n !== void 0 && Ie?.colourMap !== n && (B(n), a = !0), r !== void 0 && Ie?.domain !== r && (M(r), a = !0), i !== void 0 && Ie?.pointSize !== i && (le(i), a = !0), a && Le({
|
|
1196
|
+
colourMap: n,
|
|
1197
|
+
domain: r,
|
|
1198
|
+
pointSize: i
|
|
1199
|
+
}), K("Scatter");
|
|
1200
|
+
}, [ze, Be] = l(), Ve = (e) => {
|
|
1201
|
+
let t = !1;
|
|
1202
|
+
e.title !== void 0 && ze?.title !== e.title && (o(e.title), t = !0), e.xLabel !== void 0 && ze?.xLabel !== e.xLabel && (b(e.xLabel), t = !0), e.yLabel !== void 0 && ze?.yLabel !== e.yLabel && (S(e.yLabel), t = !0), e.xScale !== void 0 && ze?.xScale !== e.xScale && (w(e.xScale), t = !0), e.yScale !== void 0 && ze?.yScale !== e.yScale && (E(e.yScale), t = !0), t && Be(e);
|
|
1203
|
+
};
|
|
1204
|
+
a(() => {
|
|
1205
|
+
_e(G !== "Surface");
|
|
1206
|
+
}, [_e, G]);
|
|
1207
|
+
let He = s(() => ({
|
|
1160
1208
|
showGrid: t,
|
|
1161
1209
|
toggleShowGrid: n,
|
|
1162
|
-
title:
|
|
1163
|
-
setTitle:
|
|
1164
|
-
mode:
|
|
1165
|
-
setMode:
|
|
1166
|
-
xLabel:
|
|
1167
|
-
setXLabel:
|
|
1168
|
-
yLabel:
|
|
1169
|
-
setYLabel:
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
xCustomDomain:
|
|
1177
|
-
setXCustomDomain:
|
|
1178
|
-
yDomain:
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1210
|
+
title: i,
|
|
1211
|
+
setTitle: o,
|
|
1212
|
+
mode: c,
|
|
1213
|
+
setMode: u,
|
|
1214
|
+
xLabel: y,
|
|
1215
|
+
setXLabel: b,
|
|
1216
|
+
yLabel: x,
|
|
1217
|
+
setYLabel: S,
|
|
1218
|
+
xScaleType: C,
|
|
1219
|
+
setXScaleType: w,
|
|
1220
|
+
yScaleType: T,
|
|
1221
|
+
setYScaleType: E,
|
|
1222
|
+
xDomain: D,
|
|
1223
|
+
setXDomain: O,
|
|
1224
|
+
xCustomDomain: h,
|
|
1225
|
+
setXCustomDomain: g,
|
|
1226
|
+
yDomain: k,
|
|
1227
|
+
setYDomain: A,
|
|
1228
|
+
yCustomDomain: _,
|
|
1229
|
+
setYCustomDomain: v,
|
|
1230
|
+
dDomain: j,
|
|
1231
|
+
setDDomain: M,
|
|
1232
|
+
dCustomDomain: N,
|
|
1233
|
+
setDCustomDomain: F,
|
|
1234
|
+
selectionOptions: W,
|
|
1235
|
+
selectionMax: p,
|
|
1236
|
+
selectionType: d,
|
|
1237
|
+
setSelectionType: fe,
|
|
1238
|
+
setSelectionsListener: ve,
|
|
1239
|
+
histogramGetter: oe,
|
|
1240
|
+
updateHistogramGetter: ue,
|
|
1190
1241
|
selections: pe,
|
|
1191
|
-
setSelections:
|
|
1192
|
-
updateSelection:
|
|
1193
|
-
allLineParams:
|
|
1194
|
-
setAllLineParams:
|
|
1195
|
-
updateLineParams:
|
|
1196
|
-
currentLineKey:
|
|
1197
|
-
setCurrentLineKey:
|
|
1198
|
-
aspect:
|
|
1199
|
-
setAspect:
|
|
1200
|
-
dScaleType:
|
|
1201
|
-
setDScaleType:
|
|
1202
|
-
colourMap:
|
|
1203
|
-
setColourMap:
|
|
1204
|
-
invertColourMap:
|
|
1205
|
-
toggleInvertColourMap:
|
|
1206
|
-
scatterPointSize:
|
|
1207
|
-
setScatterPointSize:
|
|
1208
|
-
showPoints:
|
|
1209
|
-
toggleShowPoints:
|
|
1210
|
-
canSelect:
|
|
1211
|
-
|
|
1242
|
+
setSelections: he,
|
|
1243
|
+
updateSelection: me,
|
|
1244
|
+
allLineParams: re,
|
|
1245
|
+
setAllLineParams: U,
|
|
1246
|
+
updateLineParams: Ce,
|
|
1247
|
+
currentLineKey: ie,
|
|
1248
|
+
setCurrentLineKey: ae,
|
|
1249
|
+
aspect: R,
|
|
1250
|
+
setAspect: z,
|
|
1251
|
+
dScaleType: I,
|
|
1252
|
+
setDScaleType: L,
|
|
1253
|
+
colourMap: ee,
|
|
1254
|
+
setColourMap: B,
|
|
1255
|
+
invertColourMap: V,
|
|
1256
|
+
toggleInvertColourMap: H,
|
|
1257
|
+
scatterPointSize: ce,
|
|
1258
|
+
setScatterPointSize: le,
|
|
1259
|
+
showPoints: te,
|
|
1260
|
+
toggleShowPoints: ne,
|
|
1261
|
+
canSelect: ge,
|
|
1262
|
+
canEditSelections: ye,
|
|
1263
|
+
plotType: G,
|
|
1264
|
+
updateLineContext: Ee,
|
|
1265
|
+
updateHeatmapContext: Me,
|
|
1266
|
+
updateImageContext: ke,
|
|
1267
|
+
updateScatterContext: Re,
|
|
1268
|
+
updateSurfaceContext: Fe,
|
|
1269
|
+
updateSelectionContext: Se
|
|
1212
1270
|
}), [
|
|
1271
|
+
re,
|
|
1272
|
+
R,
|
|
1273
|
+
ge,
|
|
1274
|
+
ye,
|
|
1275
|
+
ee,
|
|
1276
|
+
ie,
|
|
1213
1277
|
N,
|
|
1214
|
-
O,
|
|
1215
|
-
le,
|
|
1216
|
-
V,
|
|
1217
|
-
A,
|
|
1218
|
-
P,
|
|
1219
|
-
C,
|
|
1220
|
-
L,
|
|
1221
|
-
E,
|
|
1222
|
-
ae,
|
|
1223
|
-
ce,
|
|
1224
1278
|
j,
|
|
1225
|
-
a,
|
|
1226
|
-
he,
|
|
1227
1279
|
I,
|
|
1280
|
+
oe,
|
|
1281
|
+
ue,
|
|
1282
|
+
V,
|
|
1283
|
+
c,
|
|
1284
|
+
me,
|
|
1228
1285
|
fe,
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1286
|
+
G,
|
|
1287
|
+
W,
|
|
1288
|
+
ve,
|
|
1289
|
+
ce,
|
|
1290
|
+
p,
|
|
1291
|
+
d,
|
|
1233
1292
|
pe,
|
|
1234
|
-
|
|
1293
|
+
he,
|
|
1235
1294
|
t,
|
|
1236
|
-
ne,
|
|
1237
|
-
r,
|
|
1238
1295
|
te,
|
|
1296
|
+
i,
|
|
1297
|
+
H,
|
|
1239
1298
|
n,
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
d,
|
|
1243
|
-
ue,
|
|
1299
|
+
ne,
|
|
1300
|
+
Ce,
|
|
1244
1301
|
h,
|
|
1302
|
+
D,
|
|
1245
1303
|
y,
|
|
1246
|
-
|
|
1247
|
-
de,
|
|
1304
|
+
C,
|
|
1248
1305
|
_,
|
|
1249
|
-
|
|
1306
|
+
k,
|
|
1307
|
+
x,
|
|
1308
|
+
T
|
|
1250
1309
|
]);
|
|
1251
|
-
return /* @__PURE__ */
|
|
1252
|
-
value:
|
|
1310
|
+
return /* @__PURE__ */ J(xn.Provider, {
|
|
1311
|
+
value: He,
|
|
1253
1312
|
children: e.children
|
|
1254
1313
|
});
|
|
1255
1314
|
}
|
|
1256
|
-
var
|
|
1315
|
+
var Tn = {
|
|
1257
1316
|
top: "_top_cq7uz_1",
|
|
1258
1317
|
error: "_error_cq7uz_6",
|
|
1259
1318
|
label: "_label_cq7uz_14"
|
|
1260
1319
|
};
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
function h(e) {
|
|
1320
|
+
// src/LabelledInput.tsx
|
|
1321
|
+
function $(e) {
|
|
1322
|
+
let [t, n] = l(2), [r, i] = l(null), [a, o] = l(e.input), [s, u] = l(String(e.input)), d = e.submitLabel === void 0, f = e.resetButton !== !1, p = e.enableEnterKey !== !1, m = c(null), h = d && !p, g = h && t === 1 || !h && t === 0 || d && t === 1 || !d && t === 0;
|
|
1323
|
+
function _(e) {
|
|
1266
1324
|
n(0);
|
|
1267
1325
|
let t = e.currentTarget.value;
|
|
1268
|
-
|
|
1326
|
+
u(t), h && v(t);
|
|
1269
1327
|
}
|
|
1270
|
-
function
|
|
1328
|
+
function v(t) {
|
|
1271
1329
|
if (n(0), e.isValid !== void 0) {
|
|
1272
1330
|
let [r, c] = e.isValid(t ?? s);
|
|
1273
1331
|
if (r) {
|
|
@@ -1280,49 +1338,49 @@ function Q(e) {
|
|
|
1280
1338
|
e.updateValue(n), o(n), i(r);
|
|
1281
1339
|
}
|
|
1282
1340
|
}
|
|
1283
|
-
let
|
|
1284
|
-
|
|
1341
|
+
let y = (e) => {
|
|
1342
|
+
p && e.key === "Enter" && v(m.current?.value);
|
|
1285
1343
|
};
|
|
1286
|
-
function
|
|
1344
|
+
function b() {
|
|
1287
1345
|
n(0), console.log("previous value is ", r), r !== null && (n(2), e.updateValue(r), o(r), console.log("setting value, ", r));
|
|
1288
1346
|
}
|
|
1289
|
-
return /* @__PURE__ */
|
|
1290
|
-
className:
|
|
1347
|
+
return /* @__PURE__ */ J(q, { children: /* @__PURE__ */ Y("div", {
|
|
1348
|
+
className: Tn.top,
|
|
1291
1349
|
children: [
|
|
1292
|
-
t === 1 && /* @__PURE__ */
|
|
1293
|
-
className:
|
|
1350
|
+
t === 1 && /* @__PURE__ */ Y("div", {
|
|
1351
|
+
className: Tn.error,
|
|
1294
1352
|
children: [
|
|
1295
1353
|
"\"",
|
|
1296
1354
|
s,
|
|
1297
1355
|
"\" is invalid"
|
|
1298
1356
|
]
|
|
1299
1357
|
}),
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
className:
|
|
1358
|
+
/* @__PURE__ */ Y("label", {
|
|
1359
|
+
className: Tn.label,
|
|
1302
1360
|
htmlFor: "labelled-input",
|
|
1303
1361
|
children: [e.label, ":"]
|
|
1304
1362
|
}),
|
|
1305
|
-
|
|
1306
|
-
onClick:
|
|
1363
|
+
f && /* @__PURE__ */ J("button", {
|
|
1364
|
+
onClick: b,
|
|
1307
1365
|
disabled: e.disabled,
|
|
1308
|
-
children: /* @__PURE__ */
|
|
1366
|
+
children: /* @__PURE__ */ J(Re, {})
|
|
1309
1367
|
}),
|
|
1310
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ J("input", {
|
|
1311
1369
|
id: "labelled-input",
|
|
1312
|
-
ref:
|
|
1313
|
-
onChange:
|
|
1314
|
-
onKeyDown:
|
|
1370
|
+
ref: m,
|
|
1371
|
+
onChange: _,
|
|
1372
|
+
onKeyDown: y,
|
|
1315
1373
|
required: !0,
|
|
1316
|
-
value:
|
|
1374
|
+
value: g ? s : String(typeof a == "number" && e.decimalPlaces ? a.toPrecision(e.decimalPlaces) : a),
|
|
1317
1375
|
disabled: e.disabled,
|
|
1318
1376
|
onBlur: () => {
|
|
1319
|
-
|
|
1377
|
+
v(m.current?.value);
|
|
1320
1378
|
},
|
|
1321
1379
|
...e.inputAttribs
|
|
1322
1380
|
}),
|
|
1323
|
-
!
|
|
1381
|
+
!d && /* @__PURE__ */ J("button", {
|
|
1324
1382
|
onClick: () => {
|
|
1325
|
-
|
|
1383
|
+
v(void 0);
|
|
1326
1384
|
},
|
|
1327
1385
|
disabled: e.disabled,
|
|
1328
1386
|
children: e.submitLabel
|
|
@@ -1330,128 +1388,126 @@ function Q(e) {
|
|
|
1330
1388
|
]
|
|
1331
1389
|
}) });
|
|
1332
1390
|
}
|
|
1333
|
-
var
|
|
1334
|
-
modal: "
|
|
1335
|
-
modal_content: "
|
|
1336
|
-
modal_header: "
|
|
1337
|
-
modal_footer: "
|
|
1338
|
-
modal_title: "
|
|
1339
|
-
modal_body: "
|
|
1340
|
-
close_button: "
|
|
1341
|
-
aspect: "
|
|
1342
|
-
btn: "
|
|
1391
|
+
var En = {
|
|
1392
|
+
modal: "_modal_1tg1a_1",
|
|
1393
|
+
modal_content: "_modal_content_1tg1a_7",
|
|
1394
|
+
modal_header: "_modal_header_1tg1a_16",
|
|
1395
|
+
modal_footer: "_modal_footer_1tg1a_17",
|
|
1396
|
+
modal_title: "_modal_title_1tg1a_22",
|
|
1397
|
+
modal_body: "_modal_body_1tg1a_26",
|
|
1398
|
+
close_button: "_close_button_1tg1a_36",
|
|
1399
|
+
aspect: "_aspect_1tg1a_42",
|
|
1400
|
+
btn: "_btn_1tg1a_48"
|
|
1343
1401
|
};
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
_e(r, (e) => {
|
|
1402
|
+
// src/Modal.tsx
|
|
1403
|
+
function Dn(e) {
|
|
1404
|
+
let { title: n, hideToggle: r = !1 } = e, i = c(null), [a, o] = l(!1);
|
|
1405
|
+
he(i, (e) => {
|
|
1349
1406
|
e.stopPropagation();
|
|
1350
|
-
}),
|
|
1351
|
-
|
|
1407
|
+
}), ge("Escape", () => {
|
|
1408
|
+
o(!1);
|
|
1352
1409
|
});
|
|
1353
|
-
let
|
|
1354
|
-
title:
|
|
1355
|
-
className:
|
|
1356
|
-
onClick: () =>
|
|
1357
|
-
hidden:
|
|
1410
|
+
let s = n + "-toggle", u = e.button ? /* @__PURE__ */ J("button", {
|
|
1411
|
+
title: n,
|
|
1412
|
+
className: En.btn,
|
|
1413
|
+
onClick: () => o(!0),
|
|
1414
|
+
hidden: r,
|
|
1358
1415
|
children: e.button
|
|
1359
|
-
},
|
|
1360
|
-
label:
|
|
1416
|
+
}, s) : /* @__PURE__ */ J(ee, {
|
|
1417
|
+
label: n,
|
|
1361
1418
|
Icon: e.icon,
|
|
1362
1419
|
onToggle: () => {
|
|
1363
|
-
|
|
1420
|
+
o(!0);
|
|
1364
1421
|
},
|
|
1365
1422
|
value: !1,
|
|
1366
|
-
hidden:
|
|
1367
|
-
},
|
|
1368
|
-
return /* @__PURE__ */
|
|
1423
|
+
hidden: r
|
|
1424
|
+
}, s);
|
|
1425
|
+
return /* @__PURE__ */ Y(t, { children: [!r && u, a && e.children && /* @__PURE__ */ J(ze, {
|
|
1369
1426
|
handle: "strong",
|
|
1370
|
-
nodeRef:
|
|
1371
|
-
children: /* @__PURE__ */
|
|
1372
|
-
hidden: !
|
|
1373
|
-
className:
|
|
1374
|
-
ref:
|
|
1375
|
-
children: /* @__PURE__ */
|
|
1376
|
-
className:
|
|
1427
|
+
nodeRef: i,
|
|
1428
|
+
children: /* @__PURE__ */ J("div", {
|
|
1429
|
+
hidden: !a,
|
|
1430
|
+
className: En.modal,
|
|
1431
|
+
ref: i,
|
|
1432
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1433
|
+
className: En.modal_content,
|
|
1377
1434
|
onClick: (e) => e.stopPropagation(),
|
|
1378
1435
|
children: [
|
|
1379
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ J("strong", {
|
|
1380
1437
|
className: "cursor",
|
|
1381
|
-
children: /* @__PURE__ */
|
|
1382
|
-
className:
|
|
1383
|
-
children: /* @__PURE__ */
|
|
1384
|
-
className:
|
|
1385
|
-
children: [
|
|
1438
|
+
children: /* @__PURE__ */ J("div", {
|
|
1439
|
+
className: En.modal_header,
|
|
1440
|
+
children: /* @__PURE__ */ Y("h4", {
|
|
1441
|
+
className: En.modal_title,
|
|
1442
|
+
children: [n, /* @__PURE__ */ J("button", {
|
|
1386
1443
|
onClick: () => {
|
|
1387
|
-
|
|
1444
|
+
o(!1);
|
|
1388
1445
|
},
|
|
1389
|
-
className:
|
|
1446
|
+
className: En.close_button,
|
|
1390
1447
|
children: "X"
|
|
1391
1448
|
})]
|
|
1392
1449
|
})
|
|
1393
1450
|
})
|
|
1394
1451
|
}),
|
|
1395
|
-
/* @__PURE__ */
|
|
1396
|
-
className:
|
|
1452
|
+
/* @__PURE__ */ Y("div", {
|
|
1453
|
+
className: En.modal_body,
|
|
1397
1454
|
children: [
|
|
1398
1455
|
" ",
|
|
1399
1456
|
e.children,
|
|
1400
1457
|
" "
|
|
1401
1458
|
]
|
|
1402
1459
|
}),
|
|
1403
|
-
/* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ J("div", { className: En.modal_footer })
|
|
1404
1461
|
]
|
|
1405
1462
|
})
|
|
1406
1463
|
})
|
|
1407
|
-
},
|
|
1464
|
+
}, n)] }, "Modal-" + n);
|
|
1408
1465
|
}
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
function l(e) {
|
|
1466
|
+
// src/AspectConfigModal.tsx
|
|
1467
|
+
function On(e) {
|
|
1468
|
+
let { aspect: t, setAspect: n, children: r } = e, [i, a] = l("number"), [o, c] = l(2), u = s(() => St(t), [t]);
|
|
1469
|
+
u != i && (console.log("Set initial type", e), a(u), u === "number" && t !== o && c(t));
|
|
1470
|
+
function d(e) {
|
|
1415
1471
|
a(e), n(e === "number" ? o : e);
|
|
1416
1472
|
}
|
|
1417
|
-
return
|
|
1473
|
+
return Dn({
|
|
1418
1474
|
title: "Aspect ratio",
|
|
1419
|
-
icon:
|
|
1475
|
+
icon: we,
|
|
1420
1476
|
hideToggle: e.hideToggle,
|
|
1421
|
-
children: /* @__PURE__ */ q
|
|
1422
|
-
className:
|
|
1423
|
-
children: /* @__PURE__ */
|
|
1477
|
+
children: /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J("div", {
|
|
1478
|
+
className: En.aspect,
|
|
1479
|
+
children: /* @__PURE__ */ J($, {
|
|
1424
1480
|
disabled: i !== "number",
|
|
1425
1481
|
label: "aspect ratio",
|
|
1426
1482
|
input: o,
|
|
1427
|
-
isValid: (e) =>
|
|
1483
|
+
isValid: (e) => Tt(e, 10),
|
|
1428
1484
|
inputAttribs: {
|
|
1429
1485
|
name: "digits",
|
|
1430
1486
|
pattern: "^\\d+|\\d+.\\d*$",
|
|
1431
1487
|
size: 3
|
|
1432
1488
|
},
|
|
1433
1489
|
updateValue: (e) => {
|
|
1434
|
-
|
|
1490
|
+
c(e), n(e);
|
|
1435
1491
|
},
|
|
1436
1492
|
submitLabel: "update ratio"
|
|
1437
1493
|
}, "0")
|
|
1438
|
-
}), /* @__PURE__ */
|
|
1439
|
-
className:
|
|
1440
|
-
children: [/* @__PURE__ */
|
|
1494
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1495
|
+
className: En.aspect,
|
|
1496
|
+
children: [/* @__PURE__ */ Y(B, {
|
|
1441
1497
|
role: "radiogroup",
|
|
1442
1498
|
ariaLabel: "aspect",
|
|
1443
1499
|
value: i,
|
|
1444
|
-
onChange:
|
|
1500
|
+
onChange: d,
|
|
1445
1501
|
children: [
|
|
1446
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1447
1503
|
label: "number",
|
|
1448
1504
|
value: "number"
|
|
1449
1505
|
}),
|
|
1450
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1451
1507
|
label: "auto",
|
|
1452
1508
|
value: "auto"
|
|
1453
1509
|
}),
|
|
1454
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1455
1511
|
label: "equal",
|
|
1456
1512
|
value: "equal"
|
|
1457
1513
|
})
|
|
@@ -1460,155 +1516,154 @@ function wn(e) {
|
|
|
1460
1516
|
})] })
|
|
1461
1517
|
});
|
|
1462
1518
|
}
|
|
1463
|
-
var
|
|
1519
|
+
var kn = {
|
|
1464
1520
|
root: "_root_h18us_1",
|
|
1465
1521
|
sliderContainer: "_sliderContainer_h18us_8",
|
|
1466
1522
|
slider: "_slider_h18us_8",
|
|
1467
1523
|
tools: "_tools_h18us_27",
|
|
1468
1524
|
toolsInner: "_toolsInner_h18us_37"
|
|
1469
1525
|
};
|
|
1470
|
-
|
|
1471
|
-
function
|
|
1526
|
+
Be(".3~e");
|
|
1527
|
+
function An(e) {
|
|
1472
1528
|
let { id: t, domainProps: n, children: r } = e;
|
|
1473
|
-
return /* @__PURE__ */
|
|
1529
|
+
return /* @__PURE__ */ J("div", {
|
|
1474
1530
|
id: t,
|
|
1475
|
-
className:
|
|
1531
|
+
className: kn.tools,
|
|
1476
1532
|
role: "dialog",
|
|
1477
1533
|
"aria-label": "Edit domain",
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1479
|
-
className:
|
|
1480
|
-
children: [r, /* @__PURE__ */
|
|
1534
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1535
|
+
className: kn.toolsInner,
|
|
1536
|
+
children: [r, /* @__PURE__ */ J(x, { ...n })]
|
|
1481
1537
|
})
|
|
1482
1538
|
});
|
|
1483
1539
|
}
|
|
1484
|
-
var
|
|
1485
|
-
function
|
|
1486
|
-
let { dataDomain: t, customDomain: n, scaleType: r, onCustomDomainChange: i, histogramGetter:
|
|
1487
|
-
|
|
1540
|
+
var jn = "domain-tools";
|
|
1541
|
+
function Mn(e) {
|
|
1542
|
+
let { dataDomain: t, customDomain: n, scaleType: r, onCustomDomainChange: i, histogramGetter: o } = e, [u, d] = l(!1), f = le(n, t), p = s(() => o && o(), [o]), m = s(() => u ? n : f, [
|
|
1543
|
+
u,
|
|
1488
1544
|
n,
|
|
1489
|
-
|
|
1545
|
+
f
|
|
1490
1546
|
]);
|
|
1491
|
-
|
|
1492
|
-
|
|
1547
|
+
a(() => {
|
|
1548
|
+
u || i(t);
|
|
1493
1549
|
}, [
|
|
1494
1550
|
t,
|
|
1495
|
-
|
|
1551
|
+
u,
|
|
1496
1552
|
i
|
|
1497
1553
|
]);
|
|
1498
|
-
let [
|
|
1499
|
-
function
|
|
1500
|
-
|
|
1554
|
+
let [h, g] = se(f, t, r ?? P.Linear), [_, v] = l(f), y = m[0] === null, b = m[1] === null, [x, C] = be(!1), [w, T] = be(!1), E = x || w;
|
|
1555
|
+
function O(e) {
|
|
1556
|
+
C(e), T(e);
|
|
1501
1557
|
}
|
|
1502
|
-
function
|
|
1503
|
-
|
|
1558
|
+
function k() {
|
|
1559
|
+
E && O(!1);
|
|
1504
1560
|
}
|
|
1505
|
-
let
|
|
1506
|
-
|
|
1507
|
-
|
|
1561
|
+
let A = c(null);
|
|
1562
|
+
he(A, k), ge("Escape", () => {
|
|
1563
|
+
k();
|
|
1508
1564
|
});
|
|
1509
|
-
let
|
|
1510
|
-
sliderDomain:
|
|
1565
|
+
let j = {
|
|
1566
|
+
sliderDomain: _,
|
|
1511
1567
|
dataDomain: t,
|
|
1512
|
-
errors:
|
|
1513
|
-
isAutoMin:
|
|
1514
|
-
isAutoMax:
|
|
1568
|
+
errors: g,
|
|
1569
|
+
isAutoMin: y,
|
|
1570
|
+
isAutoMax: b,
|
|
1515
1571
|
onAutoMinToggle: () => {
|
|
1516
|
-
let e =
|
|
1517
|
-
i([e,
|
|
1572
|
+
let e = y ? t[0] : null;
|
|
1573
|
+
i([e, m[1]]), y || C(!1);
|
|
1518
1574
|
},
|
|
1519
1575
|
onAutoMaxToggle: () => {
|
|
1520
|
-
let e =
|
|
1521
|
-
i([
|
|
1576
|
+
let e = b ? t[1] : null;
|
|
1577
|
+
i([m[0], e]), b || T(!1);
|
|
1522
1578
|
},
|
|
1523
|
-
isEditingMin:
|
|
1524
|
-
isEditingMax:
|
|
1525
|
-
onEditMin:
|
|
1526
|
-
onEditMax:
|
|
1527
|
-
onChangeMin: (e) => i([e,
|
|
1528
|
-
onChangeMax: (e) => i([
|
|
1529
|
-
onSwap: () => i([
|
|
1579
|
+
isEditingMin: x,
|
|
1580
|
+
isEditingMax: w,
|
|
1581
|
+
onEditMin: C,
|
|
1582
|
+
onEditMax: T,
|
|
1583
|
+
onChangeMin: (e) => i([e, m[1]]),
|
|
1584
|
+
onChangeMax: (e) => i([m[0], e]),
|
|
1585
|
+
onSwap: () => i([m[1], m[0]])
|
|
1530
1586
|
};
|
|
1531
|
-
return /* @__PURE__ */
|
|
1532
|
-
ref:
|
|
1533
|
-
className:
|
|
1587
|
+
return /* @__PURE__ */ Y("div", {
|
|
1588
|
+
ref: A,
|
|
1589
|
+
className: kn.root,
|
|
1534
1590
|
children: [
|
|
1535
|
-
!
|
|
1536
|
-
className:
|
|
1537
|
-
children: /* @__PURE__ */
|
|
1538
|
-
value:
|
|
1539
|
-
safeVisDomain:
|
|
1591
|
+
!p && /* @__PURE__ */ J("div", {
|
|
1592
|
+
className: kn.sliderContainer,
|
|
1593
|
+
children: /* @__PURE__ */ J(S, {
|
|
1594
|
+
value: _,
|
|
1595
|
+
safeVisDomain: h,
|
|
1540
1596
|
dataDomain: t,
|
|
1541
|
-
scaleType: r ??
|
|
1542
|
-
errors:
|
|
1543
|
-
isAutoMin:
|
|
1544
|
-
isAutoMax:
|
|
1597
|
+
scaleType: r ?? P.Linear,
|
|
1598
|
+
errors: g,
|
|
1599
|
+
isAutoMin: y,
|
|
1600
|
+
isAutoMax: b,
|
|
1545
1601
|
onChange: (e) => {
|
|
1546
|
-
|
|
1602
|
+
v(e), O(!1);
|
|
1547
1603
|
},
|
|
1548
1604
|
onAfterChange: (e, t) => {
|
|
1549
|
-
i([e ?
|
|
1605
|
+
i([e ? _[0] : m[0], t ? _[1] : m[1]]);
|
|
1550
1606
|
}
|
|
1551
1607
|
})
|
|
1552
1608
|
}),
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
id:
|
|
1555
|
-
domainProps:
|
|
1556
|
-
children:
|
|
1609
|
+
/* @__PURE__ */ J(An, {
|
|
1610
|
+
id: jn,
|
|
1611
|
+
domainProps: j,
|
|
1612
|
+
children: p && /* @__PURE__ */ J(D, {
|
|
1557
1613
|
dataDomain: t,
|
|
1558
|
-
value:
|
|
1559
|
-
scaleType: r ??
|
|
1560
|
-
onChangeMin: (e) => i([e,
|
|
1561
|
-
onChangeMax: (e) => i([
|
|
1562
|
-
...
|
|
1614
|
+
value: _,
|
|
1615
|
+
scaleType: r ?? P.Linear,
|
|
1616
|
+
onChangeMin: (e) => i([e, m[1]]),
|
|
1617
|
+
onChangeMax: (e) => i([m[0], e]),
|
|
1618
|
+
...p
|
|
1563
1619
|
})
|
|
1564
1620
|
}),
|
|
1565
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ Y("label", { children: [/* @__PURE__ */ J("input", {
|
|
1566
1622
|
type: "checkbox",
|
|
1567
|
-
checked:
|
|
1623
|
+
checked: u,
|
|
1568
1624
|
onChange: () => {
|
|
1569
|
-
|
|
1625
|
+
d((e) => !e);
|
|
1570
1626
|
}
|
|
1571
1627
|
}), "Lock domain?"] })
|
|
1572
1628
|
]
|
|
1573
1629
|
});
|
|
1574
1630
|
}
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
let t = e.label && e.setLabel && /* @__PURE__ */ K(Q, {
|
|
1631
|
+
Mn.displayName = "DomainConfig";
|
|
1632
|
+
// src/AxisConfigModal.tsx
|
|
1633
|
+
function Nn(e) {
|
|
1634
|
+
let t = e.label && e.setLabel && /* @__PURE__ */ J($, {
|
|
1580
1635
|
label: "label",
|
|
1581
1636
|
input: e.label,
|
|
1582
1637
|
updateValue: e.setLabel,
|
|
1583
1638
|
enableEnterKey: !1
|
|
1584
|
-
}, "label"), n = e.scaleType && e.setScaleType && /* @__PURE__ */
|
|
1639
|
+
}, "label"), n = e.scaleType && e.setScaleType && /* @__PURE__ */ J(M, {
|
|
1585
1640
|
label: "scale",
|
|
1586
1641
|
value: e.scaleType,
|
|
1587
1642
|
onScaleChange: e.setScaleType,
|
|
1588
1643
|
options: e.scaleOptions
|
|
1589
|
-
}), r = e.colourMap && e.setColourMap && e.invertColourMap !== void 0 && e.toggleColourMapInversion !== void 0 && /* @__PURE__ */
|
|
1644
|
+
}), r = e.colourMap && e.setColourMap && e.invertColourMap !== void 0 && e.toggleColourMapInversion !== void 0 && /* @__PURE__ */ J(g, {
|
|
1590
1645
|
value: e.colourMap,
|
|
1591
1646
|
onValueChange: e.setColourMap,
|
|
1592
1647
|
invert: e.invertColourMap,
|
|
1593
1648
|
onInversionChange: e.toggleColourMapInversion
|
|
1594
|
-
}), i = e.domain && e.histogramGetter && e.customDomain && e.setCustomDomain && /* @__PURE__ */
|
|
1649
|
+
}), i = e.domain && e.histogramGetter && e.customDomain && e.setCustomDomain && /* @__PURE__ */ J(Mn, {
|
|
1595
1650
|
dataDomain: e.domain,
|
|
1596
1651
|
customDomain: e.customDomain,
|
|
1597
1652
|
scaleType: e.scaleType,
|
|
1598
1653
|
onCustomDomainChange: e.setCustomDomain,
|
|
1599
1654
|
histogramGetter: e.histogramGetter
|
|
1600
|
-
}), a = e.scatterPointSize !== void 0 && e.setScatterPointSize && /* @__PURE__ */
|
|
1655
|
+
}), a = e.scatterPointSize !== void 0 && e.setScatterPointSize && /* @__PURE__ */ J($, {
|
|
1601
1656
|
label: "point size",
|
|
1602
1657
|
input: e.scatterPointSize,
|
|
1603
1658
|
updateValue: e.setScatterPointSize,
|
|
1604
1659
|
decimalPlaces: 2,
|
|
1605
|
-
isValid: (e) =>
|
|
1660
|
+
isValid: (e) => Et(e, !1),
|
|
1606
1661
|
disabled: !e?.hasBaton
|
|
1607
|
-
}, "point size"),
|
|
1608
|
-
return /* @__PURE__ */
|
|
1662
|
+
}, "point size"), o = e.colourMap ? /* @__PURE__ */ J(h, { colorMap: e.colourMap }) : void 0;
|
|
1663
|
+
return /* @__PURE__ */ Y(Dn, {
|
|
1609
1664
|
title: e.title,
|
|
1610
1665
|
icon: e.icon,
|
|
1611
|
-
button:
|
|
1666
|
+
button: o,
|
|
1612
1667
|
hideToggle: e.hideToggle,
|
|
1613
1668
|
children: [
|
|
1614
1669
|
t,
|
|
@@ -1620,110 +1675,107 @@ function kn(e) {
|
|
|
1620
1675
|
]
|
|
1621
1676
|
});
|
|
1622
1677
|
}
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
let { batonUuid: t, uuid: n, others: i, hasBaton: a, offerBaton: o, requestBaton: s } = e, c = t + "*", l = B(() => a ? i.map((e) => /* @__PURE__ */ K("div", {
|
|
1678
|
+
// src/BatonConfigModal.tsx
|
|
1679
|
+
function Pn(e) {
|
|
1680
|
+
let { batonUuid: t, uuid: n, others: r, hasBaton: i, offerBaton: a, requestBaton: o } = e, c = t + "*", l = s(() => i ? r.map((e) => /* @__PURE__ */ J("div", {
|
|
1627
1681
|
title: "Pass baton on",
|
|
1628
|
-
children: /* @__PURE__ */
|
|
1682
|
+
children: /* @__PURE__ */ J(f, {
|
|
1629
1683
|
label: e,
|
|
1630
|
-
onClick: () =>
|
|
1684
|
+
onClick: () => a(e)
|
|
1631
1685
|
}, e)
|
|
1632
|
-
}, e)) :
|
|
1686
|
+
}, e)) : r.map((e) => t == e ? /* @__PURE__ */ J("div", {
|
|
1633
1687
|
title: "Request baton",
|
|
1634
|
-
children: /* @__PURE__ */
|
|
1688
|
+
children: /* @__PURE__ */ J(f, {
|
|
1635
1689
|
label: c,
|
|
1636
|
-
onClick: () =>
|
|
1690
|
+
onClick: () => o()
|
|
1637
1691
|
})
|
|
1638
|
-
}, t) : /* @__PURE__ */
|
|
1692
|
+
}, t) : /* @__PURE__ */ J("p", { children: e }, e)), [
|
|
1639
1693
|
c,
|
|
1640
1694
|
t,
|
|
1641
|
-
a,
|
|
1642
|
-
o,
|
|
1643
1695
|
i,
|
|
1644
|
-
|
|
1696
|
+
a,
|
|
1697
|
+
r,
|
|
1698
|
+
o
|
|
1645
1699
|
]);
|
|
1646
|
-
return
|
|
1700
|
+
return Dn({
|
|
1647
1701
|
title: "Baton info",
|
|
1648
|
-
icon:
|
|
1702
|
+
icon: Ve,
|
|
1649
1703
|
hideToggle: !n,
|
|
1650
|
-
children: /* @__PURE__ */
|
|
1704
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1651
1705
|
style: {
|
|
1652
1706
|
lineHeight: "80%",
|
|
1653
1707
|
width: "10em"
|
|
1654
1708
|
},
|
|
1655
1709
|
children: [
|
|
1656
|
-
/* @__PURE__ */
|
|
1710
|
+
/* @__PURE__ */ J("p", { children: /* @__PURE__ */ Y("strong", { children: [
|
|
1657
1711
|
"Client (",
|
|
1658
|
-
|
|
1712
|
+
i ? c : n,
|
|
1659
1713
|
")"
|
|
1660
1714
|
] }) }),
|
|
1661
|
-
!
|
|
1662
|
-
|
|
1715
|
+
!i && l && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y("p", { children: ["Other client", l.length > 1 ? "s" : ""] }), l] }),
|
|
1716
|
+
i && t && l
|
|
1663
1717
|
]
|
|
1664
1718
|
})
|
|
1665
1719
|
});
|
|
1666
1720
|
}
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
function jn(e) {
|
|
1721
|
+
// src/ClearSelectionsBtn.tsx
|
|
1722
|
+
function Fn(e) {
|
|
1670
1723
|
function t() {
|
|
1671
1724
|
e.updateSelection && e.updateSelection(null, !1, !0), e.updateCurrentSelectionID(null);
|
|
1672
1725
|
}
|
|
1673
|
-
return /* @__PURE__ */
|
|
1726
|
+
return /* @__PURE__ */ J(f, {
|
|
1674
1727
|
label: "Clear all selections",
|
|
1675
1728
|
onClick: () => {
|
|
1676
|
-
window.confirm(
|
|
1729
|
+
window.confirm(e.popupText) && t();
|
|
1677
1730
|
},
|
|
1678
1731
|
disabled: e.disabled
|
|
1679
1732
|
});
|
|
1680
1733
|
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
function Mn(e) {
|
|
1734
|
+
// src/InteractionModeToggle.tsx
|
|
1735
|
+
function In(e) {
|
|
1684
1736
|
let { value: t, onModeChange: n, hasBaton: r, canSelect: i } = e;
|
|
1685
|
-
return
|
|
1737
|
+
return a(() => {
|
|
1686
1738
|
!r && t === X.selectRegion && n(X.panAndWheelZoom);
|
|
1687
1739
|
}, [
|
|
1688
1740
|
t,
|
|
1689
1741
|
n,
|
|
1690
1742
|
r
|
|
1691
|
-
]), /* @__PURE__ */
|
|
1743
|
+
]), /* @__PURE__ */ J(q, { children: /* @__PURE__ */ Y(B, {
|
|
1692
1744
|
role: "radiogroup",
|
|
1693
1745
|
ariaLabel: "mode",
|
|
1694
1746
|
value: t,
|
|
1695
1747
|
onChange: (e) => n(e),
|
|
1696
1748
|
children: [
|
|
1697
|
-
/* @__PURE__ */
|
|
1749
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1698
1750
|
label: "pan & wheel zoom\n alt: x-only\n shift: y-only",
|
|
1699
1751
|
iconOnly: !0,
|
|
1700
|
-
icon:
|
|
1752
|
+
icon: Le,
|
|
1701
1753
|
value: X.panAndWheelZoom
|
|
1702
1754
|
}),
|
|
1703
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1704
1756
|
label: "select to zoom\n alt: x-only\n shift: y-only",
|
|
1705
1757
|
iconOnly: !0,
|
|
1706
|
-
icon:
|
|
1758
|
+
icon: Ie,
|
|
1707
1759
|
value: X.selectToZoom
|
|
1708
1760
|
}),
|
|
1709
|
-
i ? /* @__PURE__ */
|
|
1761
|
+
i ? /* @__PURE__ */ J("div", {
|
|
1710
1762
|
style: {
|
|
1711
1763
|
pointerEvents: r ? "inherit" : "auto",
|
|
1712
1764
|
display: "inline-flex"
|
|
1713
1765
|
},
|
|
1714
1766
|
title: r ? "" : "need baton",
|
|
1715
|
-
children: /* @__PURE__ */
|
|
1767
|
+
children: /* @__PURE__ */ J(B.Btn, {
|
|
1716
1768
|
label: "select region",
|
|
1717
1769
|
iconOnly: !0,
|
|
1718
|
-
icon:
|
|
1770
|
+
icon: He,
|
|
1719
1771
|
value: X.selectRegion,
|
|
1720
1772
|
disabled: !r
|
|
1721
1773
|
})
|
|
1722
|
-
}) : /* @__PURE__ */
|
|
1774
|
+
}) : /* @__PURE__ */ J(q, {})
|
|
1723
1775
|
]
|
|
1724
1776
|
}) });
|
|
1725
1777
|
}
|
|
1726
|
-
var
|
|
1778
|
+
var Ln = {
|
|
1727
1779
|
modeless: "_modeless_1im3t_1",
|
|
1728
1780
|
modeless_content: "_modeless_content_1im3t_7",
|
|
1729
1781
|
modeless_header: "_modeless_header_1im3t_16",
|
|
@@ -1734,95 +1786,93 @@ var Nn = {
|
|
|
1734
1786
|
aspect: "_aspect_1im3t_40",
|
|
1735
1787
|
btn: "_btn_1im3t_46"
|
|
1736
1788
|
};
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
return ve("Escape", () => {
|
|
1789
|
+
// src/Modeless.tsx
|
|
1790
|
+
function Rn(e) {
|
|
1791
|
+
let { showModeless: t, setShowModeless: n, title: r } = e, i = c(null);
|
|
1792
|
+
return ge("Escape", () => {
|
|
1742
1793
|
n(!1);
|
|
1743
|
-
}), [t && e.children ? /* @__PURE__ */
|
|
1794
|
+
}), [t && e.children ? /* @__PURE__ */ J(ze, {
|
|
1744
1795
|
handle: "strong",
|
|
1745
1796
|
nodeRef: i,
|
|
1746
|
-
children: /* @__PURE__ */
|
|
1797
|
+
children: /* @__PURE__ */ J("div", {
|
|
1747
1798
|
hidden: !t,
|
|
1748
1799
|
ref: i,
|
|
1749
|
-
className:
|
|
1750
|
-
children: /* @__PURE__ */
|
|
1751
|
-
className:
|
|
1800
|
+
className: Ln.modeless,
|
|
1801
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1802
|
+
className: Ln.modeless_content,
|
|
1752
1803
|
onClick: (e) => e.stopPropagation(),
|
|
1753
1804
|
children: [
|
|
1754
|
-
/* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ J("strong", {
|
|
1755
1806
|
className: "cursor",
|
|
1756
|
-
children: /* @__PURE__ */
|
|
1757
|
-
className:
|
|
1758
|
-
children: /* @__PURE__ */
|
|
1759
|
-
className:
|
|
1760
|
-
children: [e.title, /* @__PURE__ */
|
|
1807
|
+
children: /* @__PURE__ */ J("div", {
|
|
1808
|
+
className: Ln.modeless_header,
|
|
1809
|
+
children: /* @__PURE__ */ Y("h4", {
|
|
1810
|
+
className: Ln.modeless_title,
|
|
1811
|
+
children: [e.title, /* @__PURE__ */ J("button", {
|
|
1761
1812
|
onClick: () => {
|
|
1762
1813
|
n(!1);
|
|
1763
1814
|
},
|
|
1764
|
-
className:
|
|
1815
|
+
className: Ln.close_button,
|
|
1765
1816
|
children: "X"
|
|
1766
1817
|
})]
|
|
1767
1818
|
})
|
|
1768
1819
|
})
|
|
1769
1820
|
}),
|
|
1770
|
-
/* @__PURE__ */
|
|
1771
|
-
className:
|
|
1821
|
+
/* @__PURE__ */ Y("div", {
|
|
1822
|
+
className: Ln.modeless_body,
|
|
1772
1823
|
children: [
|
|
1773
1824
|
" ",
|
|
1774
1825
|
e.children,
|
|
1775
1826
|
" "
|
|
1776
1827
|
]
|
|
1777
1828
|
}),
|
|
1778
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ J("div", { className: Ln.modeless_footer })
|
|
1779
1830
|
]
|
|
1780
1831
|
})
|
|
1781
1832
|
})
|
|
1782
1833
|
}, r) : null];
|
|
1783
1834
|
}
|
|
1784
|
-
var
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
function In(e) {
|
|
1835
|
+
var zn = { colourLabel: "_colourLabel_1evqd_1" };
|
|
1836
|
+
// src/GlyphTypeToggle.tsx
|
|
1837
|
+
function Bn(e) {
|
|
1788
1838
|
let t = e.value ?? "Circle", n = e.onGlyphTypeChange, r = e.hasBaton;
|
|
1789
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ J(q, { children: /* @__PURE__ */ Y(B, {
|
|
1790
1840
|
role: "radiogroup",
|
|
1791
1841
|
ariaLabel: "mode",
|
|
1792
1842
|
value: t,
|
|
1793
1843
|
onChange: (e) => n(e),
|
|
1794
1844
|
children: [
|
|
1795
|
-
/* @__PURE__ */
|
|
1845
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1796
1846
|
label: "Circle",
|
|
1797
1847
|
iconOnly: !0,
|
|
1798
|
-
icon:
|
|
1848
|
+
icon: We,
|
|
1799
1849
|
value: "Circle",
|
|
1800
1850
|
disabled: !r
|
|
1801
1851
|
}),
|
|
1802
|
-
/* @__PURE__ */
|
|
1852
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1803
1853
|
label: "Cross",
|
|
1804
1854
|
iconOnly: !0,
|
|
1805
|
-
icon:
|
|
1855
|
+
icon: Ge,
|
|
1806
1856
|
value: "Cross",
|
|
1807
1857
|
disabled: !r
|
|
1808
1858
|
}),
|
|
1809
|
-
/* @__PURE__ */
|
|
1859
|
+
/* @__PURE__ */ J(B.Btn, {
|
|
1810
1860
|
label: "Square",
|
|
1811
1861
|
iconOnly: !0,
|
|
1812
|
-
icon:
|
|
1862
|
+
icon: Ke,
|
|
1813
1863
|
value: "Square",
|
|
1814
1864
|
disabled: !r
|
|
1815
1865
|
}),
|
|
1816
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ J("div", {
|
|
1817
1867
|
style: {
|
|
1818
1868
|
pointerEvents: r ? "inherit" : "auto",
|
|
1819
1869
|
display: "inline-flex"
|
|
1820
1870
|
},
|
|
1821
1871
|
title: r ? "" : "need baton",
|
|
1822
|
-
children: /* @__PURE__ */
|
|
1872
|
+
children: /* @__PURE__ */ J(B.Btn, {
|
|
1823
1873
|
label: "Cap",
|
|
1824
1874
|
iconOnly: !0,
|
|
1825
|
-
icon:
|
|
1875
|
+
icon: Ee,
|
|
1826
1876
|
value: "Cap",
|
|
1827
1877
|
disabled: !r
|
|
1828
1878
|
})
|
|
@@ -1830,113 +1880,111 @@ function In(e) {
|
|
|
1830
1880
|
]
|
|
1831
1881
|
}) });
|
|
1832
1882
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
return /* @__PURE__ */ q(Pn, {
|
|
1883
|
+
// src/LineConfig.tsx
|
|
1884
|
+
function Vn(e) {
|
|
1885
|
+
let { currentLineKey: n, allLineParams: r, updateLineParams: i, hasBaton: a } = e;
|
|
1886
|
+
if (console.log("currentLineKey is ", n), n == null || !r.has(n)) return null;
|
|
1887
|
+
let o = r.get(n);
|
|
1888
|
+
if (o == null) return null;
|
|
1889
|
+
let s = o.colour ?? "#000000";
|
|
1890
|
+
return /* @__PURE__ */ Y(Rn, {
|
|
1842
1891
|
title: "Line",
|
|
1843
1892
|
showModeless: e.showLineConfig,
|
|
1844
1893
|
setShowModeless: e.updateShowLineConfig,
|
|
1845
1894
|
children: [
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
className:
|
|
1849
|
-
style: { borderLeftColor:
|
|
1850
|
-
children:
|
|
1895
|
+
/* @__PURE__ */ Y(t, { children: [
|
|
1896
|
+
/* @__PURE__ */ J("div", {
|
|
1897
|
+
className: zn.colourLabel,
|
|
1898
|
+
style: { borderLeftColor: s },
|
|
1899
|
+
children: s
|
|
1851
1900
|
}, "colour text"),
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
|
|
1854
|
-
color:
|
|
1901
|
+
/* @__PURE__ */ J("br", {}, "colour spacer"),
|
|
1902
|
+
a && /* @__PURE__ */ J(Ue, {
|
|
1903
|
+
color: s,
|
|
1855
1904
|
onChange: (e) => {
|
|
1856
|
-
e !==
|
|
1857
|
-
...
|
|
1905
|
+
e !== o.colour && i(n, {
|
|
1906
|
+
...o,
|
|
1858
1907
|
colour: e
|
|
1859
1908
|
});
|
|
1860
1909
|
}
|
|
1861
1910
|
}, "colour picker")
|
|
1862
1911
|
] }, "line colour"),
|
|
1863
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ J($, {
|
|
1864
1913
|
label: "colour",
|
|
1865
|
-
input:
|
|
1914
|
+
input: o.colour ?? "",
|
|
1866
1915
|
updateValue: (e) => {
|
|
1867
|
-
e !==
|
|
1868
|
-
...
|
|
1916
|
+
e !== o.colour && i(n, {
|
|
1917
|
+
...o,
|
|
1869
1918
|
colour: e
|
|
1870
1919
|
});
|
|
1871
1920
|
},
|
|
1872
|
-
disabled: !
|
|
1921
|
+
disabled: !a
|
|
1873
1922
|
}, "colour input"),
|
|
1874
|
-
/* @__PURE__ */
|
|
1923
|
+
/* @__PURE__ */ J($, {
|
|
1875
1924
|
label: "line width",
|
|
1876
|
-
input:
|
|
1925
|
+
input: o.width ?? 1,
|
|
1877
1926
|
updateValue: (e) => {
|
|
1878
|
-
e !==
|
|
1879
|
-
...
|
|
1927
|
+
e !== o.width && e >= 0 && i(n, {
|
|
1928
|
+
...o,
|
|
1880
1929
|
width: e
|
|
1881
1930
|
});
|
|
1882
1931
|
},
|
|
1883
|
-
isValid: (e) =>
|
|
1884
|
-
disabled: !
|
|
1932
|
+
isValid: (e) => Et(e, o.lineOn),
|
|
1933
|
+
disabled: !a
|
|
1885
1934
|
}, "line width"),
|
|
1886
|
-
/* @__PURE__ */
|
|
1935
|
+
/* @__PURE__ */ J($, {
|
|
1887
1936
|
label: "name",
|
|
1888
|
-
input:
|
|
1937
|
+
input: o.name,
|
|
1889
1938
|
updateValue: (e) => {
|
|
1890
|
-
e !==
|
|
1891
|
-
...
|
|
1939
|
+
e !== o.name && i(n, {
|
|
1940
|
+
...o,
|
|
1892
1941
|
name: e
|
|
1893
1942
|
});
|
|
1894
1943
|
},
|
|
1895
|
-
disabled: !
|
|
1944
|
+
disabled: !a
|
|
1896
1945
|
}, "name"),
|
|
1897
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ J(ee, {
|
|
1898
1947
|
label: "Line on",
|
|
1899
|
-
value:
|
|
1948
|
+
value: o.lineOn,
|
|
1900
1949
|
onToggle: () => {
|
|
1901
|
-
(
|
|
1902
|
-
...
|
|
1903
|
-
lineOn: !
|
|
1950
|
+
(o.pointSize || !o.lineOn) && i(n, {
|
|
1951
|
+
...o,
|
|
1952
|
+
lineOn: !o.lineOn
|
|
1904
1953
|
});
|
|
1905
1954
|
},
|
|
1906
|
-
disabled: !
|
|
1955
|
+
disabled: !a || o.pointSize == null || o.pointSize == 0
|
|
1907
1956
|
}, "line on"),
|
|
1908
|
-
/* @__PURE__ */
|
|
1909
|
-
value:
|
|
1957
|
+
/* @__PURE__ */ J(Bn, {
|
|
1958
|
+
value: o.glyphType ?? T.Circle,
|
|
1910
1959
|
onGlyphTypeChange: (e) => {
|
|
1911
|
-
console.log("calling onGlyphTypeChange with cLine ",
|
|
1912
|
-
...
|
|
1960
|
+
console.log("calling onGlyphTypeChange with cLine ", n), e !== o.glyphType && i(n, {
|
|
1961
|
+
...o,
|
|
1913
1962
|
glyphType: e
|
|
1914
1963
|
});
|
|
1915
1964
|
},
|
|
1916
|
-
hasBaton:
|
|
1965
|
+
hasBaton: a
|
|
1917
1966
|
}, "glyph type"),
|
|
1918
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ J($, {
|
|
1919
1968
|
label: "point size",
|
|
1920
|
-
input:
|
|
1969
|
+
input: o.pointSize ?? 0,
|
|
1921
1970
|
updateValue: (e) => {
|
|
1922
|
-
e !==
|
|
1923
|
-
...
|
|
1971
|
+
e !== o.pointSize && (e == 0 && o.lineOn ? i(n, {
|
|
1972
|
+
...o,
|
|
1924
1973
|
pointSize: void 0
|
|
1925
|
-
}) : e >= 0 &&
|
|
1926
|
-
...
|
|
1974
|
+
}) : e >= 0 && i(n, {
|
|
1975
|
+
...o,
|
|
1927
1976
|
pointSize: e
|
|
1928
1977
|
}));
|
|
1929
1978
|
},
|
|
1930
1979
|
decimalPlaces: 2,
|
|
1931
|
-
isValid: (e) =>
|
|
1932
|
-
disabled: !
|
|
1980
|
+
isValid: (e) => Et(e, o.lineOn),
|
|
1981
|
+
disabled: !a
|
|
1933
1982
|
}, "point size")
|
|
1934
1983
|
]
|
|
1935
1984
|
});
|
|
1936
1985
|
}
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
function Rn(e) {
|
|
1986
|
+
// src/LineKeyDropdown.tsx
|
|
1987
|
+
function Hn(e) {
|
|
1940
1988
|
let { allLineParams: t, lineKey: n, onLineKeyChange: r } = e, i = [...t.keys()];
|
|
1941
1989
|
function a() {
|
|
1942
1990
|
n === "" && i.length > 0 && r(i[0]);
|
|
@@ -1959,7 +2007,7 @@ function Rn(e) {
|
|
|
1959
2007
|
label: c(e),
|
|
1960
2008
|
bgcolour: o(e)
|
|
1961
2009
|
}));
|
|
1962
|
-
return /* @__PURE__ */
|
|
2010
|
+
return /* @__PURE__ */ J(qe, {
|
|
1963
2011
|
styles: l,
|
|
1964
2012
|
value: {
|
|
1965
2013
|
value: n,
|
|
@@ -1975,59 +2023,59 @@ function Rn(e) {
|
|
|
1975
2023
|
}
|
|
1976
2024
|
});
|
|
1977
2025
|
}
|
|
1978
|
-
var
|
|
2026
|
+
var Un = {
|
|
1979
2027
|
option: "_option_1qhtz_1",
|
|
1980
2028
|
icon: "_icon_1qhtz_6"
|
|
1981
|
-
},
|
|
2029
|
+
}, Wn = {
|
|
1982
2030
|
[Z.line]: {
|
|
1983
|
-
Icon:
|
|
2031
|
+
Icon: Ce,
|
|
1984
2032
|
label: "Line"
|
|
1985
2033
|
},
|
|
1986
2034
|
[Z.rectangle]: {
|
|
1987
|
-
Icon:
|
|
2035
|
+
Icon: Oe,
|
|
1988
2036
|
label: "Rectangle"
|
|
1989
2037
|
},
|
|
1990
2038
|
[Z.polyline]: {
|
|
1991
|
-
Icon:
|
|
2039
|
+
Icon: De,
|
|
1992
2040
|
label: "Polyline"
|
|
1993
2041
|
},
|
|
1994
2042
|
[Z.polygon]: {
|
|
1995
|
-
Icon:
|
|
2043
|
+
Icon: Pe,
|
|
1996
2044
|
label: "Polygon"
|
|
1997
2045
|
},
|
|
1998
2046
|
[Z.circle]: {
|
|
1999
|
-
Icon:
|
|
2047
|
+
Icon: je,
|
|
2000
2048
|
label: "Circle"
|
|
2001
2049
|
},
|
|
2002
2050
|
[Z.ellipse]: {
|
|
2003
|
-
Icon:
|
|
2051
|
+
Icon: Ne,
|
|
2004
2052
|
label: "Ellipse"
|
|
2005
2053
|
},
|
|
2006
2054
|
[Z.sector]: {
|
|
2007
|
-
Icon:
|
|
2055
|
+
Icon: Xe,
|
|
2008
2056
|
label: "Sector"
|
|
2009
2057
|
},
|
|
2010
2058
|
[Z.horizontalAxis]: {
|
|
2011
|
-
Icon:
|
|
2059
|
+
Icon: Ye,
|
|
2012
2060
|
label: "Horizontal Axis"
|
|
2013
2061
|
},
|
|
2014
2062
|
[Z.verticalAxis]: {
|
|
2015
|
-
Icon:
|
|
2063
|
+
Icon: Je,
|
|
2016
2064
|
label: "Vertical Axis"
|
|
2017
2065
|
},
|
|
2018
2066
|
[Z.unknown]: {
|
|
2019
|
-
Icon:
|
|
2067
|
+
Icon: Fe,
|
|
2020
2068
|
label: "Unknown"
|
|
2021
2069
|
}
|
|
2022
2070
|
};
|
|
2023
|
-
function
|
|
2024
|
-
let { option: t } = e, { Icon: n, label: r } =
|
|
2025
|
-
return /* @__PURE__ */
|
|
2026
|
-
className:
|
|
2027
|
-
children: [/* @__PURE__ */
|
|
2071
|
+
function Gn(e) {
|
|
2072
|
+
let { option: t } = e, { Icon: n, label: r } = Wn[t];
|
|
2073
|
+
return /* @__PURE__ */ Y("div", {
|
|
2074
|
+
className: Un.option,
|
|
2075
|
+
children: [/* @__PURE__ */ J(n, { className: Un.icon }), /* @__PURE__ */ J("span", { children: r })]
|
|
2028
2076
|
});
|
|
2029
2077
|
}
|
|
2030
|
-
function
|
|
2078
|
+
function Kn(e) {
|
|
2031
2079
|
let { value: t, onSelectionTypeChange: n, disabled: r, options: i = [
|
|
2032
2080
|
Z.line,
|
|
2033
2081
|
Z.rectangle,
|
|
@@ -2036,19 +2084,18 @@ function Hn(e) {
|
|
|
2036
2084
|
Z.polygon,
|
|
2037
2085
|
Z.polyline
|
|
2038
2086
|
] } = e;
|
|
2039
|
-
return /* @__PURE__ */
|
|
2087
|
+
return /* @__PURE__ */ J(I, {
|
|
2040
2088
|
value: t,
|
|
2041
2089
|
onChange: n,
|
|
2042
2090
|
options: i,
|
|
2043
|
-
renderOption: (e) => /* @__PURE__ */
|
|
2091
|
+
renderOption: (e) => /* @__PURE__ */ J(Gn, { option: e }),
|
|
2044
2092
|
disabled: r
|
|
2045
2093
|
});
|
|
2046
2094
|
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
function Un(e) {
|
|
2095
|
+
// src/SelectionConfigComponents.tsx
|
|
2096
|
+
function qn(e) {
|
|
2050
2097
|
let { selection: t, updateSelection: n, disabled: r } = e;
|
|
2051
|
-
return /* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ J($, {
|
|
2052
2099
|
label: "angle",
|
|
2053
2100
|
input: t.angle * 180 / Math.PI,
|
|
2054
2101
|
decimalPlaces: 5,
|
|
@@ -2058,187 +2105,183 @@ function Un(e) {
|
|
|
2058
2105
|
t.setAngle(r), n(t);
|
|
2059
2106
|
}
|
|
2060
2107
|
},
|
|
2061
|
-
isValid: (e) =>
|
|
2108
|
+
isValid: (e) => Ct(e),
|
|
2062
2109
|
disabled: r
|
|
2063
2110
|
}, "angle");
|
|
2064
2111
|
}
|
|
2065
|
-
function
|
|
2112
|
+
function Jn(e) {
|
|
2066
2113
|
let { selection: t, updateSelection: n, disabled: r } = e;
|
|
2067
|
-
return /* @__PURE__ */
|
|
2114
|
+
return /* @__PURE__ */ J($, {
|
|
2068
2115
|
label: "x",
|
|
2069
2116
|
input: t.start[0],
|
|
2070
2117
|
decimalPlaces: 8,
|
|
2071
2118
|
updateValue: (e) => {
|
|
2072
2119
|
n && (t.setStart(0, e), n(t));
|
|
2073
2120
|
},
|
|
2074
|
-
isValid: (e) =>
|
|
2121
|
+
isValid: (e) => Ct(e),
|
|
2075
2122
|
disabled: r
|
|
2076
2123
|
}, "x");
|
|
2077
2124
|
}
|
|
2078
|
-
function
|
|
2125
|
+
function Yn(e) {
|
|
2079
2126
|
let { selection: t, updateSelection: n, disabled: r } = e;
|
|
2080
|
-
return /* @__PURE__ */
|
|
2127
|
+
return /* @__PURE__ */ J($, {
|
|
2081
2128
|
label: "y",
|
|
2082
2129
|
input: t.start[1],
|
|
2083
2130
|
decimalPlaces: 8,
|
|
2084
2131
|
updateValue: (e) => {
|
|
2085
2132
|
n && (t.setStart(1, e), n(t));
|
|
2086
2133
|
},
|
|
2087
|
-
isValid: (e) =>
|
|
2134
|
+
isValid: (e) => Ct(e),
|
|
2088
2135
|
disabled: r
|
|
2089
2136
|
}, "y");
|
|
2090
2137
|
}
|
|
2091
|
-
function
|
|
2138
|
+
function Xn(e) {
|
|
2092
2139
|
let { i: t, point: n, updatePoint: r, disabled: i } = e, a = `x${t}`;
|
|
2093
|
-
return /* @__PURE__ */
|
|
2140
|
+
return /* @__PURE__ */ J($, {
|
|
2094
2141
|
label: a,
|
|
2095
2142
|
input: n[0],
|
|
2096
2143
|
decimalPlaces: 8,
|
|
2097
2144
|
updateValue: (e) => {
|
|
2098
2145
|
r([e, n[1]]);
|
|
2099
2146
|
},
|
|
2100
|
-
isValid: (e) =>
|
|
2147
|
+
isValid: (e) => Ct(e),
|
|
2101
2148
|
disabled: i
|
|
2102
2149
|
}, a);
|
|
2103
2150
|
}
|
|
2104
|
-
function
|
|
2151
|
+
function Zn(e) {
|
|
2105
2152
|
let { i: t, point: n, updatePoint: r, disabled: i } = e, a = `y${t}`;
|
|
2106
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ J($, {
|
|
2107
2154
|
label: a,
|
|
2108
2155
|
input: n[1],
|
|
2109
2156
|
decimalPlaces: 8,
|
|
2110
2157
|
updateValue: (e) => {
|
|
2111
2158
|
r([n[0], e]);
|
|
2112
2159
|
},
|
|
2113
|
-
isValid: (e) =>
|
|
2160
|
+
isValid: (e) => Ct(e),
|
|
2114
2161
|
disabled: i
|
|
2115
2162
|
}, a);
|
|
2116
2163
|
}
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
}, `XInput${t._vStart.x}`), /* @__PURE__ */ K(Q, {
|
|
2164
|
+
// src/AxialSelectionConfig.tsx
|
|
2165
|
+
function Qn(e) {
|
|
2166
|
+
let { selection: n, updateSelection: r, disabled: i } = e;
|
|
2167
|
+
return n.dimension === 0 ? /* @__PURE__ */ Y(t, { children: [/* @__PURE__ */ J(Jn, {
|
|
2168
|
+
selection: n,
|
|
2169
|
+
updateSelection: r,
|
|
2170
|
+
disabled: i
|
|
2171
|
+
}, `XInput${n._vStart.x}`), /* @__PURE__ */ J($, {
|
|
2126
2172
|
label: "x length",
|
|
2127
|
-
input:
|
|
2173
|
+
input: n.length,
|
|
2128
2174
|
updateValue: (e) => {
|
|
2129
|
-
if (
|
|
2130
|
-
let
|
|
2131
|
-
|
|
2175
|
+
if (r) {
|
|
2176
|
+
let t = Ht.createFromSelection(n);
|
|
2177
|
+
t.length = e, r(t);
|
|
2132
2178
|
}
|
|
2133
2179
|
},
|
|
2134
2180
|
decimalPlaces: 8,
|
|
2135
|
-
isValid: (e) =>
|
|
2136
|
-
disabled:
|
|
2137
|
-
}, `XLength${
|
|
2138
|
-
selection:
|
|
2139
|
-
updateSelection:
|
|
2140
|
-
disabled:
|
|
2141
|
-
}, `YInput${
|
|
2181
|
+
isValid: (e) => Ct(e),
|
|
2182
|
+
disabled: i
|
|
2183
|
+
}, `XLength${n.length}`)] }, "axis x") : /* @__PURE__ */ Y(t, { children: [/* @__PURE__ */ J(Yn, {
|
|
2184
|
+
selection: n,
|
|
2185
|
+
updateSelection: r,
|
|
2186
|
+
disabled: i
|
|
2187
|
+
}, `YInput${n._vStart.y}`), /* @__PURE__ */ J($, {
|
|
2142
2188
|
label: "y length",
|
|
2143
|
-
input:
|
|
2189
|
+
input: n.length,
|
|
2144
2190
|
updateValue: (e) => {
|
|
2145
|
-
if (
|
|
2146
|
-
let
|
|
2147
|
-
|
|
2191
|
+
if (r) {
|
|
2192
|
+
let t = Ht.createFromSelection(n);
|
|
2193
|
+
t.length = e, r(t);
|
|
2148
2194
|
}
|
|
2149
2195
|
},
|
|
2150
2196
|
decimalPlaces: 8,
|
|
2151
|
-
isValid: (e) =>
|
|
2152
|
-
disabled:
|
|
2153
|
-
}, `YLength${
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
/* @__PURE__ */ K(Q, {
|
|
2197
|
+
isValid: (e) => Ct(e),
|
|
2198
|
+
disabled: i
|
|
2199
|
+
}, `YLength${n.length}`)] }, "axis y");
|
|
2200
|
+
}
|
|
2201
|
+
// src/LinearSelectionConfig.tsx
|
|
2202
|
+
function $n(e) {
|
|
2203
|
+
let { selection: n, updateSelection: r, disabled: i } = e;
|
|
2204
|
+
return /* @__PURE__ */ Y(t, { children: [
|
|
2205
|
+
/* @__PURE__ */ J(Jn, {
|
|
2206
|
+
selection: n,
|
|
2207
|
+
updateSelection: r,
|
|
2208
|
+
disabled: i
|
|
2209
|
+
}, `XInput${n._vStart.x}`),
|
|
2210
|
+
/* @__PURE__ */ J(Yn, {
|
|
2211
|
+
selection: n,
|
|
2212
|
+
updateSelection: r,
|
|
2213
|
+
disabled: i
|
|
2214
|
+
}, `YInput${n._vStart.y}`),
|
|
2215
|
+
/* @__PURE__ */ J(qn, {
|
|
2216
|
+
selection: n,
|
|
2217
|
+
updateSelection: r,
|
|
2218
|
+
disabled: i
|
|
2219
|
+
}, `Angle${n.angle}`),
|
|
2220
|
+
/* @__PURE__ */ J($, {
|
|
2176
2221
|
label: "length",
|
|
2177
|
-
input:
|
|
2222
|
+
input: n.length,
|
|
2178
2223
|
updateValue: (e) => {
|
|
2179
|
-
if (
|
|
2180
|
-
let
|
|
2181
|
-
|
|
2224
|
+
if (r) {
|
|
2225
|
+
let t = qt.createFromSelection(n);
|
|
2226
|
+
t.length = e, r(t);
|
|
2182
2227
|
}
|
|
2183
2228
|
},
|
|
2184
2229
|
decimalPlaces: 8,
|
|
2185
|
-
isValid: (e) =>
|
|
2186
|
-
disabled:
|
|
2187
|
-
}, `Length${
|
|
2230
|
+
isValid: (e) => Ct(e),
|
|
2231
|
+
disabled: i
|
|
2232
|
+
}, `Length${n.length}`)
|
|
2188
2233
|
] }, "line");
|
|
2189
2234
|
}
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
/* @__PURE__ */ K(Q, {
|
|
2235
|
+
// src/RectangularSelectionConfig.tsx
|
|
2236
|
+
function er(e) {
|
|
2237
|
+
let { selection: n, updateSelection: r, disabled: i } = e;
|
|
2238
|
+
return /* @__PURE__ */ Y(t, { children: [
|
|
2239
|
+
/* @__PURE__ */ J(Jn, {
|
|
2240
|
+
selection: n,
|
|
2241
|
+
updateSelection: r,
|
|
2242
|
+
disabled: i
|
|
2243
|
+
}, `XInput${n._vStart.x}`),
|
|
2244
|
+
/* @__PURE__ */ J(Yn, {
|
|
2245
|
+
selection: n,
|
|
2246
|
+
updateSelection: r,
|
|
2247
|
+
disabled: i
|
|
2248
|
+
}, `YInput${n._vStart.y}`),
|
|
2249
|
+
/* @__PURE__ */ J(qn, {
|
|
2250
|
+
selection: n,
|
|
2251
|
+
updateSelection: r,
|
|
2252
|
+
disabled: i
|
|
2253
|
+
}, `Angle${n.angle}`),
|
|
2254
|
+
/* @__PURE__ */ J($, {
|
|
2211
2255
|
label: "x length",
|
|
2212
|
-
input:
|
|
2256
|
+
input: n.lengths[0],
|
|
2213
2257
|
updateValue: (e) => {
|
|
2214
|
-
if (
|
|
2215
|
-
let
|
|
2216
|
-
|
|
2258
|
+
if (r) {
|
|
2259
|
+
let t = Yt.createFromSelection(n);
|
|
2260
|
+
t.lengths = [e, n.lengths[1]], r(t);
|
|
2217
2261
|
}
|
|
2218
2262
|
},
|
|
2219
2263
|
decimalPlaces: 8,
|
|
2220
|
-
isValid: (e) =>
|
|
2221
|
-
disabled:
|
|
2222
|
-
}, `XLength${
|
|
2223
|
-
/* @__PURE__ */
|
|
2264
|
+
isValid: (e) => Ct(e),
|
|
2265
|
+
disabled: i
|
|
2266
|
+
}, `XLength${n.lengths[0]}`),
|
|
2267
|
+
/* @__PURE__ */ J($, {
|
|
2224
2268
|
label: "y length",
|
|
2225
|
-
input:
|
|
2269
|
+
input: n.lengths[1],
|
|
2226
2270
|
updateValue: (e) => {
|
|
2227
|
-
if (
|
|
2228
|
-
let
|
|
2229
|
-
|
|
2271
|
+
if (r) {
|
|
2272
|
+
let t = Yt.createFromSelection(n);
|
|
2273
|
+
t.lengths = [n.lengths[0], e], r(t);
|
|
2230
2274
|
}
|
|
2231
2275
|
},
|
|
2232
2276
|
decimalPlaces: 8,
|
|
2233
|
-
isValid: (e) =>
|
|
2234
|
-
disabled:
|
|
2235
|
-
}, `YLength${
|
|
2277
|
+
isValid: (e) => Ct(e),
|
|
2278
|
+
disabled: i
|
|
2279
|
+
}, `YLength${n.lengths[1]}`)
|
|
2236
2280
|
] }, "rectangle");
|
|
2237
2281
|
}
|
|
2238
|
-
var
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
function Qn(e) {
|
|
2282
|
+
var tr = { scrollContainer: "_scrollContainer_a4950_1" };
|
|
2283
|
+
// src/PolygonalSelectionConfig.tsx
|
|
2284
|
+
function nr(e) {
|
|
2242
2285
|
let { selection: t, updateSelection: n, disabled: r } = e;
|
|
2243
2286
|
function i(e, r) {
|
|
2244
2287
|
if (n) {
|
|
@@ -2248,25 +2291,24 @@ function Qn(e) {
|
|
|
2248
2291
|
a.points = i, n(a);
|
|
2249
2292
|
}
|
|
2250
2293
|
}
|
|
2251
|
-
let a = t.points.map((e, t) => [/* @__PURE__ */
|
|
2294
|
+
let a = t.points.map((e, t) => [/* @__PURE__ */ J(Xn, {
|
|
2252
2295
|
i: t,
|
|
2253
2296
|
point: e,
|
|
2254
2297
|
updatePoint: (e) => i(e, t),
|
|
2255
2298
|
disabled: r
|
|
2256
|
-
}, `px${t}${e[0]}`), /* @__PURE__ */
|
|
2299
|
+
}, `px${t}${e[0]}`), /* @__PURE__ */ J(Zn, {
|
|
2257
2300
|
i: t,
|
|
2258
2301
|
point: e,
|
|
2259
2302
|
updatePoint: (e) => i(e, t),
|
|
2260
2303
|
disabled: r
|
|
2261
2304
|
}, `py${t}${e[1]}`)]);
|
|
2262
|
-
return /* @__PURE__ */
|
|
2263
|
-
className:
|
|
2305
|
+
return /* @__PURE__ */ J("div", {
|
|
2306
|
+
className: tr.scrollContainer,
|
|
2264
2307
|
children: a.flat()
|
|
2265
2308
|
}, "polygon");
|
|
2266
2309
|
}
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
var $n = {
|
|
2310
|
+
// src/SelectionConfig.tsx
|
|
2311
|
+
var rr = {
|
|
2270
2312
|
line: "—",
|
|
2271
2313
|
rectangle: "▭",
|
|
2272
2314
|
polyline: "⦚",
|
|
@@ -2278,102 +2320,101 @@ var $n = {
|
|
|
2278
2320
|
verticalAxis: "↕",
|
|
2279
2321
|
unknown: " "
|
|
2280
2322
|
};
|
|
2281
|
-
function
|
|
2282
|
-
let { currentSelectionID:
|
|
2283
|
-
if (
|
|
2284
|
-
let e =
|
|
2323
|
+
function ir(e) {
|
|
2324
|
+
let { currentSelectionID: n, updateCurrentSelectionID: i, selections: a, updateSelection: o, hasBaton: s } = e, c = r(() => {
|
|
2325
|
+
if (n) {
|
|
2326
|
+
let e = a.find((e) => e.id === n);
|
|
2285
2327
|
if (e) {
|
|
2286
|
-
let
|
|
2287
|
-
if (Object.hasOwn(
|
|
2328
|
+
let t;
|
|
2329
|
+
if (Object.hasOwn(a, "findLast")) t = a.findLast((e) => e.id !== n);
|
|
2288
2330
|
else {
|
|
2289
|
-
let e =
|
|
2290
|
-
|
|
2331
|
+
let e = a.filter((e) => e.id !== n), r = e.length - 1;
|
|
2332
|
+
r >= 0 && (t = e[r]);
|
|
2291
2333
|
}
|
|
2292
|
-
|
|
2334
|
+
o && o(e, !1, !0), t && i(t.id);
|
|
2293
2335
|
}
|
|
2294
2336
|
}
|
|
2295
2337
|
}, [
|
|
2296
|
-
t,
|
|
2297
|
-
i,
|
|
2298
2338
|
n,
|
|
2299
|
-
a
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2339
|
+
a,
|
|
2340
|
+
i,
|
|
2341
|
+
o
|
|
2342
|
+
]), l = [];
|
|
2343
|
+
if (n && a.length > 0) {
|
|
2344
|
+
let e = a.find((e) => e.id === n) ?? a[0];
|
|
2345
|
+
l.push(/* @__PURE__ */ J("h4", { children: ln(e, rr) }, `ID${n}`)), l.push(/* @__PURE__ */ Y(t, { children: [
|
|
2346
|
+
/* @__PURE__ */ J("div", {
|
|
2347
|
+
className: zn.colourLabel,
|
|
2306
2348
|
style: { borderLeftColor: e.colour },
|
|
2307
2349
|
children: e.colour
|
|
2308
2350
|
}, `Colour${e.colour}`),
|
|
2309
|
-
/* @__PURE__ */
|
|
2310
|
-
|
|
2351
|
+
/* @__PURE__ */ J("br", {}, "colour spacer"),
|
|
2352
|
+
s && /* @__PURE__ */ J(Ue, {
|
|
2311
2353
|
color: e.colour,
|
|
2312
2354
|
onChange: (t) => {
|
|
2313
|
-
if (
|
|
2355
|
+
if (o) {
|
|
2314
2356
|
let n = $t(e);
|
|
2315
|
-
n && (n.colour = t,
|
|
2357
|
+
n && (n.colour = t, o(n));
|
|
2316
2358
|
}
|
|
2317
2359
|
}
|
|
2318
2360
|
}, `Picker${e.colour}`)
|
|
2319
2361
|
] }, "colour"));
|
|
2320
|
-
let
|
|
2321
|
-
|
|
2362
|
+
let r = !s;
|
|
2363
|
+
l.push(/* @__PURE__ */ J($, {
|
|
2322
2364
|
label: "name",
|
|
2323
2365
|
input: e.name,
|
|
2324
2366
|
updateValue: (t) => {
|
|
2325
|
-
if (
|
|
2367
|
+
if (o) {
|
|
2326
2368
|
let n = $t(e);
|
|
2327
|
-
n && (n.name = t,
|
|
2369
|
+
n && (n.name = t, o(n));
|
|
2328
2370
|
}
|
|
2329
2371
|
},
|
|
2330
|
-
disabled:
|
|
2331
|
-
}, `Name${e.name}`)),
|
|
2372
|
+
disabled: r
|
|
2373
|
+
}, `Name${e.name}`)), l.push(/* @__PURE__ */ J($, {
|
|
2332
2374
|
label: "alpha",
|
|
2333
2375
|
input: e.alpha,
|
|
2334
2376
|
updateValue: (t) => {
|
|
2335
|
-
if (t <= 1 && t >= 0 &&
|
|
2377
|
+
if (t <= 1 && t >= 0 && o) {
|
|
2336
2378
|
let n = $t(e);
|
|
2337
|
-
n && (n.alpha = t,
|
|
2379
|
+
n && (n.alpha = t, o(n));
|
|
2338
2380
|
}
|
|
2339
2381
|
},
|
|
2340
2382
|
decimalPlaces: 2,
|
|
2341
|
-
isValid: (e) =>
|
|
2342
|
-
disabled:
|
|
2343
|
-
}, `Alpha${e.alpha}`)), Ht.isShape(e) ?
|
|
2383
|
+
isValid: (e) => Tt(e, 1, !0),
|
|
2384
|
+
disabled: r
|
|
2385
|
+
}, `Alpha${e.alpha}`)), Ht.isShape(e) ? l.push(Qn({
|
|
2344
2386
|
selection: e,
|
|
2345
|
-
updateSelection:
|
|
2346
|
-
disabled:
|
|
2347
|
-
})) : qt.isShape(e) ?
|
|
2387
|
+
updateSelection: o,
|
|
2388
|
+
disabled: r
|
|
2389
|
+
})) : qt.isShape(e) ? l.push($n({
|
|
2348
2390
|
selection: e,
|
|
2349
|
-
updateSelection:
|
|
2350
|
-
disabled:
|
|
2351
|
-
})) : Yt.isShape(e) ?
|
|
2391
|
+
updateSelection: o,
|
|
2392
|
+
disabled: r
|
|
2393
|
+
})) : Yt.isShape(e) ? l.push(er({
|
|
2352
2394
|
selection: e,
|
|
2353
|
-
updateSelection:
|
|
2354
|
-
disabled:
|
|
2355
|
-
})) : Jt.isShape(e) &&
|
|
2395
|
+
updateSelection: o,
|
|
2396
|
+
disabled: r
|
|
2397
|
+
})) : Jt.isShape(e) && l.push(nr({
|
|
2356
2398
|
selection: e,
|
|
2357
|
-
updateSelection:
|
|
2358
|
-
disabled:
|
|
2359
|
-
})),
|
|
2399
|
+
updateSelection: o,
|
|
2400
|
+
disabled: r
|
|
2401
|
+
})), l.push(/* @__PURE__ */ J(f, {
|
|
2360
2402
|
label: "Clear Selection",
|
|
2361
|
-
disabled:
|
|
2403
|
+
disabled: r || e.permanent,
|
|
2362
2404
|
onClick: () => {
|
|
2363
|
-
window.confirm("Clear selection?") &&
|
|
2405
|
+
window.confirm("Clear selection?") && c();
|
|
2364
2406
|
}
|
|
2365
2407
|
}, "clear selection"));
|
|
2366
2408
|
}
|
|
2367
|
-
return
|
|
2409
|
+
return Rn({
|
|
2368
2410
|
title: "Selections",
|
|
2369
2411
|
showModeless: e.showSelectionConfig,
|
|
2370
2412
|
setShowModeless: e.updateShowSelectionConfig,
|
|
2371
|
-
children:
|
|
2413
|
+
children: l
|
|
2372
2414
|
});
|
|
2373
2415
|
}
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
function tr(e) {
|
|
2416
|
+
// src/SelectionIDDropdown.tsx
|
|
2417
|
+
function ar(e) {
|
|
2377
2418
|
let { selectionID: t, onSelectionIDChange: n, options: r = e.selections.map((e) => e.id) } = e;
|
|
2378
2419
|
t === "" && e.selections.length > 0 && (console.log("Setting selectionID to default selection: ", e.selections[0]), n(e.selections[0].id));
|
|
2379
2420
|
function i(t) {
|
|
@@ -2384,14 +2425,14 @@ function tr(e) {
|
|
|
2384
2425
|
backgroundColor: t.data.bgcolour
|
|
2385
2426
|
}) }, o = r.map((t) => ({
|
|
2386
2427
|
value: t,
|
|
2387
|
-
label: un(e.selections, t,
|
|
2428
|
+
label: un(e.selections, t, rr),
|
|
2388
2429
|
bgcolour: i(t)
|
|
2389
2430
|
}));
|
|
2390
|
-
return /* @__PURE__ */
|
|
2431
|
+
return /* @__PURE__ */ J(qe, {
|
|
2391
2432
|
styles: a,
|
|
2392
2433
|
value: {
|
|
2393
2434
|
value: t,
|
|
2394
|
-
label: un(e.selections, t,
|
|
2435
|
+
label: un(e.selections, t, rr),
|
|
2395
2436
|
bgcolour: i(t ?? "")
|
|
2396
2437
|
},
|
|
2397
2438
|
options: o,
|
|
@@ -2400,266 +2441,269 @@ function tr(e) {
|
|
|
2400
2441
|
}
|
|
2401
2442
|
});
|
|
2402
2443
|
}
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
return Cn({
|
|
2444
|
+
// src/PlotToolbar.tsx
|
|
2445
|
+
function or(e) {
|
|
2446
|
+
return Dn({
|
|
2407
2447
|
title: "Set title",
|
|
2408
|
-
icon:
|
|
2409
|
-
children: /* @__PURE__ */
|
|
2448
|
+
icon: Se,
|
|
2449
|
+
children: /* @__PURE__ */ J($, {
|
|
2410
2450
|
label: "title-label",
|
|
2411
2451
|
input: e.label ?? "",
|
|
2412
2452
|
updateValue: e.setLabel
|
|
2413
2453
|
}, "title-label")
|
|
2414
2454
|
});
|
|
2415
2455
|
}
|
|
2416
|
-
function
|
|
2417
|
-
let {
|
|
2418
|
-
|
|
2419
|
-
let [
|
|
2420
|
-
if (
|
|
2421
|
-
if (
|
|
2422
|
-
if (
|
|
2423
|
-
let e =
|
|
2424
|
-
console.log("Setting current selection", e.id),
|
|
2456
|
+
function sr(e) {
|
|
2457
|
+
let { batonProps: n } = vn(), { children: i } = e, o = Q(), { plotType: c, canEditSelections: d, updateSelection: f, selections: m, canSelect: h, setCurrentLineKey: g } = o, [_, v] = l(null), y = s(() => h && m.length > 0 ? m[m.length - 1].id : null, [h, m]);
|
|
2458
|
+
y && _ === null && (console.log("Setting first selection", y), v(y));
|
|
2459
|
+
let [b, x] = l(!1), [S, C] = l(!1), w = n.hasBaton, T = h && w;
|
|
2460
|
+
if (h) {
|
|
2461
|
+
if (m.map((e) => mn(e)), _ === null) {
|
|
2462
|
+
if (m.length > 0) {
|
|
2463
|
+
let e = m[m.length - 1];
|
|
2464
|
+
console.log("Setting current selection", e.id), v(e.id), b && hn(e);
|
|
2425
2465
|
}
|
|
2426
|
-
} else if (
|
|
2427
|
-
let e =
|
|
2466
|
+
} else if (b) {
|
|
2467
|
+
let e = m.find((e) => e.id === _);
|
|
2428
2468
|
e && hn(e);
|
|
2429
2469
|
}
|
|
2430
2470
|
}
|
|
2431
|
-
let
|
|
2432
|
-
|
|
2471
|
+
let E = c === "Line", D = c === "Heatmap", O = D || c === "Image", k = c === "Surface", A = c === "Scatter", j = A || D || k, M = [
|
|
2472
|
+
Nn({
|
|
2433
2473
|
title: "X axis",
|
|
2434
|
-
icon:
|
|
2435
|
-
label:
|
|
2436
|
-
setLabel:
|
|
2437
|
-
scaleType:
|
|
2438
|
-
scaleOptions:
|
|
2439
|
-
setScaleType:
|
|
2440
|
-
domain:
|
|
2441
|
-
customDomain:
|
|
2442
|
-
setCustomDomain:
|
|
2474
|
+
icon: ke,
|
|
2475
|
+
label: o.xLabel,
|
|
2476
|
+
setLabel: o.setXLabel,
|
|
2477
|
+
scaleType: o.xScaleType,
|
|
2478
|
+
scaleOptions: u,
|
|
2479
|
+
setScaleType: o.setXScaleType,
|
|
2480
|
+
domain: o.xDomain,
|
|
2481
|
+
customDomain: o.xCustomDomain,
|
|
2482
|
+
setCustomDomain: o.setXCustomDomain
|
|
2443
2483
|
}),
|
|
2444
|
-
|
|
2484
|
+
Nn({
|
|
2445
2485
|
title: "Y axis",
|
|
2446
|
-
icon:
|
|
2447
|
-
label:
|
|
2448
|
-
setLabel:
|
|
2449
|
-
scaleType:
|
|
2450
|
-
scaleOptions:
|
|
2451
|
-
setScaleType:
|
|
2452
|
-
domain:
|
|
2453
|
-
customDomain:
|
|
2454
|
-
setCustomDomain:
|
|
2486
|
+
icon: Ae,
|
|
2487
|
+
label: o.yLabel,
|
|
2488
|
+
setLabel: o.setYLabel,
|
|
2489
|
+
scaleType: o.yScaleType,
|
|
2490
|
+
scaleOptions: u,
|
|
2491
|
+
setScaleType: o.setYScaleType,
|
|
2492
|
+
domain: o.yDomain,
|
|
2493
|
+
customDomain: o.yCustomDomain,
|
|
2494
|
+
setCustomDomain: o.setYCustomDomain
|
|
2455
2495
|
}),
|
|
2456
|
-
|
|
2457
|
-
aspect:
|
|
2458
|
-
setAspect:
|
|
2459
|
-
hideToggle: !
|
|
2496
|
+
On({
|
|
2497
|
+
aspect: o.aspect,
|
|
2498
|
+
setAspect: o.setAspect,
|
|
2499
|
+
hideToggle: !O
|
|
2460
2500
|
}),
|
|
2461
|
-
|
|
2462
|
-
label:
|
|
2463
|
-
setLabel:
|
|
2501
|
+
or({
|
|
2502
|
+
label: o.title,
|
|
2503
|
+
setLabel: o.setTitle
|
|
2464
2504
|
}),
|
|
2465
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ J(ee, {
|
|
2466
2506
|
label: "Grid toggle",
|
|
2467
|
-
Icon:
|
|
2468
|
-
value:
|
|
2469
|
-
onToggle:
|
|
2507
|
+
Icon: Te,
|
|
2508
|
+
value: o.showGrid,
|
|
2509
|
+
onToggle: o.toggleShowGrid
|
|
2470
2510
|
}, "Grid toggle"),
|
|
2471
|
-
|
|
2472
|
-
],
|
|
2473
|
-
let e =
|
|
2511
|
+
Pn({ ...n })
|
|
2512
|
+
], N = [], P = s(() => {
|
|
2513
|
+
let e = o.selectionOptions;
|
|
2474
2514
|
if (e !== void 0) return Object.keys(e).map((e) => Xt(e));
|
|
2475
|
-
}, [
|
|
2476
|
-
|
|
2477
|
-
value:
|
|
2478
|
-
onSelectionTypeChange:
|
|
2479
|
-
disabled:
|
|
2480
|
-
options:
|
|
2481
|
-
}, "Selection type"))),
|
|
2482
|
-
|
|
2515
|
+
}, [o.selectionOptions]), F = P === void 0 || P.length !== 0, I = o.selectionType;
|
|
2516
|
+
h && o.selectionType !== void 0 && (I === Z.unknown && P === void 0 && (I = Z.line), F && N.push(/* @__PURE__ */ J(Kn, {
|
|
2517
|
+
value: I,
|
|
2518
|
+
onSelectionTypeChange: o.setSelectionType,
|
|
2519
|
+
disabled: o.mode !== X.selectRegion,
|
|
2520
|
+
options: P
|
|
2521
|
+
}, "Selection type"))), a(() => {
|
|
2522
|
+
F && o.setSelectionType(I);
|
|
2483
2523
|
}, [
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2524
|
+
F,
|
|
2525
|
+
I,
|
|
2526
|
+
o
|
|
2487
2527
|
]);
|
|
2488
|
-
let
|
|
2489
|
-
|
|
2490
|
-
}, [
|
|
2491
|
-
|
|
2528
|
+
let R = o.allLineParams, z = r((e) => {
|
|
2529
|
+
R.has(e) && g(e), C(!0);
|
|
2530
|
+
}, [R, g]);
|
|
2531
|
+
N.push(/* @__PURE__ */ J(ee, {
|
|
2492
2532
|
label: "Show points",
|
|
2493
|
-
Icon:
|
|
2533
|
+
Icon: Me,
|
|
2494
2534
|
iconOnly: !0,
|
|
2495
|
-
value:
|
|
2496
|
-
onToggle:
|
|
2497
|
-
hidden: !
|
|
2498
|
-
}, "show points")),
|
|
2535
|
+
value: o.showPoints,
|
|
2536
|
+
onToggle: o.toggleShowPoints,
|
|
2537
|
+
hidden: !k
|
|
2538
|
+
}, "show points")), k && N.push(/* @__PURE__ */ J(L, {}, "Show point separator")), N.push(Nn({
|
|
2499
2539
|
title: "Colour mapping",
|
|
2500
|
-
scaleType:
|
|
2501
|
-
setScaleType:
|
|
2502
|
-
scaleOptions:
|
|
2503
|
-
colourMap:
|
|
2504
|
-
setColourMap:
|
|
2505
|
-
invertColourMap:
|
|
2506
|
-
toggleColourMapInversion:
|
|
2507
|
-
domain:
|
|
2508
|
-
customDomain:
|
|
2509
|
-
setCustomDomain:
|
|
2510
|
-
histogramGetter:
|
|
2511
|
-
scatterPointSize:
|
|
2512
|
-
setScatterPointSize:
|
|
2513
|
-
hasBaton:
|
|
2514
|
-
hideToggle: !
|
|
2515
|
-
})),
|
|
2516
|
-
let
|
|
2517
|
-
|
|
2518
|
-
allLineParams:
|
|
2519
|
-
lineKey:
|
|
2520
|
-
onLineKeyChange:
|
|
2540
|
+
scaleType: o.dScaleType,
|
|
2541
|
+
setScaleType: o.setDScaleType,
|
|
2542
|
+
scaleOptions: p,
|
|
2543
|
+
colourMap: o.colourMap,
|
|
2544
|
+
setColourMap: o.setColourMap,
|
|
2545
|
+
invertColourMap: o.invertColourMap,
|
|
2546
|
+
toggleColourMapInversion: o.toggleInvertColourMap,
|
|
2547
|
+
domain: o.dDomain,
|
|
2548
|
+
customDomain: o.dCustomDomain,
|
|
2549
|
+
setCustomDomain: o.setDCustomDomain,
|
|
2550
|
+
histogramGetter: o.histogramGetter,
|
|
2551
|
+
scatterPointSize: A ? o.scatterPointSize : void 0,
|
|
2552
|
+
setScatterPointSize: o.setScatterPointSize,
|
|
2553
|
+
hasBaton: w,
|
|
2554
|
+
hideToggle: !j
|
|
2555
|
+
})), j && N.push(/* @__PURE__ */ J(L, {}, "Colour mapping separator"));
|
|
2556
|
+
let B = [];
|
|
2557
|
+
R.size && (console.log("Add line key dropdown", [...R.keys()]), B.push(/* @__PURE__ */ J(Hn, {
|
|
2558
|
+
allLineParams: R,
|
|
2559
|
+
lineKey: o.currentLineKey,
|
|
2560
|
+
onLineKeyChange: z
|
|
2521
2561
|
}, "key dropdown")));
|
|
2522
|
-
let
|
|
2523
|
-
if (
|
|
2524
|
-
let t =
|
|
2525
|
-
t !== void 0 && (
|
|
2562
|
+
let H = r((e) => {
|
|
2563
|
+
if (h) {
|
|
2564
|
+
let t = m.find((t) => t.id === e);
|
|
2565
|
+
t !== void 0 && (v(e), h && d && f(t)), x(!0);
|
|
2526
2566
|
}
|
|
2527
2567
|
}, [
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2568
|
+
h,
|
|
2569
|
+
m,
|
|
2570
|
+
f,
|
|
2571
|
+
d
|
|
2531
2572
|
]);
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2573
|
+
if (h && m.length > 0) {
|
|
2574
|
+
B.push(/* @__PURE__ */ J(ar, {
|
|
2575
|
+
selections: m,
|
|
2576
|
+
selectionID: _,
|
|
2577
|
+
onSelectionIDChange: H
|
|
2578
|
+
}, "ID dropdown"));
|
|
2579
|
+
let e = m.filter((e) => e.permanent).length, t = m.length - e, n = e === 0 ? "Clear all selections?" : t === 1 ? "Clear single selection?" : `Clear ${t}/${m.length} selections?`;
|
|
2580
|
+
B.push(/* @__PURE__ */ J(Fn, {
|
|
2581
|
+
updateSelection: d ? f : void 0,
|
|
2582
|
+
updateCurrentSelectionID: v,
|
|
2583
|
+
disabled: !T || t === 0,
|
|
2584
|
+
popupText: n
|
|
2585
|
+
}, "Clear all selections"));
|
|
2586
|
+
}
|
|
2587
|
+
return /* @__PURE__ */ Y(V, {
|
|
2588
|
+
overflowChildren: M.concat(B),
|
|
2542
2589
|
children: [
|
|
2543
|
-
/* @__PURE__ */
|
|
2544
|
-
value:
|
|
2545
|
-
onModeChange:
|
|
2546
|
-
hasBaton:
|
|
2547
|
-
canSelect:
|
|
2590
|
+
/* @__PURE__ */ J(In, {
|
|
2591
|
+
value: o.mode,
|
|
2592
|
+
onModeChange: o.setMode,
|
|
2593
|
+
hasBaton: T,
|
|
2594
|
+
canSelect: F
|
|
2548
2595
|
}, "Interaction toggle"),
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
selections:
|
|
2553
|
-
updateSelection:
|
|
2554
|
-
currentSelectionID:
|
|
2555
|
-
updateCurrentSelectionID:
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
showSelectionConfig: p,
|
|
2560
|
-
updateShowSelectionConfig: m,
|
|
2561
|
-
hasBaton: v
|
|
2596
|
+
h && F && /* @__PURE__ */ J(L, {}, "Interaction separator"),
|
|
2597
|
+
N,
|
|
2598
|
+
h && /* @__PURE__ */ J(t, { children: /* @__PURE__ */ J(ir, {
|
|
2599
|
+
selections: m,
|
|
2600
|
+
updateSelection: d ? f : void 0,
|
|
2601
|
+
currentSelectionID: _,
|
|
2602
|
+
updateCurrentSelectionID: v,
|
|
2603
|
+
showSelectionConfig: b,
|
|
2604
|
+
updateShowSelectionConfig: x,
|
|
2605
|
+
hasBaton: T
|
|
2562
2606
|
}) }, "Selection config"),
|
|
2563
|
-
|
|
2564
|
-
allLineParams:
|
|
2565
|
-
updateLineParams:
|
|
2566
|
-
currentLineKey:
|
|
2567
|
-
showLineConfig:
|
|
2568
|
-
updateShowLineConfig:
|
|
2569
|
-
hasBaton:
|
|
2607
|
+
E && /* @__PURE__ */ J(t, { children: /* @__PURE__ */ J(Vn, {
|
|
2608
|
+
allLineParams: R,
|
|
2609
|
+
updateLineParams: o.updateLineParams,
|
|
2610
|
+
currentLineKey: o.currentLineKey,
|
|
2611
|
+
showLineConfig: S,
|
|
2612
|
+
updateShowLineConfig: C,
|
|
2613
|
+
hasBaton: w
|
|
2570
2614
|
}) }, "Line config"),
|
|
2571
|
-
|
|
2615
|
+
i
|
|
2572
2616
|
]
|
|
2573
2617
|
});
|
|
2574
2618
|
}
|
|
2575
|
-
function
|
|
2576
|
-
return e.children !== null && (e.children === void 0 ? /* @__PURE__ */
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2619
|
+
function cr(e) {
|
|
2620
|
+
return e.children !== null && (e.children === void 0 ? /* @__PURE__ */ J(sr, { children: e.extraChildren }) : /* @__PURE__ */ J(V, { children: e.children }));
|
|
2621
|
+
}
|
|
2622
|
+
var lr = {
|
|
2623
|
+
any_plot: "_any_plot_v4794_1",
|
|
2624
|
+
plot_container: "_plot_container_v4794_14",
|
|
2625
|
+
table_container: "_table_container_v4794_29"
|
|
2626
|
+
};
|
|
2627
|
+
// src/HeatmapPlot.tsx
|
|
2628
|
+
function ur({ xValues: e, yValues: t, values: n }) {
|
|
2629
|
+
let { title: r, showGrid: i, xLabel: o, yLabel: s, mode: c, aspect: l, canSelect: u, selectionMax: d, selectionType: f, updateSelection: p, selections: m, dDomain: h, dCustomDomain: g, colourMap: _, invertColourMap: v, dScaleType: y, updateHistogramGetter: b } = Q(), x = Dt(c);
|
|
2630
|
+
return a(() => {
|
|
2631
|
+
b(() => At(n.data, h, _, v));
|
|
2584
2632
|
}, [
|
|
2585
2633
|
n.data,
|
|
2586
2634
|
h,
|
|
2635
|
+
_,
|
|
2587
2636
|
v,
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
]), /* @__PURE__ */ K(_, {
|
|
2637
|
+
b
|
|
2638
|
+
]), /* @__PURE__ */ J(E, {
|
|
2591
2639
|
dataArray: n,
|
|
2592
|
-
domain:
|
|
2593
|
-
colorMap:
|
|
2594
|
-
invertColorMap:
|
|
2595
|
-
scaleType:
|
|
2596
|
-
aspect:
|
|
2640
|
+
domain: U(g, h),
|
|
2641
|
+
colorMap: _,
|
|
2642
|
+
invertColorMap: v,
|
|
2643
|
+
scaleType: y,
|
|
2644
|
+
aspect: l,
|
|
2597
2645
|
showGrid: i,
|
|
2598
2646
|
title: r,
|
|
2599
2647
|
abscissaParams: {
|
|
2600
|
-
label:
|
|
2648
|
+
label: o,
|
|
2601
2649
|
value: e?.data
|
|
2602
2650
|
},
|
|
2603
2651
|
ordinateParams: {
|
|
2604
|
-
label:
|
|
2652
|
+
label: s,
|
|
2605
2653
|
value: t?.data
|
|
2606
2654
|
},
|
|
2607
|
-
interactions:
|
|
2655
|
+
interactions: x,
|
|
2608
2656
|
flipYAxis: !0,
|
|
2609
|
-
children: u && /* @__PURE__ */
|
|
2657
|
+
children: u && /* @__PURE__ */ J(bn, {
|
|
2610
2658
|
modifierKey: [],
|
|
2611
|
-
disabled:
|
|
2659
|
+
disabled: c !== X.selectRegion,
|
|
2612
2660
|
selectionMax: d,
|
|
2613
2661
|
selectionType: f,
|
|
2614
|
-
batonProps: l,
|
|
2615
2662
|
updateSelection: p,
|
|
2616
2663
|
selections: m
|
|
2617
2664
|
})
|
|
2618
2665
|
});
|
|
2619
2666
|
}
|
|
2620
|
-
function
|
|
2621
|
-
return /* @__PURE__ */
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
position: "relative"
|
|
2625
|
-
},
|
|
2626
|
-
children: /* @__PURE__ */ q(xn, {
|
|
2627
|
-
...e,
|
|
2628
|
-
children: [/* @__PURE__ */ K(ir, { children: e.customToolbarChildren }), /* @__PURE__ */ K(ar, {
|
|
2629
|
-
xValues: e.plotConfig.xValues,
|
|
2630
|
-
yValues: e.plotConfig.yValues,
|
|
2631
|
-
values: e.values
|
|
2632
|
-
})]
|
|
2633
|
-
})
|
|
2667
|
+
function dr(e) {
|
|
2668
|
+
return /* @__PURE__ */ J("div", {
|
|
2669
|
+
className: lr.plot_container,
|
|
2670
|
+
children: /* @__PURE__ */ J(wn, { children: /* @__PURE__ */ J(fr, { ...e }) })
|
|
2634
2671
|
});
|
|
2635
2672
|
}
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2673
|
+
function fr(e) {
|
|
2674
|
+
let { updateHeatmapContext: t, updateSelectionContext: n } = Q();
|
|
2675
|
+
return n(e), t(e, e.plotConfig), /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(cr, { children: e.customToolbarChildren }), /* @__PURE__ */ J(ur, {
|
|
2676
|
+
xValues: e.plotConfig.xValues,
|
|
2677
|
+
yValues: e.plotConfig.yValues,
|
|
2678
|
+
values: e.values
|
|
2679
|
+
})] });
|
|
2680
|
+
}
|
|
2681
|
+
// src/ImagePlot.tsx
|
|
2682
|
+
var pr = {
|
|
2639
2683
|
left: 80,
|
|
2640
2684
|
right: 24,
|
|
2641
2685
|
top: 16,
|
|
2642
2686
|
bottom: 34
|
|
2643
|
-
},
|
|
2644
|
-
function
|
|
2645
|
-
let { left: t, right: n, top: r, bottom: i } =
|
|
2687
|
+
}, mr = 28, hr = 24;
|
|
2688
|
+
function gr(e = {}) {
|
|
2689
|
+
let { left: t, right: n, top: r, bottom: i } = pr;
|
|
2646
2690
|
return {
|
|
2647
|
-
left: t + (e.left ?
|
|
2691
|
+
left: t + (e.left ? hr : 0),
|
|
2648
2692
|
right: n,
|
|
2649
|
-
top: r + (e.top ?
|
|
2650
|
-
bottom: i + (e.bottom ?
|
|
2693
|
+
top: r + (e.top ? mr : 0),
|
|
2694
|
+
bottom: i + (e.bottom ? hr : 0)
|
|
2651
2695
|
};
|
|
2652
2696
|
}
|
|
2653
|
-
function
|
|
2697
|
+
function _r(e) {
|
|
2654
2698
|
let t = e.shape;
|
|
2655
|
-
if (t.length == 2) return
|
|
2699
|
+
if (t.length == 2) return Qe(Ze(e), [
|
|
2656
2700
|
1,
|
|
2657
2701
|
1,
|
|
2658
2702
|
3
|
|
2659
2703
|
]);
|
|
2660
2704
|
if (t.length == 3) {
|
|
2661
2705
|
let n = t[2];
|
|
2662
|
-
if (n == 1) return
|
|
2706
|
+
if (n == 1) return Qe(e, [
|
|
2663
2707
|
1,
|
|
2664
2708
|
1,
|
|
2665
2709
|
3
|
|
@@ -2668,10 +2712,10 @@ function dr(e) {
|
|
|
2668
2712
|
}
|
|
2669
2713
|
return console.log("Shape of array is not compatible with RGB array:", t), null;
|
|
2670
2714
|
}
|
|
2671
|
-
function
|
|
2672
|
-
let { title: r, showGrid: i, xLabel: a, yLabel: o, mode: s, aspect: c,
|
|
2673
|
-
return
|
|
2674
|
-
dataArray:
|
|
2715
|
+
function vr({ xValues: e, yValues: t, values: n }) {
|
|
2716
|
+
let { title: r, showGrid: i, xLabel: a, yLabel: o, mode: s, aspect: c, canSelect: l, selectionMax: u, selectionType: d, updateSelection: f, selections: p } = Q(), m = Dt(s), h = _r(n);
|
|
2717
|
+
return h && /* @__PURE__ */ J(j, {
|
|
2718
|
+
dataArray: h,
|
|
2675
2719
|
aspect: c,
|
|
2676
2720
|
showGrid: i,
|
|
2677
2721
|
title: r,
|
|
@@ -2683,26 +2727,28 @@ function fr({ xValues: e, yValues: t, values: n }) {
|
|
|
2683
2727
|
label: o,
|
|
2684
2728
|
value: t?.data
|
|
2685
2729
|
},
|
|
2686
|
-
interactions:
|
|
2730
|
+
interactions: m,
|
|
2687
2731
|
flipYAxis: !0,
|
|
2688
|
-
children:
|
|
2732
|
+
children: l && /* @__PURE__ */ J(bn, {
|
|
2689
2733
|
modifierKey: [],
|
|
2690
2734
|
disabled: s !== X.selectRegion,
|
|
2691
|
-
selectionMax:
|
|
2692
|
-
selectionType:
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
selections: m
|
|
2735
|
+
selectionMax: u,
|
|
2736
|
+
selectionType: d,
|
|
2737
|
+
updateSelection: f,
|
|
2738
|
+
selections: p
|
|
2696
2739
|
})
|
|
2697
2740
|
});
|
|
2698
2741
|
}
|
|
2699
|
-
function
|
|
2700
|
-
|
|
2701
|
-
|
|
2742
|
+
function yr(e) {
|
|
2743
|
+
return /* @__PURE__ */ J(wn, { children: /* @__PURE__ */ J(br, { ...e }) });
|
|
2744
|
+
}
|
|
2745
|
+
function br(e) {
|
|
2746
|
+
let t = c(null), n = c(null), [r, i] = l(), a = !(e.tightAxes && e.aspect == "equal");
|
|
2747
|
+
a && r != "auto" && i("auto"), o(() => {
|
|
2702
2748
|
if (a) return;
|
|
2703
2749
|
let o = () => {
|
|
2704
2750
|
if (t.current == null) return;
|
|
2705
|
-
let a = n.current?.offsetHeight || 0, o = t.current.offsetWidth, s = e.values.shape[1] / e.values.shape[0], c =
|
|
2751
|
+
let a = n.current?.offsetHeight || 0, o = t.current.offsetWidth, s = e.values.shape[1] / e.values.shape[0], c = gr({
|
|
2706
2752
|
left: !!e.plotConfig.yLabel,
|
|
2707
2753
|
bottom: !!e.plotConfig.xLabel,
|
|
2708
2754
|
top: !!e.plotConfig.title
|
|
@@ -2722,34 +2768,25 @@ function pr(e) {
|
|
|
2722
2768
|
e.plotConfig.yLabel,
|
|
2723
2769
|
r,
|
|
2724
2770
|
i
|
|
2725
|
-
])
|
|
2771
|
+
]);
|
|
2772
|
+
let { updateImageContext: s, updateSelectionContext: u } = Q();
|
|
2773
|
+
return u(e), s(e, e.plotConfig), /* @__PURE__ */ Y("div", {
|
|
2726
2774
|
ref: t,
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
minWidth: 0,
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
children: [/* @__PURE__ */ K("div", {
|
|
2739
|
-
ref: n,
|
|
2740
|
-
style: { minWidth: 0 },
|
|
2741
|
-
children: /* @__PURE__ */ K(ir, { children: e.customToolbarChildren })
|
|
2742
|
-
}), /* @__PURE__ */ K(fr, {
|
|
2743
|
-
xValues: e.plotConfig.xValues,
|
|
2744
|
-
yValues: e.plotConfig.yValues,
|
|
2745
|
-
values: e.values
|
|
2746
|
-
})]
|
|
2747
|
-
})
|
|
2775
|
+
className: lr.plot_container,
|
|
2776
|
+
style: { aspectRatio: r },
|
|
2777
|
+
children: [/* @__PURE__ */ J("div", {
|
|
2778
|
+
ref: n,
|
|
2779
|
+
style: { minWidth: 0 },
|
|
2780
|
+
children: /* @__PURE__ */ J(cr, { children: e.customToolbarChildren })
|
|
2781
|
+
}), /* @__PURE__ */ J(vr, {
|
|
2782
|
+
xValues: e.plotConfig.xValues,
|
|
2783
|
+
yValues: e.plotConfig.yValues,
|
|
2784
|
+
values: e.values
|
|
2785
|
+
})]
|
|
2748
2786
|
});
|
|
2749
2787
|
}
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
function mr(e, t, n) {
|
|
2788
|
+
// src/LinePlot.tsx
|
|
2789
|
+
function xr(e, t, n) {
|
|
2753
2790
|
let r = [
|
|
2754
2791
|
"rgb(0, 0, 0)",
|
|
2755
2792
|
"rgb(0, 158, 115)",
|
|
@@ -2759,94 +2796,90 @@ function mr(e, t, n) {
|
|
|
2759
2796
|
"rgb(0, 114, 178)",
|
|
2760
2797
|
"rgb(213, 94, 0)",
|
|
2761
2798
|
"rgb(204, 121, 167)"
|
|
2762
|
-
], i = !0, a =
|
|
2763
|
-
t.pointSize ? t.lineOn || (a =
|
|
2799
|
+
], i = !0, a = _.LineAndGlyphs;
|
|
2800
|
+
t.pointSize ? t.lineOn || (a = _.GlyphsOnly) : (t.pointSize = 0, t.lineOn ? a = _.LineOnly : i = !1);
|
|
2764
2801
|
let o = t.colour ?? r[n % r.length];
|
|
2765
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ J(v, {
|
|
2766
2803
|
abscissas: e.x.data,
|
|
2767
2804
|
ordinates: e.y.data,
|
|
2768
2805
|
color: o,
|
|
2769
2806
|
curveType: a,
|
|
2770
|
-
glyphType: t.glyphType ??
|
|
2807
|
+
glyphType: t.glyphType ?? T.Circle,
|
|
2771
2808
|
glyphSize: t.pointSize,
|
|
2772
2809
|
width: t.width ?? 1,
|
|
2773
2810
|
visible: i
|
|
2774
2811
|
}, `data_curve_${n}`);
|
|
2775
2812
|
}
|
|
2776
|
-
function
|
|
2777
|
-
let { title: t, showGrid: n, xCustomDomain: r, xDomain: i, xScaleType:
|
|
2813
|
+
function Sr(e) {
|
|
2814
|
+
let { title: t, showGrid: n, xCustomDomain: r, xDomain: i, xScaleType: o, xLabel: c, yCustomDomain: l, yDomain: u, yScaleType: d, yLabel: f, mode: p, allLineParams: m, setAllLineParams: h, currentLineKey: g, setCurrentLineKey: _, canSelect: v, selectionMax: y, selectionType: x, updateSelection: S, selections: C } = Q(), w = e.lineData, T = s(() => {
|
|
2778
2815
|
let e = /* @__PURE__ */ new Map();
|
|
2779
2816
|
return w.forEach((t) => {
|
|
2780
2817
|
e.set(t.key, t.lineParams);
|
|
2781
2818
|
}), e;
|
|
2782
2819
|
}, [w]);
|
|
2783
|
-
|
|
2784
|
-
if (
|
|
2820
|
+
a(() => {
|
|
2821
|
+
if (g == null && T.size) {
|
|
2785
2822
|
let e = T.keys().next().value;
|
|
2786
|
-
|
|
2823
|
+
_(e);
|
|
2787
2824
|
}
|
|
2788
|
-
|
|
2825
|
+
h(T);
|
|
2789
2826
|
}, [
|
|
2790
|
-
|
|
2827
|
+
g,
|
|
2791
2828
|
T,
|
|
2792
|
-
|
|
2793
|
-
|
|
2829
|
+
h,
|
|
2830
|
+
_
|
|
2794
2831
|
]);
|
|
2795
|
-
let E =
|
|
2832
|
+
let E = Dt(p), D = (e, t) => /* @__PURE__ */ Y("p", { children: [
|
|
2796
2833
|
e.toPrecision(8),
|
|
2797
2834
|
", ",
|
|
2798
2835
|
t.toPrecision(8)
|
|
2799
|
-
] }), O =
|
|
2800
|
-
return /* @__PURE__ */
|
|
2836
|
+
] }), O = s(() => U(r, i), [r, i]), k = s(() => U(l, u), [l, u]);
|
|
2837
|
+
return /* @__PURE__ */ Y(te, {
|
|
2801
2838
|
title: t ?? "",
|
|
2802
2839
|
abscissaConfig: {
|
|
2803
2840
|
visDomain: O,
|
|
2804
2841
|
showGrid: n,
|
|
2805
|
-
scaleType:
|
|
2806
|
-
label:
|
|
2842
|
+
scaleType: o,
|
|
2843
|
+
label: c,
|
|
2807
2844
|
nice: !0
|
|
2808
2845
|
},
|
|
2809
2846
|
ordinateConfig: {
|
|
2810
2847
|
visDomain: k,
|
|
2811
2848
|
showGrid: n,
|
|
2812
|
-
scaleType:
|
|
2813
|
-
label:
|
|
2849
|
+
scaleType: d,
|
|
2850
|
+
label: f,
|
|
2814
2851
|
nice: !0
|
|
2815
2852
|
},
|
|
2816
2853
|
children: [
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
w.map((e, t) =>
|
|
2821
|
-
v && /* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ J(b, { ...E }),
|
|
2855
|
+
/* @__PURE__ */ J(A, {}),
|
|
2856
|
+
/* @__PURE__ */ J(H, { renderTooltip: D }),
|
|
2857
|
+
w.map((e, t) => xr(e, m.get(e.key) ?? e.lineParams, t)),
|
|
2858
|
+
v && /* @__PURE__ */ J(bn, {
|
|
2822
2859
|
modifierKey: [],
|
|
2823
|
-
|
|
2824
|
-
disabled: f !== X.selectRegion,
|
|
2860
|
+
disabled: p !== X.selectRegion,
|
|
2825
2861
|
selectionMax: y,
|
|
2826
|
-
selectionType:
|
|
2862
|
+
selectionType: x,
|
|
2827
2863
|
updateSelection: S,
|
|
2828
2864
|
selections: C
|
|
2829
2865
|
})
|
|
2830
2866
|
]
|
|
2831
2867
|
});
|
|
2832
2868
|
}
|
|
2833
|
-
function
|
|
2834
|
-
return /* @__PURE__ */
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
position: "relative"
|
|
2838
|
-
},
|
|
2839
|
-
children: /* @__PURE__ */ q(xn, {
|
|
2840
|
-
...e,
|
|
2841
|
-
children: [/* @__PURE__ */ K(ir, { children: e.customToolbarChildren }), /* @__PURE__ */ K(hr, { lineData: e.lineData })]
|
|
2842
|
-
})
|
|
2869
|
+
function Cr(e) {
|
|
2870
|
+
return /* @__PURE__ */ J("div", {
|
|
2871
|
+
className: lr.plot_container,
|
|
2872
|
+
children: /* @__PURE__ */ J(wn, { children: /* @__PURE__ */ J(wr, { ...e }) })
|
|
2843
2873
|
});
|
|
2844
2874
|
}
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2875
|
+
function wr(e) {
|
|
2876
|
+
let { updateLineContext: t, updateSelectionContext: n } = Q();
|
|
2877
|
+
return n(e), t(e.xDomain, e.yDomain, e.plotConfig), /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(cr, { children: e.customToolbarChildren }), /* @__PURE__ */ J(Sr, { lineData: e.lineData })] });
|
|
2878
|
+
}
|
|
2879
|
+
// src/ScatterPlot.tsx
|
|
2880
|
+
function Tr({ x: e, y: t, values: n }) {
|
|
2881
|
+
let { title: r, showGrid: i, xLabel: o, xScaleType: s, yLabel: c, yScaleType: l, mode: u, canSelect: d, selectionMax: f, selectionType: p, updateSelection: m, selections: h, dDomain: g, dCustomDomain: _, colourMap: v, invertColourMap: y, dScaleType: b, scatterPointSize: x, updateHistogramGetter: S } = Q(), C = Dt(u);
|
|
2882
|
+
return a(() => {
|
|
2850
2883
|
S(() => At(n.data, g, v, y));
|
|
2851
2884
|
}, [
|
|
2852
2885
|
n.data,
|
|
@@ -2854,9 +2887,9 @@ function _r({ x: e, y: t, values: n }) {
|
|
|
2854
2887
|
v,
|
|
2855
2888
|
y,
|
|
2856
2889
|
S
|
|
2857
|
-
]), /* @__PURE__ */
|
|
2890
|
+
]), /* @__PURE__ */ J(F, {
|
|
2858
2891
|
dataArray: n,
|
|
2859
|
-
domain:
|
|
2892
|
+
domain: U(_, g),
|
|
2860
2893
|
colorMap: v,
|
|
2861
2894
|
invertColorMap: y,
|
|
2862
2895
|
scaleType: b,
|
|
@@ -2864,80 +2897,73 @@ function _r({ x: e, y: t, values: n }) {
|
|
|
2864
2897
|
size: x,
|
|
2865
2898
|
title: r,
|
|
2866
2899
|
abscissaParams: {
|
|
2867
|
-
label:
|
|
2900
|
+
label: o,
|
|
2868
2901
|
value: e.data,
|
|
2869
|
-
scaleType:
|
|
2902
|
+
scaleType: s
|
|
2870
2903
|
},
|
|
2871
2904
|
ordinateParams: {
|
|
2872
|
-
label:
|
|
2905
|
+
label: c,
|
|
2873
2906
|
value: t.data,
|
|
2874
|
-
scaleType:
|
|
2907
|
+
scaleType: l
|
|
2875
2908
|
},
|
|
2876
2909
|
interactions: C,
|
|
2877
|
-
children: d && /* @__PURE__ */
|
|
2910
|
+
children: d && /* @__PURE__ */ J(bn, {
|
|
2878
2911
|
modifierKey: [],
|
|
2879
|
-
disabled:
|
|
2912
|
+
disabled: u !== X.selectRegion,
|
|
2880
2913
|
selectionMax: f,
|
|
2881
2914
|
selectionType: p,
|
|
2882
|
-
batonProps: u,
|
|
2883
2915
|
updateSelection: m,
|
|
2884
2916
|
selections: h
|
|
2885
2917
|
})
|
|
2886
2918
|
});
|
|
2887
2919
|
}
|
|
2888
|
-
function
|
|
2889
|
-
return /* @__PURE__ */
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
position: "relative"
|
|
2893
|
-
},
|
|
2894
|
-
children: /* @__PURE__ */ q(xn, {
|
|
2895
|
-
...e,
|
|
2896
|
-
children: [/* @__PURE__ */ K(ir, { children: e.customToolbarChildren }), /* @__PURE__ */ K(_r, {
|
|
2897
|
-
x: e.x,
|
|
2898
|
-
y: e.y,
|
|
2899
|
-
values: e.pointValues
|
|
2900
|
-
})]
|
|
2901
|
-
})
|
|
2920
|
+
function Er(e) {
|
|
2921
|
+
return /* @__PURE__ */ J("div", {
|
|
2922
|
+
className: lr.plot_container,
|
|
2923
|
+
children: /* @__PURE__ */ J(wn, { children: /* @__PURE__ */ J(Dr, { ...e }) })
|
|
2902
2924
|
});
|
|
2903
2925
|
}
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2926
|
+
function Dr(e) {
|
|
2927
|
+
let { updateScatterContext: t, updateSelectionContext: n } = Q();
|
|
2928
|
+
return n(e), t(e, e.plotConfig), /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(cr, { children: e.customToolbarChildren }), /* @__PURE__ */ J(Tr, {
|
|
2929
|
+
x: e.x,
|
|
2930
|
+
y: e.y,
|
|
2931
|
+
values: e.pointValues
|
|
2932
|
+
})] });
|
|
2933
|
+
}
|
|
2934
|
+
// src/SurfacePlot.tsx
|
|
2935
|
+
function Or(e) {
|
|
2936
|
+
let { values: t, children: n } = e, { dDomain: r, dCustomDomain: i, colourMap: o, invertColourMap: c, dScaleType: l, showPoints: u, updateHistogramGetter: d } = Q(), f = s(() => U(i, r), [i, r]);
|
|
2937
|
+
return a(() => {
|
|
2938
|
+
d(() => At(t.data, r, o, c));
|
|
2910
2939
|
}, [
|
|
2911
2940
|
t.data,
|
|
2912
2941
|
r,
|
|
2913
|
-
a,
|
|
2914
2942
|
o,
|
|
2915
|
-
|
|
2916
|
-
|
|
2943
|
+
c,
|
|
2944
|
+
d
|
|
2945
|
+
]), /* @__PURE__ */ Y(R, {
|
|
2917
2946
|
dataArray: t,
|
|
2918
|
-
domain:
|
|
2919
|
-
colorMap:
|
|
2920
|
-
invertColorMap:
|
|
2921
|
-
scaleType:
|
|
2922
|
-
showPoints:
|
|
2923
|
-
children: [/* @__PURE__ */
|
|
2947
|
+
domain: f,
|
|
2948
|
+
colorMap: o,
|
|
2949
|
+
invertColorMap: c,
|
|
2950
|
+
scaleType: l,
|
|
2951
|
+
showPoints: u,
|
|
2952
|
+
children: [/* @__PURE__ */ J($e, {}), n]
|
|
2924
2953
|
});
|
|
2925
2954
|
}
|
|
2926
|
-
function
|
|
2927
|
-
return /* @__PURE__ */
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
position: "relative"
|
|
2931
|
-
},
|
|
2932
|
-
children: /* @__PURE__ */ q(xn, {
|
|
2933
|
-
...e,
|
|
2934
|
-
children: [/* @__PURE__ */ K(ir, { children: e.customToolbarChildren }), /* @__PURE__ */ K(yr, { values: e.heightValues })]
|
|
2935
|
-
})
|
|
2955
|
+
function kr(e) {
|
|
2956
|
+
return /* @__PURE__ */ J("div", {
|
|
2957
|
+
className: lr.plot_container,
|
|
2958
|
+
children: /* @__PURE__ */ J(wn, { children: /* @__PURE__ */ J(Ar, { ...e }) })
|
|
2936
2959
|
});
|
|
2937
2960
|
}
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2961
|
+
function Ar(e) {
|
|
2962
|
+
let { updateSurfaceContext: t } = Q();
|
|
2963
|
+
return t(e, e.plotConfig), /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(cr, { children: e.customToolbarChildren }), /* @__PURE__ */ J(Or, { values: e.heightValues })] });
|
|
2964
|
+
}
|
|
2965
|
+
// src/TableDisplay.tsx
|
|
2966
|
+
function jr(e) {
|
|
2941
2967
|
function t(e, t) {
|
|
2942
2968
|
let n = e === "standard";
|
|
2943
2969
|
return new Intl.NumberFormat("en", {
|
|
@@ -2946,96 +2972,117 @@ function xr(e) {
|
|
|
2946
2972
|
maximumSignificantDigits: n ? void 0 : Math.max(t, 1)
|
|
2947
2973
|
});
|
|
2948
2974
|
}
|
|
2949
|
-
let [n, r] =
|
|
2950
|
-
|
|
2975
|
+
let [n, r] = l(e.displayParams?.displayType ?? "standard"), [i, a] = l(e.displayParams?.numberDigits ?? 2), [o, s] = l(e.cellWidth), [c, u] = l(null);
|
|
2976
|
+
c ?? u(t(n, i));
|
|
2951
2977
|
function d(e) {
|
|
2952
2978
|
r(e);
|
|
2953
2979
|
}
|
|
2954
|
-
return /* @__PURE__ */
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
children: [/* @__PURE__ */ q(te, { children: [
|
|
2960
|
-
/* @__PURE__ */ K(a, {
|
|
2961
|
-
value: s,
|
|
2980
|
+
return /* @__PURE__ */ Y("div", {
|
|
2981
|
+
className: `${lr.plot_container} ${lr.table_container}`,
|
|
2982
|
+
children: [/* @__PURE__ */ Y(V, { children: [
|
|
2983
|
+
/* @__PURE__ */ J(m, {
|
|
2984
|
+
value: o,
|
|
2962
2985
|
defaultValue: 120,
|
|
2963
|
-
onChange:
|
|
2986
|
+
onChange: s
|
|
2964
2987
|
}, "cell width input"),
|
|
2965
|
-
/* @__PURE__ */
|
|
2966
|
-
/* @__PURE__ */
|
|
2988
|
+
/* @__PURE__ */ J(L, {}),
|
|
2989
|
+
/* @__PURE__ */ Y(B, {
|
|
2967
2990
|
role: "radiogroup",
|
|
2968
2991
|
ariaLabel: "displayStyle",
|
|
2969
2992
|
value: n,
|
|
2970
2993
|
onChange: d,
|
|
2971
|
-
children: [/* @__PURE__ */
|
|
2994
|
+
children: [/* @__PURE__ */ J(B.Btn, {
|
|
2972
2995
|
label: "standard",
|
|
2973
2996
|
value: "standard"
|
|
2974
|
-
}), /* @__PURE__ */
|
|
2997
|
+
}), /* @__PURE__ */ J(B.Btn, {
|
|
2975
2998
|
label: "scientific",
|
|
2976
2999
|
value: "scientific"
|
|
2977
3000
|
})]
|
|
2978
3001
|
}, "display style toggle"),
|
|
2979
|
-
/* @__PURE__ */
|
|
2980
|
-
/* @__PURE__ */
|
|
3002
|
+
/* @__PURE__ */ J(L, {}),
|
|
3003
|
+
/* @__PURE__ */ J($, {
|
|
2981
3004
|
label: "digits",
|
|
2982
3005
|
input: i,
|
|
2983
|
-
isValid: (e) =>
|
|
3006
|
+
isValid: (e) => wt(e, n === "standard" ? 0 : 1, 10),
|
|
2984
3007
|
inputAttribs: {
|
|
2985
3008
|
name: "digits",
|
|
2986
3009
|
pattern: "^\\d$",
|
|
2987
3010
|
size: 1
|
|
2988
3011
|
},
|
|
2989
|
-
updateValue:
|
|
3012
|
+
updateValue: a
|
|
2990
3013
|
}, "0"),
|
|
2991
|
-
/* @__PURE__ */
|
|
2992
|
-
] }), /* @__PURE__ */
|
|
2993
|
-
cellWidth:
|
|
3014
|
+
/* @__PURE__ */ J(L, {})
|
|
3015
|
+
] }), /* @__PURE__ */ J(O, {
|
|
3016
|
+
cellWidth: o ?? 120,
|
|
2994
3017
|
dims: e.cellValues.shape,
|
|
2995
3018
|
cellFormatter: (t, n) => {
|
|
2996
3019
|
let r = e.cellValues.get(t, n);
|
|
2997
|
-
return
|
|
3020
|
+
return c?.format(r) || "";
|
|
2998
3021
|
}
|
|
2999
3022
|
})]
|
|
3000
3023
|
});
|
|
3001
3024
|
}
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3025
|
+
// src/AnyPlot.tsx
|
|
3026
|
+
function Mr(e) {
|
|
3027
|
+
let { updateLineContext: t, updateHeatmapContext: n, updateImageContext: r, updateSelectionContext: i, updateSurfaceContext: o, updateScatterContext: s } = Q(), c = "lineData" in e && e.lineData.length !== 0, l = "heatmapScale" in e, u = !l && "values" in e, d = "heightValues" in e, f = "pointValues" in e, p = "cellWidth" in e;
|
|
3028
|
+
a(() => {
|
|
3029
|
+
if (!(d || p)) {
|
|
3030
|
+
let { canEditSelections: t, selections: n, selectionOptions: r, selectionsListener: a } = e, o = {
|
|
3031
|
+
canEditSelections: t,
|
|
3032
|
+
selections: n,
|
|
3033
|
+
selectionOptions: r,
|
|
3034
|
+
selectionsListener: a
|
|
3035
|
+
};
|
|
3036
|
+
Object.values(o).every((e) => e === void 0) || (console.log("USC", o), i(o));
|
|
3037
|
+
}
|
|
3038
|
+
}, [
|
|
3039
|
+
d,
|
|
3040
|
+
p,
|
|
3041
|
+
i,
|
|
3042
|
+
e
|
|
3043
|
+
]), a(() => {
|
|
3044
|
+
c ? t(e.xDomain, e.yDomain, e.plotConfig) : l ? n(e, e.plotConfig) : u ? r(e, e.plotConfig) : d ? o(e, e.plotConfig) : f && s(e, e.plotConfig);
|
|
3045
|
+
}, [
|
|
3046
|
+
c,
|
|
3047
|
+
l,
|
|
3048
|
+
u,
|
|
3049
|
+
d,
|
|
3050
|
+
f,
|
|
3051
|
+
t,
|
|
3052
|
+
n,
|
|
3053
|
+
r,
|
|
3054
|
+
o,
|
|
3055
|
+
s,
|
|
3056
|
+
e
|
|
3057
|
+
]);
|
|
3058
|
+
let m = null;
|
|
3059
|
+
return c ? m = /* @__PURE__ */ J(Sr, { lineData: e.lineData }) : l ? m = /* @__PURE__ */ J(ur, {
|
|
3007
3060
|
xValues: e.plotConfig.xValues,
|
|
3008
3061
|
yValues: e.plotConfig.yValues,
|
|
3009
3062
|
values: e.values
|
|
3010
|
-
}) : /* @__PURE__ */
|
|
3063
|
+
}) : u ? m = /* @__PURE__ */ J(vr, {
|
|
3011
3064
|
xValues: e.plotConfig.xValues,
|
|
3012
3065
|
yValues: e.plotConfig.yValues,
|
|
3013
3066
|
values: e.values
|
|
3014
|
-
}) :
|
|
3067
|
+
}) : d ? m = /* @__PURE__ */ J(Or, { values: e.heightValues }) : f ? m = /* @__PURE__ */ J(Tr, {
|
|
3015
3068
|
x: e.x,
|
|
3016
3069
|
y: e.y,
|
|
3017
3070
|
values: e.pointValues
|
|
3018
|
-
})),
|
|
3071
|
+
}) : p && (m = /* @__PURE__ */ J(jr, { ...e })), m;
|
|
3019
3072
|
}
|
|
3020
|
-
function
|
|
3073
|
+
function Nr(t) {
|
|
3021
3074
|
let n = jt();
|
|
3022
|
-
|
|
3075
|
+
e(() => {
|
|
3023
3076
|
n.end();
|
|
3024
|
-
})
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
},
|
|
3030
|
-
children: /* @__PURE__ */ q(xn, {
|
|
3031
|
-
...t,
|
|
3032
|
-
children: [/* @__PURE__ */ K(ir, { children: t.customToolbarChildren }), /* @__PURE__ */ K(Sr, { ...t })]
|
|
3033
|
-
})
|
|
3077
|
+
});
|
|
3078
|
+
let r = "cellWidth" in t;
|
|
3079
|
+
return /* @__PURE__ */ J("div", {
|
|
3080
|
+
className: lr.any_plot,
|
|
3081
|
+
children: /* @__PURE__ */ Y(wn, { children: [!r && /* @__PURE__ */ J(cr, { children: t.customToolbarChildren }), /* @__PURE__ */ J(Mr, { ...t })] })
|
|
3034
3082
|
});
|
|
3035
3083
|
}
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
var { default: wr = st } = st, Tr = {
|
|
3084
|
+
// src/ConnectedPlot.tsx
|
|
3085
|
+
var { default: Pr = it } = it, Fr = {
|
|
3039
3086
|
xScale: void 0,
|
|
3040
3087
|
yScale: void 0,
|
|
3041
3088
|
xLabel: void 0,
|
|
@@ -3044,90 +3091,136 @@ var { default: wr = st } = st, Tr = {
|
|
|
3044
3091
|
yValues: void 0,
|
|
3045
3092
|
title: void 0
|
|
3046
3093
|
};
|
|
3047
|
-
function
|
|
3048
|
-
let
|
|
3094
|
+
function Ir({ uuid: e, plotId: t = "plot_0", hostname: n = "127.0.0.1", port: r = "80", baseUrl: i, source: a = void 0, events: o = [], tightAxes: s = !1, customToolbarChildren: c = void 0, depends_on: l = "", canEditSelections: u, selections: d, selectionsListener: f, selectionOptions: p, initialSelections: m }) {
|
|
3095
|
+
let h = l ? "/" + l : "", g = {
|
|
3096
|
+
plotId: t,
|
|
3097
|
+
uuid: e,
|
|
3098
|
+
plotServerURL: `${i ?? `ws://${n}:${r}`}/plot/${e}/${t}${h}`,
|
|
3099
|
+
source: a,
|
|
3100
|
+
events: o,
|
|
3101
|
+
tightAxes: s,
|
|
3102
|
+
customToolbarChildren: c,
|
|
3103
|
+
canEditSelections: u,
|
|
3104
|
+
selections: d,
|
|
3105
|
+
selectionsListener: f,
|
|
3106
|
+
selectionOptions: p,
|
|
3107
|
+
initialSelections: m
|
|
3108
|
+
};
|
|
3109
|
+
return /* @__PURE__ */ J(wn, { children: /* @__PURE__ */ J(Lr, { ...g }) });
|
|
3110
|
+
}
|
|
3111
|
+
function Lr({ uuid: t, plotId: n, plotServerURL: i, source: o, events: s, tightAxes: u = !1, customToolbarChildren: d = void 0, canEditSelections: f, selections: p, selectionsListener: m, selectionOptions: h, initialSelections: g }) {
|
|
3112
|
+
let _ = c(""), v = c(!1), [y, b] = l(), [x, S] = l([]), [C, w] = l(Fr), [T, E] = l(), [D, O] = l(), k = c(), { sendMessage: A, lastMessage: j, readyState: M, getWebSocket: N } = Pr(i, {
|
|
3049
3113
|
onOpen: () => {
|
|
3050
|
-
console.log("%s: WebSocket connected",
|
|
3114
|
+
console.log("%s: WebSocket connected", n);
|
|
3051
3115
|
},
|
|
3052
3116
|
onClose: () => {
|
|
3053
|
-
console.log("%s: WebSocket disconnected",
|
|
3117
|
+
console.log("%s: WebSocket disconnected", n);
|
|
3054
3118
|
},
|
|
3055
3119
|
reconnectAttempts: 5,
|
|
3056
3120
|
reconnectInterval: 5e3,
|
|
3057
|
-
shouldReconnect: (e) =>
|
|
3058
|
-
});
|
|
3059
|
-
z(() => (S.current = "initial", () => {
|
|
3060
|
-
S.current = "unmounted";
|
|
3061
|
-
}), []), i !== void 0 && i != v && (console.log("Setting src", i, v), y(i)), a.length > 0 && a !== b && (console.log("Setting evt", a, b), x(a));
|
|
3062
|
-
let O = R((e) => {
|
|
3063
|
-
console.log("%s: sending", t, e), w(ot(e));
|
|
3064
|
-
}, [t, w]), k = R((e) => {
|
|
3065
|
-
O({ status: e });
|
|
3066
|
-
}, [O]), A = () => {
|
|
3067
|
-
O({ requester: o });
|
|
3068
|
-
}, ee = (e) => {
|
|
3069
|
-
O({ receiver: e });
|
|
3070
|
-
}, [j, te] = H({
|
|
3071
|
-
uuid: o,
|
|
3072
|
-
batonUuid: "",
|
|
3073
|
-
others: [],
|
|
3074
|
-
hasBaton: !1,
|
|
3075
|
-
requestBaton: A,
|
|
3076
|
-
offerBaton: ee
|
|
3077
|
-
}), { selections: ne, updateSelection: M, setSelections: N } = pn(void 0, (e, t, n) => {
|
|
3078
|
-
t || (e === fn.removed ? O({ selectionIds: n ? [n.id] : [] }) : n && O({ selection: en(n) }));
|
|
3121
|
+
shouldReconnect: (e) => _.current !== "unmounted"
|
|
3079
3122
|
});
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3123
|
+
a(() => (_.current = "initial", () => {
|
|
3124
|
+
_.current = "unmounted";
|
|
3125
|
+
}), []);
|
|
3126
|
+
let P = r((e) => {
|
|
3127
|
+
console.log("%s: sending", n, e), A(rt(e));
|
|
3128
|
+
}, [n, A]), F = r((e) => {
|
|
3129
|
+
P({ status: e });
|
|
3130
|
+
}, [P]), I = r(() => {
|
|
3131
|
+
P({ requester: t });
|
|
3132
|
+
}, [t, P]), L = r((e) => {
|
|
3133
|
+
P({ receiver: e });
|
|
3134
|
+
}, [P]), { selections: R, setSelections: z, setSelectionsListener: ee, updateSelectionContext: B } = Q();
|
|
3135
|
+
a(() => {
|
|
3136
|
+
let e = {
|
|
3137
|
+
canEditSelections: f,
|
|
3138
|
+
selections: p,
|
|
3139
|
+
selectionOptions: h,
|
|
3140
|
+
selectionsListener: m
|
|
3141
|
+
};
|
|
3142
|
+
Object.values(e).every((e) => e === void 0) || (console.log("CP", e), B(e));
|
|
3143
|
+
}, [
|
|
3144
|
+
B,
|
|
3145
|
+
f,
|
|
3146
|
+
p,
|
|
3147
|
+
h,
|
|
3148
|
+
m
|
|
3149
|
+
]);
|
|
3150
|
+
let { batonProps: V, setBatonProps: H } = vn();
|
|
3151
|
+
a(() => {
|
|
3152
|
+
H && V.uuid !== t && H({
|
|
3153
|
+
uuid: t,
|
|
3154
|
+
batonUuid: "",
|
|
3155
|
+
others: [],
|
|
3156
|
+
hasBaton: !1,
|
|
3157
|
+
requestBaton: I,
|
|
3158
|
+
offerBaton: L
|
|
3159
|
+
});
|
|
3160
|
+
}, []), ee((e, t, n) => {
|
|
3161
|
+
console.log(t), O(void 0), e === fn.removed ? P({ selectionIds: n ? [n.id] : [] }) : n && P({ selection: en(n) });
|
|
3162
|
+
}), a(() => {
|
|
3163
|
+
if (M === at.OPEN) {
|
|
3164
|
+
let e = N();
|
|
3165
|
+
e && e.binaryType !== "arraybuffer" && (e.binaryType = "arraybuffer", console.log("%s: WebSocket set binaryType", n)), F("ready");
|
|
3084
3166
|
}
|
|
3085
3167
|
}, [
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
]),
|
|
3091
|
-
|
|
3092
|
-
source:
|
|
3093
|
-
events:
|
|
3168
|
+
N,
|
|
3169
|
+
n,
|
|
3170
|
+
M,
|
|
3171
|
+
F
|
|
3172
|
+
]), a(() => {
|
|
3173
|
+
M === at.OPEN && V.hasBaton && (o || s) && P({
|
|
3174
|
+
source: o,
|
|
3175
|
+
events: s
|
|
3094
3176
|
});
|
|
3095
3177
|
}, [
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3178
|
+
s,
|
|
3179
|
+
M,
|
|
3180
|
+
o,
|
|
3181
|
+
V.hasBaton,
|
|
3182
|
+
P
|
|
3101
3183
|
]);
|
|
3102
|
-
let
|
|
3103
|
-
|
|
3104
|
-
},
|
|
3105
|
-
|
|
3184
|
+
let te = () => {
|
|
3185
|
+
S([]), w(Fr), b(null), z([]);
|
|
3186
|
+
}, ne = () => {
|
|
3187
|
+
te(), console.log("%s: data cleared", n, Object.keys(C));
|
|
3106
3188
|
};
|
|
3107
|
-
|
|
3108
|
-
if (
|
|
3109
|
-
let e =
|
|
3110
|
-
|
|
3111
|
-
toastId:
|
|
3189
|
+
a(() => {
|
|
3190
|
+
if (V.batonUuid) {
|
|
3191
|
+
let e = V.hasBaton ? "Baton gained" : "Baton lost";
|
|
3192
|
+
_.current === "initial" && (e = V.hasBaton ? "Taken baton" : "Another client has baton", _.current = ""), ot(e, {
|
|
3193
|
+
toastId: t,
|
|
3112
3194
|
position: "bottom-center",
|
|
3113
3195
|
autoClose: 2e3,
|
|
3114
3196
|
theme: "light"
|
|
3115
3197
|
});
|
|
3116
3198
|
}
|
|
3117
3199
|
}, [
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3200
|
+
V.hasBaton,
|
|
3201
|
+
V.batonUuid,
|
|
3202
|
+
t
|
|
3203
|
+
]), a(() => {
|
|
3204
|
+
let e = k.current;
|
|
3205
|
+
if (y && e && M === at.OPEN && V.hasBaton) {
|
|
3206
|
+
k.current = void 0;
|
|
3207
|
+
for (let t of e) P({ selection: en(t) });
|
|
3208
|
+
}
|
|
3209
|
+
}, [
|
|
3210
|
+
y,
|
|
3211
|
+
M,
|
|
3212
|
+
V.hasBaton,
|
|
3213
|
+
P
|
|
3121
3214
|
]);
|
|
3122
|
-
let
|
|
3123
|
-
|
|
3215
|
+
let re = (e) => {
|
|
3216
|
+
ot(/* @__PURE__ */ J(() => /* @__PURE__ */ J("div", { children: /* @__PURE__ */ Y("h3", { children: [
|
|
3124
3217
|
"Baton requested from ",
|
|
3125
3218
|
e.requester,
|
|
3126
3219
|
" ",
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
/* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ J("br", {}),
|
|
3221
|
+
/* @__PURE__ */ J("button", {
|
|
3129
3222
|
onClick: () => {
|
|
3130
|
-
|
|
3223
|
+
L(e.requester);
|
|
3131
3224
|
},
|
|
3132
3225
|
children: "Approve"
|
|
3133
3226
|
})
|
|
@@ -3142,163 +3235,192 @@ function Er({ plotId: t = "plot_0", hostname: n = "127.0.0.1", port: r = "80", s
|
|
|
3142
3235
|
progress: void 0,
|
|
3143
3236
|
theme: "light"
|
|
3144
3237
|
});
|
|
3145
|
-
},
|
|
3238
|
+
}, U = (e, t, n = !0) => {
|
|
3146
3239
|
console.log("Finding old line with key", e);
|
|
3147
|
-
let r =
|
|
3148
|
-
if (r === -1) return console.log("Line with key", e, "cannot be found"),
|
|
3149
|
-
let i = [...
|
|
3240
|
+
let r = x.findIndex((t) => t.key === e);
|
|
3241
|
+
if (r === -1) return console.log("Line with key", e, "cannot be found"), x;
|
|
3242
|
+
let i = [...x];
|
|
3150
3243
|
return console.debug("Replacing old line params with", t), i[r] = {
|
|
3151
3244
|
...i[r],
|
|
3152
3245
|
...t
|
|
3153
|
-
}, n &&
|
|
3246
|
+
}, n && P({
|
|
3154
3247
|
key: e,
|
|
3155
3248
|
lineParams: t
|
|
3156
3249
|
}), i;
|
|
3157
|
-
},
|
|
3158
|
-
|
|
3159
|
-
...
|
|
3250
|
+
}, ie = (e, t = !0) => {
|
|
3251
|
+
T != null && E({
|
|
3252
|
+
...T,
|
|
3160
3253
|
pointSize: e
|
|
3161
|
-
}), t &&
|
|
3162
|
-
},
|
|
3163
|
-
let r =
|
|
3164
|
-
console.log("%s: setting line state with domains",
|
|
3165
|
-
let a =
|
|
3166
|
-
|
|
3254
|
+
}), t && P({ pointSize: e });
|
|
3255
|
+
}, ae = (e, t) => {
|
|
3256
|
+
let r = lt(e), i = ut(e);
|
|
3257
|
+
console.log("%s: setting line state with domains", n, r, i);
|
|
3258
|
+
let a = t ?? C;
|
|
3259
|
+
S(e), w(a), b({
|
|
3167
3260
|
lineData: e,
|
|
3168
3261
|
xDomain: r,
|
|
3169
3262
|
yDomain: i,
|
|
3170
3263
|
plotConfig: a,
|
|
3171
|
-
updateLineParams:
|
|
3264
|
+
updateLineParams: U
|
|
3172
3265
|
});
|
|
3266
|
+
}, oe = (e) => {
|
|
3267
|
+
let t = e.mlData.map((e) => ht(e));
|
|
3268
|
+
console.log("%s: appending line data", n, Object.keys(t));
|
|
3269
|
+
let r = Math.max(x.length, t.length), i = [];
|
|
3270
|
+
for (let e = 0; e < r; e++) i.push(ct(x[e], t[e]));
|
|
3271
|
+
ae(i);
|
|
3173
3272
|
}, se = (e) => {
|
|
3174
|
-
let
|
|
3175
|
-
|
|
3176
|
-
let r = Math.max(f.length, n.length), i = [];
|
|
3177
|
-
for (let e = 0; e < r; e++) i.push(dt(f[e], n[e]));
|
|
3178
|
-
F(i);
|
|
3179
|
-
}, ce = (e) => {
|
|
3180
|
-
let n = _t(e.plotConfig);
|
|
3181
|
-
if (e.append) se(e);
|
|
3273
|
+
let t = mt(e.plotConfig);
|
|
3274
|
+
if (e.append) oe(e);
|
|
3182
3275
|
else {
|
|
3183
|
-
let r = e.mlData.map((e) =>
|
|
3184
|
-
console.log("%s: new line data",
|
|
3276
|
+
let r = e.mlData.map((e) => ht(e)).filter((e) => e !== null);
|
|
3277
|
+
console.log("%s: new line data", n, r.map((e) => e.key)), ae(r, t);
|
|
3185
3278
|
}
|
|
3186
|
-
},
|
|
3187
|
-
let
|
|
3188
|
-
if (
|
|
3189
|
-
let e =
|
|
3190
|
-
|
|
3279
|
+
}, ce = (e) => {
|
|
3280
|
+
let t = dt(e.imData), r = mt(e.plotConfig);
|
|
3281
|
+
if (g && !v.current) {
|
|
3282
|
+
let e = g(r);
|
|
3283
|
+
e.length > 0 && (v.current = !0, O(e), k.current = e);
|
|
3284
|
+
}
|
|
3285
|
+
if (xt(t)) {
|
|
3286
|
+
let e = t;
|
|
3287
|
+
console.log("%s: new heatmap data", n, Object.keys(e)), b({
|
|
3191
3288
|
...e,
|
|
3192
3289
|
plotConfig: r
|
|
3193
3290
|
});
|
|
3194
|
-
} else console.log("%s: new image data",
|
|
3195
|
-
...
|
|
3291
|
+
} else console.log("%s: new image data", n, Object.keys(t)), b({
|
|
3292
|
+
...t,
|
|
3196
3293
|
plotConfig: r
|
|
3197
3294
|
});
|
|
3198
3295
|
}, le = (e) => {
|
|
3199
|
-
let
|
|
3200
|
-
console.log("%s: new scatter data",
|
|
3201
|
-
let r =
|
|
3202
|
-
|
|
3203
|
-
...
|
|
3296
|
+
let t = gt(e.scData);
|
|
3297
|
+
console.log("%s: new scatter data", n, Object.keys(t));
|
|
3298
|
+
let r = mt(e.plotConfig);
|
|
3299
|
+
E(t), b({
|
|
3300
|
+
...t,
|
|
3204
3301
|
plotConfig: r,
|
|
3205
|
-
setPointSize:
|
|
3302
|
+
setPointSize: ie
|
|
3206
3303
|
});
|
|
3207
3304
|
}, ue = (e) => {
|
|
3208
|
-
let
|
|
3209
|
-
console.log("%s: new surface data",
|
|
3210
|
-
let r =
|
|
3211
|
-
|
|
3212
|
-
...
|
|
3305
|
+
let t = ft(e.suData);
|
|
3306
|
+
console.log("%s: new surface data", n, Object.keys(t));
|
|
3307
|
+
let r = mt(e.plotConfig);
|
|
3308
|
+
b({
|
|
3309
|
+
...t,
|
|
3213
3310
|
plotConfig: r
|
|
3214
3311
|
});
|
|
3312
|
+
}, W = (e) => {
|
|
3313
|
+
let t = pt(e.taData);
|
|
3314
|
+
console.log("%s: new table data", n, Object.keys(t)), b({ ...t });
|
|
3215
3315
|
}, de = (e) => {
|
|
3216
|
-
let
|
|
3217
|
-
console.log("%s:
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
let t = [...e];
|
|
3222
|
-
for (let e of n) {
|
|
3223
|
-
let n = e.id, r = t.findIndex((e) => e.id === n);
|
|
3224
|
-
r === -1 ? t.push(e) : t[r] = e;
|
|
3225
|
-
}
|
|
3226
|
-
return t;
|
|
3227
|
-
})) : (console.log("%s: new selections", t, n), N(n));
|
|
3228
|
-
}, fe = (e) => {
|
|
3229
|
-
let n = e.selectionIds;
|
|
3230
|
-
console.log("%s: clear selections", t, n), n.length === 0 ? N(() => []) : N((e) => {
|
|
3231
|
-
let t = [];
|
|
3232
|
-
for (let r of e) n.includes(r.id) || t.push(r);
|
|
3233
|
-
return t;
|
|
3316
|
+
let t = e.selectionIds;
|
|
3317
|
+
console.log("%s: clear selections", n, t), t.length === 0 ? O(() => []) : O((e) => {
|
|
3318
|
+
let n = [];
|
|
3319
|
+
for (let r of e ?? []) t.includes(r.id) || n.push(r);
|
|
3320
|
+
return n;
|
|
3234
3321
|
});
|
|
3235
|
-
},
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3322
|
+
}, fe = (e) => {
|
|
3323
|
+
let t = e.setSelections.map((e) => $t(e)).filter((e) => e !== null);
|
|
3324
|
+
e.update ? (console.log("%s: update selections", n, t), O((e) => {
|
|
3325
|
+
let n = e ? [...e] : [];
|
|
3326
|
+
for (let e of t) {
|
|
3327
|
+
let t = e.id, r = n.findIndex((e) => e.id === t);
|
|
3328
|
+
r === -1 ? n.push(e) : n[r] = e;
|
|
3329
|
+
}
|
|
3330
|
+
return n;
|
|
3331
|
+
})) : t !== D && (console.log("%s: new selections", n, t, "cf", R), O(t));
|
|
3332
|
+
};
|
|
3333
|
+
a(() => {
|
|
3334
|
+
D !== void 0 && D !== R && (console.log("CP set to new", R, D), z(D));
|
|
3335
|
+
}, [
|
|
3336
|
+
D,
|
|
3337
|
+
R,
|
|
3338
|
+
z
|
|
3339
|
+
]);
|
|
3340
|
+
let [G, K] = l();
|
|
3341
|
+
a(() => {
|
|
3342
|
+
let e = V.uuid;
|
|
3343
|
+
if (H && e && G) {
|
|
3344
|
+
let { baton: t, uuids: n } = G, r = n.filter((t) => t !== e), i = t === e;
|
|
3345
|
+
if (t !== V.batonUuid || !Ot(r, V.others) || i !== V.hasBaton) {
|
|
3346
|
+
let e = {
|
|
3347
|
+
...V,
|
|
3348
|
+
batonUuid: t,
|
|
3349
|
+
others: r,
|
|
3350
|
+
hasBaton: i
|
|
3351
|
+
};
|
|
3352
|
+
H(e);
|
|
3353
|
+
}
|
|
3354
|
+
}
|
|
3355
|
+
}, [
|
|
3356
|
+
G,
|
|
3357
|
+
V,
|
|
3358
|
+
H
|
|
3359
|
+
]), a(() => {
|
|
3360
|
+
if (j === null) return;
|
|
3361
|
+
let t = j.data;
|
|
3362
|
+
if (t instanceof Blob) {
|
|
3363
|
+
console.log("Message was a blob:", t);
|
|
3250
3364
|
return;
|
|
3251
3365
|
}
|
|
3252
|
-
let r =
|
|
3253
|
-
console.log("%s: decodedMessage",
|
|
3366
|
+
let r = nt(t);
|
|
3367
|
+
console.log("%s: decodedMessage", n, Object.keys(r));
|
|
3254
3368
|
let i = jt();
|
|
3255
3369
|
e(() => {
|
|
3256
3370
|
i.end();
|
|
3257
3371
|
});
|
|
3258
3372
|
let a = !0;
|
|
3259
|
-
"mlData" in r ?
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
tightAxes:
|
|
3268
|
-
customToolbarChildren:
|
|
3269
|
-
},
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3373
|
+
if (K(void 0), "mlData" in r ? se(r) : "imData" in r ? ce(r) : "scData" in r ? le(r) : "suData" in r ? ue(r) : "taData" in r ? W(r) : "selectionIds" in r ? de(r) : "setSelections" in r ? fe(r) : "baton" in r ? K(r) : "requester" in r ? re(r) : "plotId" in r ? ne() : (a = !1, console.log("%s: new message type unknown", n)), a) {
|
|
3374
|
+
let e = performance.getEntriesByType("measure").shift();
|
|
3375
|
+
F(`ready ${e?.duration}`);
|
|
3376
|
+
}
|
|
3377
|
+
}, [j]);
|
|
3378
|
+
let pe = y;
|
|
3379
|
+
return pe && (pe = {
|
|
3380
|
+
...pe,
|
|
3381
|
+
tightAxes: u,
|
|
3382
|
+
customToolbarChildren: d
|
|
3383
|
+
}, pe && console.log("%s: plotprops", n, Object.keys(pe))), !M || M === at.UNINSTANTIATED ? /* @__PURE__ */ J("h2", { children: "Waiting for plot server connection" }) : M === at.CLOSING ? /* @__PURE__ */ J("h2", { children: "Closing plot server connection" }) : M === at.CLOSED ? /* @__PURE__ */ J("h2", { children: "Plot server connection closed" }) : pe ? /* @__PURE__ */ Y("div", {
|
|
3384
|
+
className: "connected_plot",
|
|
3385
|
+
style: {
|
|
3386
|
+
display: "grid",
|
|
3387
|
+
position: "relative",
|
|
3388
|
+
height: "100%",
|
|
3389
|
+
minHeight: 0
|
|
3390
|
+
},
|
|
3391
|
+
children: [/* @__PURE__ */ J(cr, { children: d }), /* @__PURE__ */ J(Mr, { ...pe })]
|
|
3392
|
+
}) : /* @__PURE__ */ J("h2", { children: "Awaiting command from plot server" });
|
|
3393
|
+
}
|
|
3394
|
+
// src/VideoPlot.tsx
|
|
3395
|
+
function Rr(e) {
|
|
3396
|
+
let { setFrameloop: t } = me(), n = et(e.sourceUrl), r = n.source.data, i = r.height, o = r.width;
|
|
3397
|
+
return a(() => {
|
|
3398
|
+
e.setSize([i, o]);
|
|
3277
3399
|
}, [
|
|
3278
3400
|
i,
|
|
3279
|
-
|
|
3401
|
+
o,
|
|
3280
3402
|
e
|
|
3281
|
-
]),
|
|
3403
|
+
]), a(() => () => {
|
|
3282
3404
|
t("demand");
|
|
3283
|
-
}, []),
|
|
3405
|
+
}, []), a(() => {
|
|
3284
3406
|
r.complete && t("demand");
|
|
3285
|
-
}, [r.complete, t]),
|
|
3407
|
+
}, [r.complete, t]), a(() => {
|
|
3286
3408
|
t(e.play ? "always" : "demand");
|
|
3287
|
-
}, [e.play, t]),
|
|
3409
|
+
}, [e.play, t]), pe(() => n.needsUpdate = e.play), /* @__PURE__ */ J("meshBasicMaterial", { map: n });
|
|
3288
3410
|
}
|
|
3289
|
-
function
|
|
3290
|
-
let { setFrameloop: t } =
|
|
3291
|
-
|
|
3411
|
+
function zr(e) {
|
|
3412
|
+
let { setFrameloop: t } = me(), n = tt(e.sourceUrl), r = n.source.data;
|
|
3413
|
+
a(() => (r.pause(), () => {
|
|
3292
3414
|
t("demand");
|
|
3293
3415
|
}), []);
|
|
3294
|
-
let i = r.videoHeight,
|
|
3295
|
-
return
|
|
3296
|
-
e.setSize([i,
|
|
3416
|
+
let i = r.videoHeight, o = r.videoWidth;
|
|
3417
|
+
return a(() => {
|
|
3418
|
+
e.setSize([i, o]);
|
|
3297
3419
|
}, [
|
|
3298
3420
|
i,
|
|
3299
|
-
|
|
3421
|
+
o,
|
|
3300
3422
|
e
|
|
3301
|
-
]),
|
|
3423
|
+
]), a(() => {
|
|
3302
3424
|
e.play ? r.play().catch((e) => {
|
|
3303
3425
|
console.log("Could not play: %s", e);
|
|
3304
3426
|
}) : r.pause(), t(e.play ? "always" : "demand");
|
|
@@ -3306,82 +3428,77 @@ function Or(e) {
|
|
|
3306
3428
|
r,
|
|
3307
3429
|
e.play,
|
|
3308
3430
|
t
|
|
3309
|
-
]), /* @__PURE__ */
|
|
3431
|
+
]), /* @__PURE__ */ J("meshBasicMaterial", { map: n });
|
|
3310
3432
|
}
|
|
3311
|
-
function
|
|
3312
|
-
return /* @__PURE__ */
|
|
3433
|
+
function Br(e) {
|
|
3434
|
+
return /* @__PURE__ */ J(C, { children: /* @__PURE__ */ J("button", {
|
|
3313
3435
|
type: "button",
|
|
3314
3436
|
onClick: () => e.clickPlay(),
|
|
3315
|
-
children: /* @__PURE__ */
|
|
3437
|
+
children: /* @__PURE__ */ J("span", { children: e.text })
|
|
3316
3438
|
}) });
|
|
3317
3439
|
}
|
|
3318
|
-
function
|
|
3319
|
-
let { title: t, showGrid: n, xCustomDomain: r, setXCustomDomain: i, xDomain:
|
|
3440
|
+
function Vr(e) {
|
|
3441
|
+
let { title: t, showGrid: n, xCustomDomain: r, setXCustomDomain: i, xDomain: o, xLabel: c, yCustomDomain: u, setYCustomDomain: d, yDomain: f, yLabel: p, mode: m, canSelect: h, selectionMax: g, selectionType: _, updateSelection: v, selections: y } = Q(), { sourceURL: x, isImage: S = !1 } = { ...e }, [C, w] = l(!1), T = Dt(m), E = (e, t) => /* @__PURE__ */ Y("p", { children: [
|
|
3320
3442
|
e.toPrecision(8),
|
|
3321
3443
|
", ",
|
|
3322
3444
|
t.toPrecision(8)
|
|
3323
|
-
] }), [
|
|
3324
|
-
|
|
3325
|
-
i([0,
|
|
3445
|
+
] }), [D, O] = l([1, 1]);
|
|
3446
|
+
a(() => {
|
|
3447
|
+
i([0, D[1]]), d([0, D[0]]);
|
|
3326
3448
|
}, [
|
|
3327
|
-
|
|
3449
|
+
D,
|
|
3328
3450
|
i,
|
|
3329
|
-
|
|
3451
|
+
d
|
|
3330
3452
|
]);
|
|
3331
|
-
let
|
|
3332
|
-
return /* @__PURE__ */
|
|
3453
|
+
let k = s(() => U(r, o), [r, o]), j = s(() => U(u, f), [u, f]);
|
|
3454
|
+
return /* @__PURE__ */ Y(te, {
|
|
3333
3455
|
title: t ?? "",
|
|
3334
3456
|
aspect: "equal",
|
|
3335
3457
|
abscissaConfig: {
|
|
3336
|
-
visDomain:
|
|
3458
|
+
visDomain: k,
|
|
3337
3459
|
showGrid: n,
|
|
3338
3460
|
isIndexAxis: !0,
|
|
3339
|
-
label:
|
|
3461
|
+
label: c,
|
|
3340
3462
|
nice: !0
|
|
3341
3463
|
},
|
|
3342
3464
|
ordinateConfig: {
|
|
3343
|
-
visDomain:
|
|
3465
|
+
visDomain: j,
|
|
3344
3466
|
showGrid: n,
|
|
3345
3467
|
isIndexAxis: !0,
|
|
3346
|
-
label:
|
|
3468
|
+
label: p,
|
|
3347
3469
|
nice: !0
|
|
3348
3470
|
},
|
|
3349
3471
|
children: [
|
|
3350
|
-
/* @__PURE__ */
|
|
3351
|
-
/* @__PURE__ */
|
|
3352
|
-
/* @__PURE__ */
|
|
3353
|
-
clickPlay: () =>
|
|
3354
|
-
text:
|
|
3472
|
+
/* @__PURE__ */ J(b, { ...T }),
|
|
3473
|
+
/* @__PURE__ */ J(A, {}),
|
|
3474
|
+
/* @__PURE__ */ J(Br, {
|
|
3475
|
+
clickPlay: () => w((e) => !e),
|
|
3476
|
+
text: C ? "Pause" : "Play"
|
|
3355
3477
|
}),
|
|
3356
|
-
/* @__PURE__ */
|
|
3357
|
-
/* @__PURE__ */
|
|
3358
|
-
sourceUrl:
|
|
3359
|
-
play:
|
|
3360
|
-
setSize:
|
|
3478
|
+
/* @__PURE__ */ J(H, { renderTooltip: E }),
|
|
3479
|
+
/* @__PURE__ */ J(ne, { children: J(S ? Rr : zr, {
|
|
3480
|
+
sourceUrl: x,
|
|
3481
|
+
play: C,
|
|
3482
|
+
setSize: O
|
|
3361
3483
|
}) }),
|
|
3362
|
-
|
|
3484
|
+
h && /* @__PURE__ */ J(bn, {
|
|
3363
3485
|
modifierKey: [],
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
selections: v
|
|
3486
|
+
disabled: m !== X.selectRegion,
|
|
3487
|
+
selectionMax: g,
|
|
3488
|
+
selectionType: _,
|
|
3489
|
+
updateSelection: v,
|
|
3490
|
+
selections: y
|
|
3370
3491
|
})
|
|
3371
3492
|
]
|
|
3372
3493
|
});
|
|
3373
3494
|
}
|
|
3374
|
-
function
|
|
3375
|
-
return /* @__PURE__ */
|
|
3495
|
+
function Hr(e) {
|
|
3496
|
+
return /* @__PURE__ */ J("div", {
|
|
3376
3497
|
style: {
|
|
3377
3498
|
display: "grid",
|
|
3378
3499
|
position: "relative"
|
|
3379
3500
|
},
|
|
3380
|
-
children: /* @__PURE__ */
|
|
3381
|
-
...e,
|
|
3382
|
-
children: [/* @__PURE__ */ K(ir, { children: e.customToolbarChildren }), /* @__PURE__ */ K(Ar, { ...e })]
|
|
3383
|
-
})
|
|
3501
|
+
children: /* @__PURE__ */ Y(wn, { children: [/* @__PURE__ */ J(cr, { children: e.customToolbarChildren }), /* @__PURE__ */ J(Vr, { ...e })] })
|
|
3384
3502
|
});
|
|
3385
3503
|
}
|
|
3386
|
-
|
|
3387
|
-
export { Cr as AnyPlot, ir as AnyToolbar, Ht as AxialSelection, Vt as BaseSelection, Wt as CircularSectorialSelection, Ut as CircularSelection, Er as ConnectedPlot, Kt as EllipticalSelection, h as GlyphType, or as HeatmapPlot, pr as ImagePlot, X as InteractionModeType, gr as LinePlot, qt as LinearSelection, Gt as OrientableSelection, xn as PlotCustomizationContextProvider, rr as PlotToolbar, Jt as PolygonalSelection, Yt as RectangularSelection, w as ScaleType, vr as ScatterPlot, Z as SelectionType, br as SurfacePlot, xr as TableDisplay, jr as VideoPlot, yn as usePlotCustomizationContext, pn as useSelections };
|
|
3504
|
+
export { Nr as AnyPlot, cr as AnyToolbar, Ht as AxialSelection, Vt as BaseSelection, yn as BatonContextProvider, Wt as CircularSectorialSelection, Ut as CircularSelection, Ir as ConnectedPlot, Kt as EllipticalSelection, w as GlyphType, dr as HeatmapPlot, yr as ImagePlot, X as InteractionModeType, Cr as LinePlot, qt as LinearSelection, Gt as OrientableSelection, wn as PlotCustomizationContextProvider, sr as PlotToolbar, Jt as PolygonalSelection, Yt as RectangularSelection, N as ScaleType, Er as ScatterPlot, Z as SelectionType, kr as SurfacePlot, jr as TableDisplay, Hr as VideoPlot, vn as useBatonContext, Q as usePlotCustomizationContext, pn as useSelections };
|