@diamondlightsource/davidia 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +40 -2
- package/dist/index.js +1276 -1277
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (e,
|
|
4
|
-
import { jsx as l, Fragment as
|
|
5
|
-
import
|
|
6
|
-
import { useRef as
|
|
7
|
-
import { useVisCanvasContext as
|
|
8
|
-
import { GlyphType as
|
|
1
|
+
var Jt = Object.defineProperty;
|
|
2
|
+
var en = (e, n, t) => n in e ? Jt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var A = (e, n, t) => en(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { jsx as l, Fragment as ee, jsxs as S } from "react/jsx-runtime";
|
|
5
|
+
import Dt from "afterframe";
|
|
6
|
+
import { useRef as X, useCallback as te, useMemo as F, useEffect as z, useState as D, createContext as tn, useContext as nn, Fragment as ye } from "react";
|
|
7
|
+
import { useVisCanvasContext as at, useModifierKeyPressed as on, useInteraction as an, MouseButton as sn, useCanvasEvent as je, assertDefined as Xe, Box as ln, SvgElement as Ze, DataToHtml as rn, ScaleType as _e, ToggleBtn as Re, ToggleGroup as W, useVisDomain as cn, useSafeDomain as un, DomainSlider as dn, Histogram as hn, DomainControls as mn, ScaleSelector as fn, ColorMapSelector as gn, ColorMapGradient as yn, Btn as He, Selector as pn, AXIS_SCALE_TYPES as mt, Separator as Te, COLOR_SCALE_TYPES as bn, Toolbar as st, HeatmapVis as Sn, getVisDomain as Oe, RgbVis as vn, VisCanvas as Cn, DefaultInteractions as xn, TooltipMesh as Pn, ResetZoomButton as wn, CurveType as Qe, DataCurve as Dn, GlyphType as Mn, ScatterVis as _n, SurfaceVis as Tn, CellWidthInput as Ln, MatrixVis as kn } from "@h5web/lib";
|
|
8
|
+
import { GlyphType as ka, ScaleType as Aa } from "@h5web/lib";
|
|
9
9
|
import ze from "ndarray";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { bin as
|
|
13
|
-
import { scaleLinear as
|
|
14
|
-
import { Vector3 as
|
|
15
|
-
import { useThree as
|
|
16
|
-
import { useSyncedRef as
|
|
10
|
+
import ft from "ndarray-concat-rows";
|
|
11
|
+
import An from "cwise";
|
|
12
|
+
import { bin as Vn } from "d3-array";
|
|
13
|
+
import { scaleLinear as In } from "d3-scale";
|
|
14
|
+
import { Vector3 as w, Matrix3 as Ne } from "three";
|
|
15
|
+
import { useThree as lt } from "@react-three/fiber";
|
|
16
|
+
import { useSyncedRef as Me, useRafState as $n, useKeyboardEvent as Be, usePrevious as gt, useToggle as Fe, useClickOutside as Mt } from "@react-hookz/web";
|
|
17
17
|
import { Drag as Nn } from "@visx/drag";
|
|
18
|
-
import { BsSlashLg as
|
|
19
|
-
import { MdAspectRatio as
|
|
20
|
-
import { TbZoomPan as
|
|
18
|
+
import { BsSlashLg as Fn, BsCardHeading as On } from "react-icons/bs";
|
|
19
|
+
import { MdAspectRatio as Bn, MdHorizontalRule as zn, MdOutlineRectangle as En, MdOutlinePolyline as Rn, MdOutlineShapeLine as Hn, MdGridOn as Kn } from "react-icons/md";
|
|
20
|
+
import { TbZoomPan as Un, TbZoomInArea as qn, TbPolygon as Gn, TbCircle as Wn, TbOvalVertical as Yn, TbQuestionMark as jn, TbAxisX as Xn, TbAxisY as Zn, TbGridDots as Qn } from "react-icons/tb";
|
|
21
21
|
import "@h5web/lib/dist/styles.css";
|
|
22
|
-
import { IoMdUndo as
|
|
23
|
-
import
|
|
24
|
-
import { format as
|
|
25
|
-
import { HiCursorClick as
|
|
26
|
-
import { IoShapesOutline as
|
|
27
|
-
import { HexColorPicker as
|
|
28
|
-
import { FaCircle as
|
|
29
|
-
import { RxCross1 as
|
|
30
|
-
import { FaSquareFull as
|
|
31
|
-
import
|
|
32
|
-
import { AiOutlineColumnWidth as
|
|
33
|
-
import { BiCircleQuarter as
|
|
34
|
-
import { ArcballControls as
|
|
35
|
-
import { encode as
|
|
36
|
-
import
|
|
37
|
-
import { toast as
|
|
22
|
+
import { IoMdUndo as Jn } from "react-icons/io";
|
|
23
|
+
import _t from "react-draggable";
|
|
24
|
+
import { format as eo } from "d3-format";
|
|
25
|
+
import { HiCursorClick as to } from "react-icons/hi";
|
|
26
|
+
import { IoShapesOutline as no } from "react-icons/io5";
|
|
27
|
+
import { HexColorPicker as Tt } from "react-colorful";
|
|
28
|
+
import { FaCircle as oo } from "react-icons/fa";
|
|
29
|
+
import { RxCross1 as io } from "react-icons/rx";
|
|
30
|
+
import { FaSquareFull as ao } from "react-icons/fa6";
|
|
31
|
+
import Lt from "react-select";
|
|
32
|
+
import { AiOutlineColumnWidth as so, AiOutlineColumnHeight as lo } from "react-icons/ai";
|
|
33
|
+
import { BiCircleQuarter as ro } from "react-icons/bi";
|
|
34
|
+
import { ArcballControls as co } from "@react-three/drei";
|
|
35
|
+
import { encode as uo, decode as ho } from "messagepack";
|
|
36
|
+
import mo, { ReadyState as $e } from "react-use-websocket";
|
|
37
|
+
import { toast as yt } from "react-toastify";
|
|
38
38
|
import "react-toastify/dist/ReactToastify.css";
|
|
39
|
-
const
|
|
39
|
+
const kt = An({
|
|
40
40
|
funcName: "nanMinMax",
|
|
41
41
|
args: ["array"],
|
|
42
42
|
pre: function() {
|
|
@@ -51,26 +51,26 @@ const Lt = kn({
|
|
|
51
51
|
return [this.min, this.max];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
function
|
|
55
|
-
if (
|
|
54
|
+
function fo(e, n) {
|
|
55
|
+
if (n == null) {
|
|
56
56
|
if (e === void 0)
|
|
57
57
|
throw Error("Cannot call with both arguments falsy");
|
|
58
58
|
return e;
|
|
59
59
|
}
|
|
60
60
|
if (e === void 0)
|
|
61
|
-
return
|
|
61
|
+
return n;
|
|
62
62
|
let t;
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
t =
|
|
63
|
+
const o = n.x.size, i = n.y.size;
|
|
64
|
+
if (o === i || o === i + 1)
|
|
65
|
+
t = ft([e.x, n.x]);
|
|
66
66
|
else
|
|
67
67
|
return console.log(
|
|
68
68
|
"x ({$xLength}) and y ({$yLength}) axes must be same length",
|
|
69
|
-
|
|
69
|
+
n
|
|
70
70
|
), e;
|
|
71
|
-
const a =
|
|
72
|
-
Math.min(e.yDomain[0],
|
|
73
|
-
Math.max(e.yDomain[1],
|
|
71
|
+
const a = ft([e.y, n.y]), s = kt(t), u = [
|
|
72
|
+
Math.min(e.yDomain[0], n.yDomain[0]),
|
|
73
|
+
Math.max(e.yDomain[1], n.yDomain[1])
|
|
74
74
|
];
|
|
75
75
|
return {
|
|
76
76
|
key: e.key,
|
|
@@ -82,23 +82,23 @@ function mo(e, o) {
|
|
|
82
82
|
yDomain: u
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function fo(e) {
|
|
86
|
-
const o = e.map((n) => n.xDomain[0]), t = e.map((n) => n.xDomain[1]);
|
|
87
|
-
return o.length == 1 ? [o[0], t[0]] : [Math.min(...o), Math.max(...t)];
|
|
88
|
-
}
|
|
89
85
|
function go(e) {
|
|
90
|
-
const
|
|
91
|
-
return
|
|
86
|
+
const n = e.map((o) => o.xDomain[0]), t = e.map((o) => o.xDomain[1]);
|
|
87
|
+
return n.length == 1 ? [n[0], t[0]] : [Math.min(...n), Math.max(...t)];
|
|
92
88
|
}
|
|
93
89
|
function yo(e) {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
const n = e.map((o) => o.yDomain[0]), t = e.map((o) => o.yDomain[1]);
|
|
91
|
+
return n.length == 1 ? [n[0], t[0]] : [Math.min(...n), Math.max(...t)];
|
|
92
|
+
}
|
|
93
|
+
function po(e) {
|
|
94
|
+
const n = e.values, t = re(n);
|
|
95
|
+
if (At(e)) {
|
|
96
|
+
const o = e;
|
|
97
97
|
return {
|
|
98
|
-
domain:
|
|
99
|
-
heatmapScale:
|
|
100
|
-
colourMap:
|
|
101
|
-
aspect:
|
|
98
|
+
domain: o.domain,
|
|
99
|
+
heatmapScale: o.heatmapScale,
|
|
100
|
+
colourMap: o.colourMap ?? void 0,
|
|
101
|
+
aspect: o.aspect ?? void 0,
|
|
102
102
|
values: t[0]
|
|
103
103
|
};
|
|
104
104
|
} else
|
|
@@ -108,16 +108,16 @@ function yo(e) {
|
|
|
108
108
|
values: t[0]
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
const
|
|
111
|
+
function bo(e) {
|
|
112
|
+
const n = e.heightValues, t = re(n);
|
|
113
113
|
return {
|
|
114
114
|
...e,
|
|
115
115
|
surfaceScale: e.surfaceScale ?? void 0,
|
|
116
116
|
heightValues: t[0]
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
119
|
+
function So(e) {
|
|
120
|
+
const n = e.cellValues, t = re(n);
|
|
121
121
|
return {
|
|
122
122
|
...e,
|
|
123
123
|
displayParams: e.displayParams ?? void 0,
|
|
@@ -125,15 +125,15 @@ function bo(e) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
function Ee(e) {
|
|
128
|
-
let
|
|
129
|
-
return (e == null ? void 0 : e.xValues) != null && (
|
|
128
|
+
let n, t;
|
|
129
|
+
return (e == null ? void 0 : e.xValues) != null && (n = re(e.xValues)[0]), (e == null ? void 0 : e.yValues) != null && (t = re(e.yValues)[0]), {
|
|
130
130
|
...e,
|
|
131
|
-
xValues:
|
|
131
|
+
xValues: n,
|
|
132
132
|
yValues: t
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
135
|
+
function pt(e) {
|
|
136
|
+
const n = e.x, t = re(n, !0), o = e.y, i = re(o, !0);
|
|
137
137
|
return i[0].size == 0 ? null : {
|
|
138
138
|
key: e.key,
|
|
139
139
|
lineParams: e.lineParams,
|
|
@@ -143,8 +143,8 @@ function yt(e) {
|
|
|
143
143
|
yDomain: i[1]
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
const
|
|
146
|
+
function vo(e) {
|
|
147
|
+
const n = e.pointValues, t = re(n), o = e.x, i = re(o), a = e.y, s = re(a);
|
|
148
148
|
return {
|
|
149
149
|
...e,
|
|
150
150
|
x: i[0],
|
|
@@ -152,12 +152,12 @@ function So(e) {
|
|
|
152
152
|
pointValues: t[0]
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
function re(e,
|
|
155
|
+
function re(e, n = !1) {
|
|
156
156
|
if (e.shape.length === 0 || e.shape[0] === 0)
|
|
157
157
|
return [ze(new Int8Array()), [0, 0]];
|
|
158
158
|
const t = e.dtype;
|
|
159
159
|
if (t === "<i8" || t === "<u8") {
|
|
160
|
-
if (!
|
|
160
|
+
if (!n) {
|
|
161
161
|
const d = t === "<i8" ? new BigInt64Array(e.data) : new BigUint64Array(e.data), h = new Float64Array(d);
|
|
162
162
|
return [ze(h, e.shape), [0, 0]];
|
|
163
163
|
}
|
|
@@ -186,85 +186,85 @@ function re(e, o = !1) {
|
|
|
186
186
|
[Number(s[0]), Number(s[1])]
|
|
187
187
|
];
|
|
188
188
|
}
|
|
189
|
-
let
|
|
189
|
+
let o;
|
|
190
190
|
switch (t) {
|
|
191
191
|
case "|i1":
|
|
192
|
-
|
|
192
|
+
o = new Int8Array(e.data);
|
|
193
193
|
break;
|
|
194
194
|
case "<i2":
|
|
195
|
-
|
|
195
|
+
o = new Int16Array(e.data);
|
|
196
196
|
break;
|
|
197
197
|
case "<i4":
|
|
198
|
-
|
|
198
|
+
o = new Int32Array(e.data);
|
|
199
199
|
break;
|
|
200
200
|
case "|u1":
|
|
201
|
-
|
|
201
|
+
o = new Uint8Array(e.data);
|
|
202
202
|
break;
|
|
203
203
|
case "<u2":
|
|
204
|
-
|
|
204
|
+
o = new Uint16Array(e.data);
|
|
205
205
|
break;
|
|
206
206
|
case "<u4":
|
|
207
|
-
|
|
207
|
+
o = new Uint32Array(e.data);
|
|
208
208
|
break;
|
|
209
209
|
case "<f4":
|
|
210
|
-
|
|
210
|
+
o = new Float32Array(e.data);
|
|
211
211
|
break;
|
|
212
212
|
default:
|
|
213
213
|
case "<f8":
|
|
214
|
-
|
|
214
|
+
o = new Float64Array(e.data);
|
|
215
215
|
break;
|
|
216
216
|
}
|
|
217
|
-
const i = ze(
|
|
218
|
-
return [i,
|
|
217
|
+
const i = ze(o, e.shape);
|
|
218
|
+
return [i, n ? kt(i) : [0, 0]];
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function At(e) {
|
|
221
221
|
return "domain" in e && "heatmapScale" in e;
|
|
222
222
|
}
|
|
223
223
|
function Co(e) {
|
|
224
|
-
return
|
|
224
|
+
return At(e);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function xo(e) {
|
|
227
227
|
return e === "equal" || e === "auto" ? e : "number";
|
|
228
228
|
}
|
|
229
229
|
function he(e) {
|
|
230
|
-
const
|
|
231
|
-
return [Number.isFinite(
|
|
230
|
+
const n = parseFloat(e);
|
|
231
|
+
return [Number.isFinite(n), n];
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Po(e, n, t, o) {
|
|
234
234
|
const i = parseFloat(e);
|
|
235
235
|
return [
|
|
236
|
-
Number.isFinite(i) && i >=
|
|
236
|
+
Number.isFinite(i) && i >= n && (o ? i <= t : i < t),
|
|
237
237
|
i
|
|
238
238
|
];
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
const
|
|
240
|
+
function Vt(e, n, t) {
|
|
241
|
+
const o = parseFloat(e);
|
|
242
242
|
return [
|
|
243
|
-
Number.isFinite(
|
|
244
|
-
|
|
243
|
+
Number.isFinite(o) && o > 0 && (t ? o <= n : o < n),
|
|
244
|
+
o
|
|
245
245
|
];
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function It(e, n) {
|
|
248
248
|
const t = parseFloat(e);
|
|
249
|
-
return [Number.isFinite(t) && t >= 0 && !(t === 0 && !
|
|
249
|
+
return [Number.isFinite(t) && t >= 0 && !(t === 0 && !n), t];
|
|
250
250
|
}
|
|
251
251
|
function qe(e) {
|
|
252
|
-
const
|
|
252
|
+
const n = e === "panAndWheelZoom", t = e === "selectToZoom";
|
|
253
253
|
return {
|
|
254
|
-
pan:
|
|
255
|
-
zoom:
|
|
256
|
-
xAxisZoom:
|
|
257
|
-
yAxisZoom:
|
|
254
|
+
pan: n ? {} : !1,
|
|
255
|
+
zoom: n ? {} : !1,
|
|
256
|
+
xAxisZoom: n ? {} : !1,
|
|
257
|
+
yAxisZoom: n ? {} : !1,
|
|
258
258
|
selectToZoom: t ? { modifierKey: [] } : !1,
|
|
259
259
|
xSelectToZoom: t ? { modifierKey: "Alt" } : !1,
|
|
260
260
|
ySelectToZoom: t ? { modifierKey: "Shift" } : !1
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function rt(e, n) {
|
|
264
264
|
if (e && e.length != 0) {
|
|
265
|
-
const t =
|
|
265
|
+
const t = Vn(), o = n === void 0 ? null : In().domain(n).nice(), i = e.length;
|
|
266
266
|
let a;
|
|
267
|
-
|
|
267
|
+
o !== null && i > 0 && (a = o.ticks(Math.min(i, 20)), t.thresholds(a));
|
|
268
268
|
const s = t(e), u = s.map((r) => r.length);
|
|
269
269
|
if (a === void 0) {
|
|
270
270
|
const r = s.map((c) => c.x0);
|
|
@@ -276,25 +276,25 @@ function lt(e, o) {
|
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function $t() {
|
|
280
280
|
const e = performance.now();
|
|
281
281
|
return {
|
|
282
282
|
end() {
|
|
283
|
-
const
|
|
284
|
-
return console.log(`The interaction took ${
|
|
283
|
+
const n = performance.now() - e;
|
|
284
|
+
return console.log(`The interaction took ${n}ms`), n;
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
|
-
var
|
|
289
|
-
function
|
|
288
|
+
var J = /* @__PURE__ */ ((e) => (e.panAndWheelZoom = "panAndWheelZoom", e.selectToZoom = "selectToZoom", e.selectRegion = "selectRegion", e))(J || {});
|
|
289
|
+
function wo(e) {
|
|
290
290
|
const {
|
|
291
|
-
id:
|
|
291
|
+
id: n = "MulticlickSelection",
|
|
292
292
|
minPoints: t = 2,
|
|
293
|
-
maxPoints:
|
|
293
|
+
maxPoints: o = t,
|
|
294
294
|
maxMovement: i = 1,
|
|
295
295
|
modifierKey: a,
|
|
296
296
|
disabled: s,
|
|
297
|
-
transform: u = (
|
|
297
|
+
transform: u = (I) => I,
|
|
298
298
|
validate: r = () => !0,
|
|
299
299
|
onSelectionStart: c,
|
|
300
300
|
onSelectionChange: m,
|
|
@@ -304,57 +304,57 @@ function Po(e) {
|
|
|
304
304
|
} = e;
|
|
305
305
|
if (t < 1)
|
|
306
306
|
throw new RangeError(`minPoints must be >= 1, ${t}`);
|
|
307
|
-
if (
|
|
307
|
+
if (o < t && o !== -1)
|
|
308
308
|
throw new RangeError(
|
|
309
|
-
`maxPoints must be -1 or >= minPoints, ${
|
|
309
|
+
`maxPoints must be -1 or >= minPoints, ${o} cf ${t}`
|
|
310
310
|
);
|
|
311
|
-
const p =
|
|
312
|
-
button:
|
|
311
|
+
const p = Me(u), b = Me(r), v = Me(c), T = Me(m), V = Me(d), k = Me(h), P = lt((I) => I.camera), L = at(), { canvasBox: E, htmlToWorld: O, worldToData: Y } = L, [x, _] = $n(), K = X(), G = X(!0), Z = X(!1), B = X(!1), Q = on(a), ae = an(n, {
|
|
312
|
+
button: sn.Left,
|
|
313
313
|
modifierKey: a,
|
|
314
314
|
disabled: s
|
|
315
|
-
}),
|
|
316
|
-
(
|
|
317
|
-
const $ =
|
|
318
|
-
_({ html:
|
|
315
|
+
}), ne = te(
|
|
316
|
+
(I) => {
|
|
317
|
+
const $ = I.map((f) => O(P, f)), N = $.map(Y);
|
|
318
|
+
_({ html: I, world: $, data: N });
|
|
319
319
|
},
|
|
320
|
-
[
|
|
321
|
-
),
|
|
322
|
-
(
|
|
323
|
-
|
|
320
|
+
[P, O, _, Y]
|
|
321
|
+
), xe = te(
|
|
322
|
+
(I, $, N) => {
|
|
323
|
+
G.current ? (K.current = [N], Z.current = !1, I.setPointerCapture($), o === 1 && ne([N])) : G.current = !0;
|
|
324
324
|
},
|
|
325
|
-
[
|
|
326
|
-
),
|
|
327
|
-
(
|
|
328
|
-
|
|
325
|
+
[o, ne]
|
|
326
|
+
), Pe = te(
|
|
327
|
+
(I, $, N, f) => {
|
|
328
|
+
I.releasePointerCapture($), G.current = !N, B.current = f, K.current = void 0;
|
|
329
329
|
},
|
|
330
330
|
[]
|
|
331
331
|
);
|
|
332
|
-
function
|
|
333
|
-
const { sourceEvent: $ } =
|
|
334
|
-
if (
|
|
332
|
+
function we(I) {
|
|
333
|
+
const { sourceEvent: $ } = I, N = $.type === "pointerdown", f = ae($);
|
|
334
|
+
if (N && !f)
|
|
335
335
|
return;
|
|
336
|
-
const { target: y, pointerId:
|
|
337
|
-
if (
|
|
338
|
-
|
|
336
|
+
const { target: y, pointerId: C } = $, M = y, R = K.current, H = E.clampPoint(I.htmlPt);
|
|
337
|
+
if (R === void 0) {
|
|
338
|
+
xe(M, C, H);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
const
|
|
342
|
-
let
|
|
343
|
-
if (
|
|
344
|
-
const
|
|
345
|
-
(
|
|
341
|
+
const se = R.length;
|
|
342
|
+
let Se = !1;
|
|
343
|
+
if (G.current) {
|
|
344
|
+
const Ve = R[se - 1];
|
|
345
|
+
(se === 1 ? 0 : Math.max(Math.abs(Ve.x - H.x), Math.abs(Ve.y - H.y))) <= i ? Se = N && Z.current : (R.push(H), G.current = !1);
|
|
346
346
|
} else
|
|
347
|
-
|
|
348
|
-
(
|
|
347
|
+
G.current = !0;
|
|
348
|
+
(Se || se >= t && o > 0 && se === o) && (_(void 0), Pe(M, C, N, f));
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function De(I) {
|
|
351
351
|
const $ = K.current;
|
|
352
352
|
if ($ === void 0)
|
|
353
353
|
return;
|
|
354
|
-
const
|
|
355
|
-
|
|
354
|
+
const N = $.length, f = E.clampPoint(I.htmlPt);
|
|
355
|
+
G.current ? ($.push(f), G.current = !1) : $[N - 1] = f, ne([...$]);
|
|
356
356
|
}
|
|
357
|
-
je("pointerdown",
|
|
357
|
+
je("pointerdown", we), je("pointermove", De), je("pointerup", we), Be(
|
|
358
358
|
"Escape",
|
|
359
359
|
() => {
|
|
360
360
|
K.current = void 0, _(void 0);
|
|
@@ -364,56 +364,56 @@ function Po(e) {
|
|
|
364
364
|
), Be(
|
|
365
365
|
"Enter",
|
|
366
366
|
() => {
|
|
367
|
-
|
|
367
|
+
Z.current && (B.current = !0, K.current = void 0, _(void 0));
|
|
368
368
|
},
|
|
369
369
|
[],
|
|
370
370
|
{ event: "keydown" }
|
|
371
371
|
);
|
|
372
|
-
const
|
|
373
|
-
() => x && p.current(x,
|
|
374
|
-
[x, p,
|
|
372
|
+
const j = F(
|
|
373
|
+
() => x && p.current(x, P, L),
|
|
374
|
+
[x, p, P, L]
|
|
375
375
|
), fe = F(() => {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const $ =
|
|
379
|
-
|
|
376
|
+
const I = !!j && b.current(j);
|
|
377
|
+
if (I) {
|
|
378
|
+
const $ = j.html.length;
|
|
379
|
+
Z.current = $ >= t;
|
|
380
380
|
}
|
|
381
|
-
return
|
|
382
|
-
}, [
|
|
383
|
-
return
|
|
384
|
-
var
|
|
385
|
-
if (
|
|
386
|
-
Xe(x), oe || (
|
|
381
|
+
return I;
|
|
382
|
+
}, [Z, t, j, b]), oe = gt(j), ge = gt(fe);
|
|
383
|
+
return z(() => {
|
|
384
|
+
var I, $, N, f;
|
|
385
|
+
if (j) {
|
|
386
|
+
Xe(x), oe || (I = v.current) == null || I.call(v), ($ = T.current) == null || $.call(
|
|
387
387
|
T,
|
|
388
|
-
|
|
388
|
+
Q ? j : void 0,
|
|
389
389
|
// don't pass selection object if user is not pressing modifier key
|
|
390
390
|
x,
|
|
391
391
|
fe
|
|
392
392
|
);
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
oe && (Xe(ge), (
|
|
395
|
+
oe && (Xe(ge), (N = V.current) == null || N.call(
|
|
396
396
|
V,
|
|
397
397
|
B.current ? oe : void 0,
|
|
398
398
|
// pass `undefined` if Escape pressed or modifier key released
|
|
399
399
|
ge
|
|
400
|
-
), ge && B.current && ((
|
|
400
|
+
), ge && B.current && ((f = k.current) == null || f.call(k, oe)), B.current = !1);
|
|
401
401
|
}, [
|
|
402
|
-
|
|
402
|
+
j,
|
|
403
403
|
oe,
|
|
404
404
|
x,
|
|
405
405
|
fe,
|
|
406
406
|
ge,
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
Q,
|
|
408
|
+
v,
|
|
409
409
|
T,
|
|
410
410
|
V,
|
|
411
411
|
k
|
|
412
|
-
]), !
|
|
412
|
+
]), !j || !Q ? null : (Xe(x), /* @__PURE__ */ l(ee, { children: g(j, x, fe, Z.current) }));
|
|
413
413
|
}
|
|
414
414
|
const nt = 8;
|
|
415
|
-
function
|
|
416
|
-
const { n
|
|
415
|
+
function Do(e) {
|
|
416
|
+
const { n, nx: t, ny: o, i, drag: a, ...s } = e, u = F(
|
|
417
417
|
() => ({
|
|
418
418
|
onPointerMove: a == null ? void 0 : a.dragMove,
|
|
419
419
|
onPointerUp: a && ((c) => {
|
|
@@ -442,7 +442,7 @@ function wo(e) {
|
|
|
442
442
|
"circle",
|
|
443
443
|
{
|
|
444
444
|
cx: t,
|
|
445
|
-
cy:
|
|
445
|
+
cy: o,
|
|
446
446
|
r: nt,
|
|
447
447
|
pointerEvents: "visibleFill",
|
|
448
448
|
...r,
|
|
@@ -450,19 +450,19 @@ function wo(e) {
|
|
|
450
450
|
fillOpacity: a != null && a.isDragging ? 0.3 : 1,
|
|
451
451
|
strokeWidth: 1
|
|
452
452
|
},
|
|
453
|
-
`${
|
|
453
|
+
`${n}-handle-${i}`
|
|
454
454
|
),
|
|
455
455
|
/* @__PURE__ */ l(
|
|
456
456
|
"circle",
|
|
457
457
|
{
|
|
458
458
|
cx: t,
|
|
459
|
-
cy:
|
|
459
|
+
cy: o,
|
|
460
460
|
r: 2 * nt,
|
|
461
461
|
fill: "transparent",
|
|
462
462
|
fillOpacity: 0,
|
|
463
463
|
stroke: "none"
|
|
464
464
|
},
|
|
465
|
-
`${
|
|
465
|
+
`${n}-handle-surround-${i}`
|
|
466
466
|
)
|
|
467
467
|
]
|
|
468
468
|
}
|
|
@@ -470,9 +470,9 @@ function wo(e) {
|
|
|
470
470
|
}
|
|
471
471
|
function Nt(e) {
|
|
472
472
|
const {
|
|
473
|
-
name:
|
|
473
|
+
name: n,
|
|
474
474
|
size: t,
|
|
475
|
-
i:
|
|
475
|
+
i: o,
|
|
476
476
|
nx: i,
|
|
477
477
|
ny: a,
|
|
478
478
|
onHandleChange: s,
|
|
@@ -490,17 +490,17 @@ function Nt(e) {
|
|
|
490
490
|
y: a,
|
|
491
491
|
captureDragArea: !0,
|
|
492
492
|
onDragMove: ({ x: d, y: h, dx: g, dy: p }) => {
|
|
493
|
-
s == null || s(
|
|
493
|
+
s == null || s(o, [(d ?? 0) + g, (h ?? 0) + p]);
|
|
494
494
|
},
|
|
495
495
|
onDragEnd: ({ x: d, y: h, dx: g, dy: p, isDragging: b }) => {
|
|
496
|
-
console.debug("DE:", d, h, "; delta:", g, p, "; drag:", b), s == null || s(
|
|
496
|
+
console.debug("DE:", d, h, "; delta:", g, p, "; drag:", b), s == null || s(o, [(d ?? 0) + g, (h ?? 0) + p], !1);
|
|
497
497
|
},
|
|
498
498
|
restrict: m,
|
|
499
499
|
children: (d) => /* @__PURE__ */ l(
|
|
500
|
-
|
|
500
|
+
Do,
|
|
501
501
|
{
|
|
502
|
-
n
|
|
503
|
-
i:
|
|
502
|
+
n,
|
|
503
|
+
i: o,
|
|
504
504
|
nx: i,
|
|
505
505
|
ny: a,
|
|
506
506
|
drag: s && d,
|
|
@@ -510,29 +510,29 @@ function Nt(e) {
|
|
|
510
510
|
}
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
const { size:
|
|
513
|
+
function Mo(e) {
|
|
514
|
+
const { size: n, coords: t, isFixed: o, axis: i, onHandleChange: a, ...s } = e, u = [t[0].getComponent(i), t[1].getComponent(i)], r = Math.min(u[0], u[1]), c = Math.max(u[0], u[1]);
|
|
515
515
|
let m;
|
|
516
516
|
i === 0 ? m = [
|
|
517
|
-
new
|
|
518
|
-
new
|
|
519
|
-
new
|
|
520
|
-
new
|
|
521
|
-
new
|
|
517
|
+
new w(r, n.height),
|
|
518
|
+
new w(r, 0),
|
|
519
|
+
new w(c, 0),
|
|
520
|
+
new w(c, n.height),
|
|
521
|
+
new w((r + c) / 2, n.height / 2)
|
|
522
522
|
] : m = [
|
|
523
|
-
new
|
|
524
|
-
new
|
|
525
|
-
new
|
|
526
|
-
new
|
|
527
|
-
new
|
|
523
|
+
new w(0, c),
|
|
524
|
+
new w(n.width, c),
|
|
525
|
+
new w(n.width, r),
|
|
526
|
+
new w(0, r),
|
|
527
|
+
new w(n.width / 2, (r + c) / 2)
|
|
528
528
|
];
|
|
529
529
|
const d = F(() => m.map((p, b) => {
|
|
530
|
-
const
|
|
530
|
+
const v = `'axisbox-drag-${b}`;
|
|
531
531
|
return /* @__PURE__ */ l(
|
|
532
532
|
Nt,
|
|
533
533
|
{
|
|
534
|
-
name:
|
|
535
|
-
size:
|
|
534
|
+
name: v,
|
|
535
|
+
size: n,
|
|
536
536
|
i: b,
|
|
537
537
|
nx: p.x,
|
|
538
538
|
ny: p.y,
|
|
@@ -541,25 +541,25 @@ function Do(e) {
|
|
|
541
541
|
restrictY: i === 0,
|
|
542
542
|
...s
|
|
543
543
|
},
|
|
544
|
-
|
|
544
|
+
v
|
|
545
545
|
);
|
|
546
|
-
}), [m,
|
|
546
|
+
}), [m, n, a, i, s]);
|
|
547
547
|
m.pop();
|
|
548
548
|
const h = F(
|
|
549
549
|
() => m.map((g) => `${g.x},${g.y}`).join(" "),
|
|
550
550
|
[m]
|
|
551
551
|
);
|
|
552
|
-
return /* @__PURE__ */ S(
|
|
552
|
+
return /* @__PURE__ */ S(ee, { children: [
|
|
553
553
|
/* @__PURE__ */ l("polygon", { points: h, ...s, stroke: "none" }),
|
|
554
|
-
!
|
|
555
|
-
i === 0 && /* @__PURE__ */ S(
|
|
554
|
+
!o && d,
|
|
555
|
+
i === 0 && /* @__PURE__ */ S(ee, { children: [
|
|
556
556
|
/* @__PURE__ */ l(
|
|
557
557
|
"line",
|
|
558
558
|
{
|
|
559
559
|
x1: r,
|
|
560
560
|
y1: 0,
|
|
561
561
|
x2: r,
|
|
562
|
-
y2:
|
|
562
|
+
y2: n.height,
|
|
563
563
|
stroke: s.fill,
|
|
564
564
|
strokeDasharray: s.strokeDasharray
|
|
565
565
|
}
|
|
@@ -570,19 +570,19 @@ function Do(e) {
|
|
|
570
570
|
x1: c,
|
|
571
571
|
y1: 0,
|
|
572
572
|
x2: c,
|
|
573
|
-
y2:
|
|
573
|
+
y2: n.height,
|
|
574
574
|
stroke: s.fill,
|
|
575
575
|
strokeDasharray: s.strokeDasharray
|
|
576
576
|
}
|
|
577
577
|
)
|
|
578
578
|
] }),
|
|
579
|
-
i !== 0 && /* @__PURE__ */ S(
|
|
579
|
+
i !== 0 && /* @__PURE__ */ S(ee, { children: [
|
|
580
580
|
/* @__PURE__ */ l(
|
|
581
581
|
"line",
|
|
582
582
|
{
|
|
583
583
|
x1: 0,
|
|
584
584
|
y1: r,
|
|
585
|
-
x2:
|
|
585
|
+
x2: n.width,
|
|
586
586
|
y2: r,
|
|
587
587
|
stroke: s.fill,
|
|
588
588
|
strokeDasharray: s.strokeDasharray
|
|
@@ -593,7 +593,7 @@ function Do(e) {
|
|
|
593
593
|
{
|
|
594
594
|
x1: 0,
|
|
595
595
|
y1: c,
|
|
596
|
-
x2:
|
|
596
|
+
x2: n.width,
|
|
597
597
|
y2: c,
|
|
598
598
|
stroke: s.fill,
|
|
599
599
|
strokeDasharray: s.strokeDasharray
|
|
@@ -602,34 +602,34 @@ function Do(e) {
|
|
|
602
602
|
] })
|
|
603
603
|
] });
|
|
604
604
|
}
|
|
605
|
-
const
|
|
606
|
-
function
|
|
607
|
-
const t = new
|
|
608
|
-
t.multiplyScalar(
|
|
605
|
+
const bt = 10, _o = nt * 2 + 4, To = new Ne().identity().rotate(Math.PI / 2).multiplyScalar(Math.sin(Math.PI / 3));
|
|
606
|
+
function Lo(e, n) {
|
|
607
|
+
const t = new w().subVectors(n, e), o = Math.hypot(t.x, t.y), i = t.clone().multiplyScalar(0.5 + _o / o);
|
|
608
|
+
t.multiplyScalar(bt / o);
|
|
609
609
|
let a, s;
|
|
610
|
-
if (
|
|
611
|
-
const r = new
|
|
612
|
-
a = new
|
|
610
|
+
if (o > 4 * bt) {
|
|
611
|
+
const r = new w().addVectors(e, i);
|
|
612
|
+
a = new w().subVectors(r, t), s = r.add(t);
|
|
613
613
|
} else
|
|
614
|
-
a =
|
|
615
|
-
const u = t.applyMatrix3(
|
|
614
|
+
a = n, s = new w().addVectors(n, t);
|
|
615
|
+
const u = t.applyMatrix3(To).add(a);
|
|
616
616
|
return [a, s, u].map((r) => `${r.x},${r.y}`).join(" ");
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function St(e) {
|
|
619
619
|
const {
|
|
620
|
-
size:
|
|
620
|
+
size: n,
|
|
621
621
|
coords: t,
|
|
622
|
-
isClosed:
|
|
622
|
+
isClosed: o = !1,
|
|
623
623
|
isFixed: i,
|
|
624
624
|
onHandleChange: a,
|
|
625
625
|
...s
|
|
626
626
|
} = e, u = t.slice(0, -1), r = F(() => t.map((h, g) => {
|
|
627
|
-
const p = `${
|
|
627
|
+
const p = `${o ? "polygon" : "polyline"}-drag-${g}`;
|
|
628
628
|
return /* @__PURE__ */ l(
|
|
629
629
|
Nt,
|
|
630
630
|
{
|
|
631
631
|
name: p,
|
|
632
|
-
size:
|
|
632
|
+
size: n,
|
|
633
633
|
i: g,
|
|
634
634
|
nx: h.x,
|
|
635
635
|
ny: h.y,
|
|
@@ -638,18 +638,18 @@ function bt(e) {
|
|
|
638
638
|
},
|
|
639
639
|
p
|
|
640
640
|
);
|
|
641
|
-
}), [t,
|
|
641
|
+
}), [t, o, n, a, s]), c = F(
|
|
642
642
|
() => u.map((d) => `${d.x},${d.y}`).join(" "),
|
|
643
643
|
[u]
|
|
644
|
-
), m = F(() =>
|
|
645
|
-
return /* @__PURE__ */ S(
|
|
646
|
-
|
|
644
|
+
), m = F(() => Lo(t[0], t[1]), [t]);
|
|
645
|
+
return /* @__PURE__ */ S(ee, { children: [
|
|
646
|
+
o ? /* @__PURE__ */ l("polygon", { points: c, ...s }) : /* @__PURE__ */ l("polyline", { points: c, ...s, fill: "none" }),
|
|
647
647
|
/* @__PURE__ */ l("polygon", { points: m, ...s, fill: s.stroke }),
|
|
648
648
|
!i && r
|
|
649
649
|
] });
|
|
650
650
|
}
|
|
651
|
-
class
|
|
652
|
-
constructor(
|
|
651
|
+
class pe {
|
|
652
|
+
constructor(n) {
|
|
653
653
|
A(this, "id");
|
|
654
654
|
A(this, "name", "");
|
|
655
655
|
A(this, "defaultColour", "#000000");
|
|
@@ -661,39 +661,39 @@ class be {
|
|
|
661
661
|
A(this, "asDashed");
|
|
662
662
|
/** Vector3 copy of start coordinate */
|
|
663
663
|
A(this, "vStart");
|
|
664
|
-
this.id = crypto.randomUUID().slice(-8), this.start =
|
|
664
|
+
this.id = crypto.randomUUID().slice(-8), this.start = n, this.vStart = new w(...n);
|
|
665
665
|
}
|
|
666
666
|
toString() {
|
|
667
667
|
return "";
|
|
668
668
|
}
|
|
669
|
-
setStart(
|
|
670
|
-
this.start[
|
|
669
|
+
setStart(n, t) {
|
|
670
|
+
this.start[n] = t, n == 0 ? this.vStart.x = t : n == 1 ? this.vStart.y = t : n == 2 ? this.vStart.z = t : console.log("Index error (%i > 2) on setting start", n);
|
|
671
671
|
}
|
|
672
672
|
getPoints() {
|
|
673
673
|
return [this.vStart.clone()];
|
|
674
674
|
}
|
|
675
|
-
setProperties(
|
|
676
|
-
this.id =
|
|
675
|
+
setProperties(n) {
|
|
676
|
+
this.id = n.id, this.name = n.name, this.colour = n.colour, this.alpha = n.alpha, this.asDashed = n.asDashed, this.fixed = n.fixed;
|
|
677
677
|
}
|
|
678
|
-
static createFromSelection(
|
|
679
|
-
const t = new
|
|
680
|
-
return t.setProperties(
|
|
678
|
+
static createFromSelection(n) {
|
|
679
|
+
const t = new pe([...n.start]);
|
|
680
|
+
return t.setProperties(n), t;
|
|
681
681
|
}
|
|
682
|
-
onHandleChange(
|
|
683
|
-
if (console.debug("base: oHC",
|
|
684
|
-
const i =
|
|
682
|
+
onHandleChange(n, t, o) {
|
|
683
|
+
if (console.debug("base: oHC", n, t, o), n === 0) {
|
|
684
|
+
const i = pe.createFromSelection(this), a = t[0];
|
|
685
685
|
a !== void 0 && (i.start[0] = a, i.vStart.x = a);
|
|
686
686
|
const s = t[1];
|
|
687
687
|
return s !== void 0 && (i.start[1] = s, i.vStart.y = s), i;
|
|
688
688
|
}
|
|
689
689
|
return this;
|
|
690
690
|
}
|
|
691
|
-
static isShape(
|
|
692
|
-
return "vStart" in
|
|
691
|
+
static isShape(n) {
|
|
692
|
+
return "vStart" in n;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
class ce extends
|
|
696
|
-
constructor(t,
|
|
695
|
+
class ce extends pe {
|
|
696
|
+
constructor(t, o, i) {
|
|
697
697
|
super(t);
|
|
698
698
|
A(this, "defaultColour", "#882255");
|
|
699
699
|
// wine
|
|
@@ -701,18 +701,18 @@ class ce extends be {
|
|
|
701
701
|
A(this, "length");
|
|
702
702
|
/** dimension (x=0, y=1) */
|
|
703
703
|
A(this, "dimension");
|
|
704
|
-
this.length =
|
|
704
|
+
this.length = o, this.dimension = i, this.colour = this.defaultColour;
|
|
705
705
|
}
|
|
706
706
|
_getPoint(t = 1) {
|
|
707
|
-
const
|
|
708
|
-
return
|
|
707
|
+
const o = new w(0, 0, 1);
|
|
708
|
+
return o.setComponent(this.dimension, this.length * t), o.add(this.vStart);
|
|
709
709
|
}
|
|
710
710
|
getPoints() {
|
|
711
711
|
return [this.vStart.clone(), this._getPoint()];
|
|
712
712
|
}
|
|
713
713
|
toString() {
|
|
714
|
-
const t = this._getPoint(),
|
|
715
|
-
return `Axis: ${this.start[
|
|
714
|
+
const t = this._getPoint(), o = this.dimension;
|
|
715
|
+
return `Axis: ${this.start[o]}; ${this.length}; to ${t.getComponent(o)}`;
|
|
716
716
|
}
|
|
717
717
|
static clicks() {
|
|
718
718
|
return [2, 2];
|
|
@@ -721,24 +721,24 @@ class ce extends be {
|
|
|
721
721
|
return "dimension" in t;
|
|
722
722
|
}
|
|
723
723
|
_setFromPoints(t) {
|
|
724
|
-
const
|
|
724
|
+
const o = t[0], i = t[1], a = this.dimension, s = o.getComponent(a), u = i.getComponent(a);
|
|
725
725
|
this.start = [0, 0], s < u ? (this.start[a] = s, this.length = u - s) : (this.start[a] = u, this.length = s - u), this.vStart.setComponent(a, this.start[a]);
|
|
726
726
|
}
|
|
727
|
-
static createFromPoints(t,
|
|
728
|
-
const i = t[0].getComponent(
|
|
729
|
-
return u[
|
|
727
|
+
static createFromPoints(t, o) {
|
|
728
|
+
const i = t[0].getComponent(o), a = t[1].getComponent(o), s = a - i, u = [0, 0];
|
|
729
|
+
return u[o] = s > 0 ? i : a, new ce(u, Math.abs(s), o);
|
|
730
730
|
}
|
|
731
731
|
static createFromSelection(t) {
|
|
732
|
-
const
|
|
733
|
-
return
|
|
732
|
+
const o = new ce([...t.start], t.length, t.dimension);
|
|
733
|
+
return o.setProperties(t), o;
|
|
734
734
|
}
|
|
735
|
-
onHandleChange(t,
|
|
735
|
+
onHandleChange(t, o) {
|
|
736
736
|
const i = ce.createFromSelection(this), a = this.dimension;
|
|
737
737
|
if (t === 4) {
|
|
738
|
-
const u =
|
|
738
|
+
const u = o[a] ?? 0, r = this._getPoint(0.5), c = u - r.getComponent(a), m = i.start[a] + c;
|
|
739
739
|
return i.start[a] = m, i.vStart.setComponent(a, m), i;
|
|
740
740
|
}
|
|
741
|
-
const s =
|
|
741
|
+
const s = o[a] ?? 0;
|
|
742
742
|
if (t < 2) {
|
|
743
743
|
const u = i.start[a] + i.length - s;
|
|
744
744
|
u >= 0 && (i.start[a] = s, i.vStart.setComponent(a, s), i.length = u);
|
|
@@ -749,14 +749,14 @@ class ce extends be {
|
|
|
749
749
|
return i;
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
class me extends
|
|
753
|
-
constructor(t,
|
|
752
|
+
class me extends pe {
|
|
753
|
+
constructor(t, o) {
|
|
754
754
|
super(t);
|
|
755
755
|
A(this, "defaultColour", "#332288");
|
|
756
756
|
// indigo
|
|
757
757
|
/** radius of circle */
|
|
758
758
|
A(this, "radius");
|
|
759
|
-
this.radius =
|
|
759
|
+
this.radius = o, this.colour = this.defaultColour;
|
|
760
760
|
}
|
|
761
761
|
static clicks() {
|
|
762
762
|
return [2, 2];
|
|
@@ -765,16 +765,16 @@ class me extends be {
|
|
|
765
765
|
return "radius" in t;
|
|
766
766
|
}
|
|
767
767
|
static createFromPoints(t) {
|
|
768
|
-
const [
|
|
769
|
-
return new me([
|
|
768
|
+
const [o, i] = t;
|
|
769
|
+
return new me([o.x, o.y], Math.hypot(i.x, i.y));
|
|
770
770
|
}
|
|
771
771
|
static createFromSelection(t) {
|
|
772
|
-
const
|
|
773
|
-
return
|
|
772
|
+
const o = new me([...t.start], t.radius);
|
|
773
|
+
return o.setProperties(t), o;
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
|
-
class
|
|
777
|
-
constructor(t,
|
|
776
|
+
class be extends pe {
|
|
777
|
+
constructor(t, o, i) {
|
|
778
778
|
super(t);
|
|
779
779
|
A(this, "defaultColour", "#117733");
|
|
780
780
|
// green
|
|
@@ -782,7 +782,7 @@ class Se extends be {
|
|
|
782
782
|
A(this, "radii");
|
|
783
783
|
/** start and end angles (radians) */
|
|
784
784
|
A(this, "angles");
|
|
785
|
-
this.radii =
|
|
785
|
+
this.radii = o, this.angles = i, this.colour = this.defaultColour;
|
|
786
786
|
}
|
|
787
787
|
static clicks() {
|
|
788
788
|
return [2, 3];
|
|
@@ -791,52 +791,52 @@ class Se extends be {
|
|
|
791
791
|
return "radii" in t;
|
|
792
792
|
}
|
|
793
793
|
static createFromPoints(t) {
|
|
794
|
-
const
|
|
794
|
+
const o = t[0], i = new w().subVectors(t[1], o), a = Ke(i), s = a[0], u = a[1];
|
|
795
795
|
let r = s, c = u;
|
|
796
796
|
if (t.length > 2) {
|
|
797
|
-
const h = new
|
|
797
|
+
const h = new w().subVectors(t[2], o), g = Ke(h);
|
|
798
798
|
r = g[0], c = g[1];
|
|
799
799
|
}
|
|
800
800
|
const m = s < r ? [s, r] : [r, s], d = u < c ? [u, c] : [c, u];
|
|
801
|
-
return new
|
|
802
|
-
[
|
|
801
|
+
return new be(
|
|
802
|
+
[o.x, o.y],
|
|
803
803
|
m,
|
|
804
804
|
d
|
|
805
805
|
);
|
|
806
806
|
}
|
|
807
807
|
static createFromSelection(t) {
|
|
808
|
-
const
|
|
808
|
+
const o = new be(
|
|
809
809
|
[...t.start],
|
|
810
810
|
[...t.radii],
|
|
811
811
|
[...t.angles]
|
|
812
812
|
);
|
|
813
|
-
return
|
|
813
|
+
return o.setProperties(t), o;
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
-
class
|
|
817
|
-
constructor(t,
|
|
816
|
+
class ct extends pe {
|
|
817
|
+
constructor(t, o = 0) {
|
|
818
818
|
super(t);
|
|
819
819
|
/** angle of selection (radians) */
|
|
820
820
|
A(this, "angle");
|
|
821
821
|
A(this, "transform");
|
|
822
822
|
A(this, "invTransform");
|
|
823
|
-
this.angle =
|
|
823
|
+
this.angle = o, this.transform = new Ne().identity().rotate(-this.angle), this.invTransform = new Ne().identity().rotate(this.angle);
|
|
824
824
|
}
|
|
825
825
|
setAngle(t) {
|
|
826
|
-
this.angle = t, this.transform = new
|
|
826
|
+
this.angle = t, this.transform = new Ne().identity().rotate(-this.angle), this.invTransform = new Ne().identity().rotate(this.angle);
|
|
827
827
|
}
|
|
828
828
|
static isShape(t) {
|
|
829
829
|
return "transform" in t;
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
|
-
class
|
|
833
|
-
constructor(t,
|
|
832
|
+
class Ce extends ct {
|
|
833
|
+
constructor(t, o, i = 0) {
|
|
834
834
|
super(t, i);
|
|
835
835
|
A(this, "defaultColour", "#999933");
|
|
836
836
|
// olive
|
|
837
837
|
/** lengths of major and minor semi-axes */
|
|
838
838
|
A(this, "semiAxes");
|
|
839
|
-
this.semiAxes =
|
|
839
|
+
this.semiAxes = o, this.colour = this.defaultColour;
|
|
840
840
|
}
|
|
841
841
|
static clicks() {
|
|
842
842
|
return [2, 3];
|
|
@@ -845,31 +845,31 @@ class Pe extends rt {
|
|
|
845
845
|
return "semiAxes" in t;
|
|
846
846
|
}
|
|
847
847
|
static createFromPoints(t) {
|
|
848
|
-
const
|
|
848
|
+
const o = t[0], i = new w().subVectors(t[1], o);
|
|
849
849
|
if (t.length < 3)
|
|
850
|
-
return new
|
|
851
|
-
[
|
|
850
|
+
return new Ce(
|
|
851
|
+
[o.x, o.y],
|
|
852
852
|
[Math.abs(i.x), Math.abs(i.y)]
|
|
853
853
|
);
|
|
854
|
-
const a = Ke(i), s = a[0], u = new
|
|
855
|
-
return new
|
|
854
|
+
const a = Ke(i), s = a[0], u = new w().subVectors(t[2], o), r = Math.hypot(u.x, u.y), c = s < r ? [s, r] : [r, s];
|
|
855
|
+
return new Ce([o.x, o.y], c, a[1]);
|
|
856
856
|
}
|
|
857
857
|
static createFromSelection(t) {
|
|
858
|
-
const
|
|
859
|
-
return
|
|
858
|
+
const o = new Ce([...t.start], [...t.semiAxes]);
|
|
859
|
+
return o.setProperties(t), o;
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
|
-
class ue extends
|
|
863
|
-
constructor(t = [0, 0],
|
|
862
|
+
class ue extends ct {
|
|
863
|
+
constructor(t = [0, 0], o = 1, i = 0) {
|
|
864
864
|
super(t, i);
|
|
865
865
|
A(this, "defaultColour", "#44aa99");
|
|
866
866
|
// teal
|
|
867
867
|
/** length of line */
|
|
868
868
|
A(this, "length");
|
|
869
|
-
this.length =
|
|
869
|
+
this.length = o, this.colour = this.defaultColour;
|
|
870
870
|
}
|
|
871
871
|
_getPoint(t = 1) {
|
|
872
|
-
return new
|
|
872
|
+
return new w(this.length * t, 0, 1).applyMatrix3(this.transform).add(this.vStart);
|
|
873
873
|
}
|
|
874
874
|
getPoints() {
|
|
875
875
|
return [this.vStart.clone(), this._getPoint(), this._getPoint(0.5)];
|
|
@@ -885,38 +885,38 @@ class ue extends rt {
|
|
|
885
885
|
return "length" in t;
|
|
886
886
|
}
|
|
887
887
|
_setFromPoints(t) {
|
|
888
|
-
const
|
|
889
|
-
this.start = [
|
|
890
|
-
const i = new
|
|
888
|
+
const o = t[0];
|
|
889
|
+
this.start = [o.x, o.y], this.vStart.x = o.x, this.vStart.y = o.y;
|
|
890
|
+
const i = new w().subVectors(t[1], o), a = Ke(i);
|
|
891
891
|
this.length = a[0], this.setAngle(a[1]);
|
|
892
892
|
}
|
|
893
893
|
static createFromPoints(t) {
|
|
894
|
-
const
|
|
895
|
-
return
|
|
894
|
+
const o = new ue();
|
|
895
|
+
return o._setFromPoints(t), o;
|
|
896
896
|
}
|
|
897
897
|
static createFromSelection(t) {
|
|
898
|
-
const
|
|
899
|
-
return
|
|
898
|
+
const o = new ue([...t.start], t.length, t.angle);
|
|
899
|
+
return o.setProperties(t), o;
|
|
900
900
|
}
|
|
901
|
-
onHandleChange(t,
|
|
901
|
+
onHandleChange(t, o) {
|
|
902
902
|
const i = ue.createFromSelection(this), a = i.vStart;
|
|
903
903
|
let s;
|
|
904
904
|
switch (t) {
|
|
905
905
|
case 0:
|
|
906
|
-
s = i._getPoint(), a.x =
|
|
906
|
+
s = i._getPoint(), a.x = o[0] ?? a.x, a.y = o[1] ?? a.y, i._setFromPoints([a, s]);
|
|
907
907
|
break;
|
|
908
908
|
case 1:
|
|
909
|
-
s = i._getPoint(), s.x =
|
|
909
|
+
s = i._getPoint(), s.x = o[0] ?? s.x, s.y = o[1] ?? s.y, i._setFromPoints([a, s]);
|
|
910
910
|
break;
|
|
911
911
|
case 2:
|
|
912
|
-
s = i._getPoint(0.5), a.x += (
|
|
912
|
+
s = i._getPoint(0.5), a.x += (o[0] ?? 0) - s.x, a.y += (o[1] ?? 0) - s.y, i.start[0] = a.x, i.start[1] = a.y;
|
|
913
913
|
break;
|
|
914
914
|
}
|
|
915
915
|
return i;
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
class ie extends
|
|
919
|
-
constructor(t,
|
|
918
|
+
class ie extends pe {
|
|
919
|
+
constructor(t, o) {
|
|
920
920
|
super(t[0]);
|
|
921
921
|
A(this, "defaultOpenColour", "#88ccee");
|
|
922
922
|
// cyan
|
|
@@ -927,24 +927,24 @@ class ie extends be {
|
|
|
927
927
|
A(this, "points");
|
|
928
928
|
/** if true, polygon is closed by joining last and first point */
|
|
929
929
|
A(this, "closed");
|
|
930
|
-
this.points = t, this.closed = !!
|
|
930
|
+
this.points = t, this.closed = !!o, this.colour = this.closed ? this.defaultClosedColour : this.defaultOpenColour;
|
|
931
931
|
}
|
|
932
932
|
getPoints() {
|
|
933
|
-
const t = this.points.map((a) => new
|
|
933
|
+
const t = this.points.map((a) => new w(...a)), o = new w();
|
|
934
934
|
return t.forEach((a) => {
|
|
935
|
-
|
|
936
|
-
}),
|
|
935
|
+
o.add(a);
|
|
936
|
+
}), o.divideScalar(t.length), [...t, o];
|
|
937
937
|
}
|
|
938
938
|
getPoint(t) {
|
|
939
|
-
const
|
|
940
|
-
if (t <
|
|
939
|
+
const o = this.points.length;
|
|
940
|
+
if (t < o) {
|
|
941
941
|
const i = this.points[t];
|
|
942
|
-
return new
|
|
943
|
-
} else if (t ==
|
|
944
|
-
const i = new
|
|
942
|
+
return new w(i[0], i[1]);
|
|
943
|
+
} else if (t == o) {
|
|
944
|
+
const i = new w();
|
|
945
945
|
return this.points.forEach((a) => {
|
|
946
|
-
i.add(new
|
|
947
|
-
}), i.divideScalar(
|
|
946
|
+
i.add(new w(a[0], a[1]));
|
|
947
|
+
}), i.divideScalar(o), i;
|
|
948
948
|
}
|
|
949
949
|
return null;
|
|
950
950
|
}
|
|
@@ -954,28 +954,28 @@ class ie extends be {
|
|
|
954
954
|
static isShape(t) {
|
|
955
955
|
return "points" in t;
|
|
956
956
|
}
|
|
957
|
-
static createFromPoints(t,
|
|
957
|
+
static createFromPoints(t, o) {
|
|
958
958
|
return new ie(
|
|
959
|
-
|
|
959
|
+
o.map((a) => [a.x, a.y]),
|
|
960
960
|
t
|
|
961
961
|
);
|
|
962
962
|
}
|
|
963
963
|
static createFromSelection(t) {
|
|
964
|
-
const
|
|
964
|
+
const o = new ie(
|
|
965
965
|
t.points.map((i) => [...i]),
|
|
966
966
|
t.closed
|
|
967
967
|
);
|
|
968
|
-
return
|
|
968
|
+
return o.setProperties(t), o;
|
|
969
969
|
}
|
|
970
|
-
onHandleChange(t,
|
|
970
|
+
onHandleChange(t, o) {
|
|
971
971
|
const i = ie.createFromSelection(this), a = this.points.length;
|
|
972
972
|
if (t < a) {
|
|
973
973
|
const s = this.points[t];
|
|
974
|
-
i.points[t] = [
|
|
974
|
+
i.points[t] = [o[0] ?? s[0], o[1] ?? s[1]];
|
|
975
975
|
} else if (t == a) {
|
|
976
976
|
const s = this.getPoint(t);
|
|
977
977
|
if (s) {
|
|
978
|
-
const u = [(
|
|
978
|
+
const u = [(o[0] ?? s.x) - s.x, (o[1] ?? s.y) - s.y];
|
|
979
979
|
i.points.forEach((r, c) => {
|
|
980
980
|
i.points[c] = [r[0] + u[0], r[1] + u[1]];
|
|
981
981
|
});
|
|
@@ -984,40 +984,40 @@ class ie extends be {
|
|
|
984
984
|
return i;
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
class de extends
|
|
988
|
-
constructor(t,
|
|
987
|
+
class de extends ct {
|
|
988
|
+
constructor(t, o, i = 0) {
|
|
989
989
|
super(t, i);
|
|
990
990
|
A(this, "defaultColour", "#ddcc77");
|
|
991
991
|
// sand
|
|
992
992
|
/** lengths of major and minor sides */
|
|
993
993
|
A(this, "lengths");
|
|
994
|
-
this.lengths = [...
|
|
994
|
+
this.lengths = [...o], this.colour = this.defaultColour;
|
|
995
995
|
}
|
|
996
996
|
getPoints() {
|
|
997
|
-
return new Array(5).fill(null, 0, 5).map((
|
|
997
|
+
return new Array(5).fill(null, 0, 5).map((o, i) => this.getPoint(i));
|
|
998
998
|
}
|
|
999
999
|
getPoint(t) {
|
|
1000
|
-
let
|
|
1000
|
+
let o = null;
|
|
1001
1001
|
switch (t) {
|
|
1002
1002
|
case 0:
|
|
1003
|
-
|
|
1003
|
+
o = new w(0, 0, 1);
|
|
1004
1004
|
break;
|
|
1005
1005
|
case 1:
|
|
1006
|
-
|
|
1006
|
+
o = new w(this.lengths[0], 0, 1);
|
|
1007
1007
|
break;
|
|
1008
1008
|
case 2:
|
|
1009
|
-
|
|
1009
|
+
o = new w(...this.lengths, 1);
|
|
1010
1010
|
break;
|
|
1011
1011
|
case 3:
|
|
1012
|
-
|
|
1012
|
+
o = new w(0, this.lengths[1], 1);
|
|
1013
1013
|
break;
|
|
1014
1014
|
case 4:
|
|
1015
|
-
|
|
1015
|
+
o = new w(this.lengths[0] * 0.5, this.lengths[1] * 0.5, 1);
|
|
1016
1016
|
break;
|
|
1017
1017
|
default:
|
|
1018
1018
|
return null;
|
|
1019
1019
|
}
|
|
1020
|
-
return
|
|
1020
|
+
return o.applyMatrix3(this.transform).add(this.vStart);
|
|
1021
1021
|
}
|
|
1022
1022
|
toString() {
|
|
1023
1023
|
const t = this.getPoint(2);
|
|
@@ -1030,39 +1030,39 @@ class de extends rt {
|
|
|
1030
1030
|
static isShape(t) {
|
|
1031
1031
|
return "lengths" in t;
|
|
1032
1032
|
}
|
|
1033
|
-
static createFromPoints(t,
|
|
1034
|
-
const i =
|
|
1033
|
+
static createFromPoints(t, o) {
|
|
1034
|
+
const i = o[0].clone(), a = new w().subVectors(o[1], i);
|
|
1035
1035
|
let s = 0;
|
|
1036
1036
|
const u = a.x, r = a.y;
|
|
1037
1037
|
return u < 0 !== t[0] ? (a.x = -u, r < 0 !== t[1] ? (s = Math.PI, a.y = -r) : (s = Math.PI / 2, a.y = a.x, a.x = r)) : r < 0 !== t[1] && (s = -Math.PI / 2, a.y = a.x, a.x = -r), new de([i.x, i.y], [a.x, a.y], s);
|
|
1038
1038
|
}
|
|
1039
1039
|
static createFromSelection(t) {
|
|
1040
|
-
const
|
|
1041
|
-
return
|
|
1040
|
+
const o = new de([...t.start], [...t.lengths], t.angle);
|
|
1041
|
+
return o.setProperties(t), o;
|
|
1042
1042
|
}
|
|
1043
|
-
onHandleChange(t,
|
|
1043
|
+
onHandleChange(t, o) {
|
|
1044
1044
|
const i = de.createFromSelection(this), a = this.getPoint(t);
|
|
1045
1045
|
if (a !== null) {
|
|
1046
|
-
const s =
|
|
1046
|
+
const s = o[0] ?? 0, u = o[1] ?? 0;
|
|
1047
1047
|
if (t === 4) {
|
|
1048
|
-
const p = new
|
|
1048
|
+
const p = new w(s, u).sub(a), b = i.vStart;
|
|
1049
1049
|
return b.x += p.x, b.y += p.y, i.start[0] = b.x, i.start[1] = b.y, i;
|
|
1050
1050
|
}
|
|
1051
|
-
const r = new
|
|
1051
|
+
const r = new w(s, u).sub(a).applyMatrix3(this.invTransform), [c, m] = i.lengths;
|
|
1052
1052
|
let d, h;
|
|
1053
1053
|
t !== 2 ? (d = Math.max(0, c - r.x), h = Math.max(0, m - r.y)) : (d = Math.max(0, c + r.x), h = Math.max(0, m + r.y));
|
|
1054
1054
|
let g;
|
|
1055
1055
|
switch (t) {
|
|
1056
1056
|
case 0:
|
|
1057
|
-
g = new
|
|
1057
|
+
g = new w(c - d, m - h);
|
|
1058
1058
|
break;
|
|
1059
1059
|
case 1:
|
|
1060
|
-
g = new
|
|
1060
|
+
g = new w(0, m - h), d = Math.max(0, c + r.x);
|
|
1061
1061
|
break;
|
|
1062
1062
|
case 2:
|
|
1063
1063
|
break;
|
|
1064
1064
|
case 3:
|
|
1065
|
-
g = new
|
|
1065
|
+
g = new w(c - d), h = Math.max(0, m + r.y);
|
|
1066
1066
|
break;
|
|
1067
1067
|
}
|
|
1068
1068
|
g !== void 0 && (g.applyMatrix3(this.transform).add(this.vStart), i.start[0] = g.x, i.start[1] = g.y, i.vStart.x = g.x, i.vStart.y = g.y), i.lengths[0] = d, i.lengths[1] = h;
|
|
@@ -1070,23 +1070,23 @@ class de extends rt {
|
|
|
1070
1070
|
return i;
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
|
-
var
|
|
1073
|
+
var q = /* @__PURE__ */ ((e) => (e.line = "line", e.rectangle = "rectangle", e.polyline = "polyline", e.polygon = "polygon", e.circle = "circle", e.ellipse = "ellipse", e.sector = "sector", e.horizontalAxis = "horizontalAxis", e.verticalAxis = "verticalAxis", e.unknown = "unknown", e))(q || {});
|
|
1074
1074
|
function Ke(e) {
|
|
1075
|
-
const
|
|
1076
|
-
return [Math.hypot(t,
|
|
1075
|
+
const n = e.x, t = e.y;
|
|
1076
|
+
return [Math.hypot(t, n), Math.atan2(t, n)];
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
return ce.isShape(e) ? e.dimension === 0 ? "horizontalAxis" : "verticalAxis" : de.isShape(e) ? "rectangle" : ue.isShape(e) ? "line" : ie.isShape(e) ? e.closed ? "polygon" : "polyline" :
|
|
1078
|
+
function Ft(e) {
|
|
1079
|
+
return ce.isShape(e) ? e.dimension === 0 ? "horizontalAxis" : "verticalAxis" : de.isShape(e) ? "rectangle" : ue.isShape(e) ? "line" : ie.isShape(e) ? e.closed ? "polygon" : "polyline" : Ce.isShape(e) ? "ellipse" : me.isShape(e) ? "circle" : be.isShape(e) ? "sector" : "unknown";
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1082
|
-
return ce.isShape(e) ? ce.createFromSelection(e) : de.isShape(e) ? de.createFromSelection(e) : ue.isShape(e) ? ue.createFromSelection(e) : ie.isShape(e) ? ie.createFromSelection(e) :
|
|
1081
|
+
function vt(e) {
|
|
1082
|
+
return ce.isShape(e) ? ce.createFromSelection(e) : de.isShape(e) ? de.createFromSelection(e) : ue.isShape(e) ? ue.createFromSelection(e) : ie.isShape(e) ? ie.createFromSelection(e) : Ce.isShape(e) ? Ce.createFromSelection(e) : me.isShape(e) ? me.createFromSelection(e) : be.isShape(e) ? be.createFromSelection(e) : null;
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1084
|
+
function Ot(e, n, t) {
|
|
1085
1085
|
switch (e) {
|
|
1086
1086
|
case "rectangle":
|
|
1087
|
-
return de.createFromPoints(
|
|
1087
|
+
return de.createFromPoints(n, t);
|
|
1088
1088
|
case "sector":
|
|
1089
|
-
return
|
|
1089
|
+
return be.createFromPoints(t);
|
|
1090
1090
|
case "horizontalAxis":
|
|
1091
1091
|
case "verticalAxis":
|
|
1092
1092
|
return ce.createFromPoints(
|
|
@@ -1107,12 +1107,12 @@ function Ft(e, o, t) {
|
|
|
1107
1107
|
return ue.createFromPoints(t);
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1110
|
+
function ko(e) {
|
|
1111
1111
|
switch (e) {
|
|
1112
1112
|
case "rectangle":
|
|
1113
1113
|
return de.clicks();
|
|
1114
1114
|
case "sector":
|
|
1115
|
-
return
|
|
1115
|
+
return be.clicks();
|
|
1116
1116
|
case "horizontalAxis":
|
|
1117
1117
|
case "verticalAxis":
|
|
1118
1118
|
return ce.clicks();
|
|
@@ -1129,18 +1129,18 @@ function Lo(e) {
|
|
|
1129
1129
|
return ue.clicks();
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
console.debug("Points",
|
|
1134
|
-
const a =
|
|
1135
|
-
a.alpha =
|
|
1132
|
+
function Ao(e, n, t, o, i) {
|
|
1133
|
+
console.debug("Points", n, t);
|
|
1134
|
+
const a = Ot(n, [!1, !1], t);
|
|
1135
|
+
a.alpha = o;
|
|
1136
1136
|
const s = e.map((c) => c.name);
|
|
1137
1137
|
let u, r = -1;
|
|
1138
1138
|
do
|
|
1139
|
-
r++, u = `${
|
|
1139
|
+
r++, u = `${n}${r}`;
|
|
1140
1140
|
while (s.includes(u));
|
|
1141
1141
|
return a.name = u, a;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function Bt(e, n, t, o, i, a, s, u) {
|
|
1144
1144
|
const r = {
|
|
1145
1145
|
fill: i,
|
|
1146
1146
|
fillOpacity: t,
|
|
@@ -1151,10 +1151,10 @@ function Ot(e, o, t, n, i, a, s, u) {
|
|
|
1151
1151
|
case "rectangle":
|
|
1152
1152
|
case "polygon":
|
|
1153
1153
|
return /* @__PURE__ */ l(Ze, { children: /* @__PURE__ */ l(
|
|
1154
|
-
|
|
1154
|
+
St,
|
|
1155
1155
|
{
|
|
1156
|
-
size:
|
|
1157
|
-
coords:
|
|
1156
|
+
size: o,
|
|
1157
|
+
coords: n,
|
|
1158
1158
|
isClosed: !0,
|
|
1159
1159
|
strokeDasharray: a ? "10, 10" : void 0,
|
|
1160
1160
|
isFixed: s,
|
|
@@ -1165,10 +1165,10 @@ function Ot(e, o, t, n, i, a, s, u) {
|
|
|
1165
1165
|
case "horizontalAxis":
|
|
1166
1166
|
case "verticalAxis":
|
|
1167
1167
|
return /* @__PURE__ */ l(Ze, { children: /* @__PURE__ */ l(
|
|
1168
|
-
|
|
1168
|
+
Mo,
|
|
1169
1169
|
{
|
|
1170
|
-
size:
|
|
1171
|
-
coords:
|
|
1170
|
+
size: o,
|
|
1171
|
+
coords: n,
|
|
1172
1172
|
strokeDasharray: a ? "10, 10" : void 0,
|
|
1173
1173
|
isFixed: s,
|
|
1174
1174
|
axis: e === "horizontalAxis" ? 0 : 1,
|
|
@@ -1179,10 +1179,10 @@ function Ot(e, o, t, n, i, a, s, u) {
|
|
|
1179
1179
|
case "line":
|
|
1180
1180
|
case "polyline":
|
|
1181
1181
|
return /* @__PURE__ */ l(Ze, { children: /* @__PURE__ */ l(
|
|
1182
|
-
|
|
1182
|
+
St,
|
|
1183
1183
|
{
|
|
1184
|
-
size:
|
|
1185
|
-
coords:
|
|
1184
|
+
size: o,
|
|
1185
|
+
coords: n,
|
|
1186
1186
|
strokeDasharray: a ? "10, 10" : void 0,
|
|
1187
1187
|
isFixed: s,
|
|
1188
1188
|
onHandleChange: u,
|
|
@@ -1197,44 +1197,44 @@ function Ot(e, o, t, n, i, a, s, u) {
|
|
|
1197
1197
|
return null;
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const s =
|
|
1202
|
-
return
|
|
1200
|
+
function Vo(e, n, t, o, i, a) {
|
|
1201
|
+
const s = Ot(e, t, n);
|
|
1202
|
+
return Bt(
|
|
1203
1203
|
e,
|
|
1204
1204
|
s.getPoints(),
|
|
1205
|
-
|
|
1205
|
+
o,
|
|
1206
1206
|
i,
|
|
1207
1207
|
a ?? s.colour ?? s.defaultColour,
|
|
1208
1208
|
void 0,
|
|
1209
1209
|
!0
|
|
1210
1210
|
);
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1213
|
-
const { size:
|
|
1212
|
+
function Io(e) {
|
|
1213
|
+
const { size: n, selection: t, updateSelection: o, showHandles: i } = e, a = Ft(t), s = at(), { htmlToData: u } = s, r = lt((d) => d.camera), c = te(
|
|
1214
1214
|
(d, h) => {
|
|
1215
|
-
const g = u(r, new
|
|
1215
|
+
const g = u(r, new w(d, h));
|
|
1216
1216
|
return [g.x, g.y];
|
|
1217
1217
|
},
|
|
1218
1218
|
[u, r]
|
|
1219
|
-
), m =
|
|
1219
|
+
), m = te(
|
|
1220
1220
|
(d) => {
|
|
1221
1221
|
const h = d.onHandleChange.bind(d);
|
|
1222
|
-
return (p, b,
|
|
1222
|
+
return (p, b, v = !0) => {
|
|
1223
1223
|
const T = c(b[0], b[1]);
|
|
1224
1224
|
console.debug("UH:", p, b, T);
|
|
1225
1225
|
const V = h(p, T);
|
|
1226
|
-
return
|
|
1226
|
+
return o(V, v), V;
|
|
1227
1227
|
};
|
|
1228
1228
|
},
|
|
1229
|
-
[
|
|
1229
|
+
[o, c]
|
|
1230
1230
|
);
|
|
1231
1231
|
if (a !== "unknown") {
|
|
1232
1232
|
const d = t.getPoints();
|
|
1233
|
-
return /* @__PURE__ */ l(
|
|
1233
|
+
return /* @__PURE__ */ l(rn, { points: d, children: (...h) => Bt(
|
|
1234
1234
|
a,
|
|
1235
1235
|
h,
|
|
1236
1236
|
t.alpha,
|
|
1237
|
-
|
|
1237
|
+
n,
|
|
1238
1238
|
t.colour ?? t.defaultColour,
|
|
1239
1239
|
t.asDashed,
|
|
1240
1240
|
t.fixed || !i,
|
|
@@ -1243,101 +1243,102 @@ function Vo(e) {
|
|
|
1243
1243
|
}
|
|
1244
1244
|
return console.error("Unknown selection type or has no points getter", t), null;
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
1248
|
-
|
|
1246
|
+
function $o(e, n, t, o) {
|
|
1247
|
+
return o && n.map((i) => /* @__PURE__ */ l(
|
|
1248
|
+
Io,
|
|
1249
1249
|
{
|
|
1250
1250
|
size: e,
|
|
1251
1251
|
selection: i,
|
|
1252
|
-
updateSelection:
|
|
1252
|
+
updateSelection: o,
|
|
1253
1253
|
showHandles: t
|
|
1254
1254
|
},
|
|
1255
1255
|
i.id
|
|
1256
1256
|
));
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return e !== null ? `${
|
|
1258
|
+
function zt(e, n) {
|
|
1259
|
+
return e !== null ? `${n ? n[Ft(e)] : ""} ${e.name} ${e.id}` : "No selection chosen";
|
|
1260
1260
|
}
|
|
1261
|
-
function Ct(e,
|
|
1262
|
-
const
|
|
1263
|
-
return
|
|
1261
|
+
function Ct(e, n, t) {
|
|
1262
|
+
const o = e.find((i) => i.id === n) ?? null;
|
|
1263
|
+
return zt(o, t);
|
|
1264
1264
|
}
|
|
1265
|
-
function No(e,
|
|
1266
|
-
return
|
|
1267
|
-
|
|
1265
|
+
function No(e, n) {
|
|
1266
|
+
return ln.fromPoints(...e).hasMinSize(
|
|
1267
|
+
n === "horizontalAxis" || n === "verticalAxis" ? 0 : 20
|
|
1268
1268
|
);
|
|
1269
1269
|
}
|
|
1270
|
-
|
|
1271
|
-
|
|
1270
|
+
var ot = /* @__PURE__ */ ((e) => (e.created = "created", e.removed = "removed", e.updated = "updated", e))(ot || {});
|
|
1271
|
+
function Et(e, n) {
|
|
1272
|
+
const [t, o] = D(
|
|
1272
1273
|
e ?? []
|
|
1273
|
-
),
|
|
1274
|
-
(
|
|
1275
|
-
let
|
|
1276
|
-
return
|
|
1277
|
-
(
|
|
1278
|
-
)) :
|
|
1279
|
-
const
|
|
1280
|
-
if (
|
|
1281
|
-
return [...
|
|
1282
|
-
const
|
|
1283
|
-
return console.debug("Replacing", g
|
|
1284
|
-
})) :
|
|
1274
|
+
), i = X(!1), [a, s] = D(!0), u = te(
|
|
1275
|
+
(r, c = !1, m = !1) => {
|
|
1276
|
+
let d = null;
|
|
1277
|
+
return r ? (d = r.id, m ? (console.debug("Clearing selection:", d), o(
|
|
1278
|
+
(h) => h.filter((g) => g.id !== d)
|
|
1279
|
+
), n == null || n("removed", c, r)) : o((h) => {
|
|
1280
|
+
const g = h.findIndex((b) => b.id === d);
|
|
1281
|
+
if (i.current = g === -1, i.current)
|
|
1282
|
+
return n == null || n("created", c, r), [...h, r];
|
|
1283
|
+
const p = [...h];
|
|
1284
|
+
return console.debug("Replacing", p[g], "with", r), p[g] = r, n == null || n("updated", c, r), p;
|
|
1285
|
+
})) : m && (console.debug("Clearing selections"), o([])), d;
|
|
1285
1286
|
},
|
|
1286
|
-
[
|
|
1287
|
+
[n]
|
|
1287
1288
|
);
|
|
1288
1289
|
return {
|
|
1289
|
-
selections:
|
|
1290
|
-
setSelections:
|
|
1291
|
-
isNewSelection:
|
|
1292
|
-
updateSelection:
|
|
1293
|
-
canSelect:
|
|
1294
|
-
enableSelect:
|
|
1290
|
+
selections: t,
|
|
1291
|
+
setSelections: o,
|
|
1292
|
+
isNewSelection: i,
|
|
1293
|
+
updateSelection: u,
|
|
1294
|
+
canSelect: a,
|
|
1295
|
+
enableSelect: s
|
|
1295
1296
|
};
|
|
1296
1297
|
}
|
|
1297
|
-
function
|
|
1298
|
+
function Fo(e) {
|
|
1298
1299
|
e.asDashed = !1;
|
|
1299
1300
|
}
|
|
1300
|
-
function
|
|
1301
|
+
function xt(e) {
|
|
1301
1302
|
e.asDashed = !0;
|
|
1302
1303
|
}
|
|
1303
1304
|
function Ge(e) {
|
|
1304
1305
|
const {
|
|
1305
|
-
disabled:
|
|
1306
|
-
selectionType: t =
|
|
1307
|
-
selections:
|
|
1306
|
+
disabled: n = !1,
|
|
1307
|
+
selectionType: t = q.rectangle,
|
|
1308
|
+
selections: o = [],
|
|
1308
1309
|
updateSelection: i,
|
|
1309
1310
|
batonProps: a
|
|
1310
|
-
} = e, s = 0.3, { canvasBox: u, dataToHtml: r } =
|
|
1311
|
+
} = e, s = 0.3, { canvasBox: u, dataToHtml: r } = at(), c = u.size, m = F(() => {
|
|
1311
1312
|
if (i != null)
|
|
1312
|
-
return
|
|
1313
|
+
return $o(
|
|
1313
1314
|
c,
|
|
1314
|
-
|
|
1315
|
+
o,
|
|
1315
1316
|
(a == null ? void 0 : a.hasBaton) ?? !0,
|
|
1316
1317
|
i
|
|
1317
1318
|
);
|
|
1318
|
-
}, [c,
|
|
1319
|
-
const p = r(d, new
|
|
1319
|
+
}, [c, o, i, a == null ? void 0 : a.hasBaton]), d = lt((p) => p.camera), h = F(() => {
|
|
1320
|
+
const p = r(d, new w(0, 0)), b = r(d, new w(1, 1)).sub(p);
|
|
1320
1321
|
return [b.x < 0, b.y < 0];
|
|
1321
|
-
}, [d, r]), g =
|
|
1322
|
-
return /* @__PURE__ */ S(
|
|
1323
|
-
i && ((a == null ? void 0 : a.hasBaton) ?? !0) && !
|
|
1324
|
-
|
|
1322
|
+
}, [d, r]), g = ko(t);
|
|
1323
|
+
return /* @__PURE__ */ S(ee, { children: [
|
|
1324
|
+
i && ((a == null ? void 0 : a.hasBaton) ?? !0) && !n && /* @__PURE__ */ l(
|
|
1325
|
+
wo,
|
|
1325
1326
|
{
|
|
1326
1327
|
modifierKey: e.modifierKey,
|
|
1327
1328
|
validate: ({ html: p }) => No(p, t),
|
|
1328
1329
|
onValidSelection: ({ data: p }) => {
|
|
1329
|
-
const b =
|
|
1330
|
+
const b = Ao(o, t, p, s);
|
|
1330
1331
|
return i(b);
|
|
1331
1332
|
},
|
|
1332
1333
|
minPoints: g[0],
|
|
1333
1334
|
maxPoints: g[1],
|
|
1334
|
-
children: ({ html: p }, b,
|
|
1335
|
+
children: ({ html: p }, b, v) => Vo(
|
|
1335
1336
|
t,
|
|
1336
1337
|
p,
|
|
1337
1338
|
h,
|
|
1338
1339
|
s,
|
|
1339
1340
|
c,
|
|
1340
|
-
|
|
1341
|
+
v ? void 0 : "#cc6677"
|
|
1341
1342
|
// orangered,
|
|
1342
1343
|
)
|
|
1343
1344
|
}
|
|
@@ -1345,7 +1346,7 @@ function Ge(e) {
|
|
|
1345
1346
|
m
|
|
1346
1347
|
] });
|
|
1347
1348
|
}
|
|
1348
|
-
const
|
|
1349
|
+
const Oo = {
|
|
1349
1350
|
uuid: "",
|
|
1350
1351
|
batonUuid: "",
|
|
1351
1352
|
others: [],
|
|
@@ -1354,176 +1355,176 @@ const Fo = {
|
|
|
1354
1355
|
},
|
|
1355
1356
|
offerBaton: (e) => {
|
|
1356
1357
|
}
|
|
1357
|
-
},
|
|
1358
|
+
}, Rt = tn(
|
|
1358
1359
|
{}
|
|
1359
1360
|
);
|
|
1360
|
-
function
|
|
1361
|
-
return
|
|
1361
|
+
function Le() {
|
|
1362
|
+
return nn(Rt);
|
|
1362
1363
|
}
|
|
1363
1364
|
const Je = [0, 1];
|
|
1364
|
-
function
|
|
1365
|
-
const [
|
|
1366
|
-
|
|
1367
|
-
), [u, r] =
|
|
1368
|
-
|
|
1369
|
-
), [c, m] =
|
|
1365
|
+
function ke(e) {
|
|
1366
|
+
const [n, t] = Fe(), [o, i] = D(""), [a, s] = D(
|
|
1367
|
+
J.panAndWheelZoom
|
|
1368
|
+
), [u, r] = D(
|
|
1369
|
+
q.line
|
|
1370
|
+
), [c, m] = D([
|
|
1370
1371
|
null,
|
|
1371
1372
|
null
|
|
1372
|
-
]), [d, h] =
|
|
1373
|
+
]), [d, h] = D([
|
|
1373
1374
|
null,
|
|
1374
1375
|
null
|
|
1375
|
-
]), [g, p] =
|
|
1376
|
+
]), [g, p] = D(""), [b, v] = D(""), [T, V] = D(_e.Linear), [k, P] = D(_e.Linear), [L, E] = D([
|
|
1376
1377
|
null,
|
|
1377
1378
|
null
|
|
1378
|
-
]), [O,
|
|
1379
|
-
|
|
1380
|
-
), [x, _] =
|
|
1379
|
+
]), [O, Y] = D(
|
|
1380
|
+
_e.Linear
|
|
1381
|
+
), [x, _] = D("equal"), [K, G] = D("Greys"), [Z, B] = Fe(), [Q, ae] = Fe(), [ne, xe] = D(
|
|
1381
1382
|
/* @__PURE__ */ new Map()
|
|
1382
|
-
), [
|
|
1383
|
-
|
|
1383
|
+
), [Pe, we] = D(null), [De, j] = D(), [fe, oe] = D(10);
|
|
1384
|
+
z(() => {
|
|
1384
1385
|
e.plotConfig.title && i(e.plotConfig.title);
|
|
1385
|
-
}, [e.plotConfig.title, i]),
|
|
1386
|
+
}, [e.plotConfig.title, i]), z(() => {
|
|
1386
1387
|
e.plotConfig.xLabel && p(e.plotConfig.xLabel);
|
|
1387
|
-
}, [e.plotConfig.xLabel, p]),
|
|
1388
|
-
e.plotConfig.yLabel &&
|
|
1389
|
-
}, [e.plotConfig.yLabel,
|
|
1388
|
+
}, [e.plotConfig.xLabel, p]), z(() => {
|
|
1389
|
+
e.plotConfig.yLabel && v(e.plotConfig.yLabel);
|
|
1390
|
+
}, [e.plotConfig.yLabel, v]), z(() => {
|
|
1390
1391
|
e.plotConfig.xScale && V(e.plotConfig.xScale);
|
|
1391
|
-
}, [e.plotConfig.xScale, V]),
|
|
1392
|
-
e.plotConfig.yScale &&
|
|
1393
|
-
}, [e.plotConfig.yScale,
|
|
1392
|
+
}, [e.plotConfig.xScale, V]), z(() => {
|
|
1393
|
+
e.plotConfig.yScale && P(e.plotConfig.yScale);
|
|
1394
|
+
}, [e.plotConfig.yScale, P]);
|
|
1394
1395
|
const ge = F(
|
|
1395
|
-
() => e.batonProps ??
|
|
1396
|
+
() => e.batonProps ?? Oo,
|
|
1396
1397
|
[e.batonProps]
|
|
1397
|
-
),
|
|
1398
|
+
), I = F(
|
|
1398
1399
|
() => e.xDomain ?? Je,
|
|
1399
1400
|
[e.xDomain]
|
|
1400
1401
|
), $ = F(
|
|
1401
1402
|
() => e.yDomain ?? Je,
|
|
1402
1403
|
[e.yDomain]
|
|
1403
|
-
),
|
|
1404
|
-
let
|
|
1405
|
-
"values" in e ?
|
|
1406
|
-
|
|
1404
|
+
), N = F(() => e.domain ?? Je, [e.domain]);
|
|
1405
|
+
let f = "Line";
|
|
1406
|
+
"values" in e ? f = e.heatmapScale ? "Heatmap" : "Image" : "pointValues" in e ? f = "Scatter" : "heightValues" in e && (f = "Surface"), z(() => {
|
|
1407
|
+
f !== "Line" && (e.heatmapScale && Y(e.heatmapScale), e.surfaceScale && Y(e.surfaceScale), e.showPoints !== void 0 && ae(e.showPoints), e.aspect !== void 0 && _(e.aspect), e.colourMap && G(e.colourMap));
|
|
1407
1408
|
}, [
|
|
1408
|
-
|
|
1409
|
+
f,
|
|
1409
1410
|
e.aspect,
|
|
1410
1411
|
e.colourMap,
|
|
1411
1412
|
e.heatmapScale,
|
|
1412
1413
|
e.surfaceScale,
|
|
1413
1414
|
e.showPoints,
|
|
1414
1415
|
_,
|
|
1415
|
-
|
|
1416
|
-
|
|
1416
|
+
G,
|
|
1417
|
+
Y,
|
|
1417
1418
|
ae
|
|
1418
1419
|
]);
|
|
1419
1420
|
const {
|
|
1420
1421
|
selections: y,
|
|
1421
|
-
updateSelection:
|
|
1422
|
-
setSelections:
|
|
1423
|
-
canSelect:
|
|
1424
|
-
enableSelect:
|
|
1425
|
-
} =
|
|
1426
|
-
|
|
1427
|
-
e.selections &&
|
|
1428
|
-
}, [e.selections,
|
|
1429
|
-
const
|
|
1430
|
-
if (
|
|
1431
|
-
|
|
1422
|
+
updateSelection: C,
|
|
1423
|
+
setSelections: M,
|
|
1424
|
+
canSelect: R,
|
|
1425
|
+
enableSelect: H
|
|
1426
|
+
} = Et([], e.selectionsListener), se = f === "Surface";
|
|
1427
|
+
z(() => {
|
|
1428
|
+
e.selections && M(e.selections);
|
|
1429
|
+
}, [e.selections, M]);
|
|
1430
|
+
const Se = F(() => {
|
|
1431
|
+
if (se)
|
|
1432
|
+
H(!1);
|
|
1432
1433
|
else {
|
|
1433
1434
|
const Ie = e.updateSelection;
|
|
1434
|
-
if (
|
|
1435
|
+
if (H(Ie !== null), Ie)
|
|
1435
1436
|
return Ie;
|
|
1436
1437
|
}
|
|
1437
|
-
return
|
|
1438
|
-
}, [
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
}, [e.pointSize,
|
|
1442
|
-
const Ye =
|
|
1443
|
-
(Ie,
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1438
|
+
return C;
|
|
1439
|
+
}, [H, se, e.updateSelection, C]), Ve = f === "Scatter";
|
|
1440
|
+
z(() => {
|
|
1441
|
+
Ve && e.pointSize !== void 0 && oe(e.pointSize);
|
|
1442
|
+
}, [e.pointSize, Ve, oe]);
|
|
1443
|
+
const Ye = te(
|
|
1444
|
+
(Ie, Qt) => {
|
|
1445
|
+
const ht = new Map(ne);
|
|
1446
|
+
ht.set(Ie, { ...Qt }), xe(ht);
|
|
1446
1447
|
},
|
|
1447
|
-
[
|
|
1448
|
-
),
|
|
1449
|
-
showGrid:
|
|
1448
|
+
[ne]
|
|
1449
|
+
), Zt = F(() => ({
|
|
1450
|
+
showGrid: n,
|
|
1450
1451
|
toggleShowGrid: t,
|
|
1451
|
-
title:
|
|
1452
|
+
title: o,
|
|
1452
1453
|
setTitle: i,
|
|
1453
1454
|
mode: a,
|
|
1454
1455
|
setMode: s,
|
|
1455
1456
|
xLabel: g,
|
|
1456
1457
|
setXLabel: p,
|
|
1457
1458
|
yLabel: b,
|
|
1458
|
-
setYLabel:
|
|
1459
|
+
setYLabel: v,
|
|
1459
1460
|
batonProps: ge,
|
|
1460
1461
|
xScaleType: T,
|
|
1461
1462
|
setXScaleType: V,
|
|
1462
1463
|
yScaleType: k,
|
|
1463
|
-
setYScaleType:
|
|
1464
|
-
xDomain:
|
|
1464
|
+
setYScaleType: P,
|
|
1465
|
+
xDomain: I,
|
|
1465
1466
|
xCustomDomain: c,
|
|
1466
1467
|
setXCustomDomain: m,
|
|
1467
1468
|
yDomain: $,
|
|
1468
1469
|
yCustomDomain: d,
|
|
1469
1470
|
setYCustomDomain: h,
|
|
1470
|
-
dDomain:
|
|
1471
|
+
dDomain: N,
|
|
1471
1472
|
dCustomDomain: L,
|
|
1472
|
-
setDCustomDomain:
|
|
1473
|
+
setDCustomDomain: E,
|
|
1473
1474
|
selectionType: u,
|
|
1474
1475
|
setSelectionType: r,
|
|
1475
|
-
setHistogram:
|
|
1476
|
+
setHistogram: j,
|
|
1476
1477
|
selections: y,
|
|
1477
|
-
setSelections:
|
|
1478
|
-
updateSelection:
|
|
1479
|
-
allLineParams:
|
|
1480
|
-
setAllLineParams:
|
|
1478
|
+
setSelections: M,
|
|
1479
|
+
updateSelection: Se,
|
|
1480
|
+
allLineParams: ne,
|
|
1481
|
+
setAllLineParams: xe,
|
|
1481
1482
|
updateLineParams: Ye,
|
|
1482
|
-
currentLineKey:
|
|
1483
|
-
setCurrentLineKey:
|
|
1483
|
+
currentLineKey: Pe,
|
|
1484
|
+
setCurrentLineKey: we,
|
|
1484
1485
|
aspect: x,
|
|
1485
1486
|
setAspect: _,
|
|
1486
1487
|
dScaleType: O,
|
|
1487
|
-
setDScaleType:
|
|
1488
|
+
setDScaleType: Y,
|
|
1488
1489
|
colourMap: K,
|
|
1489
|
-
setColourMap:
|
|
1490
|
-
invertColourMap:
|
|
1490
|
+
setColourMap: G,
|
|
1491
|
+
invertColourMap: Z,
|
|
1491
1492
|
toggleInvertColourMap: B,
|
|
1492
|
-
histogram:
|
|
1493
|
+
histogram: De,
|
|
1493
1494
|
scatterPointSize: fe,
|
|
1494
1495
|
setScatterPointSize: oe,
|
|
1495
|
-
showPoints:
|
|
1496
|
+
showPoints: Q,
|
|
1496
1497
|
toggleShowPoints: ae,
|
|
1497
|
-
canSelect:
|
|
1498
|
-
plotType:
|
|
1498
|
+
canSelect: R,
|
|
1499
|
+
plotType: f
|
|
1499
1500
|
}), [
|
|
1500
|
-
|
|
1501
|
+
ne,
|
|
1501
1502
|
x,
|
|
1502
1503
|
ge,
|
|
1503
|
-
|
|
1504
|
+
R,
|
|
1504
1505
|
K,
|
|
1505
|
-
|
|
1506
|
+
Pe,
|
|
1506
1507
|
L,
|
|
1507
|
-
|
|
1508
|
+
N,
|
|
1508
1509
|
O,
|
|
1509
|
-
|
|
1510
|
-
|
|
1510
|
+
De,
|
|
1511
|
+
Z,
|
|
1511
1512
|
a,
|
|
1512
|
-
|
|
1513
|
-
|
|
1513
|
+
Se,
|
|
1514
|
+
f,
|
|
1514
1515
|
fe,
|
|
1515
1516
|
u,
|
|
1516
1517
|
y,
|
|
1517
|
-
|
|
1518
|
-
o,
|
|
1519
|
-
J,
|
|
1518
|
+
M,
|
|
1520
1519
|
n,
|
|
1520
|
+
Q,
|
|
1521
|
+
o,
|
|
1521
1522
|
B,
|
|
1522
1523
|
t,
|
|
1523
1524
|
ae,
|
|
1524
1525
|
Ye,
|
|
1525
1526
|
c,
|
|
1526
|
-
|
|
1527
|
+
I,
|
|
1527
1528
|
g,
|
|
1528
1529
|
T,
|
|
1529
1530
|
d,
|
|
@@ -1531,66 +1532,66 @@ function Ae(e) {
|
|
|
1531
1532
|
b,
|
|
1532
1533
|
k
|
|
1533
1534
|
]);
|
|
1534
|
-
return /* @__PURE__ */ l(
|
|
1535
|
+
return /* @__PURE__ */ l(Rt.Provider, { value: Zt, children: e.children });
|
|
1535
1536
|
}
|
|
1536
|
-
const
|
|
1537
|
-
top:
|
|
1538
|
-
error:
|
|
1539
|
-
label:
|
|
1537
|
+
const Bo = "_top_cq7uz_1", zo = "_error_cq7uz_6", Eo = "_label_cq7uz_14", et = {
|
|
1538
|
+
top: Bo,
|
|
1539
|
+
error: zo,
|
|
1540
|
+
label: Eo
|
|
1540
1541
|
};
|
|
1541
|
-
function
|
|
1542
|
-
const [
|
|
1542
|
+
function U(e) {
|
|
1543
|
+
const [n, t] = D(
|
|
1543
1544
|
2
|
|
1544
1545
|
/* VALID */
|
|
1545
|
-
), [
|
|
1546
|
+
), [o, i] = D(null), [a, s] = D(e.input), [u, r] = D(
|
|
1546
1547
|
String(e.input)
|
|
1547
|
-
), c = e.submitLabel === void 0, m = e.resetButton !== !1, d = e.enableEnterKey !== !1, h =
|
|
1548
|
+
), c = e.submitLabel === void 0, m = e.resetButton !== !1, d = e.enableEnterKey !== !1, h = X(null), g = c && !d, p = g && n === 1 || !g && n === 0 || c && n === 1 || !c && n === 0;
|
|
1548
1549
|
function b(k) {
|
|
1549
1550
|
t(
|
|
1550
1551
|
0
|
|
1551
1552
|
/* PENDING */
|
|
1552
1553
|
);
|
|
1553
|
-
const
|
|
1554
|
-
r(
|
|
1554
|
+
const P = k.currentTarget.value;
|
|
1555
|
+
r(P), g && v(P);
|
|
1555
1556
|
}
|
|
1556
|
-
function
|
|
1557
|
+
function v(k) {
|
|
1557
1558
|
if (t(
|
|
1558
1559
|
0
|
|
1559
1560
|
/* PENDING */
|
|
1560
1561
|
), e.isValid !== void 0) {
|
|
1561
|
-
const [
|
|
1562
|
-
if (
|
|
1562
|
+
const [P, L] = e.isValid(k ?? u);
|
|
1563
|
+
if (P) {
|
|
1563
1564
|
t(
|
|
1564
1565
|
2
|
|
1565
1566
|
/* VALID */
|
|
1566
1567
|
);
|
|
1567
|
-
const
|
|
1568
|
-
e.updateValue(L), s(L), i(
|
|
1568
|
+
const E = a;
|
|
1569
|
+
e.updateValue(L), s(L), i(E);
|
|
1569
1570
|
} else
|
|
1570
1571
|
t(
|
|
1571
1572
|
1
|
|
1572
1573
|
/* ERROR */
|
|
1573
1574
|
);
|
|
1574
1575
|
} else {
|
|
1575
|
-
const
|
|
1576
|
-
e.updateValue(
|
|
1576
|
+
const P = k, L = a;
|
|
1577
|
+
e.updateValue(P), s(P), i(L);
|
|
1577
1578
|
}
|
|
1578
1579
|
}
|
|
1579
1580
|
const T = (k) => {
|
|
1580
|
-
var
|
|
1581
|
-
d && k.key === "Enter" &&
|
|
1581
|
+
var P;
|
|
1582
|
+
d && k.key === "Enter" && v((P = h.current) == null ? void 0 : P.value);
|
|
1582
1583
|
};
|
|
1583
1584
|
function V() {
|
|
1584
1585
|
t(
|
|
1585
1586
|
0
|
|
1586
1587
|
/* PENDING */
|
|
1587
|
-
), console.log("previous value is ",
|
|
1588
|
+
), console.log("previous value is ", o), o !== null && (t(
|
|
1588
1589
|
2
|
|
1589
1590
|
/* VALID */
|
|
1590
|
-
), e.updateValue(
|
|
1591
|
+
), e.updateValue(o), s(o), console.log("setting value, ", o));
|
|
1591
1592
|
}
|
|
1592
|
-
return /* @__PURE__ */ l(
|
|
1593
|
-
|
|
1593
|
+
return /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ S("div", { className: et.top, children: [
|
|
1594
|
+
n === 1 && /* @__PURE__ */ S("div", { className: et.error, children: [
|
|
1594
1595
|
'"',
|
|
1595
1596
|
u,
|
|
1596
1597
|
'" is invalid'
|
|
@@ -1599,7 +1600,7 @@ function q(e) {
|
|
|
1599
1600
|
e.label,
|
|
1600
1601
|
":"
|
|
1601
1602
|
] }),
|
|
1602
|
-
m && /* @__PURE__ */ l("button", { onClick: V, disabled: e.disabled, children: /* @__PURE__ */ l(
|
|
1603
|
+
m && /* @__PURE__ */ l("button", { onClick: V, disabled: e.disabled, children: /* @__PURE__ */ l(Jn, {}) }),
|
|
1603
1604
|
/* @__PURE__ */ l(
|
|
1604
1605
|
"input",
|
|
1605
1606
|
{
|
|
@@ -1614,7 +1615,7 @@ function q(e) {
|
|
|
1614
1615
|
disabled: e.disabled,
|
|
1615
1616
|
onBlur: () => {
|
|
1616
1617
|
var k;
|
|
1617
|
-
|
|
1618
|
+
v((k = h.current) == null ? void 0 : k.value);
|
|
1618
1619
|
},
|
|
1619
1620
|
...e.inputAttribs
|
|
1620
1621
|
}
|
|
@@ -1623,7 +1624,7 @@ function q(e) {
|
|
|
1623
1624
|
"button",
|
|
1624
1625
|
{
|
|
1625
1626
|
onClick: () => {
|
|
1626
|
-
|
|
1627
|
+
v(void 0);
|
|
1627
1628
|
},
|
|
1628
1629
|
disabled: e.disabled,
|
|
1629
1630
|
children: e.submitLabel
|
|
@@ -1631,30 +1632,30 @@ function q(e) {
|
|
|
1631
1632
|
)
|
|
1632
1633
|
] }) });
|
|
1633
1634
|
}
|
|
1634
|
-
const
|
|
1635
|
-
modal:
|
|
1636
|
-
modal_content:
|
|
1637
|
-
modal_header:
|
|
1638
|
-
modal_footer:
|
|
1639
|
-
modal_title:
|
|
1640
|
-
modal_body:
|
|
1641
|
-
close_button:
|
|
1642
|
-
aspect:
|
|
1643
|
-
btn:
|
|
1635
|
+
const Ro = "_modal_ftojl_1", Ho = "_modal_content_ftojl_7", Ko = "_modal_header_ftojl_16", Uo = "_modal_footer_ftojl_17", qo = "_modal_title_ftojl_22", Go = "_modal_body_ftojl_26", Wo = "_close_button_ftojl_32", Yo = "_aspect_ftojl_38", jo = "_btn_ftojl_44", le = {
|
|
1636
|
+
modal: Ro,
|
|
1637
|
+
modal_content: Ho,
|
|
1638
|
+
modal_header: Ko,
|
|
1639
|
+
modal_footer: Uo,
|
|
1640
|
+
modal_title: qo,
|
|
1641
|
+
modal_body: Go,
|
|
1642
|
+
close_button: Wo,
|
|
1643
|
+
aspect: Yo,
|
|
1644
|
+
btn: jo
|
|
1644
1645
|
};
|
|
1645
1646
|
function We(e) {
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1647
|
+
const n = X(null), [t, o] = D(!1);
|
|
1648
|
+
Mt(n, (r) => {
|
|
1648
1649
|
r.stopPropagation();
|
|
1649
1650
|
}), Be("Escape", () => {
|
|
1650
|
-
|
|
1651
|
+
o(!1);
|
|
1651
1652
|
});
|
|
1652
1653
|
const i = e.title, a = i + "-toggle", s = e.hideToggle ?? !1, u = e.button ? /* @__PURE__ */ l(
|
|
1653
1654
|
"button",
|
|
1654
1655
|
{
|
|
1655
1656
|
title: i,
|
|
1656
1657
|
className: le.btn,
|
|
1657
|
-
onClick: () =>
|
|
1658
|
+
onClick: () => o(!0),
|
|
1658
1659
|
hidden: s,
|
|
1659
1660
|
children: e.button
|
|
1660
1661
|
},
|
|
@@ -1665,7 +1666,7 @@ function We(e) {
|
|
|
1665
1666
|
label: i,
|
|
1666
1667
|
icon: e.icon,
|
|
1667
1668
|
onToggle: () => {
|
|
1668
|
-
|
|
1669
|
+
o(!0);
|
|
1669
1670
|
},
|
|
1670
1671
|
value: !1,
|
|
1671
1672
|
hidden: s
|
|
@@ -1674,7 +1675,7 @@ function We(e) {
|
|
|
1674
1675
|
);
|
|
1675
1676
|
return /* @__PURE__ */ S(ye, { children: [
|
|
1676
1677
|
!s && u,
|
|
1677
|
-
t && /* @__PURE__ */ l(
|
|
1678
|
+
t && /* @__PURE__ */ l(_t, { handle: "strong", nodeRef: n, children: /* @__PURE__ */ l("div", { hidden: !t, className: le.modal, ref: n, children: /* @__PURE__ */ S(
|
|
1678
1679
|
"div",
|
|
1679
1680
|
{
|
|
1680
1681
|
className: le.modal_content,
|
|
@@ -1686,7 +1687,7 @@ function We(e) {
|
|
|
1686
1687
|
"button",
|
|
1687
1688
|
{
|
|
1688
1689
|
onClick: () => {
|
|
1689
|
-
|
|
1690
|
+
o(!1);
|
|
1690
1691
|
},
|
|
1691
1692
|
className: le.close_button,
|
|
1692
1693
|
children: "X"
|
|
@@ -1704,27 +1705,27 @@ function We(e) {
|
|
|
1704
1705
|
) }) }, i)
|
|
1705
1706
|
] }, "Modal-" + i);
|
|
1706
1707
|
}
|
|
1707
|
-
function
|
|
1708
|
-
const { aspect:
|
|
1709
|
-
|
|
1710
|
-
const r =
|
|
1711
|
-
console.log("Set initial type", r,
|
|
1712
|
-
}, [
|
|
1708
|
+
function Xo(e) {
|
|
1709
|
+
const { aspect: n, setAspect: t, children: o } = e, i = X("number"), [a, s] = D(2);
|
|
1710
|
+
z(() => {
|
|
1711
|
+
const r = xo(n);
|
|
1712
|
+
console.log("Set initial type", r, n), i.current = r, s(r === "number" ? n : 2);
|
|
1713
|
+
}, [n]);
|
|
1713
1714
|
function u(r) {
|
|
1714
1715
|
i.current = r, t(r === "number" ? a : r);
|
|
1715
1716
|
}
|
|
1716
1717
|
return We({
|
|
1717
1718
|
title: "Aspect ratio",
|
|
1718
|
-
icon:
|
|
1719
|
+
icon: Bn,
|
|
1719
1720
|
hideToggle: e.hideToggle,
|
|
1720
|
-
children: /* @__PURE__ */ S(
|
|
1721
|
+
children: /* @__PURE__ */ S(ee, { children: [
|
|
1721
1722
|
/* @__PURE__ */ l("div", { className: le.aspect, children: /* @__PURE__ */ l(
|
|
1722
|
-
|
|
1723
|
+
U,
|
|
1723
1724
|
{
|
|
1724
1725
|
disabled: i.current !== "number",
|
|
1725
1726
|
label: "aspect ratio",
|
|
1726
1727
|
input: a,
|
|
1727
|
-
isValid: (r) =>
|
|
1728
|
+
isValid: (r) => Vt(r, 10),
|
|
1728
1729
|
inputAttribs: {
|
|
1729
1730
|
name: "digits",
|
|
1730
1731
|
pattern: "^\\d+|\\d+.\\d*$",
|
|
@@ -1739,88 +1740,88 @@ function jo(e) {
|
|
|
1739
1740
|
) }),
|
|
1740
1741
|
/* @__PURE__ */ S("div", { className: le.aspect, children: [
|
|
1741
1742
|
/* @__PURE__ */ S(
|
|
1742
|
-
|
|
1743
|
+
W,
|
|
1743
1744
|
{
|
|
1744
1745
|
role: "radiogroup",
|
|
1745
1746
|
ariaLabel: "aspect",
|
|
1746
1747
|
value: i.current,
|
|
1747
1748
|
onChange: u,
|
|
1748
1749
|
children: [
|
|
1749
|
-
/* @__PURE__ */ l(
|
|
1750
|
-
/* @__PURE__ */ l(
|
|
1751
|
-
/* @__PURE__ */ l(
|
|
1750
|
+
/* @__PURE__ */ l(W.Btn, { label: "number", value: "number" }),
|
|
1751
|
+
/* @__PURE__ */ l(W.Btn, { label: "auto", value: "auto" }),
|
|
1752
|
+
/* @__PURE__ */ l(W.Btn, { label: "equal", value: "equal" })
|
|
1752
1753
|
]
|
|
1753
1754
|
}
|
|
1754
1755
|
),
|
|
1755
|
-
|
|
1756
|
+
o
|
|
1756
1757
|
] })
|
|
1757
1758
|
] })
|
|
1758
1759
|
});
|
|
1759
1760
|
}
|
|
1760
|
-
const
|
|
1761
|
-
root:
|
|
1762
|
-
sliderContainer:
|
|
1763
|
-
slider:
|
|
1764
|
-
tools:
|
|
1765
|
-
toolsInner:
|
|
1761
|
+
const Zo = "_root_h18us_1", Qo = "_sliderContainer_h18us_8", Jo = "_slider_h18us_8", ei = "_tools_h18us_27", ti = "_toolsInner_h18us_37", Ue = {
|
|
1762
|
+
root: Zo,
|
|
1763
|
+
sliderContainer: Qo,
|
|
1764
|
+
slider: Jo,
|
|
1765
|
+
tools: ei,
|
|
1766
|
+
toolsInner: ti
|
|
1766
1767
|
};
|
|
1767
|
-
|
|
1768
|
-
function
|
|
1769
|
-
const { id:
|
|
1768
|
+
eo(".3~e");
|
|
1769
|
+
function ni(e) {
|
|
1770
|
+
const { id: n, domainProps: t, children: o } = e;
|
|
1770
1771
|
return /* @__PURE__ */ l(
|
|
1771
1772
|
"div",
|
|
1772
1773
|
{
|
|
1773
|
-
id:
|
|
1774
|
+
id: n,
|
|
1774
1775
|
className: Ue.tools,
|
|
1775
1776
|
role: "dialog",
|
|
1776
1777
|
"aria-label": "Edit domain",
|
|
1777
1778
|
children: /* @__PURE__ */ S("div", { className: Ue.toolsInner, children: [
|
|
1778
|
-
|
|
1779
|
-
/* @__PURE__ */ l(
|
|
1779
|
+
o,
|
|
1780
|
+
/* @__PURE__ */ l(mn, { ...t })
|
|
1780
1781
|
] })
|
|
1781
1782
|
}
|
|
1782
1783
|
);
|
|
1783
1784
|
}
|
|
1784
|
-
const
|
|
1785
|
-
function
|
|
1786
|
-
const { dataDomain:
|
|
1787
|
-
|
|
1788
|
-
s || i(
|
|
1789
|
-
}, [
|
|
1790
|
-
const [m, d] =
|
|
1785
|
+
const oi = "domain-tools";
|
|
1786
|
+
function Ht(e) {
|
|
1787
|
+
const { dataDomain: n, customDomain: t, scaleType: o } = e, { onCustomDomainChange: i, histogram: a } = e, [s, u] = D(!1), r = cn(t, n), c = F(() => s ? t : r, [s, t, r]);
|
|
1788
|
+
z(() => {
|
|
1789
|
+
s || i(n);
|
|
1790
|
+
}, [n, s, i]);
|
|
1791
|
+
const [m, d] = un(
|
|
1791
1792
|
r,
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
), [h, g] =
|
|
1795
|
-
|
|
1793
|
+
n,
|
|
1794
|
+
o ?? _e.Linear
|
|
1795
|
+
), [h, g] = D(r);
|
|
1796
|
+
z(() => {
|
|
1796
1797
|
g(r);
|
|
1797
1798
|
}, [r]);
|
|
1798
|
-
const p = c[0] === null, b = c[1] === null, [
|
|
1799
|
+
const p = c[0] === null, b = c[1] === null, [v, T] = Fe(!1), [V, k] = Fe(!1), P = v || V;
|
|
1799
1800
|
function L(x) {
|
|
1800
1801
|
T(x), k(x);
|
|
1801
1802
|
}
|
|
1802
|
-
function
|
|
1803
|
-
|
|
1803
|
+
function E() {
|
|
1804
|
+
P && L(!1);
|
|
1804
1805
|
}
|
|
1805
|
-
const O =
|
|
1806
|
-
|
|
1807
|
-
|
|
1806
|
+
const O = X(null);
|
|
1807
|
+
Mt(O, E), Be("Escape", () => {
|
|
1808
|
+
E();
|
|
1808
1809
|
});
|
|
1809
|
-
const
|
|
1810
|
+
const Y = {
|
|
1810
1811
|
sliderDomain: h,
|
|
1811
|
-
dataDomain:
|
|
1812
|
+
dataDomain: n,
|
|
1812
1813
|
errors: d,
|
|
1813
1814
|
isAutoMin: p,
|
|
1814
1815
|
isAutoMax: b,
|
|
1815
1816
|
onAutoMinToggle: () => {
|
|
1816
|
-
const x = p ?
|
|
1817
|
+
const x = p ? n[0] : null;
|
|
1817
1818
|
i([x, c[1]]), p || T(!1);
|
|
1818
1819
|
},
|
|
1819
1820
|
onAutoMaxToggle: () => {
|
|
1820
|
-
const x = b ?
|
|
1821
|
+
const x = b ? n[1] : null;
|
|
1821
1822
|
i([c[0], x]), b || k(!1);
|
|
1822
1823
|
},
|
|
1823
|
-
isEditingMin:
|
|
1824
|
+
isEditingMin: v,
|
|
1824
1825
|
isEditingMax: V,
|
|
1825
1826
|
onEditMin: T,
|
|
1826
1827
|
onEditMax: k,
|
|
@@ -1830,12 +1831,12 @@ function Rt(e) {
|
|
|
1830
1831
|
};
|
|
1831
1832
|
return /* @__PURE__ */ S("div", { ref: O, className: Ue.root, children: [
|
|
1832
1833
|
!a && /* @__PURE__ */ l("div", { className: Ue.sliderContainer, children: /* @__PURE__ */ l(
|
|
1833
|
-
|
|
1834
|
+
dn,
|
|
1834
1835
|
{
|
|
1835
1836
|
value: h,
|
|
1836
1837
|
safeVisDomain: m,
|
|
1837
|
-
dataDomain:
|
|
1838
|
-
scaleType:
|
|
1838
|
+
dataDomain: n,
|
|
1839
|
+
scaleType: o ?? _e.Linear,
|
|
1839
1840
|
errors: d,
|
|
1840
1841
|
isAutoMin: p,
|
|
1841
1842
|
isAutoMax: b,
|
|
@@ -1850,12 +1851,12 @@ function Rt(e) {
|
|
|
1850
1851
|
}
|
|
1851
1852
|
}
|
|
1852
1853
|
) }),
|
|
1853
|
-
/* @__PURE__ */ l(
|
|
1854
|
-
|
|
1854
|
+
/* @__PURE__ */ l(ni, { id: oi, domainProps: Y, children: a && /* @__PURE__ */ l(
|
|
1855
|
+
hn,
|
|
1855
1856
|
{
|
|
1856
|
-
dataDomain:
|
|
1857
|
+
dataDomain: n,
|
|
1857
1858
|
value: h,
|
|
1858
|
-
scaleType:
|
|
1859
|
+
scaleType: o ?? _e.Linear,
|
|
1859
1860
|
onChangeMin: (x) => i([x, c[1]]),
|
|
1860
1861
|
onChangeMax: (x) => i([c[0], x]),
|
|
1861
1862
|
...a
|
|
@@ -1876,10 +1877,10 @@ function Rt(e) {
|
|
|
1876
1877
|
] })
|
|
1877
1878
|
] });
|
|
1878
1879
|
}
|
|
1879
|
-
|
|
1880
|
+
Ht.displayName = "DomainConfig";
|
|
1880
1881
|
function tt(e) {
|
|
1881
|
-
const
|
|
1882
|
-
|
|
1882
|
+
const n = e.label && e.setLabel && /* @__PURE__ */ l(
|
|
1883
|
+
U,
|
|
1883
1884
|
{
|
|
1884
1885
|
label: "label",
|
|
1885
1886
|
input: e.label,
|
|
@@ -1888,15 +1889,15 @@ function tt(e) {
|
|
|
1888
1889
|
},
|
|
1889
1890
|
"label"
|
|
1890
1891
|
), t = e.scaleType && e.setScaleType && /* @__PURE__ */ l(
|
|
1891
|
-
|
|
1892
|
+
fn,
|
|
1892
1893
|
{
|
|
1893
1894
|
label: "scale",
|
|
1894
1895
|
value: e.scaleType,
|
|
1895
1896
|
onScaleChange: e.setScaleType,
|
|
1896
1897
|
options: e.scaleOptions
|
|
1897
1898
|
}
|
|
1898
|
-
),
|
|
1899
|
-
|
|
1899
|
+
), o = e.colourMap && e.setColourMap && e.invertColourMap !== void 0 && e.toggleColourMapInversion !== void 0 && /* @__PURE__ */ l(
|
|
1900
|
+
gn,
|
|
1900
1901
|
{
|
|
1901
1902
|
value: e.colourMap,
|
|
1902
1903
|
onValueChange: e.setColourMap,
|
|
@@ -1904,7 +1905,7 @@ function tt(e) {
|
|
|
1904
1905
|
onInversionChange: e.toggleColourMapInversion
|
|
1905
1906
|
}
|
|
1906
1907
|
), i = e.domain && e.histogram && e.customDomain && e.setCustomDomain && /* @__PURE__ */ l(
|
|
1907
|
-
|
|
1908
|
+
Ht,
|
|
1908
1909
|
{
|
|
1909
1910
|
dataDomain: e.domain,
|
|
1910
1911
|
customDomain: e.customDomain,
|
|
@@ -1913,13 +1914,13 @@ function tt(e) {
|
|
|
1913
1914
|
histogram: e.histogram
|
|
1914
1915
|
}
|
|
1915
1916
|
), a = e.scatterPointSize !== void 0 && e.setScatterPointSize && /* @__PURE__ */ l(
|
|
1916
|
-
|
|
1917
|
+
U,
|
|
1917
1918
|
{
|
|
1918
1919
|
label: "point size",
|
|
1919
1920
|
input: e.scatterPointSize,
|
|
1920
1921
|
updateValue: e.setScatterPointSize,
|
|
1921
1922
|
decimalPlaces: 2,
|
|
1922
|
-
isValid: (s) =>
|
|
1923
|
+
isValid: (s) => It(s, !1),
|
|
1923
1924
|
disabled: !(e != null && e.hasBaton)
|
|
1924
1925
|
},
|
|
1925
1926
|
"point size"
|
|
@@ -1927,25 +1928,25 @@ function tt(e) {
|
|
|
1927
1928
|
return We({
|
|
1928
1929
|
title: e.title,
|
|
1929
1930
|
icon: e.icon,
|
|
1930
|
-
button: e.colourMap ? /* @__PURE__ */ l(
|
|
1931
|
+
button: e.colourMap ? /* @__PURE__ */ l(yn, { colorMap: e.colourMap }) : null,
|
|
1931
1932
|
hideToggle: e.hideToggle,
|
|
1932
|
-
children: /* @__PURE__ */ S(
|
|
1933
|
-
o,
|
|
1934
|
-
t,
|
|
1933
|
+
children: /* @__PURE__ */ S(ee, { children: [
|
|
1935
1934
|
n,
|
|
1935
|
+
t,
|
|
1936
|
+
o,
|
|
1936
1937
|
i,
|
|
1937
1938
|
a,
|
|
1938
1939
|
e.children
|
|
1939
1940
|
] })
|
|
1940
1941
|
});
|
|
1941
1942
|
}
|
|
1942
|
-
function
|
|
1943
|
-
const { batonUuid:
|
|
1944
|
-
(c) =>
|
|
1945
|
-
), [u,
|
|
1943
|
+
function ii(e) {
|
|
1944
|
+
const { batonUuid: n, uuid: t, others: o, hasBaton: i, offerBaton: a, requestBaton: s } = e, u = n + "*", r = F(() => i ? o.map((c) => /* @__PURE__ */ l("div", { title: "Pass baton on", children: /* @__PURE__ */ l(He, { label: c, onClick: () => a(c) }, c) }, c)) : o.map(
|
|
1945
|
+
(c) => n == c ? /* @__PURE__ */ l("div", { title: "Request baton", children: /* @__PURE__ */ l(He, { label: u, onClick: () => s() }) }, n) : /* @__PURE__ */ l("p", { children: c }, c)
|
|
1946
|
+
), [u, n, i, a, o, s]);
|
|
1946
1947
|
return We({
|
|
1947
1948
|
title: "Baton info",
|
|
1948
|
-
icon:
|
|
1949
|
+
icon: to,
|
|
1949
1950
|
hideToggle: !t,
|
|
1950
1951
|
children: /* @__PURE__ */ S("div", { style: { lineHeight: "80%", width: "10em" }, children: [
|
|
1951
1952
|
/* @__PURE__ */ l("p", { children: /* @__PURE__ */ S("strong", { children: [
|
|
@@ -1953,80 +1954,80 @@ function oi(e) {
|
|
|
1953
1954
|
i ? u : t,
|
|
1954
1955
|
")"
|
|
1955
1956
|
] }) }),
|
|
1956
|
-
!i && r && /* @__PURE__ */ S(
|
|
1957
|
+
!i && r && /* @__PURE__ */ S(ee, { children: [
|
|
1957
1958
|
/* @__PURE__ */ S("p", { children: [
|
|
1958
1959
|
"Other client",
|
|
1959
1960
|
r.length > 1 ? "s" : ""
|
|
1960
1961
|
] }),
|
|
1961
1962
|
r
|
|
1962
1963
|
] }),
|
|
1963
|
-
i &&
|
|
1964
|
+
i && n && r
|
|
1964
1965
|
] })
|
|
1965
1966
|
});
|
|
1966
1967
|
}
|
|
1967
|
-
function
|
|
1968
|
-
function
|
|
1969
|
-
e.updateSelection && e.updateSelection(null, !
|
|
1968
|
+
function ai(e) {
|
|
1969
|
+
function n() {
|
|
1970
|
+
e.updateSelection && e.updateSelection(null, !1, !0), e.updateCurrentSelectionID(null);
|
|
1970
1971
|
}
|
|
1971
1972
|
return /* @__PURE__ */ l(
|
|
1972
1973
|
He,
|
|
1973
1974
|
{
|
|
1974
1975
|
label: "Clear all selections",
|
|
1975
1976
|
onClick: () => {
|
|
1976
|
-
window.confirm("Clear all selections?") &&
|
|
1977
|
+
window.confirm("Clear all selections?") && n();
|
|
1977
1978
|
},
|
|
1978
1979
|
disabled: e.disabled
|
|
1979
1980
|
}
|
|
1980
1981
|
);
|
|
1981
1982
|
}
|
|
1982
|
-
function
|
|
1983
|
-
const { value:
|
|
1984
|
-
return
|
|
1985
|
-
!
|
|
1986
|
-
}, [
|
|
1987
|
-
|
|
1983
|
+
function si(e) {
|
|
1984
|
+
const { value: n, onModeChange: t, hasBaton: o } = e;
|
|
1985
|
+
return z(() => {
|
|
1986
|
+
!o && n === J.selectRegion && t(J.panAndWheelZoom);
|
|
1987
|
+
}, [n, t, o]), /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ S(
|
|
1988
|
+
W,
|
|
1988
1989
|
{
|
|
1989
1990
|
role: "radiogroup",
|
|
1990
1991
|
ariaLabel: "mode",
|
|
1991
|
-
value:
|
|
1992
|
+
value: n,
|
|
1992
1993
|
onChange: (i) => t(i),
|
|
1993
1994
|
children: [
|
|
1994
1995
|
/* @__PURE__ */ l(
|
|
1995
|
-
|
|
1996
|
+
W.Btn,
|
|
1996
1997
|
{
|
|
1997
1998
|
label: decodeURI(
|
|
1998
1999
|
"pan & wheel zoom%0A alt: x-only%0A shift: y-only"
|
|
1999
2000
|
),
|
|
2000
2001
|
iconOnly: !0,
|
|
2001
|
-
icon:
|
|
2002
|
-
value:
|
|
2002
|
+
icon: Un,
|
|
2003
|
+
value: J.panAndWheelZoom
|
|
2003
2004
|
}
|
|
2004
2005
|
),
|
|
2005
2006
|
/* @__PURE__ */ l(
|
|
2006
|
-
|
|
2007
|
+
W.Btn,
|
|
2007
2008
|
{
|
|
2008
2009
|
label: decodeURI("select to zoom%0A alt: x-only%0A shift: y-only"),
|
|
2009
2010
|
iconOnly: !0,
|
|
2010
|
-
icon:
|
|
2011
|
-
value:
|
|
2011
|
+
icon: qn,
|
|
2012
|
+
value: J.selectToZoom
|
|
2012
2013
|
}
|
|
2013
2014
|
),
|
|
2014
2015
|
/* @__PURE__ */ l(
|
|
2015
2016
|
"div",
|
|
2016
2017
|
{
|
|
2017
2018
|
style: {
|
|
2018
|
-
pointerEvents:
|
|
2019
|
+
pointerEvents: o ? "inherit" : "auto",
|
|
2019
2020
|
display: "inline-flex"
|
|
2020
2021
|
},
|
|
2021
|
-
title:
|
|
2022
|
+
title: o ? "" : "need baton",
|
|
2022
2023
|
children: /* @__PURE__ */ l(
|
|
2023
|
-
|
|
2024
|
+
W.Btn,
|
|
2024
2025
|
{
|
|
2025
2026
|
label: "select region",
|
|
2026
2027
|
iconOnly: !0,
|
|
2027
|
-
icon:
|
|
2028
|
-
value:
|
|
2029
|
-
disabled: !
|
|
2028
|
+
icon: no,
|
|
2029
|
+
value: J.selectRegion,
|
|
2030
|
+
disabled: !o
|
|
2030
2031
|
}
|
|
2031
2032
|
)
|
|
2032
2033
|
}
|
|
@@ -2035,34 +2036,34 @@ function ai(e) {
|
|
|
2035
2036
|
}
|
|
2036
2037
|
) });
|
|
2037
2038
|
}
|
|
2038
|
-
const
|
|
2039
|
-
modeless:
|
|
2040
|
-
modeless_content:
|
|
2041
|
-
modeless_header:
|
|
2042
|
-
modeless_footer:
|
|
2043
|
-
modeless_title:
|
|
2044
|
-
modeless_body:
|
|
2045
|
-
close_button:
|
|
2046
|
-
aspect:
|
|
2047
|
-
btn:
|
|
2039
|
+
const li = "_modeless_1im3t_1", ri = "_modeless_content_1im3t_7", ci = "_modeless_header_1im3t_16", ui = "_modeless_footer_1im3t_17", di = "_modeless_title_1im3t_22", hi = "_modeless_body_1im3t_26", mi = "_close_button_1im3t_34", fi = "_aspect_1im3t_40", gi = "_btn_1im3t_46", ve = {
|
|
2040
|
+
modeless: li,
|
|
2041
|
+
modeless_content: ri,
|
|
2042
|
+
modeless_header: ci,
|
|
2043
|
+
modeless_footer: ui,
|
|
2044
|
+
modeless_title: di,
|
|
2045
|
+
modeless_body: hi,
|
|
2046
|
+
close_button: mi,
|
|
2047
|
+
aspect: fi,
|
|
2048
|
+
btn: gi
|
|
2048
2049
|
};
|
|
2049
|
-
function
|
|
2050
|
-
const
|
|
2050
|
+
function Kt(e) {
|
|
2051
|
+
const n = X(null);
|
|
2051
2052
|
return Be("Escape", () => {
|
|
2052
2053
|
e.setShowModeless(!1);
|
|
2053
|
-
}), [e.showModeless ? /* @__PURE__ */ l(
|
|
2054
|
+
}), [e.showModeless ? /* @__PURE__ */ l(_t, { handle: "strong", nodeRef: n, children: /* @__PURE__ */ l(
|
|
2054
2055
|
"div",
|
|
2055
2056
|
{
|
|
2056
2057
|
hidden: !e.showModeless,
|
|
2057
|
-
ref:
|
|
2058
|
-
className:
|
|
2058
|
+
ref: n,
|
|
2059
|
+
className: ve.modeless,
|
|
2059
2060
|
children: /* @__PURE__ */ S(
|
|
2060
2061
|
"div",
|
|
2061
2062
|
{
|
|
2062
|
-
className:
|
|
2063
|
-
onClick: (
|
|
2063
|
+
className: ve.modeless_content,
|
|
2064
|
+
onClick: (o) => o.stopPropagation(),
|
|
2064
2065
|
children: [
|
|
2065
|
-
/* @__PURE__ */ l("strong", { className: "cursor", children: /* @__PURE__ */ l("div", { className:
|
|
2066
|
+
/* @__PURE__ */ l("strong", { className: "cursor", children: /* @__PURE__ */ l("div", { className: ve.modeless_header, children: /* @__PURE__ */ S("h4", { className: ve.modeless_title, children: [
|
|
2066
2067
|
e.title,
|
|
2067
2068
|
/* @__PURE__ */ l(
|
|
2068
2069
|
"button",
|
|
@@ -2070,82 +2071,82 @@ function Ht(e) {
|
|
|
2070
2071
|
onClick: () => {
|
|
2071
2072
|
e.setShowModeless(!1);
|
|
2072
2073
|
},
|
|
2073
|
-
className:
|
|
2074
|
+
className: ve.close_button,
|
|
2074
2075
|
children: "X"
|
|
2075
2076
|
}
|
|
2076
2077
|
)
|
|
2077
2078
|
] }) }) }),
|
|
2078
|
-
/* @__PURE__ */ S("div", { className:
|
|
2079
|
+
/* @__PURE__ */ S("div", { className: ve.modeless_body, children: [
|
|
2079
2080
|
" ",
|
|
2080
2081
|
e.children,
|
|
2081
2082
|
" "
|
|
2082
2083
|
] }),
|
|
2083
|
-
/* @__PURE__ */ l("div", { className:
|
|
2084
|
+
/* @__PURE__ */ l("div", { className: ve.modeless_footer })
|
|
2084
2085
|
]
|
|
2085
2086
|
}
|
|
2086
2087
|
)
|
|
2087
2088
|
}
|
|
2088
2089
|
) }, e.title) : null];
|
|
2089
2090
|
}
|
|
2090
|
-
const
|
|
2091
|
-
colourLabel:
|
|
2091
|
+
const yi = "_colourLabel_1evqd_1", Ut = {
|
|
2092
|
+
colourLabel: yi
|
|
2092
2093
|
};
|
|
2093
|
-
function
|
|
2094
|
-
const
|
|
2095
|
-
return /* @__PURE__ */ l(
|
|
2096
|
-
|
|
2094
|
+
function pi(e) {
|
|
2095
|
+
const n = e.value ?? "Circle", t = e.onGlyphTypeChange, o = e.hasBaton;
|
|
2096
|
+
return /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ S(
|
|
2097
|
+
W,
|
|
2097
2098
|
{
|
|
2098
2099
|
role: "radiogroup",
|
|
2099
2100
|
ariaLabel: "mode",
|
|
2100
|
-
value:
|
|
2101
|
+
value: n,
|
|
2101
2102
|
onChange: (i) => t(i),
|
|
2102
2103
|
children: [
|
|
2103
2104
|
/* @__PURE__ */ l(
|
|
2104
|
-
|
|
2105
|
+
W.Btn,
|
|
2105
2106
|
{
|
|
2106
2107
|
label: "Circle",
|
|
2107
2108
|
iconOnly: !0,
|
|
2108
|
-
icon:
|
|
2109
|
+
icon: oo,
|
|
2109
2110
|
value: "Circle",
|
|
2110
|
-
disabled: !
|
|
2111
|
+
disabled: !o
|
|
2111
2112
|
}
|
|
2112
2113
|
),
|
|
2113
2114
|
/* @__PURE__ */ l(
|
|
2114
|
-
|
|
2115
|
+
W.Btn,
|
|
2115
2116
|
{
|
|
2116
2117
|
label: "Cross",
|
|
2117
2118
|
iconOnly: !0,
|
|
2118
|
-
icon:
|
|
2119
|
+
icon: io,
|
|
2119
2120
|
value: "Cross",
|
|
2120
|
-
disabled: !
|
|
2121
|
+
disabled: !o
|
|
2121
2122
|
}
|
|
2122
2123
|
),
|
|
2123
2124
|
/* @__PURE__ */ l(
|
|
2124
|
-
|
|
2125
|
+
W.Btn,
|
|
2125
2126
|
{
|
|
2126
2127
|
label: "Square",
|
|
2127
2128
|
iconOnly: !0,
|
|
2128
|
-
icon:
|
|
2129
|
+
icon: ao,
|
|
2129
2130
|
value: "Square",
|
|
2130
|
-
disabled: !
|
|
2131
|
+
disabled: !o
|
|
2131
2132
|
}
|
|
2132
2133
|
),
|
|
2133
2134
|
/* @__PURE__ */ l(
|
|
2134
2135
|
"div",
|
|
2135
2136
|
{
|
|
2136
2137
|
style: {
|
|
2137
|
-
pointerEvents:
|
|
2138
|
+
pointerEvents: o ? "inherit" : "auto",
|
|
2138
2139
|
display: "inline-flex"
|
|
2139
2140
|
},
|
|
2140
|
-
title:
|
|
2141
|
+
title: o ? "" : "need baton",
|
|
2141
2142
|
children: /* @__PURE__ */ l(
|
|
2142
|
-
|
|
2143
|
+
W.Btn,
|
|
2143
2144
|
{
|
|
2144
2145
|
label: "Cap",
|
|
2145
2146
|
iconOnly: !0,
|
|
2146
|
-
icon:
|
|
2147
|
+
icon: zn,
|
|
2147
2148
|
value: "Cap",
|
|
2148
|
-
disabled: !
|
|
2149
|
+
disabled: !o
|
|
2149
2150
|
}
|
|
2150
2151
|
)
|
|
2151
2152
|
}
|
|
@@ -2154,12 +2155,12 @@ function yi(e) {
|
|
|
2154
2155
|
}
|
|
2155
2156
|
) });
|
|
2156
2157
|
}
|
|
2157
|
-
function
|
|
2158
|
-
const { currentLineKey:
|
|
2159
|
-
console.log("currentLineKey is ",
|
|
2158
|
+
function bi(e) {
|
|
2159
|
+
const { currentLineKey: n, allLineParams: t, updateLineParams: o, hasBaton: i } = e;
|
|
2160
|
+
console.log("currentLineKey is ", n);
|
|
2160
2161
|
const a = [];
|
|
2161
|
-
if (
|
|
2162
|
-
const s = t.get(
|
|
2162
|
+
if (n !== null && t.has(n)) {
|
|
2163
|
+
const s = t.get(n);
|
|
2163
2164
|
if (s) {
|
|
2164
2165
|
const u = s.colour ?? "#000000";
|
|
2165
2166
|
a.push(
|
|
@@ -2167,7 +2168,7 @@ function pi(e) {
|
|
|
2167
2168
|
/* @__PURE__ */ l(
|
|
2168
2169
|
"div",
|
|
2169
2170
|
{
|
|
2170
|
-
className:
|
|
2171
|
+
className: Ut.colourLabel,
|
|
2171
2172
|
style: { borderLeftColor: u },
|
|
2172
2173
|
children: u
|
|
2173
2174
|
},
|
|
@@ -2175,11 +2176,11 @@ function pi(e) {
|
|
|
2175
2176
|
),
|
|
2176
2177
|
/* @__PURE__ */ l("br", {}, "colour spacer"),
|
|
2177
2178
|
i && /* @__PURE__ */ l(
|
|
2178
|
-
|
|
2179
|
+
Tt,
|
|
2179
2180
|
{
|
|
2180
2181
|
color: u,
|
|
2181
2182
|
onChange: (r) => {
|
|
2182
|
-
s.colour = r, n
|
|
2183
|
+
s.colour = r, o(n, s);
|
|
2183
2184
|
}
|
|
2184
2185
|
},
|
|
2185
2186
|
"colour picker"
|
|
@@ -2187,12 +2188,12 @@ function pi(e) {
|
|
|
2187
2188
|
] }, "line colour")
|
|
2188
2189
|
), a.push(
|
|
2189
2190
|
/* @__PURE__ */ l(
|
|
2190
|
-
|
|
2191
|
+
U,
|
|
2191
2192
|
{
|
|
2192
2193
|
label: "colour",
|
|
2193
2194
|
input: s.colour ?? "",
|
|
2194
2195
|
updateValue: (r) => {
|
|
2195
|
-
s.colour = r, n
|
|
2196
|
+
s.colour = r, o(n, s);
|
|
2196
2197
|
},
|
|
2197
2198
|
disabled: !i
|
|
2198
2199
|
},
|
|
@@ -2200,12 +2201,12 @@ function pi(e) {
|
|
|
2200
2201
|
)
|
|
2201
2202
|
), a.push(
|
|
2202
2203
|
/* @__PURE__ */ l(
|
|
2203
|
-
|
|
2204
|
+
U,
|
|
2204
2205
|
{
|
|
2205
2206
|
label: "name",
|
|
2206
2207
|
input: s.name,
|
|
2207
2208
|
updateValue: (r) => {
|
|
2208
|
-
s.name = r, n
|
|
2209
|
+
s.name = r, o(n, s);
|
|
2209
2210
|
},
|
|
2210
2211
|
disabled: !i
|
|
2211
2212
|
},
|
|
@@ -2218,7 +2219,7 @@ function pi(e) {
|
|
|
2218
2219
|
label: "Line on",
|
|
2219
2220
|
value: s.lineOn,
|
|
2220
2221
|
onToggle: () => {
|
|
2221
|
-
(s.pointSize || !s.lineOn) && (s.lineOn = !s.lineOn, n
|
|
2222
|
+
(s.pointSize || !s.lineOn) && (s.lineOn = !s.lineOn, o(n, s));
|
|
2222
2223
|
},
|
|
2223
2224
|
disabled: !i || s.pointSize == null || s.pointSize == 0
|
|
2224
2225
|
},
|
|
@@ -2226,14 +2227,14 @@ function pi(e) {
|
|
|
2226
2227
|
)
|
|
2227
2228
|
), a.push(
|
|
2228
2229
|
/* @__PURE__ */ l(
|
|
2229
|
-
|
|
2230
|
+
pi,
|
|
2230
2231
|
{
|
|
2231
2232
|
value: s.glyphType,
|
|
2232
2233
|
onGlyphTypeChange: (r) => {
|
|
2233
2234
|
console.log(
|
|
2234
2235
|
"calling onGlyphTypeChange with cLine ",
|
|
2235
|
-
|
|
2236
|
-
), s.glyphType = r, n
|
|
2236
|
+
n
|
|
2237
|
+
), s.glyphType = r, o(n, s);
|
|
2237
2238
|
},
|
|
2238
2239
|
hasBaton: i
|
|
2239
2240
|
},
|
|
@@ -2241,15 +2242,15 @@ function pi(e) {
|
|
|
2241
2242
|
)
|
|
2242
2243
|
), a.push(
|
|
2243
2244
|
/* @__PURE__ */ l(
|
|
2244
|
-
|
|
2245
|
+
U,
|
|
2245
2246
|
{
|
|
2246
2247
|
label: "point size",
|
|
2247
2248
|
input: s.pointSize ?? 0,
|
|
2248
2249
|
updateValue: (r) => {
|
|
2249
|
-
r == 0 && s.lineOn ? (s.pointSize = void 0, n
|
|
2250
|
+
r == 0 && s.lineOn ? (s.pointSize = void 0, o(n, s)) : r >= 0 && (s.pointSize = r, o(n, s));
|
|
2250
2251
|
},
|
|
2251
2252
|
decimalPlaces: 2,
|
|
2252
|
-
isValid: (r) =>
|
|
2253
|
+
isValid: (r) => It(r, s.lineOn),
|
|
2253
2254
|
disabled: !i
|
|
2254
2255
|
},
|
|
2255
2256
|
"point size"
|
|
@@ -2257,26 +2258,26 @@ function pi(e) {
|
|
|
2257
2258
|
);
|
|
2258
2259
|
}
|
|
2259
2260
|
}
|
|
2260
|
-
return
|
|
2261
|
+
return Kt({
|
|
2261
2262
|
title: "Line",
|
|
2262
2263
|
showModeless: e.showLineConfig,
|
|
2263
2264
|
setShowModeless: e.updateShowLineConfig,
|
|
2264
2265
|
children: a
|
|
2265
2266
|
});
|
|
2266
2267
|
}
|
|
2267
|
-
function
|
|
2268
|
-
const { allLineParams:
|
|
2268
|
+
function Si(e) {
|
|
2269
|
+
const { allLineParams: n, lineKey: t, onLineKeyChange: o } = e, i = [...n.keys()];
|
|
2269
2270
|
function a() {
|
|
2270
|
-
t === "" && i.length > 0 &&
|
|
2271
|
+
t === "" && i.length > 0 && o(i[0]);
|
|
2271
2272
|
}
|
|
2272
2273
|
a();
|
|
2273
2274
|
const s = "#ffffff";
|
|
2274
2275
|
function u(h) {
|
|
2275
|
-
const g =
|
|
2276
|
+
const g = n.get(h);
|
|
2276
2277
|
return (g == null ? void 0 : g.colour) ?? s;
|
|
2277
2278
|
}
|
|
2278
2279
|
function r(h) {
|
|
2279
|
-
const g =
|
|
2280
|
+
const g = n.get(h);
|
|
2280
2281
|
return (g == null ? void 0 : g.name) ?? "Line";
|
|
2281
2282
|
}
|
|
2282
2283
|
function c(h) {
|
|
@@ -2296,7 +2297,7 @@ function bi(e) {
|
|
|
2296
2297
|
})
|
|
2297
2298
|
);
|
|
2298
2299
|
return /* @__PURE__ */ l(
|
|
2299
|
-
|
|
2300
|
+
Lt,
|
|
2300
2301
|
{
|
|
2301
2302
|
styles: m,
|
|
2302
2303
|
value: {
|
|
@@ -2309,150 +2310,150 @@ function bi(e) {
|
|
|
2309
2310
|
t || a();
|
|
2310
2311
|
},
|
|
2311
2312
|
onChange: (h) => {
|
|
2312
|
-
h !== null &&
|
|
2313
|
+
h !== null && o(h.value);
|
|
2313
2314
|
}
|
|
2314
2315
|
}
|
|
2315
2316
|
);
|
|
2316
2317
|
}
|
|
2317
|
-
const
|
|
2318
|
-
option:
|
|
2318
|
+
const vi = "_option_1qhtz_1", Ci = "_icon_1qhtz_6", Pt = {
|
|
2319
|
+
option: vi,
|
|
2319
2320
|
icon: Ci
|
|
2320
|
-
},
|
|
2321
|
-
[
|
|
2322
|
-
Icon:
|
|
2321
|
+
}, xi = {
|
|
2322
|
+
[q.line]: {
|
|
2323
|
+
Icon: Fn,
|
|
2323
2324
|
label: "Line"
|
|
2324
2325
|
},
|
|
2325
|
-
[
|
|
2326
|
-
Icon:
|
|
2326
|
+
[q.rectangle]: {
|
|
2327
|
+
Icon: En,
|
|
2327
2328
|
label: "Rectangle"
|
|
2328
2329
|
},
|
|
2329
|
-
[
|
|
2330
|
-
Icon:
|
|
2330
|
+
[q.polyline]: {
|
|
2331
|
+
Icon: Rn,
|
|
2331
2332
|
label: "Polyline"
|
|
2332
2333
|
},
|
|
2333
|
-
[
|
|
2334
|
-
Icon:
|
|
2334
|
+
[q.polygon]: {
|
|
2335
|
+
Icon: Gn,
|
|
2335
2336
|
label: "Polygon"
|
|
2336
2337
|
},
|
|
2337
|
-
[
|
|
2338
|
-
Icon:
|
|
2338
|
+
[q.circle]: {
|
|
2339
|
+
Icon: Wn,
|
|
2339
2340
|
label: "Circle"
|
|
2340
2341
|
},
|
|
2341
|
-
[
|
|
2342
|
-
Icon:
|
|
2342
|
+
[q.ellipse]: {
|
|
2343
|
+
Icon: Yn,
|
|
2343
2344
|
label: "Ellipse"
|
|
2344
2345
|
},
|
|
2345
|
-
[
|
|
2346
|
-
Icon:
|
|
2346
|
+
[q.sector]: {
|
|
2347
|
+
Icon: ro,
|
|
2347
2348
|
label: "Sector"
|
|
2348
2349
|
},
|
|
2349
|
-
[
|
|
2350
|
-
Icon:
|
|
2350
|
+
[q.horizontalAxis]: {
|
|
2351
|
+
Icon: so,
|
|
2351
2352
|
label: "Horizontal Axis"
|
|
2352
2353
|
},
|
|
2353
|
-
[
|
|
2354
|
-
Icon:
|
|
2354
|
+
[q.verticalAxis]: {
|
|
2355
|
+
Icon: lo,
|
|
2355
2356
|
label: "Vertical Axis"
|
|
2356
2357
|
},
|
|
2357
|
-
[
|
|
2358
|
-
Icon:
|
|
2358
|
+
[q.unknown]: {
|
|
2359
|
+
Icon: jn,
|
|
2359
2360
|
label: "Unknown"
|
|
2360
2361
|
}
|
|
2361
2362
|
};
|
|
2362
|
-
function
|
|
2363
|
-
const { option:
|
|
2364
|
-
return /* @__PURE__ */ S("div", { className:
|
|
2365
|
-
/* @__PURE__ */ l(t, { className:
|
|
2366
|
-
/* @__PURE__ */ l("span", { children:
|
|
2363
|
+
function Pi(e) {
|
|
2364
|
+
const { option: n } = e, { Icon: t, label: o } = xi[n];
|
|
2365
|
+
return /* @__PURE__ */ S("div", { className: Pt.option, children: [
|
|
2366
|
+
/* @__PURE__ */ l(t, { className: Pt.icon }),
|
|
2367
|
+
/* @__PURE__ */ l("span", { children: o })
|
|
2367
2368
|
] });
|
|
2368
2369
|
}
|
|
2369
|
-
function
|
|
2370
|
+
function wi(e) {
|
|
2370
2371
|
const {
|
|
2371
|
-
value:
|
|
2372
|
+
value: n,
|
|
2372
2373
|
onSelectionTypeChange: t,
|
|
2373
|
-
disabled:
|
|
2374
|
+
disabled: o,
|
|
2374
2375
|
options: i = [
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2376
|
+
q.line,
|
|
2377
|
+
q.rectangle,
|
|
2378
|
+
q.horizontalAxis,
|
|
2379
|
+
q.verticalAxis,
|
|
2380
|
+
q.polygon,
|
|
2381
|
+
q.polyline
|
|
2381
2382
|
]
|
|
2382
2383
|
} = e;
|
|
2383
2384
|
return /* @__PURE__ */ l(
|
|
2384
|
-
|
|
2385
|
+
pn,
|
|
2385
2386
|
{
|
|
2386
|
-
value:
|
|
2387
|
+
value: n,
|
|
2387
2388
|
onChange: t,
|
|
2388
2389
|
options: i,
|
|
2389
|
-
renderOption: (a) => /* @__PURE__ */ l(
|
|
2390
|
-
disabled:
|
|
2390
|
+
renderOption: (a) => /* @__PURE__ */ l(Pi, { option: a }),
|
|
2391
|
+
disabled: o
|
|
2391
2392
|
}
|
|
2392
2393
|
);
|
|
2393
2394
|
}
|
|
2394
|
-
function
|
|
2395
|
-
const { selection:
|
|
2395
|
+
function qt(e) {
|
|
2396
|
+
const { selection: n, updateSelection: t, disabled: o } = e;
|
|
2396
2397
|
return /* @__PURE__ */ l(
|
|
2397
|
-
|
|
2398
|
+
U,
|
|
2398
2399
|
{
|
|
2399
2400
|
label: "angle",
|
|
2400
|
-
input:
|
|
2401
|
+
input: n.angle * 180 / Math.PI,
|
|
2401
2402
|
decimalPlaces: 5,
|
|
2402
2403
|
updateValue: (i) => {
|
|
2403
2404
|
const a = i * (Math.PI / 180);
|
|
2404
|
-
|
|
2405
|
+
n.setAngle(a), t && t(n);
|
|
2405
2406
|
},
|
|
2406
2407
|
isValid: (i) => he(i),
|
|
2407
|
-
disabled:
|
|
2408
|
+
disabled: o
|
|
2408
2409
|
},
|
|
2409
2410
|
"angle"
|
|
2410
2411
|
);
|
|
2411
2412
|
}
|
|
2412
|
-
function
|
|
2413
|
-
const { selection:
|
|
2413
|
+
function ut(e) {
|
|
2414
|
+
const { selection: n, updateSelection: t, disabled: o } = e;
|
|
2414
2415
|
return /* @__PURE__ */ l(
|
|
2415
|
-
|
|
2416
|
+
U,
|
|
2416
2417
|
{
|
|
2417
2418
|
label: "x",
|
|
2418
|
-
input:
|
|
2419
|
+
input: n.start[0],
|
|
2419
2420
|
decimalPlaces: 8,
|
|
2420
2421
|
updateValue: (i) => {
|
|
2421
|
-
|
|
2422
|
+
n.setStart(0, i), t && t(n);
|
|
2422
2423
|
},
|
|
2423
2424
|
isValid: (i) => he(i),
|
|
2424
|
-
disabled:
|
|
2425
|
+
disabled: o
|
|
2425
2426
|
},
|
|
2426
2427
|
"x"
|
|
2427
2428
|
);
|
|
2428
2429
|
}
|
|
2429
|
-
function
|
|
2430
|
-
const { selection:
|
|
2430
|
+
function dt(e) {
|
|
2431
|
+
const { selection: n, updateSelection: t, disabled: o } = e;
|
|
2431
2432
|
return /* @__PURE__ */ l(
|
|
2432
|
-
|
|
2433
|
+
U,
|
|
2433
2434
|
{
|
|
2434
2435
|
label: "y",
|
|
2435
|
-
input:
|
|
2436
|
+
input: n.start[1],
|
|
2436
2437
|
decimalPlaces: 8,
|
|
2437
2438
|
updateValue: (i) => {
|
|
2438
|
-
|
|
2439
|
+
n.setStart(1, i), t && t(n);
|
|
2439
2440
|
},
|
|
2440
2441
|
isValid: (i) => he(i),
|
|
2441
|
-
disabled:
|
|
2442
|
+
disabled: o
|
|
2442
2443
|
},
|
|
2443
2444
|
"y"
|
|
2444
2445
|
);
|
|
2445
2446
|
}
|
|
2446
|
-
function
|
|
2447
|
-
const { i:
|
|
2447
|
+
function Di(e) {
|
|
2448
|
+
const { i: n, point: t, updatePoint: o, disabled: i } = e, a = `x${n}`;
|
|
2448
2449
|
return /* @__PURE__ */ l(
|
|
2449
|
-
|
|
2450
|
+
U,
|
|
2450
2451
|
{
|
|
2451
2452
|
label: a,
|
|
2452
2453
|
input: t[0],
|
|
2453
2454
|
decimalPlaces: 8,
|
|
2454
2455
|
updateValue: (s) => {
|
|
2455
|
-
t[0] = s,
|
|
2456
|
+
t[0] = s, o(t);
|
|
2456
2457
|
},
|
|
2457
2458
|
isValid: (s) => he(s),
|
|
2458
2459
|
disabled: i
|
|
@@ -2460,16 +2461,16 @@ function wi(e) {
|
|
|
2460
2461
|
a
|
|
2461
2462
|
);
|
|
2462
2463
|
}
|
|
2463
|
-
function
|
|
2464
|
-
const { i:
|
|
2464
|
+
function Mi(e) {
|
|
2465
|
+
const { i: n, point: t, updatePoint: o, disabled: i } = e, a = `y${n}`;
|
|
2465
2466
|
return /* @__PURE__ */ l(
|
|
2466
|
-
|
|
2467
|
+
U,
|
|
2467
2468
|
{
|
|
2468
2469
|
label: a,
|
|
2469
2470
|
input: t[1],
|
|
2470
2471
|
decimalPlaces: 8,
|
|
2471
2472
|
updateValue: (s) => {
|
|
2472
|
-
t[1] = s,
|
|
2473
|
+
t[1] = s, o(t);
|
|
2473
2474
|
},
|
|
2474
2475
|
isValid: (s) => he(s),
|
|
2475
2476
|
disabled: i
|
|
@@ -2477,197 +2478,197 @@ function Di(e) {
|
|
|
2477
2478
|
a
|
|
2478
2479
|
);
|
|
2479
2480
|
}
|
|
2480
|
-
function
|
|
2481
|
-
const { selection:
|
|
2482
|
-
return
|
|
2481
|
+
function _i(e) {
|
|
2482
|
+
const { selection: n, updateSelection: t, disabled: o } = e;
|
|
2483
|
+
return n.dimension === 0 ? /* @__PURE__ */ S(ye, { children: [
|
|
2483
2484
|
/* @__PURE__ */ l(
|
|
2484
|
-
|
|
2485
|
+
ut,
|
|
2485
2486
|
{
|
|
2486
|
-
selection:
|
|
2487
|
+
selection: n,
|
|
2487
2488
|
updateSelection: t,
|
|
2488
|
-
disabled:
|
|
2489
|
+
disabled: o
|
|
2489
2490
|
},
|
|
2490
|
-
`XInput${
|
|
2491
|
+
`XInput${n.vStart.x}`
|
|
2491
2492
|
),
|
|
2492
2493
|
/* @__PURE__ */ l(
|
|
2493
|
-
|
|
2494
|
+
U,
|
|
2494
2495
|
{
|
|
2495
2496
|
label: "x length",
|
|
2496
|
-
input:
|
|
2497
|
+
input: n.length,
|
|
2497
2498
|
updateValue: (i) => {
|
|
2498
|
-
|
|
2499
|
+
n.length = i, t && t(n);
|
|
2499
2500
|
},
|
|
2500
2501
|
decimalPlaces: 8,
|
|
2501
2502
|
isValid: (i) => he(i),
|
|
2502
|
-
disabled:
|
|
2503
|
+
disabled: o
|
|
2503
2504
|
},
|
|
2504
|
-
`XLength${
|
|
2505
|
+
`XLength${n.length}`
|
|
2505
2506
|
)
|
|
2506
2507
|
] }, "axis x") : /* @__PURE__ */ S(ye, { children: [
|
|
2507
2508
|
/* @__PURE__ */ l(
|
|
2508
|
-
|
|
2509
|
+
dt,
|
|
2509
2510
|
{
|
|
2510
|
-
selection:
|
|
2511
|
+
selection: n,
|
|
2511
2512
|
updateSelection: t,
|
|
2512
|
-
disabled:
|
|
2513
|
+
disabled: o
|
|
2513
2514
|
},
|
|
2514
|
-
`YInput${
|
|
2515
|
+
`YInput${n.vStart.y}`
|
|
2515
2516
|
),
|
|
2516
2517
|
/* @__PURE__ */ l(
|
|
2517
|
-
|
|
2518
|
+
U,
|
|
2518
2519
|
{
|
|
2519
2520
|
label: "y length",
|
|
2520
|
-
input:
|
|
2521
|
+
input: n.length,
|
|
2521
2522
|
updateValue: (i) => {
|
|
2522
|
-
|
|
2523
|
+
n.length = i, t && t(n);
|
|
2523
2524
|
},
|
|
2524
2525
|
decimalPlaces: 8,
|
|
2525
2526
|
isValid: (i) => he(i),
|
|
2526
|
-
disabled:
|
|
2527
|
+
disabled: o
|
|
2527
2528
|
},
|
|
2528
|
-
`YLength${
|
|
2529
|
+
`YLength${n.length}`
|
|
2529
2530
|
)
|
|
2530
2531
|
] }, "axis y");
|
|
2531
2532
|
}
|
|
2532
|
-
function
|
|
2533
|
-
const { selection:
|
|
2533
|
+
function Ti(e) {
|
|
2534
|
+
const { selection: n, updateSelection: t, disabled: o } = e;
|
|
2534
2535
|
return /* @__PURE__ */ S(ye, { children: [
|
|
2535
2536
|
/* @__PURE__ */ l(
|
|
2536
|
-
|
|
2537
|
+
ut,
|
|
2537
2538
|
{
|
|
2538
|
-
selection:
|
|
2539
|
+
selection: n,
|
|
2539
2540
|
updateSelection: t,
|
|
2540
|
-
disabled:
|
|
2541
|
+
disabled: o
|
|
2541
2542
|
},
|
|
2542
|
-
`XInput${
|
|
2543
|
+
`XInput${n.vStart.x}`
|
|
2543
2544
|
),
|
|
2544
2545
|
/* @__PURE__ */ l(
|
|
2545
|
-
|
|
2546
|
+
dt,
|
|
2546
2547
|
{
|
|
2547
|
-
selection:
|
|
2548
|
+
selection: n,
|
|
2548
2549
|
updateSelection: t,
|
|
2549
|
-
disabled:
|
|
2550
|
+
disabled: o
|
|
2550
2551
|
},
|
|
2551
|
-
`YInput${
|
|
2552
|
+
`YInput${n.vStart.y}`
|
|
2552
2553
|
),
|
|
2553
2554
|
/* @__PURE__ */ l(
|
|
2554
|
-
|
|
2555
|
+
qt,
|
|
2555
2556
|
{
|
|
2556
|
-
selection:
|
|
2557
|
+
selection: n,
|
|
2557
2558
|
updateSelection: t,
|
|
2558
|
-
disabled:
|
|
2559
|
+
disabled: o
|
|
2559
2560
|
},
|
|
2560
|
-
`Angle${
|
|
2561
|
+
`Angle${n.angle}`
|
|
2561
2562
|
),
|
|
2562
2563
|
/* @__PURE__ */ l(
|
|
2563
|
-
|
|
2564
|
+
U,
|
|
2564
2565
|
{
|
|
2565
2566
|
label: "length",
|
|
2566
|
-
input:
|
|
2567
|
+
input: n.length,
|
|
2567
2568
|
updateValue: (i) => {
|
|
2568
|
-
|
|
2569
|
+
n.length = i, t && t(n);
|
|
2569
2570
|
},
|
|
2570
2571
|
decimalPlaces: 8,
|
|
2571
2572
|
isValid: (i) => he(i),
|
|
2572
|
-
disabled:
|
|
2573
|
+
disabled: o
|
|
2573
2574
|
},
|
|
2574
|
-
`Length${
|
|
2575
|
+
`Length${n.length}`
|
|
2575
2576
|
)
|
|
2576
2577
|
] }, "line");
|
|
2577
2578
|
}
|
|
2578
|
-
function
|
|
2579
|
-
const { selection:
|
|
2579
|
+
function Li(e) {
|
|
2580
|
+
const { selection: n, updateSelection: t, disabled: o } = e;
|
|
2580
2581
|
return /* @__PURE__ */ S(ye, { children: [
|
|
2581
2582
|
/* @__PURE__ */ l(
|
|
2582
|
-
|
|
2583
|
+
ut,
|
|
2583
2584
|
{
|
|
2584
|
-
selection:
|
|
2585
|
+
selection: n,
|
|
2585
2586
|
updateSelection: t,
|
|
2586
|
-
disabled:
|
|
2587
|
+
disabled: o
|
|
2587
2588
|
},
|
|
2588
|
-
`XInput${
|
|
2589
|
+
`XInput${n.vStart.x}`
|
|
2589
2590
|
),
|
|
2590
2591
|
/* @__PURE__ */ l(
|
|
2591
|
-
|
|
2592
|
+
dt,
|
|
2592
2593
|
{
|
|
2593
|
-
selection:
|
|
2594
|
+
selection: n,
|
|
2594
2595
|
updateSelection: t,
|
|
2595
|
-
disabled:
|
|
2596
|
+
disabled: o
|
|
2596
2597
|
},
|
|
2597
|
-
`YInput${
|
|
2598
|
+
`YInput${n.vStart.y}`
|
|
2598
2599
|
),
|
|
2599
2600
|
/* @__PURE__ */ l(
|
|
2600
|
-
|
|
2601
|
+
qt,
|
|
2601
2602
|
{
|
|
2602
|
-
selection:
|
|
2603
|
+
selection: n,
|
|
2603
2604
|
updateSelection: t,
|
|
2604
|
-
disabled:
|
|
2605
|
+
disabled: o
|
|
2605
2606
|
},
|
|
2606
|
-
`Angle${
|
|
2607
|
+
`Angle${n.angle}`
|
|
2607
2608
|
),
|
|
2608
2609
|
/* @__PURE__ */ l(
|
|
2609
|
-
|
|
2610
|
+
U,
|
|
2610
2611
|
{
|
|
2611
2612
|
label: "x length",
|
|
2612
|
-
input:
|
|
2613
|
+
input: n.lengths[0],
|
|
2613
2614
|
updateValue: (i) => {
|
|
2614
|
-
|
|
2615
|
+
n.lengths[0] = i, t && t(n);
|
|
2615
2616
|
},
|
|
2616
2617
|
decimalPlaces: 8,
|
|
2617
2618
|
isValid: (i) => he(i),
|
|
2618
|
-
disabled:
|
|
2619
|
+
disabled: o
|
|
2619
2620
|
},
|
|
2620
|
-
`XLength${
|
|
2621
|
+
`XLength${n.lengths[0]}`
|
|
2621
2622
|
),
|
|
2622
2623
|
/* @__PURE__ */ l(
|
|
2623
|
-
|
|
2624
|
+
U,
|
|
2624
2625
|
{
|
|
2625
2626
|
label: "y length",
|
|
2626
|
-
input:
|
|
2627
|
+
input: n.lengths[1],
|
|
2627
2628
|
updateValue: (i) => {
|
|
2628
|
-
|
|
2629
|
+
n.lengths[1] = i, t && t(n);
|
|
2629
2630
|
},
|
|
2630
2631
|
decimalPlaces: 8,
|
|
2631
2632
|
isValid: (i) => he(i),
|
|
2632
|
-
disabled:
|
|
2633
|
+
disabled: o
|
|
2633
2634
|
},
|
|
2634
|
-
`YLength${
|
|
2635
|
+
`YLength${n.lengths[1]}`
|
|
2635
2636
|
)
|
|
2636
2637
|
] }, "rectangle");
|
|
2637
2638
|
}
|
|
2638
|
-
const
|
|
2639
|
-
scrollContainer:
|
|
2639
|
+
const ki = "_scrollContainer_a4950_1", Ai = {
|
|
2640
|
+
scrollContainer: ki
|
|
2640
2641
|
};
|
|
2641
|
-
function
|
|
2642
|
-
const { selection:
|
|
2642
|
+
function Vi(e) {
|
|
2643
|
+
const { selection: n, updateSelection: t, disabled: o } = e;
|
|
2643
2644
|
function i(s, u) {
|
|
2644
|
-
|
|
2645
|
+
n.points[u] = s, t && t(n);
|
|
2645
2646
|
}
|
|
2646
|
-
const a =
|
|
2647
|
+
const a = n.points.map((s, u) => [
|
|
2647
2648
|
/* @__PURE__ */ l(
|
|
2648
|
-
|
|
2649
|
+
Di,
|
|
2649
2650
|
{
|
|
2650
2651
|
i: u,
|
|
2651
2652
|
point: s,
|
|
2652
2653
|
updatePoint: (r) => i(r, u),
|
|
2653
|
-
disabled:
|
|
2654
|
+
disabled: o
|
|
2654
2655
|
},
|
|
2655
2656
|
`px${u}${s[0]}`
|
|
2656
2657
|
),
|
|
2657
2658
|
/* @__PURE__ */ l(
|
|
2658
|
-
|
|
2659
|
+
Mi,
|
|
2659
2660
|
{
|
|
2660
2661
|
i: u,
|
|
2661
2662
|
point: s,
|
|
2662
2663
|
updatePoint: (r) => i(r, u),
|
|
2663
|
-
disabled:
|
|
2664
|
+
disabled: o
|
|
2664
2665
|
},
|
|
2665
2666
|
`py${u}${s[1]}`
|
|
2666
2667
|
)
|
|
2667
2668
|
]);
|
|
2668
|
-
return /* @__PURE__ */ l("div", { className:
|
|
2669
|
+
return /* @__PURE__ */ l("div", { className: Ai.scrollContainer, children: a.flat() }, "polygon");
|
|
2669
2670
|
}
|
|
2670
|
-
const
|
|
2671
|
+
const it = {
|
|
2671
2672
|
line: "—",
|
|
2672
2673
|
rectangle: "▭",
|
|
2673
2674
|
polyline: "⦚",
|
|
@@ -2679,46 +2680,46 @@ const ot = {
|
|
|
2679
2680
|
verticalAxis: "↕",
|
|
2680
2681
|
unknown: " "
|
|
2681
2682
|
};
|
|
2682
|
-
function
|
|
2683
|
+
function Ii(e) {
|
|
2683
2684
|
const {
|
|
2684
|
-
currentSelectionID:
|
|
2685
|
+
currentSelectionID: n,
|
|
2685
2686
|
updateCurrentSelectionID: t,
|
|
2686
|
-
selections:
|
|
2687
|
+
selections: o,
|
|
2687
2688
|
updateSelection: i,
|
|
2688
2689
|
hasBaton: a
|
|
2689
|
-
} = e, [s, u] =
|
|
2690
|
-
|
|
2691
|
-
if (
|
|
2692
|
-
const m =
|
|
2690
|
+
} = e, [s, u] = D(null);
|
|
2691
|
+
z(() => {
|
|
2692
|
+
if (o.length > 0) {
|
|
2693
|
+
const m = o.find((d) => d.id === n) ?? o[0];
|
|
2693
2694
|
u(m);
|
|
2694
2695
|
}
|
|
2695
|
-
}, [
|
|
2696
|
-
const r =
|
|
2697
|
-
if (
|
|
2698
|
-
const m =
|
|
2696
|
+
}, [n, o]);
|
|
2697
|
+
const r = te(() => {
|
|
2698
|
+
if (n) {
|
|
2699
|
+
const m = o.find((d) => d.id === n);
|
|
2699
2700
|
if (m) {
|
|
2700
2701
|
let d;
|
|
2701
|
-
if (Object.hasOwn(
|
|
2702
|
-
d =
|
|
2703
|
-
(h) => h.id !==
|
|
2702
|
+
if (Object.hasOwn(o, "findLast"))
|
|
2703
|
+
d = o.findLast(
|
|
2704
|
+
(h) => h.id !== n
|
|
2704
2705
|
);
|
|
2705
2706
|
else {
|
|
2706
|
-
const h =
|
|
2707
|
-
(p) => p.id !==
|
|
2707
|
+
const h = o.filter(
|
|
2708
|
+
(p) => p.id !== n
|
|
2708
2709
|
), g = h.length - 1;
|
|
2709
2710
|
g >= 0 && (d = h[g]);
|
|
2710
2711
|
}
|
|
2711
|
-
i && i(m, !
|
|
2712
|
+
i && i(m, !1, !0), d && t(d.id);
|
|
2712
2713
|
}
|
|
2713
2714
|
}
|
|
2714
2715
|
}, [
|
|
2715
|
-
o,
|
|
2716
2716
|
n,
|
|
2717
|
+
o,
|
|
2717
2718
|
t,
|
|
2718
2719
|
i
|
|
2719
2720
|
]), c = [];
|
|
2720
2721
|
if (c.push(
|
|
2721
|
-
/* @__PURE__ */ l("h4", { children:
|
|
2722
|
+
/* @__PURE__ */ l("h4", { children: zt(s, it) }, `ID${n}`)
|
|
2722
2723
|
), s !== null) {
|
|
2723
2724
|
const m = s;
|
|
2724
2725
|
c.push(
|
|
@@ -2726,7 +2727,7 @@ function Vi(e) {
|
|
|
2726
2727
|
/* @__PURE__ */ l(
|
|
2727
2728
|
"div",
|
|
2728
2729
|
{
|
|
2729
|
-
className:
|
|
2730
|
+
className: Ut.colourLabel,
|
|
2730
2731
|
style: { borderLeftColor: s.colour },
|
|
2731
2732
|
children: s.colour
|
|
2732
2733
|
},
|
|
@@ -2734,7 +2735,7 @@ function Vi(e) {
|
|
|
2734
2735
|
),
|
|
2735
2736
|
/* @__PURE__ */ l("br", {}, "colour spacer"),
|
|
2736
2737
|
a && /* @__PURE__ */ l(
|
|
2737
|
-
|
|
2738
|
+
Tt,
|
|
2738
2739
|
{
|
|
2739
2740
|
color: s.colour,
|
|
2740
2741
|
onChange: (h) => {
|
|
@@ -2748,7 +2749,7 @@ function Vi(e) {
|
|
|
2748
2749
|
const d = !a;
|
|
2749
2750
|
c.push(
|
|
2750
2751
|
/* @__PURE__ */ l(
|
|
2751
|
-
|
|
2752
|
+
U,
|
|
2752
2753
|
{
|
|
2753
2754
|
label: "name",
|
|
2754
2755
|
input: s.name,
|
|
@@ -2761,7 +2762,7 @@ function Vi(e) {
|
|
|
2761
2762
|
)
|
|
2762
2763
|
), c.push(
|
|
2763
2764
|
/* @__PURE__ */ l(
|
|
2764
|
-
|
|
2765
|
+
U,
|
|
2765
2766
|
{
|
|
2766
2767
|
label: "alpha",
|
|
2767
2768
|
input: s.alpha,
|
|
@@ -2769,31 +2770,31 @@ function Vi(e) {
|
|
|
2769
2770
|
h <= 1 && h >= 0 && (m.alpha = h, i && i(m));
|
|
2770
2771
|
},
|
|
2771
2772
|
decimalPlaces: 2,
|
|
2772
|
-
isValid: (h) =>
|
|
2773
|
+
isValid: (h) => Vt(h, 1, !0),
|
|
2773
2774
|
disabled: d
|
|
2774
2775
|
},
|
|
2775
2776
|
`Alpha${s.alpha}`
|
|
2776
2777
|
)
|
|
2777
2778
|
), ce.isShape(m) ? c.push(
|
|
2778
|
-
|
|
2779
|
+
_i({
|
|
2779
2780
|
selection: m,
|
|
2780
2781
|
updateSelection: i,
|
|
2781
2782
|
disabled: d
|
|
2782
2783
|
})
|
|
2783
2784
|
) : ue.isShape(m) ? c.push(
|
|
2784
|
-
|
|
2785
|
+
Ti({
|
|
2785
2786
|
selection: m,
|
|
2786
2787
|
updateSelection: i,
|
|
2787
2788
|
disabled: d
|
|
2788
2789
|
})
|
|
2789
2790
|
) : de.isShape(m) ? c.push(
|
|
2790
|
-
|
|
2791
|
+
Li({
|
|
2791
2792
|
selection: m,
|
|
2792
2793
|
updateSelection: i,
|
|
2793
2794
|
disabled: d
|
|
2794
2795
|
})
|
|
2795
2796
|
) : ie.isShape(m) && c.push(
|
|
2796
|
-
|
|
2797
|
+
Vi({
|
|
2797
2798
|
selection: m,
|
|
2798
2799
|
updateSelection: i,
|
|
2799
2800
|
disabled: d
|
|
@@ -2812,20 +2813,20 @@ function Vi(e) {
|
|
|
2812
2813
|
)
|
|
2813
2814
|
);
|
|
2814
2815
|
}
|
|
2815
|
-
return
|
|
2816
|
+
return Kt({
|
|
2816
2817
|
title: "Selections",
|
|
2817
2818
|
showModeless: e.showSelectionConfig,
|
|
2818
2819
|
setShowModeless: e.updateShowSelectionConfig,
|
|
2819
2820
|
children: c
|
|
2820
2821
|
});
|
|
2821
2822
|
}
|
|
2822
|
-
function
|
|
2823
|
+
function $i(e) {
|
|
2823
2824
|
const {
|
|
2824
|
-
selectionID:
|
|
2825
|
+
selectionID: n,
|
|
2825
2826
|
onSelectionIDChange: t,
|
|
2826
|
-
options:
|
|
2827
|
+
options: o = e.selections.map((r) => r.id)
|
|
2827
2828
|
} = e;
|
|
2828
|
-
|
|
2829
|
+
n === "" && e.selections.length > 0 && (console.log(
|
|
2829
2830
|
"Setting selectionID to default selection: ",
|
|
2830
2831
|
e.selections[0]
|
|
2831
2832
|
), t(e.selections[0].id));
|
|
@@ -2840,25 +2841,25 @@ function Ii(e) {
|
|
|
2840
2841
|
// eslint-disable-next-line react/prop-types
|
|
2841
2842
|
backgroundColor: c.data.bgcolour
|
|
2842
2843
|
})
|
|
2843
|
-
}, u =
|
|
2844
|
+
}, u = o.map(
|
|
2844
2845
|
(r) => ({
|
|
2845
2846
|
value: r,
|
|
2846
|
-
label: Ct(e.selections, r,
|
|
2847
|
+
label: Ct(e.selections, r, it),
|
|
2847
2848
|
bgcolour: a(r)
|
|
2848
2849
|
})
|
|
2849
2850
|
);
|
|
2850
2851
|
return /* @__PURE__ */ l(
|
|
2851
|
-
|
|
2852
|
+
Lt,
|
|
2852
2853
|
{
|
|
2853
2854
|
styles: s,
|
|
2854
2855
|
value: {
|
|
2855
|
-
value:
|
|
2856
|
+
value: n,
|
|
2856
2857
|
label: Ct(
|
|
2857
2858
|
e.selections,
|
|
2858
|
-
|
|
2859
|
-
|
|
2859
|
+
n,
|
|
2860
|
+
it
|
|
2860
2861
|
),
|
|
2861
|
-
bgcolour: a(
|
|
2862
|
+
bgcolour: a(n ?? "")
|
|
2862
2863
|
},
|
|
2863
2864
|
options: u,
|
|
2864
2865
|
onChange: (r) => {
|
|
@@ -2870,9 +2871,9 @@ function Ii(e) {
|
|
|
2870
2871
|
function Ni(e) {
|
|
2871
2872
|
return We({
|
|
2872
2873
|
title: "Set title",
|
|
2873
|
-
icon:
|
|
2874
|
+
icon: On,
|
|
2874
2875
|
children: /* @__PURE__ */ l(
|
|
2875
|
-
|
|
2876
|
+
U,
|
|
2876
2877
|
{
|
|
2877
2878
|
label: "title-label",
|
|
2878
2879
|
input: e.label ?? "",
|
|
@@ -2882,35 +2883,35 @@ function Ni(e) {
|
|
|
2882
2883
|
)
|
|
2883
2884
|
});
|
|
2884
2885
|
}
|
|
2885
|
-
function
|
|
2886
|
-
const { children:
|
|
2886
|
+
function Fi(e) {
|
|
2887
|
+
const { children: n } = e, t = Le(), { plotType: o, updateSelection: i } = t, { selections: a, canSelect: s, setCurrentLineKey: u } = t, [r, c] = D(
|
|
2887
2888
|
null
|
|
2888
2889
|
), m = F(() => s && a.length > 0 ? a[a.length - 1].id : null, [s, a]);
|
|
2889
|
-
|
|
2890
|
+
z(() => {
|
|
2890
2891
|
m && r === null && (console.log("Setting first selection", m), c(m));
|
|
2891
2892
|
}, [m, r]);
|
|
2892
|
-
const [d, h] =
|
|
2893
|
-
|
|
2893
|
+
const [d, h] = D(!1), [g, p] = D(!1), b = t.batonProps.hasBaton, v = s && b;
|
|
2894
|
+
z(() => {
|
|
2894
2895
|
if (s) {
|
|
2895
|
-
if (a.map((B) =>
|
|
2896
|
+
if (a.map((B) => Fo(B)), r === null) {
|
|
2896
2897
|
if (a.length > 0) {
|
|
2897
2898
|
const B = a[a.length - 1];
|
|
2898
|
-
console.log("Setting current selection", B.id), c(B.id), d &&
|
|
2899
|
+
console.log("Setting current selection", B.id), c(B.id), d && xt(B);
|
|
2899
2900
|
}
|
|
2900
2901
|
} else if (d) {
|
|
2901
|
-
const B = a.find((
|
|
2902
|
-
B &&
|
|
2902
|
+
const B = a.find((Q) => Q.id === r);
|
|
2903
|
+
B && xt(B);
|
|
2903
2904
|
}
|
|
2904
2905
|
}
|
|
2905
2906
|
}, [s, r, a, d]);
|
|
2906
|
-
const T =
|
|
2907
|
+
const T = o === "Line", V = o === "Heatmap", k = V || o === "Image", P = o === "Surface", L = o === "Scatter", E = L || V || P, O = [
|
|
2907
2908
|
tt({
|
|
2908
2909
|
title: "X axis",
|
|
2909
|
-
icon:
|
|
2910
|
+
icon: Xn,
|
|
2910
2911
|
label: t.xLabel,
|
|
2911
2912
|
setLabel: t.setXLabel,
|
|
2912
2913
|
scaleType: t.xScaleType,
|
|
2913
|
-
scaleOptions:
|
|
2914
|
+
scaleOptions: mt,
|
|
2914
2915
|
setScaleType: t.setXScaleType,
|
|
2915
2916
|
domain: t.xDomain,
|
|
2916
2917
|
customDomain: t.xCustomDomain,
|
|
@@ -2918,17 +2919,17 @@ function $i(e) {
|
|
|
2918
2919
|
}),
|
|
2919
2920
|
tt({
|
|
2920
2921
|
title: "Y axis",
|
|
2921
|
-
icon:
|
|
2922
|
+
icon: Zn,
|
|
2922
2923
|
label: t.yLabel,
|
|
2923
2924
|
setLabel: t.setYLabel,
|
|
2924
2925
|
scaleType: t.yScaleType,
|
|
2925
|
-
scaleOptions:
|
|
2926
|
+
scaleOptions: mt,
|
|
2926
2927
|
setScaleType: t.setYScaleType,
|
|
2927
2928
|
domain: t.yDomain,
|
|
2928
2929
|
customDomain: t.yCustomDomain,
|
|
2929
2930
|
setCustomDomain: t.setYCustomDomain
|
|
2930
2931
|
}),
|
|
2931
|
-
|
|
2932
|
+
Xo({
|
|
2932
2933
|
aspect: t.aspect,
|
|
2933
2934
|
setAspect: t.setAspect,
|
|
2934
2935
|
hideToggle: !k
|
|
@@ -2937,30 +2938,30 @@ function $i(e) {
|
|
|
2937
2938
|
label: t.title,
|
|
2938
2939
|
setLabel: t.setTitle
|
|
2939
2940
|
})
|
|
2940
|
-
],
|
|
2941
|
+
], Y = Ii({
|
|
2941
2942
|
selections: a,
|
|
2942
2943
|
updateSelection: i,
|
|
2943
2944
|
currentSelectionID: r,
|
|
2944
2945
|
updateCurrentSelectionID: c,
|
|
2945
|
-
icon:
|
|
2946
|
+
icon: Hn,
|
|
2946
2947
|
domain: t.dDomain,
|
|
2947
2948
|
customDomain: t.dCustomDomain,
|
|
2948
2949
|
showSelectionConfig: d,
|
|
2949
2950
|
updateShowSelectionConfig: h,
|
|
2950
|
-
hasBaton:
|
|
2951
|
+
hasBaton: v
|
|
2951
2952
|
}), x = [];
|
|
2952
2953
|
s && t.selectionType !== void 0 && x.push(
|
|
2953
2954
|
/* @__PURE__ */ l(
|
|
2954
|
-
|
|
2955
|
+
wi,
|
|
2955
2956
|
{
|
|
2956
2957
|
value: t.selectionType,
|
|
2957
2958
|
onSelectionTypeChange: t.setSelectionType,
|
|
2958
|
-
disabled: t.mode !==
|
|
2959
|
+
disabled: t.mode !== J.selectRegion
|
|
2959
2960
|
},
|
|
2960
2961
|
"Selection type"
|
|
2961
2962
|
)
|
|
2962
2963
|
);
|
|
2963
|
-
const _ = t.allLineParams, K =
|
|
2964
|
+
const _ = t.allLineParams, K = bi({
|
|
2964
2965
|
allLineParams: _,
|
|
2965
2966
|
updateLineParams: t.updateLineParams,
|
|
2966
2967
|
currentLineKey: t.currentLineKey,
|
|
@@ -2973,20 +2974,20 @@ function $i(e) {
|
|
|
2973
2974
|
Re,
|
|
2974
2975
|
{
|
|
2975
2976
|
label: "show points",
|
|
2976
|
-
icon:
|
|
2977
|
+
icon: Qn,
|
|
2977
2978
|
iconOnly: !0,
|
|
2978
2979
|
value: t.showPoints,
|
|
2979
2980
|
onToggle: t.toggleShowPoints,
|
|
2980
|
-
hidden: !
|
|
2981
|
+
hidden: !P
|
|
2981
2982
|
},
|
|
2982
2983
|
"show points"
|
|
2983
2984
|
)
|
|
2984
|
-
),
|
|
2985
|
+
), P && x.push(/* @__PURE__ */ l(Te, {}, "Show point separator")), x.push(
|
|
2985
2986
|
tt({
|
|
2986
2987
|
title: "Colour mapping",
|
|
2987
2988
|
scaleType: t.dScaleType,
|
|
2988
2989
|
setScaleType: t.setDScaleType,
|
|
2989
|
-
scaleOptions:
|
|
2990
|
+
scaleOptions: bn,
|
|
2990
2991
|
colourMap: t.colourMap,
|
|
2991
2992
|
setColourMap: t.setColourMap,
|
|
2992
2993
|
invertColourMap: t.invertColourMap,
|
|
@@ -2998,21 +2999,21 @@ function $i(e) {
|
|
|
2998
2999
|
scatterPointSize: L ? t.scatterPointSize : void 0,
|
|
2999
3000
|
setScatterPointSize: t.setScatterPointSize,
|
|
3000
3001
|
hasBaton: b,
|
|
3001
|
-
hideToggle: !
|
|
3002
|
+
hideToggle: !E
|
|
3002
3003
|
})
|
|
3003
|
-
),
|
|
3004
|
+
), E && x.push(/* @__PURE__ */ l(Te, {}, "Colour mapping separator")), O.push(
|
|
3004
3005
|
/* @__PURE__ */ l(
|
|
3005
3006
|
Re,
|
|
3006
3007
|
{
|
|
3007
3008
|
label: "Grid toggle",
|
|
3008
|
-
icon:
|
|
3009
|
+
icon: Kn,
|
|
3009
3010
|
value: t.showGrid,
|
|
3010
3011
|
onToggle: t.toggleShowGrid
|
|
3011
3012
|
},
|
|
3012
3013
|
"Grid toggle"
|
|
3013
3014
|
)
|
|
3014
|
-
), O.push(
|
|
3015
|
-
const
|
|
3015
|
+
), O.push(ii({ ...t.batonProps }));
|
|
3016
|
+
const G = te(
|
|
3016
3017
|
(B) => {
|
|
3017
3018
|
_.has(B) && u(B), p(!0);
|
|
3018
3019
|
},
|
|
@@ -3020,67 +3021,67 @@ function $i(e) {
|
|
|
3020
3021
|
);
|
|
3021
3022
|
_.size && (console.log("Add line key dropdown", [..._.keys()]), O.push(
|
|
3022
3023
|
/* @__PURE__ */ l(
|
|
3023
|
-
|
|
3024
|
+
Si,
|
|
3024
3025
|
{
|
|
3025
3026
|
allLineParams: _,
|
|
3026
3027
|
lineKey: t.currentLineKey,
|
|
3027
|
-
onLineKeyChange:
|
|
3028
|
+
onLineKeyChange: G
|
|
3028
3029
|
},
|
|
3029
3030
|
"key dropdown"
|
|
3030
3031
|
)
|
|
3031
3032
|
));
|
|
3032
|
-
const
|
|
3033
|
+
const Z = te(
|
|
3033
3034
|
(B) => {
|
|
3034
3035
|
if (s) {
|
|
3035
|
-
const
|
|
3036
|
-
|
|
3036
|
+
const Q = a.find((ae) => ae.id === B);
|
|
3037
|
+
Q !== void 0 && (c(B), s && i(Q)), h(!0);
|
|
3037
3038
|
}
|
|
3038
3039
|
},
|
|
3039
3040
|
[s, a, i]
|
|
3040
3041
|
);
|
|
3041
3042
|
return s && a.length > 0 && (O.push(
|
|
3042
3043
|
/* @__PURE__ */ l(
|
|
3043
|
-
|
|
3044
|
+
$i,
|
|
3044
3045
|
{
|
|
3045
3046
|
selections: a,
|
|
3046
3047
|
selectionID: r,
|
|
3047
|
-
onSelectionIDChange:
|
|
3048
|
+
onSelectionIDChange: Z
|
|
3048
3049
|
},
|
|
3049
3050
|
"ID dropdown"
|
|
3050
3051
|
)
|
|
3051
3052
|
), O.push(
|
|
3052
3053
|
/* @__PURE__ */ l(
|
|
3053
|
-
|
|
3054
|
+
ai,
|
|
3054
3055
|
{
|
|
3055
3056
|
updateSelection: i,
|
|
3056
3057
|
updateCurrentSelectionID: c,
|
|
3057
|
-
disabled: !
|
|
3058
|
+
disabled: !v
|
|
3058
3059
|
},
|
|
3059
3060
|
"Clear all selections"
|
|
3060
3061
|
)
|
|
3061
|
-
)), /* @__PURE__ */ S(
|
|
3062
|
+
)), /* @__PURE__ */ S(st, { overflowChildren: O, children: [
|
|
3062
3063
|
/* @__PURE__ */ l(
|
|
3063
|
-
|
|
3064
|
+
si,
|
|
3064
3065
|
{
|
|
3065
3066
|
value: t.mode,
|
|
3066
3067
|
onModeChange: t.setMode,
|
|
3067
|
-
hasBaton:
|
|
3068
|
+
hasBaton: v
|
|
3068
3069
|
},
|
|
3069
3070
|
"Interaction toggle"
|
|
3070
3071
|
),
|
|
3071
|
-
s && /* @__PURE__ */ l(
|
|
3072
|
+
s && /* @__PURE__ */ l(Te, {}, "Interaction separator"),
|
|
3072
3073
|
x,
|
|
3073
|
-
s && /* @__PURE__ */ l(ye, { children:
|
|
3074
|
+
s && /* @__PURE__ */ l(ye, { children: Y }, "Selection config"),
|
|
3074
3075
|
T && /* @__PURE__ */ l(ye, { children: K }, "Line config"),
|
|
3075
|
-
|
|
3076
|
+
n
|
|
3076
3077
|
] });
|
|
3077
3078
|
}
|
|
3078
|
-
function
|
|
3079
|
-
return e.children !== null && (e.children === void 0 ? /* @__PURE__ */ l(
|
|
3079
|
+
function Ae(e) {
|
|
3080
|
+
return e.children !== null && (e.children === void 0 ? /* @__PURE__ */ l(Fi, { children: e.extraChildren }) : /* @__PURE__ */ l(st, { children: e.children }));
|
|
3080
3081
|
}
|
|
3081
|
-
function
|
|
3082
|
+
function Gt({ xValues: e, yValues: n, values: t }) {
|
|
3082
3083
|
const {
|
|
3083
|
-
title:
|
|
3084
|
+
title: o,
|
|
3084
3085
|
showGrid: i,
|
|
3085
3086
|
xLabel: a,
|
|
3086
3087
|
yLabel: s,
|
|
@@ -3093,46 +3094,46 @@ function qt({ xValues: e, yValues: o, values: t }) {
|
|
|
3093
3094
|
selections: g,
|
|
3094
3095
|
dDomain: p,
|
|
3095
3096
|
dCustomDomain: b,
|
|
3096
|
-
colourMap:
|
|
3097
|
+
colourMap: v,
|
|
3097
3098
|
invertColourMap: T,
|
|
3098
3099
|
dScaleType: V,
|
|
3099
3100
|
setHistogram: k
|
|
3100
|
-
} =
|
|
3101
|
-
() =>
|
|
3101
|
+
} = Le(), P = qe(u), L = F(
|
|
3102
|
+
() => rt(t.data, p),
|
|
3102
3103
|
[p, t]
|
|
3103
3104
|
);
|
|
3104
|
-
return
|
|
3105
|
+
return z(() => {
|
|
3105
3106
|
L && k({
|
|
3106
3107
|
...L,
|
|
3107
|
-
colorMap:
|
|
3108
|
+
colorMap: v,
|
|
3108
3109
|
invertColorMap: T
|
|
3109
3110
|
});
|
|
3110
|
-
}, [
|
|
3111
|
-
|
|
3111
|
+
}, [v, T, L, k]), /* @__PURE__ */ l(
|
|
3112
|
+
Sn,
|
|
3112
3113
|
{
|
|
3113
3114
|
dataArray: t,
|
|
3114
3115
|
domain: Oe(b, p),
|
|
3115
|
-
colorMap:
|
|
3116
|
+
colorMap: v,
|
|
3116
3117
|
invertColorMap: T,
|
|
3117
3118
|
scaleType: V,
|
|
3118
3119
|
aspect: r,
|
|
3119
3120
|
showGrid: i,
|
|
3120
|
-
title:
|
|
3121
|
+
title: o,
|
|
3121
3122
|
abscissaParams: {
|
|
3122
3123
|
label: a,
|
|
3123
3124
|
value: e == null ? void 0 : e.data
|
|
3124
3125
|
},
|
|
3125
3126
|
ordinateParams: {
|
|
3126
3127
|
label: s,
|
|
3127
|
-
value:
|
|
3128
|
+
value: n == null ? void 0 : n.data
|
|
3128
3129
|
},
|
|
3129
|
-
interactions:
|
|
3130
|
+
interactions: P,
|
|
3130
3131
|
flipYAxis: !0,
|
|
3131
3132
|
children: m && /* @__PURE__ */ l(
|
|
3132
3133
|
Ge,
|
|
3133
3134
|
{
|
|
3134
3135
|
modifierKey: [],
|
|
3135
|
-
disabled: u !==
|
|
3136
|
+
disabled: u !== J.selectRegion,
|
|
3136
3137
|
selectionType: d,
|
|
3137
3138
|
batonProps: c,
|
|
3138
3139
|
updateSelection: h,
|
|
@@ -3142,7 +3143,7 @@ function qt({ xValues: e, yValues: o, values: t }) {
|
|
|
3142
3143
|
}
|
|
3143
3144
|
);
|
|
3144
3145
|
}
|
|
3145
|
-
function
|
|
3146
|
+
function xa(e) {
|
|
3146
3147
|
return /* @__PURE__ */ l(
|
|
3147
3148
|
"div",
|
|
3148
3149
|
{
|
|
@@ -3150,10 +3151,10 @@ function va(e) {
|
|
|
3150
3151
|
display: "grid",
|
|
3151
3152
|
position: "relative"
|
|
3152
3153
|
},
|
|
3153
|
-
children: /* @__PURE__ */ S(
|
|
3154
|
-
/* @__PURE__ */ l(
|
|
3154
|
+
children: /* @__PURE__ */ S(ke, { ...e, children: [
|
|
3155
|
+
/* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
|
|
3155
3156
|
/* @__PURE__ */ l(
|
|
3156
|
-
|
|
3157
|
+
Gt,
|
|
3157
3158
|
{
|
|
3158
3159
|
xValues: e.plotConfig.xValues,
|
|
3159
3160
|
yValues: e.plotConfig.yValues,
|
|
@@ -3164,9 +3165,9 @@ function va(e) {
|
|
|
3164
3165
|
}
|
|
3165
3166
|
);
|
|
3166
3167
|
}
|
|
3167
|
-
function
|
|
3168
|
+
function Wt({ xValues: e, yValues: n, values: t }) {
|
|
3168
3169
|
const {
|
|
3169
|
-
title:
|
|
3170
|
+
title: o,
|
|
3170
3171
|
showGrid: i,
|
|
3171
3172
|
xLabel: a,
|
|
3172
3173
|
yLabel: s,
|
|
@@ -3177,21 +3178,21 @@ function Gt({ xValues: e, yValues: o, values: t }) {
|
|
|
3177
3178
|
selectionType: d,
|
|
3178
3179
|
updateSelection: h,
|
|
3179
3180
|
selections: g
|
|
3180
|
-
} =
|
|
3181
|
+
} = Le(), p = qe(u);
|
|
3181
3182
|
return /* @__PURE__ */ l(
|
|
3182
|
-
|
|
3183
|
+
vn,
|
|
3183
3184
|
{
|
|
3184
3185
|
dataArray: t,
|
|
3185
3186
|
aspect: r,
|
|
3186
3187
|
showGrid: i,
|
|
3187
|
-
title:
|
|
3188
|
+
title: o,
|
|
3188
3189
|
abscissaParams: {
|
|
3189
3190
|
label: a,
|
|
3190
3191
|
value: e == null ? void 0 : e.data
|
|
3191
3192
|
},
|
|
3192
3193
|
ordinateParams: {
|
|
3193
3194
|
label: s,
|
|
3194
|
-
value:
|
|
3195
|
+
value: n == null ? void 0 : n.data
|
|
3195
3196
|
},
|
|
3196
3197
|
interactions: p,
|
|
3197
3198
|
flipYAxis: !0,
|
|
@@ -3199,7 +3200,7 @@ function Gt({ xValues: e, yValues: o, values: t }) {
|
|
|
3199
3200
|
Ge,
|
|
3200
3201
|
{
|
|
3201
3202
|
modifierKey: [],
|
|
3202
|
-
disabled: u !==
|
|
3203
|
+
disabled: u !== J.selectRegion,
|
|
3203
3204
|
selectionType: d,
|
|
3204
3205
|
batonProps: c,
|
|
3205
3206
|
updateSelection: h,
|
|
@@ -3209,7 +3210,7 @@ function Gt({ xValues: e, yValues: o, values: t }) {
|
|
|
3209
3210
|
}
|
|
3210
3211
|
);
|
|
3211
3212
|
}
|
|
3212
|
-
function
|
|
3213
|
+
function Pa(e) {
|
|
3213
3214
|
return /* @__PURE__ */ l(
|
|
3214
3215
|
"div",
|
|
3215
3216
|
{
|
|
@@ -3217,10 +3218,10 @@ function xa(e) {
|
|
|
3217
3218
|
display: "grid",
|
|
3218
3219
|
position: "relative"
|
|
3219
3220
|
},
|
|
3220
|
-
children: /* @__PURE__ */ S(
|
|
3221
|
-
/* @__PURE__ */ l(
|
|
3221
|
+
children: /* @__PURE__ */ S(ke, { ...e, children: [
|
|
3222
|
+
/* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
|
|
3222
3223
|
/* @__PURE__ */ l(
|
|
3223
|
-
|
|
3224
|
+
Wt,
|
|
3224
3225
|
{
|
|
3225
3226
|
xValues: e.plotConfig.xValues,
|
|
3226
3227
|
yValues: e.plotConfig.yValues,
|
|
@@ -3231,8 +3232,8 @@ function xa(e) {
|
|
|
3231
3232
|
}
|
|
3232
3233
|
);
|
|
3233
3234
|
}
|
|
3234
|
-
function
|
|
3235
|
-
const
|
|
3235
|
+
function Oi(e, n, t) {
|
|
3236
|
+
const o = [
|
|
3236
3237
|
"rgb(0, 0, 0)",
|
|
3237
3238
|
// #000000, black
|
|
3238
3239
|
"rgb(0, 158, 115)",
|
|
@@ -3251,27 +3252,27 @@ function Fi(e, o, t) {
|
|
|
3251
3252
|
// #cc79a7, pink
|
|
3252
3253
|
];
|
|
3253
3254
|
let i = !0, a = Qe.LineAndGlyphs;
|
|
3254
|
-
|
|
3255
|
-
const s =
|
|
3255
|
+
n.pointSize ? n.lineOn || (a = Qe.GlyphsOnly) : (n.pointSize = 0, n.lineOn ? a = Qe.LineOnly : i = !1);
|
|
3256
|
+
const s = n.colour ?? o[t % o.length];
|
|
3256
3257
|
return /* @__PURE__ */ l(
|
|
3257
|
-
|
|
3258
|
+
Dn,
|
|
3258
3259
|
{
|
|
3259
3260
|
abscissas: e.x.data,
|
|
3260
3261
|
ordinates: e.y.data,
|
|
3261
3262
|
color: s,
|
|
3262
3263
|
curveType: a,
|
|
3263
|
-
glyphType:
|
|
3264
|
-
glyphSize:
|
|
3264
|
+
glyphType: n.glyphType ?? Mn.Circle,
|
|
3265
|
+
glyphSize: n.pointSize,
|
|
3265
3266
|
visible: i
|
|
3266
3267
|
},
|
|
3267
3268
|
`data_curve_${t}`
|
|
3268
3269
|
);
|
|
3269
3270
|
}
|
|
3270
|
-
function
|
|
3271
|
+
function Yt(e) {
|
|
3271
3272
|
const {
|
|
3272
|
-
title:
|
|
3273
|
+
title: n,
|
|
3273
3274
|
showGrid: t,
|
|
3274
|
-
xCustomDomain:
|
|
3275
|
+
xCustomDomain: o,
|
|
3275
3276
|
xDomain: i,
|
|
3276
3277
|
xScaleType: a,
|
|
3277
3278
|
xLabel: s,
|
|
@@ -3284,34 +3285,34 @@ function Wt(e) {
|
|
|
3284
3285
|
currentLineKey: g,
|
|
3285
3286
|
setCurrentLineKey: p,
|
|
3286
3287
|
batonProps: b,
|
|
3287
|
-
canSelect:
|
|
3288
|
+
canSelect: v,
|
|
3288
3289
|
selectionType: T,
|
|
3289
3290
|
updateSelection: V,
|
|
3290
3291
|
selections: k
|
|
3291
|
-
} =
|
|
3292
|
+
} = Le(), P = e.lineData, L = F(() => {
|
|
3292
3293
|
const _ = /* @__PURE__ */ new Map();
|
|
3293
|
-
return
|
|
3294
|
+
return P.forEach((K) => {
|
|
3294
3295
|
_.set(K.key, K.lineParams);
|
|
3295
3296
|
}), _;
|
|
3296
|
-
}, [
|
|
3297
|
-
|
|
3297
|
+
}, [P]);
|
|
3298
|
+
z(() => {
|
|
3298
3299
|
if (g == null && L.size) {
|
|
3299
3300
|
const _ = L.keys().next().value;
|
|
3300
3301
|
p(_);
|
|
3301
3302
|
}
|
|
3302
3303
|
h(L);
|
|
3303
3304
|
}, [g, L, h, p]);
|
|
3304
|
-
const
|
|
3305
|
+
const E = qe(d), O = (_, K) => /* @__PURE__ */ S("p", { children: [
|
|
3305
3306
|
_.toPrecision(8),
|
|
3306
3307
|
", ",
|
|
3307
3308
|
K.toPrecision(8)
|
|
3308
|
-
] }),
|
|
3309
|
+
] }), Y = F(() => Oe(o, i), [o, i]), x = F(() => Oe(u, r), [u, r]);
|
|
3309
3310
|
return /* @__PURE__ */ S(
|
|
3310
3311
|
Cn,
|
|
3311
3312
|
{
|
|
3312
|
-
title:
|
|
3313
|
+
title: n ?? "",
|
|
3313
3314
|
abscissaConfig: {
|
|
3314
|
-
visDomain:
|
|
3315
|
+
visDomain: Y,
|
|
3315
3316
|
showGrid: t,
|
|
3316
3317
|
scaleType: a,
|
|
3317
3318
|
label: s,
|
|
@@ -3325,19 +3326,19 @@ function Wt(e) {
|
|
|
3325
3326
|
nice: !0
|
|
3326
3327
|
},
|
|
3327
3328
|
children: [
|
|
3328
|
-
/* @__PURE__ */ l(
|
|
3329
|
-
|
|
3330
|
-
const
|
|
3331
|
-
return
|
|
3329
|
+
/* @__PURE__ */ l(xn, { ...E }),
|
|
3330
|
+
P.map((_, K) => {
|
|
3331
|
+
const G = (L == null ? void 0 : L.get(_.key)) ?? _.lineParams;
|
|
3332
|
+
return Oi(_, G, K);
|
|
3332
3333
|
}),
|
|
3333
|
-
/* @__PURE__ */ l(
|
|
3334
|
-
/* @__PURE__ */ l(
|
|
3335
|
-
|
|
3334
|
+
/* @__PURE__ */ l(Pn, { renderTooltip: O }),
|
|
3335
|
+
/* @__PURE__ */ l(wn, {}),
|
|
3336
|
+
v && /* @__PURE__ */ l(
|
|
3336
3337
|
Ge,
|
|
3337
3338
|
{
|
|
3338
3339
|
modifierKey: [],
|
|
3339
3340
|
batonProps: b,
|
|
3340
|
-
disabled: d !==
|
|
3341
|
+
disabled: d !== J.selectRegion,
|
|
3341
3342
|
selectionType: T,
|
|
3342
3343
|
updateSelection: V,
|
|
3343
3344
|
selections: k
|
|
@@ -3347,7 +3348,7 @@ function Wt(e) {
|
|
|
3347
3348
|
}
|
|
3348
3349
|
);
|
|
3349
3350
|
}
|
|
3350
|
-
function
|
|
3351
|
+
function wa(e) {
|
|
3351
3352
|
return /* @__PURE__ */ l(
|
|
3352
3353
|
"div",
|
|
3353
3354
|
{
|
|
@@ -3355,16 +3356,16 @@ function Pa(e) {
|
|
|
3355
3356
|
display: "grid",
|
|
3356
3357
|
position: "relative"
|
|
3357
3358
|
},
|
|
3358
|
-
children: /* @__PURE__ */ S(
|
|
3359
|
-
/* @__PURE__ */ l(
|
|
3360
|
-
/* @__PURE__ */ l(
|
|
3359
|
+
children: /* @__PURE__ */ S(ke, { ...e, children: [
|
|
3360
|
+
/* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
|
|
3361
|
+
/* @__PURE__ */ l(Yt, { lineData: e.lineData })
|
|
3361
3362
|
] })
|
|
3362
3363
|
}
|
|
3363
3364
|
);
|
|
3364
3365
|
}
|
|
3365
|
-
function
|
|
3366
|
+
function jt({ x: e, y: n, values: t }) {
|
|
3366
3367
|
const {
|
|
3367
|
-
title:
|
|
3368
|
+
title: o,
|
|
3368
3369
|
showGrid: i,
|
|
3369
3370
|
xLabel: a,
|
|
3370
3371
|
xScaleType: s,
|
|
@@ -3377,33 +3378,33 @@ function Yt({ x: e, y: o, values: t }) {
|
|
|
3377
3378
|
updateSelection: g,
|
|
3378
3379
|
selections: p,
|
|
3379
3380
|
dDomain: b,
|
|
3380
|
-
dCustomDomain:
|
|
3381
|
+
dCustomDomain: v,
|
|
3381
3382
|
colourMap: T,
|
|
3382
3383
|
invertColourMap: V,
|
|
3383
3384
|
dScaleType: k,
|
|
3384
|
-
scatterPointSize:
|
|
3385
|
+
scatterPointSize: P,
|
|
3385
3386
|
setHistogram: L
|
|
3386
|
-
} =
|
|
3387
|
-
() =>
|
|
3387
|
+
} = Le(), E = qe(c), O = F(
|
|
3388
|
+
() => rt(t.data, b),
|
|
3388
3389
|
[b, t]
|
|
3389
3390
|
);
|
|
3390
|
-
return
|
|
3391
|
+
return z(() => {
|
|
3391
3392
|
O && L({
|
|
3392
3393
|
...O,
|
|
3393
3394
|
colorMap: T,
|
|
3394
3395
|
invertColorMap: V
|
|
3395
3396
|
});
|
|
3396
3397
|
}, [T, V, O, L]), /* @__PURE__ */ l(
|
|
3397
|
-
|
|
3398
|
+
_n,
|
|
3398
3399
|
{
|
|
3399
3400
|
dataArray: t,
|
|
3400
|
-
domain: Oe(
|
|
3401
|
+
domain: Oe(v, b),
|
|
3401
3402
|
colorMap: T,
|
|
3402
3403
|
invertColorMap: V,
|
|
3403
3404
|
scaleType: k,
|
|
3404
3405
|
showGrid: i,
|
|
3405
|
-
size:
|
|
3406
|
-
title:
|
|
3406
|
+
size: P,
|
|
3407
|
+
title: o,
|
|
3407
3408
|
abscissaParams: {
|
|
3408
3409
|
label: a,
|
|
3409
3410
|
value: e.data,
|
|
@@ -3411,15 +3412,15 @@ function Yt({ x: e, y: o, values: t }) {
|
|
|
3411
3412
|
},
|
|
3412
3413
|
ordinateParams: {
|
|
3413
3414
|
label: u,
|
|
3414
|
-
value:
|
|
3415
|
+
value: n.data,
|
|
3415
3416
|
scaleType: r
|
|
3416
3417
|
},
|
|
3417
|
-
interactions:
|
|
3418
|
+
interactions: E,
|
|
3418
3419
|
children: d && /* @__PURE__ */ l(
|
|
3419
3420
|
Ge,
|
|
3420
3421
|
{
|
|
3421
3422
|
modifierKey: [],
|
|
3422
|
-
disabled: c !==
|
|
3423
|
+
disabled: c !== J.selectRegion,
|
|
3423
3424
|
selectionType: h,
|
|
3424
3425
|
batonProps: m,
|
|
3425
3426
|
updateSelection: g,
|
|
@@ -3429,7 +3430,7 @@ function Yt({ x: e, y: o, values: t }) {
|
|
|
3429
3430
|
}
|
|
3430
3431
|
);
|
|
3431
3432
|
}
|
|
3432
|
-
function
|
|
3433
|
+
function Da(e) {
|
|
3433
3434
|
return /* @__PURE__ */ l(
|
|
3434
3435
|
"div",
|
|
3435
3436
|
{
|
|
@@ -3437,50 +3438,50 @@ function wa(e) {
|
|
|
3437
3438
|
display: "grid",
|
|
3438
3439
|
position: "relative"
|
|
3439
3440
|
},
|
|
3440
|
-
children: /* @__PURE__ */ S(
|
|
3441
|
-
/* @__PURE__ */ l(
|
|
3442
|
-
/* @__PURE__ */ l(
|
|
3441
|
+
children: /* @__PURE__ */ S(ke, { ...e, children: [
|
|
3442
|
+
/* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
|
|
3443
|
+
/* @__PURE__ */ l(jt, { x: e.x, y: e.y, values: e.pointValues })
|
|
3443
3444
|
] })
|
|
3444
3445
|
}
|
|
3445
3446
|
);
|
|
3446
3447
|
}
|
|
3447
|
-
function
|
|
3448
|
-
const { values:
|
|
3449
|
-
dDomain:
|
|
3448
|
+
function Xt(e) {
|
|
3449
|
+
const { values: n, children: t } = e, {
|
|
3450
|
+
dDomain: o,
|
|
3450
3451
|
dCustomDomain: i,
|
|
3451
3452
|
colourMap: a,
|
|
3452
3453
|
invertColourMap: s,
|
|
3453
3454
|
dScaleType: u,
|
|
3454
3455
|
showPoints: r,
|
|
3455
3456
|
setHistogram: c
|
|
3456
|
-
} =
|
|
3457
|
-
() => Oe(i,
|
|
3458
|
-
[i,
|
|
3457
|
+
} = Le(), m = F(
|
|
3458
|
+
() => Oe(i, o),
|
|
3459
|
+
[i, o]
|
|
3459
3460
|
);
|
|
3460
|
-
return
|
|
3461
|
-
const d =
|
|
3461
|
+
return z(() => {
|
|
3462
|
+
const d = rt(n.data, o);
|
|
3462
3463
|
d && (console.log("Set histogram:", d, a, s), c({
|
|
3463
3464
|
...d,
|
|
3464
3465
|
colorMap: a,
|
|
3465
3466
|
invertColorMap: s
|
|
3466
3467
|
}));
|
|
3467
|
-
}, [
|
|
3468
|
-
|
|
3468
|
+
}, [o, n, a, s, c]), /* @__PURE__ */ S(
|
|
3469
|
+
Tn,
|
|
3469
3470
|
{
|
|
3470
|
-
dataArray:
|
|
3471
|
+
dataArray: n,
|
|
3471
3472
|
domain: m,
|
|
3472
3473
|
colorMap: a,
|
|
3473
3474
|
invertColorMap: s,
|
|
3474
3475
|
scaleType: u,
|
|
3475
3476
|
showPoints: r,
|
|
3476
3477
|
children: [
|
|
3477
|
-
/* @__PURE__ */ l(
|
|
3478
|
+
/* @__PURE__ */ l(co, {}),
|
|
3478
3479
|
t
|
|
3479
3480
|
]
|
|
3480
3481
|
}
|
|
3481
3482
|
);
|
|
3482
3483
|
}
|
|
3483
|
-
function
|
|
3484
|
+
function Ma(e) {
|
|
3484
3485
|
return /* @__PURE__ */ l(
|
|
3485
3486
|
"div",
|
|
3486
3487
|
{
|
|
@@ -3488,40 +3489,40 @@ function Da(e) {
|
|
|
3488
3489
|
display: "grid",
|
|
3489
3490
|
position: "relative"
|
|
3490
3491
|
},
|
|
3491
|
-
children: /* @__PURE__ */ S(
|
|
3492
|
-
/* @__PURE__ */ l(
|
|
3493
|
-
/* @__PURE__ */ l(
|
|
3492
|
+
children: /* @__PURE__ */ S(ke, { ...e, children: [
|
|
3493
|
+
/* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
|
|
3494
|
+
/* @__PURE__ */ l(Xt, { values: e.heightValues })
|
|
3494
3495
|
] })
|
|
3495
3496
|
}
|
|
3496
3497
|
);
|
|
3497
3498
|
}
|
|
3498
|
-
function
|
|
3499
|
+
function Bi(e) {
|
|
3499
3500
|
var g, p;
|
|
3500
|
-
function
|
|
3501
|
+
function n(b, v) {
|
|
3501
3502
|
const T = b === "standard";
|
|
3502
3503
|
return new Intl.NumberFormat("en", {
|
|
3503
3504
|
notation: b,
|
|
3504
|
-
maximumFractionDigits: T ? Math.max(
|
|
3505
|
-
maximumSignificantDigits: T ? void 0 : Math.max(
|
|
3505
|
+
maximumFractionDigits: T ? Math.max(v, 0) : void 0,
|
|
3506
|
+
maximumSignificantDigits: T ? void 0 : Math.max(v, 1)
|
|
3506
3507
|
});
|
|
3507
3508
|
}
|
|
3508
|
-
const [t,
|
|
3509
|
+
const [t, o] = D(
|
|
3509
3510
|
((g = e.displayParams) == null ? void 0 : g.displayType) ?? "standard"
|
|
3510
|
-
), [i, a] =
|
|
3511
|
+
), [i, a] = D(
|
|
3511
3512
|
((p = e.displayParams) == null ? void 0 : p.numberDigits) ?? 2
|
|
3512
|
-
), [s, u] =
|
|
3513
|
+
), [s, u] = D(
|
|
3513
3514
|
e.cellWidth
|
|
3514
|
-
), [r, c] =
|
|
3515
|
-
|
|
3515
|
+
), [r, c] = D(
|
|
3516
|
+
n(t, i)
|
|
3516
3517
|
), m = 120;
|
|
3517
|
-
|
|
3518
|
-
console.log("numberDigits is ", i), c(
|
|
3518
|
+
z(() => {
|
|
3519
|
+
console.log("numberDigits is ", i), c(n(t, i));
|
|
3519
3520
|
}, [t, i]);
|
|
3520
3521
|
function d(b) {
|
|
3521
|
-
|
|
3522
|
+
o(b);
|
|
3522
3523
|
}
|
|
3523
|
-
const h = (b,
|
|
3524
|
-
const T = e.cellValues.get(b,
|
|
3524
|
+
const h = (b, v) => {
|
|
3525
|
+
const T = e.cellValues.get(b, v);
|
|
3525
3526
|
return r.format(T);
|
|
3526
3527
|
};
|
|
3527
3528
|
return /* @__PURE__ */ S(
|
|
@@ -3532,9 +3533,9 @@ function Oi(e) {
|
|
|
3532
3533
|
position: "relative"
|
|
3533
3534
|
},
|
|
3534
3535
|
children: [
|
|
3535
|
-
/* @__PURE__ */ S(
|
|
3536
|
+
/* @__PURE__ */ S(st, { children: [
|
|
3536
3537
|
/* @__PURE__ */ l(
|
|
3537
|
-
|
|
3538
|
+
Ln,
|
|
3538
3539
|
{
|
|
3539
3540
|
value: s,
|
|
3540
3541
|
defaultValue: m,
|
|
@@ -3542,28 +3543,28 @@ function Oi(e) {
|
|
|
3542
3543
|
},
|
|
3543
3544
|
"cell width input"
|
|
3544
3545
|
),
|
|
3545
|
-
/* @__PURE__ */ l(
|
|
3546
|
+
/* @__PURE__ */ l(Te, {}),
|
|
3546
3547
|
/* @__PURE__ */ S(
|
|
3547
|
-
|
|
3548
|
+
W,
|
|
3548
3549
|
{
|
|
3549
3550
|
role: "radiogroup",
|
|
3550
3551
|
ariaLabel: "displayStyle",
|
|
3551
3552
|
value: t,
|
|
3552
3553
|
onChange: d,
|
|
3553
3554
|
children: [
|
|
3554
|
-
/* @__PURE__ */ l(
|
|
3555
|
-
/* @__PURE__ */ l(
|
|
3555
|
+
/* @__PURE__ */ l(W.Btn, { label: "standard", value: "standard" }),
|
|
3556
|
+
/* @__PURE__ */ l(W.Btn, { label: "scientific", value: "scientific" })
|
|
3556
3557
|
]
|
|
3557
3558
|
},
|
|
3558
3559
|
"display style toggle"
|
|
3559
3560
|
),
|
|
3560
|
-
/* @__PURE__ */ l(
|
|
3561
|
+
/* @__PURE__ */ l(Te, {}),
|
|
3561
3562
|
/* @__PURE__ */ l(
|
|
3562
|
-
|
|
3563
|
+
U,
|
|
3563
3564
|
{
|
|
3564
3565
|
label: "digits",
|
|
3565
3566
|
input: i,
|
|
3566
|
-
isValid: (b) =>
|
|
3567
|
+
isValid: (b) => Po(b, t === "standard" ? 0 : 1, 10),
|
|
3567
3568
|
inputAttribs: {
|
|
3568
3569
|
name: "digits",
|
|
3569
3570
|
pattern: "^\\d$",
|
|
@@ -3573,10 +3574,10 @@ function Oi(e) {
|
|
|
3573
3574
|
},
|
|
3574
3575
|
"0"
|
|
3575
3576
|
),
|
|
3576
|
-
/* @__PURE__ */ l(
|
|
3577
|
+
/* @__PURE__ */ l(Te, {})
|
|
3577
3578
|
] }),
|
|
3578
3579
|
/* @__PURE__ */ l(
|
|
3579
|
-
|
|
3580
|
+
kn,
|
|
3580
3581
|
{
|
|
3581
3582
|
cellWidth: s ?? m,
|
|
3582
3583
|
dims: e.cellValues.shape,
|
|
@@ -3587,43 +3588,43 @@ function Oi(e) {
|
|
|
3587
3588
|
}
|
|
3588
3589
|
);
|
|
3589
3590
|
}
|
|
3590
|
-
function
|
|
3591
|
-
let
|
|
3592
|
-
return "lineData" in e && e.lineData.length !== 0 ?
|
|
3593
|
-
|
|
3591
|
+
function zi(e) {
|
|
3592
|
+
let n = null;
|
|
3593
|
+
return "lineData" in e && e.lineData.length !== 0 ? n = /* @__PURE__ */ l(Yt, { lineData: e.lineData }) : "values" in e ? "heatmapScale" in e ? n = /* @__PURE__ */ l(
|
|
3594
|
+
Gt,
|
|
3594
3595
|
{
|
|
3595
3596
|
xValues: e.plotConfig.xValues,
|
|
3596
3597
|
yValues: e.plotConfig.yValues,
|
|
3597
3598
|
values: e.values
|
|
3598
3599
|
}
|
|
3599
|
-
) :
|
|
3600
|
-
|
|
3600
|
+
) : n = /* @__PURE__ */ l(
|
|
3601
|
+
Wt,
|
|
3601
3602
|
{
|
|
3602
3603
|
xValues: e.plotConfig.xValues,
|
|
3603
3604
|
yValues: e.plotConfig.yValues,
|
|
3604
3605
|
values: e.values
|
|
3605
3606
|
}
|
|
3606
|
-
) : "heightValues" in e ?
|
|
3607
|
+
) : "heightValues" in e ? n = /* @__PURE__ */ l(Xt, { values: e.heightValues }) : "pointValues" in e && (n = /* @__PURE__ */ l(jt, { x: e.x, y: e.y, values: e.pointValues })), n;
|
|
3607
3608
|
}
|
|
3608
|
-
function
|
|
3609
|
-
const
|
|
3610
|
-
return
|
|
3611
|
-
|
|
3612
|
-
}), "cellWidth" in e ? /* @__PURE__ */ l(
|
|
3609
|
+
function Ei(e) {
|
|
3610
|
+
const n = X(0), t = $t();
|
|
3611
|
+
return Dt(() => {
|
|
3612
|
+
n.current = t.end();
|
|
3613
|
+
}), "cellWidth" in e ? /* @__PURE__ */ l(Bi, { ...e }) : /* @__PURE__ */ l(
|
|
3613
3614
|
"div",
|
|
3614
3615
|
{
|
|
3615
3616
|
style: {
|
|
3616
3617
|
display: "grid",
|
|
3617
3618
|
position: "relative"
|
|
3618
3619
|
},
|
|
3619
|
-
children: /* @__PURE__ */ S(
|
|
3620
|
-
/* @__PURE__ */ l(
|
|
3621
|
-
/* @__PURE__ */ l(
|
|
3620
|
+
children: /* @__PURE__ */ S(ke, { ...e, children: [
|
|
3621
|
+
/* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
|
|
3622
|
+
/* @__PURE__ */ l(zi, { ...e })
|
|
3622
3623
|
] })
|
|
3623
3624
|
}
|
|
3624
3625
|
);
|
|
3625
3626
|
}
|
|
3626
|
-
const
|
|
3627
|
+
const wt = {
|
|
3627
3628
|
xScale: void 0,
|
|
3628
3629
|
yScale: void 0,
|
|
3629
3630
|
xLabel: void 0,
|
|
@@ -3632,18 +3633,25 @@ const Pt = {
|
|
|
3632
3633
|
yValues: void 0,
|
|
3633
3634
|
title: void 0
|
|
3634
3635
|
};
|
|
3635
|
-
function
|
|
3636
|
+
function _a({
|
|
3636
3637
|
plotId: e = "plot_0",
|
|
3637
|
-
hostname:
|
|
3638
|
+
hostname: n = "127.0.0.1",
|
|
3638
3639
|
port: t = "8000",
|
|
3639
|
-
uuid:
|
|
3640
|
+
uuid: o
|
|
3640
3641
|
}) {
|
|
3641
|
-
const [i, a] =
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3642
|
+
const [i, a] = D(), s = X([]), [u, r] = D(wt), [c, m] = D(), d = (f, y, C) => {
|
|
3643
|
+
y || (f === ot.removed ? E("clear_selection_data", {
|
|
3644
|
+
selectionIds: C ? [C.id] : []
|
|
3645
|
+
}) : E(
|
|
3646
|
+
f === ot.created ? "client_new_selection" : "client_update_selection",
|
|
3647
|
+
{
|
|
3648
|
+
selection: C
|
|
3649
|
+
}
|
|
3650
|
+
));
|
|
3651
|
+
}, { selections: h, updateSelection: g, setSelections: p } = Et(
|
|
3652
|
+
void 0,
|
|
3653
|
+
d
|
|
3654
|
+
), b = X(0), v = X(""), T = `ws://${n}:${t}/plot/${o}/${e}`, { sendMessage: V, lastMessage: k, readyState: P, getWebSocket: L } = mo(
|
|
3647
3655
|
T,
|
|
3648
3656
|
{
|
|
3649
3657
|
onOpen: () => {
|
|
@@ -3654,74 +3662,74 @@ function Ma({
|
|
|
3654
3662
|
},
|
|
3655
3663
|
reconnectAttempts: 5,
|
|
3656
3664
|
reconnectInterval: 5e3,
|
|
3657
|
-
shouldReconnect: (
|
|
3665
|
+
shouldReconnect: (f) => v.current !== "unmounted"
|
|
3658
3666
|
}
|
|
3659
3667
|
);
|
|
3660
|
-
|
|
3661
|
-
|
|
3668
|
+
z(() => (v.current = "initial", () => {
|
|
3669
|
+
v.current = "unmounted";
|
|
3662
3670
|
}), []);
|
|
3663
|
-
const
|
|
3664
|
-
(
|
|
3665
|
-
console.log("%s: sending", e,
|
|
3671
|
+
const E = te(
|
|
3672
|
+
(f, y) => {
|
|
3673
|
+
console.log("%s: sending", e, y), V(uo({
|
|
3666
3674
|
plotId: e,
|
|
3667
|
-
type:
|
|
3668
|
-
params:
|
|
3675
|
+
type: f,
|
|
3676
|
+
params: y
|
|
3669
3677
|
}));
|
|
3670
3678
|
},
|
|
3671
3679
|
[e, V]
|
|
3672
|
-
), O =
|
|
3673
|
-
(
|
|
3674
|
-
|
|
3680
|
+
), O = te(
|
|
3681
|
+
(f) => {
|
|
3682
|
+
E("status", f);
|
|
3675
3683
|
},
|
|
3676
|
-
[
|
|
3677
|
-
),
|
|
3678
|
-
|
|
3679
|
-
}, x = (
|
|
3680
|
-
|
|
3681
|
-
}, [_, K] =
|
|
3682
|
-
uuid:
|
|
3684
|
+
[E]
|
|
3685
|
+
), Y = () => {
|
|
3686
|
+
E("baton_request", o);
|
|
3687
|
+
}, x = (f) => {
|
|
3688
|
+
E("baton_offer", f);
|
|
3689
|
+
}, [_, K] = D({
|
|
3690
|
+
uuid: o,
|
|
3683
3691
|
batonUuid: "",
|
|
3684
3692
|
others: [],
|
|
3685
3693
|
hasBaton: !1,
|
|
3686
|
-
requestBaton:
|
|
3694
|
+
requestBaton: Y,
|
|
3687
3695
|
offerBaton: x
|
|
3688
3696
|
});
|
|
3689
|
-
|
|
3690
|
-
if (
|
|
3691
|
-
const
|
|
3692
|
-
|
|
3697
|
+
z(() => {
|
|
3698
|
+
if (P === $e.OPEN) {
|
|
3699
|
+
const f = L();
|
|
3700
|
+
f && f.binaryType !== "arraybuffer" && (f.binaryType = "arraybuffer", console.log("%s: WebSocket set binaryType", e)), O("ready");
|
|
3693
3701
|
}
|
|
3694
|
-
}, [L, e,
|
|
3695
|
-
const
|
|
3696
|
-
|
|
3697
|
-
},
|
|
3698
|
-
s.current = [], r(
|
|
3702
|
+
}, [L, e, P, O]);
|
|
3703
|
+
const G = () => {
|
|
3704
|
+
Z(), console.log("%s: data cleared", e, Object.keys(u));
|
|
3705
|
+
}, Z = () => {
|
|
3706
|
+
s.current = [], r(wt), a(null), p([]);
|
|
3699
3707
|
};
|
|
3700
|
-
|
|
3708
|
+
z(() => {
|
|
3701
3709
|
if (_.batonUuid) {
|
|
3702
|
-
let
|
|
3703
|
-
|
|
3704
|
-
toastId:
|
|
3710
|
+
let f = _.hasBaton ? "Baton gained" : "Baton lost";
|
|
3711
|
+
v.current === "initial" && (f = _.hasBaton ? "Taken baton" : "Another client has baton", v.current = ""), yt(f, {
|
|
3712
|
+
toastId: o,
|
|
3705
3713
|
position: "bottom-center",
|
|
3706
3714
|
autoClose: 2e3,
|
|
3707
3715
|
theme: "light"
|
|
3708
3716
|
});
|
|
3709
3717
|
}
|
|
3710
|
-
}, [_.hasBaton, _.batonUuid,
|
|
3711
|
-
const B = (
|
|
3712
|
-
|
|
3713
|
-
const
|
|
3714
|
-
x(
|
|
3718
|
+
}, [_.hasBaton, _.batonUuid, o]);
|
|
3719
|
+
const B = (f) => {
|
|
3720
|
+
yt(/* @__PURE__ */ l(() => {
|
|
3721
|
+
const C = () => {
|
|
3722
|
+
x(f.requester);
|
|
3715
3723
|
};
|
|
3716
3724
|
return /* @__PURE__ */ l("div", { children: /* @__PURE__ */ S("h3", { children: [
|
|
3717
3725
|
"Baton requested from ",
|
|
3718
|
-
|
|
3726
|
+
f.requester,
|
|
3719
3727
|
" ",
|
|
3720
3728
|
/* @__PURE__ */ l("br", {}),
|
|
3721
|
-
/* @__PURE__ */ l("button", { onClick:
|
|
3729
|
+
/* @__PURE__ */ l("button", { onClick: C, children: "Approve" })
|
|
3722
3730
|
] }) });
|
|
3723
3731
|
}, {}), {
|
|
3724
|
-
toastId:
|
|
3732
|
+
toastId: f.requester,
|
|
3725
3733
|
position: "bottom-center",
|
|
3726
3734
|
autoClose: !1,
|
|
3727
3735
|
hideProgressBar: !1,
|
|
@@ -3731,171 +3739,162 @@ function Ma({
|
|
|
3731
3739
|
progress: void 0,
|
|
3732
3740
|
theme: "light"
|
|
3733
3741
|
});
|
|
3734
|
-
},
|
|
3735
|
-
const
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
{
|
|
3741
|
-
selection: y
|
|
3742
|
-
}
|
|
3743
|
-
)), P;
|
|
3744
|
-
}, ae = (y, f, v = !0) => {
|
|
3745
|
-
const P = s.current;
|
|
3746
|
-
console.log("Finding old line with key", y);
|
|
3747
|
-
const z = P.findIndex((H) => H.key === y);
|
|
3748
|
-
if (z === -1)
|
|
3749
|
-
return console.log("Line with key", y, "cannot be found"), P;
|
|
3742
|
+
}, Q = (f, y, C = !0) => {
|
|
3743
|
+
const M = s.current;
|
|
3744
|
+
console.log("Finding old line with key", f);
|
|
3745
|
+
const R = M.findIndex((H) => H.key === f);
|
|
3746
|
+
if (R === -1)
|
|
3747
|
+
return console.log("Line with key", f, "cannot be found"), M;
|
|
3750
3748
|
{
|
|
3751
|
-
const H = [...
|
|
3752
|
-
return console.debug("Replacing old line params with",
|
|
3749
|
+
const H = [...M];
|
|
3750
|
+
return console.debug("Replacing old line params with", y), H[R] = { ...H[R], ...y }, H;
|
|
3753
3751
|
}
|
|
3754
|
-
},
|
|
3755
|
-
c != null && m({ ...c, pointSize:
|
|
3756
|
-
pointSize:
|
|
3752
|
+
}, ae = (f, y = !0) => {
|
|
3753
|
+
c != null && m({ ...c, pointSize: f }), y && E("client_update_scatter_parameters", {
|
|
3754
|
+
pointSize: f
|
|
3757
3755
|
});
|
|
3758
|
-
},
|
|
3759
|
-
const
|
|
3756
|
+
}, ne = (f, y) => {
|
|
3757
|
+
const C = go(f), M = yo(f);
|
|
3760
3758
|
console.log(
|
|
3761
3759
|
"%s: setting line state with domains",
|
|
3762
3760
|
e,
|
|
3763
|
-
|
|
3764
|
-
|
|
3761
|
+
C,
|
|
3762
|
+
M
|
|
3765
3763
|
);
|
|
3766
|
-
const
|
|
3767
|
-
s.current =
|
|
3768
|
-
lineData:
|
|
3769
|
-
xDomain:
|
|
3770
|
-
yDomain:
|
|
3771
|
-
plotConfig:
|
|
3772
|
-
updateLineParams:
|
|
3764
|
+
const R = y ?? u;
|
|
3765
|
+
s.current = f, r(R), a({
|
|
3766
|
+
lineData: f,
|
|
3767
|
+
xDomain: C,
|
|
3768
|
+
yDomain: M,
|
|
3769
|
+
plotConfig: R,
|
|
3770
|
+
updateLineParams: Q
|
|
3773
3771
|
});
|
|
3774
|
-
},
|
|
3775
|
-
const
|
|
3776
|
-
console.log("%s: appending line data", e, Object.keys(
|
|
3777
|
-
const
|
|
3778
|
-
for (let H = 0; H <
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
},
|
|
3782
|
-
const
|
|
3772
|
+
}, xe = (f) => {
|
|
3773
|
+
const y = f.alData.map((H) => pt(H));
|
|
3774
|
+
console.log("%s: appending line data", e, Object.keys(y));
|
|
3775
|
+
const C = s.current, M = Math.max(C.length, y.length), R = [];
|
|
3776
|
+
for (let H = 0; H < M; H++)
|
|
3777
|
+
R.push(fo(C[H], y[H]));
|
|
3778
|
+
ne(R);
|
|
3779
|
+
}, Pe = (f) => {
|
|
3780
|
+
const y = Ee(f.plotConfig), C = f.mlData.map((M) => pt(M)).filter((M) => M !== null);
|
|
3783
3781
|
console.log(
|
|
3784
3782
|
"%s: new line data",
|
|
3785
3783
|
e,
|
|
3786
|
-
|
|
3787
|
-
),
|
|
3788
|
-
},
|
|
3789
|
-
const
|
|
3790
|
-
if (Co(
|
|
3791
|
-
const
|
|
3792
|
-
console.log("%s: new heatmap data", e, Object.keys(
|
|
3793
|
-
...
|
|
3794
|
-
plotConfig:
|
|
3784
|
+
C.map((M) => M.key)
|
|
3785
|
+
), ne(C, y);
|
|
3786
|
+
}, we = (f) => {
|
|
3787
|
+
const y = po(f.imData), C = Ee(f.plotConfig);
|
|
3788
|
+
if (Co(y)) {
|
|
3789
|
+
const M = y;
|
|
3790
|
+
console.log("%s: new heatmap data", e, Object.keys(M)), a({
|
|
3791
|
+
...M,
|
|
3792
|
+
plotConfig: C
|
|
3795
3793
|
});
|
|
3796
3794
|
} else
|
|
3797
|
-
console.log("%s: new image data", e, Object.keys(
|
|
3798
|
-
...
|
|
3799
|
-
plotConfig:
|
|
3795
|
+
console.log("%s: new image data", e, Object.keys(y)), a({
|
|
3796
|
+
...y,
|
|
3797
|
+
plotConfig: C
|
|
3800
3798
|
});
|
|
3801
|
-
},
|
|
3802
|
-
const
|
|
3803
|
-
console.log("%s: new scatter data", e, Object.keys(
|
|
3804
|
-
const
|
|
3805
|
-
m(
|
|
3806
|
-
...
|
|
3807
|
-
plotConfig:
|
|
3808
|
-
setPointSize:
|
|
3799
|
+
}, De = (f) => {
|
|
3800
|
+
const y = vo(f.scData);
|
|
3801
|
+
console.log("%s: new scatter data", e, Object.keys(y));
|
|
3802
|
+
const C = Ee(f.plotConfig);
|
|
3803
|
+
m(y), a({
|
|
3804
|
+
...y,
|
|
3805
|
+
plotConfig: C,
|
|
3806
|
+
setPointSize: ae
|
|
3809
3807
|
});
|
|
3810
|
-
},
|
|
3811
|
-
const
|
|
3812
|
-
console.log("%s: new surface data", e, Object.keys(
|
|
3813
|
-
const
|
|
3808
|
+
}, j = (f) => {
|
|
3809
|
+
const y = bo(f.suData);
|
|
3810
|
+
console.log("%s: new surface data", e, Object.keys(y));
|
|
3811
|
+
const C = Ee(f.plotConfig);
|
|
3814
3812
|
a({
|
|
3815
|
-
...
|
|
3816
|
-
plotConfig:
|
|
3813
|
+
...y,
|
|
3814
|
+
plotConfig: C
|
|
3817
3815
|
});
|
|
3818
|
-
},
|
|
3819
|
-
const
|
|
3820
|
-
console.log("%s: new table data", e, Object.keys(
|
|
3821
|
-
...
|
|
3816
|
+
}, fe = (f) => {
|
|
3817
|
+
const y = So(f.taData);
|
|
3818
|
+
console.log("%s: new table data", e, Object.keys(y)), a({
|
|
3819
|
+
...y
|
|
3822
3820
|
});
|
|
3823
|
-
},
|
|
3824
|
-
const
|
|
3825
|
-
console.log("%s: update selections", e,
|
|
3826
|
-
const
|
|
3827
|
-
for (const
|
|
3828
|
-
const H =
|
|
3829
|
-
|
|
3821
|
+
}, oe = (f) => {
|
|
3822
|
+
const y = f.updateSelections.map((C) => vt(C)).filter((C) => C !== null);
|
|
3823
|
+
console.log("%s: update selections", e, y), p((C) => {
|
|
3824
|
+
const M = [...C];
|
|
3825
|
+
for (const R of y) {
|
|
3826
|
+
const H = R.id, se = M.findIndex((Se) => Se.id === H);
|
|
3827
|
+
se === -1 ? M.push(R) : M[se] = R;
|
|
3830
3828
|
}
|
|
3831
|
-
return
|
|
3829
|
+
return M;
|
|
3832
3830
|
});
|
|
3833
|
-
},
|
|
3834
|
-
const
|
|
3835
|
-
console.log("%s: clear selections", e,
|
|
3836
|
-
const
|
|
3837
|
-
for (const
|
|
3838
|
-
|
|
3839
|
-
return
|
|
3831
|
+
}, ge = (f) => {
|
|
3832
|
+
const y = f.selectionIds;
|
|
3833
|
+
console.log("%s: clear selections", e, y), y.length === 0 ? p(() => []) : p((C) => {
|
|
3834
|
+
const M = [];
|
|
3835
|
+
for (const R of C)
|
|
3836
|
+
y.includes(R.id) || M.push(R);
|
|
3837
|
+
return M;
|
|
3840
3838
|
});
|
|
3841
|
-
},
|
|
3842
|
-
const
|
|
3843
|
-
console.log("%s: new selections", e,
|
|
3844
|
-
},
|
|
3845
|
-
console.log("%s: updating baton with msg:", e,
|
|
3846
|
-
const
|
|
3847
|
-
K((
|
|
3848
|
-
...
|
|
3849
|
-
batonUuid:
|
|
3850
|
-
others:
|
|
3851
|
-
hasBaton:
|
|
3839
|
+
}, I = (f) => {
|
|
3840
|
+
const y = f.setSelections.map((C) => vt(C)).filter((C) => C !== null);
|
|
3841
|
+
console.log("%s: new selections", e, y), p(y);
|
|
3842
|
+
}, $ = (f) => {
|
|
3843
|
+
console.log("%s: updating baton with msg:", e, f, "for", o);
|
|
3844
|
+
const y = f.baton;
|
|
3845
|
+
K((C) => ({
|
|
3846
|
+
...C,
|
|
3847
|
+
batonUuid: y,
|
|
3848
|
+
others: f.uuids.filter((M) => M !== o),
|
|
3849
|
+
hasBaton: y === o
|
|
3852
3850
|
}));
|
|
3853
3851
|
};
|
|
3854
|
-
|
|
3852
|
+
z(() => {
|
|
3855
3853
|
if (!k)
|
|
3856
3854
|
return;
|
|
3857
|
-
|
|
3858
|
-
const
|
|
3859
|
-
if (
|
|
3860
|
-
console.log("Message was a blob:",
|
|
3855
|
+
P !== $e.OPEN && console.log("%s: still not open", e);
|
|
3856
|
+
const f = k.data;
|
|
3857
|
+
if (f instanceof Blob) {
|
|
3858
|
+
console.log("Message was a blob:", f);
|
|
3861
3859
|
return;
|
|
3862
3860
|
}
|
|
3863
|
-
const
|
|
3864
|
-
console.log("%s: decodedMessage", e, Object.keys(
|
|
3865
|
-
const
|
|
3866
|
-
|
|
3867
|
-
b.current =
|
|
3861
|
+
const y = ho(f);
|
|
3862
|
+
console.log("%s: decodedMessage", e, Object.keys(y));
|
|
3863
|
+
const C = $t();
|
|
3864
|
+
Dt(() => {
|
|
3865
|
+
b.current = C.end();
|
|
3868
3866
|
});
|
|
3869
|
-
let
|
|
3870
|
-
"mlData" in
|
|
3867
|
+
let M = !0;
|
|
3868
|
+
"mlData" in y ? Pe(y) : "alData" in y ? xe(y) : "imData" in y ? we(y) : "scData" in y ? De(y) : "suData" in y ? j(y) : "taData" in y ? fe(y) : "updateSelections" in y ? oe(y) : "selectionIds" in y ? ge(y) : "setSelections" in y ? I(y) : "baton" in y ? $(y) : "requester" in y ? B(y) : "plotId" in y ? G() : (M = !1, console.log("%s: new message type unknown", e)), M && O(`ready ${b.current}`);
|
|
3871
3869
|
}, [k, e]);
|
|
3872
|
-
let
|
|
3873
|
-
return
|
|
3870
|
+
let N = i;
|
|
3871
|
+
return N && (N = { ...N, batonProps: _, updateSelection: g, selections: h }), N && console.log("%s: plotprops", e, Object.keys(N)), h.length && console.log("%s: selections", e, h.length), !P || P === $e.UNINSTANTIATED ? /* @__PURE__ */ l("h2", { children: "Waiting for plot server connection" }) : P === $e.CLOSING ? /* @__PURE__ */ l("h2", { children: "Closing plot server connection" }) : P === $e.CLOSED ? /* @__PURE__ */ l("h2", { children: "Plot server connection closed" }) : N ? /* @__PURE__ */ l(Ei, { ...N }) : /* @__PURE__ */ l("h2", { children: "Awaiting command from plot server" });
|
|
3874
3872
|
}
|
|
3875
3873
|
export {
|
|
3876
|
-
|
|
3877
|
-
|
|
3874
|
+
Ei as AnyPlot,
|
|
3875
|
+
Ae as AnyToolbar,
|
|
3878
3876
|
ce as AxialSelection,
|
|
3879
|
-
|
|
3880
|
-
|
|
3877
|
+
pe as BaseSelection,
|
|
3878
|
+
be as CircularSectorialSelection,
|
|
3881
3879
|
me as CircularSelection,
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3880
|
+
_a as ConnectedPlot,
|
|
3881
|
+
Ce as EllipticalSelection,
|
|
3882
|
+
ka as GlyphType,
|
|
3883
|
+
xa as HeatmapPlot,
|
|
3884
|
+
Pa as ImagePlot,
|
|
3885
|
+
J as InteractionModeType,
|
|
3886
|
+
wa as LinePlot,
|
|
3889
3887
|
ue as LinearSelection,
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3888
|
+
ct as OrientableSelection,
|
|
3889
|
+
ke as PlotCustomizationContextProvider,
|
|
3890
|
+
Fi as PlotToolbar,
|
|
3893
3891
|
ie as PolygonalSelection,
|
|
3894
3892
|
de as RectangularSelection,
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3893
|
+
Aa as ScaleType,
|
|
3894
|
+
Da as ScatterPlot,
|
|
3895
|
+
q as SelectionType,
|
|
3896
|
+
Ma as SurfacePlot,
|
|
3897
|
+
Bi as TableDisplay,
|
|
3898
|
+
Le as usePlotCustomizationContext,
|
|
3899
|
+
Et as useSelections
|
|
3901
3900
|
};
|