@vitessce/comparative 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.
Files changed (33) hide show
  1. package/dist/GeometryAndMeshXR-Czj8vHZc.js +137 -0
  2. package/dist/{ReactNeuroglancer-CbPe9WCz.js → ReactNeuroglancer-a-ZxN2yP.js} +12 -8
  3. package/dist/{XREnterButton-DtiXB-74.js → XREnterButton-I6uowpW7.js} +4 -4
  4. package/dist/XRSceneComponents-DKq4yR3G.js +48 -0
  5. package/dist/XRWrapper-BYpD9gRj.js +10 -0
  6. package/dist/{deflate-BxTfKZza.js → deflate-BsAMUoGX.js} +1 -1
  7. package/dist/{higlass-_VCBPyLz.js → higlass-CaFDdo3T.js} +1 -1
  8. package/dist/{index-DeTFenDS.js → index-CgUij3tX.js} +1 -1
  9. package/dist/{index-C1X7v-Zh.js → index-DE6moyYb.js} +40005 -39947
  10. package/dist/{index-BtgW7VSe.js → index-l9xLf9qw.js} +4 -4
  11. package/dist/index.min.js +1 -1
  12. package/dist/{jpeg-CX3NedG6.js → jpeg-pwtWOHdF.js} +1 -1
  13. package/dist/{lerc-CJWWMGcc.js → lerc-zRJk5Jb9.js} +1 -1
  14. package/dist/{lzw-DlfK1XQl.js → lzw--NaCYq4J.js} +1 -1
  15. package/dist/{packbits-DJF923C1.js → packbits-CLBWwNRB.js} +1 -1
  16. package/dist/{raw-TIuLKEwd.js → raw-CJbqnGFa.js} +1 -1
  17. package/dist/{webimage-mn-K6LQl.js → webimage-CPz1oQzQ.js} +1 -1
  18. package/dist/xrStore-1uKA7v5e.js +11 -0
  19. package/dist-tsc/BiomarkerSelect.js +1 -1
  20. package/dist-tsc/BiomarkerSelect.js.map +1 -1
  21. package/dist-tsc/ComparativeConfig.d.ts.map +1 -1
  22. package/dist-tsc/ComparativeConfig.js +38 -14
  23. package/dist-tsc/ComparativeConfig.js.map +1 -1
  24. package/dist-tsc/ControlledComparative.js +1 -1
  25. package/dist-tsc/ControlledComparative.js.map +1 -1
  26. package/package.json +11 -11
  27. package/src/BiomarkerSelect.jsx +1 -1
  28. package/src/ComparativeConfig.jsx +69 -28
  29. package/src/ControlledComparative.jsx +1 -1
  30. package/dist/GeometryAndMeshXR-RzGniQ1I.js +0 -138
  31. package/dist/XRSceneComponents-DqrHOYfC.js +0 -50
  32. package/dist/XRWrapper-BSYvV6ZL.js +0 -10
  33. package/dist/xrStore-D1fXVa3V.js +0 -8
@@ -8,6 +8,7 @@ import {
8
8
  VitessceConfig,
9
9
  hconcat,
10
10
  vconcat,
11
+ CoordinationLevel as CL,
11
12
  } from '@vitessce/config';
12
13
  import { usePageModeView } from '@vitessce/vit-s';
13
14
  import Sticky from 'react-sticky-el';
@@ -136,8 +137,7 @@ export function generateComparativeConfig(baseUrl, isBiomarkerSelectOnly) {
136
137
  })
137
138
  .addFile({
138
139
  fileType: 'anndata.zarr',
139
- // TODO: fix obs/subclass_l1 column
140
- url: 'https://data-2.vitessce.io/kpmp-atlas-v2/sn-rna-seq/processed/kpmp-june-2026.adata.zarr',
140
+ url: baseUrl,
141
141
  coordinationValues: {
142
142
  obsType: 'cell',
143
143
  featureType: 'gene',
@@ -154,10 +154,10 @@ export function generateComparativeConfig(baseUrl, isBiomarkerSelectOnly) {
154
154
  name: 'Subclass L2',
155
155
  path: 'obs/subclass_l2',
156
156
  },
157
- {
157
+ /* {
158
158
  name: 'Subclass L3',
159
159
  path: 'obs/subclass_l3',
160
- },
160
+ }, */
161
161
  /* {
162
162
  name: 'Donor ID',
163
163
  path: 'obs/patient',
@@ -222,6 +222,21 @@ export function generateComparativeConfig(baseUrl, isBiomarkerSelectOnly) {
222
222
  },
223
223
  );
224
224
 
225
+ const [multiObsSetSelectionScope] = vc.addCoordination(
226
+ {
227
+ cType: 'obsSetSelection',
228
+ cScope: '__multi__',
229
+ cValue: null,
230
+ },
231
+ );
232
+ const [singleObsSetSelectionScope] = vc.addCoordination(
233
+ {
234
+ cType: 'obsSetSelection',
235
+ cScope: '__single__',
236
+ cValue: null,
237
+ },
238
+ );
239
+
225
240
  if (isBiomarkerSelectOnly) {
226
241
  const biomarkerSelect = vc.addView(dataset, 'biomarkerSelectAlt', { uid: 'biomarker-select' });
227
242
 
@@ -234,10 +249,14 @@ export function generateComparativeConfig(baseUrl, isBiomarkerSelectOnly) {
234
249
  vc.layout(biomarkerSelect);
235
250
  } else {
236
251
  const comparativeHeading = vc.addView(dataset, 'comparativeHeading', { uid: 'comparative-heading' });
237
- const dualScatterplot = vc.addView(dataset, 'dualScatterplot', { uid: 'scatterplot' }).setProps({ circleScaleFactor: 0.5 });
238
- const obsSets = vc.addView(dataset, 'obsSets', { uid: 'cell-sets' });
252
+ const dualScatterplot = vc.addView(dataset, 'dualScatterplot', { uid: 'scatterplot' }).setProps({
253
+ // TODO: this is a hack. adjust the Densmap extent in the pipeline itself
254
+ circleScaleFactor: baseUrl.includes('sn-rna-seq') ? 0.5 : 0.8,
255
+ });
256
+ const obsSets = vc.addView(dataset, 'obsSets', { uid: 'cell-sets' }).setProps({ title: 'Cell Types' });
257
+ const obsSetSelector = vc.addView(dataset, 'singleObsSetSelector', { uid: 'single-cell-set' });
239
258
  const sampleSets = vc.addView(dataset, 'sampleSetPairManager', { uid: 'sample-sets' });
240
- const obsSetSizes = vc.addView(dataset, 'obsSetSizes');
259
+ // const obsSetSizes = vc.addView(dataset, 'obsSetSizes');
241
260
  const featureList = vc.addView(dataset, 'featureList');
242
261
  const violinPlots = vc.addView(dataset, 'obsSetFeatureValueDistribution', { uid: 'violin-plot' });
243
262
  const dotPlot = vc.addView(dataset, 'dotPlot', { uid: 'dot-plot' });
@@ -255,11 +274,25 @@ export function generateComparativeConfig(baseUrl, isBiomarkerSelectOnly) {
255
274
  }, { meta: false });
256
275
 
257
276
 
258
- vc.linkViews([dualScatterplot, obsSets, obsSetSizes, featureList, violinPlots, dotPlot, treemap, volcanoPlot, volcanoPlotTable, comparativeHeading, obsSetCompositionBarPlot, featureSetEnrichmentBarPlot, sampleSets], ['sampleType'], ['sample']);
259
- vc.linkViewsByObject([dualScatterplot, obsSets, obsSetSizes, featureList, violinPlots, dotPlot, treemap, volcanoPlot, volcanoPlotTable, comparativeHeading, obsSetCompositionBarPlot, featureSetEnrichmentBarPlot, sampleSets], {
277
+ vc.linkViews([dualScatterplot, obsSets, featureList, violinPlots, dotPlot, treemap, volcanoPlot, volcanoPlotTable, comparativeHeading, obsSetCompositionBarPlot, featureSetEnrichmentBarPlot, sampleSets], ['sampleType'], ['sample']);
278
+ vc.linkViewsByObject([dualScatterplot, obsSets, featureList, violinPlots, dotPlot, treemap, volcanoPlot, volcanoPlotTable, comparativeHeading, obsSetCompositionBarPlot, featureSetEnrichmentBarPlot, sampleSets], {
260
279
  sampleSetSelection: sampleSetScope_caseControl,
261
280
  featureSelection: featureSelectionScope,
262
281
  }, { meta: false });
282
+
283
+ // Link all EXCEPT the volcano plot and the featureStatsTable to the multi obs set selection scope:
284
+ vc.linkViewsByObject([dualScatterplot, obsSets, featureList, violinPlots, dotPlot, treemap, comparativeHeading, obsSetCompositionBarPlot, featureSetEnrichmentBarPlot, sampleSets], {
285
+ obsSetSelection: multiObsSetSelectionScope,
286
+ }, { meta: false });
287
+ vc.linkViewsByObject([volcanoPlot, volcanoPlotTable], {
288
+ obsSetSelection: singleObsSetSelectionScope,
289
+ }, { meta: false });
290
+
291
+
292
+ // TODO: add a dedicated VitessceConfig method to avoid the need for this
293
+ // kind of "private" manipulation of the internals of the instance.
294
+ obsSetSelector.view.coordinationScopes.obsSetSelection = ['__multi__', '__single__'];
295
+
263
296
  vc.linkViewsByObject([dualScatterplot, violinPlots, featureList, dotPlot], {
264
297
  obsColorEncoding: 'geneSelection',
265
298
  featureValueColormap: 'greys',
@@ -278,7 +311,7 @@ export function generateComparativeConfig(baseUrl, isBiomarkerSelectOnly) {
278
311
  */
279
312
 
280
313
  vc.layout(hconcat(
281
- vconcat(dualScatterplot, comparativeHeading, obsSets, obsSetSizes),
314
+ vconcat(dualScatterplot, comparativeHeading, obsSets, obsSetSelector),
282
315
  vconcat(treemap, dotPlot, obsSetCompositionBarPlot, sampleSets),
283
316
  vconcat(volcanoPlotTable, featureList, featureSetEnrichmentBarPlot, violinPlots),
284
317
  ));
@@ -342,6 +375,7 @@ export function BiomarkerSelectPageComponent() {
342
375
  export function ComparativePageComponent() {
343
376
  const ComparativeHeading = usePageModeView('comparative-heading');
344
377
  const CellSets = usePageModeView('cell-sets');
378
+ const SingleCellSet = usePageModeView('single-cell-set');
345
379
  const SampleSets = usePageModeView('sample-sets');
346
380
  const DualScatterplot = usePageModeView('scatterplot');
347
381
  const ViolinPlot = usePageModeView('violin-plot');
@@ -430,12 +464,12 @@ export function ComparativePageComponent() {
430
464
  <DualScatterplot />
431
465
  </div>
432
466
  </div>
433
- <div className={clsx('view-row')}>
467
+ {/* <div className={clsx('view-row')}>
434
468
  <div className="view-row-left" />
435
469
  <div className="view-row-center">
436
470
  <Link component="button" href="#" variant="body2">Show analysis details</Link>
437
471
  </div>
438
- </div>
472
+ </div> */}
439
473
  <div className={clsx('view-row')}>
440
474
  <div className="view-row-left">
441
475
  <p className="tabs-description">Use the tabs to switch the visualization rendered below.</p>
@@ -460,30 +494,30 @@ export function ComparativePageComponent() {
460
494
  <Treemap />
461
495
  </div>
462
496
  </div>
463
- <div className={clsx('view-row')}>
497
+ {/* <div className={clsx('view-row')}>
464
498
  <div className="view-row-left" />
465
499
  <div className="view-row-center">
466
500
  <Link component="button" href="#" variant="body2">Show analysis details</Link>
467
501
  </div>
468
- </div>
502
+ </div> */}
469
503
  </>
470
504
  ) : null}
471
505
  {visTab === 1 ? (
472
506
  <>
473
507
  <div className={clsx('view-row', 'view-row-tall')}>
474
508
  <div className="view-row-left">
475
- <p>This view displays differential expression test results, performed using PyDESeq2 (Muzellec et al. 2023). <br /><br />Tests have only been run when each group contains at least 25 cells and at least three participants. Genes are filtered to those that are expressed above zero counts in at least half of the pseudobulked observations.<br /><br />The arrows on the bottom left and bottom right denote the direction of the effect. Click a point in the plot to select the corresponding gene. <br /><br />Note that differential expression tests have been run for each cell type separately, so the each gene can appear multiple times (once per cell type). If there are too many points on the plot, cell types can be selected to filter the points.</p>
509
+ <p>This view displays differential expression test results, performed using PyDESeq2 (Muzellec et al. 2023). <br /><br />Tests have only been run when each group contains at least 25 cells and at least three participants. Genes are filtered to those that are expressed above zero counts in at least half of the pseudobulked observations.<br /><br />The arrows on the bottom left and bottom right denote the direction of the effect. Click a point in the plot to select the corresponding gene.</p>
476
510
  </div>
477
511
  <div className="view-row-center">
478
512
  <VolcanoPlot />
479
513
  </div>
480
514
  </div>
481
- <div className={clsx('view-row')}>
515
+ {/* <div className={clsx('view-row')}>
482
516
  <div className="view-row-left" />
483
517
  <div className="view-row-center">
484
518
  <Link component="button" href="#" variant="body2">Show analysis details</Link>
485
519
  </div>
486
- </div>
520
+ </div> */}
487
521
  </>
488
522
  ) : null}
489
523
  {visTab === 2 ? (
@@ -496,12 +530,12 @@ export function ComparativePageComponent() {
496
530
  <DotPlot />
497
531
  </div>
498
532
  </div>
499
- <div className={clsx('view-row')}>
533
+ {/* <div className={clsx('view-row')}>
500
534
  <div className="view-row-left" />
501
535
  <div className="view-row-center">
502
536
  <Link component="button" href="#" variant="body2">Show analysis details</Link>
503
537
  </div>
504
- </div>
538
+ </div> */}
505
539
  </>
506
540
  ) : null}
507
541
  {visTab === 3 ? (
@@ -514,35 +548,38 @@ export function ComparativePageComponent() {
514
548
  <ViolinPlot />
515
549
  </div>
516
550
  </div>
517
- <div className={clsx('view-row')}>
551
+ {/* <div className={clsx('view-row')}>
518
552
  <div className="view-row-left" />
519
553
  <div className="view-row-center">
520
554
  <Link component="button" href="#" variant="body2">Show analysis details</Link>
521
555
  </div>
522
- </div>
556
+ </div> */}
523
557
  </>
524
558
  ) : null}
525
559
  {visTab === 4 ? (
526
560
  <>
527
561
  <div className={clsx('view-row', 'view-row-tall')}>
528
562
  <div className="view-row-left">
529
- <p>This view displays the results of a cell type composition analysis performed using the ScCODA algorithm (Büttner et al. 2021). Cell types with significantly different composition between the selected sample groups are displayed opaque while not-signficant results are displayed with transparent bars. The single outlined bar denotes the automatically-selected reference cell type.</p>
563
+ <p>This view displays the results of a cell type composition analysis performed using the ScCODA algorithm (Büttner et al. 2021).
564
+ <br /><br /> The NS annotation indicates cell types which do not significantly differ in their abundance between the selected conditions.
565
+ <br /><br /> The single outlined bar denotes the automatically-selected reference cell type.
566
+ </p>
530
567
  </div>
531
568
  <div className="view-row-center">
532
569
  <SccodaPlot />
533
570
  </div>
534
571
  </div>
535
- <div className={clsx('view-row')}>
572
+ {/* <div className={clsx('view-row')}>
536
573
  <div className="view-row-left" />
537
574
  <div className="view-row-center">
538
575
  <Link component="button" href="#" variant="body2">Show analysis details</Link>
539
576
  </div>
540
- </div>
577
+ </div> */}
541
578
  </>
542
579
  ) : null}
543
580
  {/* End plots; Begin tables */}
544
581
 
545
- <div className={clsx('view-row')}>
582
+ {/* <div className={clsx('view-row')}>
546
583
  <div className="view-row-left">
547
584
  <p className="tabs-description">Use the tabs to switch the table rendered below.</p>
548
585
  </div>
@@ -552,7 +589,7 @@ export function ComparativePageComponent() {
552
589
  <Tab label="Gene Set Enrichment Analysis Results" />
553
590
  </Tabs>
554
591
  </div>
555
- </div>
592
+ </div> */}
556
593
  {tableTab === 0 ? (
557
594
  <>
558
595
  <div className={clsx('view-row', 'view-row-tall')}>
@@ -563,12 +600,12 @@ export function ComparativePageComponent() {
563
600
  <VolcanoPlotTable />
564
601
  </div>
565
602
  </div>
566
- <div className={clsx('view-row')}>
603
+ {/* <div className={clsx('view-row')}>
567
604
  <div className="view-row-left" />
568
605
  <div className="view-row-center">
569
606
  <Link component="button" href="#" variant="body2">Show analysis details</Link>
570
607
  </div>
571
- </div>
608
+ </div> */}
572
609
  </>
573
610
  ) : null}
574
611
  {/* Add more tables once implemented (all gene DE results, GSEA results) */}
@@ -578,6 +615,10 @@ export function ComparativePageComponent() {
578
615
  <div className="view-row-right">
579
616
  <CellSets />
580
617
  </div>
618
+ <div className="view-row-right" style={{ marginTop: '10px' }}>
619
+ <SingleCellSet />
620
+ <p style={{ fontSize: '11px', textAlign: 'left' }}>Select a <strong>single</strong> cell type from among the multiple selected above. This selection determines what is shown in the volcano plot and the differential expression table.</p>
621
+ </div>
581
622
  {/*
582
623
  <div className="view-row-right">
583
624
  <SampleSets />
@@ -26,7 +26,7 @@ import { ComparativePageComponent, generateComparativeConfig } from './Comparati
26
26
  */
27
27
  export function ControlledComparative(props) {
28
28
  const {
29
- datasetUrl = 'https://data-2.vitessce.io/kpmp-atlas-v2/sn-rna-seq/processed/kpmp-june-2026.adata.zarr',
29
+ datasetUrl = 'https://data-2.vitessce.io/kpmp-atlas-v2/sc-rna-seq/processed/kpmp-aug-2026.adata.zarr',
30
30
  geneSelection,
31
31
  setGeneSelection,
32
32
  sampleSetSelection,
@@ -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-BtgW7VSe.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-BtgW7VSe.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-BtgW7VSe.js";
3
- import { x as e } from "./xrStore-D1fXVa3V.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-BtgW7VSe.js";
2
- const t = e().createXRStore({
3
- handTracking: !0,
4
- emulate: !1
5
- });
6
- export {
7
- t as x
8
- };