@vitessce/scatterplot-embedding 3.6.13 → 3.6.15

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-BWwrctZk.js";
2
+ import { B as BaseDecoder } from "./index-D8r0IhL2.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -9687,6 +9687,7 @@ const FileType$1 = {
9687
9687
  OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
9688
9688
  FEATURE_LABELS_SPATIALDATA_ZARR: "featureLabels.spatialdata.zarr",
9689
9689
  OBS_POINTS_SPATIALDATA_ZARR: "obsPoints.spatialdata.zarr",
9690
+ OBS_EMBEDDING_SPATIALDATA_ZARR: "obsEmbedding.spatialdata.zarr",
9690
9691
  // SpatialData - zipped
9691
9692
  IMAGE_SPATIALDATA_ZARR_ZIP: "image.spatialdata.zarr.zip",
9692
9693
  LABELS_SPATIALDATA_ZARR_ZIP: "labels.spatialdata.zarr.zip",
@@ -9696,6 +9697,7 @@ const FileType$1 = {
9696
9697
  OBS_SPOTS_SPATIALDATA_ZARR_ZIP: "obsSpots.spatialdata.zarr.zip",
9697
9698
  FEATURE_LABELS_SPATIALDATA_ZARR_ZIP: "featureLabels.spatialdata.zarr.zip",
9698
9699
  OBS_POINTS_SPATIALDATA_ZARR_ZIP: "obsPoints.spatialdata.zarr.zip",
9700
+ OBS_EMBEDDING_SPATIALDATA_ZARR_ZIP: "obsEmbedding.spatialdata.zarr.zip",
9699
9701
  // MuData
9700
9702
  OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
9701
9703
  OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
@@ -9946,6 +9948,7 @@ const ViewHelpMapping = {
9946
9948
  [FileType$1.OBS_SETS_SPATIALDATA_ZARR]: DataType$2.OBS_SETS,
9947
9949
  [FileType$1.FEATURE_LABELS_SPATIALDATA_ZARR]: DataType$2.FEATURE_LABELS,
9948
9950
  [FileType$1.OBS_POINTS_SPATIALDATA_ZARR]: DataType$2.OBS_POINTS,
9951
+ [FileType$1.OBS_EMBEDDING_SPATIALDATA_ZARR]: DataType$2.OBS_EMBEDDING,
9949
9952
  // For new file types to support old file types
9950
9953
  [FileType$1.OBS_EMBEDDING_CELLS_JSON]: DataType$2.OBS_EMBEDDING,
9951
9954
  [FileType$1.OBS_LOCATIONS_CELLS_JSON]: DataType$2.OBS_LOCATIONS,
@@ -10122,6 +10125,9 @@ const ViewHelpMapping = {
10122
10125
  },
10123
10126
  [FileType$1.OBS_POINTS_SPATIALDATA_ZARR]: {
10124
10127
  zip: FileType$1.OBS_POINTS_SPATIALDATA_ZARR_ZIP
10128
+ },
10129
+ [FileType$1.OBS_EMBEDDING_SPATIALDATA_ZARR]: {
10130
+ zip: FileType$1.OBS_EMBEDDING_SPATIALDATA_ZARR_ZIP
10125
10131
  }
10126
10132
  });
10127
10133
  [
@@ -11169,6 +11175,16 @@ const obsSetsSpatialdataSchema = z.object({
11169
11175
  tablePath: z.string().optional().describe("The path to a table which contains the index for the set values."),
11170
11176
  obsSets: annDataObsSetsArr
11171
11177
  });
11178
+ annDataObsEmbedding.extend({
11179
+ // We extend anndataObsEmbedding which already has properties like `dims` and `path`.
11180
+ region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional(),
11181
+ tablePath: z.string().optional().describe("The path to a table which contains the index for the set values.")
11182
+ });
11183
+ const obsEmbeddingSpatialdataSchemaConvenience = z.union([
11184
+ annDataObsEmbedding,
11185
+ // For convenience, allow an array of items with `embeddingType` properties.
11186
+ z.array(annDataConvenienceObsEmbeddingItem)
11187
+ ]);
11172
11188
  z.object({
11173
11189
  targetX: z.number(),
11174
11190
  targetY: z.number(),
@@ -11277,9 +11293,10 @@ z.object({
11277
11293
  // TODO: obsPoints
11278
11294
  // TODO: obsLocations
11279
11295
  obsSets: obsSetsSpatialdataSchema,
11280
- // TODO: obsEmbedding
11296
+ obsEmbedding: obsEmbeddingSpatialdataSchemaConvenience,
11281
11297
  // TODO: obsLabels
11282
11298
  // TODO: featureLabels
11299
+ // TODO: allow specifying tablePath and region at the top-level here.
11283
11300
  coordinateSystem: z.string().optional().describe("The name of a coordinate transformation output used to transform all elements which lack a per-element coordinateSystem property.")
11284
11301
  }).partial();
11285
11302
  z.object({
@@ -123306,22 +123323,22 @@ function addDecoder(cases, importFn) {
123306
123323
  }
123307
123324
  cases.forEach((c2) => registry$1.set(c2, importFn));
123308
123325
  }
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));
123326
+ addDecoder([void 0, 1], () => import("./raw-Ddzhu2WQ.js").then((m2) => m2.default));
123327
+ addDecoder(5, () => import("./lzw-D-BbpGiu.js").then((m2) => m2.default));
123311
123328
  addDecoder(6, () => {
123312
123329
  throw new Error("old style JPEG compression is not supported.");
123313
123330
  });
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));
123331
+ addDecoder(7, () => import("./jpeg-CgBOQiTD.js").then((m2) => m2.default));
123332
+ addDecoder([8, 32946], () => import("./deflate-k2pYg4c6.js").then((m2) => m2.default));
123333
+ addDecoder(32773, () => import("./packbits-Cs8NfpR6.js").then((m2) => m2.default));
123317
123334
  addDecoder(
123318
123335
  34887,
123319
- () => import("./lerc-DPVW-T-N.js").then(async (m2) => {
123336
+ () => import("./lerc-ku5SU9l7.js").then(async (m2) => {
123320
123337
  await m2.zstd.init();
123321
123338
  return m2;
123322
123339
  }).then((m2) => m2.default)
123323
123340
  );
123324
- addDecoder(50001, () => import("./webimage-CjiYMJXR.js").then((m2) => m2.default));
123341
+ addDecoder(50001, () => import("./webimage-CC8JAPvA.js").then((m2) => m2.default));
123325
123342
  function decodeRowAcc(row, stride) {
123326
123343
  let length2 = row.length - stride;
123327
123344
  let offset2 = 0;
@@ -133279,10 +133296,10 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
133279
133296
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
133280
133297
  var _a3, _b2, _c, _d;
133281
133298
  if (isSetColorMode) {
133282
- totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) || 0) * 3;
133299
+ totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) ?? 0) * 3;
133283
133300
  totalValuesLength += ((_c = setColorValues[channelIndex]) == null ? void 0 : _c.obsIndex) ? max(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
133284
133301
  } else {
133285
- totalValuesLength += multiMatrixObsIndex[channelIndex] ? max(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) || 0;
133302
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) ?? 0;
133286
133303
  }
133287
133304
  });
133288
133305
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -133303,7 +133320,7 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
133303
133320
  const matrixObsIndex = multiMatrixObsIndex[channelIndex];
133304
133321
  const bitmaskValueIsIndex = matrixObsIndex === null;
133305
133322
  if (isSetColorMode) {
133306
- const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] || {};
133323
+ const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] ?? {};
133307
133324
  if (setColorIndices && setColors && obsIndex) {
133308
133325
  for (let i2 = 0; i2 < obsIndex.length; i2++) {
133309
133326
  let obsId = String(i2 + 1);
@@ -133327,7 +133344,7 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
133327
133344
  indexOffset += (obsIndex == null ? void 0 : obsIndex.length) || 0;
133328
133345
  colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
133329
133346
  } else {
133330
- const featureArr = multiFeatureValues[channelIndex];
133347
+ const featureArr = multiFeatureValues[channelIndex] ?? [];
133331
133348
  const normalizedFeatureArr = normalize$1(featureArr);
133332
133349
  if (!bitmaskValueIsIndex && matrixObsIndex) {
133333
133350
  for (let i2 = 0; i2 < matrixObsIndex.length; i2++) {
@@ -153226,6 +153243,8 @@ function Legend(props) {
153226
153243
  featureSelectionLabelRawStr = "Sum of features";
153227
153244
  } else if (featureAggregationStrategy === "mean") {
153228
153245
  featureSelectionLabelRawStr = "Mean of features";
153246
+ } else {
153247
+ featureSelectionLabelRawStr = featureSelectionLabelRaw == null ? void 0 : featureSelectionLabelRaw[0];
153229
153248
  }
153230
153249
  const combinedMissing = combineMissings(missing, featureAggregationStrategy);
153231
153250
  const featureSelectionLabel = combinedMissing ? `${featureSelectionLabelRawStr} (${Math.round(combinedMissing * 100)}% NaN)` : featureSelectionLabelRawStr;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D, E } from "./index-BWwrctZk.js";
1
+ import { D, E } from "./index-D8r0IhL2.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-BWwrctZk.js";
1
+ import { B as BaseDecoder } from "./index-D8r0IhL2.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-BWwrctZk.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-D8r0IhL2.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-BWwrctZk.js";
1
+ import { B as BaseDecoder } from "./index-D8r0IhL2.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-BWwrctZk.js";
1
+ import { B as BaseDecoder } from "./index-D8r0IhL2.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-BWwrctZk.js";
1
+ import { B as BaseDecoder } from "./index-D8r0IhL2.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-BWwrctZk.js";
1
+ import { B as BaseDecoder } from "./index-D8r0IhL2.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-embedding",
3
- "version": "3.6.13",
3
+ "version": "3.6.15",
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.13",
24
- "@vitessce/constants-internal": "3.6.13",
25
- "@vitessce/legend": "3.6.13",
26
- "@vitessce/scatterplot": "3.6.13",
27
- "@vitessce/sets-utils": "3.6.13",
28
- "@vitessce/utils": "3.6.13",
29
- "@vitessce/vit-s": "3.6.13"
23
+ "@vitessce/styles": "3.6.15",
24
+ "@vitessce/constants-internal": "3.6.15",
25
+ "@vitessce/legend": "3.6.15",
26
+ "@vitessce/scatterplot": "3.6.15",
27
+ "@vitessce/sets-utils": "3.6.15",
28
+ "@vitessce/utils": "3.6.15",
29
+ "@vitessce/vit-s": "3.6.15"
30
30
  },
31
31
  "devDependencies": {
32
32
  "react": "^18.0.0",