@vitessce/all 3.9.3 → 3.9.5

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.
@@ -1,7 +1,7 @@
1
- import { G as Group, M as Matrix4, T as TrianglesDrawMode, a as TriangleFanDrawMode, b as TriangleStripDrawMode, R as REVISION, L as Loader, c as LoaderUtils, F as FileLoader, d as MeshPhysicalMaterial, V as Vector2, C as Color, S as SpotLight, P as PointLight, D as DirectionalLight, e as Vector3, I as InstancedMesh, Q as Quaternion, O as Object3D, f as TextureLoader, g as ImageBitmapLoader, B as BufferAttribute, h as InterleavedBuffer, i as LinearMipmapLinearFilter, N as NearestMipmapLinearFilter, j as LinearMipmapNearestFilter, k as NearestMipmapNearestFilter, l as LinearFilter, m as NearestFilter, n as RepeatWrapping, o as MirroredRepeatWrapping, p as ClampToEdgeWrapping, q as PointsMaterial, r as Material, s as LineBasicMaterial, t as MeshStandardMaterial, u as DoubleSide, v as MeshBasicMaterial, w as PropertyBinding, x as BufferGeometry, y as SkinnedMesh, z as Mesh, A as LineSegments, E as Line$1, H as LineLoop, J as Points, K as PerspectiveCamera, U as MathUtils, W as OrthographicCamera, X as Skeleton, Y as InterpolateDiscrete, Z as InterpolateLinear, _ as AnimationClip, $ as Bone, a0 as InterleavedBufferAttribute, a1 as Texture, a2 as VectorKeyframeTrack, a3 as QuaternionKeyframeTrack, a4 as NumberKeyframeTrack, a5 as FrontSide, a6 as Interpolant, a7 as Box3, a8 as Sphere, a9 as InstancedBufferGeometry, aa as Float32BufferAttribute, ab as InstancedInterleavedBuffer, ac as WireframeGeometry, ad as ShaderMaterial, ae as UniformsUtils, af as UniformsLib, ag as Vector4, ah as Line3, ai as SphereGeometry, aj as _extends, ak as Plane, al as Triangle, am as BackSide, an as Ray$1, ao as jsxRuntimeExports, ap as Matrix3, aq as CoordinationType, ar as Data3DTexture, as as RedFormat, at as FloatType, au as getImageSize, av as Scene } from "./index-Bhio36zT.js";
1
+ import { G as Group, M as Matrix4, T as TrianglesDrawMode, a as TriangleFanDrawMode, b as TriangleStripDrawMode, R as REVISION, L as Loader, c as LoaderUtils, F as FileLoader, d as MeshPhysicalMaterial, V as Vector2, C as Color, S as SpotLight, P as PointLight, D as DirectionalLight, e as Vector3, I as InstancedMesh, Q as Quaternion, O as Object3D, f as TextureLoader, g as ImageBitmapLoader, B as BufferAttribute, h as InterleavedBuffer, i as LinearMipmapLinearFilter, N as NearestMipmapLinearFilter, j as LinearMipmapNearestFilter, k as NearestMipmapNearestFilter, l as LinearFilter, m as NearestFilter, n as RepeatWrapping, o as MirroredRepeatWrapping, p as ClampToEdgeWrapping, q as PointsMaterial, r as Material, s as LineBasicMaterial, t as MeshStandardMaterial, u as DoubleSide, v as MeshBasicMaterial, w as PropertyBinding, x as BufferGeometry, y as SkinnedMesh, z as Mesh, A as LineSegments, E as Line$1, H as LineLoop, J as Points, K as PerspectiveCamera, U as MathUtils, W as OrthographicCamera, X as Skeleton, Y as InterpolateDiscrete, Z as InterpolateLinear, _ as AnimationClip, $ as Bone, a0 as InterleavedBufferAttribute, a1 as Texture, a2 as VectorKeyframeTrack, a3 as QuaternionKeyframeTrack, a4 as NumberKeyframeTrack, a5 as FrontSide, a6 as Interpolant, a7 as Box3, a8 as Sphere, a9 as InstancedBufferGeometry, aa as Float32BufferAttribute, ab as InstancedInterleavedBuffer, ac as WireframeGeometry, ad as ShaderMaterial, ae as UniformsUtils, af as UniformsLib, ag as Vector4, ah as Line3, ai as SphereGeometry, aj as _extends, ak as Plane, al as Triangle, am as BackSide, an as Ray$1, ao as jsxRuntimeExports, ap as Matrix3, aq as CoordinationType, ar as Data3DTexture, as as RedFormat, at as FloatType, au as getImageSize, av as Scene } from "./index-CJ0WrLWz.js";
2
2
  import * as React from "react";
3
3
  import { useRef, useEffect, useState, forwardRef } from "react";
4
- import { u as useThree, a as useFrame, c as create, e as extend, b as createPortal, O as OrbitControls, C as Canvas } from "./OrbitControls-CtNyt3m6.js";
4
+ import { u as useThree, a as useFrame, c as create, e as extend, b as createPortal, O as OrbitControls, C as Canvas } from "./OrbitControls-BdKhfTcE.js";
5
5
  const isPromise = (promise) => typeof promise === "object" && typeof promise.then === "function";
6
6
  const globalCache = [];
7
7
  function shallowEqualArrays(arrA, arrB, equal = (a, b) => a === b) {
@@ -5027,7 +5027,7 @@ const Text = /* @__PURE__ */ React.forwardRef(({
5027
5027
  const {
5028
5028
  Text: TextMeshImpl,
5029
5029
  preloadFont
5030
- } = suspend(async () => import("./troika-three-text.esm-1a1oWjdg.js"), []);
5030
+ } = suspend(async () => import("./troika-three-text.esm-Bn837OOO.js"), []);
5031
5031
  const invalidate = useThree(({
5032
5032
  invalidate: invalidate2
5033
5033
  }) => invalidate2);
@@ -1,6 +1,6 @@
1
- import { aw as log, ax as isEqual, ar as Data3DTexture, as as RedFormat, ay as UnsignedByteType, l as LinearFilter, az as RedIntegerFormat, aA as UnsignedIntType, m as NearestFilter, e as Vector3, V as Vector2, ag as Vector4, ae as UniformsUtils, aq as CoordinationType, aB as WebGLMultipleRenderTargets, aC as RGBAFormat, av as Scene, W as OrthographicCamera, ad as ShaderMaterial, z as Mesh, aD as PlaneGeometry, aE as useEventCallback, ao as jsxRuntimeExports, aF as GLSL3, am as BackSide } from "./index-Bhio36zT.js";
1
+ import { aw as log, ax as isEqual, ar as Data3DTexture, as as RedFormat, ay as UnsignedByteType, l as LinearFilter, az as RedIntegerFormat, aA as UnsignedIntType, m as NearestFilter, e as Vector3, V as Vector2, ag as Vector4, ae as UniformsUtils, aq as CoordinationType, aB as WebGLMultipleRenderTargets, aC as RGBAFormat, av as Scene, W as OrthographicCamera, ad as ShaderMaterial, z as Mesh, aD as PlaneGeometry, aE as useEventCallback, ao as jsxRuntimeExports, aF as GLSL3, am as BackSide } from "./index-CJ0WrLWz.js";
2
2
  import { useRef, useState, useMemo, useEffect, Suspense } from "react";
3
- import { u as useThree, a as useFrame, O as OrbitControls, C as Canvas } from "./OrbitControls-CtNyt3m6.js";
3
+ import { u as useThree, a as useFrame, O as OrbitControls, C as Canvas } from "./OrbitControls-BdKhfTcE.js";
4
4
  const LogLevel = {
5
5
  INFO: "info",
6
6
  WARN: "warn",
@@ -197,9 +197,17 @@ function _ptToZarr(ptx, pty, ptz, ptInfo) {
197
197
  z
198
198
  };
199
199
  }
200
- function _requestBufferToRequestObjects(buffer, k) {
200
+ const DEFAULT_SIGMA_NORMALIZED = 0.25;
201
+ function _requestBufferToRequestObjects(buffer, k, optsForWeighting) {
201
202
  const counts = /* @__PURE__ */ new Map();
202
- for (let i = 0; i < buffer.length; i += 4) {
203
+ const { width, height, sigmaNormalized } = optsForWeighting;
204
+ const useWeighting = Number.isInteger(width) && Number.isInteger(height) && width > 0 && height > 0 && typeof sigmaNormalized === "number";
205
+ if (!useWeighting) {
206
+ log.warn("_requestBufferToRequestObjects: proceeding without weighting");
207
+ }
208
+ const maxPixels = Math.floor(buffer.length / 4);
209
+ for (let pix = 0; pix < maxPixels; pix += 1) {
210
+ const i = pix * 4;
203
211
  const r = buffer[i];
204
212
  const g = buffer[i + 1];
205
213
  const b = buffer[i + 2];
@@ -208,7 +216,17 @@ function _requestBufferToRequestObjects(buffer, k) {
208
216
  continue;
209
217
  }
210
218
  const packed = (r << 24 | g << 16 | b << 8 | a) >>> 0;
211
- counts.set(packed, (counts.get(packed) || 0) + 1);
219
+ let weight = 1;
220
+ if (useWeighting) {
221
+ const x = pix % width;
222
+ const y = Math.floor(pix / width);
223
+ const dx = x - width / 2;
224
+ const dy = y - height / 2;
225
+ const nd = Math.sqrt(dx * dx / (width * width) + dy * dy / (height * height));
226
+ const norm = nd / sigmaNormalized;
227
+ weight = Math.exp(-0.5 * norm * norm);
228
+ }
229
+ counts.set(packed, (counts.get(packed) || 0) + weight);
212
230
  }
213
231
  const requests = [...counts.entries()].sort((a, b) => b[1] - a[1]).slice(0, k).map(([packed]) => ({
214
232
  x: packed >> 22 & 1023,
@@ -865,7 +883,19 @@ class VolumeDataManager {
865
883
  }
866
884
  return chunkEntry.data;
867
885
  }
868
- async processRequestData(buffer) {
886
+ /**
887
+ * Process the buffer of brick requests from the shader, turning them into
888
+ * actual Promises for Zarr chunks on the JS side.
889
+ * @param {Uint8Array} buffer The bufRequest (of length width*height*4)
890
+ * containing the brick requests from the shader.
891
+ * @param {object} optsForWeighting
892
+ * @param {number} optsForWeighting.width The width of the render target.
893
+ * @param {number} optsForWeighting.height The height of the render target.
894
+ * @param {number} optsForWeighting.sigmaNormalized The normalized sigma value
895
+ * to use for weighting the brick requests based on their distance from
896
+ * the center of the render target.
897
+ */
898
+ async processRequestData(buffer, optsForWeighting) {
869
899
  if (this.isBusy) {
870
900
  log.debug("processRequestData: already busy, skipping");
871
901
  return;
@@ -880,7 +910,7 @@ class VolumeDataManager {
880
910
  }
881
911
  this.isBusy = true;
882
912
  this.triggerRequest = false;
883
- const { requests, origRequestCount } = _requestBufferToRequestObjects(buffer, this.k);
913
+ const { requests, origRequestCount } = _requestBufferToRequestObjects(buffer, this.k, optsForWeighting);
884
914
  if (requests.length === 0) {
885
915
  this.noNewRequests = true;
886
916
  }
@@ -3443,7 +3473,14 @@ function handleRequests(_gl, { frameRef, dataManager, mrtRef, bufRequest, bufUsa
3443
3473
  ctx.bindFramebuffer(ctx.READ_FRAMEBUFFER, framebufferFor(_gl, mrtRef.current));
3444
3474
  ctx.readBuffer(ctx.COLOR_ATTACHMENT1);
3445
3475
  ctx.readPixels(0, 0, mrtRef.current.width, mrtRef.current.height, ctx.RGBA, ctx.UNSIGNED_BYTE, bufRequest.current);
3446
- dataManager.processRequestData(bufRequest.current);
3476
+ dataManager.processRequestData(bufRequest.current, {
3477
+ // If width/height are not yet available,
3478
+ // processRequestData will proceed without weighting.
3479
+ width: mrtRef?.current?.width,
3480
+ height: mrtRef?.current?.height,
3481
+ // Default sigmaNormalized = 0.25; can be tuned
3482
+ sigmaNormalized: DEFAULT_SIGMA_NORMALIZED
3483
+ });
3447
3484
  } else if (dataManager.triggerUsage === true && dataManager.noNewRequests === false) {
3448
3485
  ctx.bindFramebuffer(ctx.READ_FRAMEBUFFER, framebufferFor(_gl, mrtRef.current));
3449
3486
  ctx.readBuffer(ctx.COLOR_ATTACHMENT2);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bR, bP, bN, bQ, bO, bM, bS } from "./index-Bhio36zT.js";
1
+ import { bR, bP, bN, bQ, bO, bM, bS } from "./index-CJ0WrLWz.js";
2
2
  import { useComplexCoordination, useComplexCoordinationSecondary, useCoordination, useCoordinationScopes, useCoordinationScopesBy, useGridItemSize, useMultiCoordinationScopesNonNull, useMultiCoordinationScopesSecondaryNonNull, usePageModeView } from "@vitessce/vit-s";
3
3
  export {
4
4
  bR as PluginAsyncFunction,
@@ -1,4 +1,4 @@
1
- import { aX as BaseDecoder } from "./index-Bhio36zT.js";
1
+ import { aX as BaseDecoder } from "./index-CJ0WrLWz.js";
2
2
  const dctZigZag = new Int32Array([
3
3
  0,
4
4
  1,
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { aG as getDefaultExportFromCjs, aX as BaseDecoder, aY as LercParameters, aZ as LercAddCompression } from "./index-Bhio36zT.js";
2
+ import { aG as getDefaultExportFromCjs, aX as BaseDecoder, aY as LercParameters, aZ as LercAddCompression } from "./index-CJ0WrLWz.js";
3
3
  var LercDecode = { exports: {} };
4
4
  var hasRequiredLercDecode;
5
5
  function requireLercDecode() {
@@ -1,4 +1,4 @@
1
- import { aX as BaseDecoder } from "./index-Bhio36zT.js";
1
+ import { aX as BaseDecoder } from "./index-CJ0WrLWz.js";
2
2
  const MIN_BITS = 9;
3
3
  const CLEAR_CODE = 256;
4
4
  const EOI_CODE = 257;
@@ -1,4 +1,4 @@
1
- import { aX as BaseDecoder } from "./index-Bhio36zT.js";
1
+ import { aX as BaseDecoder } from "./index-CJ0WrLWz.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { aX as BaseDecoder } from "./index-Bhio36zT.js";
1
+ import { aX as BaseDecoder } from "./index-CJ0WrLWz.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { bH as MeshDistanceMaterial, bI as MeshDepthMaterial, bJ as RGBADepthPacking, ae as UniformsUtils, bK as ShaderChunk, a9 as InstancedBufferGeometry, a8 as Sphere, a7 as Box3, am as BackSide, u as DoubleSide, z as Mesh, a5 as FrontSide, v as MeshBasicMaterial, C as Color, e as Vector3, M as Matrix4, V as Vector2, ap as Matrix3, ag as Vector4, a1 as Texture, l as LinearFilter, aD as PlaneGeometry, x as BufferGeometry, aa as Float32BufferAttribute, bL as InstancedBufferAttribute } from "./index-Bhio36zT.js";
1
+ import { bH as MeshDistanceMaterial, bI as MeshDepthMaterial, bJ as RGBADepthPacking, ae as UniformsUtils, bK as ShaderChunk, a9 as InstancedBufferGeometry, a8 as Sphere, a7 as Box3, am as BackSide, u as DoubleSide, z as Mesh, a5 as FrontSide, v as MeshBasicMaterial, C as Color, e as Vector3, M as Matrix4, V as Vector2, ap as Matrix3, ag as Vector4, a1 as Texture, l as LinearFilter, aD as PlaneGeometry, x as BufferGeometry, aa as Float32BufferAttribute, bL as InstancedBufferAttribute } from "./index-CJ0WrLWz.js";
2
2
  function workerBootstrap() {
3
3
  var modules = /* @__PURE__ */ Object.create(null);
4
4
  function registerModule(ref, callback) {
@@ -1,4 +1,4 @@
1
- import { aX as BaseDecoder } from "./index-Bhio36zT.js";
1
+ import { aX as BaseDecoder } from "./index-CJ0WrLWz.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/all",
3
- "version": "3.9.3",
3
+ "version": "3.9.5",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -17,38 +17,38 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "zod": "^3.21.4",
20
- "@vitessce/constants-internal": "3.9.3",
21
- "@vitessce/styles": "3.9.3",
22
- "@vitessce/abstract": "3.9.3",
23
- "@vitessce/error": "3.9.3",
24
- "@vitessce/csv": "3.9.3",
25
- "@vitessce/description": "3.9.3",
26
- "@vitessce/feature-list": "3.9.3",
27
- "@vitessce/heatmap": "3.9.3",
28
- "@vitessce/genomic-profiles": "3.9.3",
29
- "@vitessce/glb": "3.9.3",
30
- "@vitessce/json": "3.9.3",
31
- "@vitessce/layer-controller-beta": "3.9.3",
32
- "@vitessce/link-controller": "3.9.3",
33
- "@vitessce/layer-controller": "3.9.3",
34
- "@vitessce/ome-tiff": "3.9.3",
35
- "@vitessce/plugins": "3.9.3",
36
- "@vitessce/scatterplot-embedding": "3.9.3",
37
- "@vitessce/scatterplot-gating": "3.9.3",
38
- "@vitessce/obs-sets-manager": "3.9.3",
39
- "@vitessce/schemas": "3.9.3",
40
- "@vitessce/spatial": "3.9.3",
41
- "@vitessce/spatial-beta": "3.9.3",
42
- "@vitessce/statistical-plots": "3.9.3",
43
- "@vitessce/vit-s": "3.9.3",
44
- "@vitessce/zarr": "3.9.3",
45
- "@vitessce/globals": "3.9.3",
46
- "@vitessce/spatial-three": "3.9.3",
47
- "@vitessce/status": "3.9.3",
48
- "@vitessce/spatial-accelerated": "3.9.3",
49
- "@vitessce/biomarker-select": "3.9.3",
50
- "@vitessce/spatial-zarr": "3.9.3",
51
- "@vitessce/neuroglancer": "3.9.3"
20
+ "@vitessce/styles": "3.9.5",
21
+ "@vitessce/constants-internal": "3.9.5",
22
+ "@vitessce/abstract": "3.9.5",
23
+ "@vitessce/error": "3.9.5",
24
+ "@vitessce/csv": "3.9.5",
25
+ "@vitessce/feature-list": "3.9.5",
26
+ "@vitessce/description": "3.9.5",
27
+ "@vitessce/heatmap": "3.9.5",
28
+ "@vitessce/genomic-profiles": "3.9.5",
29
+ "@vitessce/glb": "3.9.5",
30
+ "@vitessce/json": "3.9.5",
31
+ "@vitessce/layer-controller": "3.9.5",
32
+ "@vitessce/layer-controller-beta": "3.9.5",
33
+ "@vitessce/link-controller": "3.9.5",
34
+ "@vitessce/ome-tiff": "3.9.5",
35
+ "@vitessce/obs-sets-manager": "3.9.5",
36
+ "@vitessce/scatterplot-embedding": "3.9.5",
37
+ "@vitessce/scatterplot-gating": "3.9.5",
38
+ "@vitessce/plugins": "3.9.5",
39
+ "@vitessce/schemas": "3.9.5",
40
+ "@vitessce/spatial-beta": "3.9.5",
41
+ "@vitessce/statistical-plots": "3.9.5",
42
+ "@vitessce/vit-s": "3.9.5",
43
+ "@vitessce/spatial": "3.9.5",
44
+ "@vitessce/status": "3.9.5",
45
+ "@vitessce/zarr": "3.9.5",
46
+ "@vitessce/spatial-zarr": "3.9.5",
47
+ "@vitessce/globals": "3.9.5",
48
+ "@vitessce/spatial-accelerated": "3.9.5",
49
+ "@vitessce/spatial-three": "3.9.5",
50
+ "@vitessce/biomarker-select": "3.9.5",
51
+ "@vitessce/neuroglancer": "3.9.5"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/react": "^18.0.28",