@vitessce/scatterplot-gating 3.7.0 → 3.7.1

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-CQUIaH69.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -10101,6 +10101,7 @@ const COMPONENT_COORDINATION_TYPES = {
10101
10101
  CoordinationType$1.SPATIAL_ROTATION_Y,
10102
10102
  CoordinationType$1.SPATIAL_ROTATION_Z,
10103
10103
  CoordinationType$1.SPATIAL_AXIS_FIXED,
10104
+ CoordinationType$1.SPATIAL_ROTATION_ORBIT,
10104
10105
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
10105
10106
  CoordinationType$1.SPATIAL_ZOOM,
10106
10107
  CoordinationType$1.OBS_FILTER,
@@ -10108,14 +10109,11 @@ const COMPONENT_COORDINATION_TYPES = {
10108
10109
  CoordinationType$1.OBS_SET_SELECTION,
10109
10110
  CoordinationType$1.OBS_SET_FILTER,
10110
10111
  CoordinationType$1.OBS_SET_HIGHLIGHT,
10111
- CoordinationType$1.OBS_SET_COLOR,
10112
10112
  CoordinationType$1.OBS_TYPE,
10113
- CoordinationType$1.ADDITIONAL_OBS_SETS,
10114
10113
  CoordinationType$1.OBS_SET_COLOR,
10115
10114
  CoordinationType$1.OBS_COLOR_ENCODING,
10116
- CoordinationType$1.OBS_SET_SELECTION,
10117
10115
  CoordinationType$1.EMBEDDING_TYPE,
10118
- CoordinationType$1.OBS_COLOR_ENCODING,
10116
+ CoordinationType$1.ADDITIONAL_OBS_SETS,
10119
10117
  CoordinationType$1.TOOLTIPS_VISIBLE
10120
10118
  ],
10121
10119
  [ViewType$1.SCATTERPLOT]: [
@@ -123126,22 +123124,22 @@ function addDecoder(cases, importFn) {
123126
123124
  }
123127
123125
  cases.forEach((c2) => registry$1.set(c2, importFn));
123128
123126
  }
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));
123127
+ addDecoder([void 0, 1], () => import("./raw-9dT3xwhD.js").then((m2) => m2.default));
123128
+ addDecoder(5, () => import("./lzw-C40QIo-x.js").then((m2) => m2.default));
123131
123129
  addDecoder(6, () => {
123132
123130
  throw new Error("old style JPEG compression is not supported.");
123133
123131
  });
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));
123132
+ addDecoder(7, () => import("./jpeg-CdsXFHlP.js").then((m2) => m2.default));
123133
+ addDecoder([8, 32946], () => import("./deflate-DBNG5DrN.js").then((m2) => m2.default));
123134
+ addDecoder(32773, () => import("./packbits-DuTPSgqu.js").then((m2) => m2.default));
123137
123135
  addDecoder(
123138
123136
  34887,
123139
- () => import("./lerc-BxU7w-lS.js").then(async (m2) => {
123137
+ () => import("./lerc-BI9jJUb4.js").then(async (m2) => {
123140
123138
  await m2.zstd.init();
123141
123139
  return m2;
123142
123140
  }).then((m2) => m2.default)
123143
123141
  );
123144
- addDecoder(50001, () => import("./webimage-PnoeEp0u.js").then((m2) => m2.default));
123142
+ addDecoder(50001, () => import("./webimage-DCRfoRZ7.js").then((m2) => m2.default));
123145
123143
  function decodeRowAcc(row, stride) {
123146
123144
  let length2 = row.length - stride;
123147
123145
  let offset2 = 0;
@@ -158161,6 +158159,9 @@ function getOnHoverCallback(obsIndex, setObsHighlight, setComponentHover) {
158161
158159
  }
158162
158160
  };
158163
158161
  }
158162
+ const ROTATION_THRESHOLD = 1;
158163
+ const ZOOM_THRESHOLD = 0.01;
158164
+ const TRANSLATION_THRESHOLD = 2;
158164
158165
  class AbstractSpatialOrScatterplot extends PureComponent {
158165
158166
  constructor(props) {
158166
158167
  super(props);
@@ -158168,6 +158169,7 @@ class AbstractSpatialOrScatterplot extends PureComponent {
158168
158169
  gl: null,
158169
158170
  tool: null
158170
158171
  };
158172
+ this.lastApplied = null;
158171
158173
  this.viewport = null;
158172
158174
  this.onViewStateChange = this.onViewStateChange.bind(this);
158173
158175
  this.onInitializeViewInfo = this.onInitializeViewInfo.bind(this);
@@ -158187,6 +158189,23 @@ class AbstractSpatialOrScatterplot extends PureComponent {
158187
158189
  onViewStateChange({ viewState: nextViewState }) {
158188
158190
  const { setViewState, viewState, spatialAxisFixed } = this.props;
158189
158191
  const use3d = this.use3d();
158192
+ let targetChanged = false;
158193
+ if (nextViewState.target && viewState.target) {
158194
+ const dx = Math.abs((nextViewState.target[0] ?? 0) - (viewState.target[0] ?? 0));
158195
+ const dy = Math.abs((nextViewState.target[1] ?? 0) - (viewState.target[1] ?? 0));
158196
+ const scale2 = 2 ** (nextViewState.zoom ?? 0);
158197
+ const dxPx = Math.abs(dx) * scale2;
158198
+ const dyPx = Math.abs(dy) * scale2;
158199
+ targetChanged = dxPx > TRANSLATION_THRESHOLD || dyPx > TRANSLATION_THRESHOLD;
158200
+ }
158201
+ const prev2 = this.lastApplied || viewState;
158202
+ const zoomChanged = Math.abs((nextViewState.zoom ?? 0) - (prev2.zoom ?? 0)) > ZOOM_THRESHOLD;
158203
+ const orbitChanged = Math.abs((nextViewState.rotationOrbit ?? 0) - (prev2.rotationOrbit ?? 0)) > ROTATION_THRESHOLD;
158204
+ const xChanged = Math.abs((nextViewState.rotationX ?? 0) - (prev2.rotationX ?? 0)) > ROTATION_THRESHOLD;
158205
+ if (!(zoomChanged || orbitChanged || xChanged || targetChanged)) {
158206
+ return;
158207
+ }
158208
+ this.lastApplied = nextViewState;
158190
158209
  setViewState({
158191
158210
  ...nextViewState,
158192
158211
  // 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-CQUIaH69.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-CQUIaH69.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-CQUIaH69.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-CQUIaH69.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-CQUIaH69.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-CQUIaH69.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-CQUIaH69.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.7.1",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -19,12 +19,12 @@
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.7.1",
23
+ "@vitessce/constants-internal": "3.7.1",
24
+ "@vitessce/scatterplot": "3.7.1",
25
+ "@vitessce/sets-utils": "3.7.1",
26
+ "@vitessce/vit-s": "3.7.1",
27
+ "@vitessce/utils": "3.7.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "react": "^18.0.0",