@vitessce/comparative 3.9.9 → 4.0.0-test.1
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/GeometryAndMeshXR-CX1Dr7Lp.js +137 -0
- package/dist/OrbitControls-4708Bo-O.js +7700 -0
- package/dist/{ReactNeuroglancer-DVTouLdy.js → ReactNeuroglancer-D7gl_oXM.js} +3458 -3457
- package/dist/XREnterButton-Dp2xhwJb.js +37 -0
- package/dist/XRSceneComponents-Cp8t3pvt.js +48 -0
- package/dist/XRWrapper-tyjCu0dQ.js +10 -0
- package/dist/{deflate-dpVUbWzG.js → deflate-sQAuGjEg.js} +1 -1
- package/dist/emulate-BRbJviQW.js +28295 -0
- package/dist/{higlass-DA6D2z7x.js → higlass-BTDczObM.js} +52945 -49808
- package/dist/index-CjBUb32k.js +57 -0
- package/dist/index-Cor41Qpl.js +7684 -0
- package/dist/{index-CtfYbkUc.js → index-Db7_bzrU.js} +190 -189
- package/dist/{index-D10X079V.js → index-d-ezrYVn.js} +72540 -72295
- package/dist/index.min.js +40 -39
- package/dist/{jpeg-B-udBgEy.js → jpeg-B8XmXhIa.js} +14 -14
- package/dist/{lerc-C__sKrTH.js → lerc-De9HQWG7.js} +1 -1
- package/dist/living_room-uy_CEYZC.js +11 -0
- package/dist/{lzw-CtJXYMNt.js → lzw-Bhsi2mhO.js} +10 -10
- package/dist/meeting_room-BjXC3fLc.js +11 -0
- package/dist/music_room-AFchga9Y.js +11 -0
- package/dist/office_large-qDeoZNBo.js +11 -0
- package/dist/office_small-B_PLvrYC.js +11 -0
- package/dist/packbits-D5ce5JVI.js +24 -0
- package/dist/raw-C1PbNQtJ.js +9 -0
- package/dist/ray-grab-BbmztB1N.js +3714 -0
- package/dist/{webimage-CXsNm_Gt.js → webimage-BoWu99dN.js} +1 -1
- package/dist/xrStore-BIllgY4M.js +10 -0
- package/dist-tsc/BiomarkerSelect.d.ts +1 -1
- package/dist-tsc/BiomarkerSelect.d.ts.map +1 -1
- package/dist-tsc/ComparativeConfig.d.ts +2 -2
- package/dist-tsc/ComparativeConfig.d.ts.map +1 -1
- package/dist-tsc/UncontrolledComparative.d.ts +1 -1
- package/dist-tsc/UncontrolledComparative.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/OrbitControls-CTwuQBHm.js +0 -6202
- package/dist/index-Cl09bGJd.js +0 -6178
- package/dist/packbits-DapYEvYC.js +0 -24
- package/dist/raw-DacX-0Ky.js +0 -9
- package/dist/troika-three-text.esm-CDlWralX.js +0 -4192
|
@@ -0,0 +1,137 @@
|
|
|
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 { M as Se, s as ie } from "./ray-grab-BbmztB1N.js";
|
|
4
|
+
import { M as xe, V as g, F as oe, a as X } from "./index-d-ezrYVn.js";
|
|
5
|
+
import { i as be, M as K, s as se, B as Fe } from "./index-Cor41Qpl.js";
|
|
6
|
+
import { u as ye, a as Le } from "./OrbitControls-4708Bo-O.js";
|
|
7
|
+
function Be(l, o) {
|
|
8
|
+
return l.get(o);
|
|
9
|
+
}
|
|
10
|
+
function H(l, o, B, P) {
|
|
11
|
+
if (!l?.inputSource?.hand)
|
|
12
|
+
return null;
|
|
13
|
+
const t = Be(l.inputSource.hand, o);
|
|
14
|
+
if (!t)
|
|
15
|
+
return null;
|
|
16
|
+
const i = B.getJointPose?.(t, P);
|
|
17
|
+
return i ? new g(i.transform.position.x, i.transform.position.y, i.transform.position.z) : null;
|
|
18
|
+
}
|
|
19
|
+
function z(l, o, B, P = 0.02) {
|
|
20
|
+
const t = H(l, "thumb-tip", o, B), i = H(l, "index-finger-tip", o, B);
|
|
21
|
+
return !t || !i ? !1 : t.distanceTo(i) < P;
|
|
22
|
+
}
|
|
23
|
+
function Ee(l) {
|
|
24
|
+
const { segmentationGroup: o, segmentationSettings: B, segmentationSceneScale: P, renderingSettings: t, materialRef: i, highlightEntity: ce, setObsHighlight: R } = l, T = r(null), ae = r(null), s = r(null), f = r(null);
|
|
25
|
+
r(new xe());
|
|
26
|
+
const w = r(null), S = r(null), E = r(0), p = r(/* @__PURE__ */ new Map()), b = Se((e) => e.session) != null;
|
|
27
|
+
Pe(() => {
|
|
28
|
+
i?.current?.material?.uniforms?.u_physical_Pixel && (i.current.material.uniforms.u_physical_Pixel.value = b ? 0.2 : 2.5);
|
|
29
|
+
}, [b, i]);
|
|
30
|
+
const { scene: N, gl: le } = ye(), V = ie("hand", "right"), U = ie("hand", "left"), [W, k] = L(!1), [A, q] = L(!1), [ue, Q] = L(!1), [J, D] = L({
|
|
31
|
+
startPoint: new g(),
|
|
32
|
+
midPoint: new g(),
|
|
33
|
+
endPoint: new g(),
|
|
34
|
+
setStartPoint: !1,
|
|
35
|
+
setEndPoint: !1
|
|
36
|
+
}), [O, de] = L([]), [Y, C] = L(0), Z = r(W);
|
|
37
|
+
Z.current = W;
|
|
38
|
+
const $ = r(A);
|
|
39
|
+
$.current = A;
|
|
40
|
+
const ee = r(J);
|
|
41
|
+
ee.current = J;
|
|
42
|
+
const fe = r(O);
|
|
43
|
+
fe.current = O;
|
|
44
|
+
const te = r(Y);
|
|
45
|
+
te.current = Y, Le((e, F, c) => {
|
|
46
|
+
if (!b || !c)
|
|
47
|
+
return;
|
|
48
|
+
const a = le.xr.getReferenceSpace();
|
|
49
|
+
if (!a)
|
|
50
|
+
return;
|
|
51
|
+
const x = N.getObjectByName("rightTipBbox"), v = N.getObjectByName("leftTipBbox");
|
|
52
|
+
if (!x || !v)
|
|
53
|
+
return;
|
|
54
|
+
const G = new X().setFromObject(v), I = new X().setFromObject(x);
|
|
55
|
+
let _ = !1;
|
|
56
|
+
C((d) => d - 1), G.intersectsBox(I) && G.max.x !== -I.min.x && (k(!0), Q(!0), D({
|
|
57
|
+
startPoint: new g(),
|
|
58
|
+
midPoint: new g(),
|
|
59
|
+
endPoint: new g(),
|
|
60
|
+
setStartPoint: !1,
|
|
61
|
+
setEndPoint: !1
|
|
62
|
+
}));
|
|
63
|
+
const ge = Z.current, u = ee.current;
|
|
64
|
+
if (ge) {
|
|
65
|
+
let d = H(U, "index-finger-tip", c, a), M = H(V, "index-finger-tip", c, a);
|
|
66
|
+
if (!d || !M)
|
|
67
|
+
return;
|
|
68
|
+
s.current && (d = d.applyMatrix4(s.current.matrixWorld.clone().invert()), M = M.applyMatrix4(s.current.matrixWorld.clone().invert()));
|
|
69
|
+
let j = d.clone(), y = M.clone();
|
|
70
|
+
u.setStartPoint && (j = u.startPoint), u.setEndPoint && (y = u.endPoint), D({
|
|
71
|
+
startPoint: j,
|
|
72
|
+
midPoint: new g().addVectors(j, y).multiplyScalar(0.5),
|
|
73
|
+
endPoint: y,
|
|
74
|
+
setStartPoint: u.setStartPoint,
|
|
75
|
+
setEndPoint: u.setEndPoint
|
|
76
|
+
}), z(V, c, a) && D((h) => ({
|
|
77
|
+
...h,
|
|
78
|
+
setEndPoint: !0
|
|
79
|
+
})), z(U, c, a) && D((h) => ({
|
|
80
|
+
...h,
|
|
81
|
+
setStartPoint: !0
|
|
82
|
+
})), u.setStartPoint && u.setEndPoint && (de((h) => [...h, u]), Q(!1), k(!1), C(8));
|
|
83
|
+
} else if (te.current <= 0 && T.current && b) {
|
|
84
|
+
const d = T.current;
|
|
85
|
+
d.children[0].children.forEach((M, j) => {
|
|
86
|
+
const y = d.children[0].children[j], h = new X().setFromObject(y), ne = G.intersectsBox(h), re = I.intersectsBox(h);
|
|
87
|
+
(ne || re) && (_ = !0, R(y.name), q(!0), ne && z(U, c, a) && (C(10), _ = !1), re && z(V, c, a) && (C(10), _ = !1));
|
|
88
|
+
}), !_ && $.current && (R(null), q(!1));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const pe = (e) => {
|
|
92
|
+
if (b) {
|
|
93
|
+
if (e.stopPropagation(), e.target.setPointerCapture(e.pointerId), f.current === null)
|
|
94
|
+
f.current = e.pointerId, p.current.set(e.pointerId, e.point.clone()), s.current && (w.current = s.current.scale.clone());
|
|
95
|
+
else if (S.current === null && e.pointerId !== f.current) {
|
|
96
|
+
S.current = e.pointerId, p.current.set(e.pointerId, e.point.clone());
|
|
97
|
+
const F = p.current.get(f.current), c = e.point;
|
|
98
|
+
F && (E.current = F.distanceTo(c)), s.current && (w.current = s.current.scale.clone());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, he = (e) => {
|
|
102
|
+
e.target.releasePointerCapture(e.pointerId), p.current.delete(e.pointerId), f.current === e.pointerId && (f.current = null, w.current = null), S.current === e.pointerId && (S.current = null, E.current = 0);
|
|
103
|
+
}, me = (e) => {
|
|
104
|
+
if (!s.current || !e.point)
|
|
105
|
+
return;
|
|
106
|
+
const F = f.current === e.pointerId, c = S.current === e.pointerId;
|
|
107
|
+
if (!F && !c)
|
|
108
|
+
return;
|
|
109
|
+
const a = p.current.get(e.pointerId);
|
|
110
|
+
if (p.current.set(e.pointerId, e.point.clone()), S.current !== null && E.current > 0 && w.current) {
|
|
111
|
+
const x = p.current.get(f.current), v = p.current.get(S.current);
|
|
112
|
+
if (x && v) {
|
|
113
|
+
const I = x.distanceTo(v) / E.current;
|
|
114
|
+
s.current.scale.copy(w.current).multiplyScalar(I);
|
|
115
|
+
}
|
|
116
|
+
} else if (F && a) {
|
|
117
|
+
const x = e.point.clone().sub(a);
|
|
118
|
+
s.current.position.add(x);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
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: [
|
|
122
|
+
2e-3 * P[0],
|
|
123
|
+
2e-3 * P[1],
|
|
124
|
+
2e-3 * P[2]
|
|
125
|
+
] })] }) : 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: [
|
|
126
|
+
2e-3 * t.meshScale[0],
|
|
127
|
+
2e-3 * t.meshScale[1],
|
|
128
|
+
2e-3 * t.meshScale[2]
|
|
129
|
+
], ref: i, children: [be(t.geometrySize) && n("boxGeometry", { args: t.geometrySize }), n("shaderMaterial", { customProgramCacheKey: () => "1", side: oe, 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: J, 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 }, se(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(Fe, { firstHitOnly: !0, children: n("primitive", { ref: T, object: o, position: [0, 0, 0], onClick: (e) => {
|
|
130
|
+
e.object.parent?.userData.name === "finalPass" && ce(e.object.name, e.object.userData.layerScope, e.object.userData.channelScope);
|
|
131
|
+
}, onPointerOver: (e) => {
|
|
132
|
+
R(e.object.name);
|
|
133
|
+
}, onPointerOut: () => R(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: oe, 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 }, se(e))) })] });
|
|
134
|
+
}
|
|
135
|
+
export {
|
|
136
|
+
Ee as default
|
|
137
|
+
};
|