baselode 0.1.14 → 0.1.16
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 +1447 -1240
- 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 P, jsxs as J } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as De, useState as Q, useEffect as se, useMemo as ne, useCallback as Ue } from "react";
|
|
4
4
|
import Fe from "plotly.js-dist-min";
|
|
5
5
|
import * as _ from "three";
|
|
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
|
|
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 k = "hole_id", oe = "latitude", ie = "longitude", xe = "elevation", X = "azimuth", q = "dip", F = "from", $ = "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
|
+
[k]: "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
|
+
[k]: "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
|
+
[$]: "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
|
+
[k]: "string",
|
|
45
45
|
// The depth along the hole where the assay interval starts
|
|
46
|
-
[
|
|
46
|
+
[F]: "number",
|
|
47
47
|
// The depth along the hole where the assay interval ends
|
|
48
|
-
[
|
|
48
|
+
[$]: "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
|
+
[k]: "string",
|
|
55
|
+
[F]: "number",
|
|
56
|
+
[$]: "number",
|
|
57
57
|
[Ie]: "number",
|
|
58
58
|
[ae]: "string",
|
|
59
59
|
[ce]: "string"
|
|
60
|
-
},
|
|
61
|
-
[
|
|
60
|
+
}, $o = {
|
|
61
|
+
[k]: "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
|
+
[k]: ["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
|
+
[F]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
|
|
79
|
+
[$]: ["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
117
|
function ge(e, t = null, n = null) {
|
|
118
|
-
const r = { ...
|
|
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
|
|
133
|
+
function Ro(e, t = null, n = null) {
|
|
134
134
|
return e.map((r) => ge(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 Bo(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) => ge(e, null, t);
|
|
189
|
+
function bn(e) {
|
|
190
|
+
return { holeId: e[k] };
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const n = e[
|
|
192
|
+
function It(e, t = null) {
|
|
193
|
+
const n = e[k], 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[F]), s = Number(e[$]);
|
|
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
|
+
[k]: 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)[k];
|
|
228
228
|
l !== void 0 && `${l}`.trim() !== "" && o.add(`${l}`.trim());
|
|
229
229
|
},
|
|
230
230
|
complete: () => n(Array.from(o)),
|
|
@@ -232,10 +232,10 @@ function So(e, t = null) {
|
|
|
232
232
|
});
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
return Object.entries(e || {}).some(([t, n]) => !(
|
|
235
|
+
function gn(e) {
|
|
236
|
+
return Object.entries(e || {}).some(([t, n]) => !(hn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function yn(e, t = null) {
|
|
239
239
|
return new Promise((n, r) => {
|
|
240
240
|
const o = /* @__PURE__ */ new Map();
|
|
241
241
|
te.parse(e, {
|
|
@@ -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 (!gn(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 = [],
|
|
@@ -337,18 +337,18 @@ function we({
|
|
|
337
337
|
} = {}) {
|
|
338
338
|
return e ? r.includes(e) ? "comment" : n.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !t || t === "categorical" || t === "comment" || t === "tadpole" ? o : t : t || o;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function St({
|
|
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
|
-
function
|
|
493
|
-
const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } =
|
|
492
|
+
function Re(e = []) {
|
|
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,
|
|
@@ -500,14 +500,14 @@ function Be(e = []) {
|
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
502
|
async function En(e, t = null) {
|
|
503
|
-
return await
|
|
503
|
+
return await yn(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 } =
|
|
510
|
+
const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Re(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = St({
|
|
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[k] && 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 = ge(e, null, t), r = n[
|
|
548
|
+
function An(e, t = null) {
|
|
549
|
+
const n = ge(e, null, t), r = n[k], 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
|
+
[k]: 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[k] || f.holeId || f.id || "").toString().trim();
|
|
576
576
|
if (!h) return;
|
|
577
|
-
const
|
|
578
|
-
n.has(
|
|
577
|
+
const g = h.toLowerCase();
|
|
578
|
+
n.has(g) || n.set(g, 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[k] || "").toString().trim();
|
|
583
583
|
if (!h) return;
|
|
584
|
-
const
|
|
585
|
-
l.has(
|
|
584
|
+
const g = h.toLowerCase();
|
|
585
|
+
l.has(g) || l.set(g, []), l.get(g).push(f);
|
|
586
586
|
});
|
|
587
|
-
const
|
|
587
|
+
const c = [];
|
|
588
588
|
return l.forEach((f, h) => {
|
|
589
|
-
const
|
|
590
|
-
if (!
|
|
591
|
-
const y = f.filter((
|
|
589
|
+
const g = n.get(h);
|
|
590
|
+
if (!g) return;
|
|
591
|
+
const y = f.filter((O) => Number.isFinite(O[W] ?? O.surveydepth)).sort((O, V) => (O[W] ?? O.surveydepth) - (V[W] ?? V.surveydepth));
|
|
592
592
|
if (!y.length) return;
|
|
593
|
-
const p =
|
|
594
|
-
let
|
|
595
|
-
for (let
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
598
|
-
|
|
599
|
-
x:
|
|
600
|
-
y: x +
|
|
593
|
+
const p = g.lat ?? g[oe], b = g.lng ?? g[ie], N = 111132, M = 111320 * Math.cos(p * Math.PI / 180), I = (b - o) * s, x = (p - r) * i, S = [];
|
|
594
|
+
let w = 0, D = 0, v = 0;
|
|
595
|
+
for (let O = 0; O < y.length; O += 1) {
|
|
596
|
+
const V = y[O], H = y[O - 1], A = V[W] ?? V.surveydepth, E = V[X] ?? V.azimuth, z = V[q] ?? V.dip;
|
|
597
|
+
if (!H) {
|
|
598
|
+
S.push({
|
|
599
|
+
x: I + w,
|
|
600
|
+
y: x + D,
|
|
601
601
|
z: 0,
|
|
602
|
-
md:
|
|
603
|
-
azimuth:
|
|
604
|
-
dip:
|
|
602
|
+
md: A,
|
|
603
|
+
azimuth: E,
|
|
604
|
+
dip: z
|
|
605
605
|
});
|
|
606
606
|
continue;
|
|
607
607
|
}
|
|
608
|
-
const
|
|
608
|
+
const R = H[W] ?? H.surveydepth, C = H[X] ?? H.azimuth, G = H[q] ?? H.dip, U = A - R;
|
|
609
609
|
if (U <= 0) continue;
|
|
610
|
-
const j =
|
|
610
|
+
const j = ut(G), Z = ut(z), K = Qe(C), le = Qe(E), ye = Math.acos(
|
|
611
611
|
Math.sin(j) * Math.sin(Z) * Math.cos(K - le) + Math.cos(j) * Math.cos(Z)
|
|
612
|
-
), fe = ye > 1e-6 ? 2 / ye * Math.tan(ye / 2) : 1,
|
|
613
|
-
|
|
614
|
-
x:
|
|
615
|
-
y: x +
|
|
616
|
-
z: -
|
|
612
|
+
), fe = ye > 1e-6 ? 2 / ye * Math.tan(ye / 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
|
+
w += Ce, D += he, v += Ge, S.push({
|
|
614
|
+
x: I + w,
|
|
615
|
+
y: x + D,
|
|
616
|
+
z: -v,
|
|
617
617
|
// render with z up; depth down
|
|
618
|
-
md:
|
|
619
|
-
azimuth:
|
|
620
|
-
dip:
|
|
618
|
+
md: A,
|
|
619
|
+
azimuth: E,
|
|
620
|
+
dip: z
|
|
621
621
|
});
|
|
622
622
|
}
|
|
623
|
-
const
|
|
624
|
-
...
|
|
625
|
-
lat: p +
|
|
626
|
-
lng:
|
|
623
|
+
const L = S.map((O) => ({
|
|
624
|
+
...O,
|
|
625
|
+
lat: p + O.y / N,
|
|
626
|
+
lng: b + O.x / M
|
|
627
627
|
}));
|
|
628
|
-
|
|
629
|
-
id:
|
|
630
|
-
project:
|
|
631
|
-
points:
|
|
632
|
-
collar:
|
|
628
|
+
c.push({
|
|
629
|
+
id: g[k] || g.holeId || h,
|
|
630
|
+
project: g[me] || g.project_id || g.project || "",
|
|
631
|
+
points: L,
|
|
632
|
+
collar: g
|
|
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,71 +697,71 @@ 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
|
|
715
|
-
...
|
|
716
|
-
from: re(
|
|
717
|
-
azimuth: re(
|
|
718
|
-
dip: re(
|
|
719
|
-
})).filter((
|
|
720
|
-
if (!
|
|
721
|
-
let y = re(h.x, 0), p = re(h.y, 0),
|
|
722
|
-
const
|
|
714
|
+
const g = [...d].map((S) => ({
|
|
715
|
+
...S,
|
|
716
|
+
from: re(S.from),
|
|
717
|
+
azimuth: re(S.azimuth),
|
|
718
|
+
dip: re(S.dip)
|
|
719
|
+
})).filter((S) => Number.isFinite(S.from) && Number.isFinite(S.azimuth) && Number.isFinite(S.dip)).sort((S, w) => S.from - w.from);
|
|
720
|
+
if (!g.length) return;
|
|
721
|
+
let y = re(h.x, 0), p = re(h.y, 0), b = re(h.z, 0), N = g[0].from;
|
|
722
|
+
const M = g[0].azimuth, I = g[0].dip, x = {
|
|
723
723
|
hole_id: f,
|
|
724
|
-
md:
|
|
724
|
+
md: N,
|
|
725
725
|
x: y,
|
|
726
726
|
y: p,
|
|
727
|
-
z:
|
|
728
|
-
azimuth:
|
|
729
|
-
dip:
|
|
727
|
+
z: b,
|
|
728
|
+
azimuth: M,
|
|
729
|
+
dip: I
|
|
730
730
|
};
|
|
731
731
|
l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (x[l.aliasCol] = h[l.aliasCol]), m.push(x);
|
|
732
|
-
for (let
|
|
733
|
-
const
|
|
734
|
-
if (
|
|
735
|
-
const
|
|
736
|
-
for (let
|
|
737
|
-
|
|
738
|
-
const
|
|
739
|
-
y +=
|
|
732
|
+
for (let S = 0; S < g.length - 1; S += 1) {
|
|
733
|
+
const w = g[S], D = g[S + 1], v = w.from, O = D.from - v;
|
|
734
|
+
if (O <= 0) continue;
|
|
735
|
+
const V = Math.max(1, Math.ceil(O / s)), H = O / V;
|
|
736
|
+
for (let A = 0; A < V; A += 1) {
|
|
737
|
+
N += H;
|
|
738
|
+
const E = (N - v) / O, z = w.azimuth + E * (D.azimuth - w.azimuth), R = w.dip + E * (D.dip - w.dip), C = In(H, w.azimuth, w.dip, D.azimuth, D.dip, i);
|
|
739
|
+
y += C.dx, p += C.dy, b += C.dz;
|
|
740
740
|
const G = {
|
|
741
741
|
hole_id: f,
|
|
742
|
-
md:
|
|
742
|
+
md: N,
|
|
743
743
|
x: y,
|
|
744
744
|
y: p,
|
|
745
|
-
z:
|
|
746
|
-
azimuth: i === "minimum_curvature" ?
|
|
747
|
-
dip: i === "minimum_curvature" ?
|
|
745
|
+
z: b,
|
|
746
|
+
azimuth: i === "minimum_curvature" ? z : C.azimuth,
|
|
747
|
+
dip: i === "minimum_curvature" ? R : C.dip
|
|
748
748
|
};
|
|
749
749
|
l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (G[l.aliasCol] = h[l.aliasCol]), m.push(G);
|
|
750
750
|
}
|
|
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,20 +801,20 @@ 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 = ge(l, null, t),
|
|
804
|
+
o.data.forEach((l, c) => {
|
|
805
|
+
const a = ge(l, null, t), u = a[k], m = u !== void 0 ? `${u}`.trim() : "", d = a[pe] ?? a.x, f = a[be] ?? a.y, h = a[xe] ?? a.z, g = 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,
|
|
809
|
-
order:
|
|
809
|
+
order: g,
|
|
810
810
|
x: Number(d) ?? 0,
|
|
811
811
|
y: Number(f) ?? 0,
|
|
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,29 +838,29 @@ 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
|
-
function
|
|
848
|
+
function Sn(e = [], t = "Intervals") {
|
|
849
849
|
if (!e.length) return;
|
|
850
|
-
const n = Pe(e, [
|
|
850
|
+
const n = Pe(e, [k, F, $]), 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[k]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[F]), l = Number(o == null ? void 0 : o[$]);
|
|
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
|
});
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function Dn(e, t = {}) {
|
|
864
864
|
return new Promise((n, r) => {
|
|
865
865
|
te.parse(e, {
|
|
866
866
|
header: !0,
|
|
@@ -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
|
-
s = await
|
|
889
|
+
s = await Dn(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) => k in d))
|
|
901
|
+
throw Y("loadCollars", new Error(`Collar table missing column: ${k}`));
|
|
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 (k in f) {
|
|
908
|
+
const h = f[k];
|
|
909
|
+
f[k] = 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) && k in f && (f.datasource_hole_id = f[k]), f;
|
|
912
912
|
});
|
|
913
|
-
if (!
|
|
913
|
+
if (!u.every((d) => !(!d[k] || 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 = [k, 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 (k in u) {
|
|
929
|
+
const m = u[k];
|
|
930
|
+
u[k] = m == null ? "" : `${m}`.trim();
|
|
931
931
|
}
|
|
932
|
-
return W in
|
|
932
|
+
return W in u && (u[W] = ee(u[W])), $ in u && (u[$] = ee(u[$])), 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[k] || !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, [k, 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 = [k, F, $];
|
|
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 (k in u) {
|
|
950
|
+
const m = u[k];
|
|
951
|
+
u[k] = m == null ? "" : `${m}`.trim();
|
|
952
952
|
}
|
|
953
|
-
return
|
|
953
|
+
return F in u && (u[F] = ee(u[F])), $ in u && (u[$] = ee(u[$])), F in u && $ in u && Number.isFinite(u[F]) && Number.isFinite(u[$]) && (u[Ie] = 0.5 * (u[F] + u[$])), u;
|
|
954
954
|
});
|
|
955
|
-
if (!l.every((a) => !(!a[
|
|
955
|
+
if (!l.every((a) => !(!a[k] || !Number.isFinite(a[F]) || !Number.isFinite(a[$]) || !(a[$] > a[F]))))
|
|
956
956
|
throw Y("loadAssays", new Error("Assay table has missing required values"));
|
|
957
|
-
return Pe(l, [
|
|
957
|
+
return Pe(l, [k, F, $]);
|
|
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 = [k, F, $];
|
|
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 (k in m) {
|
|
971
|
+
const h = m[k];
|
|
972
|
+
m[k] = h == null ? "" : `${h}`.trim();
|
|
973
973
|
}
|
|
974
|
-
|
|
974
|
+
F in m && (m[F] = ee(m[F])), $ in m && (m[$] = ee(m[$])), F in m && $ in m && Number.isFinite(m[F]) && Number.isFinite(m[$]) && (m[$] === m[F] && (m[F] = Math.round(m[F] * 1e3) / 1e3, m[$] = m[F] + 1e-3), m[Ie] = 0.5 * (m[F] + m[$]));
|
|
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[k] || !Number.isFinite(u[F]) || !Number.isFinite(u[$]) || !(u[$] > u[F]))))
|
|
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
|
-
if (
|
|
986
|
-
const
|
|
985
|
+
if (Sn(l, "Geology"), !r) {
|
|
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
|
+
[k, F, $]
|
|
990
990
|
);
|
|
991
991
|
}
|
|
992
|
-
return Pe(l, [
|
|
992
|
+
return Pe(l, [k, F, $]);
|
|
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 : [k];
|
|
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
|
|
1039
|
+
const Dt = ["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,29 +1044,29 @@ 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
|
-
(l) => !
|
|
1069
|
+
(l) => !Dt.includes(l)
|
|
1070
1070
|
);
|
|
1071
1071
|
t({ data: i, properties: s });
|
|
1072
1072
|
},
|
|
@@ -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
|
-
(r) => !
|
|
1100
|
+
(r) => !Dt.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;
|
|
@@ -1127,55 +1127,55 @@ function wn(e, t, n) {
|
|
|
1127
1127
|
return new n.Color().setHSL(o / 360, 0.7, 0.5);
|
|
1128
1128
|
}
|
|
1129
1129
|
const nt = (e, t = null) => ge(e, null, t);
|
|
1130
|
-
function
|
|
1130
|
+
function Rn(e) {
|
|
1131
1131
|
if (!e.length) return null;
|
|
1132
|
-
const t = e[0], n =
|
|
1132
|
+
const t = e[0], n = F in 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[k] !== void 0 ? `${e[k]}`.trim() : "";
|
|
1141
1141
|
if (!t) return null;
|
|
1142
1142
|
const n = de(e[W]);
|
|
1143
1143
|
return n === null ? null : {
|
|
1144
|
-
[
|
|
1144
|
+
[k]: 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[k] !== void 0 ? `${e[k]}`.trim() : "";
|
|
1154
1154
|
if (!t) return null;
|
|
1155
|
-
const n = de(e[
|
|
1155
|
+
const n = de(e[F]), r = de(e[$]);
|
|
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
|
+
[k]: t,
|
|
1160
|
+
[F]: n,
|
|
1161
|
+
[$]: 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 Bn(e, t =
|
|
1216
|
+
function Bn(e, t = k) {
|
|
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 = Rn(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 = ge(i), l = s[
|
|
1259
|
+
const s = ge(i), l = s[k] != null ? `${s[k]}`.trim() : "";
|
|
1260
1260
|
if (!l) continue;
|
|
1261
|
-
const
|
|
1262
|
-
if (!Number.isFinite(
|
|
1263
|
-
const
|
|
1261
|
+
const c = Number(s[F]), a = Number(s[$]);
|
|
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
|
+
[k]: l,
|
|
1266
|
+
[F]: c,
|
|
1267
|
+
[$]: 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[F] - c[F])
|
|
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 = ge(o), s = (i[
|
|
1293
|
+
const i = ge(o), s = (i[k] ?? "").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[F]), c = Number(i[$]);
|
|
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
|
+
[k]: s,
|
|
1300
|
+
[F]: l,
|
|
1301
|
+
[$]: c,
|
|
1302
1302
|
[Ie]: a,
|
|
1303
1303
|
[W]: a,
|
|
1304
1304
|
_source: "geology"
|
|
@@ -1308,96 +1308,141 @@ 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[F] - l[F])
|
|
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 }) => Bn(l.map((
|
|
1322
|
+
({ rows: l }) => Bn(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 bi(e, t, n, r, o = {}) {
|
|
1338
|
+
const i = o.fromCol || "from", s = o.toCol || "to", l = o.holeCol || "hole_id";
|
|
1339
|
+
if (!e || !e.length) return [];
|
|
1340
|
+
const c = {};
|
|
1341
|
+
for (const u of e) {
|
|
1342
|
+
const m = u[l];
|
|
1343
|
+
m != null && (c[m] || (c[m] = []), c[m].push(u));
|
|
1344
|
+
}
|
|
1345
|
+
const a = [];
|
|
1346
|
+
for (const [u, m] of Object.entries(c)) {
|
|
1347
|
+
const f = [...m].sort((p, b) => Number(p[i]) - Number(b[i])).filter((p) => {
|
|
1348
|
+
const b = Number(p[t]);
|
|
1349
|
+
return Number.isFinite(b) && b >= n;
|
|
1350
|
+
});
|
|
1351
|
+
if (!f.length) continue;
|
|
1352
|
+
const h = [];
|
|
1353
|
+
let g = [], y = null;
|
|
1354
|
+
for (const p of f) {
|
|
1355
|
+
const b = Number(p[i]), N = Number(p[s]);
|
|
1356
|
+
y === null || Math.abs(b - y) > 1e-6 ? (g.length && h.push(g), g = [p]) : g.push(p), y = N;
|
|
1357
|
+
}
|
|
1358
|
+
g.length && h.push(g);
|
|
1359
|
+
for (const p of h) {
|
|
1360
|
+
const b = Number(p[0][i]), N = Number(p[p.length - 1][s]), M = N - b;
|
|
1361
|
+
if (M < r) continue;
|
|
1362
|
+
let I = 0, x = 0;
|
|
1363
|
+
for (const v of p) {
|
|
1364
|
+
const L = Number(v[t]), O = Number(v[s]) - Number(v[i]);
|
|
1365
|
+
I += L * O, x += O;
|
|
1366
|
+
}
|
|
1367
|
+
const S = I / x, w = p.length, D = `${M.toFixed(1)} m @ ${S.toFixed(2)} ${t}`;
|
|
1368
|
+
a.push({
|
|
1369
|
+
[l]: u,
|
|
1370
|
+
assay_field: t,
|
|
1371
|
+
[i]: b,
|
|
1372
|
+
[s]: N,
|
|
1373
|
+
length: M,
|
|
1374
|
+
avg_grade: S,
|
|
1375
|
+
n_samples: w,
|
|
1376
|
+
label: D
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
return a;
|
|
1381
|
+
}
|
|
1382
|
+
function Gn(e, t) {
|
|
1338
1383
|
if (!e || e.length === 0 || !Number.isFinite(t)) return null;
|
|
1339
1384
|
const n = e.length;
|
|
1340
1385
|
if (n === 1) {
|
|
1341
|
-
const
|
|
1342
|
-
return { x: Number(
|
|
1386
|
+
const b = e[0];
|
|
1387
|
+
return { x: Number(b.x), y: Number(b.y), z: Number(b.z), dx: 0, dy: 0, dz: -1 };
|
|
1343
1388
|
}
|
|
1344
1389
|
let r = -1;
|
|
1345
|
-
for (let
|
|
1346
|
-
const
|
|
1347
|
-
if (t >=
|
|
1348
|
-
r =
|
|
1390
|
+
for (let b = 0; b < n - 1; b++) {
|
|
1391
|
+
const N = Number(e[b].md), M = Number(e[b + 1].md);
|
|
1392
|
+
if (t >= N && t <= M) {
|
|
1393
|
+
r = b;
|
|
1349
1394
|
break;
|
|
1350
1395
|
}
|
|
1351
1396
|
}
|
|
1352
1397
|
let o, i, s;
|
|
1353
1398
|
if (r === -1) {
|
|
1354
1399
|
t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
|
|
1355
|
-
const
|
|
1356
|
-
s =
|
|
1400
|
+
const b = Number(o.md), M = Number(i.md) - b;
|
|
1401
|
+
s = M > 0 ? (t - b) / M : t < b ? 0 : 1;
|
|
1357
1402
|
} else {
|
|
1358
1403
|
o = e[r], i = e[r + 1];
|
|
1359
|
-
const
|
|
1360
|
-
s =
|
|
1404
|
+
const b = Number(o.md), M = Number(i.md) - b;
|
|
1405
|
+
s = M > 0 ? (t - b) / M : 0;
|
|
1361
1406
|
}
|
|
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),
|
|
1407
|
+
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));
|
|
1408
|
+
let u, m, d;
|
|
1409
|
+
const f = Number(o.azimuth), h = Number(o.dip), g = Number(i.azimuth), y = Number(i.dip);
|
|
1365
1410
|
if (Number.isFinite(f) && Number.isFinite(h)) {
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1411
|
+
const b = Number.isFinite(g) && Number.isFinite(y) ? f + s * (g - f) : f, N = Number.isFinite(g) && Number.isFinite(y) ? h + s * (y - h) : h, M = b * Math.PI / 180, I = N * Math.PI / 180;
|
|
1412
|
+
u = Math.cos(I) * Math.sin(M), m = Math.cos(I) * Math.cos(M), d = -Math.sin(I);
|
|
1368
1413
|
} 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 && (
|
|
1414
|
+
const b = Number(i.x) - Number(o.x), N = Number(i.y) - Number(o.y), M = Number(i.z) - Number(o.z), I = Math.sqrt(b * b + N * N + M * M);
|
|
1415
|
+
if (I < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
|
|
1416
|
+
u = b / I, m = N / I, d = M / I;
|
|
1417
|
+
}
|
|
1418
|
+
const p = Math.sqrt(u * u + m * m + d * d);
|
|
1419
|
+
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 };
|
|
1420
|
+
}
|
|
1421
|
+
function Un(e, t, n, r = {}) {
|
|
1422
|
+
const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: c } = n, a = [s, l, c];
|
|
1423
|
+
let u = [0, 0, 1];
|
|
1424
|
+
const m = a[0] * u[0] + a[1] * u[1] + a[2] * u[2];
|
|
1425
|
+
Math.abs(m) > 0.99 && (u = [0, 1, 0]);
|
|
1381
1426
|
const d = [
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
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],
|
|
1427
|
+
u[1] * a[2] - u[2] * a[1],
|
|
1428
|
+
u[2] * a[0] - u[0] * a[2],
|
|
1429
|
+
u[0] * a[1] - u[1] * a[0]
|
|
1430
|
+
], 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], g = [
|
|
1386
1431
|
a[1] * h[2] - a[2] * h[1],
|
|
1387
1432
|
a[2] * h[0] - a[0] * h[2],
|
|
1388
1433
|
a[0] * h[1] - a[1] * h[0]
|
|
1389
|
-
], y = Math.sqrt(
|
|
1390
|
-
a[1] *
|
|
1391
|
-
a[2] *
|
|
1392
|
-
a[0] *
|
|
1393
|
-
],
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
],
|
|
1398
|
-
return
|
|
1399
|
-
}
|
|
1400
|
-
function
|
|
1434
|
+
], y = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), p = y > 1e-10 ? [g[0] / y, g[1] / y, g[2] / y] : [0, 1, 0], b = o === "R" ? h : p, N = t * Math.PI / 180 * i, M = Math.cos(N), I = Math.sin(N), x = b[0] * a[0] + b[1] * a[1] + b[2] * a[2], S = [
|
|
1435
|
+
a[1] * b[2] - a[2] * b[1],
|
|
1436
|
+
a[2] * b[0] - a[0] * b[2],
|
|
1437
|
+
a[0] * b[1] - a[1] * b[0]
|
|
1438
|
+
], w = [
|
|
1439
|
+
b[0] * M + S[0] * I + a[0] * x * (1 - M),
|
|
1440
|
+
b[1] * M + S[1] * I + a[1] * x * (1 - M),
|
|
1441
|
+
b[2] * M + S[2] * I + a[2] * x * (1 - M)
|
|
1442
|
+
], D = (90 - e) * Math.PI / 180, v = Math.cos(D), L = Math.sin(D), O = v * w[0] + L * a[0], V = v * w[1] + L * a[1], H = v * w[2] + L * a[2], A = Math.sqrt(O * O + V * V + H * H);
|
|
1443
|
+
return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: O / A, ny: V / A, nz: H / A };
|
|
1444
|
+
}
|
|
1445
|
+
function Yn(e, t, n = {}) {
|
|
1401
1446
|
if (!(e != null && e.length) || !(t != null && t.length)) return [];
|
|
1402
1447
|
const r = /* @__PURE__ */ new Map();
|
|
1403
1448
|
for (const i of t) {
|
|
@@ -1412,27 +1457,27 @@ function Un(e, t, n = {}) {
|
|
|
1412
1457
|
if (!s) continue;
|
|
1413
1458
|
const l = r.get(s);
|
|
1414
1459
|
if (!l || l.length === 0) continue;
|
|
1415
|
-
const
|
|
1416
|
-
if (!Number.isFinite(
|
|
1417
|
-
const a =
|
|
1460
|
+
const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
|
|
1461
|
+
if (!Number.isFinite(c)) continue;
|
|
1462
|
+
const a = Gn(l, c);
|
|
1418
1463
|
if (!a) continue;
|
|
1419
|
-
const { x:
|
|
1420
|
-
let y, p,
|
|
1421
|
-
const
|
|
1422
|
-
if (Number.isFinite(
|
|
1423
|
-
const
|
|
1424
|
-
y = x.nx, p = x.ny,
|
|
1464
|
+
const { x: u, y: m, z: d, dx: f, dy: h, dz: g } = a;
|
|
1465
|
+
let y, p, b;
|
|
1466
|
+
const N = i.alpha != null ? Number(i.alpha) : null, M = i.beta != null ? Number(i.beta) : null;
|
|
1467
|
+
if (Number.isFinite(N)) {
|
|
1468
|
+
const I = Number.isFinite(M) ? M : 0, x = Un(N, I, { dx: f, dy: h, dz: g }, n);
|
|
1469
|
+
y = x.nx, p = x.ny, b = x.nz;
|
|
1425
1470
|
} else {
|
|
1426
|
-
const
|
|
1427
|
-
if (!Number.isFinite(
|
|
1428
|
-
const
|
|
1429
|
-
y = Math.sin(
|
|
1471
|
+
const I = i.dip != null ? Number(i.dip) : null, x = i.azimuth != null ? Number(i.azimuth) : null;
|
|
1472
|
+
if (!Number.isFinite(I) || !Number.isFinite(x)) continue;
|
|
1473
|
+
const S = I * Math.PI / 180, w = x * Math.PI / 180;
|
|
1474
|
+
y = Math.sin(w) * Math.sin(S), p = Math.cos(w) * Math.sin(S), b = Math.cos(S);
|
|
1430
1475
|
}
|
|
1431
|
-
o.push({ ...i, x:
|
|
1476
|
+
o.push({ ...i, x: u, y: m, z: d, nx: y, ny: p, nz: b });
|
|
1432
1477
|
}
|
|
1433
1478
|
return o;
|
|
1434
1479
|
}
|
|
1435
|
-
const
|
|
1480
|
+
const Xn = "baselode", gi = Xn, qn = [
|
|
1436
1481
|
"#8b1e3f",
|
|
1437
1482
|
"#2563eb",
|
|
1438
1483
|
"#16a34a",
|
|
@@ -1443,7 +1488,7 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1443
1488
|
"#10b981",
|
|
1444
1489
|
"#f97316",
|
|
1445
1490
|
"#8b5cf6"
|
|
1446
|
-
],
|
|
1491
|
+
], B = {
|
|
1447
1492
|
bg: "#ffffff",
|
|
1448
1493
|
panel: "#f8fafc",
|
|
1449
1494
|
ink: "#1e293b",
|
|
@@ -1457,31 +1502,31 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1457
1502
|
muted_3: "#e2e8f0",
|
|
1458
1503
|
primary: "#8b1e3f",
|
|
1459
1504
|
primary_2: "#a8324f"
|
|
1460
|
-
},
|
|
1505
|
+
}, Oe = {
|
|
1461
1506
|
layout: {
|
|
1462
|
-
paper_bgcolor:
|
|
1463
|
-
plot_bgcolor:
|
|
1507
|
+
paper_bgcolor: B.bg,
|
|
1508
|
+
plot_bgcolor: B.bg,
|
|
1464
1509
|
colorway: qn,
|
|
1465
1510
|
font: {
|
|
1466
1511
|
family: "Inter, system-ui, sans-serif",
|
|
1467
1512
|
size: 12,
|
|
1468
|
-
color:
|
|
1513
|
+
color: B.ink
|
|
1469
1514
|
},
|
|
1470
1515
|
title: {
|
|
1471
|
-
font: { size: 14, color:
|
|
1516
|
+
font: { size: 14, color: B.ink },
|
|
1472
1517
|
x: 0.05
|
|
1473
1518
|
},
|
|
1474
1519
|
hovermode: "x unified",
|
|
1475
1520
|
hoverlabel: {
|
|
1476
|
-
bgcolor:
|
|
1477
|
-
bordercolor:
|
|
1478
|
-
font: { size: 12, color:
|
|
1521
|
+
bgcolor: B.bg,
|
|
1522
|
+
bordercolor: B.line,
|
|
1523
|
+
font: { size: 12, color: B.ink }
|
|
1479
1524
|
},
|
|
1480
1525
|
legend: {
|
|
1481
1526
|
bgcolor: "rgba(255,255,255,0.9)",
|
|
1482
|
-
bordercolor:
|
|
1527
|
+
bordercolor: B.muted_3,
|
|
1483
1528
|
borderwidth: 1,
|
|
1484
|
-
font: { size: 11, color:
|
|
1529
|
+
font: { size: 11, color: B.ink },
|
|
1485
1530
|
orientation: "h",
|
|
1486
1531
|
yanchor: "bottom",
|
|
1487
1532
|
y: 1.02,
|
|
@@ -1491,34 +1536,34 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1491
1536
|
xaxis: {
|
|
1492
1537
|
showline: !0,
|
|
1493
1538
|
linewidth: 1,
|
|
1494
|
-
linecolor:
|
|
1539
|
+
linecolor: B.line,
|
|
1495
1540
|
mirror: !1,
|
|
1496
1541
|
ticks: "outside",
|
|
1497
1542
|
tickwidth: 1,
|
|
1498
|
-
tickcolor:
|
|
1543
|
+
tickcolor: B.line,
|
|
1499
1544
|
ticklen: 4,
|
|
1500
1545
|
showgrid: !0,
|
|
1501
|
-
gridcolor:
|
|
1546
|
+
gridcolor: B.grid,
|
|
1502
1547
|
gridwidth: 1,
|
|
1503
1548
|
zeroline: !1,
|
|
1504
|
-
title_font: { color:
|
|
1505
|
-
tickfont: { color:
|
|
1549
|
+
title_font: { color: B.ink, size: 12 },
|
|
1550
|
+
tickfont: { color: B.ink_soft, size: 10 }
|
|
1506
1551
|
},
|
|
1507
1552
|
yaxis: {
|
|
1508
1553
|
showline: !0,
|
|
1509
1554
|
linewidth: 1,
|
|
1510
|
-
linecolor:
|
|
1555
|
+
linecolor: B.line,
|
|
1511
1556
|
mirror: !1,
|
|
1512
1557
|
ticks: "outside",
|
|
1513
1558
|
tickwidth: 1,
|
|
1514
|
-
tickcolor:
|
|
1559
|
+
tickcolor: B.line,
|
|
1515
1560
|
ticklen: 4,
|
|
1516
1561
|
showgrid: !0,
|
|
1517
|
-
gridcolor:
|
|
1562
|
+
gridcolor: B.grid,
|
|
1518
1563
|
gridwidth: 1,
|
|
1519
1564
|
zeroline: !1,
|
|
1520
|
-
title_font: { color:
|
|
1521
|
-
tickfont: { color:
|
|
1565
|
+
title_font: { color: B.ink, size: 12 },
|
|
1566
|
+
tickfont: { color: B.ink_soft, size: 10 }
|
|
1522
1567
|
},
|
|
1523
1568
|
modebar: {
|
|
1524
1569
|
remove: ["select2d", "lasso2d", "autoScale2d"]
|
|
@@ -1529,34 +1574,34 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1529
1574
|
data: {
|
|
1530
1575
|
scatter: [{
|
|
1531
1576
|
mode: "lines+markers",
|
|
1532
|
-
line: { width: 2, color:
|
|
1577
|
+
line: { width: 2, color: B.primary },
|
|
1533
1578
|
marker: {
|
|
1534
1579
|
size: 7,
|
|
1535
|
-
color:
|
|
1536
|
-
line: { width: 1.5, color:
|
|
1580
|
+
color: B.primary_2,
|
|
1581
|
+
line: { width: 1.5, color: B.bg }
|
|
1537
1582
|
}
|
|
1538
1583
|
}],
|
|
1539
1584
|
bar: [{
|
|
1540
1585
|
marker: {
|
|
1541
|
-
color:
|
|
1542
|
-
line: { color:
|
|
1586
|
+
color: B.primary,
|
|
1587
|
+
line: { color: B.bg, width: 0 }
|
|
1543
1588
|
}
|
|
1544
1589
|
}],
|
|
1545
1590
|
histogram: [{
|
|
1546
1591
|
marker: {
|
|
1547
|
-
color:
|
|
1548
|
-
line: { color:
|
|
1592
|
+
color: B.primary,
|
|
1593
|
+
line: { color: B.bg, width: 0 }
|
|
1549
1594
|
}
|
|
1550
1595
|
}],
|
|
1551
1596
|
box: [{
|
|
1552
|
-
fillcolor:
|
|
1553
|
-
line: { color:
|
|
1554
|
-
marker: { color:
|
|
1597
|
+
fillcolor: B.accent,
|
|
1598
|
+
line: { color: B.ink, width: 1.5 },
|
|
1599
|
+
marker: { color: B.ink }
|
|
1555
1600
|
}],
|
|
1556
1601
|
violin: [{
|
|
1557
|
-
fillcolor:
|
|
1558
|
-
line: { color:
|
|
1559
|
-
marker: { color:
|
|
1602
|
+
fillcolor: B.accent,
|
|
1603
|
+
line: { color: B.ink, width: 1.5 },
|
|
1604
|
+
marker: { color: B.ink }
|
|
1560
1605
|
}],
|
|
1561
1606
|
heatmap: [{
|
|
1562
1607
|
colorscale: [
|
|
@@ -1568,9 +1613,9 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1568
1613
|
[1, "#1e293b"]
|
|
1569
1614
|
],
|
|
1570
1615
|
colorbar: {
|
|
1571
|
-
outlinecolor:
|
|
1572
|
-
tickcolor:
|
|
1573
|
-
tickfont: { color:
|
|
1616
|
+
outlinecolor: B.line,
|
|
1617
|
+
tickcolor: B.line,
|
|
1618
|
+
tickfont: { color: B.ink_soft }
|
|
1574
1619
|
}
|
|
1575
1620
|
}],
|
|
1576
1621
|
contour: [{
|
|
@@ -1582,13 +1627,13 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1582
1627
|
[1, "#1e293b"]
|
|
1583
1628
|
],
|
|
1584
1629
|
colorbar: {
|
|
1585
|
-
outlinecolor:
|
|
1586
|
-
tickcolor:
|
|
1587
|
-
tickfont: { color:
|
|
1630
|
+
outlinecolor: B.line,
|
|
1631
|
+
tickcolor: B.line,
|
|
1632
|
+
tickfont: { color: B.ink_soft }
|
|
1588
1633
|
}
|
|
1589
1634
|
}]
|
|
1590
1635
|
}
|
|
1591
|
-
},
|
|
1636
|
+
}, yi = Oe, T = {
|
|
1592
1637
|
bg: "#1b1b1f",
|
|
1593
1638
|
panel: "#25252a",
|
|
1594
1639
|
ink: "#f0f0e4",
|
|
@@ -1600,7 +1645,7 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1600
1645
|
muted_1: "#8a8a80",
|
|
1601
1646
|
muted_2: "#5e5e56",
|
|
1602
1647
|
muted_3: "#3a3a34"
|
|
1603
|
-
},
|
|
1648
|
+
}, _i = "baselode-dark", Ni = {
|
|
1604
1649
|
layout: {
|
|
1605
1650
|
font: {
|
|
1606
1651
|
family: "Inter, Arial, sans-serif",
|
|
@@ -1743,7 +1788,7 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1743
1788
|
}
|
|
1744
1789
|
}]
|
|
1745
1790
|
}
|
|
1746
|
-
},
|
|
1791
|
+
}, Zn = "#7f7f7f", Be = {
|
|
1747
1792
|
Au: "#FFD700",
|
|
1748
1793
|
// gold
|
|
1749
1794
|
Ag: "#C0C0C0",
|
|
@@ -1780,7 +1825,7 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1780
1825
|
// aluminium / yellow
|
|
1781
1826
|
U: "#8BC34A"
|
|
1782
1827
|
// uranium / lime green
|
|
1783
|
-
},
|
|
1828
|
+
}, Wn = {
|
|
1784
1829
|
// Sedimentary
|
|
1785
1830
|
shale: "#607D8B",
|
|
1786
1831
|
mudstone: "#78909C",
|
|
@@ -1819,11 +1864,11 @@ const Yn = "baselode", ii = Yn, qn = [
|
|
|
1819
1864
|
calcite: "#F9FBE7",
|
|
1820
1865
|
vein: "#FFFFFF",
|
|
1821
1866
|
unknown: "#9E9E9E"
|
|
1822
|
-
},
|
|
1823
|
-
commodity:
|
|
1824
|
-
lithology:
|
|
1867
|
+
}, Xe = {
|
|
1868
|
+
commodity: Be,
|
|
1869
|
+
lithology: Wn
|
|
1825
1870
|
};
|
|
1826
|
-
function
|
|
1871
|
+
function Kn(e, t, n = Zn) {
|
|
1827
1872
|
if (!t || e == null) return n;
|
|
1828
1873
|
const r = String(e).trim();
|
|
1829
1874
|
if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
|
|
@@ -1832,13 +1877,13 @@ function Wn(e, t, n = Xn) {
|
|
|
1832
1877
|
if (String(i).trim().toLowerCase() === o) return s;
|
|
1833
1878
|
return n;
|
|
1834
1879
|
}
|
|
1835
|
-
function
|
|
1880
|
+
function Jn(e) {
|
|
1836
1881
|
if (e == null) return {};
|
|
1837
1882
|
if (typeof e == "string") {
|
|
1838
1883
|
const t = e.trim().toLowerCase();
|
|
1839
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1840
|
-
return
|
|
1841
|
-
const n = Object.keys(
|
|
1884
|
+
if (Object.prototype.hasOwnProperty.call(Xe, t))
|
|
1885
|
+
return Xe[t];
|
|
1886
|
+
const n = Object.keys(Xe).sort().join(", ");
|
|
1842
1887
|
throw new RangeError(
|
|
1843
1888
|
`Unknown built-in colour map '${e}'. Available maps: ${n}`
|
|
1844
1889
|
);
|
|
@@ -1848,39 +1893,39 @@ function Kn(e) {
|
|
|
1848
1893
|
`colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
|
|
1849
1894
|
);
|
|
1850
1895
|
}
|
|
1851
|
-
const
|
|
1852
|
-
function
|
|
1896
|
+
const Qn = "#8b1e3f", er = "#a8324f";
|
|
1897
|
+
function tr(e) {
|
|
1853
1898
|
if (!e) return null;
|
|
1854
1899
|
const t = e.split(/[_\-/\s]+/);
|
|
1855
1900
|
for (const n of t) {
|
|
1856
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1857
|
-
return
|
|
1901
|
+
if (Object.prototype.hasOwnProperty.call(Be, n))
|
|
1902
|
+
return Be[n];
|
|
1858
1903
|
const r = n.toLowerCase();
|
|
1859
|
-
for (const [o, i] of Object.entries(
|
|
1904
|
+
for (const [o, i] of Object.entries(Be))
|
|
1860
1905
|
if (o.toLowerCase() === r) return i;
|
|
1861
1906
|
}
|
|
1862
1907
|
return null;
|
|
1863
1908
|
}
|
|
1864
|
-
const
|
|
1865
|
-
function
|
|
1909
|
+
const nr = "#6b7280", rr = { l: 42, r: 4, t: 4, b: 30 }, ft = 10, ht = 12;
|
|
1910
|
+
function pt(e) {
|
|
1866
1911
|
return e ? typeof e == "string" ? { text: e } : e : {};
|
|
1867
1912
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const t =
|
|
1913
|
+
function wt(e = {}) {
|
|
1914
|
+
const t = pt(e.xaxis && e.xaxis.title), n = pt(e.yaxis && e.yaxis.title);
|
|
1870
1915
|
return {
|
|
1871
1916
|
...e,
|
|
1872
|
-
margin:
|
|
1917
|
+
margin: rr,
|
|
1873
1918
|
autosize: !0,
|
|
1874
1919
|
width: void 0,
|
|
1875
1920
|
xaxis: {
|
|
1876
1921
|
...e.xaxis || {},
|
|
1877
1922
|
tickfont: {
|
|
1878
1923
|
...e.xaxis && e.xaxis.tickfont || {},
|
|
1879
|
-
size:
|
|
1924
|
+
size: ft
|
|
1880
1925
|
},
|
|
1881
1926
|
title: {
|
|
1882
1927
|
...t,
|
|
1883
|
-
font: { ...t.font || {}, size:
|
|
1928
|
+
font: { ...t.font || {}, size: ht }
|
|
1884
1929
|
}
|
|
1885
1930
|
},
|
|
1886
1931
|
yaxis: {
|
|
@@ -1888,16 +1933,16 @@ function Ft(e = {}) {
|
|
|
1888
1933
|
automargin: !0,
|
|
1889
1934
|
tickfont: {
|
|
1890
1935
|
...e.yaxis && e.yaxis.tickfont || {},
|
|
1891
|
-
size:
|
|
1936
|
+
size: ft
|
|
1892
1937
|
},
|
|
1893
1938
|
title: {
|
|
1894
1939
|
...n,
|
|
1895
|
-
font: { ...n.font || {}, size:
|
|
1940
|
+
font: { ...n.font || {}, size: ht }
|
|
1896
1941
|
}
|
|
1897
1942
|
}
|
|
1898
1943
|
};
|
|
1899
1944
|
}
|
|
1900
|
-
function
|
|
1945
|
+
function or(e, t) {
|
|
1901
1946
|
var r;
|
|
1902
1947
|
if (!e || !t) return !1;
|
|
1903
1948
|
const n = e.points || [];
|
|
@@ -1908,40 +1953,40 @@ function rr(e, t) {
|
|
|
1908
1953
|
}
|
|
1909
1954
|
return !1;
|
|
1910
1955
|
}
|
|
1911
|
-
function
|
|
1956
|
+
function ir(e, t, n) {
|
|
1912
1957
|
if (!e || !t) return [];
|
|
1913
1958
|
const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
|
|
1914
1959
|
return r.forEach((s) => {
|
|
1915
1960
|
let l = Number(
|
|
1916
1961
|
s.from ?? s.samp_from ?? s.sample_from ?? s.fromdepth ?? s.from_depth ?? s.depth_from
|
|
1917
|
-
),
|
|
1962
|
+
), c = Number(
|
|
1918
1963
|
s.to ?? s.samp_to ?? s.sample_to ?? s.todepth ?? s.to_depth ?? s.depth_to
|
|
1919
1964
|
);
|
|
1920
|
-
if (!Number.isFinite(l) || !Number.isFinite(
|
|
1965
|
+
if (!Number.isFinite(l) || !Number.isFinite(c)) {
|
|
1921
1966
|
const f = Number(s.depth ?? s.md);
|
|
1922
|
-
Number.isFinite(f) && (l = f,
|
|
1967
|
+
Number.isFinite(f) && (l = f, c = f);
|
|
1923
1968
|
}
|
|
1924
1969
|
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 +
|
|
1970
|
+
if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
|
|
1971
|
+
const u = `${t}:${l}-${c}:${String(a)}`;
|
|
1972
|
+
if (i.has(u)) return;
|
|
1973
|
+
i.add(u);
|
|
1974
|
+
const m = (l + c) / 2, d = n ? a : Number(a);
|
|
1930
1975
|
!n && !Number.isFinite(d) || o.push({
|
|
1931
1976
|
z: m,
|
|
1932
1977
|
val: d,
|
|
1933
1978
|
from: l,
|
|
1934
|
-
to:
|
|
1935
|
-
errorPlus:
|
|
1979
|
+
to: c,
|
|
1980
|
+
errorPlus: c - m,
|
|
1936
1981
|
errorMinus: m - l
|
|
1937
1982
|
});
|
|
1938
1983
|
}), o.sort((s, l) => l.z - s.z);
|
|
1939
1984
|
}
|
|
1940
|
-
function
|
|
1985
|
+
function sr(e, t, n, r) {
|
|
1941
1986
|
if (!e.length) return { data: [], layout: {} };
|
|
1942
1987
|
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
1988
|
if (!o.length) return { data: [], layout: {} };
|
|
1944
|
-
const i =
|
|
1989
|
+
const i = Jn(n), s = [
|
|
1945
1990
|
"#1f77b4",
|
|
1946
1991
|
// blue
|
|
1947
1992
|
"#ff7f0e",
|
|
@@ -1971,15 +2016,15 @@ function ir(e, t, n, r) {
|
|
|
1971
2016
|
"#636363"
|
|
1972
2017
|
// dark gray
|
|
1973
2018
|
], l = [...new Set(o.map((d) => d.category))];
|
|
1974
|
-
function
|
|
2019
|
+
function c(d, f) {
|
|
1975
2020
|
if (i && Object.keys(i).length > 0) {
|
|
1976
|
-
const h =
|
|
2021
|
+
const h = Kn(d, i, null);
|
|
1977
2022
|
if (h !== null) return h;
|
|
1978
2023
|
}
|
|
1979
2024
|
return s[f % s.length];
|
|
1980
2025
|
}
|
|
1981
2026
|
const a = new Map(
|
|
1982
|
-
l.map((d, f) => [d,
|
|
2027
|
+
l.map((d, f) => [d, c(d, f)])
|
|
1983
2028
|
);
|
|
1984
2029
|
return { data: l.map((d) => {
|
|
1985
2030
|
const f = o.filter((h) => h.category === d);
|
|
@@ -1995,19 +2040,19 @@ function ir(e, t, n, r) {
|
|
|
1995
2040
|
customdata: f.map((h) => [h.from, h.to]),
|
|
1996
2041
|
hovertemplate: `${t}: ${d}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
|
|
1997
2042
|
};
|
|
1998
|
-
}), layout:
|
|
2043
|
+
}), layout: wt({
|
|
1999
2044
|
barmode: "overlay",
|
|
2000
2045
|
bargap: 0,
|
|
2001
2046
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
2002
2047
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
2003
2048
|
showlegend: !1,
|
|
2004
2049
|
title: t || void 0,
|
|
2005
|
-
template: r !== void 0 ? r :
|
|
2050
|
+
template: r !== void 0 ? r : Oe
|
|
2006
2051
|
}) };
|
|
2007
2052
|
}
|
|
2008
|
-
function
|
|
2053
|
+
function lr(e, t, n, r, o) {
|
|
2009
2054
|
if (!e.length) return { data: [], layout: {} };
|
|
2010
|
-
const i = n === "bar", s = n === "markers", l = n === "line",
|
|
2055
|
+
const i = n === "bar", s = n === "markers", l = n === "line", c = r || Qn, a = r || er, u = {
|
|
2011
2056
|
x: e.map((h) => h.val),
|
|
2012
2057
|
y: e.map((h) => h.z),
|
|
2013
2058
|
hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
|
|
@@ -2019,37 +2064,37 @@ function sr(e, t, n, r, o) {
|
|
|
2019
2064
|
arrayminus: e.map((h) => h.errorMinus),
|
|
2020
2065
|
thickness: 1.5,
|
|
2021
2066
|
width: 2,
|
|
2022
|
-
color:
|
|
2067
|
+
color: nr
|
|
2023
2068
|
};
|
|
2024
2069
|
return { data: [i ? {
|
|
2025
|
-
...
|
|
2070
|
+
...u,
|
|
2026
2071
|
type: "bar",
|
|
2027
2072
|
orientation: "h",
|
|
2028
|
-
marker: { color:
|
|
2073
|
+
marker: { color: c },
|
|
2029
2074
|
error_y: m
|
|
2030
2075
|
} : {
|
|
2031
|
-
...
|
|
2076
|
+
...u,
|
|
2032
2077
|
type: "scatter",
|
|
2033
2078
|
mode: s ? "markers" : l ? "lines" : "lines+markers",
|
|
2034
|
-
line: { color:
|
|
2079
|
+
line: { color: c, width: 2 },
|
|
2035
2080
|
marker: { size: 7, color: a },
|
|
2036
2081
|
error_y: l ? void 0 : m
|
|
2037
|
-
}], layout:
|
|
2082
|
+
}], layout: wt({
|
|
2038
2083
|
xaxis: { title: t, zeroline: !1 },
|
|
2039
2084
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
2040
2085
|
barmode: "overlay",
|
|
2041
2086
|
showlegend: !1,
|
|
2042
|
-
template: o !== void 0 ? o :
|
|
2087
|
+
template: o !== void 0 ? o : Oe
|
|
2043
2088
|
}) };
|
|
2044
2089
|
}
|
|
2045
2090
|
function Tt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
|
|
2046
2091
|
if (!e || !e.length || !n) return { data: [], layout: {} };
|
|
2047
2092
|
if (t || r === "categorical")
|
|
2048
|
-
return
|
|
2049
|
-
const s =
|
|
2050
|
-
return
|
|
2093
|
+
return sr(e, n, o, i);
|
|
2094
|
+
const s = tr(n);
|
|
2095
|
+
return lr(e, n, r, s, i);
|
|
2051
2096
|
}
|
|
2052
|
-
function
|
|
2097
|
+
function Mi(e = [], {
|
|
2053
2098
|
fromCol: t = "from",
|
|
2054
2099
|
toCol: n = "to",
|
|
2055
2100
|
categoryCol: r = "geology_code",
|
|
@@ -2058,18 +2103,18 @@ function ci(e = [], {
|
|
|
2058
2103
|
} = {}) {
|
|
2059
2104
|
const s = [];
|
|
2060
2105
|
return e.forEach((l) => {
|
|
2061
|
-
const
|
|
2062
|
-
if (!Number.isFinite(
|
|
2063
|
-
const m = (
|
|
2106
|
+
const c = Number(l == null ? void 0 : l[t]), a = Number(l == null ? void 0 : l[n]), u = l == null ? void 0 : l[r];
|
|
2107
|
+
if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c || u == null || `${u}`.trim() === "") return;
|
|
2108
|
+
const m = (c + a) / 2;
|
|
2064
2109
|
s.push({
|
|
2065
2110
|
z: m,
|
|
2066
|
-
val: `${
|
|
2067
|
-
from:
|
|
2111
|
+
val: `${u}`,
|
|
2112
|
+
from: c,
|
|
2068
2113
|
to: a,
|
|
2069
2114
|
errorPlus: a - m,
|
|
2070
|
-
errorMinus: m -
|
|
2115
|
+
errorMinus: m - c
|
|
2071
2116
|
});
|
|
2072
|
-
}), s.sort((l,
|
|
2117
|
+
}), s.sort((l, c) => c.z - l.z), Tt({
|
|
2073
2118
|
points: s,
|
|
2074
2119
|
isCategorical: !0,
|
|
2075
2120
|
property: r,
|
|
@@ -2078,7 +2123,7 @@ function ci(e = [], {
|
|
|
2078
2123
|
template: i
|
|
2079
2124
|
});
|
|
2080
2125
|
}
|
|
2081
|
-
const
|
|
2126
|
+
const $t = [
|
|
2082
2127
|
"#0f172a",
|
|
2083
2128
|
"#1e3a5f",
|
|
2084
2129
|
"#7c3aed",
|
|
@@ -2089,24 +2134,24 @@ const wt = [
|
|
|
2089
2134
|
"#db2777",
|
|
2090
2135
|
"#65a30d",
|
|
2091
2136
|
"#9333ea"
|
|
2092
|
-
],
|
|
2093
|
-
function
|
|
2137
|
+
], ar = { l: 42, r: 4, t: 4, b: 30 }, bt = 10, gt = 12;
|
|
2138
|
+
function Rt(e = {}) {
|
|
2094
2139
|
return {
|
|
2095
2140
|
...e,
|
|
2096
|
-
margin:
|
|
2141
|
+
margin: ar,
|
|
2097
2142
|
autosize: !0,
|
|
2098
2143
|
width: void 0,
|
|
2099
2144
|
xaxis: {
|
|
2100
2145
|
...e.xaxis || {},
|
|
2101
2146
|
tickfont: {
|
|
2102
2147
|
...e.xaxis && e.xaxis.tickfont || {},
|
|
2103
|
-
size:
|
|
2148
|
+
size: bt
|
|
2104
2149
|
},
|
|
2105
2150
|
title: {
|
|
2106
2151
|
...e.xaxis && e.xaxis.title || {},
|
|
2107
2152
|
font: {
|
|
2108
2153
|
...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
|
|
2109
|
-
size:
|
|
2154
|
+
size: gt
|
|
2110
2155
|
}
|
|
2111
2156
|
}
|
|
2112
2157
|
},
|
|
@@ -2115,63 +2160,63 @@ function $t(e = {}) {
|
|
|
2115
2160
|
automargin: !0,
|
|
2116
2161
|
tickfont: {
|
|
2117
2162
|
...e.yaxis && e.yaxis.tickfont || {},
|
|
2118
|
-
size:
|
|
2163
|
+
size: bt
|
|
2119
2164
|
},
|
|
2120
2165
|
title: {
|
|
2121
2166
|
...e.yaxis && e.yaxis.title || {},
|
|
2122
2167
|
font: {
|
|
2123
2168
|
...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
|
|
2124
|
-
size:
|
|
2169
|
+
size: gt
|
|
2125
2170
|
}
|
|
2126
2171
|
}
|
|
2127
2172
|
}
|
|
2128
2173
|
};
|
|
2129
2174
|
}
|
|
2130
|
-
function
|
|
2175
|
+
function cr(e, {
|
|
2131
2176
|
tailScale: t = 5,
|
|
2132
2177
|
colorBy: n = null,
|
|
2133
|
-
palette: r =
|
|
2178
|
+
palette: r = $t,
|
|
2134
2179
|
depthCol: o = W,
|
|
2135
|
-
dipCol: i =
|
|
2136
|
-
azCol: s =
|
|
2180
|
+
dipCol: i = q,
|
|
2181
|
+
azCol: s = X,
|
|
2137
2182
|
template: l = void 0
|
|
2138
2183
|
} = {}) {
|
|
2139
|
-
const
|
|
2140
|
-
(
|
|
2184
|
+
const c = e.filter(
|
|
2185
|
+
(g) => g[o] != null && g[i] != null && g[s] != null
|
|
2141
2186
|
);
|
|
2142
|
-
if (!
|
|
2187
|
+
if (!c.length)
|
|
2143
2188
|
return { data: [], layout: {} };
|
|
2144
2189
|
const a = {};
|
|
2145
|
-
n && [...new Set(
|
|
2190
|
+
n && [...new Set(c.map((y) => y[n]).filter((y) => y != null))].sort().forEach((y, p) => {
|
|
2146
2191
|
a[y] = r[p % r.length];
|
|
2147
2192
|
});
|
|
2148
|
-
const
|
|
2149
|
-
for (const
|
|
2150
|
-
const y = Number(
|
|
2151
|
-
|
|
2152
|
-
const
|
|
2153
|
-
|
|
2154
|
-
const x =
|
|
2193
|
+
const u = /* @__PURE__ */ new Map(), m = [];
|
|
2194
|
+
for (const g of c) {
|
|
2195
|
+
const y = Number(g[o]), p = Number(g[i]), b = Number(g[s]), N = n ? g[n] ?? "_default" : "_default", M = n ? a[N] ?? "#0f172a" : "#0f172a";
|
|
2196
|
+
u.has(N) || u.set(N, { xs: [], ys: [], dips: [], azs: [], color: M });
|
|
2197
|
+
const I = u.get(N);
|
|
2198
|
+
I.xs.push(p), I.ys.push(y), I.dips.push(p), I.azs.push(b);
|
|
2199
|
+
const x = b * Math.PI / 180, S = t * (Math.abs(p) / 90), w = Math.sin(x) * S, D = Math.cos(x) * S;
|
|
2155
2200
|
m.push({
|
|
2156
2201
|
type: "line",
|
|
2157
2202
|
x0: p,
|
|
2158
2203
|
y0: y,
|
|
2159
|
-
x1: p +
|
|
2160
|
-
y1: y +
|
|
2161
|
-
line: { color:
|
|
2204
|
+
x1: p + w,
|
|
2205
|
+
y1: y + D,
|
|
2206
|
+
line: { color: M, width: 2 }
|
|
2162
2207
|
});
|
|
2163
2208
|
}
|
|
2164
|
-
const d = [], f = n &&
|
|
2165
|
-
for (const [
|
|
2209
|
+
const d = [], f = n && u.size > 1;
|
|
2210
|
+
for (const [g, y] of u.entries())
|
|
2166
2211
|
d.push({
|
|
2167
2212
|
type: "scatter",
|
|
2168
2213
|
x: y.xs,
|
|
2169
2214
|
y: y.ys,
|
|
2170
2215
|
mode: "markers",
|
|
2171
|
-
name:
|
|
2216
|
+
name: g !== "_default" ? String(g) : void 0,
|
|
2172
2217
|
marker: { size: 8, color: y.color },
|
|
2173
|
-
showlegend: f &&
|
|
2174
|
-
customdata: y.dips.map((p,
|
|
2218
|
+
showlegend: f && g !== "_default",
|
|
2219
|
+
customdata: y.dips.map((p, b) => [p, y.azs[b]]),
|
|
2175
2220
|
hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
|
|
2176
2221
|
});
|
|
2177
2222
|
return { data: d, layout: {
|
|
@@ -2187,14 +2232,14 @@ function ar(e, {
|
|
|
2187
2232
|
},
|
|
2188
2233
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
2189
2234
|
showlegend: !!f,
|
|
2190
|
-
template: l !== void 0 ? l :
|
|
2235
|
+
template: l !== void 0 ? l : Oe
|
|
2191
2236
|
} };
|
|
2192
2237
|
}
|
|
2193
|
-
function
|
|
2238
|
+
function zi(e, {
|
|
2194
2239
|
labelCol: t = "structure_type",
|
|
2195
|
-
palette: n =
|
|
2196
|
-
fromCol: r =
|
|
2197
|
-
toCol: o =
|
|
2240
|
+
palette: n = $t,
|
|
2241
|
+
fromCol: r = F,
|
|
2242
|
+
toCol: o = $,
|
|
2198
2243
|
template: i = void 0
|
|
2199
2244
|
} = {}) {
|
|
2200
2245
|
const s = e.filter((d) => d[r] != null && d[o] != null && Number(d[o]) > Number(d[r])).filter((d) => {
|
|
@@ -2205,7 +2250,7 @@ function ui(e, {
|
|
|
2205
2250
|
}).map((d) => ({ from: Number(d[r]), to: Number(d[o]), label: String(d[t]).trim() })).sort((d, f) => d.from - f.from);
|
|
2206
2251
|
if (!s.length)
|
|
2207
2252
|
return { data: [], layout: {} };
|
|
2208
|
-
const l = [],
|
|
2253
|
+
const l = [], c = [], a = [];
|
|
2209
2254
|
return s.forEach((d, f) => {
|
|
2210
2255
|
l.push({
|
|
2211
2256
|
type: "rect",
|
|
@@ -2218,26 +2263,26 @@ function ui(e, {
|
|
|
2218
2263
|
fillcolor: n[f % n.length],
|
|
2219
2264
|
line: { width: 0 },
|
|
2220
2265
|
layer: "below"
|
|
2221
|
-
}),
|
|
2266
|
+
}), c.push(0.5 * (d.from + d.to)), a.push(d.label);
|
|
2222
2267
|
}), { data: [{
|
|
2223
2268
|
type: "scatter",
|
|
2224
2269
|
x: Array(a.length).fill(0.5),
|
|
2225
|
-
y:
|
|
2270
|
+
y: c,
|
|
2226
2271
|
mode: "text",
|
|
2227
2272
|
text: a,
|
|
2228
2273
|
textposition: "middle center",
|
|
2229
2274
|
showlegend: !1,
|
|
2230
2275
|
hoverinfo: "text"
|
|
2231
|
-
}], layout:
|
|
2276
|
+
}], layout: Rt({
|
|
2232
2277
|
shapes: l,
|
|
2233
2278
|
height: 400,
|
|
2234
2279
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
2235
2280
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
2236
2281
|
showlegend: !1,
|
|
2237
|
-
template: i !== void 0 ? i :
|
|
2282
|
+
template: i !== void 0 ? i : Oe
|
|
2238
2283
|
}) };
|
|
2239
2284
|
}
|
|
2240
|
-
function
|
|
2285
|
+
function yt(e, t) {
|
|
2241
2286
|
if (!e) return "";
|
|
2242
2287
|
const n = String(e).trim().split(/\s+/), r = [];
|
|
2243
2288
|
let o = "";
|
|
@@ -2245,26 +2290,26 @@ function gt(e, t) {
|
|
|
2245
2290
|
o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
|
|
2246
2291
|
return o && r.push(o), r.join("<br>");
|
|
2247
2292
|
}
|
|
2248
|
-
function
|
|
2293
|
+
function ur(e, {
|
|
2249
2294
|
commentCol: t = "comments",
|
|
2250
|
-
fromCol: n =
|
|
2251
|
-
toCol: r =
|
|
2295
|
+
fromCol: n = F,
|
|
2296
|
+
toCol: r = $,
|
|
2252
2297
|
bgColor: o = "#f1f5f9",
|
|
2253
2298
|
borderColor: i = "#cbd5e1",
|
|
2254
2299
|
textColor: s = "#1e293b",
|
|
2255
2300
|
charsPerLine: l = 18,
|
|
2256
|
-
template:
|
|
2301
|
+
template: c = void 0
|
|
2257
2302
|
} = {}) {
|
|
2258
2303
|
const a = e.filter((p) => p[n] != null && p[r] != null && Number(p[r]) > Number(p[n])).map((p) => {
|
|
2259
|
-
const
|
|
2260
|
-
return { from: Number(p[n]), to: Number(p[r]), comment:
|
|
2261
|
-
}).sort((p,
|
|
2304
|
+
const b = p[t], N = b != null && String(b).trim() !== "" && String(b) !== "null" ? String(b).trim() : "";
|
|
2305
|
+
return { from: Number(p[n]), to: Number(p[r]), comment: N };
|
|
2306
|
+
}).sort((p, b) => p.from - b.from);
|
|
2262
2307
|
if (!a.length)
|
|
2263
2308
|
return { data: [], layout: {} };
|
|
2264
|
-
const
|
|
2309
|
+
const u = [], m = [], d = [], f = [], h = [];
|
|
2265
2310
|
for (const p of a) {
|
|
2266
|
-
const
|
|
2267
|
-
|
|
2311
|
+
const b = 0.5 * (p.from + p.to), N = !!p.comment;
|
|
2312
|
+
u.push({
|
|
2268
2313
|
type: "rect",
|
|
2269
2314
|
xref: "x",
|
|
2270
2315
|
yref: "y",
|
|
@@ -2272,10 +2317,10 @@ function cr(e, {
|
|
|
2272
2317
|
x1: 1,
|
|
2273
2318
|
y0: p.from,
|
|
2274
2319
|
y1: p.to,
|
|
2275
|
-
fillcolor:
|
|
2320
|
+
fillcolor: N ? o : "rgba(0,0,0,0)",
|
|
2276
2321
|
line: { color: i, width: 1 },
|
|
2277
2322
|
layer: "below"
|
|
2278
|
-
}),
|
|
2323
|
+
}), N && (m.push(0.5), d.push(b), f.push(yt(p.comment, l)), h.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${yt(p.comment, 40)}`));
|
|
2279
2324
|
}
|
|
2280
2325
|
return { data: m.length ? [{
|
|
2281
2326
|
type: "scatter",
|
|
@@ -2288,25 +2333,25 @@ function cr(e, {
|
|
|
2288
2333
|
hovertext: h,
|
|
2289
2334
|
hoverinfo: "text",
|
|
2290
2335
|
showlegend: !1
|
|
2291
|
-
}] : [], layout:
|
|
2292
|
-
shapes:
|
|
2336
|
+
}] : [], layout: Rt({
|
|
2337
|
+
shapes: u,
|
|
2293
2338
|
height: 400,
|
|
2294
2339
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
2295
2340
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
2296
2341
|
showlegend: !1,
|
|
2297
|
-
template:
|
|
2342
|
+
template: c !== void 0 ? c : Oe
|
|
2298
2343
|
}) };
|
|
2299
2344
|
}
|
|
2300
|
-
function
|
|
2345
|
+
function vi(e, {
|
|
2301
2346
|
symbolSize: t = 10,
|
|
2302
2347
|
xCol: n = "easting",
|
|
2303
2348
|
yCol: r = "northing"
|
|
2304
2349
|
} = {}) {
|
|
2305
|
-
const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[
|
|
2350
|
+
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
2351
|
if (o === null || i === null || s === null || l === null) return null;
|
|
2307
|
-
const
|
|
2352
|
+
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), g = f * Math.cos(u);
|
|
2308
2353
|
return {
|
|
2309
|
-
strike:
|
|
2354
|
+
strike: c,
|
|
2310
2355
|
dipValue: s,
|
|
2311
2356
|
x: o,
|
|
2312
2357
|
y: i,
|
|
@@ -2315,27 +2360,27 @@ function di(e, {
|
|
|
2315
2360
|
strikeX1: o + m,
|
|
2316
2361
|
strikeY1: i + d,
|
|
2317
2362
|
tickX1: o + h,
|
|
2318
|
-
tickY1: i +
|
|
2363
|
+
tickY1: i + g
|
|
2319
2364
|
};
|
|
2320
2365
|
}
|
|
2321
2366
|
const Bt = "markers+line";
|
|
2322
|
-
function
|
|
2367
|
+
function dr(e, t) {
|
|
2323
2368
|
var r;
|
|
2324
2369
|
const n = et(e);
|
|
2325
2370
|
return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Bt;
|
|
2326
2371
|
}
|
|
2327
|
-
function
|
|
2328
|
-
const s =
|
|
2372
|
+
function Ei({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o, template: i }) {
|
|
2373
|
+
const s = De(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) || Bt, 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), [g, y] = Q("");
|
|
2329
2374
|
return se(() => {
|
|
2330
|
-
const p = d ===
|
|
2331
|
-
if (!l || !a || !p && !
|
|
2332
|
-
const
|
|
2333
|
-
if (!
|
|
2334
|
-
let
|
|
2375
|
+
const p = d === ke, b = d === Je;
|
|
2376
|
+
if (!l || !a || !p && !b && c.length === 0) return;
|
|
2377
|
+
const N = s.current;
|
|
2378
|
+
if (!N) return;
|
|
2379
|
+
let M;
|
|
2335
2380
|
try {
|
|
2336
|
-
p ?
|
|
2337
|
-
points:
|
|
2338
|
-
isCategorical: d ===
|
|
2381
|
+
p ? M = ur(c, { commentCol: a, fromCol: "from", toCol: "to" }) : b ? M = cr(c) : M = Tt({
|
|
2382
|
+
points: c,
|
|
2383
|
+
isCategorical: d === Le,
|
|
2339
2384
|
property: a,
|
|
2340
2385
|
chartType: h,
|
|
2341
2386
|
template: i
|
|
@@ -2344,80 +2389,80 @@ function mi({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [],
|
|
|
2344
2389
|
console.error("Plot build error", x), y((x == null ? void 0 : x.message) || "Plot build error");
|
|
2345
2390
|
return;
|
|
2346
2391
|
}
|
|
2347
|
-
if ((!(
|
|
2392
|
+
if ((!(M != null && M.data) || M.data.length === 0) && !p)
|
|
2348
2393
|
return;
|
|
2349
|
-
const
|
|
2394
|
+
const I = {
|
|
2350
2395
|
displayModeBar: !0,
|
|
2351
2396
|
responsive: !0,
|
|
2352
2397
|
useResizeHandler: !0,
|
|
2353
2398
|
modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
|
|
2354
2399
|
};
|
|
2355
2400
|
try {
|
|
2356
|
-
y(""), Fe.react(
|
|
2357
|
-
|
|
2401
|
+
y(""), Fe.react(N, M.data, M.layout, I), requestAnimationFrame(() => {
|
|
2402
|
+
N && N.parentElement && Fe.Plots.resize(N);
|
|
2358
2403
|
});
|
|
2359
2404
|
} catch (x) {
|
|
2360
2405
|
console.error("Plot render error", x), y((x == null ? void 0 : x.message) || "Plot render error");
|
|
2361
2406
|
}
|
|
2362
2407
|
return () => {
|
|
2363
|
-
if (
|
|
2408
|
+
if (N)
|
|
2364
2409
|
try {
|
|
2365
|
-
Fe.purge(
|
|
2410
|
+
Fe.purge(N);
|
|
2366
2411
|
} catch (x) {
|
|
2367
2412
|
console.warn("Plot purge error", x);
|
|
2368
2413
|
}
|
|
2369
2414
|
};
|
|
2370
|
-
}, [l, a, h, d,
|
|
2415
|
+
}, [l, a, h, d, c, i]), se(() => {
|
|
2371
2416
|
const p = s.current;
|
|
2372
2417
|
if (!p || typeof ResizeObserver > "u") return;
|
|
2373
|
-
const
|
|
2418
|
+
const b = new ResizeObserver(() => {
|
|
2374
2419
|
try {
|
|
2375
2420
|
p && p.data && Fe.Plots.resize(p);
|
|
2376
|
-
} catch (
|
|
2377
|
-
console.warn("Plot resize error",
|
|
2421
|
+
} catch (N) {
|
|
2422
|
+
console.warn("Plot resize error", N);
|
|
2378
2423
|
}
|
|
2379
2424
|
});
|
|
2380
|
-
return
|
|
2381
|
-
}, []), !l || !a ? /* @__PURE__ */
|
|
2425
|
+
return b.observe(p), () => b.disconnect();
|
|
2426
|
+
}, []), !l || !a ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("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__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("div", { className: "placeholder", children: "No data" }) }) : g ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ J("div", { className: "placeholder", children: [
|
|
2382
2427
|
"Plot error: ",
|
|
2383
|
-
|
|
2428
|
+
g
|
|
2384
2429
|
] }) }) : /* @__PURE__ */ J("div", { className: "plot-card", children: [
|
|
2385
|
-
/* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ P("div", { className: "plot-title", children: /* @__PURE__ */ P(
|
|
2386
2431
|
"select",
|
|
2387
2432
|
{
|
|
2388
2433
|
className: "plot-select",
|
|
2389
2434
|
value: m,
|
|
2390
2435
|
onChange: (p) => o && o({ holeId: p.target.value }),
|
|
2391
2436
|
children: n.map((p) => {
|
|
2392
|
-
const
|
|
2393
|
-
return /* @__PURE__ */
|
|
2437
|
+
const b = typeof p == "string" ? p : p.holeId, N = typeof p == "string" ? p : p.label || p.holeId;
|
|
2438
|
+
return /* @__PURE__ */ P("option", { value: b, children: N }, b);
|
|
2394
2439
|
})
|
|
2395
2440
|
}
|
|
2396
2441
|
) }),
|
|
2397
2442
|
/* @__PURE__ */ J("div", { className: "plot-controls column", children: [
|
|
2398
|
-
r.length > 0 && /* @__PURE__ */
|
|
2443
|
+
r.length > 0 && /* @__PURE__ */ P(
|
|
2399
2444
|
"select",
|
|
2400
2445
|
{
|
|
2401
2446
|
className: "plot-select",
|
|
2402
2447
|
value: a,
|
|
2403
2448
|
onChange: (p) => o && o({ property: p.target.value }),
|
|
2404
|
-
children: r.map((p) => /* @__PURE__ */
|
|
2449
|
+
children: r.map((p) => /* @__PURE__ */ P("option", { value: p, children: p }, p))
|
|
2405
2450
|
}
|
|
2406
2451
|
),
|
|
2407
|
-
f.length > 1 && /* @__PURE__ */
|
|
2452
|
+
f.length > 1 && /* @__PURE__ */ P(
|
|
2408
2453
|
"select",
|
|
2409
2454
|
{
|
|
2410
2455
|
className: "plot-select",
|
|
2411
2456
|
value: h,
|
|
2412
2457
|
onChange: (p) => o && o({ chartType: p.target.value }),
|
|
2413
|
-
children: f.map((p) => /* @__PURE__ */
|
|
2458
|
+
children: f.map((p) => /* @__PURE__ */ P("option", { value: p.value, children: p.label }, p.value))
|
|
2414
2459
|
}
|
|
2415
2460
|
)
|
|
2416
2461
|
] }),
|
|
2417
|
-
/* @__PURE__ */
|
|
2462
|
+
/* @__PURE__ */ P("div", { className: "plotly-chart", ref: s })
|
|
2418
2463
|
] });
|
|
2419
2464
|
}
|
|
2420
|
-
function
|
|
2465
|
+
function _t(e, t) {
|
|
2421
2466
|
if (!(t != null && t.length)) return e;
|
|
2422
2467
|
const n = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
|
|
2423
2468
|
for (const r of t) {
|
|
@@ -2431,7 +2476,7 @@ function yt(e, t) {
|
|
|
2431
2476
|
}
|
|
2432
2477
|
return Array.from(n.values());
|
|
2433
2478
|
}
|
|
2434
|
-
function
|
|
2479
|
+
function mr(e, t) {
|
|
2435
2480
|
if (!e || !t) return [];
|
|
2436
2481
|
const n = /* @__PURE__ */ new Set(), r = [];
|
|
2437
2482
|
for (const o of e.points || []) {
|
|
@@ -2442,69 +2487,69 @@ function dr(e, t) {
|
|
|
2442
2487
|
}
|
|
2443
2488
|
return r;
|
|
2444
2489
|
}
|
|
2445
|
-
function
|
|
2490
|
+
function xi({
|
|
2446
2491
|
initialFocusedHoleId: e = "",
|
|
2447
2492
|
sourceFile: t = null,
|
|
2448
2493
|
extraHoles: n = [],
|
|
2449
2494
|
plotCount: r = 4
|
|
2450
2495
|
} = {}) {
|
|
2451
|
-
const [o, i] = Q([]), [s, l] = Q([]), [
|
|
2496
|
+
const [o, i] = Q([]), [s, l] = Q([]), [c, a] = Q([]), [u, m] = Q([]), [d, f] = Q([]), [h, g] = Q({}), [y, p] = Q(""), [b, N] = Q([]), [M, I] = Q(""), [x, S] = Q(e || ""), [w, D] = Q([]), v = De(null);
|
|
2452
2497
|
se(() => {
|
|
2453
|
-
!t ||
|
|
2454
|
-
if (!
|
|
2455
|
-
const
|
|
2456
|
-
l(
|
|
2457
|
-
holeIds:
|
|
2498
|
+
!t || v.current === t || (v.current = t, En(t).then((A) => {
|
|
2499
|
+
if (!A) return;
|
|
2500
|
+
const E = Array.from(new Map(A.map((z) => [z.holeId, z])).values());
|
|
2501
|
+
l(E), N(St({
|
|
2502
|
+
holeIds: E.map((z) => z.holeId),
|
|
2458
2503
|
focusedHoleId: x,
|
|
2459
2504
|
plotCount: r,
|
|
2460
2505
|
defaultProp: "",
|
|
2461
|
-
categoricalProps:
|
|
2506
|
+
categoricalProps: u,
|
|
2462
2507
|
commentProps: d,
|
|
2463
2508
|
numericDefaultChartType: "markers+line"
|
|
2464
2509
|
}));
|
|
2465
|
-
}).catch((
|
|
2466
|
-
console.info("Assay metadata load skipped:",
|
|
2510
|
+
}).catch((A) => {
|
|
2511
|
+
console.info("Assay metadata load skipped:", A.message);
|
|
2467
2512
|
}));
|
|
2468
|
-
}, [t, x, r,
|
|
2513
|
+
}, [t, x, r, u, d]), se(() => {
|
|
2469
2514
|
if (!(n != null && n.length)) return;
|
|
2470
|
-
const
|
|
2471
|
-
l((
|
|
2472
|
-
const
|
|
2473
|
-
return
|
|
2515
|
+
const A = n.map((E) => ({ holeId: E.id || E.holeId })).filter((E) => E.holeId);
|
|
2516
|
+
l((E) => {
|
|
2517
|
+
const z = new Set(E.map((C) => C.holeId)), R = A.filter((C) => !z.has(C.holeId));
|
|
2518
|
+
return R.length ? [...E, ...R] : E;
|
|
2474
2519
|
});
|
|
2475
2520
|
}, [n]), se(() => {
|
|
2476
|
-
|
|
2477
|
-
}, [
|
|
2521
|
+
I((A) => A && A.startsWith("Loading ") && A.includes(" for hole ") ? A : "");
|
|
2522
|
+
}, [b]), se(() => {
|
|
2478
2523
|
if (!s.length) {
|
|
2479
|
-
|
|
2524
|
+
N([]);
|
|
2480
2525
|
return;
|
|
2481
2526
|
}
|
|
2482
|
-
const
|
|
2483
|
-
|
|
2527
|
+
const A = Ct(s.map((E) => E.holeId), x);
|
|
2528
|
+
N((E) => Array.from({ length: r }).map((R, C) => {
|
|
2484
2529
|
var K;
|
|
2485
|
-
const G =
|
|
2530
|
+
const G = E[C] || {}, U = s.some((le) => le.holeId === G.holeId) ? G.holeId : A[C] || ((K = s[C]) == null ? void 0 : K.holeId) || "", j = G.property || y, Z = Te({
|
|
2486
2531
|
property: j,
|
|
2487
2532
|
chartType: G.chartType,
|
|
2488
|
-
categoricalProps:
|
|
2533
|
+
categoricalProps: u,
|
|
2489
2534
|
commentProps: d,
|
|
2490
2535
|
numericDefaultChartType: "markers+line"
|
|
2491
2536
|
});
|
|
2492
2537
|
return { holeId: U, property: j, chartType: Z };
|
|
2493
2538
|
}));
|
|
2494
|
-
}, [s, x, y,
|
|
2539
|
+
}, [s, x, y, u, d, r]), se(() => {
|
|
2495
2540
|
if (!t) return;
|
|
2496
|
-
|
|
2497
|
-
const
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
const U =
|
|
2501
|
-
[...G.filter((Z) => (Z.id || Z.holeId) !==
|
|
2541
|
+
b.map((E) => E.holeId).filter(Boolean).forEach((E) => {
|
|
2542
|
+
const z = o.some((C) => (C.id || C.holeId) === E), R = w.includes(E);
|
|
2543
|
+
z || R || (D((C) => [...C, E]), xn(t, E).then((C) => {
|
|
2544
|
+
D((G) => G.filter((U) => U !== E)), C && i((G) => {
|
|
2545
|
+
const U = _t(
|
|
2546
|
+
[...G.filter((Z) => (Z.id || Z.holeId) !== E), C],
|
|
2502
2547
|
n
|
|
2503
|
-
), j =
|
|
2504
|
-
return a(j.numericProps), m(j.categoricalProps), f(j.commentProps),
|
|
2548
|
+
), j = Re(U);
|
|
2549
|
+
return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), g(j.columnMeta), !y && j.defaultProp && (p(j.defaultProp), N((Z) => Z.map((K) => ({
|
|
2505
2550
|
...K,
|
|
2506
2551
|
property: K.property || j.defaultProp,
|
|
2507
|
-
chartType:
|
|
2552
|
+
chartType: Te({
|
|
2508
2553
|
property: K.property || j.defaultProp,
|
|
2509
2554
|
chartType: K.chartType,
|
|
2510
2555
|
categoricalProps: j.categoricalProps,
|
|
@@ -2513,75 +2558,75 @@ function fi({
|
|
|
2513
2558
|
})
|
|
2514
2559
|
})))), U;
|
|
2515
2560
|
});
|
|
2516
|
-
}).catch((
|
|
2517
|
-
console.error(
|
|
2561
|
+
}).catch((C) => {
|
|
2562
|
+
console.error(C), D((G) => G.filter((U) => U !== E)), I(C.message || `Error loading hole ${E}`);
|
|
2518
2563
|
}));
|
|
2519
2564
|
});
|
|
2520
|
-
}, [
|
|
2521
|
-
n != null && n.length && i((
|
|
2522
|
-
if (!
|
|
2523
|
-
const
|
|
2524
|
-
return a(
|
|
2565
|
+
}, [b, t, o, w, y, n]), se(() => {
|
|
2566
|
+
n != null && n.length && i((A) => {
|
|
2567
|
+
if (!A.length) {
|
|
2568
|
+
const R = Re(n);
|
|
2569
|
+
return a(R.numericProps), m(R.categoricalProps), f(R.commentProps), g(R.columnMeta), !y && R.defaultProp && p(R.defaultProp), n;
|
|
2525
2570
|
}
|
|
2526
|
-
const
|
|
2527
|
-
return a(
|
|
2571
|
+
const E = _t(A, n), z = Re(E);
|
|
2572
|
+
return a(z.numericProps), m(z.categoricalProps), f(z.commentProps), g(z.columnMeta), !y && z.defaultProp && p(z.defaultProp), E;
|
|
2528
2573
|
});
|
|
2529
2574
|
}, [n]);
|
|
2530
|
-
const
|
|
2531
|
-
() => [...
|
|
2532
|
-
[
|
|
2533
|
-
),
|
|
2534
|
-
() => s.map((
|
|
2575
|
+
const L = ne(
|
|
2576
|
+
() => [...c, ...u, ...d],
|
|
2577
|
+
[c, u, d]
|
|
2578
|
+
), O = ne(
|
|
2579
|
+
() => s.map((A) => ({ holeId: A.holeId, label: A.holeId })).sort((A, E) => A.label.localeCompare(E.label)),
|
|
2535
2580
|
[s]
|
|
2536
|
-
),
|
|
2537
|
-
const
|
|
2538
|
-
return Array.from({ length: r }).map((
|
|
2539
|
-
const
|
|
2540
|
-
let U =
|
|
2541
|
-
|
|
2542
|
-
const j = d.includes(U), Z = !j &&
|
|
2581
|
+
), V = ne(() => {
|
|
2582
|
+
const A = [...c, ...u, ...d];
|
|
2583
|
+
return Array.from({ length: r }).map((E, z) => {
|
|
2584
|
+
const R = b[z] || {}, C = o.find((he) => (he.id || he.holeId) === R.holeId) || null, G = C ? A.filter((he) => or(C, he)) : A;
|
|
2585
|
+
let U = R.property || y;
|
|
2586
|
+
C && !G.includes(U) && (U = G[0] || U);
|
|
2587
|
+
const j = d.includes(U), Z = !j && u.includes(U), K = !j && !Z && U === "dip", le = j ? "comment" : K ? "tadpole" : Z ? "categorical" : "numeric", ye = K ? "tadpole" : R.chartType || (j ? "comment" : Z ? "categorical" : "markers+line"), fe = R.holeId || (C == null ? void 0 : C.id) || (C == null ? void 0 : C.holeId) || "", Ce = K ? (C == null ? void 0 : C.points) || [] : j ? mr(C, U) : ir(C, U, Z);
|
|
2543
2588
|
return {
|
|
2544
2589
|
config: { holeId: fe, property: U, chartType: ye },
|
|
2545
|
-
hole:
|
|
2546
|
-
loading:
|
|
2590
|
+
hole: C,
|
|
2591
|
+
loading: w.includes(R.holeId),
|
|
2547
2592
|
isCategorical: Z,
|
|
2548
2593
|
isComment: j,
|
|
2549
2594
|
isTadpole: K,
|
|
2550
2595
|
displayType: le,
|
|
2551
|
-
points:
|
|
2596
|
+
points: Ce,
|
|
2552
2597
|
propertyOptions: G,
|
|
2553
2598
|
label: fe
|
|
2554
2599
|
};
|
|
2555
2600
|
});
|
|
2556
|
-
}, [
|
|
2557
|
-
|
|
2558
|
-
const
|
|
2559
|
-
return
|
|
2560
|
-
property:
|
|
2601
|
+
}, [b, o, y, u, d, w, r, c]), H = (A, E) => {
|
|
2602
|
+
N((z) => {
|
|
2603
|
+
const R = [...z], G = { ...R[A] || {}, ...E };
|
|
2604
|
+
return E.property && (G.chartType = Te({
|
|
2605
|
+
property: E.property,
|
|
2561
2606
|
chartType: G.chartType,
|
|
2562
|
-
categoricalProps:
|
|
2607
|
+
categoricalProps: u,
|
|
2563
2608
|
commentProps: d,
|
|
2564
2609
|
numericDefaultChartType: "markers+line"
|
|
2565
|
-
})),
|
|
2610
|
+
})), R[A] = G, R;
|
|
2566
2611
|
});
|
|
2567
2612
|
};
|
|
2568
2613
|
return {
|
|
2569
|
-
error:
|
|
2614
|
+
error: M,
|
|
2570
2615
|
focusedHoleId: x,
|
|
2571
|
-
setFocusedHoleId:
|
|
2572
|
-
setError:
|
|
2616
|
+
setFocusedHoleId: S,
|
|
2617
|
+
setError: I,
|
|
2573
2618
|
holeCount: s.length,
|
|
2574
|
-
numericProps:
|
|
2575
|
-
categoricalProps:
|
|
2619
|
+
numericProps: c,
|
|
2620
|
+
categoricalProps: u,
|
|
2576
2621
|
commentProps: d,
|
|
2577
2622
|
columnMeta: h,
|
|
2578
|
-
propertyOptions:
|
|
2579
|
-
labeledHoleOptions:
|
|
2580
|
-
traceGraphs:
|
|
2581
|
-
handleConfigChange:
|
|
2623
|
+
propertyOptions: L,
|
|
2624
|
+
labeledHoleOptions: O,
|
|
2625
|
+
traceGraphs: V,
|
|
2626
|
+
handleConfigChange: H
|
|
2582
2627
|
};
|
|
2583
2628
|
}
|
|
2584
|
-
const
|
|
2629
|
+
const fr = [
|
|
2585
2630
|
"#313695",
|
|
2586
2631
|
"#4575b4",
|
|
2587
2632
|
"#74add1",
|
|
@@ -2593,7 +2638,7 @@ const mr = [
|
|
|
2593
2638
|
"#d73027",
|
|
2594
2639
|
"#a50026"
|
|
2595
2640
|
];
|
|
2596
|
-
function
|
|
2641
|
+
function hr(e = [], t = fr) {
|
|
2597
2642
|
const n = e.filter((a) => Number.isFinite(a));
|
|
2598
2643
|
if (!n.length)
|
|
2599
2644
|
return {
|
|
@@ -2603,9 +2648,9 @@ function fr(e = [], t = mr) {
|
|
|
2603
2648
|
bins: [],
|
|
2604
2649
|
colors: t
|
|
2605
2650
|
};
|
|
2606
|
-
const r = n.slice().sort((a,
|
|
2651
|
+
const r = n.slice().sort((a, u) => a - u), o = r[0], i = r[r.length - 1], s = t.length;
|
|
2607
2652
|
if (i === o) {
|
|
2608
|
-
const a = t.map((
|
|
2653
|
+
const a = t.map((u, m) => ({
|
|
2609
2654
|
index: m,
|
|
2610
2655
|
min: o,
|
|
2611
2656
|
max: i,
|
|
@@ -2619,24 +2664,24 @@ function fr(e = [], t = mr) {
|
|
|
2619
2664
|
colors: t
|
|
2620
2665
|
};
|
|
2621
2666
|
}
|
|
2622
|
-
const l = t.map((a,
|
|
2623
|
-
const m =
|
|
2667
|
+
const l = t.map((a, u) => {
|
|
2668
|
+
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)), g = r[f], y = u === s - 1 ? i : r[h];
|
|
2624
2669
|
return {
|
|
2625
|
-
index:
|
|
2626
|
-
min:
|
|
2670
|
+
index: u,
|
|
2671
|
+
min: g,
|
|
2627
2672
|
max: y,
|
|
2628
|
-
label:
|
|
2673
|
+
label: pr(g, y)
|
|
2629
2674
|
};
|
|
2630
|
-
}),
|
|
2675
|
+
}), c = (i - o) / s;
|
|
2631
2676
|
return {
|
|
2632
2677
|
min: o,
|
|
2633
2678
|
max: i,
|
|
2634
|
-
step:
|
|
2679
|
+
step: c,
|
|
2635
2680
|
bins: l,
|
|
2636
2681
|
colors: t
|
|
2637
2682
|
};
|
|
2638
2683
|
}
|
|
2639
|
-
function
|
|
2684
|
+
function pr(e, t) {
|
|
2640
2685
|
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
2686
|
return `${n(e)} – ${n(t)}`;
|
|
2642
2687
|
}
|
|
@@ -2652,43 +2697,43 @@ function Vt(e, t) {
|
|
|
2652
2697
|
}
|
|
2653
2698
|
return -1;
|
|
2654
2699
|
}
|
|
2655
|
-
function
|
|
2700
|
+
function br(e, t, n = "#8b1e3f") {
|
|
2656
2701
|
const r = Vt(e, t);
|
|
2657
2702
|
return r < 0 ? n : t.colors[r] || n;
|
|
2658
2703
|
}
|
|
2659
2704
|
function Ht(e) {
|
|
2660
2705
|
return Array.isArray(e) ? e : [];
|
|
2661
2706
|
}
|
|
2662
|
-
function
|
|
2707
|
+
function qe(e) {
|
|
2663
2708
|
const t = Number(e);
|
|
2664
2709
|
return Number.isFinite(t) ? t : void 0;
|
|
2665
2710
|
}
|
|
2666
|
-
function
|
|
2711
|
+
function jt(e = {}) {
|
|
2667
2712
|
return {
|
|
2668
2713
|
...e,
|
|
2669
|
-
x:
|
|
2670
|
-
y:
|
|
2671
|
-
z:
|
|
2714
|
+
x: qe(e.x),
|
|
2715
|
+
y: qe(e.y),
|
|
2716
|
+
z: qe(e.z)
|
|
2672
2717
|
};
|
|
2673
2718
|
}
|
|
2674
|
-
function
|
|
2719
|
+
function gr(e = [], t = [0, 0], n = 0) {
|
|
2675
2720
|
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 =
|
|
2721
|
+
return Ht(e).map(jt).map((c) => {
|
|
2722
|
+
if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return { ...c };
|
|
2723
|
+
const a = c.x - r, u = c.y - o;
|
|
2679
2724
|
return {
|
|
2680
|
-
...
|
|
2681
|
-
along: a * l +
|
|
2682
|
-
across: a * s -
|
|
2725
|
+
...c,
|
|
2726
|
+
along: a * l + u * s,
|
|
2727
|
+
across: a * s - u * l
|
|
2683
2728
|
};
|
|
2684
2729
|
});
|
|
2685
2730
|
}
|
|
2686
|
-
function
|
|
2687
|
-
const o =
|
|
2731
|
+
function yr(e = [], t = [0, 0], n = 0, r = 50) {
|
|
2732
|
+
const o = gr(e, t, n), i = 0.5 * Number(r || 0);
|
|
2688
2733
|
return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
|
|
2689
2734
|
}
|
|
2690
|
-
function
|
|
2691
|
-
let r = Ht(e).map(
|
|
2735
|
+
function ki(e = [], t = null, n = null) {
|
|
2736
|
+
let r = Ht(e).map(jt);
|
|
2692
2737
|
if (Array.isArray(t) && t.length === 2) {
|
|
2693
2738
|
const [o, i] = t;
|
|
2694
2739
|
r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
|
|
@@ -2698,8 +2743,8 @@ function hi(e = [], t = null, n = null) {
|
|
|
2698
2743
|
color_value: o == null ? void 0 : o[n]
|
|
2699
2744
|
}))), r;
|
|
2700
2745
|
}
|
|
2701
|
-
function
|
|
2702
|
-
let i =
|
|
2746
|
+
function Ai(e = [], t = [0, 0], n = 0, r = 50, o = null) {
|
|
2747
|
+
let i = yr(e, t, n, r);
|
|
2703
2748
|
return o && (i = i.map((s) => ({
|
|
2704
2749
|
...s,
|
|
2705
2750
|
color_value: s == null ? void 0 : s[o]
|
|
@@ -2715,7 +2760,7 @@ function Ne(e, t = void 0) {
|
|
|
2715
2760
|
const n = Number(e);
|
|
2716
2761
|
return Number.isFinite(n) ? n : t;
|
|
2717
2762
|
}
|
|
2718
|
-
function
|
|
2763
|
+
function Ii(e = [], t = null) {
|
|
2719
2764
|
const n = /* @__PURE__ */ new Map();
|
|
2720
2765
|
rt(e).forEach((o) => {
|
|
2721
2766
|
const i = ot(o);
|
|
@@ -2725,17 +2770,17 @@ function bi(e = [], t = null) {
|
|
|
2725
2770
|
});
|
|
2726
2771
|
const r = [];
|
|
2727
2772
|
return n.forEach((o, i) => {
|
|
2728
|
-
const s = [...o].sort((
|
|
2773
|
+
const s = [...o].sort((c, a) => Ne(c.md, 0) - Ne(a.md, 0)), l = {
|
|
2729
2774
|
hole_id: i,
|
|
2730
|
-
x: s.map((
|
|
2731
|
-
y: s.map((
|
|
2732
|
-
z: s.map((
|
|
2775
|
+
x: s.map((c) => Ne(c.x, 0)),
|
|
2776
|
+
y: s.map((c) => Ne(c.y, 0)),
|
|
2777
|
+
z: s.map((c) => Ne(c.z, 0)),
|
|
2733
2778
|
color: null
|
|
2734
2779
|
};
|
|
2735
|
-
t && (l.color = s.map((
|
|
2780
|
+
t && (l.color = s.map((c) => c == null ? void 0 : c[t])), r.push(l);
|
|
2736
2781
|
}), r;
|
|
2737
2782
|
}
|
|
2738
|
-
function
|
|
2783
|
+
function Oi(e = [], t = 1, n = null) {
|
|
2739
2784
|
return rt(e).map((r) => ({
|
|
2740
2785
|
hole_id: ot(r),
|
|
2741
2786
|
from: r == null ? void 0 : r.from,
|
|
@@ -2745,7 +2790,7 @@ function gi(e = [], t = 1, n = null) {
|
|
|
2745
2790
|
value: n ? r == null ? void 0 : r[n] : null
|
|
2746
2791
|
}));
|
|
2747
2792
|
}
|
|
2748
|
-
function
|
|
2793
|
+
function Ci(e = [], t = null) {
|
|
2749
2794
|
return t ? rt(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
|
|
2750
2795
|
hole_id: ot(n),
|
|
2751
2796
|
label: n == null ? void 0 : n[t],
|
|
@@ -2759,7 +2804,7 @@ function Me(e) {
|
|
|
2759
2804
|
...e.structuralMeshes
|
|
2760
2805
|
];
|
|
2761
2806
|
}
|
|
2762
|
-
const
|
|
2807
|
+
const _r = {
|
|
2763
2808
|
bedding: "#2563eb",
|
|
2764
2809
|
foliation: "#16a34a",
|
|
2765
2810
|
joint: "#9333ea",
|
|
@@ -2768,11 +2813,11 @@ const yr = {
|
|
|
2768
2813
|
"shear zone": "#0ea5e9",
|
|
2769
2814
|
"fault zone": "#ef4444"
|
|
2770
2815
|
};
|
|
2771
|
-
function
|
|
2772
|
-
const n = t ||
|
|
2816
|
+
function Nr(e, t) {
|
|
2817
|
+
const n = t || _r, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
|
|
2773
2818
|
return new _.Color(o).getHex();
|
|
2774
2819
|
}
|
|
2775
|
-
function
|
|
2820
|
+
function Mr(e, t) {
|
|
2776
2821
|
const n = e * Math.PI / 180, r = t * Math.PI / 180;
|
|
2777
2822
|
return new _.Vector3(
|
|
2778
2823
|
Math.sin(r) * Math.sin(n),
|
|
@@ -2783,32 +2828,32 @@ function Nr(e, t) {
|
|
|
2783
2828
|
// Up component
|
|
2784
2829
|
).normalize();
|
|
2785
2830
|
}
|
|
2786
|
-
function
|
|
2831
|
+
function zr(e, t = {}) {
|
|
2787
2832
|
const {
|
|
2788
2833
|
radius: n = 5,
|
|
2789
2834
|
discThickness: r = 0.2,
|
|
2790
2835
|
opacity: o = 0.7,
|
|
2791
2836
|
segments: i = 32,
|
|
2792
2837
|
colorMap: s = null
|
|
2793
|
-
} = t, l = new _.Group(),
|
|
2838
|
+
} = t, l = new _.Group(), c = new _.Vector3(0, 1, 0);
|
|
2794
2839
|
for (const a of e) {
|
|
2795
|
-
const
|
|
2796
|
-
if (
|
|
2797
|
-
const f = a[
|
|
2798
|
-
let
|
|
2840
|
+
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;
|
|
2841
|
+
if (u == null || m == null || d == null || !Number.isFinite(u) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
|
|
2842
|
+
const f = a[q] != null ? Number(a[q]) : null, h = a[X] != null ? Number(a[X]) : null;
|
|
2843
|
+
let g;
|
|
2799
2844
|
if (a.nx != null && Number.isFinite(a.nx) && a.ny != null && Number.isFinite(a.ny) && a.nz != null && Number.isFinite(a.nz))
|
|
2800
|
-
|
|
2845
|
+
g = new _.Vector3(a.nx, a.ny, a.nz).normalize();
|
|
2801
2846
|
else {
|
|
2802
2847
|
if (f == null || h == null || !Number.isFinite(f) || !Number.isFinite(h)) continue;
|
|
2803
|
-
|
|
2848
|
+
g = Mr(f, h);
|
|
2804
2849
|
}
|
|
2805
2850
|
const y = new _.CylinderGeometry(n, n, r, i, 1, !1), p = new _.MeshStandardMaterial({
|
|
2806
|
-
color:
|
|
2851
|
+
color: Nr(a.structure_type, s),
|
|
2807
2852
|
transparent: !0,
|
|
2808
2853
|
opacity: o,
|
|
2809
2854
|
side: _.DoubleSide
|
|
2810
|
-
}),
|
|
2811
|
-
|
|
2855
|
+
}), b = new _.Mesh(y, p);
|
|
2856
|
+
b.position.set(u, m, d), b.quaternion.setFromUnitVectors(c, g), b.userData = {
|
|
2812
2857
|
type: "structure",
|
|
2813
2858
|
hole_id: a.hole_id,
|
|
2814
2859
|
depth: a.depth ?? a.mid,
|
|
@@ -2816,26 +2861,26 @@ function Mr(e, t = {}) {
|
|
|
2816
2861
|
dip: f,
|
|
2817
2862
|
azimuth: h,
|
|
2818
2863
|
comments: a.comments
|
|
2819
|
-
}, l.add(
|
|
2864
|
+
}, l.add(b);
|
|
2820
2865
|
}
|
|
2821
2866
|
return l;
|
|
2822
2867
|
}
|
|
2823
|
-
function
|
|
2824
|
-
if (!e.scene || (
|
|
2868
|
+
function vr(e, t, n, r = {}) {
|
|
2869
|
+
if (!e.scene || (Gt(e), !(t != null && t.length) || !(n != null && n.length))) return;
|
|
2825
2870
|
const { maxDiscs: o = 3e3 } = r;
|
|
2826
2871
|
let i = t;
|
|
2827
2872
|
if (i.length > o) {
|
|
2828
|
-
const
|
|
2829
|
-
for (let
|
|
2830
|
-
a.push(i[Math.floor(
|
|
2873
|
+
const c = i.length / o, a = [];
|
|
2874
|
+
for (let u = 0; u < o; u++)
|
|
2875
|
+
a.push(i[Math.floor(u * c)]);
|
|
2831
2876
|
i = a;
|
|
2832
2877
|
}
|
|
2833
|
-
const s = n.flatMap((
|
|
2834
|
-
l.length && (e.structuralGroup =
|
|
2835
|
-
|
|
2878
|
+
const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = Yn(i, s, r);
|
|
2879
|
+
l.length && (e.structuralGroup = zr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
|
|
2880
|
+
c.isMesh && e.structuralMeshes.push(c);
|
|
2836
2881
|
}), Me(e));
|
|
2837
2882
|
}
|
|
2838
|
-
function
|
|
2883
|
+
function Gt(e) {
|
|
2839
2884
|
e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
|
|
2840
2885
|
t.isMesh && (t.geometry.dispose(), t.material.dispose());
|
|
2841
2886
|
}), e.structuralGroup = null), e.structuralMeshes = [], Me(e);
|
|
@@ -2843,8 +2888,103 @@ function jt(e) {
|
|
|
2843
2888
|
function Er(e, t) {
|
|
2844
2889
|
e.structuralGroup && (e.structuralGroup.visible = !!t);
|
|
2845
2890
|
}
|
|
2846
|
-
|
|
2847
|
-
|
|
2891
|
+
let xr = 0;
|
|
2892
|
+
function kr(e) {
|
|
2893
|
+
let t, n, r, o;
|
|
2894
|
+
if ("width" in e || "height" in e || "x" in e && !("maxX" in e)) {
|
|
2895
|
+
const i = Number(e.x ?? 0), s = Number(e.y ?? 0), l = Number(e.width ?? 0), c = Number(e.height ?? 0);
|
|
2896
|
+
t = i, n = s, r = i + l, o = s + c;
|
|
2897
|
+
} else
|
|
2898
|
+
t = Number(e.minX), n = Number(e.minY), r = Number(e.maxX), o = Number(e.maxY);
|
|
2899
|
+
if (r - t <= 0)
|
|
2900
|
+
throw new Error(
|
|
2901
|
+
`Invalid raster bounds: width must be positive (got minX=${t}, maxX=${r})`
|
|
2902
|
+
);
|
|
2903
|
+
if (o - n <= 0)
|
|
2904
|
+
throw new Error(
|
|
2905
|
+
`Invalid raster bounds: height must be positive (got minY=${n}, maxY=${o})`
|
|
2906
|
+
);
|
|
2907
|
+
return { minX: t, minY: n, maxX: r, maxY: o };
|
|
2908
|
+
}
|
|
2909
|
+
function Ar(e) {
|
|
2910
|
+
if (e.type === "texture")
|
|
2911
|
+
return Promise.resolve(e.texture);
|
|
2912
|
+
let t, n = !1;
|
|
2913
|
+
if (e.type === "url")
|
|
2914
|
+
t = e.url;
|
|
2915
|
+
else if (e.type === "file")
|
|
2916
|
+
t = URL.createObjectURL(e.file), n = !0;
|
|
2917
|
+
else
|
|
2918
|
+
return Promise.reject(
|
|
2919
|
+
new Error(`Unsupported raster source type: "${e.type}"`)
|
|
2920
|
+
);
|
|
2921
|
+
return new Promise((r, o) => {
|
|
2922
|
+
new _.TextureLoader().load(
|
|
2923
|
+
t,
|
|
2924
|
+
(s) => {
|
|
2925
|
+
n && URL.revokeObjectURL(t), r(s);
|
|
2926
|
+
},
|
|
2927
|
+
void 0,
|
|
2928
|
+
(s) => {
|
|
2929
|
+
n && URL.revokeObjectURL(t), o(
|
|
2930
|
+
new Error(
|
|
2931
|
+
`Failed to load raster texture from "${t}": ${(s == null ? void 0 : s.message) ?? s}`
|
|
2932
|
+
)
|
|
2933
|
+
);
|
|
2934
|
+
}
|
|
2935
|
+
);
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
async function Si(e) {
|
|
2939
|
+
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;
|
|
2940
|
+
let c = e.opacity ?? 1;
|
|
2941
|
+
if ((c < 0 || c > 1) && (console.warn(
|
|
2942
|
+
`[baselode] raster overlay "${s}": opacity ${c} is outside [0, 1] — clamped`
|
|
2943
|
+
), c = Math.max(0, Math.min(1, c))), !t) throw new Error("raster overlay: options.source is required");
|
|
2944
|
+
if (!n) throw new Error("raster overlay: options.bounds is required");
|
|
2945
|
+
const a = kr(n), { minX: u, minY: m, maxX: d, maxY: f } = a, h = d - u, g = f - m, y = (u + d) / 2, p = (m + f) / 2, b = await Ar(t), N = new _.PlaneGeometry(h, g), M = new _.MeshBasicMaterial({
|
|
2946
|
+
map: b,
|
|
2947
|
+
transparent: !0,
|
|
2948
|
+
opacity: c,
|
|
2949
|
+
side: _.DoubleSide,
|
|
2950
|
+
depthWrite: !1
|
|
2951
|
+
}), I = new _.Mesh(N, M);
|
|
2952
|
+
return I.position.set(y, p, r), I.renderOrder = i, I.visible = o, { id: s, name: l, mesh: I, texture: b, bounds: a, elevation: r, opacity: c, visible: o };
|
|
2953
|
+
}
|
|
2954
|
+
function Ir(e, t) {
|
|
2955
|
+
e.scene && (e.rasterOverlays.has(t.id) && it(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
|
|
2956
|
+
}
|
|
2957
|
+
function it(e, t) {
|
|
2958
|
+
var r;
|
|
2959
|
+
const n = e.rasterOverlays.get(t);
|
|
2960
|
+
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));
|
|
2961
|
+
}
|
|
2962
|
+
function Or(e, t, n) {
|
|
2963
|
+
const r = e.rasterOverlays.get(t);
|
|
2964
|
+
if (!r) return;
|
|
2965
|
+
const o = Math.max(0, Math.min(1, Number(n)));
|
|
2966
|
+
r.opacity = o, r.mesh.material.opacity = o, r.mesh.material.needsUpdate = !0;
|
|
2967
|
+
}
|
|
2968
|
+
function Cr(e, t, n) {
|
|
2969
|
+
const r = e.rasterOverlays.get(t);
|
|
2970
|
+
r && (r.visible = !!n, r.mesh.visible = r.visible);
|
|
2971
|
+
}
|
|
2972
|
+
function Sr(e, t, n) {
|
|
2973
|
+
const r = e.rasterOverlays.get(t);
|
|
2974
|
+
r && (r.elevation = Number(n), r.mesh.position.setZ(r.elevation));
|
|
2975
|
+
}
|
|
2976
|
+
function Dr(e, t) {
|
|
2977
|
+
return e.rasterOverlays.get(t);
|
|
2978
|
+
}
|
|
2979
|
+
function Lr(e) {
|
|
2980
|
+
return Array.from(e.rasterOverlays.values());
|
|
2981
|
+
}
|
|
2982
|
+
function Pr(e) {
|
|
2983
|
+
for (const t of [...e.rasterOverlays.keys()])
|
|
2984
|
+
it(e, t);
|
|
2985
|
+
}
|
|
2986
|
+
function st(e) {
|
|
2987
|
+
var n, r, o, i, s, l, c, a, u;
|
|
2848
2988
|
if (!e) return "";
|
|
2849
2989
|
const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
|
|
2850
2990
|
return [
|
|
@@ -2854,12 +2994,12 @@ function it(e) {
|
|
|
2854
2994
|
t((i = e.target) == null ? void 0 : i.x),
|
|
2855
2995
|
t((s = e.target) == null ? void 0 : s.y),
|
|
2856
2996
|
t((l = e.target) == null ? void 0 : l.z),
|
|
2857
|
-
t((
|
|
2997
|
+
t((c = e.up) == null ? void 0 : c.x),
|
|
2858
2998
|
t((a = e.up) == null ? void 0 : a.y),
|
|
2859
|
-
t((
|
|
2999
|
+
t((u = e.up) == null ? void 0 : u.z)
|
|
2860
3000
|
].join("|");
|
|
2861
3001
|
}
|
|
2862
|
-
function
|
|
3002
|
+
function Ut(e) {
|
|
2863
3003
|
return !e.camera || !e.controls ? null : {
|
|
2864
3004
|
camera: {
|
|
2865
3005
|
x: e.camera.position.x,
|
|
@@ -2878,37 +3018,37 @@ function Gt(e) {
|
|
|
2878
3018
|
}
|
|
2879
3019
|
};
|
|
2880
3020
|
}
|
|
2881
|
-
function
|
|
3021
|
+
function Fr(e, t) {
|
|
2882
3022
|
if (!e.camera || !e.controls || !t) return !1;
|
|
2883
3023
|
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 =
|
|
3024
|
+
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
3025
|
}
|
|
2886
|
-
function
|
|
3026
|
+
function wr(e) {
|
|
2887
3027
|
if (!e.viewChangeHandler) return;
|
|
2888
3028
|
const t = Date.now();
|
|
2889
3029
|
if (t - e._lastViewEmitMs < 250) return;
|
|
2890
|
-
const n =
|
|
3030
|
+
const n = Ut(e);
|
|
2891
3031
|
if (!n) return;
|
|
2892
|
-
const r =
|
|
3032
|
+
const r = st(n);
|
|
2893
3033
|
r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
|
|
2894
3034
|
}
|
|
2895
|
-
function
|
|
2896
|
-
const l = (t + n) / 2,
|
|
2897
|
-
e.controls.target.set(l,
|
|
3035
|
+
function lt(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
3036
|
+
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;
|
|
3037
|
+
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
3038
|
}
|
|
2899
|
-
function
|
|
3039
|
+
function Tr(e, t = 1e3) {
|
|
2900
3040
|
!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
3041
|
}
|
|
2902
|
-
function
|
|
3042
|
+
function $r(e, t = 2e3) {
|
|
2903
3043
|
!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
3044
|
}
|
|
2905
|
-
function
|
|
3045
|
+
function Rr(e, t = 0, n = 0) {
|
|
2906
3046
|
e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
|
|
2907
3047
|
}
|
|
2908
|
-
function
|
|
3048
|
+
function Br(e, t = 1.1) {
|
|
2909
3049
|
!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
3050
|
}
|
|
2911
|
-
function
|
|
3051
|
+
function Vr(e, t = 1.2) {
|
|
2912
3052
|
if (!e.lastBounds) return;
|
|
2913
3053
|
const {
|
|
2914
3054
|
minX: n,
|
|
@@ -2917,16 +3057,16 @@ function Dr(e, t = 1.2) {
|
|
|
2917
3057
|
maxY: i,
|
|
2918
3058
|
minZ: s,
|
|
2919
3059
|
maxZ: l
|
|
2920
|
-
} = e.lastBounds,
|
|
2921
|
-
e.controls.target.set(m, d, f), e.camera.position.set(m +
|
|
3060
|
+
} = 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, g = Math.max(c, a, u, 1) * 2;
|
|
3061
|
+
e.controls.target.set(m, d, f), e.camera.position.set(m + g, d + g, f + g), e.camera.lookAt(m, d, f), e.controls.update();
|
|
2922
3062
|
}
|
|
2923
|
-
const
|
|
2924
|
-
function
|
|
3063
|
+
const Hr = 1, jr = 120;
|
|
3064
|
+
function Gr(e, t) {
|
|
2925
3065
|
if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
|
|
2926
|
-
const n = Math.min(
|
|
2927
|
-
return e.camera.position.copy(r).addScaledVector(a,
|
|
3066
|
+
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();
|
|
3067
|
+
return e.camera.position.copy(r).addScaledVector(a, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
|
|
2928
3068
|
}
|
|
2929
|
-
function
|
|
3069
|
+
function Ur(e, t = "orbit") {
|
|
2930
3070
|
if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
|
|
2931
3071
|
e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
|
|
2932
3072
|
else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
|
|
@@ -2936,36 +3076,36 @@ function Pr(e, t = "orbit") {
|
|
|
2936
3076
|
}
|
|
2937
3077
|
}
|
|
2938
3078
|
const ue = "#9ca3af";
|
|
2939
|
-
function
|
|
3079
|
+
function Nt(e, t) {
|
|
2940
3080
|
const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
|
|
2941
3081
|
if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
|
|
2942
3082
|
const o = Math.min(n, r), i = Math.max(n, r);
|
|
2943
3083
|
return i <= o ? null : { segStart: o, segEnd: i };
|
|
2944
3084
|
}
|
|
2945
|
-
function
|
|
3085
|
+
function Yr(e, t, n) {
|
|
2946
3086
|
let r = 0, o = 0;
|
|
2947
3087
|
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 +=
|
|
3088
|
+
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);
|
|
3089
|
+
if (!Number.isFinite(c) || !Number.isFinite(a) || !Number.isFinite(u) || a <= c) continue;
|
|
3090
|
+
const m = Math.max(t, c), f = Math.min(n, a) - m;
|
|
3091
|
+
f <= 0 || (r += u * f, o += f);
|
|
2952
3092
|
}
|
|
2953
3093
|
if (o <= 0) return null;
|
|
2954
3094
|
const i = r / o;
|
|
2955
3095
|
return Number.isFinite(i) ? i : null;
|
|
2956
3096
|
}
|
|
2957
|
-
function
|
|
3097
|
+
function Xr(e, t) {
|
|
2958
3098
|
if (!Number.isFinite(e)) return new _.Color(ue);
|
|
2959
3099
|
if (Vt(e, t) < 0) return new _.Color(ue);
|
|
2960
|
-
const r =
|
|
3100
|
+
const r = br(e, t, ue);
|
|
2961
3101
|
return new _.Color(r);
|
|
2962
3102
|
}
|
|
2963
|
-
function
|
|
3103
|
+
function qr(e) {
|
|
2964
3104
|
if (!e || !String(e).trim()) return ue;
|
|
2965
|
-
const t =
|
|
3105
|
+
const t = Yt(String(e).toLowerCase().trim());
|
|
2966
3106
|
return "#" + new _.Color().setHSL(t, 0.7, 0.5).getHexString();
|
|
2967
3107
|
}
|
|
2968
|
-
function
|
|
3108
|
+
function Zr(e = {}) {
|
|
2969
3109
|
return {
|
|
2970
3110
|
preserveView: !!e.preserveView,
|
|
2971
3111
|
assayIntervalsByHole: e.assayIntervalsByHole || null,
|
|
@@ -2973,7 +3113,7 @@ function $r(e = {}) {
|
|
|
2973
3113
|
isCategoricalVariable: !!e.isCategoricalVariable
|
|
2974
3114
|
};
|
|
2975
3115
|
}
|
|
2976
|
-
function
|
|
3116
|
+
function Wr(e, t) {
|
|
2977
3117
|
if (!e || !t) return [];
|
|
2978
3118
|
const n = [];
|
|
2979
3119
|
return Object.values(e).forEach((r) => {
|
|
@@ -2989,140 +3129,140 @@ function Ze(e) {
|
|
|
2989
3129
|
project: e.project
|
|
2990
3130
|
};
|
|
2991
3131
|
}
|
|
2992
|
-
function
|
|
3132
|
+
function Kr(e) {
|
|
2993
3133
|
return `${e ?? ""}`.trim().toLowerCase();
|
|
2994
3134
|
}
|
|
2995
|
-
function
|
|
2996
|
-
const n = `${e ?? ""}:${t ?? 0}`, r =
|
|
3135
|
+
function Jr(e, t) {
|
|
3136
|
+
const n = `${e ?? ""}:${t ?? 0}`, r = Yt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new _.Color();
|
|
2997
3137
|
return s.setHSL(i, 1, 0.5), s;
|
|
2998
3138
|
}
|
|
2999
|
-
function
|
|
3139
|
+
function Yt(e) {
|
|
3000
3140
|
const t = `${e ?? ""}`;
|
|
3001
3141
|
let n = 2166136261;
|
|
3002
3142
|
for (let r = 0; r < t.length; r += 1)
|
|
3003
3143
|
n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
|
|
3004
3144
|
return (n >>> 0) / 4294967295;
|
|
3005
3145
|
}
|
|
3006
|
-
function
|
|
3146
|
+
function Qr(e, t, n) {
|
|
3007
3147
|
let r = null, o = 0;
|
|
3008
3148
|
for (const i of e) {
|
|
3009
3149
|
const s = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
|
|
3010
3150
|
if (!Number.isFinite(s) || !Number.isFinite(l)) continue;
|
|
3011
|
-
const
|
|
3012
|
-
|
|
3151
|
+
const c = Math.min(n, l) - Math.max(t, s);
|
|
3152
|
+
c > o && (o = c, r = i == null ? void 0 : i.value);
|
|
3013
3153
|
}
|
|
3014
3154
|
return r;
|
|
3015
3155
|
}
|
|
3016
|
-
function
|
|
3156
|
+
function eo(e, t) {
|
|
3017
3157
|
if (!t || !e) return [];
|
|
3018
3158
|
const n = e.id || e.holeId;
|
|
3019
3159
|
if (!n) return [];
|
|
3020
3160
|
const r = t[n];
|
|
3021
3161
|
if (Array.isArray(r) && r.length) return r;
|
|
3022
|
-
const o =
|
|
3162
|
+
const o = Kr(n);
|
|
3023
3163
|
if (o) {
|
|
3024
3164
|
const i = t[o];
|
|
3025
3165
|
if (Array.isArray(i) && i.length) return i;
|
|
3026
3166
|
}
|
|
3027
3167
|
return [];
|
|
3028
3168
|
}
|
|
3029
|
-
function
|
|
3169
|
+
function to({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
|
|
3030
3170
|
if (!e)
|
|
3031
|
-
return
|
|
3171
|
+
return Jr(r, o);
|
|
3032
3172
|
if (e === "__HAS_ASSAY__") {
|
|
3033
3173
|
if (!(t != null && t.length)) return new _.Color(ue);
|
|
3034
|
-
const
|
|
3035
|
-
return
|
|
3174
|
+
const u = Nt(i, s);
|
|
3175
|
+
return u ? t.some((d) => {
|
|
3036
3176
|
const f = Number(d == null ? void 0 : d.from), h = Number(d == null ? void 0 : d.to);
|
|
3037
3177
|
if (!Number.isFinite(f) || !Number.isFinite(h)) return !1;
|
|
3038
|
-
const
|
|
3039
|
-
return Math.min(
|
|
3178
|
+
const g = Math.max(u.segStart, f);
|
|
3179
|
+
return Math.min(u.segEnd, h) > g;
|
|
3040
3180
|
}) ? new _.Color("#ff8c42") : new _.Color(ue) : new _.Color(ue);
|
|
3041
3181
|
}
|
|
3042
3182
|
if (!(t != null && t.length)) return new _.Color(ue);
|
|
3043
|
-
const
|
|
3044
|
-
if (!
|
|
3183
|
+
const c = Nt(i, s);
|
|
3184
|
+
if (!c) return new _.Color(ue);
|
|
3045
3185
|
if (l) {
|
|
3046
|
-
const
|
|
3047
|
-
return new _.Color(
|
|
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
|
|
3057
|
-
t.forEach((p,
|
|
3058
|
-
const
|
|
3059
|
-
a = Math.min(a,
|
|
3060
|
-
const
|
|
3061
|
-
return
|
|
3186
|
+
const u = Qr(t, c.segStart, c.segEnd);
|
|
3187
|
+
return new _.Color(qr(u));
|
|
3188
|
+
}
|
|
3189
|
+
const a = Yr(t, c.segStart, c.segEnd);
|
|
3190
|
+
return Xr(a, n);
|
|
3191
|
+
}
|
|
3192
|
+
function no(e, t, n = {}) {
|
|
3193
|
+
if (!e.scene || (Xt(e), !t || t.length === 0)) return;
|
|
3194
|
+
const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = Zr(n), l = s ? [] : Wr(o, i), c = hr(l);
|
|
3195
|
+
let a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, h = -1 / 0;
|
|
3196
|
+
const g = new _.Vector3(), y = new _.Vector3(0, 1, 0);
|
|
3197
|
+
t.forEach((p, b) => {
|
|
3198
|
+
const M = b * 137.5 % 360 / 360, I = new _.Color().setHSL(M, 0.75, 0.55), x = (p.points || []).map((D) => {
|
|
3199
|
+
a = Math.min(a, D.x), u = Math.max(u, D.x), m = Math.min(m, D.y), d = Math.max(d, D.y), f = Math.min(f, D.z), h = Math.max(h, D.z);
|
|
3200
|
+
const v = new _.Vector3(D.x, D.y, D.z);
|
|
3201
|
+
return v.md = D.md, v;
|
|
3062
3202
|
});
|
|
3063
3203
|
if (x.length < 2) {
|
|
3064
3204
|
if (x.length === 1) {
|
|
3065
|
-
const
|
|
3066
|
-
color:
|
|
3067
|
-
emissive:
|
|
3205
|
+
const D = new _.SphereGeometry(5, 12, 12), v = new _.MeshLambertMaterial({
|
|
3206
|
+
color: I,
|
|
3207
|
+
emissive: I,
|
|
3068
3208
|
emissiveIntensity: 0.2
|
|
3069
|
-
}),
|
|
3070
|
-
|
|
3209
|
+
}), L = new _.Mesh(D, v);
|
|
3210
|
+
L.position.copy(x[0]), L.userData = Ze(p), e.scene.add(L), e.drillLines.push(L), e.drillMeshes.push(L);
|
|
3071
3211
|
}
|
|
3072
3212
|
return;
|
|
3073
3213
|
}
|
|
3074
|
-
const
|
|
3075
|
-
|
|
3076
|
-
const
|
|
3077
|
-
for (let
|
|
3078
|
-
const
|
|
3079
|
-
if (
|
|
3080
|
-
const
|
|
3214
|
+
const S = new _.Group();
|
|
3215
|
+
S.userData = Ze(p);
|
|
3216
|
+
const w = i ? eo(p, o) : [];
|
|
3217
|
+
for (let D = 0; D < x.length - 1; D += 1) {
|
|
3218
|
+
const v = x[D], L = x[D + 1], O = g.subVectors(L, v), V = O.length();
|
|
3219
|
+
if (V <= 1e-3) continue;
|
|
3220
|
+
const H = 2.2, A = new _.CylinderGeometry(H, H, V, 6, 1, !0), E = to({
|
|
3081
3221
|
selectedAssayVariable: i,
|
|
3082
|
-
assayIntervals:
|
|
3083
|
-
assayScale:
|
|
3222
|
+
assayIntervals: w,
|
|
3223
|
+
assayScale: c,
|
|
3084
3224
|
holeId: p.id,
|
|
3085
|
-
segmentIndex:
|
|
3086
|
-
p1:
|
|
3087
|
-
p2:
|
|
3225
|
+
segmentIndex: D,
|
|
3226
|
+
p1: v,
|
|
3227
|
+
p2: L,
|
|
3088
3228
|
isCategorical: s
|
|
3089
|
-
}),
|
|
3090
|
-
color:
|
|
3229
|
+
}), z = new _.MeshLambertMaterial({
|
|
3230
|
+
color: E,
|
|
3091
3231
|
flatShading: !0,
|
|
3092
|
-
emissive:
|
|
3232
|
+
emissive: E,
|
|
3093
3233
|
emissiveIntensity: 0.15
|
|
3094
|
-
}),
|
|
3095
|
-
|
|
3234
|
+
}), R = new _.Mesh(A, z);
|
|
3235
|
+
R.position.copy(v.clone().addScaledVector(O, 0.5)), R.quaternion.setFromUnitVectors(y, O.clone().normalize()), R.userData = Ze(p), S.add(R), e.drillMeshes.push(R);
|
|
3096
3236
|
}
|
|
3097
|
-
e.scene.add(
|
|
3098
|
-
}), e.camera && e.controls && (e.lastBounds = { minX: a, maxX:
|
|
3237
|
+
e.scene.add(S), e.drillLines.push(S);
|
|
3238
|
+
}), 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
3239
|
}
|
|
3100
|
-
function
|
|
3240
|
+
function Xt(e) {
|
|
3101
3241
|
e.drillLines.forEach((t) => {
|
|
3102
3242
|
e.scene.remove(t), t.isGroup ? t.traverse((n) => {
|
|
3103
3243
|
n.isMesh && (n.geometry.dispose(), n.material.dispose());
|
|
3104
3244
|
}) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
|
|
3105
3245
|
}), e.drillLines = [], e.drillMeshes = [], Me(e);
|
|
3106
3246
|
}
|
|
3107
|
-
const
|
|
3108
|
-
function
|
|
3247
|
+
const Mt = "#ffffbb", ro = 2, oo = 1.5, io = 1;
|
|
3248
|
+
function so(e) {
|
|
3109
3249
|
const { renderer: t, scene: n, camera: r, container: o } = e;
|
|
3110
3250
|
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 _.Vector2(i, s),
|
|
3114
|
-
|
|
3251
|
+
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);
|
|
3252
|
+
l.addPass(c);
|
|
3253
|
+
const a = new _.Vector2(i, s), u = new un(a, n, r);
|
|
3254
|
+
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
3255
|
}
|
|
3116
|
-
function
|
|
3256
|
+
function lo(e, t, n) {
|
|
3117
3257
|
!e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
|
|
3118
3258
|
}
|
|
3119
3259
|
function Se(e, t) {
|
|
3120
3260
|
e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
|
|
3121
3261
|
}
|
|
3122
|
-
function
|
|
3262
|
+
function zt(e) {
|
|
3123
3263
|
e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
|
|
3124
3264
|
}
|
|
3125
|
-
const
|
|
3265
|
+
const ao = [
|
|
3126
3266
|
{ normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
|
|
3127
3267
|
{ normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
|
|
3128
3268
|
{ normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
|
|
@@ -3130,40 +3270,40 @@ const Kr = [
|
|
|
3130
3270
|
{ normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
|
|
3131
3271
|
{ normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
|
|
3132
3272
|
];
|
|
3133
|
-
function
|
|
3273
|
+
function co(e, t, n, r, o = {}) {
|
|
3134
3274
|
if (!e.scene || (qt(e), !t || !n || !r)) return;
|
|
3135
3275
|
const { autoCenter: i = !0, opacity: s = 1 } = o;
|
|
3136
|
-
let l = 1 / 0,
|
|
3137
|
-
t.forEach((
|
|
3138
|
-
const
|
|
3139
|
-
l = Math.min(l,
|
|
3276
|
+
let l = 1 / 0, c = -1 / 0, a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0;
|
|
3277
|
+
t.forEach((z) => {
|
|
3278
|
+
const R = Number(z.x ?? z.center_x ?? 0), C = Number(z.y ?? z.center_y ?? 0), G = Number(z.z ?? z.center_z ?? 0), U = Number(z.dx ?? z.size_x ?? 1), j = Number(z.dy ?? z.size_y ?? 1), Z = Number(z.dz ?? z.size_z ?? 1);
|
|
3279
|
+
l = Math.min(l, R - U / 2), c = Math.max(c, R + U / 2), a = Math.min(a, C - j / 2), u = Math.max(u, C + j / 2), m = Math.min(m, G - Z / 2), d = Math.max(d, G + Z / 2);
|
|
3140
3280
|
});
|
|
3141
|
-
let f = 0, h = 0,
|
|
3142
|
-
o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0),
|
|
3143
|
-
const y = l + f, p =
|
|
3144
|
-
t.map((
|
|
3145
|
-
),
|
|
3146
|
-
let
|
|
3147
|
-
if (t.forEach((
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3150
|
-
const
|
|
3151
|
-
if (
|
|
3152
|
-
const ze =
|
|
3153
|
-
_e.verts.forEach(([
|
|
3154
|
-
|
|
3155
|
-
}),
|
|
3281
|
+
let f = 0, h = 0, g = 0;
|
|
3282
|
+
o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0), g = Number(o.offset.z ?? 0)) : i && (f = -((l + c) / 2), h = -((a + u) / 2), g = -((m + d) / 2));
|
|
3283
|
+
const y = l + f, p = c + f, b = a + h, N = u + h, M = m + g, I = d + g, x = (z, R, C) => `${Math.round(z)},${Math.round(R)},${Math.round(C)}`, S = new Set(
|
|
3284
|
+
t.map((z) => x(Number(z.x ?? 0), Number(z.y ?? 0), Number(z.z ?? 0)))
|
|
3285
|
+
), w = [], D = [], v = [], L = [], O = [];
|
|
3286
|
+
let V = 0;
|
|
3287
|
+
if (t.forEach((z) => {
|
|
3288
|
+
const R = Number(z.x ?? z.center_x ?? 0), C = Number(z.y ?? z.center_y ?? 0), G = Number(z.z ?? z.center_z ?? 0), U = Number(z.dx ?? z.size_x ?? 1), j = Number(z.dy ?? z.size_y ?? 1), Z = Number(z.dz ?? z.size_z ?? 1), K = R + f, le = C + h, ye = G + g, fe = $n(z[n], r, _), { r: Ce, g: he, b: Ge } = fe;
|
|
3289
|
+
ao.forEach((_e) => {
|
|
3290
|
+
const Jt = R + _e.neibDir[0] * U, Qt = C + _e.neibDir[1] * j, en = G + _e.neibDir[2] * Z;
|
|
3291
|
+
if (S.has(x(Jt, Qt, en))) return;
|
|
3292
|
+
const ze = V;
|
|
3293
|
+
_e.verts.forEach(([tn, nn, rn]) => {
|
|
3294
|
+
w.push(K + tn * U / 2, le + nn * j / 2, ye + rn * Z / 2), D.push(_e.normal[0], _e.normal[1], _e.normal[2]), v.push(Ce, he, Ge), V++;
|
|
3295
|
+
}), L.push(ze, ze + 1, ze + 2, ze, ze + 2, ze + 3), O.push(z);
|
|
3156
3296
|
});
|
|
3157
|
-
}),
|
|
3158
|
-
const
|
|
3159
|
-
|
|
3160
|
-
const
|
|
3297
|
+
}), w.length === 0) return;
|
|
3298
|
+
const H = new _.BufferGeometry();
|
|
3299
|
+
H.setAttribute("position", new _.Float32BufferAttribute(w, 3)), H.setAttribute("normal", new _.Float32BufferAttribute(D, 3)), H.setAttribute("color", new _.Float32BufferAttribute(v, 3)), H.setIndex(L);
|
|
3300
|
+
const A = new _.MeshLambertMaterial({
|
|
3161
3301
|
vertexColors: !0,
|
|
3162
3302
|
transparent: s < 1,
|
|
3163
3303
|
opacity: s,
|
|
3164
3304
|
side: _.DoubleSide
|
|
3165
|
-
}),
|
|
3166
|
-
|
|
3305
|
+
}), E = new _.Mesh(H, A);
|
|
3306
|
+
E.userData._isMergedBlocks = !0, E.userData._quadToBlock = O, E.userData._offset = { x: f, y: h, z: g }, e.scene.add(E), e.blocks.push(E), Me(e), e.camera && e.controls && (e.lastBounds = { minX: y, maxX: p, minY: b, maxY: N, minZ: M, maxZ: I }, lt(e, { minX: y, maxX: p, minY: b, maxY: N, minZ: M, maxZ: I }));
|
|
3167
3307
|
}
|
|
3168
3308
|
function qt(e) {
|
|
3169
3309
|
var t;
|
|
@@ -3171,21 +3311,21 @@ function qt(e) {
|
|
|
3171
3311
|
e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
|
|
3172
3312
|
}), 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
3313
|
}
|
|
3174
|
-
function
|
|
3314
|
+
function uo(e, t) {
|
|
3175
3315
|
const n = Math.max(0, Math.min(1, Number(t)));
|
|
3176
3316
|
e.blocks.forEach((r) => {
|
|
3177
3317
|
r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
|
|
3178
3318
|
});
|
|
3179
3319
|
}
|
|
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,
|
|
3320
|
+
function mo(e, t, n) {
|
|
3321
|
+
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
3322
|
if (!e._blockHighlightMesh) {
|
|
3183
3323
|
const d = new _.BoxGeometry(1, 1, 1), f = new _.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
|
|
3184
3324
|
e._blockHighlightMesh = new _.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
|
|
3185
3325
|
}
|
|
3186
|
-
return e._blockHighlightMesh.position.set(s, l,
|
|
3326
|
+
return e._blockHighlightMesh.position.set(s, l, c), e._blockHighlightMesh.scale.set(a, u, m), e._blockHighlightMesh;
|
|
3187
3327
|
}
|
|
3188
|
-
function
|
|
3328
|
+
function Zt(e) {
|
|
3189
3329
|
var o, i;
|
|
3190
3330
|
if (!e._outlinePass || e.selectables.length === 0) {
|
|
3191
3331
|
e._outlinePass && Se(e, null);
|
|
@@ -3200,98 +3340,98 @@ function Xt(e) {
|
|
|
3200
3340
|
if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
|
|
3201
3341
|
const s = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[s];
|
|
3202
3342
|
if (l) {
|
|
3203
|
-
Se(e,
|
|
3343
|
+
Se(e, mo(e, l, r.userData._offset));
|
|
3204
3344
|
return;
|
|
3205
3345
|
}
|
|
3206
3346
|
}
|
|
3207
3347
|
Se(e, r);
|
|
3208
3348
|
}
|
|
3209
|
-
function
|
|
3349
|
+
function fo(e) {
|
|
3210
3350
|
const t = e.renderer;
|
|
3211
3351
|
t && (e.handleCanvasClick = (n) => {
|
|
3212
|
-
var f, h,
|
|
3352
|
+
var f, h, g, y, p, b, N;
|
|
3213
3353
|
if (n.button !== 0) return;
|
|
3214
3354
|
if ((f = e.gizmo) != null && f.domElement) {
|
|
3215
|
-
const
|
|
3216
|
-
if (n.clientX >=
|
|
3355
|
+
const M = e.gizmo.domElement.getBoundingClientRect();
|
|
3356
|
+
if (n.clientX >= M.left && n.clientX <= M.right && n.clientY >= M.top && n.clientY <= M.bottom)
|
|
3217
3357
|
return;
|
|
3218
3358
|
}
|
|
3219
3359
|
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),
|
|
3221
|
-
const
|
|
3222
|
-
if (
|
|
3223
|
-
const
|
|
3360
|
+
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) {
|
|
3361
|
+
const M = e.raycaster.intersectObjects(e.blocks, !1);
|
|
3362
|
+
if (M.length > 0) {
|
|
3363
|
+
const I = M[0], x = I.object;
|
|
3224
3364
|
if ((h = x == null ? void 0 : x.userData) != null && h._isMergedBlocks && e.blockClickHandler) {
|
|
3225
|
-
const
|
|
3226
|
-
|
|
3365
|
+
const S = Math.floor(I.faceIndex / 2), w = x.userData._quadToBlock[S];
|
|
3366
|
+
w && e.blockClickHandler(w);
|
|
3227
3367
|
}
|
|
3228
3368
|
return;
|
|
3229
3369
|
}
|
|
3230
3370
|
}
|
|
3231
|
-
const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0),
|
|
3232
|
-
if ((((y = l[0]) == null ? void 0 : y.distance) ?? 1 / 0) <
|
|
3233
|
-
const
|
|
3234
|
-
e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...
|
|
3371
|
+
const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((g = s[0]) == null ? void 0 : g.distance) ?? 1 / 0;
|
|
3372
|
+
if ((((y = l[0]) == null ? void 0 : y.distance) ?? 1 / 0) < c && l.length > 0) {
|
|
3373
|
+
const M = l[0].object;
|
|
3374
|
+
e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...M.userData });
|
|
3235
3375
|
return;
|
|
3236
3376
|
}
|
|
3237
3377
|
if (s.length === 0) return;
|
|
3238
|
-
let
|
|
3239
|
-
for (;
|
|
3240
|
-
|
|
3241
|
-
const m = (
|
|
3378
|
+
let u = s[0].object;
|
|
3379
|
+
for (; u && u.parent && !((p = u.userData) != null && p.holeId); )
|
|
3380
|
+
u = u.parent;
|
|
3381
|
+
const m = (b = u == null ? void 0 : u.userData) == null ? void 0 : b.holeId, d = (N = u == null ? void 0 : u.userData) == null ? void 0 : N.project;
|
|
3242
3382
|
m && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: m, project: d });
|
|
3243
3383
|
}, t.domElement.addEventListener("click", e.handleCanvasClick));
|
|
3244
3384
|
}
|
|
3245
|
-
class
|
|
3385
|
+
class Di {
|
|
3246
3386
|
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 _.Clock(), this.handleCanvasClick = null, this.raycaster = new _.Raycaster(), this.pointer = new _.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new _.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null;
|
|
3387
|
+
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 _.Clock(), this.handleCanvasClick = null, this.raycaster = new _.Raycaster(), this.pointer = new _.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new _.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
3388
|
}
|
|
3249
3389
|
init(t) {
|
|
3250
3390
|
if (!t) return;
|
|
3251
3391
|
this.container = t;
|
|
3252
3392
|
const n = t.clientWidth, r = t.clientHeight;
|
|
3253
|
-
this.scene = new _.Scene(), this.scene.background = new _.Color(16777215), this.camera = new _.PerspectiveCamera(28, n / r, 1e-3,
|
|
3393
|
+
this.scene = new _.Scene(), this.scene.background = new _.Color(16777215), this.camera = new _.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 _.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
|
|
3254
3394
|
const o = new _.AmbientLight(16777215, 1.2);
|
|
3255
3395
|
this.scene.add(o);
|
|
3256
3396
|
const i = new _.DirectionalLight(16777215, 1.5);
|
|
3257
3397
|
i.position.set(10, 10, 5), this.scene.add(i);
|
|
3258
3398
|
const s = new _.AxesHelper(20);
|
|
3259
|
-
this.scene.add(s), this.controls = new
|
|
3399
|
+
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 = {
|
|
3260
3400
|
LEFT: _.MOUSE.PAN,
|
|
3261
3401
|
MIDDLE: _.MOUSE.DOLLY,
|
|
3262
3402
|
RIGHT: _.MOUSE.ROTATE
|
|
3263
3403
|
}, this.controls.touches = {
|
|
3264
3404
|
ONE: _.TOUCH.ROTATE,
|
|
3265
3405
|
TWO: _.TOUCH.PAN
|
|
3266
|
-
}, this.controls.maxPolarAngle = Math.PI, this.flyControls = new
|
|
3406
|
+
}, 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
3407
|
container: this.container,
|
|
3268
3408
|
placement: "top-right",
|
|
3269
3409
|
size: 110,
|
|
3270
3410
|
offset: { top: 12, right: 12 },
|
|
3271
3411
|
animated: !0,
|
|
3272
3412
|
speed: 1.5
|
|
3273
|
-
}), this.gizmo.attachControls(this.controls),
|
|
3413
|
+
}), this.gizmo.attachControls(this.controls), fo(this), so(this);
|
|
3274
3414
|
const l = () => {
|
|
3275
3415
|
var a;
|
|
3276
3416
|
this.frameId = requestAnimationFrame(l);
|
|
3277
|
-
const
|
|
3278
|
-
this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.enabled) ? this.flyControls.update(
|
|
3417
|
+
const c = this.clock.getDelta();
|
|
3418
|
+
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
3419
|
};
|
|
3280
3420
|
l();
|
|
3281
3421
|
}
|
|
3282
3422
|
resize() {
|
|
3283
3423
|
if (!this.container || !this.camera || !this.renderer) return;
|
|
3284
3424
|
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(),
|
|
3425
|
+
this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), lo(this, t, n);
|
|
3286
3426
|
}
|
|
3287
3427
|
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),
|
|
3428
|
+
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
3429
|
}
|
|
3290
3430
|
// ---------------------------------------------------------------------------
|
|
3291
3431
|
// Data renderers — delegate to domain modules
|
|
3292
3432
|
// ---------------------------------------------------------------------------
|
|
3293
3433
|
setDrillholes(t, n = {}) {
|
|
3294
|
-
|
|
3434
|
+
no(this, t, n);
|
|
3295
3435
|
}
|
|
3296
3436
|
/**
|
|
3297
3437
|
* Render block model data as a single merged mesh of exterior faces only.
|
|
@@ -3301,17 +3441,17 @@ class _i {
|
|
|
3301
3441
|
* @param {Object} [options]
|
|
3302
3442
|
*/
|
|
3303
3443
|
setBlocks(t, n, r, o = {}) {
|
|
3304
|
-
|
|
3444
|
+
co(this, t, n, r, o);
|
|
3305
3445
|
}
|
|
3306
3446
|
/**
|
|
3307
3447
|
* Update the opacity of all currently rendered blocks.
|
|
3308
3448
|
* @param {number} opacity - New opacity value between 0 and 1
|
|
3309
3449
|
*/
|
|
3310
3450
|
setBlockOpacity(t) {
|
|
3311
|
-
|
|
3451
|
+
uo(this, t);
|
|
3312
3452
|
}
|
|
3313
3453
|
setStructuralDiscs(t, n, r = {}) {
|
|
3314
|
-
|
|
3454
|
+
vr(this, t, n, r);
|
|
3315
3455
|
}
|
|
3316
3456
|
setStructuralDiscsVisible(t) {
|
|
3317
3457
|
Er(this, t);
|
|
@@ -3336,44 +3476,44 @@ class _i {
|
|
|
3336
3476
|
this.viewChangeHandler = typeof t == "function" ? t : null;
|
|
3337
3477
|
}
|
|
3338
3478
|
getViewState() {
|
|
3339
|
-
return
|
|
3479
|
+
return Ut(this);
|
|
3340
3480
|
}
|
|
3341
3481
|
setViewState(t) {
|
|
3342
|
-
return
|
|
3482
|
+
return Fr(this, t);
|
|
3343
3483
|
}
|
|
3344
3484
|
_buildViewSignature(t) {
|
|
3345
|
-
return
|
|
3485
|
+
return st(t);
|
|
3346
3486
|
}
|
|
3347
3487
|
_emitViewChangeIfNeeded() {
|
|
3348
|
-
|
|
3488
|
+
wr(this);
|
|
3349
3489
|
}
|
|
3350
3490
|
_fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
3351
|
-
|
|
3491
|
+
lt(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
|
|
3352
3492
|
}
|
|
3353
3493
|
recenterCameraToOrigin(t = 1e3) {
|
|
3354
|
-
|
|
3494
|
+
Tr(this, t);
|
|
3355
3495
|
}
|
|
3356
3496
|
lookDown(t = 2e3) {
|
|
3357
|
-
|
|
3497
|
+
$r(this, t);
|
|
3358
3498
|
}
|
|
3359
3499
|
pan(t = 0, n = 0) {
|
|
3360
|
-
|
|
3500
|
+
Rr(this, t, n);
|
|
3361
3501
|
}
|
|
3362
3502
|
dolly(t = 1.1) {
|
|
3363
|
-
|
|
3503
|
+
Br(this, t);
|
|
3364
3504
|
}
|
|
3365
3505
|
focusOnLastBounds(t = 1.2) {
|
|
3366
|
-
|
|
3506
|
+
Vr(this, t);
|
|
3367
3507
|
}
|
|
3368
3508
|
/**
|
|
3369
3509
|
* Change the camera field-of-view while keeping the visible scene the same apparent size.
|
|
3370
3510
|
* @param {number} fovDeg - Desired FOV in degrees
|
|
3371
3511
|
*/
|
|
3372
3512
|
setCameraFov(t) {
|
|
3373
|
-
|
|
3513
|
+
Gr(this, t);
|
|
3374
3514
|
}
|
|
3375
3515
|
setControlMode(t = "orbit") {
|
|
3376
|
-
|
|
3516
|
+
Ur(this, t);
|
|
3377
3517
|
}
|
|
3378
3518
|
// ---------------------------------------------------------------------------
|
|
3379
3519
|
// Selection glow public API
|
|
@@ -3406,14 +3546,70 @@ class _i {
|
|
|
3406
3546
|
* Dispose the effect composer and all GPU resources used by the selection glow.
|
|
3407
3547
|
*/
|
|
3408
3548
|
disposeGlow() {
|
|
3409
|
-
|
|
3549
|
+
zt(this);
|
|
3410
3550
|
}
|
|
3411
3551
|
/** @private */
|
|
3412
3552
|
_updateSelectionFromPointer() {
|
|
3413
|
-
|
|
3553
|
+
Zt(this);
|
|
3554
|
+
}
|
|
3555
|
+
// ---------------------------------------------------------------------------
|
|
3556
|
+
// Raster overlay API — delegate to rasterOverlayScene
|
|
3557
|
+
// ---------------------------------------------------------------------------
|
|
3558
|
+
/**
|
|
3559
|
+
* Add a raster overlay layer (created with createRasterOverlay) to the scene.
|
|
3560
|
+
* @param {object} layer - Layer descriptor returned by createRasterOverlay()
|
|
3561
|
+
*/
|
|
3562
|
+
addRasterOverlay(t) {
|
|
3563
|
+
Ir(this, t);
|
|
3564
|
+
}
|
|
3565
|
+
/**
|
|
3566
|
+
* Remove a raster overlay from the scene and dispose its GPU resources.
|
|
3567
|
+
* @param {string} id - Overlay id
|
|
3568
|
+
*/
|
|
3569
|
+
removeRasterOverlay(t) {
|
|
3570
|
+
it(this, t);
|
|
3571
|
+
}
|
|
3572
|
+
/**
|
|
3573
|
+
* Set the opacity of a raster overlay at runtime.
|
|
3574
|
+
* @param {string} id - Overlay id
|
|
3575
|
+
* @param {number} opacity - New opacity [0, 1]
|
|
3576
|
+
*/
|
|
3577
|
+
setRasterOverlayOpacity(t, n) {
|
|
3578
|
+
Or(this, t, n);
|
|
3579
|
+
}
|
|
3580
|
+
/**
|
|
3581
|
+
* Show or hide a raster overlay.
|
|
3582
|
+
* @param {string} id - Overlay id
|
|
3583
|
+
* @param {boolean} visible
|
|
3584
|
+
*/
|
|
3585
|
+
setRasterOverlayVisibility(t, n) {
|
|
3586
|
+
Cr(this, t, n);
|
|
3587
|
+
}
|
|
3588
|
+
/**
|
|
3589
|
+
* Update the elevation (Z position) of a raster overlay.
|
|
3590
|
+
* @param {string} id - Overlay id
|
|
3591
|
+
* @param {number} elevation
|
|
3592
|
+
*/
|
|
3593
|
+
setRasterOverlayElevation(t, n) {
|
|
3594
|
+
Sr(this, t, n);
|
|
3595
|
+
}
|
|
3596
|
+
/**
|
|
3597
|
+
* Return a raster overlay by id, or undefined if not found.
|
|
3598
|
+
* @param {string} id
|
|
3599
|
+
* @returns {object|undefined}
|
|
3600
|
+
*/
|
|
3601
|
+
getRasterOverlay(t) {
|
|
3602
|
+
return Dr(this, t);
|
|
3603
|
+
}
|
|
3604
|
+
/**
|
|
3605
|
+
* Return all raster overlay layers in insertion order.
|
|
3606
|
+
* @returns {object[]}
|
|
3607
|
+
*/
|
|
3608
|
+
listRasterOverlays() {
|
|
3609
|
+
return Lr(this);
|
|
3414
3610
|
}
|
|
3415
3611
|
}
|
|
3416
|
-
function
|
|
3612
|
+
function Li({
|
|
3417
3613
|
controlMode: e = "orbit",
|
|
3418
3614
|
onToggleFly: t = () => {
|
|
3419
3615
|
},
|
|
@@ -3425,13 +3621,13 @@ function Ni({
|
|
|
3425
3621
|
}
|
|
3426
3622
|
}) {
|
|
3427
3623
|
return /* @__PURE__ */ J("div", { className: "baselode-3d-controls", children: [
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
|
|
3625
|
+
/* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
|
|
3626
|
+
/* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
|
|
3627
|
+
/* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
|
|
3432
3628
|
] });
|
|
3433
3629
|
}
|
|
3434
|
-
function
|
|
3630
|
+
function Pi({
|
|
3435
3631
|
properties: e = [],
|
|
3436
3632
|
selectedProperty: t = "",
|
|
3437
3633
|
onPropertyChange: n = () => {
|
|
@@ -3444,37 +3640,37 @@ function Mi({
|
|
|
3444
3640
|
onPopupClose: l = () => {
|
|
3445
3641
|
}
|
|
3446
3642
|
}) {
|
|
3447
|
-
var
|
|
3643
|
+
var c, a;
|
|
3448
3644
|
return /* @__PURE__ */ J("div", { className: "bm-widget", children: [
|
|
3449
|
-
/* @__PURE__ */
|
|
3645
|
+
/* @__PURE__ */ P("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
|
|
3450
3646
|
/* @__PURE__ */ J(
|
|
3451
3647
|
"select",
|
|
3452
3648
|
{
|
|
3453
3649
|
id: "bm-property-select",
|
|
3454
3650
|
className: "bm-widget__select",
|
|
3455
3651
|
value: t,
|
|
3456
|
-
onChange: (
|
|
3652
|
+
onChange: (u) => n(u.target.value),
|
|
3457
3653
|
children: [
|
|
3458
|
-
e.length === 0 && /* @__PURE__ */
|
|
3459
|
-
e.map((
|
|
3654
|
+
e.length === 0 && /* @__PURE__ */ P("option", { value: "", children: "— no attributes —" }),
|
|
3655
|
+
e.map((u) => /* @__PURE__ */ P("option", { value: u, children: u }, u))
|
|
3460
3656
|
]
|
|
3461
3657
|
}
|
|
3462
3658
|
),
|
|
3463
3659
|
i && i.type === "numeric" && /* @__PURE__ */ J("div", { className: "bm-widget__scale", children: [
|
|
3464
|
-
/* @__PURE__ */
|
|
3465
|
-
/* @__PURE__ */
|
|
3466
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ P("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((c = i.min) == null ? void 0 : c.toFixed(2)) ?? "—" }),
|
|
3661
|
+
/* @__PURE__ */ P("div", { className: "bm-widget__scale-bar" }),
|
|
3662
|
+
/* @__PURE__ */ P("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
|
|
3467
3663
|
] }),
|
|
3468
|
-
i && i.type === "categorical" && /* @__PURE__ */
|
|
3664
|
+
i && i.type === "categorical" && /* @__PURE__ */ P("div", { className: "bm-widget__categories", children: (i.categories || []).map((u, m) => {
|
|
3469
3665
|
const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
|
|
3470
|
-
return /* @__PURE__ */
|
|
3666
|
+
return /* @__PURE__ */ P(
|
|
3471
3667
|
"span",
|
|
3472
3668
|
{
|
|
3473
3669
|
className: "bm-widget__category-chip",
|
|
3474
3670
|
style: { background: `hsl(${d},70%,50%)` },
|
|
3475
|
-
children:
|
|
3671
|
+
children: u
|
|
3476
3672
|
},
|
|
3477
|
-
|
|
3673
|
+
u
|
|
3478
3674
|
);
|
|
3479
3675
|
}) }),
|
|
3480
3676
|
/* @__PURE__ */ J("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
|
|
@@ -3482,7 +3678,7 @@ function Mi({
|
|
|
3482
3678
|
Math.round(r * 100),
|
|
3483
3679
|
"%)"
|
|
3484
3680
|
] }),
|
|
3485
|
-
/* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ P(
|
|
3486
3682
|
"input",
|
|
3487
3683
|
{
|
|
3488
3684
|
id: "bm-opacity-slider",
|
|
@@ -3492,13 +3688,13 @@ function Mi({
|
|
|
3492
3688
|
max: "1",
|
|
3493
3689
|
step: "0.01",
|
|
3494
3690
|
value: r,
|
|
3495
|
-
onChange: (
|
|
3691
|
+
onChange: (u) => o(parseFloat(u.target.value))
|
|
3496
3692
|
}
|
|
3497
3693
|
),
|
|
3498
3694
|
s && /* @__PURE__ */ J("div", { className: "bm-widget__popup", children: [
|
|
3499
3695
|
/* @__PURE__ */ J("div", { className: "bm-widget__popup-header", children: [
|
|
3500
|
-
/* @__PURE__ */
|
|
3501
|
-
/* @__PURE__ */
|
|
3696
|
+
/* @__PURE__ */ P("span", { children: "Block attributes" }),
|
|
3697
|
+
/* @__PURE__ */ P(
|
|
3502
3698
|
"button",
|
|
3503
3699
|
{
|
|
3504
3700
|
type: "button",
|
|
@@ -3509,19 +3705,19 @@ function Mi({
|
|
|
3509
3705
|
}
|
|
3510
3706
|
)
|
|
3511
3707
|
] }),
|
|
3512
|
-
/* @__PURE__ */
|
|
3513
|
-
/* @__PURE__ */
|
|
3514
|
-
/* @__PURE__ */
|
|
3515
|
-
] },
|
|
3708
|
+
/* @__PURE__ */ P("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ P("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ J("tr", { children: [
|
|
3709
|
+
/* @__PURE__ */ P("th", { children: u }),
|
|
3710
|
+
/* @__PURE__ */ P("td", { children: m == null ? "—" : String(m) })
|
|
3711
|
+
] }, u)) }) })
|
|
3516
3712
|
] })
|
|
3517
3713
|
] });
|
|
3518
3714
|
}
|
|
3519
|
-
const
|
|
3715
|
+
const ho = [
|
|
3520
3716
|
{ minZoom: 0, lodKey: "thumb" },
|
|
3521
3717
|
{ minZoom: 4, lodKey: "medium" },
|
|
3522
3718
|
{ minZoom: 7, lodKey: "full" }
|
|
3523
|
-
],
|
|
3524
|
-
function
|
|
3719
|
+
], Wt = 50;
|
|
3720
|
+
function po(e, t, n = ho) {
|
|
3525
3721
|
var i;
|
|
3526
3722
|
const r = e.lod_urls;
|
|
3527
3723
|
if (!r || typeof r != "object" || Array.isArray(r))
|
|
@@ -3531,10 +3727,10 @@ function ro(e, t, n = no) {
|
|
|
3531
3727
|
t >= s.minZoom && (o = s.lodKey);
|
|
3532
3728
|
return r[o] || e.image_url || "";
|
|
3533
3729
|
}
|
|
3534
|
-
function
|
|
3730
|
+
function bo(e) {
|
|
3535
3731
|
return [...e].sort((t, n) => (t.from_depth ?? 0) - (n.from_depth ?? 0));
|
|
3536
3732
|
}
|
|
3537
|
-
function
|
|
3733
|
+
function go(e) {
|
|
3538
3734
|
const t = {};
|
|
3539
3735
|
for (const n of e) {
|
|
3540
3736
|
const r = n.photo_set != null && n.photo_set !== "" ? String(n.photo_set) : "default";
|
|
@@ -3542,7 +3738,7 @@ function io(e) {
|
|
|
3542
3738
|
}
|
|
3543
3739
|
return t;
|
|
3544
3740
|
}
|
|
3545
|
-
function
|
|
3741
|
+
function yo(e, t, n = 10) {
|
|
3546
3742
|
const r = [];
|
|
3547
3743
|
if (e >= t || n <= 0) return r;
|
|
3548
3744
|
const o = Math.ceil(e / n) * n, i = n * 1e-9;
|
|
@@ -3552,120 +3748,120 @@ function so(e, t, n = 10) {
|
|
|
3552
3748
|
}
|
|
3553
3749
|
return r;
|
|
3554
3750
|
}
|
|
3555
|
-
function
|
|
3751
|
+
function _o(e) {
|
|
3556
3752
|
return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
|
|
3557
3753
|
}
|
|
3558
|
-
function
|
|
3754
|
+
function Kt(e) {
|
|
3559
3755
|
return `tray_${String(e).padStart(3, "0")}.jpg`;
|
|
3560
3756
|
}
|
|
3561
|
-
function
|
|
3757
|
+
function No(e, t, n, r, o = "Tray Images", i = Kt) {
|
|
3562
3758
|
const s = (n ?? "").replace(/\/$/, ""), l = (r ?? "").replace(/\/$/, "");
|
|
3563
|
-
return t.map((
|
|
3564
|
-
const
|
|
3759
|
+
return t.map((c, a) => {
|
|
3760
|
+
const u = c.filename ?? i(a), m = c.photoSet ?? o;
|
|
3565
3761
|
return {
|
|
3566
3762
|
hole_id: e,
|
|
3567
|
-
from_depth:
|
|
3568
|
-
to_depth:
|
|
3763
|
+
from_depth: c.fromDepth,
|
|
3764
|
+
to_depth: c.toDepth,
|
|
3569
3765
|
photo_set: m,
|
|
3570
|
-
image_url: `${s}/${
|
|
3766
|
+
image_url: `${s}/${u}`,
|
|
3571
3767
|
lod_urls: {
|
|
3572
|
-
thumb: `${s}/${
|
|
3573
|
-
full: `${l}/${
|
|
3768
|
+
thumb: `${s}/${u}`,
|
|
3769
|
+
full: `${l}/${u}`
|
|
3574
3770
|
}
|
|
3575
3771
|
};
|
|
3576
3772
|
});
|
|
3577
3773
|
}
|
|
3578
|
-
function
|
|
3774
|
+
function Fi(e, t, n = Wt) {
|
|
3579
3775
|
const r = t / 5;
|
|
3580
3776
|
return Math.max(1, Math.round(e * n * r));
|
|
3581
3777
|
}
|
|
3582
|
-
const We = 5,
|
|
3583
|
-
function
|
|
3778
|
+
const We = 5, vt = 1.12, Mo = 0.05, zo = 40;
|
|
3779
|
+
function vo({
|
|
3584
3780
|
photos: e = [],
|
|
3585
3781
|
holeId: t = "",
|
|
3586
3782
|
initialZoom: n = 5,
|
|
3587
3783
|
transform: r,
|
|
3588
3784
|
onTransformChange: o
|
|
3589
3785
|
}) {
|
|
3590
|
-
const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i,
|
|
3591
|
-
|
|
3786
|
+
const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, c = De(l);
|
|
3787
|
+
c.current = l;
|
|
3592
3788
|
const a = Ue(
|
|
3593
|
-
(
|
|
3594
|
-
const
|
|
3595
|
-
o ? o(
|
|
3789
|
+
(v) => {
|
|
3790
|
+
const L = typeof v == "function" ? v(c.current) : v;
|
|
3791
|
+
o ? o(L) : s(L);
|
|
3596
3792
|
},
|
|
3597
3793
|
[o]
|
|
3598
|
-
), [
|
|
3599
|
-
const
|
|
3600
|
-
for (const
|
|
3601
|
-
const
|
|
3602
|
-
|
|
3794
|
+
), [u, m] = Q(!1), d = De(null), f = De(null), h = ne(() => bo(e), [e]), g = ne(() => go(h), [h]), y = ne(() => {
|
|
3795
|
+
const v = /* @__PURE__ */ new Set();
|
|
3796
|
+
for (const L of e) {
|
|
3797
|
+
const O = L.photo_set != null && L.photo_set !== "" ? String(L.photo_set) : "default";
|
|
3798
|
+
v.add(O);
|
|
3603
3799
|
}
|
|
3604
|
-
return [...
|
|
3605
|
-
}, [e]), { minDepth: p, maxDepth:
|
|
3800
|
+
return [...v];
|
|
3801
|
+
}, [e]), { minDepth: p, maxDepth: b } = ne(() => {
|
|
3606
3802
|
if (!h.length) return { minDepth: 0, maxDepth: 0 };
|
|
3607
|
-
const
|
|
3803
|
+
const v = h.map((L) => L.to_depth ?? L.from_depth ?? 0);
|
|
3608
3804
|
return {
|
|
3609
3805
|
minDepth: h[0].from_depth ?? 0,
|
|
3610
|
-
maxDepth: Math.max(...
|
|
3806
|
+
maxDepth: Math.max(...v)
|
|
3611
3807
|
};
|
|
3612
|
-
}, [h]),
|
|
3613
|
-
() => Math.max(1, Math.round((
|
|
3614
|
-
[p,
|
|
3615
|
-
),
|
|
3616
|
-
const
|
|
3617
|
-
return
|
|
3618
|
-
}, [p,
|
|
3808
|
+
}, [h]), N = Wt * We / 5, M = ne(
|
|
3809
|
+
() => Math.max(1, Math.round((b - p) * N)),
|
|
3810
|
+
[p, b, N]
|
|
3811
|
+
), I = ne(() => {
|
|
3812
|
+
const v = _o(We);
|
|
3813
|
+
return yo(p, b, v);
|
|
3814
|
+
}, [p, b]), x = 540 * We / 5, S = ne(
|
|
3619
3815
|
() => Math.max(1, Math.min(10, Math.round(n * l.scale))),
|
|
3620
3816
|
[n, l.scale]
|
|
3621
|
-
),
|
|
3622
|
-
|
|
3623
|
-
const
|
|
3624
|
-
a((
|
|
3625
|
-
const
|
|
3817
|
+
), w = Ue((v) => {
|
|
3818
|
+
v.preventDefault();
|
|
3819
|
+
const L = v.deltaY < 0 ? vt : 1 / vt, O = f.current.getBoundingClientRect(), V = v.clientX - O.left, H = v.clientY - O.top;
|
|
3820
|
+
a((A) => {
|
|
3821
|
+
const E = Math.max(Mo, Math.min(zo, A.scale * L)), z = E / A.scale;
|
|
3626
3822
|
return {
|
|
3627
|
-
scale:
|
|
3628
|
-
tx:
|
|
3629
|
-
ty:
|
|
3823
|
+
scale: E,
|
|
3824
|
+
tx: V - (V - A.tx) * z,
|
|
3825
|
+
ty: H - (H - A.ty) * z
|
|
3630
3826
|
};
|
|
3631
3827
|
});
|
|
3632
3828
|
}, [a]);
|
|
3633
3829
|
se(() => {
|
|
3634
|
-
const
|
|
3635
|
-
if (
|
|
3636
|
-
return
|
|
3637
|
-
}, [
|
|
3638
|
-
const
|
|
3639
|
-
|
|
3640
|
-
x:
|
|
3641
|
-
y:
|
|
3642
|
-
tx:
|
|
3643
|
-
ty:
|
|
3830
|
+
const v = f.current;
|
|
3831
|
+
if (v)
|
|
3832
|
+
return v.addEventListener("wheel", w, { passive: !1 }), () => v.removeEventListener("wheel", w);
|
|
3833
|
+
}, [w]);
|
|
3834
|
+
const D = Ue((v) => {
|
|
3835
|
+
v.button === 0 && (v.preventDefault(), d.current = {
|
|
3836
|
+
x: v.clientX,
|
|
3837
|
+
y: v.clientY,
|
|
3838
|
+
tx: c.current.tx,
|
|
3839
|
+
ty: c.current.ty
|
|
3644
3840
|
}, m(!0));
|
|
3645
3841
|
}, []);
|
|
3646
3842
|
return se(() => {
|
|
3647
|
-
const
|
|
3843
|
+
const v = (O) => {
|
|
3648
3844
|
if (!d.current) return;
|
|
3649
|
-
const { tx:
|
|
3650
|
-
a((
|
|
3651
|
-
...
|
|
3652
|
-
tx:
|
|
3653
|
-
ty:
|
|
3845
|
+
const { tx: V, ty: H, x: A, y: E } = d.current;
|
|
3846
|
+
a((z) => ({
|
|
3847
|
+
...z,
|
|
3848
|
+
tx: V + (O.clientX - A),
|
|
3849
|
+
ty: H + (O.clientY - E)
|
|
3654
3850
|
}));
|
|
3655
|
-
},
|
|
3851
|
+
}, L = () => {
|
|
3656
3852
|
d.current = null, m(!1);
|
|
3657
3853
|
};
|
|
3658
|
-
return window.addEventListener("mousemove",
|
|
3659
|
-
window.removeEventListener("mousemove",
|
|
3854
|
+
return window.addEventListener("mousemove", v), window.addEventListener("mouseup", L), () => {
|
|
3855
|
+
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", L);
|
|
3660
3856
|
};
|
|
3661
3857
|
}, [a]), /* @__PURE__ */ J("div", { className: "core-photo-table", children: [
|
|
3662
3858
|
/* @__PURE__ */ J("div", { className: "core-photo-controls", children: [
|
|
3663
|
-
t && /* @__PURE__ */
|
|
3859
|
+
t && /* @__PURE__ */ P("span", { className: "core-photo-hole-id", children: t }),
|
|
3664
3860
|
/* @__PURE__ */ J("span", { className: "core-photo-zoom-label", children: [
|
|
3665
3861
|
Math.round(l.scale * 100),
|
|
3666
3862
|
"%"
|
|
3667
3863
|
] }),
|
|
3668
|
-
/* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ P(
|
|
3669
3865
|
"button",
|
|
3670
3866
|
{
|
|
3671
3867
|
className: "core-photo-zoom-btn",
|
|
@@ -3677,91 +3873,91 @@ function mo({
|
|
|
3677
3873
|
)
|
|
3678
3874
|
] }),
|
|
3679
3875
|
e.length > 0 && /* @__PURE__ */ J("div", { className: "core-photo-col-headers", children: [
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
y.map((
|
|
3876
|
+
/* @__PURE__ */ P("div", { className: "core-photo-ruler-spacer" }),
|
|
3877
|
+
y.map((v) => /* @__PURE__ */ P(
|
|
3682
3878
|
"div",
|
|
3683
3879
|
{
|
|
3684
3880
|
className: "core-photo-set-header",
|
|
3685
3881
|
style: { width: x },
|
|
3686
|
-
children:
|
|
3882
|
+
children: v
|
|
3687
3883
|
},
|
|
3688
|
-
|
|
3884
|
+
v
|
|
3689
3885
|
))
|
|
3690
3886
|
] }),
|
|
3691
|
-
e.length === 0 ? /* @__PURE__ */
|
|
3887
|
+
e.length === 0 ? /* @__PURE__ */ P("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ P(
|
|
3692
3888
|
"div",
|
|
3693
3889
|
{
|
|
3694
|
-
className: `core-photo-scroll${
|
|
3890
|
+
className: `core-photo-scroll${u ? " is-dragging" : ""}`,
|
|
3695
3891
|
ref: f,
|
|
3696
|
-
onMouseDown:
|
|
3892
|
+
onMouseDown: D,
|
|
3697
3893
|
children: /* @__PURE__ */ J(
|
|
3698
3894
|
"div",
|
|
3699
3895
|
{
|
|
3700
3896
|
className: "core-photo-inner",
|
|
3701
3897
|
style: {
|
|
3702
|
-
height:
|
|
3898
|
+
height: M,
|
|
3703
3899
|
transform: `translate(${l.tx}px, ${l.ty}px) scale(${l.scale})`,
|
|
3704
3900
|
transformOrigin: "0 0"
|
|
3705
3901
|
},
|
|
3706
3902
|
children: [
|
|
3707
|
-
/* @__PURE__ */
|
|
3903
|
+
/* @__PURE__ */ P(
|
|
3708
3904
|
"div",
|
|
3709
3905
|
{
|
|
3710
3906
|
className: "core-photo-depth-ruler",
|
|
3711
|
-
style: { height:
|
|
3712
|
-
children:
|
|
3907
|
+
style: { height: M },
|
|
3908
|
+
children: I.map(({ depth: v, label: L }) => /* @__PURE__ */ P(
|
|
3713
3909
|
"div",
|
|
3714
3910
|
{
|
|
3715
3911
|
className: "core-photo-depth-marker",
|
|
3716
3912
|
style: {
|
|
3717
|
-
top: Math.round((
|
|
3913
|
+
top: Math.round((v - p) * N)
|
|
3718
3914
|
},
|
|
3719
|
-
children:
|
|
3915
|
+
children: L
|
|
3720
3916
|
},
|
|
3721
|
-
|
|
3917
|
+
v
|
|
3722
3918
|
))
|
|
3723
3919
|
}
|
|
3724
3920
|
),
|
|
3725
|
-
y.map((
|
|
3921
|
+
y.map((v) => /* @__PURE__ */ P(
|
|
3726
3922
|
"div",
|
|
3727
3923
|
{
|
|
3728
3924
|
className: "core-photo-col-body",
|
|
3729
|
-
style: { height:
|
|
3730
|
-
children:
|
|
3731
|
-
const
|
|
3732
|
-
(
|
|
3733
|
-
),
|
|
3925
|
+
style: { height: M, width: x },
|
|
3926
|
+
children: g[v].map((L) => {
|
|
3927
|
+
const O = L.from_depth ?? 0, V = L.to_depth ?? O, H = Math.round(
|
|
3928
|
+
(O - p) * N
|
|
3929
|
+
), A = Math.max(
|
|
3734
3930
|
2,
|
|
3735
|
-
Math.round((
|
|
3736
|
-
),
|
|
3931
|
+
Math.round((V - O) * N)
|
|
3932
|
+
), E = po(L, S);
|
|
3737
3933
|
return /* @__PURE__ */ J(
|
|
3738
3934
|
"div",
|
|
3739
3935
|
{
|
|
3740
3936
|
className: "core-photo-item",
|
|
3741
|
-
style: { top:
|
|
3742
|
-
title: `${
|
|
3937
|
+
style: { top: H, height: A, width: x },
|
|
3938
|
+
title: `${O}–${V} m`,
|
|
3743
3939
|
children: [
|
|
3744
|
-
|
|
3940
|
+
E ? /* @__PURE__ */ P(
|
|
3745
3941
|
"img",
|
|
3746
3942
|
{
|
|
3747
|
-
src:
|
|
3748
|
-
alt: `Core ${
|
|
3943
|
+
src: E,
|
|
3944
|
+
alt: `Core ${O}–${V} m`,
|
|
3749
3945
|
loading: "lazy"
|
|
3750
3946
|
}
|
|
3751
|
-
) : /* @__PURE__ */
|
|
3752
|
-
|
|
3753
|
-
|
|
3947
|
+
) : /* @__PURE__ */ P("div", { className: "core-photo-no-image" }),
|
|
3948
|
+
A >= 18 && /* @__PURE__ */ J("span", { className: "core-photo-item-label", children: [
|
|
3949
|
+
O,
|
|
3754
3950
|
"–",
|
|
3755
|
-
|
|
3951
|
+
V,
|
|
3756
3952
|
" m"
|
|
3757
3953
|
] })
|
|
3758
3954
|
]
|
|
3759
3955
|
},
|
|
3760
|
-
`${
|
|
3956
|
+
`${L.hole_id ?? ""}-${O}-${V}-${v}`
|
|
3761
3957
|
);
|
|
3762
3958
|
})
|
|
3763
3959
|
},
|
|
3764
|
-
|
|
3960
|
+
v
|
|
3765
3961
|
))
|
|
3766
3962
|
]
|
|
3767
3963
|
}
|
|
@@ -3770,33 +3966,33 @@ function mo({
|
|
|
3770
3966
|
)
|
|
3771
3967
|
] });
|
|
3772
3968
|
}
|
|
3773
|
-
function
|
|
3969
|
+
function wi({
|
|
3774
3970
|
holeId: e = "",
|
|
3775
3971
|
trays: t = [],
|
|
3776
3972
|
thumbBaseUrl: n = "",
|
|
3777
3973
|
fullBaseUrl: r = "",
|
|
3778
3974
|
photoSet: o = "Tray Images",
|
|
3779
|
-
getFilename: i =
|
|
3975
|
+
getFilename: i = Kt,
|
|
3780
3976
|
initialZoom: s = 5,
|
|
3781
3977
|
transform: l,
|
|
3782
|
-
onTransformChange:
|
|
3978
|
+
onTransformChange: c
|
|
3783
3979
|
}) {
|
|
3784
3980
|
const a = ne(
|
|
3785
|
-
() =>
|
|
3981
|
+
() => No(e, t, n, r, o, i),
|
|
3786
3982
|
[e, t, n, r, o, i]
|
|
3787
3983
|
);
|
|
3788
|
-
return /* @__PURE__ */
|
|
3789
|
-
|
|
3984
|
+
return /* @__PURE__ */ P(
|
|
3985
|
+
vo,
|
|
3790
3986
|
{
|
|
3791
3987
|
photos: a,
|
|
3792
3988
|
holeId: e,
|
|
3793
3989
|
initialZoom: s,
|
|
3794
3990
|
transform: l,
|
|
3795
|
-
onTransformChange:
|
|
3991
|
+
onTransformChange: c
|
|
3796
3992
|
}
|
|
3797
3993
|
);
|
|
3798
3994
|
}
|
|
3799
|
-
function
|
|
3995
|
+
function Ti(e) {
|
|
3800
3996
|
const t = typeof e == "string" ? JSON.parse(e) : e;
|
|
3801
3997
|
if (t.schema_version !== "1.0")
|
|
3802
3998
|
throw new Error(
|
|
@@ -3824,7 +4020,7 @@ function ki(e) {
|
|
|
3824
4020
|
blocks: n
|
|
3825
4021
|
};
|
|
3826
4022
|
}
|
|
3827
|
-
function
|
|
4023
|
+
function Eo(e) {
|
|
3828
4024
|
const t = new _.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
|
|
3829
4025
|
e.vertices.forEach(([o, i, s], l) => {
|
|
3830
4026
|
n[l * 3] = o, n[l * 3 + 1] = i, n[l * 3 + 2] = s;
|
|
@@ -3834,17 +4030,17 @@ function fo(e) {
|
|
|
3834
4030
|
r[l * 3] = o, r[l * 3 + 1] = i, r[l * 3 + 2] = s;
|
|
3835
4031
|
}), t.setIndex(new _.BufferAttribute(r, 1)), t;
|
|
3836
4032
|
}
|
|
3837
|
-
function
|
|
4033
|
+
function $i(e, t, n = {}) {
|
|
3838
4034
|
const { defaultOpacity: r = 1 } = n, o = new _.Group();
|
|
3839
4035
|
return t.blocks.forEach((i) => {
|
|
3840
|
-
var
|
|
3841
|
-
const s =
|
|
4036
|
+
var g, y;
|
|
4037
|
+
const s = Eo(i), l = ((g = i.material) == null ? void 0 : g.color) ?? "#888888", c = ((y = i.material) == null ? void 0 : y.opacity) ?? r, a = c < 1, u = new _.MeshStandardMaterial({
|
|
3842
4038
|
color: new _.Color(l),
|
|
3843
|
-
opacity:
|
|
4039
|
+
opacity: c,
|
|
3844
4040
|
transparent: a,
|
|
3845
4041
|
side: _.DoubleSide,
|
|
3846
4042
|
flatShading: !0
|
|
3847
|
-
}), m = new _.Mesh(s,
|
|
4043
|
+
}), m = new _.Mesh(s, u);
|
|
3848
4044
|
m.userData = {
|
|
3849
4045
|
id: i.id,
|
|
3850
4046
|
attributes: i.attributes
|
|
@@ -3854,169 +4050,180 @@ function Ai(e, t, n = {}) {
|
|
|
3854
4050
|
}), e.add(o), o;
|
|
3855
4051
|
}
|
|
3856
4052
|
export {
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
4053
|
+
fr as ASSAY_COLOR_PALETTE_10,
|
|
4054
|
+
hn as ASSAY_NON_VALUE_FIELDS,
|
|
4055
|
+
X as AZIMUTH,
|
|
3860
4056
|
qn as BASELODE_COLORWAY,
|
|
3861
4057
|
T as BASELODE_DARK,
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
4058
|
+
Ni as BASELODE_DARK_TEMPLATE,
|
|
4059
|
+
_i as BASELODE_DARK_TEMPLATE_NAME,
|
|
4060
|
+
To as BASELODE_DATA_MODEL_DRILL_ASSAY,
|
|
4061
|
+
Fo as BASELODE_DATA_MODEL_DRILL_COLLAR,
|
|
4062
|
+
mn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
|
|
4063
|
+
wo as BASELODE_DATA_MODEL_DRILL_SURVEY,
|
|
4064
|
+
$o as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
|
|
4065
|
+
B as BASELODE_LIGHT,
|
|
4066
|
+
yi as BASELODE_LIGHT_TEMPLATE,
|
|
4067
|
+
gi as BASELODE_LIGHT_TEMPLATE_NAME,
|
|
4068
|
+
Oe as BASELODE_TEMPLATE,
|
|
4069
|
+
Xn as BASELODE_TEMPLATE_NAME,
|
|
4070
|
+
Wt as BASE_PIXELS_PER_METRE,
|
|
4071
|
+
Xe as BUILTIN_COLOUR_MAPS,
|
|
4072
|
+
Li as Baselode3DControls,
|
|
4073
|
+
Di as Baselode3DScene,
|
|
4074
|
+
Pi as BlockModelWidget,
|
|
4075
|
+
at as CHART_OPTIONS,
|
|
4076
|
+
zn as COMMENT_COLUMN_NAMES,
|
|
4077
|
+
Be as COMMODITY_COLOURS,
|
|
3882
4078
|
Et as CRS,
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
4079
|
+
vo as CorePhotoTable,
|
|
4080
|
+
wi as CorePhotoViewer,
|
|
4081
|
+
fn as DEFAULT_COLUMN_MAP,
|
|
4082
|
+
ho as DEFAULT_LOD_BREAKPOINTS,
|
|
3887
4083
|
W as DEPTH,
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
4084
|
+
q as DIP,
|
|
4085
|
+
Le as DISPLAY_CATEGORICAL,
|
|
4086
|
+
ke as DISPLAY_COMMENT,
|
|
3891
4087
|
$e as DISPLAY_HIDDEN,
|
|
3892
|
-
|
|
4088
|
+
Ae as DISPLAY_NUMERIC,
|
|
3893
4089
|
Je as DISPLAY_TADPOLE,
|
|
3894
4090
|
pe as EASTING,
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
4091
|
+
xe as ELEVATION,
|
|
4092
|
+
nr as ERROR_COLOR,
|
|
4093
|
+
Zn as FALLBACK_COLOUR,
|
|
4094
|
+
jr as FOV_MAX_DEG,
|
|
4095
|
+
Hr as FOV_MIN_DEG,
|
|
4096
|
+
F as FROM,
|
|
3901
4097
|
ae as GEOLOGY_CODE,
|
|
3902
4098
|
ce as GEOLOGY_DESCRIPTION,
|
|
3903
|
-
|
|
3904
|
-
|
|
4099
|
+
ct as HIDDEN_COLUMNS,
|
|
4100
|
+
k as HOLE_ID,
|
|
3905
4101
|
oe as LATITUDE,
|
|
3906
|
-
|
|
4102
|
+
Wn as LITHOLOGY_COLOURS,
|
|
3907
4103
|
ie as LONGITUDE,
|
|
3908
4104
|
Ie as MID,
|
|
3909
4105
|
be as NORTHING,
|
|
3910
|
-
|
|
3911
|
-
|
|
4106
|
+
Qn as NUMERIC_LINE_COLOR,
|
|
4107
|
+
er as NUMERIC_MARKER_COLOR,
|
|
3912
4108
|
me as PROJECT_ID,
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
4109
|
+
dn as STRIKE,
|
|
4110
|
+
$ as TO,
|
|
4111
|
+
Ei as TracePlot,
|
|
4112
|
+
$i as addGradeBlocksToScene,
|
|
4113
|
+
Ir as addRasterOverlay,
|
|
4114
|
+
Un as alphaBetaToNormal,
|
|
4115
|
+
Ci as annotationsFromIntervals,
|
|
4116
|
+
li as assembleDataset,
|
|
4117
|
+
Jo as attachAssayPositions,
|
|
4118
|
+
Wo as balancedTangentialDesurvey,
|
|
4119
|
+
kn as buildAssayState,
|
|
4120
|
+
Mi as buildCategoricalStripLogConfig,
|
|
4121
|
+
ur as buildCommentsConfig,
|
|
4122
|
+
yo as buildDepthMarkers,
|
|
4123
|
+
hr as buildEqualRangeColorScale,
|
|
4124
|
+
ir as buildIntervalPoints,
|
|
3928
4125
|
Tt as buildPlotConfig,
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
4126
|
+
vi as buildStrikeDipSymbol,
|
|
4127
|
+
zr as buildStructuralDiscs,
|
|
4128
|
+
zi as buildStructuralStripConfig,
|
|
4129
|
+
cr as buildTadpoleConfig,
|
|
4130
|
+
Ko as buildTraces,
|
|
4131
|
+
No as buildTrayPhotos,
|
|
4132
|
+
st as buildViewSignature,
|
|
4133
|
+
di as calculateBlockVolume,
|
|
4134
|
+
wn as calculatePropertyStats,
|
|
4135
|
+
vn as classifyColumns,
|
|
4136
|
+
Pr as clearRasterOverlays,
|
|
4137
|
+
si as coerceNumeric,
|
|
4138
|
+
Yn as computeStructuralPositions,
|
|
4139
|
+
Si as createRasterOverlay,
|
|
4140
|
+
Uo as defaultChartType,
|
|
4141
|
+
Kt as defaultTrayFilename,
|
|
4142
|
+
Fi as depthIntervalToPixels,
|
|
4143
|
+
_o as depthMarkerInterval,
|
|
4144
|
+
Re as deriveAssayProps,
|
|
4145
|
+
qo as desurveyTraces,
|
|
4146
|
+
Mr as dipAzimuthToNormal,
|
|
4147
|
+
Br as dolly,
|
|
4148
|
+
wr as emitViewChangeIfNeeded,
|
|
3950
4149
|
Tn as filterBlocks,
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
4150
|
+
ii as filterByProject,
|
|
4151
|
+
lt as fitCameraToBounds,
|
|
4152
|
+
Vr as focusOnLastBounds,
|
|
4153
|
+
ui as getBlockStats,
|
|
4154
|
+
qr as getCategoryHexColor,
|
|
3956
4155
|
et as getChartOptions,
|
|
3957
|
-
|
|
3958
|
-
|
|
4156
|
+
$n as getColorForValue,
|
|
4157
|
+
Kn as getColour,
|
|
3959
4158
|
Vt as getEqualRangeBinIndex,
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
4159
|
+
br as getEqualRangeColor,
|
|
4160
|
+
Dr as getRasterOverlay,
|
|
4161
|
+
Ut as getViewState,
|
|
4162
|
+
Eo as gradeBlockToThreeGeometry,
|
|
4163
|
+
go as groupPhotosBySet,
|
|
3964
4164
|
Bn as groupRowsByHole,
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
4165
|
+
or as holeHasData,
|
|
4166
|
+
Gn as interpolateTrace,
|
|
4167
|
+
Oi as intervalsAsTubes,
|
|
4168
|
+
oi as joinAssaysToTraces,
|
|
4169
|
+
Lr as listRasterOverlays,
|
|
4170
|
+
Yo as loadAssayFile,
|
|
4171
|
+
xn as loadAssayHole,
|
|
3971
4172
|
En as loadAssayMetadata,
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
4173
|
+
ni as loadAssays,
|
|
4174
|
+
ci as loadBlockModelMetadata,
|
|
4175
|
+
ei as loadCollars,
|
|
4176
|
+
ri as loadGeology,
|
|
4177
|
+
Ti as loadGradeBlocksFromJson,
|
|
4178
|
+
ti as loadSurveys,
|
|
3978
4179
|
je as loadTable,
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
4180
|
+
Vo as logDataInfo,
|
|
4181
|
+
Bo as logDataWarning,
|
|
4182
|
+
$r as lookDown,
|
|
4183
|
+
On as minimumCurvatureDesurvey,
|
|
4184
|
+
Fn as normalizeBlockRow,
|
|
4185
|
+
kr as normalizeBounds,
|
|
4186
|
+
jo as normalizeCsvRow,
|
|
4187
|
+
we as normalizeFieldName,
|
|
4188
|
+
Rr as pan,
|
|
3987
4189
|
Hn as parseAssayCsvTextToHoles,
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
4190
|
+
_n as parseAssayHole,
|
|
4191
|
+
Ho as parseAssayHoleIds,
|
|
4192
|
+
yn as parseAssayHoleIdsWithAssays,
|
|
4193
|
+
Nn as parseAssaysCSV,
|
|
4194
|
+
ai as parseBlockModelCSV,
|
|
4195
|
+
Qo as parseDrillholesCSV,
|
|
4196
|
+
jn as parseGeologyCsvText,
|
|
3995
4197
|
Vn as parseStructuralCSV,
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4198
|
+
hi as parseStructuralIntervalsCSV,
|
|
4199
|
+
fi as parseStructuralPointsCSV,
|
|
4200
|
+
Xo as parseSurveyCSV,
|
|
4201
|
+
pi as parseUnifiedDataset,
|
|
4202
|
+
Go as pickFirstPresent,
|
|
4203
|
+
ki as planView,
|
|
4204
|
+
gr as projectTraceToSection,
|
|
4205
|
+
Tr as recenterCameraToOrigin,
|
|
4206
|
+
it as removeRasterOverlay,
|
|
4004
4207
|
Ct as reorderHoleIds,
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4208
|
+
Jn as resolveColourMap,
|
|
4209
|
+
Ai as sectionView,
|
|
4210
|
+
yr as sectionWindow,
|
|
4211
|
+
po as selectPhotoLodUrl,
|
|
4212
|
+
Ur as setControlMode,
|
|
4213
|
+
Gr as setFov,
|
|
4214
|
+
Sr as setRasterOverlayElevation,
|
|
4215
|
+
Or as setRasterOverlayOpacity,
|
|
4216
|
+
Cr as setRasterOverlayVisibility,
|
|
4217
|
+
Fr as setViewState,
|
|
4218
|
+
bi as significantIntercepts,
|
|
4219
|
+
bo as sortPhotosByDepth,
|
|
4013
4220
|
ge as standardizeColumns,
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4221
|
+
Ro as standardizeRowArray,
|
|
4222
|
+
Zo as tangentialDesurvey,
|
|
4223
|
+
pn as toError,
|
|
4224
|
+
Ii as tracesAsSegments,
|
|
4225
|
+
xi as useDrillholeTraceGrid,
|
|
4226
|
+
mi as validateStructuralPoints,
|
|
4020
4227
|
Y as withDataErrorContext
|
|
4021
4228
|
};
|
|
4022
4229
|
//# sourceMappingURL=baselode.js.map
|