@vitessce/scatterplot-gating 3.7.0 → 3.8.0

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,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { B as BaseDecoder } from "./index-wrQf0yLB.js";
2
+ import { B as BaseDecoder } from "./index-B4FTJe_L.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -9492,6 +9492,7 @@ const ViewType$1 = {
9492
9492
  SCATTERPLOT: "scatterplot",
9493
9493
  SPATIAL: "spatial",
9494
9494
  SPATIAL_BETA: "spatialBeta",
9495
+ SPATIAL_ACCELERATED: "spatialAccelerated",
9495
9496
  HEATMAP: "heatmap",
9496
9497
  LAYER_CONTROLLER: "layerController",
9497
9498
  LAYER_CONTROLLER_BETA: "layerControllerBeta",
@@ -9785,6 +9786,8 @@ const CoordinationType$1 = {
9785
9786
  // Could be per-image-layer
9786
9787
  SPATIAL_TARGET_RESOLUTION: "spatialTargetResolution",
9787
9788
  // Per-spatial-layer
9789
+ SPATIAL_MAX_RESOLUTION: "spatialMaxResolution",
9790
+ // Per-image-channel (for spatial-accelerated)
9788
9791
  // For clipping plane sliders
9789
9792
  SPATIAL_SLICE_X: "spatialSliceX",
9790
9793
  SPATIAL_SLICE_Y: "spatialSliceY",
@@ -10101,6 +10104,7 @@ const COMPONENT_COORDINATION_TYPES = {
10101
10104
  CoordinationType$1.SPATIAL_ROTATION_Y,
10102
10105
  CoordinationType$1.SPATIAL_ROTATION_Z,
10103
10106
  CoordinationType$1.SPATIAL_AXIS_FIXED,
10107
+ CoordinationType$1.SPATIAL_ROTATION_ORBIT,
10104
10108
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
10105
10109
  CoordinationType$1.SPATIAL_ZOOM,
10106
10110
  CoordinationType$1.OBS_FILTER,
@@ -10108,14 +10112,11 @@ const COMPONENT_COORDINATION_TYPES = {
10108
10112
  CoordinationType$1.OBS_SET_SELECTION,
10109
10113
  CoordinationType$1.OBS_SET_FILTER,
10110
10114
  CoordinationType$1.OBS_SET_HIGHLIGHT,
10111
- CoordinationType$1.OBS_SET_COLOR,
10112
10115
  CoordinationType$1.OBS_TYPE,
10113
- CoordinationType$1.ADDITIONAL_OBS_SETS,
10114
10116
  CoordinationType$1.OBS_SET_COLOR,
10115
10117
  CoordinationType$1.OBS_COLOR_ENCODING,
10116
- CoordinationType$1.OBS_SET_SELECTION,
10117
10118
  CoordinationType$1.EMBEDDING_TYPE,
10118
- CoordinationType$1.OBS_COLOR_ENCODING,
10119
+ CoordinationType$1.ADDITIONAL_OBS_SETS,
10119
10120
  CoordinationType$1.TOOLTIPS_VISIBLE
10120
10121
  ],
10121
10122
  [ViewType$1.SCATTERPLOT]: [
@@ -10335,6 +10336,7 @@ const COMPONENT_COORDINATION_TYPES = {
10335
10336
  CoordinationType$1.SPATIAL_RENDERING_MODE,
10336
10337
  CoordinationType$1.VOLUMETRIC_RENDERING_ALGORITHM,
10337
10338
  CoordinationType$1.SPATIAL_TARGET_RESOLUTION,
10339
+ CoordinationType$1.SPATIAL_MAX_RESOLUTION,
10338
10340
  CoordinationType$1.SPATIAL_SLICE_X,
10339
10341
  CoordinationType$1.SPATIAL_SLICE_Y,
10340
10342
  CoordinationType$1.SPATIAL_SLICE_Z,
@@ -10508,6 +10510,7 @@ const COMPONENT_COORDINATION_TYPES = {
10508
10510
  CoordinationType$1.SPATIAL_RENDERING_MODE,
10509
10511
  CoordinationType$1.VOLUMETRIC_RENDERING_ALGORITHM,
10510
10512
  CoordinationType$1.SPATIAL_TARGET_RESOLUTION,
10513
+ CoordinationType$1.SPATIAL_MAX_RESOLUTION,
10511
10514
  CoordinationType$1.SPATIAL_SLICE_X,
10512
10515
  CoordinationType$1.SPATIAL_SLICE_Y,
10513
10516
  CoordinationType$1.SPATIAL_SLICE_Z,
@@ -123126,22 +123129,22 @@ function addDecoder(cases, importFn) {
123126
123129
  }
123127
123130
  cases.forEach((c2) => registry$1.set(c2, importFn));
123128
123131
  }
123129
- addDecoder([void 0, 1], () => import("./raw-g5V-yVQZ.js").then((m2) => m2.default));
123130
- addDecoder(5, () => import("./lzw-BPz0RIPM.js").then((m2) => m2.default));
123132
+ addDecoder([void 0, 1], () => import("./raw-BFCCI-Mm.js").then((m2) => m2.default));
123133
+ addDecoder(5, () => import("./lzw-DiaKhPZe.js").then((m2) => m2.default));
123131
123134
  addDecoder(6, () => {
123132
123135
  throw new Error("old style JPEG compression is not supported.");
123133
123136
  });
123134
- addDecoder(7, () => import("./jpeg-Di23zXFS.js").then((m2) => m2.default));
123135
- addDecoder([8, 32946], () => import("./deflate-WkvPtv5P.js").then((m2) => m2.default));
123136
- addDecoder(32773, () => import("./packbits-4y-CZhCi.js").then((m2) => m2.default));
123137
+ addDecoder(7, () => import("./jpeg-G-ewKEbP.js").then((m2) => m2.default));
123138
+ addDecoder([8, 32946], () => import("./deflate-B6pWJWB8.js").then((m2) => m2.default));
123139
+ addDecoder(32773, () => import("./packbits-CT7DC7Iq.js").then((m2) => m2.default));
123137
123140
  addDecoder(
123138
123141
  34887,
123139
- () => import("./lerc-BxU7w-lS.js").then(async (m2) => {
123142
+ () => import("./lerc-CoSyfsZl.js").then(async (m2) => {
123140
123143
  await m2.zstd.init();
123141
123144
  return m2;
123142
123145
  }).then((m2) => m2.default)
123143
123146
  );
123144
- addDecoder(50001, () => import("./webimage-PnoeEp0u.js").then((m2) => m2.default));
123147
+ addDecoder(50001, () => import("./webimage-BtSqKc33.js").then((m2) => m2.default));
123145
123148
  function decodeRowAcc(row, stride) {
123146
123149
  let length2 = row.length - stride;
123147
123150
  let offset2 = 0;
@@ -158161,6 +158164,9 @@ function getOnHoverCallback(obsIndex, setObsHighlight, setComponentHover) {
158161
158164
  }
158162
158165
  };
158163
158166
  }
158167
+ const ROTATION_THRESHOLD = 1;
158168
+ const ZOOM_THRESHOLD = 0.01;
158169
+ const TRANSLATION_THRESHOLD = 2;
158164
158170
  class AbstractSpatialOrScatterplot extends PureComponent {
158165
158171
  constructor(props) {
158166
158172
  super(props);
@@ -158168,6 +158174,7 @@ class AbstractSpatialOrScatterplot extends PureComponent {
158168
158174
  gl: null,
158169
158175
  tool: null
158170
158176
  };
158177
+ this.lastApplied = null;
158171
158178
  this.viewport = null;
158172
158179
  this.onViewStateChange = this.onViewStateChange.bind(this);
158173
158180
  this.onInitializeViewInfo = this.onInitializeViewInfo.bind(this);
@@ -158187,6 +158194,23 @@ class AbstractSpatialOrScatterplot extends PureComponent {
158187
158194
  onViewStateChange({ viewState: nextViewState }) {
158188
158195
  const { setViewState, viewState, spatialAxisFixed } = this.props;
158189
158196
  const use3d = this.use3d();
158197
+ let targetChanged = false;
158198
+ if (nextViewState.target && viewState.target) {
158199
+ const dx = Math.abs((nextViewState.target[0] ?? 0) - (viewState.target[0] ?? 0));
158200
+ const dy = Math.abs((nextViewState.target[1] ?? 0) - (viewState.target[1] ?? 0));
158201
+ const scale2 = 2 ** (nextViewState.zoom ?? 0);
158202
+ const dxPx = Math.abs(dx) * scale2;
158203
+ const dyPx = Math.abs(dy) * scale2;
158204
+ targetChanged = dxPx > TRANSLATION_THRESHOLD || dyPx > TRANSLATION_THRESHOLD;
158205
+ }
158206
+ const prev2 = this.lastApplied || viewState;
158207
+ const zoomChanged = Math.abs((nextViewState.zoom ?? 0) - (prev2.zoom ?? 0)) > ZOOM_THRESHOLD;
158208
+ const orbitChanged = Math.abs((nextViewState.rotationOrbit ?? 0) - (prev2.rotationOrbit ?? 0)) > ROTATION_THRESHOLD;
158209
+ const xChanged = Math.abs((nextViewState.rotationX ?? 0) - (prev2.rotationX ?? 0)) > ROTATION_THRESHOLD;
158210
+ if (!(zoomChanged || orbitChanged || xChanged || targetChanged)) {
158211
+ return;
158212
+ }
158213
+ this.lastApplied = nextViewState;
158190
158214
  setViewState({
158191
158215
  ...nextViewState,
158192
158216
  // If the axis is fixed, just use the current target in state i.e don't change target.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { G } from "./index-wrQf0yLB.js";
1
+ import { G } from "./index-B4FTJe_L.js";
2
2
  export {
3
3
  G as GatingSubscriber
4
4
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-wrQf0yLB.js";
1
+ import { B as BaseDecoder } from "./index-B4FTJe_L.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 { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-wrQf0yLB.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-B4FTJe_L.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-wrQf0yLB.js";
1
+ import { B as BaseDecoder } from "./index-B4FTJe_L.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 { B as BaseDecoder } from "./index-wrQf0yLB.js";
1
+ import { B as BaseDecoder } from "./index-B4FTJe_L.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-wrQf0yLB.js";
1
+ import { B as BaseDecoder } from "./index-B4FTJe_L.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-wrQf0yLB.js";
1
+ import { B as BaseDecoder } from "./index-B4FTJe_L.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/scatterplot-gating",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,16 +19,16 @@
19
19
  "d3-array": "^2.4.0",
20
20
  "lodash-es": "^4.17.21",
21
21
  "react-aria": "^3.28.0",
22
- "@vitessce/styles": "3.7.0",
23
- "@vitessce/constants-internal": "3.7.0",
24
- "@vitessce/scatterplot": "3.7.0",
25
- "@vitessce/sets-utils": "3.7.0",
26
- "@vitessce/utils": "3.7.0",
27
- "@vitessce/vit-s": "3.7.0"
22
+ "@vitessce/styles": "3.8.0",
23
+ "@vitessce/constants-internal": "3.8.0",
24
+ "@vitessce/scatterplot": "3.8.0",
25
+ "@vitessce/sets-utils": "3.8.0",
26
+ "@vitessce/utils": "3.8.0",
27
+ "@vitessce/vit-s": "3.8.0"
28
28
  },
29
29
  "devDependencies": {
30
- "react": "^18.0.0",
31
- "react-dom": "^18.0.0",
30
+ "react": "18.3.1",
31
+ "react-dom": "18.3.1",
32
32
  "vite": "^7.0.0",
33
33
  "vitest": "^3.1.4"
34
34
  },