@vitessce/comparative 4.0.5 → 4.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ import { jsxs as g, jsx as n } from "react/jsx-runtime";
2
+ import { useRef as r, useEffect as Se, useState as B } from "react";
3
+ import { useThree as xe, useFrame as be } from "@react-three/fiber";
4
+ import { Bvh as Fe } from "@react-three/drei";
5
+ import { Matrix4 as ye, Vector3 as P, Box3 as N, FrontSide as se } from "three";
6
+ import { g as Le, i as we, M as W, s as ce } from "./index-NQBX1k0A.js";
7
+ function Be(a, d) {
8
+ return a.get(d);
9
+ }
10
+ function V(a, d, S, f) {
11
+ if (!a?.inputSource?.hand)
12
+ return null;
13
+ const F = Be(a.inputSource.hand, d);
14
+ if (!F)
15
+ return null;
16
+ const i = S.getJointPose?.(F, f);
17
+ return i ? new P(i.transform.position.x, i.transform.position.y, i.transform.position.z) : null;
18
+ }
19
+ function U(a, d, S, f = 0.02) {
20
+ const F = V(a, "thumb-tip", d, S), i = V(a, "index-finger-tip", d, S);
21
+ return !F || !i ? !1 : F.distanceTo(i) < f;
22
+ }
23
+ function De(a) {
24
+ const { useXR: d, useXRInputSourceState: S } = Le(), { segmentationGroup: f, segmentationSettings: F, segmentationSceneScale: i, renderingSettings: t, materialRef: v, highlightEntity: ae, setObsHighlight: E } = a, D = r(null), le = r(null), o = r(null), p = r(null);
25
+ r(new ye());
26
+ const I = r(null), x = r(null), O = r(0), h = r(/* @__PURE__ */ new Map()), y = d((e) => e.session) != null;
27
+ Se(() => {
28
+ v?.current?.material?.uniforms?.u_physical_Pixel && (v.current.material.uniforms.u_physical_Pixel.value = y ? 0.2 : 2.5);
29
+ }, [y, v]);
30
+ const { scene: k, gl: ue } = xe(), X = S("hand", "right"), J = S("hand", "left"), [A, q] = B(!1), [Q, Y] = B(!1), [de, Z] = B(!1), [K, C] = B({
31
+ startPoint: new P(),
32
+ midPoint: new P(),
33
+ endPoint: new P(),
34
+ setStartPoint: !1,
35
+ setEndPoint: !1
36
+ }), [G, fe] = B([]), [$, _] = B(0), ee = r(A);
37
+ ee.current = A;
38
+ const te = r(Q);
39
+ te.current = Q;
40
+ const ne = r(K);
41
+ ne.current = K;
42
+ const pe = r(G);
43
+ pe.current = G;
44
+ const re = r($);
45
+ re.current = $, be((e, L, s) => {
46
+ if (!y || !s)
47
+ return;
48
+ const c = ue.xr.getReferenceSpace();
49
+ if (!c)
50
+ return;
51
+ const b = k.getObjectByName("rightTipBbox"), R = k.getObjectByName("leftTipBbox");
52
+ if (!b || !R)
53
+ return;
54
+ const z = new N().setFromObject(R), j = new N().setFromObject(b);
55
+ let H = !1;
56
+ _((u) => u - 1), z.intersectsBox(j) && z.max.x !== -j.min.x && (q(!0), Z(!0), C({
57
+ startPoint: new P(),
58
+ midPoint: new P(),
59
+ endPoint: new P(),
60
+ setStartPoint: !1,
61
+ setEndPoint: !1
62
+ }));
63
+ const Pe = ee.current, l = ne.current;
64
+ if (Pe) {
65
+ let u = V(J, "index-finger-tip", s, c), M = V(X, "index-finger-tip", s, c);
66
+ if (!u || !M)
67
+ return;
68
+ o.current && (u = u.applyMatrix4(o.current.matrixWorld.clone().invert()), M = M.applyMatrix4(o.current.matrixWorld.clone().invert()));
69
+ let T = u.clone(), w = M.clone();
70
+ l.setStartPoint && (T = l.startPoint), l.setEndPoint && (w = l.endPoint), C({
71
+ startPoint: T,
72
+ midPoint: new P().addVectors(T, w).multiplyScalar(0.5),
73
+ endPoint: w,
74
+ setStartPoint: l.setStartPoint,
75
+ setEndPoint: l.setEndPoint
76
+ }), U(X, s, c) && C((m) => ({
77
+ ...m,
78
+ setEndPoint: !0
79
+ })), U(J, s, c) && C((m) => ({
80
+ ...m,
81
+ setStartPoint: !0
82
+ })), l.setStartPoint && l.setEndPoint && (fe((m) => [...m, l]), Z(!1), q(!1), _(8));
83
+ } else if (re.current <= 0 && D.current && y) {
84
+ const u = D.current;
85
+ u.children[0].children.forEach((M, T) => {
86
+ const w = u.children[0].children[T], m = new N().setFromObject(w), ie = z.intersectsBox(m), oe = j.intersectsBox(m);
87
+ (ie || oe) && (H = !0, E(w.name), Y(!0), ie && U(J, s, c) && (_(10), H = !1), oe && U(X, s, c) && (_(10), H = !1));
88
+ }), !H && te.current && (E(null), Y(!1));
89
+ }
90
+ });
91
+ const he = (e) => {
92
+ if (y) {
93
+ if (e.stopPropagation(), e.target.setPointerCapture(e.pointerId), p.current === null)
94
+ p.current = e.pointerId, h.current.set(e.pointerId, e.point.clone()), o.current && (I.current = o.current.scale.clone());
95
+ else if (x.current === null && e.pointerId !== p.current) {
96
+ x.current = e.pointerId, h.current.set(e.pointerId, e.point.clone());
97
+ const L = h.current.get(p.current), s = e.point;
98
+ L && (O.current = L.distanceTo(s)), o.current && (I.current = o.current.scale.clone());
99
+ }
100
+ }
101
+ }, me = (e) => {
102
+ e.target.releasePointerCapture(e.pointerId), h.current.delete(e.pointerId), p.current === e.pointerId && (p.current = null, I.current = null), x.current === e.pointerId && (x.current = null, O.current = 0);
103
+ }, ge = (e) => {
104
+ if (!o.current || !e.point)
105
+ return;
106
+ const L = p.current === e.pointerId, s = x.current === e.pointerId;
107
+ if (!L && !s)
108
+ return;
109
+ const c = h.current.get(e.pointerId);
110
+ if (h.current.set(e.pointerId, e.point.clone()), x.current !== null && O.current > 0 && I.current) {
111
+ const b = h.current.get(p.current), R = h.current.get(x.current);
112
+ if (b && R) {
113
+ const j = b.distanceTo(R) / O.current;
114
+ o.current.scale.copy(I.current).multiplyScalar(j);
115
+ }
116
+ } else if (L && c) {
117
+ const b = e.point.clone().sub(c);
118
+ o.current.position.add(b);
119
+ }
120
+ };
121
+ return y ? g("group", { children: [g("group", { ref: o, onPointerDown: he, onPointerUp: me, onPointerMove: ge, children: [f?.visible ? g("group", { children: [n("hemisphereLight", { color: 8421504, groundColor: 6316128 }), n("directionalLight", { color: 16777215, position: [0, -800, 0] }), n("primitive", { ref: D, object: f, position: [-0.18, 1.13, -1], scale: [
122
+ 2e-3 * i[0],
123
+ 2e-3 * i[1],
124
+ 2e-3 * i[2]
125
+ ] })] }) : null, t.uniforms && t.shader && t.meshScale ? n("group", { children: g("mesh", { name: "cube", position: [-0.18, 1.13, -1], rotation: [0, 0, 0], scale: [
126
+ 2e-3 * t.meshScale[0],
127
+ 2e-3 * t.meshScale[1],
128
+ 2e-3 * t.meshScale[2]
129
+ ], ref: v, children: [we(t.geometrySize) && n("boxGeometry", { args: t.geometrySize }), n("shaderMaterial", { customProgramCacheKey: () => "1", side: se, uniforms: t.uniforms, needsUpdate: !0, transparent: !0, vertexShader: t.shader.vertexShader, fragmentShader: t.shader.fragmentShader })] }) }) : null] }), n("group", { name: "currentLine", ref: le, children: de ? n(W, { currentLine: K, scale: 1 / 2e-3 * 0.4 }) : null }), n("group", { name: "lines", children: G.map((e) => n(W, { currentLine: e, scale: 1 / 2e-3 * 0.4 }, ce(e))) })] }) : g("group", { children: [g("group", { children: [f?.visible ? g("group", { children: [n("hemisphereLight", { color: 8421504, groundColor: 6316128 }), n("directionalLight", { color: 16777215, position: [0, -800, 0] }), n("directionalLight", { color: 16777215, position: [0, 800, 0] }), n(Fe, { firstHitOnly: !0, children: n("primitive", { ref: D, object: f, position: [0, 0, 0], onClick: (e) => {
130
+ e.object.parent?.userData.name === "finalPass" && ae(e.object.name, e.object.userData.layerScope, e.object.userData.channelScope);
131
+ }, onPointerOver: (e) => {
132
+ E(e.object.name);
133
+ }, onPointerOut: () => E(null) }) })] }) : null, t.uniforms && t.shader && t.meshScale && t.geometrySize ? n("group", { children: g("mesh", { scale: t.meshScale, ref: v, children: [n("boxGeometry", { args: t.geometrySize }), n("shaderMaterial", { customProgramCacheKey: () => "1", side: se, uniforms: t.uniforms, needsUpdate: !0, transparent: !0, vertexShader: t.shader.vertexShader, fragmentShader: t.shader.fragmentShader })] }) }) : null] }), n("group", { name: "lines", children: G.map((e) => n(W, { currentLine: e, scale: 1 }, ce(e))) })] });
134
+ }
135
+ export {
136
+ De as default
137
+ };
@@ -3,7 +3,7 @@ var g_ = (i, e, t) => e in i ? p_(i, e, { enumerable: !0, configurable: !0, writ
3
3
  var Fn = (i, e, t) => g_(i, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { jsx as m_, jsxs as v_ } from "react/jsx-runtime";
5
5
  import Hb from "react";
6
- import { b as Qe, r as y_, h as Vt, j as ut, k as Hv, m as qv, n as Gk, o as jv, p as Nr, q as Jv, s as aa, t as Ro, v as Ao, w as Wk, x as oa, y as qu, z as Or, A as ju, D as Ju, E as xs, F as S_, G as b_, H as w_, I as Ku, J as C_, K as x_, M as Hk, N as Yu, O as E_, P as k_, Q as T_, R as L_, S as D_, T as Kv, U as qk, V as I_, W as Yv, X as P_, Y as R_, Z as A_, _ as __, $ as M_, a0 as N_, a1 as O_, a2 as V_, a3 as B_, a4 as qb, a5 as F_ } from "./index-DCtpEKxQ.js";
6
+ import { b as Qe, r as y_, h as Vt, j as ut, k as Hv, m as qv, n as Gk, o as jv, p as Nr, q as Jv, s as aa, t as Ro, v as Ao, w as Wk, x as oa, y as qu, z as Or, A as ju, D as Ju, E as xs, F as S_, G as b_, H as w_, I as Ku, J as C_, K as x_, M as Hk, N as Yu, O as E_, P as k_, Q as T_, R as L_, S as D_, T as Kv, U as qk, V as I_, W as Yv, X as P_, Y as R_, Z as A_, _ as __, $ as M_, a0 as N_, a1 as O_, a2 as V_, a3 as B_, a4 as qb, a5 as F_ } from "./index-BhBtzTli.js";
7
7
  var U_ = y_();
8
8
  const H = /* @__PURE__ */ Qe(U_);
9
9
  var jb = {}, Nf, Jb;
@@ -1,6 +1,6 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import { useState as s, useEffect as o } from "react";
3
- import { x as r } from "./xrStore-BsW7RDcW.js";
3
+ import { g as r } from "./xrStore-KNRIEBqp.js";
4
4
  function b() {
5
5
  const [i, u] = s(!1), [n, a] = s(!1);
6
6
  return o(() => {
@@ -11,14 +11,14 @@ function b() {
11
11
  }), () => {
12
12
  e = !0;
13
13
  };
14
- }, []), o(() => r.subscribe((t) => {
14
+ }, []), o(() => r().subscribe((t) => {
15
15
  a(t.session != null);
16
16
  }), []), i ? l("button", { type: "button", onClick: () => {
17
17
  if (n) {
18
- const { session: e } = r.getState();
18
+ const { session: e } = r().getState();
19
19
  e && e.end();
20
20
  } else
21
- r.enterAR();
21
+ r().enterAR();
22
22
  }, style: {
23
23
  border: "1px solid white",
24
24
  padding: "12px 24px",
@@ -0,0 +1,48 @@
1
+ import { jsxs as c, Fragment as d, jsx as i } from "react/jsx-runtime";
2
+ import { useRef as m } from "react";
3
+ import { useThree as g, useFrame as h } from "@react-three/fiber";
4
+ import { g as x } from "./index-NQBX1k0A.js";
5
+ function l(n, r) {
6
+ return n.get(r);
7
+ }
8
+ function S() {
9
+ const { useXRInputSourceState: n } = x(), r = n("hand", "right"), a = n("hand", "left"), t = m(null), o = m(null), { gl: f } = g();
10
+ return h((y, b, u) => {
11
+ if (!u || !f.xr.isPresenting)
12
+ return;
13
+ const p = f.xr.getReferenceSpace();
14
+ if (p) {
15
+ if (r?.inputSource?.hand && t.current) {
16
+ const s = l(r.inputSource.hand, "index-finger-tip");
17
+ if (s) {
18
+ const e = u.getJointPose?.(s, p);
19
+ e && t.current.position.set(e.transform.position.x, e.transform.position.y, e.transform.position.z);
20
+ }
21
+ }
22
+ if (a?.inputSource?.hand && o.current) {
23
+ const s = l(a.inputSource.hand, "index-finger-tip");
24
+ if (s) {
25
+ const e = u.getJointPose?.(s, p);
26
+ e && o.current.position.set(e.transform.position.x, e.transform.position.y, e.transform.position.z);
27
+ }
28
+ }
29
+ }
30
+ }), c(d, { children: [c("mesh", { name: "leftTipBbox", ref: o, children: [i("boxGeometry", { args: [0.02, 0.02, 0.02] }), i("meshStandardMaterial", { color: "blue", transparent: !0, opacity: 0 })] }), c("mesh", { name: "rightTipBbox", ref: t, children: [i("boxGeometry", { args: [0.02, 0.02, 0.02] }), i("meshStandardMaterial", { color: "orange", transparent: !0, opacity: 0 })] })] });
31
+ }
32
+ function R() {
33
+ const { useXR: n } = x(), r = n((t) => t.session), { scene: a } = g();
34
+ return h(() => {
35
+ r && a.traverse((t) => {
36
+ if (t.isMesh && t.material && t.userData?.xpiHand) {
37
+ const o = t;
38
+ o.material.transparent = !0, o.material.opacity = 0.5;
39
+ }
40
+ });
41
+ }), null;
42
+ }
43
+ function X() {
44
+ return c(d, { children: [i(S, {}), i(R, {})] });
45
+ }
46
+ export {
47
+ X as default
48
+ };
@@ -0,0 +1,10 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { g as e } from "./index-NQBX1k0A.js";
3
+ import { g as m } from "./xrStore-KNRIEBqp.js";
4
+ function f({ children: r }) {
5
+ const { XR: o } = e();
6
+ return t(o, { store: m(), children: r });
7
+ }
8
+ export {
9
+ f as default
10
+ };
@@ -1,5 +1,5 @@
1
1
  import { i as r } from "./pako.esm-D68R8YXe.js";
2
- import { B as a } from "./index-DCtpEKxQ.js";
2
+ import { B as a } from "./index-BhBtzTli.js";
3
3
  class s extends a {
4
4
  decodeBlock(e) {
5
5
  return r(new Uint8Array(e)).buffer;
@@ -1,6 +1,6 @@
1
1
  import * as KY from "react";
2
2
  import I, { createContext as op, isValidElement as ZY, PureComponent as ap, Component as sp, useMemo as Zt, useState as Ur, useRef as Mt, useEffect as ar, useCallback as zt, memo as QY, useContext as nl, useReducer as JY, useLayoutEffect as eK } from "react";
3
- import { b as PB, e as e4, f as qO } from "./index-DCtpEKxQ.js";
3
+ import { b as PB, e as e4, f as qO } from "./index-BhBtzTli.js";
4
4
  import ga, { unstable_batchedUpdates as Yp, createPortal as tK } from "react-dom";
5
5
  import { jsx as Ic, jsxs as rK } from "react/jsx-runtime";
6
6
  function nK(t) {
@@ -1313,7 +1313,7 @@ const bGt = {
1313
1313
  ee.SAMPLE_HIGHLIGHT,
1314
1314
  ee.HIERARCHY_LEVELS
1315
1315
  ]
1316
- }, VGt = "4.0.5", yGt = {
1316
+ }, VGt = "4.0.7", yGt = {
1317
1317
  version: VGt
1318
1318
  }, rM = ["z", "t"], Pnt = "Min/Max", ZGt = {
1319
1319
  opacity: 1,
@@ -157749,19 +157749,19 @@ async function psi(t) {
157749
157749
  const n = await e();
157750
157750
  return new n(t);
157751
157751
  }
157752
- kp([void 0, 1], () => import("./raw-CVKHU2Cx.js").then((t) => t.default));
157753
- kp(5, () => import("./lzw-DeZLl_w8.js").then((t) => t.default));
157752
+ kp([void 0, 1], () => import("./raw-C_fR9yV6.js").then((t) => t.default));
157753
+ kp(5, () => import("./lzw-DzjQwFAL.js").then((t) => t.default));
157754
157754
  kp(6, () => {
157755
157755
  throw new Error("old style JPEG compression is not supported.");
157756
157756
  });
157757
- kp(7, () => import("./jpeg-CdxpVJsF.js").then((t) => t.default));
157758
- kp([8, 32946], () => import("./deflate-BvMDqABS.js").then((t) => t.default));
157759
- kp(32773, () => import("./packbits-Dyg_ivb5.js").then((t) => t.default));
157757
+ kp(7, () => import("./jpeg-DkJ6-Dos.js").then((t) => t.default));
157758
+ kp([8, 32946], () => import("./deflate-DiO1S3KD.js").then((t) => t.default));
157759
+ kp(32773, () => import("./packbits-DUYDLTQ3.js").then((t) => t.default));
157760
157760
  kp(
157761
157761
  34887,
157762
- () => import("./lerc-BXvIz1Au.js").then(async (t) => (await t.zstd.init(), t)).then((t) => t.default)
157762
+ () => import("./lerc-DmEtbLp8.js").then(async (t) => (await t.zstd.init(), t)).then((t) => t.default)
157763
157763
  );
157764
- kp(50001, () => import("./webimage-Ch8lvkbZ.js").then((t) => t.default));
157764
+ kp(50001, () => import("./webimage-DX-M5CWL.js").then((t) => t.default));
157765
157765
  function R$(t, e, n, i = 1) {
157766
157766
  return new (Object.getPrototypeOf(t)).constructor(e * n * i);
157767
157767
  }
@@ -186830,10 +186830,10 @@ class Gpt extends An.Component {
186830
186830
  }
186831
186831
  }
186832
186832
  const WRi = An.lazy(async () => {
186833
- const { SpatialWrapper: t } = await import("./index-CROv8z3N.js").then((e) => e.a);
186833
+ const { SpatialWrapper: t } = await import("./index-NQBX1k0A.js").then((e) => e.a);
186834
186834
  return { default: t };
186835
186835
  }), JRi = An.forwardRef((t, e) => H("div", { ref: e, style: { width: "100%", height: "100%" }, children: H(Gpt, { fallback: H("div", { children: "3D spatial view is not available in this environment." }), children: H(k5, { fallback: H("div", { children: "Loading..." }), children: H(WRi, { ...t }) }) }) })), vRi = An.lazy(async () => {
186836
- const { SpatialWrapper: t } = await import("./index-Hw-umFod.js");
186836
+ const { SpatialWrapper: t } = await import("./index-CXpSxI1k.js");
186837
186837
  return { default: t };
186838
186838
  }), GRi = An.forwardRef((t, e) => H("div", { ref: e, style: { width: "100%", height: "100%" }, children: H(Gpt, { fallback: H("div", { children: "3D spatial view is not available in this environment." }), children: H(k5, { fallback: H("div", { children: "Loading..." }), children: H(vRi, { ...t }) }) }) })), wRi = er()(() => ({
186839
186839
  spatialBetaCameraLabel: {
@@ -195787,7 +195787,7 @@ function ymt(t) {
195787
195787
  }
195788
195788
  aVi({ dataFetcher: jBe, config: jBe.config }, { pluginType: "dataFetcher" });
195789
195789
  const nyi = An.lazy(async () => {
195790
- const { HiGlassComponent: t } = await import("./higlass-rNtWN-38.js");
195790
+ const { HiGlassComponent: t } = await import("./higlass-DlUDuKAR.js");
195791
195791
  return { default: t };
195792
195792
  }), MO = 800;
195793
195793
  function iyi(t, e) {
@@ -198670,7 +198670,7 @@ function uyi(t) {
198670
198670
  const { classes: e } = t;
198671
198671
  return Ge(Wi, { children: [H(dUe, { styles: cyi }), H(N1, { styles: dyi, parentClassName: e.neuroglancerWrapper })] });
198672
198672
  }
198673
- const Byi = An.lazy(() => import("./ReactNeuroglancer-DXWxReLL.js"));
198673
+ const Byi = An.lazy(() => import("./ReactNeuroglancer-CwTNjeY2.js"));
198674
198674
  function hyi() {
198675
198675
  const t = new gyi();
198676
198676
  return t.AsyncComputationWorker = Iyi, t;
@@ -239587,7 +239587,7 @@ class jU extends Ug {
239587
239587
  loadObsIndex(e = null) {
239588
239588
  this.obsIndex || (this.obsIndex = {});
239589
239589
  const n = ker(e);
239590
- return this.obsIndex[n] ? this.obsIndex[n] : (this.obsIndex[n] = this.getJson(`${n}/.zattrs`).then(({ _index: i }) => this.getFlatArrDecompressed(`${n}/${i}`)), this.obsIndex[n]);
239590
+ return this.obsIndex[n] ? this.obsIndex[n] : (this.obsIndex[n] = this.getJson(`${n}/.zattrs`).then(({ _index: i }) => this._loadColumn(`${n}/${i}`)), this.obsIndex[n]);
239591
239591
  }
239592
239592
  /**
239593
239593
  * Class method for loading the var index.
@@ -239596,7 +239596,7 @@ class jU extends Ug {
239596
239596
  loadVarIndex(e = null) {
239597
239597
  this.varIndex || (this.varIndex = {});
239598
239598
  const n = Der(e);
239599
- return this.varIndex[n] ? this.varIndex[n] : (this.varIndex[n] = this.getJson(`${n}/.zattrs`).then(({ _index: i }) => this.getFlatArrDecompressed(`${n}/${i}`)), this.varIndex[n]);
239599
+ return this.varIndex[n] ? this.varIndex[n] : (this.varIndex[n] = this.getJson(`${n}/.zattrs`).then(({ _index: i }) => this._loadColumn(`${n}/${i}`)), this.varIndex[n]);
239600
239600
  }
239601
239601
  /**
239602
239602
  * Class method for loading the var alias.
@@ -249319,7 +249319,7 @@ class eJ extends Ug {
249319
249319
  */
249320
249320
  loadVarIndex(e = void 0) {
249321
249321
  const n = nrr(e);
249322
- return n in this.varIndices ? this.varIndices[n] : (this.varIndices[n] = this.getJson(`${n}/.zattrs`).then(({ _index: i }) => this.getFlatArrDecompressed(`${n}/${i}`)), this.varIndices[n]);
249322
+ return n in this.varIndices ? this.varIndices[n] : (this.varIndices[n] = this.getJson(`${n}/.zattrs`).then(({ _index: i }) => this._loadColumn(`${n}/${i}`)), this.varIndices[n]);
249323
249323
  }
249324
249324
  /**
249325
249325
  * Class method for loading the var alias.
@@ -4,7 +4,7 @@ import { useThree as ve, useFrame as Me, Canvas as Pe } from "@react-three/fiber
4
4
  import { OrbitControls as me } from "@react-three/drei";
5
5
  import * as M from "three";
6
6
  import { Data3DTexture as ge, RedFormat as Ae, UnsignedByteType as Be, LinearFilter as pe, RedIntegerFormat as Ne, UnsignedIntType as Ue, NearestFilter as xe, Vector3 as R, Vector2 as _, Vector4 as j, UniformsUtils as Le } from "three";
7
- import { l as n, i as Oe, a as ue, L as he, C as P, u as K } from "./index-DCtpEKxQ.js";
7
+ import { l as n, i as Oe, a as ue, L as he, C as P, u as K } from "./index-BhBtzTli.js";
8
8
  const w = 32, B = 64, Z = 64, fe = 4, ce = B * Z * fe, be = B * w, _e = Z * w, Ce = fe * w, V = {
9
9
  NOT_STARTED: "not_started",
10
10
  IN_PROGRESS: "in_progress",
@@ -6,7 +6,7 @@ import ae, { useRef as Q, useState as X, useEffect as q, Suspense as ee, forward
6
6
  import { Canvas as Ce } from "@react-three/fiber";
7
7
  import { Center as ze, Text as ve, Line as Te, Bvh as we, OrbitControls as Me } from "@react-three/drei";
8
8
  import { Matrix3 as Le, Matrix4 as ie, Vector3 as P, Vector2 as G, UniformsUtils as Pe, Data3DTexture as Ae, RedFormat as De, FloatType as Ie, LinearFilter as ge, FrontSide as _e, Scene as Fe, Group as Ee, MeshPhysicalMaterial as Re, MeshBasicMaterial as Ve, MeshStandardMaterial as Oe, BackSide as ke } from "three";
9
- import { C as j, g as Ue } from "./index-DCtpEKxQ.js";
9
+ import { C as j, g as Ue } from "./index-BhBtzTli.js";
10
10
  function Ne({ currentLine: t, scale: e }) {
11
11
  const a = Q(null);
12
12
  return H("group", { children: [_(ze, { bottom: !0, right: !0, position: [t.midPoint.x, t.midPoint.y, t.midPoint.z], rotation: [0, 0, 0], children: _(ve, { color: "gray", scale: 0.05, ref: a, children: `${(t.startPoint.distanceTo(t.endPoint) * e).toFixed(2)} µm` }) }), _(Te, {
@@ -762,7 +762,7 @@ function re(t) {
762
762
  g(c.object.name);
763
763
  }, onPointerOut: () => g(null) }) })] }) : null, i.uniforms && i.shader && i.meshScale && i.geometrySize ? _("group", { children: H("mesh", { scale: i.meshScale, ref: l, children: [_("boxGeometry", { args: i.geometrySize }), _("shaderMaterial", { customProgramCacheKey: () => "1", side: _e, uniforms: i.uniforms, needsUpdate: !0, transparent: !0, vertexShader: i.shader.vertexShader, fragmentShader: i.shader.fragmentShader })] }) }) : null] }), _("group", { name: "lines", children: m.map((c) => _(Ne, { currentLine: c, scale: 1 }, tt(c))) })] });
764
764
  }
765
- const at = ae.lazy(() => import("./GeometryAndMeshXR-BWKSLAfk.js").catch(() => ({ default: re }))), lt = ae.lazy(() => import("./XRSceneComponents-0DSP5wNK.js").catch(() => ({ default: () => null })));
765
+ const at = ae.lazy(() => import("./GeometryAndMeshXR-C6hkSK75.js").catch(() => ({ default: re }))), lt = ae.lazy(() => import("./XRSceneComponents-BA3KqbZ8.js").catch(() => ({ default: () => null })));
766
766
  function oe(t) {
767
767
  const e = Q(null), a = Q(null), [o, i] = X(!1), [l, n] = X(!1), [g, p] = X(null), [m, c] = X([1, 1, 1]), [s, w] = X({
768
768
  uniforms: null,
@@ -976,12 +976,12 @@ function pt() {
976
976
  }
977
977
  const it = ae.lazy(
978
978
  // eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
979
- () => import("./XRWrapper-B0U8nIg5.js").catch(() => ({
979
+ () => import("./XRWrapper-BwByCAw7.js").catch(() => ({
980
980
  default: ({ children: t }) => t
981
981
  }))
982
982
  ), ot = ae.lazy(
983
983
  // eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
984
- () => import("./XREnterButton-BYroaJsz.js").catch(() => ({
984
+ () => import("./XREnterButton-h8-XHjHS.js").catch(() => ({
985
985
  default: () => null
986
986
  }))
987
987
  ), rt = Se((t, e) => {
package/dist/index.min.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aI as i, ag as n, ab as t, a9 as r, aa as l, ak as p, al as C, ac as d, ax as c, av as u, at as g, aw as T, au as y, aJ as m, a8 as S, as as P, ad as f, a7 as F, a6 as I, ar as N, ai as _, ao as v, ah as x, aj as A, an as U, am as V, af as w, ap as E, aq as G, aC as H, aF as M, az as O, aG as h, aH as z, aA as L, aD as B, aE as D, aB as J, ae as Y, ay as b } from "./index-DCtpEKxQ.js";
1
+ import { aI as i, ag as n, ab as t, a9 as r, aa as l, ak as p, al as C, ac as d, ax as c, av as u, at as g, aw as T, au as y, aJ as m, a8 as S, as as P, ad as f, a7 as F, a6 as I, ar as N, ai as _, ao as v, ah as x, aj as A, an as U, am as V, af as w, ap as E, aq as G, aC as H, aF as M, az as O, aG as h, aH as z, aA as L, aD as B, aE as D, aB as J, ae as Y, ay as b } from "./index-BhBtzTli.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { B as re } from "./index-DCtpEKxQ.js";
1
+ import { B as re } from "./index-BhBtzTli.js";
2
2
  const O = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as sA } from "./pako.esm-D68R8YXe.js";
2
- import { b as DA, B as nA, c as fA, d as gA } from "./index-DCtpEKxQ.js";
2
+ import { b as DA, B as nA, c as fA, d as gA } from "./index-BhBtzTli.js";
3
3
  var BA = { exports: {} }, iA;
4
4
  function tA() {
5
5
  return iA || (iA = 1, function(j) {
@@ -1,4 +1,4 @@
1
- import { B as b } from "./index-DCtpEKxQ.js";
1
+ import { B as b } from "./index-BhBtzTli.js";
2
2
  const B = 9, E = 256, p = 257, k = 12;
3
3
  function x(c, o, r) {
4
4
  const i = o % 8, n = Math.floor(o / 8), h = 8 - i, g = o + r - (n + 1) * 8;
@@ -1,4 +1,4 @@
1
- import { B as c } from "./index-DCtpEKxQ.js";
1
+ import { B as c } from "./index-BhBtzTli.js";
2
2
  class l extends c {
3
3
  decodeBlock(s) {
4
4
  const n = new DataView(s), r = [];
@@ -1,4 +1,4 @@
1
- import { B as o } from "./index-DCtpEKxQ.js";
1
+ import { B as o } from "./index-BhBtzTli.js";
2
2
  class d extends o {
3
3
  decodeBlock(e) {
4
4
  return e;
@@ -1,4 +1,4 @@
1
- import { B as r } from "./index-DCtpEKxQ.js";
1
+ import { B as r } from "./index-BhBtzTli.js";
2
2
  class s extends r {
3
3
  constructor() {
4
4
  if (super(), typeof createImageBitmap > "u")
@@ -0,0 +1,11 @@
1
+ import { g as t } from "./index-NQBX1k0A.js";
2
+ let e = null;
3
+ function o() {
4
+ return e || (e = t().createXRStore({
5
+ handTracking: !0,
6
+ emulate: !1
7
+ })), e;
8
+ }
9
+ export {
10
+ o as g
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/comparative",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -22,16 +22,16 @@
22
22
  "react-sticky-el": "^2.1.1",
23
23
  "react-window": "^1.8.10",
24
24
  "nuqs": "^2.6.0",
25
- "@vitessce/all": "4.0.5",
26
- "@vitessce/abstract": "4.0.5",
27
- "@vitessce/error": "4.0.5",
28
- "@vitessce/config": "4.0.5",
29
- "@vitessce/constants-internal": "4.0.5",
30
- "@vitessce/constants": "4.0.5",
31
- "@vitessce/export-utils": "4.0.5",
32
- "@vitessce/styles": "4.0.5",
33
- "@vitessce/vit-s": "4.0.5",
34
- "@vitessce/zarr": "4.0.5"
25
+ "@vitessce/abstract": "4.0.7",
26
+ "@vitessce/error": "4.0.7",
27
+ "@vitessce/config": "4.0.7",
28
+ "@vitessce/all": "4.0.7",
29
+ "@vitessce/constants-internal": "4.0.7",
30
+ "@vitessce/constants": "4.0.7",
31
+ "@vitessce/export-utils": "4.0.7",
32
+ "@vitessce/vit-s": "4.0.7",
33
+ "@vitessce/styles": "4.0.7",
34
+ "@vitessce/zarr": "4.0.7"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@vitejs/plugin-react": "^4.5.0",
@@ -1,138 +0,0 @@
1
- import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
- import { useRef as r, useEffect as Pe, useState as L } from "react";
3
- import { useThree as Se, useFrame as xe } from "@react-three/fiber";
4
- import { Bvh as be } from "@react-three/drei";
5
- import { Matrix4 as Fe, Vector3 as g, Box3 as J, FrontSide as ie } from "three";
6
- import { g as ye, i as Le, M as K, s as oe } from "./index-CROv8z3N.js";
7
- const { useXR: we, useXRInputSourceState: se } = ye();
8
- function Be(l, o) {
9
- return l.get(o);
10
- }
11
- function H(l, o, w, P) {
12
- if (!l?.inputSource?.hand)
13
- return null;
14
- const t = Be(l.inputSource.hand, o);
15
- if (!t)
16
- return null;
17
- const i = w.getJointPose?.(t, P);
18
- return i ? new g(i.transform.position.x, i.transform.position.y, i.transform.position.z) : null;
19
- }
20
- function z(l, o, w, P = 0.02) {
21
- const t = H(l, "thumb-tip", o, w), i = H(l, "index-finger-tip", o, w);
22
- return !t || !i ? !1 : t.distanceTo(i) < P;
23
- }
24
- function De(l) {
25
- const { segmentationGroup: o, segmentationSettings: w, segmentationSceneScale: P, renderingSettings: t, materialRef: i, highlightEntity: ce, setObsHighlight: M } = l, T = r(null), ae = r(null), s = r(null), f = r(null);
26
- r(new Fe());
27
- const B = r(null), S = r(null), E = r(0), p = r(/* @__PURE__ */ new Map()), b = we((e) => e.session) != null;
28
- Pe(() => {
29
- i?.current?.material?.uniforms?.u_physical_Pixel && (i.current.material.uniforms.u_physical_Pixel.value = b ? 0.2 : 2.5);
30
- }, [b, i]);
31
- const { scene: N, gl: le } = Se(), U = se("hand", "right"), V = se("hand", "left"), [W, k] = L(!1), [A, q] = L(!1), [ue, Q] = L(!1), [X, D] = L({
32
- startPoint: new g(),
33
- midPoint: new g(),
34
- endPoint: new g(),
35
- setStartPoint: !1,
36
- setEndPoint: !1
37
- }), [O, de] = L([]), [Y, C] = L(0), Z = r(W);
38
- Z.current = W;
39
- const $ = r(A);
40
- $.current = A;
41
- const ee = r(X);
42
- ee.current = X;
43
- const fe = r(O);
44
- fe.current = O;
45
- const te = r(Y);
46
- te.current = Y, xe((e, F, c) => {
47
- if (!b || !c)
48
- return;
49
- const a = le.xr.getReferenceSpace();
50
- if (!a)
51
- return;
52
- const x = N.getObjectByName("rightTipBbox"), v = N.getObjectByName("leftTipBbox");
53
- if (!x || !v)
54
- return;
55
- const G = new J().setFromObject(v), I = new J().setFromObject(x);
56
- let _ = !1;
57
- C((d) => d - 1), G.intersectsBox(I) && G.max.x !== -I.min.x && (k(!0), Q(!0), D({
58
- startPoint: new g(),
59
- midPoint: new g(),
60
- endPoint: new g(),
61
- setStartPoint: !1,
62
- setEndPoint: !1
63
- }));
64
- const ge = Z.current, u = ee.current;
65
- if (ge) {
66
- let d = H(V, "index-finger-tip", c, a), R = H(U, "index-finger-tip", c, a);
67
- if (!d || !R)
68
- return;
69
- s.current && (d = d.applyMatrix4(s.current.matrixWorld.clone().invert()), R = R.applyMatrix4(s.current.matrixWorld.clone().invert()));
70
- let j = d.clone(), y = R.clone();
71
- u.setStartPoint && (j = u.startPoint), u.setEndPoint && (y = u.endPoint), D({
72
- startPoint: j,
73
- midPoint: new g().addVectors(j, y).multiplyScalar(0.5),
74
- endPoint: y,
75
- setStartPoint: u.setStartPoint,
76
- setEndPoint: u.setEndPoint
77
- }), z(U, c, a) && D((h) => ({
78
- ...h,
79
- setEndPoint: !0
80
- })), z(V, c, a) && D((h) => ({
81
- ...h,
82
- setStartPoint: !0
83
- })), u.setStartPoint && u.setEndPoint && (de((h) => [...h, u]), Q(!1), k(!1), C(8));
84
- } else if (te.current <= 0 && T.current && b) {
85
- const d = T.current;
86
- d.children[0].children.forEach((R, j) => {
87
- const y = d.children[0].children[j], h = new J().setFromObject(y), ne = G.intersectsBox(h), re = I.intersectsBox(h);
88
- (ne || re) && (_ = !0, M(y.name), q(!0), ne && z(V, c, a) && (C(10), _ = !1), re && z(U, c, a) && (C(10), _ = !1));
89
- }), !_ && $.current && (M(null), q(!1));
90
- }
91
- });
92
- const pe = (e) => {
93
- if (b) {
94
- if (e.stopPropagation(), e.target.setPointerCapture(e.pointerId), f.current === null)
95
- f.current = e.pointerId, p.current.set(e.pointerId, e.point.clone()), s.current && (B.current = s.current.scale.clone());
96
- else if (S.current === null && e.pointerId !== f.current) {
97
- S.current = e.pointerId, p.current.set(e.pointerId, e.point.clone());
98
- const F = p.current.get(f.current), c = e.point;
99
- F && (E.current = F.distanceTo(c)), s.current && (B.current = s.current.scale.clone());
100
- }
101
- }
102
- }, he = (e) => {
103
- e.target.releasePointerCapture(e.pointerId), p.current.delete(e.pointerId), f.current === e.pointerId && (f.current = null, B.current = null), S.current === e.pointerId && (S.current = null, E.current = 0);
104
- }, me = (e) => {
105
- if (!s.current || !e.point)
106
- return;
107
- const F = f.current === e.pointerId, c = S.current === e.pointerId;
108
- if (!F && !c)
109
- return;
110
- const a = p.current.get(e.pointerId);
111
- if (p.current.set(e.pointerId, e.point.clone()), S.current !== null && E.current > 0 && B.current) {
112
- const x = p.current.get(f.current), v = p.current.get(S.current);
113
- if (x && v) {
114
- const I = x.distanceTo(v) / E.current;
115
- s.current.scale.copy(B.current).multiplyScalar(I);
116
- }
117
- } else if (F && a) {
118
- const x = e.point.clone().sub(a);
119
- s.current.position.add(x);
120
- }
121
- };
122
- return b ? m("group", { children: [m("group", { ref: s, onPointerDown: pe, onPointerUp: he, onPointerMove: me, children: [o?.visible ? m("group", { children: [n("hemisphereLight", { color: 8421504, groundColor: 6316128 }), n("directionalLight", { color: 16777215, position: [0, -800, 0] }), n("primitive", { ref: T, object: o, position: [-0.18, 1.13, -1], scale: [
123
- 2e-3 * P[0],
124
- 2e-3 * P[1],
125
- 2e-3 * P[2]
126
- ] })] }) : null, t.uniforms && t.shader && t.meshScale ? n("group", { children: m("mesh", { name: "cube", position: [-0.18, 1.13, -1], rotation: [0, 0, 0], scale: [
127
- 2e-3 * t.meshScale[0],
128
- 2e-3 * t.meshScale[1],
129
- 2e-3 * t.meshScale[2]
130
- ], ref: i, children: [Le(t.geometrySize) && n("boxGeometry", { args: t.geometrySize }), n("shaderMaterial", { customProgramCacheKey: () => "1", side: ie, uniforms: t.uniforms, needsUpdate: !0, transparent: !0, vertexShader: t.shader.vertexShader, fragmentShader: t.shader.fragmentShader })] }) }) : null] }), n("group", { name: "currentLine", ref: ae, children: ue ? n(K, { currentLine: X, scale: 1 / 2e-3 * 0.4 }) : null }), n("group", { name: "lines", children: O.map((e) => n(K, { currentLine: e, scale: 1 / 2e-3 * 0.4 }, oe(e))) })] }) : m("group", { children: [m("group", { children: [o?.visible ? m("group", { children: [n("hemisphereLight", { color: 8421504, groundColor: 6316128 }), n("directionalLight", { color: 16777215, position: [0, -800, 0] }), n("directionalLight", { color: 16777215, position: [0, 800, 0] }), n(be, { firstHitOnly: !0, children: n("primitive", { ref: T, object: o, position: [0, 0, 0], onClick: (e) => {
131
- e.object.parent?.userData.name === "finalPass" && ce(e.object.name, e.object.userData.layerScope, e.object.userData.channelScope);
132
- }, onPointerOver: (e) => {
133
- M(e.object.name);
134
- }, onPointerOut: () => M(null) }) })] }) : null, t.uniforms && t.shader && t.meshScale && t.geometrySize ? n("group", { children: m("mesh", { scale: t.meshScale, ref: i, children: [n("boxGeometry", { args: t.geometrySize }), n("shaderMaterial", { customProgramCacheKey: () => "1", side: ie, uniforms: t.uniforms, needsUpdate: !0, transparent: !0, vertexShader: t.shader.vertexShader, fragmentShader: t.shader.fragmentShader })] }) }) : null] }), n("group", { name: "lines", children: O.map((e) => n(K, { currentLine: e, scale: 1 }, oe(e))) })] });
135
- }
136
- export {
137
- De as default
138
- };
@@ -1,50 +0,0 @@
1
- import { jsxs as a, Fragment as d, jsx as i } from "react/jsx-runtime";
2
- import { useRef as f } from "react";
3
- import { useThree as g, useFrame as h } from "@react-three/fiber";
4
- import { g as x } from "./index-CROv8z3N.js";
5
- const { useXRInputSourceState: m } = x();
6
- function l(n, r) {
7
- return n.get(r);
8
- }
9
- function S() {
10
- const n = m("hand", "right"), r = m("hand", "left"), t = f(null), o = f(null), { gl: p } = g();
11
- return h((b, H, c) => {
12
- if (!c || !p.xr.isPresenting)
13
- return;
14
- const u = p.xr.getReferenceSpace();
15
- if (u) {
16
- if (n?.inputSource?.hand && t.current) {
17
- const s = l(n.inputSource.hand, "index-finger-tip");
18
- if (s) {
19
- const e = c.getJointPose?.(s, u);
20
- e && t.current.position.set(e.transform.position.x, e.transform.position.y, e.transform.position.z);
21
- }
22
- }
23
- if (r?.inputSource?.hand && o.current) {
24
- const s = l(r.inputSource.hand, "index-finger-tip");
25
- if (s) {
26
- const e = c.getJointPose?.(s, u);
27
- e && o.current.position.set(e.transform.position.x, e.transform.position.y, e.transform.position.z);
28
- }
29
- }
30
- }
31
- }), a(d, { children: [a("mesh", { name: "leftTipBbox", ref: o, children: [i("boxGeometry", { args: [0.02, 0.02, 0.02] }), i("meshStandardMaterial", { color: "blue", transparent: !0, opacity: 0 })] }), a("mesh", { name: "rightTipBbox", ref: t, children: [i("boxGeometry", { args: [0.02, 0.02, 0.02] }), i("meshStandardMaterial", { color: "orange", transparent: !0, opacity: 0 })] })] });
32
- }
33
- const { useXR: R } = x();
34
- function y() {
35
- const n = R((t) => t.session), { scene: r } = g();
36
- return h(() => {
37
- n && r.traverse((t) => {
38
- if (t.isMesh && t.material && t.userData?.xpiHand) {
39
- const o = t;
40
- o.material.transparent = !0, o.material.opacity = 0.5;
41
- }
42
- });
43
- }), null;
44
- }
45
- function B() {
46
- return a(d, { children: [i(S, {}), i(y, {})] });
47
- }
48
- export {
49
- B as default
50
- };
@@ -1,10 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { g as t } from "./index-CROv8z3N.js";
3
- import { x as e } from "./xrStore-BsW7RDcW.js";
4
- const { XR: m } = t();
5
- function f({ children: r }) {
6
- return o(m, { store: e, children: r });
7
- }
8
- export {
9
- f as default
10
- };
@@ -1,8 +0,0 @@
1
- import { g as e } from "./index-CROv8z3N.js";
2
- const t = e().createXRStore({
3
- handTracking: !0,
4
- emulate: !1
5
- });
6
- export {
7
- t as x
8
- };