baselode 0.1.14 → 0.1.15
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/baselode.js +1404 -1243
- package/dist/baselode.js.map +1 -1
- package/package.json +1 -1
package/dist/baselode.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import te from "papaparse";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
2
|
+
import { jsx as D, jsxs as J } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as Se, useState as Q, useEffect as se, useMemo as ne, useCallback as Ue } from "react";
|
|
4
4
|
import Fe from "plotly.js-dist-min";
|
|
5
|
-
import * as
|
|
6
|
-
import { OrbitControls as
|
|
7
|
-
import { FlyControls as
|
|
8
|
-
import { ViewportGizmo as
|
|
9
|
-
import { EffectComposer as
|
|
10
|
-
import { RenderPass as
|
|
11
|
-
import { OutlinePass as
|
|
12
|
-
const
|
|
5
|
+
import * as g from "three";
|
|
6
|
+
import { OrbitControls as on } from "three/examples/jsm/controls/OrbitControls";
|
|
7
|
+
import { FlyControls as sn } from "three/examples/jsm/controls/FlyControls";
|
|
8
|
+
import { ViewportGizmo as ln } from "three-viewport-gizmo";
|
|
9
|
+
import { EffectComposer as an } from "three/examples/jsm/postprocessing/EffectComposer.js";
|
|
10
|
+
import { RenderPass as cn } from "three/examples/jsm/postprocessing/RenderPass.js";
|
|
11
|
+
import { OutlinePass as un } from "three/examples/jsm/postprocessing/OutlinePass.js";
|
|
12
|
+
const x = "hole_id", oe = "latitude", ie = "longitude", xe = "elevation", X = "azimuth", q = "dip", S = "from", T = "to", Ie = "mid", me = "project_id", pe = "easting", be = "northing", Et = "crs", W = "depth", xt = "alpha", kt = "beta", dn = "strike", ae = "geology_code", ce = "geology_description", Fo = {
|
|
13
13
|
// A unique hole identifier across the entire dataset and all future data sets
|
|
14
|
-
[
|
|
14
|
+
[x]: "string",
|
|
15
15
|
// The hole ID from the original collar source
|
|
16
16
|
datasource_hole_id: "string",
|
|
17
17
|
// The project ID or project code from the original collar source, if available
|
|
@@ -21,62 +21,62 @@ const A = "hole_id", oe = "latitude", ie = "longitude", Ae = "elevation", q = "a
|
|
|
21
21
|
// The longitude of the collar, in decimal degrees (WGS84)
|
|
22
22
|
[ie]: "number",
|
|
23
23
|
// The elevation of the collar, in meters above sea level (WGS84)
|
|
24
|
-
[
|
|
24
|
+
[xe]: "number",
|
|
25
25
|
// The easting coordinate of the collar, in meters (projected CRS)
|
|
26
26
|
[pe]: "number",
|
|
27
27
|
// The northing coordinate of the collar, in meters (projected CRS)
|
|
28
28
|
[be]: "number",
|
|
29
29
|
// The coordinate reference system of the collar coordinates for easting/northing, as an EPSG code or proj string
|
|
30
30
|
[Et]: "string"
|
|
31
|
-
},
|
|
31
|
+
}, wo = {
|
|
32
32
|
// The unique hole id that maps to the collar and any other data tables
|
|
33
|
-
[
|
|
33
|
+
[x]: "string",
|
|
34
34
|
// The depth along the hole where the survey measurement was taken / started
|
|
35
35
|
[W]: "number",
|
|
36
36
|
// The depth along the hole where the survey measurement ended, if applicable (some surveys are point measurements and may not have a 'to' depth)
|
|
37
|
-
[
|
|
37
|
+
[T]: "number",
|
|
38
38
|
// The azimuth of the hole at the survey depth, in degrees from north
|
|
39
|
-
[
|
|
39
|
+
[X]: "number",
|
|
40
40
|
// The dip of the hole at the survey depth, in degrees from horizontal (negative values indicate downward inclination)
|
|
41
|
-
[
|
|
42
|
-
},
|
|
41
|
+
[q]: "number"
|
|
42
|
+
}, To = {
|
|
43
43
|
// The unique hole id that maps to the collar and any other data tables
|
|
44
|
-
[
|
|
44
|
+
[x]: "string",
|
|
45
45
|
// The depth along the hole where the assay interval starts
|
|
46
|
-
[
|
|
46
|
+
[S]: "number",
|
|
47
47
|
// The depth along the hole where the assay interval ends
|
|
48
|
-
[
|
|
48
|
+
[T]: "number",
|
|
49
49
|
// The midpoint depth of the assay interval
|
|
50
50
|
[Ie]: "number"
|
|
51
51
|
// assay value columns are variable and not standardized here.
|
|
52
52
|
// Assays may be flattened (one column per assay type) or long (one row per assay type with an additional 'assay_type' column)
|
|
53
|
-
},
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
53
|
+
}, mn = {
|
|
54
|
+
[x]: "string",
|
|
55
|
+
[S]: "number",
|
|
56
|
+
[T]: "number",
|
|
57
57
|
[Ie]: "number",
|
|
58
58
|
[ae]: "string",
|
|
59
59
|
[ce]: "string"
|
|
60
|
-
},
|
|
61
|
-
[
|
|
60
|
+
}, $o = {
|
|
61
|
+
[x]: "string",
|
|
62
62
|
[W]: "number",
|
|
63
|
-
[X]: "number",
|
|
64
63
|
[q]: "number",
|
|
64
|
+
[X]: "number",
|
|
65
|
+
[xt]: "number",
|
|
65
66
|
[kt]: "number",
|
|
66
|
-
[At]: "number",
|
|
67
67
|
comments: "string"
|
|
68
|
-
},
|
|
69
|
-
[
|
|
68
|
+
}, fn = {
|
|
69
|
+
[x]: ["hole_id", "holeid", "hole id", "hole-id"],
|
|
70
70
|
datasource_hole_id: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
|
|
71
71
|
[me]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
|
|
72
72
|
[oe]: ["latitude", "lat"],
|
|
73
73
|
[ie]: ["longitude", "lon"],
|
|
74
|
-
[
|
|
74
|
+
[xe]: ["elevation", "rl", "elev", "z"],
|
|
75
75
|
[pe]: ["easting", "x"],
|
|
76
76
|
[be]: ["northing", "y"],
|
|
77
77
|
[Et]: ["crs", "epsg", "projection"],
|
|
78
|
-
[
|
|
79
|
-
[
|
|
78
|
+
[S]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
|
|
79
|
+
[T]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
|
|
80
80
|
[ae]: [
|
|
81
81
|
"geology_code",
|
|
82
82
|
"geologycode",
|
|
@@ -98,42 +98,42 @@ const A = "hole_id", oe = "latitude", ie = "longitude", Ae = "elevation", q = "a
|
|
|
98
98
|
"description",
|
|
99
99
|
"comments"
|
|
100
100
|
],
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
[
|
|
101
|
+
[X]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
|
|
102
|
+
[q]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
|
|
103
|
+
[xt]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
|
|
104
|
+
[kt]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
|
|
105
105
|
declination: ["declination", "dec"],
|
|
106
106
|
[W]: ["depth", "survey_depth", "surveydepth"],
|
|
107
|
-
[
|
|
108
|
-
},
|
|
109
|
-
for (const [e, t] of Object.entries(
|
|
107
|
+
[dn]: ["strike", "str"]
|
|
108
|
+
}, At = {};
|
|
109
|
+
for (const [e, t] of Object.entries(fn))
|
|
110
110
|
for (const n of t) {
|
|
111
111
|
const r = n.toLowerCase().trim();
|
|
112
|
-
|
|
112
|
+
At[r] = e;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function we(e) {
|
|
115
115
|
return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
const r = { ...
|
|
117
|
+
function ye(e, t = null, n = null) {
|
|
118
|
+
const r = { ...At };
|
|
119
119
|
if (n) {
|
|
120
120
|
for (const [i, s] of Object.entries(n))
|
|
121
121
|
if (i != null && s != null) {
|
|
122
|
-
const l =
|
|
123
|
-
r[l] =
|
|
122
|
+
const l = we(i), c = we(s);
|
|
123
|
+
r[l] = c;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
const o = {};
|
|
127
127
|
for (const [i, s] of Object.entries(e)) {
|
|
128
|
-
const l =
|
|
129
|
-
o[
|
|
128
|
+
const l = we(i), c = r[l] || l;
|
|
129
|
+
o[c] = s;
|
|
130
130
|
}
|
|
131
131
|
return o;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return e.map((r) =>
|
|
133
|
+
function Bo(e, t = null, n = null) {
|
|
134
|
+
return e.map((r) => ye(r, t, n));
|
|
135
135
|
}
|
|
136
|
-
const
|
|
136
|
+
const hn = /* @__PURE__ */ new Set([
|
|
137
137
|
"hole_id",
|
|
138
138
|
"holeid",
|
|
139
139
|
"id",
|
|
@@ -166,33 +166,33 @@ const fn = /* @__PURE__ */ new Set([
|
|
|
166
166
|
"comment",
|
|
167
167
|
"z"
|
|
168
168
|
]), Ke = "[baselode:data]";
|
|
169
|
-
function
|
|
169
|
+
function pn(e, t = "Unknown error") {
|
|
170
170
|
if (e instanceof Error) return e;
|
|
171
171
|
const n = typeof e == "string" && e.trim() ? e : t;
|
|
172
172
|
return new Error(n);
|
|
173
173
|
}
|
|
174
174
|
function Y(e, t, n = "Operation failed") {
|
|
175
|
-
const r =
|
|
175
|
+
const r = pn(t, n), o = new Error(`${e}: ${r.message}`);
|
|
176
176
|
return o.cause = r, o;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Ro(e, t) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
180
|
console.warn(`${Ke} ${e}`, t);
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
console.warn(`${Ke} ${e}`);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Vo(e) {
|
|
186
186
|
console.info(`${Ke} ${e}`);
|
|
187
187
|
}
|
|
188
|
-
const
|
|
189
|
-
function
|
|
190
|
-
return { holeId: e[
|
|
188
|
+
const He = (e, t = null) => ye(e, null, t);
|
|
189
|
+
function bn(e) {
|
|
190
|
+
return { holeId: e[x] };
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const n = e[
|
|
192
|
+
function It(e, t = null) {
|
|
193
|
+
const n = e[x], r = n !== void 0 ? `${n}`.trim() : "";
|
|
194
194
|
if (!r) return null;
|
|
195
|
-
const o = e[me] || e.project || e.project_code, i = Number(e[
|
|
195
|
+
const o = e[me] || e.project || e.project_code, i = Number(e[S]), s = Number(e[T]);
|
|
196
196
|
return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
|
|
197
197
|
holeId: r,
|
|
198
198
|
project: o,
|
|
@@ -201,22 +201,22 @@ function vt(e, t = null) {
|
|
|
201
201
|
...e
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Ot(e, t) {
|
|
205
205
|
var o;
|
|
206
206
|
const n = t.sort((i, s) => i.from - s.from), r = [];
|
|
207
207
|
return n.forEach((i) => {
|
|
208
|
-
const { from: s, to: l, project:
|
|
208
|
+
const { from: s, to: l, project: c, ...a } = i, u = {
|
|
209
209
|
z: s,
|
|
210
210
|
from: s,
|
|
211
211
|
to: l,
|
|
212
|
-
[
|
|
213
|
-
[me]:
|
|
212
|
+
[x]: e,
|
|
213
|
+
[me]: c,
|
|
214
214
|
...a
|
|
215
215
|
};
|
|
216
|
-
r.push(
|
|
216
|
+
r.push(u), r.push({ ...u, z: l });
|
|
217
217
|
}), { id: e, project: (o = n[0]) == null ? void 0 : o.project, points: r };
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function Ho(e, t = null) {
|
|
220
220
|
return new Promise((n, r) => {
|
|
221
221
|
const o = /* @__PURE__ */ new Set();
|
|
222
222
|
te.parse(e, {
|
|
@@ -224,7 +224,7 @@ function So(e, t = null) {
|
|
|
224
224
|
dynamicTyping: !0,
|
|
225
225
|
skipEmptyLines: !0,
|
|
226
226
|
step: (i) => {
|
|
227
|
-
const l =
|
|
227
|
+
const l = He(i.data, t)[x];
|
|
228
228
|
l !== void 0 && `${l}`.trim() !== "" && o.add(`${l}`.trim());
|
|
229
229
|
},
|
|
230
230
|
complete: () => n(Array.from(o)),
|
|
@@ -232,8 +232,8 @@ function So(e, t = null) {
|
|
|
232
232
|
});
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return Object.entries(e || {}).some(([t, n]) => !(
|
|
235
|
+
function yn(e) {
|
|
236
|
+
return Object.entries(e || {}).some(([t, n]) => !(hn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
|
|
237
237
|
}
|
|
238
238
|
function gn(e, t = null) {
|
|
239
239
|
return new Promise((n, r) => {
|
|
@@ -243,11 +243,11 @@ function gn(e, t = null) {
|
|
|
243
243
|
dynamicTyping: !0,
|
|
244
244
|
skipEmptyLines: !0,
|
|
245
245
|
step: (i) => {
|
|
246
|
-
const s =
|
|
247
|
-
if (!
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
const a = `${
|
|
246
|
+
const s = He(i.data, t);
|
|
247
|
+
if (!yn(s)) return;
|
|
248
|
+
const c = bn(s).holeId;
|
|
249
|
+
if (c !== void 0 && `${c}`.trim() !== "") {
|
|
250
|
+
const a = `${c}`.trim();
|
|
251
251
|
o.has(a) || o.set(a, {
|
|
252
252
|
holeId: a
|
|
253
253
|
});
|
|
@@ -258,7 +258,7 @@ function gn(e, t = null) {
|
|
|
258
258
|
});
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function _n(e, t, n = null, r = null) {
|
|
262
262
|
return new Promise((o, i) => {
|
|
263
263
|
const s = `${t}`.trim();
|
|
264
264
|
if (!s) {
|
|
@@ -270,23 +270,23 @@ function yn(e, t, n = null, r = null) {
|
|
|
270
270
|
header: !0,
|
|
271
271
|
dynamicTyping: !0,
|
|
272
272
|
skipEmptyLines: !0,
|
|
273
|
-
step: (
|
|
274
|
-
const a =
|
|
275
|
-
|
|
273
|
+
step: (c) => {
|
|
274
|
+
const a = He(c.data, r), u = It(a, r);
|
|
275
|
+
u && `${u.holeId}`.trim() === s && l.push(u);
|
|
276
276
|
},
|
|
277
277
|
complete: () => {
|
|
278
278
|
if (!l.length) {
|
|
279
279
|
o(null);
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
const
|
|
283
|
-
o(
|
|
282
|
+
const c = Ot(s, l);
|
|
283
|
+
o(c);
|
|
284
284
|
},
|
|
285
|
-
error: (
|
|
285
|
+
error: (c) => i(Y("parseAssayHole", c))
|
|
286
286
|
});
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function Nn(e, t = null, n = null) {
|
|
290
290
|
return new Promise((r, o) => {
|
|
291
291
|
te.parse(e, {
|
|
292
292
|
header: !0,
|
|
@@ -294,24 +294,24 @@ function _n(e, t = null, n = null) {
|
|
|
294
294
|
skipEmptyLines: !0,
|
|
295
295
|
complete: (i) => {
|
|
296
296
|
const s = /* @__PURE__ */ new Map();
|
|
297
|
-
i.data.forEach((
|
|
298
|
-
const a =
|
|
299
|
-
|
|
297
|
+
i.data.forEach((c) => {
|
|
298
|
+
const a = He(c, n), u = It(a, n);
|
|
299
|
+
u && (s.has(u.holeId) || s.set(u.holeId, []), s.get(u.holeId).push(u));
|
|
300
300
|
});
|
|
301
|
-
const l = Array.from(s.entries()).map(([
|
|
301
|
+
const l = Array.from(s.entries()).map(([c, a]) => Ot(c, a));
|
|
302
302
|
r({ holes: l });
|
|
303
303
|
},
|
|
304
304
|
error: (i) => o(Y("parseAssaysCSV", i))
|
|
305
305
|
});
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function jo(e = {}) {
|
|
309
309
|
const t = {};
|
|
310
310
|
return Object.entries(e || {}).forEach(([n, r]) => {
|
|
311
|
-
n && (t[
|
|
311
|
+
n && (t[we(n)] = r);
|
|
312
312
|
}), t;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Go(e = {}, t = [], n) {
|
|
315
315
|
for (const r of t) {
|
|
316
316
|
const o = e[r];
|
|
317
317
|
if (o != null && `${o}`.trim() !== "")
|
|
@@ -319,7 +319,7 @@ function Oo(e = {}, t = [], n) {
|
|
|
319
319
|
}
|
|
320
320
|
return n;
|
|
321
321
|
}
|
|
322
|
-
const
|
|
322
|
+
const Mn = 4;
|
|
323
323
|
function Ct(e = [], t = "") {
|
|
324
324
|
if (!e.length) return [];
|
|
325
325
|
if (!t) return e;
|
|
@@ -328,7 +328,7 @@ function Ct(e = [], t = "") {
|
|
|
328
328
|
const r = e[n], o = e.filter((i, s) => s !== n);
|
|
329
329
|
return [r, ...o];
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function Te({
|
|
332
332
|
property: e = "",
|
|
333
333
|
chartType: t = "",
|
|
334
334
|
categoricalProps: n = [],
|
|
@@ -340,15 +340,15 @@ function we({
|
|
|
340
340
|
function Dt({
|
|
341
341
|
holeIds: e = [],
|
|
342
342
|
focusedHoleId: t = "",
|
|
343
|
-
plotCount: n =
|
|
343
|
+
plotCount: n = Mn,
|
|
344
344
|
defaultProp: r = "",
|
|
345
345
|
categoricalProps: o = [],
|
|
346
346
|
commentProps: i = [],
|
|
347
347
|
numericDefaultChartType: s = "markers+line"
|
|
348
348
|
} = {}) {
|
|
349
349
|
const l = Ct(e, t);
|
|
350
|
-
return Array.from({ length: n }).map((
|
|
351
|
-
const
|
|
350
|
+
return Array.from({ length: n }).map((c, a) => {
|
|
351
|
+
const u = l[a] || e[a] || "", m = Te({
|
|
352
352
|
property: r,
|
|
353
353
|
chartType: "",
|
|
354
354
|
categoricalProps: o,
|
|
@@ -356,30 +356,30 @@ function Dt({
|
|
|
356
356
|
numericDefaultChartType: s
|
|
357
357
|
});
|
|
358
358
|
return {
|
|
359
|
-
holeId:
|
|
359
|
+
holeId: u,
|
|
360
360
|
property: r,
|
|
361
361
|
chartType: m
|
|
362
362
|
};
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
const
|
|
366
|
-
[
|
|
365
|
+
const Ae = "numeric", Le = "categorical", ke = "comment", $e = "hidden", Je = "tadpole", at = {
|
|
366
|
+
[Ae]: [
|
|
367
367
|
{ value: "bar", label: "Bars" },
|
|
368
368
|
{ value: "markers", label: "Markers" },
|
|
369
369
|
{ value: "markers+line", label: "Markers + Line" },
|
|
370
370
|
{ value: "line", label: "Line only" }
|
|
371
371
|
],
|
|
372
|
-
[
|
|
372
|
+
[Le]: [
|
|
373
373
|
{ value: "categorical", label: "Categorical bands" }
|
|
374
374
|
],
|
|
375
|
-
[
|
|
375
|
+
[ke]: [
|
|
376
376
|
{ value: "comment", label: "Comments" }
|
|
377
377
|
],
|
|
378
378
|
[Je]: [
|
|
379
379
|
{ value: "tadpole", label: "Tadpole" }
|
|
380
380
|
],
|
|
381
381
|
[$e]: []
|
|
382
|
-
},
|
|
382
|
+
}, ct = /* @__PURE__ */ new Set([
|
|
383
383
|
// Hole identifiers
|
|
384
384
|
"hole_id",
|
|
385
385
|
"holeid",
|
|
@@ -434,7 +434,7 @@ const ve = "numeric", Oe = "categorical", xe = "comment", $e = "hidden", Je = "t
|
|
|
434
434
|
"data_source",
|
|
435
435
|
"_hole_key",
|
|
436
436
|
"_hole_id_key"
|
|
437
|
-
]),
|
|
437
|
+
]), zn = /* @__PURE__ */ new Set([
|
|
438
438
|
"comments",
|
|
439
439
|
"comment",
|
|
440
440
|
"notes",
|
|
@@ -447,50 +447,50 @@ const ve = "numeric", Oe = "categorical", xe = "comment", $e = "hidden", Je = "t
|
|
|
447
447
|
"structcomment",
|
|
448
448
|
"geology_description"
|
|
449
449
|
]);
|
|
450
|
-
function
|
|
450
|
+
function vn(e) {
|
|
451
451
|
if (!(e != null && e.length))
|
|
452
452
|
return { byType: {}, numericCols: [], categoricalCols: [], commentCols: [] };
|
|
453
453
|
const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
|
|
454
454
|
for (const r of t) {
|
|
455
455
|
const o = r.toLowerCase().trim();
|
|
456
|
-
if (
|
|
456
|
+
if (ct.has(o) || ct.has(r)) {
|
|
457
457
|
n[r] = $e;
|
|
458
458
|
continue;
|
|
459
459
|
}
|
|
460
|
-
if (
|
|
461
|
-
const l = e.some((
|
|
462
|
-
const a =
|
|
460
|
+
if (zn.has(o)) {
|
|
461
|
+
const l = e.some((c) => {
|
|
462
|
+
const a = c[r];
|
|
463
463
|
return a != null && String(a).trim() !== "" && String(a) !== "null";
|
|
464
464
|
});
|
|
465
|
-
n[r] = l ?
|
|
465
|
+
n[r] = l ? ke : $e;
|
|
466
466
|
continue;
|
|
467
467
|
}
|
|
468
468
|
let i = !1, s = !1;
|
|
469
469
|
for (const l of e) {
|
|
470
|
-
const
|
|
471
|
-
if (!(
|
|
470
|
+
const c = l[r];
|
|
471
|
+
if (!(c == null || typeof c == "string" && c.trim() === "") && (s = !0, typeof c == "number" && Number.isFinite(c))) {
|
|
472
472
|
i = !0;
|
|
473
473
|
break;
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
s ? i ? n[r] =
|
|
476
|
+
s ? i ? n[r] = Ae : n[r] = Le : n[r] = $e;
|
|
477
477
|
}
|
|
478
478
|
return {
|
|
479
479
|
byType: n,
|
|
480
|
-
numericCols: Object.entries(n).filter(([, r]) => r ===
|
|
481
|
-
categoricalCols: Object.entries(n).filter(([, r]) => r ===
|
|
482
|
-
commentCols: Object.entries(n).filter(([, r]) => r ===
|
|
480
|
+
numericCols: Object.entries(n).filter(([, r]) => r === Ae).map(([r]) => r),
|
|
481
|
+
categoricalCols: Object.entries(n).filter(([, r]) => r === Le).map(([r]) => r),
|
|
482
|
+
commentCols: Object.entries(n).filter(([, r]) => r === ke).map(([r]) => r)
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
485
|
function et(e) {
|
|
486
|
-
return
|
|
486
|
+
return at[e] ?? at[Ae];
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Uo(e) {
|
|
489
489
|
const t = et(e);
|
|
490
|
-
return t.length ? e ===
|
|
490
|
+
return t.length ? e === Ae ? "line" : t[0].value : "markers+line";
|
|
491
491
|
}
|
|
492
492
|
function Be(e = []) {
|
|
493
|
-
const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } =
|
|
493
|
+
const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = vn(t), s = n[0] || r[0] || "";
|
|
494
494
|
return {
|
|
495
495
|
numericProps: n,
|
|
496
496
|
categoricalProps: r,
|
|
@@ -502,12 +502,12 @@ function Be(e = []) {
|
|
|
502
502
|
async function En(e, t = null) {
|
|
503
503
|
return await gn(e);
|
|
504
504
|
}
|
|
505
|
-
async function
|
|
506
|
-
return await
|
|
505
|
+
async function xn(e, t, n = null) {
|
|
506
|
+
return await _n(e, t);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function kn(e = [], t = "") {
|
|
509
509
|
if (!e.length) return null;
|
|
510
|
-
const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Be(e), l = e.map((a) => a.id || a.holeId).filter(Boolean),
|
|
510
|
+
const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Be(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = Dt({
|
|
511
511
|
holeIds: l,
|
|
512
512
|
focusedHoleId: t,
|
|
513
513
|
plotCount: 4,
|
|
@@ -523,40 +523,40 @@ function An(e = [], t = "") {
|
|
|
523
523
|
commentProps: o,
|
|
524
524
|
columnMeta: i,
|
|
525
525
|
defaultProp: s,
|
|
526
|
-
traceConfigs:
|
|
526
|
+
traceConfigs: c
|
|
527
527
|
};
|
|
528
528
|
}
|
|
529
|
-
async function
|
|
530
|
-
const { holes: r } = await
|
|
529
|
+
async function Yo(e, t = "", n = null) {
|
|
530
|
+
const { holes: r } = await Nn(e, n), o = kn(r, t);
|
|
531
531
|
if (!o) throw new Error("No valid assay intervals found.");
|
|
532
532
|
return o;
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Xo(e, t = null) {
|
|
535
535
|
return new Promise((n, r) => {
|
|
536
536
|
te.parse(e, {
|
|
537
537
|
header: !0,
|
|
538
538
|
dynamicTyping: !0,
|
|
539
539
|
skipEmptyLines: !0,
|
|
540
540
|
complete: (o) => {
|
|
541
|
-
const i = o.data.map((s) =>
|
|
541
|
+
const i = o.data.map((s) => An(s, t)).filter((s) => s[x] && Number.isFinite(s[W]) && Number.isFinite(s[q]) && Number.isFinite(s[X]));
|
|
542
542
|
n(i);
|
|
543
543
|
},
|
|
544
544
|
error: (o) => r(Y("parseSurveyCSV", o))
|
|
545
545
|
});
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
const n =
|
|
548
|
+
function An(e, t = null) {
|
|
549
|
+
const n = ye(e, null, t), r = n[x], o = n[me] || n.project || n.project_code, i = ve(n[oe]), s = ve(n[ie]), l = ve(n[W]), c = ve(n[q]), a = ve(n[X]), u = ve(n.maxdepth);
|
|
550
550
|
return {
|
|
551
551
|
raw: n,
|
|
552
|
-
[
|
|
552
|
+
[x]: r,
|
|
553
553
|
[me]: o,
|
|
554
554
|
[oe]: i,
|
|
555
555
|
[ie]: s,
|
|
556
556
|
[W]: l,
|
|
557
|
-
[
|
|
558
|
-
[
|
|
559
|
-
maxdepth:
|
|
557
|
+
[q]: c,
|
|
558
|
+
[X]: a,
|
|
559
|
+
maxdepth: u,
|
|
560
560
|
// Legacy field names for backwards compatibility
|
|
561
561
|
project_code: o,
|
|
562
562
|
latitude: i,
|
|
@@ -564,76 +564,76 @@ function xn(e, t = null) {
|
|
|
564
564
|
surveydepth: l
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
const
|
|
567
|
+
const ve = (e) => {
|
|
568
568
|
const t = Number(e);
|
|
569
569
|
return Number.isFinite(t) ? t : void 0;
|
|
570
570
|
};
|
|
571
|
-
function
|
|
572
|
-
var a,
|
|
571
|
+
function qo(e, t) {
|
|
572
|
+
var a, u, m, d;
|
|
573
573
|
const n = /* @__PURE__ */ new Map();
|
|
574
574
|
e.forEach((f) => {
|
|
575
|
-
const h = (f[
|
|
575
|
+
const h = (f[x] || f.holeId || f.id || "").toString().trim();
|
|
576
576
|
if (!h) return;
|
|
577
577
|
const b = h.toLowerCase();
|
|
578
578
|
n.has(b) || n.set(b, f);
|
|
579
579
|
});
|
|
580
|
-
const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((
|
|
580
|
+
const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((u = e[0]) == null ? void 0 : u[oe]) ?? 0, o = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[ie]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), l = /* @__PURE__ */ new Map();
|
|
581
581
|
t.forEach((f) => {
|
|
582
|
-
const h = (f[
|
|
582
|
+
const h = (f[x] || "").toString().trim();
|
|
583
583
|
if (!h) return;
|
|
584
584
|
const b = h.toLowerCase();
|
|
585
585
|
l.has(b) || l.set(b, []), l.get(b).push(f);
|
|
586
586
|
});
|
|
587
|
-
const
|
|
587
|
+
const c = [];
|
|
588
588
|
return l.forEach((f, h) => {
|
|
589
589
|
const b = n.get(h);
|
|
590
590
|
if (!b) return;
|
|
591
|
-
const
|
|
592
|
-
if (!
|
|
593
|
-
const p = b.lat ?? b[oe],
|
|
594
|
-
let $ = 0, P = 0,
|
|
595
|
-
for (let C = 0; C <
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
598
|
-
|
|
599
|
-
x:
|
|
600
|
-
y:
|
|
591
|
+
const _ = f.filter((C) => Number.isFinite(C[W] ?? C.surveydepth)).sort((C, V) => (C[W] ?? C.surveydepth) - (V[W] ?? V.surveydepth));
|
|
592
|
+
if (!_.length) return;
|
|
593
|
+
const p = b.lat ?? b[oe], y = b.lng ?? b[ie], M = 111132, z = 111320 * Math.cos(p * Math.PI / 180), O = (y - o) * s, k = (p - r) * i, L = [];
|
|
594
|
+
let $ = 0, P = 0, v = 0;
|
|
595
|
+
for (let C = 0; C < _.length; C += 1) {
|
|
596
|
+
const V = _[C], H = _[C - 1], A = V[W] ?? V.surveydepth, E = V[X] ?? V.azimuth, N = V[q] ?? V.dip;
|
|
597
|
+
if (!H) {
|
|
598
|
+
L.push({
|
|
599
|
+
x: O + $,
|
|
600
|
+
y: k + P,
|
|
601
601
|
z: 0,
|
|
602
|
-
md:
|
|
603
|
-
azimuth:
|
|
602
|
+
md: A,
|
|
603
|
+
azimuth: E,
|
|
604
604
|
dip: N
|
|
605
605
|
});
|
|
606
606
|
continue;
|
|
607
607
|
}
|
|
608
|
-
const B =
|
|
608
|
+
const B = H[W] ?? H.surveydepth, I = H[X] ?? H.azimuth, G = H[q] ?? H.dip, U = A - B;
|
|
609
609
|
if (U <= 0) continue;
|
|
610
|
-
const j =
|
|
610
|
+
const j = ut(G), Z = ut(N), K = Qe(I), le = Qe(E), ge = Math.acos(
|
|
611
611
|
Math.sin(j) * Math.sin(Z) * Math.cos(K - le) + Math.cos(j) * Math.cos(Z)
|
|
612
|
-
), fe =
|
|
613
|
-
$ +=
|
|
614
|
-
x:
|
|
615
|
-
y:
|
|
616
|
-
z: -
|
|
612
|
+
), fe = ge > 1e-6 ? 2 / ge * Math.tan(ge / 2) : 1, Ce = 0.5 * U * (Math.sin(j) * Math.cos(K) + Math.sin(Z) * Math.cos(le)) * fe, he = 0.5 * U * (Math.sin(j) * Math.sin(K) + Math.sin(Z) * Math.sin(le)) * fe, Ge = 0.5 * U * (Math.cos(j) + Math.cos(Z)) * fe;
|
|
613
|
+
$ += Ce, P += he, v += Ge, L.push({
|
|
614
|
+
x: O + $,
|
|
615
|
+
y: k + P,
|
|
616
|
+
z: -v,
|
|
617
617
|
// render with z up; depth down
|
|
618
|
-
md:
|
|
619
|
-
azimuth:
|
|
618
|
+
md: A,
|
|
619
|
+
azimuth: E,
|
|
620
620
|
dip: N
|
|
621
621
|
});
|
|
622
622
|
}
|
|
623
|
-
const F =
|
|
623
|
+
const F = L.map((C) => ({
|
|
624
624
|
...C,
|
|
625
625
|
lat: p + C.y / M,
|
|
626
|
-
lng:
|
|
626
|
+
lng: y + C.x / z
|
|
627
627
|
}));
|
|
628
|
-
|
|
629
|
-
id: b[
|
|
628
|
+
c.push({
|
|
629
|
+
id: b[x] || b.holeId || h,
|
|
630
630
|
project: b[me] || b.project_id || b.project || "",
|
|
631
631
|
points: F,
|
|
632
632
|
collar: b
|
|
633
633
|
});
|
|
634
|
-
}),
|
|
634
|
+
}), c;
|
|
635
635
|
}
|
|
636
|
-
const Qe = (e) => e * Math.PI / 180,
|
|
636
|
+
const Qe = (e) => e * Math.PI / 180, ut = (e) => {
|
|
637
637
|
const t = Number(e), n = 90 + (Number.isFinite(t) ? t : 0), r = Math.min(180, Math.max(0, n));
|
|
638
638
|
return Qe(r);
|
|
639
639
|
};
|
|
@@ -641,29 +641,29 @@ function re(e, t = void 0) {
|
|
|
641
641
|
const n = Number(e);
|
|
642
642
|
return Number.isFinite(n) ? n : t;
|
|
643
643
|
}
|
|
644
|
-
function
|
|
644
|
+
function dt(e) {
|
|
645
645
|
return e == null ? "" : `${e}`.trim();
|
|
646
646
|
}
|
|
647
|
-
function
|
|
648
|
-
const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) =>
|
|
647
|
+
function Ve(e = [], t = null) {
|
|
648
|
+
const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => dt(s == null ? void 0 : s[i])));
|
|
649
649
|
if (!o)
|
|
650
650
|
throw Y("canonicalizeHoleIdRows", new Error(`hole id column '${n}' not found`));
|
|
651
651
|
return {
|
|
652
652
|
aliasCol: o,
|
|
653
653
|
rows: e.map((i) => ({
|
|
654
654
|
...i,
|
|
655
|
-
hole_id:
|
|
655
|
+
hole_id: dt(i == null ? void 0 : i[o])
|
|
656
656
|
}))
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function mt(e) {
|
|
660
660
|
return Number(e) * Math.PI / 180;
|
|
661
661
|
}
|
|
662
662
|
function Ye(e, t) {
|
|
663
|
-
const n =
|
|
663
|
+
const n = mt(e), r = mt(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
|
|
664
664
|
return { ca: o, cb: i, cc: s };
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function In(e, t, n, r, o, i = "minimum_curvature") {
|
|
667
667
|
const s = Ye(t, n), l = Ye(r, o);
|
|
668
668
|
if (i === "tangential")
|
|
669
669
|
return {
|
|
@@ -683,11 +683,11 @@ function vn(e, t, n, r, o, i = "minimum_curvature") {
|
|
|
683
683
|
dip: d
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
const
|
|
686
|
+
const c = s.ca * l.ca + s.cb * l.cb + s.cc * l.cc, a = Math.acos(Math.max(-1, Math.min(1, c))), u = a > 1e-6 ? 2 * Math.tan(a / 2) / a : 1;
|
|
687
687
|
return {
|
|
688
|
-
dx: 0.5 * e * (s.ca + l.ca) *
|
|
689
|
-
dy: 0.5 * e * (s.cb + l.cb) *
|
|
690
|
-
dz: 0.5 * e * (s.cc + l.cc) *
|
|
688
|
+
dx: 0.5 * e * (s.ca + l.ca) * u,
|
|
689
|
+
dy: 0.5 * e * (s.cb + l.cb) * u,
|
|
690
|
+
dz: 0.5 * e * (s.cc + l.cc) * u,
|
|
691
691
|
azimuth: r,
|
|
692
692
|
dip: o
|
|
693
693
|
};
|
|
@@ -697,52 +697,52 @@ function tt(e = [], t = [], n = {}) {
|
|
|
697
697
|
step: r = 1,
|
|
698
698
|
holeIdCol: o = null,
|
|
699
699
|
method: i = "minimum_curvature"
|
|
700
|
-
} = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l =
|
|
701
|
-
if (!l.rows.length || !
|
|
700
|
+
} = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l = Ve(e, o), c = Ve(t, o || l.aliasCol);
|
|
701
|
+
if (!l.rows.length || !c.rows.length) return [];
|
|
702
702
|
const a = /* @__PURE__ */ new Map();
|
|
703
703
|
l.rows.forEach((d) => {
|
|
704
704
|
!d.hole_id || a.has(d.hole_id) || a.set(d.hole_id, d);
|
|
705
705
|
});
|
|
706
|
-
const
|
|
707
|
-
|
|
708
|
-
d.hole_id && (
|
|
706
|
+
const u = /* @__PURE__ */ new Map();
|
|
707
|
+
c.rows.forEach((d) => {
|
|
708
|
+
d.hole_id && (u.has(d.hole_id) || u.set(d.hole_id, []), u.get(d.hole_id).push(d));
|
|
709
709
|
});
|
|
710
710
|
const m = [];
|
|
711
|
-
return
|
|
711
|
+
return u.forEach((d, f) => {
|
|
712
712
|
const h = a.get(f);
|
|
713
713
|
if (!h) return;
|
|
714
|
-
const b = [...d].map((
|
|
715
|
-
...
|
|
716
|
-
from: re(
|
|
717
|
-
azimuth: re(
|
|
718
|
-
dip: re(
|
|
719
|
-
})).filter((
|
|
714
|
+
const b = [...d].map((L) => ({
|
|
715
|
+
...L,
|
|
716
|
+
from: re(L.from),
|
|
717
|
+
azimuth: re(L.azimuth),
|
|
718
|
+
dip: re(L.dip)
|
|
719
|
+
})).filter((L) => Number.isFinite(L.from) && Number.isFinite(L.azimuth) && Number.isFinite(L.dip)).sort((L, $) => L.from - $.from);
|
|
720
720
|
if (!b.length) return;
|
|
721
|
-
let
|
|
722
|
-
const z = b[0].azimuth,
|
|
721
|
+
let _ = re(h.x, 0), p = re(h.y, 0), y = re(h.z, 0), M = b[0].from;
|
|
722
|
+
const z = b[0].azimuth, O = b[0].dip, k = {
|
|
723
723
|
hole_id: f,
|
|
724
724
|
md: M,
|
|
725
|
-
x:
|
|
725
|
+
x: _,
|
|
726
726
|
y: p,
|
|
727
|
-
z:
|
|
727
|
+
z: y,
|
|
728
728
|
azimuth: z,
|
|
729
|
-
dip:
|
|
729
|
+
dip: O
|
|
730
730
|
};
|
|
731
|
-
l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (
|
|
732
|
-
for (let
|
|
733
|
-
const $ = b[
|
|
731
|
+
l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (k[l.aliasCol] = h[l.aliasCol]), m.push(k);
|
|
732
|
+
for (let L = 0; L < b.length - 1; L += 1) {
|
|
733
|
+
const $ = b[L], P = b[L + 1], v = $.from, C = P.from - v;
|
|
734
734
|
if (C <= 0) continue;
|
|
735
|
-
const
|
|
736
|
-
for (let
|
|
737
|
-
M +=
|
|
738
|
-
const
|
|
739
|
-
|
|
735
|
+
const V = Math.max(1, Math.ceil(C / s)), H = C / V;
|
|
736
|
+
for (let A = 0; A < V; A += 1) {
|
|
737
|
+
M += H;
|
|
738
|
+
const E = (M - v) / C, N = $.azimuth + E * (P.azimuth - $.azimuth), B = $.dip + E * (P.dip - $.dip), I = In(H, $.azimuth, $.dip, P.azimuth, P.dip, i);
|
|
739
|
+
_ += I.dx, p += I.dy, y += I.dz;
|
|
740
740
|
const G = {
|
|
741
741
|
hole_id: f,
|
|
742
742
|
md: M,
|
|
743
|
-
x:
|
|
743
|
+
x: _,
|
|
744
744
|
y: p,
|
|
745
|
-
z:
|
|
745
|
+
z: y,
|
|
746
746
|
azimuth: i === "minimum_curvature" ? N : I.azimuth,
|
|
747
747
|
dip: i === "minimum_curvature" ? B : I.dip
|
|
748
748
|
};
|
|
@@ -751,17 +751,17 @@ function tt(e = [], t = [], n = {}) {
|
|
|
751
751
|
}
|
|
752
752
|
}), m;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function On(e, t, n = {}) {
|
|
755
755
|
return tt(e, t, { ...n, method: "minimum_curvature" });
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Zo(e, t, n = {}) {
|
|
758
758
|
return tt(e, t, { ...n, method: "tangential" });
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function Wo(e, t, n = {}) {
|
|
761
761
|
return tt(e, t, { ...n, method: "balanced_tangential" });
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
return
|
|
763
|
+
function Ko(e, t, n = {}) {
|
|
764
|
+
return On(e, t, n);
|
|
765
765
|
}
|
|
766
766
|
function Cn(e, t) {
|
|
767
767
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
@@ -774,18 +774,18 @@ function Cn(e, t) {
|
|
|
774
774
|
}
|
|
775
775
|
return n;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
778
|
-
const r = n.holeIdCol || "hole_id", o =
|
|
777
|
+
function Jo(e = [], t = [], n = {}) {
|
|
778
|
+
const r = n.holeIdCol || "hole_id", o = Ve(e, r), i = Ve(t, r);
|
|
779
779
|
if (!o.rows.length || !i.rows.length) return [...o.rows];
|
|
780
780
|
const s = /* @__PURE__ */ new Map();
|
|
781
781
|
return i.rows.forEach((l) => {
|
|
782
782
|
l.hole_id && (s.has(l.hole_id) || s.set(l.hole_id, []), s.get(l.hole_id).push(l));
|
|
783
|
-
}), s.forEach((l,
|
|
784
|
-
s.set(
|
|
783
|
+
}), s.forEach((l, c) => {
|
|
784
|
+
s.set(c, [...l].sort((a, u) => re(a.md, 0) - re(u.md, 0)));
|
|
785
785
|
}), o.rows.map((l) => {
|
|
786
|
-
const
|
|
787
|
-
if (!l.hole_id || !Number.isFinite(
|
|
788
|
-
const m = Cn(s.get(l.hole_id) || [],
|
|
786
|
+
const c = re(l.from), a = re(l.to), u = Number.isFinite(c) && Number.isFinite(a) ? 0.5 * (c + a) : void 0;
|
|
787
|
+
if (!l.hole_id || !Number.isFinite(u)) return { ...l };
|
|
788
|
+
const m = Cn(s.get(l.hole_id) || [], u);
|
|
789
789
|
if (!m) return { ...l };
|
|
790
790
|
const d = { ...l };
|
|
791
791
|
return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
|
|
@@ -793,7 +793,7 @@ function Ho(e = [], t = [], n = {}) {
|
|
|
793
793
|
}), d;
|
|
794
794
|
});
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function Qo(e, t = null) {
|
|
797
797
|
return new Promise((n, r) => {
|
|
798
798
|
te.parse(e, {
|
|
799
799
|
header: !0,
|
|
@@ -801,8 +801,8 @@ function Ro(e, t = null) {
|
|
|
801
801
|
skipEmptyLines: !0,
|
|
802
802
|
complete: (o) => {
|
|
803
803
|
const i = /* @__PURE__ */ new Map();
|
|
804
|
-
o.data.forEach((l,
|
|
805
|
-
const a =
|
|
804
|
+
o.data.forEach((l, c) => {
|
|
805
|
+
const a = ye(l, null, t), u = a[x], m = u !== void 0 ? `${u}`.trim() : "", d = a[pe] ?? a.x, f = a[be] ?? a.y, h = a[xe] ?? a.z, b = a.order ?? c;
|
|
806
806
|
!m || d === null || d === void 0 || f === null || f === void 0 || h === null || h === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
|
|
807
807
|
...a,
|
|
808
808
|
holeId: m,
|
|
@@ -812,9 +812,9 @@ function Ro(e, t = null) {
|
|
|
812
812
|
z: Number(h) ?? 0
|
|
813
813
|
}));
|
|
814
814
|
});
|
|
815
|
-
const s = Array.from(i.entries()).map(([l,
|
|
815
|
+
const s = Array.from(i.entries()).map(([l, c]) => ({
|
|
816
816
|
id: l,
|
|
817
|
-
points:
|
|
817
|
+
points: c.sort((a, u) => a.order - u.order).map((a) => ({
|
|
818
818
|
...a,
|
|
819
819
|
x: Number(a.x) || 0,
|
|
820
820
|
y: Number(a.y) || 0,
|
|
@@ -827,7 +827,7 @@ function Ro(e, t = null) {
|
|
|
827
827
|
});
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function Ee(e) {
|
|
831
831
|
return e ? Array.isArray(e) ? [...e] : [] : [];
|
|
832
832
|
}
|
|
833
833
|
function ee(e) {
|
|
@@ -838,24 +838,24 @@ function Pe(e = [], t = []) {
|
|
|
838
838
|
const n = [...e];
|
|
839
839
|
return n.sort((r, o) => {
|
|
840
840
|
for (let i = 0; i < t.length; i += 1) {
|
|
841
|
-
const s = t[i], l = r == null ? void 0 : r[s],
|
|
842
|
-
if (l !==
|
|
843
|
-
return l == null ? 1 :
|
|
841
|
+
const s = t[i], l = r == null ? void 0 : r[s], c = o == null ? void 0 : o[s];
|
|
842
|
+
if (l !== c)
|
|
843
|
+
return l == null ? 1 : c == null ? -1 : typeof l == "number" && typeof c == "number" ? l - c : `${l}`.localeCompare(`${c}`);
|
|
844
844
|
}
|
|
845
845
|
return 0;
|
|
846
846
|
}), n;
|
|
847
847
|
}
|
|
848
848
|
function Dn(e = [], t = "Intervals") {
|
|
849
849
|
if (!e.length) return;
|
|
850
|
-
const n = Pe(e, [
|
|
850
|
+
const n = Pe(e, [x, S, T]), r = /* @__PURE__ */ new Map();
|
|
851
851
|
n.forEach((o) => {
|
|
852
|
-
const i = `${(o == null ? void 0 : o[
|
|
852
|
+
const i = `${(o == null ? void 0 : o[x]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[S]), l = Number(o == null ? void 0 : o[T]);
|
|
853
853
|
if (!i || !Number.isFinite(s) || !Number.isFinite(l)) return;
|
|
854
|
-
const
|
|
855
|
-
if (Number.isFinite(
|
|
854
|
+
const c = r.get(i);
|
|
855
|
+
if (Number.isFinite(c) && s < c)
|
|
856
856
|
throw Y(
|
|
857
857
|
"validateNoOverlappingIntervals",
|
|
858
|
-
new Error(`${t} intervals overlap for hole '${i}': from=${s} is less than previous to=${
|
|
858
|
+
new Error(`${t} intervals overlap for hole '${i}': from=${s} is less than previous to=${c}`)
|
|
859
859
|
);
|
|
860
860
|
r.set(i, l);
|
|
861
861
|
});
|
|
@@ -873,7 +873,7 @@ function Sn(e, t = {}) {
|
|
|
873
873
|
});
|
|
874
874
|
}
|
|
875
875
|
function Ln(e = [], t = null, n = null) {
|
|
876
|
-
return e.map((r) =>
|
|
876
|
+
return e.map((r) => ye(r, t, n));
|
|
877
877
|
}
|
|
878
878
|
async function je(e, t = {}) {
|
|
879
879
|
const {
|
|
@@ -884,115 +884,115 @@ async function je(e, t = {}) {
|
|
|
884
884
|
} = t;
|
|
885
885
|
let s;
|
|
886
886
|
if (Array.isArray(e))
|
|
887
|
-
s =
|
|
887
|
+
s = Ee(e);
|
|
888
888
|
else if (n === "csv")
|
|
889
889
|
s = await Sn(e, i);
|
|
890
890
|
else throw n === "parquet" || n === "sql" ? Y("loadTable", new Error(`Unsupported kind in JS runtime: ${n}`)) : Y("loadTable", new Error(`Unsupported kind: ${n}`));
|
|
891
891
|
return Ln(s, r, o);
|
|
892
892
|
}
|
|
893
|
-
async function
|
|
893
|
+
async function ei(e, t = {}) {
|
|
894
894
|
const {
|
|
895
895
|
crs: n = null,
|
|
896
896
|
sourceColumnMap: r = null,
|
|
897
897
|
keepAll: o = !0,
|
|
898
898
|
...i
|
|
899
899
|
} = t, s = await je(e, { ...i, sourceColumnMap: r });
|
|
900
|
-
if (!s.some((d) =>
|
|
901
|
-
throw Y("loadCollars", new Error(`Collar table missing column: ${
|
|
902
|
-
const
|
|
903
|
-
if (!
|
|
900
|
+
if (!s.some((d) => x in d))
|
|
901
|
+
throw Y("loadCollars", new Error(`Collar table missing column: ${x}`));
|
|
902
|
+
const c = s.some((d) => pe in d && be in d), a = s.some((d) => oe in d && ie in d);
|
|
903
|
+
if (!c && !a)
|
|
904
904
|
throw Y("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
|
|
905
|
-
const
|
|
905
|
+
const u = s.map((d) => {
|
|
906
906
|
const f = { ...d };
|
|
907
|
-
if (
|
|
908
|
-
const h = f[
|
|
909
|
-
f[
|
|
907
|
+
if (x in f) {
|
|
908
|
+
const h = f[x];
|
|
909
|
+
f[x] = h == null ? "" : `${h}`.trim();
|
|
910
910
|
}
|
|
911
|
-
return oe in f && (f[oe] = ee(f[oe])), ie in f && (f[ie] = ee(f[ie])),
|
|
911
|
+
return oe in f && (f[oe] = ee(f[oe])), ie in f && (f[ie] = ee(f[ie])), xe in f && (f[xe] = ee(f[xe])), pe in f && (f[pe] = ee(f[pe])), be in f && (f[be] = ee(f[be])), !("datasource_hole_id" in f) && x in f && (f.datasource_hole_id = f[x]), f;
|
|
912
912
|
});
|
|
913
|
-
if (!
|
|
913
|
+
if (!u.every((d) => !(!d[x] || a && (!Number.isFinite(d[oe]) || !Number.isFinite(d[ie])) || c && !a && (!Number.isFinite(d[pe]) || !Number.isFinite(d[be])))))
|
|
914
914
|
throw Y("loadCollars", new Error("Collar table has missing required values"));
|
|
915
|
-
return
|
|
915
|
+
return u;
|
|
916
916
|
}
|
|
917
|
-
async function
|
|
917
|
+
async function ti(e, t = {}) {
|
|
918
918
|
const {
|
|
919
919
|
sourceColumnMap: n = null,
|
|
920
920
|
keepAll: r = !0,
|
|
921
921
|
...o
|
|
922
|
-
} = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [
|
|
922
|
+
} = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [x, W, X, q];
|
|
923
923
|
for (const a of s)
|
|
924
924
|
if (!i.some((m) => a in m))
|
|
925
925
|
throw Y("loadSurveys", new Error(`Survey table missing column: ${a}`));
|
|
926
926
|
const l = i.map((a) => {
|
|
927
|
-
const
|
|
928
|
-
if (
|
|
929
|
-
const m =
|
|
930
|
-
|
|
927
|
+
const u = { ...a };
|
|
928
|
+
if (x in u) {
|
|
929
|
+
const m = u[x];
|
|
930
|
+
u[x] = m == null ? "" : `${m}`.trim();
|
|
931
931
|
}
|
|
932
|
-
return W in
|
|
932
|
+
return W in u && (u[W] = ee(u[W])), T in u && (u[T] = ee(u[T])), X in u && (u[X] = ee(u[X])), q in u && (u[q] = ee(u[q])), u;
|
|
933
933
|
});
|
|
934
|
-
if (!l.every((a) => !(!a[
|
|
934
|
+
if (!l.every((a) => !(!a[x] || !Number.isFinite(a[W]) || !Number.isFinite(a[X]) || !Number.isFinite(a[q]))))
|
|
935
935
|
throw Y("loadSurveys", new Error("Survey table has missing required values"));
|
|
936
|
-
return Pe(l, [
|
|
936
|
+
return Pe(l, [x, W]);
|
|
937
937
|
}
|
|
938
|
-
async function
|
|
938
|
+
async function ni(e, t = {}) {
|
|
939
939
|
const {
|
|
940
940
|
sourceColumnMap: n = null,
|
|
941
941
|
keepAll: r = !0,
|
|
942
942
|
...o
|
|
943
|
-
} = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [
|
|
943
|
+
} = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [x, S, T];
|
|
944
944
|
for (const a of s)
|
|
945
945
|
if (!i.some((m) => a in m))
|
|
946
946
|
throw Y("loadAssays", new Error(`Assay table missing column: ${a}`));
|
|
947
947
|
const l = i.map((a) => {
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
const m =
|
|
951
|
-
|
|
948
|
+
const u = { ...a };
|
|
949
|
+
if (x in u) {
|
|
950
|
+
const m = u[x];
|
|
951
|
+
u[x] = m == null ? "" : `${m}`.trim();
|
|
952
952
|
}
|
|
953
|
-
return
|
|
953
|
+
return S in u && (u[S] = ee(u[S])), T in u && (u[T] = ee(u[T])), S in u && T in u && Number.isFinite(u[S]) && Number.isFinite(u[T]) && (u[Ie] = 0.5 * (u[S] + u[T])), u;
|
|
954
954
|
});
|
|
955
|
-
if (!l.every((a) => !(!a[
|
|
955
|
+
if (!l.every((a) => !(!a[x] || !Number.isFinite(a[S]) || !Number.isFinite(a[T]) || !(a[T] > a[S]))))
|
|
956
956
|
throw Y("loadAssays", new Error("Assay table has missing required values"));
|
|
957
|
-
return Pe(l, [
|
|
957
|
+
return Pe(l, [x, S, T]);
|
|
958
958
|
}
|
|
959
|
-
async function
|
|
959
|
+
async function ri(e, t = {}) {
|
|
960
960
|
const {
|
|
961
961
|
sourceColumnMap: n = null,
|
|
962
962
|
keepAll: r = !0,
|
|
963
963
|
...o
|
|
964
|
-
} = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [
|
|
965
|
-
for (const
|
|
966
|
-
if (!i.some((d) =>
|
|
967
|
-
throw Y("loadGeology", new Error(`Geology table missing column: ${
|
|
968
|
-
const l = i.map((
|
|
969
|
-
const m = { ...
|
|
970
|
-
if (
|
|
971
|
-
const h = m[
|
|
972
|
-
m[
|
|
964
|
+
} = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [x, S, T];
|
|
965
|
+
for (const u of s)
|
|
966
|
+
if (!i.some((d) => u in d))
|
|
967
|
+
throw Y("loadGeology", new Error(`Geology table missing column: ${u}`));
|
|
968
|
+
const l = i.map((u) => {
|
|
969
|
+
const m = { ...u };
|
|
970
|
+
if (x in m) {
|
|
971
|
+
const h = m[x];
|
|
972
|
+
m[x] = h == null ? "" : `${h}`.trim();
|
|
973
973
|
}
|
|
974
|
-
|
|
974
|
+
S in m && (m[S] = ee(m[S])), T in m && (m[T] = ee(m[T])), S in m && T in m && Number.isFinite(m[S]) && Number.isFinite(m[T]) && (m[T] === m[S] && (m[S] = Math.round(m[S] * 1e3) / 1e3, m[T] = m[S] + 1e-3), m[Ie] = 0.5 * (m[S] + m[T]));
|
|
975
975
|
const d = m[ae] !== void 0 && m[ae] !== null && `${m[ae]}`.trim() !== "", f = m[ce] !== void 0 && m[ce] !== null && `${m[ce]}`.trim() !== "";
|
|
976
976
|
return !d && f && (m[ae] = m[ce]), d && !f && (m[ce] = m[ae]), m;
|
|
977
977
|
});
|
|
978
|
-
if (!l.every((
|
|
978
|
+
if (!l.every((u) => !(!u[x] || !Number.isFinite(u[S]) || !Number.isFinite(u[T]) || !(u[T] > u[S]))))
|
|
979
979
|
throw Y("loadGeology", new Error("Geology table has missing or invalid interval values"));
|
|
980
|
-
if (!l.some((
|
|
981
|
-
const m =
|
|
980
|
+
if (!l.some((u) => {
|
|
981
|
+
const m = u[ae], d = u[ce];
|
|
982
982
|
return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
|
|
983
983
|
}))
|
|
984
984
|
throw Y("loadGeology", new Error(`Geology table missing categorical columns: ${ae} or ${ce}`));
|
|
985
985
|
if (Dn(l, "Geology"), !r) {
|
|
986
|
-
const
|
|
986
|
+
const u = new Set(Object.keys(mn));
|
|
987
987
|
return Pe(
|
|
988
|
-
l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) =>
|
|
989
|
-
[
|
|
988
|
+
l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => u.has(d)))),
|
|
989
|
+
[x, S, T]
|
|
990
990
|
);
|
|
991
991
|
}
|
|
992
|
-
return Pe(l, [
|
|
992
|
+
return Pe(l, [x, S, T]);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [
|
|
994
|
+
function oi(e = [], t = [], n = {}) {
|
|
995
|
+
const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [x];
|
|
996
996
|
if (!t.length) return [...e];
|
|
997
997
|
const o = (s) => r.map((l) => `${(s == null ? void 0 : s[l]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
|
|
998
998
|
return t.forEach((s) => {
|
|
@@ -1000,16 +1000,16 @@ function qo(e = [], t = [], n = {}) {
|
|
|
1000
1000
|
}), e.map((s) => {
|
|
1001
1001
|
const l = i.get(o(s));
|
|
1002
1002
|
if (!l) return { ...s };
|
|
1003
|
-
const
|
|
1004
|
-
return Object.entries(l).forEach(([a,
|
|
1005
|
-
r.includes(a) || (Object.prototype.hasOwnProperty.call(
|
|
1006
|
-
}),
|
|
1003
|
+
const c = { ...s };
|
|
1004
|
+
return Object.entries(l).forEach(([a, u]) => {
|
|
1005
|
+
r.includes(a) || (Object.prototype.hasOwnProperty.call(c, a) ? c[`${a}_trace`] = u : c[a] = u);
|
|
1006
|
+
}), c;
|
|
1007
1007
|
});
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function ii(e = [], t = null) {
|
|
1010
1010
|
return t == null ? [...e] : e.length ? e.some((r) => me in r) ? e.filter((r) => (r == null ? void 0 : r[me]) === t) : [...e] : [];
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function si(e = [], t = []) {
|
|
1013
1013
|
return e.map((n) => {
|
|
1014
1014
|
const r = { ...n };
|
|
1015
1015
|
return t.forEach((o) => {
|
|
@@ -1019,7 +1019,7 @@ function Zo(e = [], t = []) {
|
|
|
1019
1019
|
}), r;
|
|
1020
1020
|
});
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function li({
|
|
1023
1023
|
collars: e = [],
|
|
1024
1024
|
surveys: t = [],
|
|
1025
1025
|
assays: n = [],
|
|
@@ -1028,15 +1028,15 @@ function Wo({
|
|
|
1028
1028
|
metadata: i = {}
|
|
1029
1029
|
} = {}) {
|
|
1030
1030
|
return {
|
|
1031
|
-
collars:
|
|
1032
|
-
surveys:
|
|
1033
|
-
assays:
|
|
1034
|
-
geology:
|
|
1035
|
-
structures:
|
|
1031
|
+
collars: Ee(e),
|
|
1032
|
+
surveys: Ee(t),
|
|
1033
|
+
assays: Ee(n),
|
|
1034
|
+
geology: Ee(r),
|
|
1035
|
+
structures: Ee(o),
|
|
1036
1036
|
metadata: i || {}
|
|
1037
1037
|
};
|
|
1038
1038
|
}
|
|
1039
|
-
const St = ["x", "y", "z", "dx", "dy", "dz"],
|
|
1039
|
+
const St = ["x", "y", "z", "dx", "dy", "dz"], Pn = {
|
|
1040
1040
|
x: ["x", "easting", "center_x", "xc", "xcentre", "xcenter", "x_centre", "x_center", "cx"],
|
|
1041
1041
|
y: ["y", "northing", "center_y", "yc", "ycentre", "ycenter", "y_centre", "y_center", "cy"],
|
|
1042
1042
|
z: ["z", "elevation", "center_z", "zc", "zcentre", "zcenter", "z_centre", "z_center", "cz"],
|
|
@@ -1044,26 +1044,26 @@ const St = ["x", "y", "z", "dx", "dy", "dz"], On = {
|
|
|
1044
1044
|
dy: ["dy", "size_y", "sy", "sizey", "dim_y", "block_size_y"],
|
|
1045
1045
|
dz: ["dz", "size_z", "sz", "sizez", "dim_z", "block_size_z"]
|
|
1046
1046
|
}, Lt = {};
|
|
1047
|
-
Object.entries(
|
|
1047
|
+
Object.entries(Pn).forEach(([e, t]) => {
|
|
1048
1048
|
t.forEach((n) => {
|
|
1049
1049
|
Lt[n.toLowerCase()] = e;
|
|
1050
1050
|
});
|
|
1051
1051
|
});
|
|
1052
|
-
function
|
|
1052
|
+
function Fn(e) {
|
|
1053
1053
|
const t = {};
|
|
1054
1054
|
return Object.entries(e).forEach(([n, r]) => {
|
|
1055
1055
|
const o = Lt[n.toLowerCase().trim()] || n;
|
|
1056
1056
|
t[o] = r;
|
|
1057
1057
|
}), t;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function ai(e) {
|
|
1060
1060
|
return new Promise((t, n) => {
|
|
1061
1061
|
te.parse(e, {
|
|
1062
1062
|
header: !0,
|
|
1063
1063
|
dynamicTyping: !0,
|
|
1064
1064
|
skipEmptyLines: !0,
|
|
1065
1065
|
complete: (r) => {
|
|
1066
|
-
const i = (r.data || []).map(
|
|
1066
|
+
const i = (r.data || []).map(Fn).filter(
|
|
1067
1067
|
(l) => l.x !== null && l.y !== null && l.z !== null
|
|
1068
1068
|
), s = Object.keys(i[0] || {}).filter(
|
|
1069
1069
|
(l) => !St.includes(l)
|
|
@@ -1076,7 +1076,7 @@ function Ko(e) {
|
|
|
1076
1076
|
});
|
|
1077
1077
|
});
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function ci(e) {
|
|
1080
1080
|
if (typeof e == "string")
|
|
1081
1081
|
try {
|
|
1082
1082
|
return JSON.parse(e);
|
|
@@ -1086,7 +1086,7 @@ function Jo(e) {
|
|
|
1086
1086
|
if (e && typeof e == "object") return e;
|
|
1087
1087
|
throw Y("loadBlockModelMetadata", new Error("Invalid metadata source"));
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1089
|
+
function wn(e, t) {
|
|
1090
1090
|
const n = e.map((i) => i[t]).filter((i) => i != null);
|
|
1091
1091
|
if (n.length > 0 && n.every((i) => typeof i == "number")) {
|
|
1092
1092
|
const i = Math.min(...n), s = Math.max(...n);
|
|
@@ -1094,13 +1094,13 @@ function Fn(e, t) {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
return { type: "categorical", categories: [...new Set(n)], values: n };
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function ui(e) {
|
|
1098
1098
|
if (!e || e.length === 0) return {};
|
|
1099
1099
|
const t = Object.keys(e[0]).filter(
|
|
1100
1100
|
(r) => !St.includes(r)
|
|
1101
1101
|
), n = {};
|
|
1102
1102
|
return t.forEach((r) => {
|
|
1103
|
-
n[r] =
|
|
1103
|
+
n[r] = wn(e, r);
|
|
1104
1104
|
}), n;
|
|
1105
1105
|
}
|
|
1106
1106
|
function Tn(e, t) {
|
|
@@ -1111,13 +1111,13 @@ function Tn(e, t) {
|
|
|
1111
1111
|
})
|
|
1112
1112
|
);
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function di(e, t = null) {
|
|
1115
1115
|
return (t ? Tn(e, t) : e).reduce((r, o) => {
|
|
1116
1116
|
const i = Number(o.dx) || 0, s = Number(o.dy) || 0, l = Number(o.dz) || 0;
|
|
1117
1117
|
return r + i * s * l;
|
|
1118
1118
|
}, 0);
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function $n(e, t, n) {
|
|
1121
1121
|
if (!t) return new n.Color("#888888");
|
|
1122
1122
|
if (t.type === "numeric") {
|
|
1123
1123
|
const i = t.max - t.min, l = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
|
|
@@ -1126,56 +1126,56 @@ function wn(e, t, n) {
|
|
|
1126
1126
|
const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
|
|
1127
1127
|
return new n.Color().setHSL(o / 360, 0.7, 0.5);
|
|
1128
1128
|
}
|
|
1129
|
-
const nt = (e, t = null) =>
|
|
1130
|
-
function
|
|
1129
|
+
const nt = (e, t = null) => ye(e, null, t);
|
|
1130
|
+
function Bn(e) {
|
|
1131
1131
|
if (!e.length) return null;
|
|
1132
|
-
const t = e[0], n =
|
|
1132
|
+
const t = e[0], n = S in t && T in t, r = W in t && !n;
|
|
1133
1133
|
return n ? "interval" : r ? "point" : null;
|
|
1134
1134
|
}
|
|
1135
1135
|
function de(e) {
|
|
1136
1136
|
const t = Number(e);
|
|
1137
1137
|
return Number.isFinite(t) ? t : null;
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1140
|
-
const t = e[
|
|
1139
|
+
function Pt(e) {
|
|
1140
|
+
const t = e[x] !== void 0 ? `${e[x]}`.trim() : "";
|
|
1141
1141
|
if (!t) return null;
|
|
1142
1142
|
const n = de(e[W]);
|
|
1143
1143
|
return n === null ? null : {
|
|
1144
|
-
[
|
|
1144
|
+
[x]: t,
|
|
1145
1145
|
[W]: n,
|
|
1146
|
-
[X]: de(e[X]),
|
|
1147
1146
|
[q]: de(e[q]),
|
|
1147
|
+
[X]: de(e[X]),
|
|
1148
1148
|
comments: e.comments != null ? `${e.comments}` : null,
|
|
1149
1149
|
...e
|
|
1150
1150
|
};
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const t = e[
|
|
1152
|
+
function Ft(e) {
|
|
1153
|
+
const t = e[x] !== void 0 ? `${e[x]}`.trim() : "";
|
|
1154
1154
|
if (!t) return null;
|
|
1155
|
-
const n = de(e[
|
|
1155
|
+
const n = de(e[S]), r = de(e[T]);
|
|
1156
1156
|
if (n === null || r === null || r <= n) return null;
|
|
1157
1157
|
const o = 0.5 * (n + r);
|
|
1158
1158
|
return {
|
|
1159
|
-
[
|
|
1160
|
-
[
|
|
1161
|
-
[
|
|
1159
|
+
[x]: t,
|
|
1160
|
+
[S]: n,
|
|
1161
|
+
[T]: r,
|
|
1162
1162
|
mid: o,
|
|
1163
|
-
[X]: de(e[X]),
|
|
1164
1163
|
[q]: de(e[q]),
|
|
1164
|
+
[X]: de(e[X]),
|
|
1165
1165
|
classification: e.classification != null ? `${e.classification}` : null,
|
|
1166
1166
|
comments: e.comments != null ? `${e.comments}` : null,
|
|
1167
1167
|
...e
|
|
1168
1168
|
};
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function mi(e) {
|
|
1171
1171
|
const t = [], n = [];
|
|
1172
1172
|
for (const r of e) {
|
|
1173
|
-
const o = [], i = de(r[
|
|
1173
|
+
const o = [], i = de(r[q]), s = de(r[X]);
|
|
1174
1174
|
i !== null && (i < 0 || i > 90) && o.push(`dip ${i} out of range [0, 90]`), s !== null && (s < 0 || s >= 360) && o.push(`azimuth ${s} out of range [0, 360)`), o.length ? n.push({ row: r, message: o.join("; ") }) : t.push(r);
|
|
1175
1175
|
}
|
|
1176
1176
|
return { valid: t, errors: n };
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function fi(e, t = null) {
|
|
1179
1179
|
return new Promise((n, r) => {
|
|
1180
1180
|
const o = {
|
|
1181
1181
|
header: !0,
|
|
@@ -1184,7 +1184,7 @@ function ni(e, t = null) {
|
|
|
1184
1184
|
complete: (i) => {
|
|
1185
1185
|
const s = [];
|
|
1186
1186
|
for (const l of i.data) {
|
|
1187
|
-
const
|
|
1187
|
+
const c = nt(l, t), a = Pt(c);
|
|
1188
1188
|
a && s.push(a);
|
|
1189
1189
|
}
|
|
1190
1190
|
n(s);
|
|
@@ -1195,7 +1195,7 @@ function ni(e, t = null) {
|
|
|
1195
1195
|
`) ? te.parse(e, o) : te.parse(e, o);
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function hi(e, t = null) {
|
|
1199
1199
|
return new Promise((n, r) => {
|
|
1200
1200
|
te.parse(e, {
|
|
1201
1201
|
header: !0,
|
|
@@ -1204,8 +1204,8 @@ function ri(e, t = null) {
|
|
|
1204
1204
|
complete: (o) => {
|
|
1205
1205
|
const i = [];
|
|
1206
1206
|
for (const s of o.data) {
|
|
1207
|
-
const l = nt(s, t),
|
|
1208
|
-
|
|
1207
|
+
const l = nt(s, t), c = Ft(l);
|
|
1208
|
+
c && i.push(c);
|
|
1209
1209
|
}
|
|
1210
1210
|
n(i);
|
|
1211
1211
|
},
|
|
@@ -1213,7 +1213,7 @@ function ri(e, t = null) {
|
|
|
1213
1213
|
});
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1216
|
+
function Rn(e, t = x) {
|
|
1217
1217
|
const n = /* @__PURE__ */ new Map();
|
|
1218
1218
|
for (const r of e) {
|
|
1219
1219
|
const o = r[t] != null ? String(r[t]).trim() : "";
|
|
@@ -1228,7 +1228,7 @@ function Vn(e, t = null) {
|
|
|
1228
1228
|
dynamicTyping: !0,
|
|
1229
1229
|
skipEmptyLines: !0,
|
|
1230
1230
|
complete: (o) => {
|
|
1231
|
-
const i = o.data.map((
|
|
1231
|
+
const i = o.data.map((c) => nt(c, t)), s = Bn(i);
|
|
1232
1232
|
if (!s) {
|
|
1233
1233
|
r(Y(
|
|
1234
1234
|
"parseStructuralCSV",
|
|
@@ -1237,8 +1237,8 @@ function Vn(e, t = null) {
|
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
1239
|
const l = [];
|
|
1240
|
-
for (const
|
|
1241
|
-
const a = s === "interval" ?
|
|
1240
|
+
for (const c of i) {
|
|
1241
|
+
const a = s === "interval" ? Ft(c) : Pt(c);
|
|
1242
1242
|
a && l.push(a);
|
|
1243
1243
|
}
|
|
1244
1244
|
n({ schema: s, rows: l });
|
|
@@ -1256,17 +1256,17 @@ function Hn(e) {
|
|
|
1256
1256
|
complete: (n) => {
|
|
1257
1257
|
const r = /* @__PURE__ */ new Map();
|
|
1258
1258
|
for (const i of n.data) {
|
|
1259
|
-
const s =
|
|
1259
|
+
const s = ye(i), l = s[x] != null ? `${s[x]}`.trim() : "";
|
|
1260
1260
|
if (!l) continue;
|
|
1261
|
-
const
|
|
1262
|
-
if (!Number.isFinite(
|
|
1263
|
-
const
|
|
1261
|
+
const c = Number(s[S]), a = Number(s[T]);
|
|
1262
|
+
if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c) continue;
|
|
1263
|
+
const u = (c + a) / 2, { [q]: m, [X]: d, ...f } = s, h = {
|
|
1264
1264
|
...f,
|
|
1265
|
-
[
|
|
1266
|
-
[
|
|
1267
|
-
[
|
|
1268
|
-
[Ie]:
|
|
1269
|
-
[W]:
|
|
1265
|
+
[x]: l,
|
|
1266
|
+
[S]: c,
|
|
1267
|
+
[T]: a,
|
|
1268
|
+
[Ie]: u,
|
|
1269
|
+
[W]: u,
|
|
1270
1270
|
// unified depth field for y-axis rendering
|
|
1271
1271
|
_source: "assay"
|
|
1272
1272
|
};
|
|
@@ -1274,14 +1274,14 @@ function Hn(e) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
const o = Array.from(r.entries()).map(([i, s]) => ({
|
|
1276
1276
|
holeId: i,
|
|
1277
|
-
points: s.sort((l,
|
|
1277
|
+
points: s.sort((l, c) => l[S] - c[S])
|
|
1278
1278
|
}));
|
|
1279
1279
|
t(o);
|
|
1280
1280
|
}
|
|
1281
1281
|
});
|
|
1282
1282
|
});
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function jn(e) {
|
|
1285
1285
|
return new Promise((t) => {
|
|
1286
1286
|
te.parse(e, {
|
|
1287
1287
|
header: !0,
|
|
@@ -1290,15 +1290,15 @@ function Rn(e) {
|
|
|
1290
1290
|
complete: (n) => {
|
|
1291
1291
|
const r = /* @__PURE__ */ new Map();
|
|
1292
1292
|
for (const o of n.data) {
|
|
1293
|
-
const i =
|
|
1293
|
+
const i = ye(o), s = (i[x] ?? "").toString().trim();
|
|
1294
1294
|
if (!s) continue;
|
|
1295
|
-
const l = Number(i[
|
|
1296
|
-
if (!Number.isFinite(l) || !Number.isFinite(
|
|
1297
|
-
const a = (l +
|
|
1295
|
+
const l = Number(i[S]), c = Number(i[T]);
|
|
1296
|
+
if (!Number.isFinite(l) || !Number.isFinite(c) || c <= l) continue;
|
|
1297
|
+
const a = (l + c) / 2, { [q]: u, [X]: m, ...d } = i, f = {
|
|
1298
1298
|
...d,
|
|
1299
|
-
[
|
|
1300
|
-
[
|
|
1301
|
-
[
|
|
1299
|
+
[x]: s,
|
|
1300
|
+
[S]: l,
|
|
1301
|
+
[T]: c,
|
|
1302
1302
|
[Ie]: a,
|
|
1303
1303
|
[W]: a,
|
|
1304
1304
|
_source: "geology"
|
|
@@ -1308,96 +1308,96 @@ function Rn(e) {
|
|
|
1308
1308
|
t({
|
|
1309
1309
|
holes: Array.from(r.entries()).map(([o, i]) => ({
|
|
1310
1310
|
holeId: o,
|
|
1311
|
-
points: i.sort((s, l) => s[
|
|
1311
|
+
points: i.sort((s, l) => s[S] - l[S])
|
|
1312
1312
|
}))
|
|
1313
1313
|
});
|
|
1314
1314
|
}
|
|
1315
1315
|
});
|
|
1316
1316
|
});
|
|
1317
1317
|
}
|
|
1318
|
-
async function
|
|
1318
|
+
async function pi({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
|
|
1319
1319
|
const [r, o, i] = await Promise.all([
|
|
1320
1320
|
e ? Hn(e) : Promise.resolve([]),
|
|
1321
1321
|
t ? Vn(t).then(
|
|
1322
|
-
({ rows: l }) =>
|
|
1322
|
+
({ rows: l }) => Rn(l.map((c) => ({ ...c, _source: "structural" })))
|
|
1323
1323
|
) : Promise.resolve([]),
|
|
1324
|
-
n ?
|
|
1324
|
+
n ? jn(n).then(({ holes: l }) => l) : Promise.resolve([])
|
|
1325
1325
|
]), s = new Map(r.map((l) => [l.holeId, { ...l, points: [...l.points] }]));
|
|
1326
1326
|
for (const l of [...o, ...i]) {
|
|
1327
|
-
const
|
|
1328
|
-
if (
|
|
1329
|
-
if (s.has(
|
|
1330
|
-
const a = s.get(
|
|
1331
|
-
s.set(
|
|
1327
|
+
const c = l.holeId;
|
|
1328
|
+
if (c)
|
|
1329
|
+
if (s.has(c)) {
|
|
1330
|
+
const a = s.get(c);
|
|
1331
|
+
s.set(c, { ...a, points: [...a.points, ...l.points || []] });
|
|
1332
1332
|
} else
|
|
1333
|
-
s.set(
|
|
1333
|
+
s.set(c, l);
|
|
1334
1334
|
}
|
|
1335
1335
|
return { holes: Array.from(s.values()) };
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Gn(e, t) {
|
|
1338
1338
|
if (!e || e.length === 0 || !Number.isFinite(t)) return null;
|
|
1339
1339
|
const n = e.length;
|
|
1340
1340
|
if (n === 1) {
|
|
1341
|
-
const
|
|
1342
|
-
return { x: Number(
|
|
1341
|
+
const y = e[0];
|
|
1342
|
+
return { x: Number(y.x), y: Number(y.y), z: Number(y.z), dx: 0, dy: 0, dz: -1 };
|
|
1343
1343
|
}
|
|
1344
1344
|
let r = -1;
|
|
1345
|
-
for (let
|
|
1346
|
-
const M = Number(e[
|
|
1345
|
+
for (let y = 0; y < n - 1; y++) {
|
|
1346
|
+
const M = Number(e[y].md), z = Number(e[y + 1].md);
|
|
1347
1347
|
if (t >= M && t <= z) {
|
|
1348
|
-
r =
|
|
1348
|
+
r = y;
|
|
1349
1349
|
break;
|
|
1350
1350
|
}
|
|
1351
1351
|
}
|
|
1352
1352
|
let o, i, s;
|
|
1353
1353
|
if (r === -1) {
|
|
1354
1354
|
t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
|
|
1355
|
-
const
|
|
1356
|
-
s = z > 0 ? (t -
|
|
1355
|
+
const y = Number(o.md), z = Number(i.md) - y;
|
|
1356
|
+
s = z > 0 ? (t - y) / z : t < y ? 0 : 1;
|
|
1357
1357
|
} else {
|
|
1358
1358
|
o = e[r], i = e[r + 1];
|
|
1359
|
-
const
|
|
1360
|
-
s = z > 0 ? (t -
|
|
1359
|
+
const y = Number(o.md), z = Number(i.md) - y;
|
|
1360
|
+
s = z > 0 ? (t - y) / z : 0;
|
|
1361
1361
|
}
|
|
1362
|
-
const l = Number(o.x) + s * (Number(i.x) - Number(o.x)),
|
|
1363
|
-
let
|
|
1364
|
-
const f = Number(o.azimuth), h = Number(o.dip), b = Number(i.azimuth),
|
|
1362
|
+
const l = Number(o.x) + s * (Number(i.x) - Number(o.x)), c = Number(o.y) + s * (Number(i.y) - Number(o.y)), a = Number(o.z) + s * (Number(i.z) - Number(o.z));
|
|
1363
|
+
let u, m, d;
|
|
1364
|
+
const f = Number(o.azimuth), h = Number(o.dip), b = Number(i.azimuth), _ = Number(i.dip);
|
|
1365
1365
|
if (Number.isFinite(f) && Number.isFinite(h)) {
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1366
|
+
const y = Number.isFinite(b) && Number.isFinite(_) ? f + s * (b - f) : f, M = Number.isFinite(b) && Number.isFinite(_) ? h + s * (_ - h) : h, z = y * Math.PI / 180, O = M * Math.PI / 180;
|
|
1367
|
+
u = Math.cos(O) * Math.sin(z), m = Math.cos(O) * Math.cos(z), d = -Math.sin(O);
|
|
1368
1368
|
} else {
|
|
1369
|
-
const
|
|
1370
|
-
if (
|
|
1371
|
-
|
|
1372
|
-
}
|
|
1373
|
-
const p = Math.sqrt(
|
|
1374
|
-
return p < 1e-10 ? { x: l, y:
|
|
1375
|
-
}
|
|
1376
|
-
function
|
|
1377
|
-
const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz:
|
|
1378
|
-
let
|
|
1379
|
-
const m = a[0] *
|
|
1380
|
-
Math.abs(m) > 0.99 && (
|
|
1369
|
+
const y = Number(i.x) - Number(o.x), M = Number(i.y) - Number(o.y), z = Number(i.z) - Number(o.z), O = Math.sqrt(y * y + M * M + z * z);
|
|
1370
|
+
if (O < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
|
|
1371
|
+
u = y / O, m = M / O, d = z / O;
|
|
1372
|
+
}
|
|
1373
|
+
const p = Math.sqrt(u * u + m * m + d * d);
|
|
1374
|
+
return p < 1e-10 ? { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: c, z: a, dx: u / p, dy: m / p, dz: d / p };
|
|
1375
|
+
}
|
|
1376
|
+
function Un(e, t, n, r = {}) {
|
|
1377
|
+
const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: c } = n, a = [s, l, c];
|
|
1378
|
+
let u = [0, 0, 1];
|
|
1379
|
+
const m = a[0] * u[0] + a[1] * u[1] + a[2] * u[2];
|
|
1380
|
+
Math.abs(m) > 0.99 && (u = [0, 1, 0]);
|
|
1381
1381
|
const d = [
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1382
|
+
u[1] * a[2] - u[2] * a[1],
|
|
1383
|
+
u[2] * a[0] - u[0] * a[2],
|
|
1384
|
+
u[0] * a[1] - u[1] * a[0]
|
|
1385
1385
|
], f = Math.sqrt(d[0] ** 2 + d[1] ** 2 + d[2] ** 2), h = f > 1e-10 ? [d[0] / f, d[1] / f, d[2] / f] : [1, 0, 0], b = [
|
|
1386
1386
|
a[1] * h[2] - a[2] * h[1],
|
|
1387
1387
|
a[2] * h[0] - a[0] * h[2],
|
|
1388
1388
|
a[0] * h[1] - a[1] * h[0]
|
|
1389
|
-
],
|
|
1390
|
-
a[1] *
|
|
1391
|
-
a[2] *
|
|
1392
|
-
a[0] *
|
|
1389
|
+
], _ = Math.sqrt(b[0] ** 2 + b[1] ** 2 + b[2] ** 2), p = _ > 1e-10 ? [b[0] / _, b[1] / _, b[2] / _] : [0, 1, 0], y = o === "R" ? h : p, M = t * Math.PI / 180 * i, z = Math.cos(M), O = Math.sin(M), k = y[0] * a[0] + y[1] * a[1] + y[2] * a[2], L = [
|
|
1390
|
+
a[1] * y[2] - a[2] * y[1],
|
|
1391
|
+
a[2] * y[0] - a[0] * y[2],
|
|
1392
|
+
a[0] * y[1] - a[1] * y[0]
|
|
1393
1393
|
], $ = [
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
], P = (90 - e) * Math.PI / 180,
|
|
1398
|
-
return
|
|
1394
|
+
y[0] * z + L[0] * O + a[0] * k * (1 - z),
|
|
1395
|
+
y[1] * z + L[1] * O + a[1] * k * (1 - z),
|
|
1396
|
+
y[2] * z + L[2] * O + a[2] * k * (1 - z)
|
|
1397
|
+
], P = (90 - e) * Math.PI / 180, v = Math.cos(P), F = Math.sin(P), C = v * $[0] + F * a[0], V = v * $[1] + F * a[1], H = v * $[2] + F * a[2], A = Math.sqrt(C * C + V * V + H * H);
|
|
1398
|
+
return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: C / A, ny: V / A, nz: H / A };
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1400
|
+
function Yn(e, t, n = {}) {
|
|
1401
1401
|
if (!(e != null && e.length) || !(t != null && t.length)) return [];
|
|
1402
1402
|
const r = /* @__PURE__ */ new Map();
|
|
1403
1403
|
for (const i of t) {
|
|
@@ -1412,27 +1412,27 @@ function Un(e, t, n = {}) {
|
|
|
1412
1412
|
if (!s) continue;
|
|
1413
1413
|
const l = r.get(s);
|
|
1414
1414
|
if (!l || l.length === 0) continue;
|
|
1415
|
-
const
|
|
1416
|
-
if (!Number.isFinite(
|
|
1417
|
-
const a =
|
|
1415
|
+
const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
|
|
1416
|
+
if (!Number.isFinite(c)) continue;
|
|
1417
|
+
const a = Gn(l, c);
|
|
1418
1418
|
if (!a) continue;
|
|
1419
|
-
const { x:
|
|
1420
|
-
let
|
|
1419
|
+
const { x: u, y: m, z: d, dx: f, dy: h, dz: b } = a;
|
|
1420
|
+
let _, p, y;
|
|
1421
1421
|
const M = i.alpha != null ? Number(i.alpha) : null, z = i.beta != null ? Number(i.beta) : null;
|
|
1422
1422
|
if (Number.isFinite(M)) {
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1423
|
+
const O = Number.isFinite(z) ? z : 0, k = Un(M, O, { dx: f, dy: h, dz: b }, n);
|
|
1424
|
+
_ = k.nx, p = k.ny, y = k.nz;
|
|
1425
1425
|
} else {
|
|
1426
|
-
const
|
|
1427
|
-
if (!Number.isFinite(
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1426
|
+
const O = i.dip != null ? Number(i.dip) : null, k = i.azimuth != null ? Number(i.azimuth) : null;
|
|
1427
|
+
if (!Number.isFinite(O) || !Number.isFinite(k)) continue;
|
|
1428
|
+
const L = O * Math.PI / 180, $ = k * Math.PI / 180;
|
|
1429
|
+
_ = Math.sin($) * Math.sin(L), p = Math.cos($) * Math.sin(L), y = Math.cos(L);
|
|
1430
1430
|
}
|
|
1431
|
-
o.push({ ...i, x:
|
|
1431
|
+
o.push({ ...i, x: u, y: m, z: d, nx: _, ny: p, nz: y });
|
|
1432
1432
|
}
|
|
1433
1433
|
return o;
|
|
1434
1434
|
}
|
|
1435
|
-
const
|
|
1435
|
+
const Xn = "baselode", bi = Xn, qn = [
|
|
1436
1436
|
"#8b1e3f",
|
|
1437
1437
|
"#2563eb",
|
|
1438
1438
|
"#16a34a",
|
|
@@ -1443,7 +1443,7 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1443
1443
|
"#10b981",
|
|
1444
1444
|
"#f97316",
|
|
1445
1445
|
"#8b5cf6"
|
|
1446
|
-
],
|
|
1446
|
+
], R = {
|
|
1447
1447
|
bg: "#ffffff",
|
|
1448
1448
|
panel: "#f8fafc",
|
|
1449
1449
|
ink: "#1e293b",
|
|
@@ -1457,31 +1457,31 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1457
1457
|
muted_3: "#e2e8f0",
|
|
1458
1458
|
primary: "#8b1e3f",
|
|
1459
1459
|
primary_2: "#a8324f"
|
|
1460
|
-
},
|
|
1460
|
+
}, Oe = {
|
|
1461
1461
|
layout: {
|
|
1462
|
-
paper_bgcolor:
|
|
1463
|
-
plot_bgcolor:
|
|
1462
|
+
paper_bgcolor: R.bg,
|
|
1463
|
+
plot_bgcolor: R.bg,
|
|
1464
1464
|
colorway: qn,
|
|
1465
1465
|
font: {
|
|
1466
1466
|
family: "Inter, system-ui, sans-serif",
|
|
1467
1467
|
size: 12,
|
|
1468
|
-
color:
|
|
1468
|
+
color: R.ink
|
|
1469
1469
|
},
|
|
1470
1470
|
title: {
|
|
1471
|
-
font: { size: 14, color:
|
|
1471
|
+
font: { size: 14, color: R.ink },
|
|
1472
1472
|
x: 0.05
|
|
1473
1473
|
},
|
|
1474
1474
|
hovermode: "x unified",
|
|
1475
1475
|
hoverlabel: {
|
|
1476
|
-
bgcolor:
|
|
1477
|
-
bordercolor:
|
|
1478
|
-
font: { size: 12, color:
|
|
1476
|
+
bgcolor: R.bg,
|
|
1477
|
+
bordercolor: R.line,
|
|
1478
|
+
font: { size: 12, color: R.ink }
|
|
1479
1479
|
},
|
|
1480
1480
|
legend: {
|
|
1481
1481
|
bgcolor: "rgba(255,255,255,0.9)",
|
|
1482
|
-
bordercolor:
|
|
1482
|
+
bordercolor: R.muted_3,
|
|
1483
1483
|
borderwidth: 1,
|
|
1484
|
-
font: { size: 11, color:
|
|
1484
|
+
font: { size: 11, color: R.ink },
|
|
1485
1485
|
orientation: "h",
|
|
1486
1486
|
yanchor: "bottom",
|
|
1487
1487
|
y: 1.02,
|
|
@@ -1491,34 +1491,34 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1491
1491
|
xaxis: {
|
|
1492
1492
|
showline: !0,
|
|
1493
1493
|
linewidth: 1,
|
|
1494
|
-
linecolor:
|
|
1494
|
+
linecolor: R.line,
|
|
1495
1495
|
mirror: !1,
|
|
1496
1496
|
ticks: "outside",
|
|
1497
1497
|
tickwidth: 1,
|
|
1498
|
-
tickcolor:
|
|
1498
|
+
tickcolor: R.line,
|
|
1499
1499
|
ticklen: 4,
|
|
1500
1500
|
showgrid: !0,
|
|
1501
|
-
gridcolor:
|
|
1501
|
+
gridcolor: R.grid,
|
|
1502
1502
|
gridwidth: 1,
|
|
1503
1503
|
zeroline: !1,
|
|
1504
|
-
title_font: { color:
|
|
1505
|
-
tickfont: { color:
|
|
1504
|
+
title_font: { color: R.ink, size: 12 },
|
|
1505
|
+
tickfont: { color: R.ink_soft, size: 10 }
|
|
1506
1506
|
},
|
|
1507
1507
|
yaxis: {
|
|
1508
1508
|
showline: !0,
|
|
1509
1509
|
linewidth: 1,
|
|
1510
|
-
linecolor:
|
|
1510
|
+
linecolor: R.line,
|
|
1511
1511
|
mirror: !1,
|
|
1512
1512
|
ticks: "outside",
|
|
1513
1513
|
tickwidth: 1,
|
|
1514
|
-
tickcolor:
|
|
1514
|
+
tickcolor: R.line,
|
|
1515
1515
|
ticklen: 4,
|
|
1516
1516
|
showgrid: !0,
|
|
1517
|
-
gridcolor:
|
|
1517
|
+
gridcolor: R.grid,
|
|
1518
1518
|
gridwidth: 1,
|
|
1519
1519
|
zeroline: !1,
|
|
1520
|
-
title_font: { color:
|
|
1521
|
-
tickfont: { color:
|
|
1520
|
+
title_font: { color: R.ink, size: 12 },
|
|
1521
|
+
tickfont: { color: R.ink_soft, size: 10 }
|
|
1522
1522
|
},
|
|
1523
1523
|
modebar: {
|
|
1524
1524
|
remove: ["select2d", "lasso2d", "autoScale2d"]
|
|
@@ -1529,34 +1529,34 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1529
1529
|
data: {
|
|
1530
1530
|
scatter: [{
|
|
1531
1531
|
mode: "lines+markers",
|
|
1532
|
-
line: { width: 2, color:
|
|
1532
|
+
line: { width: 2, color: R.primary },
|
|
1533
1533
|
marker: {
|
|
1534
1534
|
size: 7,
|
|
1535
|
-
color:
|
|
1536
|
-
line: { width: 1.5, color:
|
|
1535
|
+
color: R.primary_2,
|
|
1536
|
+
line: { width: 1.5, color: R.bg }
|
|
1537
1537
|
}
|
|
1538
1538
|
}],
|
|
1539
1539
|
bar: [{
|
|
1540
1540
|
marker: {
|
|
1541
|
-
color:
|
|
1542
|
-
line: { color:
|
|
1541
|
+
color: R.primary,
|
|
1542
|
+
line: { color: R.bg, width: 0 }
|
|
1543
1543
|
}
|
|
1544
1544
|
}],
|
|
1545
1545
|
histogram: [{
|
|
1546
1546
|
marker: {
|
|
1547
|
-
color:
|
|
1548
|
-
line: { color:
|
|
1547
|
+
color: R.primary,
|
|
1548
|
+
line: { color: R.bg, width: 0 }
|
|
1549
1549
|
}
|
|
1550
1550
|
}],
|
|
1551
1551
|
box: [{
|
|
1552
|
-
fillcolor:
|
|
1553
|
-
line: { color:
|
|
1554
|
-
marker: { color:
|
|
1552
|
+
fillcolor: R.accent,
|
|
1553
|
+
line: { color: R.ink, width: 1.5 },
|
|
1554
|
+
marker: { color: R.ink }
|
|
1555
1555
|
}],
|
|
1556
1556
|
violin: [{
|
|
1557
|
-
fillcolor:
|
|
1558
|
-
line: { color:
|
|
1559
|
-
marker: { color:
|
|
1557
|
+
fillcolor: R.accent,
|
|
1558
|
+
line: { color: R.ink, width: 1.5 },
|
|
1559
|
+
marker: { color: R.ink }
|
|
1560
1560
|
}],
|
|
1561
1561
|
heatmap: [{
|
|
1562
1562
|
colorscale: [
|
|
@@ -1568,9 +1568,9 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1568
1568
|
[1, "#1e293b"]
|
|
1569
1569
|
],
|
|
1570
1570
|
colorbar: {
|
|
1571
|
-
outlinecolor:
|
|
1572
|
-
tickcolor:
|
|
1573
|
-
tickfont: { color:
|
|
1571
|
+
outlinecolor: R.line,
|
|
1572
|
+
tickcolor: R.line,
|
|
1573
|
+
tickfont: { color: R.ink_soft }
|
|
1574
1574
|
}
|
|
1575
1575
|
}],
|
|
1576
1576
|
contour: [{
|
|
@@ -1582,13 +1582,13 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1582
1582
|
[1, "#1e293b"]
|
|
1583
1583
|
],
|
|
1584
1584
|
colorbar: {
|
|
1585
|
-
outlinecolor:
|
|
1586
|
-
tickcolor:
|
|
1587
|
-
tickfont: { color:
|
|
1585
|
+
outlinecolor: R.line,
|
|
1586
|
+
tickcolor: R.line,
|
|
1587
|
+
tickfont: { color: R.ink_soft }
|
|
1588
1588
|
}
|
|
1589
1589
|
}]
|
|
1590
1590
|
}
|
|
1591
|
-
},
|
|
1591
|
+
}, yi = Oe, w = {
|
|
1592
1592
|
bg: "#1b1b1f",
|
|
1593
1593
|
panel: "#25252a",
|
|
1594
1594
|
ink: "#f0f0e4",
|
|
@@ -1600,11 +1600,11 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1600
1600
|
muted_1: "#8a8a80",
|
|
1601
1601
|
muted_2: "#5e5e56",
|
|
1602
1602
|
muted_3: "#3a3a34"
|
|
1603
|
-
},
|
|
1603
|
+
}, gi = "baselode-dark", _i = {
|
|
1604
1604
|
layout: {
|
|
1605
1605
|
font: {
|
|
1606
1606
|
family: "Inter, Arial, sans-serif",
|
|
1607
|
-
color:
|
|
1607
|
+
color: w.ink,
|
|
1608
1608
|
size: 14
|
|
1609
1609
|
},
|
|
1610
1610
|
title: {
|
|
@@ -1613,37 +1613,37 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1613
1613
|
font: {
|
|
1614
1614
|
family: "Inter, Arial, sans-serif",
|
|
1615
1615
|
size: 22,
|
|
1616
|
-
color:
|
|
1616
|
+
color: w.ink
|
|
1617
1617
|
}
|
|
1618
1618
|
},
|
|
1619
|
-
paper_bgcolor:
|
|
1620
|
-
plot_bgcolor:
|
|
1619
|
+
paper_bgcolor: w.bg,
|
|
1620
|
+
plot_bgcolor: w.bg,
|
|
1621
1621
|
colorway: [
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1622
|
+
w.ink,
|
|
1623
|
+
w.accent,
|
|
1624
|
+
w.muted_1,
|
|
1625
|
+
w.accent_2,
|
|
1626
|
+
w.muted_2,
|
|
1627
|
+
w.muted_3
|
|
1628
1628
|
],
|
|
1629
1629
|
margin: { l: 70, r: 30, t: 70, b: 60 },
|
|
1630
1630
|
hovermode: "x unified",
|
|
1631
1631
|
hoverlabel: {
|
|
1632
|
-
bgcolor:
|
|
1633
|
-
bordercolor:
|
|
1632
|
+
bgcolor: w.panel,
|
|
1633
|
+
bordercolor: w.accent,
|
|
1634
1634
|
font: {
|
|
1635
1635
|
family: "Inter, Arial, sans-serif",
|
|
1636
|
-
color:
|
|
1636
|
+
color: w.ink,
|
|
1637
1637
|
size: 13
|
|
1638
1638
|
}
|
|
1639
1639
|
},
|
|
1640
1640
|
legend: {
|
|
1641
1641
|
bgcolor: "rgba(37,37,42,0.88)",
|
|
1642
|
-
bordercolor:
|
|
1642
|
+
bordercolor: w.line,
|
|
1643
1643
|
borderwidth: 1,
|
|
1644
1644
|
font: {
|
|
1645
1645
|
family: "Inter, Arial, sans-serif",
|
|
1646
|
-
color:
|
|
1646
|
+
color: w.ink,
|
|
1647
1647
|
size: 12
|
|
1648
1648
|
},
|
|
1649
1649
|
orientation: "h",
|
|
@@ -1656,27 +1656,27 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1656
1656
|
showline: !1,
|
|
1657
1657
|
ticks: "outside",
|
|
1658
1658
|
tickwidth: 1,
|
|
1659
|
-
tickcolor:
|
|
1659
|
+
tickcolor: w.muted_1,
|
|
1660
1660
|
ticklen: 6,
|
|
1661
1661
|
showgrid: !0,
|
|
1662
|
-
gridcolor:
|
|
1662
|
+
gridcolor: w.grid,
|
|
1663
1663
|
gridwidth: 1,
|
|
1664
1664
|
zeroline: !1,
|
|
1665
|
-
title_font: { color:
|
|
1666
|
-
tickfont: { color:
|
|
1665
|
+
title_font: { color: w.ink },
|
|
1666
|
+
tickfont: { color: w.ink_soft }
|
|
1667
1667
|
},
|
|
1668
1668
|
yaxis: {
|
|
1669
1669
|
showline: !1,
|
|
1670
1670
|
ticks: "outside",
|
|
1671
1671
|
tickwidth: 1,
|
|
1672
|
-
tickcolor:
|
|
1672
|
+
tickcolor: w.muted_1,
|
|
1673
1673
|
ticklen: 6,
|
|
1674
1674
|
showgrid: !0,
|
|
1675
|
-
gridcolor:
|
|
1675
|
+
gridcolor: w.grid,
|
|
1676
1676
|
gridwidth: 1,
|
|
1677
1677
|
zeroline: !1,
|
|
1678
|
-
title_font: { color:
|
|
1679
|
-
tickfont: { color:
|
|
1678
|
+
title_font: { color: w.ink },
|
|
1679
|
+
tickfont: { color: w.ink_soft }
|
|
1680
1680
|
},
|
|
1681
1681
|
bargap: 0.18,
|
|
1682
1682
|
bargroupgap: 0.08
|
|
@@ -1684,34 +1684,34 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1684
1684
|
data: {
|
|
1685
1685
|
scatter: [{
|
|
1686
1686
|
mode: "lines+markers",
|
|
1687
|
-
line: { width: 2.5, color:
|
|
1687
|
+
line: { width: 2.5, color: w.ink },
|
|
1688
1688
|
marker: {
|
|
1689
1689
|
size: 7,
|
|
1690
|
-
color:
|
|
1691
|
-
line: { width: 1.5, color:
|
|
1690
|
+
color: w.ink,
|
|
1691
|
+
line: { width: 1.5, color: w.bg }
|
|
1692
1692
|
}
|
|
1693
1693
|
}],
|
|
1694
1694
|
bar: [{
|
|
1695
1695
|
marker: {
|
|
1696
|
-
color:
|
|
1697
|
-
line: { color:
|
|
1696
|
+
color: w.ink,
|
|
1697
|
+
line: { color: w.bg, width: 0 }
|
|
1698
1698
|
}
|
|
1699
1699
|
}],
|
|
1700
1700
|
histogram: [{
|
|
1701
1701
|
marker: {
|
|
1702
|
-
color:
|
|
1703
|
-
line: { color:
|
|
1702
|
+
color: w.ink,
|
|
1703
|
+
line: { color: w.bg, width: 0 }
|
|
1704
1704
|
}
|
|
1705
1705
|
}],
|
|
1706
1706
|
box: [{
|
|
1707
|
-
fillcolor:
|
|
1708
|
-
line: { color:
|
|
1709
|
-
marker: { color:
|
|
1707
|
+
fillcolor: w.accent,
|
|
1708
|
+
line: { color: w.ink, width: 1.5 },
|
|
1709
|
+
marker: { color: w.ink }
|
|
1710
1710
|
}],
|
|
1711
1711
|
violin: [{
|
|
1712
|
-
fillcolor:
|
|
1713
|
-
line: { color:
|
|
1714
|
-
marker: { color:
|
|
1712
|
+
fillcolor: w.accent,
|
|
1713
|
+
line: { color: w.ink, width: 1.5 },
|
|
1714
|
+
marker: { color: w.ink }
|
|
1715
1715
|
}],
|
|
1716
1716
|
heatmap: [{
|
|
1717
1717
|
colorscale: [
|
|
@@ -1723,9 +1723,9 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1723
1723
|
[1, "#ffffbb"]
|
|
1724
1724
|
],
|
|
1725
1725
|
colorbar: {
|
|
1726
|
-
outlinecolor:
|
|
1727
|
-
tickcolor:
|
|
1728
|
-
tickfont: { color:
|
|
1726
|
+
outlinecolor: w.ink,
|
|
1727
|
+
tickcolor: w.ink,
|
|
1728
|
+
tickfont: { color: w.ink_soft }
|
|
1729
1729
|
}
|
|
1730
1730
|
}],
|
|
1731
1731
|
contour: [{
|
|
@@ -1737,13 +1737,13 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1737
1737
|
[1, "#ffffbb"]
|
|
1738
1738
|
],
|
|
1739
1739
|
colorbar: {
|
|
1740
|
-
outlinecolor:
|
|
1741
|
-
tickcolor:
|
|
1742
|
-
tickfont: { color:
|
|
1740
|
+
outlinecolor: w.ink,
|
|
1741
|
+
tickcolor: w.ink,
|
|
1742
|
+
tickfont: { color: w.ink_soft }
|
|
1743
1743
|
}
|
|
1744
1744
|
}]
|
|
1745
1745
|
}
|
|
1746
|
-
},
|
|
1746
|
+
}, Zn = "#7f7f7f", Re = {
|
|
1747
1747
|
Au: "#FFD700",
|
|
1748
1748
|
// gold
|
|
1749
1749
|
Ag: "#C0C0C0",
|
|
@@ -1780,7 +1780,7 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1780
1780
|
// aluminium / yellow
|
|
1781
1781
|
U: "#8BC34A"
|
|
1782
1782
|
// uranium / lime green
|
|
1783
|
-
},
|
|
1783
|
+
}, Wn = {
|
|
1784
1784
|
// Sedimentary
|
|
1785
1785
|
shale: "#607D8B",
|
|
1786
1786
|
mudstone: "#78909C",
|
|
@@ -1819,11 +1819,11 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1819
1819
|
calcite: "#F9FBE7",
|
|
1820
1820
|
vein: "#FFFFFF",
|
|
1821
1821
|
unknown: "#9E9E9E"
|
|
1822
|
-
},
|
|
1823
|
-
commodity:
|
|
1824
|
-
lithology:
|
|
1822
|
+
}, Xe = {
|
|
1823
|
+
commodity: Re,
|
|
1824
|
+
lithology: Wn
|
|
1825
1825
|
};
|
|
1826
|
-
function
|
|
1826
|
+
function Kn(e, t, n = Zn) {
|
|
1827
1827
|
if (!t || e == null) return n;
|
|
1828
1828
|
const r = String(e).trim();
|
|
1829
1829
|
if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
|
|
@@ -1832,13 +1832,13 @@ function Wn(e, t, n = Xn) {
|
|
|
1832
1832
|
if (String(i).trim().toLowerCase() === o) return s;
|
|
1833
1833
|
return n;
|
|
1834
1834
|
}
|
|
1835
|
-
function
|
|
1835
|
+
function Jn(e) {
|
|
1836
1836
|
if (e == null) return {};
|
|
1837
1837
|
if (typeof e == "string") {
|
|
1838
1838
|
const t = e.trim().toLowerCase();
|
|
1839
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1840
|
-
return
|
|
1841
|
-
const n = Object.keys(
|
|
1839
|
+
if (Object.prototype.hasOwnProperty.call(Xe, t))
|
|
1840
|
+
return Xe[t];
|
|
1841
|
+
const n = Object.keys(Xe).sort().join(", ");
|
|
1842
1842
|
throw new RangeError(
|
|
1843
1843
|
`Unknown built-in colour map '${e}'. Available maps: ${n}`
|
|
1844
1844
|
);
|
|
@@ -1848,39 +1848,39 @@ function Kn(e) {
|
|
|
1848
1848
|
`colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
|
|
1849
1849
|
);
|
|
1850
1850
|
}
|
|
1851
|
-
const
|
|
1852
|
-
function
|
|
1851
|
+
const Qn = "#8b1e3f", er = "#a8324f";
|
|
1852
|
+
function tr(e) {
|
|
1853
1853
|
if (!e) return null;
|
|
1854
1854
|
const t = e.split(/[_\-/\s]+/);
|
|
1855
1855
|
for (const n of t) {
|
|
1856
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1857
|
-
return
|
|
1856
|
+
if (Object.prototype.hasOwnProperty.call(Re, n))
|
|
1857
|
+
return Re[n];
|
|
1858
1858
|
const r = n.toLowerCase();
|
|
1859
|
-
for (const [o, i] of Object.entries(
|
|
1859
|
+
for (const [o, i] of Object.entries(Re))
|
|
1860
1860
|
if (o.toLowerCase() === r) return i;
|
|
1861
1861
|
}
|
|
1862
1862
|
return null;
|
|
1863
1863
|
}
|
|
1864
|
-
const
|
|
1865
|
-
function
|
|
1864
|
+
const nr = "#6b7280", rr = { l: 42, r: 4, t: 4, b: 30 }, ft = 10, ht = 12;
|
|
1865
|
+
function pt(e) {
|
|
1866
1866
|
return e ? typeof e == "string" ? { text: e } : e : {};
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const t =
|
|
1868
|
+
function wt(e = {}) {
|
|
1869
|
+
const t = pt(e.xaxis && e.xaxis.title), n = pt(e.yaxis && e.yaxis.title);
|
|
1870
1870
|
return {
|
|
1871
1871
|
...e,
|
|
1872
|
-
margin:
|
|
1872
|
+
margin: rr,
|
|
1873
1873
|
autosize: !0,
|
|
1874
1874
|
width: void 0,
|
|
1875
1875
|
xaxis: {
|
|
1876
1876
|
...e.xaxis || {},
|
|
1877
1877
|
tickfont: {
|
|
1878
1878
|
...e.xaxis && e.xaxis.tickfont || {},
|
|
1879
|
-
size:
|
|
1879
|
+
size: ft
|
|
1880
1880
|
},
|
|
1881
1881
|
title: {
|
|
1882
1882
|
...t,
|
|
1883
|
-
font: { ...t.font || {}, size:
|
|
1883
|
+
font: { ...t.font || {}, size: ht }
|
|
1884
1884
|
}
|
|
1885
1885
|
},
|
|
1886
1886
|
yaxis: {
|
|
@@ -1888,16 +1888,16 @@ function Ft(e = {}) {
|
|
|
1888
1888
|
automargin: !0,
|
|
1889
1889
|
tickfont: {
|
|
1890
1890
|
...e.yaxis && e.yaxis.tickfont || {},
|
|
1891
|
-
size:
|
|
1891
|
+
size: ft
|
|
1892
1892
|
},
|
|
1893
1893
|
title: {
|
|
1894
1894
|
...n,
|
|
1895
|
-
font: { ...n.font || {}, size:
|
|
1895
|
+
font: { ...n.font || {}, size: ht }
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
1898
|
};
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1900
|
+
function or(e, t) {
|
|
1901
1901
|
var r;
|
|
1902
1902
|
if (!e || !t) return !1;
|
|
1903
1903
|
const n = e.points || [];
|
|
@@ -1908,40 +1908,40 @@ function rr(e, t) {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
return !1;
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1911
|
+
function ir(e, t, n) {
|
|
1912
1912
|
if (!e || !t) return [];
|
|
1913
1913
|
const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
|
|
1914
1914
|
return r.forEach((s) => {
|
|
1915
1915
|
let l = Number(
|
|
1916
1916
|
s.from ?? s.samp_from ?? s.sample_from ?? s.fromdepth ?? s.from_depth ?? s.depth_from
|
|
1917
|
-
),
|
|
1917
|
+
), c = Number(
|
|
1918
1918
|
s.to ?? s.samp_to ?? s.sample_to ?? s.todepth ?? s.to_depth ?? s.depth_to
|
|
1919
1919
|
);
|
|
1920
|
-
if (!Number.isFinite(l) || !Number.isFinite(
|
|
1920
|
+
if (!Number.isFinite(l) || !Number.isFinite(c)) {
|
|
1921
1921
|
const f = Number(s.depth ?? s.md);
|
|
1922
|
-
Number.isFinite(f) && (l = f,
|
|
1922
|
+
Number.isFinite(f) && (l = f, c = f);
|
|
1923
1923
|
}
|
|
1924
1924
|
const a = s == null ? void 0 : s[t];
|
|
1925
|
-
if (!Number.isFinite(l) || !Number.isFinite(
|
|
1926
|
-
const
|
|
1927
|
-
if (i.has(
|
|
1928
|
-
i.add(
|
|
1929
|
-
const m = (l +
|
|
1925
|
+
if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
|
|
1926
|
+
const u = `${t}:${l}-${c}:${String(a)}`;
|
|
1927
|
+
if (i.has(u)) return;
|
|
1928
|
+
i.add(u);
|
|
1929
|
+
const m = (l + c) / 2, d = n ? a : Number(a);
|
|
1930
1930
|
!n && !Number.isFinite(d) || o.push({
|
|
1931
1931
|
z: m,
|
|
1932
1932
|
val: d,
|
|
1933
1933
|
from: l,
|
|
1934
|
-
to:
|
|
1935
|
-
errorPlus:
|
|
1934
|
+
to: c,
|
|
1935
|
+
errorPlus: c - m,
|
|
1936
1936
|
errorMinus: m - l
|
|
1937
1937
|
});
|
|
1938
1938
|
}), o.sort((s, l) => l.z - s.z);
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function sr(e, t, n, r) {
|
|
1941
1941
|
if (!e.length) return { data: [], layout: {} };
|
|
1942
1942
|
const o = e.filter((d) => Number.isFinite(d == null ? void 0 : d.from) && Number.isFinite(d == null ? void 0 : d.to) && d.to > d.from).map((d) => ({ ...d, category: `${(d == null ? void 0 : d.val) ?? ""}`.trim() })).filter((d) => d.category !== "" && !/^(nan|null|none)$/i.test(d.category)).sort((d, f) => d.from - f.from || d.to - f.to);
|
|
1943
1943
|
if (!o.length) return { data: [], layout: {} };
|
|
1944
|
-
const i =
|
|
1944
|
+
const i = Jn(n), s = [
|
|
1945
1945
|
"#1f77b4",
|
|
1946
1946
|
// blue
|
|
1947
1947
|
"#ff7f0e",
|
|
@@ -1971,15 +1971,15 @@ function ir(e, t, n, r) {
|
|
|
1971
1971
|
"#636363"
|
|
1972
1972
|
// dark gray
|
|
1973
1973
|
], l = [...new Set(o.map((d) => d.category))];
|
|
1974
|
-
function
|
|
1974
|
+
function c(d, f) {
|
|
1975
1975
|
if (i && Object.keys(i).length > 0) {
|
|
1976
|
-
const h =
|
|
1976
|
+
const h = Kn(d, i, null);
|
|
1977
1977
|
if (h !== null) return h;
|
|
1978
1978
|
}
|
|
1979
1979
|
return s[f % s.length];
|
|
1980
1980
|
}
|
|
1981
1981
|
const a = new Map(
|
|
1982
|
-
l.map((d, f) => [d,
|
|
1982
|
+
l.map((d, f) => [d, c(d, f)])
|
|
1983
1983
|
);
|
|
1984
1984
|
return { data: l.map((d) => {
|
|
1985
1985
|
const f = o.filter((h) => h.category === d);
|
|
@@ -1995,19 +1995,19 @@ function ir(e, t, n, r) {
|
|
|
1995
1995
|
customdata: f.map((h) => [h.from, h.to]),
|
|
1996
1996
|
hovertemplate: `${t}: ${d}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
|
|
1997
1997
|
};
|
|
1998
|
-
}), layout:
|
|
1998
|
+
}), layout: wt({
|
|
1999
1999
|
barmode: "overlay",
|
|
2000
2000
|
bargap: 0,
|
|
2001
2001
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
2002
2002
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
2003
2003
|
showlegend: !1,
|
|
2004
2004
|
title: t || void 0,
|
|
2005
|
-
template: r !== void 0 ? r :
|
|
2005
|
+
template: r !== void 0 ? r : Oe
|
|
2006
2006
|
}) };
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2008
|
+
function lr(e, t, n, r, o) {
|
|
2009
2009
|
if (!e.length) return { data: [], layout: {} };
|
|
2010
|
-
const i = n === "bar", s = n === "markers", l = n === "line",
|
|
2010
|
+
const i = n === "bar", s = n === "markers", l = n === "line", c = r || Qn, a = r || er, u = {
|
|
2011
2011
|
x: e.map((h) => h.val),
|
|
2012
2012
|
y: e.map((h) => h.z),
|
|
2013
2013
|
hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
|
|
@@ -2019,37 +2019,37 @@ function sr(e, t, n, r, o) {
|
|
|
2019
2019
|
arrayminus: e.map((h) => h.errorMinus),
|
|
2020
2020
|
thickness: 1.5,
|
|
2021
2021
|
width: 2,
|
|
2022
|
-
color:
|
|
2022
|
+
color: nr
|
|
2023
2023
|
};
|
|
2024
2024
|
return { data: [i ? {
|
|
2025
|
-
...
|
|
2025
|
+
...u,
|
|
2026
2026
|
type: "bar",
|
|
2027
2027
|
orientation: "h",
|
|
2028
|
-
marker: { color:
|
|
2028
|
+
marker: { color: c },
|
|
2029
2029
|
error_y: m
|
|
2030
2030
|
} : {
|
|
2031
|
-
...
|
|
2031
|
+
...u,
|
|
2032
2032
|
type: "scatter",
|
|
2033
2033
|
mode: s ? "markers" : l ? "lines" : "lines+markers",
|
|
2034
|
-
line: { color:
|
|
2034
|
+
line: { color: c, width: 2 },
|
|
2035
2035
|
marker: { size: 7, color: a },
|
|
2036
2036
|
error_y: l ? void 0 : m
|
|
2037
|
-
}], layout:
|
|
2037
|
+
}], layout: wt({
|
|
2038
2038
|
xaxis: { title: t, zeroline: !1 },
|
|
2039
2039
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
2040
2040
|
barmode: "overlay",
|
|
2041
2041
|
showlegend: !1,
|
|
2042
|
-
template: o !== void 0 ? o :
|
|
2042
|
+
template: o !== void 0 ? o : Oe
|
|
2043
2043
|
}) };
|
|
2044
2044
|
}
|
|
2045
2045
|
function Tt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
|
|
2046
2046
|
if (!e || !e.length || !n) return { data: [], layout: {} };
|
|
2047
2047
|
if (t || r === "categorical")
|
|
2048
|
-
return
|
|
2049
|
-
const s =
|
|
2050
|
-
return
|
|
2048
|
+
return sr(e, n, o, i);
|
|
2049
|
+
const s = tr(n);
|
|
2050
|
+
return lr(e, n, r, s, i);
|
|
2051
2051
|
}
|
|
2052
|
-
function
|
|
2052
|
+
function Ni(e = [], {
|
|
2053
2053
|
fromCol: t = "from",
|
|
2054
2054
|
toCol: n = "to",
|
|
2055
2055
|
categoryCol: r = "geology_code",
|
|
@@ -2058,18 +2058,18 @@ function ci(e = [], {
|
|
|
2058
2058
|
} = {}) {
|
|
2059
2059
|
const s = [];
|
|
2060
2060
|
return e.forEach((l) => {
|
|
2061
|
-
const
|
|
2062
|
-
if (!Number.isFinite(
|
|
2063
|
-
const m = (
|
|
2061
|
+
const c = Number(l == null ? void 0 : l[t]), a = Number(l == null ? void 0 : l[n]), u = l == null ? void 0 : l[r];
|
|
2062
|
+
if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c || u == null || `${u}`.trim() === "") return;
|
|
2063
|
+
const m = (c + a) / 2;
|
|
2064
2064
|
s.push({
|
|
2065
2065
|
z: m,
|
|
2066
|
-
val: `${
|
|
2067
|
-
from:
|
|
2066
|
+
val: `${u}`,
|
|
2067
|
+
from: c,
|
|
2068
2068
|
to: a,
|
|
2069
2069
|
errorPlus: a - m,
|
|
2070
|
-
errorMinus: m -
|
|
2070
|
+
errorMinus: m - c
|
|
2071
2071
|
});
|
|
2072
|
-
}), s.sort((l,
|
|
2072
|
+
}), s.sort((l, c) => c.z - l.z), Tt({
|
|
2073
2073
|
points: s,
|
|
2074
2074
|
isCategorical: !0,
|
|
2075
2075
|
property: r,
|
|
@@ -2078,7 +2078,7 @@ function ci(e = [], {
|
|
|
2078
2078
|
template: i
|
|
2079
2079
|
});
|
|
2080
2080
|
}
|
|
2081
|
-
const
|
|
2081
|
+
const $t = [
|
|
2082
2082
|
"#0f172a",
|
|
2083
2083
|
"#1e3a5f",
|
|
2084
2084
|
"#7c3aed",
|
|
@@ -2089,24 +2089,24 @@ const wt = [
|
|
|
2089
2089
|
"#db2777",
|
|
2090
2090
|
"#65a30d",
|
|
2091
2091
|
"#9333ea"
|
|
2092
|
-
],
|
|
2093
|
-
function
|
|
2092
|
+
], ar = { l: 42, r: 4, t: 4, b: 30 }, bt = 10, yt = 12;
|
|
2093
|
+
function Bt(e = {}) {
|
|
2094
2094
|
return {
|
|
2095
2095
|
...e,
|
|
2096
|
-
margin:
|
|
2096
|
+
margin: ar,
|
|
2097
2097
|
autosize: !0,
|
|
2098
2098
|
width: void 0,
|
|
2099
2099
|
xaxis: {
|
|
2100
2100
|
...e.xaxis || {},
|
|
2101
2101
|
tickfont: {
|
|
2102
2102
|
...e.xaxis && e.xaxis.tickfont || {},
|
|
2103
|
-
size:
|
|
2103
|
+
size: bt
|
|
2104
2104
|
},
|
|
2105
2105
|
title: {
|
|
2106
2106
|
...e.xaxis && e.xaxis.title || {},
|
|
2107
2107
|
font: {
|
|
2108
2108
|
...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
|
|
2109
|
-
size:
|
|
2109
|
+
size: yt
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
2112
|
},
|
|
@@ -2115,63 +2115,63 @@ function $t(e = {}) {
|
|
|
2115
2115
|
automargin: !0,
|
|
2116
2116
|
tickfont: {
|
|
2117
2117
|
...e.yaxis && e.yaxis.tickfont || {},
|
|
2118
|
-
size:
|
|
2118
|
+
size: bt
|
|
2119
2119
|
},
|
|
2120
2120
|
title: {
|
|
2121
2121
|
...e.yaxis && e.yaxis.title || {},
|
|
2122
2122
|
font: {
|
|
2123
2123
|
...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
|
|
2124
|
-
size:
|
|
2124
|
+
size: yt
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
2127
|
}
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2130
|
+
function cr(e, {
|
|
2131
2131
|
tailScale: t = 5,
|
|
2132
2132
|
colorBy: n = null,
|
|
2133
|
-
palette: r =
|
|
2133
|
+
palette: r = $t,
|
|
2134
2134
|
depthCol: o = W,
|
|
2135
|
-
dipCol: i =
|
|
2136
|
-
azCol: s =
|
|
2135
|
+
dipCol: i = q,
|
|
2136
|
+
azCol: s = X,
|
|
2137
2137
|
template: l = void 0
|
|
2138
2138
|
} = {}) {
|
|
2139
|
-
const
|
|
2139
|
+
const c = e.filter(
|
|
2140
2140
|
(b) => b[o] != null && b[i] != null && b[s] != null
|
|
2141
2141
|
);
|
|
2142
|
-
if (!
|
|
2142
|
+
if (!c.length)
|
|
2143
2143
|
return { data: [], layout: {} };
|
|
2144
2144
|
const a = {};
|
|
2145
|
-
n && [...new Set(
|
|
2146
|
-
a[
|
|
2145
|
+
n && [...new Set(c.map((_) => _[n]).filter((_) => _ != null))].sort().forEach((_, p) => {
|
|
2146
|
+
a[_] = r[p % r.length];
|
|
2147
2147
|
});
|
|
2148
|
-
const
|
|
2149
|
-
for (const b of
|
|
2150
|
-
const
|
|
2151
|
-
|
|
2152
|
-
const
|
|
2153
|
-
|
|
2154
|
-
const
|
|
2148
|
+
const u = /* @__PURE__ */ new Map(), m = [];
|
|
2149
|
+
for (const b of c) {
|
|
2150
|
+
const _ = Number(b[o]), p = Number(b[i]), y = Number(b[s]), M = n ? b[n] ?? "_default" : "_default", z = n ? a[M] ?? "#0f172a" : "#0f172a";
|
|
2151
|
+
u.has(M) || u.set(M, { xs: [], ys: [], dips: [], azs: [], color: z });
|
|
2152
|
+
const O = u.get(M);
|
|
2153
|
+
O.xs.push(p), O.ys.push(_), O.dips.push(p), O.azs.push(y);
|
|
2154
|
+
const k = y * Math.PI / 180, L = t * (Math.abs(p) / 90), $ = Math.sin(k) * L, P = Math.cos(k) * L;
|
|
2155
2155
|
m.push({
|
|
2156
2156
|
type: "line",
|
|
2157
2157
|
x0: p,
|
|
2158
|
-
y0:
|
|
2158
|
+
y0: _,
|
|
2159
2159
|
x1: p + $,
|
|
2160
|
-
y1:
|
|
2160
|
+
y1: _ + P,
|
|
2161
2161
|
line: { color: z, width: 2 }
|
|
2162
2162
|
});
|
|
2163
2163
|
}
|
|
2164
|
-
const d = [], f = n &&
|
|
2165
|
-
for (const [b,
|
|
2164
|
+
const d = [], f = n && u.size > 1;
|
|
2165
|
+
for (const [b, _] of u.entries())
|
|
2166
2166
|
d.push({
|
|
2167
2167
|
type: "scatter",
|
|
2168
|
-
x:
|
|
2169
|
-
y:
|
|
2168
|
+
x: _.xs,
|
|
2169
|
+
y: _.ys,
|
|
2170
2170
|
mode: "markers",
|
|
2171
2171
|
name: b !== "_default" ? String(b) : void 0,
|
|
2172
|
-
marker: { size: 8, color:
|
|
2172
|
+
marker: { size: 8, color: _.color },
|
|
2173
2173
|
showlegend: f && b !== "_default",
|
|
2174
|
-
customdata:
|
|
2174
|
+
customdata: _.dips.map((p, y) => [p, _.azs[y]]),
|
|
2175
2175
|
hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
|
|
2176
2176
|
});
|
|
2177
2177
|
return { data: d, layout: {
|
|
@@ -2187,14 +2187,14 @@ function ar(e, {
|
|
|
2187
2187
|
},
|
|
2188
2188
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
2189
2189
|
showlegend: !!f,
|
|
2190
|
-
template: l !== void 0 ? l :
|
|
2190
|
+
template: l !== void 0 ? l : Oe
|
|
2191
2191
|
} };
|
|
2192
2192
|
}
|
|
2193
|
-
function
|
|
2193
|
+
function Mi(e, {
|
|
2194
2194
|
labelCol: t = "structure_type",
|
|
2195
|
-
palette: n =
|
|
2196
|
-
fromCol: r =
|
|
2197
|
-
toCol: o =
|
|
2195
|
+
palette: n = $t,
|
|
2196
|
+
fromCol: r = S,
|
|
2197
|
+
toCol: o = T,
|
|
2198
2198
|
template: i = void 0
|
|
2199
2199
|
} = {}) {
|
|
2200
2200
|
const s = e.filter((d) => d[r] != null && d[o] != null && Number(d[o]) > Number(d[r])).filter((d) => {
|
|
@@ -2205,7 +2205,7 @@ function ui(e, {
|
|
|
2205
2205
|
}).map((d) => ({ from: Number(d[r]), to: Number(d[o]), label: String(d[t]).trim() })).sort((d, f) => d.from - f.from);
|
|
2206
2206
|
if (!s.length)
|
|
2207
2207
|
return { data: [], layout: {} };
|
|
2208
|
-
const l = [],
|
|
2208
|
+
const l = [], c = [], a = [];
|
|
2209
2209
|
return s.forEach((d, f) => {
|
|
2210
2210
|
l.push({
|
|
2211
2211
|
type: "rect",
|
|
@@ -2218,23 +2218,23 @@ function ui(e, {
|
|
|
2218
2218
|
fillcolor: n[f % n.length],
|
|
2219
2219
|
line: { width: 0 },
|
|
2220
2220
|
layer: "below"
|
|
2221
|
-
}),
|
|
2221
|
+
}), c.push(0.5 * (d.from + d.to)), a.push(d.label);
|
|
2222
2222
|
}), { data: [{
|
|
2223
2223
|
type: "scatter",
|
|
2224
2224
|
x: Array(a.length).fill(0.5),
|
|
2225
|
-
y:
|
|
2225
|
+
y: c,
|
|
2226
2226
|
mode: "text",
|
|
2227
2227
|
text: a,
|
|
2228
2228
|
textposition: "middle center",
|
|
2229
2229
|
showlegend: !1,
|
|
2230
2230
|
hoverinfo: "text"
|
|
2231
|
-
}], layout:
|
|
2231
|
+
}], layout: Bt({
|
|
2232
2232
|
shapes: l,
|
|
2233
2233
|
height: 400,
|
|
2234
2234
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
2235
2235
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
2236
2236
|
showlegend: !1,
|
|
2237
|
-
template: i !== void 0 ? i :
|
|
2237
|
+
template: i !== void 0 ? i : Oe
|
|
2238
2238
|
}) };
|
|
2239
2239
|
}
|
|
2240
2240
|
function gt(e, t) {
|
|
@@ -2245,26 +2245,26 @@ function gt(e, t) {
|
|
|
2245
2245
|
o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
|
|
2246
2246
|
return o && r.push(o), r.join("<br>");
|
|
2247
2247
|
}
|
|
2248
|
-
function
|
|
2248
|
+
function ur(e, {
|
|
2249
2249
|
commentCol: t = "comments",
|
|
2250
|
-
fromCol: n =
|
|
2251
|
-
toCol: r =
|
|
2250
|
+
fromCol: n = S,
|
|
2251
|
+
toCol: r = T,
|
|
2252
2252
|
bgColor: o = "#f1f5f9",
|
|
2253
2253
|
borderColor: i = "#cbd5e1",
|
|
2254
2254
|
textColor: s = "#1e293b",
|
|
2255
2255
|
charsPerLine: l = 18,
|
|
2256
|
-
template:
|
|
2256
|
+
template: c = void 0
|
|
2257
2257
|
} = {}) {
|
|
2258
2258
|
const a = e.filter((p) => p[n] != null && p[r] != null && Number(p[r]) > Number(p[n])).map((p) => {
|
|
2259
|
-
const
|
|
2259
|
+
const y = p[t], M = y != null && String(y).trim() !== "" && String(y) !== "null" ? String(y).trim() : "";
|
|
2260
2260
|
return { from: Number(p[n]), to: Number(p[r]), comment: M };
|
|
2261
|
-
}).sort((p,
|
|
2261
|
+
}).sort((p, y) => p.from - y.from);
|
|
2262
2262
|
if (!a.length)
|
|
2263
2263
|
return { data: [], layout: {} };
|
|
2264
|
-
const
|
|
2264
|
+
const u = [], m = [], d = [], f = [], h = [];
|
|
2265
2265
|
for (const p of a) {
|
|
2266
|
-
const
|
|
2267
|
-
|
|
2266
|
+
const y = 0.5 * (p.from + p.to), M = !!p.comment;
|
|
2267
|
+
u.push({
|
|
2268
2268
|
type: "rect",
|
|
2269
2269
|
xref: "x",
|
|
2270
2270
|
yref: "y",
|
|
@@ -2275,7 +2275,7 @@ function cr(e, {
|
|
|
2275
2275
|
fillcolor: M ? o : "rgba(0,0,0,0)",
|
|
2276
2276
|
line: { color: i, width: 1 },
|
|
2277
2277
|
layer: "below"
|
|
2278
|
-
}), M && (m.push(0.5), d.push(
|
|
2278
|
+
}), M && (m.push(0.5), d.push(y), f.push(gt(p.comment, l)), h.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${gt(p.comment, 40)}`));
|
|
2279
2279
|
}
|
|
2280
2280
|
return { data: m.length ? [{
|
|
2281
2281
|
type: "scatter",
|
|
@@ -2288,25 +2288,25 @@ function cr(e, {
|
|
|
2288
2288
|
hovertext: h,
|
|
2289
2289
|
hoverinfo: "text",
|
|
2290
2290
|
showlegend: !1
|
|
2291
|
-
}] : [], layout:
|
|
2292
|
-
shapes:
|
|
2291
|
+
}] : [], layout: Bt({
|
|
2292
|
+
shapes: u,
|
|
2293
2293
|
height: 400,
|
|
2294
2294
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
2295
2295
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
2296
2296
|
showlegend: !1,
|
|
2297
|
-
template:
|
|
2297
|
+
template: c !== void 0 ? c : Oe
|
|
2298
2298
|
}) };
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2300
|
+
function zi(e, {
|
|
2301
2301
|
symbolSize: t = 10,
|
|
2302
2302
|
xCol: n = "easting",
|
|
2303
2303
|
yCol: r = "northing"
|
|
2304
2304
|
} = {}) {
|
|
2305
|
-
const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[
|
|
2305
|
+
const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[q] != null ? Number(e[q]) : null, l = e[X] != null ? Number(e[X]) : null;
|
|
2306
2306
|
if (o === null || i === null || s === null || l === null) return null;
|
|
2307
|
-
const
|
|
2307
|
+
const c = (l - 90 + 360) % 360, a = c * Math.PI / 180, u = l * Math.PI / 180, m = t * Math.sin(a), d = t * Math.cos(a), f = t * 0.4 * (s / 90), h = f * Math.sin(u), b = f * Math.cos(u);
|
|
2308
2308
|
return {
|
|
2309
|
-
strike:
|
|
2309
|
+
strike: c,
|
|
2310
2310
|
dipValue: s,
|
|
2311
2311
|
x: o,
|
|
2312
2312
|
y: i,
|
|
@@ -2318,106 +2318,106 @@ function di(e, {
|
|
|
2318
2318
|
tickY1: i + b
|
|
2319
2319
|
};
|
|
2320
2320
|
}
|
|
2321
|
-
const
|
|
2322
|
-
function
|
|
2321
|
+
const Rt = "markers+line";
|
|
2322
|
+
function dr(e, t) {
|
|
2323
2323
|
var r;
|
|
2324
2324
|
const n = et(e);
|
|
2325
|
-
return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) ||
|
|
2325
|
+
return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Rt;
|
|
2326
2326
|
}
|
|
2327
|
-
function
|
|
2328
|
-
const s =
|
|
2327
|
+
function vi({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o, template: i }) {
|
|
2328
|
+
const s = Se(null), l = t == null ? void 0 : t.hole, c = (t == null ? void 0 : t.points) || [], a = (e == null ? void 0 : e.property) || "", u = (e == null ? void 0 : e.chartType) || Rt, m = (e == null ? void 0 : e.holeId) || "", d = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? ke : t != null && t.isCategorical ? Le : Ae), f = et(d), h = dr(d, u), [b, _] = Q("");
|
|
2329
2329
|
return se(() => {
|
|
2330
|
-
const p = d ===
|
|
2331
|
-
if (!l || !a || !p && !
|
|
2330
|
+
const p = d === ke, y = d === Je;
|
|
2331
|
+
if (!l || !a || !p && !y && c.length === 0) return;
|
|
2332
2332
|
const M = s.current;
|
|
2333
2333
|
if (!M) return;
|
|
2334
2334
|
let z;
|
|
2335
2335
|
try {
|
|
2336
|
-
p ? z =
|
|
2337
|
-
points:
|
|
2338
|
-
isCategorical: d ===
|
|
2336
|
+
p ? z = ur(c, { commentCol: a, fromCol: "from", toCol: "to" }) : y ? z = cr(c) : z = Tt({
|
|
2337
|
+
points: c,
|
|
2338
|
+
isCategorical: d === Le,
|
|
2339
2339
|
property: a,
|
|
2340
2340
|
chartType: h,
|
|
2341
2341
|
template: i
|
|
2342
2342
|
});
|
|
2343
|
-
} catch (
|
|
2344
|
-
console.error("Plot build error",
|
|
2343
|
+
} catch (k) {
|
|
2344
|
+
console.error("Plot build error", k), _((k == null ? void 0 : k.message) || "Plot build error");
|
|
2345
2345
|
return;
|
|
2346
2346
|
}
|
|
2347
2347
|
if ((!(z != null && z.data) || z.data.length === 0) && !p)
|
|
2348
2348
|
return;
|
|
2349
|
-
const
|
|
2349
|
+
const O = {
|
|
2350
2350
|
displayModeBar: !0,
|
|
2351
2351
|
responsive: !0,
|
|
2352
2352
|
useResizeHandler: !0,
|
|
2353
2353
|
modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
|
|
2354
2354
|
};
|
|
2355
2355
|
try {
|
|
2356
|
-
|
|
2356
|
+
_(""), Fe.react(M, z.data, z.layout, O), requestAnimationFrame(() => {
|
|
2357
2357
|
M && M.parentElement && Fe.Plots.resize(M);
|
|
2358
2358
|
});
|
|
2359
|
-
} catch (
|
|
2360
|
-
console.error("Plot render error",
|
|
2359
|
+
} catch (k) {
|
|
2360
|
+
console.error("Plot render error", k), _((k == null ? void 0 : k.message) || "Plot render error");
|
|
2361
2361
|
}
|
|
2362
2362
|
return () => {
|
|
2363
2363
|
if (M)
|
|
2364
2364
|
try {
|
|
2365
2365
|
Fe.purge(M);
|
|
2366
|
-
} catch (
|
|
2367
|
-
console.warn("Plot purge error",
|
|
2366
|
+
} catch (k) {
|
|
2367
|
+
console.warn("Plot purge error", k);
|
|
2368
2368
|
}
|
|
2369
2369
|
};
|
|
2370
|
-
}, [l, a, h, d,
|
|
2370
|
+
}, [l, a, h, d, c, i]), se(() => {
|
|
2371
2371
|
const p = s.current;
|
|
2372
2372
|
if (!p || typeof ResizeObserver > "u") return;
|
|
2373
|
-
const
|
|
2373
|
+
const y = new ResizeObserver(() => {
|
|
2374
2374
|
try {
|
|
2375
2375
|
p && p.data && Fe.Plots.resize(p);
|
|
2376
2376
|
} catch (M) {
|
|
2377
2377
|
console.warn("Plot resize error", M);
|
|
2378
2378
|
}
|
|
2379
2379
|
});
|
|
2380
|
-
return
|
|
2381
|
-
}, []), !l || !a ? /* @__PURE__ */
|
|
2380
|
+
return y.observe(p), () => y.disconnect();
|
|
2381
|
+
}, []), !l || !a ? /* @__PURE__ */ D("div", { className: "plot-card empty", children: /* @__PURE__ */ D("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== ke && d !== Je && c.length === 0 ? /* @__PURE__ */ D("div", { className: "plot-card empty", children: /* @__PURE__ */ D("div", { className: "placeholder", children: "No data" }) }) : b ? /* @__PURE__ */ D("div", { className: "plot-card empty", children: /* @__PURE__ */ J("div", { className: "placeholder", children: [
|
|
2382
2382
|
"Plot error: ",
|
|
2383
2383
|
b
|
|
2384
2384
|
] }) }) : /* @__PURE__ */ J("div", { className: "plot-card", children: [
|
|
2385
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ D("div", { className: "plot-title", children: /* @__PURE__ */ D(
|
|
2386
2386
|
"select",
|
|
2387
2387
|
{
|
|
2388
2388
|
className: "plot-select",
|
|
2389
2389
|
value: m,
|
|
2390
2390
|
onChange: (p) => o && o({ holeId: p.target.value }),
|
|
2391
2391
|
children: n.map((p) => {
|
|
2392
|
-
const
|
|
2393
|
-
return /* @__PURE__ */
|
|
2392
|
+
const y = typeof p == "string" ? p : p.holeId, M = typeof p == "string" ? p : p.label || p.holeId;
|
|
2393
|
+
return /* @__PURE__ */ D("option", { value: y, children: M }, y);
|
|
2394
2394
|
})
|
|
2395
2395
|
}
|
|
2396
2396
|
) }),
|
|
2397
2397
|
/* @__PURE__ */ J("div", { className: "plot-controls column", children: [
|
|
2398
|
-
r.length > 0 && /* @__PURE__ */
|
|
2398
|
+
r.length > 0 && /* @__PURE__ */ D(
|
|
2399
2399
|
"select",
|
|
2400
2400
|
{
|
|
2401
2401
|
className: "plot-select",
|
|
2402
2402
|
value: a,
|
|
2403
2403
|
onChange: (p) => o && o({ property: p.target.value }),
|
|
2404
|
-
children: r.map((p) => /* @__PURE__ */
|
|
2404
|
+
children: r.map((p) => /* @__PURE__ */ D("option", { value: p, children: p }, p))
|
|
2405
2405
|
}
|
|
2406
2406
|
),
|
|
2407
|
-
f.length > 1 && /* @__PURE__ */
|
|
2407
|
+
f.length > 1 && /* @__PURE__ */ D(
|
|
2408
2408
|
"select",
|
|
2409
2409
|
{
|
|
2410
2410
|
className: "plot-select",
|
|
2411
2411
|
value: h,
|
|
2412
2412
|
onChange: (p) => o && o({ chartType: p.target.value }),
|
|
2413
|
-
children: f.map((p) => /* @__PURE__ */
|
|
2413
|
+
children: f.map((p) => /* @__PURE__ */ D("option", { value: p.value, children: p.label }, p.value))
|
|
2414
2414
|
}
|
|
2415
2415
|
)
|
|
2416
2416
|
] }),
|
|
2417
|
-
/* @__PURE__ */
|
|
2417
|
+
/* @__PURE__ */ D("div", { className: "plotly-chart", ref: s })
|
|
2418
2418
|
] });
|
|
2419
2419
|
}
|
|
2420
|
-
function
|
|
2420
|
+
function _t(e, t) {
|
|
2421
2421
|
if (!(t != null && t.length)) return e;
|
|
2422
2422
|
const n = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
|
|
2423
2423
|
for (const r of t) {
|
|
@@ -2431,7 +2431,7 @@ function yt(e, t) {
|
|
|
2431
2431
|
}
|
|
2432
2432
|
return Array.from(n.values());
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function mr(e, t) {
|
|
2435
2435
|
if (!e || !t) return [];
|
|
2436
2436
|
const n = /* @__PURE__ */ new Set(), r = [];
|
|
2437
2437
|
for (const o of e.points || []) {
|
|
@@ -2442,69 +2442,69 @@ function dr(e, t) {
|
|
|
2442
2442
|
}
|
|
2443
2443
|
return r;
|
|
2444
2444
|
}
|
|
2445
|
-
function
|
|
2445
|
+
function Ei({
|
|
2446
2446
|
initialFocusedHoleId: e = "",
|
|
2447
2447
|
sourceFile: t = null,
|
|
2448
2448
|
extraHoles: n = [],
|
|
2449
2449
|
plotCount: r = 4
|
|
2450
2450
|
} = {}) {
|
|
2451
|
-
const [o, i] = Q([]), [s, l] = Q([]), [
|
|
2451
|
+
const [o, i] = Q([]), [s, l] = Q([]), [c, a] = Q([]), [u, m] = Q([]), [d, f] = Q([]), [h, b] = Q({}), [_, p] = Q(""), [y, M] = Q([]), [z, O] = Q(""), [k, L] = Q(e || ""), [$, P] = Q([]), v = Se(null);
|
|
2452
2452
|
se(() => {
|
|
2453
|
-
!t ||
|
|
2454
|
-
if (!
|
|
2455
|
-
const
|
|
2456
|
-
l(
|
|
2457
|
-
holeIds:
|
|
2458
|
-
focusedHoleId:
|
|
2453
|
+
!t || v.current === t || (v.current = t, En(t).then((A) => {
|
|
2454
|
+
if (!A) return;
|
|
2455
|
+
const E = Array.from(new Map(A.map((N) => [N.holeId, N])).values());
|
|
2456
|
+
l(E), M(Dt({
|
|
2457
|
+
holeIds: E.map((N) => N.holeId),
|
|
2458
|
+
focusedHoleId: k,
|
|
2459
2459
|
plotCount: r,
|
|
2460
2460
|
defaultProp: "",
|
|
2461
|
-
categoricalProps:
|
|
2461
|
+
categoricalProps: u,
|
|
2462
2462
|
commentProps: d,
|
|
2463
2463
|
numericDefaultChartType: "markers+line"
|
|
2464
2464
|
}));
|
|
2465
|
-
}).catch((
|
|
2466
|
-
console.info("Assay metadata load skipped:",
|
|
2465
|
+
}).catch((A) => {
|
|
2466
|
+
console.info("Assay metadata load skipped:", A.message);
|
|
2467
2467
|
}));
|
|
2468
|
-
}, [t,
|
|
2468
|
+
}, [t, k, r, u, d]), se(() => {
|
|
2469
2469
|
if (!(n != null && n.length)) return;
|
|
2470
|
-
const
|
|
2471
|
-
l((
|
|
2472
|
-
const N = new Set(
|
|
2473
|
-
return B.length ? [...
|
|
2470
|
+
const A = n.map((E) => ({ holeId: E.id || E.holeId })).filter((E) => E.holeId);
|
|
2471
|
+
l((E) => {
|
|
2472
|
+
const N = new Set(E.map((I) => I.holeId)), B = A.filter((I) => !N.has(I.holeId));
|
|
2473
|
+
return B.length ? [...E, ...B] : E;
|
|
2474
2474
|
});
|
|
2475
2475
|
}, [n]), se(() => {
|
|
2476
|
-
|
|
2477
|
-
}, [
|
|
2476
|
+
O((A) => A && A.startsWith("Loading ") && A.includes(" for hole ") ? A : "");
|
|
2477
|
+
}, [y]), se(() => {
|
|
2478
2478
|
if (!s.length) {
|
|
2479
2479
|
M([]);
|
|
2480
2480
|
return;
|
|
2481
2481
|
}
|
|
2482
|
-
const
|
|
2483
|
-
M((
|
|
2482
|
+
const A = Ct(s.map((E) => E.holeId), k);
|
|
2483
|
+
M((E) => Array.from({ length: r }).map((B, I) => {
|
|
2484
2484
|
var K;
|
|
2485
|
-
const G =
|
|
2485
|
+
const G = E[I] || {}, U = s.some((le) => le.holeId === G.holeId) ? G.holeId : A[I] || ((K = s[I]) == null ? void 0 : K.holeId) || "", j = G.property || _, Z = Te({
|
|
2486
2486
|
property: j,
|
|
2487
2487
|
chartType: G.chartType,
|
|
2488
|
-
categoricalProps:
|
|
2488
|
+
categoricalProps: u,
|
|
2489
2489
|
commentProps: d,
|
|
2490
2490
|
numericDefaultChartType: "markers+line"
|
|
2491
2491
|
});
|
|
2492
2492
|
return { holeId: U, property: j, chartType: Z };
|
|
2493
2493
|
}));
|
|
2494
|
-
}, [s,
|
|
2494
|
+
}, [s, k, _, u, d, r]), se(() => {
|
|
2495
2495
|
if (!t) return;
|
|
2496
|
-
|
|
2497
|
-
const N = o.some((I) => (I.id || I.holeId) ===
|
|
2498
|
-
N || B || (P((I) => [...I,
|
|
2499
|
-
P((G) => G.filter((U) => U !==
|
|
2500
|
-
const U =
|
|
2501
|
-
[...G.filter((Z) => (Z.id || Z.holeId) !==
|
|
2496
|
+
y.map((E) => E.holeId).filter(Boolean).forEach((E) => {
|
|
2497
|
+
const N = o.some((I) => (I.id || I.holeId) === E), B = $.includes(E);
|
|
2498
|
+
N || B || (P((I) => [...I, E]), xn(t, E).then((I) => {
|
|
2499
|
+
P((G) => G.filter((U) => U !== E)), I && i((G) => {
|
|
2500
|
+
const U = _t(
|
|
2501
|
+
[...G.filter((Z) => (Z.id || Z.holeId) !== E), I],
|
|
2502
2502
|
n
|
|
2503
2503
|
), j = Be(U);
|
|
2504
|
-
return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), b(j.columnMeta), !
|
|
2504
|
+
return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), b(j.columnMeta), !_ && j.defaultProp && (p(j.defaultProp), M((Z) => Z.map((K) => ({
|
|
2505
2505
|
...K,
|
|
2506
2506
|
property: K.property || j.defaultProp,
|
|
2507
|
-
chartType:
|
|
2507
|
+
chartType: Te({
|
|
2508
2508
|
property: K.property || j.defaultProp,
|
|
2509
2509
|
chartType: K.chartType,
|
|
2510
2510
|
categoricalProps: j.categoricalProps,
|
|
@@ -2514,74 +2514,74 @@ function fi({
|
|
|
2514
2514
|
})))), U;
|
|
2515
2515
|
});
|
|
2516
2516
|
}).catch((I) => {
|
|
2517
|
-
console.error(I), P((G) => G.filter((U) => U !==
|
|
2517
|
+
console.error(I), P((G) => G.filter((U) => U !== E)), O(I.message || `Error loading hole ${E}`);
|
|
2518
2518
|
}));
|
|
2519
2519
|
});
|
|
2520
|
-
}, [
|
|
2521
|
-
n != null && n.length && i((
|
|
2522
|
-
if (!
|
|
2520
|
+
}, [y, t, o, $, _, n]), se(() => {
|
|
2521
|
+
n != null && n.length && i((A) => {
|
|
2522
|
+
if (!A.length) {
|
|
2523
2523
|
const B = Be(n);
|
|
2524
|
-
return a(B.numericProps), m(B.categoricalProps), f(B.commentProps), b(B.columnMeta), !
|
|
2524
|
+
return a(B.numericProps), m(B.categoricalProps), f(B.commentProps), b(B.columnMeta), !_ && B.defaultProp && p(B.defaultProp), n;
|
|
2525
2525
|
}
|
|
2526
|
-
const
|
|
2527
|
-
return a(N.numericProps), m(N.categoricalProps), f(N.commentProps), b(N.columnMeta), !
|
|
2526
|
+
const E = _t(A, n), N = Be(E);
|
|
2527
|
+
return a(N.numericProps), m(N.categoricalProps), f(N.commentProps), b(N.columnMeta), !_ && N.defaultProp && p(N.defaultProp), E;
|
|
2528
2528
|
});
|
|
2529
2529
|
}, [n]);
|
|
2530
2530
|
const F = ne(
|
|
2531
|
-
() => [...
|
|
2532
|
-
[
|
|
2531
|
+
() => [...c, ...u, ...d],
|
|
2532
|
+
[c, u, d]
|
|
2533
2533
|
), C = ne(
|
|
2534
|
-
() => s.map((
|
|
2534
|
+
() => s.map((A) => ({ holeId: A.holeId, label: A.holeId })).sort((A, E) => A.label.localeCompare(E.label)),
|
|
2535
2535
|
[s]
|
|
2536
|
-
),
|
|
2537
|
-
const
|
|
2538
|
-
return Array.from({ length: r }).map((
|
|
2539
|
-
const B =
|
|
2540
|
-
let U = B.property ||
|
|
2536
|
+
), V = ne(() => {
|
|
2537
|
+
const A = [...c, ...u, ...d];
|
|
2538
|
+
return Array.from({ length: r }).map((E, N) => {
|
|
2539
|
+
const B = y[N] || {}, I = o.find((he) => (he.id || he.holeId) === B.holeId) || null, G = I ? A.filter((he) => or(I, he)) : A;
|
|
2540
|
+
let U = B.property || _;
|
|
2541
2541
|
I && !G.includes(U) && (U = G[0] || U);
|
|
2542
|
-
const j = d.includes(U), Z = !j &&
|
|
2542
|
+
const j = d.includes(U), Z = !j && u.includes(U), K = !j && !Z && U === "dip", le = j ? "comment" : K ? "tadpole" : Z ? "categorical" : "numeric", ge = K ? "tadpole" : B.chartType || (j ? "comment" : Z ? "categorical" : "markers+line"), fe = B.holeId || (I == null ? void 0 : I.id) || (I == null ? void 0 : I.holeId) || "", Ce = K ? (I == null ? void 0 : I.points) || [] : j ? mr(I, U) : ir(I, U, Z);
|
|
2543
2543
|
return {
|
|
2544
|
-
config: { holeId: fe, property: U, chartType:
|
|
2544
|
+
config: { holeId: fe, property: U, chartType: ge },
|
|
2545
2545
|
hole: I,
|
|
2546
2546
|
loading: $.includes(B.holeId),
|
|
2547
2547
|
isCategorical: Z,
|
|
2548
2548
|
isComment: j,
|
|
2549
2549
|
isTadpole: K,
|
|
2550
2550
|
displayType: le,
|
|
2551
|
-
points:
|
|
2551
|
+
points: Ce,
|
|
2552
2552
|
propertyOptions: G,
|
|
2553
2553
|
label: fe
|
|
2554
2554
|
};
|
|
2555
2555
|
});
|
|
2556
|
-
}, [
|
|
2556
|
+
}, [y, o, _, u, d, $, r, c]), H = (A, E) => {
|
|
2557
2557
|
M((N) => {
|
|
2558
|
-
const B = [...N], G = { ...B[
|
|
2559
|
-
return
|
|
2560
|
-
property:
|
|
2558
|
+
const B = [...N], G = { ...B[A] || {}, ...E };
|
|
2559
|
+
return E.property && (G.chartType = Te({
|
|
2560
|
+
property: E.property,
|
|
2561
2561
|
chartType: G.chartType,
|
|
2562
|
-
categoricalProps:
|
|
2562
|
+
categoricalProps: u,
|
|
2563
2563
|
commentProps: d,
|
|
2564
2564
|
numericDefaultChartType: "markers+line"
|
|
2565
|
-
})), B[
|
|
2565
|
+
})), B[A] = G, B;
|
|
2566
2566
|
});
|
|
2567
2567
|
};
|
|
2568
2568
|
return {
|
|
2569
2569
|
error: z,
|
|
2570
|
-
focusedHoleId:
|
|
2571
|
-
setFocusedHoleId:
|
|
2572
|
-
setError:
|
|
2570
|
+
focusedHoleId: k,
|
|
2571
|
+
setFocusedHoleId: L,
|
|
2572
|
+
setError: O,
|
|
2573
2573
|
holeCount: s.length,
|
|
2574
|
-
numericProps:
|
|
2575
|
-
categoricalProps:
|
|
2574
|
+
numericProps: c,
|
|
2575
|
+
categoricalProps: u,
|
|
2576
2576
|
commentProps: d,
|
|
2577
2577
|
columnMeta: h,
|
|
2578
2578
|
propertyOptions: F,
|
|
2579
2579
|
labeledHoleOptions: C,
|
|
2580
|
-
traceGraphs:
|
|
2581
|
-
handleConfigChange:
|
|
2580
|
+
traceGraphs: V,
|
|
2581
|
+
handleConfigChange: H
|
|
2582
2582
|
};
|
|
2583
2583
|
}
|
|
2584
|
-
const
|
|
2584
|
+
const fr = [
|
|
2585
2585
|
"#313695",
|
|
2586
2586
|
"#4575b4",
|
|
2587
2587
|
"#74add1",
|
|
@@ -2593,7 +2593,7 @@ const mr = [
|
|
|
2593
2593
|
"#d73027",
|
|
2594
2594
|
"#a50026"
|
|
2595
2595
|
];
|
|
2596
|
-
function
|
|
2596
|
+
function hr(e = [], t = fr) {
|
|
2597
2597
|
const n = e.filter((a) => Number.isFinite(a));
|
|
2598
2598
|
if (!n.length)
|
|
2599
2599
|
return {
|
|
@@ -2603,9 +2603,9 @@ function fr(e = [], t = mr) {
|
|
|
2603
2603
|
bins: [],
|
|
2604
2604
|
colors: t
|
|
2605
2605
|
};
|
|
2606
|
-
const r = n.slice().sort((a,
|
|
2606
|
+
const r = n.slice().sort((a, u) => a - u), o = r[0], i = r[r.length - 1], s = t.length;
|
|
2607
2607
|
if (i === o) {
|
|
2608
|
-
const a = t.map((
|
|
2608
|
+
const a = t.map((u, m) => ({
|
|
2609
2609
|
index: m,
|
|
2610
2610
|
min: o,
|
|
2611
2611
|
max: i,
|
|
@@ -2619,24 +2619,24 @@ function fr(e = [], t = mr) {
|
|
|
2619
2619
|
colors: t
|
|
2620
2620
|
};
|
|
2621
2621
|
}
|
|
2622
|
-
const l = t.map((a,
|
|
2623
|
-
const m =
|
|
2622
|
+
const l = t.map((a, u) => {
|
|
2623
|
+
const m = u / s, d = (u + 1) / s, f = Math.floor(m * r.length), h = Math.min(r.length - 1, Math.floor(d * r.length)), b = r[f], _ = u === s - 1 ? i : r[h];
|
|
2624
2624
|
return {
|
|
2625
|
-
index:
|
|
2625
|
+
index: u,
|
|
2626
2626
|
min: b,
|
|
2627
|
-
max:
|
|
2628
|
-
label:
|
|
2627
|
+
max: _,
|
|
2628
|
+
label: pr(b, _)
|
|
2629
2629
|
};
|
|
2630
|
-
}),
|
|
2630
|
+
}), c = (i - o) / s;
|
|
2631
2631
|
return {
|
|
2632
2632
|
min: o,
|
|
2633
2633
|
max: i,
|
|
2634
|
-
step:
|
|
2634
|
+
step: c,
|
|
2635
2635
|
bins: l,
|
|
2636
2636
|
colors: t
|
|
2637
2637
|
};
|
|
2638
2638
|
}
|
|
2639
|
-
function
|
|
2639
|
+
function pr(e, t) {
|
|
2640
2640
|
const n = (r) => Number.isFinite(r) ? Math.abs(r) >= 1e3 ? r.toFixed(0) : Math.abs(r) >= 10 ? r.toFixed(1) : Math.abs(r) >= 0.1 ? r.toFixed(2) : r.toFixed(3) : "n/a";
|
|
2641
2641
|
return `${n(e)} – ${n(t)}`;
|
|
2642
2642
|
}
|
|
@@ -2652,43 +2652,43 @@ function Vt(e, t) {
|
|
|
2652
2652
|
}
|
|
2653
2653
|
return -1;
|
|
2654
2654
|
}
|
|
2655
|
-
function
|
|
2655
|
+
function br(e, t, n = "#8b1e3f") {
|
|
2656
2656
|
const r = Vt(e, t);
|
|
2657
2657
|
return r < 0 ? n : t.colors[r] || n;
|
|
2658
2658
|
}
|
|
2659
2659
|
function Ht(e) {
|
|
2660
2660
|
return Array.isArray(e) ? e : [];
|
|
2661
2661
|
}
|
|
2662
|
-
function
|
|
2662
|
+
function qe(e) {
|
|
2663
2663
|
const t = Number(e);
|
|
2664
2664
|
return Number.isFinite(t) ? t : void 0;
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2666
|
+
function jt(e = {}) {
|
|
2667
2667
|
return {
|
|
2668
2668
|
...e,
|
|
2669
|
-
x:
|
|
2670
|
-
y:
|
|
2671
|
-
z:
|
|
2669
|
+
x: qe(e.x),
|
|
2670
|
+
y: qe(e.y),
|
|
2671
|
+
z: qe(e.z)
|
|
2672
2672
|
};
|
|
2673
2673
|
}
|
|
2674
|
-
function
|
|
2674
|
+
function yr(e = [], t = [0, 0], n = 0) {
|
|
2675
2675
|
const [r, o] = t, i = Number(n) * Math.PI / 180, s = Math.cos(i), l = Math.sin(i);
|
|
2676
|
-
return Ht(e).map(
|
|
2677
|
-
if (!Number.isFinite(
|
|
2678
|
-
const a =
|
|
2676
|
+
return Ht(e).map(jt).map((c) => {
|
|
2677
|
+
if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return { ...c };
|
|
2678
|
+
const a = c.x - r, u = c.y - o;
|
|
2679
2679
|
return {
|
|
2680
|
-
...
|
|
2681
|
-
along: a * l +
|
|
2682
|
-
across: a * s -
|
|
2680
|
+
...c,
|
|
2681
|
+
along: a * l + u * s,
|
|
2682
|
+
across: a * s - u * l
|
|
2683
2683
|
};
|
|
2684
2684
|
});
|
|
2685
2685
|
}
|
|
2686
2686
|
function gr(e = [], t = [0, 0], n = 0, r = 50) {
|
|
2687
|
-
const o =
|
|
2687
|
+
const o = yr(e, t, n), i = 0.5 * Number(r || 0);
|
|
2688
2688
|
return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
|
|
2689
2689
|
}
|
|
2690
|
-
function
|
|
2691
|
-
let r = Ht(e).map(
|
|
2690
|
+
function xi(e = [], t = null, n = null) {
|
|
2691
|
+
let r = Ht(e).map(jt);
|
|
2692
2692
|
if (Array.isArray(t) && t.length === 2) {
|
|
2693
2693
|
const [o, i] = t;
|
|
2694
2694
|
r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
|
|
@@ -2698,7 +2698,7 @@ function hi(e = [], t = null, n = null) {
|
|
|
2698
2698
|
color_value: o == null ? void 0 : o[n]
|
|
2699
2699
|
}))), r;
|
|
2700
2700
|
}
|
|
2701
|
-
function
|
|
2701
|
+
function ki(e = [], t = [0, 0], n = 0, r = 50, o = null) {
|
|
2702
2702
|
let i = gr(e, t, n, r);
|
|
2703
2703
|
return o && (i = i.map((s) => ({
|
|
2704
2704
|
...s,
|
|
@@ -2715,7 +2715,7 @@ function Ne(e, t = void 0) {
|
|
|
2715
2715
|
const n = Number(e);
|
|
2716
2716
|
return Number.isFinite(n) ? n : t;
|
|
2717
2717
|
}
|
|
2718
|
-
function
|
|
2718
|
+
function Ai(e = [], t = null) {
|
|
2719
2719
|
const n = /* @__PURE__ */ new Map();
|
|
2720
2720
|
rt(e).forEach((o) => {
|
|
2721
2721
|
const i = ot(o);
|
|
@@ -2725,17 +2725,17 @@ function bi(e = [], t = null) {
|
|
|
2725
2725
|
});
|
|
2726
2726
|
const r = [];
|
|
2727
2727
|
return n.forEach((o, i) => {
|
|
2728
|
-
const s = [...o].sort((
|
|
2728
|
+
const s = [...o].sort((c, a) => Ne(c.md, 0) - Ne(a.md, 0)), l = {
|
|
2729
2729
|
hole_id: i,
|
|
2730
|
-
x: s.map((
|
|
2731
|
-
y: s.map((
|
|
2732
|
-
z: s.map((
|
|
2730
|
+
x: s.map((c) => Ne(c.x, 0)),
|
|
2731
|
+
y: s.map((c) => Ne(c.y, 0)),
|
|
2732
|
+
z: s.map((c) => Ne(c.z, 0)),
|
|
2733
2733
|
color: null
|
|
2734
2734
|
};
|
|
2735
|
-
t && (l.color = s.map((
|
|
2735
|
+
t && (l.color = s.map((c) => c == null ? void 0 : c[t])), r.push(l);
|
|
2736
2736
|
}), r;
|
|
2737
2737
|
}
|
|
2738
|
-
function
|
|
2738
|
+
function Ii(e = [], t = 1, n = null) {
|
|
2739
2739
|
return rt(e).map((r) => ({
|
|
2740
2740
|
hole_id: ot(r),
|
|
2741
2741
|
from: r == null ? void 0 : r.from,
|
|
@@ -2745,7 +2745,7 @@ function gi(e = [], t = 1, n = null) {
|
|
|
2745
2745
|
value: n ? r == null ? void 0 : r[n] : null
|
|
2746
2746
|
}));
|
|
2747
2747
|
}
|
|
2748
|
-
function
|
|
2748
|
+
function Oi(e = [], t = null) {
|
|
2749
2749
|
return t ? rt(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
|
|
2750
2750
|
hole_id: ot(n),
|
|
2751
2751
|
label: n == null ? void 0 : n[t],
|
|
@@ -2759,7 +2759,7 @@ function Me(e) {
|
|
|
2759
2759
|
...e.structuralMeshes
|
|
2760
2760
|
];
|
|
2761
2761
|
}
|
|
2762
|
-
const
|
|
2762
|
+
const _r = {
|
|
2763
2763
|
bedding: "#2563eb",
|
|
2764
2764
|
foliation: "#16a34a",
|
|
2765
2765
|
joint: "#9333ea",
|
|
@@ -2768,13 +2768,13 @@ const yr = {
|
|
|
2768
2768
|
"shear zone": "#0ea5e9",
|
|
2769
2769
|
"fault zone": "#ef4444"
|
|
2770
2770
|
};
|
|
2771
|
-
function _r(e, t) {
|
|
2772
|
-
const n = t || yr, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
|
|
2773
|
-
return new _.Color(o).getHex();
|
|
2774
|
-
}
|
|
2775
2771
|
function Nr(e, t) {
|
|
2772
|
+
const n = t || _r, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
|
|
2773
|
+
return new g.Color(o).getHex();
|
|
2774
|
+
}
|
|
2775
|
+
function Mr(e, t) {
|
|
2776
2776
|
const n = e * Math.PI / 180, r = t * Math.PI / 180;
|
|
2777
|
-
return new
|
|
2777
|
+
return new g.Vector3(
|
|
2778
2778
|
Math.sin(r) * Math.sin(n),
|
|
2779
2779
|
// East component
|
|
2780
2780
|
Math.cos(r) * Math.sin(n),
|
|
@@ -2783,32 +2783,32 @@ function Nr(e, t) {
|
|
|
2783
2783
|
// Up component
|
|
2784
2784
|
).normalize();
|
|
2785
2785
|
}
|
|
2786
|
-
function
|
|
2786
|
+
function zr(e, t = {}) {
|
|
2787
2787
|
const {
|
|
2788
2788
|
radius: n = 5,
|
|
2789
2789
|
discThickness: r = 0.2,
|
|
2790
2790
|
opacity: o = 0.7,
|
|
2791
2791
|
segments: i = 32,
|
|
2792
2792
|
colorMap: s = null
|
|
2793
|
-
} = t, l = new
|
|
2793
|
+
} = t, l = new g.Group(), c = new g.Vector3(0, 1, 0);
|
|
2794
2794
|
for (const a of e) {
|
|
2795
|
-
const
|
|
2796
|
-
if (
|
|
2797
|
-
const f = a[
|
|
2795
|
+
const u = a.x != null ? a.x : a.easting != null ? a.easting : null, m = a.y != null ? a.y : a.northing != null ? a.northing : null, d = a.z != null ? a.z : a.elevation != null ? a.elevation : null;
|
|
2796
|
+
if (u == null || m == null || d == null || !Number.isFinite(u) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
|
|
2797
|
+
const f = a[q] != null ? Number(a[q]) : null, h = a[X] != null ? Number(a[X]) : null;
|
|
2798
2798
|
let b;
|
|
2799
2799
|
if (a.nx != null && Number.isFinite(a.nx) && a.ny != null && Number.isFinite(a.ny) && a.nz != null && Number.isFinite(a.nz))
|
|
2800
|
-
b = new
|
|
2800
|
+
b = new g.Vector3(a.nx, a.ny, a.nz).normalize();
|
|
2801
2801
|
else {
|
|
2802
2802
|
if (f == null || h == null || !Number.isFinite(f) || !Number.isFinite(h)) continue;
|
|
2803
|
-
b =
|
|
2803
|
+
b = Mr(f, h);
|
|
2804
2804
|
}
|
|
2805
|
-
const
|
|
2806
|
-
color:
|
|
2805
|
+
const _ = new g.CylinderGeometry(n, n, r, i, 1, !1), p = new g.MeshStandardMaterial({
|
|
2806
|
+
color: Nr(a.structure_type, s),
|
|
2807
2807
|
transparent: !0,
|
|
2808
2808
|
opacity: o,
|
|
2809
|
-
side:
|
|
2810
|
-
}),
|
|
2811
|
-
|
|
2809
|
+
side: g.DoubleSide
|
|
2810
|
+
}), y = new g.Mesh(_, p);
|
|
2811
|
+
y.position.set(u, m, d), y.quaternion.setFromUnitVectors(c, b), y.userData = {
|
|
2812
2812
|
type: "structure",
|
|
2813
2813
|
hole_id: a.hole_id,
|
|
2814
2814
|
depth: a.depth ?? a.mid,
|
|
@@ -2816,26 +2816,26 @@ function Mr(e, t = {}) {
|
|
|
2816
2816
|
dip: f,
|
|
2817
2817
|
azimuth: h,
|
|
2818
2818
|
comments: a.comments
|
|
2819
|
-
}, l.add(
|
|
2819
|
+
}, l.add(y);
|
|
2820
2820
|
}
|
|
2821
2821
|
return l;
|
|
2822
2822
|
}
|
|
2823
|
-
function
|
|
2824
|
-
if (!e.scene || (
|
|
2823
|
+
function vr(e, t, n, r = {}) {
|
|
2824
|
+
if (!e.scene || (Gt(e), !(t != null && t.length) || !(n != null && n.length))) return;
|
|
2825
2825
|
const { maxDiscs: o = 3e3 } = r;
|
|
2826
2826
|
let i = t;
|
|
2827
2827
|
if (i.length > o) {
|
|
2828
|
-
const
|
|
2829
|
-
for (let
|
|
2830
|
-
a.push(i[Math.floor(
|
|
2828
|
+
const c = i.length / o, a = [];
|
|
2829
|
+
for (let u = 0; u < o; u++)
|
|
2830
|
+
a.push(i[Math.floor(u * c)]);
|
|
2831
2831
|
i = a;
|
|
2832
2832
|
}
|
|
2833
|
-
const s = n.flatMap((
|
|
2834
|
-
l.length && (e.structuralGroup =
|
|
2835
|
-
|
|
2833
|
+
const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = Yn(i, s, r);
|
|
2834
|
+
l.length && (e.structuralGroup = zr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
|
|
2835
|
+
c.isMesh && e.structuralMeshes.push(c);
|
|
2836
2836
|
}), Me(e));
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function Gt(e) {
|
|
2839
2839
|
e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
|
|
2840
2840
|
t.isMesh && (t.geometry.dispose(), t.material.dispose());
|
|
2841
2841
|
}), e.structuralGroup = null), e.structuralMeshes = [], Me(e);
|
|
@@ -2843,8 +2843,103 @@ function jt(e) {
|
|
|
2843
2843
|
function Er(e, t) {
|
|
2844
2844
|
e.structuralGroup && (e.structuralGroup.visible = !!t);
|
|
2845
2845
|
}
|
|
2846
|
-
|
|
2847
|
-
|
|
2846
|
+
let xr = 0;
|
|
2847
|
+
function kr(e) {
|
|
2848
|
+
let t, n, r, o;
|
|
2849
|
+
if ("width" in e || "height" in e || "x" in e && !("maxX" in e)) {
|
|
2850
|
+
const i = Number(e.x ?? 0), s = Number(e.y ?? 0), l = Number(e.width ?? 0), c = Number(e.height ?? 0);
|
|
2851
|
+
t = i, n = s, r = i + l, o = s + c;
|
|
2852
|
+
} else
|
|
2853
|
+
t = Number(e.minX), n = Number(e.minY), r = Number(e.maxX), o = Number(e.maxY);
|
|
2854
|
+
if (r - t <= 0)
|
|
2855
|
+
throw new Error(
|
|
2856
|
+
`Invalid raster bounds: width must be positive (got minX=${t}, maxX=${r})`
|
|
2857
|
+
);
|
|
2858
|
+
if (o - n <= 0)
|
|
2859
|
+
throw new Error(
|
|
2860
|
+
`Invalid raster bounds: height must be positive (got minY=${n}, maxY=${o})`
|
|
2861
|
+
);
|
|
2862
|
+
return { minX: t, minY: n, maxX: r, maxY: o };
|
|
2863
|
+
}
|
|
2864
|
+
function Ar(e) {
|
|
2865
|
+
if (e.type === "texture")
|
|
2866
|
+
return Promise.resolve(e.texture);
|
|
2867
|
+
let t, n = !1;
|
|
2868
|
+
if (e.type === "url")
|
|
2869
|
+
t = e.url;
|
|
2870
|
+
else if (e.type === "file")
|
|
2871
|
+
t = URL.createObjectURL(e.file), n = !0;
|
|
2872
|
+
else
|
|
2873
|
+
return Promise.reject(
|
|
2874
|
+
new Error(`Unsupported raster source type: "${e.type}"`)
|
|
2875
|
+
);
|
|
2876
|
+
return new Promise((r, o) => {
|
|
2877
|
+
new g.TextureLoader().load(
|
|
2878
|
+
t,
|
|
2879
|
+
(s) => {
|
|
2880
|
+
n && URL.revokeObjectURL(t), r(s);
|
|
2881
|
+
},
|
|
2882
|
+
void 0,
|
|
2883
|
+
(s) => {
|
|
2884
|
+
n && URL.revokeObjectURL(t), o(
|
|
2885
|
+
new Error(
|
|
2886
|
+
`Failed to load raster texture from "${t}": ${(s == null ? void 0 : s.message) ?? s}`
|
|
2887
|
+
)
|
|
2888
|
+
);
|
|
2889
|
+
}
|
|
2890
|
+
);
|
|
2891
|
+
});
|
|
2892
|
+
}
|
|
2893
|
+
async function Ci(e) {
|
|
2894
|
+
const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, s = e.id ?? `raster-overlay-${++xr}`, l = e.name ?? s;
|
|
2895
|
+
let c = e.opacity ?? 1;
|
|
2896
|
+
if ((c < 0 || c > 1) && (console.warn(
|
|
2897
|
+
`[baselode] raster overlay "${s}": opacity ${c} is outside [0, 1] — clamped`
|
|
2898
|
+
), c = Math.max(0, Math.min(1, c))), !t) throw new Error("raster overlay: options.source is required");
|
|
2899
|
+
if (!n) throw new Error("raster overlay: options.bounds is required");
|
|
2900
|
+
const a = kr(n), { minX: u, minY: m, maxX: d, maxY: f } = a, h = d - u, b = f - m, _ = (u + d) / 2, p = (m + f) / 2, y = await Ar(t), M = new g.PlaneGeometry(h, b), z = new g.MeshBasicMaterial({
|
|
2901
|
+
map: y,
|
|
2902
|
+
transparent: !0,
|
|
2903
|
+
opacity: c,
|
|
2904
|
+
side: g.DoubleSide,
|
|
2905
|
+
depthWrite: !1
|
|
2906
|
+
}), O = new g.Mesh(M, z);
|
|
2907
|
+
return O.position.set(_, p, r), O.renderOrder = i, O.visible = o, { id: s, name: l, mesh: O, texture: y, bounds: a, elevation: r, opacity: c, visible: o };
|
|
2908
|
+
}
|
|
2909
|
+
function Ir(e, t) {
|
|
2910
|
+
e.scene && (e.rasterOverlays.has(t.id) && it(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
|
|
2911
|
+
}
|
|
2912
|
+
function it(e, t) {
|
|
2913
|
+
var r;
|
|
2914
|
+
const n = e.rasterOverlays.get(t);
|
|
2915
|
+
n && ((r = e.scene) == null || r.remove(n.mesh), n.mesh.geometry.dispose(), n.mesh.material.dispose(), n.texture && n.texture.dispose(), e.rasterOverlays.delete(t));
|
|
2916
|
+
}
|
|
2917
|
+
function Or(e, t, n) {
|
|
2918
|
+
const r = e.rasterOverlays.get(t);
|
|
2919
|
+
if (!r) return;
|
|
2920
|
+
const o = Math.max(0, Math.min(1, Number(n)));
|
|
2921
|
+
r.opacity = o, r.mesh.material.opacity = o, r.mesh.material.needsUpdate = !0;
|
|
2922
|
+
}
|
|
2923
|
+
function Cr(e, t, n) {
|
|
2924
|
+
const r = e.rasterOverlays.get(t);
|
|
2925
|
+
r && (r.visible = !!n, r.mesh.visible = r.visible);
|
|
2926
|
+
}
|
|
2927
|
+
function Dr(e, t, n) {
|
|
2928
|
+
const r = e.rasterOverlays.get(t);
|
|
2929
|
+
r && (r.elevation = Number(n), r.mesh.position.setZ(r.elevation));
|
|
2930
|
+
}
|
|
2931
|
+
function Sr(e, t) {
|
|
2932
|
+
return e.rasterOverlays.get(t);
|
|
2933
|
+
}
|
|
2934
|
+
function Lr(e) {
|
|
2935
|
+
return Array.from(e.rasterOverlays.values());
|
|
2936
|
+
}
|
|
2937
|
+
function Pr(e) {
|
|
2938
|
+
for (const t of [...e.rasterOverlays.keys()])
|
|
2939
|
+
it(e, t);
|
|
2940
|
+
}
|
|
2941
|
+
function st(e) {
|
|
2942
|
+
var n, r, o, i, s, l, c, a, u;
|
|
2848
2943
|
if (!e) return "";
|
|
2849
2944
|
const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
|
|
2850
2945
|
return [
|
|
@@ -2854,12 +2949,12 @@ function it(e) {
|
|
|
2854
2949
|
t((i = e.target) == null ? void 0 : i.x),
|
|
2855
2950
|
t((s = e.target) == null ? void 0 : s.y),
|
|
2856
2951
|
t((l = e.target) == null ? void 0 : l.z),
|
|
2857
|
-
t((
|
|
2952
|
+
t((c = e.up) == null ? void 0 : c.x),
|
|
2858
2953
|
t((a = e.up) == null ? void 0 : a.y),
|
|
2859
|
-
t((
|
|
2954
|
+
t((u = e.up) == null ? void 0 : u.z)
|
|
2860
2955
|
].join("|");
|
|
2861
2956
|
}
|
|
2862
|
-
function
|
|
2957
|
+
function Ut(e) {
|
|
2863
2958
|
return !e.camera || !e.controls ? null : {
|
|
2864
2959
|
camera: {
|
|
2865
2960
|
x: e.camera.position.x,
|
|
@@ -2878,37 +2973,37 @@ function Gt(e) {
|
|
|
2878
2973
|
}
|
|
2879
2974
|
};
|
|
2880
2975
|
}
|
|
2881
|
-
function
|
|
2976
|
+
function Fr(e, t) {
|
|
2882
2977
|
if (!e.camera || !e.controls || !t) return !1;
|
|
2883
2978
|
const n = t.camera || {}, r = t.target || {}, o = t.up || {};
|
|
2884
|
-
return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature =
|
|
2979
|
+
return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature = st(t), !0) : !1;
|
|
2885
2980
|
}
|
|
2886
|
-
function
|
|
2981
|
+
function wr(e) {
|
|
2887
2982
|
if (!e.viewChangeHandler) return;
|
|
2888
2983
|
const t = Date.now();
|
|
2889
2984
|
if (t - e._lastViewEmitMs < 250) return;
|
|
2890
|
-
const n =
|
|
2985
|
+
const n = Ut(e);
|
|
2891
2986
|
if (!n) return;
|
|
2892
|
-
const r =
|
|
2987
|
+
const r = st(n);
|
|
2893
2988
|
r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
|
|
2894
2989
|
}
|
|
2895
|
-
function
|
|
2896
|
-
const l = (t + n) / 2,
|
|
2897
|
-
e.controls.target.set(l,
|
|
2990
|
+
function lt(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
2991
|
+
const l = (t + n) / 2, c = (r + o) / 2, a = (i + s) / 2, u = n - t, m = o - r, d = s - i, h = Math.max(u, m, d, 1) * 2;
|
|
2992
|
+
e.controls.target.set(l, c, a), e.camera.position.set(l + h, c + h, a + h), e.camera.lookAt(l, c, a), e.controls.update();
|
|
2898
2993
|
}
|
|
2899
|
-
function
|
|
2994
|
+
function Tr(e, t = 1e3) {
|
|
2900
2995
|
!e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(t, t, t), e.camera.lookAt(0, 0, 0), e.controls.update());
|
|
2901
2996
|
}
|
|
2902
|
-
function
|
|
2997
|
+
function $r(e, t = 2e3) {
|
|
2903
2998
|
!e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(0, 0, t), e.camera.up.set(0, 1, 0), e.camera.lookAt(0, 0, 0), e.controls.update());
|
|
2904
2999
|
}
|
|
2905
|
-
function
|
|
3000
|
+
function Br(e, t = 0, n = 0) {
|
|
2906
3001
|
e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
|
|
2907
3002
|
}
|
|
2908
|
-
function
|
|
3003
|
+
function Rr(e, t = 1.1) {
|
|
2909
3004
|
!e.controls || typeof e.controls.dollyIn != "function" || typeof e.controls.dollyOut != "function" || (t > 1 ? e.controls.dollyOut(t) : e.controls.dollyIn(1 / t), e.controls.update());
|
|
2910
3005
|
}
|
|
2911
|
-
function
|
|
3006
|
+
function Vr(e, t = 1.2) {
|
|
2912
3007
|
if (!e.lastBounds) return;
|
|
2913
3008
|
const {
|
|
2914
3009
|
minX: n,
|
|
@@ -2917,16 +3012,16 @@ function Dr(e, t = 1.2) {
|
|
|
2917
3012
|
maxY: i,
|
|
2918
3013
|
minZ: s,
|
|
2919
3014
|
maxZ: l
|
|
2920
|
-
} = e.lastBounds,
|
|
3015
|
+
} = e.lastBounds, c = (r - n) * t, a = (i - o) * t, u = (l - s) * t, m = (n + r) / 2, d = (o + i) / 2, f = (s + l) / 2, b = Math.max(c, a, u, 1) * 2;
|
|
2921
3016
|
e.controls.target.set(m, d, f), e.camera.position.set(m + b, d + b, f + b), e.camera.lookAt(m, d, f), e.controls.update();
|
|
2922
3017
|
}
|
|
2923
|
-
const
|
|
2924
|
-
function
|
|
3018
|
+
const Hr = 1, jr = 120;
|
|
3019
|
+
function Gr(e, t) {
|
|
2925
3020
|
if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
|
|
2926
|
-
const n = Math.min(
|
|
2927
|
-
return e.camera.position.copy(r).addScaledVector(a,
|
|
3021
|
+
const n = Math.min(jr, Math.max(Hr, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, s = 2 * o * Math.tan(i / 2), l = n * Math.PI / 180, c = s / (2 * Math.tan(l / 2)), a = e.camera.position.clone().sub(r).normalize();
|
|
3022
|
+
return e.camera.position.copy(r).addScaledVector(a, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
|
|
2928
3023
|
}
|
|
2929
|
-
function
|
|
3024
|
+
function Ur(e, t = "orbit") {
|
|
2930
3025
|
if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
|
|
2931
3026
|
e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
|
|
2932
3027
|
else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
|
|
@@ -2936,36 +3031,36 @@ function Pr(e, t = "orbit") {
|
|
|
2936
3031
|
}
|
|
2937
3032
|
}
|
|
2938
3033
|
const ue = "#9ca3af";
|
|
2939
|
-
function
|
|
3034
|
+
function Nt(e, t) {
|
|
2940
3035
|
const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
|
|
2941
3036
|
if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
|
|
2942
3037
|
const o = Math.min(n, r), i = Math.max(n, r);
|
|
2943
3038
|
return i <= o ? null : { segStart: o, segEnd: i };
|
|
2944
3039
|
}
|
|
2945
|
-
function
|
|
3040
|
+
function Yr(e, t, n) {
|
|
2946
3041
|
let r = 0, o = 0;
|
|
2947
3042
|
for (let s = 0; s < e.length; s += 1) {
|
|
2948
|
-
const l = e[s],
|
|
2949
|
-
if (!Number.isFinite(
|
|
2950
|
-
const m = Math.max(t,
|
|
2951
|
-
f <= 0 || (r +=
|
|
3043
|
+
const l = e[s], c = Number(l == null ? void 0 : l.from), a = Number(l == null ? void 0 : l.to), u = Number(l == null ? void 0 : l.value);
|
|
3044
|
+
if (!Number.isFinite(c) || !Number.isFinite(a) || !Number.isFinite(u) || a <= c) continue;
|
|
3045
|
+
const m = Math.max(t, c), f = Math.min(n, a) - m;
|
|
3046
|
+
f <= 0 || (r += u * f, o += f);
|
|
2952
3047
|
}
|
|
2953
3048
|
if (o <= 0) return null;
|
|
2954
3049
|
const i = r / o;
|
|
2955
3050
|
return Number.isFinite(i) ? i : null;
|
|
2956
3051
|
}
|
|
2957
|
-
function
|
|
2958
|
-
if (!Number.isFinite(e)) return new
|
|
2959
|
-
if (Vt(e, t) < 0) return new
|
|
2960
|
-
const r =
|
|
2961
|
-
return new
|
|
3052
|
+
function Xr(e, t) {
|
|
3053
|
+
if (!Number.isFinite(e)) return new g.Color(ue);
|
|
3054
|
+
if (Vt(e, t) < 0) return new g.Color(ue);
|
|
3055
|
+
const r = br(e, t, ue);
|
|
3056
|
+
return new g.Color(r);
|
|
2962
3057
|
}
|
|
2963
|
-
function
|
|
3058
|
+
function qr(e) {
|
|
2964
3059
|
if (!e || !String(e).trim()) return ue;
|
|
2965
|
-
const t =
|
|
2966
|
-
return "#" + new
|
|
3060
|
+
const t = Yt(String(e).toLowerCase().trim());
|
|
3061
|
+
return "#" + new g.Color().setHSL(t, 0.7, 0.5).getHexString();
|
|
2967
3062
|
}
|
|
2968
|
-
function
|
|
3063
|
+
function Zr(e = {}) {
|
|
2969
3064
|
return {
|
|
2970
3065
|
preserveView: !!e.preserveView,
|
|
2971
3066
|
assayIntervalsByHole: e.assayIntervalsByHole || null,
|
|
@@ -2973,7 +3068,7 @@ function $r(e = {}) {
|
|
|
2973
3068
|
isCategoricalVariable: !!e.isCategoricalVariable
|
|
2974
3069
|
};
|
|
2975
3070
|
}
|
|
2976
|
-
function
|
|
3071
|
+
function Wr(e, t) {
|
|
2977
3072
|
if (!e || !t) return [];
|
|
2978
3073
|
const n = [];
|
|
2979
3074
|
return Object.values(e).forEach((r) => {
|
|
@@ -2989,140 +3084,140 @@ function Ze(e) {
|
|
|
2989
3084
|
project: e.project
|
|
2990
3085
|
};
|
|
2991
3086
|
}
|
|
2992
|
-
function
|
|
3087
|
+
function Kr(e) {
|
|
2993
3088
|
return `${e ?? ""}`.trim().toLowerCase();
|
|
2994
3089
|
}
|
|
2995
|
-
function
|
|
2996
|
-
const n = `${e ?? ""}:${t ?? 0}`, r =
|
|
3090
|
+
function Jr(e, t) {
|
|
3091
|
+
const n = `${e ?? ""}:${t ?? 0}`, r = Yt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new g.Color();
|
|
2997
3092
|
return s.setHSL(i, 1, 0.5), s;
|
|
2998
3093
|
}
|
|
2999
|
-
function
|
|
3094
|
+
function Yt(e) {
|
|
3000
3095
|
const t = `${e ?? ""}`;
|
|
3001
3096
|
let n = 2166136261;
|
|
3002
3097
|
for (let r = 0; r < t.length; r += 1)
|
|
3003
3098
|
n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
|
|
3004
3099
|
return (n >>> 0) / 4294967295;
|
|
3005
3100
|
}
|
|
3006
|
-
function
|
|
3101
|
+
function Qr(e, t, n) {
|
|
3007
3102
|
let r = null, o = 0;
|
|
3008
3103
|
for (const i of e) {
|
|
3009
3104
|
const s = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
|
|
3010
3105
|
if (!Number.isFinite(s) || !Number.isFinite(l)) continue;
|
|
3011
|
-
const
|
|
3012
|
-
|
|
3106
|
+
const c = Math.min(n, l) - Math.max(t, s);
|
|
3107
|
+
c > o && (o = c, r = i == null ? void 0 : i.value);
|
|
3013
3108
|
}
|
|
3014
3109
|
return r;
|
|
3015
3110
|
}
|
|
3016
|
-
function
|
|
3111
|
+
function eo(e, t) {
|
|
3017
3112
|
if (!t || !e) return [];
|
|
3018
3113
|
const n = e.id || e.holeId;
|
|
3019
3114
|
if (!n) return [];
|
|
3020
3115
|
const r = t[n];
|
|
3021
3116
|
if (Array.isArray(r) && r.length) return r;
|
|
3022
|
-
const o =
|
|
3117
|
+
const o = Kr(n);
|
|
3023
3118
|
if (o) {
|
|
3024
3119
|
const i = t[o];
|
|
3025
3120
|
if (Array.isArray(i) && i.length) return i;
|
|
3026
3121
|
}
|
|
3027
3122
|
return [];
|
|
3028
3123
|
}
|
|
3029
|
-
function
|
|
3124
|
+
function to({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
|
|
3030
3125
|
if (!e)
|
|
3031
|
-
return
|
|
3126
|
+
return Jr(r, o);
|
|
3032
3127
|
if (e === "__HAS_ASSAY__") {
|
|
3033
|
-
if (!(t != null && t.length)) return new
|
|
3034
|
-
const
|
|
3035
|
-
return
|
|
3128
|
+
if (!(t != null && t.length)) return new g.Color(ue);
|
|
3129
|
+
const u = Nt(i, s);
|
|
3130
|
+
return u ? t.some((d) => {
|
|
3036
3131
|
const f = Number(d == null ? void 0 : d.from), h = Number(d == null ? void 0 : d.to);
|
|
3037
3132
|
if (!Number.isFinite(f) || !Number.isFinite(h)) return !1;
|
|
3038
|
-
const b = Math.max(
|
|
3039
|
-
return Math.min(
|
|
3040
|
-
}) ? new
|
|
3133
|
+
const b = Math.max(u.segStart, f);
|
|
3134
|
+
return Math.min(u.segEnd, h) > b;
|
|
3135
|
+
}) ? new g.Color("#ff8c42") : new g.Color(ue) : new g.Color(ue);
|
|
3041
3136
|
}
|
|
3042
|
-
if (!(t != null && t.length)) return new
|
|
3043
|
-
const
|
|
3044
|
-
if (!
|
|
3137
|
+
if (!(t != null && t.length)) return new g.Color(ue);
|
|
3138
|
+
const c = Nt(i, s);
|
|
3139
|
+
if (!c) return new g.Color(ue);
|
|
3045
3140
|
if (l) {
|
|
3046
|
-
const
|
|
3047
|
-
return new
|
|
3048
|
-
}
|
|
3049
|
-
const a =
|
|
3050
|
-
return
|
|
3051
|
-
}
|
|
3052
|
-
function
|
|
3053
|
-
if (!e.scene || (
|
|
3054
|
-
const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } =
|
|
3055
|
-
let a = 1 / 0,
|
|
3056
|
-
const b = new
|
|
3057
|
-
t.forEach((p,
|
|
3058
|
-
const z =
|
|
3059
|
-
a = Math.min(a, P.x),
|
|
3060
|
-
const
|
|
3061
|
-
return
|
|
3141
|
+
const u = Qr(t, c.segStart, c.segEnd);
|
|
3142
|
+
return new g.Color(qr(u));
|
|
3143
|
+
}
|
|
3144
|
+
const a = Yr(t, c.segStart, c.segEnd);
|
|
3145
|
+
return Xr(a, n);
|
|
3146
|
+
}
|
|
3147
|
+
function no(e, t, n = {}) {
|
|
3148
|
+
if (!e.scene || (Xt(e), !t || t.length === 0)) return;
|
|
3149
|
+
const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = Zr(n), l = s ? [] : Wr(o, i), c = hr(l);
|
|
3150
|
+
let a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, h = -1 / 0;
|
|
3151
|
+
const b = new g.Vector3(), _ = new g.Vector3(0, 1, 0);
|
|
3152
|
+
t.forEach((p, y) => {
|
|
3153
|
+
const z = y * 137.5 % 360 / 360, O = new g.Color().setHSL(z, 0.75, 0.55), k = (p.points || []).map((P) => {
|
|
3154
|
+
a = Math.min(a, P.x), u = Math.max(u, P.x), m = Math.min(m, P.y), d = Math.max(d, P.y), f = Math.min(f, P.z), h = Math.max(h, P.z);
|
|
3155
|
+
const v = new g.Vector3(P.x, P.y, P.z);
|
|
3156
|
+
return v.md = P.md, v;
|
|
3062
3157
|
});
|
|
3063
|
-
if (
|
|
3064
|
-
if (
|
|
3065
|
-
const P = new
|
|
3066
|
-
color:
|
|
3067
|
-
emissive:
|
|
3158
|
+
if (k.length < 2) {
|
|
3159
|
+
if (k.length === 1) {
|
|
3160
|
+
const P = new g.SphereGeometry(5, 12, 12), v = new g.MeshLambertMaterial({
|
|
3161
|
+
color: O,
|
|
3162
|
+
emissive: O,
|
|
3068
3163
|
emissiveIntensity: 0.2
|
|
3069
|
-
}), F = new
|
|
3070
|
-
F.position.copy(
|
|
3164
|
+
}), F = new g.Mesh(P, v);
|
|
3165
|
+
F.position.copy(k[0]), F.userData = Ze(p), e.scene.add(F), e.drillLines.push(F), e.drillMeshes.push(F);
|
|
3071
3166
|
}
|
|
3072
3167
|
return;
|
|
3073
3168
|
}
|
|
3074
|
-
const
|
|
3075
|
-
|
|
3076
|
-
const $ = i ?
|
|
3077
|
-
for (let P = 0; P <
|
|
3078
|
-
const
|
|
3079
|
-
if (
|
|
3080
|
-
const
|
|
3169
|
+
const L = new g.Group();
|
|
3170
|
+
L.userData = Ze(p);
|
|
3171
|
+
const $ = i ? eo(p, o) : [];
|
|
3172
|
+
for (let P = 0; P < k.length - 1; P += 1) {
|
|
3173
|
+
const v = k[P], F = k[P + 1], C = b.subVectors(F, v), V = C.length();
|
|
3174
|
+
if (V <= 1e-3) continue;
|
|
3175
|
+
const H = 2.2, A = new g.CylinderGeometry(H, H, V, 6, 1, !0), E = to({
|
|
3081
3176
|
selectedAssayVariable: i,
|
|
3082
3177
|
assayIntervals: $,
|
|
3083
|
-
assayScale:
|
|
3178
|
+
assayScale: c,
|
|
3084
3179
|
holeId: p.id,
|
|
3085
3180
|
segmentIndex: P,
|
|
3086
|
-
p1:
|
|
3181
|
+
p1: v,
|
|
3087
3182
|
p2: F,
|
|
3088
3183
|
isCategorical: s
|
|
3089
|
-
}), N = new
|
|
3090
|
-
color:
|
|
3184
|
+
}), N = new g.MeshLambertMaterial({
|
|
3185
|
+
color: E,
|
|
3091
3186
|
flatShading: !0,
|
|
3092
|
-
emissive:
|
|
3187
|
+
emissive: E,
|
|
3093
3188
|
emissiveIntensity: 0.15
|
|
3094
|
-
}), B = new
|
|
3095
|
-
B.position.copy(
|
|
3189
|
+
}), B = new g.Mesh(A, N);
|
|
3190
|
+
B.position.copy(v.clone().addScaledVector(C, 0.5)), B.quaternion.setFromUnitVectors(_, C.clone().normalize()), B.userData = Ze(p), L.add(B), e.drillMeshes.push(B);
|
|
3096
3191
|
}
|
|
3097
|
-
e.scene.add(
|
|
3098
|
-
}), e.camera && e.controls && (e.lastBounds = { minX: a, maxX:
|
|
3192
|
+
e.scene.add(L), e.drillLines.push(L);
|
|
3193
|
+
}), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h }, r || lt(e, { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h })), Me(e);
|
|
3099
3194
|
}
|
|
3100
|
-
function
|
|
3195
|
+
function Xt(e) {
|
|
3101
3196
|
e.drillLines.forEach((t) => {
|
|
3102
3197
|
e.scene.remove(t), t.isGroup ? t.traverse((n) => {
|
|
3103
3198
|
n.isMesh && (n.geometry.dispose(), n.material.dispose());
|
|
3104
3199
|
}) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
|
|
3105
3200
|
}), e.drillLines = [], e.drillMeshes = [], Me(e);
|
|
3106
3201
|
}
|
|
3107
|
-
const
|
|
3108
|
-
function
|
|
3202
|
+
const Mt = "#ffffbb", ro = 2, oo = 1.5, io = 1;
|
|
3203
|
+
function so(e) {
|
|
3109
3204
|
const { renderer: t, scene: n, camera: r, container: o } = e;
|
|
3110
3205
|
if (!t || !n || !r) return;
|
|
3111
|
-
const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, s = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new
|
|
3112
|
-
l.addPass(
|
|
3113
|
-
const a = new
|
|
3114
|
-
|
|
3206
|
+
const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, s = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new an(t), c = new cn(n, r);
|
|
3207
|
+
l.addPass(c);
|
|
3208
|
+
const a = new g.Vector2(i, s), u = new un(a, n, r);
|
|
3209
|
+
u.visibleEdgeColor.set(Mt), u.hiddenEdgeColor.set(Mt), u.edgeStrength = ro, u.edgeThickness = oo, u.edgeGlow = io, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, s), e._composer = l, e._outlinePass = u;
|
|
3115
3210
|
}
|
|
3116
|
-
function
|
|
3211
|
+
function lo(e, t, n) {
|
|
3117
3212
|
!e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
|
|
3118
3213
|
}
|
|
3119
|
-
function
|
|
3214
|
+
function De(e, t) {
|
|
3120
3215
|
e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
|
|
3121
3216
|
}
|
|
3122
|
-
function
|
|
3217
|
+
function zt(e) {
|
|
3123
3218
|
e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
|
|
3124
3219
|
}
|
|
3125
|
-
const
|
|
3220
|
+
const ao = [
|
|
3126
3221
|
{ normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
|
|
3127
3222
|
{ normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
|
|
3128
3223
|
{ normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
|
|
@@ -3130,40 +3225,40 @@ const Kr = [
|
|
|
3130
3225
|
{ normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
|
|
3131
3226
|
{ normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
|
|
3132
3227
|
];
|
|
3133
|
-
function
|
|
3228
|
+
function co(e, t, n, r, o = {}) {
|
|
3134
3229
|
if (!e.scene || (qt(e), !t || !n || !r)) return;
|
|
3135
3230
|
const { autoCenter: i = !0, opacity: s = 1 } = o;
|
|
3136
|
-
let l = 1 / 0,
|
|
3231
|
+
let l = 1 / 0, c = -1 / 0, a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0;
|
|
3137
3232
|
t.forEach((N) => {
|
|
3138
3233
|
const B = Number(N.x ?? N.center_x ?? 0), I = Number(N.y ?? N.center_y ?? 0), G = Number(N.z ?? N.center_z ?? 0), U = Number(N.dx ?? N.size_x ?? 1), j = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1);
|
|
3139
|
-
l = Math.min(l, B - U / 2),
|
|
3234
|
+
l = Math.min(l, B - U / 2), c = Math.max(c, B + U / 2), a = Math.min(a, I - j / 2), u = Math.max(u, I + j / 2), m = Math.min(m, G - Z / 2), d = Math.max(d, G + Z / 2);
|
|
3140
3235
|
});
|
|
3141
3236
|
let f = 0, h = 0, b = 0;
|
|
3142
|
-
o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0), b = Number(o.offset.z ?? 0)) : i && (f = -((l +
|
|
3143
|
-
const
|
|
3144
|
-
t.map((N) =>
|
|
3145
|
-
), $ = [], P = [],
|
|
3146
|
-
let
|
|
3237
|
+
o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0), b = Number(o.offset.z ?? 0)) : i && (f = -((l + c) / 2), h = -((a + u) / 2), b = -((m + d) / 2));
|
|
3238
|
+
const _ = l + f, p = c + f, y = a + h, M = u + h, z = m + b, O = d + b, k = (N, B, I) => `${Math.round(N)},${Math.round(B)},${Math.round(I)}`, L = new Set(
|
|
3239
|
+
t.map((N) => k(Number(N.x ?? 0), Number(N.y ?? 0), Number(N.z ?? 0)))
|
|
3240
|
+
), $ = [], P = [], v = [], F = [], C = [];
|
|
3241
|
+
let V = 0;
|
|
3147
3242
|
if (t.forEach((N) => {
|
|
3148
|
-
const B = Number(N.x ?? N.center_x ?? 0), I = Number(N.y ?? N.center_y ?? 0), G = Number(N.z ?? N.center_z ?? 0), U = Number(N.dx ?? N.size_x ?? 1), j = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1), K = B + f, le = I + h,
|
|
3149
|
-
|
|
3150
|
-
const
|
|
3151
|
-
if (
|
|
3152
|
-
const ze =
|
|
3153
|
-
_e.verts.forEach(([
|
|
3154
|
-
$.push(K +
|
|
3243
|
+
const B = Number(N.x ?? N.center_x ?? 0), I = Number(N.y ?? N.center_y ?? 0), G = Number(N.z ?? N.center_z ?? 0), U = Number(N.dx ?? N.size_x ?? 1), j = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1), K = B + f, le = I + h, ge = G + b, fe = $n(N[n], r, g), { r: Ce, g: he, b: Ge } = fe;
|
|
3244
|
+
ao.forEach((_e) => {
|
|
3245
|
+
const Jt = B + _e.neibDir[0] * U, Qt = I + _e.neibDir[1] * j, en = G + _e.neibDir[2] * Z;
|
|
3246
|
+
if (L.has(k(Jt, Qt, en))) return;
|
|
3247
|
+
const ze = V;
|
|
3248
|
+
_e.verts.forEach(([tn, nn, rn]) => {
|
|
3249
|
+
$.push(K + tn * U / 2, le + nn * j / 2, ge + rn * Z / 2), P.push(_e.normal[0], _e.normal[1], _e.normal[2]), v.push(Ce, he, Ge), V++;
|
|
3155
3250
|
}), F.push(ze, ze + 1, ze + 2, ze, ze + 2, ze + 3), C.push(N);
|
|
3156
3251
|
});
|
|
3157
3252
|
}), $.length === 0) return;
|
|
3158
|
-
const
|
|
3159
|
-
|
|
3160
|
-
const
|
|
3253
|
+
const H = new g.BufferGeometry();
|
|
3254
|
+
H.setAttribute("position", new g.Float32BufferAttribute($, 3)), H.setAttribute("normal", new g.Float32BufferAttribute(P, 3)), H.setAttribute("color", new g.Float32BufferAttribute(v, 3)), H.setIndex(F);
|
|
3255
|
+
const A = new g.MeshLambertMaterial({
|
|
3161
3256
|
vertexColors: !0,
|
|
3162
3257
|
transparent: s < 1,
|
|
3163
3258
|
opacity: s,
|
|
3164
|
-
side:
|
|
3165
|
-
}),
|
|
3166
|
-
|
|
3259
|
+
side: g.DoubleSide
|
|
3260
|
+
}), E = new g.Mesh(H, A);
|
|
3261
|
+
E.userData._isMergedBlocks = !0, E.userData._quadToBlock = C, E.userData._offset = { x: f, y: h, z: b }, e.scene.add(E), e.blocks.push(E), Me(e), e.camera && e.controls && (e.lastBounds = { minX: _, maxX: p, minY: y, maxY: M, minZ: z, maxZ: O }, lt(e, { minX: _, maxX: p, minY: y, maxY: M, minZ: z, maxZ: O }));
|
|
3167
3262
|
}
|
|
3168
3263
|
function qt(e) {
|
|
3169
3264
|
var t;
|
|
@@ -3171,45 +3266,45 @@ function qt(e) {
|
|
|
3171
3266
|
e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
|
|
3172
3267
|
}), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), Me(e);
|
|
3173
3268
|
}
|
|
3174
|
-
function
|
|
3269
|
+
function uo(e, t) {
|
|
3175
3270
|
const n = Math.max(0, Math.min(1, Number(t)));
|
|
3176
3271
|
e.blocks.forEach((r) => {
|
|
3177
3272
|
r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
|
|
3178
3273
|
});
|
|
3179
3274
|
}
|
|
3180
|
-
function
|
|
3181
|
-
const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, s = Number(t.x ?? t.center_x ?? 0) + r, l = Number(t.y ?? t.center_y ?? 0) + o,
|
|
3275
|
+
function mo(e, t, n) {
|
|
3276
|
+
const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, s = Number(t.x ?? t.center_x ?? 0) + r, l = Number(t.y ?? t.center_y ?? 0) + o, c = Number(t.z ?? t.center_z ?? 0) + i, a = Number(t.dx ?? t.size_x ?? 1), u = Number(t.dy ?? t.size_y ?? 1), m = Number(t.dz ?? t.size_z ?? 1);
|
|
3182
3277
|
if (!e._blockHighlightMesh) {
|
|
3183
|
-
const d = new
|
|
3184
|
-
e._blockHighlightMesh = new
|
|
3278
|
+
const d = new g.BoxGeometry(1, 1, 1), f = new g.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
|
|
3279
|
+
e._blockHighlightMesh = new g.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
|
|
3185
3280
|
}
|
|
3186
|
-
return e._blockHighlightMesh.position.set(s, l,
|
|
3281
|
+
return e._blockHighlightMesh.position.set(s, l, c), e._blockHighlightMesh.scale.set(a, u, m), e._blockHighlightMesh;
|
|
3187
3282
|
}
|
|
3188
|
-
function
|
|
3283
|
+
function Zt(e) {
|
|
3189
3284
|
var o, i;
|
|
3190
3285
|
if (!e._outlinePass || e.selectables.length === 0) {
|
|
3191
|
-
e._outlinePass &&
|
|
3286
|
+
e._outlinePass && De(e, null);
|
|
3192
3287
|
return;
|
|
3193
3288
|
}
|
|
3194
3289
|
const t = e.raycaster.intersectObjects(e.selectables, !0);
|
|
3195
3290
|
if (t.length === 0) {
|
|
3196
|
-
|
|
3291
|
+
De(e, null);
|
|
3197
3292
|
return;
|
|
3198
3293
|
}
|
|
3199
3294
|
const n = t[0], r = n.object;
|
|
3200
3295
|
if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
|
|
3201
3296
|
const s = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[s];
|
|
3202
3297
|
if (l) {
|
|
3203
|
-
|
|
3298
|
+
De(e, mo(e, l, r.userData._offset));
|
|
3204
3299
|
return;
|
|
3205
3300
|
}
|
|
3206
3301
|
}
|
|
3207
|
-
|
|
3302
|
+
De(e, r);
|
|
3208
3303
|
}
|
|
3209
|
-
function
|
|
3304
|
+
function fo(e) {
|
|
3210
3305
|
const t = e.renderer;
|
|
3211
3306
|
t && (e.handleCanvasClick = (n) => {
|
|
3212
|
-
var f, h, b,
|
|
3307
|
+
var f, h, b, _, p, y, M;
|
|
3213
3308
|
if (n.button !== 0) return;
|
|
3214
3309
|
if ((f = e.gizmo) != null && f.domElement) {
|
|
3215
3310
|
const z = e.gizmo.domElement.getBoundingClientRect();
|
|
@@ -3217,81 +3312,81 @@ function to(e) {
|
|
|
3217
3312
|
return;
|
|
3218
3313
|
}
|
|
3219
3314
|
const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, i = n.clientY - r.top;
|
|
3220
|
-
if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera),
|
|
3315
|
+
if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Zt(e), e.blocks.length > 0) {
|
|
3221
3316
|
const z = e.raycaster.intersectObjects(e.blocks, !1);
|
|
3222
3317
|
if (z.length > 0) {
|
|
3223
|
-
const
|
|
3224
|
-
if ((h =
|
|
3225
|
-
const
|
|
3318
|
+
const O = z[0], k = O.object;
|
|
3319
|
+
if ((h = k == null ? void 0 : k.userData) != null && h._isMergedBlocks && e.blockClickHandler) {
|
|
3320
|
+
const L = Math.floor(O.faceIndex / 2), $ = k.userData._quadToBlock[L];
|
|
3226
3321
|
$ && e.blockClickHandler($);
|
|
3227
3322
|
}
|
|
3228
3323
|
return;
|
|
3229
3324
|
}
|
|
3230
3325
|
}
|
|
3231
|
-
const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0),
|
|
3232
|
-
if ((((
|
|
3326
|
+
const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((b = s[0]) == null ? void 0 : b.distance) ?? 1 / 0;
|
|
3327
|
+
if ((((_ = l[0]) == null ? void 0 : _.distance) ?? 1 / 0) < c && l.length > 0) {
|
|
3233
3328
|
const z = l[0].object;
|
|
3234
3329
|
e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...z.userData });
|
|
3235
3330
|
return;
|
|
3236
3331
|
}
|
|
3237
3332
|
if (s.length === 0) return;
|
|
3238
|
-
let
|
|
3239
|
-
for (;
|
|
3240
|
-
|
|
3241
|
-
const m = (
|
|
3333
|
+
let u = s[0].object;
|
|
3334
|
+
for (; u && u.parent && !((p = u.userData) != null && p.holeId); )
|
|
3335
|
+
u = u.parent;
|
|
3336
|
+
const m = (y = u == null ? void 0 : u.userData) == null ? void 0 : y.holeId, d = (M = u == null ? void 0 : u.userData) == null ? void 0 : M.project;
|
|
3242
3337
|
m && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: m, project: d });
|
|
3243
3338
|
}, t.domElement.addEventListener("click", e.handleCanvasClick));
|
|
3244
3339
|
}
|
|
3245
|
-
class
|
|
3340
|
+
class Di {
|
|
3246
3341
|
constructor() {
|
|
3247
|
-
this.container = null, this.scene = null, this.camera = null, this.renderer = null, this.controls = null, this.flyControls = null, this.gizmo = null, this.blocks = [], this.drillLines = [], this.drillMeshes = [], this.structuralGroup = null, this.structuralMeshes = [], this.frameId = null, this.clock = new
|
|
3342
|
+
this.container = null, this.scene = null, this.camera = null, this.renderer = null, this.controls = null, this.flyControls = null, this.gizmo = null, this.blocks = [], this.drillLines = [], this.drillMeshes = [], this.structuralGroup = null, this.structuralMeshes = [], this.frameId = null, this.clock = new g.Clock(), this.handleCanvasClick = null, this.raycaster = new g.Raycaster(), this.pointer = new g.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new g.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null, this.rasterOverlays = /* @__PURE__ */ new Map();
|
|
3248
3343
|
}
|
|
3249
3344
|
init(t) {
|
|
3250
3345
|
if (!t) return;
|
|
3251
3346
|
this.container = t;
|
|
3252
3347
|
const n = t.clientWidth, r = t.clientHeight;
|
|
3253
|
-
this.scene = new
|
|
3254
|
-
const o = new
|
|
3348
|
+
this.scene = new g.Scene(), this.scene.background = new g.Color(16777215), this.camera = new g.PerspectiveCamera(28, n / r, 1e-3, 1e7), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new g.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
|
|
3349
|
+
const o = new g.AmbientLight(16777215, 1.2);
|
|
3255
3350
|
this.scene.add(o);
|
|
3256
|
-
const i = new
|
|
3351
|
+
const i = new g.DirectionalLight(16777215, 1.5);
|
|
3257
3352
|
i.position.set(10, 10, 5), this.scene.add(i);
|
|
3258
|
-
const s = new
|
|
3259
|
-
this.scene.add(s), this.controls = new
|
|
3260
|
-
LEFT:
|
|
3261
|
-
MIDDLE:
|
|
3262
|
-
RIGHT:
|
|
3353
|
+
const s = new g.AxesHelper(20);
|
|
3354
|
+
this.scene.add(s), this.controls = new on(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 1.2, this.controls.minDistance = 3e-3, this.controls.maxDistance = 5e6, this.controls.mouseButtons = {
|
|
3355
|
+
LEFT: g.MOUSE.PAN,
|
|
3356
|
+
MIDDLE: g.MOUSE.DOLLY,
|
|
3357
|
+
RIGHT: g.MOUSE.ROTATE
|
|
3263
3358
|
}, this.controls.touches = {
|
|
3264
|
-
ONE:
|
|
3265
|
-
TWO:
|
|
3266
|
-
}, this.controls.maxPolarAngle = Math.PI, this.flyControls = new
|
|
3359
|
+
ONE: g.TOUCH.ROTATE,
|
|
3360
|
+
TWO: g.TOUCH.PAN
|
|
3361
|
+
}, this.controls.maxPolarAngle = Math.PI, this.flyControls = new sn(this.camera, this.renderer.domElement), this.flyControls.movementSpeed = 2e3, this.flyControls.rollSpeed = Math.PI / 12, this.flyControls.dragToLook = !0, this.flyControls.enabled = !1, this.gizmo = new ln(this.camera, this.renderer, {
|
|
3267
3362
|
container: this.container,
|
|
3268
3363
|
placement: "top-right",
|
|
3269
3364
|
size: 110,
|
|
3270
3365
|
offset: { top: 12, right: 12 },
|
|
3271
3366
|
animated: !0,
|
|
3272
3367
|
speed: 1.5
|
|
3273
|
-
}), this.gizmo.attachControls(this.controls),
|
|
3368
|
+
}), this.gizmo.attachControls(this.controls), fo(this), so(this);
|
|
3274
3369
|
const l = () => {
|
|
3275
3370
|
var a;
|
|
3276
3371
|
this.frameId = requestAnimationFrame(l);
|
|
3277
|
-
const
|
|
3278
|
-
this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.enabled) ? this.flyControls.update(
|
|
3372
|
+
const c = this.clock.getDelta();
|
|
3373
|
+
this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.enabled) ? this.flyControls.update(c) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(c) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
|
|
3279
3374
|
};
|
|
3280
3375
|
l();
|
|
3281
3376
|
}
|
|
3282
3377
|
resize() {
|
|
3283
3378
|
if (!this.container || !this.camera || !this.renderer) return;
|
|
3284
3379
|
const t = this.container.clientWidth, n = this.container.clientHeight;
|
|
3285
|
-
this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(),
|
|
3380
|
+
this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), lo(this, t, n);
|
|
3286
3381
|
}
|
|
3287
3382
|
dispose() {
|
|
3288
|
-
this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, qt(this),
|
|
3383
|
+
this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, qt(this), Xt(this), Gt(this), Pr(this), zt(this), this.controls && this.controls.dispose(), this.flyControls && this.flyControls.dispose(), this.renderer && (this.renderer.dispose(), this.container && this.renderer.domElement && this.container.removeChild(this.renderer.domElement));
|
|
3289
3384
|
}
|
|
3290
3385
|
// ---------------------------------------------------------------------------
|
|
3291
3386
|
// Data renderers — delegate to domain modules
|
|
3292
3387
|
// ---------------------------------------------------------------------------
|
|
3293
3388
|
setDrillholes(t, n = {}) {
|
|
3294
|
-
|
|
3389
|
+
no(this, t, n);
|
|
3295
3390
|
}
|
|
3296
3391
|
/**
|
|
3297
3392
|
* Render block model data as a single merged mesh of exterior faces only.
|
|
@@ -3301,17 +3396,17 @@ class _i {
|
|
|
3301
3396
|
* @param {Object} [options]
|
|
3302
3397
|
*/
|
|
3303
3398
|
setBlocks(t, n, r, o = {}) {
|
|
3304
|
-
|
|
3399
|
+
co(this, t, n, r, o);
|
|
3305
3400
|
}
|
|
3306
3401
|
/**
|
|
3307
3402
|
* Update the opacity of all currently rendered blocks.
|
|
3308
3403
|
* @param {number} opacity - New opacity value between 0 and 1
|
|
3309
3404
|
*/
|
|
3310
3405
|
setBlockOpacity(t) {
|
|
3311
|
-
|
|
3406
|
+
uo(this, t);
|
|
3312
3407
|
}
|
|
3313
3408
|
setStructuralDiscs(t, n, r = {}) {
|
|
3314
|
-
|
|
3409
|
+
vr(this, t, n, r);
|
|
3315
3410
|
}
|
|
3316
3411
|
setStructuralDiscsVisible(t) {
|
|
3317
3412
|
Er(this, t);
|
|
@@ -3336,44 +3431,44 @@ class _i {
|
|
|
3336
3431
|
this.viewChangeHandler = typeof t == "function" ? t : null;
|
|
3337
3432
|
}
|
|
3338
3433
|
getViewState() {
|
|
3339
|
-
return
|
|
3434
|
+
return Ut(this);
|
|
3340
3435
|
}
|
|
3341
3436
|
setViewState(t) {
|
|
3342
|
-
return
|
|
3437
|
+
return Fr(this, t);
|
|
3343
3438
|
}
|
|
3344
3439
|
_buildViewSignature(t) {
|
|
3345
|
-
return
|
|
3440
|
+
return st(t);
|
|
3346
3441
|
}
|
|
3347
3442
|
_emitViewChangeIfNeeded() {
|
|
3348
|
-
|
|
3443
|
+
wr(this);
|
|
3349
3444
|
}
|
|
3350
3445
|
_fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
3351
|
-
|
|
3446
|
+
lt(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
|
|
3352
3447
|
}
|
|
3353
3448
|
recenterCameraToOrigin(t = 1e3) {
|
|
3354
|
-
|
|
3449
|
+
Tr(this, t);
|
|
3355
3450
|
}
|
|
3356
3451
|
lookDown(t = 2e3) {
|
|
3357
|
-
|
|
3452
|
+
$r(this, t);
|
|
3358
3453
|
}
|
|
3359
3454
|
pan(t = 0, n = 0) {
|
|
3360
|
-
|
|
3455
|
+
Br(this, t, n);
|
|
3361
3456
|
}
|
|
3362
3457
|
dolly(t = 1.1) {
|
|
3363
|
-
|
|
3458
|
+
Rr(this, t);
|
|
3364
3459
|
}
|
|
3365
3460
|
focusOnLastBounds(t = 1.2) {
|
|
3366
|
-
|
|
3461
|
+
Vr(this, t);
|
|
3367
3462
|
}
|
|
3368
3463
|
/**
|
|
3369
3464
|
* Change the camera field-of-view while keeping the visible scene the same apparent size.
|
|
3370
3465
|
* @param {number} fovDeg - Desired FOV in degrees
|
|
3371
3466
|
*/
|
|
3372
3467
|
setCameraFov(t) {
|
|
3373
|
-
|
|
3468
|
+
Gr(this, t);
|
|
3374
3469
|
}
|
|
3375
3470
|
setControlMode(t = "orbit") {
|
|
3376
|
-
|
|
3471
|
+
Ur(this, t);
|
|
3377
3472
|
}
|
|
3378
3473
|
// ---------------------------------------------------------------------------
|
|
3379
3474
|
// Selection glow public API
|
|
@@ -3393,7 +3488,7 @@ class _i {
|
|
|
3393
3488
|
* @param {THREE.Object3D|null} object
|
|
3394
3489
|
*/
|
|
3395
3490
|
selectObject(t) {
|
|
3396
|
-
|
|
3491
|
+
De(this, t || null);
|
|
3397
3492
|
}
|
|
3398
3493
|
/**
|
|
3399
3494
|
* Return the currently selected object, or null if nothing is selected.
|
|
@@ -3406,14 +3501,70 @@ class _i {
|
|
|
3406
3501
|
* Dispose the effect composer and all GPU resources used by the selection glow.
|
|
3407
3502
|
*/
|
|
3408
3503
|
disposeGlow() {
|
|
3409
|
-
|
|
3504
|
+
zt(this);
|
|
3410
3505
|
}
|
|
3411
3506
|
/** @private */
|
|
3412
3507
|
_updateSelectionFromPointer() {
|
|
3413
|
-
|
|
3508
|
+
Zt(this);
|
|
3509
|
+
}
|
|
3510
|
+
// ---------------------------------------------------------------------------
|
|
3511
|
+
// Raster overlay API — delegate to rasterOverlayScene
|
|
3512
|
+
// ---------------------------------------------------------------------------
|
|
3513
|
+
/**
|
|
3514
|
+
* Add a raster overlay layer (created with createRasterOverlay) to the scene.
|
|
3515
|
+
* @param {object} layer - Layer descriptor returned by createRasterOverlay()
|
|
3516
|
+
*/
|
|
3517
|
+
addRasterOverlay(t) {
|
|
3518
|
+
Ir(this, t);
|
|
3519
|
+
}
|
|
3520
|
+
/**
|
|
3521
|
+
* Remove a raster overlay from the scene and dispose its GPU resources.
|
|
3522
|
+
* @param {string} id - Overlay id
|
|
3523
|
+
*/
|
|
3524
|
+
removeRasterOverlay(t) {
|
|
3525
|
+
it(this, t);
|
|
3526
|
+
}
|
|
3527
|
+
/**
|
|
3528
|
+
* Set the opacity of a raster overlay at runtime.
|
|
3529
|
+
* @param {string} id - Overlay id
|
|
3530
|
+
* @param {number} opacity - New opacity [0, 1]
|
|
3531
|
+
*/
|
|
3532
|
+
setRasterOverlayOpacity(t, n) {
|
|
3533
|
+
Or(this, t, n);
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
* Show or hide a raster overlay.
|
|
3537
|
+
* @param {string} id - Overlay id
|
|
3538
|
+
* @param {boolean} visible
|
|
3539
|
+
*/
|
|
3540
|
+
setRasterOverlayVisibility(t, n) {
|
|
3541
|
+
Cr(this, t, n);
|
|
3542
|
+
}
|
|
3543
|
+
/**
|
|
3544
|
+
* Update the elevation (Z position) of a raster overlay.
|
|
3545
|
+
* @param {string} id - Overlay id
|
|
3546
|
+
* @param {number} elevation
|
|
3547
|
+
*/
|
|
3548
|
+
setRasterOverlayElevation(t, n) {
|
|
3549
|
+
Dr(this, t, n);
|
|
3550
|
+
}
|
|
3551
|
+
/**
|
|
3552
|
+
* Return a raster overlay by id, or undefined if not found.
|
|
3553
|
+
* @param {string} id
|
|
3554
|
+
* @returns {object|undefined}
|
|
3555
|
+
*/
|
|
3556
|
+
getRasterOverlay(t) {
|
|
3557
|
+
return Sr(this, t);
|
|
3558
|
+
}
|
|
3559
|
+
/**
|
|
3560
|
+
* Return all raster overlay layers in insertion order.
|
|
3561
|
+
* @returns {object[]}
|
|
3562
|
+
*/
|
|
3563
|
+
listRasterOverlays() {
|
|
3564
|
+
return Lr(this);
|
|
3414
3565
|
}
|
|
3415
3566
|
}
|
|
3416
|
-
function
|
|
3567
|
+
function Si({
|
|
3417
3568
|
controlMode: e = "orbit",
|
|
3418
3569
|
onToggleFly: t = () => {
|
|
3419
3570
|
},
|
|
@@ -3425,13 +3576,13 @@ function Ni({
|
|
|
3425
3576
|
}
|
|
3426
3577
|
}) {
|
|
3427
3578
|
return /* @__PURE__ */ J("div", { className: "baselode-3d-controls", children: [
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3579
|
+
/* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
|
|
3580
|
+
/* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
|
|
3581
|
+
/* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
|
|
3582
|
+
/* @__PURE__ */ D("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
|
|
3432
3583
|
] });
|
|
3433
3584
|
}
|
|
3434
|
-
function
|
|
3585
|
+
function Li({
|
|
3435
3586
|
properties: e = [],
|
|
3436
3587
|
selectedProperty: t = "",
|
|
3437
3588
|
onPropertyChange: n = () => {
|
|
@@ -3444,37 +3595,37 @@ function Mi({
|
|
|
3444
3595
|
onPopupClose: l = () => {
|
|
3445
3596
|
}
|
|
3446
3597
|
}) {
|
|
3447
|
-
var
|
|
3598
|
+
var c, a;
|
|
3448
3599
|
return /* @__PURE__ */ J("div", { className: "bm-widget", children: [
|
|
3449
|
-
/* @__PURE__ */
|
|
3600
|
+
/* @__PURE__ */ D("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
|
|
3450
3601
|
/* @__PURE__ */ J(
|
|
3451
3602
|
"select",
|
|
3452
3603
|
{
|
|
3453
3604
|
id: "bm-property-select",
|
|
3454
3605
|
className: "bm-widget__select",
|
|
3455
3606
|
value: t,
|
|
3456
|
-
onChange: (
|
|
3607
|
+
onChange: (u) => n(u.target.value),
|
|
3457
3608
|
children: [
|
|
3458
|
-
e.length === 0 && /* @__PURE__ */
|
|
3459
|
-
e.map((
|
|
3609
|
+
e.length === 0 && /* @__PURE__ */ D("option", { value: "", children: "— no attributes —" }),
|
|
3610
|
+
e.map((u) => /* @__PURE__ */ D("option", { value: u, children: u }, u))
|
|
3460
3611
|
]
|
|
3461
3612
|
}
|
|
3462
3613
|
),
|
|
3463
3614
|
i && i.type === "numeric" && /* @__PURE__ */ J("div", { className: "bm-widget__scale", children: [
|
|
3464
|
-
/* @__PURE__ */
|
|
3465
|
-
/* @__PURE__ */
|
|
3466
|
-
/* @__PURE__ */
|
|
3615
|
+
/* @__PURE__ */ D("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((c = i.min) == null ? void 0 : c.toFixed(2)) ?? "—" }),
|
|
3616
|
+
/* @__PURE__ */ D("div", { className: "bm-widget__scale-bar" }),
|
|
3617
|
+
/* @__PURE__ */ D("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
|
|
3467
3618
|
] }),
|
|
3468
|
-
i && i.type === "categorical" && /* @__PURE__ */
|
|
3619
|
+
i && i.type === "categorical" && /* @__PURE__ */ D("div", { className: "bm-widget__categories", children: (i.categories || []).map((u, m) => {
|
|
3469
3620
|
const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
|
|
3470
|
-
return /* @__PURE__ */
|
|
3621
|
+
return /* @__PURE__ */ D(
|
|
3471
3622
|
"span",
|
|
3472
3623
|
{
|
|
3473
3624
|
className: "bm-widget__category-chip",
|
|
3474
3625
|
style: { background: `hsl(${d},70%,50%)` },
|
|
3475
|
-
children:
|
|
3626
|
+
children: u
|
|
3476
3627
|
},
|
|
3477
|
-
|
|
3628
|
+
u
|
|
3478
3629
|
);
|
|
3479
3630
|
}) }),
|
|
3480
3631
|
/* @__PURE__ */ J("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
|
|
@@ -3482,7 +3633,7 @@ function Mi({
|
|
|
3482
3633
|
Math.round(r * 100),
|
|
3483
3634
|
"%)"
|
|
3484
3635
|
] }),
|
|
3485
|
-
/* @__PURE__ */
|
|
3636
|
+
/* @__PURE__ */ D(
|
|
3486
3637
|
"input",
|
|
3487
3638
|
{
|
|
3488
3639
|
id: "bm-opacity-slider",
|
|
@@ -3492,13 +3643,13 @@ function Mi({
|
|
|
3492
3643
|
max: "1",
|
|
3493
3644
|
step: "0.01",
|
|
3494
3645
|
value: r,
|
|
3495
|
-
onChange: (
|
|
3646
|
+
onChange: (u) => o(parseFloat(u.target.value))
|
|
3496
3647
|
}
|
|
3497
3648
|
),
|
|
3498
3649
|
s && /* @__PURE__ */ J("div", { className: "bm-widget__popup", children: [
|
|
3499
3650
|
/* @__PURE__ */ J("div", { className: "bm-widget__popup-header", children: [
|
|
3500
|
-
/* @__PURE__ */
|
|
3501
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ D("span", { children: "Block attributes" }),
|
|
3652
|
+
/* @__PURE__ */ D(
|
|
3502
3653
|
"button",
|
|
3503
3654
|
{
|
|
3504
3655
|
type: "button",
|
|
@@ -3509,19 +3660,19 @@ function Mi({
|
|
|
3509
3660
|
}
|
|
3510
3661
|
)
|
|
3511
3662
|
] }),
|
|
3512
|
-
/* @__PURE__ */
|
|
3513
|
-
/* @__PURE__ */
|
|
3514
|
-
/* @__PURE__ */
|
|
3515
|
-
] },
|
|
3663
|
+
/* @__PURE__ */ D("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ D("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ J("tr", { children: [
|
|
3664
|
+
/* @__PURE__ */ D("th", { children: u }),
|
|
3665
|
+
/* @__PURE__ */ D("td", { children: m == null ? "—" : String(m) })
|
|
3666
|
+
] }, u)) }) })
|
|
3516
3667
|
] })
|
|
3517
3668
|
] });
|
|
3518
3669
|
}
|
|
3519
|
-
const
|
|
3670
|
+
const ho = [
|
|
3520
3671
|
{ minZoom: 0, lodKey: "thumb" },
|
|
3521
3672
|
{ minZoom: 4, lodKey: "medium" },
|
|
3522
3673
|
{ minZoom: 7, lodKey: "full" }
|
|
3523
|
-
],
|
|
3524
|
-
function
|
|
3674
|
+
], Wt = 50;
|
|
3675
|
+
function po(e, t, n = ho) {
|
|
3525
3676
|
var i;
|
|
3526
3677
|
const r = e.lod_urls;
|
|
3527
3678
|
if (!r || typeof r != "object" || Array.isArray(r))
|
|
@@ -3531,10 +3682,10 @@ function ro(e, t, n = no) {
|
|
|
3531
3682
|
t >= s.minZoom && (o = s.lodKey);
|
|
3532
3683
|
return r[o] || e.image_url || "";
|
|
3533
3684
|
}
|
|
3534
|
-
function
|
|
3685
|
+
function bo(e) {
|
|
3535
3686
|
return [...e].sort((t, n) => (t.from_depth ?? 0) - (n.from_depth ?? 0));
|
|
3536
3687
|
}
|
|
3537
|
-
function
|
|
3688
|
+
function yo(e) {
|
|
3538
3689
|
const t = {};
|
|
3539
3690
|
for (const n of e) {
|
|
3540
3691
|
const r = n.photo_set != null && n.photo_set !== "" ? String(n.photo_set) : "default";
|
|
@@ -3542,7 +3693,7 @@ function io(e) {
|
|
|
3542
3693
|
}
|
|
3543
3694
|
return t;
|
|
3544
3695
|
}
|
|
3545
|
-
function
|
|
3696
|
+
function go(e, t, n = 10) {
|
|
3546
3697
|
const r = [];
|
|
3547
3698
|
if (e >= t || n <= 0) return r;
|
|
3548
3699
|
const o = Math.ceil(e / n) * n, i = n * 1e-9;
|
|
@@ -3552,120 +3703,120 @@ function so(e, t, n = 10) {
|
|
|
3552
3703
|
}
|
|
3553
3704
|
return r;
|
|
3554
3705
|
}
|
|
3555
|
-
function
|
|
3706
|
+
function _o(e) {
|
|
3556
3707
|
return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
|
|
3557
3708
|
}
|
|
3558
|
-
function
|
|
3709
|
+
function Kt(e) {
|
|
3559
3710
|
return `tray_${String(e).padStart(3, "0")}.jpg`;
|
|
3560
3711
|
}
|
|
3561
|
-
function
|
|
3712
|
+
function No(e, t, n, r, o = "Tray Images", i = Kt) {
|
|
3562
3713
|
const s = (n ?? "").replace(/\/$/, ""), l = (r ?? "").replace(/\/$/, "");
|
|
3563
|
-
return t.map((
|
|
3564
|
-
const
|
|
3714
|
+
return t.map((c, a) => {
|
|
3715
|
+
const u = c.filename ?? i(a), m = c.photoSet ?? o;
|
|
3565
3716
|
return {
|
|
3566
3717
|
hole_id: e,
|
|
3567
|
-
from_depth:
|
|
3568
|
-
to_depth:
|
|
3718
|
+
from_depth: c.fromDepth,
|
|
3719
|
+
to_depth: c.toDepth,
|
|
3569
3720
|
photo_set: m,
|
|
3570
|
-
image_url: `${s}/${
|
|
3721
|
+
image_url: `${s}/${u}`,
|
|
3571
3722
|
lod_urls: {
|
|
3572
|
-
thumb: `${s}/${
|
|
3573
|
-
full: `${l}/${
|
|
3723
|
+
thumb: `${s}/${u}`,
|
|
3724
|
+
full: `${l}/${u}`
|
|
3574
3725
|
}
|
|
3575
3726
|
};
|
|
3576
3727
|
});
|
|
3577
3728
|
}
|
|
3578
|
-
function
|
|
3729
|
+
function Pi(e, t, n = Wt) {
|
|
3579
3730
|
const r = t / 5;
|
|
3580
3731
|
return Math.max(1, Math.round(e * n * r));
|
|
3581
3732
|
}
|
|
3582
|
-
const We = 5,
|
|
3583
|
-
function
|
|
3733
|
+
const We = 5, vt = 1.12, Mo = 0.05, zo = 40;
|
|
3734
|
+
function vo({
|
|
3584
3735
|
photos: e = [],
|
|
3585
3736
|
holeId: t = "",
|
|
3586
3737
|
initialZoom: n = 5,
|
|
3587
3738
|
transform: r,
|
|
3588
3739
|
onTransformChange: o
|
|
3589
3740
|
}) {
|
|
3590
|
-
const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i,
|
|
3591
|
-
|
|
3741
|
+
const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, c = Se(l);
|
|
3742
|
+
c.current = l;
|
|
3592
3743
|
const a = Ue(
|
|
3593
|
-
(
|
|
3594
|
-
const F = typeof
|
|
3744
|
+
(v) => {
|
|
3745
|
+
const F = typeof v == "function" ? v(c.current) : v;
|
|
3595
3746
|
o ? o(F) : s(F);
|
|
3596
3747
|
},
|
|
3597
3748
|
[o]
|
|
3598
|
-
), [
|
|
3599
|
-
const
|
|
3749
|
+
), [u, m] = Q(!1), d = Se(null), f = Se(null), h = ne(() => bo(e), [e]), b = ne(() => yo(h), [h]), _ = ne(() => {
|
|
3750
|
+
const v = /* @__PURE__ */ new Set();
|
|
3600
3751
|
for (const F of e) {
|
|
3601
3752
|
const C = F.photo_set != null && F.photo_set !== "" ? String(F.photo_set) : "default";
|
|
3602
|
-
|
|
3753
|
+
v.add(C);
|
|
3603
3754
|
}
|
|
3604
|
-
return [...
|
|
3605
|
-
}, [e]), { minDepth: p, maxDepth:
|
|
3755
|
+
return [...v];
|
|
3756
|
+
}, [e]), { minDepth: p, maxDepth: y } = ne(() => {
|
|
3606
3757
|
if (!h.length) return { minDepth: 0, maxDepth: 0 };
|
|
3607
|
-
const
|
|
3758
|
+
const v = h.map((F) => F.to_depth ?? F.from_depth ?? 0);
|
|
3608
3759
|
return {
|
|
3609
3760
|
minDepth: h[0].from_depth ?? 0,
|
|
3610
|
-
maxDepth: Math.max(...
|
|
3761
|
+
maxDepth: Math.max(...v)
|
|
3611
3762
|
};
|
|
3612
|
-
}, [h]), M =
|
|
3613
|
-
() => Math.max(1, Math.round((
|
|
3614
|
-
[p,
|
|
3615
|
-
),
|
|
3616
|
-
const
|
|
3617
|
-
return
|
|
3618
|
-
}, [p,
|
|
3763
|
+
}, [h]), M = Wt * We / 5, z = ne(
|
|
3764
|
+
() => Math.max(1, Math.round((y - p) * M)),
|
|
3765
|
+
[p, y, M]
|
|
3766
|
+
), O = ne(() => {
|
|
3767
|
+
const v = _o(We);
|
|
3768
|
+
return go(p, y, v);
|
|
3769
|
+
}, [p, y]), k = 540 * We / 5, L = ne(
|
|
3619
3770
|
() => Math.max(1, Math.min(10, Math.round(n * l.scale))),
|
|
3620
3771
|
[n, l.scale]
|
|
3621
|
-
), $ = Ue((
|
|
3622
|
-
|
|
3623
|
-
const F =
|
|
3624
|
-
a((
|
|
3625
|
-
const
|
|
3772
|
+
), $ = Ue((v) => {
|
|
3773
|
+
v.preventDefault();
|
|
3774
|
+
const F = v.deltaY < 0 ? vt : 1 / vt, C = f.current.getBoundingClientRect(), V = v.clientX - C.left, H = v.clientY - C.top;
|
|
3775
|
+
a((A) => {
|
|
3776
|
+
const E = Math.max(Mo, Math.min(zo, A.scale * F)), N = E / A.scale;
|
|
3626
3777
|
return {
|
|
3627
|
-
scale:
|
|
3628
|
-
tx:
|
|
3629
|
-
ty:
|
|
3778
|
+
scale: E,
|
|
3779
|
+
tx: V - (V - A.tx) * N,
|
|
3780
|
+
ty: H - (H - A.ty) * N
|
|
3630
3781
|
};
|
|
3631
3782
|
});
|
|
3632
3783
|
}, [a]);
|
|
3633
3784
|
se(() => {
|
|
3634
|
-
const
|
|
3635
|
-
if (
|
|
3636
|
-
return
|
|
3785
|
+
const v = f.current;
|
|
3786
|
+
if (v)
|
|
3787
|
+
return v.addEventListener("wheel", $, { passive: !1 }), () => v.removeEventListener("wheel", $);
|
|
3637
3788
|
}, [$]);
|
|
3638
|
-
const P = Ue((
|
|
3639
|
-
|
|
3640
|
-
x:
|
|
3641
|
-
y:
|
|
3642
|
-
tx:
|
|
3643
|
-
ty:
|
|
3789
|
+
const P = Ue((v) => {
|
|
3790
|
+
v.button === 0 && (v.preventDefault(), d.current = {
|
|
3791
|
+
x: v.clientX,
|
|
3792
|
+
y: v.clientY,
|
|
3793
|
+
tx: c.current.tx,
|
|
3794
|
+
ty: c.current.ty
|
|
3644
3795
|
}, m(!0));
|
|
3645
3796
|
}, []);
|
|
3646
3797
|
return se(() => {
|
|
3647
|
-
const
|
|
3798
|
+
const v = (C) => {
|
|
3648
3799
|
if (!d.current) return;
|
|
3649
|
-
const { tx:
|
|
3800
|
+
const { tx: V, ty: H, x: A, y: E } = d.current;
|
|
3650
3801
|
a((N) => ({
|
|
3651
3802
|
...N,
|
|
3652
|
-
tx:
|
|
3653
|
-
ty:
|
|
3803
|
+
tx: V + (C.clientX - A),
|
|
3804
|
+
ty: H + (C.clientY - E)
|
|
3654
3805
|
}));
|
|
3655
3806
|
}, F = () => {
|
|
3656
3807
|
d.current = null, m(!1);
|
|
3657
3808
|
};
|
|
3658
|
-
return window.addEventListener("mousemove",
|
|
3659
|
-
window.removeEventListener("mousemove",
|
|
3809
|
+
return window.addEventListener("mousemove", v), window.addEventListener("mouseup", F), () => {
|
|
3810
|
+
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", F);
|
|
3660
3811
|
};
|
|
3661
3812
|
}, [a]), /* @__PURE__ */ J("div", { className: "core-photo-table", children: [
|
|
3662
3813
|
/* @__PURE__ */ J("div", { className: "core-photo-controls", children: [
|
|
3663
|
-
t && /* @__PURE__ */
|
|
3814
|
+
t && /* @__PURE__ */ D("span", { className: "core-photo-hole-id", children: t }),
|
|
3664
3815
|
/* @__PURE__ */ J("span", { className: "core-photo-zoom-label", children: [
|
|
3665
3816
|
Math.round(l.scale * 100),
|
|
3666
3817
|
"%"
|
|
3667
3818
|
] }),
|
|
3668
|
-
/* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ D(
|
|
3669
3820
|
"button",
|
|
3670
3821
|
{
|
|
3671
3822
|
className: "core-photo-zoom-btn",
|
|
@@ -3677,21 +3828,21 @@ function mo({
|
|
|
3677
3828
|
)
|
|
3678
3829
|
] }),
|
|
3679
3830
|
e.length > 0 && /* @__PURE__ */ J("div", { className: "core-photo-col-headers", children: [
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
|
|
3831
|
+
/* @__PURE__ */ D("div", { className: "core-photo-ruler-spacer" }),
|
|
3832
|
+
_.map((v) => /* @__PURE__ */ D(
|
|
3682
3833
|
"div",
|
|
3683
3834
|
{
|
|
3684
3835
|
className: "core-photo-set-header",
|
|
3685
|
-
style: { width:
|
|
3686
|
-
children:
|
|
3836
|
+
style: { width: k },
|
|
3837
|
+
children: v
|
|
3687
3838
|
},
|
|
3688
|
-
|
|
3839
|
+
v
|
|
3689
3840
|
))
|
|
3690
3841
|
] }),
|
|
3691
|
-
e.length === 0 ? /* @__PURE__ */
|
|
3842
|
+
e.length === 0 ? /* @__PURE__ */ D("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ D(
|
|
3692
3843
|
"div",
|
|
3693
3844
|
{
|
|
3694
|
-
className: `core-photo-scroll${
|
|
3845
|
+
className: `core-photo-scroll${u ? " is-dragging" : ""}`,
|
|
3695
3846
|
ref: f,
|
|
3696
3847
|
onMouseDown: P,
|
|
3697
3848
|
children: /* @__PURE__ */ J(
|
|
@@ -3704,64 +3855,64 @@ function mo({
|
|
|
3704
3855
|
transformOrigin: "0 0"
|
|
3705
3856
|
},
|
|
3706
3857
|
children: [
|
|
3707
|
-
/* @__PURE__ */
|
|
3858
|
+
/* @__PURE__ */ D(
|
|
3708
3859
|
"div",
|
|
3709
3860
|
{
|
|
3710
3861
|
className: "core-photo-depth-ruler",
|
|
3711
3862
|
style: { height: z },
|
|
3712
|
-
children:
|
|
3863
|
+
children: O.map(({ depth: v, label: F }) => /* @__PURE__ */ D(
|
|
3713
3864
|
"div",
|
|
3714
3865
|
{
|
|
3715
3866
|
className: "core-photo-depth-marker",
|
|
3716
3867
|
style: {
|
|
3717
|
-
top: Math.round((
|
|
3868
|
+
top: Math.round((v - p) * M)
|
|
3718
3869
|
},
|
|
3719
3870
|
children: F
|
|
3720
3871
|
},
|
|
3721
|
-
|
|
3872
|
+
v
|
|
3722
3873
|
))
|
|
3723
3874
|
}
|
|
3724
3875
|
),
|
|
3725
|
-
|
|
3876
|
+
_.map((v) => /* @__PURE__ */ D(
|
|
3726
3877
|
"div",
|
|
3727
3878
|
{
|
|
3728
3879
|
className: "core-photo-col-body",
|
|
3729
|
-
style: { height: z, width:
|
|
3730
|
-
children: b[
|
|
3731
|
-
const C = F.from_depth ?? 0,
|
|
3880
|
+
style: { height: z, width: k },
|
|
3881
|
+
children: b[v].map((F) => {
|
|
3882
|
+
const C = F.from_depth ?? 0, V = F.to_depth ?? C, H = Math.round(
|
|
3732
3883
|
(C - p) * M
|
|
3733
|
-
),
|
|
3884
|
+
), A = Math.max(
|
|
3734
3885
|
2,
|
|
3735
|
-
Math.round((
|
|
3736
|
-
),
|
|
3886
|
+
Math.round((V - C) * M)
|
|
3887
|
+
), E = po(F, L);
|
|
3737
3888
|
return /* @__PURE__ */ J(
|
|
3738
3889
|
"div",
|
|
3739
3890
|
{
|
|
3740
3891
|
className: "core-photo-item",
|
|
3741
|
-
style: { top:
|
|
3742
|
-
title: `${C}–${
|
|
3892
|
+
style: { top: H, height: A, width: k },
|
|
3893
|
+
title: `${C}–${V} m`,
|
|
3743
3894
|
children: [
|
|
3744
|
-
|
|
3895
|
+
E ? /* @__PURE__ */ D(
|
|
3745
3896
|
"img",
|
|
3746
3897
|
{
|
|
3747
|
-
src:
|
|
3748
|
-
alt: `Core ${C}–${
|
|
3898
|
+
src: E,
|
|
3899
|
+
alt: `Core ${C}–${V} m`,
|
|
3749
3900
|
loading: "lazy"
|
|
3750
3901
|
}
|
|
3751
|
-
) : /* @__PURE__ */
|
|
3752
|
-
|
|
3902
|
+
) : /* @__PURE__ */ D("div", { className: "core-photo-no-image" }),
|
|
3903
|
+
A >= 18 && /* @__PURE__ */ J("span", { className: "core-photo-item-label", children: [
|
|
3753
3904
|
C,
|
|
3754
3905
|
"–",
|
|
3755
|
-
|
|
3906
|
+
V,
|
|
3756
3907
|
" m"
|
|
3757
3908
|
] })
|
|
3758
3909
|
]
|
|
3759
3910
|
},
|
|
3760
|
-
`${F.hole_id ?? ""}-${C}-${
|
|
3911
|
+
`${F.hole_id ?? ""}-${C}-${V}-${v}`
|
|
3761
3912
|
);
|
|
3762
3913
|
})
|
|
3763
3914
|
},
|
|
3764
|
-
|
|
3915
|
+
v
|
|
3765
3916
|
))
|
|
3766
3917
|
]
|
|
3767
3918
|
}
|
|
@@ -3770,33 +3921,33 @@ function mo({
|
|
|
3770
3921
|
)
|
|
3771
3922
|
] });
|
|
3772
3923
|
}
|
|
3773
|
-
function
|
|
3924
|
+
function Fi({
|
|
3774
3925
|
holeId: e = "",
|
|
3775
3926
|
trays: t = [],
|
|
3776
3927
|
thumbBaseUrl: n = "",
|
|
3777
3928
|
fullBaseUrl: r = "",
|
|
3778
3929
|
photoSet: o = "Tray Images",
|
|
3779
|
-
getFilename: i =
|
|
3930
|
+
getFilename: i = Kt,
|
|
3780
3931
|
initialZoom: s = 5,
|
|
3781
3932
|
transform: l,
|
|
3782
|
-
onTransformChange:
|
|
3933
|
+
onTransformChange: c
|
|
3783
3934
|
}) {
|
|
3784
3935
|
const a = ne(
|
|
3785
|
-
() =>
|
|
3936
|
+
() => No(e, t, n, r, o, i),
|
|
3786
3937
|
[e, t, n, r, o, i]
|
|
3787
3938
|
);
|
|
3788
|
-
return /* @__PURE__ */
|
|
3789
|
-
|
|
3939
|
+
return /* @__PURE__ */ D(
|
|
3940
|
+
vo,
|
|
3790
3941
|
{
|
|
3791
3942
|
photos: a,
|
|
3792
3943
|
holeId: e,
|
|
3793
3944
|
initialZoom: s,
|
|
3794
3945
|
transform: l,
|
|
3795
|
-
onTransformChange:
|
|
3946
|
+
onTransformChange: c
|
|
3796
3947
|
}
|
|
3797
3948
|
);
|
|
3798
3949
|
}
|
|
3799
|
-
function
|
|
3950
|
+
function wi(e) {
|
|
3800
3951
|
const t = typeof e == "string" ? JSON.parse(e) : e;
|
|
3801
3952
|
if (t.schema_version !== "1.0")
|
|
3802
3953
|
throw new Error(
|
|
@@ -3824,199 +3975,209 @@ function ki(e) {
|
|
|
3824
3975
|
blocks: n
|
|
3825
3976
|
};
|
|
3826
3977
|
}
|
|
3827
|
-
function
|
|
3828
|
-
const t = new
|
|
3978
|
+
function Eo(e) {
|
|
3979
|
+
const t = new g.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
|
|
3829
3980
|
e.vertices.forEach(([o, i, s], l) => {
|
|
3830
3981
|
n[l * 3] = o, n[l * 3 + 1] = i, n[l * 3 + 2] = s;
|
|
3831
|
-
}), t.setAttribute("position", new
|
|
3982
|
+
}), t.setAttribute("position", new g.BufferAttribute(n, 3));
|
|
3832
3983
|
const r = new Uint32Array(e.triangles.length * 3);
|
|
3833
3984
|
return e.triangles.forEach(([o, i, s], l) => {
|
|
3834
3985
|
r[l * 3] = o, r[l * 3 + 1] = i, r[l * 3 + 2] = s;
|
|
3835
|
-
}), t.setIndex(new
|
|
3986
|
+
}), t.setIndex(new g.BufferAttribute(r, 1)), t;
|
|
3836
3987
|
}
|
|
3837
|
-
function
|
|
3838
|
-
const { defaultOpacity: r = 1 } = n, o = new
|
|
3988
|
+
function Ti(e, t, n = {}) {
|
|
3989
|
+
const { defaultOpacity: r = 1 } = n, o = new g.Group();
|
|
3839
3990
|
return t.blocks.forEach((i) => {
|
|
3840
|
-
var b,
|
|
3841
|
-
const s =
|
|
3842
|
-
color: new
|
|
3843
|
-
opacity:
|
|
3991
|
+
var b, _;
|
|
3992
|
+
const s = Eo(i), l = ((b = i.material) == null ? void 0 : b.color) ?? "#888888", c = ((_ = i.material) == null ? void 0 : _.opacity) ?? r, a = c < 1, u = new g.MeshStandardMaterial({
|
|
3993
|
+
color: new g.Color(l),
|
|
3994
|
+
opacity: c,
|
|
3844
3995
|
transparent: a,
|
|
3845
|
-
side:
|
|
3996
|
+
side: g.DoubleSide,
|
|
3846
3997
|
flatShading: !0
|
|
3847
|
-
}), m = new
|
|
3998
|
+
}), m = new g.Mesh(s, u);
|
|
3848
3999
|
m.userData = {
|
|
3849
4000
|
id: i.id,
|
|
3850
4001
|
attributes: i.attributes
|
|
3851
4002
|
};
|
|
3852
|
-
const d = new
|
|
4003
|
+
const d = new g.EdgesGeometry(s, 15), f = new g.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), h = new g.LineSegments(d, f);
|
|
3853
4004
|
h.visible = !1, m.add(h), o.add(m);
|
|
3854
4005
|
}), e.add(o), o;
|
|
3855
4006
|
}
|
|
3856
4007
|
export {
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
4008
|
+
fr as ASSAY_COLOR_PALETTE_10,
|
|
4009
|
+
hn as ASSAY_NON_VALUE_FIELDS,
|
|
4010
|
+
X as AZIMUTH,
|
|
3860
4011
|
qn as BASELODE_COLORWAY,
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
4012
|
+
w as BASELODE_DARK,
|
|
4013
|
+
_i as BASELODE_DARK_TEMPLATE,
|
|
4014
|
+
gi as BASELODE_DARK_TEMPLATE_NAME,
|
|
4015
|
+
To as BASELODE_DATA_MODEL_DRILL_ASSAY,
|
|
4016
|
+
Fo as BASELODE_DATA_MODEL_DRILL_COLLAR,
|
|
4017
|
+
mn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
|
|
4018
|
+
wo as BASELODE_DATA_MODEL_DRILL_SURVEY,
|
|
4019
|
+
$o as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
|
|
4020
|
+
R as BASELODE_LIGHT,
|
|
4021
|
+
yi as BASELODE_LIGHT_TEMPLATE,
|
|
4022
|
+
bi as BASELODE_LIGHT_TEMPLATE_NAME,
|
|
4023
|
+
Oe as BASELODE_TEMPLATE,
|
|
4024
|
+
Xn as BASELODE_TEMPLATE_NAME,
|
|
4025
|
+
Wt as BASE_PIXELS_PER_METRE,
|
|
4026
|
+
Xe as BUILTIN_COLOUR_MAPS,
|
|
4027
|
+
Si as Baselode3DControls,
|
|
4028
|
+
Di as Baselode3DScene,
|
|
4029
|
+
Li as BlockModelWidget,
|
|
4030
|
+
at as CHART_OPTIONS,
|
|
4031
|
+
zn as COMMENT_COLUMN_NAMES,
|
|
4032
|
+
Re as COMMODITY_COLOURS,
|
|
3882
4033
|
Et as CRS,
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
4034
|
+
vo as CorePhotoTable,
|
|
4035
|
+
Fi as CorePhotoViewer,
|
|
4036
|
+
fn as DEFAULT_COLUMN_MAP,
|
|
4037
|
+
ho as DEFAULT_LOD_BREAKPOINTS,
|
|
3887
4038
|
W as DEPTH,
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
4039
|
+
q as DIP,
|
|
4040
|
+
Le as DISPLAY_CATEGORICAL,
|
|
4041
|
+
ke as DISPLAY_COMMENT,
|
|
3891
4042
|
$e as DISPLAY_HIDDEN,
|
|
3892
|
-
|
|
4043
|
+
Ae as DISPLAY_NUMERIC,
|
|
3893
4044
|
Je as DISPLAY_TADPOLE,
|
|
3894
4045
|
pe as EASTING,
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
4046
|
+
xe as ELEVATION,
|
|
4047
|
+
nr as ERROR_COLOR,
|
|
4048
|
+
Zn as FALLBACK_COLOUR,
|
|
4049
|
+
jr as FOV_MAX_DEG,
|
|
4050
|
+
Hr as FOV_MIN_DEG,
|
|
4051
|
+
S as FROM,
|
|
3901
4052
|
ae as GEOLOGY_CODE,
|
|
3902
4053
|
ce as GEOLOGY_DESCRIPTION,
|
|
3903
|
-
|
|
3904
|
-
|
|
4054
|
+
ct as HIDDEN_COLUMNS,
|
|
4055
|
+
x as HOLE_ID,
|
|
3905
4056
|
oe as LATITUDE,
|
|
3906
|
-
|
|
4057
|
+
Wn as LITHOLOGY_COLOURS,
|
|
3907
4058
|
ie as LONGITUDE,
|
|
3908
4059
|
Ie as MID,
|
|
3909
4060
|
be as NORTHING,
|
|
3910
|
-
|
|
3911
|
-
|
|
4061
|
+
Qn as NUMERIC_LINE_COLOR,
|
|
4062
|
+
er as NUMERIC_MARKER_COLOR,
|
|
3912
4063
|
me as PROJECT_ID,
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
4064
|
+
dn as STRIKE,
|
|
4065
|
+
T as TO,
|
|
4066
|
+
vi as TracePlot,
|
|
4067
|
+
Ti as addGradeBlocksToScene,
|
|
4068
|
+
Ir as addRasterOverlay,
|
|
4069
|
+
Un as alphaBetaToNormal,
|
|
4070
|
+
Oi as annotationsFromIntervals,
|
|
4071
|
+
li as assembleDataset,
|
|
4072
|
+
Jo as attachAssayPositions,
|
|
4073
|
+
Wo as balancedTangentialDesurvey,
|
|
4074
|
+
kn as buildAssayState,
|
|
4075
|
+
Ni as buildCategoricalStripLogConfig,
|
|
4076
|
+
ur as buildCommentsConfig,
|
|
4077
|
+
go as buildDepthMarkers,
|
|
4078
|
+
hr as buildEqualRangeColorScale,
|
|
4079
|
+
ir as buildIntervalPoints,
|
|
3928
4080
|
Tt as buildPlotConfig,
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
4081
|
+
zi as buildStrikeDipSymbol,
|
|
4082
|
+
zr as buildStructuralDiscs,
|
|
4083
|
+
Mi as buildStructuralStripConfig,
|
|
4084
|
+
cr as buildTadpoleConfig,
|
|
4085
|
+
Ko as buildTraces,
|
|
4086
|
+
No as buildTrayPhotos,
|
|
4087
|
+
st as buildViewSignature,
|
|
4088
|
+
di as calculateBlockVolume,
|
|
4089
|
+
wn as calculatePropertyStats,
|
|
4090
|
+
vn as classifyColumns,
|
|
4091
|
+
Pr as clearRasterOverlays,
|
|
4092
|
+
si as coerceNumeric,
|
|
4093
|
+
Yn as computeStructuralPositions,
|
|
4094
|
+
Ci as createRasterOverlay,
|
|
4095
|
+
Uo as defaultChartType,
|
|
4096
|
+
Kt as defaultTrayFilename,
|
|
4097
|
+
Pi as depthIntervalToPixels,
|
|
4098
|
+
_o as depthMarkerInterval,
|
|
3945
4099
|
Be as deriveAssayProps,
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
4100
|
+
qo as desurveyTraces,
|
|
4101
|
+
Mr as dipAzimuthToNormal,
|
|
4102
|
+
Rr as dolly,
|
|
4103
|
+
wr as emitViewChangeIfNeeded,
|
|
3950
4104
|
Tn as filterBlocks,
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
4105
|
+
ii as filterByProject,
|
|
4106
|
+
lt as fitCameraToBounds,
|
|
4107
|
+
Vr as focusOnLastBounds,
|
|
4108
|
+
ui as getBlockStats,
|
|
4109
|
+
qr as getCategoryHexColor,
|
|
3956
4110
|
et as getChartOptions,
|
|
3957
|
-
|
|
3958
|
-
|
|
4111
|
+
$n as getColorForValue,
|
|
4112
|
+
Kn as getColour,
|
|
3959
4113
|
Vt as getEqualRangeBinIndex,
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
4114
|
+
br as getEqualRangeColor,
|
|
4115
|
+
Sr as getRasterOverlay,
|
|
4116
|
+
Ut as getViewState,
|
|
4117
|
+
Eo as gradeBlockToThreeGeometry,
|
|
4118
|
+
yo as groupPhotosBySet,
|
|
4119
|
+
Rn as groupRowsByHole,
|
|
4120
|
+
or as holeHasData,
|
|
4121
|
+
Gn as interpolateTrace,
|
|
4122
|
+
Ii as intervalsAsTubes,
|
|
4123
|
+
oi as joinAssaysToTraces,
|
|
4124
|
+
Lr as listRasterOverlays,
|
|
4125
|
+
Yo as loadAssayFile,
|
|
4126
|
+
xn as loadAssayHole,
|
|
3971
4127
|
En as loadAssayMetadata,
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
4128
|
+
ni as loadAssays,
|
|
4129
|
+
ci as loadBlockModelMetadata,
|
|
4130
|
+
ei as loadCollars,
|
|
4131
|
+
ri as loadGeology,
|
|
4132
|
+
wi as loadGradeBlocksFromJson,
|
|
4133
|
+
ti as loadSurveys,
|
|
3978
4134
|
je as loadTable,
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
4135
|
+
Vo as logDataInfo,
|
|
4136
|
+
Ro as logDataWarning,
|
|
4137
|
+
$r as lookDown,
|
|
4138
|
+
On as minimumCurvatureDesurvey,
|
|
4139
|
+
Fn as normalizeBlockRow,
|
|
4140
|
+
kr as normalizeBounds,
|
|
4141
|
+
jo as normalizeCsvRow,
|
|
4142
|
+
we as normalizeFieldName,
|
|
4143
|
+
Br as pan,
|
|
3987
4144
|
Hn as parseAssayCsvTextToHoles,
|
|
3988
|
-
|
|
3989
|
-
|
|
4145
|
+
_n as parseAssayHole,
|
|
4146
|
+
Ho as parseAssayHoleIds,
|
|
3990
4147
|
gn as parseAssayHoleIdsWithAssays,
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
4148
|
+
Nn as parseAssaysCSV,
|
|
4149
|
+
ai as parseBlockModelCSV,
|
|
4150
|
+
Qo as parseDrillholesCSV,
|
|
4151
|
+
jn as parseGeologyCsvText,
|
|
3995
4152
|
Vn as parseStructuralCSV,
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4153
|
+
hi as parseStructuralIntervalsCSV,
|
|
4154
|
+
fi as parseStructuralPointsCSV,
|
|
4155
|
+
Xo as parseSurveyCSV,
|
|
4156
|
+
pi as parseUnifiedDataset,
|
|
4157
|
+
Go as pickFirstPresent,
|
|
4158
|
+
xi as planView,
|
|
4159
|
+
yr as projectTraceToSection,
|
|
4160
|
+
Tr as recenterCameraToOrigin,
|
|
4161
|
+
it as removeRasterOverlay,
|
|
4004
4162
|
Ct as reorderHoleIds,
|
|
4005
|
-
|
|
4006
|
-
|
|
4163
|
+
Jn as resolveColourMap,
|
|
4164
|
+
ki as sectionView,
|
|
4007
4165
|
gr as sectionWindow,
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4166
|
+
po as selectPhotoLodUrl,
|
|
4167
|
+
Ur as setControlMode,
|
|
4168
|
+
Gr as setFov,
|
|
4169
|
+
Dr as setRasterOverlayElevation,
|
|
4170
|
+
Or as setRasterOverlayOpacity,
|
|
4171
|
+
Cr as setRasterOverlayVisibility,
|
|
4172
|
+
Fr as setViewState,
|
|
4173
|
+
bo as sortPhotosByDepth,
|
|
4174
|
+
ye as standardizeColumns,
|
|
4175
|
+
Bo as standardizeRowArray,
|
|
4176
|
+
Zo as tangentialDesurvey,
|
|
4177
|
+
pn as toError,
|
|
4178
|
+
Ai as tracesAsSegments,
|
|
4179
|
+
Ei as useDrillholeTraceGrid,
|
|
4180
|
+
mi as validateStructuralPoints,
|
|
4020
4181
|
Y as withDataErrorContext
|
|
4021
4182
|
};
|
|
4022
4183
|
//# sourceMappingURL=baselode.js.map
|