@vitessce/heatmap 3.3.3 → 3.3.5

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-98499b51.js";
2
+ import { B as BaseDecoder } from "./index-dd20d252.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1302,9 +1302,6 @@ var pluralizeExports = pluralize$1.exports;
1302
1302
  const plur = /* @__PURE__ */ getDefaultExportFromCjs(pluralizeExports);
1303
1303
  plur.addPluralRule("glomerulus", "glomeruli");
1304
1304
  plur.addPluralRule("interstitium", "interstitia");
1305
- function fromEntries(iterable) {
1306
- return [...iterable].reduce((obj, { 0: key, 1: val }) => Object.assign(obj, { [key]: val }), {});
1307
- }
1308
1305
  function commaNumber(n2) {
1309
1306
  const nf = new Intl.NumberFormat("en-US");
1310
1307
  return nf.format(n2);
@@ -1371,6 +1368,55 @@ function copyUint8Array(arr) {
1371
1368
  newArr.set(arr);
1372
1369
  return newArr;
1373
1370
  }
1371
+ const defaultPoolSize = typeof navigator !== "undefined" ? navigator.hardwareConcurrency || 4 : 1;
1372
+ class Pool {
1373
+ /**
1374
+ * @constructor
1375
+ * @param {object} Worker The worker class to be used for processing.
1376
+ */
1377
+ constructor(createWorker2) {
1378
+ __publicField(this, "workers");
1379
+ __publicField(this, "idleWorkers");
1380
+ __publicField(this, "waitQueue");
1381
+ this.workers = [];
1382
+ this.idleWorkers = [];
1383
+ this.waitQueue = [];
1384
+ for (let i2 = 0; i2 < defaultPoolSize; ++i2) {
1385
+ const w2 = createWorker2();
1386
+ this.workers.push(w2);
1387
+ this.idleWorkers.push(w2);
1388
+ }
1389
+ }
1390
+ // eslint-disable-next-line class-methods-use-this
1391
+ async process() {
1392
+ throw new Error('Pool needs to implement "process" method');
1393
+ }
1394
+ async waitForWorker() {
1395
+ const idleWorker = this.idleWorkers.pop();
1396
+ if (idleWorker) {
1397
+ return idleWorker;
1398
+ }
1399
+ const waiter = {};
1400
+ const promise = new Promise((resolve) => {
1401
+ waiter.resolve = resolve;
1402
+ });
1403
+ this.waitQueue.push(waiter);
1404
+ return promise;
1405
+ }
1406
+ async finishTask(currentWorker) {
1407
+ const waiter = this.waitQueue.pop();
1408
+ if (waiter && waiter.resolve) {
1409
+ waiter.resolve(currentWorker);
1410
+ } else {
1411
+ this.idleWorkers.push(currentWorker);
1412
+ }
1413
+ }
1414
+ destroy() {
1415
+ for (let i2 = 0; i2 < this.workers.length; ++i2) {
1416
+ this.workers[i2].terminate();
1417
+ }
1418
+ }
1419
+ }
1374
1420
  let getRandomValues$1;
1375
1421
  const rnds8$1 = new Uint8Array(16);
1376
1422
  function rng$1() {
@@ -10890,6 +10936,7 @@ const FileType$1 = {
10890
10936
  OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
10891
10937
  // AnnData
10892
10938
  OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
10939
+ OBS_FEATURE_COLUMNS_ANNDATA_ZARR: "obsFeatureColumns.anndata.zarr",
10893
10940
  OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
10894
10941
  OBS_EMBEDDING_ANNDATA_ZARR: "obsEmbedding.anndata.zarr",
10895
10942
  OBS_SPOTS_ANNDATA_ZARR: "obsSpots.anndata.zarr",
@@ -11616,7 +11663,7 @@ function configSchemaToVersion(zodSchema) {
11616
11663
  return zodSchema.shape.version._def.value;
11617
11664
  }
11618
11665
  ({
11619
- ...fromEntries(SCHEMA_HANDLERS.map(([zodSchema]) => {
11666
+ ...Object.fromEntries(SCHEMA_HANDLERS.map(([zodSchema]) => {
11620
11667
  const version2 = configSchemaToVersion(zodSchema);
11621
11668
  return [version2, zodSchema];
11622
11669
  })),
@@ -11692,6 +11739,9 @@ const annDataObsSets = z.array(z.object({
11692
11739
  ]),
11693
11740
  scorePath: z.string().optional().describe("The location in the AnnData store for the set confidence scores, like 'obs/celltype_prediction_score.'")
11694
11741
  }));
11742
+ z.array(z.object({
11743
+ path: z.string()
11744
+ }));
11695
11745
  const annDataObsSpots = annDataObsm;
11696
11746
  const annDataObsPoints = annDataObsm;
11697
11747
  const annDataObsLocations = annDataObsm;
@@ -18464,62 +18514,19 @@ interpolateSequentialMulti(schemePlasma);
18464
18514
  function getCellColors(params) {
18465
18515
  const { cellSets, cellSetSelection, cellSetColor, obsIndex, theme } = params;
18466
18516
  if (cellSetSelection && cellSets) {
18467
- return treeToCellColorsBySetNames(cellSets, cellSetSelection, cellSetColor, theme);
18517
+ return treeToCellColorsBySetNames(
18518
+ cellSets,
18519
+ cellSetSelection,
18520
+ cellSetColor,
18521
+ theme
18522
+ /* as string */
18523
+ );
18468
18524
  }
18469
18525
  if (obsIndex && theme) {
18470
18526
  return new Map(obsIndex.map((o2) => [o2, getDefaultColor(theme)]));
18471
18527
  }
18472
18528
  return /* @__PURE__ */ new Map();
18473
18529
  }
18474
- const defaultPoolSize = typeof navigator !== "undefined" ? navigator.hardwareConcurrency || 4 : 1;
18475
- class Pool {
18476
- /**
18477
- * @constructor
18478
- * @param {object} Worker The worker class to be used for processing.
18479
- */
18480
- constructor(createWorker2) {
18481
- __publicField(this, "workers");
18482
- __publicField(this, "idleWorkers");
18483
- __publicField(this, "waitQueue");
18484
- this.workers = [];
18485
- this.idleWorkers = [];
18486
- this.waitQueue = [];
18487
- for (let i2 = 0; i2 < defaultPoolSize; ++i2) {
18488
- const w2 = createWorker2();
18489
- this.workers.push(w2);
18490
- this.idleWorkers.push(w2);
18491
- }
18492
- }
18493
- // eslint-disable-next-line class-methods-use-this
18494
- async process() {
18495
- throw new Error('Pool needs to implement "process" method');
18496
- }
18497
- async waitForWorker() {
18498
- const idleWorker = this.idleWorkers.pop();
18499
- if (idleWorker) {
18500
- return idleWorker;
18501
- }
18502
- const waiter = {};
18503
- const promise = new Promise((resolve) => {
18504
- waiter.resolve = resolve;
18505
- });
18506
- this.waitQueue.push(waiter);
18507
- return promise;
18508
- }
18509
- async finishTask(currentWorker) {
18510
- const waiter = this.waitQueue.pop();
18511
- if (waiter && waiter.resolve) {
18512
- waiter.resolve(currentWorker);
18513
- } else {
18514
- this.idleWorkers.push(currentWorker);
18515
- }
18516
- }
18517
- destroy() {
18518
- for (let i2 = 0; i2 < this.workers.length; ++i2) {
18519
- this.workers[i2].terminate();
18520
- }
18521
- }
18522
- }
18523
18530
  function r$1(e3) {
18524
18531
  var t2, f2, n2 = "";
18525
18532
  if ("string" == typeof e3 || "number" == typeof e3)
@@ -20667,19 +20674,19 @@ function _createClass$w(Constructor, protoProps, staticProps) {
20667
20674
  });
20668
20675
  return Constructor;
20669
20676
  }
20670
- function _setPrototypeOf$w(o2, p) {
20671
- _setPrototypeOf$w = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p2) {
20677
+ function _setPrototypeOf$v(o2, p) {
20678
+ _setPrototypeOf$v = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p2) {
20672
20679
  o3.__proto__ = p2;
20673
20680
  return o3;
20674
20681
  };
20675
- return _setPrototypeOf$w(o2, p);
20682
+ return _setPrototypeOf$v(o2, p);
20676
20683
  }
20677
- function _inheritsLoose$1(subClass, superClass) {
20684
+ function _inheritsLoose(subClass, superClass) {
20678
20685
  subClass.prototype = Object.create(superClass.prototype);
20679
20686
  subClass.prototype.constructor = subClass;
20680
- _setPrototypeOf$w(subClass, superClass);
20687
+ _setPrototypeOf$v(subClass, superClass);
20681
20688
  }
20682
- function _assertThisInitialized$w(self2) {
20689
+ function _assertThisInitialized$v(self2) {
20683
20690
  if (self2 === void 0) {
20684
20691
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
20685
20692
  }
@@ -20886,7 +20893,7 @@ var BaseStyleRule = /* @__PURE__ */ function() {
20886
20893
  return BaseStyleRule2;
20887
20894
  }();
20888
20895
  var StyleRule = /* @__PURE__ */ function(_BaseStyleRule) {
20889
- _inheritsLoose$1(StyleRule2, _BaseStyleRule);
20896
+ _inheritsLoose(StyleRule2, _BaseStyleRule);
20890
20897
  function StyleRule2(key, style2, options) {
20891
20898
  var _this;
20892
20899
  _this = _BaseStyleRule.call(this, key, style2, options) || this;
@@ -20894,7 +20901,7 @@ var StyleRule = /* @__PURE__ */ function(_BaseStyleRule) {
20894
20901
  if (selector2) {
20895
20902
  _this.selectorText = selector2;
20896
20903
  } else if (scoped !== false) {
20897
- _this.id = generateId(_assertThisInitialized$w(_assertThisInitialized$w(_this)), sheet);
20904
+ _this.id = generateId(_assertThisInitialized$v(_assertThisInitialized$v(_this)), sheet);
20898
20905
  _this.selectorText = "." + escape(_this.id);
20899
20906
  }
20900
20907
  return _this;
@@ -21124,7 +21131,7 @@ var pluginKeyframesRule = {
21124
21131
  }
21125
21132
  };
21126
21133
  var KeyframeRule = /* @__PURE__ */ function(_BaseStyleRule) {
21127
- _inheritsLoose$1(KeyframeRule2, _BaseStyleRule);
21134
+ _inheritsLoose(KeyframeRule2, _BaseStyleRule);
21128
21135
  function KeyframeRule2() {
21129
21136
  return _BaseStyleRule.apply(this, arguments) || this;
21130
21137
  }
@@ -24036,25 +24043,7 @@ function useIsFocusVisible() {
24036
24043
  ref
24037
24044
  };
24038
24045
  }
24039
- function _setPrototypeOf$v(o2, p) {
24040
- _setPrototypeOf$v = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p2) {
24041
- o3.__proto__ = p2;
24042
- return o3;
24043
- };
24044
- return _setPrototypeOf$v(o2, p);
24045
- }
24046
- function _inheritsLoose(subClass, superClass) {
24047
- subClass.prototype = Object.create(superClass.prototype);
24048
- subClass.prototype.constructor = subClass;
24049
- _setPrototypeOf$v(subClass, superClass);
24050
- }
24051
24046
  const TransitionGroupContext = React__default.createContext(null);
24052
- function _assertThisInitialized$v(self2) {
24053
- if (self2 === void 0) {
24054
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
24055
- }
24056
- return self2;
24057
- }
24058
24047
  function getChildMapping(children2, mapFn) {
24059
24048
  var mapper = function mapper2(child) {
24060
24049
  return mapFn && isValidElement(child) ? mapFn(child) : child;
@@ -24203,7 +24192,7 @@ var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
24203
24192
  }
24204
24193
  if (this.mounted) {
24205
24194
  this.setState(function(state) {
24206
- var children2 = _extends$1({}, state.children);
24195
+ var children2 = _extends$2({}, state.children);
24207
24196
  delete children2[child.key];
24208
24197
  return {
24209
24198
  children: children2
@@ -24212,7 +24201,7 @@ var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
24212
24201
  }
24213
24202
  };
24214
24203
  _proto.render = function render() {
24215
- var _this$props = this.props, Component2 = _this$props.component, childFactory2 = _this$props.childFactory, props2 = _objectWithoutPropertiesLoose$1(_this$props, ["component", "childFactory"]);
24204
+ var _this$props = this.props, Component2 = _this$props.component, childFactory2 = _this$props.childFactory, props2 = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
24216
24205
  var contextValue = this.state.contextValue;
24217
24206
  var children2 = values(this.state.children).map(childFactory2);
24218
24207
  delete props2.appear;
@@ -131554,7 +131543,8 @@ const AXIS_MARGIN = 3;
131554
131543
  const AXIS_PADDING = 10;
131555
131544
  const THEME_TO_TEXT_COLOR = {
131556
131545
  dark: [224, 224, 224],
131557
- light: [64, 64, 64]
131546
+ light: [64, 64, 64],
131547
+ light2: [64, 64, 64]
131558
131548
  };
131559
131549
  const AXIS_FONT_FAMILY = "-apple-system, 'Helvetica Neue', Arial, sans-serif";
131560
131550
  const PIXELATED_TEXTURE_PARAMETERS = {
@@ -132657,16 +132647,16 @@ function addDecoder(cases, importFn) {
132657
132647
  }
132658
132648
  cases.forEach((c) => registry$1.set(c, importFn));
132659
132649
  }
132660
- addDecoder([void 0, 1], () => import("./raw-0da61dee.js").then((m) => m.default));
132661
- addDecoder(5, () => import("./lzw-85a51820.js").then((m) => m.default));
132650
+ addDecoder([void 0, 1], () => import("./raw-b95711bc.js").then((m) => m.default));
132651
+ addDecoder(5, () => import("./lzw-c47337be.js").then((m) => m.default));
132662
132652
  addDecoder(6, () => {
132663
132653
  throw new Error("old style JPEG compression is not supported.");
132664
132654
  });
132665
- addDecoder(7, () => import("./jpeg-de3f5fd6.js").then((m) => m.default));
132666
- addDecoder([8, 32946], () => import("./deflate-ca3a4331.js").then((m) => m.default));
132667
- addDecoder(32773, () => import("./packbits-e923ce89.js").then((m) => m.default));
132668
- addDecoder(34887, () => import("./lerc-1f658a8e.js").then((m) => m.default));
132669
- addDecoder(50001, () => import("./webimage-dc2efc6c.js").then((m) => m.default));
132655
+ addDecoder(7, () => import("./jpeg-329d0b25.js").then((m) => m.default));
132656
+ addDecoder([8, 32946], () => import("./deflate-e18d403c.js").then((m) => m.default));
132657
+ addDecoder(32773, () => import("./packbits-4373d6cf.js").then((m) => m.default));
132658
+ addDecoder(34887, () => import("./lerc-497104ea.js").then((m) => m.default));
132659
+ addDecoder(50001, () => import("./webimage-85278526.js").then((m) => m.default));
132670
132660
  function decodeRowAcc(row, stride) {
132671
132661
  let length2 = row.length - stride;
132672
132662
  let offset5 = 0;
@@ -143908,7 +143898,7 @@ class BitmaskLayer2 extends XRLayer {
143908
143898
  } = this.state;
143909
143899
  if (textures && model) {
143910
143900
  const scaleFactor = 1 / 2 ** (maxZoom - zoom);
143911
- const colors = fromEntries(range$5(MAX_CHANNELS).map((i2) => [`color${i2}`, getColor(channelColors[i2])]));
143901
+ const colors = Object.fromEntries(range$5(MAX_CHANNELS).map((i2) => [`color${i2}`, getColor(channelColors[i2])]));
143912
143902
  model.setUniforms(Object.assign({}, uniforms, {
143913
143903
  ...colors,
143914
143904
  // Bitmask image channel data textures
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, H } from "./index-98499b51.js";
1
+ import { a, H } from "./index-dd20d252.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-98499b51.js";
1
+ import { B as BaseDecoder } from "./index-dd20d252.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-98499b51.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-dd20d252.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-98499b51.js";
1
+ import { B as BaseDecoder } from "./index-dd20d252.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-98499b51.js";
1
+ import { B as BaseDecoder } from "./index-dd20d252.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-98499b51.js";
1
+ import { B as BaseDecoder } from "./index-dd20d252.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-98499b51.js";
1
+ import { B as BaseDecoder } from "./index-dd20d252.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useState, useCallback, useMemo, } from 'react';
3
3
  import { TitleInfo, useDeckCanvasSize, useGetObsMembership, useGetObsInfo, useReady, useUrls, useObsSetsData, useObsFeatureMatrixData, useUint8ObsFeatureMatrix, useMultiObsLabels, useFeatureLabelsData, useCoordination, useLoaders, useSetComponentHover, useSetComponentViewInfo, } from '@vitessce/vit-s';
4
- import { pluralize as plur, capitalize, commaNumber, getCellColors } from '@vitessce/utils';
5
- import { mergeObsSets, findLongestCommonPath } from '@vitessce/sets-utils';
4
+ import { pluralize as plur, capitalize, commaNumber } from '@vitessce/utils';
5
+ import { mergeObsSets, findLongestCommonPath, getCellColors } from '@vitessce/sets-utils';
6
6
  import { COMPONENT_COORDINATION_TYPES, ViewType } from '@vitessce/constants-internal';
7
7
  import { Legend } from '@vitessce/legend';
8
8
  import Heatmap from './Heatmap.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/heatmap",
3
- "version": "3.3.3",
3
+ "version": "3.3.5",
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.3.3",
24
- "@vitessce/sets-utils": "3.3.3",
25
- "@vitessce/legend": "3.3.3",
26
- "@vitessce/tooltip": "3.3.3",
27
- "@vitessce/vit-s": "3.3.3",
28
- "@vitessce/workers": "3.3.3",
29
- "@vitessce/utils": "3.3.3",
30
- "@vitessce/gl": "3.3.3"
23
+ "@vitessce/constants-internal": "3.3.5",
24
+ "@vitessce/gl": "3.3.5",
25
+ "@vitessce/legend": "3.3.5",
26
+ "@vitessce/tooltip": "3.3.5",
27
+ "@vitessce/sets-utils": "3.3.5",
28
+ "@vitessce/utils": "3.3.5",
29
+ "@vitessce/vit-s": "3.3.5",
30
+ "@vitessce/workers": "3.3.5"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@testing-library/jest-dom": "^5.16.4",
@@ -16,8 +16,8 @@ import {
16
16
  useCoordination, useLoaders,
17
17
  useSetComponentHover, useSetComponentViewInfo,
18
18
  } from '@vitessce/vit-s';
19
- import { pluralize as plur, capitalize, commaNumber, getCellColors } from '@vitessce/utils';
20
- import { mergeObsSets, findLongestCommonPath } from '@vitessce/sets-utils';
19
+ import { pluralize as plur, capitalize, commaNumber } from '@vitessce/utils';
20
+ import { mergeObsSets, findLongestCommonPath, getCellColors } from '@vitessce/sets-utils';
21
21
  import { COMPONENT_COORDINATION_TYPES, ViewType } from '@vitessce/constants-internal';
22
22
  import { Legend } from '@vitessce/legend';
23
23
  import Heatmap from './Heatmap.js';