baselode 0.1.22 → 0.1.24

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/tool-ui.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { z as e } from "zod";
2
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";
3
+ import { useMemo as x, useState as q, useEffect as $, useRef as H } from "react";
4
+ import Y from "plotly.js-dist-min";
5
+ import { u as ne, O as re, c as ie, aa as se, a8 as ae, aL as pe, k as D, m as k, aK as ee, o as Q, q as de, n as ue, v as ce, h as ye, W as be, aJ as fe } from "./baselode3dScene-vx7nOB46.js";
6
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
7
  label: e.string().optional(),
8
8
  unit: e.string().nullish(),
@@ -105,12 +105,12 @@ function _e(o) {
105
105
  "--baselode-tool-primary": o.primary || o.accent
106
106
  };
107
107
  }
108
- function q(o) {
108
+ function W(o) {
109
109
  return o === "baselode-dark" || o === "black" ? "baselode-dark" : "baselode";
110
110
  }
111
111
  function oe(o) {
112
112
  return _e(
113
- q(o) === "baselode-dark" ? ne : re
113
+ W(o) === "baselode-dark" ? ne : re
114
114
  );
115
115
  }
116
116
  function ve(o) {
@@ -193,7 +193,7 @@ function Pe({
193
193
  onIntervalClick: s,
194
194
  onDepthRangeChange: a
195
195
  }) {
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(
196
+ const S = H(null), i = t.displayType === D || t.chartType === "categorical", v = n == null ? void 0 : n[t.property], T = Q(t.label || t.property, v), C = x(
197
197
  () => de(o, t.property, i),
198
198
  [o, i, t.property]
199
199
  ), _ = x(() => {
@@ -218,7 +218,7 @@ function Pe({
218
218
  [t.displayType]
219
219
  );
220
220
  return $(() => {
221
- var O, K, I, d;
221
+ var O, M, I, d;
222
222
  const l = S.current;
223
223
  if (!l) return;
224
224
  if (!_.data.length) {
@@ -226,8 +226,8 @@ function Pe({
226
226
  return;
227
227
  }
228
228
  const F = (B) => {
229
- var M, R;
230
- const g = (M = B == null ? void 0 : B.points) == null ? void 0 : M[0];
229
+ var J, R;
230
+ const g = (J = B == null ? void 0 : B.points) == null ? void 0 : J[0];
231
231
  if (!g || !s) return;
232
232
  const E = Array.isArray(g.customdata) ? g.customdata : [];
233
233
  s({
@@ -245,7 +245,7 @@ function Pe({
245
245
  depthRange: g
246
246
  });
247
247
  };
248
- return (O = l.removeAllListeners) == null || O.call(l, "plotly_click"), (K = l.removeAllListeners) == null || K.call(l, "plotly_relayout"), Q.react(
248
+ return (O = l.removeAllListeners) == null || O.call(l, "plotly_click"), (M = l.removeAllListeners) == null || M.call(l, "plotly_relayout"), Y.react(
249
249
  l,
250
250
  _.data,
251
251
  {
@@ -259,7 +259,7 @@ function Pe({
259
259
  responsive: !0
260
260
  }
261
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);
262
+ Y.purge(l);
263
263
  };
264
264
  }, [
265
265
  r,
@@ -287,7 +287,7 @@ function Pe({
287
287
  property: l.target.value
288
288
  });
289
289
  },
290
- children: t.propertyOptions.map((l) => /* @__PURE__ */ u("option", { value: l, children: W(l, n == null ? void 0 : n[l]) }, l))
290
+ children: t.propertyOptions.map((l) => /* @__PURE__ */ u("option", { value: l, children: Q(l, n == null ? void 0 : n[l]) }, l))
291
291
  }
292
292
  )
293
293
  ] }),
@@ -349,15 +349,15 @@ function De({
349
349
  ), O = x(
350
350
  () => le(c, s),
351
351
  [c, s]
352
- ), K = x(() => {
352
+ ), M = x(() => {
353
353
  const p = a && typeof a == "object" ? a : null;
354
354
  if (!S) return p ?? void 0;
355
355
  const m = [...c.numericCols, ...c.categoricalCols].filter((z) => z !== se && z !== ae), h = pe((r == null ? void 0 : r.points) || [], m);
356
356
  if (!p) return h;
357
- const V = { ...h };
357
+ const K = { ...h };
358
358
  return Object.entries(p).forEach(([z, U]) => {
359
- V[z] = { ...h[z], ...U };
360
- }), V;
359
+ K[z] = { ...h[z], ...U };
360
+ }), K;
361
361
  }, [a, S, c, r]), I = x(
362
362
  () => y.map((p, m) => Z(p, {
363
363
  trackIndex: m,
@@ -368,21 +368,21 @@ function De({
368
368
  showLegend: T
369
369
  })),
370
370
  [v, i, c, O, T, y]
371
- ), d = G(C), B = d ?? G(_), [g, E] = H(I), [M, R] = H(B);
371
+ ), d = G(C), B = d ?? G(_), [g, E] = q(I), [J, R] = q(B);
372
372
  $(() => {
373
373
  E(I);
374
374
  }, [I]), $(() => {
375
375
  d && R(d);
376
376
  }, [d == null ? void 0 : d[0], d == null ? void 0 : d[1]]);
377
- const J = d ?? M;
377
+ const V = d ?? J;
378
378
  function L(p) {
379
379
  const m = g.map((h) => {
380
380
  if ((h.id || h.property) !== (p.id || p.property))
381
381
  return h;
382
- const V = p.property ?? h.property, z = c.byType[V] === D ? D : "numeric", U = Z({
382
+ const K = p.property ?? h.property, z = c.byType[K] === D ? D : "numeric", U = Z({
383
383
  ...h,
384
384
  ...p,
385
- property: V,
385
+ property: K,
386
386
  displayType: p.chartType === "categorical" ? D : z,
387
387
  chartType: p.property && p.property !== h.property ? ee(z) : p.chartType ?? h.chartType,
388
388
  label: te(h.label, h.property) ? h.label : void 0
@@ -393,7 +393,7 @@ function De({
393
393
  allowChartTypeSelection: v,
394
394
  showLegend: T
395
395
  });
396
- return P == null || P(U), V !== h.property && (A == null || A({
396
+ return P == null || P(U), K !== h.property && (A == null || A({
397
397
  trackId: U.id || U.property,
398
398
  property: U.property,
399
399
  displayType: U.displayType,
@@ -407,7 +407,7 @@ function De({
407
407
  {
408
408
  className: "baselode-tool-strip-log",
409
409
  "data-tool-ui-id": o,
410
- "data-baselode-theme": q(b),
410
+ "data-baselode-theme": W(b),
411
411
  style: oe(b),
412
412
  children: [
413
413
  /* @__PURE__ */ w("header", { className: "baselode-tool-strip-log__header", children: [
@@ -422,11 +422,11 @@ function De({
422
422
  {
423
423
  hole: r,
424
424
  track: p,
425
- propertyMeta: K,
425
+ propertyMeta: M,
426
426
  height: j,
427
427
  template: b,
428
428
  showModeBar: f,
429
- depthRange: J,
429
+ depthRange: V,
430
430
  onTrackChange: L,
431
431
  onIntervalClick: l,
432
432
  onDepthRangeChange: (m) => {
@@ -453,7 +453,7 @@ function ze({
453
453
  rasterOverlays: S = [],
454
454
  camera: i
455
455
  }) {
456
- const v = Y(null), T = Y(null), [C, _] = H("");
456
+ const v = H(null), T = H(null), [C, _] = q("");
457
457
  return $(() => {
458
458
  const A = v.current;
459
459
  if (!A) return;
@@ -461,7 +461,7 @@ function ze({
461
461
  const l = new be();
462
462
  T.current = l;
463
463
  async function F() {
464
- var O, K, I, d, B, g, E, M, R, J;
464
+ var O, M, I, d, B, g, E, J, R, V;
465
465
  try {
466
466
  _(""), l.init(A), l.setBackground(y), l.setControlMode(j);
467
467
  const L = (b == null ? void 0 : b.holes) || [];
@@ -469,7 +469,7 @@ function ze({
469
469
  s.structures,
470
470
  L,
471
471
  s.options || {}
472
- ), s.visible !== void 0 && l.setStructuralDiscsVisible(s.visible)), (K = a == null ? void 0 : a.data) != null && K.length && l.setBlocks(
472
+ ), s.visible !== void 0 && l.setStructuralDiscsVisible(s.visible)), (M = a == null ? void 0 : a.data) != null && M.length && l.setBlocks(
473
473
  a.data,
474
474
  a.selectedProperty,
475
475
  a.stats || {},
@@ -478,7 +478,7 @@ function ze({
478
478
  for (const p of S) {
479
479
  const m = await fe(p);
480
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);
481
+ (B = (d = (I = m.mesh) == null ? void 0 : I.geometry) == null ? void 0 : d.dispose) == null || B.call(d), (J = (E = (g = m.mesh) == null ? void 0 : g.material) == null ? void 0 : E.dispose) == null || J.call(E), (V = (R = m.texture) == null ? void 0 : R.dispose) == null || V.call(R);
482
482
  return;
483
483
  }
484
484
  l.addRasterOverlay(m);
@@ -507,7 +507,7 @@ function ze({
507
507
  {
508
508
  className: "baselode-tool-3d-scene",
509
509
  "data-tool-ui-id": o,
510
- "data-baselode-theme": q(y),
510
+ "data-baselode-theme": W(y),
511
511
  style: oe(y),
512
512
  children: [
513
513
  (t || n) && /* @__PURE__ */ w("header", { className: "baselode-tool-3d-scene__header", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baselode",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "Geoscience drillhole data processing and visualization toolkit",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {