@vitessce/dev 3.6.11 → 3.6.13

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,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs, aV as requireAssign, aW as require_export, aX as require_core, aY as require_fails, aZ as require_toObject, a_ as require_objectKeys, a$ as require_cof, b0 as require_wks, b1 as require_iterators, b2 as requireWeb_dom_iterable, b3 as requireEs6_string_iterator, b4 as require_anObject, b5 as require_hide, b6 as require_ctx, b7 as require_toLength, b8 as require_global, b9 as require_objectDp, ba as require_descriptors, bb as require_isObject, bc as require_objectCreate, bd as require_iterDefine, be as require_iterStep, bf as require_meta, bg as require_isArray, bh as require_iobject, bi as require_setToStringTag, bj as require_aFunction, bk as requireIterator, bl as require_propertyDesc, bm as require_root, bn as require_baseGetTag, bo as requireIsObjectLike, bp as requireIsObject, bq as requireEs6_symbol, br as requireDefineProperty, bs as require_toIobject, bt as require_objectGopd, bu as require_html, bv as require_domCreate, bw as require_library, bx as requireSymbol, by as require_objectPie, bz as require_has, bA as require_redefine, bB as require_objectAssign, bC as getAugmentedNamespace, bD as requirePropTypes, aI as jsxRuntimeExports } from "./index-M1VivJi6.js";
1
+ import { g as getDefaultExportFromCjs, aV as requireAssign, aW as require_export, aX as require_core, aY as require_fails, aZ as require_toObject, a_ as require_objectKeys, a$ as require_cof, b0 as require_wks, b1 as require_iterators, b2 as requireWeb_dom_iterable, b3 as requireEs6_string_iterator, b4 as require_anObject, b5 as require_hide, b6 as require_ctx, b7 as require_toLength, b8 as require_global, b9 as require_objectDp, ba as require_descriptors, bb as require_isObject, bc as require_objectCreate, bd as require_iterDefine, be as require_iterStep, bf as require_meta, bg as require_isArray, bh as require_iobject, bi as require_setToStringTag, bj as require_aFunction, bk as requireIterator, bl as require_propertyDesc, bm as require_root, bn as require_baseGetTag, bo as requireIsObjectLike, bp as requireIsObject, bq as requireEs6_symbol, br as requireDefineProperty, bs as require_toIobject, bt as require_objectGopd, bu as require_html, bv as require_domCreate, bw as require_library, bx as requireSymbol, by as require_objectPie, bz as require_has, bA as require_redefine, bB as require_objectAssign, bC as getAugmentedNamespace, bD as requirePropTypes, aI as jsxRuntimeExports } from "./index-BsLyjMi2.js";
2
2
  import React__default from "react";
3
3
  var lib = {};
4
4
  var assignExports = requireAssign();
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-SxljTded.js";
2
- import { aP as BaseDecoder } from "./index-M1VivJi6.js";
2
+ import { aP as BaseDecoder } from "./index-BsLyjMi2.js";
3
3
  class DeflateDecoder extends BaseDecoder {
4
4
  decodeBlock(buffer) {
5
5
  return inflate_1(new Uint8Array(buffer)).buffer;
@@ -1,7 +1,7 @@
1
1
  import * as React$7 from "react";
2
2
  import React__default, { isValidElement, PureComponent, Component, createElement, createContext, createRef } from "react";
3
3
  import ReactDOM__default, { findDOMNode as findDOMNode$1 } from "react-dom";
4
- import { aS as commonjsGlobal$1, aT as requireObjectAssign, g as getDefaultExportFromCjs$1, aU as earcut } from "./index-M1VivJi6.js";
4
+ import { aS as commonjsGlobal$1, aT as requireObjectAssign, g as getDefaultExportFromCjs$1, aU as earcut } from "./index-BsLyjMi2.js";
5
5
  var promise = {};
6
6
  var hasRequiredPromise;
7
7
  function requirePromise() {
@@ -1324,7 +1324,7 @@ const COMPONENT_COORDINATION_TYPES = {
1324
1324
  CoordinationType$2.HIERARCHY_LEVELS
1325
1325
  ]
1326
1326
  };
1327
- const version$6 = "3.6.11";
1327
+ const version$6 = "3.6.13";
1328
1328
  const META_VERSION = {
1329
1329
  version: version$6
1330
1330
  };
@@ -2458,12 +2458,13 @@ class VitessceConfigDatasetFile {
2458
2458
  * which may provide additional parameters to the loader class
2459
2459
  * corresponding to the specified fileType.
2460
2460
  */
2461
- constructor(url, fileType, coordinationValues, options) {
2461
+ constructor(url, fileType, coordinationValues, options, requestInit2) {
2462
2462
  this.file = {
2463
2463
  url,
2464
2464
  fileType,
2465
2465
  ...coordinationValues ? { coordinationValues } : {},
2466
- ...options ? { options } : {}
2466
+ ...options ? { options } : {},
2467
+ ...requestInit2 ? { requestInit: requestInit2 } : {}
2467
2468
  };
2468
2469
  }
2469
2470
  /**
@@ -2504,6 +2505,7 @@ class VitessceConfigDataset {
2504
2505
  let fileType;
2505
2506
  let coordinationValues;
2506
2507
  let options;
2508
+ let requestInit2;
2507
2509
  if (args.length > 0) {
2508
2510
  url = params2;
2509
2511
  let dataType;
@@ -2517,12 +2519,13 @@ class VitessceConfigDataset {
2517
2519
  url,
2518
2520
  fileType,
2519
2521
  options,
2520
- coordinationValues
2522
+ coordinationValues,
2523
+ requestInit: requestInit2
2521
2524
  } = params2);
2522
2525
  } else {
2523
2526
  throw new Error("Expected addFile argument to be an object.");
2524
2527
  }
2525
- this.dataset.files.push(new VitessceConfigDatasetFile(url, fileType, coordinationValues, options));
2528
+ this.dataset.files.push(new VitessceConfigDatasetFile(url, fileType, coordinationValues, options, requestInit2));
2526
2529
  return this;
2527
2530
  }
2528
2531
  /**
@@ -2855,13 +2858,19 @@ class VitessceConfig {
2855
2858
  * Add a new view to the config.
2856
2859
  * @param {VitessceConfigDataset} dataset The dataset instance which defines the data
2857
2860
  * that will be displayed in the view.
2858
- * @param {string} component A component name, such as "scatterplot" or "spatial".
2859
- * @param {object} options Extra options for the component.
2860
- * @param {number} options.x The x-coordinate for the view in the grid layout.
2861
- * @param {number} options.y The y-coordinate for the view in the grid layout.
2862
- * @param {number} options.w The width for the view in the grid layout.
2863
- * @param {number} options.h The height for the view in the grid layout.
2864
- * @param {number} options.mapping A convenience parameter for setting the EMBEDDING_TYPE
2861
+ * @param {string} component A component name, such as "scatterplot"
2862
+ * or "spatial".
2863
+ * @param {object|undefined} options Extra options for the component.
2864
+ * @param {number|undefined} options.x The x-coordinate for the view
2865
+ * in the grid layout.
2866
+ * @param {number|undefined} options.y The y-coordinate for the view
2867
+ * in the grid layout.
2868
+ * @param {number|undefined} options.w The width for the view in the
2869
+ * grid layout.
2870
+ * @param {number|undefined} options.h The height for the view in the
2871
+ * grid layout.
2872
+ * @param {string|undefined} options.mapping A convenience parameter
2873
+ * for setting the EMBEDDING_TYPE
2865
2874
  * coordination value. Only applicable if the component is "scatterplot".
2866
2875
  * @returns {VitessceConfigView} A new view instance.
2867
2876
  */
@@ -225667,22 +225676,22 @@ async function getDecoder(fileDirectory) {
225667
225676
  const Decoder = await importFn();
225668
225677
  return new Decoder(fileDirectory);
225669
225678
  }
225670
- addDecoder([void 0, 1], () => import("./raw-CpsDpwkc.js").then((m2) => m2.default));
225671
- addDecoder(5, () => import("./lzw-BalQkUpy.js").then((m2) => m2.default));
225679
+ addDecoder([void 0, 1], () => import("./raw-CBlbbCrj.js").then((m2) => m2.default));
225680
+ addDecoder(5, () => import("./lzw-BBM6Xm4R.js").then((m2) => m2.default));
225672
225681
  addDecoder(6, () => {
225673
225682
  throw new Error("old style JPEG compression is not supported.");
225674
225683
  });
225675
- addDecoder(7, () => import("./jpeg-xtx0j4w1.js").then((m2) => m2.default));
225676
- addDecoder([8, 32946], () => import("./deflate-N56CA029.js").then((m2) => m2.default));
225677
- addDecoder(32773, () => import("./packbits-Ck8I4RLy.js").then((m2) => m2.default));
225684
+ addDecoder(7, () => import("./jpeg-DC6EhC9e.js").then((m2) => m2.default));
225685
+ addDecoder([8, 32946], () => import("./deflate-DXxvDuxS.js").then((m2) => m2.default));
225686
+ addDecoder(32773, () => import("./packbits-C8SMglgQ.js").then((m2) => m2.default));
225678
225687
  addDecoder(
225679
225688
  34887,
225680
- () => import("./lerc-Mos1_jYn.js").then(async (m2) => {
225689
+ () => import("./lerc-B_WzdfsG.js").then(async (m2) => {
225681
225690
  await m2.zstd.init();
225682
225691
  return m2;
225683
225692
  }).then((m2) => m2.default)
225684
225693
  );
225685
- addDecoder(50001, () => import("./webimage-hhyC7JKo.js").then((m2) => m2.default));
225694
+ addDecoder(50001, () => import("./webimage-C2MT0eHP.js").then((m2) => m2.default));
225686
225695
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
225687
225696
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
225688
225697
  }
@@ -263312,6 +263321,61 @@ function abbreviateNumber(value2) {
263312
263321
  return naive;
263313
263322
  return value2.toExponential(0);
263314
263323
  }
263324
+ class DAG {
263325
+ /**
263326
+ * DAG constructor.
263327
+ * @param {{ from: string, to: string, attributes: any}[]} edges
263328
+ */
263329
+ constructor(edges) {
263330
+ this.graph = /* @__PURE__ */ new Map();
263331
+ this.edgeData = new InternMap$1([], JSON.stringify);
263332
+ edges.forEach((edge) => {
263333
+ const { from: from2, to } = edge;
263334
+ if (!this.graph.has(from2)) {
263335
+ this.graph.set(from2, []);
263336
+ }
263337
+ this.graph.get(from2).push(to);
263338
+ this.edgeData.set([from2, to], edge.attributes);
263339
+ });
263340
+ }
263341
+ /**
263342
+ * Find a path from start to end using DFS.
263343
+ * @param {string} start
263344
+ * @param {string} end
263345
+ * @returns {{ from: string, to: string, attributes: any }[] | null} Returns
263346
+ * the path as an array of edges or null if no path exists.
263347
+ */
263348
+ findPath(start2, end2) {
263349
+ const path2 = [];
263350
+ const visited = /* @__PURE__ */ new Set();
263351
+ const dfs = (node2) => {
263352
+ if (node2 === end2) {
263353
+ return true;
263354
+ }
263355
+ visited.add(node2);
263356
+ const neighbors = this.graph.get(node2) || [];
263357
+ for (const neighbor of neighbors) {
263358
+ if (!visited.has(neighbor)) {
263359
+ path2.push([node2, neighbor]);
263360
+ if (dfs(neighbor)) {
263361
+ return true;
263362
+ }
263363
+ path2.pop();
263364
+ }
263365
+ }
263366
+ return false;
263367
+ };
263368
+ const found = dfs(start2);
263369
+ if (found) {
263370
+ return path2.map(([from2, to]) => ({
263371
+ from: from2,
263372
+ to,
263373
+ attributes: this.edgeData.get([from2, to])
263374
+ }));
263375
+ }
263376
+ return null;
263377
+ }
263378
+ }
263315
263379
  function getSourceFromLoader(loader2, level) {
263316
263380
  const { data: data2 } = loader2;
263317
263381
  const source2 = Array.isArray(data2) ? data2[data2.length - 1] : data2;
@@ -263608,8 +263672,14 @@ function coordinateTransformationsToMatrix(coordinateTransformations, axes) {
263608
263672
  }
263609
263673
  } else if (spatialOutputAxes.length === 2) {
263610
263674
  const nextMat = new Matrix4$1().fromArray([
263611
- ...filteredAffine[0],
263612
- ...filteredAffine[1],
263675
+ filteredAffine[0][0],
263676
+ filteredAffine[0][1],
263677
+ 0,
263678
+ filteredAffine[0][2],
263679
+ filteredAffine[1][0],
263680
+ filteredAffine[1][1],
263681
+ 0,
263682
+ filteredAffine[1][2],
263613
263683
  0,
263614
263684
  0,
263615
263685
  1,
@@ -263625,6 +263695,7 @@ function coordinateTransformationsToMatrix(coordinateTransformations, axes) {
263625
263695
  const swapMat = new Matrix4$1().fromArray(swapMatNested.flat());
263626
263696
  mat = mat.multiplyLeft(swapMat);
263627
263697
  }
263698
+ mat = mat.transpose();
263628
263699
  } else {
263629
263700
  throw new Error("Affine transformation must have 2 or 3 rows.");
263630
263701
  }
@@ -263651,6 +263722,9 @@ function coordinateTransformationsToMatrix(coordinateTransformations, axes) {
263651
263722
  }
263652
263723
  });
263653
263724
  }
263725
+ if (mat.some((value2) => Number.isNaN(value2))) {
263726
+ throw new Error("Matrix contains NaN values");
263727
+ }
263654
263728
  return mat;
263655
263729
  }
263656
263730
  function hexToRgb(hex2) {
@@ -263669,41 +263743,22 @@ function normalizeAxes(axes) {
263669
263743
  return axisInfo;
263670
263744
  });
263671
263745
  }
263746
+ function getIntrinsicCoordinateSystem(normAxes) {
263747
+ return normAxes.map((axis2) => axis2.name).join("");
263748
+ }
263672
263749
  function normalizeCoordinateTransformations(coordinateTransformations, datasets) {
263673
263750
  let result = [];
263674
263751
  if (Array.isArray(coordinateTransformations)) {
263675
263752
  result = coordinateTransformations.flatMap((transform3) => {
263676
263753
  if (transform3.input && transform3.output) {
263677
263754
  const { type: type2 } = transform3;
263678
- if (type2 === "translation") {
263679
- return {
263680
- type: type2,
263681
- translation: transform3.translation
263682
- };
263683
- }
263684
- if (type2 === "scale") {
263685
- return {
263686
- type: type2,
263687
- scale: transform3.scale
263688
- };
263689
- }
263690
- if (type2 === "affine") {
263691
- return {
263692
- type: type2,
263693
- affine: transform3.affine,
263694
- // Affine transformations can potentially swap axes,
263695
- // so we need to include the input and output axes.
263696
- input: transform3.input,
263697
- output: transform3.output
263698
- };
263699
- }
263700
- if (type2 === "identity") {
263701
- return { type: type2 };
263702
- }
263703
263755
  if (type2 === "sequence") {
263704
- return normalizeCoordinateTransformations(transform3.transformations, datasets);
263756
+ return normalizeCoordinateTransformations(transform3.transformations, null);
263757
+ }
263758
+ if (type2 === "affine" || type2 === "translation" || type2 === "scale" || type2 === "identity") {
263759
+ return transform3;
263705
263760
  }
263706
- log$c.warn(`Coordinate transformation type "${type2}" is not supported.`);
263761
+ log$c.error(`Coordinate transformation type "${type2}" is not supported.`);
263707
263762
  }
263708
263763
  return transform3;
263709
263764
  });
@@ -263716,6 +263771,27 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
263716
263771
  }
263717
263772
  return result;
263718
263773
  }
263774
+ function coordinateTransformationsToMatrixForSpatialData(ngffMetadata, targetCoordinateSystem) {
263775
+ const { datasets, coordinateTransformations, axes } = ngffMetadata;
263776
+ const normAxes = normalizeAxes(axes);
263777
+ const intrinsicCoordinateSystem = getIntrinsicCoordinateSystem(normAxes);
263778
+ const edges = coordinateTransformations.map((ct) => ({
263779
+ from: ct.input.name,
263780
+ to: ct.output.name,
263781
+ attributes: ct
263782
+ }));
263783
+ const dag = new DAG(edges);
263784
+ const ctPath = dag.findPath(intrinsicCoordinateSystem, targetCoordinateSystem);
263785
+ if (!ctPath) {
263786
+ if (!coordinateTransformations.find((ct) => ct.output.name === targetCoordinateSystem)) {
263787
+ throw new Error(`No coordinate transformation found with output.name "${targetCoordinateSystem}".`);
263788
+ }
263789
+ throw new Error(`No path found from "${intrinsicCoordinateSystem}" to "${targetCoordinateSystem}".`);
263790
+ }
263791
+ const filteredTransformations = ctPath.map((ctEdge) => ctEdge.attributes);
263792
+ const normalizedTransformations = normalizeCoordinateTransformations(filteredTransformations, datasets);
263793
+ return coordinateTransformationsToMatrix(normalizedTransformations, normAxes);
263794
+ }
263719
263795
  class NodeNotFoundError extends Error {
263720
263796
  constructor(context2, options = {}) {
263721
263797
  super(`Node not found: ${context2}`, options);
@@ -269098,7 +269174,7 @@ class ErrorBoundary2 extends React__default.Component {
269098
269174
  }
269099
269175
  }
269100
269176
  const LazySpatialThree = React__default.lazy(async () => {
269101
- const { SpatialWrapper: SpatialWrapper2 } = await import("./index-Bel-giod.js");
269177
+ const { SpatialWrapper: SpatialWrapper2 } = await import("./index-NxuTLT6r.js");
269102
269178
  return { default: SpatialWrapper2 };
269103
269179
  });
269104
269180
  const SpatialThreeAdapter = React__default.forwardRef((props, ref2) => jsxRuntimeExports.jsx("div", { ref: ref2, style: { width: "100%", height: "100%" }, children: jsxRuntimeExports.jsx(ErrorBoundary2, { children: jsxRuntimeExports.jsx(Suspense, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(LazySpatialThree, { ...props }) }) }) }));
@@ -279630,7 +279706,7 @@ function HiglassGlobalStyles(props) {
279630
279706
  }
279631
279707
  register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
279632
279708
  const LazyHiGlassComponent = React__default.lazy(async () => {
279633
- const { HiGlassComponent } = await import("./higlass-DCDSoYfE.js");
279709
+ const { HiGlassComponent } = await import("./higlass-ZA8QVeYb.js");
279634
279710
  return { default: HiGlassComponent };
279635
279711
  });
279636
279712
  const HG_SIZE = 800;
@@ -282573,7 +282649,7 @@ function NeuroglancerGlobalStyles(props) {
282573
282649
  const { classes: classes2 } = props;
282574
282650
  return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(GlobalStyles$3, { styles: globalNeuroglancerCss }), jsxRuntimeExports.jsx(ScopedGlobalStyles, { styles: globalNeuroglancerStyles, parentClassName: classes2.neuroglancerWrapper })] });
282575
282651
  }
282576
- const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-CysvH9aU.js"));
282652
+ const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-CG0BfwKU.js"));
282577
282653
  function createWorker() {
282578
282654
  return new WorkerFactory();
282579
282655
  }
@@ -340045,13 +340121,22 @@ class ImageWrapper {
340045
340121
  return this.modelMatrix;
340046
340122
  }
340047
340123
  _getModelMatrix() {
340048
- const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options;
340124
+ const { coordinateSystem = "global", coordinateTransformations: coordinateTransformationsFromOptions } = this.options;
340049
340125
  if ("multiscales" in this.vivLoader.metadata) {
340050
340126
  const { multiscales: [{ datasets, coordinateTransformations: coordinateTransformationsFromFile, axes }] } = this.vivLoader.metadata;
340051
340127
  const ngffAxes = getNgffAxes(axes);
340052
340128
  const transformMatrixFromOptions = coordinateTransformationsToMatrix(coordinateTransformationsFromOptions, ngffAxes);
340053
- const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, datasets);
340054
- const transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, ngffAxes);
340129
+ let transformMatrixFromFile;
340130
+ if ("spatialdata_attrs" in this.vivLoader.metadata) {
340131
+ transformMatrixFromFile = coordinateTransformationsToMatrixForSpatialData(
340132
+ // Pass the first multiscales element.
340133
+ this.vivLoader.metadata.multiscales[0],
340134
+ coordinateSystem
340135
+ );
340136
+ } else {
340137
+ const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, datasets);
340138
+ transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, ngffAxes);
340139
+ }
340055
340140
  const transformMatrix = transformMatrixFromFile.multiplyLeft(transformMatrixFromOptions);
340056
340141
  return transformMatrix;
340057
340142
  }
@@ -340540,16 +340625,7 @@ class SpatialDataLabelsLoader extends SpatialDataImageLoader {
340540
340625
  return result;
340541
340626
  }
340542
340627
  }
340543
- function getCoordsPath(path2) {
340544
- return `${path2}/coords`;
340545
- }
340546
- function getRadiusPath(path2) {
340547
- return `${path2}/radius`;
340548
- }
340549
- function getGeometryPath$1(path2) {
340550
- return `${path2}/geometry`;
340551
- }
340552
- const DEFAULT_AXES$1 = [
340628
+ const OLD_SHAPES_DEFAULT_AXES = [
340553
340629
  {
340554
340630
  name: "x",
340555
340631
  type: "space",
@@ -340561,7 +340637,7 @@ const DEFAULT_AXES$1 = [
340561
340637
  unit: "unit"
340562
340638
  }
340563
340639
  ];
340564
- const DEFAULT_COORDINATE_TRANSFORMATIONS$1 = [
340640
+ const OLD_SHAPES_DEFAULT_COORDINATE_TRANSFORMATIONS = [
340565
340641
  {
340566
340642
  input: {
340567
340643
  axes: [
@@ -340596,6 +340672,15 @@ const DEFAULT_COORDINATE_TRANSFORMATIONS$1 = [
340596
340672
  type: "identity"
340597
340673
  }
340598
340674
  ];
340675
+ function getCoordsPath(path2) {
340676
+ return `${path2}/coords`;
340677
+ }
340678
+ function getRadiusPath(path2) {
340679
+ return `${path2}/radius`;
340680
+ }
340681
+ function getGeometryPath$1(path2) {
340682
+ return `${path2}/geometry`;
340683
+ }
340599
340684
  class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
340600
340685
  async loadModelMatrix() {
340601
340686
  const { path: path2, coordinateSystem = "global" } = this.options;
@@ -340603,12 +340688,9 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
340603
340688
  return this.modelMatrix;
340604
340689
  }
340605
340690
  const zattrs = await this.dataSource.loadSpatialDataElementAttrs(path2);
340606
- const coordinateTransformationsFromFile = (zattrs?.coordinateTransformations || DEFAULT_COORDINATE_TRANSFORMATIONS$1).filter(({ input: { name: inputName }, output: { name: outputName } }) => inputName === "xy" && outputName === coordinateSystem);
340607
- const axes = zattrs?.axes ?? DEFAULT_AXES$1;
340608
- const normAxes = normalizeAxes(axes);
340609
- const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, null);
340610
- const transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, normAxes);
340611
- this.modelMatrix = transformMatrixFromFile;
340691
+ const coordinateTransformations = zattrs?.coordinateTransformations ?? OLD_SHAPES_DEFAULT_COORDINATE_TRANSFORMATIONS;
340692
+ const axes = zattrs?.axes ?? OLD_SHAPES_DEFAULT_AXES;
340693
+ this.modelMatrix = coordinateTransformationsToMatrixForSpatialData({ axes, coordinateTransformations }, coordinateSystem);
340612
340694
  return this.modelMatrix;
340613
340695
  }
340614
340696
  /**
@@ -340706,53 +340788,6 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
340706
340788
  function getGeometryPath(path2) {
340707
340789
  return `${path2}/geometry`;
340708
340790
  }
340709
- const DEFAULT_AXES = [
340710
- {
340711
- name: "x",
340712
- type: "space",
340713
- unit: "unit"
340714
- },
340715
- {
340716
- name: "y",
340717
- type: "space",
340718
- unit: "unit"
340719
- }
340720
- ];
340721
- const DEFAULT_COORDINATE_TRANSFORMATIONS = [
340722
- {
340723
- input: {
340724
- axes: [
340725
- {
340726
- name: "x",
340727
- type: "space",
340728
- unit: "unit"
340729
- },
340730
- {
340731
- name: "y",
340732
- type: "space",
340733
- unit: "unit"
340734
- }
340735
- ],
340736
- name: "xy"
340737
- },
340738
- output: {
340739
- axes: [
340740
- {
340741
- name: "x",
340742
- type: "space",
340743
- unit: "unit"
340744
- },
340745
- {
340746
- name: "y",
340747
- type: "space",
340748
- unit: "unit"
340749
- }
340750
- ],
340751
- name: "global"
340752
- },
340753
- type: "identity"
340754
- }
340755
- ];
340756
340791
  class SpatialDataObsSegmentationsLoader extends AbstractTwoStepLoader {
340757
340792
  async loadModelMatrix() {
340758
340793
  const { path: path2, coordinateSystem = "global" } = this.options;
@@ -340760,12 +340795,9 @@ class SpatialDataObsSegmentationsLoader extends AbstractTwoStepLoader {
340760
340795
  return this.modelMatrix;
340761
340796
  }
340762
340797
  const zattrs = await this.dataSource.loadSpatialDataElementAttrs(path2);
340763
- const coordinateTransformationsFromFile = (zattrs?.coordinateTransformations ?? DEFAULT_COORDINATE_TRANSFORMATIONS).filter(({ input: { name: inputName }, output: { name: outputName } }) => inputName === "xy" && outputName === coordinateSystem);
340764
- const axes = zattrs?.axes ?? DEFAULT_AXES;
340765
- const normAxes = normalizeAxes(axes);
340766
- const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, null);
340767
- const transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, normAxes);
340768
- this.modelMatrix = transformMatrixFromFile;
340798
+ const coordinateTransformations = zattrs?.coordinateTransformations ?? OLD_SHAPES_DEFAULT_COORDINATE_TRANSFORMATIONS;
340799
+ const axes = zattrs?.axes ?? OLD_SHAPES_DEFAULT_AXES;
340800
+ this.modelMatrix = coordinateTransformationsToMatrixForSpatialData({ axes, coordinateTransformations }, coordinateSystem);
340769
340801
  return this.modelMatrix;
340770
340802
  }
340771
340803
  /**
@@ -340842,11 +340874,7 @@ class SpatialDataObsPointsLoader extends AbstractTwoStepLoader {
340842
340874
  if (!coordinateTransformations) {
340843
340875
  throw new Error("The coordinate transformations metadata must be defined for point elements.");
340844
340876
  }
340845
- const normAxes = normalizeAxes(axes);
340846
- const coordinateTransformationsFromFile = coordinateTransformations.filter(({ input: { name: inputName }, output: { name: outputName } }) => inputName === "xyz" && outputName === coordinateSystem);
340847
- const normCoordinateTransformationsFromFile = normalizeCoordinateTransformations(coordinateTransformationsFromFile, null);
340848
- const transformMatrixFromFile = coordinateTransformationsToMatrix(normCoordinateTransformationsFromFile, normAxes);
340849
- this.modelMatrix = transformMatrixFromFile;
340877
+ this.modelMatrix = coordinateTransformationsToMatrixForSpatialData({ axes, coordinateTransformations }, coordinateSystem);
340850
340878
  return this.modelMatrix;
340851
340879
  }
340852
340880
  /**
@@ -350477,7 +350505,7 @@ class SpatialDataTableSource extends AnnDataSource {
350477
350505
  const schemaBytes = await this.loadParquetSchemaBytes(parquetPath);
350478
350506
  if (schemaBytes) {
350479
350507
  const wasmSchema = readSchema(schemaBytes);
350480
- const arrowTableForSchema = tableFromIPC(wasmSchema.intoIPCStream());
350508
+ const arrowTableForSchema = await tableFromIPC(wasmSchema.intoIPCStream());
350481
350509
  indexColumnName = tableToIndexColumnName(arrowTableForSchema);
350482
350510
  }
350483
350511
  } catch (e3) {
@@ -350493,14 +350521,14 @@ class SpatialDataTableSource extends AnnDataSource {
350493
350521
  }
350494
350522
  if (columns2 && !indexColumnName) {
350495
350523
  const wasmSchema = readSchema(parquetBytes);
350496
- const arrowTableForSchema = tableFromIPC(wasmSchema.intoIPCStream());
350524
+ const arrowTableForSchema = await tableFromIPC(wasmSchema.intoIPCStream());
350497
350525
  indexColumnName = tableToIndexColumnName(arrowTableForSchema);
350498
350526
  }
350499
350527
  if (options.columns && indexColumnName) {
350500
350528
  options.columns = [...options.columns, indexColumnName];
350501
350529
  }
350502
350530
  const wasmTable = readParquet(parquetBytes, options);
350503
- const arrowTable = tableFromIPC(wasmTable.intoIPCStream());
350531
+ const arrowTable = await tableFromIPC(wasmTable.intoIPCStream());
350504
350532
  return arrowTable;
350505
350533
  }
350506
350534
  // TABLE-SPECIFIC METHODS
@@ -392139,6 +392167,9 @@ function makeFileType(name2, dataType, dataLoaderClass, dataSourceClass, options
392139
392167
  }
392140
392168
  function makeZarrFileTypes(name2, dataType, dataLoaderClass, dataSourceClass, optionsSchema) {
392141
392169
  const altFileTypes = ALT_ZARR_STORE_TYPES[name2];
392170
+ if (!altFileTypes) {
392171
+ throw new Error(`No alternative file types found for Zarr-based fileType ${name2}`);
392172
+ }
392142
392173
  return [
392143
392174
  new PluginFileType(name2, dataType, dataLoaderClass, dataSourceClass, optionsSchema),
392144
392175
  ...Object.entries(altFileTypes).map(([key2, fileType]) => {
@@ -392227,15 +392258,15 @@ const baseFileTypes = [
392227
392258
  ...makeZarrFileTypes(FileType$2.OBS_SEGMENTATIONS_OME_ZARR, DataType$4.OBS_SEGMENTATIONS, OmeZarrAsObsSegmentationsLoader, ZarrDataSource, obsSegmentationsOmeZarrSchema),
392228
392259
  makeFileType(FileType$2.OBS_SEGMENTATIONS_OME_TIFF, DataType$4.OBS_SEGMENTATIONS, OmeTiffAsObsSegmentationsLoader, OmeTiffSource, obsSegmentationsOmeTiffSchema),
392229
392260
  // SpatialData file types
392230
- makeFileType(FileType$2.IMAGE_SPATIALDATA_ZARR, DataType$4.IMAGE, SpatialDataImageLoader, ZarrDataSource, imageSpatialdataSchema),
392231
- makeFileType(FileType$2.LABELS_SPATIALDATA_ZARR, DataType$4.OBS_SEGMENTATIONS, SpatialDataLabelsLoader, ZarrDataSource, obsSegmentationsSpatialdataSchema),
392232
- makeFileType(FileType$2.SHAPES_SPATIALDATA_ZARR, DataType$4.OBS_SEGMENTATIONS, SpatialDataObsSegmentationsLoader, SpatialDataShapesSource, obsSegmentationsSpatialdataSchema),
392233
- makeFileType(FileType$2.OBS_SPOTS_SPATIALDATA_ZARR, DataType$4.OBS_SPOTS, SpatialDataObsSpotsLoader, SpatialDataShapesSource, obsSpotsSpatialdataSchema),
392234
- makeFileType(FileType$2.OBS_POINTS_SPATIALDATA_ZARR, DataType$4.OBS_POINTS, SpatialDataObsPointsLoader, SpatialDataPointsSource, obsPointsSpatialdataSchema),
392235
- makeFileType(FileType$2.OBS_FEATURE_MATRIX_SPATIALDATA_ZARR, DataType$4.OBS_FEATURE_MATRIX, ObsFeatureMatrixAnndataLoader, SpatialDataTableSource, obsFeatureMatrixSpatialdataSchema),
392236
- makeFileType(FileType$2.OBS_SETS_SPATIALDATA_ZARR, DataType$4.OBS_SETS, SpatialDataObsSetsLoader, SpatialDataTableSource, obsSetsSpatialdataSchema),
392261
+ ...makeZarrFileTypes(FileType$2.IMAGE_SPATIALDATA_ZARR, DataType$4.IMAGE, SpatialDataImageLoader, ZarrDataSource, imageSpatialdataSchema),
392262
+ ...makeZarrFileTypes(FileType$2.LABELS_SPATIALDATA_ZARR, DataType$4.OBS_SEGMENTATIONS, SpatialDataLabelsLoader, ZarrDataSource, obsSegmentationsSpatialdataSchema),
392263
+ ...makeZarrFileTypes(FileType$2.SHAPES_SPATIALDATA_ZARR, DataType$4.OBS_SEGMENTATIONS, SpatialDataObsSegmentationsLoader, SpatialDataShapesSource, obsSegmentationsSpatialdataSchema),
392264
+ ...makeZarrFileTypes(FileType$2.OBS_SPOTS_SPATIALDATA_ZARR, DataType$4.OBS_SPOTS, SpatialDataObsSpotsLoader, SpatialDataShapesSource, obsSpotsSpatialdataSchema),
392265
+ ...makeZarrFileTypes(FileType$2.OBS_POINTS_SPATIALDATA_ZARR, DataType$4.OBS_POINTS, SpatialDataObsPointsLoader, SpatialDataPointsSource, obsPointsSpatialdataSchema),
392266
+ ...makeZarrFileTypes(FileType$2.OBS_FEATURE_MATRIX_SPATIALDATA_ZARR, DataType$4.OBS_FEATURE_MATRIX, ObsFeatureMatrixAnndataLoader, SpatialDataTableSource, obsFeatureMatrixSpatialdataSchema),
392267
+ ...makeZarrFileTypes(FileType$2.OBS_SETS_SPATIALDATA_ZARR, DataType$4.OBS_SETS, SpatialDataObsSetsLoader, SpatialDataTableSource, obsSetsSpatialdataSchema),
392268
+ ...makeZarrFileTypes(FileType$2.FEATURE_LABELS_SPATIALDATA_ZARR, DataType$4.FEATURE_LABELS, FeatureLabelsAnndataLoader, SpatialDataTableSource, featureLabelsAnndataSchema),
392237
392269
  makeFileType(FileType$2.OBS_SEGMENTATIONS_GLB, DataType$4.OBS_SEGMENTATIONS, GlbDataLoader, GlbSource, meshGlbSchema),
392238
- makeFileType(FileType$2.FEATURE_LABELS_SPATIALDATA_ZARR, DataType$4.FEATURE_LABELS, FeatureLabelsAnndataLoader, SpatialDataTableSource, featureLabelsAnndataSchema),
392239
392270
  // All legacy file types
392240
392271
  makeFileType(FileType$2.OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR, DataType$4.OBS_FEATURE_MATRIX, MatrixZarrAsObsFeatureMatrixLoader, ZarrDataSource, z.null()),
392241
392272
  makeFileType(FileType$2.IMAGE_RASTER_JSON, DataType$4.IMAGE, RasterJsonAsImageLoader, JsonSource, rasterJsonSchema),
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs, R as Raycaster, O as OrthographicCamera, P as PerspectiveCamera, S as Scene, a as PCFSoftShadowMap, V as VSMShadowMap, b as PCFShadowMap, B as BasicShadowMap, N as NoToneMapping, A as ACESFilmicToneMapping, c as Vector3, d as Vector2, C as Clock, W as WebGLRenderer, e as Camera, f as BufferGeometry, M as Material, L as Layers, T as Texture, h as RGBAFormat, U as UnsignedByteType, i as Color, _ as _extends, j as THREE, G as Group, k as Matrix4, l as TrianglesDrawMode, m as TriangleFanDrawMode, n as TriangleStripDrawMode, o as REVISION, E as EventDispatcher, p as MOUSE, q as TOUCH, r as Spherical, Q as Quaternion, s as Ray$1, t as Plane, u as Loader, v as LoaderUtils, F as FileLoader, w as MeshPhysicalMaterial, x as SpotLight, y as PointLight, D as DirectionalLight, I as InstancedMesh, z as Object3D, H as TextureLoader, J as ImageBitmapLoader, K as BufferAttribute, X as InterleavedBuffer, Y as LinearMipmapLinearFilter, Z as NearestMipmapLinearFilter, $ as LinearMipmapNearestFilter, a0 as NearestMipmapNearestFilter, a1 as LinearFilter, a2 as NearestFilter, a3 as RepeatWrapping, a4 as MirroredRepeatWrapping, a5 as ClampToEdgeWrapping, a6 as PointsMaterial, a7 as LineBasicMaterial, a8 as MeshStandardMaterial, a9 as DoubleSide, aa as MeshBasicMaterial, ab as PropertyBinding, ac as SkinnedMesh, ad as Mesh, ae as LineSegments, af as Line$1, ag as LineLoop, ah as Points, ai as MathUtils, aj as Skeleton, ak as InterpolateDiscrete, al as InterpolateLinear, am as AnimationClip, an as Bone, ao as InterleavedBufferAttribute, ap as VectorKeyframeTrack, aq as QuaternionKeyframeTrack, ar as NumberKeyframeTrack, as as FrontSide, at as Interpolant, au as Box3, av as Sphere, aw as InstancedBufferGeometry, ax as Float32BufferAttribute, ay as InstancedInterleavedBuffer, az as WireframeGeometry, aA as ShaderMaterial, aB as UniformsUtils, aC as UniformsLib, aD as Vector4, aE as Line3, aF as SphereGeometry, aG as Triangle, aH as BackSide, aI as jsxRuntimeExports, aJ as Matrix3, aK as CoordinationType, aL as Data3DTexture, aM as RedFormat, aN as FloatType, aO as getImageSize } from "./index-M1VivJi6.js";
1
+ import { g as getDefaultExportFromCjs, R as Raycaster, O as OrthographicCamera, P as PerspectiveCamera, S as Scene, a as PCFSoftShadowMap, V as VSMShadowMap, b as PCFShadowMap, B as BasicShadowMap, N as NoToneMapping, A as ACESFilmicToneMapping, c as Vector3, d as Vector2, C as Clock, W as WebGLRenderer, e as Camera, f as BufferGeometry, M as Material, L as Layers, T as Texture, h as RGBAFormat, U as UnsignedByteType, i as Color, _ as _extends, j as THREE, G as Group, k as Matrix4, l as TrianglesDrawMode, m as TriangleFanDrawMode, n as TriangleStripDrawMode, o as REVISION, E as EventDispatcher, p as MOUSE, q as TOUCH, r as Spherical, Q as Quaternion, s as Ray$1, t as Plane, u as Loader, v as LoaderUtils, F as FileLoader, w as MeshPhysicalMaterial, x as SpotLight, y as PointLight, D as DirectionalLight, I as InstancedMesh, z as Object3D, H as TextureLoader, J as ImageBitmapLoader, K as BufferAttribute, X as InterleavedBuffer, Y as LinearMipmapLinearFilter, Z as NearestMipmapLinearFilter, $ as LinearMipmapNearestFilter, a0 as NearestMipmapNearestFilter, a1 as LinearFilter, a2 as NearestFilter, a3 as RepeatWrapping, a4 as MirroredRepeatWrapping, a5 as ClampToEdgeWrapping, a6 as PointsMaterial, a7 as LineBasicMaterial, a8 as MeshStandardMaterial, a9 as DoubleSide, aa as MeshBasicMaterial, ab as PropertyBinding, ac as SkinnedMesh, ad as Mesh, ae as LineSegments, af as Line$1, ag as LineLoop, ah as Points, ai as MathUtils, aj as Skeleton, ak as InterpolateDiscrete, al as InterpolateLinear, am as AnimationClip, an as Bone, ao as InterleavedBufferAttribute, ap as VectorKeyframeTrack, aq as QuaternionKeyframeTrack, ar as NumberKeyframeTrack, as as FrontSide, at as Interpolant, au as Box3, av as Sphere, aw as InstancedBufferGeometry, ax as Float32BufferAttribute, ay as InstancedInterleavedBuffer, az as WireframeGeometry, aA as ShaderMaterial, aB as UniformsUtils, aC as UniformsLib, aD as Vector4, aE as Line3, aF as SphereGeometry, aG as Triangle, aH as BackSide, aI as jsxRuntimeExports, aJ as Matrix3, aK as CoordinationType, aL as Data3DTexture, aM as RedFormat, aN as FloatType, aO as getImageSize } from "./index-BsLyjMi2.js";
2
2
  import * as React from "react";
3
3
  import React__default, { useReducer, useRef, useEffect, useLayoutEffect, useDebugValue, useState, useMemo, forwardRef } from "react";
4
4
  var constants = { exports: {} };
@@ -23637,7 +23637,7 @@ const Text = /* @__PURE__ */ React.forwardRef(({
23637
23637
  const {
23638
23638
  Text: TextMeshImpl,
23639
23639
  preloadFont
23640
- } = suspend(async () => import("./troika-three-text.esm-CiBgI1UH.js"), []);
23640
+ } = suspend(async () => import("./troika-three-text.esm-d4voIYSE.js"), []);
23641
23641
  const invalidate2 = useThree(({
23642
23642
  invalidate: invalidate3
23643
23643
  }) => invalidate3);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bU, bP, bN, bO, bY, bZ, bQ, c5, c3, c1, c4, c2, bM, c0, bR, bL, bK, bW, bV, bX, b$, b_, bT, ca, cd, c7, ce, cf, c8, cb, cc, c9, bS, c6 } from "./index-M1VivJi6.js";
1
+ import { bU, bP, bN, bO, bY, bZ, bQ, c5, c3, c1, c4, c2, bM, c0, bR, bL, bK, bW, bV, bX, b$, b_, bT, ca, cd, c7, ce, cf, c8, cb, cc, c9, bS, c6 } from "./index-BsLyjMi2.js";
2
2
  import "react";
3
3
  export {
4
4
  bU as CoordinationLevel,
@@ -1,4 +1,4 @@
1
- import { aP as BaseDecoder } from "./index-M1VivJi6.js";
1
+ import { aP as BaseDecoder } from "./index-BsLyjMi2.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, aP as BaseDecoder, aQ as LercParameters, aR as LercAddCompression } from "./index-M1VivJi6.js";
2
+ import { g as getDefaultExportFromCjs, aP as BaseDecoder, aQ as LercParameters, aR as LercAddCompression } from "./index-BsLyjMi2.js";
3
3
  var LercDecode = { exports: {} };
4
4
  var hasRequiredLercDecode;
5
5
  function requireLercDecode() {
@@ -1,4 +1,4 @@
1
- import { aP as BaseDecoder } from "./index-M1VivJi6.js";
1
+ import { aP as BaseDecoder } from "./index-BsLyjMi2.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 { aP as BaseDecoder } from "./index-M1VivJi6.js";
1
+ import { aP as BaseDecoder } from "./index-BsLyjMi2.js";
2
2
  class PackbitsDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  const dataView = new DataView(buffer);
@@ -1,4 +1,4 @@
1
- import { aP as BaseDecoder } from "./index-M1VivJi6.js";
1
+ import { aP as BaseDecoder } from "./index-BsLyjMi2.js";
2
2
  class RawDecoder extends BaseDecoder {
3
3
  decodeBlock(buffer) {
4
4
  return buffer;
@@ -1,4 +1,4 @@
1
- import { bE as MeshDistanceMaterial, bF as MeshDepthMaterial, bG as RGBADepthPacking, aB as UniformsUtils, bH as ShaderChunk, aw as InstancedBufferGeometry, av as Sphere, au as Box3, aH as BackSide, a9 as DoubleSide, ad as Mesh, as as FrontSide, aa as MeshBasicMaterial, i as Color, c as Vector3, k as Matrix4, d as Vector2, aJ as Matrix3, aD as Vector4, T as Texture, a1 as LinearFilter, bI as PlaneGeometry, f as BufferGeometry, ax as Float32BufferAttribute, bJ as InstancedBufferAttribute } from "./index-M1VivJi6.js";
1
+ import { bE as MeshDistanceMaterial, bF as MeshDepthMaterial, bG as RGBADepthPacking, aB as UniformsUtils, bH as ShaderChunk, aw as InstancedBufferGeometry, av as Sphere, au as Box3, aH as BackSide, a9 as DoubleSide, ad as Mesh, as as FrontSide, aa as MeshBasicMaterial, i as Color, c as Vector3, k as Matrix4, d as Vector2, aJ as Matrix3, aD as Vector4, T as Texture, a1 as LinearFilter, bI as PlaneGeometry, f as BufferGeometry, ax as Float32BufferAttribute, bJ as InstancedBufferAttribute } from "./index-BsLyjMi2.js";
2
2
  function workerBootstrap() {
3
3
  var modules = /* @__PURE__ */ Object.create(null);
4
4
  function registerModule(ref, callback) {
@@ -1,4 +1,4 @@
1
- import { aP as BaseDecoder } from "./index-M1VivJi6.js";
1
+ import { aP as BaseDecoder } from "./index-BsLyjMi2.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/dev",
3
- "version": "3.6.11",
3
+ "version": "3.6.13",
4
4
  "author": "HIDIVE Lab at HMS",
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.6.11",
20
- "@vitessce/config": "3.6.11",
21
- "@vitessce/constants": "3.6.11",
22
- "@vitessce/export-utils": "3.6.11"
19
+ "@vitessce/all": "3.6.13",
20
+ "@vitessce/config": "3.6.13",
21
+ "@vitessce/constants": "3.6.13",
22
+ "@vitessce/export-utils": "3.6.13"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@vitejs/plugin-react": "^4.5.0",