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