baselode 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baselode.js +1319 -1165
- package/dist/baselode.js.map +1 -1
- package/package.json +2 -1
package/dist/baselode.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as ot, useState as
|
|
1
|
+
import Z from "papaparse";
|
|
2
|
+
import { jsx as q, jsxs as Ne } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as ot, useState as K, useEffect as oe, useMemo as ve } from "react";
|
|
4
4
|
import xe from "plotly.js-dist-min";
|
|
5
|
-
import * as
|
|
5
|
+
import * as x from "three";
|
|
6
6
|
import { OrbitControls as It } from "three/examples/jsm/controls/OrbitControls";
|
|
7
7
|
import { FlyControls as At } from "three/examples/jsm/controls/FlyControls";
|
|
8
|
-
import { ViewportGizmo as
|
|
9
|
-
const
|
|
8
|
+
import { ViewportGizmo as St } from "three-viewport-gizmo";
|
|
9
|
+
const z = "hole_id", ee = "latitude", te = "longitude", he = "elevation", O = "azimuth", k = "dip", B = "from", R = "to", Ve = "mid", re = "project_id", ie = "easting", se = "northing", it = "crs", H = "depth", st = "alpha", at = "beta", Et = "strike", Qn = {
|
|
10
10
|
// A unique hole identifier across the entire dataset and all future data sets
|
|
11
|
-
[
|
|
11
|
+
[z]: "string",
|
|
12
12
|
// The hole ID from the original collar source
|
|
13
13
|
datasource_hole_id: "string",
|
|
14
14
|
// The project ID or project code from the original collar source, if available
|
|
15
|
-
[
|
|
15
|
+
[re]: "string",
|
|
16
16
|
// The latitude of the collar, in decimal degrees (WGS84)
|
|
17
|
-
[Q]: "number",
|
|
18
|
-
// The longitude of the collar, in decimal degrees (WGS84)
|
|
19
17
|
[ee]: "number",
|
|
18
|
+
// The longitude of the collar, in decimal degrees (WGS84)
|
|
19
|
+
[te]: "number",
|
|
20
20
|
// The elevation of the collar, in meters above sea level (WGS84)
|
|
21
21
|
[he]: "number",
|
|
22
22
|
// The easting coordinate of the collar, in meters (projected CRS)
|
|
@@ -25,54 +25,54 @@ const b = "hole_id", Q = "latitude", ee = "longitude", he = "elevation", D = "az
|
|
|
25
25
|
[se]: "number",
|
|
26
26
|
// The coordinate reference system of the collar coordinates for easting/northing, as an EPSG code or proj string
|
|
27
27
|
[it]: "string"
|
|
28
|
-
},
|
|
28
|
+
}, er = {
|
|
29
29
|
// The unique hole id that maps to the collar and any other data tables
|
|
30
|
-
[
|
|
30
|
+
[z]: "string",
|
|
31
31
|
// The depth along the hole where the survey measurement was taken / started
|
|
32
|
-
[
|
|
32
|
+
[H]: "number",
|
|
33
33
|
// The depth along the hole where the survey measurement ended, if applicable (some surveys are point measurements and may not have a 'to' depth)
|
|
34
|
-
[
|
|
34
|
+
[R]: "number",
|
|
35
35
|
// The azimuth of the hole at the survey depth, in degrees from north
|
|
36
|
-
[
|
|
36
|
+
[O]: "number",
|
|
37
37
|
// The dip of the hole at the survey depth, in degrees from horizontal (negative values indicate downward inclination)
|
|
38
|
-
[
|
|
39
|
-
},
|
|
38
|
+
[k]: "number"
|
|
39
|
+
}, tr = {
|
|
40
40
|
// The unique hole id that maps to the collar and any other data tables
|
|
41
|
-
[
|
|
41
|
+
[z]: "string",
|
|
42
42
|
// The depth along the hole where the assay interval starts
|
|
43
|
-
[
|
|
43
|
+
[B]: "number",
|
|
44
44
|
// The depth along the hole where the assay interval ends
|
|
45
|
-
[
|
|
45
|
+
[R]: "number",
|
|
46
46
|
// The midpoint depth of the assay interval
|
|
47
|
-
[
|
|
47
|
+
[Ve]: "number"
|
|
48
48
|
// assay value columns are variable and not standardized here.
|
|
49
49
|
// Assays may be flattened (one column per assay type) or long (one row per assay type with an additional 'assay_type' column)
|
|
50
|
-
},
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
50
|
+
}, nr = {
|
|
51
|
+
[z]: "string",
|
|
52
|
+
[H]: "number",
|
|
53
|
+
[k]: "number",
|
|
54
|
+
[O]: "number",
|
|
55
55
|
[st]: "number",
|
|
56
56
|
[at]: "number",
|
|
57
57
|
comments: "string"
|
|
58
58
|
}, vt = {
|
|
59
|
-
[
|
|
59
|
+
[z]: ["hole_id", "holeid", "hole id", "hole-id"],
|
|
60
60
|
datasource_hole_id: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
61
|
+
[re]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
|
|
62
|
+
[ee]: ["latitude", "lat"],
|
|
63
|
+
[te]: ["longitude", "lon"],
|
|
64
64
|
[he]: ["elevation", "rl", "elev", "z"],
|
|
65
65
|
[ie]: ["easting", "x"],
|
|
66
66
|
[se]: ["northing", "y"],
|
|
67
67
|
[it]: ["crs", "epsg", "projection"],
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
68
|
+
[B]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
|
|
69
|
+
[R]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
|
|
70
|
+
[O]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdrn", "dipdir_calc", "dipdirect_calc"],
|
|
71
|
+
[k]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
|
|
72
72
|
[st]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
|
|
73
73
|
[at]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
|
|
74
|
-
[
|
|
75
|
-
[
|
|
74
|
+
[H]: ["depth", "survey_depth", "surveydepth"],
|
|
75
|
+
[Et]: ["strike", "str"]
|
|
76
76
|
}, lt = {};
|
|
77
77
|
for (const [e, t] of Object.entries(vt))
|
|
78
78
|
for (const n of t) {
|
|
@@ -85,20 +85,20 @@ function ze(e) {
|
|
|
85
85
|
function ue(e, t = null, n = null) {
|
|
86
86
|
const r = { ...lt };
|
|
87
87
|
if (n) {
|
|
88
|
-
for (const [
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
r[
|
|
88
|
+
for (const [i, s] of Object.entries(n))
|
|
89
|
+
if (i != null && s != null) {
|
|
90
|
+
const l = ze(i), u = ze(s);
|
|
91
|
+
r[l] = u;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
const o = {};
|
|
95
|
-
for (const [
|
|
96
|
-
const
|
|
97
|
-
o[u] =
|
|
95
|
+
for (const [i, s] of Object.entries(e)) {
|
|
96
|
+
const l = ze(i), u = r[l] || l;
|
|
97
|
+
o[u] = s;
|
|
98
98
|
}
|
|
99
99
|
return o;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function rr(e, t = null, n = null) {
|
|
102
102
|
return e.map((r) => ue(r, t, n));
|
|
103
103
|
}
|
|
104
104
|
const Pt = /* @__PURE__ */ new Set([
|
|
@@ -133,153 +133,153 @@ const Pt = /* @__PURE__ */ new Set([
|
|
|
133
133
|
"todepth",
|
|
134
134
|
"comment",
|
|
135
135
|
"z"
|
|
136
|
-
]),
|
|
137
|
-
function
|
|
136
|
+
]), Fe = "[baselode:data]";
|
|
137
|
+
function Dt(e, t = "Unknown error") {
|
|
138
138
|
if (e instanceof Error) return e;
|
|
139
139
|
const n = typeof e == "string" && e.trim() ? e : t;
|
|
140
140
|
return new Error(n);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
const r =
|
|
142
|
+
function $(e, t, n = "Operation failed") {
|
|
143
|
+
const r = Dt(t, n), o = new Error(`${e}: ${r.message}`);
|
|
144
144
|
return o.cause = r, o;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function or(e, t) {
|
|
147
147
|
if (t !== void 0) {
|
|
148
|
-
console.warn(`${
|
|
148
|
+
console.warn(`${Fe} ${e}`, t);
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
|
-
console.warn(`${
|
|
151
|
+
console.warn(`${Fe} ${e}`);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
console.info(`${
|
|
153
|
+
function ir(e) {
|
|
154
|
+
console.info(`${Fe} ${e}`);
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
return { holeId: e[
|
|
156
|
+
const Se = (e, t = null) => ue(e, null, t);
|
|
157
|
+
function Lt(e) {
|
|
158
|
+
return { holeId: e[z] };
|
|
159
159
|
}
|
|
160
160
|
function ct(e, t = null) {
|
|
161
|
-
const n = e[
|
|
161
|
+
const n = e[z], r = n !== void 0 ? `${n}`.trim() : "";
|
|
162
162
|
if (!r) return null;
|
|
163
|
-
const o = e[
|
|
164
|
-
return !Number.isFinite(
|
|
163
|
+
const o = e[re] || e.project || e.project_code, i = Number(e[B]), s = Number(e[R]);
|
|
164
|
+
return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
|
|
165
165
|
holeId: r,
|
|
166
166
|
project: o,
|
|
167
|
-
from:
|
|
168
|
-
to:
|
|
167
|
+
from: i,
|
|
168
|
+
to: s,
|
|
169
169
|
...e
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
function ut(e, t) {
|
|
173
173
|
var o;
|
|
174
|
-
const n = t.sort((
|
|
175
|
-
return n.forEach((
|
|
176
|
-
const { from:
|
|
177
|
-
z:
|
|
178
|
-
from:
|
|
179
|
-
to:
|
|
180
|
-
[
|
|
181
|
-
[
|
|
182
|
-
...
|
|
174
|
+
const n = t.sort((i, s) => i.from - s.from), r = [];
|
|
175
|
+
return n.forEach((i) => {
|
|
176
|
+
const { from: s, to: l, project: u, ...a } = i, c = {
|
|
177
|
+
z: s,
|
|
178
|
+
from: s,
|
|
179
|
+
to: l,
|
|
180
|
+
[z]: e,
|
|
181
|
+
[re]: u,
|
|
182
|
+
...a
|
|
183
183
|
};
|
|
184
|
-
r.push(
|
|
184
|
+
r.push(c), r.push({ ...c, z: l });
|
|
185
185
|
}), { id: e, project: (o = n[0]) == null ? void 0 : o.project, points: r };
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function sr(e, t = null) {
|
|
188
188
|
return new Promise((n, r) => {
|
|
189
189
|
const o = /* @__PURE__ */ new Set();
|
|
190
|
-
|
|
190
|
+
Z.parse(e, {
|
|
191
191
|
header: !0,
|
|
192
192
|
dynamicTyping: !0,
|
|
193
193
|
skipEmptyLines: !0,
|
|
194
|
-
step: (
|
|
195
|
-
const
|
|
196
|
-
|
|
194
|
+
step: (i) => {
|
|
195
|
+
const l = Se(i.data, t)[z];
|
|
196
|
+
l !== void 0 && `${l}`.trim() !== "" && o.add(`${l}`.trim());
|
|
197
197
|
},
|
|
198
198
|
complete: () => n(Array.from(o)),
|
|
199
|
-
error: (
|
|
199
|
+
error: (i) => r($("parseAssayHoleIds", i))
|
|
200
200
|
});
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Tt(e) {
|
|
204
204
|
return Object.entries(e || {}).some(([t, n]) => !(Pt.has(t) || n == null || typeof n == "string" && n.trim() === ""));
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Ft(e, t = null) {
|
|
207
207
|
return new Promise((n, r) => {
|
|
208
208
|
const o = /* @__PURE__ */ new Map();
|
|
209
|
-
|
|
209
|
+
Z.parse(e, {
|
|
210
210
|
header: !0,
|
|
211
211
|
dynamicTyping: !0,
|
|
212
212
|
skipEmptyLines: !0,
|
|
213
|
-
step: (
|
|
214
|
-
const
|
|
215
|
-
if (!
|
|
216
|
-
const u =
|
|
213
|
+
step: (i) => {
|
|
214
|
+
const s = Se(i.data, t);
|
|
215
|
+
if (!Tt(s)) return;
|
|
216
|
+
const u = Lt(s).holeId;
|
|
217
217
|
if (u !== void 0 && `${u}`.trim() !== "") {
|
|
218
|
-
const
|
|
219
|
-
o.has(
|
|
220
|
-
holeId:
|
|
218
|
+
const a = `${u}`.trim();
|
|
219
|
+
o.has(a) || o.set(a, {
|
|
220
|
+
holeId: a
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
complete: () => n(Array.from(o.values())),
|
|
225
|
-
error: (
|
|
225
|
+
error: (i) => r($("parseAssayHoleIdsWithAssays", i))
|
|
226
226
|
});
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
return new Promise((o,
|
|
231
|
-
const
|
|
232
|
-
if (!
|
|
233
|
-
|
|
229
|
+
function Ot(e, t, n = null, r = null) {
|
|
230
|
+
return new Promise((o, i) => {
|
|
231
|
+
const s = `${t}`.trim();
|
|
232
|
+
if (!s) {
|
|
233
|
+
i($("parseAssayHole", new Error("Missing hole id")));
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
const
|
|
237
|
-
|
|
236
|
+
const l = [];
|
|
237
|
+
Z.parse(e, {
|
|
238
238
|
header: !0,
|
|
239
239
|
dynamicTyping: !0,
|
|
240
240
|
skipEmptyLines: !0,
|
|
241
241
|
step: (u) => {
|
|
242
|
-
const
|
|
243
|
-
|
|
242
|
+
const a = Se(u.data, r), c = ct(a, r);
|
|
243
|
+
c && `${c.holeId}`.trim() === s && l.push(c);
|
|
244
244
|
},
|
|
245
245
|
complete: () => {
|
|
246
|
-
if (!
|
|
246
|
+
if (!l.length) {
|
|
247
247
|
o(null);
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
|
-
const u = ut(
|
|
250
|
+
const u = ut(s, l);
|
|
251
251
|
o(u);
|
|
252
252
|
},
|
|
253
|
-
error: (u) =>
|
|
253
|
+
error: (u) => i($("parseAssayHole", u))
|
|
254
254
|
});
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function kt(e, t = null, n = null) {
|
|
258
258
|
return new Promise((r, o) => {
|
|
259
|
-
|
|
259
|
+
Z.parse(e, {
|
|
260
260
|
header: !0,
|
|
261
261
|
dynamicTyping: !0,
|
|
262
262
|
skipEmptyLines: !0,
|
|
263
|
-
complete: (
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
|
|
263
|
+
complete: (i) => {
|
|
264
|
+
const s = /* @__PURE__ */ new Map();
|
|
265
|
+
i.data.forEach((u) => {
|
|
266
|
+
const a = Se(u, n), c = ct(a, n);
|
|
267
|
+
c && (s.has(c.holeId) || s.set(c.holeId, []), s.get(c.holeId).push(c));
|
|
268
268
|
});
|
|
269
|
-
const
|
|
270
|
-
r({ holes:
|
|
269
|
+
const l = Array.from(s.entries()).map(([u, a]) => ut(u, a));
|
|
270
|
+
r({ holes: l });
|
|
271
271
|
},
|
|
272
|
-
error: (
|
|
272
|
+
error: (i) => o($("parseAssaysCSV", i))
|
|
273
273
|
});
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function ar(e = {}) {
|
|
277
277
|
const t = {};
|
|
278
278
|
return Object.entries(e || {}).forEach(([n, r]) => {
|
|
279
279
|
n && (t[ze(n)] = r);
|
|
280
280
|
}), t;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function lr(e = {}, t = [], n) {
|
|
283
283
|
for (const r of t) {
|
|
284
284
|
const o = e[r];
|
|
285
285
|
if (o != null && `${o}`.trim() !== "")
|
|
@@ -287,16 +287,16 @@ function tr(e = {}, t = [], n) {
|
|
|
287
287
|
}
|
|
288
288
|
return n;
|
|
289
289
|
}
|
|
290
|
-
const
|
|
291
|
-
function
|
|
290
|
+
const Vt = 4;
|
|
291
|
+
function mt(e = [], t = "") {
|
|
292
292
|
if (!e.length) return [];
|
|
293
293
|
if (!t) return e;
|
|
294
|
-
const n = e.findIndex((
|
|
294
|
+
const n = e.findIndex((i) => i === t);
|
|
295
295
|
if (n === -1) return e;
|
|
296
|
-
const r = e[n], o = e.filter((
|
|
296
|
+
const r = e[n], o = e.filter((i, s) => s !== n);
|
|
297
297
|
return [r, ...o];
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Me({
|
|
300
300
|
property: e = "",
|
|
301
301
|
chartType: t = "",
|
|
302
302
|
categoricalProps: n = [],
|
|
@@ -305,32 +305,32 @@ function Ne({
|
|
|
305
305
|
} = {}) {
|
|
306
306
|
return e ? r.includes(e) ? "comment" : n.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !t || t === "categorical" || t === "comment" || t === "tadpole" ? o : t : t || o;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function dt({
|
|
309
309
|
holeIds: e = [],
|
|
310
310
|
focusedHoleId: t = "",
|
|
311
|
-
plotCount: n =
|
|
311
|
+
plotCount: n = Vt,
|
|
312
312
|
defaultProp: r = "",
|
|
313
313
|
categoricalProps: o = [],
|
|
314
|
-
commentProps:
|
|
315
|
-
numericDefaultChartType:
|
|
314
|
+
commentProps: i = [],
|
|
315
|
+
numericDefaultChartType: s = "markers+line"
|
|
316
316
|
} = {}) {
|
|
317
|
-
const
|
|
318
|
-
return Array.from({ length: n }).map((u,
|
|
319
|
-
const
|
|
317
|
+
const l = mt(e, t);
|
|
318
|
+
return Array.from({ length: n }).map((u, a) => {
|
|
319
|
+
const c = l[a] || e[a] || "", m = Me({
|
|
320
320
|
property: r,
|
|
321
321
|
chartType: "",
|
|
322
322
|
categoricalProps: o,
|
|
323
|
-
commentProps:
|
|
324
|
-
numericDefaultChartType:
|
|
323
|
+
commentProps: i,
|
|
324
|
+
numericDefaultChartType: s
|
|
325
325
|
});
|
|
326
326
|
return {
|
|
327
|
-
holeId:
|
|
327
|
+
holeId: c,
|
|
328
328
|
property: r,
|
|
329
|
-
chartType:
|
|
329
|
+
chartType: m
|
|
330
330
|
};
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
-
const ye = "numeric", _e = "categorical", pe = "comment",
|
|
333
|
+
const ye = "numeric", _e = "categorical", pe = "comment", Ce = "hidden", Oe = "tadpole", Ue = {
|
|
334
334
|
[ye]: [
|
|
335
335
|
{ value: "bar", label: "Bars" },
|
|
336
336
|
{ value: "markers", label: "Markers" },
|
|
@@ -343,11 +343,11 @@ const ye = "numeric", _e = "categorical", pe = "comment", Me = "hidden", ke = "t
|
|
|
343
343
|
[pe]: [
|
|
344
344
|
{ value: "comment", label: "Comments" }
|
|
345
345
|
],
|
|
346
|
-
[
|
|
346
|
+
[Oe]: [
|
|
347
347
|
{ value: "tadpole", label: "Tadpole" }
|
|
348
348
|
],
|
|
349
|
-
[
|
|
350
|
-
},
|
|
349
|
+
[Ce]: []
|
|
350
|
+
}, Ye = /* @__PURE__ */ new Set([
|
|
351
351
|
// Hole identifiers
|
|
352
352
|
"hole_id",
|
|
353
353
|
"holeid",
|
|
@@ -402,7 +402,7 @@ const ye = "numeric", _e = "categorical", pe = "comment", Me = "hidden", ke = "t
|
|
|
402
402
|
"data_source",
|
|
403
403
|
"_hole_key",
|
|
404
404
|
"_hole_id_key"
|
|
405
|
-
]),
|
|
405
|
+
]), wt = /* @__PURE__ */ new Set([
|
|
406
406
|
"comments",
|
|
407
407
|
"comment",
|
|
408
408
|
"notes",
|
|
@@ -420,27 +420,27 @@ function Rt(e) {
|
|
|
420
420
|
const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
|
|
421
421
|
for (const r of t) {
|
|
422
422
|
const o = r.toLowerCase().trim();
|
|
423
|
-
if (
|
|
424
|
-
n[r] =
|
|
423
|
+
if (Ye.has(o) || Ye.has(r)) {
|
|
424
|
+
n[r] = Ce;
|
|
425
425
|
continue;
|
|
426
426
|
}
|
|
427
|
-
if (
|
|
428
|
-
const
|
|
429
|
-
const
|
|
430
|
-
return
|
|
427
|
+
if (wt.has(o)) {
|
|
428
|
+
const l = e.some((u) => {
|
|
429
|
+
const a = u[r];
|
|
430
|
+
return a != null && String(a).trim() !== "" && String(a) !== "null";
|
|
431
431
|
});
|
|
432
|
-
n[r] =
|
|
432
|
+
n[r] = l ? pe : Ce;
|
|
433
433
|
continue;
|
|
434
434
|
}
|
|
435
|
-
let
|
|
436
|
-
for (const
|
|
437
|
-
const u =
|
|
438
|
-
if (!(u == null || typeof u == "string" && u.trim() === "") && (
|
|
439
|
-
|
|
435
|
+
let i = !1, s = !1;
|
|
436
|
+
for (const l of e) {
|
|
437
|
+
const u = l[r];
|
|
438
|
+
if (!(u == null || typeof u == "string" && u.trim() === "") && (s = !0, typeof u == "number" && Number.isFinite(u))) {
|
|
439
|
+
i = !0;
|
|
440
440
|
break;
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
|
|
443
|
+
s ? i ? n[r] = ye : n[r] = _e : n[r] = Ce;
|
|
444
444
|
}
|
|
445
445
|
return {
|
|
446
446
|
byType: n,
|
|
@@ -449,36 +449,36 @@ function Rt(e) {
|
|
|
449
449
|
commentCols: Object.entries(n).filter(([, r]) => r === pe).map(([r]) => r)
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
452
|
+
function we(e) {
|
|
453
|
+
return Ue[e] ?? Ue[ye];
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
const t =
|
|
455
|
+
function cr(e) {
|
|
456
|
+
const t = we(e);
|
|
457
457
|
return t.length ? e === ye ? "line" : t[0].value : "markers+line";
|
|
458
458
|
}
|
|
459
459
|
function Ie(e = []) {
|
|
460
|
-
const t = e.flatMap((
|
|
460
|
+
const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = Rt(t), s = n[0] || r[0] || "";
|
|
461
461
|
return {
|
|
462
462
|
numericProps: n,
|
|
463
463
|
categoricalProps: r,
|
|
464
464
|
commentProps: o,
|
|
465
|
-
columnMeta:
|
|
466
|
-
defaultProp:
|
|
465
|
+
columnMeta: i,
|
|
466
|
+
defaultProp: s
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
469
|
async function $t(e, t = null) {
|
|
470
|
-
return await
|
|
470
|
+
return await Ft(e);
|
|
471
471
|
}
|
|
472
472
|
async function Ht(e, t, n = null) {
|
|
473
|
-
return await
|
|
473
|
+
return await Ot(e, t);
|
|
474
474
|
}
|
|
475
475
|
function jt(e = [], t = "") {
|
|
476
476
|
if (!e.length) return null;
|
|
477
|
-
const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta:
|
|
478
|
-
holeIds:
|
|
477
|
+
const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Ie(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), u = dt({
|
|
478
|
+
holeIds: l,
|
|
479
479
|
focusedHoleId: t,
|
|
480
480
|
plotCount: 4,
|
|
481
|
-
defaultProp:
|
|
481
|
+
defaultProp: s,
|
|
482
482
|
categoricalProps: r,
|
|
483
483
|
commentProps: o,
|
|
484
484
|
numericDefaultChartType: "line"
|
|
@@ -488,173 +488,173 @@ function jt(e = [], t = "") {
|
|
|
488
488
|
numericProps: n,
|
|
489
489
|
categoricalProps: r,
|
|
490
490
|
commentProps: o,
|
|
491
|
-
columnMeta:
|
|
492
|
-
defaultProp:
|
|
491
|
+
columnMeta: i,
|
|
492
|
+
defaultProp: s,
|
|
493
493
|
traceConfigs: u
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
|
-
async function
|
|
497
|
-
const { holes: r } = await
|
|
496
|
+
async function ur(e, t = "", n = null) {
|
|
497
|
+
const { holes: r } = await kt(e, n), o = jt(r, t);
|
|
498
498
|
if (!o) throw new Error("No valid assay intervals found.");
|
|
499
499
|
return o;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function mr(e, t = null) {
|
|
502
502
|
return new Promise((n, r) => {
|
|
503
|
-
|
|
503
|
+
Z.parse(e, {
|
|
504
504
|
header: !0,
|
|
505
505
|
dynamicTyping: !0,
|
|
506
506
|
skipEmptyLines: !0,
|
|
507
507
|
complete: (o) => {
|
|
508
|
-
const
|
|
509
|
-
n(
|
|
508
|
+
const i = o.data.map((s) => Gt(s, t)).filter((s) => s[z] && Number.isFinite(s[H]) && Number.isFinite(s[k]) && Number.isFinite(s[O]));
|
|
509
|
+
n(i);
|
|
510
510
|
},
|
|
511
|
-
error: (o) => r(
|
|
511
|
+
error: (o) => r($("parseSurveyCSV", o))
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
|
-
function
|
|
516
|
-
const n = ue(e, null, t), r = n[
|
|
515
|
+
function Gt(e, t = null) {
|
|
516
|
+
const n = ue(e, null, t), r = n[z], o = n[re] || n.project || n.project_code, i = fe(n[ee]), s = fe(n[te]), l = fe(n[H]), u = fe(n[k]), a = fe(n[O]), c = fe(n.maxdepth);
|
|
517
517
|
return {
|
|
518
518
|
raw: n,
|
|
519
|
-
[
|
|
520
|
-
[
|
|
521
|
-
[Q]: s,
|
|
519
|
+
[z]: r,
|
|
520
|
+
[re]: o,
|
|
522
521
|
[ee]: i,
|
|
523
|
-
[
|
|
524
|
-
[
|
|
525
|
-
[
|
|
526
|
-
|
|
522
|
+
[te]: s,
|
|
523
|
+
[H]: l,
|
|
524
|
+
[k]: u,
|
|
525
|
+
[O]: a,
|
|
526
|
+
maxdepth: c,
|
|
527
527
|
// Legacy field names for backwards compatibility
|
|
528
528
|
project_code: o,
|
|
529
|
-
latitude:
|
|
530
|
-
longitude:
|
|
531
|
-
surveydepth:
|
|
529
|
+
latitude: i,
|
|
530
|
+
longitude: s,
|
|
531
|
+
surveydepth: l
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
534
|
const fe = (e) => {
|
|
535
535
|
const t = Number(e);
|
|
536
536
|
return Number.isFinite(t) ? t : void 0;
|
|
537
537
|
};
|
|
538
|
-
function
|
|
539
|
-
var c,
|
|
538
|
+
function dr(e, t) {
|
|
539
|
+
var a, c, m, d;
|
|
540
540
|
const n = /* @__PURE__ */ new Map();
|
|
541
541
|
e.forEach((f) => {
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
544
|
-
const
|
|
545
|
-
n.has(
|
|
542
|
+
const y = (f[z] || f.holeId || f.id || "").toString().trim();
|
|
543
|
+
if (!y) return;
|
|
544
|
+
const p = y.toLowerCase();
|
|
545
|
+
n.has(p) || n.set(p, f);
|
|
546
546
|
});
|
|
547
|
-
const r = ((
|
|
547
|
+
const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((c = e[0]) == null ? void 0 : c[ee]) ?? 0, o = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[te]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), l = /* @__PURE__ */ new Map();
|
|
548
548
|
t.forEach((f) => {
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
551
|
-
const
|
|
552
|
-
|
|
549
|
+
const y = (f[z] || "").toString().trim();
|
|
550
|
+
if (!y) return;
|
|
551
|
+
const p = y.toLowerCase();
|
|
552
|
+
l.has(p) || l.set(p, []), l.get(p).push(f);
|
|
553
553
|
});
|
|
554
554
|
const u = [];
|
|
555
|
-
return
|
|
556
|
-
const
|
|
557
|
-
if (!
|
|
558
|
-
const h = f.filter((
|
|
555
|
+
return l.forEach((f, y) => {
|
|
556
|
+
const p = n.get(y);
|
|
557
|
+
if (!p) return;
|
|
558
|
+
const h = f.filter((D) => Number.isFinite(D[H] ?? D.surveydepth)).sort((D, G) => (D[H] ?? D.surveydepth) - (G[H] ?? G.surveydepth));
|
|
559
559
|
if (!h.length) return;
|
|
560
|
-
const
|
|
561
|
-
let
|
|
562
|
-
for (let
|
|
563
|
-
const
|
|
564
|
-
if (!
|
|
565
|
-
|
|
566
|
-
x:
|
|
567
|
-
y:
|
|
560
|
+
const g = p.lat ?? p[ee], b = p.lng ?? p[te], _ = 111132, I = 111320 * Math.cos(g * Math.PI / 180), N = (b - o) * s, P = (g - r) * i, E = [];
|
|
561
|
+
let M = 0, F = 0, j = 0;
|
|
562
|
+
for (let D = 0; D < h.length; D += 1) {
|
|
563
|
+
const G = h[D], U = h[D - 1], S = G[H] ?? G.surveydepth, C = G[O] ?? G.azimuth, v = G[k] ?? G.dip;
|
|
564
|
+
if (!U) {
|
|
565
|
+
E.push({
|
|
566
|
+
x: N + M,
|
|
567
|
+
y: P + F,
|
|
568
568
|
z: 0,
|
|
569
|
-
md:
|
|
570
|
-
azimuth:
|
|
571
|
-
dip:
|
|
569
|
+
md: S,
|
|
570
|
+
azimuth: C,
|
|
571
|
+
dip: v
|
|
572
572
|
});
|
|
573
573
|
continue;
|
|
574
574
|
}
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
const
|
|
578
|
-
Math.sin(
|
|
579
|
-
),
|
|
580
|
-
|
|
581
|
-
x:
|
|
582
|
-
y:
|
|
583
|
-
z: -
|
|
575
|
+
const L = U[H] ?? U.surveydepth, A = U[O] ?? U.azimuth, V = U[k] ?? U.dip, w = S - L;
|
|
576
|
+
if (w <= 0) continue;
|
|
577
|
+
const T = qe(V), Y = qe(v), X = ke(A), le = ke(C), be = Math.acos(
|
|
578
|
+
Math.sin(T) * Math.sin(Y) * Math.cos(X - le) + Math.cos(T) * Math.cos(Y)
|
|
579
|
+
), me = be > 1e-6 ? 2 / be * Math.tan(be / 2) : 1, Ee = 0.5 * w * (Math.sin(T) * Math.cos(X) + Math.sin(Y) * Math.cos(le)) * me, de = 0.5 * w * (Math.sin(T) * Math.sin(X) + Math.sin(Y) * Math.sin(le)) * me, Ct = 0.5 * w * (Math.cos(T) + Math.cos(Y)) * me;
|
|
580
|
+
M += Ee, F += de, j += Ct, E.push({
|
|
581
|
+
x: N + M,
|
|
582
|
+
y: P + F,
|
|
583
|
+
z: -j,
|
|
584
584
|
// render with z up; depth down
|
|
585
|
-
md:
|
|
586
|
-
azimuth:
|
|
587
|
-
dip:
|
|
585
|
+
md: S,
|
|
586
|
+
azimuth: C,
|
|
587
|
+
dip: v
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
...
|
|
592
|
-
lat:
|
|
593
|
-
lng:
|
|
590
|
+
const W = E.map((D) => ({
|
|
591
|
+
...D,
|
|
592
|
+
lat: g + D.y / _,
|
|
593
|
+
lng: b + D.x / I
|
|
594
594
|
}));
|
|
595
595
|
u.push({
|
|
596
|
-
id:
|
|
597
|
-
project:
|
|
598
|
-
points:
|
|
599
|
-
collar:
|
|
596
|
+
id: p[z] || p.holeId || y,
|
|
597
|
+
project: p[re] || p.project_id || p.project || "",
|
|
598
|
+
points: W,
|
|
599
|
+
collar: p
|
|
600
600
|
});
|
|
601
601
|
}), u;
|
|
602
602
|
}
|
|
603
|
-
const
|
|
603
|
+
const ke = (e) => e * Math.PI / 180, qe = (e) => {
|
|
604
604
|
const t = Number(e), n = 90 + (Number.isFinite(t) ? t : 0), r = Math.min(180, Math.max(0, n));
|
|
605
|
-
return
|
|
605
|
+
return ke(r);
|
|
606
606
|
};
|
|
607
|
-
function
|
|
607
|
+
function Q(e, t = void 0) {
|
|
608
608
|
const n = Number(e);
|
|
609
609
|
return Number.isFinite(n) ? n : t;
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function Xe(e) {
|
|
612
612
|
return e == null ? "" : `${e}`.trim();
|
|
613
613
|
}
|
|
614
614
|
function Ae(e = [], t = null) {
|
|
615
|
-
const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((
|
|
615
|
+
const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => Xe(s == null ? void 0 : s[i])));
|
|
616
616
|
if (!o)
|
|
617
|
-
throw
|
|
617
|
+
throw $("canonicalizeHoleIdRows", new Error(`hole id column '${n}' not found`));
|
|
618
618
|
return {
|
|
619
619
|
aliasCol: o,
|
|
620
|
-
rows: e.map((
|
|
621
|
-
...
|
|
622
|
-
hole_id:
|
|
620
|
+
rows: e.map((i) => ({
|
|
621
|
+
...i,
|
|
622
|
+
hole_id: Xe(i == null ? void 0 : i[o])
|
|
623
623
|
}))
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function Ze(e) {
|
|
627
627
|
return Number(e) * Math.PI / 180;
|
|
628
628
|
}
|
|
629
629
|
function Pe(e, t) {
|
|
630
|
-
const n =
|
|
631
|
-
return { ca: o, cb:
|
|
630
|
+
const n = Ze(e), r = Ze(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
|
|
631
|
+
return { ca: o, cb: i, cc: s };
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
633
|
+
function Bt(e, t, n, r, o, i = "minimum_curvature") {
|
|
634
|
+
const s = Pe(t, n), l = Pe(r, o);
|
|
635
|
+
if (i === "tangential")
|
|
636
636
|
return {
|
|
637
|
-
dx: e *
|
|
638
|
-
dy: e *
|
|
639
|
-
dz: e *
|
|
637
|
+
dx: e * s.ca,
|
|
638
|
+
dy: e * s.cb,
|
|
639
|
+
dz: e * s.cc,
|
|
640
640
|
azimuth: t,
|
|
641
641
|
dip: n
|
|
642
642
|
};
|
|
643
|
-
if (
|
|
644
|
-
const
|
|
643
|
+
if (i === "balanced_tangential") {
|
|
644
|
+
const m = 0.5 * (t + r), d = 0.5 * (n + o), f = Pe(m, d);
|
|
645
645
|
return {
|
|
646
646
|
dx: e * f.ca,
|
|
647
647
|
dy: e * f.cb,
|
|
648
648
|
dz: e * f.cc,
|
|
649
|
-
azimuth:
|
|
650
|
-
dip:
|
|
649
|
+
azimuth: m,
|
|
650
|
+
dip: d
|
|
651
651
|
};
|
|
652
652
|
}
|
|
653
|
-
const u =
|
|
653
|
+
const u = s.ca * l.ca + s.cb * l.cb + s.cc * l.cc, a = Math.acos(Math.max(-1, Math.min(1, u))), c = a > 1e-6 ? 2 * Math.tan(a / 2) / a : 1;
|
|
654
654
|
return {
|
|
655
|
-
dx: 0.5 * e * (
|
|
656
|
-
dy: 0.5 * e * (
|
|
657
|
-
dz: 0.5 * e * (
|
|
655
|
+
dx: 0.5 * e * (s.ca + l.ca) * c,
|
|
656
|
+
dy: 0.5 * e * (s.cb + l.cb) * c,
|
|
657
|
+
dz: 0.5 * e * (s.cc + l.cc) * c,
|
|
658
658
|
azimuth: r,
|
|
659
659
|
dip: o
|
|
660
660
|
};
|
|
@@ -663,168 +663,168 @@ function Re(e = [], t = [], n = {}) {
|
|
|
663
663
|
const {
|
|
664
664
|
step: r = 1,
|
|
665
665
|
holeIdCol: o = null,
|
|
666
|
-
method:
|
|
667
|
-
} = n,
|
|
668
|
-
if (!
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
!
|
|
666
|
+
method: i = "minimum_curvature"
|
|
667
|
+
} = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l = Ae(e, o), u = Ae(t, o || l.aliasCol);
|
|
668
|
+
if (!l.rows.length || !u.rows.length) return [];
|
|
669
|
+
const a = /* @__PURE__ */ new Map();
|
|
670
|
+
l.rows.forEach((d) => {
|
|
671
|
+
!d.hole_id || a.has(d.hole_id) || a.set(d.hole_id, d);
|
|
672
672
|
});
|
|
673
|
-
const
|
|
674
|
-
u.rows.forEach((
|
|
675
|
-
|
|
673
|
+
const c = /* @__PURE__ */ new Map();
|
|
674
|
+
u.rows.forEach((d) => {
|
|
675
|
+
d.hole_id && (c.has(d.hole_id) || c.set(d.hole_id, []), c.get(d.hole_id).push(d));
|
|
676
676
|
});
|
|
677
|
-
const
|
|
678
|
-
return
|
|
679
|
-
const
|
|
680
|
-
if (!
|
|
681
|
-
const
|
|
682
|
-
...
|
|
683
|
-
from:
|
|
684
|
-
azimuth:
|
|
685
|
-
dip:
|
|
686
|
-
})).filter((
|
|
687
|
-
if (!
|
|
688
|
-
let h =
|
|
689
|
-
const
|
|
677
|
+
const m = [];
|
|
678
|
+
return c.forEach((d, f) => {
|
|
679
|
+
const y = a.get(f);
|
|
680
|
+
if (!y) return;
|
|
681
|
+
const p = [...d].map((E) => ({
|
|
682
|
+
...E,
|
|
683
|
+
from: Q(E.from),
|
|
684
|
+
azimuth: Q(E.azimuth),
|
|
685
|
+
dip: Q(E.dip)
|
|
686
|
+
})).filter((E) => Number.isFinite(E.from) && Number.isFinite(E.azimuth) && Number.isFinite(E.dip)).sort((E, M) => E.from - M.from);
|
|
687
|
+
if (!p.length) return;
|
|
688
|
+
let h = Q(y.x, 0), g = Q(y.y, 0), b = Q(y.z, 0), _ = p[0].from;
|
|
689
|
+
const I = p[0].azimuth, N = p[0].dip, P = {
|
|
690
690
|
hole_id: f,
|
|
691
|
-
md:
|
|
691
|
+
md: _,
|
|
692
692
|
x: h,
|
|
693
|
-
y:
|
|
694
|
-
z:
|
|
695
|
-
azimuth:
|
|
696
|
-
dip:
|
|
693
|
+
y: g,
|
|
694
|
+
z: b,
|
|
695
|
+
azimuth: I,
|
|
696
|
+
dip: N
|
|
697
697
|
};
|
|
698
|
-
|
|
699
|
-
for (let
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
for (let
|
|
704
|
-
|
|
705
|
-
const
|
|
706
|
-
h +=
|
|
707
|
-
const
|
|
698
|
+
l.aliasCol !== "hole_id" && y[l.aliasCol] !== void 0 && (P[l.aliasCol] = y[l.aliasCol]), m.push(P);
|
|
699
|
+
for (let E = 0; E < p.length - 1; E += 1) {
|
|
700
|
+
const M = p[E], F = p[E + 1], j = M.from, D = F.from - j;
|
|
701
|
+
if (D <= 0) continue;
|
|
702
|
+
const G = Math.max(1, Math.ceil(D / s)), U = D / G;
|
|
703
|
+
for (let S = 0; S < G; S += 1) {
|
|
704
|
+
_ += U;
|
|
705
|
+
const C = (_ - j) / D, v = M.azimuth + C * (F.azimuth - M.azimuth), L = M.dip + C * (F.dip - M.dip), A = Bt(U, M.azimuth, M.dip, F.azimuth, F.dip, i);
|
|
706
|
+
h += A.dx, g += A.dy, b += A.dz;
|
|
707
|
+
const V = {
|
|
708
708
|
hole_id: f,
|
|
709
|
-
md:
|
|
709
|
+
md: _,
|
|
710
710
|
x: h,
|
|
711
|
-
y:
|
|
712
|
-
z:
|
|
713
|
-
azimuth:
|
|
714
|
-
dip:
|
|
711
|
+
y: g,
|
|
712
|
+
z: b,
|
|
713
|
+
azimuth: i === "minimum_curvature" ? v : A.azimuth,
|
|
714
|
+
dip: i === "minimum_curvature" ? L : A.dip
|
|
715
715
|
};
|
|
716
|
-
|
|
716
|
+
l.aliasCol !== "hole_id" && y[l.aliasCol] !== void 0 && (V[l.aliasCol] = y[l.aliasCol]), m.push(V);
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
}),
|
|
719
|
+
}), m;
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function Ut(e, t, n = {}) {
|
|
722
722
|
return Re(e, t, { ...n, method: "minimum_curvature" });
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function fr(e, t, n = {}) {
|
|
725
725
|
return Re(e, t, { ...n, method: "tangential" });
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function hr(e, t, n = {}) {
|
|
728
728
|
return Re(e, t, { ...n, method: "balanced_tangential" });
|
|
729
729
|
}
|
|
730
|
-
function
|
|
731
|
-
return
|
|
730
|
+
function pr(e, t, n = {}) {
|
|
731
|
+
return Ut(e, t, n);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Yt(e, t) {
|
|
734
734
|
if (!e.length || !Number.isFinite(t)) return null;
|
|
735
735
|
let n = null, r = 1 / 0;
|
|
736
736
|
for (let o = 0; o < e.length; o += 1) {
|
|
737
|
-
const
|
|
738
|
-
if (!Number.isFinite(
|
|
739
|
-
const
|
|
740
|
-
|
|
737
|
+
const i = e[o], s = Q(i.md);
|
|
738
|
+
if (!Number.isFinite(s)) continue;
|
|
739
|
+
const l = Math.abs(s - t);
|
|
740
|
+
l < r && (r = l, n = i);
|
|
741
741
|
}
|
|
742
742
|
return n;
|
|
743
743
|
}
|
|
744
|
-
function
|
|
745
|
-
const r = n.holeIdCol || "hole_id", o = Ae(e, r),
|
|
746
|
-
if (!o.rows.length || !
|
|
747
|
-
const
|
|
748
|
-
return
|
|
749
|
-
|
|
750
|
-
}),
|
|
751
|
-
|
|
752
|
-
}), o.rows.map((
|
|
753
|
-
const u =
|
|
754
|
-
if (!
|
|
755
|
-
const
|
|
756
|
-
if (!
|
|
757
|
-
const
|
|
744
|
+
function yr(e = [], t = [], n = {}) {
|
|
745
|
+
const r = n.holeIdCol || "hole_id", o = Ae(e, r), i = Ae(t, r);
|
|
746
|
+
if (!o.rows.length || !i.rows.length) return [...o.rows];
|
|
747
|
+
const s = /* @__PURE__ */ new Map();
|
|
748
|
+
return i.rows.forEach((l) => {
|
|
749
|
+
l.hole_id && (s.has(l.hole_id) || s.set(l.hole_id, []), s.get(l.hole_id).push(l));
|
|
750
|
+
}), s.forEach((l, u) => {
|
|
751
|
+
s.set(u, [...l].sort((a, c) => Q(a.md, 0) - Q(c.md, 0)));
|
|
752
|
+
}), o.rows.map((l) => {
|
|
753
|
+
const u = Q(l.from), a = Q(l.to), c = Number.isFinite(u) && Number.isFinite(a) ? 0.5 * (u + a) : void 0;
|
|
754
|
+
if (!l.hole_id || !Number.isFinite(c)) return { ...l };
|
|
755
|
+
const m = Yt(s.get(l.hole_id) || [], c);
|
|
756
|
+
if (!m) return { ...l };
|
|
757
|
+
const d = { ...l };
|
|
758
758
|
return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
|
|
759
|
-
|
|
760
|
-
}),
|
|
759
|
+
m[f] !== void 0 && (Object.prototype.hasOwnProperty.call(d, f) ? d[`${f}_trace`] = m[f] : d[f] = m[f]);
|
|
760
|
+
}), d;
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function br(e, t = null) {
|
|
764
764
|
return new Promise((n, r) => {
|
|
765
|
-
|
|
765
|
+
Z.parse(e, {
|
|
766
766
|
header: !0,
|
|
767
767
|
dynamicTyping: !0,
|
|
768
768
|
skipEmptyLines: !0,
|
|
769
769
|
complete: (o) => {
|
|
770
|
-
const
|
|
771
|
-
o.data.forEach((
|
|
772
|
-
const
|
|
773
|
-
!
|
|
774
|
-
...
|
|
775
|
-
holeId:
|
|
776
|
-
order:
|
|
777
|
-
x: Number(
|
|
770
|
+
const i = /* @__PURE__ */ new Map();
|
|
771
|
+
o.data.forEach((l, u) => {
|
|
772
|
+
const a = ue(l, null, t), c = a[z], m = c !== void 0 ? `${c}`.trim() : "", d = a[ie] ?? a.x, f = a[se] ?? a.y, y = a[he] ?? a.z, p = a.order ?? u;
|
|
773
|
+
!m || d === null || d === void 0 || f === null || f === void 0 || y === null || y === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
|
|
774
|
+
...a,
|
|
775
|
+
holeId: m,
|
|
776
|
+
order: p,
|
|
777
|
+
x: Number(d) ?? 0,
|
|
778
778
|
y: Number(f) ?? 0,
|
|
779
|
-
z: Number(
|
|
779
|
+
z: Number(y) ?? 0
|
|
780
780
|
}));
|
|
781
781
|
});
|
|
782
|
-
const
|
|
783
|
-
id:
|
|
784
|
-
points: u.sort((
|
|
785
|
-
...
|
|
786
|
-
x: Number(
|
|
787
|
-
y: Number(
|
|
788
|
-
z: Number(
|
|
782
|
+
const s = Array.from(i.entries()).map(([l, u]) => ({
|
|
783
|
+
id: l,
|
|
784
|
+
points: u.sort((a, c) => a.order - c.order).map((a) => ({
|
|
785
|
+
...a,
|
|
786
|
+
x: Number(a.x) || 0,
|
|
787
|
+
y: Number(a.y) || 0,
|
|
788
|
+
z: Number(a.z) || 0
|
|
789
789
|
}))
|
|
790
790
|
}));
|
|
791
|
-
n({ holes:
|
|
791
|
+
n({ holes: s });
|
|
792
792
|
},
|
|
793
|
-
error: (o) => r(
|
|
793
|
+
error: (o) => r($("parseDrillholesCSV", o))
|
|
794
794
|
});
|
|
795
795
|
});
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function ge(e) {
|
|
798
798
|
return e ? Array.isArray(e) ? [...e] : [] : [];
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function J(e) {
|
|
801
801
|
const t = Number(e);
|
|
802
802
|
return Number.isFinite(t) ? t : void 0;
|
|
803
803
|
}
|
|
804
804
|
function ft(e = [], t = []) {
|
|
805
805
|
const n = [...e];
|
|
806
806
|
return n.sort((r, o) => {
|
|
807
|
-
for (let
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
return
|
|
807
|
+
for (let i = 0; i < t.length; i += 1) {
|
|
808
|
+
const s = t[i], l = r == null ? void 0 : r[s], u = o == null ? void 0 : o[s];
|
|
809
|
+
if (l !== u)
|
|
810
|
+
return l == null ? 1 : u == null ? -1 : typeof l == "number" && typeof u == "number" ? l - u : `${l}`.localeCompare(`${u}`);
|
|
811
811
|
}
|
|
812
812
|
return 0;
|
|
813
813
|
}), n;
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function qt(e, t = {}) {
|
|
816
816
|
return new Promise((n, r) => {
|
|
817
|
-
|
|
817
|
+
Z.parse(e, {
|
|
818
818
|
header: !0,
|
|
819
819
|
dynamicTyping: !0,
|
|
820
820
|
skipEmptyLines: !0,
|
|
821
821
|
...t,
|
|
822
822
|
complete: (o) => n(Array.isArray(o == null ? void 0 : o.data) ? o.data : []),
|
|
823
|
-
error: (o) => r(
|
|
823
|
+
error: (o) => r($("loadTable(csv)", o))
|
|
824
824
|
});
|
|
825
825
|
});
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Xt(e = [], t = null, n = null) {
|
|
828
828
|
return e.map((r) => ue(r, t, n));
|
|
829
829
|
}
|
|
830
830
|
async function $e(e, t = {}) {
|
|
@@ -832,111 +832,111 @@ async function $e(e, t = {}) {
|
|
|
832
832
|
kind: n = "csv",
|
|
833
833
|
columnMap: r = null,
|
|
834
834
|
sourceColumnMap: o = null,
|
|
835
|
-
papaParseConfig:
|
|
835
|
+
papaParseConfig: i = {}
|
|
836
836
|
} = t;
|
|
837
|
-
let
|
|
837
|
+
let s;
|
|
838
838
|
if (Array.isArray(e))
|
|
839
|
-
|
|
839
|
+
s = ge(e);
|
|
840
840
|
else if (n === "csv")
|
|
841
|
-
|
|
842
|
-
else throw n === "parquet" || n === "sql" ?
|
|
843
|
-
return
|
|
841
|
+
s = await qt(e, i);
|
|
842
|
+
else throw n === "parquet" || n === "sql" ? $("loadTable", new Error(`Unsupported kind in JS runtime: ${n}`)) : $("loadTable", new Error(`Unsupported kind: ${n}`));
|
|
843
|
+
return Xt(s, r, o);
|
|
844
844
|
}
|
|
845
|
-
async function
|
|
845
|
+
async function gr(e, t = {}) {
|
|
846
846
|
const {
|
|
847
847
|
crs: n = null,
|
|
848
848
|
sourceColumnMap: r = null,
|
|
849
849
|
keepAll: o = !0,
|
|
850
|
-
...
|
|
851
|
-
} = t,
|
|
852
|
-
if (!
|
|
853
|
-
throw
|
|
854
|
-
const u =
|
|
855
|
-
if (!u && !
|
|
856
|
-
throw
|
|
857
|
-
const
|
|
858
|
-
const f = { ...
|
|
859
|
-
if (
|
|
860
|
-
const
|
|
861
|
-
f[
|
|
850
|
+
...i
|
|
851
|
+
} = t, s = await $e(e, { ...i, sourceColumnMap: r });
|
|
852
|
+
if (!s.some((d) => z in d))
|
|
853
|
+
throw $("loadCollars", new Error(`Collar table missing column: ${z}`));
|
|
854
|
+
const u = s.some((d) => ie in d && se in d), a = s.some((d) => ee in d && te in d);
|
|
855
|
+
if (!u && !a)
|
|
856
|
+
throw $("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
|
|
857
|
+
const c = s.map((d) => {
|
|
858
|
+
const f = { ...d };
|
|
859
|
+
if (z in f) {
|
|
860
|
+
const y = f[z];
|
|
861
|
+
f[z] = y == null ? "" : `${y}`.trim();
|
|
862
862
|
}
|
|
863
|
-
return
|
|
863
|
+
return ee in f && (f[ee] = J(f[ee])), te in f && (f[te] = J(f[te])), he in f && (f[he] = J(f[he])), ie in f && (f[ie] = J(f[ie])), se in f && (f[se] = J(f[se])), !("datasource_hole_id" in f) && z in f && (f.datasource_hole_id = f[z]), f;
|
|
864
864
|
});
|
|
865
|
-
if (!
|
|
866
|
-
throw
|
|
867
|
-
return
|
|
865
|
+
if (!c.every((d) => !(!d[z] || a && (!Number.isFinite(d[ee]) || !Number.isFinite(d[te])) || u && !a && (!Number.isFinite(d[ie]) || !Number.isFinite(d[se])))))
|
|
866
|
+
throw $("loadCollars", new Error("Collar table has missing required values"));
|
|
867
|
+
return c;
|
|
868
868
|
}
|
|
869
|
-
async function
|
|
869
|
+
async function _r(e, t = {}) {
|
|
870
870
|
const {
|
|
871
871
|
sourceColumnMap: n = null,
|
|
872
872
|
keepAll: r = !0,
|
|
873
873
|
...o
|
|
874
|
-
} = t,
|
|
875
|
-
for (const
|
|
876
|
-
if (!
|
|
877
|
-
throw
|
|
878
|
-
const
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
const
|
|
882
|
-
|
|
874
|
+
} = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, H, O, k];
|
|
875
|
+
for (const a of s)
|
|
876
|
+
if (!i.some((m) => a in m))
|
|
877
|
+
throw $("loadSurveys", new Error(`Survey table missing column: ${a}`));
|
|
878
|
+
const l = i.map((a) => {
|
|
879
|
+
const c = { ...a };
|
|
880
|
+
if (z in c) {
|
|
881
|
+
const m = c[z];
|
|
882
|
+
c[z] = m == null ? "" : `${m}`.trim();
|
|
883
883
|
}
|
|
884
|
-
return
|
|
884
|
+
return H in c && (c[H] = J(c[H])), R in c && (c[R] = J(c[R])), O in c && (c[O] = J(c[O])), k in c && (c[k] = J(c[k])), c;
|
|
885
885
|
});
|
|
886
|
-
if (!
|
|
887
|
-
throw
|
|
888
|
-
return ft(
|
|
886
|
+
if (!l.every((a) => !(!a[z] || !Number.isFinite(a[H]) || !Number.isFinite(a[O]) || !Number.isFinite(a[k]))))
|
|
887
|
+
throw $("loadSurveys", new Error("Survey table has missing required values"));
|
|
888
|
+
return ft(l, [z, H]);
|
|
889
889
|
}
|
|
890
|
-
async function
|
|
890
|
+
async function xr(e, t = {}) {
|
|
891
891
|
const {
|
|
892
892
|
sourceColumnMap: n = null,
|
|
893
893
|
keepAll: r = !0,
|
|
894
894
|
...o
|
|
895
|
-
} = t,
|
|
896
|
-
for (const
|
|
897
|
-
if (!
|
|
898
|
-
throw
|
|
899
|
-
const
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
const
|
|
903
|
-
|
|
895
|
+
} = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, B, R];
|
|
896
|
+
for (const a of s)
|
|
897
|
+
if (!i.some((m) => a in m))
|
|
898
|
+
throw $("loadAssays", new Error(`Assay table missing column: ${a}`));
|
|
899
|
+
const l = i.map((a) => {
|
|
900
|
+
const c = { ...a };
|
|
901
|
+
if (z in c) {
|
|
902
|
+
const m = c[z];
|
|
903
|
+
c[z] = m == null ? "" : `${m}`.trim();
|
|
904
904
|
}
|
|
905
|
-
return
|
|
905
|
+
return B in c && (c[B] = J(c[B])), R in c && (c[R] = J(c[R])), B in c && R in c && Number.isFinite(c[B]) && Number.isFinite(c[R]) && (c[Ve] = 0.5 * (c[B] + c[R])), c;
|
|
906
906
|
});
|
|
907
|
-
if (!
|
|
908
|
-
throw
|
|
909
|
-
return ft(
|
|
907
|
+
if (!l.every((a) => !(!a[z] || !Number.isFinite(a[B]) || !Number.isFinite(a[R]))))
|
|
908
|
+
throw $("loadAssays", new Error("Assay table has missing required values"));
|
|
909
|
+
return ft(l, [z, B, R]);
|
|
910
910
|
}
|
|
911
|
-
function
|
|
912
|
-
const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [
|
|
911
|
+
function Nr(e = [], t = [], n = {}) {
|
|
912
|
+
const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [z];
|
|
913
913
|
if (!t.length) return [...e];
|
|
914
|
-
const o = (
|
|
915
|
-
return t.forEach((
|
|
916
|
-
|
|
917
|
-
}), e.map((
|
|
918
|
-
const
|
|
919
|
-
if (!
|
|
920
|
-
const u = { ...
|
|
921
|
-
return Object.entries(
|
|
922
|
-
r.includes(
|
|
914
|
+
const o = (s) => r.map((l) => `${(s == null ? void 0 : s[l]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
|
|
915
|
+
return t.forEach((s) => {
|
|
916
|
+
i.set(o(s), s);
|
|
917
|
+
}), e.map((s) => {
|
|
918
|
+
const l = i.get(o(s));
|
|
919
|
+
if (!l) return { ...s };
|
|
920
|
+
const u = { ...s };
|
|
921
|
+
return Object.entries(l).forEach(([a, c]) => {
|
|
922
|
+
r.includes(a) || (Object.prototype.hasOwnProperty.call(u, a) ? u[`${a}_trace`] = c : u[a] = c);
|
|
923
923
|
}), u;
|
|
924
924
|
});
|
|
925
925
|
}
|
|
926
|
-
function
|
|
927
|
-
return t == null ? [...e] : e.length ? e.some((r) =>
|
|
926
|
+
function zr(e = [], t = null) {
|
|
927
|
+
return t == null ? [...e] : e.length ? e.some((r) => re in r) ? e.filter((r) => (r == null ? void 0 : r[re]) === t) : [...e] : [];
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Mr(e = [], t = []) {
|
|
930
930
|
return e.map((n) => {
|
|
931
931
|
const r = { ...n };
|
|
932
932
|
return t.forEach((o) => {
|
|
933
933
|
if (!(o in r)) return;
|
|
934
|
-
const
|
|
935
|
-
r[o] =
|
|
934
|
+
const i = J(r[o]);
|
|
935
|
+
r[o] = i;
|
|
936
936
|
}), r;
|
|
937
937
|
});
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function Cr({
|
|
940
940
|
collars: e = [],
|
|
941
941
|
surveys: t = [],
|
|
942
942
|
assays: n = [],
|
|
@@ -944,137 +944,137 @@ function gr({
|
|
|
944
944
|
metadata: o = {}
|
|
945
945
|
} = {}) {
|
|
946
946
|
return {
|
|
947
|
-
collars:
|
|
948
|
-
surveys:
|
|
949
|
-
assays:
|
|
950
|
-
structures:
|
|
947
|
+
collars: ge(e),
|
|
948
|
+
surveys: ge(t),
|
|
949
|
+
assays: ge(n),
|
|
950
|
+
structures: ge(r),
|
|
951
951
|
metadata: o || {}
|
|
952
952
|
};
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function Ir(e) {
|
|
955
955
|
return new Promise((t, n) => {
|
|
956
|
-
|
|
956
|
+
Z.parse(e, {
|
|
957
957
|
header: !0,
|
|
958
958
|
dynamicTyping: !0,
|
|
959
959
|
complete: (r) => {
|
|
960
960
|
const o = r.data.filter(
|
|
961
|
-
(
|
|
962
|
-
),
|
|
963
|
-
(
|
|
961
|
+
(l) => l.center_x !== null && l.center_y !== null && l.center_z !== null
|
|
962
|
+
), i = ["center_x", "center_y", "center_z", "size_x", "size_y", "size_z"], s = Object.keys(o[0] || {}).filter(
|
|
963
|
+
(l) => !i.includes(l)
|
|
964
964
|
);
|
|
965
|
-
t({ data: o, properties:
|
|
965
|
+
t({ data: o, properties: s });
|
|
966
966
|
},
|
|
967
967
|
error: (r) => {
|
|
968
|
-
n(
|
|
968
|
+
n($("parseBlockModelCSV", r));
|
|
969
969
|
}
|
|
970
970
|
});
|
|
971
971
|
});
|
|
972
972
|
}
|
|
973
|
-
function
|
|
974
|
-
const n = e.map((
|
|
975
|
-
if (n.every((
|
|
976
|
-
const
|
|
977
|
-
return { type: "numeric", min:
|
|
973
|
+
function Ar(e, t) {
|
|
974
|
+
const n = e.map((i) => i[t]).filter((i) => i != null);
|
|
975
|
+
if (n.every((i) => typeof i == "number")) {
|
|
976
|
+
const i = Math.min(...n), s = Math.max(...n);
|
|
977
|
+
return { type: "numeric", min: i, max: s, values: n };
|
|
978
978
|
}
|
|
979
979
|
return { type: "categorical", categories: [...new Set(n)], values: n };
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function Zt(e, t, n) {
|
|
982
982
|
if (!t) return new n.Color("#888888");
|
|
983
983
|
if (t.type === "numeric") {
|
|
984
|
-
const
|
|
985
|
-
return new n.Color().setHSL(
|
|
984
|
+
const i = t.max - t.min, l = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
|
|
985
|
+
return new n.Color().setHSL(l / 360, 0.8, 0.5);
|
|
986
986
|
}
|
|
987
987
|
const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
|
|
988
988
|
return new n.Color().setHSL(o / 360, 0.7, 0.5);
|
|
989
989
|
}
|
|
990
990
|
const He = (e, t = null) => ue(e, null, t);
|
|
991
|
-
function
|
|
991
|
+
function Wt(e) {
|
|
992
992
|
if (!e.length) return null;
|
|
993
|
-
const t = e[0], n =
|
|
993
|
+
const t = e[0], n = B in t && R in t, r = H in t && !n;
|
|
994
994
|
return n ? "interval" : r ? "point" : null;
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function ne(e) {
|
|
997
997
|
const t = Number(e);
|
|
998
998
|
return Number.isFinite(t) ? t : null;
|
|
999
999
|
}
|
|
1000
1000
|
function ht(e) {
|
|
1001
|
-
const t = e[
|
|
1001
|
+
const t = e[z] !== void 0 ? `${e[z]}`.trim() : "";
|
|
1002
1002
|
if (!t) return null;
|
|
1003
|
-
const n =
|
|
1003
|
+
const n = ne(e[H]);
|
|
1004
1004
|
return n === null ? null : {
|
|
1005
|
-
[
|
|
1006
|
-
[
|
|
1007
|
-
[
|
|
1008
|
-
[
|
|
1005
|
+
[z]: t,
|
|
1006
|
+
[H]: n,
|
|
1007
|
+
[k]: ne(e[k]),
|
|
1008
|
+
[O]: ne(e[O]),
|
|
1009
1009
|
comments: e.comments != null ? `${e.comments}` : null,
|
|
1010
1010
|
...e
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
1013
|
function pt(e) {
|
|
1014
|
-
const t = e[
|
|
1014
|
+
const t = e[z] !== void 0 ? `${e[z]}`.trim() : "";
|
|
1015
1015
|
if (!t) return null;
|
|
1016
|
-
const n =
|
|
1016
|
+
const n = ne(e[B]), r = ne(e[R]);
|
|
1017
1017
|
if (n === null || r === null || r <= n) return null;
|
|
1018
1018
|
const o = 0.5 * (n + r);
|
|
1019
1019
|
return {
|
|
1020
|
-
[
|
|
1021
|
-
[
|
|
1022
|
-
[
|
|
1020
|
+
[z]: t,
|
|
1021
|
+
[B]: n,
|
|
1022
|
+
[R]: r,
|
|
1023
1023
|
mid: o,
|
|
1024
|
-
[
|
|
1025
|
-
[
|
|
1024
|
+
[k]: ne(e[k]),
|
|
1025
|
+
[O]: ne(e[O]),
|
|
1026
1026
|
classification: e.classification != null ? `${e.classification}` : null,
|
|
1027
1027
|
comments: e.comments != null ? `${e.comments}` : null,
|
|
1028
1028
|
...e
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function Sr(e) {
|
|
1032
1032
|
const t = [], n = [];
|
|
1033
1033
|
for (const r of e) {
|
|
1034
|
-
const o = [],
|
|
1035
|
-
|
|
1034
|
+
const o = [], i = ne(r[k]), s = ne(r[O]);
|
|
1035
|
+
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);
|
|
1036
1036
|
}
|
|
1037
1037
|
return { valid: t, errors: n };
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function Er(e, t = null) {
|
|
1040
1040
|
return new Promise((n, r) => {
|
|
1041
1041
|
const o = {
|
|
1042
1042
|
header: !0,
|
|
1043
1043
|
dynamicTyping: !0,
|
|
1044
1044
|
skipEmptyLines: !0,
|
|
1045
|
-
complete: (
|
|
1046
|
-
const
|
|
1047
|
-
for (const
|
|
1048
|
-
const u = He(
|
|
1049
|
-
|
|
1045
|
+
complete: (i) => {
|
|
1046
|
+
const s = [];
|
|
1047
|
+
for (const l of i.data) {
|
|
1048
|
+
const u = He(l, t), a = ht(u);
|
|
1049
|
+
a && s.push(a);
|
|
1050
1050
|
}
|
|
1051
|
-
n(
|
|
1051
|
+
n(s);
|
|
1052
1052
|
},
|
|
1053
|
-
error: (
|
|
1053
|
+
error: (i) => r($("parseStructuralPointsCSV", i))
|
|
1054
1054
|
};
|
|
1055
1055
|
typeof e == "string" && !e.startsWith("data:") && e.includes(`
|
|
1056
|
-
`) ?
|
|
1056
|
+
`) ? Z.parse(e, o) : Z.parse(e, o);
|
|
1057
1057
|
});
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function vr(e, t = null) {
|
|
1060
1060
|
return new Promise((n, r) => {
|
|
1061
|
-
|
|
1061
|
+
Z.parse(e, {
|
|
1062
1062
|
header: !0,
|
|
1063
1063
|
dynamicTyping: !0,
|
|
1064
1064
|
skipEmptyLines: !0,
|
|
1065
1065
|
complete: (o) => {
|
|
1066
|
-
const
|
|
1067
|
-
for (const
|
|
1068
|
-
const
|
|
1069
|
-
u &&
|
|
1066
|
+
const i = [];
|
|
1067
|
+
for (const s of o.data) {
|
|
1068
|
+
const l = He(s, t), u = pt(l);
|
|
1069
|
+
u && i.push(u);
|
|
1070
1070
|
}
|
|
1071
|
-
n(
|
|
1071
|
+
n(i);
|
|
1072
1072
|
},
|
|
1073
|
-
error: (o) => r(
|
|
1073
|
+
error: (o) => r($("parseStructuralIntervalsCSV", o))
|
|
1074
1074
|
});
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
|
-
function Kt(e, t =
|
|
1077
|
+
function Kt(e, t = z) {
|
|
1078
1078
|
const n = /* @__PURE__ */ new Map();
|
|
1079
1079
|
for (const r of e) {
|
|
1080
1080
|
const o = r[t] != null ? String(r[t]).trim() : "";
|
|
@@ -1084,83 +1084,181 @@ function Kt(e, t = b) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
function Jt(e, t = null) {
|
|
1086
1086
|
return new Promise((n, r) => {
|
|
1087
|
-
|
|
1087
|
+
Z.parse(e, {
|
|
1088
1088
|
header: !0,
|
|
1089
1089
|
dynamicTyping: !0,
|
|
1090
1090
|
skipEmptyLines: !0,
|
|
1091
1091
|
complete: (o) => {
|
|
1092
|
-
const
|
|
1093
|
-
if (!
|
|
1094
|
-
r(
|
|
1092
|
+
const i = o.data.map((u) => He(u, t)), s = Wt(i);
|
|
1093
|
+
if (!s) {
|
|
1094
|
+
r($(
|
|
1095
1095
|
"parseStructuralCSV",
|
|
1096
1096
|
new Error("Structural CSV requires either 'depth' (point) or 'from'/'to' (interval) columns")
|
|
1097
1097
|
));
|
|
1098
1098
|
return;
|
|
1099
1099
|
}
|
|
1100
|
-
const
|
|
1101
|
-
for (const u of
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1100
|
+
const l = [];
|
|
1101
|
+
for (const u of i) {
|
|
1102
|
+
const a = s === "interval" ? pt(u) : ht(u);
|
|
1103
|
+
a && l.push(a);
|
|
1104
1104
|
}
|
|
1105
|
-
n({ schema:
|
|
1105
|
+
n({ schema: s, rows: l });
|
|
1106
1106
|
},
|
|
1107
|
-
error: (o) => r(
|
|
1107
|
+
error: (o) => r($("parseStructuralCSV", o))
|
|
1108
1108
|
});
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
|
1111
1111
|
function Qt(e) {
|
|
1112
1112
|
return new Promise((t) => {
|
|
1113
|
-
|
|
1113
|
+
Z.parse(e, {
|
|
1114
1114
|
header: !0,
|
|
1115
1115
|
dynamicTyping: !0,
|
|
1116
1116
|
skipEmptyLines: !0,
|
|
1117
1117
|
complete: (n) => {
|
|
1118
1118
|
const r = /* @__PURE__ */ new Map();
|
|
1119
|
-
for (const
|
|
1120
|
-
const
|
|
1121
|
-
if (!
|
|
1122
|
-
const u = Number(
|
|
1123
|
-
if (!Number.isFinite(u) || !Number.isFinite(
|
|
1124
|
-
const
|
|
1119
|
+
for (const i of n.data) {
|
|
1120
|
+
const s = ue(i), l = s[z] != null ? `${s[z]}`.trim() : "";
|
|
1121
|
+
if (!l) continue;
|
|
1122
|
+
const u = Number(s[B]), a = Number(s[R]);
|
|
1123
|
+
if (!Number.isFinite(u) || !Number.isFinite(a) || a <= u) continue;
|
|
1124
|
+
const c = (u + a) / 2, { [k]: m, [O]: d, ...f } = s, y = {
|
|
1125
1125
|
...f,
|
|
1126
|
-
[
|
|
1127
|
-
[
|
|
1128
|
-
[
|
|
1129
|
-
[
|
|
1130
|
-
[
|
|
1126
|
+
[z]: l,
|
|
1127
|
+
[B]: u,
|
|
1128
|
+
[R]: a,
|
|
1129
|
+
[Ve]: c,
|
|
1130
|
+
[H]: c,
|
|
1131
1131
|
// unified depth field for y-axis rendering
|
|
1132
1132
|
_source: "assay"
|
|
1133
1133
|
};
|
|
1134
|
-
r.has(
|
|
1134
|
+
r.has(l) || r.set(l, []), r.get(l).push(y);
|
|
1135
1135
|
}
|
|
1136
|
-
const o = Array.from(r.entries()).map(([
|
|
1137
|
-
holeId:
|
|
1138
|
-
points:
|
|
1136
|
+
const o = Array.from(r.entries()).map(([i, s]) => ({
|
|
1137
|
+
holeId: i,
|
|
1138
|
+
points: s.sort((l, u) => l[B] - u[B])
|
|
1139
1139
|
}));
|
|
1140
1140
|
t(o);
|
|
1141
1141
|
}
|
|
1142
1142
|
});
|
|
1143
1143
|
});
|
|
1144
1144
|
}
|
|
1145
|
-
async function
|
|
1145
|
+
async function Pr({ assayCsv: e, structuralCsv: t } = {}) {
|
|
1146
1146
|
const [n, r] = await Promise.all([
|
|
1147
1147
|
e ? Qt(e) : Promise.resolve([]),
|
|
1148
1148
|
t ? Jt(t).then(
|
|
1149
|
-
({ rows:
|
|
1149
|
+
({ rows: i }) => Kt(i.map((s) => ({ ...s, _source: "structural" })))
|
|
1150
1150
|
) : Promise.resolve([])
|
|
1151
|
-
]), o = new Map(n.map((
|
|
1152
|
-
for (const
|
|
1153
|
-
const
|
|
1154
|
-
if (
|
|
1155
|
-
if (o.has(
|
|
1156
|
-
const
|
|
1157
|
-
o.set(
|
|
1151
|
+
]), o = new Map(n.map((i) => [i.holeId, { ...i, points: [...i.points] }]));
|
|
1152
|
+
for (const i of r) {
|
|
1153
|
+
const s = i.holeId;
|
|
1154
|
+
if (s)
|
|
1155
|
+
if (o.has(s)) {
|
|
1156
|
+
const l = o.get(s);
|
|
1157
|
+
o.set(s, { ...l, points: [...l.points, ...i.points || []] });
|
|
1158
1158
|
} else
|
|
1159
|
-
o.set(
|
|
1159
|
+
o.set(s, i);
|
|
1160
1160
|
}
|
|
1161
1161
|
return { holes: Array.from(o.values()) };
|
|
1162
1162
|
}
|
|
1163
|
-
|
|
1163
|
+
function en(e, t) {
|
|
1164
|
+
if (!e || e.length === 0 || !Number.isFinite(t)) return null;
|
|
1165
|
+
const n = e.length;
|
|
1166
|
+
if (n === 1) {
|
|
1167
|
+
const b = e[0];
|
|
1168
|
+
return { x: Number(b.x), y: Number(b.y), z: Number(b.z), dx: 0, dy: 0, dz: -1 };
|
|
1169
|
+
}
|
|
1170
|
+
let r = -1;
|
|
1171
|
+
for (let b = 0; b < n - 1; b++) {
|
|
1172
|
+
const _ = Number(e[b].md), I = Number(e[b + 1].md);
|
|
1173
|
+
if (t >= _ && t <= I) {
|
|
1174
|
+
r = b;
|
|
1175
|
+
break;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
let o, i, s;
|
|
1179
|
+
if (r === -1) {
|
|
1180
|
+
t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
|
|
1181
|
+
const b = Number(o.md), I = Number(i.md) - b;
|
|
1182
|
+
s = I > 0 ? (t - b) / I : t < b ? 0 : 1;
|
|
1183
|
+
} else {
|
|
1184
|
+
o = e[r], i = e[r + 1];
|
|
1185
|
+
const b = Number(o.md), I = Number(i.md) - b;
|
|
1186
|
+
s = I > 0 ? (t - b) / I : 0;
|
|
1187
|
+
}
|
|
1188
|
+
const l = Number(o.x) + s * (Number(i.x) - Number(o.x)), u = Number(o.y) + s * (Number(i.y) - Number(o.y)), a = Number(o.z) + s * (Number(i.z) - Number(o.z));
|
|
1189
|
+
let c, m, d;
|
|
1190
|
+
const f = Number(o.azimuth), y = Number(o.dip), p = Number(i.azimuth), h = Number(i.dip);
|
|
1191
|
+
if (Number.isFinite(f) && Number.isFinite(y)) {
|
|
1192
|
+
const b = Number.isFinite(p) && Number.isFinite(h) ? f + s * (p - f) : f, _ = Number.isFinite(p) && Number.isFinite(h) ? y + s * (h - y) : y, I = b * Math.PI / 180, N = _ * Math.PI / 180;
|
|
1193
|
+
c = Math.cos(N) * Math.sin(I), m = Math.cos(N) * Math.cos(I), d = -Math.sin(N);
|
|
1194
|
+
} else {
|
|
1195
|
+
const b = Number(i.x) - Number(o.x), _ = Number(i.y) - Number(o.y), I = Number(i.z) - Number(o.z), N = Math.sqrt(b * b + _ * _ + I * I);
|
|
1196
|
+
if (N < 1e-10) return { x: l, y: u, z: a, dx: 0, dy: 0, dz: -1 };
|
|
1197
|
+
c = b / N, m = _ / N, d = I / N;
|
|
1198
|
+
}
|
|
1199
|
+
const g = Math.sqrt(c * c + m * m + d * d);
|
|
1200
|
+
return g < 1e-10 ? { x: l, y: u, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: u, z: a, dx: c / g, dy: m / g, dz: d / g };
|
|
1201
|
+
}
|
|
1202
|
+
function tn(e, t, n, r = {}) {
|
|
1203
|
+
const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: u } = n, a = [s, l, u];
|
|
1204
|
+
let c = [0, 0, 1];
|
|
1205
|
+
const m = a[0] * c[0] + a[1] * c[1] + a[2] * c[2];
|
|
1206
|
+
Math.abs(m) > 0.99 && (c = [0, 1, 0]);
|
|
1207
|
+
const d = [
|
|
1208
|
+
c[1] * a[2] - c[2] * a[1],
|
|
1209
|
+
c[2] * a[0] - c[0] * a[2],
|
|
1210
|
+
c[0] * a[1] - c[1] * a[0]
|
|
1211
|
+
], f = Math.sqrt(d[0] ** 2 + d[1] ** 2 + d[2] ** 2), y = f > 1e-10 ? [d[0] / f, d[1] / f, d[2] / f] : [1, 0, 0], p = [
|
|
1212
|
+
a[1] * y[2] - a[2] * y[1],
|
|
1213
|
+
a[2] * y[0] - a[0] * y[2],
|
|
1214
|
+
a[0] * y[1] - a[1] * y[0]
|
|
1215
|
+
], h = Math.sqrt(p[0] ** 2 + p[1] ** 2 + p[2] ** 2), g = h > 1e-10 ? [p[0] / h, p[1] / h, p[2] / h] : [0, 1, 0], b = o === "R" ? y : g, _ = t * Math.PI / 180 * i, I = Math.cos(_), N = Math.sin(_), P = b[0] * a[0] + b[1] * a[1] + b[2] * a[2], E = [
|
|
1216
|
+
a[1] * b[2] - a[2] * b[1],
|
|
1217
|
+
a[2] * b[0] - a[0] * b[2],
|
|
1218
|
+
a[0] * b[1] - a[1] * b[0]
|
|
1219
|
+
], M = [
|
|
1220
|
+
b[0] * I + E[0] * N + a[0] * P * (1 - I),
|
|
1221
|
+
b[1] * I + E[1] * N + a[1] * P * (1 - I),
|
|
1222
|
+
b[2] * I + E[2] * N + a[2] * P * (1 - I)
|
|
1223
|
+
], F = (90 - e) * Math.PI / 180, j = Math.cos(F), W = Math.sin(F), D = j * M[0] + W * a[0], G = j * M[1] + W * a[1], U = j * M[2] + W * a[2], S = Math.sqrt(D * D + G * G + U * U);
|
|
1224
|
+
return S < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: D / S, ny: G / S, nz: U / S };
|
|
1225
|
+
}
|
|
1226
|
+
function nn(e, t, n = {}) {
|
|
1227
|
+
if (!(e != null && e.length) || !(t != null && t.length)) return [];
|
|
1228
|
+
const r = /* @__PURE__ */ new Map();
|
|
1229
|
+
for (const i of t) {
|
|
1230
|
+
const s = i.hole_id != null ? `${i.hole_id}`.trim().toLowerCase() : "";
|
|
1231
|
+
s && (r.has(s) || r.set(s, []), r.get(s).push(i));
|
|
1232
|
+
}
|
|
1233
|
+
for (const [, i] of r)
|
|
1234
|
+
i.sort((s, l) => Number(s.md) - Number(l.md));
|
|
1235
|
+
const o = [];
|
|
1236
|
+
for (const i of e) {
|
|
1237
|
+
const s = i.hole_id != null ? `${i.hole_id}`.trim().toLowerCase() : "";
|
|
1238
|
+
if (!s) continue;
|
|
1239
|
+
const l = r.get(s);
|
|
1240
|
+
if (!l || l.length === 0) continue;
|
|
1241
|
+
const u = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
|
|
1242
|
+
if (!Number.isFinite(u)) continue;
|
|
1243
|
+
const a = en(l, u);
|
|
1244
|
+
if (!a) continue;
|
|
1245
|
+
const { x: c, y: m, z: d, dx: f, dy: y, dz: p } = a;
|
|
1246
|
+
let h, g, b;
|
|
1247
|
+
const _ = i.alpha != null ? Number(i.alpha) : null, I = i.beta != null ? Number(i.beta) : null;
|
|
1248
|
+
if (Number.isFinite(_)) {
|
|
1249
|
+
const N = Number.isFinite(I) ? I : 0, P = tn(_, N, { dx: f, dy: y, dz: p }, n);
|
|
1250
|
+
h = P.nx, g = P.ny, b = P.nz;
|
|
1251
|
+
} else {
|
|
1252
|
+
const N = i.dip != null ? Number(i.dip) : null, P = i.azimuth != null ? Number(i.azimuth) : null;
|
|
1253
|
+
if (!Number.isFinite(N) || !Number.isFinite(P)) continue;
|
|
1254
|
+
const E = N * Math.PI / 180, M = P * Math.PI / 180;
|
|
1255
|
+
h = Math.sin(M) * Math.sin(E), g = Math.cos(M) * Math.sin(E), b = Math.cos(E);
|
|
1256
|
+
}
|
|
1257
|
+
o.push({ ...i, x: c, y: m, z: d, nx: h, ny: g, nz: b });
|
|
1258
|
+
}
|
|
1259
|
+
return o;
|
|
1260
|
+
}
|
|
1261
|
+
const We = "#8b1e3f", rn = "#a8324f", on = "#6b7280", sn = { l: 4, r: 4, t: 4, b: 4 }, Ke = 10, Je = 12;
|
|
1164
1262
|
function Qe(e) {
|
|
1165
1263
|
return e ? typeof e == "string" ? { text: e } : e : {};
|
|
1166
1264
|
}
|
|
@@ -1168,7 +1266,7 @@ function yt(e = {}) {
|
|
|
1168
1266
|
const t = Qe(e.xaxis && e.xaxis.title), n = Qe(e.yaxis && e.yaxis.title);
|
|
1169
1267
|
return {
|
|
1170
1268
|
...e,
|
|
1171
|
-
margin:
|
|
1269
|
+
margin: sn,
|
|
1172
1270
|
autosize: !0,
|
|
1173
1271
|
width: void 0,
|
|
1174
1272
|
xaxis: {
|
|
@@ -1195,115 +1293,115 @@ function yt(e = {}) {
|
|
|
1195
1293
|
}
|
|
1196
1294
|
};
|
|
1197
1295
|
}
|
|
1198
|
-
function
|
|
1296
|
+
function an(e, t) {
|
|
1199
1297
|
var r;
|
|
1200
1298
|
if (!e || !t) return !1;
|
|
1201
1299
|
const n = e.points || [];
|
|
1202
1300
|
for (let o = 0; o < n.length; o += 1) {
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1301
|
+
const i = (r = n[o]) == null ? void 0 : r[t];
|
|
1302
|
+
if (i != null && (typeof i == "number" && Number.isFinite(i) || typeof i == "string" && i.trim() !== ""))
|
|
1205
1303
|
return !0;
|
|
1206
1304
|
}
|
|
1207
1305
|
return !1;
|
|
1208
1306
|
}
|
|
1209
|
-
function
|
|
1307
|
+
function ln(e, t, n) {
|
|
1210
1308
|
if (!e || !t) return [];
|
|
1211
|
-
const r = (e == null ? void 0 : e.points) || [], o = [],
|
|
1212
|
-
return r.forEach((
|
|
1213
|
-
let
|
|
1214
|
-
|
|
1309
|
+
const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
|
|
1310
|
+
return r.forEach((s) => {
|
|
1311
|
+
let l = Number(
|
|
1312
|
+
s.from ?? s.samp_from ?? s.sample_from ?? s.fromdepth ?? s.from_depth ?? s.depth_from
|
|
1215
1313
|
), u = Number(
|
|
1216
|
-
|
|
1314
|
+
s.to ?? s.samp_to ?? s.sample_to ?? s.todepth ?? s.to_depth ?? s.depth_to
|
|
1217
1315
|
);
|
|
1218
|
-
if (!Number.isFinite(
|
|
1219
|
-
const f = Number(
|
|
1220
|
-
Number.isFinite(f) && (
|
|
1316
|
+
if (!Number.isFinite(l) || !Number.isFinite(u)) {
|
|
1317
|
+
const f = Number(s.depth ?? s.md);
|
|
1318
|
+
Number.isFinite(f) && (l = f, u = f);
|
|
1221
1319
|
}
|
|
1222
|
-
const
|
|
1223
|
-
if (!Number.isFinite(
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1228
|
-
!n && !Number.isFinite(
|
|
1229
|
-
z:
|
|
1230
|
-
val:
|
|
1231
|
-
from:
|
|
1320
|
+
const a = s == null ? void 0 : s[t];
|
|
1321
|
+
if (!Number.isFinite(l) || !Number.isFinite(u) || u < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
|
|
1322
|
+
const c = `${t}:${l}-${u}`;
|
|
1323
|
+
if (i.has(c)) return;
|
|
1324
|
+
i.add(c);
|
|
1325
|
+
const m = (l + u) / 2, d = n ? a : Number(a);
|
|
1326
|
+
!n && !Number.isFinite(d) || o.push({
|
|
1327
|
+
z: m,
|
|
1328
|
+
val: d,
|
|
1329
|
+
from: l,
|
|
1232
1330
|
to: u,
|
|
1233
|
-
errorPlus: u -
|
|
1234
|
-
errorMinus:
|
|
1331
|
+
errorPlus: u - m,
|
|
1332
|
+
errorMinus: m - l
|
|
1235
1333
|
});
|
|
1236
|
-
}), o.sort((
|
|
1334
|
+
}), o.sort((s, l) => l.z - s.z);
|
|
1237
1335
|
}
|
|
1238
|
-
function
|
|
1336
|
+
function cn(e, t) {
|
|
1239
1337
|
if (!e.length) return { data: [], layout: {} };
|
|
1240
|
-
const n = [...e].sort((
|
|
1241
|
-
for (let
|
|
1242
|
-
const
|
|
1243
|
-
if (
|
|
1244
|
-
const
|
|
1245
|
-
!
|
|
1338
|
+
const n = [...e].sort((c, m) => m.z - c.z), r = [];
|
|
1339
|
+
for (let c = 0; c < n.length; c += 1) {
|
|
1340
|
+
const m = n[c], d = n[c + 1], f = m.z, y = d ? d.z : m.z - 20;
|
|
1341
|
+
if (y === f) continue;
|
|
1342
|
+
const p = m.val == null ? "" : String(m.val).trim();
|
|
1343
|
+
!p || /^(nan|null|none)$/i.test(p) || r.push({ y0: f, y1: y, category: p, fromVal: m.from, toVal: m.to });
|
|
1246
1344
|
}
|
|
1247
|
-
const o = ["#4e79a7", "#f28e2b", "#e15759", "#76b7b2", "#59a14f", "#edc948", "#b07aa1", "#ff9da7", "#9c755f", "#bab0ac", "#d4a6c8", "#86bcb6"],
|
|
1248
|
-
|
|
1249
|
-
),
|
|
1345
|
+
const o = ["#4e79a7", "#f28e2b", "#e15759", "#76b7b2", "#59a14f", "#edc948", "#b07aa1", "#ff9da7", "#9c755f", "#bab0ac", "#d4a6c8", "#86bcb6"], i = [...new Set(r.map((c) => c.category))], s = Object.fromEntries(
|
|
1346
|
+
i.map((c, m) => [c, o[m % o.length]])
|
|
1347
|
+
), l = r.map((c) => ({
|
|
1250
1348
|
type: "rect",
|
|
1251
1349
|
xref: "x",
|
|
1252
1350
|
yref: "y",
|
|
1253
1351
|
x0: 0,
|
|
1254
1352
|
x1: 1,
|
|
1255
|
-
y0:
|
|
1256
|
-
y1:
|
|
1257
|
-
fillcolor:
|
|
1353
|
+
y0: c.y0,
|
|
1354
|
+
y1: c.y1,
|
|
1355
|
+
fillcolor: s[c.category],
|
|
1258
1356
|
line: { width: 0 }
|
|
1259
1357
|
}));
|
|
1260
1358
|
return { data: [{
|
|
1261
1359
|
x: r.map(() => 0.5),
|
|
1262
|
-
y: r.map((
|
|
1360
|
+
y: r.map((c) => (c.y0 + c.y1) / 2),
|
|
1263
1361
|
mode: "text",
|
|
1264
|
-
text: r.map((
|
|
1362
|
+
text: r.map((c) => c.category),
|
|
1265
1363
|
textposition: "middle center",
|
|
1266
1364
|
showlegend: !1,
|
|
1267
1365
|
hoverinfo: "text",
|
|
1268
|
-
customdata: r.map((
|
|
1366
|
+
customdata: r.map((c) => [Math.min(c.fromVal, c.toVal), Math.max(c.fromVal, c.toVal)]),
|
|
1269
1367
|
hovertemplate: "Category: %{text}<br>from: %{customdata[0]} to: %{customdata[1]}<extra></extra>"
|
|
1270
1368
|
}], layout: yt({
|
|
1271
1369
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1272
1370
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
1273
|
-
shapes:
|
|
1371
|
+
shapes: l,
|
|
1274
1372
|
showlegend: !1,
|
|
1275
1373
|
title: t || void 0
|
|
1276
1374
|
}) };
|
|
1277
1375
|
}
|
|
1278
|
-
function
|
|
1376
|
+
function un(e, t, n) {
|
|
1279
1377
|
if (!e.length) return { data: [], layout: {} };
|
|
1280
|
-
const r = n === "bar", o = n === "markers",
|
|
1281
|
-
x: e.map((
|
|
1282
|
-
y: e.map((
|
|
1378
|
+
const r = n === "bar", o = n === "markers", i = n === "line", s = {
|
|
1379
|
+
x: e.map((c) => c.val),
|
|
1380
|
+
y: e.map((c) => c.z),
|
|
1283
1381
|
hovertemplate: `${t}: %{x}<br>from: %{customdata[0]} to: %{customdata[1]}<extra></extra>`,
|
|
1284
|
-
customdata: e.map((
|
|
1285
|
-
},
|
|
1382
|
+
customdata: e.map((c) => [Math.min(c.from, c.to), Math.max(c.from, c.to)])
|
|
1383
|
+
}, l = {
|
|
1286
1384
|
type: "data",
|
|
1287
1385
|
symmetric: !1,
|
|
1288
|
-
array: e.map((
|
|
1289
|
-
arrayminus: e.map((
|
|
1386
|
+
array: e.map((c) => c.errorPlus),
|
|
1387
|
+
arrayminus: e.map((c) => c.errorMinus),
|
|
1290
1388
|
thickness: 1.5,
|
|
1291
1389
|
width: 2,
|
|
1292
|
-
color:
|
|
1390
|
+
color: on
|
|
1293
1391
|
};
|
|
1294
1392
|
return { data: [r ? {
|
|
1295
|
-
...
|
|
1393
|
+
...s,
|
|
1296
1394
|
type: "bar",
|
|
1297
1395
|
orientation: "h",
|
|
1298
|
-
marker: { color:
|
|
1299
|
-
error_y:
|
|
1396
|
+
marker: { color: We },
|
|
1397
|
+
error_y: l
|
|
1300
1398
|
} : {
|
|
1301
|
-
...
|
|
1399
|
+
...s,
|
|
1302
1400
|
type: "scatter",
|
|
1303
|
-
mode: o ? "markers" :
|
|
1304
|
-
line: { color:
|
|
1305
|
-
marker: { size: 7, color:
|
|
1306
|
-
error_y:
|
|
1401
|
+
mode: o ? "markers" : i ? "lines" : "lines+markers",
|
|
1402
|
+
line: { color: We, width: 2 },
|
|
1403
|
+
marker: { size: 7, color: rn },
|
|
1404
|
+
error_y: i ? void 0 : l
|
|
1307
1405
|
}], layout: yt({
|
|
1308
1406
|
xaxis: { title: t, zeroline: !1 },
|
|
1309
1407
|
yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
|
|
@@ -1311,10 +1409,10 @@ function an(e, t, n) {
|
|
|
1311
1409
|
showlegend: !1
|
|
1312
1410
|
}) };
|
|
1313
1411
|
}
|
|
1314
|
-
function
|
|
1315
|
-
return !e || !e.length || !n ? { data: [], layout: {} } : t || r === "categorical" ?
|
|
1412
|
+
function mn({ points: e, isCategorical: t, property: n, chartType: r }) {
|
|
1413
|
+
return !e || !e.length || !n ? { data: [], layout: {} } : t || r === "categorical" ? cn(e, n) : un(e, n, r);
|
|
1316
1414
|
}
|
|
1317
|
-
const
|
|
1415
|
+
const bt = [
|
|
1318
1416
|
"#0f172a",
|
|
1319
1417
|
"#1e3a5f",
|
|
1320
1418
|
"#7c3aed",
|
|
@@ -1325,11 +1423,11 @@ const gt = [
|
|
|
1325
1423
|
"#db2777",
|
|
1326
1424
|
"#65a30d",
|
|
1327
1425
|
"#9333ea"
|
|
1328
|
-
],
|
|
1329
|
-
function
|
|
1426
|
+
], dn = { l: 4, r: 4, t: 4, b: 4 }, et = 10, tt = 12;
|
|
1427
|
+
function gt(e = {}) {
|
|
1330
1428
|
return {
|
|
1331
1429
|
...e,
|
|
1332
|
-
margin:
|
|
1430
|
+
margin: dn,
|
|
1333
1431
|
autosize: !0,
|
|
1334
1432
|
width: void 0,
|
|
1335
1433
|
xaxis: {
|
|
@@ -1362,54 +1460,54 @@ function bt(e = {}) {
|
|
|
1362
1460
|
}
|
|
1363
1461
|
};
|
|
1364
1462
|
}
|
|
1365
|
-
function
|
|
1463
|
+
function fn(e, {
|
|
1366
1464
|
tailScale: t = 5,
|
|
1367
1465
|
colorBy: n = null,
|
|
1368
|
-
palette: r =
|
|
1369
|
-
depthCol: o =
|
|
1370
|
-
dipCol:
|
|
1371
|
-
azCol:
|
|
1466
|
+
palette: r = bt,
|
|
1467
|
+
depthCol: o = H,
|
|
1468
|
+
dipCol: i = k,
|
|
1469
|
+
azCol: s = O
|
|
1372
1470
|
} = {}) {
|
|
1373
|
-
const
|
|
1374
|
-
(
|
|
1471
|
+
const l = e.filter(
|
|
1472
|
+
(y) => y[o] != null && y[i] != null && y[s] != null
|
|
1375
1473
|
);
|
|
1376
|
-
if (!
|
|
1474
|
+
if (!l.length)
|
|
1377
1475
|
return { data: [], layout: {} };
|
|
1378
1476
|
const u = {};
|
|
1379
|
-
n && [...new Set(
|
|
1380
|
-
u[
|
|
1477
|
+
n && [...new Set(l.map((p) => p[n]).filter((p) => p != null))].sort().forEach((p, h) => {
|
|
1478
|
+
u[p] = r[h % r.length];
|
|
1381
1479
|
});
|
|
1382
|
-
const
|
|
1383
|
-
for (const
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1480
|
+
const a = /* @__PURE__ */ new Map(), c = [];
|
|
1481
|
+
for (const y of l) {
|
|
1482
|
+
const p = Number(y[o]), h = Number(y[i]), g = Number(y[s]), b = n ? y[n] ?? "_default" : "_default", _ = n ? u[b] ?? "#0f172a" : "#0f172a";
|
|
1483
|
+
a.has(b) || a.set(b, { xs: [], ys: [], dips: [], azs: [], color: _ });
|
|
1484
|
+
const I = a.get(b);
|
|
1485
|
+
I.xs.push(h), I.ys.push(p), I.dips.push(h), I.azs.push(g);
|
|
1486
|
+
const N = g * Math.PI / 180, P = t * (Math.abs(h) / 90), E = Math.sin(N) * P, M = Math.cos(N) * P;
|
|
1487
|
+
c.push({
|
|
1390
1488
|
type: "line",
|
|
1391
1489
|
x0: h,
|
|
1392
|
-
y0:
|
|
1393
|
-
x1: h +
|
|
1394
|
-
y1:
|
|
1395
|
-
line: { color:
|
|
1490
|
+
y0: p,
|
|
1491
|
+
x1: h + E,
|
|
1492
|
+
y1: p + M,
|
|
1493
|
+
line: { color: _, width: 2 }
|
|
1396
1494
|
});
|
|
1397
1495
|
}
|
|
1398
|
-
const
|
|
1399
|
-
for (const [
|
|
1400
|
-
|
|
1496
|
+
const m = [], d = n && a.size > 1;
|
|
1497
|
+
for (const [y, p] of a.entries())
|
|
1498
|
+
m.push({
|
|
1401
1499
|
type: "scatter",
|
|
1402
|
-
x:
|
|
1403
|
-
y:
|
|
1500
|
+
x: p.xs,
|
|
1501
|
+
y: p.ys,
|
|
1404
1502
|
mode: "markers",
|
|
1405
|
-
name:
|
|
1406
|
-
marker: { size: 8, color:
|
|
1407
|
-
showlegend:
|
|
1408
|
-
customdata:
|
|
1503
|
+
name: y !== "_default" ? String(y) : void 0,
|
|
1504
|
+
marker: { size: 8, color: p.color },
|
|
1505
|
+
showlegend: d && y !== "_default",
|
|
1506
|
+
customdata: p.dips.map((h, g) => [h, p.azs[g]]),
|
|
1409
1507
|
hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
|
|
1410
1508
|
});
|
|
1411
|
-
return { data:
|
|
1412
|
-
shapes:
|
|
1509
|
+
return { data: m, layout: {
|
|
1510
|
+
shapes: c,
|
|
1413
1511
|
height: 400,
|
|
1414
1512
|
margin: { l: 40, r: 10, t: 10, b: 40 },
|
|
1415
1513
|
xaxis: {
|
|
@@ -1420,80 +1518,80 @@ function un(e, {
|
|
|
1420
1518
|
tickvals: [-90, -60, -30, 0, 30, 60, 90]
|
|
1421
1519
|
},
|
|
1422
1520
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1423
|
-
showlegend: !!
|
|
1521
|
+
showlegend: !!d
|
|
1424
1522
|
} };
|
|
1425
1523
|
}
|
|
1426
|
-
function
|
|
1524
|
+
function Dr(e, {
|
|
1427
1525
|
labelCol: t = "structure_type",
|
|
1428
|
-
palette: n =
|
|
1429
|
-
fromCol: r =
|
|
1430
|
-
toCol: o =
|
|
1526
|
+
palette: n = bt,
|
|
1527
|
+
fromCol: r = B,
|
|
1528
|
+
toCol: o = R
|
|
1431
1529
|
} = {}) {
|
|
1432
|
-
const
|
|
1433
|
-
const
|
|
1434
|
-
if (
|
|
1435
|
-
const f = String(
|
|
1530
|
+
const i = e.filter((m) => m[r] != null && m[o] != null && Number(m[o]) > Number(m[r])).filter((m) => {
|
|
1531
|
+
const d = m[t];
|
|
1532
|
+
if (d == null) return !1;
|
|
1533
|
+
const f = String(d).trim();
|
|
1436
1534
|
return f !== "" && !/^(nan|null|none)$/i.test(f);
|
|
1437
|
-
}).map((
|
|
1438
|
-
if (!
|
|
1535
|
+
}).map((m) => ({ from: Number(m[r]), to: Number(m[o]), label: String(m[t]).trim() })).sort((m, d) => m.from - d.from);
|
|
1536
|
+
if (!i.length)
|
|
1439
1537
|
return { data: [], layout: {} };
|
|
1440
|
-
const
|
|
1441
|
-
return
|
|
1442
|
-
|
|
1538
|
+
const s = [], l = [], u = [];
|
|
1539
|
+
return i.forEach((m, d) => {
|
|
1540
|
+
s.push({
|
|
1443
1541
|
type: "rect",
|
|
1444
1542
|
xref: "x",
|
|
1445
1543
|
yref: "y",
|
|
1446
1544
|
x0: 0,
|
|
1447
1545
|
x1: 1,
|
|
1448
|
-
y0:
|
|
1449
|
-
y1:
|
|
1450
|
-
fillcolor: n[
|
|
1546
|
+
y0: m.from,
|
|
1547
|
+
y1: m.to,
|
|
1548
|
+
fillcolor: n[d % n.length],
|
|
1451
1549
|
line: { width: 0 }
|
|
1452
|
-
}),
|
|
1550
|
+
}), l.push(0.5 * (m.from + m.to)), u.push(m.label);
|
|
1453
1551
|
}), { data: [{
|
|
1454
1552
|
type: "scatter",
|
|
1455
1553
|
x: Array(u.length).fill(0.5),
|
|
1456
|
-
y:
|
|
1554
|
+
y: l,
|
|
1457
1555
|
mode: "text",
|
|
1458
1556
|
text: u,
|
|
1459
1557
|
textposition: "middle center",
|
|
1460
1558
|
showlegend: !1,
|
|
1461
1559
|
hoverinfo: "text"
|
|
1462
|
-
}], layout:
|
|
1463
|
-
shapes:
|
|
1560
|
+
}], layout: gt({
|
|
1561
|
+
shapes: s,
|
|
1464
1562
|
height: 400,
|
|
1465
1563
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1466
1564
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1467
1565
|
showlegend: !1
|
|
1468
1566
|
}) };
|
|
1469
1567
|
}
|
|
1470
|
-
function
|
|
1568
|
+
function hn(e, t) {
|
|
1471
1569
|
if (!e) return "";
|
|
1472
1570
|
const n = String(e).trim().split(/\s+/), r = [];
|
|
1473
1571
|
let o = "";
|
|
1474
|
-
for (const
|
|
1475
|
-
o && o.length + 1 +
|
|
1572
|
+
for (const i of n)
|
|
1573
|
+
o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
|
|
1476
1574
|
return o && r.push(o), r.join("<br>");
|
|
1477
1575
|
}
|
|
1478
|
-
function
|
|
1576
|
+
function pn(e, {
|
|
1479
1577
|
commentCol: t = "comments",
|
|
1480
|
-
fromCol: n =
|
|
1481
|
-
toCol: r =
|
|
1578
|
+
fromCol: n = B,
|
|
1579
|
+
toCol: r = R,
|
|
1482
1580
|
bgColor: o = "#f1f5f9",
|
|
1483
|
-
borderColor:
|
|
1484
|
-
textColor:
|
|
1485
|
-
charsPerLine:
|
|
1581
|
+
borderColor: i = "#cbd5e1",
|
|
1582
|
+
textColor: s = "#1e293b",
|
|
1583
|
+
charsPerLine: l = 18
|
|
1486
1584
|
} = {}) {
|
|
1487
1585
|
const u = e.filter((h) => h[n] != null && h[r] != null && Number(h[r]) > Number(h[n])).map((h) => {
|
|
1488
|
-
const
|
|
1489
|
-
return { from: Number(h[n]), to: Number(h[r]), comment:
|
|
1490
|
-
}).sort((h,
|
|
1586
|
+
const g = h[t], b = g != null && String(g).trim() !== "" && String(g) !== "null" ? String(g).trim() : "";
|
|
1587
|
+
return { from: Number(h[n]), to: Number(h[r]), comment: b };
|
|
1588
|
+
}).sort((h, g) => h.from - g.from);
|
|
1491
1589
|
if (!u.length)
|
|
1492
1590
|
return { data: [], layout: {} };
|
|
1493
|
-
const
|
|
1591
|
+
const a = [], c = [], m = [], d = [], f = [];
|
|
1494
1592
|
for (const h of u) {
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1593
|
+
const g = 0.5 * (h.from + h.to), b = !!h.comment;
|
|
1594
|
+
a.push({
|
|
1497
1595
|
type: "rect",
|
|
1498
1596
|
xref: "x",
|
|
1499
1597
|
yref: "y",
|
|
@@ -1501,146 +1599,146 @@ function mn(e, {
|
|
|
1501
1599
|
x1: 1,
|
|
1502
1600
|
y0: h.from,
|
|
1503
1601
|
y1: h.to,
|
|
1504
|
-
fillcolor:
|
|
1505
|
-
line: { color:
|
|
1506
|
-
}),
|
|
1602
|
+
fillcolor: b ? o : "rgba(0,0,0,0)",
|
|
1603
|
+
line: { color: i, width: 1 }
|
|
1604
|
+
}), b && (c.push(0.5), m.push(g), d.push(hn(h.comment, l)), f.push(`${h.from}–${h.to} m: ${h.comment}`));
|
|
1507
1605
|
}
|
|
1508
|
-
return { data:
|
|
1606
|
+
return { data: c.length ? [{
|
|
1509
1607
|
type: "scatter",
|
|
1510
|
-
x:
|
|
1511
|
-
y:
|
|
1608
|
+
x: c,
|
|
1609
|
+
y: m,
|
|
1512
1610
|
mode: "text",
|
|
1513
|
-
text:
|
|
1611
|
+
text: d,
|
|
1514
1612
|
textposition: "middle center",
|
|
1515
|
-
textfont: { color:
|
|
1613
|
+
textfont: { color: s, size: 10 },
|
|
1516
1614
|
hovertext: f,
|
|
1517
1615
|
hoverinfo: "text",
|
|
1518
1616
|
showlegend: !1
|
|
1519
|
-
}] : [], layout:
|
|
1520
|
-
shapes:
|
|
1617
|
+
}] : [], layout: gt({
|
|
1618
|
+
shapes: a,
|
|
1521
1619
|
height: 400,
|
|
1522
1620
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1523
1621
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1524
1622
|
showlegend: !1
|
|
1525
1623
|
}) };
|
|
1526
1624
|
}
|
|
1527
|
-
function
|
|
1625
|
+
function Lr(e, {
|
|
1528
1626
|
symbolSize: t = 10,
|
|
1529
1627
|
xCol: n = "easting",
|
|
1530
1628
|
yCol: r = "northing"
|
|
1531
1629
|
} = {}) {
|
|
1532
|
-
const o = e[n] != null ? Number(e[n]) : null,
|
|
1533
|
-
if (o === null ||
|
|
1534
|
-
const u = (
|
|
1630
|
+
const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[k] != null ? Number(e[k]) : null, l = e[O] != null ? Number(e[O]) : null;
|
|
1631
|
+
if (o === null || i === null || s === null || l === null) return null;
|
|
1632
|
+
const u = (l - 90 + 360) % 360, a = u * Math.PI / 180, c = l * Math.PI / 180, m = t * Math.sin(a), d = t * Math.cos(a), f = t * 0.4 * (s / 90), y = f * Math.sin(c), p = f * Math.cos(c);
|
|
1535
1633
|
return {
|
|
1536
1634
|
strike: u,
|
|
1537
|
-
dipValue:
|
|
1635
|
+
dipValue: s,
|
|
1538
1636
|
x: o,
|
|
1539
|
-
y:
|
|
1540
|
-
strikeX0: o -
|
|
1541
|
-
strikeY0:
|
|
1542
|
-
strikeX1: o +
|
|
1543
|
-
strikeY1:
|
|
1544
|
-
tickX1: o +
|
|
1545
|
-
tickY1:
|
|
1637
|
+
y: i,
|
|
1638
|
+
strikeX0: o - m,
|
|
1639
|
+
strikeY0: i - d,
|
|
1640
|
+
strikeX1: o + m,
|
|
1641
|
+
strikeY1: i + d,
|
|
1642
|
+
tickX1: o + y,
|
|
1643
|
+
tickY1: i + p
|
|
1546
1644
|
};
|
|
1547
1645
|
}
|
|
1548
1646
|
const _t = "markers+line";
|
|
1549
|
-
function
|
|
1647
|
+
function yn(e, t) {
|
|
1550
1648
|
var r;
|
|
1551
|
-
const n =
|
|
1649
|
+
const n = we(e);
|
|
1552
1650
|
return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || _t;
|
|
1553
1651
|
}
|
|
1554
|
-
function
|
|
1555
|
-
const
|
|
1652
|
+
function Tr({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o }) {
|
|
1653
|
+
const i = ot(null), s = t == null ? void 0 : t.hole, l = (t == null ? void 0 : t.points) || [], u = (e == null ? void 0 : e.property) || "", a = (e == null ? void 0 : e.chartType) || _t, c = (e == null ? void 0 : e.holeId) || "", m = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? pe : t != null && t.isCategorical ? _e : ye), d = we(m), f = yn(m, a), [y, p] = K("");
|
|
1556
1654
|
return oe(() => {
|
|
1557
|
-
const h =
|
|
1558
|
-
if (!
|
|
1559
|
-
const
|
|
1560
|
-
if (!
|
|
1561
|
-
let
|
|
1655
|
+
const h = m === pe, g = m === Oe;
|
|
1656
|
+
if (!s || !u || !h && !g && l.length === 0) return;
|
|
1657
|
+
const b = i.current;
|
|
1658
|
+
if (!b) return;
|
|
1659
|
+
let _;
|
|
1562
1660
|
try {
|
|
1563
|
-
h ?
|
|
1564
|
-
points:
|
|
1565
|
-
isCategorical:
|
|
1661
|
+
h ? _ = pn(l, { commentCol: u, fromCol: "from", toCol: "to" }) : g ? _ = fn(l) : _ = mn({
|
|
1662
|
+
points: l,
|
|
1663
|
+
isCategorical: m === _e,
|
|
1566
1664
|
property: u,
|
|
1567
1665
|
chartType: f
|
|
1568
1666
|
});
|
|
1569
|
-
} catch (
|
|
1570
|
-
console.error("Plot build error",
|
|
1667
|
+
} catch (N) {
|
|
1668
|
+
console.error("Plot build error", N), p((N == null ? void 0 : N.message) || "Plot build error");
|
|
1571
1669
|
return;
|
|
1572
1670
|
}
|
|
1573
|
-
if ((!(
|
|
1671
|
+
if ((!(_ != null && _.data) || _.data.length === 0) && !h)
|
|
1574
1672
|
return;
|
|
1575
|
-
const
|
|
1673
|
+
const I = {
|
|
1576
1674
|
displayModeBar: !0,
|
|
1577
1675
|
responsive: !0,
|
|
1578
1676
|
useResizeHandler: !0,
|
|
1579
1677
|
modeBarButtonsToRemove: ["select2d", "lasso2d", "zoom2d", "zoomIn2d", "zoomOut2d", "autoScale2d"]
|
|
1580
1678
|
};
|
|
1581
1679
|
try {
|
|
1582
|
-
|
|
1583
|
-
|
|
1680
|
+
p(""), xe.react(b, _.data, _.layout, I), requestAnimationFrame(() => {
|
|
1681
|
+
b && b.parentElement && xe.Plots.resize(b);
|
|
1584
1682
|
});
|
|
1585
|
-
} catch (
|
|
1586
|
-
console.error("Plot render error",
|
|
1683
|
+
} catch (N) {
|
|
1684
|
+
console.error("Plot render error", N), p((N == null ? void 0 : N.message) || "Plot render error");
|
|
1587
1685
|
}
|
|
1588
1686
|
return () => {
|
|
1589
|
-
if (
|
|
1687
|
+
if (b)
|
|
1590
1688
|
try {
|
|
1591
|
-
xe.purge(
|
|
1592
|
-
} catch (
|
|
1593
|
-
console.warn("Plot purge error",
|
|
1689
|
+
xe.purge(b);
|
|
1690
|
+
} catch (N) {
|
|
1691
|
+
console.warn("Plot purge error", N);
|
|
1594
1692
|
}
|
|
1595
1693
|
};
|
|
1596
|
-
}, [
|
|
1597
|
-
const h =
|
|
1694
|
+
}, [s, u, f, m, l]), oe(() => {
|
|
1695
|
+
const h = i.current;
|
|
1598
1696
|
if (!h || typeof ResizeObserver > "u") return;
|
|
1599
|
-
const
|
|
1697
|
+
const g = new ResizeObserver(() => {
|
|
1600
1698
|
try {
|
|
1601
1699
|
h && h.data && xe.Plots.resize(h);
|
|
1602
|
-
} catch (
|
|
1603
|
-
console.warn("Plot resize error",
|
|
1700
|
+
} catch (b) {
|
|
1701
|
+
console.warn("Plot resize error", b);
|
|
1604
1702
|
}
|
|
1605
1703
|
});
|
|
1606
|
-
return
|
|
1607
|
-
}, []), !
|
|
1704
|
+
return g.observe(h), () => g.disconnect();
|
|
1705
|
+
}, []), !s || !u ? /* @__PURE__ */ q("div", { className: "plot-card empty", children: /* @__PURE__ */ q("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : m !== pe && m !== Oe && l.length === 0 ? /* @__PURE__ */ q("div", { className: "plot-card empty", children: /* @__PURE__ */ q("div", { className: "placeholder", children: "No data" }) }) : y ? /* @__PURE__ */ q("div", { className: "plot-card empty", children: /* @__PURE__ */ Ne("div", { className: "placeholder", children: [
|
|
1608
1706
|
"Plot error: ",
|
|
1609
|
-
|
|
1610
|
-
] }) }) : /* @__PURE__ */
|
|
1611
|
-
/* @__PURE__ */
|
|
1707
|
+
y
|
|
1708
|
+
] }) }) : /* @__PURE__ */ Ne("div", { className: "plot-card", children: [
|
|
1709
|
+
/* @__PURE__ */ q("div", { className: "plot-title", children: /* @__PURE__ */ q(
|
|
1612
1710
|
"select",
|
|
1613
1711
|
{
|
|
1614
1712
|
className: "plot-select",
|
|
1615
|
-
value:
|
|
1713
|
+
value: c,
|
|
1616
1714
|
onChange: (h) => o && o({ holeId: h.target.value }),
|
|
1617
1715
|
children: n.map((h) => {
|
|
1618
|
-
const
|
|
1619
|
-
return /* @__PURE__ */
|
|
1716
|
+
const g = typeof h == "string" ? h : h.holeId, b = typeof h == "string" ? h : h.label || h.holeId;
|
|
1717
|
+
return /* @__PURE__ */ q("option", { value: g, children: b }, g);
|
|
1620
1718
|
})
|
|
1621
1719
|
}
|
|
1622
1720
|
) }),
|
|
1623
|
-
/* @__PURE__ */
|
|
1624
|
-
r.length > 0 && /* @__PURE__ */
|
|
1721
|
+
/* @__PURE__ */ Ne("div", { className: "plot-controls column", children: [
|
|
1722
|
+
r.length > 0 && /* @__PURE__ */ q(
|
|
1625
1723
|
"select",
|
|
1626
1724
|
{
|
|
1627
1725
|
className: "plot-select",
|
|
1628
1726
|
value: u,
|
|
1629
1727
|
onChange: (h) => o && o({ property: h.target.value }),
|
|
1630
|
-
children: r.map((h) => /* @__PURE__ */
|
|
1728
|
+
children: r.map((h) => /* @__PURE__ */ q("option", { value: h, children: h }, h))
|
|
1631
1729
|
}
|
|
1632
1730
|
),
|
|
1633
|
-
|
|
1731
|
+
d.length > 1 && /* @__PURE__ */ q(
|
|
1634
1732
|
"select",
|
|
1635
1733
|
{
|
|
1636
1734
|
className: "plot-select",
|
|
1637
1735
|
value: f,
|
|
1638
1736
|
onChange: (h) => o && o({ chartType: h.target.value }),
|
|
1639
|
-
children:
|
|
1737
|
+
children: d.map((h) => /* @__PURE__ */ q("option", { value: h.value, children: h.label }, h.value))
|
|
1640
1738
|
}
|
|
1641
1739
|
)
|
|
1642
1740
|
] }),
|
|
1643
|
-
/* @__PURE__ */
|
|
1741
|
+
/* @__PURE__ */ q("div", { className: "plotly-chart", ref: i })
|
|
1644
1742
|
] });
|
|
1645
1743
|
}
|
|
1646
1744
|
function nt(e, t) {
|
|
@@ -1650,164 +1748,164 @@ function nt(e, t) {
|
|
|
1650
1748
|
const o = r.id || r.holeId;
|
|
1651
1749
|
if (o)
|
|
1652
1750
|
if (n.has(o)) {
|
|
1653
|
-
const
|
|
1654
|
-
n.set(o, { ...
|
|
1751
|
+
const i = n.get(o);
|
|
1752
|
+
n.set(o, { ...i, points: [...i.points || [], ...r.points || []] });
|
|
1655
1753
|
} else
|
|
1656
1754
|
n.set(o, r);
|
|
1657
1755
|
}
|
|
1658
1756
|
return Array.from(n.values());
|
|
1659
1757
|
}
|
|
1660
|
-
function
|
|
1758
|
+
function bn(e, t) {
|
|
1661
1759
|
if (!e || !t) return [];
|
|
1662
1760
|
const n = /* @__PURE__ */ new Set(), r = [];
|
|
1663
1761
|
for (const o of e.points || []) {
|
|
1664
|
-
const
|
|
1665
|
-
if (!Number.isFinite(
|
|
1666
|
-
const
|
|
1667
|
-
n.has(
|
|
1762
|
+
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);
|
|
1763
|
+
if (!Number.isFinite(i) || !Number.isFinite(s) || s <= i) continue;
|
|
1764
|
+
const l = `${i}-${s}`;
|
|
1765
|
+
n.has(l) || (n.add(l), r.push({ from: i, to: s, [t]: o[t] ?? "" }));
|
|
1668
1766
|
}
|
|
1669
1767
|
return r;
|
|
1670
1768
|
}
|
|
1671
|
-
function
|
|
1769
|
+
function Fr({
|
|
1672
1770
|
initialFocusedHoleId: e = "",
|
|
1673
1771
|
sourceFile: t = null,
|
|
1674
1772
|
extraHoles: n = [],
|
|
1675
1773
|
plotCount: r = 4
|
|
1676
1774
|
} = {}) {
|
|
1677
|
-
const [o,
|
|
1775
|
+
const [o, i] = K([]), [s, l] = K([]), [u, a] = K([]), [c, m] = K([]), [d, f] = K([]), [y, p] = K({}), [h, g] = K(""), [b, _] = K([]), [I, N] = K(""), [P, E] = K(e || ""), [M, F] = K([]), j = ot(null);
|
|
1678
1776
|
oe(() => {
|
|
1679
|
-
!t ||
|
|
1680
|
-
if (!
|
|
1681
|
-
const
|
|
1682
|
-
|
|
1683
|
-
holeIds:
|
|
1684
|
-
focusedHoleId:
|
|
1777
|
+
!t || j.current === t || (j.current = t, $t(t).then((S) => {
|
|
1778
|
+
if (!S) return;
|
|
1779
|
+
const C = Array.from(new Map(S.map((v) => [v.holeId, v])).values());
|
|
1780
|
+
l(C), _(dt({
|
|
1781
|
+
holeIds: C.map((v) => v.holeId),
|
|
1782
|
+
focusedHoleId: P,
|
|
1685
1783
|
plotCount: r,
|
|
1686
1784
|
defaultProp: "",
|
|
1687
|
-
categoricalProps:
|
|
1688
|
-
commentProps:
|
|
1785
|
+
categoricalProps: c,
|
|
1786
|
+
commentProps: d,
|
|
1689
1787
|
numericDefaultChartType: "markers+line"
|
|
1690
1788
|
}));
|
|
1691
|
-
}).catch((
|
|
1692
|
-
console.info("Assay metadata load skipped:",
|
|
1789
|
+
}).catch((S) => {
|
|
1790
|
+
console.info("Assay metadata load skipped:", S.message);
|
|
1693
1791
|
}));
|
|
1694
|
-
}, [t,
|
|
1792
|
+
}, [t, P, r, c, d]), oe(() => {
|
|
1695
1793
|
if (!(n != null && n.length)) return;
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1698
|
-
const
|
|
1699
|
-
return
|
|
1794
|
+
const S = n.map((C) => ({ holeId: C.id || C.holeId })).filter((C) => C.holeId);
|
|
1795
|
+
l((C) => {
|
|
1796
|
+
const v = new Set(C.map((A) => A.holeId)), L = S.filter((A) => !v.has(A.holeId));
|
|
1797
|
+
return L.length ? [...C, ...L] : C;
|
|
1700
1798
|
});
|
|
1701
1799
|
}, [n]), oe(() => {
|
|
1702
|
-
|
|
1703
|
-
}, [
|
|
1704
|
-
if (!
|
|
1705
|
-
|
|
1800
|
+
N((S) => S && S.startsWith("Loading data for hole") ? S : "");
|
|
1801
|
+
}, [b]), oe(() => {
|
|
1802
|
+
if (!s.length) {
|
|
1803
|
+
_([]);
|
|
1706
1804
|
return;
|
|
1707
1805
|
}
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1806
|
+
const S = mt(s.map((C) => C.holeId), P);
|
|
1807
|
+
_((C) => Array.from({ length: r }).map((L, A) => {
|
|
1710
1808
|
var X;
|
|
1711
|
-
const
|
|
1712
|
-
property:
|
|
1713
|
-
chartType:
|
|
1714
|
-
categoricalProps:
|
|
1715
|
-
commentProps:
|
|
1809
|
+
const V = C[A] || {}, w = s.some((le) => le.holeId === V.holeId) ? V.holeId : S[A] || ((X = s[A]) == null ? void 0 : X.holeId) || "", T = V.property || h, Y = Me({
|
|
1810
|
+
property: T,
|
|
1811
|
+
chartType: V.chartType,
|
|
1812
|
+
categoricalProps: c,
|
|
1813
|
+
commentProps: d,
|
|
1716
1814
|
numericDefaultChartType: "markers+line"
|
|
1717
1815
|
});
|
|
1718
|
-
return { holeId:
|
|
1816
|
+
return { holeId: w, property: T, chartType: Y };
|
|
1719
1817
|
}));
|
|
1720
|
-
}, [
|
|
1818
|
+
}, [s, P, h, c, d, r]), oe(() => {
|
|
1721
1819
|
if (!t) return;
|
|
1722
|
-
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
const
|
|
1727
|
-
[...
|
|
1820
|
+
b.map((C) => C.holeId).filter(Boolean).forEach((C) => {
|
|
1821
|
+
const v = o.some((A) => (A.id || A.holeId) === C), L = M.includes(C);
|
|
1822
|
+
v || L || (F((A) => [...A, C]), Ht(t, C).then((A) => {
|
|
1823
|
+
F((V) => V.filter((w) => w !== C)), A && i((V) => {
|
|
1824
|
+
const w = nt(
|
|
1825
|
+
[...V.filter((Y) => (Y.id || Y.holeId) !== C), A],
|
|
1728
1826
|
n
|
|
1729
|
-
),
|
|
1730
|
-
return
|
|
1827
|
+
), T = Ie(w);
|
|
1828
|
+
return a(T.numericProps), m(T.categoricalProps), f(T.commentProps), p(T.columnMeta), !h && T.defaultProp && (g(T.defaultProp), _((Y) => Y.map((X) => ({
|
|
1731
1829
|
...X,
|
|
1732
|
-
property: X.property ||
|
|
1733
|
-
chartType:
|
|
1734
|
-
property: X.property ||
|
|
1830
|
+
property: X.property || T.defaultProp,
|
|
1831
|
+
chartType: Me({
|
|
1832
|
+
property: X.property || T.defaultProp,
|
|
1735
1833
|
chartType: X.chartType,
|
|
1736
|
-
categoricalProps:
|
|
1737
|
-
commentProps:
|
|
1834
|
+
categoricalProps: T.categoricalProps,
|
|
1835
|
+
commentProps: T.commentProps,
|
|
1738
1836
|
numericDefaultChartType: "markers+line"
|
|
1739
1837
|
})
|
|
1740
|
-
})))),
|
|
1838
|
+
})))), w;
|
|
1741
1839
|
});
|
|
1742
|
-
}).catch((
|
|
1743
|
-
console.error(
|
|
1840
|
+
}).catch((A) => {
|
|
1841
|
+
console.error(A), F((V) => V.filter((w) => w !== C)), N(A.message || `Error loading hole ${C}`);
|
|
1744
1842
|
}));
|
|
1745
1843
|
});
|
|
1746
|
-
}, [
|
|
1747
|
-
n != null && n.length &&
|
|
1748
|
-
if (!
|
|
1749
|
-
const
|
|
1750
|
-
return
|
|
1844
|
+
}, [b, t, o, M, h, n]), oe(() => {
|
|
1845
|
+
n != null && n.length && i((S) => {
|
|
1846
|
+
if (!S.length) {
|
|
1847
|
+
const L = Ie(n);
|
|
1848
|
+
return a(L.numericProps), m(L.categoricalProps), f(L.commentProps), p(L.columnMeta), !h && L.defaultProp && g(L.defaultProp), n;
|
|
1751
1849
|
}
|
|
1752
|
-
const
|
|
1753
|
-
return
|
|
1850
|
+
const C = nt(S, n), v = Ie(C);
|
|
1851
|
+
return a(v.numericProps), m(v.categoricalProps), f(v.commentProps), p(v.columnMeta), !h && v.defaultProp && g(v.defaultProp), C;
|
|
1754
1852
|
});
|
|
1755
1853
|
}, [n]);
|
|
1756
|
-
const
|
|
1757
|
-
() => [...u, ...
|
|
1758
|
-
[u,
|
|
1759
|
-
),
|
|
1760
|
-
() =>
|
|
1761
|
-
[
|
|
1762
|
-
),
|
|
1763
|
-
const
|
|
1764
|
-
return Array.from({ length: r }).map((
|
|
1765
|
-
const
|
|
1766
|
-
let
|
|
1767
|
-
|
|
1768
|
-
const
|
|
1854
|
+
const W = ve(
|
|
1855
|
+
() => [...u, ...c, ...d],
|
|
1856
|
+
[u, c, d]
|
|
1857
|
+
), D = ve(
|
|
1858
|
+
() => s.map((S) => ({ holeId: S.holeId, label: S.holeId })).sort((S, C) => S.label.localeCompare(C.label)),
|
|
1859
|
+
[s]
|
|
1860
|
+
), G = ve(() => {
|
|
1861
|
+
const S = [...u, ...c, ...d];
|
|
1862
|
+
return Array.from({ length: r }).map((C, v) => {
|
|
1863
|
+
const L = b[v] || {}, A = o.find((de) => (de.id || de.holeId) === L.holeId) || null, V = A ? S.filter((de) => an(A, de)) : S;
|
|
1864
|
+
let w = L.property || h;
|
|
1865
|
+
A && !V.includes(w) && (w = V[0] || w);
|
|
1866
|
+
const T = d.includes(w), Y = !T && c.includes(w), X = !T && !Y && w === "dip", le = T ? "comment" : X ? "tadpole" : Y ? "categorical" : "numeric", be = X ? "tadpole" : L.chartType || (T ? "comment" : Y ? "categorical" : "markers+line"), me = L.holeId || (A == null ? void 0 : A.id) || (A == null ? void 0 : A.holeId) || "", Ee = X ? (A == null ? void 0 : A.points) || [] : T ? bn(A, w) : ln(A, w, Y);
|
|
1769
1867
|
return {
|
|
1770
|
-
config: { holeId:
|
|
1771
|
-
hole:
|
|
1772
|
-
loading:
|
|
1773
|
-
isCategorical:
|
|
1774
|
-
isComment:
|
|
1868
|
+
config: { holeId: me, property: w, chartType: be },
|
|
1869
|
+
hole: A,
|
|
1870
|
+
loading: M.includes(L.holeId),
|
|
1871
|
+
isCategorical: Y,
|
|
1872
|
+
isComment: T,
|
|
1775
1873
|
isTadpole: X,
|
|
1776
1874
|
displayType: le,
|
|
1777
|
-
points:
|
|
1778
|
-
propertyOptions:
|
|
1779
|
-
label:
|
|
1875
|
+
points: Ee,
|
|
1876
|
+
propertyOptions: V,
|
|
1877
|
+
label: me
|
|
1780
1878
|
};
|
|
1781
1879
|
});
|
|
1782
|
-
}, [
|
|
1783
|
-
|
|
1784
|
-
const
|
|
1785
|
-
return
|
|
1786
|
-
property:
|
|
1787
|
-
chartType:
|
|
1788
|
-
categoricalProps:
|
|
1789
|
-
commentProps:
|
|
1880
|
+
}, [b, o, h, c, d, M, r, u]), U = (S, C) => {
|
|
1881
|
+
_((v) => {
|
|
1882
|
+
const L = [...v], V = { ...L[S] || {}, ...C };
|
|
1883
|
+
return C.property && (V.chartType = Me({
|
|
1884
|
+
property: C.property,
|
|
1885
|
+
chartType: V.chartType,
|
|
1886
|
+
categoricalProps: c,
|
|
1887
|
+
commentProps: d,
|
|
1790
1888
|
numericDefaultChartType: "markers+line"
|
|
1791
|
-
})), S
|
|
1889
|
+
})), L[S] = V, L;
|
|
1792
1890
|
});
|
|
1793
1891
|
};
|
|
1794
1892
|
return {
|
|
1795
|
-
error:
|
|
1796
|
-
focusedHoleId:
|
|
1797
|
-
setFocusedHoleId:
|
|
1798
|
-
setError:
|
|
1799
|
-
holeCount:
|
|
1893
|
+
error: I,
|
|
1894
|
+
focusedHoleId: P,
|
|
1895
|
+
setFocusedHoleId: E,
|
|
1896
|
+
setError: N,
|
|
1897
|
+
holeCount: s.length,
|
|
1800
1898
|
numericProps: u,
|
|
1801
|
-
categoricalProps:
|
|
1802
|
-
commentProps:
|
|
1803
|
-
columnMeta:
|
|
1804
|
-
propertyOptions:
|
|
1805
|
-
labeledHoleOptions:
|
|
1806
|
-
traceGraphs:
|
|
1807
|
-
handleConfigChange:
|
|
1899
|
+
categoricalProps: c,
|
|
1900
|
+
commentProps: d,
|
|
1901
|
+
columnMeta: y,
|
|
1902
|
+
propertyOptions: W,
|
|
1903
|
+
labeledHoleOptions: D,
|
|
1904
|
+
traceGraphs: G,
|
|
1905
|
+
handleConfigChange: U
|
|
1808
1906
|
};
|
|
1809
1907
|
}
|
|
1810
|
-
const
|
|
1908
|
+
const gn = [
|
|
1811
1909
|
"#313695",
|
|
1812
1910
|
"#4575b4",
|
|
1813
1911
|
"#74add1",
|
|
@@ -1819,8 +1917,8 @@ const pn = [
|
|
|
1819
1917
|
"#d73027",
|
|
1820
1918
|
"#a50026"
|
|
1821
1919
|
];
|
|
1822
|
-
function
|
|
1823
|
-
const n = e.filter((
|
|
1920
|
+
function _n(e = [], t = gn) {
|
|
1921
|
+
const n = e.filter((a) => Number.isFinite(a));
|
|
1824
1922
|
if (!n.length)
|
|
1825
1923
|
return {
|
|
1826
1924
|
min: null,
|
|
@@ -1829,40 +1927,40 @@ function yn(e = [], t = pn) {
|
|
|
1829
1927
|
bins: [],
|
|
1830
1928
|
colors: t
|
|
1831
1929
|
};
|
|
1832
|
-
const r = n.slice().sort((
|
|
1833
|
-
if (
|
|
1834
|
-
const
|
|
1835
|
-
index:
|
|
1930
|
+
const r = n.slice().sort((a, c) => a - c), o = r[0], i = r[r.length - 1], s = t.length;
|
|
1931
|
+
if (i === o) {
|
|
1932
|
+
const a = t.map((c, m) => ({
|
|
1933
|
+
index: m,
|
|
1836
1934
|
min: o,
|
|
1837
|
-
max:
|
|
1935
|
+
max: i,
|
|
1838
1936
|
label: `${o}`
|
|
1839
1937
|
}));
|
|
1840
1938
|
return {
|
|
1841
1939
|
min: o,
|
|
1842
|
-
max:
|
|
1940
|
+
max: i,
|
|
1843
1941
|
step: 0,
|
|
1844
|
-
bins:
|
|
1942
|
+
bins: a,
|
|
1845
1943
|
colors: t
|
|
1846
1944
|
};
|
|
1847
1945
|
}
|
|
1848
|
-
const
|
|
1849
|
-
const
|
|
1946
|
+
const l = t.map((a, c) => {
|
|
1947
|
+
const m = c / s, d = (c + 1) / s, f = Math.floor(m * r.length), y = Math.min(r.length - 1, Math.floor(d * r.length)), p = r[f], h = c === s - 1 ? i : r[y];
|
|
1850
1948
|
return {
|
|
1851
|
-
index:
|
|
1852
|
-
min:
|
|
1949
|
+
index: c,
|
|
1950
|
+
min: p,
|
|
1853
1951
|
max: h,
|
|
1854
|
-
label:
|
|
1952
|
+
label: xn(p, h)
|
|
1855
1953
|
};
|
|
1856
|
-
}), u = (
|
|
1954
|
+
}), u = (i - o) / s;
|
|
1857
1955
|
return {
|
|
1858
1956
|
min: o,
|
|
1859
|
-
max:
|
|
1957
|
+
max: i,
|
|
1860
1958
|
step: u,
|
|
1861
|
-
bins:
|
|
1959
|
+
bins: l,
|
|
1862
1960
|
colors: t
|
|
1863
1961
|
};
|
|
1864
1962
|
}
|
|
1865
|
-
function
|
|
1963
|
+
function xn(e, t) {
|
|
1866
1964
|
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";
|
|
1867
1965
|
return `${n(e)} – ${n(t)}`;
|
|
1868
1966
|
}
|
|
@@ -1878,92 +1976,92 @@ function xt(e, t) {
|
|
|
1878
1976
|
}
|
|
1879
1977
|
return -1;
|
|
1880
1978
|
}
|
|
1881
|
-
function
|
|
1979
|
+
function Nn(e, t, n = "#8b1e3f") {
|
|
1882
1980
|
const r = xt(e, t);
|
|
1883
1981
|
return r < 0 ? n : t.colors[r] || n;
|
|
1884
1982
|
}
|
|
1885
|
-
function
|
|
1983
|
+
function Nt(e) {
|
|
1886
1984
|
return Array.isArray(e) ? e : [];
|
|
1887
1985
|
}
|
|
1888
|
-
function
|
|
1986
|
+
function De(e) {
|
|
1889
1987
|
const t = Number(e);
|
|
1890
1988
|
return Number.isFinite(t) ? t : void 0;
|
|
1891
1989
|
}
|
|
1892
1990
|
function zt(e = {}) {
|
|
1893
1991
|
return {
|
|
1894
1992
|
...e,
|
|
1895
|
-
x:
|
|
1896
|
-
y:
|
|
1897
|
-
z:
|
|
1993
|
+
x: De(e.x),
|
|
1994
|
+
y: De(e.y),
|
|
1995
|
+
z: De(e.z)
|
|
1898
1996
|
};
|
|
1899
1997
|
}
|
|
1900
|
-
function
|
|
1901
|
-
const [r, o] = t,
|
|
1902
|
-
return
|
|
1998
|
+
function zn(e = [], t = [0, 0], n = 0) {
|
|
1999
|
+
const [r, o] = t, i = Number(n) * Math.PI / 180, s = Math.cos(i), l = Math.sin(i);
|
|
2000
|
+
return Nt(e).map(zt).map((u) => {
|
|
1903
2001
|
if (!Number.isFinite(u.x) || !Number.isFinite(u.y)) return { ...u };
|
|
1904
|
-
const
|
|
2002
|
+
const a = u.x - r, c = u.y - o;
|
|
1905
2003
|
return {
|
|
1906
2004
|
...u,
|
|
1907
|
-
along:
|
|
1908
|
-
across:
|
|
2005
|
+
along: a * l + c * s,
|
|
2006
|
+
across: a * s - c * l
|
|
1909
2007
|
};
|
|
1910
2008
|
});
|
|
1911
2009
|
}
|
|
1912
|
-
function
|
|
1913
|
-
const o =
|
|
1914
|
-
return !Number.isFinite(
|
|
2010
|
+
function Mn(e = [], t = [0, 0], n = 0, r = 50) {
|
|
2011
|
+
const o = zn(e, t, n), i = 0.5 * Number(r || 0);
|
|
2012
|
+
return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
|
|
1915
2013
|
}
|
|
1916
|
-
function
|
|
1917
|
-
let r =
|
|
2014
|
+
function Or(e = [], t = null, n = null) {
|
|
2015
|
+
let r = Nt(e).map(zt);
|
|
1918
2016
|
if (Array.isArray(t) && t.length === 2) {
|
|
1919
|
-
const [o,
|
|
1920
|
-
r = r.filter((
|
|
2017
|
+
const [o, i] = t;
|
|
2018
|
+
r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
|
|
1921
2019
|
}
|
|
1922
2020
|
return n && (r = r.map((o) => ({
|
|
1923
2021
|
...o,
|
|
1924
2022
|
color_value: o == null ? void 0 : o[n]
|
|
1925
2023
|
}))), r;
|
|
1926
2024
|
}
|
|
1927
|
-
function
|
|
1928
|
-
let
|
|
1929
|
-
return o && (
|
|
1930
|
-
...
|
|
1931
|
-
color_value:
|
|
1932
|
-
}))),
|
|
2025
|
+
function kr(e = [], t = [0, 0], n = 0, r = 50, o = null) {
|
|
2026
|
+
let i = Mn(e, t, n, r);
|
|
2027
|
+
return o && (i = i.map((s) => ({
|
|
2028
|
+
...s,
|
|
2029
|
+
color_value: s == null ? void 0 : s[o]
|
|
2030
|
+
}))), i;
|
|
1933
2031
|
}
|
|
1934
2032
|
function je(e) {
|
|
1935
2033
|
return Array.isArray(e) ? e : [];
|
|
1936
2034
|
}
|
|
1937
|
-
function
|
|
2035
|
+
function Ge(e = {}) {
|
|
1938
2036
|
return e.hole_id ?? e.holeId ?? e.id;
|
|
1939
2037
|
}
|
|
1940
2038
|
function ce(e, t = void 0) {
|
|
1941
2039
|
const n = Number(e);
|
|
1942
2040
|
return Number.isFinite(n) ? n : t;
|
|
1943
2041
|
}
|
|
1944
|
-
function
|
|
2042
|
+
function Vr(e = [], t = null) {
|
|
1945
2043
|
const n = /* @__PURE__ */ new Map();
|
|
1946
2044
|
je(e).forEach((o) => {
|
|
1947
|
-
const
|
|
1948
|
-
if (
|
|
1949
|
-
const
|
|
1950
|
-
n.has(
|
|
2045
|
+
const i = Ge(o);
|
|
2046
|
+
if (i == null || `${i}`.trim() === "") return;
|
|
2047
|
+
const s = `${i}`;
|
|
2048
|
+
n.has(s) || n.set(s, []), n.get(s).push(o);
|
|
1951
2049
|
});
|
|
1952
2050
|
const r = [];
|
|
1953
|
-
return n.forEach((o,
|
|
1954
|
-
const
|
|
1955
|
-
hole_id:
|
|
1956
|
-
x:
|
|
1957
|
-
y:
|
|
1958
|
-
z:
|
|
2051
|
+
return n.forEach((o, i) => {
|
|
2052
|
+
const s = [...o].sort((u, a) => ce(u.md, 0) - ce(a.md, 0)), l = {
|
|
2053
|
+
hole_id: i,
|
|
2054
|
+
x: s.map((u) => ce(u.x, 0)),
|
|
2055
|
+
y: s.map((u) => ce(u.y, 0)),
|
|
2056
|
+
z: s.map((u) => ce(u.z, 0)),
|
|
1959
2057
|
color: null
|
|
1960
2058
|
};
|
|
1961
|
-
t && (
|
|
2059
|
+
t && (l.color = s.map((u) => u == null ? void 0 : u[t])), r.push(l);
|
|
1962
2060
|
}), r;
|
|
1963
2061
|
}
|
|
1964
|
-
function
|
|
2062
|
+
function wr(e = [], t = 1, n = null) {
|
|
1965
2063
|
return je(e).map((r) => ({
|
|
1966
|
-
hole_id:
|
|
2064
|
+
hole_id: Ge(r),
|
|
1967
2065
|
from: r == null ? void 0 : r.from,
|
|
1968
2066
|
to: r == null ? void 0 : r.to,
|
|
1969
2067
|
radius: t,
|
|
@@ -1971,9 +2069,9 @@ function Tr(e = [], t = 1, n = null) {
|
|
|
1971
2069
|
value: n ? r == null ? void 0 : r[n] : null
|
|
1972
2070
|
}));
|
|
1973
2071
|
}
|
|
1974
|
-
function
|
|
2072
|
+
function Rr(e = [], t = null) {
|
|
1975
2073
|
return t ? je(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
|
|
1976
|
-
hole_id:
|
|
2074
|
+
hole_id: Ge(n),
|
|
1977
2075
|
label: n == null ? void 0 : n[t],
|
|
1978
2076
|
depth: 0.5 * (ce(n == null ? void 0 : n.from, 0) + ce(n == null ? void 0 : n.to, 0))
|
|
1979
2077
|
})) : [];
|
|
@@ -1987,13 +2085,13 @@ const Cn = {
|
|
|
1987
2085
|
"shear zone": "#0ea5e9",
|
|
1988
2086
|
"fault zone": "#ef4444"
|
|
1989
2087
|
};
|
|
1990
|
-
function
|
|
2088
|
+
function In(e, t) {
|
|
1991
2089
|
const n = t || Cn, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
|
|
1992
|
-
return new
|
|
2090
|
+
return new x.Color(o).getHex();
|
|
1993
2091
|
}
|
|
1994
|
-
function
|
|
2092
|
+
function An(e, t) {
|
|
1995
2093
|
const n = e * Math.PI / 180, r = t * Math.PI / 180;
|
|
1996
|
-
return new
|
|
2094
|
+
return new x.Vector3(
|
|
1997
2095
|
Math.sin(r) * Math.sin(n),
|
|
1998
2096
|
// East component
|
|
1999
2097
|
Math.cos(r) * Math.sin(n),
|
|
@@ -2002,52 +2100,60 @@ function Nn(e, t) {
|
|
|
2002
2100
|
// Up component
|
|
2003
2101
|
).normalize();
|
|
2004
2102
|
}
|
|
2005
|
-
function
|
|
2103
|
+
function Sn(e, t = {}) {
|
|
2006
2104
|
const {
|
|
2007
2105
|
radius: n = 5,
|
|
2008
2106
|
discThickness: r = 0.2,
|
|
2009
2107
|
opacity: o = 0.7,
|
|
2010
|
-
segments:
|
|
2011
|
-
colorMap:
|
|
2012
|
-
} = t,
|
|
2013
|
-
for (const
|
|
2014
|
-
const
|
|
2015
|
-
if (
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2108
|
+
segments: i = 32,
|
|
2109
|
+
colorMap: s = null
|
|
2110
|
+
} = t, l = new x.Group(), u = new x.Vector3(0, 1, 0);
|
|
2111
|
+
for (const a of e) {
|
|
2112
|
+
const c = 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;
|
|
2113
|
+
if (c == null || m == null || d == null || !Number.isFinite(c) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
|
|
2114
|
+
const f = a[k] != null ? Number(a[k]) : null, y = a[O] != null ? Number(a[O]) : null;
|
|
2115
|
+
let p;
|
|
2116
|
+
if (a.nx != null && Number.isFinite(a.nx) && a.ny != null && Number.isFinite(a.ny) && a.nz != null && Number.isFinite(a.nz))
|
|
2117
|
+
p = new x.Vector3(a.nx, a.ny, a.nz).normalize();
|
|
2118
|
+
else {
|
|
2119
|
+
if (f == null || y == null || !Number.isFinite(f) || !Number.isFinite(y)) continue;
|
|
2120
|
+
p = An(f, y);
|
|
2121
|
+
}
|
|
2122
|
+
const h = new x.CylinderGeometry(n, n, r, i, 1, !1), g = new x.MeshStandardMaterial({
|
|
2123
|
+
color: In(a.structure_type, s),
|
|
2018
2124
|
transparent: !0,
|
|
2019
2125
|
opacity: o,
|
|
2020
|
-
side:
|
|
2021
|
-
}),
|
|
2022
|
-
|
|
2126
|
+
side: x.DoubleSide
|
|
2127
|
+
}), b = new x.Mesh(h, g);
|
|
2128
|
+
b.position.set(c, m, d), b.quaternion.setFromUnitVectors(u, p), b.userData = {
|
|
2023
2129
|
type: "structure",
|
|
2024
|
-
hole_id:
|
|
2025
|
-
depth:
|
|
2026
|
-
structure_type:
|
|
2130
|
+
hole_id: a.hole_id,
|
|
2131
|
+
depth: a.depth ?? a.mid,
|
|
2132
|
+
structure_type: a.structure_type,
|
|
2027
2133
|
dip: f,
|
|
2028
|
-
azimuth:
|
|
2029
|
-
comments:
|
|
2030
|
-
},
|
|
2134
|
+
azimuth: y,
|
|
2135
|
+
comments: a.comments
|
|
2136
|
+
}, l.add(b);
|
|
2031
2137
|
}
|
|
2032
|
-
return
|
|
2138
|
+
return l;
|
|
2033
2139
|
}
|
|
2034
|
-
function
|
|
2035
|
-
var n, r, o,
|
|
2140
|
+
function Be(e) {
|
|
2141
|
+
var n, r, o, i, s, l, u, a, c;
|
|
2036
2142
|
if (!e) return "";
|
|
2037
|
-
const t = (
|
|
2143
|
+
const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
|
|
2038
2144
|
return [
|
|
2039
2145
|
t((n = e.camera) == null ? void 0 : n.x),
|
|
2040
2146
|
t((r = e.camera) == null ? void 0 : r.y),
|
|
2041
2147
|
t((o = e.camera) == null ? void 0 : o.z),
|
|
2042
|
-
t((
|
|
2043
|
-
t((
|
|
2044
|
-
t((
|
|
2148
|
+
t((i = e.target) == null ? void 0 : i.x),
|
|
2149
|
+
t((s = e.target) == null ? void 0 : s.y),
|
|
2150
|
+
t((l = e.target) == null ? void 0 : l.z),
|
|
2045
2151
|
t((u = e.up) == null ? void 0 : u.x),
|
|
2046
|
-
t((
|
|
2047
|
-
t((
|
|
2152
|
+
t((a = e.up) == null ? void 0 : a.y),
|
|
2153
|
+
t((c = e.up) == null ? void 0 : c.z)
|
|
2048
2154
|
].join("|");
|
|
2049
2155
|
}
|
|
2050
|
-
function
|
|
2156
|
+
function Mt(e) {
|
|
2051
2157
|
return !e.camera || !e.controls ? null : {
|
|
2052
2158
|
camera: {
|
|
2053
2159
|
x: e.camera.position.x,
|
|
@@ -2066,49 +2172,55 @@ function Nt(e) {
|
|
|
2066
2172
|
}
|
|
2067
2173
|
};
|
|
2068
2174
|
}
|
|
2069
|
-
function
|
|
2175
|
+
function En(e, t) {
|
|
2070
2176
|
if (!e.camera || !e.controls || !t) return !1;
|
|
2071
2177
|
const n = t.camera || {}, r = t.target || {}, o = t.up || {};
|
|
2072
|
-
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 =
|
|
2178
|
+
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 = Be(t), !0) : !1;
|
|
2073
2179
|
}
|
|
2074
|
-
function
|
|
2180
|
+
function vn(e) {
|
|
2075
2181
|
if (!e.viewChangeHandler) return;
|
|
2076
2182
|
const t = Date.now();
|
|
2077
2183
|
if (t - e._lastViewEmitMs < 250) return;
|
|
2078
|
-
const n =
|
|
2184
|
+
const n = Mt(e);
|
|
2079
2185
|
if (!n) return;
|
|
2080
|
-
const r =
|
|
2186
|
+
const r = Be(n);
|
|
2081
2187
|
r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
|
|
2082
2188
|
}
|
|
2083
|
-
function
|
|
2084
|
-
const
|
|
2085
|
-
e.controls.target.set(
|
|
2189
|
+
function Le(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
2190
|
+
const l = (t + n) / 2, u = (r + o) / 2, a = (i + s) / 2, c = n - t, m = o - r, d = s - i, y = Math.max(c, m, d, 1) * 2;
|
|
2191
|
+
e.controls.target.set(l, u, a), e.camera.position.set(l + y, u + y, a + y), e.camera.lookAt(l, u, a), e.controls.update();
|
|
2086
2192
|
}
|
|
2087
|
-
function
|
|
2193
|
+
function Pn(e, t = 1e3) {
|
|
2088
2194
|
!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());
|
|
2089
2195
|
}
|
|
2090
|
-
function
|
|
2196
|
+
function Dn(e, t = 2e3) {
|
|
2091
2197
|
!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());
|
|
2092
2198
|
}
|
|
2093
|
-
function
|
|
2199
|
+
function Ln(e, t = 0, n = 0) {
|
|
2094
2200
|
e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
|
|
2095
2201
|
}
|
|
2096
|
-
function
|
|
2202
|
+
function Tn(e, t = 1.1) {
|
|
2097
2203
|
!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());
|
|
2098
2204
|
}
|
|
2099
|
-
function
|
|
2205
|
+
function Fn(e, t = 1.2) {
|
|
2100
2206
|
if (!e.lastBounds) return;
|
|
2101
2207
|
const {
|
|
2102
2208
|
minX: n,
|
|
2103
2209
|
maxX: r,
|
|
2104
2210
|
minY: o,
|
|
2105
|
-
maxY:
|
|
2106
|
-
minZ:
|
|
2107
|
-
maxZ:
|
|
2108
|
-
} = e.lastBounds, u = (r - n) * t,
|
|
2109
|
-
e.controls.target.set(
|
|
2110
|
-
}
|
|
2111
|
-
|
|
2211
|
+
maxY: i,
|
|
2212
|
+
minZ: s,
|
|
2213
|
+
maxZ: l
|
|
2214
|
+
} = e.lastBounds, u = (r - n) * t, a = (i - o) * t, c = (l - s) * t, m = (n + r) / 2, d = (o + i) / 2, f = (s + l) / 2, p = Math.max(u, a, c, 1) * 2;
|
|
2215
|
+
e.controls.target.set(m, d, f), e.camera.position.set(m + p, d + p, f + p), e.camera.lookAt(m, d, f), e.controls.update();
|
|
2216
|
+
}
|
|
2217
|
+
const On = 1, kn = 120;
|
|
2218
|
+
function Vn(e, t) {
|
|
2219
|
+
if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
|
|
2220
|
+
const n = Math.min(kn, Math.max(On, 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, u = s / (2 * Math.tan(l / 2)), a = e.camera.position.clone().sub(r).normalize();
|
|
2221
|
+
return e.camera.position.copy(r).addScaledVector(a, u), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
|
|
2222
|
+
}
|
|
2223
|
+
function wn(e, t = "orbit") {
|
|
2112
2224
|
if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
|
|
2113
2225
|
e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
|
|
2114
2226
|
else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
|
|
@@ -2121,72 +2233,72 @@ const ae = "#9ca3af";
|
|
|
2121
2233
|
function rt(e, t) {
|
|
2122
2234
|
const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
|
|
2123
2235
|
if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
|
|
2124
|
-
const o = Math.min(n, r),
|
|
2125
|
-
return
|
|
2236
|
+
const o = Math.min(n, r), i = Math.max(n, r);
|
|
2237
|
+
return i <= o ? null : { segStart: o, segEnd: i };
|
|
2126
2238
|
}
|
|
2127
|
-
function
|
|
2239
|
+
function Rn(e, t, n) {
|
|
2128
2240
|
let r = 0, o = 0;
|
|
2129
|
-
for (let
|
|
2130
|
-
const
|
|
2131
|
-
if (!Number.isFinite(u) || !Number.isFinite(
|
|
2132
|
-
const
|
|
2133
|
-
f <= 0 || (r +=
|
|
2241
|
+
for (let s = 0; s < e.length; s += 1) {
|
|
2242
|
+
const l = e[s], u = Number(l == null ? void 0 : l.from), a = Number(l == null ? void 0 : l.to), c = Number(l == null ? void 0 : l.value);
|
|
2243
|
+
if (!Number.isFinite(u) || !Number.isFinite(a) || !Number.isFinite(c) || a <= u) continue;
|
|
2244
|
+
const m = Math.max(t, u), f = Math.min(n, a) - m;
|
|
2245
|
+
f <= 0 || (r += c * f, o += f);
|
|
2134
2246
|
}
|
|
2135
2247
|
if (o <= 0) return null;
|
|
2136
|
-
const
|
|
2137
|
-
return Number.isFinite(
|
|
2248
|
+
const i = r / o;
|
|
2249
|
+
return Number.isFinite(i) ? i : null;
|
|
2138
2250
|
}
|
|
2139
|
-
function
|
|
2140
|
-
if (!Number.isFinite(e)) return new
|
|
2141
|
-
if (xt(e, t) < 0) return new
|
|
2142
|
-
const r =
|
|
2143
|
-
return new
|
|
2251
|
+
function $n(e, t) {
|
|
2252
|
+
if (!Number.isFinite(e)) return new x.Color(ae);
|
|
2253
|
+
if (xt(e, t) < 0) return new x.Color(ae);
|
|
2254
|
+
const r = Nn(e, t, ae);
|
|
2255
|
+
return new x.Color(r);
|
|
2144
2256
|
}
|
|
2145
|
-
function
|
|
2257
|
+
function Hn(e = {}) {
|
|
2146
2258
|
return {
|
|
2147
2259
|
preserveView: !!e.preserveView,
|
|
2148
2260
|
assayIntervalsByHole: e.assayIntervalsByHole || null,
|
|
2149
2261
|
selectedAssayVariable: e.selectedAssayVariable || ""
|
|
2150
2262
|
};
|
|
2151
2263
|
}
|
|
2152
|
-
function
|
|
2264
|
+
function jn(e, t) {
|
|
2153
2265
|
if (!e || !t) return [];
|
|
2154
2266
|
const n = [];
|
|
2155
2267
|
return Object.values(e).forEach((r) => {
|
|
2156
2268
|
(r || []).forEach((o) => {
|
|
2157
|
-
const
|
|
2158
|
-
Number.isFinite(
|
|
2269
|
+
const i = Number(o == null ? void 0 : o.value);
|
|
2270
|
+
Number.isFinite(i) && n.push(i);
|
|
2159
2271
|
});
|
|
2160
2272
|
}), n;
|
|
2161
2273
|
}
|
|
2162
|
-
function
|
|
2274
|
+
function Te(e) {
|
|
2163
2275
|
return {
|
|
2164
2276
|
holeId: e.id,
|
|
2165
2277
|
project: e.project
|
|
2166
2278
|
};
|
|
2167
2279
|
}
|
|
2168
|
-
class
|
|
2280
|
+
class $r {
|
|
2169
2281
|
constructor() {
|
|
2170
|
-
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.frameId = null, this.clock = new
|
|
2282
|
+
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 x.Clock(), this.handleCanvasClick = null, this.raycaster = new x.Raycaster(), this.pointer = new x.Vector2(), this.drillholeClickHandler = null, this.controlMode = "orbit", this._tmpDir = new x.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0;
|
|
2171
2283
|
}
|
|
2172
2284
|
init(t) {
|
|
2173
2285
|
if (!t) return;
|
|
2174
2286
|
this.container = t;
|
|
2175
2287
|
const n = t.clientWidth, r = t.clientHeight;
|
|
2176
|
-
this.scene = new
|
|
2177
|
-
const o = new
|
|
2288
|
+
this.scene = new x.Scene(), this.scene.background = new x.Color(16777215), this.camera = new x.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 x.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
|
|
2289
|
+
const o = new x.AmbientLight(16777215, 0.5);
|
|
2178
2290
|
this.scene.add(o);
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2181
|
-
const
|
|
2182
|
-
this.scene.add(
|
|
2183
|
-
LEFT:
|
|
2184
|
-
MIDDLE:
|
|
2185
|
-
RIGHT:
|
|
2291
|
+
const i = new x.DirectionalLight(16777215, 0.6);
|
|
2292
|
+
i.position.set(10, 10, 5), this.scene.add(i);
|
|
2293
|
+
const s = new x.AxesHelper(20);
|
|
2294
|
+
this.scene.add(s), this.controls = new It(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 = {
|
|
2295
|
+
LEFT: x.MOUSE.PAN,
|
|
2296
|
+
MIDDLE: x.MOUSE.DOLLY,
|
|
2297
|
+
RIGHT: x.MOUSE.ROTATE
|
|
2186
2298
|
}, this.controls.touches = {
|
|
2187
|
-
ONE:
|
|
2188
|
-
TWO:
|
|
2189
|
-
}, this.controls.maxPolarAngle = Math.PI, this.flyControls = new At(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
|
|
2299
|
+
ONE: x.TOUCH.ROTATE,
|
|
2300
|
+
TWO: x.TOUCH.PAN
|
|
2301
|
+
}, this.controls.maxPolarAngle = Math.PI, this.flyControls = new At(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 St(this.camera, this.renderer, {
|
|
2190
2302
|
container: this.container,
|
|
2191
2303
|
placement: "top-right",
|
|
2192
2304
|
size: 110,
|
|
@@ -2194,48 +2306,53 @@ class Or {
|
|
|
2194
2306
|
animated: !0,
|
|
2195
2307
|
speed: 1.5
|
|
2196
2308
|
}), this.gizmo.attachControls(this.controls), this._attachCanvasClickHandler();
|
|
2197
|
-
const
|
|
2198
|
-
var
|
|
2199
|
-
this.frameId = requestAnimationFrame(
|
|
2309
|
+
const l = () => {
|
|
2310
|
+
var a;
|
|
2311
|
+
this.frameId = requestAnimationFrame(l);
|
|
2200
2312
|
const u = this.clock.getDelta();
|
|
2201
|
-
this.renderer.clear(), this.controlMode === "fly" && ((
|
|
2313
|
+
this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.enabled) ? this.flyControls.update(u) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
|
|
2202
2314
|
};
|
|
2203
|
-
|
|
2315
|
+
l();
|
|
2204
2316
|
}
|
|
2205
2317
|
setViewChangeHandler(t) {
|
|
2206
2318
|
this.viewChangeHandler = typeof t == "function" ? t : null;
|
|
2207
2319
|
}
|
|
2208
2320
|
getViewState() {
|
|
2209
|
-
return
|
|
2321
|
+
return Mt(this);
|
|
2210
2322
|
}
|
|
2211
2323
|
setViewState(t) {
|
|
2212
|
-
return
|
|
2324
|
+
return En(this, t);
|
|
2213
2325
|
}
|
|
2214
2326
|
_buildViewSignature(t) {
|
|
2215
|
-
return
|
|
2327
|
+
return Be(t);
|
|
2216
2328
|
}
|
|
2217
2329
|
_emitViewChangeIfNeeded() {
|
|
2218
|
-
|
|
2330
|
+
vn(this);
|
|
2219
2331
|
}
|
|
2220
2332
|
_attachCanvasClickHandler() {
|
|
2221
2333
|
const t = this.renderer;
|
|
2222
2334
|
t && (this.handleCanvasClick = (n) => {
|
|
2223
|
-
var
|
|
2335
|
+
var f, y, p, h, g, b;
|
|
2224
2336
|
if (n.button !== 0) return;
|
|
2225
|
-
if ((
|
|
2226
|
-
const
|
|
2227
|
-
if (n.clientX >=
|
|
2337
|
+
if ((f = this.gizmo) != null && f.domElement) {
|
|
2338
|
+
const _ = this.gizmo.domElement.getBoundingClientRect();
|
|
2339
|
+
if (n.clientX >= _.left && n.clientX <= _.right && n.clientY >= _.top && n.clientY <= _.bottom)
|
|
2228
2340
|
return;
|
|
2229
2341
|
}
|
|
2230
|
-
const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left,
|
|
2231
|
-
this.pointer.x = o / r.width * 2 - 1, this.pointer.y = -(
|
|
2232
|
-
const
|
|
2233
|
-
if (
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2342
|
+
const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, i = n.clientY - r.top;
|
|
2343
|
+
this.pointer.x = o / r.width * 2 - 1, this.pointer.y = -(i / r.height * 2) + 1, this.raycaster.setFromCamera(this.pointer, this.camera);
|
|
2344
|
+
const s = this.raycaster.intersectObjects(this.drillMeshes, !0), l = this.raycaster.intersectObjects(this.structuralMeshes, !0), u = ((y = s[0]) == null ? void 0 : y.distance) ?? 1 / 0;
|
|
2345
|
+
if ((((p = l[0]) == null ? void 0 : p.distance) ?? 1 / 0) < u && l.length > 0) {
|
|
2346
|
+
const _ = l[0].object;
|
|
2347
|
+
this.drillholeClickHandler && this.drillholeClickHandler({ type: "structure", ..._.userData });
|
|
2348
|
+
return;
|
|
2349
|
+
}
|
|
2350
|
+
if (s.length === 0) return;
|
|
2351
|
+
let c = s[0].object;
|
|
2352
|
+
for (; c && c.parent && !((h = c.userData) != null && h.holeId); )
|
|
2353
|
+
c = c.parent;
|
|
2354
|
+
const m = (g = c == null ? void 0 : c.userData) == null ? void 0 : g.holeId, d = (b = c == null ? void 0 : c.userData) == null ? void 0 : b.project;
|
|
2355
|
+
m && this.drillholeClickHandler && this.drillholeClickHandler({ holeId: m, project: d });
|
|
2239
2356
|
}, t.domElement.addEventListener("click", this.handleCanvasClick));
|
|
2240
2357
|
}
|
|
2241
2358
|
resize() {
|
|
@@ -2245,91 +2362,91 @@ class Or {
|
|
|
2245
2362
|
}
|
|
2246
2363
|
setBlocks(t, n, r) {
|
|
2247
2364
|
if (!this.scene || (this._clearBlocks(), !t || !n || !r)) return;
|
|
2248
|
-
let o = 1 / 0,
|
|
2249
|
-
t.forEach((
|
|
2365
|
+
let o = 1 / 0, i = -1 / 0, s = 1 / 0, l = -1 / 0, u = 1 / 0, a = -1 / 0;
|
|
2366
|
+
t.forEach((c) => {
|
|
2250
2367
|
const {
|
|
2251
|
-
center_x:
|
|
2252
|
-
center_y:
|
|
2368
|
+
center_x: m = 0,
|
|
2369
|
+
center_y: d = 0,
|
|
2253
2370
|
center_z: f = 0,
|
|
2254
|
-
size_x:
|
|
2255
|
-
size_y:
|
|
2371
|
+
size_x: y = 1,
|
|
2372
|
+
size_y: p = 1,
|
|
2256
2373
|
size_z: h = 1
|
|
2257
|
-
} =
|
|
2258
|
-
o = Math.min(o,
|
|
2259
|
-
const
|
|
2260
|
-
color:
|
|
2374
|
+
} = c;
|
|
2375
|
+
o = Math.min(o, m - y / 2), i = Math.max(i, m + y / 2), s = Math.min(s, d - p / 2), l = Math.max(l, d + p / 2), u = Math.min(u, f - h / 2), a = Math.max(a, f + h / 2);
|
|
2376
|
+
const g = new x.BoxGeometry(y, p, h), b = Zt(c[n], r, x), _ = new x.MeshStandardMaterial({
|
|
2377
|
+
color: b,
|
|
2261
2378
|
transparent: !0,
|
|
2262
2379
|
opacity: 0.7,
|
|
2263
|
-
side:
|
|
2264
|
-
}),
|
|
2265
|
-
|
|
2266
|
-
}), this.camera && this.controls && (this.lastBounds = { minX: o, maxX:
|
|
2380
|
+
side: x.DoubleSide
|
|
2381
|
+
}), I = new x.Mesh(g, _);
|
|
2382
|
+
I.position.set(m, d, f), this.scene.add(I), this.blocks.push(I);
|
|
2383
|
+
}), this.camera && this.controls && (this.lastBounds = { minX: o, maxX: i, minY: s, maxY: l, minZ: u, maxZ: a }, Le(this, { minX: o, maxX: i, minY: s, maxY: l, minZ: u, maxZ: a }));
|
|
2267
2384
|
}
|
|
2268
2385
|
setDrillholes(t, n = {}) {
|
|
2269
2386
|
if (!this.scene || (this._clearDrillholes(), !t || t.length === 0)) return;
|
|
2270
|
-
const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable:
|
|
2271
|
-
let u = 1 / 0,
|
|
2272
|
-
const
|
|
2273
|
-
t.forEach((h,
|
|
2274
|
-
const
|
|
2275
|
-
u = Math.min(u,
|
|
2276
|
-
const
|
|
2277
|
-
return
|
|
2387
|
+
const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i } = Hn(n), s = jn(o, i), l = _n(s);
|
|
2388
|
+
let u = 1 / 0, a = -1 / 0, c = 1 / 0, m = -1 / 0, d = 1 / 0, f = -1 / 0;
|
|
2389
|
+
const y = new x.Vector3(), p = new x.Vector3(0, 1, 0);
|
|
2390
|
+
t.forEach((h, g) => {
|
|
2391
|
+
const _ = g * 137.5 % 360 / 360, I = new x.Color().setHSL(_, 0.75, 0.55), N = (h.points || []).map((M) => {
|
|
2392
|
+
u = Math.min(u, M.x), a = Math.max(a, M.x), c = Math.min(c, M.y), m = Math.max(m, M.y), d = Math.min(d, M.z), f = Math.max(f, M.z);
|
|
2393
|
+
const F = new x.Vector3(M.x, M.y, M.z);
|
|
2394
|
+
return F.md = M.md, F;
|
|
2278
2395
|
});
|
|
2279
|
-
if (
|
|
2280
|
-
if (
|
|
2281
|
-
const
|
|
2282
|
-
color:
|
|
2283
|
-
emissive:
|
|
2396
|
+
if (N.length < 2) {
|
|
2397
|
+
if (N.length === 1) {
|
|
2398
|
+
const M = new x.SphereGeometry(5, 12, 12), F = new x.MeshLambertMaterial({
|
|
2399
|
+
color: I,
|
|
2400
|
+
emissive: I,
|
|
2284
2401
|
emissiveIntensity: 0.2
|
|
2285
|
-
}),
|
|
2286
|
-
|
|
2402
|
+
}), j = new x.Mesh(M, F);
|
|
2403
|
+
j.position.copy(N[0]), j.userData = Te(h), this.scene.add(j), this.drillLines.push(j), this.drillMeshes.push(j);
|
|
2287
2404
|
}
|
|
2288
2405
|
return;
|
|
2289
2406
|
}
|
|
2290
|
-
const
|
|
2291
|
-
|
|
2292
|
-
const
|
|
2293
|
-
for (let
|
|
2294
|
-
const
|
|
2295
|
-
if (
|
|
2296
|
-
const
|
|
2297
|
-
selectedAssayVariable:
|
|
2298
|
-
assayIntervals:
|
|
2299
|
-
assayScale:
|
|
2407
|
+
const P = new x.Group();
|
|
2408
|
+
P.userData = Te(h);
|
|
2409
|
+
const E = i ? this._resolveAssayIntervalsForHole(h, o) : [];
|
|
2410
|
+
for (let M = 0; M < N.length - 1; M += 1) {
|
|
2411
|
+
const F = N[M], j = N[M + 1], W = y.subVectors(j, F), D = W.length();
|
|
2412
|
+
if (D <= 1e-3) continue;
|
|
2413
|
+
const G = 2.2, U = new x.CylinderGeometry(G, G, D, 6, 1, !0), S = this._getSegmentColor({
|
|
2414
|
+
selectedAssayVariable: i,
|
|
2415
|
+
assayIntervals: E,
|
|
2416
|
+
assayScale: l,
|
|
2300
2417
|
holeId: h.id,
|
|
2301
|
-
segmentIndex:
|
|
2302
|
-
p1:
|
|
2303
|
-
p2:
|
|
2304
|
-
}),
|
|
2305
|
-
color:
|
|
2418
|
+
segmentIndex: M,
|
|
2419
|
+
p1: F,
|
|
2420
|
+
p2: j
|
|
2421
|
+
}), C = new x.MeshLambertMaterial({
|
|
2422
|
+
color: S,
|
|
2306
2423
|
flatShading: !0,
|
|
2307
|
-
emissive:
|
|
2424
|
+
emissive: S,
|
|
2308
2425
|
emissiveIntensity: 0.15
|
|
2309
|
-
}),
|
|
2310
|
-
|
|
2426
|
+
}), v = new x.Mesh(U, C);
|
|
2427
|
+
v.position.copy(F.clone().addScaledVector(W, 0.5)), v.quaternion.setFromUnitVectors(p, W.clone().normalize()), v.userData = Te(h), P.add(v), this.drillMeshes.push(v);
|
|
2311
2428
|
}
|
|
2312
|
-
this.scene.add(
|
|
2313
|
-
}), this.camera && this.controls && (this.lastBounds = { minX: u, maxX:
|
|
2429
|
+
this.scene.add(P), this.drillLines.push(P);
|
|
2430
|
+
}), this.camera && this.controls && (this.lastBounds = { minX: u, maxX: a, minY: c, maxY: m, minZ: d, maxZ: f }, r || Le(this, { minX: u, maxX: a, minY: c, maxY: m, minZ: d, maxZ: f }));
|
|
2314
2431
|
}
|
|
2315
|
-
_getSegmentColor({ selectedAssayVariable: t, assayIntervals: n, assayScale: r, holeId: o, segmentIndex:
|
|
2432
|
+
_getSegmentColor({ selectedAssayVariable: t, assayIntervals: n, assayScale: r, holeId: o, segmentIndex: i, p1: s, p2: l }) {
|
|
2316
2433
|
if (!t)
|
|
2317
|
-
return
|
|
2434
|
+
return Bn(o, i);
|
|
2318
2435
|
if (t === "__HAS_ASSAY__") {
|
|
2319
|
-
if (!(n != null && n.length)) return new
|
|
2320
|
-
const
|
|
2321
|
-
return
|
|
2322
|
-
const f = Number(
|
|
2323
|
-
if (!Number.isFinite(f) || !Number.isFinite(
|
|
2324
|
-
const
|
|
2325
|
-
return Math.min(
|
|
2326
|
-
}) ? new
|
|
2436
|
+
if (!(n != null && n.length)) return new x.Color(ae);
|
|
2437
|
+
const c = rt(s, l);
|
|
2438
|
+
return c ? n.some((d) => {
|
|
2439
|
+
const f = Number(d == null ? void 0 : d.from), y = Number(d == null ? void 0 : d.to);
|
|
2440
|
+
if (!Number.isFinite(f) || !Number.isFinite(y)) return !1;
|
|
2441
|
+
const p = Math.max(c.segStart, f);
|
|
2442
|
+
return Math.min(c.segEnd, y) > p;
|
|
2443
|
+
}) ? new x.Color("#ff8c42") : new x.Color(ae) : new x.Color(ae);
|
|
2327
2444
|
}
|
|
2328
|
-
if (!(n != null && n.length)) return new
|
|
2329
|
-
const u = rt(
|
|
2330
|
-
if (!u) return new
|
|
2331
|
-
const
|
|
2332
|
-
return
|
|
2445
|
+
if (!(n != null && n.length)) return new x.Color(ae);
|
|
2446
|
+
const u = rt(s, l);
|
|
2447
|
+
if (!u) return new x.Color(ae);
|
|
2448
|
+
const a = Rn(n, u.segStart, u.segEnd);
|
|
2449
|
+
return $n(a, r);
|
|
2333
2450
|
}
|
|
2334
2451
|
_resolveAssayIntervalsForHole(t, n) {
|
|
2335
2452
|
if (!n || !t) return [];
|
|
@@ -2337,36 +2454,67 @@ class Or {
|
|
|
2337
2454
|
if (!r) return [];
|
|
2338
2455
|
const o = n[r];
|
|
2339
2456
|
if (Array.isArray(o) && o.length) return o;
|
|
2340
|
-
const
|
|
2341
|
-
if (
|
|
2342
|
-
const
|
|
2343
|
-
if (Array.isArray(
|
|
2457
|
+
const i = Gn(r);
|
|
2458
|
+
if (i) {
|
|
2459
|
+
const s = n[i];
|
|
2460
|
+
if (Array.isArray(s) && s.length) return s;
|
|
2344
2461
|
}
|
|
2345
2462
|
return [];
|
|
2346
2463
|
}
|
|
2347
|
-
_fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ:
|
|
2348
|
-
|
|
2464
|
+
_fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
|
|
2465
|
+
Le(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
|
|
2349
2466
|
}
|
|
2350
2467
|
recenterCameraToOrigin(t = 1e3) {
|
|
2351
|
-
|
|
2468
|
+
Pn(this, t);
|
|
2352
2469
|
}
|
|
2353
2470
|
lookDown(t = 2e3) {
|
|
2354
|
-
|
|
2471
|
+
Dn(this, t);
|
|
2355
2472
|
}
|
|
2356
2473
|
pan(t = 0, n = 0) {
|
|
2357
|
-
|
|
2474
|
+
Ln(this, t, n);
|
|
2358
2475
|
}
|
|
2359
2476
|
dolly(t = 1.1) {
|
|
2360
|
-
|
|
2477
|
+
Tn(this, t);
|
|
2361
2478
|
}
|
|
2362
2479
|
focusOnLastBounds(t = 1.2) {
|
|
2363
|
-
|
|
2480
|
+
Fn(this, t);
|
|
2364
2481
|
}
|
|
2365
2482
|
_clearBlocks() {
|
|
2366
2483
|
this.blocks.forEach((t) => {
|
|
2367
2484
|
this.scene.remove(t), t.geometry.dispose(), t.material.dispose();
|
|
2368
2485
|
}), this.blocks = [];
|
|
2369
2486
|
}
|
|
2487
|
+
setStructuralDiscs(t, n, r = {}) {
|
|
2488
|
+
if (!this.scene || (this._clearStructuralDiscs(), !(t != null && t.length) || !(n != null && n.length))) return;
|
|
2489
|
+
const { maxDiscs: o = 3e3 } = r;
|
|
2490
|
+
let i = t;
|
|
2491
|
+
if (i.length > o) {
|
|
2492
|
+
const u = i.length / o, a = [];
|
|
2493
|
+
for (let c = 0; c < o; c++)
|
|
2494
|
+
a.push(i[Math.floor(c * u)]);
|
|
2495
|
+
i = a;
|
|
2496
|
+
}
|
|
2497
|
+
const s = n.flatMap((u) => (u.points || []).map((a) => ({ ...a, hole_id: u.id }))), l = nn(i, s, r);
|
|
2498
|
+
l.length && (this.structuralGroup = Sn(l, r), this.scene.add(this.structuralGroup), this.structuralGroup.traverse((u) => {
|
|
2499
|
+
u.isMesh && this.structuralMeshes.push(u);
|
|
2500
|
+
}));
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Change the camera field-of-view while keeping the visible scene the same apparent size.
|
|
2504
|
+
* FOV is clamped to [FOV_MIN_DEG, FOV_MAX_DEG]. Delegates to setFov in baselode3dCameraControls.
|
|
2505
|
+
* @param {number} fovDeg - Desired FOV in degrees
|
|
2506
|
+
*/
|
|
2507
|
+
setCameraFov(t) {
|
|
2508
|
+
Vn(this, t);
|
|
2509
|
+
}
|
|
2510
|
+
setStructuralDiscsVisible(t) {
|
|
2511
|
+
this.structuralGroup && (this.structuralGroup.visible = !!t);
|
|
2512
|
+
}
|
|
2513
|
+
_clearStructuralDiscs() {
|
|
2514
|
+
this.structuralGroup && (this.scene.remove(this.structuralGroup), this.structuralGroup.traverse((t) => {
|
|
2515
|
+
t.isMesh && (t.geometry.dispose(), t.material.dispose());
|
|
2516
|
+
}), this.structuralGroup = null), this.structuralMeshes = [];
|
|
2517
|
+
}
|
|
2370
2518
|
_clearDrillholes() {
|
|
2371
2519
|
this.drillLines.forEach((t) => {
|
|
2372
2520
|
this.scene.remove(t), t.isGroup ? t.traverse((n) => {
|
|
@@ -2375,30 +2523,30 @@ class Or {
|
|
|
2375
2523
|
}), this.drillLines = [], this.drillMeshes = [];
|
|
2376
2524
|
}
|
|
2377
2525
|
dispose() {
|
|
2378
|
-
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, this._clearBlocks(), this._clearDrillholes(), 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));
|
|
2526
|
+
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, this._clearBlocks(), this._clearDrillholes(), this._clearStructuralDiscs(), 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));
|
|
2379
2527
|
}
|
|
2380
2528
|
setDrillholeClickHandler(t) {
|
|
2381
2529
|
this.drillholeClickHandler = t;
|
|
2382
2530
|
}
|
|
2383
2531
|
setControlMode(t = "orbit") {
|
|
2384
|
-
|
|
2532
|
+
wn(this, t);
|
|
2385
2533
|
}
|
|
2386
2534
|
}
|
|
2387
|
-
function
|
|
2535
|
+
function Gn(e) {
|
|
2388
2536
|
return `${e ?? ""}`.trim().toLowerCase();
|
|
2389
2537
|
}
|
|
2390
|
-
function
|
|
2391
|
-
const n = `${e ?? ""}:${t ?? 0}`, r =
|
|
2392
|
-
return
|
|
2538
|
+
function Bn(e, t) {
|
|
2539
|
+
const n = `${e ?? ""}:${t ?? 0}`, r = Un(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new x.Color();
|
|
2540
|
+
return s.setHSL(i, 1, 0.5), s;
|
|
2393
2541
|
}
|
|
2394
|
-
function
|
|
2542
|
+
function Un(e) {
|
|
2395
2543
|
const t = `${e ?? ""}`;
|
|
2396
2544
|
let n = 2166136261;
|
|
2397
2545
|
for (let r = 0; r < t.length; r += 1)
|
|
2398
2546
|
n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
|
|
2399
2547
|
return (n >>> 0) / 4294967295;
|
|
2400
2548
|
}
|
|
2401
|
-
function
|
|
2549
|
+
function Hr({
|
|
2402
2550
|
controlMode: e = "orbit",
|
|
2403
2551
|
onToggleFly: t = () => {
|
|
2404
2552
|
},
|
|
@@ -2409,128 +2557,134 @@ function kr({
|
|
|
2409
2557
|
onFit: o = () => {
|
|
2410
2558
|
}
|
|
2411
2559
|
}) {
|
|
2412
|
-
return /* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
/* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2560
|
+
return /* @__PURE__ */ Ne("div", { className: "baselode-3d-controls", children: [
|
|
2561
|
+
/* @__PURE__ */ q("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
|
|
2562
|
+
/* @__PURE__ */ q("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
|
|
2563
|
+
/* @__PURE__ */ q("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
|
|
2564
|
+
/* @__PURE__ */ q("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
|
|
2417
2565
|
] });
|
|
2418
2566
|
}
|
|
2419
2567
|
export {
|
|
2420
|
-
|
|
2568
|
+
gn as ASSAY_COLOR_PALETTE_10,
|
|
2421
2569
|
Pt as ASSAY_NON_VALUE_FIELDS,
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2570
|
+
O as AZIMUTH,
|
|
2571
|
+
tr as BASELODE_DATA_MODEL_DRILL_ASSAY,
|
|
2572
|
+
Qn as BASELODE_DATA_MODEL_DRILL_COLLAR,
|
|
2573
|
+
er as BASELODE_DATA_MODEL_DRILL_SURVEY,
|
|
2574
|
+
nr as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
|
|
2575
|
+
Hr as Baselode3DControls,
|
|
2576
|
+
$r as Baselode3DScene,
|
|
2577
|
+
Ue as CHART_OPTIONS,
|
|
2578
|
+
wt as COMMENT_COLUMN_NAMES,
|
|
2431
2579
|
it as CRS,
|
|
2432
2580
|
vt as DEFAULT_COLUMN_MAP,
|
|
2433
|
-
|
|
2434
|
-
|
|
2581
|
+
H as DEPTH,
|
|
2582
|
+
k as DIP,
|
|
2435
2583
|
_e as DISPLAY_CATEGORICAL,
|
|
2436
2584
|
pe as DISPLAY_COMMENT,
|
|
2437
|
-
|
|
2585
|
+
Ce as DISPLAY_HIDDEN,
|
|
2438
2586
|
ye as DISPLAY_NUMERIC,
|
|
2439
|
-
|
|
2587
|
+
Oe as DISPLAY_TADPOLE,
|
|
2440
2588
|
ie as EASTING,
|
|
2441
2589
|
he as ELEVATION,
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2590
|
+
on as ERROR_COLOR,
|
|
2591
|
+
kn as FOV_MAX_DEG,
|
|
2592
|
+
On as FOV_MIN_DEG,
|
|
2593
|
+
B as FROM,
|
|
2594
|
+
Ye as HIDDEN_COLUMNS,
|
|
2595
|
+
z as HOLE_ID,
|
|
2596
|
+
ee as LATITUDE,
|
|
2597
|
+
te as LONGITUDE,
|
|
2598
|
+
Ve as MID,
|
|
2449
2599
|
se as NORTHING,
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2600
|
+
We as NUMERIC_LINE_COLOR,
|
|
2601
|
+
rn as NUMERIC_MARKER_COLOR,
|
|
2602
|
+
re as PROJECT_ID,
|
|
2603
|
+
Et as STRIKE,
|
|
2604
|
+
R as TO,
|
|
2605
|
+
Tr as TracePlot,
|
|
2606
|
+
tn as alphaBetaToNormal,
|
|
2607
|
+
Rr as annotationsFromIntervals,
|
|
2608
|
+
Cr as assembleDataset,
|
|
2609
|
+
yr as attachAssayPositions,
|
|
2610
|
+
hr as balancedTangentialDesurvey,
|
|
2460
2611
|
jt as buildAssayState,
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2612
|
+
pn as buildCommentsConfig,
|
|
2613
|
+
_n as buildEqualRangeColorScale,
|
|
2614
|
+
ln as buildIntervalPoints,
|
|
2615
|
+
mn as buildPlotConfig,
|
|
2616
|
+
Lr as buildStrikeDipSymbol,
|
|
2617
|
+
Sn as buildStructuralDiscs,
|
|
2618
|
+
Dr as buildStructuralStripConfig,
|
|
2619
|
+
fn as buildTadpoleConfig,
|
|
2620
|
+
pr as buildTraces,
|
|
2621
|
+
Be as buildViewSignature,
|
|
2622
|
+
Ar as calculatePropertyStats,
|
|
2472
2623
|
Rt as classifyColumns,
|
|
2473
|
-
|
|
2474
|
-
|
|
2624
|
+
Mr as coerceNumeric,
|
|
2625
|
+
nn as computeStructuralPositions,
|
|
2626
|
+
cr as defaultChartType,
|
|
2475
2627
|
Ie as deriveAssayProps,
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2628
|
+
dr as desurveyTraces,
|
|
2629
|
+
An as dipAzimuthToNormal,
|
|
2630
|
+
Tn as dolly,
|
|
2631
|
+
vn as emitViewChangeIfNeeded,
|
|
2632
|
+
zr as filterByProject,
|
|
2633
|
+
Le as fitCameraToBounds,
|
|
2634
|
+
Fn as focusOnLastBounds,
|
|
2635
|
+
we as getChartOptions,
|
|
2636
|
+
Zt as getColorForValue,
|
|
2485
2637
|
xt as getEqualRangeBinIndex,
|
|
2486
|
-
|
|
2487
|
-
|
|
2638
|
+
Nn as getEqualRangeColor,
|
|
2639
|
+
Mt as getViewState,
|
|
2488
2640
|
Kt as groupRowsByHole,
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2641
|
+
an as holeHasData,
|
|
2642
|
+
en as interpolateTrace,
|
|
2643
|
+
wr as intervalsAsTubes,
|
|
2644
|
+
Nr as joinAssaysToTraces,
|
|
2645
|
+
ur as loadAssayFile,
|
|
2493
2646
|
Ht as loadAssayHole,
|
|
2494
2647
|
$t as loadAssayMetadata,
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2648
|
+
xr as loadAssays,
|
|
2649
|
+
gr as loadCollars,
|
|
2650
|
+
_r as loadSurveys,
|
|
2498
2651
|
$e as loadTable,
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2652
|
+
ir as logDataInfo,
|
|
2653
|
+
or as logDataWarning,
|
|
2654
|
+
Dn as lookDown,
|
|
2655
|
+
Ut as minimumCurvatureDesurvey,
|
|
2656
|
+
ar as normalizeCsvRow,
|
|
2504
2657
|
ze as normalizeFieldName,
|
|
2505
|
-
|
|
2658
|
+
Ln as pan,
|
|
2506
2659
|
Qt as parseAssayCsvTextToHoles,
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2660
|
+
Ot as parseAssayHole,
|
|
2661
|
+
sr as parseAssayHoleIds,
|
|
2662
|
+
Ft as parseAssayHoleIdsWithAssays,
|
|
2663
|
+
kt as parseAssaysCSV,
|
|
2664
|
+
Ir as parseBlockModelCSV,
|
|
2665
|
+
br as parseDrillholesCSV,
|
|
2513
2666
|
Jt as parseStructuralCSV,
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2667
|
+
vr as parseStructuralIntervalsCSV,
|
|
2668
|
+
Er as parseStructuralPointsCSV,
|
|
2669
|
+
mr as parseSurveyCSV,
|
|
2670
|
+
Pr as parseUnifiedDataset,
|
|
2671
|
+
lr as pickFirstPresent,
|
|
2672
|
+
Or as planView,
|
|
2673
|
+
zn as projectTraceToSection,
|
|
2674
|
+
Pn as recenterCameraToOrigin,
|
|
2675
|
+
mt as reorderHoleIds,
|
|
2676
|
+
kr as sectionView,
|
|
2677
|
+
Mn as sectionWindow,
|
|
2678
|
+
wn as setControlMode,
|
|
2679
|
+
Vn as setFov,
|
|
2680
|
+
En as setViewState,
|
|
2527
2681
|
ue as standardizeColumns,
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2682
|
+
rr as standardizeRowArray,
|
|
2683
|
+
fr as tangentialDesurvey,
|
|
2684
|
+
Dt as toError,
|
|
2685
|
+
Vr as tracesAsSegments,
|
|
2686
|
+
Fr as useDrillholeTraceGrid,
|
|
2687
|
+
Sr as validateStructuralPoints,
|
|
2688
|
+
$ as withDataErrorContext
|
|
2535
2689
|
};
|
|
2536
2690
|
//# sourceMappingURL=baselode.js.map
|