baselode 0.1.20 → 0.1.22
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 +1561 -1353
- package/dist/baselode.js.map +1 -1
- package/dist/{baselode3dScene-qMfVRKxK.js → baselode3dScene-4nzt80B1.js} +951 -884
- package/dist/baselode3dScene-4nzt80B1.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tool-ui.js +376 -355
- package/dist/tool-ui.js.map +1 -1
- package/package.json +1 -1
- package/dist/baselode3dScene-qMfVRKxK.js.map +0 -1
package/dist/tool-ui.js
CHANGED
|
@@ -1,90 +1,96 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
import { jsxs as w, jsx as
|
|
3
|
-
import { useMemo as x, useState as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { jsxs as w, jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as x, useState as H, useEffect as $, useRef as Y } from "react";
|
|
4
|
+
import Q from "plotly.js-dist-min";
|
|
5
|
+
import { t as ne, K as re, c as ie, a9 as se, a7 as ae, aL as pe, j as D, l as k, aK as ee, n as W, p as de, m as ue, u as ce, g as ye, V as be, aJ as fe } from "./baselode3dScene-4nzt80B1.js";
|
|
6
|
+
const me = e.union([e.string(), e.number(), e.boolean(), e.null()]), N = e.record(e.string(), e.unknown()), X = e.tuple([e.number(), e.number()]), ge = e.object({
|
|
7
|
+
label: e.string().optional(),
|
|
8
|
+
unit: e.string().nullish(),
|
|
9
|
+
sourceAttribute: e.string().nullish()
|
|
10
|
+
}), he = e.object({
|
|
11
|
+
id: e.string().optional(),
|
|
12
|
+
property: e.string().min(1),
|
|
13
|
+
label: e.string().optional(),
|
|
14
|
+
displayType: e.enum(["numeric", "categorical"]).default("numeric"),
|
|
15
|
+
chartType: e.enum(["bar", "markers", "line", "markers+line", "categorical"]).optional(),
|
|
16
|
+
colourMap: e.union([e.string(), e.record(e.string(), e.string())]).optional(),
|
|
17
|
+
propertyOptions: e.array(e.string().min(1)).optional(),
|
|
18
|
+
allowPropertySelection: e.boolean().optional(),
|
|
19
|
+
allowChartTypeSelection: e.boolean().optional(),
|
|
20
|
+
showLegend: e.boolean().optional()
|
|
21
|
+
}), Se = e.object({
|
|
22
|
+
id: e.string().min(1),
|
|
23
|
+
title: e.string().optional(),
|
|
24
|
+
subtitle: e.string().optional(),
|
|
25
|
+
hole: e.object({
|
|
26
|
+
id: e.string().min(1),
|
|
27
|
+
points: e.array(N),
|
|
28
|
+
metadata: e.record(e.string(), me).optional()
|
|
25
29
|
}),
|
|
26
|
-
tracks:
|
|
27
|
-
height:
|
|
28
|
-
template:
|
|
29
|
-
showModeBar:
|
|
30
|
-
propertyOptions:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
tracks: e.array(he).min(1),
|
|
31
|
+
height: e.number().positive().max(1200).optional(),
|
|
32
|
+
template: e.enum(["baselode", "baselode-dark", "plotly-default"]).optional(),
|
|
33
|
+
showModeBar: e.boolean().optional(),
|
|
34
|
+
propertyOptions: e.array(e.string().min(1)).optional(),
|
|
35
|
+
propertyMeta: e.record(e.string(), ge).optional(),
|
|
36
|
+
deriveMetaFromRows: e.boolean().optional(),
|
|
37
|
+
allowPropertySelection: e.boolean().optional(),
|
|
38
|
+
allowChartTypeSelection: e.boolean().optional(),
|
|
39
|
+
showLegend: e.boolean().optional(),
|
|
40
|
+
depthRange: X.optional(),
|
|
41
|
+
defaultDepthRange: X.optional()
|
|
36
42
|
});
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
return
|
|
43
|
+
function Ie(o) {
|
|
44
|
+
const t = Se.safeParse(o);
|
|
45
|
+
return t.success ? t.data : null;
|
|
40
46
|
}
|
|
41
|
-
const
|
|
42
|
-
id:
|
|
43
|
-
title:
|
|
44
|
-
subtitle:
|
|
45
|
-
height:
|
|
46
|
-
background:
|
|
47
|
-
controlMode:
|
|
48
|
-
drillholes:
|
|
49
|
-
holes:
|
|
50
|
-
options:
|
|
47
|
+
const Te = e.object({
|
|
48
|
+
id: e.string().min(1),
|
|
49
|
+
title: e.string().optional(),
|
|
50
|
+
subtitle: e.string().optional(),
|
|
51
|
+
height: e.number().positive().max(1400).optional(),
|
|
52
|
+
background: e.enum(["white", "black"]).optional(),
|
|
53
|
+
controlMode: e.enum(["orbit", "fly"]).optional(),
|
|
54
|
+
drillholes: e.object({
|
|
55
|
+
holes: e.array(N),
|
|
56
|
+
options: N.optional()
|
|
51
57
|
}).optional(),
|
|
52
|
-
stripLogs:
|
|
53
|
-
structuralDiscs:
|
|
54
|
-
structures:
|
|
55
|
-
options:
|
|
56
|
-
visible:
|
|
58
|
+
stripLogs: e.array(N).optional(),
|
|
59
|
+
structuralDiscs: e.object({
|
|
60
|
+
structures: e.array(N),
|
|
61
|
+
options: N.optional(),
|
|
62
|
+
visible: e.boolean().optional()
|
|
57
63
|
}).optional(),
|
|
58
|
-
blocks:
|
|
59
|
-
data:
|
|
60
|
-
selectedProperty:
|
|
61
|
-
stats:
|
|
62
|
-
options:
|
|
64
|
+
blocks: e.object({
|
|
65
|
+
data: e.array(N),
|
|
66
|
+
selectedProperty: e.string().min(1),
|
|
67
|
+
stats: N.optional(),
|
|
68
|
+
options: N.optional()
|
|
63
69
|
}).optional(),
|
|
64
|
-
rasterOverlays:
|
|
65
|
-
id:
|
|
66
|
-
name:
|
|
67
|
-
source:
|
|
68
|
-
type:
|
|
69
|
-
url:
|
|
70
|
+
rasterOverlays: e.array(e.object({
|
|
71
|
+
id: e.string().optional(),
|
|
72
|
+
name: e.string().optional(),
|
|
73
|
+
source: e.object({
|
|
74
|
+
type: e.literal("url"),
|
|
75
|
+
url: e.string().min(1)
|
|
70
76
|
}),
|
|
71
|
-
bounds:
|
|
72
|
-
elevation:
|
|
73
|
-
opacity:
|
|
74
|
-
visible:
|
|
75
|
-
renderOrder:
|
|
77
|
+
bounds: N,
|
|
78
|
+
elevation: e.number().optional(),
|
|
79
|
+
opacity: e.number().optional(),
|
|
80
|
+
visible: e.boolean().optional(),
|
|
81
|
+
renderOrder: e.number().optional()
|
|
76
82
|
})).optional(),
|
|
77
|
-
camera:
|
|
78
|
-
viewState:
|
|
79
|
-
fitToBounds:
|
|
80
|
-
focusPadding:
|
|
83
|
+
camera: e.object({
|
|
84
|
+
viewState: N.optional(),
|
|
85
|
+
fitToBounds: e.boolean().optional(),
|
|
86
|
+
focusPadding: e.number().positive().optional()
|
|
81
87
|
}).optional()
|
|
82
88
|
});
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
return
|
|
89
|
+
function Ue(o) {
|
|
90
|
+
const t = Te.safeParse(o);
|
|
91
|
+
return t.success ? t.data : null;
|
|
86
92
|
}
|
|
87
|
-
function
|
|
93
|
+
function _e(o) {
|
|
88
94
|
return {
|
|
89
95
|
"--baselode-tool-bg": o.bg,
|
|
90
96
|
"--baselode-tool-panel": o.panel,
|
|
@@ -99,410 +105,425 @@ function ce(o) {
|
|
|
99
105
|
"--baselode-tool-primary": o.primary || o.accent
|
|
100
106
|
};
|
|
101
107
|
}
|
|
102
|
-
function
|
|
108
|
+
function q(o) {
|
|
103
109
|
return o === "baselode-dark" || o === "black" ? "baselode-dark" : "baselode";
|
|
104
110
|
}
|
|
105
|
-
function
|
|
106
|
-
return
|
|
107
|
-
|
|
111
|
+
function oe(o) {
|
|
112
|
+
return _e(
|
|
113
|
+
q(o) === "baselode-dark" ? ne : re
|
|
108
114
|
);
|
|
109
115
|
}
|
|
110
|
-
function
|
|
111
|
-
return o === "baselode-dark" ?
|
|
116
|
+
function ve(o) {
|
|
117
|
+
return o === "baselode-dark" ? ce : o === "plotly-default" ? null : ye;
|
|
112
118
|
}
|
|
113
|
-
function
|
|
119
|
+
function G(o) {
|
|
114
120
|
if (!Array.isArray(o) || o.length !== 2) return null;
|
|
115
|
-
const
|
|
116
|
-
return !Number.isFinite(
|
|
121
|
+
const t = Number(o[0]), n = Number(o[1]);
|
|
122
|
+
return !Number.isFinite(t) || !Number.isFinite(n) || t === n ? null : t < n ? [t, n] : [n, t];
|
|
117
123
|
}
|
|
118
|
-
function
|
|
124
|
+
function Le(o) {
|
|
119
125
|
if (o)
|
|
120
126
|
return [o[1], o[0]];
|
|
121
127
|
}
|
|
122
|
-
function
|
|
128
|
+
function Ne(o) {
|
|
123
129
|
if (!o || typeof o != "object") return null;
|
|
124
|
-
const
|
|
125
|
-
if (Array.isArray(
|
|
126
|
-
return
|
|
127
|
-
const n = o["yaxis.range[0]"],
|
|
128
|
-
return n !== void 0 &&
|
|
130
|
+
const t = o["yaxis.range"];
|
|
131
|
+
if (Array.isArray(t) && t.length === 2)
|
|
132
|
+
return G(t);
|
|
133
|
+
const n = o["yaxis.range[0]"], r = o["yaxis.range[1]"];
|
|
134
|
+
return n !== void 0 && r !== void 0 ? G([n, r]) : null;
|
|
129
135
|
}
|
|
130
|
-
function
|
|
131
|
-
return !!(o && o !==
|
|
136
|
+
function te(o, t) {
|
|
137
|
+
return !!(o && o !== t);
|
|
132
138
|
}
|
|
133
|
-
function
|
|
139
|
+
function le(o, t) {
|
|
134
140
|
const n = [...o.numericCols, ...o.categoricalCols];
|
|
135
|
-
if (!(
|
|
136
|
-
const
|
|
137
|
-
return
|
|
141
|
+
if (!(t != null && t.length)) return n;
|
|
142
|
+
const r = new Set(n);
|
|
143
|
+
return t.filter((y) => r.has(y));
|
|
138
144
|
}
|
|
139
|
-
function
|
|
140
|
-
trackIndex:
|
|
145
|
+
function Z(o, {
|
|
146
|
+
trackIndex: t = 0,
|
|
141
147
|
selectableProperties: n,
|
|
142
|
-
classified:
|
|
143
|
-
allowPropertySelection:
|
|
144
|
-
allowChartTypeSelection:
|
|
145
|
-
showLegend:
|
|
148
|
+
classified: r,
|
|
149
|
+
allowPropertySelection: y,
|
|
150
|
+
allowChartTypeSelection: j,
|
|
151
|
+
showLegend: b
|
|
146
152
|
}) {
|
|
147
|
-
const
|
|
153
|
+
const f = le(r, o.propertyOptions ?? n), s = f.includes(o.property) ? o.property : f[0] ?? o.property, a = r.byType[s] === D ? D : "numeric", S = o.chartType === "categorical" || o.displayType === D ? D : a, v = k(S).some((T) => T.value === o.chartType) ? o.chartType : ee(S);
|
|
148
154
|
return {
|
|
149
155
|
...o,
|
|
150
|
-
id: o.id || `${
|
|
151
|
-
property:
|
|
152
|
-
label:
|
|
153
|
-
displayType:
|
|
154
|
-
chartType:
|
|
155
|
-
propertyOptions:
|
|
156
|
-
allowPropertySelection: o.allowPropertySelection ??
|
|
157
|
-
allowChartTypeSelection: o.allowChartTypeSelection ??
|
|
158
|
-
showLegend: o.showLegend ??
|
|
156
|
+
id: o.id || `${s}-${t + 1}`,
|
|
157
|
+
property: s,
|
|
158
|
+
label: te(o.label, o.property) ? o.label : void 0,
|
|
159
|
+
displayType: S,
|
|
160
|
+
chartType: v,
|
|
161
|
+
propertyOptions: f,
|
|
162
|
+
allowPropertySelection: o.allowPropertySelection ?? y ?? !1,
|
|
163
|
+
allowChartTypeSelection: o.allowChartTypeSelection ?? j ?? !1,
|
|
164
|
+
showLegend: o.showLegend ?? b ?? S === D
|
|
159
165
|
};
|
|
160
166
|
}
|
|
161
|
-
function
|
|
162
|
-
return !Array.isArray(o) || !o.length ? [] : o.map((
|
|
163
|
-
var
|
|
164
|
-
const n = (
|
|
165
|
-
return !
|
|
167
|
+
function we(o) {
|
|
168
|
+
return !Array.isArray(o) || !o.length ? [] : o.map((t) => {
|
|
169
|
+
var y;
|
|
170
|
+
const n = (y = t == null ? void 0 : t.marker) == null ? void 0 : y.color, r = t == null ? void 0 : t.name;
|
|
171
|
+
return !r || typeof n != "string" ? null : { label: r, color: n };
|
|
166
172
|
}).filter(Boolean);
|
|
167
173
|
}
|
|
168
|
-
function
|
|
169
|
-
return
|
|
174
|
+
function Ae(o, t) {
|
|
175
|
+
return t ? {
|
|
170
176
|
...o,
|
|
171
177
|
yaxis: {
|
|
172
178
|
...o.yaxis || {},
|
|
173
179
|
autorange: !1,
|
|
174
|
-
range:
|
|
180
|
+
range: Le(t)
|
|
175
181
|
}
|
|
176
182
|
} : o;
|
|
177
183
|
}
|
|
178
|
-
function
|
|
184
|
+
function Pe({
|
|
179
185
|
hole: o,
|
|
180
|
-
track:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
track: t,
|
|
187
|
+
propertyMeta: n,
|
|
188
|
+
height: r,
|
|
189
|
+
template: y,
|
|
190
|
+
showModeBar: j,
|
|
191
|
+
depthRange: b,
|
|
192
|
+
onTrackChange: f,
|
|
193
|
+
onIntervalClick: s,
|
|
194
|
+
onDepthRangeChange: a
|
|
188
195
|
}) {
|
|
189
|
-
const
|
|
190
|
-
() =>
|
|
191
|
-
[o,
|
|
192
|
-
),
|
|
193
|
-
const l =
|
|
194
|
-
points:
|
|
195
|
-
isCategorical:
|
|
196
|
-
property:
|
|
197
|
-
chartType:
|
|
198
|
-
colourMap:
|
|
199
|
-
template:
|
|
196
|
+
const S = Y(null), i = t.displayType === D || t.chartType === "categorical", v = n == null ? void 0 : n[t.property], T = W(t.label || t.property, v), C = x(
|
|
197
|
+
() => de(o, t.property, i),
|
|
198
|
+
[o, i, t.property]
|
|
199
|
+
), _ = x(() => {
|
|
200
|
+
const l = ue({
|
|
201
|
+
points: C,
|
|
202
|
+
isCategorical: i,
|
|
203
|
+
property: t.label || t.property,
|
|
204
|
+
chartType: t.chartType || (i ? "categorical" : "markers+line"),
|
|
205
|
+
colourMap: t.colourMap,
|
|
206
|
+
template: ve(y),
|
|
207
|
+
meta: v
|
|
200
208
|
});
|
|
201
209
|
return {
|
|
202
210
|
data: l.data,
|
|
203
|
-
layout:
|
|
211
|
+
layout: Ae(l.layout, b)
|
|
204
212
|
};
|
|
205
|
-
}, [
|
|
206
|
-
() =>
|
|
207
|
-
[
|
|
208
|
-
),
|
|
209
|
-
() =>
|
|
210
|
-
[
|
|
213
|
+
}, [b, i, v, C, y, t.chartType, t.colourMap, t.label, t.property]), A = x(
|
|
214
|
+
() => t.showLegend && i ? we(_.data) : [],
|
|
215
|
+
[i, _.data, t.showLegend]
|
|
216
|
+
), P = x(
|
|
217
|
+
() => k(t.displayType),
|
|
218
|
+
[t.displayType]
|
|
211
219
|
);
|
|
212
|
-
return
|
|
213
|
-
var
|
|
214
|
-
const l =
|
|
220
|
+
return $(() => {
|
|
221
|
+
var O, K, I, d;
|
|
222
|
+
const l = S.current;
|
|
215
223
|
if (!l) return;
|
|
216
|
-
if (!
|
|
217
|
-
l.replaceChildren(document.createTextNode(`No data for ${
|
|
224
|
+
if (!_.data.length) {
|
|
225
|
+
l.replaceChildren(document.createTextNode(`No data for ${T}`));
|
|
218
226
|
return;
|
|
219
227
|
}
|
|
220
|
-
const
|
|
221
|
-
var
|
|
222
|
-
const
|
|
223
|
-
if (!
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
trackId:
|
|
227
|
-
property:
|
|
228
|
-
value:
|
|
229
|
-
from: Number(
|
|
230
|
-
to: Number(
|
|
231
|
-
pointIndex:
|
|
228
|
+
const F = (B) => {
|
|
229
|
+
var M, R;
|
|
230
|
+
const g = (M = B == null ? void 0 : B.points) == null ? void 0 : M[0];
|
|
231
|
+
if (!g || !s) return;
|
|
232
|
+
const E = Array.isArray(g.customdata) ? g.customdata : [];
|
|
233
|
+
s({
|
|
234
|
+
trackId: t.id || t.property,
|
|
235
|
+
property: t.property,
|
|
236
|
+
value: i ? (R = g.data) == null ? void 0 : R.name : g.x,
|
|
237
|
+
from: Number(E[0]),
|
|
238
|
+
to: Number(E[1]),
|
|
239
|
+
pointIndex: g.pointIndex
|
|
232
240
|
});
|
|
233
|
-
},
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
trackId:
|
|
237
|
-
depthRange:
|
|
241
|
+
}, c = (B) => {
|
|
242
|
+
const g = Ne(B);
|
|
243
|
+
g && a && a({
|
|
244
|
+
trackId: t.id || t.property,
|
|
245
|
+
depthRange: g
|
|
238
246
|
});
|
|
239
247
|
};
|
|
240
|
-
return (
|
|
248
|
+
return (O = l.removeAllListeners) == null || O.call(l, "plotly_click"), (K = l.removeAllListeners) == null || K.call(l, "plotly_relayout"), Q.react(
|
|
241
249
|
l,
|
|
242
|
-
|
|
250
|
+
_.data,
|
|
243
251
|
{
|
|
244
|
-
...
|
|
245
|
-
height:
|
|
252
|
+
..._.layout,
|
|
253
|
+
height: r,
|
|
246
254
|
title: void 0,
|
|
247
|
-
margin: { ...
|
|
255
|
+
margin: { ..._.layout.margin, t: 12 }
|
|
248
256
|
},
|
|
249
257
|
{
|
|
250
|
-
displayModeBar:
|
|
258
|
+
displayModeBar: j,
|
|
251
259
|
responsive: !0
|
|
252
260
|
}
|
|
253
|
-
),
|
|
254
|
-
|
|
261
|
+
), s && ((I = l.on) == null || I.call(l, "plotly_click", F)), a && ((d = l.on) == null || d.call(l, "plotly_relayout", c)), () => {
|
|
262
|
+
Q.purge(l);
|
|
255
263
|
};
|
|
256
264
|
}, [
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
/* @__PURE__ */
|
|
265
|
+
r,
|
|
266
|
+
a,
|
|
267
|
+
s,
|
|
268
|
+
_.data,
|
|
269
|
+
_.layout,
|
|
270
|
+
j,
|
|
271
|
+
t.id,
|
|
272
|
+
t.property,
|
|
273
|
+
T,
|
|
274
|
+
i
|
|
275
|
+
]), /* @__PURE__ */ w("section", { className: "baselode-tool-strip-log__track", "aria-label": T, children: [
|
|
276
|
+
/* @__PURE__ */ u("div", { className: "baselode-tool-strip-log__track-title", children: T }),
|
|
277
|
+
(t.allowPropertySelection || t.allowChartTypeSelection && P.length > 1) && /* @__PURE__ */ w("div", { className: "baselode-tool-strip-log__controls", children: [
|
|
278
|
+
t.allowPropertySelection && t.propertyOptions.length > 0 && /* @__PURE__ */ w("label", { className: "baselode-tool-strip-log__control", children: [
|
|
279
|
+
/* @__PURE__ */ u("span", { children: "Property" }),
|
|
280
|
+
/* @__PURE__ */ u(
|
|
272
281
|
"select",
|
|
273
282
|
{
|
|
274
|
-
value:
|
|
283
|
+
value: t.property,
|
|
275
284
|
onChange: (l) => {
|
|
276
|
-
|
|
277
|
-
...
|
|
285
|
+
f == null || f({
|
|
286
|
+
...t,
|
|
278
287
|
property: l.target.value
|
|
279
288
|
});
|
|
280
289
|
},
|
|
281
|
-
children:
|
|
290
|
+
children: t.propertyOptions.map((l) => /* @__PURE__ */ u("option", { value: l, children: W(l, n == null ? void 0 : n[l]) }, l))
|
|
282
291
|
}
|
|
283
292
|
)
|
|
284
293
|
] }),
|
|
285
|
-
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
294
|
+
t.allowChartTypeSelection && P.length > 1 && /* @__PURE__ */ w("label", { className: "baselode-tool-strip-log__control", children: [
|
|
295
|
+
/* @__PURE__ */ u("span", { children: "Chart" }),
|
|
296
|
+
/* @__PURE__ */ u(
|
|
288
297
|
"select",
|
|
289
298
|
{
|
|
290
|
-
value:
|
|
299
|
+
value: t.chartType,
|
|
291
300
|
onChange: (l) => {
|
|
292
|
-
|
|
293
|
-
...
|
|
301
|
+
f == null || f({
|
|
302
|
+
...t,
|
|
294
303
|
chartType: l.target.value
|
|
295
304
|
});
|
|
296
305
|
},
|
|
297
|
-
children:
|
|
306
|
+
children: P.map((l) => /* @__PURE__ */ u("option", { value: l.value, children: l.label }, l.value))
|
|
298
307
|
}
|
|
299
308
|
)
|
|
300
309
|
] })
|
|
301
310
|
] }),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
|
|
304
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ u("div", { className: "baselode-tool-strip-log__plot", ref: S }),
|
|
312
|
+
A.length > 0 && /* @__PURE__ */ u("div", { className: "baselode-tool-strip-log__legend", children: A.map((l) => /* @__PURE__ */ w("div", { className: "baselode-tool-strip-log__legend-row", children: [
|
|
313
|
+
/* @__PURE__ */ u(
|
|
305
314
|
"span",
|
|
306
315
|
{
|
|
307
316
|
className: "baselode-tool-strip-log__legend-swatch",
|
|
308
317
|
style: { backgroundColor: l.color }
|
|
309
318
|
}
|
|
310
319
|
),
|
|
311
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ u("span", { children: l.label })
|
|
312
321
|
] }, l.label)) })
|
|
313
322
|
] });
|
|
314
323
|
}
|
|
315
|
-
function
|
|
324
|
+
function De({
|
|
316
325
|
id: o,
|
|
317
|
-
title:
|
|
326
|
+
title: t,
|
|
318
327
|
subtitle: n,
|
|
319
|
-
hole:
|
|
320
|
-
tracks:
|
|
321
|
-
height:
|
|
322
|
-
template:
|
|
323
|
-
showModeBar:
|
|
324
|
-
propertyOptions:
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
328
|
+
hole: r,
|
|
329
|
+
tracks: y,
|
|
330
|
+
height: j = 420,
|
|
331
|
+
template: b = "baselode",
|
|
332
|
+
showModeBar: f = !1,
|
|
333
|
+
propertyOptions: s,
|
|
334
|
+
propertyMeta: a,
|
|
335
|
+
deriveMetaFromRows: S = !1,
|
|
336
|
+
allowPropertySelection: i = !1,
|
|
337
|
+
allowChartTypeSelection: v = !1,
|
|
338
|
+
showLegend: T,
|
|
339
|
+
depthRange: C,
|
|
340
|
+
defaultDepthRange: _,
|
|
341
|
+
onPropertyChange: A,
|
|
342
|
+
onTrackChange: P,
|
|
343
|
+
onIntervalClick: l,
|
|
344
|
+
onDepthRangeChange: F
|
|
334
345
|
}) {
|
|
335
|
-
const
|
|
336
|
-
() =>
|
|
337
|
-
[
|
|
338
|
-
),
|
|
339
|
-
() =>
|
|
340
|
-
[
|
|
341
|
-
),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
346
|
+
const c = x(
|
|
347
|
+
() => ie((r == null ? void 0 : r.points) || []),
|
|
348
|
+
[r]
|
|
349
|
+
), O = x(
|
|
350
|
+
() => le(c, s),
|
|
351
|
+
[c, s]
|
|
352
|
+
), K = x(() => {
|
|
353
|
+
const p = a && typeof a == "object" ? a : null;
|
|
354
|
+
if (!S) return p ?? void 0;
|
|
355
|
+
const m = [...c.numericCols, ...c.categoricalCols].filter((z) => z !== se && z !== ae), h = pe((r == null ? void 0 : r.points) || [], m);
|
|
356
|
+
if (!p) return h;
|
|
357
|
+
const V = { ...h };
|
|
358
|
+
return Object.entries(p).forEach(([z, U]) => {
|
|
359
|
+
V[z] = { ...h[z], ...U };
|
|
360
|
+
}), V;
|
|
361
|
+
}, [a, S, c, r]), I = x(
|
|
362
|
+
() => y.map((p, m) => Z(p, {
|
|
363
|
+
trackIndex: m,
|
|
364
|
+
selectableProperties: O,
|
|
365
|
+
classified: c,
|
|
366
|
+
allowPropertySelection: i,
|
|
367
|
+
allowChartTypeSelection: v,
|
|
368
|
+
showLegend: T
|
|
349
369
|
})),
|
|
350
|
-
[
|
|
351
|
-
),
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}, [
|
|
355
|
-
|
|
356
|
-
}, [
|
|
357
|
-
const
|
|
358
|
-
function
|
|
359
|
-
const
|
|
360
|
-
if ((
|
|
361
|
-
return
|
|
362
|
-
const
|
|
363
|
-
...
|
|
364
|
-
...
|
|
365
|
-
property:
|
|
366
|
-
displayType:
|
|
367
|
-
chartType:
|
|
368
|
-
label:
|
|
370
|
+
[v, i, c, O, T, y]
|
|
371
|
+
), d = G(C), B = d ?? G(_), [g, E] = H(I), [M, R] = H(B);
|
|
372
|
+
$(() => {
|
|
373
|
+
E(I);
|
|
374
|
+
}, [I]), $(() => {
|
|
375
|
+
d && R(d);
|
|
376
|
+
}, [d == null ? void 0 : d[0], d == null ? void 0 : d[1]]);
|
|
377
|
+
const J = d ?? M;
|
|
378
|
+
function L(p) {
|
|
379
|
+
const m = g.map((h) => {
|
|
380
|
+
if ((h.id || h.property) !== (p.id || p.property))
|
|
381
|
+
return h;
|
|
382
|
+
const V = p.property ?? h.property, z = c.byType[V] === D ? D : "numeric", U = Z({
|
|
383
|
+
...h,
|
|
384
|
+
...p,
|
|
385
|
+
property: V,
|
|
386
|
+
displayType: p.chartType === "categorical" ? D : z,
|
|
387
|
+
chartType: p.property && p.property !== h.property ? ee(z) : p.chartType ?? h.chartType,
|
|
388
|
+
label: te(h.label, h.property) ? h.label : void 0
|
|
369
389
|
}, {
|
|
370
|
-
selectableProperties:
|
|
371
|
-
classified:
|
|
372
|
-
allowPropertySelection:
|
|
373
|
-
allowChartTypeSelection:
|
|
374
|
-
showLegend:
|
|
390
|
+
selectableProperties: O,
|
|
391
|
+
classified: c,
|
|
392
|
+
allowPropertySelection: i,
|
|
393
|
+
allowChartTypeSelection: v,
|
|
394
|
+
showLegend: T
|
|
375
395
|
});
|
|
376
|
-
return
|
|
377
|
-
trackId:
|
|
378
|
-
property:
|
|
379
|
-
displayType:
|
|
380
|
-
chartType:
|
|
381
|
-
})),
|
|
396
|
+
return P == null || P(U), V !== h.property && (A == null || A({
|
|
397
|
+
trackId: U.id || U.property,
|
|
398
|
+
property: U.property,
|
|
399
|
+
displayType: U.displayType,
|
|
400
|
+
chartType: U.chartType
|
|
401
|
+
})), U;
|
|
382
402
|
});
|
|
383
|
-
|
|
403
|
+
E(m);
|
|
384
404
|
}
|
|
385
405
|
return /* @__PURE__ */ w(
|
|
386
406
|
"article",
|
|
387
407
|
{
|
|
388
408
|
className: "baselode-tool-strip-log",
|
|
389
409
|
"data-tool-ui-id": o,
|
|
390
|
-
"data-baselode-theme":
|
|
391
|
-
style:
|
|
410
|
+
"data-baselode-theme": q(b),
|
|
411
|
+
style: oe(b),
|
|
392
412
|
children: [
|
|
393
413
|
/* @__PURE__ */ w("header", { className: "baselode-tool-strip-log__header", children: [
|
|
394
414
|
/* @__PURE__ */ w("div", { children: [
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ u("div", { className: "baselode-tool-strip-log__eyebrow", children: r.id }),
|
|
416
|
+
/* @__PURE__ */ u("h3", { children: t || "Strip log" })
|
|
397
417
|
] }),
|
|
398
|
-
n && /* @__PURE__ */
|
|
418
|
+
n && /* @__PURE__ */ u("p", { children: n })
|
|
399
419
|
] }),
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
|
|
420
|
+
/* @__PURE__ */ u("div", { className: "baselode-tool-strip-log__tracks", children: g.map((p) => /* @__PURE__ */ u(
|
|
421
|
+
Pe,
|
|
402
422
|
{
|
|
403
|
-
hole:
|
|
404
|
-
track:
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
423
|
+
hole: r,
|
|
424
|
+
track: p,
|
|
425
|
+
propertyMeta: K,
|
|
426
|
+
height: j,
|
|
427
|
+
template: b,
|
|
428
|
+
showModeBar: f,
|
|
429
|
+
depthRange: J,
|
|
430
|
+
onTrackChange: L,
|
|
431
|
+
onIntervalClick: l,
|
|
432
|
+
onDepthRangeChange: (m) => {
|
|
433
|
+
!d && (m != null && m.depthRange) && R(m.depthRange), F == null || F(m);
|
|
413
434
|
}
|
|
414
435
|
},
|
|
415
|
-
|
|
436
|
+
p.id || p.property
|
|
416
437
|
)) })
|
|
417
438
|
]
|
|
418
439
|
}
|
|
419
440
|
);
|
|
420
441
|
}
|
|
421
|
-
function
|
|
442
|
+
function ze({
|
|
422
443
|
id: o,
|
|
423
|
-
title:
|
|
444
|
+
title: t,
|
|
424
445
|
subtitle: n,
|
|
425
|
-
height:
|
|
426
|
-
background:
|
|
427
|
-
controlMode:
|
|
428
|
-
drillholes:
|
|
429
|
-
stripLogs:
|
|
430
|
-
structuralDiscs:
|
|
431
|
-
blocks:
|
|
432
|
-
rasterOverlays:
|
|
433
|
-
camera:
|
|
446
|
+
height: r = 520,
|
|
447
|
+
background: y = "white",
|
|
448
|
+
controlMode: j = "orbit",
|
|
449
|
+
drillholes: b,
|
|
450
|
+
stripLogs: f = [],
|
|
451
|
+
structuralDiscs: s,
|
|
452
|
+
blocks: a,
|
|
453
|
+
rasterOverlays: S = [],
|
|
454
|
+
camera: i
|
|
434
455
|
}) {
|
|
435
|
-
const
|
|
436
|
-
return
|
|
437
|
-
const
|
|
438
|
-
if (!
|
|
439
|
-
let
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
async function
|
|
443
|
-
var
|
|
456
|
+
const v = Y(null), T = Y(null), [C, _] = H("");
|
|
457
|
+
return $(() => {
|
|
458
|
+
const A = v.current;
|
|
459
|
+
if (!A) return;
|
|
460
|
+
let P = !1;
|
|
461
|
+
const l = new be();
|
|
462
|
+
T.current = l;
|
|
463
|
+
async function F() {
|
|
464
|
+
var O, K, I, d, B, g, E, M, R, J;
|
|
444
465
|
try {
|
|
445
|
-
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
),
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
466
|
+
_(""), l.init(A), l.setBackground(y), l.setControlMode(j);
|
|
467
|
+
const L = (b == null ? void 0 : b.holes) || [];
|
|
468
|
+
L.length && l.setDrillholes(L, (b == null ? void 0 : b.options) || {}), L.length && f.length && l.setStripLogs(L, f), (O = s == null ? void 0 : s.structures) != null && O.length && (l.setStructuralDiscs(
|
|
469
|
+
s.structures,
|
|
470
|
+
L,
|
|
471
|
+
s.options || {}
|
|
472
|
+
), s.visible !== void 0 && l.setStructuralDiscsVisible(s.visible)), (K = a == null ? void 0 : a.data) != null && K.length && l.setBlocks(
|
|
473
|
+
a.data,
|
|
474
|
+
a.selectedProperty,
|
|
475
|
+
a.stats || {},
|
|
476
|
+
a.options || {}
|
|
456
477
|
);
|
|
457
|
-
for (const
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
460
|
-
(
|
|
478
|
+
for (const p of S) {
|
|
479
|
+
const m = await fe(p);
|
|
480
|
+
if (P) {
|
|
481
|
+
(B = (d = (I = m.mesh) == null ? void 0 : I.geometry) == null ? void 0 : d.dispose) == null || B.call(d), (M = (E = (g = m.mesh) == null ? void 0 : g.material) == null ? void 0 : E.dispose) == null || M.call(E), (J = (R = m.texture) == null ? void 0 : R.dispose) == null || J.call(R);
|
|
461
482
|
return;
|
|
462
483
|
}
|
|
463
|
-
|
|
484
|
+
l.addRasterOverlay(m);
|
|
464
485
|
}
|
|
465
|
-
|
|
466
|
-
} catch (
|
|
467
|
-
console.error("Baselode 3D Tool UI render error",
|
|
486
|
+
i != null && i.viewState ? l.setViewState(i.viewState) : (i == null ? void 0 : i.fitToBounds) !== !1 && l.focusOnLastBounds((i == null ? void 0 : i.focusPadding) || 1.2);
|
|
487
|
+
} catch (L) {
|
|
488
|
+
console.error("Baselode 3D Tool UI render error", L), _((L == null ? void 0 : L.message) || "3D scene render error");
|
|
468
489
|
}
|
|
469
490
|
}
|
|
470
|
-
|
|
471
|
-
const
|
|
472
|
-
return
|
|
473
|
-
|
|
491
|
+
F();
|
|
492
|
+
const c = typeof ResizeObserver < "u" ? new ResizeObserver(() => l.resize()) : null;
|
|
493
|
+
return c == null || c.observe(A), () => {
|
|
494
|
+
P = !0, c == null || c.disconnect(), l.dispose(), T.current = null;
|
|
474
495
|
};
|
|
475
496
|
}, [
|
|
476
|
-
|
|
477
|
-
f,
|
|
478
|
-
u,
|
|
479
|
-
B,
|
|
480
|
-
p,
|
|
497
|
+
y,
|
|
481
498
|
a,
|
|
499
|
+
i,
|
|
500
|
+
j,
|
|
501
|
+
b,
|
|
482
502
|
S,
|
|
483
|
-
|
|
503
|
+
f,
|
|
504
|
+
s
|
|
484
505
|
]), /* @__PURE__ */ w(
|
|
485
506
|
"article",
|
|
486
507
|
{
|
|
487
508
|
className: "baselode-tool-3d-scene",
|
|
488
509
|
"data-tool-ui-id": o,
|
|
489
|
-
"data-baselode-theme":
|
|
490
|
-
style:
|
|
510
|
+
"data-baselode-theme": q(y),
|
|
511
|
+
style: oe(y),
|
|
491
512
|
children: [
|
|
492
|
-
(
|
|
493
|
-
|
|
494
|
-
n && /* @__PURE__ */
|
|
513
|
+
(t || n) && /* @__PURE__ */ w("header", { className: "baselode-tool-3d-scene__header", children: [
|
|
514
|
+
t && /* @__PURE__ */ u("h3", { children: t }),
|
|
515
|
+
n && /* @__PURE__ */ u("p", { children: n })
|
|
495
516
|
] }),
|
|
496
|
-
|
|
517
|
+
C && /* @__PURE__ */ w("div", { className: "baselode-tool-3d-scene__error", children: [
|
|
497
518
|
"Scene error: ",
|
|
498
|
-
|
|
519
|
+
C
|
|
499
520
|
] }),
|
|
500
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ u(
|
|
501
522
|
"div",
|
|
502
523
|
{
|
|
503
524
|
className: "baselode-tool-3d-scene__viewport",
|
|
504
|
-
ref:
|
|
505
|
-
style: { height:
|
|
525
|
+
ref: v,
|
|
526
|
+
style: { height: r }
|
|
506
527
|
}
|
|
507
528
|
)
|
|
508
529
|
]
|
|
@@ -510,12 +531,12 @@ function Pe({
|
|
|
510
531
|
);
|
|
511
532
|
}
|
|
512
533
|
export {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
534
|
+
ze as Baselode3DSceneToolUI,
|
|
535
|
+
De as BaselodeStripLogToolUI,
|
|
536
|
+
Te as SerializableBaselode3DSceneSchema,
|
|
537
|
+
Se as SerializableBaselodeStripLogSchema,
|
|
538
|
+
he as SerializableBaselodeStripLogTrackSchema,
|
|
539
|
+
Ue as safeParseSerializableBaselode3DScene,
|
|
540
|
+
Ie as safeParseSerializableBaselodeStripLog
|
|
520
541
|
};
|
|
521
542
|
//# sourceMappingURL=tool-ui.js.map
|