@vitessce/all 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.
@@ -3,8 +3,7 @@ import { useRef, useEffect, useState } from "react";
3
3
  import { useThree, useFrame } from "@react-three/fiber";
4
4
  import { Bvh } from "@react-three/drei";
5
5
  import { Matrix4, Vector3, Box3, FrontSide } from "three";
6
- import { g as getXRModule, i as isValidGeometrySize, M as MeasureLine, s as stringifyLineData } from "./index-DG1OhQF2.js";
7
- const { useXR, useXRInputSourceState } = getXRModule();
6
+ import { g as getXRModule, i as isValidGeometrySize, M as MeasureLine, s as stringifyLineData } from "./index-B8xbImKw.js";
8
7
  function getHandJoint(hand, jointName) {
9
8
  return hand.get(jointName);
10
9
  }
@@ -27,6 +26,7 @@ function isPinching(hand, frame, refSpace, threshold = 0.02) {
27
26
  return thumbPos.distanceTo(indexPos) < threshold;
28
27
  }
29
28
  function GeometryAndMeshXR(props) {
29
+ const { useXR, useXRInputSourceState } = getXRModule();
30
30
  const { segmentationGroup, segmentationSettings, segmentationSceneScale, renderingSettings, materialRef, highlightEntity, setObsHighlight } = props;
31
31
  const model = useRef(null);
32
32
  const distanceRef = useRef(null);
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
- import { a as getDefaultExportFromCjs, d as requireAssign, f as require_export, h as require_core, j as require_fails, k as require_toObject, m as require_objectKeys, n as require_cof, o as require_wks, p as require_iterators, q as requireWeb_dom_iterable, s as requireEs6_string_iterator, t as require_anObject, v as require_hide, w as require_ctx, x as require_toLength, y as require_global, z as require_objectDp, A as require_descriptors, D as require_isObject, E as require_objectCreate, F as require_iterDefine, G as require_iterStep, H as require_meta, I as require_isArray, J as require_iobject, K as require_setToStringTag, M as require_aFunction, N as requireIterator, O as require_propertyDesc, c as commonjsGlobal, P as requireEs6_symbol, Q as requireDefineProperty, R as require_toIobject, S as require_objectGopd, T as require_html, U as require_domCreate, V as require_library, W as requireSymbol, X as require_objectPie, Y as require_has, Z as require_redefine, _ as require_objectAssign, $ as GREY_HEX, a0 as diffCameraState } from "./index-Bmbsroxo.js";
3
+ import { a as getDefaultExportFromCjs, d as requireAssign, f as require_export, h as require_core, j as require_fails, k as require_toObject, m as require_objectKeys, n as require_cof, o as require_wks, p as require_iterators, q as requireWeb_dom_iterable, s as requireEs6_string_iterator, t as require_anObject, v as require_hide, w as require_ctx, x as require_toLength, y as require_global, z as require_objectDp, A as require_descriptors, D as require_isObject, E as require_objectCreate, F as require_iterDefine, G as require_iterStep, H as require_meta, I as require_isArray, J as require_iobject, K as require_setToStringTag, M as require_aFunction, N as requireIterator, O as require_propertyDesc, c as commonjsGlobal, P as requireEs6_symbol, Q as requireDefineProperty, R as require_toIobject, S as require_objectGopd, T as require_html, U as require_domCreate, V as require_library, W as requireSymbol, X as require_objectPie, Y as require_has, Z as require_redefine, _ as require_objectAssign, $ as GREY_HEX, a0 as diffCameraState } from "./index-CzTdHRMx.js";
4
4
  var assignExports = requireAssign();
5
5
  const _Object$assign = /* @__PURE__ */ getDefaultExportFromCjs(assignExports);
6
6
  var es6_object_keys = {};
@@ -4648,7 +4648,7 @@ const annotationPropertyTypeHandlers = {
4648
4648
  },
4649
4649
  "int8": {
4650
4650
  serializedBytes() {
4651
- return 2;
4651
+ return 1;
4652
4652
  },
4653
4653
  alignment() {
4654
4654
  return 1;
@@ -12163,17 +12163,21 @@ function updateFixedCurPositionInChunks(tsource, globalPosition, localPosition)
12163
12163
  const curPositionInChunks = tsource.curPositionInChunks, fixedPositionWithinChunk = tsource.fixedPositionWithinChunk;
12164
12164
  const nonDisplayLowerClipBound = tsource.nonDisplayLowerClipBound, nonDisplayUpperClipBound = tsource.nonDisplayUpperClipBound;
12165
12165
  var _tsource$source$spec = tsource.source.spec;
12166
- const rank = _tsource$source$spec.rank, chunkDataSize = _tsource$source$spec.chunkDataSize;
12166
+ const rank = _tsource$source$spec.rank, chunkDataSize = _tsource$source$spec.chunkDataSize, lowerChunkBound = _tsource$source$spec.lowerChunkBound, upperChunkBound = _tsource$source$spec.upperChunkBound;
12167
12167
  if (!getChunkPositionFromCombinedGlobalLocalPositions(curPositionInChunks, globalPosition, localPosition, tsource.layerRank, tsource.fixedLayerToChunkTransform)) {
12168
12168
  return false;
12169
12169
  }
12170
+ const EPSILON2 = 1e-3;
12170
12171
  for (let chunkDim = 0; chunkDim < rank; ++chunkDim) {
12171
12172
  const x = curPositionInChunks[chunkDim];
12172
- if (x < nonDisplayLowerClipBound[chunkDim] || x >= nonDisplayUpperClipBound[chunkDim]) {
12173
+ if (x < nonDisplayLowerClipBound[chunkDim] - EPSILON2 || x > nonDisplayUpperClipBound[chunkDim] + EPSILON2) {
12173
12174
  return false;
12174
12175
  }
12175
12176
  const chunkSize = chunkDataSize[chunkDim];
12176
- const chunk = curPositionInChunks[chunkDim] = Math.floor(x / chunkSize);
12177
+ const chunk = curPositionInChunks[chunkDim] = Math.min(
12178
+ upperChunkBound[chunkDim] - 1,
12179
+ Math.max(lowerChunkBound[chunkDim], Math.floor(x / chunkSize))
12180
+ );
12177
12181
  fixedPositionWithinChunk[chunkDim] = x - chunk * chunkSize;
12178
12182
  }
12179
12183
  return true;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
- import { x as xrStore } from "./xrStore-CIMJKmPR.js";
3
+ import { g as getXrStore } from "./xrStore--BrpHLm6.js";
4
4
  function XREnterButton() {
5
5
  const [supported, setSupported] = useState(false);
6
6
  const [entered, setEntered] = useState(false);
@@ -18,7 +18,7 @@ function XREnterButton() {
18
18
  };
19
19
  }, []);
20
20
  useEffect(() => {
21
- const unsubscribe = xrStore.subscribe((state) => {
21
+ const unsubscribe = getXrStore().subscribe((state) => {
22
22
  setEntered(state.session != null);
23
23
  });
24
24
  return unsubscribe;
@@ -27,11 +27,11 @@ function XREnterButton() {
27
27
  return null;
28
28
  const handleClick = () => {
29
29
  if (entered) {
30
- const { session } = xrStore.getState();
30
+ const { session } = getXrStore().getState();
31
31
  if (session)
32
32
  session.end();
33
33
  } else {
34
- xrStore.enterAR();
34
+ getXrStore().enterAR();
35
35
  }
36
36
  };
37
37
  return jsx("button", { type: "button", onClick: handleClick, style: {
@@ -1,12 +1,12 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useRef } from "react";
3
3
  import { useThree, useFrame } from "@react-three/fiber";
4
- import { g as getXRModule } from "./index-DG1OhQF2.js";
5
- const { useXRInputSourceState } = getXRModule();
4
+ import { g as getXRModule } from "./index-B8xbImKw.js";
6
5
  function getHandJoint(hand, jointName) {
7
6
  return hand.get(jointName);
8
7
  }
9
8
  function HandBbox() {
9
+ const { useXRInputSourceState } = getXRModule();
10
10
  const rightHand = useXRInputSourceState("hand", "right");
11
11
  const leftHand = useXRInputSourceState("hand", "left");
12
12
  const rightTipRef = useRef(null);
@@ -39,8 +39,8 @@ function HandBbox() {
39
39
  });
40
40
  return jsxs(Fragment, { children: [jsxs("mesh", { name: "leftTipBbox", ref: leftTipRef, children: [jsx("boxGeometry", { args: [0.02, 0.02, 0.02] }), jsx("meshStandardMaterial", { color: "blue", transparent: true, opacity: 0 })] }), jsxs("mesh", { name: "rightTipBbox", ref: rightTipRef, children: [jsx("boxGeometry", { args: [0.02, 0.02, 0.02] }), jsx("meshStandardMaterial", { color: "orange", transparent: true, opacity: 0 })] })] });
41
41
  }
42
- const { useXR } = getXRModule();
43
42
  function HandDecorate() {
43
+ const { useXR } = getXRModule();
44
44
  const session = useXR((state) => state.session);
45
45
  const { scene } = useThree();
46
46
  useFrame(() => {
@@ -0,0 +1,10 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { g as getXRModule } from "./index-B8xbImKw.js";
3
+ import { g as getXrStore } from "./xrStore--BrpHLm6.js";
4
+ function XRWrapper({ children }) {
5
+ const { XR } = getXRModule();
6
+ return jsx(XR, { store: getXrStore(), children });
7
+ }
8
+ export {
9
+ XRWrapper as default
10
+ };
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-Bmbsroxo.js";
2
+ import { B as BaseDecoder } from "./index-CzTdHRMx.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import React__default, { createContext, isValidElement, PureComponent, Component, useMemo, useState, useRef, useEffect, useCallback, memo, useContext, useReducer, useLayoutEffect } from "react";
3
- import { r as requireObjectAssign, a as getDefaultExportFromCjs$1, c as commonjsGlobal, e as earcut } from "./index-Bmbsroxo.js";
3
+ import { r as requireObjectAssign, a as getDefaultExportFromCjs$1, c as commonjsGlobal, e as earcut } from "./index-CzTdHRMx.js";
4
4
  import ReactDOM__default, { unstable_batchedUpdates, createPortal } from "react-dom";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  function finallyConstructor(callback) {
@@ -3,7 +3,7 @@ import React__default, { useRef, useState, useEffect, Suspense, forwardRef } fro
3
3
  import { Canvas } from "@react-three/fiber";
4
4
  import { Center, Text, Line, Bvh, OrbitControls } from "@react-three/drei";
5
5
  import { Matrix3, Matrix4, Vector3, Vector2, UniformsUtils, Data3DTexture, RedFormat, FloatType, LinearFilter, FrontSide, Scene, Group, MeshPhysicalMaterial, MeshBasicMaterial, MeshStandardMaterial, BackSide } from "three";
6
- import { C as CoordinationType, g as getImageSize } from "./index-Bmbsroxo.js";
6
+ import { C as CoordinationType, g as getImageSize } from "./index-CzTdHRMx.js";
7
7
  function MeasureLine({ currentLine, scale }) {
8
8
  const textRef = useRef(null);
9
9
  return jsxs("group", { children: [jsx(Center, { bottom: true, right: true, position: [currentLine.midPoint.x, currentLine.midPoint.y, currentLine.midPoint.z], rotation: [0, 0, 0], children: jsx(Text, { color: "gray", scale: 0.05, ref: textRef, children: `${(currentLine.startPoint.distanceTo(currentLine.endPoint) * scale).toFixed(2)} µm` }) }), jsx(Line, {
@@ -945,8 +945,8 @@ function GeometryAndMesh(props) {
945
945
  setObsHighlight(e.object.name);
946
946
  }, onPointerOut: () => setObsHighlight(null) }) })] }) : null, renderingSettings.uniforms && renderingSettings.shader && renderingSettings.meshScale && renderingSettings.geometrySize ? jsx("group", { children: jsxs("mesh", { scale: renderingSettings.meshScale, ref: materialRef, children: [jsx("boxGeometry", { args: renderingSettings.geometrySize }), jsx("shaderMaterial", { customProgramCacheKey: () => "1", side: FrontSide, uniforms: renderingSettings.uniforms, needsUpdate: true, transparent: true, vertexShader: renderingSettings.shader.vertexShader, fragmentShader: renderingSettings.shader.fragmentShader })] }) }) : null] }), jsx("group", { name: "lines", children: lines.map((object) => jsx(MeasureLine, { currentLine: object, scale: 1 }, stringifyLineData(object))) })] });
947
947
  }
948
- const LazyGeometryAndMeshXR = React__default.lazy(() => import("./GeometryAndMeshXR-C6kmHlO-.js").catch(() => ({ default: GeometryAndMesh })));
949
- const LazyXRSceneComponents = React__default.lazy(() => import("./XRSceneComponents-TgABwiay.js").catch(() => ({ default: () => null })));
948
+ const LazyGeometryAndMeshXR = React__default.lazy(() => import("./GeometryAndMeshXR-Caba1QEa.js").catch(() => ({ default: GeometryAndMesh })));
949
+ const LazyXRSceneComponents = React__default.lazy(() => import("./XRSceneComponents-Dgayh6-j.js").catch(() => ({ default: () => null })));
950
950
  function SpatialThree(props) {
951
951
  const materialRef = useRef(null);
952
952
  const orbitRef = useRef(null);
@@ -1303,13 +1303,13 @@ function getXRModule() {
1303
1303
  }
1304
1304
  const LazyXRWrapper = React__default.lazy(
1305
1305
  // eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
1306
- () => import("./XRWrapper-5X3Se-wN.js").catch(() => ({
1306
+ () => import("./XRWrapper-BrRGN2E4.js").catch(() => ({
1307
1307
  default: ({ children }) => children
1308
1308
  }))
1309
1309
  );
1310
1310
  const LazyXREnterButton = React__default.lazy(
1311
1311
  // eslint-disable-next-line implicit-arrow-linebreak, function-paren-newline
1312
- () => import("./XREnterButton-YHfoEyJU.js").catch(() => ({
1312
+ () => import("./XREnterButton-C7Q7e8rD.js").catch(() => ({
1313
1313
  default: () => null
1314
1314
  }))
1315
1315
  );
@@ -4,7 +4,7 @@ import { useThree, useFrame, Canvas } from "@react-three/fiber";
4
4
  import { OrbitControls } from "@react-three/drei";
5
5
  import * as THREE from "three";
6
6
  import { Data3DTexture, RedFormat, UnsignedByteType, LinearFilter, RedIntegerFormat, UnsignedIntType, NearestFilter, Vector3, Vector2, Vector4, UniformsUtils } from "three";
7
- import { l as log, i as isEqual, C as CoordinationType, u as useEventCallback } from "./index-Bmbsroxo.js";
7
+ import { l as log, i as isEqual, C as CoordinationType, u as useEventCallback } from "./index-CzTdHRMx.js";
8
8
  const LogLevel = {
9
9
  INFO: "info",
10
10
  WARN: "warn",