@ndmspc/ndmvr-core 1.1.2-rc.3 → 1.1.2-rc.5

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/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BehaviorSubject as e, EMPTY as t, ReplaySubject as n, Subject as r, concatMap as i, filter as a, finalize as o, from as s } from "rxjs";
2
2
  import { build3d as c, create as l, makeImage as u, openFile as d, parse as f } from "jsroot";
3
- import { Box3 as p, BoxGeometry as m, Color as h, DoubleSide as g, EdgesGeometry as _, FileLoader as v, Group as y, InstancedBufferAttribute as b, InstancedBufferGeometry as x, LineSegments as S, Loader as C, Mesh as w, MeshBasicMaterial as T, Object3D as E, PlaneGeometry as D, Raycaster as O, SRGBColorSpace as k, ShaderMaterial as A, ShapePath as j, Sprite as M, SpriteMaterial as ee, Texture as te, TextureLoader as ne, Vector2 as re, Vector3 as N } from "three";
3
+ import { Box3 as p, BoxGeometry as m, Color as h, DoubleSide as g, EdgesGeometry as _, FileLoader as v, Group as y, InstancedBufferAttribute as b, InstancedBufferGeometry as x, LineSegments as S, Loader as C, Mesh as w, MeshBasicMaterial as T, Object3D as E, PlaneGeometry as D, Raycaster as O, SRGBColorSpace as k, ShaderMaterial as A, ShapePath as j, Sprite as M, SpriteMaterial as N, Texture as ee, TextureLoader as P, Vector2 as te, Vector3 as F } from "three";
4
4
  //#region src/core/broker.js
5
- var P = class {
5
+ var I = class {
6
6
  constructor(e, t, n, r) {
7
7
  this.url = e, this.ws = null, this.channel = n, this.connected = !1, this.connecting = !1, this.intentionalDisconnect = !1, this.reconnectAttempts = 0, this.maxReconnectAttempts = 10, this.reconnectTimeout = null, this.initTime = Date.now(), this.timeout = r || 6e4, this.timeFlag = !0, t && this.connect();
8
8
  }
@@ -88,7 +88,7 @@ var P = class {
88
88
  unsubscribe(e) {
89
89
  e.unsubscribe();
90
90
  }
91
- }, F, ie = class {
91
+ }, ne, re = class {
92
92
  #e;
93
93
  #t;
94
94
  constructor() {
@@ -102,16 +102,16 @@ var P = class {
102
102
  };
103
103
  createWs = (e, t, n) => {
104
104
  this.#t.has(e) && this.#t.delete(e);
105
- let r = new P(e, t, this.#e, n);
105
+ let r = new I(e, t, this.#e, n);
106
106
  this.#t.set(e, r);
107
107
  };
108
108
  getBrokerByUrl = (e, t) => {
109
109
  let n = this.#t.get(e);
110
- return n ? t && !n.isConnected() && !n.isConnecting() && n.connect() : (n = new P(e, t, this.#e), this.#t.set(e, n)), n;
110
+ return n ? t && !n.isConnected() && !n.isConnecting() && n.connect() : (n = new I(e, t, this.#e), this.#t.set(e, n)), n;
111
111
  };
112
112
  connectWsByUrl = (e) => {
113
113
  let t = this.#t.get(e);
114
- return t || (t = new P(e, !0, this.#e), this.#t.set(e, t)), t.connect(), t;
114
+ return t || (t = new I(e, !0, this.#e), this.#t.set(e, t)), t.connect(), t;
115
115
  };
116
116
  disconnectWsByUrl = (e) => {
117
117
  if (e) {
@@ -146,9 +146,9 @@ var P = class {
146
146
  }), e;
147
147
  };
148
148
  getSubject = () => this.#e;
149
- }, ae = () => (F ||= new ie(), F), oe = () => {
150
- ae().createWsFromParams(new URL(window.location.href).searchParams);
151
- }, se = async (e) => {
149
+ }, ie = () => (ne ||= new re(), ne), ae = () => {
150
+ ie().createWsFromParams(new URL(window.location.href).searchParams);
151
+ }, oe = async (e) => {
152
152
  try {
153
153
  let t = await fetch(e);
154
154
  if (!t.ok) throw Error(`Response status: ${t.status}`);
@@ -156,7 +156,7 @@ var P = class {
156
156
  } catch (e) {
157
157
  throw e;
158
158
  }
159
- }, ce, le = class {
159
+ }, se, ce = class {
160
160
  #e;
161
161
  constructor() {
162
162
  this.#e = new r();
@@ -167,7 +167,7 @@ var P = class {
167
167
  next(e) {
168
168
  this.#e.next(e);
169
169
  }
170
- }, ue = () => (ce ||= new le(), ce), de, fe = class {
170
+ }, le = () => (se ||= new ce(), se), ue, de = class {
171
171
  #e;
172
172
  constructor() {
173
173
  this.#e = new e({ inputDevice: "keyboard" });
@@ -179,7 +179,7 @@ var P = class {
179
179
  let t = this.#e.getValue();
180
180
  e.inputDevice && (t.inputDevice = e.inputDevice), this.#e.next(e);
181
181
  }
182
- }, I = () => (de ||= new fe(), de), L = /* @__PURE__ */ new Map(), pe = class {
182
+ }, L = () => (ue ||= new de(), ue), R = /* @__PURE__ */ new Map(), fe = class {
183
183
  #e;
184
184
  constructor() {
185
185
  this.#e = new e({
@@ -187,7 +187,8 @@ var P = class {
187
187
  selectedSet: [],
188
188
  arrays: ["content"],
189
189
  selectedArray: "content",
190
- minMaxValue: []
190
+ minMaxValue: [],
191
+ availableAxes: []
191
192
  });
192
193
  }
193
194
  getObservable() {
@@ -197,12 +198,12 @@ var P = class {
197
198
  return this.#e.getValue();
198
199
  }
199
200
  next(e) {
200
- this.#e.next(e);
201
+ this.#e.next(e), console.log("STATE: ", e);
201
202
  }
202
- }, R = (e) => {
203
+ }, z = (e) => {
203
204
  if (!e) throw Error("StateSubject id is undefined");
204
- return L.get(e) || L.set(e, new pe()), L.get(e);
205
- }, z, me = class {
205
+ return R.get(e) || R.set(e, new fe()), R.get(e);
206
+ }, pe, me = class {
206
207
  #e;
207
208
  constructor() {
208
209
  this.#e = new n();
@@ -263,7 +264,7 @@ var P = class {
263
264
  getObservable() {
264
265
  return this.#e.asObservable();
265
266
  }
266
- }, B = () => (z ||= new me(), z), he = class {
267
+ }, B = () => (pe ||= new me(), pe), he = class {
267
268
  #e;
268
269
  #t;
269
270
  #n;
@@ -371,10 +372,10 @@ function V(e, t = null) {
371
372
  x: 0,
372
373
  y: 0,
373
374
  z: 0
374
- }, l = new N((o.x - s.x * (r - 1)) / r, (o.y - s.y * (i - 1)) / i, (o.z - s.z * (a - 1)) / a), u = [], d = 1;
375
+ }, l = new F((o.x - s.x * (r - 1)) / r, (o.y - s.y * (i - 1)) / i, (o.z - s.z * (a - 1)) / a), u = [], d = 1;
375
376
  for (let e = 0; e < r; e++) for (let n = 0; n < i; n++) for (let r = 0; r < a; r++) u.push({
376
377
  id: `${t}${d++}`,
377
- position: new N(c.x + e * (l.x + s.x) + l.x / 2, c.y + n * (l.y + s.y) + l.y / 2, c.z - r * (l.z + s.z) - l.z / 2),
378
+ position: new F(c.x + e * (l.x + s.x) + l.x / 2, c.y + n * (l.y + s.y) + l.y / 2, c.z - r * (l.z + s.z) - l.z / 2),
378
379
  scale: l.clone()
379
380
  });
380
381
  return u;
@@ -385,7 +386,7 @@ function V(e, t = null) {
385
386
  let t = {};
386
387
  for (let n in e) {
387
388
  let r = e[n];
388
- r && typeof r == "object" && "x" in r && "y" in r && "z" in r && Object.keys(r).length === 3 ? t[n] = new N(r.x, r.y, r.z) : typeof r == "string" && r.startsWith("0x") ? t[n] = new h(parseInt(r)) : r && typeof r == "object" && !Array.isArray(r) ? t[n] = i(r) : t[n] = r;
389
+ r && typeof r == "object" && "x" in r && "y" in r && "z" in r && Object.keys(r).length === 3 ? t[n] = new F(r.x, r.y, r.z) : typeof r == "string" && r.startsWith("0x") ? t[n] = new h(parseInt(r)) : r && typeof r == "object" && !Array.isArray(r) ? t[n] = i(r) : t[n] = r;
389
390
  }
390
391
  return t;
391
392
  }
@@ -393,7 +394,7 @@ function V(e, t = null) {
393
394
  if (Array.isArray(e)) return o ? e : e.map((n) => a(n, t, e, !1));
394
395
  if (e && typeof e == "object") {
395
396
  if (t === "histogramPads") return r(e).map((e) => i(e));
396
- if ("x" in e && "y" in e && "z" in e && Object.keys(e).length === 3) return new N(e.x, e.y, e.z);
397
+ if ("x" in e && "y" in e && "z" in e && Object.keys(e).length === 3) return new F(e.x, e.y, e.z);
397
398
  let n = {};
398
399
  for (let t in e) {
399
400
  let r = t === "histogramPads";
@@ -407,11 +408,11 @@ function V(e, t = null) {
407
408
  return typeof e == "string" && e.startsWith("0x") ? new h(parseInt(e)) : e;
408
409
  }
409
410
  function o(e, t) {
410
- if (!e || Array.isArray(t) || !t || typeof t != "object" || t instanceof N || t instanceof h) return t;
411
+ if (!e || Array.isArray(t) || !t || typeof t != "object" || t instanceof F || t instanceof h) return t;
411
412
  let n = { ...e };
412
413
  for (let r in t) {
413
414
  let i = e[r], a = t[r];
414
- i && typeof i == "object" && !Array.isArray(i) && !(i instanceof N) && !(i instanceof h) && a && typeof a == "object" && !Array.isArray(a) && !(a instanceof N) && !(a instanceof h) ? n[r] = o(i, a) : n[r] = a;
415
+ i && typeof i == "object" && !Array.isArray(i) && !(i instanceof F) && !(i instanceof h) && a && typeof a == "object" && !Array.isArray(a) && !(a instanceof F) && !(a instanceof h) ? n[r] = o(i, a) : n[r] = a;
415
416
  }
416
417
  return n;
417
418
  }
@@ -429,9 +430,9 @@ function be(e, t) {
429
430
  ].every((n) => e[n]?.x === t[n]?.x && e[n]?.y === t[n]?.y && e[n]?.z === t[n]?.z);
430
431
  }
431
432
  function xe(e, t) {
432
- let n = new ne().load(ge);
433
+ let n = new P().load(ge);
433
434
  n.colorSpace = k;
434
- let r = new M(new ee({
435
+ let r = new M(new N({
435
436
  map: n,
436
437
  transparent: !0
437
438
  }));
@@ -649,7 +650,7 @@ var Se = class {
649
650
  mergeHistogramConfig(e, t = this.#e.value.config.histogram) {
650
651
  if (e == null) return t;
651
652
  if (typeof t != "object" || !t || typeof e != "object" || !e) return e;
652
- let n = (e) => Array.isArray(e) || e instanceof h || e instanceof N || e && e.isColor === !0 || e && e.isVector3 === !0;
653
+ let n = (e) => Array.isArray(e) || e instanceof h || e instanceof F || e && e.isColor === !0 || e && e.isVector3 === !0;
653
654
  if (n(t)) return n(e) ? e : t;
654
655
  let r = { ...t };
655
656
  for (let t in e) e.hasOwnProperty(t) && e[t] !== void 0 && (n(e[t]) || n(r[t]) ? r[t] = e[t] : typeof e[t] == "object" && e[t] !== null && typeof r[t] == "object" && r[t] !== null ? r[t] = this.mergeHistogramConfig(e[t], r[t]) : r[t] = e[t]);
@@ -673,7 +674,7 @@ var Se = class {
673
674
  #e;
674
675
  #t;
675
676
  constructor() {
676
- this.#e = document.createElement("a-entity"), this.#e.id = "cameraRig", this.#e.setAttribute("position", "0 1.6 0"), this.#e.innerHTML = "\n <a-camera id=\"camera\" wasd-controls-custom=\"acceleration: 10\" wasd-controls=\"acceleration: 50\">\n </a-camera>\n ", this.#t = document.createElement("a-entity"), this.#t.id = "oculus-controller", this.#t.setAttribute("oculus-controller", ""), I().getObservable().subscribe(this.handleStateChange.bind(this));
677
+ this.#e = document.createElement("a-entity"), this.#e.id = "cameraRig", this.#e.setAttribute("position", "0 1.6 0"), this.#e.innerHTML = "\n <a-camera id=\"camera\" wasd-controls-custom=\"acceleration: 10\" wasd-controls=\"acceleration: 50\">\n </a-camera>\n ", this.#t = document.createElement("a-entity"), this.#t.id = "oculus-controller", this.#t.setAttribute("oculus-controller", ""), L().getObservable().subscribe(this.handleStateChange.bind(this));
677
678
  }
678
679
  handleStateChange(e) {
679
680
  let t = document.getElementById("cameraRig");
@@ -698,14 +699,14 @@ var Se = class {
698
699
  }
699
700
  verticalMoveCamera = (e, t) => {
700
701
  if (this.#e === null && (this.#e = document.getElementById("cameraRig")), this.#e !== null) {
701
- let n = new N(), r = this.#e.object3D.position.clone();
702
- e ? (n.copy(r).add(new N(0, +t, 0)), this.#e.object3D.position.lerp(n, .5)) : this.#e.object3D.position.y > 1.6 && (n.copy(r).add(new N(0, -t, 0)), this.#e.object3D.position.lerp(n, .5));
702
+ let n = new F(), r = this.#e.object3D.position.clone();
703
+ e ? (n.copy(r).add(new F(0, +t, 0)), this.#e.object3D.position.lerp(n, .5)) : this.#e.object3D.position.y > 1.6 && (n.copy(r).add(new F(0, -t, 0)), this.#e.object3D.position.lerp(n, .5));
703
704
  }
704
705
  };
705
706
  horizontalMoveCameraLocal = (e, t, n) => {
706
707
  if (!this.#e || !this.#t) return;
707
- let r = new re(e, t), i = this.#t.object3D.rotation.y;
708
- r.rotateAround(new N(0, 0), -i), r.normalize(), r.multiplyScalar(n), this.#e.object3D.position.x += r.x, this.#e.object3D.position.z += r.y;
708
+ let r = new te(e, t), i = this.#t.object3D.rotation.y;
709
+ r.rotateAround(new F(0, 0), -i), r.normalize(), r.multiplyScalar(n), this.#e.object3D.position.x += r.x, this.#e.object3D.position.z += r.y;
709
710
  };
710
711
  getCamera() {
711
712
  return this.#t;
@@ -718,7 +719,7 @@ var Se = class {
718
719
  constructor() {
719
720
  this.#n = Le(), setTimeout(() => {
720
721
  this.setUpArrowListener(), this.setDownArrowListener();
721
- }, 100), this.setUpArrowListener = this.setUpArrowListener.bind(this), this.startUpClick = this.startUpClick.bind(this), this.endUpClick = this.endUpClick.bind(this), this.upClickFunction = this.upClickFunction.bind(this), this.setDownArrowListener = this.setDownArrowListener.bind(this), this.startDownClick = this.startDownClick.bind(this), this.endDownClick = this.endDownClick.bind(this), this.downClickFunction = this.downClickFunction.bind(this), this.initController(), I().getObservable().subscribe((e) => {
722
+ }, 100), this.setUpArrowListener = this.setUpArrowListener.bind(this), this.startUpClick = this.startUpClick.bind(this), this.endUpClick = this.endUpClick.bind(this), this.upClickFunction = this.upClickFunction.bind(this), this.setDownArrowListener = this.setDownArrowListener.bind(this), this.startDownClick = this.startDownClick.bind(this), this.endDownClick = this.endDownClick.bind(this), this.downClickFunction = this.downClickFunction.bind(this), this.initController(), L().getObservable().subscribe((e) => {
722
723
  if (e.inputDevice === "mobile") document.getElementById("container").appendChild(this.getController());
723
724
  else {
724
725
  let e = document.getElementById("container");
@@ -816,7 +817,7 @@ var Se = class {
816
817
  rendererElement;
817
818
  raycastOn;
818
819
  constructor(e, t) {
819
- this.singleClickTimer = null, this.dbClickTimeout = 190, this.raycastOn = !0, this.rendererElement = t, this.raycaster = new O(), this.mouse = new re(), this.sceneElement = e, this.checkInterval = 1, this.lastCheck = void 0, e.traverse((e) => {
820
+ this.singleClickTimer = null, this.dbClickTimeout = 190, this.raycastOn = !0, this.rendererElement = t, this.raycaster = new O(), this.mouse = new te(), this.sceneElement = e, this.checkInterval = 1, this.lastCheck = void 0, e.traverse((e) => {
820
821
  e.isCamera && (this.cameraElement = e);
821
822
  }), this.mousemoveEventHandle = this.mousemoveEventHandle.bind(this), this.clickEventHandle = this.clickEventHandle.bind(this), this.setupRaycasting(), this.configSub = W().getObservable().subscribe((e) => {
822
823
  this.dbClickTimeout = e.config.environment.dbClickTimeout ?? 190;
@@ -1122,14 +1123,15 @@ function rt(e) {
1122
1123
  [r]: e.fArrays[r].min ?? t(e.fArrays[r]?.values?.filter((e) => e !== 0))
1123
1124
  };
1124
1125
  });
1125
- let r = (i, a = 1) => {
1126
- n[a] || (n[a] = {}), Object.entries(i).forEach(([i, o]) => {
1127
- o.forEach((o) => {
1128
- if (!o) return;
1129
- let s = t(o.fArray.filter((e) => e !== 0));
1130
- (!(i in n[a]) || s < n[a][i]) && (n[a][i] = s), o.fArrays && Object.keys(o.fArrays).forEach((r) => {
1131
- (!(r in n[a]) || s > n[a][r]) && (n[a][r] = s), n[a][r] = Math.min(n[a][r], e.fArrays[r].min ?? t(o.fArrays[r]?.values?.filter((e) => e !== 0)));
1132
- }), o.children && r(o.children, a + 1);
1126
+ let r = (e, i = 1) => {
1127
+ n[i] || (n[i] = {}), Object.entries(e).forEach(([e, a]) => {
1128
+ a.forEach((a) => {
1129
+ if (!a) return;
1130
+ let o = t(a.fArray.filter((e) => e !== 0));
1131
+ (!(e in n[i]) || o < n[i][e]) && (n[i][e] = o), a.fArrays && Object.keys(a.fArrays).forEach((e) => {
1132
+ let r = a.fArrays[e].min;
1133
+ (!(e in n[i]) || r < n[i][e]) && (n[i][e] = r), n[i][e] = Math.min(n[i][e], a.fArrays[e].min ?? t(a.fArrays[e]?.values?.filter((e) => e !== 0)));
1134
+ }), a.children && r(a.children, i + 1);
1133
1135
  });
1134
1136
  });
1135
1137
  };
@@ -1160,12 +1162,12 @@ function at(e, t, n) {
1160
1162
  new h(e.min).toArray(n, t), new h(e.max).toArray(n, t + 3), r++;
1161
1163
  }), t.uniforms.colorPairs = { value: n }, t.uniformsNeedUpdate = !0;
1162
1164
  }
1163
- function ot(e, t, n, r, i, a) {
1164
- let o = ((e, t, n) => {
1165
- let r = (e - t) / (n - t);
1166
- return r > 1 && (r = 1), isNaN(r) || r === Infinity ? 0 : r;
1167
- })(t, n, r), s = 0;
1168
- return e.set[i] ? s = 1 + e.layer.length + i : e.layer[a] && (s = 1 + a), s + o;
1165
+ function ot(e, t, n, r, i, a, o) {
1166
+ let s = ((e, t, n) => {
1167
+ let r;
1168
+ return r = o === "log10" ? Math.log(1 + (e - t)) / Math.log(1 + (n - t)) : (e - t) / (n - t), r > 1 && (r = 1), isNaN(r) || r === Infinity ? 0 : r;
1169
+ })(t, n, r), c = 0;
1170
+ return e.set[i] ? c = 1 + e.layer.length + i : e.layer[a] && (c = 1 + a), c + s;
1169
1171
  }
1170
1172
  function st(e, t, n, r, i, a, o) {
1171
1173
  if (!(1 / e == -Infinity || e < 0)) return o[0] = t[e], o[1] = t[e + 1], o[2] = t[e + 2], o[3] = n[e], o[4] = n[e + 1], o[5] = n[e + 2], o;
@@ -1343,7 +1345,7 @@ var $ = class {
1343
1345
  let i = new _(new m(1, 1, 1));
1344
1346
  this.instGeom = new x(), this.instGeom.instanceCount = 0, this.instGeom.frustumCulled = !1, this.instGeom.index = i.index;
1345
1347
  for (let e in i.attributes) this.instGeom.setAttribute(e, i.attributes[e]);
1346
- this.material = this.createMaterial(), this.colorArray = new Float32Array(96), this.fillColorArray(), this.instancePositions = new Float32Array(3), this.instanceScales = new Float32Array(3), this.instanceColors = new Float32Array(1), this.instGeom.setAttribute("instancePosition", new b(this.instancePositions, 3)), this.instGeom.setAttribute("instanceScale", new b(this.instanceScales, 3)), this.instGeom.setAttribute("instanceColorIndex", new b(this.instanceColors, 1)), this.wireframe = new S(this.instGeom, this.material), this.wireframe.frustumCulled = !1, this.stateSub = R(this.id).getObservable().subscribe((e) => {
1348
+ this.material = this.createMaterial(), this.colorArray = new Float32Array(96), this.fillColorArray(), this.instancePositions = new Float32Array(3), this.instanceScales = new Float32Array(3), this.instanceColors = new Float32Array(1), this.instGeom.setAttribute("instancePosition", new b(this.instancePositions, 3)), this.instGeom.setAttribute("instanceScale", new b(this.instanceScales, 3)), this.instGeom.setAttribute("instanceColorIndex", new b(this.instanceColors, 1)), this.wireframe = new S(this.instGeom, this.material), this.wireframe.frustumCulled = !1, this.stateSub = z(this.id).getObservable().subscribe((e) => {
1347
1349
  this.numOfavailableSets = e.sets.length;
1348
1350
  });
1349
1351
  }
@@ -1462,7 +1464,7 @@ var $ = class {
1462
1464
  renderHistory = [];
1463
1465
  opts = void 0;
1464
1466
  constructor(e, t, n) {
1465
- this.rootObj = e.obj, this.id = t, this.opts = n, this.config = W().mergeHistogramConfig(this?.opts?.config), this.functionSub = B().getObservable().pipe(a((e) => e.target.entity === "nested-histogram" && (e.target.id.includes("*") || e.target.id.includes(this.id)))).subscribe((e) => this.functionSubjectHandler(e)), this.configSub = W().getObservable().pipe(a((e) => e.target.id.includes("*") || e.target.id.includes(this.id))).subscribe((e) => this.configSubjectHandler(e)), this.dispatchSub = ue().getObservable().pipe(a((e) => e.target.id === "*" || e.target.id === this.id)).subscribe((e) => this.dispatchSubjectHandler(e)), this.initDefaultFunctions();
1467
+ this.rootObj = e.obj, this.id = t, this.opts = n, this.config = W().mergeHistogramConfig(this?.opts?.config), this.functionSub = B().getObservable().pipe(a((e) => e.target.entity === "nested-histogram" && (e.target.id.includes("*") || e.target.id.includes(this.id)))).subscribe((e) => this.functionSubjectHandler(e)), this.configSub = W().getObservable().pipe(a((e) => e.target.id.includes("*") || e.target.id.includes(this.id))).subscribe((e) => this.configSubjectHandler(e)), this.dispatchSub = le().getObservable().pipe(a((e) => e.target.id === "*" || e.target.id === this.id)).subscribe((e) => this.dispatchSubjectHandler(e)), this.initDefaultFunctions();
1466
1468
  }
1467
1469
  remove() {
1468
1470
  this.functionSub.unsubscribe(), this.configSub.unsubscribe(), this.dispatchSub.unsubscribe(), window.removeEventListener("keydown", this.keyDownHandler), window.removeEventListener("keydown", this.keyUpHandler);
@@ -1563,13 +1565,13 @@ var $ = class {
1563
1565
  colorArray = void 0;
1564
1566
  constructor(e, t, n) {
1565
1567
  if (!e || !e.obj) throw console.error("THnPainter constructor: histo or histo.obj is undefined", e), Error("THnPainter: histo or histo.obj is undefined");
1566
- super(e, t, n), console.log("THnPainter constructor start: "), this.pointer = new $(this.rootObj), this.handleStateChange = this.handleStateChange.bind(this), this.stateSub = R(this.id).getObservable().subscribe(this.handleStateChange), this.init(!0), console.log("THnPainter constructor end, mesh: ", this.mesh, "meshParent: ", this?.mesh?.parent ?? "undefined");
1568
+ super(e, t, n), console.log("THnPainter constructor start: "), this.pointer = new $(this.rootObj), this.handleStateChange = this.handleStateChange.bind(this), this.stateSub = z(this.id).getObservable().subscribe(this.handleStateChange), this.init(!0), console.log("THnPainter constructor end, mesh: ", this.mesh, "meshParent: ", this?.mesh?.parent ?? "undefined");
1567
1569
  }
1568
1570
  async updateHistogram(e) {
1569
1571
  if (!e || !e.obj) throw console.error("THnPainter constructor: histo or histo.obj is undefined", e), Error("THnPainter: histo or histo.obj is undefined");
1570
1572
  console.log("THnPainter updateHistogram start => histo: ", e, ", mesh: ", this.mesh, "uuid: ", this.mesh.uuid, "mesh.parent: ", this?.mesh?.parent ?? "undefined");
1571
1573
  let t, n = this.mesh.parent;
1572
- if (console.log("THnPainter updateHistogram parent is defined, removing mesh: ", this.mesh, "uuid: ", this.mesh.uuid, "mesh.parent: ", this?.mesh?.parent ?? "undefined"), this.pointer.isHistogramFilled && (t = this.mesh.raycast, this.mesh.raycast = () => {}, this.wireframe.dispose(), this.instGeom.dispose()), this.matrixCache = [], this.BVHTree = [], this.availableSets = [], this.selectedSet = [], this.minMaxValue = [], R(this.id).next({
1574
+ if (console.log("THnPainter updateHistogram parent is defined, removing mesh: ", this.mesh, "uuid: ", this.mesh.uuid, "mesh.parent: ", this?.mesh?.parent ?? "undefined"), this.pointer.isHistogramFilled && (t = this.mesh.raycast, this.mesh.raycast = () => {}, this.wireframe.dispose(), this.instGeom.dispose()), this.matrixCache = [], this.BVHTree = [], this.availableSets = [], this.selectedSet = [], this.availableAxes = [], this.minMaxValue = [], z(this.id).next({
1573
1575
  sets: [],
1574
1576
  selectedSet: [],
1575
1577
  arrays: ["content"],
@@ -1583,7 +1585,7 @@ var $ = class {
1583
1585
  }
1584
1586
  init(e = !1) {
1585
1587
  if (this.maxInstancesPerLayer = it(this.pointer.origin), e) {
1586
- this.maxContentPerLayer = et(this.pointer.origin), this.minContentPerLayer = rt(this.pointer.origin), this.maxErrorPerLayer = tt(this.pointer.origin, this.maxContentPerLayer), this.minErrorPerLayer = nt(this.pointer.origin, this.minContentPerLayer), this.setAvailableSets(this.pointer.origin), this.setAvailableArrays(this.pointer.origin);
1588
+ this.maxContentPerLayer = et(this.pointer.origin), this.minContentPerLayer = rt(this.pointer.origin), this.maxErrorPerLayer = tt(this.pointer.origin, this.maxContentPerLayer), this.minErrorPerLayer = nt(this.pointer.origin, this.minContentPerLayer), this.setAvailableSets(this.pointer.origin), this.setAvailableArrays(this.pointer.origin), this.setAvailableAxes(this.pointer.origin);
1587
1589
  let e = Array(this.maxContentPerLayer.length);
1588
1590
  for (let t = 0; t < this.maxContentPerLayer.length; t++) e[t] = {}, Object.keys(this.maxContentPerLayer[t]).forEach((n) => {
1589
1591
  e[t][n] = {
@@ -1597,8 +1599,8 @@ var $ = class {
1597
1599
  }
1598
1600
  };
1599
1601
  });
1600
- console.log("minMaxValues: ", e), R(this.id).next({
1601
- ...R(this.id).getValue(),
1602
+ console.log("minMaxValues: ", e), z(this.id).next({
1603
+ ...z(this.id).getValue(),
1602
1604
  minMaxValue: e
1603
1605
  });
1604
1606
  }
@@ -1691,83 +1693,83 @@ var $ = class {
1691
1693
  o.fXaxis.fNbins,
1692
1694
  o.fYaxis.fNbins,
1693
1695
  o.fZaxis.fNbins
1694
- ]), u, d, f, p, m = o.fArrays?.[this.selectedArray]?.outside ?? !1, h = this.selectedSet.indexOf(c), g = this.availableSets.indexOf(c), _ = o.fArrays[Object.keys(o.fArrays)[0]].values, v = this.config.scale.scaleBy === "value";
1696
+ ]), u, d, f, p, m = o.fArrays?.[this.selectedArray]?.outside ?? !1, h = this.selectedSet.indexOf(c), g = this.availableSets.indexOf(c), _ = o.fArrays ? o.fArrays[Object.keys(o.fArrays)[0]].values : !1, v = this.availableAxes[a], y = this.config.scale.scaleBy === "value";
1695
1697
  if (c) if (this.config.scale.sets === "fixed") ({min: u, max: d} = this.minMaxValue[a + this.pointer.parentPath.length][c].value), {min: p, max: f} = this.minMaxValue[a + this.pointer.parentPath.length][c].error;
1696
1698
  else if (this.config.scale.sets === "relative") {
1697
- let e = o.fSumw2.filter((e) => e !== 0), t = v ? o.fArray.filter((e) => e !== 0) : e;
1699
+ let e = o.fSumw2.filter((e) => e !== 0), t = y ? o.fArray.filter((e) => e !== 0) : e;
1698
1700
  u = Math.min(...t), d = Math.max(...t), f = this.maxErrorPerLayer[a + this.pointer.parentPath.length][c], p = this.minErrorPerLayer[a + this.pointer.parentPath.length][c];
1699
- } else u = v ? this.minContentPerLayer[a + this.pointer.parentPath.length][c] : -.1, d = v ? this.maxContentPerLayer[a + this.pointer.parentPath.length][c] : this.maxErrorPerLayer[a + this.pointer.parentPath.length][c], f = this.maxErrorPerLayer[a + this.pointer.parentPath.length][c], p = this.minErrorPerLayer[a + this.pointer.parentPath.length][c];
1701
+ } else u = y ? this.minContentPerLayer[a + this.pointer.parentPath.length][c] : -.1, d = y ? this.maxContentPerLayer[a + this.pointer.parentPath.length][c] : this.maxErrorPerLayer[a + this.pointer.parentPath.length][c], f = this.maxErrorPerLayer[a + this.pointer.parentPath.length][c], p = this.minErrorPerLayer[a + this.pointer.parentPath.length][c];
1700
1702
  else if (this.selectedArray !== "content" && o.fArrays && _) if (this.config.scale.parameter === "fixed") ({min: u, max: d} = this.minMaxValue[a + this.pointer.parentPath.length][this.selectedArray].value), {min: p, max: f} = this.minMaxValue[a + this.pointer.parentPath.length][this.selectedArray].error;
1701
1703
  else if (this.config.scale.parameter === "relative") {
1702
- let e = o.fArrays[this.selectedArray].errors.filter((e) => e !== 0), t = v ? o.fArrays[this.selectedArray].values.filter((e) => e !== 0) : e;
1704
+ let e = o.fArrays[this.selectedArray].errors.filter((e) => e !== 0), t = y ? o.fArrays[this.selectedArray].values.filter((e) => e !== 0) : e;
1703
1705
  u = Math.min(...t), d = Math.max(...t), f = this.maxErrorPerLayer[a + this.pointer.parentPath.length][this.selectedArray], p = this.minErrorPerLayer[a + this.pointer.parentPath.length][this.selectedArray];
1704
- } else u = v ? this.minContentPerLayer[0][this.selectedArray] : -.1, d = v ? this.maxContentPerLayer[0][this.selectedArray] : this.maxErrorPerLayer[0][this.selectedArray], f = this.maxErrorPerLayer[0][this.selectedArray], p = this.minErrorPerLayer[0][this.selectedArray];
1706
+ } else u = y ? this.minContentPerLayer[0][this.selectedArray] : -.1, d = y ? this.maxContentPerLayer[0][this.selectedArray] : this.maxErrorPerLayer[0][this.selectedArray], f = this.maxErrorPerLayer[0][this.selectedArray], p = this.minErrorPerLayer[0][this.selectedArray];
1705
1707
  else {
1706
1708
  let e = this.pointer.isOnSet ?? "content";
1707
1709
  if (this.config.scale.content === "fixed") ({min: u, max: d} = this.minMaxValue[a + this.pointer.parentPath.length][e].value), {min: p, max: f} = this.minMaxValue[a + this.pointer.parentPath.length][e].error;
1708
1710
  else if (this.config.scale.content === "relative") {
1709
- let t = o.fSumw2.filter((e) => e !== 0), n = v ? o.fArray.filter((e) => e !== 0) : t;
1711
+ let t = o.fSumw2.filter((e) => e !== 0), n = y ? o.fArray.filter((e) => e !== 0) : t;
1710
1712
  u = Math.min(...n), d = Math.max(...n), f = this.maxErrorPerLayer[a + this.pointer.parentPath.length][e], p = this.minErrorPerLayer[a + this.pointer.parentPath.length][e];
1711
- } else u = v ? this.minContentPerLayer[a + this.pointer.parentPath.length][e] : -.1, d = v ? this.maxContentPerLayer[a + this.pointer.parentPath.length][e] : this.maxErrorPerLayer[a + this.pointer.parentPath.length][e], f = this.maxErrorPerLayer[a + this.pointer.parentPath.length][e], p = this.minErrorPerLayer[a + this.pointer.parentPath.length][e];
1713
+ } else u = y ? this.minContentPerLayer[a + this.pointer.parentPath.length][e] : -.1, d = y ? this.maxContentPerLayer[a + this.pointer.parentPath.length][e] : this.maxErrorPerLayer[a + this.pointer.parentPath.length][e], f = this.maxErrorPerLayer[a + this.pointer.parentPath.length][e], p = this.minErrorPerLayer[a + this.pointer.parentPath.length][e];
1712
1714
  }
1713
1715
  u === d && (u = d - .2);
1714
- let y = o._typename.substring(0, 3) === "TH3", b = o._typename.substring(0, 3) === "TH2", x = o._typename.substring(0, 3) === "TH1", S = this.maxInstancesPerLayer.slice(a + 1).reduce((e, t) => e * t, 1);
1715
- l.setFromNumber(e / S);
1716
- let C = this.config.padding.layer[a] ?? this.config.padding.default, w = !this.config.padding.layer[a] && x ? {
1717
- x: C.x,
1718
- y: C.y,
1719
- z: C.z
1720
- } : { ...C };
1721
- c && this.config.padding.sets && x && (w = {
1716
+ let b = o._typename.substring(0, 3) === "TH3", x = o._typename.substring(0, 3) === "TH2", S = o._typename.substring(0, 3) === "TH1", C = this.maxInstancesPerLayer.slice(a + 1).reduce((e, t) => e * t, 1);
1717
+ l.setFromNumber(e / C);
1718
+ let w = this.config.padding.layer[a] ?? this.config.padding.default, T = !this.config.padding.layer[a] && S ? {
1719
+ x: w.x,
1720
+ y: w.y,
1721
+ z: w.z
1722
+ } : { ...w };
1723
+ c && this.config.padding.sets && S && (T = {
1722
1724
  x: this.config.padding.sets.x,
1723
1725
  y: 0,
1724
1726
  z: 0
1725
- }), this.pointer.isOnSet && (w = {
1727
+ }), this.pointer.isOnSet && (T = {
1726
1728
  x: 0,
1727
1729
  y: 0,
1728
1730
  z: 0
1729
1731
  });
1730
- let { min: T, max: E } = this.config.scale?.layer?.[a] ? this.config.scale?.layer[a] : this.config.scale.default;
1731
- for (let v = e; v < t; v += S) {
1732
+ let { min: E, max: D } = this.config.scale?.layer?.[a] ? this.config.scale?.layer[a] : this.config.scale.default;
1733
+ for (let y = e; y < t; y += C) {
1732
1734
  let e = {
1733
1735
  x: l.getValueAt(0),
1734
1736
  y: l.getValueAt(1),
1735
1737
  z: l.getValueAt(2)
1736
- }, x = Ye(s.position.z, s.scale.z, qe(Je(o, e, w, s?.scale, s?.position, a, r))), C = this.getBinContent(o, e.x, e.y, e.z, _ ? this.selectedArray : "content"), D = this.getBinError(o, e.x, e.y, e.z, _ ? this.selectedArray : "content"), O = this.config.scale.scaleBy === "value" ? C : D, k = this.config.scale.scaleBy === "value" ? u : p, A = this.config.scale.scaleBy === "value" ? d : f;
1737
- k === A && (k -= k * .1);
1738
- let j = 1;
1739
- if (O >= k == !m) {
1740
- let e = (O - k) / (A - k);
1741
- if (!m) j = Number.isInteger(O) && O === 0 && this.config.scale.scaleBy === "value" ? j = 0 : (E - T) * e + T, j > 1 && (j = 1);
1738
+ }, S = Ye(s.position.z, s.scale.z, qe(Je(o, e, T, s?.scale, s?.position, a, r))), w = this.config.scale.scaleBy === "value" ? u : p, O = this.config.scale.scaleBy === "value" ? d : f;
1739
+ w === O && (w -= w * .1);
1740
+ let k = _ || this.selectedArray === "content" ? this.getBinContent(o, e.x, e.y, e.z, this.selectedArray) : O, A = _ || this.selectedArray === "content" ? this.getBinError(o, e.x, e.y, e.z, this.selectedArray) : 0, j = this.config.scale.scaleBy === "value" ? k : A, M = 1;
1741
+ if (j >= w == !m) {
1742
+ let e = v[0].scaleType === "log10" ? Math.log(1 + (j - w)) / Math.log(1 + (O - w)) : (j - w) / (O - w);
1743
+ if (!m) M = Number.isInteger(j) && j === 0 && this.config.scale.scaleBy === "value" ? M = 0 : (D - E) * e + E, M > 1 && (M = 1);
1742
1744
  else {
1743
- let e = (C - void 0) / (void 0 - void 0);
1744
- j = Number.isInteger(C) && C === 0 ? j = 0 : (E - T) * e + T;
1745
+ let e = (k - void 0) / (void 0 - void 0);
1746
+ M = Number.isInteger(k) && k === 0 ? M = 0 : (D - E) * e + E;
1745
1747
  }
1746
- } else j = 0;
1747
- this.config.color.scaleBy === "value" ? this.color = ot(this.config.color, O, k, A, g, a) : this.color = ot(this.config.color, D, p, f, g, a);
1748
- let M = x.y.size * j;
1749
- if (j === 0) x.x.size = 0, x.z.size = 0, x.y.size = 0;
1750
- else if (y) x.x.size *= j, x.z.size *= j, x.y.size = M;
1751
- else if (b) x.y.pos -= (x.y.size - M) / 2, x.y.size = M;
1752
- else if (x.y.pos -= (x.y.size - M) / 2, x.y.size = M, c) {
1748
+ } else M = 0;
1749
+ this.config.color.scaleBy === "value" ? this.color = ot(this.config.color, j, w, O, g, a, v[0].errorType) : this.color = ot(this.config.color, A, p, f, g, a, v[0].errorType);
1750
+ let N = S.y.size * M;
1751
+ if (M === 0) S.x.size = 0, S.z.size = 0, S.y.size = 0;
1752
+ else if (b) S.x.size *= M, S.z.size *= M, S.y.size = N;
1753
+ else if (x) S.y.pos -= (S.y.size - N) / 2, S.y.size = N;
1754
+ else if (S.y.pos -= (S.y.size - N) / 2, S.y.size = N, c) {
1753
1755
  let e = this.config.TH1ZScale.set;
1754
- x.z.size = e || .01;
1755
- } else this.config.TH1ZScale?.layer?.[a] ? x.z.size = s.scale.z * this.config.TH1ZScale.layer[a] : x.z.size = s.scale.z * this.config.TH1ZScale.default;
1756
- if (c) x.z.size = .01, x.z.pos += (h - (this.selectedSet.length - 1) / 2) * .1, this.setMatrixCacheAt(a, g, v / S, x, a === n && j !== 0 ? this.color : -1);
1756
+ S.z.size = e || .01;
1757
+ } else this.config.TH1ZScale?.layer?.[a] ? S.z.size = s.scale.z * this.config.TH1ZScale.layer[a] : S.z.size = s.scale.z * this.config.TH1ZScale.default;
1758
+ if (c) S.z.size = .01, S.z.pos += (h - (this.selectedSet.length - 1) / 2) * .1, this.setMatrixCacheAt(a, g, y / C, S, a === n && M !== 0 ? this.color : -1);
1757
1759
  else {
1758
1760
  let e = null;
1759
- this.pointer.isOnSet && (x.z.size = .01, x.z.pos += (h - (this.selectedSet.length - 1) / 2) * .1, e = this.availableSets.indexOf(this.pointer.isOnSet)), this.setMatrixCacheAt(a, e, v / S, x, a === n && j !== 0 ? this.color : -1);
1761
+ this.pointer.isOnSet && (S.z.size = .01, S.z.pos += (h - (this.selectedSet.length - 1) / 2) * .1, e = this.availableSets.indexOf(this.pointer.isOnSet)), this.setMatrixCacheAt(a, e, y / C, S, a === n && M !== 0 ? this.color : -1);
1760
1762
  }
1761
1763
  if (a === n) {
1762
- let e = v;
1764
+ let e = y;
1763
1765
  c && (e += this.totalInstances * h);
1764
1766
  } else {
1765
1767
  let n = o.getBin(e.x + 1, e.y + 1, e.z + 1), r, s = {
1766
- position: new N(x.x.pos, x.y.pos, x.z.pos),
1767
- scale: new N(x.x.size, x.y.size, x.z.size)
1768
+ position: new F(S.x.pos, S.y.pos, S.z.pos),
1769
+ scale: new F(S.x.size, S.y.size, S.z.size)
1768
1770
  };
1769
- o.children.content ? (r = o.children.content[n], i(v, t, a + 1, r, s)) : this.selectedSet.forEach((e) => {
1770
- r = o.children[e][n], i(v, t, a + 1, r, s, e);
1771
+ o.children.content ? (r = o.children.content[n], i(y, t, a + 1, r, s)) : this.selectedSet.forEach((e) => {
1772
+ r = o.children[e][n], i(y, t, a + 1, r, s, e);
1771
1773
  });
1772
1774
  }
1773
1775
  if (!l.increment()) break;
@@ -1919,7 +1921,7 @@ var $ = class {
1919
1921
  this.selectedArray = e.selectedArray, this.selectedSet = e.selectedSet;
1920
1922
  let t = this.mesh.parent;
1921
1923
  this.instGeom.dispose(), t.remove(this.mesh), this.setupInsBufGeom(), t.add(this.mesh), this.renderHistogramHistory();
1922
- } else this.minMaxValue.length !== 0 && Ze(e.minMaxValue, this.minMaxValue) ? this.renderHistogramHistory() : (this.availableSets = e.sets, this.selectedSet = e.selectedSet, this.minMaxValue = e.minMaxValue);
1924
+ } else this.minMaxValue.length !== 0 && Ze(e.minMaxValue, this.minMaxValue) ? this.renderHistogramHistory() : (this.availableSets = e.sets, this.selectedSet = e.selectedSet, this.minMaxValue = e.minMaxValue, this.availableAxes = e.availableAxes);
1923
1925
  }
1924
1926
  async renderHistogramHistory() {
1925
1927
  let e = this.renderHistory;
@@ -1973,26 +1975,54 @@ var $ = class {
1973
1975
  e > r && (i /= n[e - r], a /= n[e - r]);
1974
1976
  }
1975
1977
  }
1978
+ setAvailableAxes(e) {
1979
+ let t = z(this.id).getValue(), n = [], r = [
1980
+ "x",
1981
+ "y",
1982
+ "z"
1983
+ ], i = (e) => {
1984
+ let t = [];
1985
+ t.push({
1986
+ scaleType: "linear",
1987
+ errorType: "linear"
1988
+ });
1989
+ let a = Number.parseInt(e._typename.substring(2, 3), 10);
1990
+ for (let n = 0; n < a; n++) {
1991
+ let i = r[n], a = e[`f${i.toUpperCase()}axis`];
1992
+ t.push({
1993
+ axis: i,
1994
+ fTitle: a.fTitle,
1995
+ fName: a.fName,
1996
+ scaleType: "linear",
1997
+ errorType: "linear",
1998
+ fXmax: a.fXmax,
1999
+ fXmin: a.fXmin
2000
+ });
2001
+ }
2002
+ n.push(t), e.children && i(e.children[Object.keys(e.children)[0]].find((e) => e !== null));
2003
+ };
2004
+ i(e), t.availableAxes = n, z(this.id).next(t);
2005
+ }
1976
2006
  setAvailableSets(e) {
1977
2007
  if (e.children?.content) {
1978
2008
  let t = e.children.content.find((e) => e);
1979
2009
  this.setAvailableSets(t);
1980
2010
  } else if (e?.children) {
1981
- let t = R(this.id).getValue();
1982
- t.sets = Object.keys(e.children), t.selectedSet.length === 0 ? (this.selectedSet.push(t.sets[0]), t.selectedSet.push(t.sets[0])) : this.selectedSet.every((e) => t.sets.find((t) => t === e)) || (t.selectedSet = [t.sets[0]]), R(this.id).next(t);
2011
+ let t = z(this.id).getValue();
2012
+ t.sets = Object.keys(e.children), t.selectedSet.length === 0 ? (this.selectedSet.push(t.sets[0]), t.selectedSet.push(t.sets[0])) : this.selectedSet.every((e) => t.sets.find((t) => t === e)) || (t.selectedSet = [t.sets[0]]), z(this.id).next(t);
1983
2013
  } else {
1984
- let e = R(this.id).getValue();
2014
+ let e = z(this.id).getValue();
1985
2015
  e.sets = [], e.selectedSet = [];
1986
2016
  }
1987
2017
  }
1988
2018
  setAvailableArrays(e) {
1989
- let t = R(this.id).getValue();
2019
+ let t = z(this.id).getValue();
1990
2020
  t.arrays = [], e.fArrays && (t.arrays = Object.keys(e.fArrays)), t.arrays.unshift("content");
1991
2021
  let n = (e) => {
1992
2022
  let r = e.find((e) => e);
1993
2023
  r.fArrays && (t.arrays = t.arrays.concat(Object.keys(r.fArrays))), r.children?.content && n(r.children.content);
1994
2024
  };
1995
- e.children?.content && n(e.children.content), t.arrays = [...new Set(t.arrays)], R(this.id).next(t);
2025
+ e.children?.content && n(e.children.content), t.arrays = [...new Set(t.arrays)], z(this.id).next(t);
1996
2026
  }
1997
2027
  configSubjectHandler(e) {
1998
2028
  this.config = W().mergeHistogramConfig(this?.opts?.config), this.keyBindings = ve(e.config.bindings);
@@ -2028,13 +2058,13 @@ var $ = class {
2028
2058
  return i === "content" || !e.fArrays ? e.fSumw2.length === 0 ? e.getBinError(a) : e.fSumw2[a] : e.fArrays?.[i].errors[a];
2029
2059
  }
2030
2060
  checkIntersectionBVH(e) {
2031
- let t = new N(), n = (e, t, n, r) => {
2061
+ let t = new F(), n = (e, t, n, r) => {
2032
2062
  if (t < 0 || 1 / t == -Infinity) {
2033
2063
  let n = t * -1, i = r && r !== "content" ? this.matrixCache[e]?.[this.availableSets.indexOf(r)] : this.matrixCache[e];
2034
- return i ? new p().setFromCenterAndSize(new N(i.pos[n * 3], i.pos[n * 3 + 1], i.pos[n * 3 + 2]), new N(i.scale[n * 3], i.scale[n * 3 + 1], i.scale[n * 3 + 2])) : void 0;
2064
+ return i ? new p().setFromCenterAndSize(new F(i.pos[n * 3], i.pos[n * 3 + 1], i.pos[n * 3 + 2]), new F(i.scale[n * 3], i.scale[n * 3 + 1], i.scale[n * 3 + 2])) : void 0;
2035
2065
  } else {
2036
2066
  let i = r && r !== "content" ? Array.isArray(this.BVHTree[e][this.availableSets.indexOf(r)]) ? this.BVHTree[e][this.availableSets.indexOf(r)][n] : this.BVHTree[e][this.availableSets.indexOf(r)] : this.BVHTree[e][n];
2037
- return i ? new p().setFromCenterAndSize(new N(i.pos[t * 3], i.pos[t * 3 + 1], i.pos[t * 3 + 2]), new N(i.scale[t * 3], i.scale[t * 3 + 1], i.scale[t * 3 + 2])) : void 0;
2067
+ return i ? new p().setFromCenterAndSize(new F(i.pos[t * 3], i.pos[t * 3 + 1], i.pos[t * 3 + 2]), new F(i.scale[t * 3], i.scale[t * 3 + 1], i.scale[t * 3 + 2])) : void 0;
2038
2068
  }
2039
2069
  }, r = (e, t) => {
2040
2070
  let n = 0, r = e, i = t;
@@ -2084,7 +2114,7 @@ var $ = class {
2084
2114
  distance: null
2085
2115
  }), r;
2086
2116
  }, o = (e, t, n = 0, i = [], s = null) => {
2087
- let c = [], l = this.maxInstancesPerLayer[t + 1], u = this.maxInstancesPerLayer[t] * this.maxInstancesPerLayer[t + 1], d = e.fArrays[Object.keys(e.fArrays)[0]].values;
2117
+ let c = [], l = this.maxInstancesPerLayer[t + 1], u = this.maxInstancesPerLayer[t] * this.maxInstancesPerLayer[t + 1], d = e.fArrays ? e.fArrays[Object.keys(e.fArrays)[0]].values : !1;
2088
2118
  return a(t, n, s).forEach((a) => {
2089
2119
  let f = Math.abs(a.index) - n * this.maxInstancesPerLayer[t], p = f % e.fXaxis.fNbins, m = Math.floor(f % (e.fXaxis.fNbins * e.fYaxis.fNbins) / e.fXaxis.fNbins), h = Math.floor(f / (e.fXaxis.fNbins * e.fYaxis.fNbins)), g = [...i, {
2090
2120
  x: p,
@@ -2201,12 +2231,12 @@ var $ = class {
2201
2231
  console.warn("updateTexture called with null/undefined");
2202
2232
  return;
2203
2233
  }
2204
- let t = new ne();
2234
+ let t = new P();
2205
2235
  if (typeof e == "string" && (e.startsWith("data:") || e.startsWith("http"))) t.load(e, (e) => {
2206
2236
  this.plane.material.map = e, this.plane.material.needsUpdate = !0;
2207
2237
  }, void 0, (e) => console.error("Texture load failed", e));
2208
2238
  else if (e instanceof HTMLImageElement) {
2209
- let t = new te(e);
2239
+ let t = new ee(e);
2210
2240
  t.needsUpdate = !0, this.plane.material.map = t, this.plane.material.needsUpdate = !0;
2211
2241
  } else console.error("Unsupported image type passed to updateTexture:", e);
2212
2242
  }
@@ -2371,12 +2401,12 @@ var vt = class {
2371
2401
  console.error("Error creating text line:", e);
2372
2402
  }
2373
2403
  }
2374
- let m = new N(e.point.x, e.point.y, e.point.z);
2404
+ let m = new F(e.point.x, e.point.y, e.point.z);
2375
2405
  this.camera.worldToLocal(m);
2376
- let h = new N().subVectors(m, this.camera.position).normalize(), g = new N().copy(this.camera.position).addScaledVector(h, .1), _ = new p().setFromObject(this.group), v = new N();
2406
+ let h = new F().subVectors(m, this.camera.position).normalize(), g = new F().copy(this.camera.position).addScaledVector(h, .1), _ = new p().setFromObject(this.group), v = new F();
2377
2407
  _.getSize(v);
2378
2408
  let y = v.clone().multiplyScalar(.5);
2379
- g.add(new N(y.x, y.y, 0)), this.group.position.copy(g), this.camera.add(this.group);
2409
+ g.add(new F(y.x, y.y, 0)), this.group.position.copy(g), this.camera.add(this.group);
2380
2410
  }
2381
2411
  getGroup() {
2382
2412
  return this.group;
@@ -2461,7 +2491,7 @@ var vt = class {
2461
2491
  }
2462
2492
  renderWithBuild3d() {
2463
2493
  return c(this.rootObj).then((e) => {
2464
- let t = this.config.environment.histogramPads.find((e) => e.id === this.id)?.scale, n = new p().setFromObject(e), r = new N();
2494
+ let t = this.config.environment.histogramPads.find((e) => e.id === this.id)?.scale, n = new p().setFromObject(e), r = new F();
2465
2495
  n.getSize(r), e.scale.set(t.x / r.x, t.z / r.y, t.y / r.z), e.rotateX(-Math.PI / 2), e.translateZ(-(t.y / 2)), this.histogramGroup.add(e);
2466
2496
  let i = this.getInstancedMesh();
2467
2497
  i && (this.defaultRaycastHandler = i.raycast.bind(i), i.raycast = this.raycastHandler.bind(this));
@@ -2580,4 +2610,4 @@ var vt = class {
2580
2610
  }
2581
2611
  };
2582
2612
  //#endregion
2583
- export { pt as CanvasClass, yt as HistogramJsrootClass, $ as HistogramPointerClass, Ve as MobileController, Ue as NdmvrRaycaster, ft as THnPainter, G as binInfoSubjectGet, ae as brokerManagerGet, H as canvasSubjectGet, W as configSubjectGet, ue as dispatchSubjectGet, He as fetchTFile, B as functionSubjectGet, Pe as getCameraComponent, Te as histogramSubjectGet, se as httpRequest, oe as initNdmvrAframe, I as inputDeviceSubjectGet, R as stateSubjectGet };
2613
+ export { pt as CanvasClass, yt as HistogramJsrootClass, $ as HistogramPointerClass, Ve as MobileController, Ue as NdmvrRaycaster, ft as THnPainter, G as binInfoSubjectGet, ie as brokerManagerGet, H as canvasSubjectGet, W as configSubjectGet, le as dispatchSubjectGet, He as fetchTFile, B as functionSubjectGet, Pe as getCameraComponent, Te as histogramSubjectGet, oe as httpRequest, ae as initNdmvrAframe, L as inputDeviceSubjectGet, z as stateSubjectGet };