@vitessce/spatial-utils 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-B7UQn9SL.js";
2
+ import { B as BaseDecoder } from "./index-DNlaWdqD.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -120366,22 +120366,22 @@ function addDecoder(cases, importFn) {
120366
120366
  }
120367
120367
  cases.forEach((c) => registry$2.set(c, importFn));
120368
120368
  }
120369
- addDecoder([void 0, 1], () => import("./raw-NP8gx4mT.js").then((m) => m.default));
120370
- addDecoder(5, () => import("./lzw-CEZtZPvs.js").then((m) => m.default));
120369
+ addDecoder([void 0, 1], () => import("./raw-Bss46i_c.js").then((m) => m.default));
120370
+ addDecoder(5, () => import("./lzw-DkntU-ha.js").then((m) => m.default));
120371
120371
  addDecoder(6, () => {
120372
120372
  throw new Error("old style JPEG compression is not supported.");
120373
120373
  });
120374
- addDecoder(7, () => import("./jpeg-C55SiNtf.js").then((m) => m.default));
120375
- addDecoder([8, 32946], () => import("./deflate-TxuAgoYJ.js").then((m) => m.default));
120376
- addDecoder(32773, () => import("./packbits-BDxIgeb9.js").then((m) => m.default));
120374
+ addDecoder(7, () => import("./jpeg-DaGR7vcd.js").then((m) => m.default));
120375
+ addDecoder([8, 32946], () => import("./deflate-CGOn-uf0.js").then((m) => m.default));
120376
+ addDecoder(32773, () => import("./packbits-DxfeCzu5.js").then((m) => m.default));
120377
120377
  addDecoder(
120378
120378
  34887,
120379
- () => import("./lerc-cC8m0WBJ.js").then(async (m) => {
120379
+ () => import("./lerc-CMrT9aqC.js").then(async (m) => {
120380
120380
  await m.zstd.init();
120381
120381
  return m;
120382
120382
  }).then((m) => m.default)
120383
120383
  );
120384
- addDecoder(50001, () => import("./webimage-BMtq3qgy.js").then((m) => m.default));
120384
+ addDecoder(50001, () => import("./webimage-CBrq6HV-.js").then((m) => m.default));
120385
120385
  function decodeRowAcc(row, stride) {
120386
120386
  let length2 = row.length - stride;
120387
120387
  let offset = 0;
@@ -134131,10 +134131,10 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
134131
134131
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
134132
134132
  var _a3, _b2, _c2, _d;
134133
134133
  if (isSetColorMode) {
134134
- totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) || 0) * 3;
134134
+ totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) ?? 0) * 3;
134135
134135
  totalValuesLength += ((_c2 = setColorValues[channelIndex]) == null ? void 0 : _c2.obsIndex) ? max(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
134136
134136
  } else {
134137
- totalValuesLength += multiMatrixObsIndex[channelIndex] ? max(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) || 0;
134137
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) ?? 0;
134138
134138
  }
134139
134139
  });
134140
134140
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -134155,7 +134155,7 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
134155
134155
  const matrixObsIndex = multiMatrixObsIndex[channelIndex];
134156
134156
  const bitmaskValueIsIndex = matrixObsIndex === null;
134157
134157
  if (isSetColorMode) {
134158
- const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] || {};
134158
+ const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] ?? {};
134159
134159
  if (setColorIndices && setColors && obsIndex) {
134160
134160
  for (let i2 = 0; i2 < obsIndex.length; i2++) {
134161
134161
  let obsId = String(i2 + 1);
@@ -134179,7 +134179,7 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
134179
134179
  indexOffset += (obsIndex == null ? void 0 : obsIndex.length) || 0;
134180
134180
  colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
134181
134181
  } else {
134182
- const featureArr = multiFeatureValues[channelIndex];
134182
+ const featureArr = multiFeatureValues[channelIndex] ?? [];
134183
134183
  const normalizedFeatureArr = normalize(featureArr);
134184
134184
  if (!bitmaskValueIsIndex && matrixObsIndex) {
134185
134185
  for (let i2 = 0; i2 < matrixObsIndex.length; i2++) {
@@ -138274,18 +138274,6 @@ function coordinateTransformationsToMatrixForSpatialData(ngffMetadata, targetCoo
138274
138274
  );
138275
138275
  return coordinateTransformationsToMatrix(normalizedTransformations, normAxes);
138276
138276
  }
138277
- class NodeNotFoundError extends Error {
138278
- constructor(context, options = {}) {
138279
- super(`Node not found: ${context}`, options);
138280
- this.name = "NodeNotFoundError";
138281
- }
138282
- }
138283
- class KeyError extends Error {
138284
- constructor(path) {
138285
- super(`Missing key: ${path}`);
138286
- this.name = "KeyError";
138287
- }
138288
- }
138289
138277
  class BoolArray {
138290
138278
  constructor(x, byteOffset, length2) {
138291
138279
  __privateAdd(this, _bytes);
@@ -138803,7 +138791,7 @@ const _JsonCodec = class _JsonCodec {
138803
138791
  const items = Array.from(buf.data);
138804
138792
  items.push("|O");
138805
138793
  items.push(buf.shape);
138806
- let replacer = void 0;
138794
+ let replacer;
138807
138795
  if (replacer_functions.length) {
138808
138796
  replacer = (key, value) => {
138809
138797
  let new_value = value;
@@ -139066,6 +139054,18 @@ async function load_codecs(chunk_meta) {
139066
139054
  function is_typed_array_like_meta(meta) {
139067
139055
  return meta.data_type !== "v2:object";
139068
139056
  }
139057
+ class NodeNotFoundError extends Error {
139058
+ constructor(context, options = {}) {
139059
+ super(`Node not found: ${context}`, options);
139060
+ this.name = "NodeNotFoundError";
139061
+ }
139062
+ }
139063
+ class KeyError extends Error {
139064
+ constructor(path) {
139065
+ super(`Missing key: ${path}`);
139066
+ this.name = "KeyError";
139067
+ }
139068
+ }
139069
139069
  const MAX_BIG_UINT = 18446744073709551615n;
139070
139070
  function create_sharded_chunk_getter(location, shard_shape, encode_shard_key, sharding_config) {
139071
139071
  assert$1(location.store.getRange, "Store does not support range requests");
@@ -139242,105 +139242,6 @@ let Array$1 = (_c = class extends (_a = Location, _a) {
139242
139242
  return is_dtype(this.dtype, query);
139243
139243
  }
139244
139244
  }, _metadata2 = new WeakMap(), _c);
139245
- let VERSION_COUNTER = create_version_counter();
139246
- function create_version_counter() {
139247
- let version_counts = /* @__PURE__ */ new WeakMap();
139248
- function get_counts(store) {
139249
- let counts = version_counts.get(store) ?? { v2: 0, v3: 0 };
139250
- version_counts.set(store, counts);
139251
- return counts;
139252
- }
139253
- return {
139254
- increment(store, version2) {
139255
- get_counts(store)[version2] += 1;
139256
- },
139257
- version_max(store) {
139258
- let counts = get_counts(store);
139259
- return counts.v3 > counts.v2 ? "v3" : "v2";
139260
- }
139261
- };
139262
- }
139263
- async function load_attrs(location) {
139264
- let meta_bytes = await location.store.get(location.resolve(".zattrs").path);
139265
- if (!meta_bytes)
139266
- return {};
139267
- return json_decode_object(meta_bytes);
139268
- }
139269
- async function open_v2(location, options = {}) {
139270
- let loc = "store" in location ? location : new Location(location);
139271
- let attrs = {};
139272
- if (options.attrs ?? true)
139273
- attrs = await load_attrs(loc);
139274
- if (options.kind === "array")
139275
- return open_array_v2(loc, attrs);
139276
- if (options.kind === "group")
139277
- return open_group_v2(loc, attrs);
139278
- return open_array_v2(loc, attrs).catch((err2) => {
139279
- rethrow_unless(err2, NodeNotFoundError);
139280
- return open_group_v2(loc, attrs);
139281
- });
139282
- }
139283
- async function open_array_v2(location, attrs) {
139284
- let { path } = location.resolve(".zarray");
139285
- let meta = await location.store.get(path);
139286
- if (!meta) {
139287
- throw new NodeNotFoundError("v2 array", {
139288
- cause: new KeyError(path)
139289
- });
139290
- }
139291
- VERSION_COUNTER.increment(location.store, "v2");
139292
- return new Array$1(location.store, location.path, v2_to_v3_array_metadata(json_decode_object(meta), attrs));
139293
- }
139294
- async function open_group_v2(location, attrs) {
139295
- let { path } = location.resolve(".zgroup");
139296
- let meta = await location.store.get(path);
139297
- if (!meta) {
139298
- throw new NodeNotFoundError("v2 group", {
139299
- cause: new KeyError(path)
139300
- });
139301
- }
139302
- VERSION_COUNTER.increment(location.store, "v2");
139303
- return new Group(location.store, location.path, v2_to_v3_group_metadata(json_decode_object(meta), attrs));
139304
- }
139305
- async function _open_v3(location) {
139306
- let { store, path } = location.resolve("zarr.json");
139307
- let meta = await location.store.get(path);
139308
- if (!meta) {
139309
- throw new NodeNotFoundError("v3 array or group", {
139310
- cause: new KeyError(path)
139311
- });
139312
- }
139313
- let meta_doc = json_decode_object(meta);
139314
- if (meta_doc.node_type === "array") {
139315
- meta_doc.fill_value = ensure_correct_scalar(meta_doc);
139316
- }
139317
- return meta_doc.node_type === "array" ? new Array$1(store, location.path, meta_doc) : new Group(store, location.path, meta_doc);
139318
- }
139319
- async function open_v3(location, options = {}) {
139320
- let loc = "store" in location ? location : new Location(location);
139321
- let node2 = await _open_v3(loc);
139322
- VERSION_COUNTER.increment(loc.store, "v3");
139323
- if (options.kind === void 0)
139324
- return node2;
139325
- if (options.kind === "array" && node2 instanceof Array$1)
139326
- return node2;
139327
- if (options.kind === "group" && node2 instanceof Group)
139328
- return node2;
139329
- let kind = node2 instanceof Array$1 ? "array" : "group";
139330
- throw new Error(`Expected node of kind ${options.kind}, found ${kind}.`);
139331
- }
139332
- async function open(location, options = {}) {
139333
- let store = "store" in location ? location.store : location;
139334
- let version_max = VERSION_COUNTER.version_max(store);
139335
- let open_primary = version_max === "v2" ? open.v2 : open.v3;
139336
- let open_secondary = version_max === "v2" ? open.v3 : open.v2;
139337
- return open_primary(location, options).catch((err2) => {
139338
- rethrow_unless(err2, NodeNotFoundError);
139339
- return open_secondary(location, options);
139340
- });
139341
- }
139342
- open.v2 = open_v2;
139343
- open.v3 = open_v3;
139344
139245
  function* range(start, stop, step = 1) {
139345
139246
  if (stop === void 0) {
139346
139247
  stop = start;
@@ -139721,6 +139622,105 @@ function set_from_chunk_binary(dest, src, bytes_per_element2, projections) {
139721
139622
  }, bytes_per_element2, projs);
139722
139623
  }
139723
139624
  }
139625
+ let VERSION_COUNTER = create_version_counter();
139626
+ function create_version_counter() {
139627
+ let version_counts = /* @__PURE__ */ new WeakMap();
139628
+ function get_counts(store) {
139629
+ let counts = version_counts.get(store) ?? { v2: 0, v3: 0 };
139630
+ version_counts.set(store, counts);
139631
+ return counts;
139632
+ }
139633
+ return {
139634
+ increment(store, version2) {
139635
+ get_counts(store)[version2] += 1;
139636
+ },
139637
+ version_max(store) {
139638
+ let counts = get_counts(store);
139639
+ return counts.v3 > counts.v2 ? "v3" : "v2";
139640
+ }
139641
+ };
139642
+ }
139643
+ async function load_attrs(location) {
139644
+ let meta_bytes = await location.store.get(location.resolve(".zattrs").path);
139645
+ if (!meta_bytes)
139646
+ return {};
139647
+ return json_decode_object(meta_bytes);
139648
+ }
139649
+ async function open_v2(location, options = {}) {
139650
+ let loc = "store" in location ? location : new Location(location);
139651
+ let attrs = {};
139652
+ if (options.attrs ?? true)
139653
+ attrs = await load_attrs(loc);
139654
+ if (options.kind === "array")
139655
+ return open_array_v2(loc, attrs);
139656
+ if (options.kind === "group")
139657
+ return open_group_v2(loc, attrs);
139658
+ return open_array_v2(loc, attrs).catch((err2) => {
139659
+ rethrow_unless(err2, NodeNotFoundError);
139660
+ return open_group_v2(loc, attrs);
139661
+ });
139662
+ }
139663
+ async function open_array_v2(location, attrs) {
139664
+ let { path } = location.resolve(".zarray");
139665
+ let meta = await location.store.get(path);
139666
+ if (!meta) {
139667
+ throw new NodeNotFoundError("v2 array", {
139668
+ cause: new KeyError(path)
139669
+ });
139670
+ }
139671
+ VERSION_COUNTER.increment(location.store, "v2");
139672
+ return new Array$1(location.store, location.path, v2_to_v3_array_metadata(json_decode_object(meta), attrs));
139673
+ }
139674
+ async function open_group_v2(location, attrs) {
139675
+ let { path } = location.resolve(".zgroup");
139676
+ let meta = await location.store.get(path);
139677
+ if (!meta) {
139678
+ throw new NodeNotFoundError("v2 group", {
139679
+ cause: new KeyError(path)
139680
+ });
139681
+ }
139682
+ VERSION_COUNTER.increment(location.store, "v2");
139683
+ return new Group(location.store, location.path, v2_to_v3_group_metadata(json_decode_object(meta), attrs));
139684
+ }
139685
+ async function _open_v3(location) {
139686
+ let { store, path } = location.resolve("zarr.json");
139687
+ let meta = await location.store.get(path);
139688
+ if (!meta) {
139689
+ throw new NodeNotFoundError("v3 array or group", {
139690
+ cause: new KeyError(path)
139691
+ });
139692
+ }
139693
+ let meta_doc = json_decode_object(meta);
139694
+ if (meta_doc.node_type === "array") {
139695
+ meta_doc.fill_value = ensure_correct_scalar(meta_doc);
139696
+ }
139697
+ return meta_doc.node_type === "array" ? new Array$1(store, location.path, meta_doc) : new Group(store, location.path, meta_doc);
139698
+ }
139699
+ async function open_v3(location, options = {}) {
139700
+ let loc = "store" in location ? location : new Location(location);
139701
+ let node2 = await _open_v3(loc);
139702
+ VERSION_COUNTER.increment(loc.store, "v3");
139703
+ if (options.kind === void 0)
139704
+ return node2;
139705
+ if (options.kind === "array" && node2 instanceof Array$1)
139706
+ return node2;
139707
+ if (options.kind === "group" && node2 instanceof Group)
139708
+ return node2;
139709
+ let kind = node2 instanceof Array$1 ? "array" : "group";
139710
+ throw new Error(`Expected node of kind ${options.kind}, found ${kind}.`);
139711
+ }
139712
+ async function open(location, options = {}) {
139713
+ let store = "store" in location ? location.store : location;
139714
+ let version_max = VERSION_COUNTER.version_max(store);
139715
+ let open_primary = version_max === "v2" ? open.v2 : open.v3;
139716
+ let open_secondary = version_max === "v2" ? open.v3 : open.v2;
139717
+ return open_primary(location, options).catch((err2) => {
139718
+ rethrow_unless(err2, NodeNotFoundError);
139719
+ return open_secondary(location, options);
139720
+ });
139721
+ }
139722
+ open.v2 = open_v2;
139723
+ open.v3 = open_v3;
139724
139724
  function getV2DataType(dtype) {
139725
139725
  const mapping = {
139726
139726
  int8: "|i1",
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D, e, a, b, c, d, H, G, Z, E, s, n, o, F, C, z, l, m, A, y, h, r, w, q, i, f, j, k, v, u, t, p, x } from "./index-B7UQn9SL.js";
1
+ import { D, e, a, b, c, d, H, G, Z, E, s, n, o, F, C, z, l, m, A, y, h, r, w, q, i, f, j, k, v, u, t, p, x } from "./index-DNlaWdqD.js";
2
2
  export {
3
3
  D as DEFAULT_CELLS_LAYER,
4
4
  e as DEFAULT_LAYER_TYPE_ORDERING,
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-B7UQn9SL.js";
1
+ import { B as BaseDecoder } from "./index-DNlaWdqD.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-B7UQn9SL.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-DNlaWdqD.js";
3
3
  const LercParameters = {
4
4
  AddCompression: 1
5
5
  };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-B7UQn9SL.js";
1
+ import { B as BaseDecoder } from "./index-DNlaWdqD.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-B7UQn9SL.js";
1
+ import { B as BaseDecoder } from "./index-DNlaWdqD.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-B7UQn9SL.js";
1
+ import { B as BaseDecoder } from "./index-DNlaWdqD.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-B7UQn9SL.js";
1
+ import { B as BaseDecoder } from "./index-DNlaWdqD.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/spatial-utils",
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": {
@@ -17,16 +17,16 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "lodash-es": "^4.17.21",
20
- "zarrita": "0.5.2",
20
+ "zarrita": "0.5.3",
21
21
  "math.gl": "^3.5.6",
22
22
  "mathjs": "^9.2.0",
23
23
  "internmap": "^2.0.3",
24
- "@vitessce/gl": "3.6.13",
25
- "@vitessce/utils": "3.6.13",
26
- "@vitessce/zarr-utils": "3.6.13",
27
- "@vitessce/constants-internal": "3.6.13",
28
- "@vitessce/globals": "3.6.13",
29
- "@vitessce/error": "3.6.13"
24
+ "@vitessce/gl": "3.6.15",
25
+ "@vitessce/utils": "3.6.15",
26
+ "@vitessce/zarr-utils": "3.6.15",
27
+ "@vitessce/constants-internal": "3.6.15",
28
+ "@vitessce/globals": "3.6.15",
29
+ "@vitessce/error": "3.6.15"
30
30
  },
31
31
  "scripts": {
32
32
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",