@vitessce/scatterplot-embedding 3.6.10 → 3.6.12

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-B4Ggb1ZC.js";
2
+ import { B as BaseDecoder } from "./index-BWwrctZk.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -122215,7 +122215,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
122215
122215
  const GLSL_COLORMAPS = [
122216
122216
  "plasma",
122217
122217
  "viridis",
122218
- "jet"
122218
+ "jet",
122219
+ "greys"
122219
122220
  ];
122220
122221
  const GLSL_COLORMAP_DEFAULT = "plasma";
122221
122222
  const COLORMAP_SHADER_PLACEHOLDER = "COLORMAP_FUNC";
@@ -123305,22 +123306,22 @@ function addDecoder(cases, importFn) {
123305
123306
  }
123306
123307
  cases.forEach((c2) => registry$1.set(c2, importFn));
123307
123308
  }
123308
- addDecoder([void 0, 1], () => import("./raw-BqckyMzs.js").then((m2) => m2.default));
123309
- addDecoder(5, () => import("./lzw-3prZR1De.js").then((m2) => m2.default));
123309
+ addDecoder([void 0, 1], () => import("./raw-C_kh447x.js").then((m2) => m2.default));
123310
+ addDecoder(5, () => import("./lzw-BUQlEYLS.js").then((m2) => m2.default));
123310
123311
  addDecoder(6, () => {
123311
123312
  throw new Error("old style JPEG compression is not supported.");
123312
123313
  });
123313
- addDecoder(7, () => import("./jpeg-CIYA5vLI.js").then((m2) => m2.default));
123314
- addDecoder([8, 32946], () => import("./deflate-DQOZf0tG.js").then((m2) => m2.default));
123315
- addDecoder(32773, () => import("./packbits-Dn-nd6sC.js").then((m2) => m2.default));
123314
+ addDecoder(7, () => import("./jpeg-Cr4SB03o.js").then((m2) => m2.default));
123315
+ addDecoder([8, 32946], () => import("./deflate-D8XXpIHo.js").then((m2) => m2.default));
123316
+ addDecoder(32773, () => import("./packbits-BdoLIRfv.js").then((m2) => m2.default));
123316
123317
  addDecoder(
123317
123318
  34887,
123318
- () => import("./lerc-DTPsduDc.js").then(async (m2) => {
123319
+ () => import("./lerc-DPVW-T-N.js").then(async (m2) => {
123319
123320
  await m2.zstd.init();
123320
123321
  return m2;
123321
123322
  }).then((m2) => m2.default)
123322
123323
  );
123323
- addDecoder(50001, () => import("./webimage-Cd8IIoXB.js").then((m2) => m2.default));
123324
+ addDecoder(50001, () => import("./webimage-CjiYMJXR.js").then((m2) => m2.default));
123324
123325
  function decodeRowAcc(row, stride) {
123325
123326
  let length2 = row.length - stride;
123326
123327
  let offset2 = 0;
@@ -153218,6 +153219,9 @@ function Legend(props) {
153218
153219
  featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
153219
153220
  } else if (featureAggregationStrategy === "last") {
153220
153221
  featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw.at(-1);
153222
+ } else if (typeof featureAggregationStrategy === "number") {
153223
+ const i2 = featureAggregationStrategy;
153224
+ featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[i2];
153221
153225
  } else if (featureAggregationStrategy === "sum") {
153222
153226
  featureSelectionLabelRawStr = "Sum of features";
153223
153227
  } else if (featureAggregationStrategy === "mean") {
@@ -153693,7 +153697,7 @@ function EmbeddingScatterplotSubscriber(props) {
153693
153697
  return [1, 10, 100];
153694
153698
  }, [contourPercentiles, sortedWeights]);
153695
153699
  const circleInfo = useMemo(() => {
153696
- if (!originalViewState || !width2 || !height2) {
153700
+ if (!originalViewState || !width2 || !height2 || !xRange || !yRange) {
153697
153701
  return null;
153698
153702
  }
153699
153703
  const center2 = [
@@ -153704,7 +153708,8 @@ function EmbeddingScatterplotSubscriber(props) {
153704
153708
  if (!(typeof scaleFactor === "number" && typeof center2[0] === "number" && typeof center2[1] === "number") || Number.isNaN(scaleFactor)) {
153705
153709
  return null;
153706
153710
  }
153707
- const radius = Math.min(width2, height2) / 2 / scaleFactor;
153711
+ const size = Math.max(xRange, yRange);
153712
+ const radius = size * Math.sqrt(2) / 2 * 0.8;
153708
153713
  const numPoints = 96;
153709
153714
  const options = { steps: numPoints, units: "degrees" };
153710
153715
  const circlePolygon = circle$2(center2, radius, options);
@@ -153714,7 +153719,7 @@ function EmbeddingScatterplotSubscriber(props) {
153714
153719
  polygon: circlePolygon,
153715
153720
  steps: numPoints
153716
153721
  };
153717
- }, [originalViewState, width2, height2]);
153722
+ }, [originalViewState, width2, height2, xRange, yRange]);
153718
153723
  const [alignedEmbeddingIndex, alignedEmbeddingData] = useMemo(() => {
153719
153724
  if ((obsEmbedding == null ? void 0 : obsEmbedding.data) && obsEmbeddingIndex && matrixObsIndex) {
153720
153725
  const matrixIndexMap = new Map(matrixObsIndex.map((key, i2) => [key, i2]));
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D, E } from "./index-B4Ggb1ZC.js";
1
+ import { D, E } from "./index-BWwrctZk.js";
2
2
  export {
3
3
  D as DualEmbeddingScatterplotSubscriber,
4
4
  E as EmbeddingScatterplotSubscriber
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-B4Ggb1ZC.js";
1
+ import { B as BaseDecoder } from "./index-BWwrctZk.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-B4Ggb1ZC.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-BWwrctZk.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-B4Ggb1ZC.js";
1
+ import { B as BaseDecoder } from "./index-BWwrctZk.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-B4Ggb1ZC.js";
1
+ import { B as BaseDecoder } from "./index-BWwrctZk.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-B4Ggb1ZC.js";
1
+ import { B as BaseDecoder } from "./index-BWwrctZk.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-B4Ggb1ZC.js";
1
+ import { B as BaseDecoder } from "./index-BWwrctZk.js";
2
2
  class WebImageDecoder extends BaseDecoder {
3
3
  constructor() {
4
4
  super();
@@ -1 +1 @@
1
- {"version":3,"file":"EmbeddingScatterplotSubscriber.d.ts","sourceRoot":"","sources":["../src/EmbeddingScatterplotSubscriber.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;GAYG;AACH,sDAVG;IAAsB,IAAI,EAAlB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;CAEhB,eA4lBA"}
1
+ {"version":3,"file":"EmbeddingScatterplotSubscriber.d.ts","sourceRoot":"","sources":["../src/EmbeddingScatterplotSubscriber.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;GAYG;AACH,sDAVG;IAAsB,IAAI,EAAlB,MAAM;IACQ,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;IAEU,mBAAmB;IAErB,KAAK,EAAnB,MAAM;IACQ,kBAAkB,EAAhC,MAAM;CAEhB,eA+lBA"}
@@ -211,7 +211,7 @@ export function EmbeddingScatterplotSubscriber(props) {
211
211
  // which surrounds all points in the scatterplot,
212
212
  // which we can use to position text labels along.
213
213
  const circleInfo = useMemo(() => {
214
- if (!originalViewState || !width || !height) {
214
+ if (!originalViewState || !width || !height || !xRange || !yRange) {
215
215
  return null;
216
216
  }
217
217
  const center = [
@@ -222,7 +222,10 @@ export function EmbeddingScatterplotSubscriber(props) {
222
222
  if (!(typeof scaleFactor === 'number' && typeof center[0] === 'number' && typeof center[1] === 'number') || Number.isNaN(scaleFactor)) {
223
223
  return null;
224
224
  }
225
- const radius = Math.min(width, height) / 2 / scaleFactor;
225
+ const size = Math.max(xRange, yRange);
226
+ // TODO: figure out a better solution than
227
+ // scaling the radius by the arbitrary 0.8?
228
+ const radius = ((size * Math.sqrt(2)) / 2) * 0.8;
226
229
  const numPoints = 96;
227
230
  const options = { steps: numPoints, units: 'degrees' };
228
231
  const circlePolygon = circle(center, radius, options);
@@ -232,7 +235,7 @@ export function EmbeddingScatterplotSubscriber(props) {
232
235
  polygon: circlePolygon,
233
236
  steps: numPoints,
234
237
  };
235
- }, [originalViewState, width, height]);
238
+ }, [originalViewState, width, height, xRange, yRange]);
236
239
  // It is possible for the embedding index+data to be out of order
237
240
  // with respect to the matrix index+data. Here, we align the embedding
238
241
  // data so that the rows are ordered the same as the matrix rows.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/scatterplot-embedding",
3
- "version": "3.6.10",
3
+ "version": "3.6.12",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,13 +20,13 @@
20
20
  "lodash-es": "^4.17.21",
21
21
  "react-aria": "^3.28.0",
22
22
  "@turf/circle": "^7.2.0",
23
- "@vitessce/styles": "3.6.10",
24
- "@vitessce/constants-internal": "3.6.10",
25
- "@vitessce/legend": "3.6.10",
26
- "@vitessce/scatterplot": "3.6.10",
27
- "@vitessce/sets-utils": "3.6.10",
28
- "@vitessce/utils": "3.6.10",
29
- "@vitessce/vit-s": "3.6.10"
23
+ "@vitessce/styles": "3.6.12",
24
+ "@vitessce/constants-internal": "3.6.12",
25
+ "@vitessce/legend": "3.6.12",
26
+ "@vitessce/scatterplot": "3.6.12",
27
+ "@vitessce/sets-utils": "3.6.12",
28
+ "@vitessce/utils": "3.6.12",
29
+ "@vitessce/vit-s": "3.6.12"
30
30
  },
31
31
  "devDependencies": {
32
32
  "react": "^18.0.0",
@@ -418,7 +418,7 @@ export function EmbeddingScatterplotSubscriber(props) {
418
418
  // which surrounds all points in the scatterplot,
419
419
  // which we can use to position text labels along.
420
420
  const circleInfo = useMemo(() => {
421
- if (!originalViewState || !width || !height) {
421
+ if (!originalViewState || !width || !height || !xRange || !yRange) {
422
422
  return null;
423
423
  }
424
424
  const center = [
@@ -429,7 +429,10 @@ export function EmbeddingScatterplotSubscriber(props) {
429
429
  if (!(typeof scaleFactor === 'number' && typeof center[0] === 'number' && typeof center[1] === 'number') || Number.isNaN(scaleFactor)) {
430
430
  return null;
431
431
  }
432
- const radius = Math.min(width, height) / 2 / scaleFactor;
432
+ const size = Math.max(xRange, yRange);
433
+ // TODO: figure out a better solution than
434
+ // scaling the radius by the arbitrary 0.8?
435
+ const radius = ((size * Math.sqrt(2)) / 2) * 0.8;
433
436
  const numPoints = 96;
434
437
  const options = { steps: numPoints, units: 'degrees' };
435
438
  const circlePolygon = circle(center, radius, options);
@@ -439,7 +442,7 @@ export function EmbeddingScatterplotSubscriber(props) {
439
442
  polygon: circlePolygon,
440
443
  steps: numPoints,
441
444
  };
442
- }, [originalViewState, width, height]);
445
+ }, [originalViewState, width, height, xRange, yRange]);
443
446
 
444
447
  // It is possible for the embedding index+data to be out of order
445
448
  // with respect to the matrix index+data. Here, we align the embedding