vitessce 4.0.6 → 4.0.8
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-hu4vTmhX.js +137 -0
- package/dist/{ReactNeuroglancer-BfWBfio7.js → ReactNeuroglancer-D23wA2dj.js} +12 -8
- package/dist/{XREnterButton-Ds1SaRw_.js → XREnterButton-ByL8QeQS.js} +4 -4
- package/dist/XRSceneComponents-CDR8ACQQ.js +48 -0
- package/dist/XRWrapper-U1L_BOLE.js +10 -0
- package/dist/{deflate-DFY3qUSs.js → deflate-Dh0jEfBC.js} +1 -1
- package/dist/{higlass-Cqc7iZHl.js → higlass-DA81W_V1.js} +1 -1
- package/dist/{index-DKTi-cuf.js → index-CO_38kOj.js} +1 -1
- package/dist/{index-D3bLRjD6.js → index-CjKdDvZm.js} +4 -4
- package/dist/{index-2wuvrL8L.js → index-psiMcK01.js} +23534 -23462
- package/dist/index.min.js +1 -1
- package/dist/{jpeg-BPnskwPq.js → jpeg-C9uF6xN7.js} +1 -1
- package/dist/{lerc-Dg1VM0xG.js → lerc-C5QpsPgI.js} +1 -1
- package/dist/{lzw-Dzg6FzWL.js → lzw-DiWnyk0G.js} +1 -1
- package/dist/{packbits-DyFavsT7.js → packbits-CU33I0V2.js} +1 -1
- package/dist/{raw-CQtNhR7F.js → raw-Cxilss4K.js} +1 -1
- package/dist/{webimage-DSY7WB8f.js → webimage-ZflXxTBy.js} +1 -1
- package/dist/xrStore-C2hgPci8.js +11 -0
- package/package.json +7 -7
- package/dist/GeometryAndMeshXR-b-X0Zzj-.js +0 -138
- package/dist/XRSceneComponents-DWGzfOk0.js +0 -50
- package/dist/XRWrapper-D4MLfydV.js +0 -10
- package/dist/xrStore-JZVFnWDG.js +0 -8
package/dist/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ag as i, ab as n, a9 as t, aa as r, ak as p, al as l, ac as d, ax as C, av as c, at as u, aw as g, au as T, a8 as y, as as S, ad as m, a7 as P, a6 as f, ar as F, ai as I, ao as N, ah as _, aj as x, an as A, am as V, af as w, ap as E, aq as G, aC as H, aF as M, az as O, aG as U, aH as h, aA as v, aD as z, aE as L, aB as B, ae as D, ay as Y } from "./index-
|
|
1
|
+
import { ag as i, ab as n, a9 as t, aa as r, ak as p, al as l, ac as d, ax as C, av as c, at as u, aw as g, au as T, a8 as y, as as S, ad as m, a7 as P, a6 as f, ar as F, ai as I, ao as N, ah as _, aj as x, an as A, am as V, af as w, ap as E, aq as G, aC as H, aF as M, az as O, aG as U, aH as h, aA as v, aD as z, aE as L, aB as B, ae as D, ay as Y } from "./index-psiMcK01.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
export {
|
|
@@ -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-
|
|
2
|
+
import { b as DA, B as nA, c as fA, d as gA } from "./index-psiMcK01.js";
|
|
3
3
|
var BA = { exports: {} }, iA;
|
|
4
4
|
function tA() {
|
|
5
5
|
return iA || (iA = 1, function(j) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitessce",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@vitessce/abstract": "4.0.
|
|
20
|
-
"@vitessce/error": "4.0.
|
|
21
|
-
"@vitessce/
|
|
22
|
-
"@vitessce/all": "4.0.
|
|
23
|
-
"@vitessce/
|
|
24
|
-
"@vitessce/
|
|
19
|
+
"@vitessce/abstract": "4.0.8",
|
|
20
|
+
"@vitessce/error": "4.0.8",
|
|
21
|
+
"@vitessce/constants": "4.0.8",
|
|
22
|
+
"@vitessce/all": "4.0.8",
|
|
23
|
+
"@vitessce/export-utils": "4.0.8",
|
|
24
|
+
"@vitessce/config": "4.0.8"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@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-D3bLRjD6.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-D3bLRjD6.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-D3bLRjD6.js";
|
|
3
|
-
import { x as e } from "./xrStore-JZVFnWDG.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
|
-
};
|