@vitessce/heatmap 3.2.2 → 3.3.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-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-99684608.js";
2
+ import { B as BaseDecoder } from "./index-3c0e8e85.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,3 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
1
7
  import * as React from "react";
2
8
  import React__default, { Children, isValidElement, cloneElement, useRef, useMemo, useEffect, useLayoutEffect, createElement, forwardRef, useState, useImperativeHandle, useReducer, useCallback, useContext } from "react";
3
9
  import { useVitessceContainer, useComponentHover, useComponentViewInfo, usePlotOptionsStyles, OptionsContainer, OptionSelect, useLoaders, useSetComponentHover, useSetComponentViewInfo, useCoordination, useDeckCanvasSize, useMultiObsLabels, useFeatureLabelsData, useObsFeatureMatrixData, useObsSetsData, useReady, useUrls, useUint8ObsFeatureMatrix, useGetObsInfo, useGetObsMembership, TitleInfo } from "@vitessce/vit-s";
@@ -10867,6 +10873,7 @@ const DataType$2 = {
10867
10873
  const FileType$1 = {
10868
10874
  // Joint file types
10869
10875
  ANNDATA_ZARR: "anndata.zarr",
10876
+ SPATIALDATA_ZARR: "spatialdata.zarr",
10870
10877
  // Atomic file types
10871
10878
  OBS_EMBEDDING_CSV: "obsEmbedding.csv",
10872
10879
  OBS_SPOTS_CSV: "obsSpots.csv",
@@ -10889,6 +10896,16 @@ const FileType$1 = {
10889
10896
  OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
10890
10897
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
10891
10898
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
10899
+ // SpatialData
10900
+ IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
10901
+ LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
10902
+ SHAPES_SPATIALDATA_ZARR: "shapes.spatialdata.zarr",
10903
+ OBS_FEATURE_MATRIX_SPATIALDATA_ZARR: "obsFeatureMatrix.spatialdata.zarr",
10904
+ OBS_SETS_SPATIALDATA_ZARR: "obsSets.spatialdata.zarr",
10905
+ OBS_SPOTS_SPATIALDATA_ZARR: "obsSpots.spatialdata.zarr",
10906
+ // TODO:
10907
+ // OBS_POINTS_SPATIALDATA_ZARR: 'obsPoints.spatialdata.zarr',
10908
+ // OBS_LOCATIONS_SPATIALDATA_ZARR: 'obsLocations.spatialdata.zarr',
10892
10909
  // MuData
10893
10910
  OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
10894
10911
  OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
@@ -11690,9 +11707,30 @@ z.object({
11690
11707
  offsetsUrl: z.string().optional(),
11691
11708
  coordinateTransformations: omeCoordinateTransformations.optional()
11692
11709
  });
11693
- z.object({
11710
+ const imageOmeZarrSchema = z.object({
11694
11711
  coordinateTransformations: omeCoordinateTransformations.optional()
11695
11712
  });
11713
+ imageOmeZarrSchema.extend({
11714
+ path: z.string()
11715
+ });
11716
+ z.object({
11717
+ path: z.string()
11718
+ });
11719
+ z.object({
11720
+ path: z.string()
11721
+ });
11722
+ z.object({
11723
+ path: z.string(),
11724
+ tablePath: z.string().optional().describe("The path to a table which annotates the spots. If available but not specified, the spot identifiers may not be aligned with associated tabular data as expected.")
11725
+ });
11726
+ annDataObsFeatureMatrix.extend({
11727
+ region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional()
11728
+ });
11729
+ z.object({
11730
+ region: z.string().describe("The name of a region to use to filter instances (i.e., rows) in the table").optional(),
11731
+ tablePath: z.string().optional().describe("The path to a table which contains the index for the set values."),
11732
+ obsSets: annDataObsSets
11733
+ });
11696
11734
  z.object({
11697
11735
  obsIndex: z.string(),
11698
11736
  obsEmbedding: z.array(z.string()).length(2)
@@ -18354,9 +18392,9 @@ const schemePlasma = [[13, 8, 135], [16, 7, 136], [19, 7, 137], [22, 7, 138], [2
18354
18392
  function rgbSpline(spline) {
18355
18393
  return (colors) => {
18356
18394
  const n2 = colors.length;
18357
- let r2 = new Array(n2);
18358
- let g2 = new Array(n2);
18359
- let b = new Array(n2);
18395
+ const r2 = new Array(n2);
18396
+ const g2 = new Array(n2);
18397
+ const b = new Array(n2);
18360
18398
  let i2;
18361
18399
  let color2;
18362
18400
  for (i2 = 0; i2 < n2; ++i2) {
@@ -18365,10 +18403,10 @@ function rgbSpline(spline) {
18365
18403
  g2[i2] = color2[1] || 0;
18366
18404
  b[i2] = color2[2] || 0;
18367
18405
  }
18368
- r2 = spline(r2);
18369
- g2 = spline(g2);
18370
- b = spline(b);
18371
- return (t2) => [r2(t2), g2(t2), b(t2)];
18406
+ const rFunc = spline(r2);
18407
+ const gFunc = spline(g2);
18408
+ const bFunc = spline(b);
18409
+ return (t2) => [rFunc(t2), gFunc(t2), bFunc(t2)];
18372
18410
  };
18373
18411
  }
18374
18412
  function basis(values2) {
@@ -18404,17 +18442,19 @@ function getCellColors(params) {
18404
18442
  }
18405
18443
  return /* @__PURE__ */ new Map();
18406
18444
  }
18407
- const defaultPoolSize = typeof navigator !== "undefined" ? navigator.hardwareConcurrency || 4 : null;
18445
+ const defaultPoolSize = typeof navigator !== "undefined" ? navigator.hardwareConcurrency || 4 : 1;
18408
18446
  class Pool {
18409
18447
  /**
18410
18448
  * @constructor
18411
18449
  * @param {object} Worker The worker class to be used for processing.
18412
18450
  */
18413
18451
  constructor(createWorker2) {
18452
+ __publicField(this, "workers");
18453
+ __publicField(this, "idleWorkers");
18454
+ __publicField(this, "waitQueue");
18414
18455
  this.workers = [];
18415
18456
  this.idleWorkers = [];
18416
18457
  this.waitQueue = [];
18417
- this.decoder = null;
18418
18458
  for (let i2 = 0; i2 < defaultPoolSize; ++i2) {
18419
18459
  const w2 = createWorker2();
18420
18460
  this.workers.push(w2);
@@ -18439,7 +18479,7 @@ class Pool {
18439
18479
  }
18440
18480
  async finishTask(currentWorker) {
18441
18481
  const waiter = this.waitQueue.pop();
18442
- if (waiter) {
18482
+ if (waiter && waiter.resolve) {
18443
18483
  waiter.resolve(currentWorker);
18444
18484
  } else {
18445
18485
  this.idleWorkers.push(currentWorker);
@@ -30597,9 +30637,9 @@ function Legend(props2) {
30597
30637
  const hasSubLabel = subLabel !== null;
30598
30638
  if (!isSetColor) {
30599
30639
  g2.append("text").attr("text-anchor", hasSubLabel ? "start" : "end").attr("dominant-baseline", "hanging").attr("x", hasSubLabel ? 0 : width).attr("y", 0).text(mainLabel).style("font-size", "10px").style("fill", foregroundColor);
30600
- }
30601
- if (hasSubLabel) {
30602
- g2.append("text").attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("x", width).attr("y", titleHeight).text(subLabel).style("font-size", "9px").style("fill", foregroundColor);
30640
+ if (hasSubLabel) {
30641
+ g2.append("text").attr("text-anchor", "end").attr("dominant-baseline", "hanging").attr("x", width).attr("y", titleHeight).text(subLabel).style("font-size", "9px").style("fill", foregroundColor);
30642
+ }
30603
30643
  }
30604
30644
  }, [
30605
30645
  width,
@@ -132521,16 +132561,16 @@ function addDecoder(cases, importFn) {
132521
132561
  }
132522
132562
  cases.forEach((c) => registry$1.set(c, importFn));
132523
132563
  }
132524
- addDecoder([void 0, 1], () => import("./raw-ed466def.js").then((m) => m.default));
132525
- addDecoder(5, () => import("./lzw-dcec678f.js").then((m) => m.default));
132564
+ addDecoder([void 0, 1], () => import("./raw-7b8f8ab9.js").then((m) => m.default));
132565
+ addDecoder(5, () => import("./lzw-72ff5da2.js").then((m) => m.default));
132526
132566
  addDecoder(6, () => {
132527
132567
  throw new Error("old style JPEG compression is not supported.");
132528
132568
  });
132529
- addDecoder(7, () => import("./jpeg-91201fe5.js").then((m) => m.default));
132530
- addDecoder([8, 32946], () => import("./deflate-54e8a983.js").then((m) => m.default));
132531
- addDecoder(32773, () => import("./packbits-1f0b4f8a.js").then((m) => m.default));
132532
- addDecoder(34887, () => import("./lerc-ede29ce8.js").then((m) => m.default));
132533
- addDecoder(50001, () => import("./webimage-892fe81d.js").then((m) => m.default));
132569
+ addDecoder(7, () => import("./jpeg-793f8655.js").then((m) => m.default));
132570
+ addDecoder([8, 32946], () => import("./deflate-3d857d4d.js").then((m) => m.default));
132571
+ addDecoder(32773, () => import("./packbits-f9a71497.js").then((m) => m.default));
132572
+ addDecoder(34887, () => import("./lerc-e636506e.js").then((m) => m.default));
132573
+ addDecoder(50001, () => import("./webimage-bddf84dc.js").then((m) => m.default));
132534
132574
  function decodeRowAcc(row, stride) {
132535
132575
  let length2 = row.length - stride;
132536
132576
  let offset5 = 0;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, H } from "./index-99684608.js";
1
+ import { a, H } from "./index-3c0e8e85.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-99684608.js";
1
+ import { B as BaseDecoder } from "./index-3c0e8e85.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-99684608.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-3c0e8e85.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-99684608.js";
1
+ import { B as BaseDecoder } from "./index-3c0e8e85.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-99684608.js";
1
+ import { B as BaseDecoder } from "./index-3c0e8e85.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-99684608.js";
1
+ import { B as BaseDecoder } from "./index-3c0e8e85.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-99684608.js";
1
+ import { B as BaseDecoder } from "./index-3c0e8e85.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/heatmap",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,14 +20,14 @@
20
20
  "lodash-es": "^4.17.21",
21
21
  "uuid": "^9.0.0",
22
22
  "react-aria": "^3.28.0",
23
- "@vitessce/constants-internal": "3.2.2",
24
- "@vitessce/gl": "3.2.2",
25
- "@vitessce/legend": "3.2.2",
26
- "@vitessce/sets-utils": "3.2.2",
27
- "@vitessce/tooltip": "3.2.2",
28
- "@vitessce/utils": "3.2.2",
29
- "@vitessce/vit-s": "3.2.2",
30
- "@vitessce/workers": "3.2.2"
23
+ "@vitessce/constants-internal": "3.3.0",
24
+ "@vitessce/legend": "3.3.0",
25
+ "@vitessce/sets-utils": "3.3.0",
26
+ "@vitessce/gl": "3.3.0",
27
+ "@vitessce/tooltip": "3.3.0",
28
+ "@vitessce/utils": "3.3.0",
29
+ "@vitessce/vit-s": "3.3.0",
30
+ "@vitessce/workers": "3.3.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "^5.16.4",