@vitessce/dev 3.3.10 → 3.3.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-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-0a4e4af9.js";
2
+ import { B as BaseDecoder } from "./index-1da4e7ab.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  class DeflateDecoder extends BaseDecoder {
@@ -1,6 +1,6 @@
1
1
  import React__default from "react";
2
2
  import ReactDOM__default from "react-dom";
3
- import { c as commonjsGlobal, o as objectAssign, g as getDefaultExportFromCjs, e as earcut, b as getAugmentedNamespace } from "./index-0a4e4af9.js";
3
+ import { c as commonjsGlobal, o as objectAssign, g as getDefaultExportFromCjs, e as earcut, b as getAugmentedNamespace } from "./index-1da4e7ab.js";
4
4
  function _mergeNamespaces(n, m) {
5
5
  for (var i = 0; i < m.length; i++) {
6
6
  const e = m[i];
@@ -775,10 +775,10 @@ const COMPONENT_COORDINATION_TYPES = {
775
775
  ]
776
776
  };
777
777
  const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
778
- const version$6 = "3.3.10";
779
- const date$5 = "2024-04-01";
778
+ const version$6 = "3.3.12";
779
+ const date$5 = "2024-04-16";
780
780
  const branch = "changeset-release/main";
781
- const hash$1 = "bed2e0da";
781
+ const hash$1 = "9eef7158";
782
782
  const META_VERSION = {
783
783
  note,
784
784
  version: version$6,
@@ -44363,9 +44363,9 @@ async function dataQueryFn(ctx2) {
44363
44363
  const payload = await loader2.load();
44364
44364
  if (!payload)
44365
44365
  return placeholderObject;
44366
- const { data: data2, url, coordinationValues } = payload;
44366
+ const { data: data2, url, requestInit: requestInit2, coordinationValues } = payload;
44367
44367
  const urls2 = (Array.isArray(url) ? url : [{ url, name: dataType }]).filter((d) => d.url);
44368
- return { data: data2, coordinationValues, urls: urls2 };
44368
+ return { data: data2, coordinationValues, urls: urls2, requestInit: requestInit2 };
44369
44369
  }
44370
44370
  if (isRequired) {
44371
44371
  throw new LoaderNotFoundError(loaders, dataset, dataType, matchOn);
@@ -44395,6 +44395,7 @@ function useDataType(dataType, loaders, dataset, isRequired, coordinationSetters
44395
44395
  const loadedData = data2?.data || placeholderObject;
44396
44396
  const coordinationValues = data2?.coordinationValues;
44397
44397
  const urls2 = data2?.urls;
44398
+ const requestInit2 = data2?.requestInit;
44398
44399
  useEffect(() => {
44399
44400
  initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
44400
44401
  }, [coordinationValues]);
@@ -44404,7 +44405,7 @@ function useDataType(dataType, loaders, dataset, isRequired, coordinationSetters
44404
44405
  }
44405
44406
  }, [error2, setWarning]);
44406
44407
  const dataStatus = isFetching ? STATUS$1.LOADING : status;
44407
- return [loadedData, dataStatus, urls2];
44408
+ return [loadedData, dataStatus, urls2, requestInit2];
44408
44409
  }
44409
44410
  function useDataTypeMulti(dataType, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOnObj, mergeCoordination, viewUid) {
44410
44411
  const placeholderObject = useMemo(() => ({}), []);
@@ -45135,11 +45136,13 @@ class LoaderResult {
45135
45136
  * @param {LoaderDataType} data
45136
45137
  * @param {object[]|string|null} url Single URL or array of { url, name } objects.
45137
45138
  * @param {object|null} coordinationValues
45139
+ * @param {RequestInit|null} requestInit
45138
45140
  */
45139
- constructor(data2, url, coordinationValues = null) {
45141
+ constructor(data2, url, coordinationValues = null, requestInit2 = null) {
45140
45142
  this.data = data2;
45141
45143
  this.url = url;
45142
45144
  this.coordinationValues = coordinationValues;
45145
+ this.requestInit = requestInit2;
45143
45146
  }
45144
45147
  }
45145
45148
  class AbstractLoader {
@@ -136626,13 +136629,13 @@ var gOPD = Object.getOwnPropertyDescriptor;
136626
136629
  var defineProperty$1 = Object.defineProperty;
136627
136630
  var TypeErr = TypeError;
136628
136631
  var getProto$1 = Object.getPrototypeOf;
136629
- var regex$3 = /a/;
136632
+ var regex$2 = /a/;
136630
136633
  var shim$1 = function shimFlags() {
136631
136634
  if (!supportsDescriptors || !getProto$1) {
136632
136635
  throw new TypeErr("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");
136633
136636
  }
136634
136637
  var polyfill2 = getPolyfill$1();
136635
- var proto = getProto$1(regex$3);
136638
+ var proto = getProto$1(regex$2);
136636
136639
  var descriptor2 = gOPD(proto, "flags");
136637
136640
  if (!descriptor2 || descriptor2.get !== polyfill2) {
136638
136641
  defineProperty$1(proto, "flags", {
@@ -170667,16 +170670,16 @@ async function getDecoder(fileDirectory) {
170667
170670
  const Decoder = await importFn();
170668
170671
  return new Decoder(fileDirectory);
170669
170672
  }
170670
- addDecoder([void 0, 1], () => import("./raw-7452dc66.js").then((m2) => m2.default));
170671
- addDecoder(5, () => import("./lzw-585ded9f.js").then((m2) => m2.default));
170673
+ addDecoder([void 0, 1], () => import("./raw-0101d710.js").then((m2) => m2.default));
170674
+ addDecoder(5, () => import("./lzw-4b21012c.js").then((m2) => m2.default));
170672
170675
  addDecoder(6, () => {
170673
170676
  throw new Error("old style JPEG compression is not supported.");
170674
170677
  });
170675
- addDecoder(7, () => import("./jpeg-8148bfbc.js").then((m2) => m2.default));
170676
- addDecoder([8, 32946], () => import("./deflate-632f7db0.js").then((m2) => m2.default));
170677
- addDecoder(32773, () => import("./packbits-629a9c3a.js").then((m2) => m2.default));
170678
- addDecoder(34887, () => import("./lerc-42581c23.js").then((m2) => m2.default));
170679
- addDecoder(50001, () => import("./webimage-f847a2ad.js").then((m2) => m2.default));
170678
+ addDecoder(7, () => import("./jpeg-8c7f1fed.js").then((m2) => m2.default));
170679
+ addDecoder([8, 32946], () => import("./deflate-fb332ce2.js").then((m2) => m2.default));
170680
+ addDecoder(32773, () => import("./packbits-0905e09a.js").then((m2) => m2.default));
170681
+ addDecoder(34887, () => import("./lerc-065ddf7e.js").then((m2) => m2.default));
170682
+ addDecoder(50001, () => import("./webimage-c198b63b.js").then((m2) => m2.default));
170680
170683
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
170681
170684
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
170682
170685
  }
@@ -218518,7 +218521,8 @@ var ZarrMultivecDataFetcher = function ZarrMultivecDataFetcher2(HGC, ...args) {
218518
218521
  this.dataConfig = dataConfig;
218519
218522
  this.trackUid = slugid.nice();
218520
218523
  if (dataConfig.url) {
218521
- this.store = new FetchStore$1(dataConfig.url);
218524
+ const { url, options = {} } = dataConfig;
218525
+ this.store = new FetchStore$1(url, options);
218522
218526
  this.storeRoot = Promise.resolve(root(this.store));
218523
218527
  }
218524
218528
  if (dataConfig.row !== void 0) {
@@ -218690,7 +218694,7 @@ const HIGLASS_BUNDLE_VERSION = "1.11.13";
218690
218694
  const HIGLASS_CSS_URL = `https://unpkg.com/${HIGLASS_PKG_NAME}@${HIGLASS_BUNDLE_VERSION}/dist/hglib.css`;
218691
218695
  register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
218692
218696
  const LazyHiGlassComponent = React__default.lazy(async () => {
218693
- const { HiGlassComponent } = await import("./hglib-fecfe463.js").then((n3) => n3.h);
218697
+ const { HiGlassComponent } = await import("./hglib-6b84cb77.js").then((n3) => n3.h);
218694
218698
  return { default: HiGlassComponent };
218695
218699
  });
218696
218700
  const HG_SIZE = 800;
@@ -218861,7 +218865,7 @@ function GenomicProfilesSubscriber(props2) {
218861
218865
  const [width2, height2, containerRef] = useGridItemSize();
218862
218866
  const loaders = useLoaders();
218863
218867
  const [{ dataset, obsSetColor: cellSetColor, obsSetSelection: cellSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.GENOMIC_PROFILES], coordinationScopes);
218864
- const [genomicProfilesAttrs, genomicProfilesStatus, genomicProfilesUrls] = useGenomicProfilesData(loaders, dataset, true, {}, {}, {});
218868
+ const [genomicProfilesAttrs, genomicProfilesStatus, genomicProfilesUrls, genomicProfilesRequestInit] = useGenomicProfilesData(loaders, dataset, true, {}, {}, {});
218865
218869
  const isReady = useReady([genomicProfilesStatus]);
218866
218870
  const urls2 = useUrls([genomicProfilesUrls]);
218867
218871
  const hgViewConfig = useMemo(() => {
@@ -218928,12 +218932,14 @@ function GenomicProfilesSubscriber(props2) {
218928
218932
  const setInSelection = isPath ? cellSetSelection?.find((s2) => isEqual$4(s2, trackUid)) : false;
218929
218933
  const setColor = isPath ? cellSetColor?.find((s2) => isEqual$4(s2.path, trackUid))?.color : null;
218930
218934
  const trackUidString = isPath ? trackUid.join("__") : trackUid;
218935
+ const options = genomicProfilesRequestInit ? { overrides: genomicProfilesRequestInit } : void 0;
218931
218936
  const track = {
218932
218937
  type: "horizontal-bar",
218933
218938
  uid: `bar-track-${trackUidString}`,
218934
218939
  data: {
218935
218940
  type: "zarr-multivec",
218936
218941
  url,
218942
+ options,
218937
218943
  row: i2
218938
218944
  },
218939
218945
  options: {
@@ -277933,10 +277939,10 @@ class AnnDataSource extends ZarrDataSource {
277933
277939
  throw new Error("Keys for encoding-type or encoding-version not found in AnnDataSource._loadString");
277934
277940
  }
277935
277941
  }
277936
- const regex$2 = /^mod\/([^/]*)\/(.*)$/;
277942
+ const regex$1 = /^mod\/([^/]*)\/(.*)$/;
277937
277943
  function getModPrefix(arrPath) {
277938
277944
  if (arrPath) {
277939
- const matches2 = arrPath.match(regex$2);
277945
+ const matches2 = arrPath.match(regex$1);
277940
277946
  if (matches2 && matches2.length === 3) {
277941
277947
  return `mod/${matches2[1]}/`;
277942
277948
  }
@@ -277998,12 +278004,17 @@ class MuDataSource extends AnnDataSource {
277998
278004
  return this.varAlias[varPath];
277999
278005
  }
278000
278006
  }
278001
- const regex$1 = /^table\/([^/]*)\/(.*)$/;
278007
+ const pluralRegex = /^tables\/([^/]*)\/(.*)$/;
278008
+ const singularRegex = /^table\/([^/]*)\/(.*)$/;
278002
278009
  function getTablePrefix(arrPath) {
278003
278010
  if (arrPath) {
278004
- const matches2 = arrPath.match(regex$1);
278005
- if (matches2 && matches2.length === 3) {
278006
- return `table/${matches2[1]}/`;
278011
+ const pluralMatches = arrPath.match(pluralRegex);
278012
+ if (pluralMatches && pluralMatches.length === 3) {
278013
+ return `tables/${pluralMatches[1]}/`;
278014
+ }
278015
+ const singularMatches = arrPath.match(singularRegex);
278016
+ if (singularMatches && singularMatches.length === 3) {
278017
+ return `table/${singularMatches[1]}/`;
278007
278018
  }
278008
278019
  }
278009
278020
  return "table/table/";
@@ -278202,7 +278213,33 @@ class MatrixZarrAsObsFeatureMatrixLoader extends AbstractTwoStepLoader {
278202
278213
  return Promise.all([this.loadAttrs(), this.loadArr()]).then(([attrs, arr]) => Promise.resolve(new LoaderResult({ obsIndex: attrs.data.rows, featureIndex: attrs.data.cols, obsFeatureMatrix: arr }, null)));
278203
278214
  }
278204
278215
  }
278205
- const toObject = (data2) => ({ data: data2 });
278216
+ class IncorrectDataTypeError extends Error {
278217
+ constructor(message) {
278218
+ super(message);
278219
+ this.name = "IncorrectDataTypeError";
278220
+ }
278221
+ }
278222
+ function convertBigInt64ArrayToInt32Array(arr) {
278223
+ if (!(arr instanceof BigInt64Array)) {
278224
+ throw new IncorrectDataTypeError("Expected a BigInt64Array");
278225
+ }
278226
+ const out = new Int32Array(arr.length);
278227
+ const view = new Int32Array(arr.buffer);
278228
+ for (let i2 = 0; i2 < arr.length; i2++) {
278229
+ out[i2] = view[i2 * 2];
278230
+ }
278231
+ return out;
278232
+ }
278233
+ const maybeDowncastInt64 = (data2) => {
278234
+ try {
278235
+ return convertBigInt64ArrayToInt32Array(data2);
278236
+ } catch (error2) {
278237
+ if (error2 instanceof IncorrectDataTypeError) {
278238
+ return data2;
278239
+ }
278240
+ throw error2;
278241
+ }
278242
+ };
278206
278243
  const concatenateColumnVectors = (arr) => {
278207
278244
  const numCols = arr.length;
278208
278245
  const numRows = arr[0].length;
@@ -278217,6 +278254,7 @@ const concatenateColumnVectors = (arr) => {
278217
278254
  }
278218
278255
  return new TypedArray2(view.buffer);
278219
278256
  };
278257
+ const toObject = (data2) => ({ data: data2 });
278220
278258
  class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
278221
278259
  getOptions() {
278222
278260
  return this.options;
@@ -278316,9 +278354,10 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
278316
278354
  const { data: rowIndices } = await get$6(indexArr, [
278317
278355
  slice$4(startRowIndex, endRowIndex)
278318
278356
  ]);
278319
- const { data: cellXGeneData } = await get$6(cellXGeneArr, [
278357
+ let { data: cellXGeneData } = await get$6(cellXGeneArr, [
278320
278358
  slice$4(startRowIndex, endRowIndex)
278321
278359
  ]);
278360
+ cellXGeneData = maybeDowncastInt64(cellXGeneData);
278322
278361
  for (let rowIndex = 0; rowIndex < rowIndices.length; rowIndex += 1) {
278323
278362
  geneData[rowIndices[rowIndex]] = cellXGeneData[rowIndex];
278324
278363
  }
@@ -278355,10 +278394,11 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
278355
278394
  this._sparseMatrix = this._openSparseArrays().then(async (sparseArrays) => {
278356
278395
  const { path: matrix2 } = this.getOptions();
278357
278396
  const { shape: shape2 } = await this.dataSource.getJson(`${matrix2}/.zattrs`);
278358
- const [rows, cols, cellXGene] = await Promise.all(sparseArrays.map(async (arr) => {
278397
+ let [rows, cols, cellXGene] = await Promise.all(sparseArrays.map(async (arr) => {
278359
278398
  const { data: data2 } = await createZarrArrayAdapter(arr).getRaw(null);
278360
278399
  return data2;
278361
278400
  }));
278401
+ cellXGene = maybeDowncastInt64(cellXGene);
278362
278402
  const cellXGeneMatrix = new Float32Array(shape2[0] * shape2[1]).fill(0);
278363
278403
  let row = 0;
278364
278404
  rows.forEach((_, index2) => {
@@ -278386,10 +278426,11 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
278386
278426
  this._sparseMatrix = this._openSparseArrays().then(async (sparseArrays) => {
278387
278427
  const { path: matrix2 } = this.getOptions();
278388
278428
  const { shape: shape2 } = await this.dataSource.getJson(`${matrix2}/.zattrs`);
278389
- const [cols, rows, cellXGene] = await Promise.all(sparseArrays.map(async (arr) => {
278429
+ let [cols, rows, cellXGene] = await Promise.all(sparseArrays.map(async (arr) => {
278390
278430
  const { data: data2 } = await createZarrArrayAdapter(arr).getRaw(null);
278391
278431
  return data2;
278392
278432
  }));
278433
+ cellXGene = maybeDowncastInt64(cellXGene);
278393
278434
  const cellXGeneMatrix = new Float32Array(shape2[0] * shape2[1]).fill(0);
278394
278435
  let col = 0;
278395
278436
  cols.forEach((_, index2) => {
@@ -278429,7 +278470,7 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
278429
278470
  if (!this.arr) {
278430
278471
  this.arr = open(storeRoot.resolve(matrix2), { kind: "array" });
278431
278472
  }
278432
- this.cellXGene = this.arr.then((z2) => createZarrArrayAdapter(z2).getRaw(null)).then(({ data: data2 }) => toObject(data2));
278473
+ this.cellXGene = this.arr.then((z2) => createZarrArrayAdapter(z2).getRaw(null)).then(({ data: data2 }) => toObject(maybeDowncastInt64(data2)));
278433
278474
  }
278434
278475
  } else if (encodingType === "csr_matrix") {
278435
278476
  this.cellXGene = this._loadCSRSparseCellXGene().then(async (cellXGene) => {
@@ -278476,7 +278517,7 @@ class ObsFeatureMatrixAnndataLoader extends AbstractTwoStepLoader {
278476
278517
  this.arr = open(storeRoot.resolve(matrix2), { kind: "array" });
278477
278518
  }
278478
278519
  const indices = await this._getGeneIndices(selection);
278479
- genes = await Promise.all(indices.map((index2) => this.arr.then((z2) => get$6(z2, [null, index2])).then(({ data: data2 }) => data2)));
278520
+ genes = await Promise.all(indices.map((index2) => this.arr.then((z2) => get$6(z2, [null, index2])).then(({ data: data2 }) => maybeDowncastInt64(data2))));
278480
278521
  }
278481
278522
  return { data: genes, url: null };
278482
278523
  }
@@ -279516,8 +279557,8 @@ class GenomicProfilesZarrLoader extends AbstractTwoStepLoader {
279516
279557
  return this.attrs;
279517
279558
  }
279518
279559
  load() {
279519
- const { url } = this;
279520
- return this.loadAttrs().then((attrs) => Promise.resolve(new LoaderResult(attrs, url)));
279560
+ const { url, requestInit: requestInit2 } = this;
279561
+ return this.loadAttrs().then((attrs) => Promise.resolve(new LoaderResult(attrs, url, null, requestInit2)));
279521
279562
  }
279522
279563
  }
279523
279564
  class OmeTiffSource {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { k, C, D, F, H, p, h, u, P, w, t, V, s, i, f, d, m, l, n, r, q, j, x, v, z } from "./index-0a4e4af9.js";
1
+ import { k, C, D, F, H, p, h, u, P, w, t, V, s, i, f, d, m, l, n, r, q, j, x, v, z } from "./index-1da4e7ab.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-0a4e4af9.js";
1
+ import { B as BaseDecoder } from "./index-1da4e7ab.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const dctZigZag = new Int32Array([
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-0a4e4af9.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder, L as LercParameters, a as LercAddCompression } from "./index-1da4e7ab.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  var LercDecode = { exports: {} };
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-0a4e4af9.js";
1
+ import { B as BaseDecoder } from "./index-1da4e7ab.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const MIN_BITS = 9;
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-0a4e4af9.js";
1
+ import { B as BaseDecoder } from "./index-1da4e7ab.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  class PackbitsDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-0a4e4af9.js";
1
+ import { B as BaseDecoder } from "./index-1da4e7ab.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  class RawDecoder extends BaseDecoder {
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-0a4e4af9.js";
1
+ import { B as BaseDecoder } from "./index-1da4e7ab.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  class WebImageDecoder extends BaseDecoder {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/dev",
3
- "version": "3.3.10",
3
+ "version": "3.3.12",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -16,10 +16,10 @@
16
16
  "dist-tsc"
17
17
  ],
18
18
  "dependencies": {
19
- "@vitessce/all": "3.3.10",
20
- "@vitessce/config": "3.3.10",
21
- "@vitessce/constants": "3.3.10",
22
- "@vitessce/export-utils": "3.3.10"
19
+ "@vitessce/all": "3.3.12",
20
+ "@vitessce/config": "3.3.12",
21
+ "@vitessce/export-utils": "3.3.12",
22
+ "@vitessce/constants": "3.3.12"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@vitejs/plugin-react": "^4.0.0",