baselode 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -31
- package/dist/baselode.js +1838 -1544
- package/dist/baselode.js.map +1 -1
- package/package.json +1 -1
package/dist/baselode.js
CHANGED
|
@@ -1,107 +1,139 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
1
|
+
import K from "papaparse";
|
|
2
|
+
import { jsx as $, jsxs as Q } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as pt, useState as J, useEffect as me, useMemo as He } from "react";
|
|
4
|
+
import Pe from "plotly.js-dist-min";
|
|
5
5
|
import * as N from "three";
|
|
6
|
-
import { OrbitControls as
|
|
7
|
-
import { FlyControls as
|
|
8
|
-
import { ViewportGizmo as
|
|
9
|
-
|
|
6
|
+
import { OrbitControls as Xt } from "three/examples/jsm/controls/OrbitControls";
|
|
7
|
+
import { FlyControls as Wt } from "three/examples/jsm/controls/FlyControls";
|
|
8
|
+
import { ViewportGizmo as Zt } from "three-viewport-gizmo";
|
|
9
|
+
import { EffectComposer as Kt } from "three/examples/jsm/postprocessing/EffectComposer.js";
|
|
10
|
+
import { RenderPass as Jt } from "three/examples/jsm/postprocessing/RenderPass.js";
|
|
11
|
+
import { OutlinePass as Qt } from "three/examples/jsm/postprocessing/OutlinePass.js";
|
|
12
|
+
const z = "hole_id", te = "latitude", ne = "longitude", Me = "elevation", R = "azimuth", B = "dip", S = "from", D = "to", Ee = "mid", ae = "project_id", de = "easting", fe = "northing", bt = "crs", q = "depth", gt = "alpha", yt = "beta", en = "strike", oe = "geology_code", ie = "geology_description", Wr = {
|
|
10
13
|
// A unique hole identifier across the entire dataset and all future data sets
|
|
11
|
-
[
|
|
14
|
+
[z]: "string",
|
|
12
15
|
// The hole ID from the original collar source
|
|
13
16
|
datasource_hole_id: "string",
|
|
14
17
|
// The project ID or project code from the original collar source, if available
|
|
15
|
-
[
|
|
18
|
+
[ae]: "string",
|
|
16
19
|
// The latitude of the collar, in decimal degrees (WGS84)
|
|
17
20
|
[te]: "number",
|
|
18
21
|
// The longitude of the collar, in decimal degrees (WGS84)
|
|
19
22
|
[ne]: "number",
|
|
20
23
|
// The elevation of the collar, in meters above sea level (WGS84)
|
|
21
|
-
[
|
|
24
|
+
[Me]: "number",
|
|
22
25
|
// The easting coordinate of the collar, in meters (projected CRS)
|
|
23
|
-
[
|
|
26
|
+
[de]: "number",
|
|
24
27
|
// The northing coordinate of the collar, in meters (projected CRS)
|
|
25
|
-
[
|
|
28
|
+
[fe]: "number",
|
|
26
29
|
// The coordinate reference system of the collar coordinates for easting/northing, as an EPSG code or proj string
|
|
27
|
-
[
|
|
28
|
-
},
|
|
30
|
+
[bt]: "string"
|
|
31
|
+
}, Zr = {
|
|
29
32
|
// The unique hole id that maps to the collar and any other data tables
|
|
30
|
-
[
|
|
33
|
+
[z]: "string",
|
|
31
34
|
// The depth along the hole where the survey measurement was taken / started
|
|
32
|
-
[
|
|
35
|
+
[q]: "number",
|
|
33
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)
|
|
34
|
-
[
|
|
37
|
+
[D]: "number",
|
|
35
38
|
// The azimuth of the hole at the survey depth, in degrees from north
|
|
36
|
-
[
|
|
39
|
+
[R]: "number",
|
|
37
40
|
// The dip of the hole at the survey depth, in degrees from horizontal (negative values indicate downward inclination)
|
|
38
41
|
[B]: "number"
|
|
39
|
-
},
|
|
42
|
+
}, Kr = {
|
|
40
43
|
// The unique hole id that maps to the collar and any other data tables
|
|
41
|
-
[
|
|
44
|
+
[z]: "string",
|
|
42
45
|
// The depth along the hole where the assay interval starts
|
|
43
|
-
[
|
|
46
|
+
[S]: "number",
|
|
44
47
|
// The depth along the hole where the assay interval ends
|
|
45
|
-
[
|
|
48
|
+
[D]: "number",
|
|
46
49
|
// The midpoint depth of the assay interval
|
|
47
|
-
[
|
|
50
|
+
[Ee]: "number"
|
|
48
51
|
// assay value columns are variable and not standardized here.
|
|
49
52
|
// Assays may be flattened (one column per assay type) or long (one row per assay type with an additional 'assay_type' column)
|
|
50
|
-
},
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
+
}, tn = {
|
|
54
|
+
[z]: "string",
|
|
55
|
+
[S]: "number",
|
|
56
|
+
[D]: "number",
|
|
57
|
+
[Ee]: "number",
|
|
58
|
+
[oe]: "string",
|
|
59
|
+
[ie]: "string"
|
|
60
|
+
}, Jr = {
|
|
61
|
+
[z]: "string",
|
|
62
|
+
[q]: "number",
|
|
53
63
|
[B]: "number",
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
64
|
+
[R]: "number",
|
|
65
|
+
[gt]: "number",
|
|
66
|
+
[yt]: "number",
|
|
57
67
|
comments: "string"
|
|
58
|
-
},
|
|
59
|
-
[
|
|
68
|
+
}, nn = {
|
|
69
|
+
[z]: ["hole_id", "holeid", "hole id", "hole-id"],
|
|
60
70
|
datasource_hole_id: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
|
|
61
|
-
[
|
|
71
|
+
[ae]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
|
|
62
72
|
[te]: ["latitude", "lat"],
|
|
63
73
|
[ne]: ["longitude", "lon"],
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
74
|
+
[Me]: ["elevation", "rl", "elev", "z"],
|
|
75
|
+
[de]: ["easting", "x"],
|
|
76
|
+
[fe]: ["northing", "y"],
|
|
77
|
+
[bt]: ["crs", "epsg", "projection"],
|
|
78
|
+
[S]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
|
|
79
|
+
[D]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
|
|
80
|
+
[oe]: [
|
|
81
|
+
"geology_code",
|
|
82
|
+
"geologycode",
|
|
83
|
+
"lith1",
|
|
84
|
+
"lith1code",
|
|
85
|
+
"lith1_code",
|
|
86
|
+
"lithology",
|
|
87
|
+
"plot_lithology",
|
|
88
|
+
"rock1"
|
|
89
|
+
],
|
|
90
|
+
[ie]: [
|
|
91
|
+
"geology_description",
|
|
92
|
+
"geologydescription",
|
|
93
|
+
"geology_comment",
|
|
94
|
+
"geologycomment",
|
|
95
|
+
"geology comment",
|
|
96
|
+
"lithology_comment",
|
|
97
|
+
"lithology comment",
|
|
98
|
+
"description",
|
|
99
|
+
"comments"
|
|
100
|
+
],
|
|
101
|
+
[R]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
|
|
71
102
|
[B]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
|
|
75
|
-
[
|
|
76
|
-
|
|
77
|
-
|
|
103
|
+
[gt]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
|
|
104
|
+
[yt]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
|
|
105
|
+
declination: ["declination", "dec"],
|
|
106
|
+
[q]: ["depth", "survey_depth", "surveydepth"],
|
|
107
|
+
[en]: ["strike", "str"]
|
|
108
|
+
}, _t = {};
|
|
109
|
+
for (const [e, t] of Object.entries(nn))
|
|
78
110
|
for (const n of t) {
|
|
79
111
|
const r = n.toLowerCase().trim();
|
|
80
|
-
|
|
112
|
+
_t[r] = e;
|
|
81
113
|
}
|
|
82
|
-
function
|
|
114
|
+
function Ce(e) {
|
|
83
115
|
return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
|
|
84
116
|
}
|
|
85
|
-
function
|
|
86
|
-
const r = { ...
|
|
117
|
+
function he(e, t = null, n = null) {
|
|
118
|
+
const r = { ..._t };
|
|
87
119
|
if (n) {
|
|
88
|
-
for (const [
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
r[
|
|
120
|
+
for (const [i, s] of Object.entries(n))
|
|
121
|
+
if (i != null && s != null) {
|
|
122
|
+
const l = Ce(i), c = Ce(s);
|
|
123
|
+
r[l] = c;
|
|
92
124
|
}
|
|
93
125
|
}
|
|
94
126
|
const o = {};
|
|
95
|
-
for (const [
|
|
96
|
-
const
|
|
97
|
-
o[
|
|
127
|
+
for (const [i, s] of Object.entries(e)) {
|
|
128
|
+
const l = Ce(i), c = r[l] || l;
|
|
129
|
+
o[c] = s;
|
|
98
130
|
}
|
|
99
131
|
return o;
|
|
100
132
|
}
|
|
101
|
-
function
|
|
102
|
-
return e.map((r) =>
|
|
133
|
+
function Qr(e, t = null, n = null) {
|
|
134
|
+
return e.map((r) => he(r, t, n));
|
|
103
135
|
}
|
|
104
|
-
const
|
|
136
|
+
const rn = /* @__PURE__ */ new Set([
|
|
105
137
|
"hole_id",
|
|
106
138
|
"holeid",
|
|
107
139
|
"id",
|
|
@@ -133,153 +165,153 @@ const Ht = /* @__PURE__ */ new Set([
|
|
|
133
165
|
"todepth",
|
|
134
166
|
"comment",
|
|
135
167
|
"z"
|
|
136
|
-
]),
|
|
137
|
-
function
|
|
168
|
+
]), Be = "[baselode:data]";
|
|
169
|
+
function on(e, t = "Unknown error") {
|
|
138
170
|
if (e instanceof Error) return e;
|
|
139
171
|
const n = typeof e == "string" && e.trim() ? e : t;
|
|
140
172
|
return new Error(n);
|
|
141
173
|
}
|
|
142
174
|
function w(e, t, n = "Operation failed") {
|
|
143
|
-
const r =
|
|
175
|
+
const r = on(t, n), o = new Error(`${e}: ${r.message}`);
|
|
144
176
|
return o.cause = r, o;
|
|
145
177
|
}
|
|
146
|
-
function
|
|
178
|
+
function eo(e, t) {
|
|
147
179
|
if (t !== void 0) {
|
|
148
|
-
console.warn(`${
|
|
180
|
+
console.warn(`${Be} ${e}`, t);
|
|
149
181
|
return;
|
|
150
182
|
}
|
|
151
|
-
console.warn(`${
|
|
183
|
+
console.warn(`${Be} ${e}`);
|
|
152
184
|
}
|
|
153
|
-
function
|
|
154
|
-
console.info(`${
|
|
185
|
+
function to(e) {
|
|
186
|
+
console.info(`${Be} ${e}`);
|
|
155
187
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
return { holeId: e[
|
|
188
|
+
const Te = (e, t = null) => he(e, null, t);
|
|
189
|
+
function sn(e) {
|
|
190
|
+
return { holeId: e[z] };
|
|
159
191
|
}
|
|
160
|
-
function
|
|
161
|
-
const n = e[
|
|
192
|
+
function Nt(e, t = null) {
|
|
193
|
+
const n = e[z], r = n !== void 0 ? `${n}`.trim() : "";
|
|
162
194
|
if (!r) return null;
|
|
163
|
-
const o = e[
|
|
164
|
-
return !Number.isFinite(
|
|
195
|
+
const o = e[ae] || e.project || e.project_code, i = Number(e[S]), s = Number(e[D]);
|
|
196
|
+
return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
|
|
165
197
|
holeId: r,
|
|
166
198
|
project: o,
|
|
167
|
-
from:
|
|
168
|
-
to:
|
|
199
|
+
from: i,
|
|
200
|
+
to: s,
|
|
169
201
|
...e
|
|
170
202
|
};
|
|
171
203
|
}
|
|
172
|
-
function
|
|
204
|
+
function zt(e, t) {
|
|
173
205
|
var o;
|
|
174
|
-
const n = t.sort((
|
|
175
|
-
return n.forEach((
|
|
176
|
-
const { from:
|
|
177
|
-
z:
|
|
178
|
-
from:
|
|
179
|
-
to:
|
|
180
|
-
[
|
|
181
|
-
[
|
|
182
|
-
...
|
|
206
|
+
const n = t.sort((i, s) => i.from - s.from), r = [];
|
|
207
|
+
return n.forEach((i) => {
|
|
208
|
+
const { from: s, to: l, project: c, ...a } = i, u = {
|
|
209
|
+
z: s,
|
|
210
|
+
from: s,
|
|
211
|
+
to: l,
|
|
212
|
+
[z]: e,
|
|
213
|
+
[ae]: c,
|
|
214
|
+
...a
|
|
183
215
|
};
|
|
184
|
-
r.push(
|
|
216
|
+
r.push(u), r.push({ ...u, z: l });
|
|
185
217
|
}), { id: e, project: (o = n[0]) == null ? void 0 : o.project, points: r };
|
|
186
218
|
}
|
|
187
|
-
function
|
|
219
|
+
function no(e, t = null) {
|
|
188
220
|
return new Promise((n, r) => {
|
|
189
221
|
const o = /* @__PURE__ */ new Set();
|
|
190
|
-
|
|
222
|
+
K.parse(e, {
|
|
191
223
|
header: !0,
|
|
192
224
|
dynamicTyping: !0,
|
|
193
225
|
skipEmptyLines: !0,
|
|
194
|
-
step: (
|
|
195
|
-
const
|
|
196
|
-
|
|
226
|
+
step: (i) => {
|
|
227
|
+
const l = Te(i.data, t)[z];
|
|
228
|
+
l !== void 0 && `${l}`.trim() !== "" && o.add(`${l}`.trim());
|
|
197
229
|
},
|
|
198
230
|
complete: () => n(Array.from(o)),
|
|
199
|
-
error: (
|
|
231
|
+
error: (i) => r(w("parseAssayHoleIds", i))
|
|
200
232
|
});
|
|
201
233
|
});
|
|
202
234
|
}
|
|
203
|
-
function
|
|
204
|
-
return Object.entries(e || {}).some(([t, n]) => !(
|
|
235
|
+
function ln(e) {
|
|
236
|
+
return Object.entries(e || {}).some(([t, n]) => !(rn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
|
|
205
237
|
}
|
|
206
|
-
function
|
|
238
|
+
function an(e, t = null) {
|
|
207
239
|
return new Promise((n, r) => {
|
|
208
240
|
const o = /* @__PURE__ */ new Map();
|
|
209
|
-
|
|
241
|
+
K.parse(e, {
|
|
210
242
|
header: !0,
|
|
211
243
|
dynamicTyping: !0,
|
|
212
244
|
skipEmptyLines: !0,
|
|
213
|
-
step: (
|
|
214
|
-
const
|
|
215
|
-
if (!
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
const
|
|
219
|
-
o.has(
|
|
220
|
-
holeId:
|
|
245
|
+
step: (i) => {
|
|
246
|
+
const s = Te(i.data, t);
|
|
247
|
+
if (!ln(s)) return;
|
|
248
|
+
const c = sn(s).holeId;
|
|
249
|
+
if (c !== void 0 && `${c}`.trim() !== "") {
|
|
250
|
+
const a = `${c}`.trim();
|
|
251
|
+
o.has(a) || o.set(a, {
|
|
252
|
+
holeId: a
|
|
221
253
|
});
|
|
222
254
|
}
|
|
223
255
|
},
|
|
224
256
|
complete: () => n(Array.from(o.values())),
|
|
225
|
-
error: (
|
|
257
|
+
error: (i) => r(w("parseAssayHoleIdsWithAssays", i))
|
|
226
258
|
});
|
|
227
259
|
});
|
|
228
260
|
}
|
|
229
|
-
function
|
|
230
|
-
return new Promise((o,
|
|
231
|
-
const
|
|
232
|
-
if (!
|
|
233
|
-
|
|
261
|
+
function cn(e, t, n = null, r = null) {
|
|
262
|
+
return new Promise((o, i) => {
|
|
263
|
+
const s = `${t}`.trim();
|
|
264
|
+
if (!s) {
|
|
265
|
+
i(w("parseAssayHole", new Error("Missing hole id")));
|
|
234
266
|
return;
|
|
235
267
|
}
|
|
236
|
-
const
|
|
237
|
-
|
|
268
|
+
const l = [];
|
|
269
|
+
K.parse(e, {
|
|
238
270
|
header: !0,
|
|
239
271
|
dynamicTyping: !0,
|
|
240
272
|
skipEmptyLines: !0,
|
|
241
|
-
step: (
|
|
242
|
-
const
|
|
243
|
-
|
|
273
|
+
step: (c) => {
|
|
274
|
+
const a = Te(c.data, r), u = Nt(a, r);
|
|
275
|
+
u && `${u.holeId}`.trim() === s && l.push(u);
|
|
244
276
|
},
|
|
245
277
|
complete: () => {
|
|
246
|
-
if (!
|
|
278
|
+
if (!l.length) {
|
|
247
279
|
o(null);
|
|
248
280
|
return;
|
|
249
281
|
}
|
|
250
|
-
const
|
|
251
|
-
o(
|
|
282
|
+
const c = zt(s, l);
|
|
283
|
+
o(c);
|
|
252
284
|
},
|
|
253
|
-
error: (
|
|
285
|
+
error: (c) => i(w("parseAssayHole", c))
|
|
254
286
|
});
|
|
255
287
|
});
|
|
256
288
|
}
|
|
257
|
-
function
|
|
289
|
+
function un(e, t = null, n = null) {
|
|
258
290
|
return new Promise((r, o) => {
|
|
259
|
-
|
|
291
|
+
K.parse(e, {
|
|
260
292
|
header: !0,
|
|
261
293
|
dynamicTyping: !0,
|
|
262
294
|
skipEmptyLines: !0,
|
|
263
|
-
complete: (
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
|
|
295
|
+
complete: (i) => {
|
|
296
|
+
const s = /* @__PURE__ */ new Map();
|
|
297
|
+
i.data.forEach((c) => {
|
|
298
|
+
const a = Te(c, n), u = Nt(a, n);
|
|
299
|
+
u && (s.has(u.holeId) || s.set(u.holeId, []), s.get(u.holeId).push(u));
|
|
268
300
|
});
|
|
269
|
-
const
|
|
270
|
-
r({ holes:
|
|
301
|
+
const l = Array.from(s.entries()).map(([c, a]) => zt(c, a));
|
|
302
|
+
r({ holes: l });
|
|
271
303
|
},
|
|
272
|
-
error: (
|
|
304
|
+
error: (i) => o(w("parseAssaysCSV", i))
|
|
273
305
|
});
|
|
274
306
|
});
|
|
275
307
|
}
|
|
276
|
-
function
|
|
308
|
+
function ro(e = {}) {
|
|
277
309
|
const t = {};
|
|
278
310
|
return Object.entries(e || {}).forEach(([n, r]) => {
|
|
279
|
-
n && (t[
|
|
311
|
+
n && (t[Ce(n)] = r);
|
|
280
312
|
}), t;
|
|
281
313
|
}
|
|
282
|
-
function
|
|
314
|
+
function oo(e = {}, t = [], n) {
|
|
283
315
|
for (const r of t) {
|
|
284
316
|
const o = e[r];
|
|
285
317
|
if (o != null && `${o}`.trim() !== "")
|
|
@@ -287,16 +319,16 @@ function Mr(e = {}, t = [], n) {
|
|
|
287
319
|
}
|
|
288
320
|
return n;
|
|
289
321
|
}
|
|
290
|
-
const
|
|
291
|
-
function
|
|
322
|
+
const mn = 4;
|
|
323
|
+
function Mt(e = [], t = "") {
|
|
292
324
|
if (!e.length) return [];
|
|
293
325
|
if (!t) return e;
|
|
294
|
-
const n = e.findIndex((
|
|
326
|
+
const n = e.findIndex((i) => i === t);
|
|
295
327
|
if (n === -1) return e;
|
|
296
|
-
const r = e[n], o = e.filter((
|
|
328
|
+
const r = e[n], o = e.filter((i, s) => s !== n);
|
|
297
329
|
return [r, ...o];
|
|
298
330
|
}
|
|
299
|
-
function
|
|
331
|
+
function Oe({
|
|
300
332
|
property: e = "",
|
|
301
333
|
chartType: t = "",
|
|
302
334
|
categoricalProps: n = [],
|
|
@@ -305,49 +337,49 @@ function Ae({
|
|
|
305
337
|
} = {}) {
|
|
306
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;
|
|
307
339
|
}
|
|
308
|
-
function
|
|
340
|
+
function xt({
|
|
309
341
|
holeIds: e = [],
|
|
310
342
|
focusedHoleId: t = "",
|
|
311
|
-
plotCount: n =
|
|
343
|
+
plotCount: n = mn,
|
|
312
344
|
defaultProp: r = "",
|
|
313
345
|
categoricalProps: o = [],
|
|
314
|
-
commentProps:
|
|
315
|
-
numericDefaultChartType:
|
|
346
|
+
commentProps: i = [],
|
|
347
|
+
numericDefaultChartType: s = "markers+line"
|
|
316
348
|
} = {}) {
|
|
317
|
-
const
|
|
318
|
-
return Array.from({ length: n }).map((
|
|
319
|
-
const
|
|
349
|
+
const l = Mt(e, t);
|
|
350
|
+
return Array.from({ length: n }).map((c, a) => {
|
|
351
|
+
const u = l[a] || e[a] || "", m = Oe({
|
|
320
352
|
property: r,
|
|
321
353
|
chartType: "",
|
|
322
354
|
categoricalProps: o,
|
|
323
|
-
commentProps:
|
|
324
|
-
numericDefaultChartType:
|
|
355
|
+
commentProps: i,
|
|
356
|
+
numericDefaultChartType: s
|
|
325
357
|
});
|
|
326
358
|
return {
|
|
327
|
-
holeId:
|
|
359
|
+
holeId: u,
|
|
328
360
|
property: r,
|
|
329
361
|
chartType: m
|
|
330
362
|
};
|
|
331
363
|
});
|
|
332
364
|
}
|
|
333
|
-
const
|
|
334
|
-
[
|
|
365
|
+
const Ie = "numeric", Se = "categorical", xe = "comment", ke = "hidden", Ge = "tadpole", Qe = {
|
|
366
|
+
[Ie]: [
|
|
335
367
|
{ value: "bar", label: "Bars" },
|
|
336
368
|
{ value: "markers", label: "Markers" },
|
|
337
369
|
{ value: "markers+line", label: "Markers + Line" },
|
|
338
370
|
{ value: "line", label: "Line only" }
|
|
339
371
|
],
|
|
340
|
-
[
|
|
372
|
+
[Se]: [
|
|
341
373
|
{ value: "categorical", label: "Categorical bands" }
|
|
342
374
|
],
|
|
343
|
-
[
|
|
375
|
+
[xe]: [
|
|
344
376
|
{ value: "comment", label: "Comments" }
|
|
345
377
|
],
|
|
346
|
-
[
|
|
378
|
+
[Ge]: [
|
|
347
379
|
{ value: "tadpole", label: "Tadpole" }
|
|
348
380
|
],
|
|
349
|
-
[
|
|
350
|
-
},
|
|
381
|
+
[ke]: []
|
|
382
|
+
}, et = /* @__PURE__ */ new Set([
|
|
351
383
|
// Hole identifiers
|
|
352
384
|
"hole_id",
|
|
353
385
|
"holeid",
|
|
@@ -402,7 +434,7 @@ const xe = "numeric", Me = "categorical", _e = "comment", ve = "hidden", we = "t
|
|
|
402
434
|
"data_source",
|
|
403
435
|
"_hole_key",
|
|
404
436
|
"_hole_id_key"
|
|
405
|
-
]),
|
|
437
|
+
]), dn = /* @__PURE__ */ new Set([
|
|
406
438
|
"comments",
|
|
407
439
|
"comment",
|
|
408
440
|
"notes",
|
|
@@ -412,73 +444,74 @@ const xe = "numeric", Me = "categorical", _e = "comment", ve = "hidden", we = "t
|
|
|
412
444
|
"remark",
|
|
413
445
|
"log_description",
|
|
414
446
|
"struct_comment",
|
|
415
|
-
"structcomment"
|
|
447
|
+
"structcomment",
|
|
448
|
+
"geology_description"
|
|
416
449
|
]);
|
|
417
|
-
function
|
|
450
|
+
function fn(e) {
|
|
418
451
|
if (!(e != null && e.length))
|
|
419
452
|
return { byType: {}, numericCols: [], categoricalCols: [], commentCols: [] };
|
|
420
453
|
const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
|
|
421
454
|
for (const r of t) {
|
|
422
455
|
const o = r.toLowerCase().trim();
|
|
423
|
-
if (
|
|
424
|
-
n[r] =
|
|
456
|
+
if (et.has(o) || et.has(r)) {
|
|
457
|
+
n[r] = ke;
|
|
425
458
|
continue;
|
|
426
459
|
}
|
|
427
|
-
if (
|
|
428
|
-
const
|
|
429
|
-
const
|
|
430
|
-
return
|
|
460
|
+
if (dn.has(o)) {
|
|
461
|
+
const l = e.some((c) => {
|
|
462
|
+
const a = c[r];
|
|
463
|
+
return a != null && String(a).trim() !== "" && String(a) !== "null";
|
|
431
464
|
});
|
|
432
|
-
n[r] =
|
|
465
|
+
n[r] = l ? xe : ke;
|
|
433
466
|
continue;
|
|
434
467
|
}
|
|
435
|
-
let
|
|
436
|
-
for (const
|
|
437
|
-
const
|
|
438
|
-
if (!(
|
|
439
|
-
|
|
468
|
+
let i = !1, s = !1;
|
|
469
|
+
for (const l of e) {
|
|
470
|
+
const c = l[r];
|
|
471
|
+
if (!(c == null || typeof c == "string" && c.trim() === "") && (s = !0, typeof c == "number" && Number.isFinite(c))) {
|
|
472
|
+
i = !0;
|
|
440
473
|
break;
|
|
441
474
|
}
|
|
442
475
|
}
|
|
443
|
-
|
|
476
|
+
s ? i ? n[r] = Ie : n[r] = Se : n[r] = ke;
|
|
444
477
|
}
|
|
445
478
|
return {
|
|
446
479
|
byType: n,
|
|
447
|
-
numericCols: Object.entries(n).filter(([, r]) => r ===
|
|
448
|
-
categoricalCols: Object.entries(n).filter(([, r]) => r ===
|
|
449
|
-
commentCols: Object.entries(n).filter(([, r]) => r ===
|
|
480
|
+
numericCols: Object.entries(n).filter(([, r]) => r === Ie).map(([r]) => r),
|
|
481
|
+
categoricalCols: Object.entries(n).filter(([, r]) => r === Se).map(([r]) => r),
|
|
482
|
+
commentCols: Object.entries(n).filter(([, r]) => r === xe).map(([r]) => r)
|
|
450
483
|
};
|
|
451
484
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
485
|
+
function Ue(e) {
|
|
486
|
+
return Qe[e] ?? Qe[Ie];
|
|
454
487
|
}
|
|
455
|
-
function
|
|
456
|
-
const t =
|
|
457
|
-
return t.length ? e ===
|
|
488
|
+
function io(e) {
|
|
489
|
+
const t = Ue(e);
|
|
490
|
+
return t.length ? e === Ie ? "line" : t[0].value : "markers+line";
|
|
458
491
|
}
|
|
459
|
-
function
|
|
460
|
-
const t = e.flatMap((
|
|
492
|
+
function Le(e = []) {
|
|
493
|
+
const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = fn(t), s = n[0] || r[0] || "";
|
|
461
494
|
return {
|
|
462
495
|
numericProps: n,
|
|
463
496
|
categoricalProps: r,
|
|
464
497
|
commentProps: o,
|
|
465
|
-
columnMeta:
|
|
466
|
-
defaultProp:
|
|
498
|
+
columnMeta: i,
|
|
499
|
+
defaultProp: s
|
|
467
500
|
};
|
|
468
501
|
}
|
|
469
|
-
async function
|
|
470
|
-
return await
|
|
502
|
+
async function hn(e, t = null) {
|
|
503
|
+
return await an(e);
|
|
471
504
|
}
|
|
472
|
-
async function
|
|
473
|
-
return await
|
|
505
|
+
async function pn(e, t, n = null) {
|
|
506
|
+
return await cn(e, t);
|
|
474
507
|
}
|
|
475
|
-
function
|
|
508
|
+
function bn(e = [], t = "") {
|
|
476
509
|
if (!e.length) return null;
|
|
477
|
-
const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta:
|
|
478
|
-
holeIds:
|
|
510
|
+
const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Le(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = xt({
|
|
511
|
+
holeIds: l,
|
|
479
512
|
focusedHoleId: t,
|
|
480
513
|
plotCount: 4,
|
|
481
|
-
defaultProp:
|
|
514
|
+
defaultProp: s,
|
|
482
515
|
categoricalProps: r,
|
|
483
516
|
commentProps: o,
|
|
484
517
|
numericDefaultChartType: "line"
|
|
@@ -488,160 +521,160 @@ function Qt(e = [], t = "") {
|
|
|
488
521
|
numericProps: n,
|
|
489
522
|
categoricalProps: r,
|
|
490
523
|
commentProps: o,
|
|
491
|
-
columnMeta:
|
|
492
|
-
defaultProp:
|
|
493
|
-
traceConfigs:
|
|
524
|
+
columnMeta: i,
|
|
525
|
+
defaultProp: s,
|
|
526
|
+
traceConfigs: c
|
|
494
527
|
};
|
|
495
528
|
}
|
|
496
|
-
async function
|
|
497
|
-
const { holes: r } = await
|
|
529
|
+
async function so(e, t = "", n = null) {
|
|
530
|
+
const { holes: r } = await un(e, n), o = bn(r, t);
|
|
498
531
|
if (!o) throw new Error("No valid assay intervals found.");
|
|
499
532
|
return o;
|
|
500
533
|
}
|
|
501
|
-
function
|
|
534
|
+
function lo(e, t = null) {
|
|
502
535
|
return new Promise((n, r) => {
|
|
503
|
-
|
|
536
|
+
K.parse(e, {
|
|
504
537
|
header: !0,
|
|
505
538
|
dynamicTyping: !0,
|
|
506
539
|
skipEmptyLines: !0,
|
|
507
540
|
complete: (o) => {
|
|
508
|
-
const
|
|
509
|
-
n(
|
|
541
|
+
const i = o.data.map((s) => gn(s, t)).filter((s) => s[z] && Number.isFinite(s[q]) && Number.isFinite(s[B]) && Number.isFinite(s[R]));
|
|
542
|
+
n(i);
|
|
510
543
|
},
|
|
511
544
|
error: (o) => r(w("parseSurveyCSV", o))
|
|
512
545
|
});
|
|
513
546
|
});
|
|
514
547
|
}
|
|
515
|
-
function
|
|
516
|
-
const n =
|
|
548
|
+
function gn(e, t = null) {
|
|
549
|
+
const n = he(e, null, t), r = n[z], o = n[ae] || n.project || n.project_code, i = Ne(n[te]), s = Ne(n[ne]), l = Ne(n[q]), c = Ne(n[B]), a = Ne(n[R]), u = Ne(n.maxdepth);
|
|
517
550
|
return {
|
|
518
551
|
raw: n,
|
|
519
|
-
[
|
|
520
|
-
[
|
|
521
|
-
[te]:
|
|
522
|
-
[ne]:
|
|
523
|
-
[
|
|
524
|
-
[B]:
|
|
525
|
-
[
|
|
526
|
-
maxdepth:
|
|
552
|
+
[z]: r,
|
|
553
|
+
[ae]: o,
|
|
554
|
+
[te]: i,
|
|
555
|
+
[ne]: s,
|
|
556
|
+
[q]: l,
|
|
557
|
+
[B]: c,
|
|
558
|
+
[R]: a,
|
|
559
|
+
maxdepth: u,
|
|
527
560
|
// Legacy field names for backwards compatibility
|
|
528
561
|
project_code: o,
|
|
529
|
-
latitude:
|
|
530
|
-
longitude:
|
|
531
|
-
surveydepth:
|
|
562
|
+
latitude: i,
|
|
563
|
+
longitude: s,
|
|
564
|
+
surveydepth: l
|
|
532
565
|
};
|
|
533
566
|
}
|
|
534
|
-
const
|
|
567
|
+
const Ne = (e) => {
|
|
535
568
|
const t = Number(e);
|
|
536
569
|
return Number.isFinite(t) ? t : void 0;
|
|
537
570
|
};
|
|
538
|
-
function
|
|
539
|
-
var
|
|
571
|
+
function ao(e, t) {
|
|
572
|
+
var a, u, m, d;
|
|
540
573
|
const n = /* @__PURE__ */ new Map();
|
|
541
574
|
e.forEach((f) => {
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
544
|
-
const
|
|
545
|
-
n.has(
|
|
575
|
+
const p = (f[z] || f.holeId || f.id || "").toString().trim();
|
|
576
|
+
if (!p) return;
|
|
577
|
+
const b = p.toLowerCase();
|
|
578
|
+
n.has(b) || n.set(b, f);
|
|
546
579
|
});
|
|
547
|
-
const r = ((
|
|
580
|
+
const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((u = e[0]) == null ? void 0 : u[te]) ?? 0, o = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[ne]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), l = /* @__PURE__ */ new Map();
|
|
548
581
|
t.forEach((f) => {
|
|
549
|
-
const
|
|
550
|
-
if (!b) return;
|
|
551
|
-
const p = b.toLowerCase();
|
|
552
|
-
c.has(p) || c.set(p, []), c.get(p).push(f);
|
|
553
|
-
});
|
|
554
|
-
const u = [];
|
|
555
|
-
return c.forEach((f, b) => {
|
|
556
|
-
const p = n.get(b);
|
|
582
|
+
const p = (f[z] || "").toString().trim();
|
|
557
583
|
if (!p) return;
|
|
558
|
-
const
|
|
584
|
+
const b = p.toLowerCase();
|
|
585
|
+
l.has(b) || l.set(b, []), l.get(b).push(f);
|
|
586
|
+
});
|
|
587
|
+
const c = [];
|
|
588
|
+
return l.forEach((f, p) => {
|
|
589
|
+
const b = n.get(p);
|
|
590
|
+
if (!b) return;
|
|
591
|
+
const h = f.filter((F) => Number.isFinite(F[q] ?? F.surveydepth)).sort((F, Y) => (F[q] ?? F.surveydepth) - (Y[q] ?? Y.surveydepth));
|
|
559
592
|
if (!h.length) return;
|
|
560
|
-
const _ =
|
|
561
|
-
let
|
|
562
|
-
for (let
|
|
563
|
-
const
|
|
564
|
-
if (!
|
|
565
|
-
|
|
566
|
-
x:
|
|
567
|
-
y:
|
|
593
|
+
const _ = b.lat ?? b[te], g = b.lng ?? b[ne], v = 111132, M = 111320 * Math.cos(_ * Math.PI / 180), E = (g - o) * s, P = (_ - r) * i, C = [];
|
|
594
|
+
let L = 0, k = 0, G = 0;
|
|
595
|
+
for (let F = 0; F < h.length; F += 1) {
|
|
596
|
+
const Y = h[F], j = h[F - 1], A = Y[q] ?? Y.surveydepth, x = Y[R] ?? Y.azimuth, y = Y[B] ?? Y.dip;
|
|
597
|
+
if (!j) {
|
|
598
|
+
C.push({
|
|
599
|
+
x: E + L,
|
|
600
|
+
y: P + k,
|
|
568
601
|
z: 0,
|
|
569
602
|
md: A,
|
|
570
|
-
azimuth:
|
|
571
|
-
dip:
|
|
603
|
+
azimuth: x,
|
|
604
|
+
dip: y
|
|
572
605
|
});
|
|
573
606
|
continue;
|
|
574
607
|
}
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
Math.sin(
|
|
579
|
-
),
|
|
580
|
-
|
|
581
|
-
x:
|
|
582
|
-
y:
|
|
583
|
-
z:
|
|
608
|
+
const O = j[q] ?? j.surveydepth, I = j[R] ?? j.azimuth, V = j[B] ?? j.dip, H = A - O;
|
|
609
|
+
if (H <= 0) continue;
|
|
610
|
+
const T = tt(V), U = tt(y), W = Ye(I), re = Ye(x), pe = Math.acos(
|
|
611
|
+
Math.sin(T) * Math.sin(U) * Math.cos(W - re) + Math.cos(T) * Math.cos(U)
|
|
612
|
+
), ce = pe > 1e-6 ? 2 / pe * Math.tan(pe / 2) : 1, ve = 0.5 * H * (Math.sin(T) * Math.cos(W) + Math.sin(U) * Math.cos(re)) * ce, ue = 0.5 * H * (Math.sin(T) * Math.sin(W) + Math.sin(U) * Math.sin(re)) * ce, Ve = 0.5 * H * (Math.cos(T) + Math.cos(U)) * ce;
|
|
613
|
+
L += ve, k += ue, G += Ve, C.push({
|
|
614
|
+
x: E + L,
|
|
615
|
+
y: P + k,
|
|
616
|
+
z: -G,
|
|
584
617
|
// render with z up; depth down
|
|
585
618
|
md: A,
|
|
586
|
-
azimuth:
|
|
587
|
-
dip:
|
|
619
|
+
azimuth: x,
|
|
620
|
+
dip: y
|
|
588
621
|
});
|
|
589
622
|
}
|
|
590
|
-
const
|
|
591
|
-
...
|
|
592
|
-
lat: _ +
|
|
593
|
-
lng:
|
|
623
|
+
const X = C.map((F) => ({
|
|
624
|
+
...F,
|
|
625
|
+
lat: _ + F.y / v,
|
|
626
|
+
lng: g + F.x / M
|
|
594
627
|
}));
|
|
595
|
-
|
|
596
|
-
id:
|
|
597
|
-
project:
|
|
598
|
-
points:
|
|
599
|
-
collar:
|
|
628
|
+
c.push({
|
|
629
|
+
id: b[z] || b.holeId || p,
|
|
630
|
+
project: b[ae] || b.project_id || b.project || "",
|
|
631
|
+
points: X,
|
|
632
|
+
collar: b
|
|
600
633
|
});
|
|
601
|
-
}),
|
|
634
|
+
}), c;
|
|
602
635
|
}
|
|
603
|
-
const
|
|
636
|
+
const Ye = (e) => e * Math.PI / 180, tt = (e) => {
|
|
604
637
|
const t = Number(e), n = 90 + (Number.isFinite(t) ? t : 0), r = Math.min(180, Math.max(0, n));
|
|
605
|
-
return
|
|
638
|
+
return Ye(r);
|
|
606
639
|
};
|
|
607
640
|
function ee(e, t = void 0) {
|
|
608
641
|
const n = Number(e);
|
|
609
642
|
return Number.isFinite(n) ? n : t;
|
|
610
643
|
}
|
|
611
|
-
function
|
|
644
|
+
function nt(e) {
|
|
612
645
|
return e == null ? "" : `${e}`.trim();
|
|
613
646
|
}
|
|
614
|
-
function
|
|
615
|
-
const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((
|
|
647
|
+
function Fe(e = [], t = null) {
|
|
648
|
+
const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => nt(s == null ? void 0 : s[i])));
|
|
616
649
|
if (!o)
|
|
617
650
|
throw w("canonicalizeHoleIdRows", new Error(`hole id column '${n}' not found`));
|
|
618
651
|
return {
|
|
619
652
|
aliasCol: o,
|
|
620
|
-
rows: e.map((
|
|
621
|
-
...
|
|
622
|
-
hole_id:
|
|
653
|
+
rows: e.map((i) => ({
|
|
654
|
+
...i,
|
|
655
|
+
hole_id: nt(i == null ? void 0 : i[o])
|
|
623
656
|
}))
|
|
624
657
|
};
|
|
625
658
|
}
|
|
626
|
-
function
|
|
659
|
+
function rt(e) {
|
|
627
660
|
return Number(e) * Math.PI / 180;
|
|
628
661
|
}
|
|
629
|
-
function
|
|
630
|
-
const n =
|
|
631
|
-
return { ca: o, cb:
|
|
662
|
+
function we(e, t) {
|
|
663
|
+
const n = rt(e), r = rt(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
|
|
664
|
+
return { ca: o, cb: i, cc: s };
|
|
632
665
|
}
|
|
633
|
-
function
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
666
|
+
function yn(e, t, n, r, o, i = "minimum_curvature") {
|
|
667
|
+
const s = we(t, n), l = we(r, o);
|
|
668
|
+
if (i === "tangential")
|
|
636
669
|
return {
|
|
637
|
-
dx: e *
|
|
638
|
-
dy: e *
|
|
639
|
-
dz: e *
|
|
670
|
+
dx: e * s.ca,
|
|
671
|
+
dy: e * s.cb,
|
|
672
|
+
dz: e * s.cc,
|
|
640
673
|
azimuth: t,
|
|
641
674
|
dip: n
|
|
642
675
|
};
|
|
643
|
-
if (
|
|
644
|
-
const m = 0.5 * (t + r), d = 0.5 * (n + o), f =
|
|
676
|
+
if (i === "balanced_tangential") {
|
|
677
|
+
const m = 0.5 * (t + r), d = 0.5 * (n + o), f = we(m, d);
|
|
645
678
|
return {
|
|
646
679
|
dx: e * f.ca,
|
|
647
680
|
dy: e * f.cb,
|
|
@@ -650,145 +683,145 @@ function tn(e, t, n, r, o, s = "minimum_curvature") {
|
|
|
650
683
|
dip: d
|
|
651
684
|
};
|
|
652
685
|
}
|
|
653
|
-
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;
|
|
654
687
|
return {
|
|
655
|
-
dx: 0.5 * e * (
|
|
656
|
-
dy: 0.5 * e * (
|
|
657
|
-
dz: 0.5 * e * (
|
|
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,
|
|
658
691
|
azimuth: r,
|
|
659
692
|
dip: o
|
|
660
693
|
};
|
|
661
694
|
}
|
|
662
|
-
function
|
|
695
|
+
function qe(e = [], t = [], n = {}) {
|
|
663
696
|
const {
|
|
664
697
|
step: r = 1,
|
|
665
698
|
holeIdCol: o = null,
|
|
666
|
-
method:
|
|
667
|
-
} = n,
|
|
668
|
-
if (!
|
|
669
|
-
const l = /* @__PURE__ */ new Map();
|
|
670
|
-
c.rows.forEach((d) => {
|
|
671
|
-
!d.hole_id || l.has(d.hole_id) || l.set(d.hole_id, d);
|
|
672
|
-
});
|
|
699
|
+
method: i = "minimum_curvature"
|
|
700
|
+
} = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l = Fe(e, o), c = Fe(t, o || l.aliasCol);
|
|
701
|
+
if (!l.rows.length || !c.rows.length) return [];
|
|
673
702
|
const a = /* @__PURE__ */ new Map();
|
|
674
|
-
|
|
675
|
-
d.hole_id
|
|
703
|
+
l.rows.forEach((d) => {
|
|
704
|
+
!d.hole_id || a.has(d.hole_id) || a.set(d.hole_id, d);
|
|
705
|
+
});
|
|
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));
|
|
676
709
|
});
|
|
677
710
|
const m = [];
|
|
678
|
-
return
|
|
679
|
-
const
|
|
680
|
-
if (!
|
|
681
|
-
const
|
|
682
|
-
...
|
|
683
|
-
from: ee(
|
|
684
|
-
azimuth: ee(
|
|
685
|
-
dip: ee(
|
|
686
|
-
})).filter((
|
|
687
|
-
if (!
|
|
688
|
-
let h = ee(
|
|
689
|
-
const
|
|
711
|
+
return u.forEach((d, f) => {
|
|
712
|
+
const p = a.get(f);
|
|
713
|
+
if (!p) return;
|
|
714
|
+
const b = [...d].map((C) => ({
|
|
715
|
+
...C,
|
|
716
|
+
from: ee(C.from),
|
|
717
|
+
azimuth: ee(C.azimuth),
|
|
718
|
+
dip: ee(C.dip)
|
|
719
|
+
})).filter((C) => Number.isFinite(C.from) && Number.isFinite(C.azimuth) && Number.isFinite(C.dip)).sort((C, L) => C.from - L.from);
|
|
720
|
+
if (!b.length) return;
|
|
721
|
+
let h = ee(p.x, 0), _ = ee(p.y, 0), g = ee(p.z, 0), v = b[0].from;
|
|
722
|
+
const M = b[0].azimuth, E = b[0].dip, P = {
|
|
690
723
|
hole_id: f,
|
|
691
|
-
md:
|
|
724
|
+
md: v,
|
|
692
725
|
x: h,
|
|
693
726
|
y: _,
|
|
694
|
-
z:
|
|
695
|
-
azimuth:
|
|
696
|
-
dip:
|
|
727
|
+
z: g,
|
|
728
|
+
azimuth: M,
|
|
729
|
+
dip: E
|
|
697
730
|
};
|
|
698
|
-
|
|
699
|
-
for (let
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
for (let A = 0; A <
|
|
704
|
-
|
|
705
|
-
const
|
|
706
|
-
h +=
|
|
707
|
-
const
|
|
731
|
+
l.aliasCol !== "hole_id" && p[l.aliasCol] !== void 0 && (P[l.aliasCol] = p[l.aliasCol]), m.push(P);
|
|
732
|
+
for (let C = 0; C < b.length - 1; C += 1) {
|
|
733
|
+
const L = b[C], k = b[C + 1], G = L.from, F = k.from - G;
|
|
734
|
+
if (F <= 0) continue;
|
|
735
|
+
const Y = Math.max(1, Math.ceil(F / s)), j = F / Y;
|
|
736
|
+
for (let A = 0; A < Y; A += 1) {
|
|
737
|
+
v += j;
|
|
738
|
+
const x = (v - G) / F, y = L.azimuth + x * (k.azimuth - L.azimuth), O = L.dip + x * (k.dip - L.dip), I = yn(j, L.azimuth, L.dip, k.azimuth, k.dip, i);
|
|
739
|
+
h += I.dx, _ += I.dy, g += I.dz;
|
|
740
|
+
const V = {
|
|
708
741
|
hole_id: f,
|
|
709
|
-
md:
|
|
742
|
+
md: v,
|
|
710
743
|
x: h,
|
|
711
744
|
y: _,
|
|
712
|
-
z:
|
|
713
|
-
azimuth:
|
|
714
|
-
dip:
|
|
745
|
+
z: g,
|
|
746
|
+
azimuth: i === "minimum_curvature" ? y : I.azimuth,
|
|
747
|
+
dip: i === "minimum_curvature" ? O : I.dip
|
|
715
748
|
};
|
|
716
|
-
|
|
749
|
+
l.aliasCol !== "hole_id" && p[l.aliasCol] !== void 0 && (V[l.aliasCol] = p[l.aliasCol]), m.push(V);
|
|
717
750
|
}
|
|
718
751
|
}
|
|
719
752
|
}), m;
|
|
720
753
|
}
|
|
721
|
-
function
|
|
722
|
-
return
|
|
754
|
+
function _n(e, t, n = {}) {
|
|
755
|
+
return qe(e, t, { ...n, method: "minimum_curvature" });
|
|
723
756
|
}
|
|
724
|
-
function
|
|
725
|
-
return
|
|
757
|
+
function co(e, t, n = {}) {
|
|
758
|
+
return qe(e, t, { ...n, method: "tangential" });
|
|
726
759
|
}
|
|
727
|
-
function
|
|
728
|
-
return
|
|
760
|
+
function uo(e, t, n = {}) {
|
|
761
|
+
return qe(e, t, { ...n, method: "balanced_tangential" });
|
|
729
762
|
}
|
|
730
|
-
function
|
|
731
|
-
return
|
|
763
|
+
function mo(e, t, n = {}) {
|
|
764
|
+
return _n(e, t, n);
|
|
732
765
|
}
|
|
733
|
-
function
|
|
766
|
+
function Nn(e, t) {
|
|
734
767
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
735
768
|
let n = null, r = 1 / 0;
|
|
736
769
|
for (let o = 0; o < e.length; o += 1) {
|
|
737
|
-
const
|
|
738
|
-
if (!Number.isFinite(
|
|
739
|
-
const
|
|
740
|
-
|
|
770
|
+
const i = e[o], s = ee(i.md);
|
|
771
|
+
if (!Number.isFinite(s)) continue;
|
|
772
|
+
const l = Math.abs(s - t);
|
|
773
|
+
l < r && (r = l, n = i);
|
|
741
774
|
}
|
|
742
775
|
return n;
|
|
743
776
|
}
|
|
744
|
-
function
|
|
745
|
-
const r = n.holeIdCol || "hole_id", o =
|
|
746
|
-
if (!o.rows.length || !
|
|
747
|
-
const
|
|
748
|
-
return
|
|
749
|
-
|
|
750
|
-
}),
|
|
751
|
-
|
|
752
|
-
}), o.rows.map((
|
|
753
|
-
const
|
|
754
|
-
if (!
|
|
755
|
-
const m =
|
|
756
|
-
if (!m) return { ...
|
|
757
|
-
const d = { ...
|
|
777
|
+
function fo(e = [], t = [], n = {}) {
|
|
778
|
+
const r = n.holeIdCol || "hole_id", o = Fe(e, r), i = Fe(t, r);
|
|
779
|
+
if (!o.rows.length || !i.rows.length) return [...o.rows];
|
|
780
|
+
const s = /* @__PURE__ */ new Map();
|
|
781
|
+
return i.rows.forEach((l) => {
|
|
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, c) => {
|
|
784
|
+
s.set(c, [...l].sort((a, u) => ee(a.md, 0) - ee(u.md, 0)));
|
|
785
|
+
}), o.rows.map((l) => {
|
|
786
|
+
const c = ee(l.from), a = ee(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 = Nn(s.get(l.hole_id) || [], u);
|
|
789
|
+
if (!m) return { ...l };
|
|
790
|
+
const d = { ...l };
|
|
758
791
|
return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
|
|
759
792
|
m[f] !== void 0 && (Object.prototype.hasOwnProperty.call(d, f) ? d[`${f}_trace`] = m[f] : d[f] = m[f]);
|
|
760
793
|
}), d;
|
|
761
794
|
});
|
|
762
795
|
}
|
|
763
|
-
function
|
|
796
|
+
function ho(e, t = null) {
|
|
764
797
|
return new Promise((n, r) => {
|
|
765
|
-
|
|
798
|
+
K.parse(e, {
|
|
766
799
|
header: !0,
|
|
767
800
|
dynamicTyping: !0,
|
|
768
801
|
skipEmptyLines: !0,
|
|
769
802
|
complete: (o) => {
|
|
770
|
-
const
|
|
771
|
-
o.data.forEach((
|
|
772
|
-
const
|
|
773
|
-
!m || d === null || d === void 0 || f === null || f === void 0 ||
|
|
774
|
-
...
|
|
803
|
+
const i = /* @__PURE__ */ new Map();
|
|
804
|
+
o.data.forEach((l, c) => {
|
|
805
|
+
const a = he(l, null, t), u = a[z], m = u !== void 0 ? `${u}`.trim() : "", d = a[de] ?? a.x, f = a[fe] ?? a.y, p = a[Me] ?? a.z, b = a.order ?? c;
|
|
806
|
+
!m || d === null || d === void 0 || f === null || f === void 0 || p === null || p === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
|
|
807
|
+
...a,
|
|
775
808
|
holeId: m,
|
|
776
|
-
order:
|
|
809
|
+
order: b,
|
|
777
810
|
x: Number(d) ?? 0,
|
|
778
811
|
y: Number(f) ?? 0,
|
|
779
|
-
z: Number(
|
|
812
|
+
z: Number(p) ?? 0
|
|
780
813
|
}));
|
|
781
814
|
});
|
|
782
|
-
const
|
|
783
|
-
id:
|
|
784
|
-
points:
|
|
785
|
-
...
|
|
786
|
-
x: Number(
|
|
787
|
-
y: Number(
|
|
788
|
-
z: Number(
|
|
815
|
+
const s = Array.from(i.entries()).map(([l, c]) => ({
|
|
816
|
+
id: l,
|
|
817
|
+
points: c.sort((a, u) => a.order - u.order).map((a) => ({
|
|
818
|
+
...a,
|
|
819
|
+
x: Number(a.x) || 0,
|
|
820
|
+
y: Number(a.y) || 0,
|
|
821
|
+
z: Number(a.z) || 0
|
|
789
822
|
}))
|
|
790
823
|
}));
|
|
791
|
-
n({ holes:
|
|
824
|
+
n({ holes: s });
|
|
792
825
|
},
|
|
793
826
|
error: (o) => r(w("parseDrillholesCSV", o))
|
|
794
827
|
});
|
|
@@ -797,24 +830,39 @@ function kr(e, t = null) {
|
|
|
797
830
|
function ze(e) {
|
|
798
831
|
return e ? Array.isArray(e) ? [...e] : [] : [];
|
|
799
832
|
}
|
|
800
|
-
function
|
|
833
|
+
function Z(e) {
|
|
801
834
|
const t = Number(e);
|
|
802
835
|
return Number.isFinite(t) ? t : void 0;
|
|
803
836
|
}
|
|
804
|
-
function
|
|
837
|
+
function De(e = [], t = []) {
|
|
805
838
|
const n = [...e];
|
|
806
839
|
return n.sort((r, o) => {
|
|
807
|
-
for (let
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
return
|
|
840
|
+
for (let i = 0; i < t.length; i += 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}`);
|
|
811
844
|
}
|
|
812
845
|
return 0;
|
|
813
846
|
}), n;
|
|
814
847
|
}
|
|
815
|
-
function
|
|
848
|
+
function zn(e = [], t = "Intervals") {
|
|
849
|
+
if (!e.length) return;
|
|
850
|
+
const n = De(e, [z, S, D]), r = /* @__PURE__ */ new Map();
|
|
851
|
+
n.forEach((o) => {
|
|
852
|
+
const i = `${(o == null ? void 0 : o[z]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[S]), l = Number(o == null ? void 0 : o[D]);
|
|
853
|
+
if (!i || !Number.isFinite(s) || !Number.isFinite(l)) return;
|
|
854
|
+
const c = r.get(i);
|
|
855
|
+
if (Number.isFinite(c) && s < c)
|
|
856
|
+
throw w(
|
|
857
|
+
"validateNoOverlappingIntervals",
|
|
858
|
+
new Error(`${t} intervals overlap for hole '${i}': from=${s} is less than previous to=${c}`)
|
|
859
|
+
);
|
|
860
|
+
r.set(i, l);
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
function Mn(e, t = {}) {
|
|
816
864
|
return new Promise((n, r) => {
|
|
817
|
-
|
|
865
|
+
K.parse(e, {
|
|
818
866
|
header: !0,
|
|
819
867
|
dynamicTyping: !0,
|
|
820
868
|
skipEmptyLines: !0,
|
|
@@ -824,166 +872,203 @@ function on(e, t = {}) {
|
|
|
824
872
|
});
|
|
825
873
|
});
|
|
826
874
|
}
|
|
827
|
-
function
|
|
828
|
-
return e.map((r) =>
|
|
875
|
+
function xn(e = [], t = null, n = null) {
|
|
876
|
+
return e.map((r) => he(r, t, n));
|
|
829
877
|
}
|
|
830
|
-
async function
|
|
878
|
+
async function $e(e, t = {}) {
|
|
831
879
|
const {
|
|
832
880
|
kind: n = "csv",
|
|
833
881
|
columnMap: r = null,
|
|
834
882
|
sourceColumnMap: o = null,
|
|
835
|
-
papaParseConfig:
|
|
883
|
+
papaParseConfig: i = {}
|
|
836
884
|
} = t;
|
|
837
|
-
let
|
|
885
|
+
let s;
|
|
838
886
|
if (Array.isArray(e))
|
|
839
|
-
|
|
887
|
+
s = ze(e);
|
|
840
888
|
else if (n === "csv")
|
|
841
|
-
|
|
889
|
+
s = await Mn(e, i);
|
|
842
890
|
else throw n === "parquet" || n === "sql" ? w("loadTable", new Error(`Unsupported kind in JS runtime: ${n}`)) : w("loadTable", new Error(`Unsupported kind: ${n}`));
|
|
843
|
-
return
|
|
891
|
+
return xn(s, r, o);
|
|
844
892
|
}
|
|
845
|
-
async function
|
|
893
|
+
async function po(e, t = {}) {
|
|
846
894
|
const {
|
|
847
895
|
crs: n = null,
|
|
848
896
|
sourceColumnMap: r = null,
|
|
849
897
|
keepAll: o = !0,
|
|
850
|
-
...
|
|
851
|
-
} = t,
|
|
852
|
-
if (!
|
|
853
|
-
throw w("loadCollars", new Error(`Collar table missing column: ${
|
|
854
|
-
const
|
|
855
|
-
if (!
|
|
898
|
+
...i
|
|
899
|
+
} = t, s = await $e(e, { ...i, sourceColumnMap: r });
|
|
900
|
+
if (!s.some((d) => z in d))
|
|
901
|
+
throw w("loadCollars", new Error(`Collar table missing column: ${z}`));
|
|
902
|
+
const c = s.some((d) => de in d && fe in d), a = s.some((d) => te in d && ne in d);
|
|
903
|
+
if (!c && !a)
|
|
856
904
|
throw w("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
|
|
857
|
-
const
|
|
905
|
+
const u = s.map((d) => {
|
|
858
906
|
const f = { ...d };
|
|
859
|
-
if (
|
|
860
|
-
const
|
|
861
|
-
f[
|
|
907
|
+
if (z in f) {
|
|
908
|
+
const p = f[z];
|
|
909
|
+
f[z] = p == null ? "" : `${p}`.trim();
|
|
862
910
|
}
|
|
863
|
-
return te in f && (f[te] =
|
|
911
|
+
return te in f && (f[te] = Z(f[te])), ne in f && (f[ne] = Z(f[ne])), Me in f && (f[Me] = Z(f[Me])), de in f && (f[de] = Z(f[de])), fe in f && (f[fe] = Z(f[fe])), !("datasource_hole_id" in f) && z in f && (f.datasource_hole_id = f[z]), f;
|
|
864
912
|
});
|
|
865
|
-
if (!
|
|
913
|
+
if (!u.every((d) => !(!d[z] || a && (!Number.isFinite(d[te]) || !Number.isFinite(d[ne])) || c && !a && (!Number.isFinite(d[de]) || !Number.isFinite(d[fe])))))
|
|
866
914
|
throw w("loadCollars", new Error("Collar table has missing required values"));
|
|
867
|
-
return
|
|
915
|
+
return u;
|
|
868
916
|
}
|
|
869
|
-
async function
|
|
917
|
+
async function bo(e, t = {}) {
|
|
870
918
|
const {
|
|
871
919
|
sourceColumnMap: n = null,
|
|
872
920
|
keepAll: r = !0,
|
|
873
921
|
...o
|
|
874
|
-
} = t,
|
|
875
|
-
for (const
|
|
876
|
-
if (!
|
|
877
|
-
throw w("loadSurveys", new Error(`Survey table missing column: ${
|
|
878
|
-
const
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
const m =
|
|
882
|
-
|
|
922
|
+
} = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, q, R, B];
|
|
923
|
+
for (const a of s)
|
|
924
|
+
if (!i.some((m) => a in m))
|
|
925
|
+
throw w("loadSurveys", new Error(`Survey table missing column: ${a}`));
|
|
926
|
+
const l = i.map((a) => {
|
|
927
|
+
const u = { ...a };
|
|
928
|
+
if (z in u) {
|
|
929
|
+
const m = u[z];
|
|
930
|
+
u[z] = m == null ? "" : `${m}`.trim();
|
|
883
931
|
}
|
|
884
|
-
return
|
|
932
|
+
return q in u && (u[q] = Z(u[q])), D in u && (u[D] = Z(u[D])), R in u && (u[R] = Z(u[R])), B in u && (u[B] = Z(u[B])), u;
|
|
885
933
|
});
|
|
886
|
-
if (!
|
|
934
|
+
if (!l.every((a) => !(!a[z] || !Number.isFinite(a[q]) || !Number.isFinite(a[R]) || !Number.isFinite(a[B]))))
|
|
887
935
|
throw w("loadSurveys", new Error("Survey table has missing required values"));
|
|
888
|
-
return
|
|
936
|
+
return De(l, [z, q]);
|
|
889
937
|
}
|
|
890
|
-
async function
|
|
938
|
+
async function go(e, t = {}) {
|
|
891
939
|
const {
|
|
892
940
|
sourceColumnMap: n = null,
|
|
893
941
|
keepAll: r = !0,
|
|
894
942
|
...o
|
|
895
|
-
} = t,
|
|
896
|
-
for (const
|
|
897
|
-
if (!
|
|
898
|
-
throw w("loadAssays", new Error(`Assay table missing column: ${
|
|
899
|
-
const
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
const m =
|
|
903
|
-
|
|
943
|
+
} = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, S, D];
|
|
944
|
+
for (const a of s)
|
|
945
|
+
if (!i.some((m) => a in m))
|
|
946
|
+
throw w("loadAssays", new Error(`Assay table missing column: ${a}`));
|
|
947
|
+
const l = i.map((a) => {
|
|
948
|
+
const u = { ...a };
|
|
949
|
+
if (z in u) {
|
|
950
|
+
const m = u[z];
|
|
951
|
+
u[z] = m == null ? "" : `${m}`.trim();
|
|
904
952
|
}
|
|
905
|
-
return
|
|
953
|
+
return S in u && (u[S] = Z(u[S])), D in u && (u[D] = Z(u[D])), S in u && D in u && Number.isFinite(u[S]) && Number.isFinite(u[D]) && (u[Ee] = 0.5 * (u[S] + u[D])), u;
|
|
906
954
|
});
|
|
907
|
-
if (!
|
|
955
|
+
if (!l.every((a) => !(!a[z] || !Number.isFinite(a[S]) || !Number.isFinite(a[D]) || !(a[D] > a[S]))))
|
|
908
956
|
throw w("loadAssays", new Error("Assay table has missing required values"));
|
|
909
|
-
return
|
|
957
|
+
return De(l, [z, S, D]);
|
|
958
|
+
}
|
|
959
|
+
async function yo(e, t = {}) {
|
|
960
|
+
const {
|
|
961
|
+
sourceColumnMap: n = null,
|
|
962
|
+
keepAll: r = !0,
|
|
963
|
+
...o
|
|
964
|
+
} = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, S, D];
|
|
965
|
+
for (const u of s)
|
|
966
|
+
if (!i.some((d) => u in d))
|
|
967
|
+
throw w("loadGeology", new Error(`Geology table missing column: ${u}`));
|
|
968
|
+
const l = i.map((u) => {
|
|
969
|
+
const m = { ...u };
|
|
970
|
+
if (z in m) {
|
|
971
|
+
const p = m[z];
|
|
972
|
+
m[z] = p == null ? "" : `${p}`.trim();
|
|
973
|
+
}
|
|
974
|
+
S in m && (m[S] = Z(m[S])), D in m && (m[D] = Z(m[D])), S in m && D in m && Number.isFinite(m[S]) && Number.isFinite(m[D]) && (m[D] === m[S] && (m[S] = Math.round(m[S] * 1e3) / 1e3, m[D] = m[S] + 1e-3), m[Ee] = 0.5 * (m[S] + m[D]));
|
|
975
|
+
const d = m[oe] !== void 0 && m[oe] !== null && `${m[oe]}`.trim() !== "", f = m[ie] !== void 0 && m[ie] !== null && `${m[ie]}`.trim() !== "";
|
|
976
|
+
return !d && f && (m[oe] = m[ie]), d && !f && (m[ie] = m[oe]), m;
|
|
977
|
+
});
|
|
978
|
+
if (!l.every((u) => !(!u[z] || !Number.isFinite(u[S]) || !Number.isFinite(u[D]) || !(u[D] > u[S]))))
|
|
979
|
+
throw w("loadGeology", new Error("Geology table has missing or invalid interval values"));
|
|
980
|
+
if (!l.some((u) => {
|
|
981
|
+
const m = u[oe], d = u[ie];
|
|
982
|
+
return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
|
|
983
|
+
}))
|
|
984
|
+
throw w("loadGeology", new Error(`Geology table missing categorical columns: ${oe} or ${ie}`));
|
|
985
|
+
if (zn(l, "Geology"), !r) {
|
|
986
|
+
const u = new Set(Object.keys(tn));
|
|
987
|
+
return De(
|
|
988
|
+
l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => u.has(d)))),
|
|
989
|
+
[z, S, D]
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
return De(l, [z, S, D]);
|
|
910
993
|
}
|
|
911
|
-
function
|
|
912
|
-
const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [
|
|
994
|
+
function _o(e = [], t = [], n = {}) {
|
|
995
|
+
const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [z];
|
|
913
996
|
if (!t.length) return [...e];
|
|
914
|
-
const o = (
|
|
915
|
-
return t.forEach((
|
|
916
|
-
|
|
917
|
-
}), e.map((
|
|
918
|
-
const
|
|
919
|
-
if (!
|
|
920
|
-
const
|
|
921
|
-
return Object.entries(
|
|
922
|
-
r.includes(
|
|
923
|
-
}),
|
|
997
|
+
const o = (s) => r.map((l) => `${(s == null ? void 0 : s[l]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
|
|
998
|
+
return t.forEach((s) => {
|
|
999
|
+
i.set(o(s), s);
|
|
1000
|
+
}), e.map((s) => {
|
|
1001
|
+
const l = i.get(o(s));
|
|
1002
|
+
if (!l) return { ...s };
|
|
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;
|
|
924
1007
|
});
|
|
925
1008
|
}
|
|
926
|
-
function
|
|
927
|
-
return t == null ? [...e] : e.length ? e.some((r) =>
|
|
1009
|
+
function No(e = [], t = null) {
|
|
1010
|
+
return t == null ? [...e] : e.length ? e.some((r) => ae in r) ? e.filter((r) => (r == null ? void 0 : r[ae]) === t) : [...e] : [];
|
|
928
1011
|
}
|
|
929
|
-
function
|
|
1012
|
+
function zo(e = [], t = []) {
|
|
930
1013
|
return e.map((n) => {
|
|
931
1014
|
const r = { ...n };
|
|
932
1015
|
return t.forEach((o) => {
|
|
933
1016
|
if (!(o in r)) return;
|
|
934
|
-
const
|
|
935
|
-
r[o] =
|
|
1017
|
+
const i = Z(r[o]);
|
|
1018
|
+
r[o] = i;
|
|
936
1019
|
}), r;
|
|
937
1020
|
});
|
|
938
1021
|
}
|
|
939
|
-
function
|
|
1022
|
+
function Mo({
|
|
940
1023
|
collars: e = [],
|
|
941
1024
|
surveys: t = [],
|
|
942
1025
|
assays: n = [],
|
|
943
|
-
|
|
944
|
-
|
|
1026
|
+
geology: r = [],
|
|
1027
|
+
structures: o = [],
|
|
1028
|
+
metadata: i = {}
|
|
945
1029
|
} = {}) {
|
|
946
1030
|
return {
|
|
947
1031
|
collars: ze(e),
|
|
948
1032
|
surveys: ze(t),
|
|
949
1033
|
assays: ze(n),
|
|
950
|
-
|
|
951
|
-
|
|
1034
|
+
geology: ze(r),
|
|
1035
|
+
structures: ze(o),
|
|
1036
|
+
metadata: i || {}
|
|
952
1037
|
};
|
|
953
1038
|
}
|
|
954
|
-
const
|
|
1039
|
+
const It = ["x", "y", "z", "dx", "dy", "dz"], In = {
|
|
955
1040
|
x: ["x", "easting", "center_x", "xc", "xcentre", "xcenter", "x_centre", "x_center", "cx"],
|
|
956
1041
|
y: ["y", "northing", "center_y", "yc", "ycentre", "ycenter", "y_centre", "y_center", "cy"],
|
|
957
1042
|
z: ["z", "elevation", "center_z", "zc", "zcentre", "zcenter", "z_centre", "z_center", "cz"],
|
|
958
1043
|
dx: ["dx", "size_x", "sx", "sizex", "dim_x", "block_size_x"],
|
|
959
1044
|
dy: ["dy", "size_y", "sy", "sizey", "dim_y", "block_size_y"],
|
|
960
1045
|
dz: ["dz", "size_z", "sz", "sizez", "dim_z", "block_size_z"]
|
|
961
|
-
},
|
|
962
|
-
Object.entries(
|
|
1046
|
+
}, Et = {};
|
|
1047
|
+
Object.entries(In).forEach(([e, t]) => {
|
|
963
1048
|
t.forEach((n) => {
|
|
964
|
-
|
|
1049
|
+
Et[n.toLowerCase()] = e;
|
|
965
1050
|
});
|
|
966
1051
|
});
|
|
967
|
-
function
|
|
1052
|
+
function En(e) {
|
|
968
1053
|
const t = {};
|
|
969
1054
|
return Object.entries(e).forEach(([n, r]) => {
|
|
970
|
-
const o =
|
|
1055
|
+
const o = Et[n.toLowerCase().trim()] || n;
|
|
971
1056
|
t[o] = r;
|
|
972
1057
|
}), t;
|
|
973
1058
|
}
|
|
974
|
-
function
|
|
1059
|
+
function xo(e) {
|
|
975
1060
|
return new Promise((t, n) => {
|
|
976
|
-
|
|
1061
|
+
K.parse(e, {
|
|
977
1062
|
header: !0,
|
|
978
1063
|
dynamicTyping: !0,
|
|
979
1064
|
skipEmptyLines: !0,
|
|
980
1065
|
complete: (r) => {
|
|
981
|
-
const
|
|
982
|
-
(
|
|
983
|
-
),
|
|
984
|
-
(
|
|
1066
|
+
const i = (r.data || []).map(En).filter(
|
|
1067
|
+
(l) => l.x !== null && l.y !== null && l.z !== null
|
|
1068
|
+
), s = Object.keys(i[0] || {}).filter(
|
|
1069
|
+
(l) => !It.includes(l)
|
|
985
1070
|
);
|
|
986
|
-
t({ data:
|
|
1071
|
+
t({ data: i, properties: s });
|
|
987
1072
|
},
|
|
988
1073
|
error: (r) => {
|
|
989
1074
|
n(w("parseBlockModelCSV", r));
|
|
@@ -991,7 +1076,7 @@ function Rr(e) {
|
|
|
991
1076
|
});
|
|
992
1077
|
});
|
|
993
1078
|
}
|
|
994
|
-
function
|
|
1079
|
+
function Io(e) {
|
|
995
1080
|
if (typeof e == "string")
|
|
996
1081
|
try {
|
|
997
1082
|
return JSON.parse(e);
|
|
@@ -1001,134 +1086,134 @@ function Hr(e) {
|
|
|
1001
1086
|
if (e && typeof e == "object") return e;
|
|
1002
1087
|
throw w("loadBlockModelMetadata", new Error("Invalid metadata source"));
|
|
1003
1088
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const n = e.map((
|
|
1006
|
-
if (n.length > 0 && n.every((
|
|
1007
|
-
const
|
|
1008
|
-
return { type: "numeric", min:
|
|
1089
|
+
function vn(e, t) {
|
|
1090
|
+
const n = e.map((i) => i[t]).filter((i) => i != null);
|
|
1091
|
+
if (n.length > 0 && n.every((i) => typeof i == "number")) {
|
|
1092
|
+
const i = Math.min(...n), s = Math.max(...n);
|
|
1093
|
+
return { type: "numeric", min: i, max: s, values: n };
|
|
1009
1094
|
}
|
|
1010
1095
|
return { type: "categorical", categories: [...new Set(n)], values: n };
|
|
1011
1096
|
}
|
|
1012
|
-
function
|
|
1097
|
+
function Eo(e) {
|
|
1013
1098
|
if (!e || e.length === 0) return {};
|
|
1014
1099
|
const t = Object.keys(e[0]).filter(
|
|
1015
|
-
(r) => !
|
|
1100
|
+
(r) => !It.includes(r)
|
|
1016
1101
|
), n = {};
|
|
1017
1102
|
return t.forEach((r) => {
|
|
1018
|
-
n[r] =
|
|
1103
|
+
n[r] = vn(e, r);
|
|
1019
1104
|
}), n;
|
|
1020
1105
|
}
|
|
1021
|
-
function
|
|
1106
|
+
function An(e, t) {
|
|
1022
1107
|
return !t || typeof t != "object" ? e : e.filter(
|
|
1023
1108
|
(n) => Object.entries(t).every(([r, o]) => {
|
|
1024
|
-
const
|
|
1025
|
-
return o == null ? !0 : typeof o != "object" || Array.isArray(o) ?
|
|
1109
|
+
const i = n[r];
|
|
1110
|
+
return o == null ? !0 : typeof o != "object" || Array.isArray(o) ? i === o : !("gt" in o && !(i > o.gt) || "gte" in o && !(i >= o.gte) || "lt" in o && !(i < o.lt) || "lte" in o && !(i <= o.lte) || "eq" in o && i !== o.eq || "ne" in o && i === o.ne || "in" in o && !o.in.includes(i));
|
|
1026
1111
|
})
|
|
1027
1112
|
);
|
|
1028
1113
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return (t ?
|
|
1031
|
-
const
|
|
1032
|
-
return r +
|
|
1114
|
+
function vo(e, t = null) {
|
|
1115
|
+
return (t ? An(e, t) : e).reduce((r, o) => {
|
|
1116
|
+
const i = Number(o.dx) || 0, s = Number(o.dy) || 0, l = Number(o.dz) || 0;
|
|
1117
|
+
return r + i * s * l;
|
|
1033
1118
|
}, 0);
|
|
1034
1119
|
}
|
|
1035
|
-
function
|
|
1120
|
+
function Sn(e, t, n) {
|
|
1036
1121
|
if (!t) return new n.Color("#888888");
|
|
1037
1122
|
if (t.type === "numeric") {
|
|
1038
|
-
const
|
|
1039
|
-
return new n.Color().setHSL(
|
|
1123
|
+
const i = t.max - t.min, l = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
|
|
1124
|
+
return new n.Color().setHSL(l / 360, 0.8, 0.5);
|
|
1040
1125
|
}
|
|
1041
1126
|
const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
|
|
1042
1127
|
return new n.Color().setHSL(o / 360, 0.7, 0.5);
|
|
1043
1128
|
}
|
|
1044
|
-
const
|
|
1045
|
-
function
|
|
1129
|
+
const Xe = (e, t = null) => he(e, null, t);
|
|
1130
|
+
function Dn(e) {
|
|
1046
1131
|
if (!e.length) return null;
|
|
1047
|
-
const t = e[0], n =
|
|
1132
|
+
const t = e[0], n = S in t && D in t, r = q in t && !n;
|
|
1048
1133
|
return n ? "interval" : r ? "point" : null;
|
|
1049
1134
|
}
|
|
1050
|
-
function
|
|
1135
|
+
function le(e) {
|
|
1051
1136
|
const t = Number(e);
|
|
1052
1137
|
return Number.isFinite(t) ? t : null;
|
|
1053
1138
|
}
|
|
1054
|
-
function
|
|
1055
|
-
const t = e[
|
|
1139
|
+
function vt(e) {
|
|
1140
|
+
const t = e[z] !== void 0 ? `${e[z]}`.trim() : "";
|
|
1056
1141
|
if (!t) return null;
|
|
1057
|
-
const n =
|
|
1142
|
+
const n = le(e[q]);
|
|
1058
1143
|
return n === null ? null : {
|
|
1059
|
-
[
|
|
1060
|
-
[
|
|
1061
|
-
[B]:
|
|
1062
|
-
[
|
|
1144
|
+
[z]: t,
|
|
1145
|
+
[q]: n,
|
|
1146
|
+
[B]: le(e[B]),
|
|
1147
|
+
[R]: le(e[R]),
|
|
1063
1148
|
comments: e.comments != null ? `${e.comments}` : null,
|
|
1064
1149
|
...e
|
|
1065
1150
|
};
|
|
1066
1151
|
}
|
|
1067
|
-
function
|
|
1068
|
-
const t = e[
|
|
1152
|
+
function At(e) {
|
|
1153
|
+
const t = e[z] !== void 0 ? `${e[z]}`.trim() : "";
|
|
1069
1154
|
if (!t) return null;
|
|
1070
|
-
const n =
|
|
1155
|
+
const n = le(e[S]), r = le(e[D]);
|
|
1071
1156
|
if (n === null || r === null || r <= n) return null;
|
|
1072
1157
|
const o = 0.5 * (n + r);
|
|
1073
1158
|
return {
|
|
1074
|
-
[
|
|
1075
|
-
[
|
|
1076
|
-
[
|
|
1159
|
+
[z]: t,
|
|
1160
|
+
[S]: n,
|
|
1161
|
+
[D]: r,
|
|
1077
1162
|
mid: o,
|
|
1078
|
-
[B]:
|
|
1079
|
-
[
|
|
1163
|
+
[B]: le(e[B]),
|
|
1164
|
+
[R]: le(e[R]),
|
|
1080
1165
|
classification: e.classification != null ? `${e.classification}` : null,
|
|
1081
1166
|
comments: e.comments != null ? `${e.comments}` : null,
|
|
1082
1167
|
...e
|
|
1083
1168
|
};
|
|
1084
1169
|
}
|
|
1085
|
-
function
|
|
1170
|
+
function Ao(e) {
|
|
1086
1171
|
const t = [], n = [];
|
|
1087
1172
|
for (const r of e) {
|
|
1088
|
-
const o = [],
|
|
1089
|
-
|
|
1173
|
+
const o = [], i = le(r[B]), s = le(r[R]);
|
|
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);
|
|
1090
1175
|
}
|
|
1091
1176
|
return { valid: t, errors: n };
|
|
1092
1177
|
}
|
|
1093
|
-
function
|
|
1178
|
+
function So(e, t = null) {
|
|
1094
1179
|
return new Promise((n, r) => {
|
|
1095
1180
|
const o = {
|
|
1096
1181
|
header: !0,
|
|
1097
1182
|
dynamicTyping: !0,
|
|
1098
1183
|
skipEmptyLines: !0,
|
|
1099
|
-
complete: (
|
|
1100
|
-
const
|
|
1101
|
-
for (const
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1184
|
+
complete: (i) => {
|
|
1185
|
+
const s = [];
|
|
1186
|
+
for (const l of i.data) {
|
|
1187
|
+
const c = Xe(l, t), a = vt(c);
|
|
1188
|
+
a && s.push(a);
|
|
1104
1189
|
}
|
|
1105
|
-
n(
|
|
1190
|
+
n(s);
|
|
1106
1191
|
},
|
|
1107
|
-
error: (
|
|
1192
|
+
error: (i) => r(w("parseStructuralPointsCSV", i))
|
|
1108
1193
|
};
|
|
1109
1194
|
typeof e == "string" && !e.startsWith("data:") && e.includes(`
|
|
1110
|
-
`) ?
|
|
1195
|
+
`) ? K.parse(e, o) : K.parse(e, o);
|
|
1111
1196
|
});
|
|
1112
1197
|
}
|
|
1113
|
-
function
|
|
1198
|
+
function Do(e, t = null) {
|
|
1114
1199
|
return new Promise((n, r) => {
|
|
1115
|
-
|
|
1200
|
+
K.parse(e, {
|
|
1116
1201
|
header: !0,
|
|
1117
1202
|
dynamicTyping: !0,
|
|
1118
1203
|
skipEmptyLines: !0,
|
|
1119
1204
|
complete: (o) => {
|
|
1120
|
-
const
|
|
1121
|
-
for (const
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1205
|
+
const i = [];
|
|
1206
|
+
for (const s of o.data) {
|
|
1207
|
+
const l = Xe(s, t), c = At(l);
|
|
1208
|
+
c && i.push(c);
|
|
1124
1209
|
}
|
|
1125
|
-
n(
|
|
1210
|
+
n(i);
|
|
1126
1211
|
},
|
|
1127
1212
|
error: (o) => r(w("parseStructuralIntervalsCSV", o))
|
|
1128
1213
|
});
|
|
1129
1214
|
});
|
|
1130
1215
|
}
|
|
1131
|
-
function
|
|
1216
|
+
function Pn(e, t = z) {
|
|
1132
1217
|
const n = /* @__PURE__ */ new Map();
|
|
1133
1218
|
for (const r of e) {
|
|
1134
1219
|
const o = r[t] != null ? String(r[t]).trim() : "";
|
|
@@ -1136,337 +1221,415 @@ function fn(e, t = E) {
|
|
|
1136
1221
|
}
|
|
1137
1222
|
return Array.from(n.values());
|
|
1138
1223
|
}
|
|
1139
|
-
function
|
|
1224
|
+
function Cn(e, t = null) {
|
|
1140
1225
|
return new Promise((n, r) => {
|
|
1141
|
-
|
|
1226
|
+
K.parse(e, {
|
|
1142
1227
|
header: !0,
|
|
1143
1228
|
dynamicTyping: !0,
|
|
1144
1229
|
skipEmptyLines: !0,
|
|
1145
1230
|
complete: (o) => {
|
|
1146
|
-
const
|
|
1147
|
-
if (!
|
|
1231
|
+
const i = o.data.map((c) => Xe(c, t)), s = Dn(i);
|
|
1232
|
+
if (!s) {
|
|
1148
1233
|
r(w(
|
|
1149
1234
|
"parseStructuralCSV",
|
|
1150
1235
|
new Error("Structural CSV requires either 'depth' (point) or 'from'/'to' (interval) columns")
|
|
1151
1236
|
));
|
|
1152
1237
|
return;
|
|
1153
1238
|
}
|
|
1154
|
-
const
|
|
1155
|
-
for (const
|
|
1156
|
-
const
|
|
1157
|
-
|
|
1239
|
+
const l = [];
|
|
1240
|
+
for (const c of i) {
|
|
1241
|
+
const a = s === "interval" ? At(c) : vt(c);
|
|
1242
|
+
a && l.push(a);
|
|
1158
1243
|
}
|
|
1159
|
-
n({ schema:
|
|
1244
|
+
n({ schema: s, rows: l });
|
|
1160
1245
|
},
|
|
1161
1246
|
error: (o) => r(w("parseStructuralCSV", o))
|
|
1162
1247
|
});
|
|
1163
1248
|
});
|
|
1164
1249
|
}
|
|
1165
|
-
function
|
|
1250
|
+
function On(e) {
|
|
1166
1251
|
return new Promise((t) => {
|
|
1167
|
-
|
|
1252
|
+
K.parse(e, {
|
|
1168
1253
|
header: !0,
|
|
1169
1254
|
dynamicTyping: !0,
|
|
1170
1255
|
skipEmptyLines: !0,
|
|
1171
1256
|
complete: (n) => {
|
|
1172
1257
|
const r = /* @__PURE__ */ new Map();
|
|
1173
|
-
for (const
|
|
1174
|
-
const
|
|
1175
|
-
if (!
|
|
1176
|
-
const
|
|
1177
|
-
if (!Number.isFinite(
|
|
1178
|
-
const
|
|
1258
|
+
for (const i of n.data) {
|
|
1259
|
+
const s = he(i), l = s[z] != null ? `${s[z]}`.trim() : "";
|
|
1260
|
+
if (!l) continue;
|
|
1261
|
+
const c = Number(s[S]), a = Number(s[D]);
|
|
1262
|
+
if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c) continue;
|
|
1263
|
+
const u = (c + a) / 2, { [B]: m, [R]: d, ...f } = s, p = {
|
|
1179
1264
|
...f,
|
|
1180
|
-
[
|
|
1181
|
-
[
|
|
1182
|
-
[
|
|
1183
|
-
[
|
|
1184
|
-
[
|
|
1265
|
+
[z]: l,
|
|
1266
|
+
[S]: c,
|
|
1267
|
+
[D]: a,
|
|
1268
|
+
[Ee]: u,
|
|
1269
|
+
[q]: u,
|
|
1185
1270
|
// unified depth field for y-axis rendering
|
|
1186
1271
|
_source: "assay"
|
|
1187
1272
|
};
|
|
1188
|
-
r.has(
|
|
1273
|
+
r.has(l) || r.set(l, []), r.get(l).push(p);
|
|
1189
1274
|
}
|
|
1190
|
-
const o = Array.from(r.entries()).map(([
|
|
1191
|
-
holeId:
|
|
1192
|
-
points:
|
|
1275
|
+
const o = Array.from(r.entries()).map(([i, s]) => ({
|
|
1276
|
+
holeId: i,
|
|
1277
|
+
points: s.sort((l, c) => l[S] - c[S])
|
|
1193
1278
|
}));
|
|
1194
1279
|
t(o);
|
|
1195
1280
|
}
|
|
1196
1281
|
});
|
|
1197
1282
|
});
|
|
1198
1283
|
}
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1284
|
+
function kn(e) {
|
|
1285
|
+
return new Promise((t) => {
|
|
1286
|
+
K.parse(e, {
|
|
1287
|
+
header: !0,
|
|
1288
|
+
dynamicTyping: !0,
|
|
1289
|
+
skipEmptyLines: !0,
|
|
1290
|
+
complete: (n) => {
|
|
1291
|
+
const r = /* @__PURE__ */ new Map();
|
|
1292
|
+
for (const o of n.data) {
|
|
1293
|
+
const i = he(o), s = (i[z] ?? "").toString().trim();
|
|
1294
|
+
if (!s) continue;
|
|
1295
|
+
const l = Number(i[S]), c = Number(i[D]);
|
|
1296
|
+
if (!Number.isFinite(l) || !Number.isFinite(c) || c <= l) continue;
|
|
1297
|
+
const a = (l + c) / 2, { [B]: u, [R]: m, ...d } = i, f = {
|
|
1298
|
+
...d,
|
|
1299
|
+
[z]: s,
|
|
1300
|
+
[S]: l,
|
|
1301
|
+
[D]: c,
|
|
1302
|
+
[Ee]: a,
|
|
1303
|
+
[q]: a,
|
|
1304
|
+
_source: "geology"
|
|
1305
|
+
};
|
|
1306
|
+
r.has(s) || r.set(s, []), r.get(s).push(f);
|
|
1307
|
+
}
|
|
1308
|
+
t({
|
|
1309
|
+
holes: Array.from(r.entries()).map(([o, i]) => ({
|
|
1310
|
+
holeId: o,
|
|
1311
|
+
points: i.sort((s, l) => s[S] - l[S])
|
|
1312
|
+
}))
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
});
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
async function Po({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
|
|
1319
|
+
const [r, o, i] = await Promise.all([
|
|
1320
|
+
e ? On(e) : Promise.resolve([]),
|
|
1321
|
+
t ? Cn(t).then(
|
|
1322
|
+
({ rows: l }) => Pn(l.map((c) => ({ ...c, _source: "structural" })))
|
|
1323
|
+
) : Promise.resolve([]),
|
|
1324
|
+
n ? kn(n).then(({ holes: l }) => l) : Promise.resolve([])
|
|
1325
|
+
]), s = new Map(r.map((l) => [l.holeId, { ...l, points: [...l.points] }]));
|
|
1326
|
+
for (const l of [...o, ...i]) {
|
|
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 || []] });
|
|
1212
1332
|
} else
|
|
1213
|
-
|
|
1333
|
+
s.set(c, l);
|
|
1214
1334
|
}
|
|
1215
|
-
return { holes: Array.from(
|
|
1335
|
+
return { holes: Array.from(s.values()) };
|
|
1216
1336
|
}
|
|
1217
|
-
function
|
|
1337
|
+
function Ln(e, t) {
|
|
1218
1338
|
if (!e || e.length === 0 || !Number.isFinite(t)) return null;
|
|
1219
1339
|
const n = e.length;
|
|
1220
1340
|
if (n === 1) {
|
|
1221
|
-
const
|
|
1222
|
-
return { x: Number(
|
|
1341
|
+
const g = e[0];
|
|
1342
|
+
return { x: Number(g.x), y: Number(g.y), z: Number(g.z), dx: 0, dy: 0, dz: -1 };
|
|
1223
1343
|
}
|
|
1224
1344
|
let r = -1;
|
|
1225
|
-
for (let
|
|
1226
|
-
const
|
|
1227
|
-
if (t >=
|
|
1228
|
-
r =
|
|
1345
|
+
for (let g = 0; g < n - 1; g++) {
|
|
1346
|
+
const v = Number(e[g].md), M = Number(e[g + 1].md);
|
|
1347
|
+
if (t >= v && t <= M) {
|
|
1348
|
+
r = g;
|
|
1229
1349
|
break;
|
|
1230
1350
|
}
|
|
1231
1351
|
}
|
|
1232
|
-
let o,
|
|
1352
|
+
let o, i, s;
|
|
1233
1353
|
if (r === -1) {
|
|
1234
|
-
t < Number(e[0].md) ? (o = e[0],
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1354
|
+
t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
|
|
1355
|
+
const g = Number(o.md), M = Number(i.md) - g;
|
|
1356
|
+
s = M > 0 ? (t - g) / M : t < g ? 0 : 1;
|
|
1237
1357
|
} else {
|
|
1238
|
-
o = e[r],
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1241
|
-
}
|
|
1242
|
-
const
|
|
1243
|
-
let
|
|
1244
|
-
const f = Number(o.azimuth),
|
|
1245
|
-
if (Number.isFinite(f) && Number.isFinite(
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1358
|
+
o = e[r], i = e[r + 1];
|
|
1359
|
+
const g = Number(o.md), M = Number(i.md) - g;
|
|
1360
|
+
s = M > 0 ? (t - g) / M : 0;
|
|
1361
|
+
}
|
|
1362
|
+
const l = Number(o.x) + s * (Number(i.x) - Number(o.x)), c = Number(o.y) + s * (Number(i.y) - Number(o.y)), a = Number(o.z) + s * (Number(i.z) - Number(o.z));
|
|
1363
|
+
let u, m, d;
|
|
1364
|
+
const f = Number(o.azimuth), p = Number(o.dip), b = Number(i.azimuth), h = Number(i.dip);
|
|
1365
|
+
if (Number.isFinite(f) && Number.isFinite(p)) {
|
|
1366
|
+
const g = Number.isFinite(b) && Number.isFinite(h) ? f + s * (b - f) : f, v = Number.isFinite(b) && Number.isFinite(h) ? p + s * (h - p) : p, M = g * Math.PI / 180, E = v * Math.PI / 180;
|
|
1367
|
+
u = Math.cos(E) * Math.sin(M), m = Math.cos(E) * Math.cos(M), d = -Math.sin(E);
|
|
1248
1368
|
} else {
|
|
1249
|
-
const
|
|
1250
|
-
if (
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
const _ = Math.sqrt(
|
|
1254
|
-
return _ < 1e-10 ? { x:
|
|
1255
|
-
}
|
|
1256
|
-
function
|
|
1257
|
-
const { betaZeroAxis: o = "B", betaHandedness:
|
|
1258
|
-
let
|
|
1259
|
-
const m =
|
|
1260
|
-
Math.abs(m) > 0.99 && (
|
|
1369
|
+
const g = Number(i.x) - Number(o.x), v = Number(i.y) - Number(o.y), M = Number(i.z) - Number(o.z), E = Math.sqrt(g * g + v * v + M * M);
|
|
1370
|
+
if (E < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
|
|
1371
|
+
u = g / E, m = v / E, d = M / E;
|
|
1372
|
+
}
|
|
1373
|
+
const _ = Math.sqrt(u * u + m * m + d * d);
|
|
1374
|
+
return _ < 1e-10 ? { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: c, z: a, dx: u / _, dy: m / _, dz: d / _ };
|
|
1375
|
+
}
|
|
1376
|
+
function Fn(e, t, n, r = {}) {
|
|
1377
|
+
const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: c } = n, a = [s, l, c];
|
|
1378
|
+
let u = [0, 0, 1];
|
|
1379
|
+
const m = a[0] * u[0] + a[1] * u[1] + a[2] * u[2];
|
|
1380
|
+
Math.abs(m) > 0.99 && (u = [0, 1, 0]);
|
|
1261
1381
|
const d = [
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
], f = Math.sqrt(d[0] ** 2 + d[1] ** 2 + d[2] ** 2),
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
], h = Math.sqrt(
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
],
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1278
|
-
return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx:
|
|
1279
|
-
}
|
|
1280
|
-
function
|
|
1382
|
+
u[1] * a[2] - u[2] * a[1],
|
|
1383
|
+
u[2] * a[0] - u[0] * a[2],
|
|
1384
|
+
u[0] * a[1] - u[1] * a[0]
|
|
1385
|
+
], f = Math.sqrt(d[0] ** 2 + d[1] ** 2 + d[2] ** 2), p = f > 1e-10 ? [d[0] / f, d[1] / f, d[2] / f] : [1, 0, 0], b = [
|
|
1386
|
+
a[1] * p[2] - a[2] * p[1],
|
|
1387
|
+
a[2] * p[0] - a[0] * p[2],
|
|
1388
|
+
a[0] * p[1] - a[1] * p[0]
|
|
1389
|
+
], h = Math.sqrt(b[0] ** 2 + b[1] ** 2 + b[2] ** 2), _ = h > 1e-10 ? [b[0] / h, b[1] / h, b[2] / h] : [0, 1, 0], g = o === "R" ? p : _, v = t * Math.PI / 180 * i, M = Math.cos(v), E = Math.sin(v), P = g[0] * a[0] + g[1] * a[1] + g[2] * a[2], C = [
|
|
1390
|
+
a[1] * g[2] - a[2] * g[1],
|
|
1391
|
+
a[2] * g[0] - a[0] * g[2],
|
|
1392
|
+
a[0] * g[1] - a[1] * g[0]
|
|
1393
|
+
], L = [
|
|
1394
|
+
g[0] * M + C[0] * E + a[0] * P * (1 - M),
|
|
1395
|
+
g[1] * M + C[1] * E + a[1] * P * (1 - M),
|
|
1396
|
+
g[2] * M + C[2] * E + a[2] * P * (1 - M)
|
|
1397
|
+
], k = (90 - e) * Math.PI / 180, G = Math.cos(k), X = Math.sin(k), F = G * L[0] + X * a[0], Y = G * L[1] + X * a[1], j = G * L[2] + X * a[2], A = Math.sqrt(F * F + Y * Y + j * j);
|
|
1398
|
+
return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: F / A, ny: Y / A, nz: j / A };
|
|
1399
|
+
}
|
|
1400
|
+
function Tn(e, t, n = {}) {
|
|
1281
1401
|
if (!(e != null && e.length) || !(t != null && t.length)) return [];
|
|
1282
1402
|
const r = /* @__PURE__ */ new Map();
|
|
1283
|
-
for (const
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1403
|
+
for (const i of t) {
|
|
1404
|
+
const s = i.hole_id != null ? `${i.hole_id}`.trim().toLowerCase() : "";
|
|
1405
|
+
s && (r.has(s) || r.set(s, []), r.get(s).push(i));
|
|
1286
1406
|
}
|
|
1287
|
-
for (const [,
|
|
1288
|
-
|
|
1407
|
+
for (const [, i] of r)
|
|
1408
|
+
i.sort((s, l) => Number(s.md) - Number(l.md));
|
|
1289
1409
|
const o = [];
|
|
1290
|
-
for (const
|
|
1291
|
-
const
|
|
1292
|
-
if (!
|
|
1293
|
-
const
|
|
1294
|
-
if (!
|
|
1295
|
-
const
|
|
1296
|
-
if (!Number.isFinite(
|
|
1297
|
-
const
|
|
1298
|
-
if (!
|
|
1299
|
-
const { x:
|
|
1300
|
-
let h, _,
|
|
1301
|
-
const
|
|
1302
|
-
if (Number.isFinite(
|
|
1303
|
-
const
|
|
1304
|
-
h =
|
|
1410
|
+
for (const i of e) {
|
|
1411
|
+
const s = i.hole_id != null ? `${i.hole_id}`.trim().toLowerCase() : "";
|
|
1412
|
+
if (!s) continue;
|
|
1413
|
+
const l = r.get(s);
|
|
1414
|
+
if (!l || l.length === 0) continue;
|
|
1415
|
+
const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
|
|
1416
|
+
if (!Number.isFinite(c)) continue;
|
|
1417
|
+
const a = Ln(l, c);
|
|
1418
|
+
if (!a) continue;
|
|
1419
|
+
const { x: u, y: m, z: d, dx: f, dy: p, dz: b } = a;
|
|
1420
|
+
let h, _, g;
|
|
1421
|
+
const v = i.alpha != null ? Number(i.alpha) : null, M = i.beta != null ? Number(i.beta) : null;
|
|
1422
|
+
if (Number.isFinite(v)) {
|
|
1423
|
+
const E = Number.isFinite(M) ? M : 0, P = Fn(v, E, { dx: f, dy: p, dz: b }, n);
|
|
1424
|
+
h = P.nx, _ = P.ny, g = P.nz;
|
|
1305
1425
|
} else {
|
|
1306
|
-
const
|
|
1307
|
-
if (!Number.isFinite(
|
|
1308
|
-
const
|
|
1309
|
-
h = Math.sin(
|
|
1426
|
+
const E = i.dip != null ? Number(i.dip) : null, P = i.azimuth != null ? Number(i.azimuth) : null;
|
|
1427
|
+
if (!Number.isFinite(E) || !Number.isFinite(P)) continue;
|
|
1428
|
+
const C = E * Math.PI / 180, L = P * Math.PI / 180;
|
|
1429
|
+
h = Math.sin(L) * Math.sin(C), _ = Math.cos(L) * Math.sin(C), g = Math.cos(C);
|
|
1310
1430
|
}
|
|
1311
|
-
o.push({ ...
|
|
1431
|
+
o.push({ ...i, x: u, y: m, z: d, nx: h, ny: _, nz: g });
|
|
1312
1432
|
}
|
|
1313
1433
|
return o;
|
|
1314
1434
|
}
|
|
1315
|
-
const
|
|
1316
|
-
function
|
|
1435
|
+
const ot = "#8b1e3f", $n = "#a8324f", Vn = "#6b7280", Hn = { l: 42, r: 4, t: 4, b: 30 }, it = 10, st = 12;
|
|
1436
|
+
function lt(e) {
|
|
1317
1437
|
return e ? typeof e == "string" ? { text: e } : e : {};
|
|
1318
1438
|
}
|
|
1319
|
-
function
|
|
1320
|
-
const t =
|
|
1439
|
+
function St(e = {}) {
|
|
1440
|
+
const t = lt(e.xaxis && e.xaxis.title), n = lt(e.yaxis && e.yaxis.title);
|
|
1321
1441
|
return {
|
|
1322
1442
|
...e,
|
|
1323
|
-
margin:
|
|
1443
|
+
margin: Hn,
|
|
1324
1444
|
autosize: !0,
|
|
1325
1445
|
width: void 0,
|
|
1326
1446
|
xaxis: {
|
|
1327
1447
|
...e.xaxis || {},
|
|
1328
1448
|
tickfont: {
|
|
1329
1449
|
...e.xaxis && e.xaxis.tickfont || {},
|
|
1330
|
-
size:
|
|
1450
|
+
size: it
|
|
1331
1451
|
},
|
|
1332
1452
|
title: {
|
|
1333
1453
|
...t,
|
|
1334
|
-
font: { ...t.font || {}, size:
|
|
1454
|
+
font: { ...t.font || {}, size: st }
|
|
1335
1455
|
}
|
|
1336
1456
|
},
|
|
1337
1457
|
yaxis: {
|
|
1338
1458
|
...e.yaxis || {},
|
|
1459
|
+
automargin: !0,
|
|
1339
1460
|
tickfont: {
|
|
1340
1461
|
...e.yaxis && e.yaxis.tickfont || {},
|
|
1341
|
-
size:
|
|
1462
|
+
size: it
|
|
1342
1463
|
},
|
|
1343
1464
|
title: {
|
|
1344
1465
|
...n,
|
|
1345
|
-
font: { ...n.font || {}, size:
|
|
1466
|
+
font: { ...n.font || {}, size: st }
|
|
1346
1467
|
}
|
|
1347
1468
|
}
|
|
1348
1469
|
};
|
|
1349
1470
|
}
|
|
1350
|
-
function
|
|
1471
|
+
function wn(e, t) {
|
|
1351
1472
|
var r;
|
|
1352
1473
|
if (!e || !t) return !1;
|
|
1353
1474
|
const n = e.points || [];
|
|
1354
1475
|
for (let o = 0; o < n.length; o += 1) {
|
|
1355
|
-
const
|
|
1356
|
-
if (
|
|
1476
|
+
const i = (r = n[o]) == null ? void 0 : r[t];
|
|
1477
|
+
if (i != null && (typeof i == "number" && Number.isFinite(i) || typeof i == "string" && i.trim() !== ""))
|
|
1357
1478
|
return !0;
|
|
1358
1479
|
}
|
|
1359
1480
|
return !1;
|
|
1360
1481
|
}
|
|
1361
|
-
function
|
|
1482
|
+
function jn(e, t, n) {
|
|
1362
1483
|
if (!e || !t) return [];
|
|
1363
|
-
const r = (e == null ? void 0 : e.points) || [], o = [],
|
|
1364
|
-
return r.forEach((
|
|
1365
|
-
let
|
|
1366
|
-
|
|
1367
|
-
),
|
|
1368
|
-
|
|
1484
|
+
const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
|
|
1485
|
+
return r.forEach((s) => {
|
|
1486
|
+
let l = Number(
|
|
1487
|
+
s.from ?? s.samp_from ?? s.sample_from ?? s.fromdepth ?? s.from_depth ?? s.depth_from
|
|
1488
|
+
), c = Number(
|
|
1489
|
+
s.to ?? s.samp_to ?? s.sample_to ?? s.todepth ?? s.to_depth ?? s.depth_to
|
|
1369
1490
|
);
|
|
1370
|
-
if (!Number.isFinite(
|
|
1371
|
-
const f = Number(
|
|
1372
|
-
Number.isFinite(f) && (
|
|
1491
|
+
if (!Number.isFinite(l) || !Number.isFinite(c)) {
|
|
1492
|
+
const f = Number(s.depth ?? s.md);
|
|
1493
|
+
Number.isFinite(f) && (l = f, c = f);
|
|
1373
1494
|
}
|
|
1374
|
-
const
|
|
1375
|
-
if (!Number.isFinite(
|
|
1376
|
-
const
|
|
1377
|
-
if (
|
|
1378
|
-
|
|
1379
|
-
const m = (
|
|
1495
|
+
const a = s == null ? void 0 : s[t];
|
|
1496
|
+
if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
|
|
1497
|
+
const u = `${t}:${l}-${c}:${String(a)}`;
|
|
1498
|
+
if (i.has(u)) return;
|
|
1499
|
+
i.add(u);
|
|
1500
|
+
const m = (l + c) / 2, d = n ? a : Number(a);
|
|
1380
1501
|
!n && !Number.isFinite(d) || o.push({
|
|
1381
1502
|
z: m,
|
|
1382
1503
|
val: d,
|
|
1383
|
-
from:
|
|
1384
|
-
to:
|
|
1385
|
-
errorPlus:
|
|
1386
|
-
errorMinus: m -
|
|
1504
|
+
from: l,
|
|
1505
|
+
to: c,
|
|
1506
|
+
errorPlus: c - m,
|
|
1507
|
+
errorMinus: m - l
|
|
1387
1508
|
});
|
|
1388
|
-
}), o.sort((
|
|
1509
|
+
}), o.sort((s, l) => l.z - s.z);
|
|
1389
1510
|
}
|
|
1390
|
-
function
|
|
1511
|
+
function Rn(e, t) {
|
|
1391
1512
|
if (!e.length) return { data: [], layout: {} };
|
|
1392
|
-
const n =
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1513
|
+
const n = e.filter((c) => Number.isFinite(c == null ? void 0 : c.from) && Number.isFinite(c == null ? void 0 : c.to) && c.to > c.from).map((c) => ({ ...c, category: `${(c == null ? void 0 : c.val) ?? ""}`.trim() })).filter((c) => c.category !== "" && !/^(nan|null|none)$/i.test(c.category)).sort((c, a) => c.from - a.from || c.to - a.to);
|
|
1514
|
+
if (!n.length) return { data: [], layout: {} };
|
|
1515
|
+
const r = [
|
|
1516
|
+
"#1f77b4",
|
|
1517
|
+
// blue
|
|
1518
|
+
"#ff7f0e",
|
|
1519
|
+
// orange
|
|
1520
|
+
"#2ca02c",
|
|
1521
|
+
// green
|
|
1522
|
+
"#d62728",
|
|
1523
|
+
// red
|
|
1524
|
+
"#9467bd",
|
|
1525
|
+
// purple
|
|
1526
|
+
"#17becf",
|
|
1527
|
+
// cyan
|
|
1528
|
+
"#bcbd22",
|
|
1529
|
+
// olive
|
|
1530
|
+
"#e377c2",
|
|
1531
|
+
// pink
|
|
1532
|
+
"#8c564b",
|
|
1533
|
+
// brown
|
|
1534
|
+
"#393b79",
|
|
1535
|
+
// indigo
|
|
1536
|
+
"#e6550d",
|
|
1537
|
+
// deep orange
|
|
1538
|
+
"#31a354",
|
|
1539
|
+
// deep green
|
|
1540
|
+
"#756bb1",
|
|
1541
|
+
// violet
|
|
1542
|
+
"#636363"
|
|
1543
|
+
// dark gray
|
|
1544
|
+
], o = [...new Set(n.map((c) => c.category))], i = new Map(o.map((c, a) => [c, r[a % r.length]]));
|
|
1545
|
+
return { data: o.map((c) => {
|
|
1546
|
+
const a = n.filter((u) => u.category === c);
|
|
1547
|
+
return {
|
|
1548
|
+
type: "bar",
|
|
1549
|
+
x: a.map(() => 0.5),
|
|
1550
|
+
y: a.map((u) => u.to - u.from),
|
|
1551
|
+
base: a.map((u) => u.from),
|
|
1552
|
+
width: 1,
|
|
1553
|
+
marker: { color: i.get(c), line: { width: 0 } },
|
|
1554
|
+
name: c,
|
|
1555
|
+
showlegend: !1,
|
|
1556
|
+
customdata: a.map((u) => [u.from, u.to]),
|
|
1557
|
+
hovertemplate: `${t}: ${c}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
|
|
1558
|
+
};
|
|
1559
|
+
}), layout: St({
|
|
1560
|
+
barmode: "overlay",
|
|
1561
|
+
bargap: 0,
|
|
1423
1562
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1424
1563
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
1425
|
-
shapes: c,
|
|
1426
1564
|
showlegend: !1,
|
|
1427
1565
|
title: t || void 0
|
|
1428
1566
|
}) };
|
|
1429
1567
|
}
|
|
1430
|
-
function
|
|
1568
|
+
function Bn(e, t, n) {
|
|
1431
1569
|
if (!e.length) return { data: [], layout: {} };
|
|
1432
|
-
const r = n === "bar", o = n === "markers",
|
|
1433
|
-
x: e.map((
|
|
1434
|
-
y: e.map((
|
|
1435
|
-
hovertemplate: `${t}: %{x}<br>from: %{customdata[0]} to: %{customdata[1]}<extra></extra>`,
|
|
1436
|
-
customdata: e.map((
|
|
1437
|
-
},
|
|
1570
|
+
const r = n === "bar", o = n === "markers", i = n === "line", s = {
|
|
1571
|
+
x: e.map((u) => u.val),
|
|
1572
|
+
y: e.map((u) => u.z),
|
|
1573
|
+
hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
|
|
1574
|
+
customdata: e.map((u) => [Math.min(u.from, u.to), Math.max(u.from, u.to)])
|
|
1575
|
+
}, l = {
|
|
1438
1576
|
type: "data",
|
|
1439
1577
|
symmetric: !1,
|
|
1440
|
-
array: e.map((
|
|
1441
|
-
arrayminus: e.map((
|
|
1578
|
+
array: e.map((u) => u.errorPlus),
|
|
1579
|
+
arrayminus: e.map((u) => u.errorMinus),
|
|
1442
1580
|
thickness: 1.5,
|
|
1443
1581
|
width: 2,
|
|
1444
|
-
color:
|
|
1582
|
+
color: Vn
|
|
1445
1583
|
};
|
|
1446
1584
|
return { data: [r ? {
|
|
1447
|
-
...
|
|
1585
|
+
...s,
|
|
1448
1586
|
type: "bar",
|
|
1449
1587
|
orientation: "h",
|
|
1450
|
-
marker: { color:
|
|
1451
|
-
error_y:
|
|
1588
|
+
marker: { color: ot },
|
|
1589
|
+
error_y: l
|
|
1452
1590
|
} : {
|
|
1453
|
-
...
|
|
1591
|
+
...s,
|
|
1454
1592
|
type: "scatter",
|
|
1455
|
-
mode: o ? "markers" :
|
|
1456
|
-
line: { color:
|
|
1457
|
-
marker: { size: 7, color:
|
|
1458
|
-
error_y:
|
|
1459
|
-
}], layout:
|
|
1593
|
+
mode: o ? "markers" : i ? "lines" : "lines+markers",
|
|
1594
|
+
line: { color: ot, width: 2 },
|
|
1595
|
+
marker: { size: 7, color: $n },
|
|
1596
|
+
error_y: i ? void 0 : l
|
|
1597
|
+
}], layout: St({
|
|
1460
1598
|
xaxis: { title: t, zeroline: !1 },
|
|
1461
1599
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
1462
1600
|
barmode: "overlay",
|
|
1463
1601
|
showlegend: !1
|
|
1464
1602
|
}) };
|
|
1465
1603
|
}
|
|
1466
|
-
function
|
|
1467
|
-
return !e || !e.length || !n ? { data: [], layout: {} } : t || r === "categorical" ?
|
|
1604
|
+
function Dt({ points: e, isCategorical: t, property: n, chartType: r }) {
|
|
1605
|
+
return !e || !e.length || !n ? { data: [], layout: {} } : t || r === "categorical" ? Rn(e, n) : Bn(e, n, r);
|
|
1468
1606
|
}
|
|
1469
|
-
|
|
1607
|
+
function Co(e = [], {
|
|
1608
|
+
fromCol: t = "from",
|
|
1609
|
+
toCol: n = "to",
|
|
1610
|
+
categoryCol: r = "geology_code"
|
|
1611
|
+
} = {}) {
|
|
1612
|
+
const o = [];
|
|
1613
|
+
return e.forEach((i) => {
|
|
1614
|
+
const s = Number(i == null ? void 0 : i[t]), l = Number(i == null ? void 0 : i[n]), c = i == null ? void 0 : i[r];
|
|
1615
|
+
if (!Number.isFinite(s) || !Number.isFinite(l) || l <= s || c == null || `${c}`.trim() === "") return;
|
|
1616
|
+
const a = (s + l) / 2;
|
|
1617
|
+
o.push({
|
|
1618
|
+
z: a,
|
|
1619
|
+
val: `${c}`,
|
|
1620
|
+
from: s,
|
|
1621
|
+
to: l,
|
|
1622
|
+
errorPlus: l - a,
|
|
1623
|
+
errorMinus: a - s
|
|
1624
|
+
});
|
|
1625
|
+
}), o.sort((i, s) => s.z - i.z), Dt({
|
|
1626
|
+
points: o,
|
|
1627
|
+
isCategorical: !0,
|
|
1628
|
+
property: r,
|
|
1629
|
+
chartType: "categorical"
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
const Pt = [
|
|
1470
1633
|
"#0f172a",
|
|
1471
1634
|
"#1e3a5f",
|
|
1472
1635
|
"#7c3aed",
|
|
@@ -1477,91 +1640,92 @@ const zt = [
|
|
|
1477
1640
|
"#db2777",
|
|
1478
1641
|
"#65a30d",
|
|
1479
1642
|
"#9333ea"
|
|
1480
|
-
],
|
|
1481
|
-
function
|
|
1643
|
+
], Gn = { l: 42, r: 4, t: 4, b: 30 }, at = 10, ct = 12;
|
|
1644
|
+
function Ct(e = {}) {
|
|
1482
1645
|
return {
|
|
1483
1646
|
...e,
|
|
1484
|
-
margin:
|
|
1647
|
+
margin: Gn,
|
|
1485
1648
|
autosize: !0,
|
|
1486
1649
|
width: void 0,
|
|
1487
1650
|
xaxis: {
|
|
1488
1651
|
...e.xaxis || {},
|
|
1489
1652
|
tickfont: {
|
|
1490
1653
|
...e.xaxis && e.xaxis.tickfont || {},
|
|
1491
|
-
size:
|
|
1654
|
+
size: at
|
|
1492
1655
|
},
|
|
1493
1656
|
title: {
|
|
1494
1657
|
...e.xaxis && e.xaxis.title || {},
|
|
1495
1658
|
font: {
|
|
1496
1659
|
...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
|
|
1497
|
-
size:
|
|
1660
|
+
size: ct
|
|
1498
1661
|
}
|
|
1499
1662
|
}
|
|
1500
1663
|
},
|
|
1501
1664
|
yaxis: {
|
|
1502
1665
|
...e.yaxis || {},
|
|
1666
|
+
automargin: !0,
|
|
1503
1667
|
tickfont: {
|
|
1504
1668
|
...e.yaxis && e.yaxis.tickfont || {},
|
|
1505
|
-
size:
|
|
1669
|
+
size: at
|
|
1506
1670
|
},
|
|
1507
1671
|
title: {
|
|
1508
1672
|
...e.yaxis && e.yaxis.title || {},
|
|
1509
1673
|
font: {
|
|
1510
1674
|
...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
|
|
1511
|
-
size:
|
|
1675
|
+
size: ct
|
|
1512
1676
|
}
|
|
1513
1677
|
}
|
|
1514
1678
|
}
|
|
1515
1679
|
};
|
|
1516
1680
|
}
|
|
1517
|
-
function
|
|
1681
|
+
function Yn(e, {
|
|
1518
1682
|
tailScale: t = 5,
|
|
1519
1683
|
colorBy: n = null,
|
|
1520
|
-
palette: r =
|
|
1521
|
-
depthCol: o =
|
|
1522
|
-
dipCol:
|
|
1523
|
-
azCol:
|
|
1684
|
+
palette: r = Pt,
|
|
1685
|
+
depthCol: o = q,
|
|
1686
|
+
dipCol: i = B,
|
|
1687
|
+
azCol: s = R
|
|
1524
1688
|
} = {}) {
|
|
1525
|
-
const
|
|
1526
|
-
(
|
|
1689
|
+
const l = e.filter(
|
|
1690
|
+
(p) => p[o] != null && p[i] != null && p[s] != null
|
|
1527
1691
|
);
|
|
1528
|
-
if (!
|
|
1692
|
+
if (!l.length)
|
|
1529
1693
|
return { data: [], layout: {} };
|
|
1530
|
-
const
|
|
1531
|
-
n && [...new Set(
|
|
1532
|
-
|
|
1694
|
+
const c = {};
|
|
1695
|
+
n && [...new Set(l.map((b) => b[n]).filter((b) => b != null))].sort().forEach((b, h) => {
|
|
1696
|
+
c[b] = r[h % r.length];
|
|
1533
1697
|
});
|
|
1534
|
-
const
|
|
1535
|
-
for (const
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
const
|
|
1539
|
-
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1698
|
+
const a = /* @__PURE__ */ new Map(), u = [];
|
|
1699
|
+
for (const p of l) {
|
|
1700
|
+
const b = Number(p[o]), h = Number(p[i]), _ = Number(p[s]), g = n ? p[n] ?? "_default" : "_default", v = n ? c[g] ?? "#0f172a" : "#0f172a";
|
|
1701
|
+
a.has(g) || a.set(g, { xs: [], ys: [], dips: [], azs: [], color: v });
|
|
1702
|
+
const M = a.get(g);
|
|
1703
|
+
M.xs.push(h), M.ys.push(b), M.dips.push(h), M.azs.push(_);
|
|
1704
|
+
const E = _ * Math.PI / 180, P = t * (Math.abs(h) / 90), C = Math.sin(E) * P, L = Math.cos(E) * P;
|
|
1705
|
+
u.push({
|
|
1542
1706
|
type: "line",
|
|
1543
1707
|
x0: h,
|
|
1544
|
-
y0:
|
|
1545
|
-
x1: h +
|
|
1546
|
-
y1:
|
|
1547
|
-
line: { color:
|
|
1708
|
+
y0: b,
|
|
1709
|
+
x1: h + C,
|
|
1710
|
+
y1: b + L,
|
|
1711
|
+
line: { color: v, width: 2 }
|
|
1548
1712
|
});
|
|
1549
1713
|
}
|
|
1550
|
-
const m = [], d = n &&
|
|
1551
|
-
for (const [
|
|
1714
|
+
const m = [], d = n && a.size > 1;
|
|
1715
|
+
for (const [p, b] of a.entries())
|
|
1552
1716
|
m.push({
|
|
1553
1717
|
type: "scatter",
|
|
1554
|
-
x:
|
|
1555
|
-
y:
|
|
1718
|
+
x: b.xs,
|
|
1719
|
+
y: b.ys,
|
|
1556
1720
|
mode: "markers",
|
|
1557
|
-
name:
|
|
1558
|
-
marker: { size: 8, color:
|
|
1559
|
-
showlegend: d &&
|
|
1560
|
-
customdata:
|
|
1721
|
+
name: p !== "_default" ? String(p) : void 0,
|
|
1722
|
+
marker: { size: 8, color: b.color },
|
|
1723
|
+
showlegend: d && p !== "_default",
|
|
1724
|
+
customdata: b.dips.map((h, _) => [h, b.azs[_]]),
|
|
1561
1725
|
hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
|
|
1562
1726
|
});
|
|
1563
1727
|
return { data: m, layout: {
|
|
1564
|
-
shapes:
|
|
1728
|
+
shapes: u,
|
|
1565
1729
|
height: 400,
|
|
1566
1730
|
margin: { l: 40, r: 10, t: 10, b: 40 },
|
|
1567
1731
|
xaxis: {
|
|
@@ -1575,23 +1739,23 @@ function En(e, {
|
|
|
1575
1739
|
showlegend: !!d
|
|
1576
1740
|
} };
|
|
1577
1741
|
}
|
|
1578
|
-
function
|
|
1742
|
+
function Oo(e, {
|
|
1579
1743
|
labelCol: t = "structure_type",
|
|
1580
|
-
palette: n =
|
|
1581
|
-
fromCol: r =
|
|
1582
|
-
toCol: o =
|
|
1744
|
+
palette: n = Pt,
|
|
1745
|
+
fromCol: r = S,
|
|
1746
|
+
toCol: o = D
|
|
1583
1747
|
} = {}) {
|
|
1584
|
-
const
|
|
1748
|
+
const i = e.filter((m) => m[r] != null && m[o] != null && Number(m[o]) > Number(m[r])).filter((m) => {
|
|
1585
1749
|
const d = m[t];
|
|
1586
1750
|
if (d == null) return !1;
|
|
1587
1751
|
const f = String(d).trim();
|
|
1588
1752
|
return f !== "" && !/^(nan|null|none)$/i.test(f);
|
|
1589
1753
|
}).map((m) => ({ from: Number(m[r]), to: Number(m[o]), label: String(m[t]).trim() })).sort((m, d) => m.from - d.from);
|
|
1590
|
-
if (!
|
|
1754
|
+
if (!i.length)
|
|
1591
1755
|
return { data: [], layout: {} };
|
|
1592
|
-
const
|
|
1593
|
-
return
|
|
1594
|
-
|
|
1756
|
+
const s = [], l = [], c = [];
|
|
1757
|
+
return i.forEach((m, d) => {
|
|
1758
|
+
s.push({
|
|
1595
1759
|
type: "rect",
|
|
1596
1760
|
xref: "x",
|
|
1597
1761
|
yref: "y",
|
|
@@ -1600,52 +1764,53 @@ function Xr(e, {
|
|
|
1600
1764
|
y0: m.from,
|
|
1601
1765
|
y1: m.to,
|
|
1602
1766
|
fillcolor: n[d % n.length],
|
|
1603
|
-
line: { width: 0 }
|
|
1604
|
-
|
|
1767
|
+
line: { width: 0 },
|
|
1768
|
+
layer: "below"
|
|
1769
|
+
}), l.push(0.5 * (m.from + m.to)), c.push(m.label);
|
|
1605
1770
|
}), { data: [{
|
|
1606
1771
|
type: "scatter",
|
|
1607
|
-
x: Array(
|
|
1608
|
-
y:
|
|
1772
|
+
x: Array(c.length).fill(0.5),
|
|
1773
|
+
y: l,
|
|
1609
1774
|
mode: "text",
|
|
1610
|
-
text:
|
|
1775
|
+
text: c,
|
|
1611
1776
|
textposition: "middle center",
|
|
1612
1777
|
showlegend: !1,
|
|
1613
1778
|
hoverinfo: "text"
|
|
1614
|
-
}], layout:
|
|
1615
|
-
shapes:
|
|
1779
|
+
}], layout: Ct({
|
|
1780
|
+
shapes: s,
|
|
1616
1781
|
height: 400,
|
|
1617
1782
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1618
1783
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1619
1784
|
showlegend: !1
|
|
1620
1785
|
}) };
|
|
1621
1786
|
}
|
|
1622
|
-
function
|
|
1787
|
+
function ut(e, t) {
|
|
1623
1788
|
if (!e) return "";
|
|
1624
1789
|
const n = String(e).trim().split(/\s+/), r = [];
|
|
1625
1790
|
let o = "";
|
|
1626
|
-
for (const
|
|
1627
|
-
o && o.length + 1 +
|
|
1791
|
+
for (const i of n)
|
|
1792
|
+
o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
|
|
1628
1793
|
return o && r.push(o), r.join("<br>");
|
|
1629
1794
|
}
|
|
1630
|
-
function
|
|
1795
|
+
function Un(e, {
|
|
1631
1796
|
commentCol: t = "comments",
|
|
1632
|
-
fromCol: n =
|
|
1633
|
-
toCol: r =
|
|
1797
|
+
fromCol: n = S,
|
|
1798
|
+
toCol: r = D,
|
|
1634
1799
|
bgColor: o = "#f1f5f9",
|
|
1635
|
-
borderColor:
|
|
1636
|
-
textColor:
|
|
1637
|
-
charsPerLine:
|
|
1800
|
+
borderColor: i = "#cbd5e1",
|
|
1801
|
+
textColor: s = "#1e293b",
|
|
1802
|
+
charsPerLine: l = 18
|
|
1638
1803
|
} = {}) {
|
|
1639
|
-
const
|
|
1640
|
-
const _ = h[t],
|
|
1641
|
-
return { from: Number(h[n]), to: Number(h[r]), comment:
|
|
1804
|
+
const c = e.filter((h) => h[n] != null && h[r] != null && Number(h[r]) > Number(h[n])).map((h) => {
|
|
1805
|
+
const _ = h[t], g = _ != null && String(_).trim() !== "" && String(_) !== "null" ? String(_).trim() : "";
|
|
1806
|
+
return { from: Number(h[n]), to: Number(h[r]), comment: g };
|
|
1642
1807
|
}).sort((h, _) => h.from - _.from);
|
|
1643
|
-
if (!
|
|
1808
|
+
if (!c.length)
|
|
1644
1809
|
return { data: [], layout: {} };
|
|
1645
|
-
const
|
|
1646
|
-
for (const h of
|
|
1647
|
-
const _ = 0.5 * (h.from + h.to),
|
|
1648
|
-
|
|
1810
|
+
const a = [], u = [], m = [], d = [], f = [];
|
|
1811
|
+
for (const h of c) {
|
|
1812
|
+
const _ = 0.5 * (h.from + h.to), g = !!h.comment;
|
|
1813
|
+
a.push({
|
|
1649
1814
|
type: "rect",
|
|
1650
1815
|
xref: "x",
|
|
1651
1816
|
yref: "y",
|
|
@@ -1653,313 +1818,314 @@ function Sn(e, {
|
|
|
1653
1818
|
x1: 1,
|
|
1654
1819
|
y0: h.from,
|
|
1655
1820
|
y1: h.to,
|
|
1656
|
-
fillcolor:
|
|
1657
|
-
line: { color:
|
|
1658
|
-
|
|
1821
|
+
fillcolor: g ? o : "rgba(0,0,0,0)",
|
|
1822
|
+
line: { color: i, width: 1 },
|
|
1823
|
+
layer: "below"
|
|
1824
|
+
}), g && (u.push(0.5), m.push(_), d.push(ut(h.comment, l)), f.push(`${h.from.toFixed(3)}–${h.to.toFixed(3)} m<br>${ut(h.comment, 40)}`));
|
|
1659
1825
|
}
|
|
1660
|
-
return { data:
|
|
1826
|
+
return { data: u.length ? [{
|
|
1661
1827
|
type: "scatter",
|
|
1662
|
-
x:
|
|
1828
|
+
x: u,
|
|
1663
1829
|
y: m,
|
|
1664
1830
|
mode: "text",
|
|
1665
1831
|
text: d,
|
|
1666
1832
|
textposition: "middle center",
|
|
1667
|
-
textfont: { color:
|
|
1833
|
+
textfont: { color: s, size: 10 },
|
|
1668
1834
|
hovertext: f,
|
|
1669
1835
|
hoverinfo: "text",
|
|
1670
1836
|
showlegend: !1
|
|
1671
|
-
}] : [], layout:
|
|
1672
|
-
shapes:
|
|
1837
|
+
}] : [], layout: Ct({
|
|
1838
|
+
shapes: a,
|
|
1673
1839
|
height: 400,
|
|
1674
1840
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1675
1841
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1676
1842
|
showlegend: !1
|
|
1677
1843
|
}) };
|
|
1678
1844
|
}
|
|
1679
|
-
function
|
|
1845
|
+
function ko(e, {
|
|
1680
1846
|
symbolSize: t = 10,
|
|
1681
1847
|
xCol: n = "easting",
|
|
1682
1848
|
yCol: r = "northing"
|
|
1683
1849
|
} = {}) {
|
|
1684
|
-
const o = e[n] != null ? Number(e[n]) : null,
|
|
1685
|
-
if (o === null ||
|
|
1686
|
-
const
|
|
1850
|
+
const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[B] != null ? Number(e[B]) : null, l = e[R] != null ? Number(e[R]) : null;
|
|
1851
|
+
if (o === null || i === null || s === null || l === null) return null;
|
|
1852
|
+
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), p = f * Math.sin(u), b = f * Math.cos(u);
|
|
1687
1853
|
return {
|
|
1688
|
-
strike:
|
|
1689
|
-
dipValue:
|
|
1854
|
+
strike: c,
|
|
1855
|
+
dipValue: s,
|
|
1690
1856
|
x: o,
|
|
1691
|
-
y:
|
|
1857
|
+
y: i,
|
|
1692
1858
|
strikeX0: o - m,
|
|
1693
|
-
strikeY0:
|
|
1859
|
+
strikeY0: i - d,
|
|
1694
1860
|
strikeX1: o + m,
|
|
1695
|
-
strikeY1:
|
|
1696
|
-
tickX1: o +
|
|
1697
|
-
tickY1:
|
|
1861
|
+
strikeY1: i + d,
|
|
1862
|
+
tickX1: o + p,
|
|
1863
|
+
tickY1: i + b
|
|
1698
1864
|
};
|
|
1699
1865
|
}
|
|
1700
|
-
const
|
|
1701
|
-
function
|
|
1866
|
+
const Ot = "markers+line";
|
|
1867
|
+
function qn(e, t) {
|
|
1702
1868
|
var r;
|
|
1703
|
-
const n =
|
|
1704
|
-
return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) ||
|
|
1705
|
-
}
|
|
1706
|
-
function
|
|
1707
|
-
const
|
|
1708
|
-
return
|
|
1709
|
-
const h = m ===
|
|
1710
|
-
if (!
|
|
1711
|
-
const
|
|
1712
|
-
if (!
|
|
1713
|
-
let
|
|
1869
|
+
const n = Ue(e);
|
|
1870
|
+
return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Ot;
|
|
1871
|
+
}
|
|
1872
|
+
function Lo({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o }) {
|
|
1873
|
+
const i = pt(null), s = t == null ? void 0 : t.hole, l = (t == null ? void 0 : t.points) || [], c = (e == null ? void 0 : e.property) || "", a = (e == null ? void 0 : e.chartType) || Ot, u = (e == null ? void 0 : e.holeId) || "", m = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? xe : t != null && t.isCategorical ? Se : Ie), d = Ue(m), f = qn(m, a), [p, b] = J("");
|
|
1874
|
+
return me(() => {
|
|
1875
|
+
const h = m === xe, _ = m === Ge;
|
|
1876
|
+
if (!s || !c || !h && !_ && l.length === 0) return;
|
|
1877
|
+
const g = i.current;
|
|
1878
|
+
if (!g) return;
|
|
1879
|
+
let v;
|
|
1714
1880
|
try {
|
|
1715
|
-
h ?
|
|
1716
|
-
points:
|
|
1717
|
-
isCategorical: m ===
|
|
1718
|
-
property:
|
|
1881
|
+
h ? v = Un(l, { commentCol: c, fromCol: "from", toCol: "to" }) : _ ? v = Yn(l) : v = Dt({
|
|
1882
|
+
points: l,
|
|
1883
|
+
isCategorical: m === Se,
|
|
1884
|
+
property: c,
|
|
1719
1885
|
chartType: f
|
|
1720
1886
|
});
|
|
1721
|
-
} catch (
|
|
1722
|
-
console.error("Plot build error",
|
|
1887
|
+
} catch (E) {
|
|
1888
|
+
console.error("Plot build error", E), b((E == null ? void 0 : E.message) || "Plot build error");
|
|
1723
1889
|
return;
|
|
1724
1890
|
}
|
|
1725
|
-
if ((!(
|
|
1891
|
+
if ((!(v != null && v.data) || v.data.length === 0) && !h)
|
|
1726
1892
|
return;
|
|
1727
|
-
const
|
|
1893
|
+
const M = {
|
|
1728
1894
|
displayModeBar: !0,
|
|
1729
1895
|
responsive: !0,
|
|
1730
1896
|
useResizeHandler: !0,
|
|
1731
|
-
modeBarButtonsToRemove: ["select2d", "lasso2d", "
|
|
1897
|
+
modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
|
|
1732
1898
|
};
|
|
1733
1899
|
try {
|
|
1734
|
-
|
|
1735
|
-
|
|
1900
|
+
b(""), Pe.react(g, v.data, v.layout, M), requestAnimationFrame(() => {
|
|
1901
|
+
g && g.parentElement && Pe.Plots.resize(g);
|
|
1736
1902
|
});
|
|
1737
|
-
} catch (
|
|
1738
|
-
console.error("Plot render error",
|
|
1903
|
+
} catch (E) {
|
|
1904
|
+
console.error("Plot render error", E), b((E == null ? void 0 : E.message) || "Plot render error");
|
|
1739
1905
|
}
|
|
1740
1906
|
return () => {
|
|
1741
|
-
if (
|
|
1907
|
+
if (g)
|
|
1742
1908
|
try {
|
|
1743
|
-
|
|
1744
|
-
} catch (
|
|
1745
|
-
console.warn("Plot purge error",
|
|
1909
|
+
Pe.purge(g);
|
|
1910
|
+
} catch (E) {
|
|
1911
|
+
console.warn("Plot purge error", E);
|
|
1746
1912
|
}
|
|
1747
1913
|
};
|
|
1748
|
-
}, [
|
|
1749
|
-
const h =
|
|
1914
|
+
}, [s, c, f, m, l]), me(() => {
|
|
1915
|
+
const h = i.current;
|
|
1750
1916
|
if (!h || typeof ResizeObserver > "u") return;
|
|
1751
1917
|
const _ = new ResizeObserver(() => {
|
|
1752
1918
|
try {
|
|
1753
|
-
h && h.data &&
|
|
1754
|
-
} catch (
|
|
1755
|
-
console.warn("Plot resize error",
|
|
1919
|
+
h && h.data && Pe.Plots.resize(h);
|
|
1920
|
+
} catch (g) {
|
|
1921
|
+
console.warn("Plot resize error", g);
|
|
1756
1922
|
}
|
|
1757
1923
|
});
|
|
1758
1924
|
return _.observe(h), () => _.disconnect();
|
|
1759
|
-
}, []), !
|
|
1925
|
+
}, []), !s || !c ? /* @__PURE__ */ $("div", { className: "plot-card empty", children: /* @__PURE__ */ $("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : m !== xe && m !== Ge && l.length === 0 ? /* @__PURE__ */ $("div", { className: "plot-card empty", children: /* @__PURE__ */ $("div", { className: "placeholder", children: "No data" }) }) : p ? /* @__PURE__ */ $("div", { className: "plot-card empty", children: /* @__PURE__ */ Q("div", { className: "placeholder", children: [
|
|
1760
1926
|
"Plot error: ",
|
|
1761
|
-
|
|
1927
|
+
p
|
|
1762
1928
|
] }) }) : /* @__PURE__ */ Q("div", { className: "plot-card", children: [
|
|
1763
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ $("div", { className: "plot-title", children: /* @__PURE__ */ $(
|
|
1764
1930
|
"select",
|
|
1765
1931
|
{
|
|
1766
1932
|
className: "plot-select",
|
|
1767
|
-
value:
|
|
1933
|
+
value: u,
|
|
1768
1934
|
onChange: (h) => o && o({ holeId: h.target.value }),
|
|
1769
1935
|
children: n.map((h) => {
|
|
1770
|
-
const _ = typeof h == "string" ? h : h.holeId,
|
|
1771
|
-
return /* @__PURE__ */
|
|
1936
|
+
const _ = typeof h == "string" ? h : h.holeId, g = typeof h == "string" ? h : h.label || h.holeId;
|
|
1937
|
+
return /* @__PURE__ */ $("option", { value: _, children: g }, _);
|
|
1772
1938
|
})
|
|
1773
1939
|
}
|
|
1774
1940
|
) }),
|
|
1775
1941
|
/* @__PURE__ */ Q("div", { className: "plot-controls column", children: [
|
|
1776
|
-
r.length > 0 && /* @__PURE__ */
|
|
1942
|
+
r.length > 0 && /* @__PURE__ */ $(
|
|
1777
1943
|
"select",
|
|
1778
1944
|
{
|
|
1779
1945
|
className: "plot-select",
|
|
1780
|
-
value:
|
|
1946
|
+
value: c,
|
|
1781
1947
|
onChange: (h) => o && o({ property: h.target.value }),
|
|
1782
|
-
children: r.map((h) => /* @__PURE__ */
|
|
1948
|
+
children: r.map((h) => /* @__PURE__ */ $("option", { value: h, children: h }, h))
|
|
1783
1949
|
}
|
|
1784
1950
|
),
|
|
1785
|
-
d.length > 1 && /* @__PURE__ */
|
|
1951
|
+
d.length > 1 && /* @__PURE__ */ $(
|
|
1786
1952
|
"select",
|
|
1787
1953
|
{
|
|
1788
1954
|
className: "plot-select",
|
|
1789
1955
|
value: f,
|
|
1790
1956
|
onChange: (h) => o && o({ chartType: h.target.value }),
|
|
1791
|
-
children: d.map((h) => /* @__PURE__ */
|
|
1957
|
+
children: d.map((h) => /* @__PURE__ */ $("option", { value: h.value, children: h.label }, h.value))
|
|
1792
1958
|
}
|
|
1793
1959
|
)
|
|
1794
1960
|
] }),
|
|
1795
|
-
/* @__PURE__ */
|
|
1961
|
+
/* @__PURE__ */ $("div", { className: "plotly-chart", ref: i })
|
|
1796
1962
|
] });
|
|
1797
1963
|
}
|
|
1798
|
-
function
|
|
1964
|
+
function mt(e, t) {
|
|
1799
1965
|
if (!(t != null && t.length)) return e;
|
|
1800
1966
|
const n = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
|
|
1801
1967
|
for (const r of t) {
|
|
1802
1968
|
const o = r.id || r.holeId;
|
|
1803
1969
|
if (o)
|
|
1804
1970
|
if (n.has(o)) {
|
|
1805
|
-
const
|
|
1806
|
-
n.set(o, { ...
|
|
1971
|
+
const i = n.get(o);
|
|
1972
|
+
n.set(o, { ...i, points: [...i.points || [], ...r.points || []] });
|
|
1807
1973
|
} else
|
|
1808
1974
|
n.set(o, r);
|
|
1809
1975
|
}
|
|
1810
1976
|
return Array.from(n.values());
|
|
1811
1977
|
}
|
|
1812
|
-
function
|
|
1978
|
+
function Xn(e, t) {
|
|
1813
1979
|
if (!e || !t) return [];
|
|
1814
1980
|
const n = /* @__PURE__ */ new Set(), r = [];
|
|
1815
1981
|
for (const o of e.points || []) {
|
|
1816
|
-
const
|
|
1817
|
-
if (!Number.isFinite(
|
|
1818
|
-
const
|
|
1819
|
-
n.has(
|
|
1982
|
+
const i = Number(o.from ?? o.samp_from ?? o.depth_from ?? o.from_depth), s = Number(o.to ?? o.samp_to ?? o.depth_to ?? o.to_depth);
|
|
1983
|
+
if (!Number.isFinite(i) || !Number.isFinite(s) || s <= i) continue;
|
|
1984
|
+
const l = `${i}-${s}`;
|
|
1985
|
+
n.has(l) || (n.add(l), r.push({ from: i, to: s, [t]: o[t] ?? "" }));
|
|
1820
1986
|
}
|
|
1821
1987
|
return r;
|
|
1822
1988
|
}
|
|
1823
|
-
function
|
|
1989
|
+
function Fo({
|
|
1824
1990
|
initialFocusedHoleId: e = "",
|
|
1825
1991
|
sourceFile: t = null,
|
|
1826
1992
|
extraHoles: n = [],
|
|
1827
1993
|
plotCount: r = 4
|
|
1828
1994
|
} = {}) {
|
|
1829
|
-
const [o,
|
|
1830
|
-
|
|
1831
|
-
!t ||
|
|
1995
|
+
const [o, i] = J([]), [s, l] = J([]), [c, a] = J([]), [u, m] = J([]), [d, f] = J([]), [p, b] = J({}), [h, _] = J(""), [g, v] = J([]), [M, E] = J(""), [P, C] = J(e || ""), [L, k] = J([]), G = pt(null);
|
|
1996
|
+
me(() => {
|
|
1997
|
+
!t || G.current === t || (G.current = t, hn(t).then((A) => {
|
|
1832
1998
|
if (!A) return;
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
holeIds:
|
|
1836
|
-
focusedHoleId:
|
|
1999
|
+
const x = Array.from(new Map(A.map((y) => [y.holeId, y])).values());
|
|
2000
|
+
l(x), v(xt({
|
|
2001
|
+
holeIds: x.map((y) => y.holeId),
|
|
2002
|
+
focusedHoleId: P,
|
|
1837
2003
|
plotCount: r,
|
|
1838
2004
|
defaultProp: "",
|
|
1839
|
-
categoricalProps:
|
|
2005
|
+
categoricalProps: u,
|
|
1840
2006
|
commentProps: d,
|
|
1841
2007
|
numericDefaultChartType: "markers+line"
|
|
1842
2008
|
}));
|
|
1843
2009
|
}).catch((A) => {
|
|
1844
2010
|
console.info("Assay metadata load skipped:", A.message);
|
|
1845
2011
|
}));
|
|
1846
|
-
}, [t,
|
|
2012
|
+
}, [t, P, r, u, d]), me(() => {
|
|
1847
2013
|
if (!(n != null && n.length)) return;
|
|
1848
|
-
const A = n.map((
|
|
1849
|
-
|
|
1850
|
-
const
|
|
1851
|
-
return
|
|
2014
|
+
const A = n.map((x) => ({ holeId: x.id || x.holeId })).filter((x) => x.holeId);
|
|
2015
|
+
l((x) => {
|
|
2016
|
+
const y = new Set(x.map((I) => I.holeId)), O = A.filter((I) => !y.has(I.holeId));
|
|
2017
|
+
return O.length ? [...x, ...O] : x;
|
|
1852
2018
|
});
|
|
1853
|
-
}, [n]),
|
|
1854
|
-
|
|
1855
|
-
}, [
|
|
1856
|
-
if (!
|
|
1857
|
-
|
|
2019
|
+
}, [n]), me(() => {
|
|
2020
|
+
E((A) => A && A.startsWith("Loading ") && A.includes(" for hole ") ? A : "");
|
|
2021
|
+
}, [g]), me(() => {
|
|
2022
|
+
if (!s.length) {
|
|
2023
|
+
v([]);
|
|
1858
2024
|
return;
|
|
1859
2025
|
}
|
|
1860
|
-
const A =
|
|
1861
|
-
|
|
1862
|
-
var
|
|
1863
|
-
const
|
|
1864
|
-
property:
|
|
1865
|
-
chartType:
|
|
1866
|
-
categoricalProps:
|
|
2026
|
+
const A = Mt(s.map((x) => x.holeId), P);
|
|
2027
|
+
v((x) => Array.from({ length: r }).map((O, I) => {
|
|
2028
|
+
var W;
|
|
2029
|
+
const V = x[I] || {}, H = s.some((re) => re.holeId === V.holeId) ? V.holeId : A[I] || ((W = s[I]) == null ? void 0 : W.holeId) || "", T = V.property || h, U = Oe({
|
|
2030
|
+
property: T,
|
|
2031
|
+
chartType: V.chartType,
|
|
2032
|
+
categoricalProps: u,
|
|
1867
2033
|
commentProps: d,
|
|
1868
2034
|
numericDefaultChartType: "markers+line"
|
|
1869
2035
|
});
|
|
1870
|
-
return { holeId:
|
|
2036
|
+
return { holeId: H, property: T, chartType: U };
|
|
1871
2037
|
}));
|
|
1872
|
-
}, [
|
|
2038
|
+
}, [s, P, h, u, d, r]), me(() => {
|
|
1873
2039
|
if (!t) return;
|
|
1874
|
-
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
const
|
|
1879
|
-
[...
|
|
2040
|
+
g.map((x) => x.holeId).filter(Boolean).forEach((x) => {
|
|
2041
|
+
const y = o.some((I) => (I.id || I.holeId) === x), O = L.includes(x);
|
|
2042
|
+
y || O || (k((I) => [...I, x]), pn(t, x).then((I) => {
|
|
2043
|
+
k((V) => V.filter((H) => H !== x)), I && i((V) => {
|
|
2044
|
+
const H = mt(
|
|
2045
|
+
[...V.filter((U) => (U.id || U.holeId) !== x), I],
|
|
1880
2046
|
n
|
|
1881
|
-
),
|
|
1882
|
-
return
|
|
1883
|
-
...
|
|
1884
|
-
property:
|
|
1885
|
-
chartType:
|
|
1886
|
-
property:
|
|
1887
|
-
chartType:
|
|
1888
|
-
categoricalProps:
|
|
1889
|
-
commentProps:
|
|
2047
|
+
), T = Le(H);
|
|
2048
|
+
return a(T.numericProps), m(T.categoricalProps), f(T.commentProps), b(T.columnMeta), !h && T.defaultProp && (_(T.defaultProp), v((U) => U.map((W) => ({
|
|
2049
|
+
...W,
|
|
2050
|
+
property: W.property || T.defaultProp,
|
|
2051
|
+
chartType: Oe({
|
|
2052
|
+
property: W.property || T.defaultProp,
|
|
2053
|
+
chartType: W.chartType,
|
|
2054
|
+
categoricalProps: T.categoricalProps,
|
|
2055
|
+
commentProps: T.commentProps,
|
|
1890
2056
|
numericDefaultChartType: "markers+line"
|
|
1891
2057
|
})
|
|
1892
|
-
})))),
|
|
2058
|
+
})))), H;
|
|
1893
2059
|
});
|
|
1894
|
-
}).catch((
|
|
1895
|
-
console.error(
|
|
2060
|
+
}).catch((I) => {
|
|
2061
|
+
console.error(I), k((V) => V.filter((H) => H !== x)), E(I.message || `Error loading hole ${x}`);
|
|
1896
2062
|
}));
|
|
1897
2063
|
});
|
|
1898
|
-
}, [
|
|
1899
|
-
n != null && n.length &&
|
|
2064
|
+
}, [g, t, o, L, h, n]), me(() => {
|
|
2065
|
+
n != null && n.length && i((A) => {
|
|
1900
2066
|
if (!A.length) {
|
|
1901
|
-
const
|
|
1902
|
-
return
|
|
2067
|
+
const O = Le(n);
|
|
2068
|
+
return a(O.numericProps), m(O.categoricalProps), f(O.commentProps), b(O.columnMeta), !h && O.defaultProp && _(O.defaultProp), n;
|
|
1903
2069
|
}
|
|
1904
|
-
const
|
|
1905
|
-
return
|
|
2070
|
+
const x = mt(A, n), y = Le(x);
|
|
2071
|
+
return a(y.numericProps), m(y.categoricalProps), f(y.commentProps), b(y.columnMeta), !h && y.defaultProp && _(y.defaultProp), x;
|
|
1906
2072
|
});
|
|
1907
2073
|
}, [n]);
|
|
1908
|
-
const
|
|
1909
|
-
() => [...
|
|
1910
|
-
[
|
|
1911
|
-
),
|
|
1912
|
-
() =>
|
|
1913
|
-
[
|
|
1914
|
-
),
|
|
1915
|
-
const A = [...
|
|
1916
|
-
return Array.from({ length: r }).map((
|
|
1917
|
-
const
|
|
1918
|
-
let
|
|
1919
|
-
|
|
1920
|
-
const
|
|
2074
|
+
const X = He(
|
|
2075
|
+
() => [...c, ...u, ...d],
|
|
2076
|
+
[c, u, d]
|
|
2077
|
+
), F = He(
|
|
2078
|
+
() => s.map((A) => ({ holeId: A.holeId, label: A.holeId })).sort((A, x) => A.label.localeCompare(x.label)),
|
|
2079
|
+
[s]
|
|
2080
|
+
), Y = He(() => {
|
|
2081
|
+
const A = [...c, ...u, ...d];
|
|
2082
|
+
return Array.from({ length: r }).map((x, y) => {
|
|
2083
|
+
const O = g[y] || {}, I = o.find((ue) => (ue.id || ue.holeId) === O.holeId) || null, V = I ? A.filter((ue) => wn(I, ue)) : A;
|
|
2084
|
+
let H = O.property || h;
|
|
2085
|
+
I && !V.includes(H) && (H = V[0] || H);
|
|
2086
|
+
const T = d.includes(H), U = !T && u.includes(H), W = !T && !U && H === "dip", re = T ? "comment" : W ? "tadpole" : U ? "categorical" : "numeric", pe = W ? "tadpole" : O.chartType || (T ? "comment" : U ? "categorical" : "markers+line"), ce = O.holeId || (I == null ? void 0 : I.id) || (I == null ? void 0 : I.holeId) || "", ve = W ? (I == null ? void 0 : I.points) || [] : T ? Xn(I, H) : jn(I, H, U);
|
|
1921
2087
|
return {
|
|
1922
|
-
config: { holeId:
|
|
1923
|
-
hole:
|
|
1924
|
-
loading:
|
|
1925
|
-
isCategorical:
|
|
1926
|
-
isComment:
|
|
1927
|
-
isTadpole:
|
|
2088
|
+
config: { holeId: ce, property: H, chartType: pe },
|
|
2089
|
+
hole: I,
|
|
2090
|
+
loading: L.includes(O.holeId),
|
|
2091
|
+
isCategorical: U,
|
|
2092
|
+
isComment: T,
|
|
2093
|
+
isTadpole: W,
|
|
1928
2094
|
displayType: re,
|
|
1929
|
-
points:
|
|
1930
|
-
propertyOptions:
|
|
1931
|
-
label:
|
|
2095
|
+
points: ve,
|
|
2096
|
+
propertyOptions: V,
|
|
2097
|
+
label: ce
|
|
1932
2098
|
};
|
|
1933
2099
|
});
|
|
1934
|
-
}, [
|
|
1935
|
-
|
|
1936
|
-
const
|
|
1937
|
-
return
|
|
1938
|
-
property:
|
|
1939
|
-
chartType:
|
|
1940
|
-
categoricalProps:
|
|
2100
|
+
}, [g, o, h, u, d, L, r, c]), j = (A, x) => {
|
|
2101
|
+
v((y) => {
|
|
2102
|
+
const O = [...y], V = { ...O[A] || {}, ...x };
|
|
2103
|
+
return x.property && (V.chartType = Oe({
|
|
2104
|
+
property: x.property,
|
|
2105
|
+
chartType: V.chartType,
|
|
2106
|
+
categoricalProps: u,
|
|
1941
2107
|
commentProps: d,
|
|
1942
2108
|
numericDefaultChartType: "markers+line"
|
|
1943
|
-
})),
|
|
2109
|
+
})), O[A] = V, O;
|
|
1944
2110
|
});
|
|
1945
2111
|
};
|
|
1946
2112
|
return {
|
|
1947
|
-
error:
|
|
1948
|
-
focusedHoleId:
|
|
1949
|
-
setFocusedHoleId:
|
|
1950
|
-
setError:
|
|
1951
|
-
holeCount:
|
|
1952
|
-
numericProps:
|
|
1953
|
-
categoricalProps:
|
|
2113
|
+
error: M,
|
|
2114
|
+
focusedHoleId: P,
|
|
2115
|
+
setFocusedHoleId: C,
|
|
2116
|
+
setError: E,
|
|
2117
|
+
holeCount: s.length,
|
|
2118
|
+
numericProps: c,
|
|
2119
|
+
categoricalProps: u,
|
|
1954
2120
|
commentProps: d,
|
|
1955
|
-
columnMeta:
|
|
1956
|
-
propertyOptions:
|
|
1957
|
-
labeledHoleOptions:
|
|
1958
|
-
traceGraphs:
|
|
1959
|
-
handleConfigChange:
|
|
2121
|
+
columnMeta: p,
|
|
2122
|
+
propertyOptions: X,
|
|
2123
|
+
labeledHoleOptions: F,
|
|
2124
|
+
traceGraphs: Y,
|
|
2125
|
+
handleConfigChange: j
|
|
1960
2126
|
};
|
|
1961
2127
|
}
|
|
1962
|
-
const
|
|
2128
|
+
const Wn = [
|
|
1963
2129
|
"#313695",
|
|
1964
2130
|
"#4575b4",
|
|
1965
2131
|
"#74add1",
|
|
@@ -1971,8 +2137,8 @@ const Ln = [
|
|
|
1971
2137
|
"#d73027",
|
|
1972
2138
|
"#a50026"
|
|
1973
2139
|
];
|
|
1974
|
-
function
|
|
1975
|
-
const n = e.filter((
|
|
2140
|
+
function Zn(e = [], t = Wn) {
|
|
2141
|
+
const n = e.filter((a) => Number.isFinite(a));
|
|
1976
2142
|
if (!n.length)
|
|
1977
2143
|
return {
|
|
1978
2144
|
min: null,
|
|
@@ -1981,44 +2147,44 @@ function Tn(e = [], t = Ln) {
|
|
|
1981
2147
|
bins: [],
|
|
1982
2148
|
colors: t
|
|
1983
2149
|
};
|
|
1984
|
-
const r = n.slice().sort((
|
|
1985
|
-
if (
|
|
1986
|
-
const
|
|
2150
|
+
const r = n.slice().sort((a, u) => a - u), o = r[0], i = r[r.length - 1], s = t.length;
|
|
2151
|
+
if (i === o) {
|
|
2152
|
+
const a = t.map((u, m) => ({
|
|
1987
2153
|
index: m,
|
|
1988
2154
|
min: o,
|
|
1989
|
-
max:
|
|
2155
|
+
max: i,
|
|
1990
2156
|
label: `${o}`
|
|
1991
2157
|
}));
|
|
1992
2158
|
return {
|
|
1993
2159
|
min: o,
|
|
1994
|
-
max:
|
|
2160
|
+
max: i,
|
|
1995
2161
|
step: 0,
|
|
1996
|
-
bins:
|
|
2162
|
+
bins: a,
|
|
1997
2163
|
colors: t
|
|
1998
2164
|
};
|
|
1999
2165
|
}
|
|
2000
|
-
const
|
|
2001
|
-
const m =
|
|
2166
|
+
const l = t.map((a, u) => {
|
|
2167
|
+
const m = u / s, d = (u + 1) / s, f = Math.floor(m * r.length), p = Math.min(r.length - 1, Math.floor(d * r.length)), b = r[f], h = u === s - 1 ? i : r[p];
|
|
2002
2168
|
return {
|
|
2003
|
-
index:
|
|
2004
|
-
min:
|
|
2169
|
+
index: u,
|
|
2170
|
+
min: b,
|
|
2005
2171
|
max: h,
|
|
2006
|
-
label:
|
|
2172
|
+
label: Kn(b, h)
|
|
2007
2173
|
};
|
|
2008
|
-
}),
|
|
2174
|
+
}), c = (i - o) / s;
|
|
2009
2175
|
return {
|
|
2010
2176
|
min: o,
|
|
2011
|
-
max:
|
|
2012
|
-
step:
|
|
2013
|
-
bins:
|
|
2177
|
+
max: i,
|
|
2178
|
+
step: c,
|
|
2179
|
+
bins: l,
|
|
2014
2180
|
colors: t
|
|
2015
2181
|
};
|
|
2016
2182
|
}
|
|
2017
|
-
function
|
|
2183
|
+
function Kn(e, t) {
|
|
2018
2184
|
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";
|
|
2019
2185
|
return `${n(e)} – ${n(t)}`;
|
|
2020
2186
|
}
|
|
2021
|
-
function
|
|
2187
|
+
function kt(e, t) {
|
|
2022
2188
|
if (!Number.isFinite(e) || !t || !Array.isArray(t.bins) || !t.bins.length)
|
|
2023
2189
|
return -1;
|
|
2024
2190
|
if (t.max === t.min)
|
|
@@ -2030,92 +2196,92 @@ function It(e, t) {
|
|
|
2030
2196
|
}
|
|
2031
2197
|
return -1;
|
|
2032
2198
|
}
|
|
2033
|
-
function
|
|
2034
|
-
const r =
|
|
2199
|
+
function Jn(e, t, n = "#8b1e3f") {
|
|
2200
|
+
const r = kt(e, t);
|
|
2035
2201
|
return r < 0 ? n : t.colors[r] || n;
|
|
2036
2202
|
}
|
|
2037
|
-
function
|
|
2203
|
+
function Lt(e) {
|
|
2038
2204
|
return Array.isArray(e) ? e : [];
|
|
2039
2205
|
}
|
|
2040
|
-
function
|
|
2206
|
+
function je(e) {
|
|
2041
2207
|
const t = Number(e);
|
|
2042
2208
|
return Number.isFinite(t) ? t : void 0;
|
|
2043
2209
|
}
|
|
2044
|
-
function
|
|
2210
|
+
function Ft(e = {}) {
|
|
2045
2211
|
return {
|
|
2046
2212
|
...e,
|
|
2047
|
-
x:
|
|
2048
|
-
y:
|
|
2049
|
-
z:
|
|
2213
|
+
x: je(e.x),
|
|
2214
|
+
y: je(e.y),
|
|
2215
|
+
z: je(e.z)
|
|
2050
2216
|
};
|
|
2051
2217
|
}
|
|
2052
|
-
function
|
|
2053
|
-
const [r, o] = t,
|
|
2054
|
-
return
|
|
2055
|
-
if (!Number.isFinite(
|
|
2056
|
-
const
|
|
2218
|
+
function Qn(e = [], t = [0, 0], n = 0) {
|
|
2219
|
+
const [r, o] = t, i = Number(n) * Math.PI / 180, s = Math.cos(i), l = Math.sin(i);
|
|
2220
|
+
return Lt(e).map(Ft).map((c) => {
|
|
2221
|
+
if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return { ...c };
|
|
2222
|
+
const a = c.x - r, u = c.y - o;
|
|
2057
2223
|
return {
|
|
2058
|
-
...
|
|
2059
|
-
along:
|
|
2060
|
-
across:
|
|
2224
|
+
...c,
|
|
2225
|
+
along: a * l + u * s,
|
|
2226
|
+
across: a * s - u * l
|
|
2061
2227
|
};
|
|
2062
2228
|
});
|
|
2063
2229
|
}
|
|
2064
|
-
function
|
|
2065
|
-
const o =
|
|
2066
|
-
return !Number.isFinite(
|
|
2230
|
+
function er(e = [], t = [0, 0], n = 0, r = 50) {
|
|
2231
|
+
const o = Qn(e, t, n), i = 0.5 * Number(r || 0);
|
|
2232
|
+
return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
|
|
2067
2233
|
}
|
|
2068
|
-
function
|
|
2069
|
-
let r =
|
|
2234
|
+
function To(e = [], t = null, n = null) {
|
|
2235
|
+
let r = Lt(e).map(Ft);
|
|
2070
2236
|
if (Array.isArray(t) && t.length === 2) {
|
|
2071
|
-
const [o,
|
|
2072
|
-
r = r.filter((
|
|
2237
|
+
const [o, i] = t;
|
|
2238
|
+
r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
|
|
2073
2239
|
}
|
|
2074
2240
|
return n && (r = r.map((o) => ({
|
|
2075
2241
|
...o,
|
|
2076
2242
|
color_value: o == null ? void 0 : o[n]
|
|
2077
2243
|
}))), r;
|
|
2078
2244
|
}
|
|
2079
|
-
function
|
|
2080
|
-
let
|
|
2081
|
-
return o && (
|
|
2082
|
-
...
|
|
2083
|
-
color_value:
|
|
2084
|
-
}))),
|
|
2245
|
+
function $o(e = [], t = [0, 0], n = 0, r = 50, o = null) {
|
|
2246
|
+
let i = er(e, t, n, r);
|
|
2247
|
+
return o && (i = i.map((s) => ({
|
|
2248
|
+
...s,
|
|
2249
|
+
color_value: s == null ? void 0 : s[o]
|
|
2250
|
+
}))), i;
|
|
2085
2251
|
}
|
|
2086
|
-
function
|
|
2252
|
+
function We(e) {
|
|
2087
2253
|
return Array.isArray(e) ? e : [];
|
|
2088
2254
|
}
|
|
2089
|
-
function
|
|
2255
|
+
function Ze(e = {}) {
|
|
2090
2256
|
return e.hole_id ?? e.holeId ?? e.id;
|
|
2091
2257
|
}
|
|
2092
|
-
function
|
|
2258
|
+
function ge(e, t = void 0) {
|
|
2093
2259
|
const n = Number(e);
|
|
2094
2260
|
return Number.isFinite(n) ? n : t;
|
|
2095
2261
|
}
|
|
2096
|
-
function
|
|
2262
|
+
function Vo(e = [], t = null) {
|
|
2097
2263
|
const n = /* @__PURE__ */ new Map();
|
|
2098
|
-
|
|
2099
|
-
const
|
|
2100
|
-
if (
|
|
2101
|
-
const
|
|
2102
|
-
n.has(
|
|
2264
|
+
We(e).forEach((o) => {
|
|
2265
|
+
const i = Ze(o);
|
|
2266
|
+
if (i == null || `${i}`.trim() === "") return;
|
|
2267
|
+
const s = `${i}`;
|
|
2268
|
+
n.has(s) || n.set(s, []), n.get(s).push(o);
|
|
2103
2269
|
});
|
|
2104
2270
|
const r = [];
|
|
2105
|
-
return n.forEach((o,
|
|
2106
|
-
const
|
|
2107
|
-
hole_id:
|
|
2108
|
-
x:
|
|
2109
|
-
y:
|
|
2110
|
-
z:
|
|
2271
|
+
return n.forEach((o, i) => {
|
|
2272
|
+
const s = [...o].sort((c, a) => ge(c.md, 0) - ge(a.md, 0)), l = {
|
|
2273
|
+
hole_id: i,
|
|
2274
|
+
x: s.map((c) => ge(c.x, 0)),
|
|
2275
|
+
y: s.map((c) => ge(c.y, 0)),
|
|
2276
|
+
z: s.map((c) => ge(c.z, 0)),
|
|
2111
2277
|
color: null
|
|
2112
2278
|
};
|
|
2113
|
-
t && (
|
|
2279
|
+
t && (l.color = s.map((c) => c == null ? void 0 : c[t])), r.push(l);
|
|
2114
2280
|
}), r;
|
|
2115
2281
|
}
|
|
2116
|
-
function
|
|
2117
|
-
return
|
|
2118
|
-
hole_id:
|
|
2282
|
+
function Ho(e = [], t = 1, n = null) {
|
|
2283
|
+
return We(e).map((r) => ({
|
|
2284
|
+
hole_id: Ze(r),
|
|
2119
2285
|
from: r == null ? void 0 : r.from,
|
|
2120
2286
|
to: r == null ? void 0 : r.to,
|
|
2121
2287
|
radius: t,
|
|
@@ -2123,14 +2289,21 @@ function to(e = [], t = 1, n = null) {
|
|
|
2123
2289
|
value: n ? r == null ? void 0 : r[n] : null
|
|
2124
2290
|
}));
|
|
2125
2291
|
}
|
|
2126
|
-
function
|
|
2127
|
-
return t ?
|
|
2128
|
-
hole_id:
|
|
2292
|
+
function wo(e = [], t = null) {
|
|
2293
|
+
return t ? We(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
|
|
2294
|
+
hole_id: Ze(n),
|
|
2129
2295
|
label: n == null ? void 0 : n[t],
|
|
2130
|
-
depth: 0.5 * (
|
|
2296
|
+
depth: 0.5 * (ge(n == null ? void 0 : n.from, 0) + ge(n == null ? void 0 : n.to, 0))
|
|
2131
2297
|
})) : [];
|
|
2132
2298
|
}
|
|
2133
|
-
|
|
2299
|
+
function ye(e) {
|
|
2300
|
+
e.selectables = [
|
|
2301
|
+
...e.blocks,
|
|
2302
|
+
...e.drillMeshes,
|
|
2303
|
+
...e.structuralMeshes
|
|
2304
|
+
];
|
|
2305
|
+
}
|
|
2306
|
+
const tr = {
|
|
2134
2307
|
bedding: "#2563eb",
|
|
2135
2308
|
foliation: "#16a34a",
|
|
2136
2309
|
joint: "#9333ea",
|
|
@@ -2139,11 +2312,11 @@ const $n = {
|
|
|
2139
2312
|
"shear zone": "#0ea5e9",
|
|
2140
2313
|
"fault zone": "#ef4444"
|
|
2141
2314
|
};
|
|
2142
|
-
function
|
|
2143
|
-
const n = t ||
|
|
2315
|
+
function nr(e, t) {
|
|
2316
|
+
const n = t || tr, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
|
|
2144
2317
|
return new N.Color(o).getHex();
|
|
2145
2318
|
}
|
|
2146
|
-
function
|
|
2319
|
+
function rr(e, t) {
|
|
2147
2320
|
const n = e * Math.PI / 180, r = t * Math.PI / 180;
|
|
2148
2321
|
return new N.Vector3(
|
|
2149
2322
|
Math.sin(r) * Math.sin(n),
|
|
@@ -2154,60 +2327,83 @@ function Hn(e, t) {
|
|
|
2154
2327
|
// Up component
|
|
2155
2328
|
).normalize();
|
|
2156
2329
|
}
|
|
2157
|
-
function
|
|
2330
|
+
function or(e, t = {}) {
|
|
2158
2331
|
const {
|
|
2159
2332
|
radius: n = 5,
|
|
2160
2333
|
discThickness: r = 0.2,
|
|
2161
2334
|
opacity: o = 0.7,
|
|
2162
|
-
segments:
|
|
2163
|
-
colorMap:
|
|
2164
|
-
} = t,
|
|
2165
|
-
for (const
|
|
2166
|
-
const
|
|
2167
|
-
if (
|
|
2168
|
-
const f =
|
|
2169
|
-
let
|
|
2170
|
-
if (
|
|
2171
|
-
|
|
2335
|
+
segments: i = 32,
|
|
2336
|
+
colorMap: s = null
|
|
2337
|
+
} = t, l = new N.Group(), c = new N.Vector3(0, 1, 0);
|
|
2338
|
+
for (const a of e) {
|
|
2339
|
+
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;
|
|
2340
|
+
if (u == null || m == null || d == null || !Number.isFinite(u) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
|
|
2341
|
+
const f = a[B] != null ? Number(a[B]) : null, p = a[R] != null ? Number(a[R]) : null;
|
|
2342
|
+
let b;
|
|
2343
|
+
if (a.nx != null && Number.isFinite(a.nx) && a.ny != null && Number.isFinite(a.ny) && a.nz != null && Number.isFinite(a.nz))
|
|
2344
|
+
b = new N.Vector3(a.nx, a.ny, a.nz).normalize();
|
|
2172
2345
|
else {
|
|
2173
|
-
if (f == null ||
|
|
2174
|
-
|
|
2346
|
+
if (f == null || p == null || !Number.isFinite(f) || !Number.isFinite(p)) continue;
|
|
2347
|
+
b = rr(f, p);
|
|
2175
2348
|
}
|
|
2176
|
-
const h = new N.CylinderGeometry(n, n, r,
|
|
2177
|
-
color:
|
|
2349
|
+
const h = new N.CylinderGeometry(n, n, r, i, 1, !1), _ = new N.MeshStandardMaterial({
|
|
2350
|
+
color: nr(a.structure_type, s),
|
|
2178
2351
|
transparent: !0,
|
|
2179
2352
|
opacity: o,
|
|
2180
2353
|
side: N.DoubleSide
|
|
2181
|
-
}),
|
|
2182
|
-
|
|
2354
|
+
}), g = new N.Mesh(h, _);
|
|
2355
|
+
g.position.set(u, m, d), g.quaternion.setFromUnitVectors(c, b), g.userData = {
|
|
2183
2356
|
type: "structure",
|
|
2184
|
-
hole_id:
|
|
2185
|
-
depth:
|
|
2186
|
-
structure_type:
|
|
2357
|
+
hole_id: a.hole_id,
|
|
2358
|
+
depth: a.depth ?? a.mid,
|
|
2359
|
+
structure_type: a.structure_type,
|
|
2187
2360
|
dip: f,
|
|
2188
|
-
azimuth:
|
|
2189
|
-
comments:
|
|
2190
|
-
},
|
|
2361
|
+
azimuth: p,
|
|
2362
|
+
comments: a.comments
|
|
2363
|
+
}, l.add(g);
|
|
2191
2364
|
}
|
|
2192
|
-
return
|
|
2365
|
+
return l;
|
|
2366
|
+
}
|
|
2367
|
+
function ir(e, t, n, r = {}) {
|
|
2368
|
+
if (!e.scene || (Tt(e), !(t != null && t.length) || !(n != null && n.length))) return;
|
|
2369
|
+
const { maxDiscs: o = 3e3 } = r;
|
|
2370
|
+
let i = t;
|
|
2371
|
+
if (i.length > o) {
|
|
2372
|
+
const c = i.length / o, a = [];
|
|
2373
|
+
for (let u = 0; u < o; u++)
|
|
2374
|
+
a.push(i[Math.floor(u * c)]);
|
|
2375
|
+
i = a;
|
|
2376
|
+
}
|
|
2377
|
+
const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = Tn(i, s, r);
|
|
2378
|
+
l.length && (e.structuralGroup = or(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
|
|
2379
|
+
c.isMesh && e.structuralMeshes.push(c);
|
|
2380
|
+
}), ye(e));
|
|
2381
|
+
}
|
|
2382
|
+
function Tt(e) {
|
|
2383
|
+
e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
|
|
2384
|
+
t.isMesh && (t.geometry.dispose(), t.material.dispose());
|
|
2385
|
+
}), e.structuralGroup = null), e.structuralMeshes = [], ye(e);
|
|
2193
2386
|
}
|
|
2194
|
-
function
|
|
2195
|
-
|
|
2387
|
+
function sr(e, t) {
|
|
2388
|
+
e.structuralGroup && (e.structuralGroup.visible = !!t);
|
|
2389
|
+
}
|
|
2390
|
+
function Ke(e) {
|
|
2391
|
+
var n, r, o, i, s, l, c, a, u;
|
|
2196
2392
|
if (!e) return "";
|
|
2197
2393
|
const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
|
|
2198
2394
|
return [
|
|
2199
2395
|
t((n = e.camera) == null ? void 0 : n.x),
|
|
2200
2396
|
t((r = e.camera) == null ? void 0 : r.y),
|
|
2201
2397
|
t((o = e.camera) == null ? void 0 : o.z),
|
|
2202
|
-
t((
|
|
2203
|
-
t((
|
|
2204
|
-
t((
|
|
2205
|
-
t((
|
|
2206
|
-
t((
|
|
2207
|
-
t((
|
|
2398
|
+
t((i = e.target) == null ? void 0 : i.x),
|
|
2399
|
+
t((s = e.target) == null ? void 0 : s.y),
|
|
2400
|
+
t((l = e.target) == null ? void 0 : l.z),
|
|
2401
|
+
t((c = e.up) == null ? void 0 : c.x),
|
|
2402
|
+
t((a = e.up) == null ? void 0 : a.y),
|
|
2403
|
+
t((u = e.up) == null ? void 0 : u.z)
|
|
2208
2404
|
].join("|");
|
|
2209
2405
|
}
|
|
2210
|
-
function
|
|
2406
|
+
function $t(e) {
|
|
2211
2407
|
return !e.camera || !e.controls ? null : {
|
|
2212
2408
|
camera: {
|
|
2213
2409
|
x: e.camera.position.x,
|
|
@@ -2226,55 +2422,55 @@ function Et(e) {
|
|
|
2226
2422
|
}
|
|
2227
2423
|
};
|
|
2228
2424
|
}
|
|
2229
|
-
function
|
|
2425
|
+
function lr(e, t) {
|
|
2230
2426
|
if (!e.camera || !e.controls || !t) return !1;
|
|
2231
2427
|
const n = t.camera || {}, r = t.target || {}, o = t.up || {};
|
|
2232
|
-
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 =
|
|
2428
|
+
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 = Ke(t), !0) : !1;
|
|
2233
2429
|
}
|
|
2234
|
-
function
|
|
2430
|
+
function ar(e) {
|
|
2235
2431
|
if (!e.viewChangeHandler) return;
|
|
2236
2432
|
const t = Date.now();
|
|
2237
2433
|
if (t - e._lastViewEmitMs < 250) return;
|
|
2238
|
-
const n =
|
|
2434
|
+
const n = $t(e);
|
|
2239
2435
|
if (!n) return;
|
|
2240
|
-
const r =
|
|
2436
|
+
const r = Ke(n);
|
|
2241
2437
|
r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
|
|
2242
2438
|
}
|
|
2243
|
-
function
|
|
2244
|
-
const
|
|
2245
|
-
e.controls.target.set(
|
|
2439
|
+
function Je(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
2440
|
+
const l = (t + n) / 2, c = (r + o) / 2, a = (i + s) / 2, u = n - t, m = o - r, d = s - i, p = Math.max(u, m, d, 1) * 2;
|
|
2441
|
+
e.controls.target.set(l, c, a), e.camera.position.set(l + p, c + p, a + p), e.camera.lookAt(l, c, a), e.controls.update();
|
|
2246
2442
|
}
|
|
2247
|
-
function
|
|
2443
|
+
function cr(e, t = 1e3) {
|
|
2248
2444
|
!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());
|
|
2249
2445
|
}
|
|
2250
|
-
function
|
|
2446
|
+
function ur(e, t = 2e3) {
|
|
2251
2447
|
!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());
|
|
2252
2448
|
}
|
|
2253
|
-
function
|
|
2449
|
+
function mr(e, t = 0, n = 0) {
|
|
2254
2450
|
e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
|
|
2255
2451
|
}
|
|
2256
|
-
function
|
|
2452
|
+
function dr(e, t = 1.1) {
|
|
2257
2453
|
!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());
|
|
2258
2454
|
}
|
|
2259
|
-
function
|
|
2455
|
+
function fr(e, t = 1.2) {
|
|
2260
2456
|
if (!e.lastBounds) return;
|
|
2261
2457
|
const {
|
|
2262
2458
|
minX: n,
|
|
2263
2459
|
maxX: r,
|
|
2264
2460
|
minY: o,
|
|
2265
|
-
maxY:
|
|
2266
|
-
minZ:
|
|
2267
|
-
maxZ:
|
|
2268
|
-
} = e.lastBounds,
|
|
2269
|
-
e.controls.target.set(m, d, f), e.camera.position.set(m +
|
|
2270
|
-
}
|
|
2271
|
-
const
|
|
2272
|
-
function
|
|
2461
|
+
maxY: i,
|
|
2462
|
+
minZ: s,
|
|
2463
|
+
maxZ: l
|
|
2464
|
+
} = e.lastBounds, c = (r - n) * t, a = (i - o) * t, u = (l - s) * t, m = (n + r) / 2, d = (o + i) / 2, f = (s + l) / 2, b = Math.max(c, a, u, 1) * 2;
|
|
2465
|
+
e.controls.target.set(m, d, f), e.camera.position.set(m + b, d + b, f + b), e.camera.lookAt(m, d, f), e.controls.update();
|
|
2466
|
+
}
|
|
2467
|
+
const hr = 1, pr = 120;
|
|
2468
|
+
function br(e, t) {
|
|
2273
2469
|
if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
|
|
2274
|
-
const n = Math.min(
|
|
2275
|
-
return e.camera.position.copy(r).addScaledVector(
|
|
2470
|
+
const n = Math.min(pr, 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();
|
|
2471
|
+
return e.camera.position.copy(r).addScaledVector(a, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
|
|
2276
2472
|
}
|
|
2277
|
-
function
|
|
2473
|
+
function gr(e, t = "orbit") {
|
|
2278
2474
|
if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
|
|
2279
2475
|
e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
|
|
2280
2476
|
else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
|
|
@@ -2283,57 +2479,316 @@ function Qn(e, t = "orbit") {
|
|
|
2283
2479
|
e.controls.target.copy(n), e.controls.update();
|
|
2284
2480
|
}
|
|
2285
2481
|
}
|
|
2286
|
-
const
|
|
2287
|
-
function
|
|
2482
|
+
const se = "#9ca3af";
|
|
2483
|
+
function dt(e, t) {
|
|
2288
2484
|
const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
|
|
2289
2485
|
if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
|
|
2290
|
-
const o = Math.min(n, r),
|
|
2291
|
-
return
|
|
2486
|
+
const o = Math.min(n, r), i = Math.max(n, r);
|
|
2487
|
+
return i <= o ? null : { segStart: o, segEnd: i };
|
|
2292
2488
|
}
|
|
2293
|
-
function
|
|
2489
|
+
function yr(e, t, n) {
|
|
2294
2490
|
let r = 0, o = 0;
|
|
2295
|
-
for (let
|
|
2296
|
-
const
|
|
2297
|
-
if (!Number.isFinite(
|
|
2298
|
-
const m = Math.max(t,
|
|
2299
|
-
f <= 0 || (r +=
|
|
2491
|
+
for (let s = 0; s < e.length; s += 1) {
|
|
2492
|
+
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);
|
|
2493
|
+
if (!Number.isFinite(c) || !Number.isFinite(a) || !Number.isFinite(u) || a <= c) continue;
|
|
2494
|
+
const m = Math.max(t, c), f = Math.min(n, a) - m;
|
|
2495
|
+
f <= 0 || (r += u * f, o += f);
|
|
2300
2496
|
}
|
|
2301
2497
|
if (o <= 0) return null;
|
|
2302
|
-
const
|
|
2303
|
-
return Number.isFinite(
|
|
2498
|
+
const i = r / o;
|
|
2499
|
+
return Number.isFinite(i) ? i : null;
|
|
2304
2500
|
}
|
|
2305
|
-
function
|
|
2306
|
-
if (!Number.isFinite(e)) return new N.Color(
|
|
2307
|
-
if (
|
|
2308
|
-
const r =
|
|
2501
|
+
function _r(e, t) {
|
|
2502
|
+
if (!Number.isFinite(e)) return new N.Color(se);
|
|
2503
|
+
if (kt(e, t) < 0) return new N.Color(se);
|
|
2504
|
+
const r = Jn(e, t, se);
|
|
2309
2505
|
return new N.Color(r);
|
|
2310
2506
|
}
|
|
2311
|
-
function
|
|
2507
|
+
function Nr(e) {
|
|
2508
|
+
if (!e || !String(e).trim()) return se;
|
|
2509
|
+
const t = Vt(String(e).toLowerCase().trim());
|
|
2510
|
+
return "#" + new N.Color().setHSL(t, 0.7, 0.5).getHexString();
|
|
2511
|
+
}
|
|
2512
|
+
function zr(e = {}) {
|
|
2312
2513
|
return {
|
|
2313
2514
|
preserveView: !!e.preserveView,
|
|
2314
2515
|
assayIntervalsByHole: e.assayIntervalsByHole || null,
|
|
2315
|
-
selectedAssayVariable: e.selectedAssayVariable || ""
|
|
2516
|
+
selectedAssayVariable: e.selectedAssayVariable || "",
|
|
2517
|
+
isCategoricalVariable: !!e.isCategoricalVariable
|
|
2316
2518
|
};
|
|
2317
2519
|
}
|
|
2318
|
-
function
|
|
2520
|
+
function Mr(e, t) {
|
|
2319
2521
|
if (!e || !t) return [];
|
|
2320
2522
|
const n = [];
|
|
2321
2523
|
return Object.values(e).forEach((r) => {
|
|
2322
2524
|
(r || []).forEach((o) => {
|
|
2323
|
-
const
|
|
2324
|
-
Number.isFinite(
|
|
2525
|
+
const i = Number(o == null ? void 0 : o.value);
|
|
2526
|
+
Number.isFinite(i) && n.push(i);
|
|
2325
2527
|
});
|
|
2326
2528
|
}), n;
|
|
2327
2529
|
}
|
|
2328
|
-
function
|
|
2530
|
+
function Re(e) {
|
|
2329
2531
|
return {
|
|
2330
2532
|
holeId: e.id,
|
|
2331
2533
|
project: e.project
|
|
2332
2534
|
};
|
|
2333
2535
|
}
|
|
2334
|
-
|
|
2536
|
+
function xr(e) {
|
|
2537
|
+
return `${e ?? ""}`.trim().toLowerCase();
|
|
2538
|
+
}
|
|
2539
|
+
function Ir(e, t) {
|
|
2540
|
+
const n = `${e ?? ""}:${t ?? 0}`, r = Vt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new N.Color();
|
|
2541
|
+
return s.setHSL(i, 1, 0.5), s;
|
|
2542
|
+
}
|
|
2543
|
+
function Vt(e) {
|
|
2544
|
+
const t = `${e ?? ""}`;
|
|
2545
|
+
let n = 2166136261;
|
|
2546
|
+
for (let r = 0; r < t.length; r += 1)
|
|
2547
|
+
n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
|
|
2548
|
+
return (n >>> 0) / 4294967295;
|
|
2549
|
+
}
|
|
2550
|
+
function Er(e, t, n) {
|
|
2551
|
+
let r = null, o = 0;
|
|
2552
|
+
for (const i of e) {
|
|
2553
|
+
const s = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
|
|
2554
|
+
if (!Number.isFinite(s) || !Number.isFinite(l)) continue;
|
|
2555
|
+
const c = Math.min(n, l) - Math.max(t, s);
|
|
2556
|
+
c > o && (o = c, r = i == null ? void 0 : i.value);
|
|
2557
|
+
}
|
|
2558
|
+
return r;
|
|
2559
|
+
}
|
|
2560
|
+
function vr(e, t) {
|
|
2561
|
+
if (!t || !e) return [];
|
|
2562
|
+
const n = e.id || e.holeId;
|
|
2563
|
+
if (!n) return [];
|
|
2564
|
+
const r = t[n];
|
|
2565
|
+
if (Array.isArray(r) && r.length) return r;
|
|
2566
|
+
const o = xr(n);
|
|
2567
|
+
if (o) {
|
|
2568
|
+
const i = t[o];
|
|
2569
|
+
if (Array.isArray(i) && i.length) return i;
|
|
2570
|
+
}
|
|
2571
|
+
return [];
|
|
2572
|
+
}
|
|
2573
|
+
function Ar({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
|
|
2574
|
+
if (!e)
|
|
2575
|
+
return Ir(r, o);
|
|
2576
|
+
if (e === "__HAS_ASSAY__") {
|
|
2577
|
+
if (!(t != null && t.length)) return new N.Color(se);
|
|
2578
|
+
const u = dt(i, s);
|
|
2579
|
+
return u ? t.some((d) => {
|
|
2580
|
+
const f = Number(d == null ? void 0 : d.from), p = Number(d == null ? void 0 : d.to);
|
|
2581
|
+
if (!Number.isFinite(f) || !Number.isFinite(p)) return !1;
|
|
2582
|
+
const b = Math.max(u.segStart, f);
|
|
2583
|
+
return Math.min(u.segEnd, p) > b;
|
|
2584
|
+
}) ? new N.Color("#ff8c42") : new N.Color(se) : new N.Color(se);
|
|
2585
|
+
}
|
|
2586
|
+
if (!(t != null && t.length)) return new N.Color(se);
|
|
2587
|
+
const c = dt(i, s);
|
|
2588
|
+
if (!c) return new N.Color(se);
|
|
2589
|
+
if (l) {
|
|
2590
|
+
const u = Er(t, c.segStart, c.segEnd);
|
|
2591
|
+
return new N.Color(Nr(u));
|
|
2592
|
+
}
|
|
2593
|
+
const a = yr(t, c.segStart, c.segEnd);
|
|
2594
|
+
return _r(a, n);
|
|
2595
|
+
}
|
|
2596
|
+
function Sr(e, t, n = {}) {
|
|
2597
|
+
if (!e.scene || (Ht(e), !t || t.length === 0)) return;
|
|
2598
|
+
const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = zr(n), l = s ? [] : Mr(o, i), c = Zn(l);
|
|
2599
|
+
let a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, p = -1 / 0;
|
|
2600
|
+
const b = new N.Vector3(), h = new N.Vector3(0, 1, 0);
|
|
2601
|
+
t.forEach((_, g) => {
|
|
2602
|
+
const M = g * 137.5 % 360 / 360, E = new N.Color().setHSL(M, 0.75, 0.55), P = (_.points || []).map((k) => {
|
|
2603
|
+
a = Math.min(a, k.x), u = Math.max(u, k.x), m = Math.min(m, k.y), d = Math.max(d, k.y), f = Math.min(f, k.z), p = Math.max(p, k.z);
|
|
2604
|
+
const G = new N.Vector3(k.x, k.y, k.z);
|
|
2605
|
+
return G.md = k.md, G;
|
|
2606
|
+
});
|
|
2607
|
+
if (P.length < 2) {
|
|
2608
|
+
if (P.length === 1) {
|
|
2609
|
+
const k = new N.SphereGeometry(5, 12, 12), G = new N.MeshLambertMaterial({
|
|
2610
|
+
color: E,
|
|
2611
|
+
emissive: E,
|
|
2612
|
+
emissiveIntensity: 0.2
|
|
2613
|
+
}), X = new N.Mesh(k, G);
|
|
2614
|
+
X.position.copy(P[0]), X.userData = Re(_), e.scene.add(X), e.drillLines.push(X), e.drillMeshes.push(X);
|
|
2615
|
+
}
|
|
2616
|
+
return;
|
|
2617
|
+
}
|
|
2618
|
+
const C = new N.Group();
|
|
2619
|
+
C.userData = Re(_);
|
|
2620
|
+
const L = i ? vr(_, o) : [];
|
|
2621
|
+
for (let k = 0; k < P.length - 1; k += 1) {
|
|
2622
|
+
const G = P[k], X = P[k + 1], F = b.subVectors(X, G), Y = F.length();
|
|
2623
|
+
if (Y <= 1e-3) continue;
|
|
2624
|
+
const j = 2.2, A = new N.CylinderGeometry(j, j, Y, 6, 1, !0), x = Ar({
|
|
2625
|
+
selectedAssayVariable: i,
|
|
2626
|
+
assayIntervals: L,
|
|
2627
|
+
assayScale: c,
|
|
2628
|
+
holeId: _.id,
|
|
2629
|
+
segmentIndex: k,
|
|
2630
|
+
p1: G,
|
|
2631
|
+
p2: X,
|
|
2632
|
+
isCategorical: s
|
|
2633
|
+
}), y = new N.MeshLambertMaterial({
|
|
2634
|
+
color: x,
|
|
2635
|
+
flatShading: !0,
|
|
2636
|
+
emissive: x,
|
|
2637
|
+
emissiveIntensity: 0.15
|
|
2638
|
+
}), O = new N.Mesh(A, y);
|
|
2639
|
+
O.position.copy(G.clone().addScaledVector(F, 0.5)), O.quaternion.setFromUnitVectors(h, F.clone().normalize()), O.userData = Re(_), C.add(O), e.drillMeshes.push(O);
|
|
2640
|
+
}
|
|
2641
|
+
e.scene.add(C), e.drillLines.push(C);
|
|
2642
|
+
}), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: p }, r || Je(e, { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: p })), ye(e);
|
|
2643
|
+
}
|
|
2644
|
+
function Ht(e) {
|
|
2645
|
+
e.drillLines.forEach((t) => {
|
|
2646
|
+
e.scene.remove(t), t.isGroup ? t.traverse((n) => {
|
|
2647
|
+
n.isMesh && (n.geometry.dispose(), n.material.dispose());
|
|
2648
|
+
}) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
|
|
2649
|
+
}), e.drillLines = [], e.drillMeshes = [], ye(e);
|
|
2650
|
+
}
|
|
2651
|
+
const ft = "#ffffbb", Dr = 2, Pr = 1.5, Cr = 1;
|
|
2652
|
+
function Or(e) {
|
|
2653
|
+
const { renderer: t, scene: n, camera: r, container: o } = e;
|
|
2654
|
+
if (!t || !n || !r) return;
|
|
2655
|
+
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 Kt(t), c = new Jt(n, r);
|
|
2656
|
+
l.addPass(c);
|
|
2657
|
+
const a = new N.Vector2(i, s), u = new Qt(a, n, r);
|
|
2658
|
+
u.visibleEdgeColor.set(ft), u.hiddenEdgeColor.set(ft), u.edgeStrength = Dr, u.edgeThickness = Pr, u.edgeGlow = Cr, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, s), e._composer = l, e._outlinePass = u;
|
|
2659
|
+
}
|
|
2660
|
+
function kr(e, t, n) {
|
|
2661
|
+
!e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
|
|
2662
|
+
}
|
|
2663
|
+
function Ae(e, t) {
|
|
2664
|
+
e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
|
|
2665
|
+
}
|
|
2666
|
+
function ht(e) {
|
|
2667
|
+
e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
|
|
2668
|
+
}
|
|
2669
|
+
const Lr = [
|
|
2670
|
+
{ normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
|
|
2671
|
+
{ normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
|
|
2672
|
+
{ normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
|
|
2673
|
+
{ normal: [0, -1, 0], neibDir: [0, -1, 0], verts: [[1, -1, 1], [-1, -1, 1], [-1, -1, -1], [1, -1, -1]] },
|
|
2674
|
+
{ normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
|
|
2675
|
+
{ normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
|
|
2676
|
+
];
|
|
2677
|
+
function Fr(e, t, n, r, o = {}) {
|
|
2678
|
+
if (!e.scene || (wt(e), !t || !n || !r)) return;
|
|
2679
|
+
const { autoCenter: i = !0, opacity: s = 1 } = o;
|
|
2680
|
+
let l = 1 / 0, c = -1 / 0, a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0;
|
|
2681
|
+
t.forEach((y) => {
|
|
2682
|
+
const O = Number(y.x ?? y.center_x ?? 0), I = Number(y.y ?? y.center_y ?? 0), V = Number(y.z ?? y.center_z ?? 0), H = Number(y.dx ?? y.size_x ?? 1), T = Number(y.dy ?? y.size_y ?? 1), U = Number(y.dz ?? y.size_z ?? 1);
|
|
2683
|
+
l = Math.min(l, O - H / 2), c = Math.max(c, O + H / 2), a = Math.min(a, I - T / 2), u = Math.max(u, I + T / 2), m = Math.min(m, V - U / 2), d = Math.max(d, V + U / 2);
|
|
2684
|
+
});
|
|
2685
|
+
let f = 0, p = 0, b = 0;
|
|
2686
|
+
o.offset ? (f = Number(o.offset.x ?? 0), p = Number(o.offset.y ?? 0), b = Number(o.offset.z ?? 0)) : i && (f = -((l + c) / 2), p = -((a + u) / 2), b = -((m + d) / 2));
|
|
2687
|
+
const h = l + f, _ = c + f, g = a + p, v = u + p, M = m + b, E = d + b, P = (y, O, I) => `${Math.round(y)},${Math.round(O)},${Math.round(I)}`, C = new Set(
|
|
2688
|
+
t.map((y) => P(Number(y.x ?? 0), Number(y.y ?? 0), Number(y.z ?? 0)))
|
|
2689
|
+
), L = [], k = [], G = [], X = [], F = [];
|
|
2690
|
+
let Y = 0;
|
|
2691
|
+
if (t.forEach((y) => {
|
|
2692
|
+
const O = Number(y.x ?? y.center_x ?? 0), I = Number(y.y ?? y.center_y ?? 0), V = Number(y.z ?? y.center_z ?? 0), H = Number(y.dx ?? y.size_x ?? 1), T = Number(y.dy ?? y.size_y ?? 1), U = Number(y.dz ?? y.size_z ?? 1), W = O + f, re = I + p, pe = V + b, ce = Sn(y[n], r, N), { r: ve, g: ue, b: Ve } = ce;
|
|
2693
|
+
Lr.forEach((be) => {
|
|
2694
|
+
const Rt = O + be.neibDir[0] * H, Bt = I + be.neibDir[1] * T, Gt = V + be.neibDir[2] * U;
|
|
2695
|
+
if (C.has(P(Rt, Bt, Gt))) return;
|
|
2696
|
+
const _e = Y;
|
|
2697
|
+
be.verts.forEach(([Yt, Ut, qt]) => {
|
|
2698
|
+
L.push(W + Yt * H / 2, re + Ut * T / 2, pe + qt * U / 2), k.push(be.normal[0], be.normal[1], be.normal[2]), G.push(ve, ue, Ve), Y++;
|
|
2699
|
+
}), X.push(_e, _e + 1, _e + 2, _e, _e + 2, _e + 3), F.push(y);
|
|
2700
|
+
});
|
|
2701
|
+
}), L.length === 0) return;
|
|
2702
|
+
const j = new N.BufferGeometry();
|
|
2703
|
+
j.setAttribute("position", new N.Float32BufferAttribute(L, 3)), j.setAttribute("normal", new N.Float32BufferAttribute(k, 3)), j.setAttribute("color", new N.Float32BufferAttribute(G, 3)), j.setIndex(X);
|
|
2704
|
+
const A = new N.MeshLambertMaterial({
|
|
2705
|
+
vertexColors: !0,
|
|
2706
|
+
transparent: s < 1,
|
|
2707
|
+
opacity: s,
|
|
2708
|
+
side: N.DoubleSide
|
|
2709
|
+
}), x = new N.Mesh(j, A);
|
|
2710
|
+
x.userData._isMergedBlocks = !0, x.userData._quadToBlock = F, x.userData._offset = { x: f, y: p, z: b }, e.scene.add(x), e.blocks.push(x), ye(e), e.camera && e.controls && (e.lastBounds = { minX: h, maxX: _, minY: g, maxY: v, minZ: M, maxZ: E }, Je(e, { minX: h, maxX: _, minY: g, maxY: v, minZ: M, maxZ: E }));
|
|
2711
|
+
}
|
|
2712
|
+
function wt(e) {
|
|
2713
|
+
var t;
|
|
2714
|
+
e.blocks.forEach((n) => {
|
|
2715
|
+
e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
|
|
2716
|
+
}), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), ye(e);
|
|
2717
|
+
}
|
|
2718
|
+
function Tr(e, t) {
|
|
2719
|
+
const n = Math.max(0, Math.min(1, Number(t)));
|
|
2720
|
+
e.blocks.forEach((r) => {
|
|
2721
|
+
r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
|
|
2722
|
+
});
|
|
2723
|
+
}
|
|
2724
|
+
function $r(e, t, n) {
|
|
2725
|
+
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);
|
|
2726
|
+
if (!e._blockHighlightMesh) {
|
|
2727
|
+
const d = new N.BoxGeometry(1, 1, 1), f = new N.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
|
|
2728
|
+
e._blockHighlightMesh = new N.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
|
|
2729
|
+
}
|
|
2730
|
+
return e._blockHighlightMesh.position.set(s, l, c), e._blockHighlightMesh.scale.set(a, u, m), e._blockHighlightMesh;
|
|
2731
|
+
}
|
|
2732
|
+
function jt(e) {
|
|
2733
|
+
var o, i;
|
|
2734
|
+
if (!e._outlinePass || e.selectables.length === 0) {
|
|
2735
|
+
e._outlinePass && Ae(e, null);
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2738
|
+
const t = e.raycaster.intersectObjects(e.selectables, !0);
|
|
2739
|
+
if (t.length === 0) {
|
|
2740
|
+
Ae(e, null);
|
|
2741
|
+
return;
|
|
2742
|
+
}
|
|
2743
|
+
const n = t[0], r = n.object;
|
|
2744
|
+
if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
|
|
2745
|
+
const s = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[s];
|
|
2746
|
+
if (l) {
|
|
2747
|
+
Ae(e, $r(e, l, r.userData._offset));
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
Ae(e, r);
|
|
2752
|
+
}
|
|
2753
|
+
function Vr(e) {
|
|
2754
|
+
const t = e.renderer;
|
|
2755
|
+
t && (e.handleCanvasClick = (n) => {
|
|
2756
|
+
var f, p, b, h, _, g, v;
|
|
2757
|
+
if (n.button !== 0) return;
|
|
2758
|
+
if ((f = e.gizmo) != null && f.domElement) {
|
|
2759
|
+
const M = e.gizmo.domElement.getBoundingClientRect();
|
|
2760
|
+
if (n.clientX >= M.left && n.clientX <= M.right && n.clientY >= M.top && n.clientY <= M.bottom)
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, i = n.clientY - r.top;
|
|
2764
|
+
if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), jt(e), e.blocks.length > 0) {
|
|
2765
|
+
const M = e.raycaster.intersectObjects(e.blocks, !1);
|
|
2766
|
+
if (M.length > 0) {
|
|
2767
|
+
const E = M[0], P = E.object;
|
|
2768
|
+
if ((p = P == null ? void 0 : P.userData) != null && p._isMergedBlocks && e.blockClickHandler) {
|
|
2769
|
+
const C = Math.floor(E.faceIndex / 2), L = P.userData._quadToBlock[C];
|
|
2770
|
+
L && e.blockClickHandler(L);
|
|
2771
|
+
}
|
|
2772
|
+
return;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((b = s[0]) == null ? void 0 : b.distance) ?? 1 / 0;
|
|
2776
|
+
if ((((h = l[0]) == null ? void 0 : h.distance) ?? 1 / 0) < c && l.length > 0) {
|
|
2777
|
+
const M = l[0].object;
|
|
2778
|
+
e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...M.userData });
|
|
2779
|
+
return;
|
|
2780
|
+
}
|
|
2781
|
+
if (s.length === 0) return;
|
|
2782
|
+
let u = s[0].object;
|
|
2783
|
+
for (; u && u.parent && !((_ = u.userData) != null && _.holeId); )
|
|
2784
|
+
u = u.parent;
|
|
2785
|
+
const m = (g = u == null ? void 0 : u.userData) == null ? void 0 : g.holeId, d = (v = u == null ? void 0 : u.userData) == null ? void 0 : v.project;
|
|
2786
|
+
m && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: m, project: d });
|
|
2787
|
+
}, t.domElement.addEventListener("click", e.handleCanvasClick));
|
|
2788
|
+
}
|
|
2789
|
+
class jo {
|
|
2335
2790
|
constructor() {
|
|
2336
|
-
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 N.Clock(), this.handleCanvasClick = null, this.raycaster = new N.Raycaster(), this.pointer = new N.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new N.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0;
|
|
2791
|
+
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 N.Clock(), this.handleCanvasClick = null, this.raycaster = new N.Raycaster(), this.pointer = new N.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new N.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null;
|
|
2337
2792
|
}
|
|
2338
2793
|
init(t) {
|
|
2339
2794
|
if (!t) return;
|
|
@@ -2342,335 +2797,167 @@ class ro {
|
|
|
2342
2797
|
this.scene = new N.Scene(), this.scene.background = new N.Color(16777215), this.camera = new N.PerspectiveCamera(28, n / r, 1e-3, 1e5), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new N.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
|
|
2343
2798
|
const o = new N.AmbientLight(16777215, 0.5);
|
|
2344
2799
|
this.scene.add(o);
|
|
2345
|
-
const
|
|
2346
|
-
|
|
2347
|
-
const
|
|
2348
|
-
this.scene.add(
|
|
2800
|
+
const i = new N.DirectionalLight(16777215, 0.6);
|
|
2801
|
+
i.position.set(10, 10, 5), this.scene.add(i);
|
|
2802
|
+
const s = new N.AxesHelper(20);
|
|
2803
|
+
this.scene.add(s), this.controls = new Xt(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 = 4e4, this.controls.mouseButtons = {
|
|
2349
2804
|
LEFT: N.MOUSE.PAN,
|
|
2350
2805
|
MIDDLE: N.MOUSE.DOLLY,
|
|
2351
2806
|
RIGHT: N.MOUSE.ROTATE
|
|
2352
2807
|
}, this.controls.touches = {
|
|
2353
2808
|
ONE: N.TOUCH.ROTATE,
|
|
2354
2809
|
TWO: N.TOUCH.PAN
|
|
2355
|
-
}, this.controls.maxPolarAngle = Math.PI, this.flyControls = new
|
|
2810
|
+
}, this.controls.maxPolarAngle = Math.PI, this.flyControls = new Wt(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 Zt(this.camera, this.renderer, {
|
|
2356
2811
|
container: this.container,
|
|
2357
2812
|
placement: "top-right",
|
|
2358
2813
|
size: 110,
|
|
2359
2814
|
offset: { top: 12, right: 12 },
|
|
2360
2815
|
animated: !0,
|
|
2361
2816
|
speed: 1.5
|
|
2362
|
-
}), this.gizmo.attachControls(this.controls), this
|
|
2363
|
-
const
|
|
2364
|
-
var
|
|
2365
|
-
this.frameId = requestAnimationFrame(
|
|
2366
|
-
const
|
|
2367
|
-
this.renderer.clear(), this.controlMode === "fly" && ((
|
|
2817
|
+
}), this.gizmo.attachControls(this.controls), Vr(this), Or(this);
|
|
2818
|
+
const l = () => {
|
|
2819
|
+
var a;
|
|
2820
|
+
this.frameId = requestAnimationFrame(l);
|
|
2821
|
+
const c = this.clock.getDelta();
|
|
2822
|
+
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();
|
|
2368
2823
|
};
|
|
2369
|
-
|
|
2370
|
-
}
|
|
2371
|
-
setViewChangeHandler(t) {
|
|
2372
|
-
this.viewChangeHandler = typeof t == "function" ? t : null;
|
|
2373
|
-
}
|
|
2374
|
-
getViewState() {
|
|
2375
|
-
return Et(this);
|
|
2376
|
-
}
|
|
2377
|
-
setViewState(t) {
|
|
2378
|
-
return Bn(this, t);
|
|
2379
|
-
}
|
|
2380
|
-
_buildViewSignature(t) {
|
|
2381
|
-
return qe(t);
|
|
2382
|
-
}
|
|
2383
|
-
_emitViewChangeIfNeeded() {
|
|
2384
|
-
Gn(this);
|
|
2385
|
-
}
|
|
2386
|
-
_attachCanvasClickHandler() {
|
|
2387
|
-
const t = this.renderer;
|
|
2388
|
-
t && (this.handleCanvasClick = (n) => {
|
|
2389
|
-
var f, b, p, h, _, y, I;
|
|
2390
|
-
if (n.button !== 0) return;
|
|
2391
|
-
if ((f = this.gizmo) != null && f.domElement) {
|
|
2392
|
-
const z = this.gizmo.domElement.getBoundingClientRect();
|
|
2393
|
-
if (n.clientX >= z.left && n.clientX <= z.right && n.clientY >= z.top && n.clientY <= z.bottom)
|
|
2394
|
-
return;
|
|
2395
|
-
}
|
|
2396
|
-
const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, s = n.clientY - r.top;
|
|
2397
|
-
if (this.pointer.x = o / r.width * 2 - 1, this.pointer.y = -(s / r.height * 2) + 1, this.raycaster.setFromCamera(this.pointer, this.camera), this.blocks.length > 0) {
|
|
2398
|
-
const z = this.raycaster.intersectObjects(this.blocks, !1);
|
|
2399
|
-
if (z.length > 0) {
|
|
2400
|
-
const x = z[0], D = x.object;
|
|
2401
|
-
if ((b = D == null ? void 0 : D.userData) != null && b._isMergedBlocks && this.blockClickHandler) {
|
|
2402
|
-
const S = Math.floor(x.faceIndex / 2), M = D.userData._quadToBlock[S];
|
|
2403
|
-
M && this.blockClickHandler(M);
|
|
2404
|
-
}
|
|
2405
|
-
return;
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
const i = this.raycaster.intersectObjects(this.drillMeshes, !0), c = this.raycaster.intersectObjects(this.structuralMeshes, !0), u = ((p = i[0]) == null ? void 0 : p.distance) ?? 1 / 0;
|
|
2409
|
-
if ((((h = c[0]) == null ? void 0 : h.distance) ?? 1 / 0) < u && c.length > 0) {
|
|
2410
|
-
const z = c[0].object;
|
|
2411
|
-
this.drillholeClickHandler && this.drillholeClickHandler({ type: "structure", ...z.userData });
|
|
2412
|
-
return;
|
|
2413
|
-
}
|
|
2414
|
-
if (i.length === 0) return;
|
|
2415
|
-
let a = i[0].object;
|
|
2416
|
-
for (; a && a.parent && !((_ = a.userData) != null && _.holeId); )
|
|
2417
|
-
a = a.parent;
|
|
2418
|
-
const m = (y = a == null ? void 0 : a.userData) == null ? void 0 : y.holeId, d = (I = a == null ? void 0 : a.userData) == null ? void 0 : I.project;
|
|
2419
|
-
m && this.drillholeClickHandler && this.drillholeClickHandler({ holeId: m, project: d });
|
|
2420
|
-
}, t.domElement.addEventListener("click", this.handleCanvasClick));
|
|
2824
|
+
l();
|
|
2421
2825
|
}
|
|
2422
2826
|
resize() {
|
|
2423
2827
|
if (!this.container || !this.camera || !this.renderer) return;
|
|
2424
2828
|
const t = this.container.clientWidth, n = this.container.clientHeight;
|
|
2425
|
-
this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update();
|
|
2829
|
+
this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), kr(this, t, n);
|
|
2830
|
+
}
|
|
2831
|
+
dispose() {
|
|
2832
|
+
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, wt(this), Ht(this), Tt(this), ht(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));
|
|
2833
|
+
}
|
|
2834
|
+
// ---------------------------------------------------------------------------
|
|
2835
|
+
// Data renderers — delegate to domain modules
|
|
2836
|
+
// ---------------------------------------------------------------------------
|
|
2837
|
+
setDrillholes(t, n = {}) {
|
|
2838
|
+
Sr(this, t, n);
|
|
2426
2839
|
}
|
|
2427
2840
|
/**
|
|
2428
2841
|
* Render block model data as a single merged mesh of exterior faces only.
|
|
2429
|
-
*
|
|
2430
|
-
* Adjacent blocks' shared faces are skipped so there are no coincident
|
|
2431
|
-
* polygons and therefore no z-fighting. Vertex colours are used so the
|
|
2432
|
-
* entire model is a single draw call.
|
|
2433
|
-
*
|
|
2434
|
-
* Accepts rows with canonical column names ``x``, ``y``, ``z``, ``dx``,
|
|
2435
|
-
* ``dy``, ``dz`` (produced by :func:`parseBlockModelCSV`).
|
|
2436
|
-
*
|
|
2437
2842
|
* @param {Array<Object>} data - Block rows (canonical column names)
|
|
2438
2843
|
* @param {string} selectedProperty - Attribute column used for colouring
|
|
2439
|
-
* @param {Object} stats - Property statistics
|
|
2844
|
+
* @param {Object} stats - Property statistics
|
|
2440
2845
|
* @param {Object} [options]
|
|
2441
|
-
* @param {Object} [options.offset] - Optional ``{x, y, z}`` translation applied
|
|
2442
|
-
* to all block centres before rendering. When omitted the scene defaults to
|
|
2443
|
-
* auto-centering by shifting the extent centre to the origin.
|
|
2444
|
-
* @param {number} [options.opacity=1.0] - Initial material opacity (0–1)
|
|
2445
|
-
* @param {boolean} [options.autoCenter=true] - If true and no offset is
|
|
2446
|
-
* supplied, translate block centres so the extent centre sits at the origin.
|
|
2447
2846
|
*/
|
|
2448
2847
|
setBlocks(t, n, r, o = {}) {
|
|
2449
|
-
|
|
2450
|
-
const { autoCenter: s = !0, opacity: i = 1 } = o;
|
|
2451
|
-
let c = 1 / 0, u = -1 / 0, l = 1 / 0, a = -1 / 0, m = 1 / 0, d = -1 / 0;
|
|
2452
|
-
t.forEach((g) => {
|
|
2453
|
-
const C = Number(g.x ?? g.center_x ?? 0), F = Number(g.y ?? g.center_y ?? 0), V = Number(g.z ?? g.center_z ?? 0), k = Number(g.dx ?? g.size_x ?? 1), H = Number(g.dy ?? g.size_y ?? 1), U = Number(g.dz ?? g.size_z ?? 1);
|
|
2454
|
-
c = Math.min(c, C - k / 2), u = Math.max(u, C + k / 2), l = Math.min(l, F - H / 2), a = Math.max(a, F + H / 2), m = Math.min(m, V - U / 2), d = Math.max(d, V + U / 2);
|
|
2455
|
-
});
|
|
2456
|
-
let f = 0, b = 0, p = 0;
|
|
2457
|
-
o.offset ? (f = Number(o.offset.x ?? 0), b = Number(o.offset.y ?? 0), p = Number(o.offset.z ?? 0)) : s && (f = -((c + u) / 2), b = -((l + a) / 2), p = -((m + d) / 2));
|
|
2458
|
-
const h = c + f, _ = u + f, y = l + b, I = a + b, z = m + p, x = d + p, D = (g, C, F) => `${Math.round(g)},${Math.round(C)},${Math.round(F)}`, S = new Set(
|
|
2459
|
-
t.map((g) => D(Number(g.x ?? 0), Number(g.y ?? 0), Number(g.z ?? 0)))
|
|
2460
|
-
), M = [
|
|
2461
|
-
{ normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
|
|
2462
|
-
{ normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
|
|
2463
|
-
{ normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
|
|
2464
|
-
{ normal: [0, -1, 0], neibDir: [0, -1, 0], verts: [[1, -1, 1], [-1, -1, 1], [-1, -1, -1], [1, -1, -1]] },
|
|
2465
|
-
{ normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
|
|
2466
|
-
{ normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
|
|
2467
|
-
], O = [], $ = [], Z = [], T = [], R = [];
|
|
2468
|
-
let q = 0;
|
|
2469
|
-
if (t.forEach((g) => {
|
|
2470
|
-
const C = Number(g.x ?? g.center_x ?? 0), F = Number(g.y ?? g.center_y ?? 0), V = Number(g.z ?? g.center_z ?? 0), k = Number(g.dx ?? g.size_x ?? 1), H = Number(g.dy ?? g.size_y ?? 1), U = Number(g.dz ?? g.size_z ?? 1), re = C + f, de = F + b, ie = V + p, Ne = mn(g[n], r, N), { r: le, g: Pe, b: Dt } = Ne;
|
|
2471
|
-
M.forEach((fe) => {
|
|
2472
|
-
const St = C + fe.neibDir[0] * k, Pt = F + fe.neibDir[1] * H, kt = V + fe.neibDir[2] * U;
|
|
2473
|
-
if (S.has(D(St, Pt, kt))) return;
|
|
2474
|
-
const be = q;
|
|
2475
|
-
fe.verts.forEach(([Lt, Tt, Ft]) => {
|
|
2476
|
-
O.push(re + Lt * k / 2, de + Tt * H / 2, ie + Ft * U / 2), $.push(fe.normal[0], fe.normal[1], fe.normal[2]), Z.push(le, Pe, Dt), q++;
|
|
2477
|
-
}), T.push(be, be + 1, be + 2, be, be + 2, be + 3), R.push(g);
|
|
2478
|
-
});
|
|
2479
|
-
}), O.length === 0) return;
|
|
2480
|
-
const A = new N.BufferGeometry();
|
|
2481
|
-
A.setAttribute("position", new N.Float32BufferAttribute(O, 3)), A.setAttribute("normal", new N.Float32BufferAttribute($, 3)), A.setAttribute("color", new N.Float32BufferAttribute(Z, 3)), A.setIndex(T);
|
|
2482
|
-
const v = new N.MeshLambertMaterial({
|
|
2483
|
-
vertexColors: !0,
|
|
2484
|
-
transparent: i < 1,
|
|
2485
|
-
opacity: i,
|
|
2486
|
-
side: N.DoubleSide
|
|
2487
|
-
// safe — all interior faces are already removed
|
|
2488
|
-
}), P = new N.Mesh(A, v);
|
|
2489
|
-
P.userData._isMergedBlocks = !0, P.userData._quadToBlock = R, this.scene.add(P), this.blocks.push(P), this.camera && this.controls && (this.lastBounds = { minX: h, maxX: _, minY: y, maxY: I, minZ: z, maxZ: x }, Fe(this, { minX: h, maxX: _, minY: y, maxY: I, minZ: z, maxZ: x }));
|
|
2848
|
+
Fr(this, t, n, r, o);
|
|
2490
2849
|
}
|
|
2491
2850
|
/**
|
|
2492
2851
|
* Update the opacity of all currently rendered blocks.
|
|
2493
|
-
* @param {number} opacity - New opacity value between 0
|
|
2852
|
+
* @param {number} opacity - New opacity value between 0 and 1
|
|
2494
2853
|
*/
|
|
2495
2854
|
setBlockOpacity(t) {
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2855
|
+
Tr(this, t);
|
|
2856
|
+
}
|
|
2857
|
+
setStructuralDiscs(t, n, r = {}) {
|
|
2858
|
+
ir(this, t, n, r);
|
|
2859
|
+
}
|
|
2860
|
+
setStructuralDiscsVisible(t) {
|
|
2861
|
+
sr(this, t);
|
|
2862
|
+
}
|
|
2863
|
+
// ---------------------------------------------------------------------------
|
|
2864
|
+
// Click handlers
|
|
2865
|
+
// ---------------------------------------------------------------------------
|
|
2866
|
+
setDrillholeClickHandler(t) {
|
|
2867
|
+
this.drillholeClickHandler = t;
|
|
2500
2868
|
}
|
|
2501
2869
|
/**
|
|
2502
2870
|
* Register a click handler for block selection.
|
|
2503
|
-
* The handler is called with the full block row data when a block is clicked.
|
|
2504
2871
|
* @param {Function|null} handler - Callback ``(blockData) => void``, or null to clear
|
|
2505
2872
|
*/
|
|
2506
2873
|
setBlockClickHandler(t) {
|
|
2507
2874
|
this.blockClickHandler = typeof t == "function" ? t : null;
|
|
2508
2875
|
}
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
t.forEach((h, _) => {
|
|
2515
|
-
const I = _ * 137.5 % 360 / 360, z = new N.Color().setHSL(I, 0.75, 0.55), x = (h.points || []).map((M) => {
|
|
2516
|
-
u = Math.min(u, M.x), l = Math.max(l, M.x), a = Math.min(a, M.y), m = Math.max(m, M.y), d = Math.min(d, M.z), f = Math.max(f, M.z);
|
|
2517
|
-
const O = new N.Vector3(M.x, M.y, M.z);
|
|
2518
|
-
return O.md = M.md, O;
|
|
2519
|
-
});
|
|
2520
|
-
if (x.length < 2) {
|
|
2521
|
-
if (x.length === 1) {
|
|
2522
|
-
const M = new N.SphereGeometry(5, 12, 12), O = new N.MeshLambertMaterial({
|
|
2523
|
-
color: z,
|
|
2524
|
-
emissive: z,
|
|
2525
|
-
emissiveIntensity: 0.2
|
|
2526
|
-
}), $ = new N.Mesh(M, O);
|
|
2527
|
-
$.position.copy(x[0]), $.userData = Oe(h), this.scene.add($), this.drillLines.push($), this.drillMeshes.push($);
|
|
2528
|
-
}
|
|
2529
|
-
return;
|
|
2530
|
-
}
|
|
2531
|
-
const D = new N.Group();
|
|
2532
|
-
D.userData = Oe(h);
|
|
2533
|
-
const S = s ? this._resolveAssayIntervalsForHole(h, o) : [];
|
|
2534
|
-
for (let M = 0; M < x.length - 1; M += 1) {
|
|
2535
|
-
const O = x[M], $ = x[M + 1], Z = b.subVectors($, O), T = Z.length();
|
|
2536
|
-
if (T <= 1e-3) continue;
|
|
2537
|
-
const R = 2.2, q = new N.CylinderGeometry(R, R, T, 6, 1, !0), A = this._getSegmentColor({
|
|
2538
|
-
selectedAssayVariable: s,
|
|
2539
|
-
assayIntervals: S,
|
|
2540
|
-
assayScale: c,
|
|
2541
|
-
holeId: h.id,
|
|
2542
|
-
segmentIndex: M,
|
|
2543
|
-
p1: O,
|
|
2544
|
-
p2: $
|
|
2545
|
-
}), v = new N.MeshLambertMaterial({
|
|
2546
|
-
color: A,
|
|
2547
|
-
flatShading: !0,
|
|
2548
|
-
emissive: A,
|
|
2549
|
-
emissiveIntensity: 0.15
|
|
2550
|
-
}), P = new N.Mesh(q, v);
|
|
2551
|
-
P.position.copy(O.clone().addScaledVector(Z, 0.5)), P.quaternion.setFromUnitVectors(p, Z.clone().normalize()), P.userData = Oe(h), D.add(P), this.drillMeshes.push(P);
|
|
2552
|
-
}
|
|
2553
|
-
this.scene.add(D), this.drillLines.push(D);
|
|
2554
|
-
}), this.camera && this.controls && (this.lastBounds = { minX: u, maxX: l, minY: a, maxY: m, minZ: d, maxZ: f }, r || Fe(this, { minX: u, maxX: l, minY: a, maxY: m, minZ: d, maxZ: f }));
|
|
2555
|
-
}
|
|
2556
|
-
_getSegmentColor({ selectedAssayVariable: t, assayIntervals: n, assayScale: r, holeId: o, segmentIndex: s, p1: i, p2: c }) {
|
|
2557
|
-
if (!t)
|
|
2558
|
-
return sr(o, s);
|
|
2559
|
-
if (t === "__HAS_ASSAY__") {
|
|
2560
|
-
if (!(n != null && n.length)) return new N.Color(me);
|
|
2561
|
-
const a = it(i, c);
|
|
2562
|
-
return a ? n.some((d) => {
|
|
2563
|
-
const f = Number(d == null ? void 0 : d.from), b = Number(d == null ? void 0 : d.to);
|
|
2564
|
-
if (!Number.isFinite(f) || !Number.isFinite(b)) return !1;
|
|
2565
|
-
const p = Math.max(a.segStart, f);
|
|
2566
|
-
return Math.min(a.segEnd, b) > p;
|
|
2567
|
-
}) ? new N.Color("#ff8c42") : new N.Color(me) : new N.Color(me);
|
|
2568
|
-
}
|
|
2569
|
-
if (!(n != null && n.length)) return new N.Color(me);
|
|
2570
|
-
const u = it(i, c);
|
|
2571
|
-
if (!u) return new N.Color(me);
|
|
2572
|
-
const l = er(n, u.segStart, u.segEnd);
|
|
2573
|
-
return tr(l, r);
|
|
2574
|
-
}
|
|
2575
|
-
_resolveAssayIntervalsForHole(t, n) {
|
|
2576
|
-
if (!n || !t) return [];
|
|
2577
|
-
const r = t.id || t.holeId;
|
|
2578
|
-
if (!r) return [];
|
|
2579
|
-
const o = n[r];
|
|
2580
|
-
if (Array.isArray(o) && o.length) return o;
|
|
2581
|
-
const s = or(r);
|
|
2582
|
-
if (s) {
|
|
2583
|
-
const i = n[s];
|
|
2584
|
-
if (Array.isArray(i) && i.length) return i;
|
|
2585
|
-
}
|
|
2586
|
-
return [];
|
|
2876
|
+
// ---------------------------------------------------------------------------
|
|
2877
|
+
// Camera controls — delegate to baselode3dCameraControls
|
|
2878
|
+
// ---------------------------------------------------------------------------
|
|
2879
|
+
setViewChangeHandler(t) {
|
|
2880
|
+
this.viewChangeHandler = typeof t == "function" ? t : null;
|
|
2587
2881
|
}
|
|
2588
|
-
|
|
2589
|
-
|
|
2882
|
+
getViewState() {
|
|
2883
|
+
return $t(this);
|
|
2884
|
+
}
|
|
2885
|
+
setViewState(t) {
|
|
2886
|
+
return lr(this, t);
|
|
2887
|
+
}
|
|
2888
|
+
_buildViewSignature(t) {
|
|
2889
|
+
return Ke(t);
|
|
2890
|
+
}
|
|
2891
|
+
_emitViewChangeIfNeeded() {
|
|
2892
|
+
ar(this);
|
|
2893
|
+
}
|
|
2894
|
+
_fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
2895
|
+
Je(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
|
|
2590
2896
|
}
|
|
2591
2897
|
recenterCameraToOrigin(t = 1e3) {
|
|
2592
|
-
|
|
2898
|
+
cr(this, t);
|
|
2593
2899
|
}
|
|
2594
2900
|
lookDown(t = 2e3) {
|
|
2595
|
-
|
|
2901
|
+
ur(this, t);
|
|
2596
2902
|
}
|
|
2597
2903
|
pan(t = 0, n = 0) {
|
|
2598
|
-
|
|
2904
|
+
mr(this, t, n);
|
|
2599
2905
|
}
|
|
2600
2906
|
dolly(t = 1.1) {
|
|
2601
|
-
|
|
2907
|
+
dr(this, t);
|
|
2602
2908
|
}
|
|
2603
2909
|
focusOnLastBounds(t = 1.2) {
|
|
2604
|
-
|
|
2605
|
-
}
|
|
2606
|
-
_clearBlocks() {
|
|
2607
|
-
this.blocks.forEach((t) => {
|
|
2608
|
-
this.scene.remove(t), t.geometry.dispose(), t.material.dispose();
|
|
2609
|
-
}), this.blocks = [];
|
|
2610
|
-
}
|
|
2611
|
-
setStructuralDiscs(t, n, r = {}) {
|
|
2612
|
-
if (!this.scene || (this._clearStructuralDiscs(), !(t != null && t.length) || !(n != null && n.length))) return;
|
|
2613
|
-
const { maxDiscs: o = 3e3 } = r;
|
|
2614
|
-
let s = t;
|
|
2615
|
-
if (s.length > o) {
|
|
2616
|
-
const u = s.length / o, l = [];
|
|
2617
|
-
for (let a = 0; a < o; a++)
|
|
2618
|
-
l.push(s[Math.floor(a * u)]);
|
|
2619
|
-
s = l;
|
|
2620
|
-
}
|
|
2621
|
-
const i = n.flatMap((u) => (u.points || []).map((l) => ({ ...l, hole_id: u.id }))), c = gn(s, i, r);
|
|
2622
|
-
c.length && (this.structuralGroup = jn(c, r), this.scene.add(this.structuralGroup), this.structuralGroup.traverse((u) => {
|
|
2623
|
-
u.isMesh && this.structuralMeshes.push(u);
|
|
2624
|
-
}));
|
|
2910
|
+
fr(this, t);
|
|
2625
2911
|
}
|
|
2626
2912
|
/**
|
|
2627
2913
|
* Change the camera field-of-view while keeping the visible scene the same apparent size.
|
|
2628
|
-
* FOV is clamped to [FOV_MIN_DEG, FOV_MAX_DEG]. Delegates to setFov in baselode3dCameraControls.
|
|
2629
2914
|
* @param {number} fovDeg - Desired FOV in degrees
|
|
2630
2915
|
*/
|
|
2631
2916
|
setCameraFov(t) {
|
|
2632
|
-
|
|
2917
|
+
br(this, t);
|
|
2633
2918
|
}
|
|
2634
|
-
|
|
2635
|
-
|
|
2919
|
+
setControlMode(t = "orbit") {
|
|
2920
|
+
gr(this, t);
|
|
2636
2921
|
}
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2922
|
+
// ---------------------------------------------------------------------------
|
|
2923
|
+
// Selection glow public API
|
|
2924
|
+
// ---------------------------------------------------------------------------
|
|
2925
|
+
_syncSelectables() {
|
|
2926
|
+
ye(this);
|
|
2641
2927
|
}
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2928
|
+
/**
|
|
2929
|
+
* Register the objects that are candidates for click-select glow.
|
|
2930
|
+
* @param {THREE.Object3D[]} objects
|
|
2931
|
+
*/
|
|
2932
|
+
setSelectableObjects(t) {
|
|
2933
|
+
this.selectables = Array.isArray(t) ? t.slice() : [];
|
|
2648
2934
|
}
|
|
2649
|
-
|
|
2650
|
-
|
|
2935
|
+
/**
|
|
2936
|
+
* Programmatically select an object (or pass null to clear).
|
|
2937
|
+
* @param {THREE.Object3D|null} object
|
|
2938
|
+
*/
|
|
2939
|
+
selectObject(t) {
|
|
2940
|
+
Ae(this, t || null);
|
|
2651
2941
|
}
|
|
2652
|
-
|
|
2653
|
-
|
|
2942
|
+
/**
|
|
2943
|
+
* Return the currently selected object, or null if nothing is selected.
|
|
2944
|
+
* @returns {THREE.Object3D|null}
|
|
2945
|
+
*/
|
|
2946
|
+
getSelectedObject() {
|
|
2947
|
+
return this._selectedObject || null;
|
|
2654
2948
|
}
|
|
2655
|
-
|
|
2656
|
-
|
|
2949
|
+
/**
|
|
2950
|
+
* Dispose the effect composer and all GPU resources used by the selection glow.
|
|
2951
|
+
*/
|
|
2952
|
+
disposeGlow() {
|
|
2953
|
+
ht(this);
|
|
2954
|
+
}
|
|
2955
|
+
/** @private */
|
|
2956
|
+
_updateSelectionFromPointer() {
|
|
2957
|
+
jt(this);
|
|
2657
2958
|
}
|
|
2658
2959
|
}
|
|
2659
|
-
function
|
|
2660
|
-
return `${e ?? ""}`.trim().toLowerCase();
|
|
2661
|
-
}
|
|
2662
|
-
function sr(e, t) {
|
|
2663
|
-
const n = `${e ?? ""}:${t ?? 0}`, r = ir(n), o = (t ?? 0) % 14 / 14, s = (r * 0.15 + o * 0.85) % 1, i = new N.Color();
|
|
2664
|
-
return i.setHSL(s, 1, 0.5), i;
|
|
2665
|
-
}
|
|
2666
|
-
function ir(e) {
|
|
2667
|
-
const t = `${e ?? ""}`;
|
|
2668
|
-
let n = 2166136261;
|
|
2669
|
-
for (let r = 0; r < t.length; r += 1)
|
|
2670
|
-
n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
|
|
2671
|
-
return (n >>> 0) / 4294967295;
|
|
2672
|
-
}
|
|
2673
|
-
function oo({
|
|
2960
|
+
function Ro({
|
|
2674
2961
|
controlMode: e = "orbit",
|
|
2675
2962
|
onToggleFly: t = () => {
|
|
2676
2963
|
},
|
|
@@ -2682,13 +2969,13 @@ function oo({
|
|
|
2682
2969
|
}
|
|
2683
2970
|
}) {
|
|
2684
2971
|
return /* @__PURE__ */ Q("div", { className: "baselode-3d-controls", children: [
|
|
2685
|
-
/* @__PURE__ */
|
|
2686
|
-
/* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */
|
|
2688
|
-
/* @__PURE__ */
|
|
2972
|
+
/* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
|
|
2973
|
+
/* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
|
|
2974
|
+
/* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
|
|
2975
|
+
/* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
|
|
2689
2976
|
] });
|
|
2690
2977
|
}
|
|
2691
|
-
function
|
|
2978
|
+
function Bo({
|
|
2692
2979
|
properties: e = [],
|
|
2693
2980
|
selectedProperty: t = "",
|
|
2694
2981
|
onPropertyChange: n = () => {
|
|
@@ -2696,42 +2983,42 @@ function so({
|
|
|
2696
2983
|
opacity: r = 0.85,
|
|
2697
2984
|
onOpacityChange: o = () => {
|
|
2698
2985
|
},
|
|
2699
|
-
propertyStats:
|
|
2700
|
-
clickedBlock:
|
|
2701
|
-
onPopupClose:
|
|
2986
|
+
propertyStats: i = null,
|
|
2987
|
+
clickedBlock: s = null,
|
|
2988
|
+
onPopupClose: l = () => {
|
|
2702
2989
|
}
|
|
2703
2990
|
}) {
|
|
2704
|
-
var
|
|
2991
|
+
var c, a;
|
|
2705
2992
|
return /* @__PURE__ */ Q("div", { className: "bm-widget", children: [
|
|
2706
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ $("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
|
|
2707
2994
|
/* @__PURE__ */ Q(
|
|
2708
2995
|
"select",
|
|
2709
2996
|
{
|
|
2710
2997
|
id: "bm-property-select",
|
|
2711
2998
|
className: "bm-widget__select",
|
|
2712
2999
|
value: t,
|
|
2713
|
-
onChange: (
|
|
3000
|
+
onChange: (u) => n(u.target.value),
|
|
2714
3001
|
children: [
|
|
2715
|
-
e.length === 0 && /* @__PURE__ */
|
|
2716
|
-
e.map((
|
|
3002
|
+
e.length === 0 && /* @__PURE__ */ $("option", { value: "", children: "— no attributes —" }),
|
|
3003
|
+
e.map((u) => /* @__PURE__ */ $("option", { value: u, children: u }, u))
|
|
2717
3004
|
]
|
|
2718
3005
|
}
|
|
2719
3006
|
),
|
|
2720
|
-
|
|
2721
|
-
/* @__PURE__ */
|
|
2722
|
-
/* @__PURE__ */
|
|
2723
|
-
/* @__PURE__ */
|
|
3007
|
+
i && i.type === "numeric" && /* @__PURE__ */ Q("div", { className: "bm-widget__scale", children: [
|
|
3008
|
+
/* @__PURE__ */ $("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((c = i.min) == null ? void 0 : c.toFixed(2)) ?? "—" }),
|
|
3009
|
+
/* @__PURE__ */ $("div", { className: "bm-widget__scale-bar" }),
|
|
3010
|
+
/* @__PURE__ */ $("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
|
|
2724
3011
|
] }),
|
|
2725
|
-
|
|
2726
|
-
const d = Math.round(m / Math.max(
|
|
2727
|
-
return /* @__PURE__ */
|
|
3012
|
+
i && i.type === "categorical" && /* @__PURE__ */ $("div", { className: "bm-widget__categories", children: (i.categories || []).map((u, m) => {
|
|
3013
|
+
const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
|
|
3014
|
+
return /* @__PURE__ */ $(
|
|
2728
3015
|
"span",
|
|
2729
3016
|
{
|
|
2730
3017
|
className: "bm-widget__category-chip",
|
|
2731
3018
|
style: { background: `hsl(${d},70%,50%)` },
|
|
2732
|
-
children:
|
|
3019
|
+
children: u
|
|
2733
3020
|
},
|
|
2734
|
-
|
|
3021
|
+
u
|
|
2735
3022
|
);
|
|
2736
3023
|
}) }),
|
|
2737
3024
|
/* @__PURE__ */ Q("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
|
|
@@ -2739,7 +3026,7 @@ function so({
|
|
|
2739
3026
|
Math.round(r * 100),
|
|
2740
3027
|
"%)"
|
|
2741
3028
|
] }),
|
|
2742
|
-
/* @__PURE__ */
|
|
3029
|
+
/* @__PURE__ */ $(
|
|
2743
3030
|
"input",
|
|
2744
3031
|
{
|
|
2745
3032
|
id: "bm-opacity-slider",
|
|
@@ -2749,157 +3036,164 @@ function so({
|
|
|
2749
3036
|
max: "1",
|
|
2750
3037
|
step: "0.01",
|
|
2751
3038
|
value: r,
|
|
2752
|
-
onChange: (
|
|
3039
|
+
onChange: (u) => o(parseFloat(u.target.value))
|
|
2753
3040
|
}
|
|
2754
3041
|
),
|
|
2755
|
-
|
|
3042
|
+
s && /* @__PURE__ */ Q("div", { className: "bm-widget__popup", children: [
|
|
2756
3043
|
/* @__PURE__ */ Q("div", { className: "bm-widget__popup-header", children: [
|
|
2757
|
-
/* @__PURE__ */
|
|
2758
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ $("span", { children: "Block attributes" }),
|
|
3045
|
+
/* @__PURE__ */ $(
|
|
2759
3046
|
"button",
|
|
2760
3047
|
{
|
|
2761
3048
|
type: "button",
|
|
2762
3049
|
className: "bm-widget__popup-close",
|
|
2763
|
-
onClick:
|
|
3050
|
+
onClick: l,
|
|
2764
3051
|
"aria-label": "Close",
|
|
2765
3052
|
children: "×"
|
|
2766
3053
|
}
|
|
2767
3054
|
)
|
|
2768
3055
|
] }),
|
|
2769
|
-
/* @__PURE__ */
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
] },
|
|
3056
|
+
/* @__PURE__ */ $("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ $("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ Q("tr", { children: [
|
|
3057
|
+
/* @__PURE__ */ $("th", { children: u }),
|
|
3058
|
+
/* @__PURE__ */ $("td", { children: m == null ? "—" : String(m) })
|
|
3059
|
+
] }, u)) }) })
|
|
2773
3060
|
] })
|
|
2774
3061
|
] });
|
|
2775
3062
|
}
|
|
2776
3063
|
export {
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
3064
|
+
Wn as ASSAY_COLOR_PALETTE_10,
|
|
3065
|
+
rn as ASSAY_NON_VALUE_FIELDS,
|
|
3066
|
+
R as AZIMUTH,
|
|
3067
|
+
Kr as BASELODE_DATA_MODEL_DRILL_ASSAY,
|
|
3068
|
+
Wr as BASELODE_DATA_MODEL_DRILL_COLLAR,
|
|
3069
|
+
tn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
|
|
3070
|
+
Zr as BASELODE_DATA_MODEL_DRILL_SURVEY,
|
|
3071
|
+
Jr as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
|
|
3072
|
+
Ro as Baselode3DControls,
|
|
3073
|
+
jo as Baselode3DScene,
|
|
3074
|
+
Bo as BlockModelWidget,
|
|
3075
|
+
Qe as CHART_OPTIONS,
|
|
3076
|
+
dn as COMMENT_COLUMN_NAMES,
|
|
3077
|
+
bt as CRS,
|
|
3078
|
+
nn as DEFAULT_COLUMN_MAP,
|
|
3079
|
+
q as DEPTH,
|
|
2792
3080
|
B as DIP,
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
3081
|
+
Se as DISPLAY_CATEGORICAL,
|
|
3082
|
+
xe as DISPLAY_COMMENT,
|
|
3083
|
+
ke as DISPLAY_HIDDEN,
|
|
3084
|
+
Ie as DISPLAY_NUMERIC,
|
|
3085
|
+
Ge as DISPLAY_TADPOLE,
|
|
3086
|
+
de as EASTING,
|
|
3087
|
+
Me as ELEVATION,
|
|
3088
|
+
Vn as ERROR_COLOR,
|
|
3089
|
+
pr as FOV_MAX_DEG,
|
|
3090
|
+
hr as FOV_MIN_DEG,
|
|
3091
|
+
S as FROM,
|
|
3092
|
+
oe as GEOLOGY_CODE,
|
|
3093
|
+
ie as GEOLOGY_DESCRIPTION,
|
|
3094
|
+
et as HIDDEN_COLUMNS,
|
|
3095
|
+
z as HOLE_ID,
|
|
2806
3096
|
te as LATITUDE,
|
|
2807
3097
|
ne as LONGITUDE,
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
gr as
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
3098
|
+
Ee as MID,
|
|
3099
|
+
fe as NORTHING,
|
|
3100
|
+
ot as NUMERIC_LINE_COLOR,
|
|
3101
|
+
$n as NUMERIC_MARKER_COLOR,
|
|
3102
|
+
ae as PROJECT_ID,
|
|
3103
|
+
en as STRIKE,
|
|
3104
|
+
D as TO,
|
|
3105
|
+
Lo as TracePlot,
|
|
3106
|
+
Fn as alphaBetaToNormal,
|
|
3107
|
+
wo as annotationsFromIntervals,
|
|
3108
|
+
Mo as assembleDataset,
|
|
3109
|
+
fo as attachAssayPositions,
|
|
3110
|
+
uo as balancedTangentialDesurvey,
|
|
3111
|
+
bn as buildAssayState,
|
|
3112
|
+
Co as buildCategoricalStripLogConfig,
|
|
3113
|
+
Un as buildCommentsConfig,
|
|
3114
|
+
Zn as buildEqualRangeColorScale,
|
|
3115
|
+
jn as buildIntervalPoints,
|
|
3116
|
+
Dt as buildPlotConfig,
|
|
3117
|
+
ko as buildStrikeDipSymbol,
|
|
3118
|
+
or as buildStructuralDiscs,
|
|
3119
|
+
Oo as buildStructuralStripConfig,
|
|
3120
|
+
Yn as buildTadpoleConfig,
|
|
3121
|
+
mo as buildTraces,
|
|
3122
|
+
Ke as buildViewSignature,
|
|
3123
|
+
vo as calculateBlockVolume,
|
|
3124
|
+
vn as calculatePropertyStats,
|
|
3125
|
+
fn as classifyColumns,
|
|
3126
|
+
zo as coerceNumeric,
|
|
3127
|
+
Tn as computeStructuralPositions,
|
|
3128
|
+
io as defaultChartType,
|
|
3129
|
+
Le as deriveAssayProps,
|
|
3130
|
+
ao as desurveyTraces,
|
|
3131
|
+
rr as dipAzimuthToNormal,
|
|
3132
|
+
dr as dolly,
|
|
3133
|
+
ar as emitViewChangeIfNeeded,
|
|
3134
|
+
An as filterBlocks,
|
|
3135
|
+
No as filterByProject,
|
|
3136
|
+
Je as fitCameraToBounds,
|
|
3137
|
+
fr as focusOnLastBounds,
|
|
3138
|
+
Eo as getBlockStats,
|
|
3139
|
+
Nr as getCategoryHexColor,
|
|
3140
|
+
Ue as getChartOptions,
|
|
3141
|
+
Sn as getColorForValue,
|
|
3142
|
+
kt as getEqualRangeBinIndex,
|
|
3143
|
+
Jn as getEqualRangeColor,
|
|
3144
|
+
$t as getViewState,
|
|
3145
|
+
Pn as groupRowsByHole,
|
|
3146
|
+
wn as holeHasData,
|
|
3147
|
+
Ln as interpolateTrace,
|
|
3148
|
+
Ho as intervalsAsTubes,
|
|
3149
|
+
_o as joinAssaysToTraces,
|
|
3150
|
+
so as loadAssayFile,
|
|
3151
|
+
pn as loadAssayHole,
|
|
3152
|
+
hn as loadAssayMetadata,
|
|
3153
|
+
go as loadAssays,
|
|
3154
|
+
Io as loadBlockModelMetadata,
|
|
3155
|
+
po as loadCollars,
|
|
3156
|
+
yo as loadGeology,
|
|
3157
|
+
bo as loadSurveys,
|
|
3158
|
+
$e as loadTable,
|
|
3159
|
+
to as logDataInfo,
|
|
3160
|
+
eo as logDataWarning,
|
|
3161
|
+
ur as lookDown,
|
|
3162
|
+
_n as minimumCurvatureDesurvey,
|
|
3163
|
+
En as normalizeBlockRow,
|
|
3164
|
+
ro as normalizeCsvRow,
|
|
3165
|
+
Ce as normalizeFieldName,
|
|
3166
|
+
mr as pan,
|
|
3167
|
+
On as parseAssayCsvTextToHoles,
|
|
3168
|
+
cn as parseAssayHole,
|
|
3169
|
+
no as parseAssayHoleIds,
|
|
3170
|
+
an as parseAssayHoleIdsWithAssays,
|
|
3171
|
+
un as parseAssaysCSV,
|
|
3172
|
+
xo as parseBlockModelCSV,
|
|
3173
|
+
ho as parseDrillholesCSV,
|
|
3174
|
+
kn as parseGeologyCsvText,
|
|
3175
|
+
Cn as parseStructuralCSV,
|
|
3176
|
+
Do as parseStructuralIntervalsCSV,
|
|
3177
|
+
So as parseStructuralPointsCSV,
|
|
3178
|
+
lo as parseSurveyCSV,
|
|
3179
|
+
Po as parseUnifiedDataset,
|
|
3180
|
+
oo as pickFirstPresent,
|
|
3181
|
+
To as planView,
|
|
3182
|
+
Qn as projectTraceToSection,
|
|
3183
|
+
cr as recenterCameraToOrigin,
|
|
3184
|
+
Mt as reorderHoleIds,
|
|
3185
|
+
$o as sectionView,
|
|
3186
|
+
er as sectionWindow,
|
|
3187
|
+
gr as setControlMode,
|
|
3188
|
+
br as setFov,
|
|
3189
|
+
lr as setViewState,
|
|
3190
|
+
he as standardizeColumns,
|
|
3191
|
+
Qr as standardizeRowArray,
|
|
3192
|
+
co as tangentialDesurvey,
|
|
3193
|
+
on as toError,
|
|
3194
|
+
Vo as tracesAsSegments,
|
|
3195
|
+
Fo as useDrillholeTraceGrid,
|
|
3196
|
+
Ao as validateStructuralPoints,
|
|
2903
3197
|
w as withDataErrorContext
|
|
2904
3198
|
};
|
|
2905
3199
|
//# sourceMappingURL=baselode.js.map
|