@vitessce/all 3.8.5 → 3.8.7

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.
@@ -209323,22 +209323,22 @@ async function getDecoder(fileDirectory) {
209323
209323
  const Decoder = await importFn();
209324
209324
  return new Decoder(fileDirectory);
209325
209325
  }
209326
- addDecoder([void 0, 1], () => import("./raw-DLW6Ob0W.js").then((m2) => m2.default));
209327
- addDecoder(5, () => import("./lzw-CVivhiK8.js").then((m2) => m2.default));
209326
+ addDecoder([void 0, 1], () => import("./raw-awn9z18M.js").then((m2) => m2.default));
209327
+ addDecoder(5, () => import("./lzw-BCI0B7dw.js").then((m2) => m2.default));
209328
209328
  addDecoder(6, () => {
209329
209329
  throw new Error("old style JPEG compression is not supported.");
209330
209330
  });
209331
- addDecoder(7, () => import("./jpeg-CP3ptIzO.js").then((m2) => m2.default));
209332
- addDecoder([8, 32946], () => import("./deflate-CMHXRV2s.js").then((m2) => m2.default));
209333
- addDecoder(32773, () => import("./packbits-CSpmt53h.js").then((m2) => m2.default));
209331
+ addDecoder(7, () => import("./jpeg-CjgDlwi_.js").then((m2) => m2.default));
209332
+ addDecoder([8, 32946], () => import("./deflate-YfGOvzab.js").then((m2) => m2.default));
209333
+ addDecoder(32773, () => import("./packbits-DYn86_iq.js").then((m2) => m2.default));
209334
209334
  addDecoder(
209335
209335
  34887,
209336
- () => import("./lerc-DSNwBQly.js").then(async (m2) => {
209336
+ () => import("./lerc-CL4MdbCg.js").then(async (m2) => {
209337
209337
  await m2.zstd.init();
209338
209338
  return m2;
209339
209339
  }).then((m2) => m2.default)
209340
209340
  );
209341
- addDecoder(50001, () => import("./webimage-TKddjYdZ.js").then((m2) => m2.default));
209341
+ addDecoder(50001, () => import("./webimage-Bo4F4TPe.js").then((m2) => m2.default));
209342
209342
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
209343
209343
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
209344
209344
  }
@@ -227465,11 +227465,11 @@ function TooltipContent(props) {
227465
227465
  return jsxRuntimeExports.jsx("table", { children: jsxRuntimeExports.jsx("tbody", { children: Object.entries(mappedInfo).map(([key2, value2]) => jsxRuntimeExports.jsxs("tr", { children: [jsxRuntimeExports.jsx("th", { children: key2 }), jsxRuntimeExports.jsx("td", { children: value2 })] }, key2)) }) });
227466
227466
  }
227467
227467
  function ScatterplotTooltipSubscriber(props) {
227468
- const { parentUuid, obsHighlight, width: width2, height: height2, getObsInfo, featureType, featureLabelsMap } = props;
227468
+ const { parentUuid, obsHighlight, width: width2, height: height2, getObsInfo: getObsInfo2, featureType, featureLabelsMap } = props;
227469
227469
  const sourceUuid = useComponentHover();
227470
227470
  const viewInfo = useComponentViewInfo(parentUuid);
227471
- const [cellInfo, x2, y2] = obsHighlight && getObsInfo ? [
227472
- getObsInfo(obsHighlight),
227471
+ const [cellInfo, x2, y2] = obsHighlight && getObsInfo2 ? [
227472
+ getObsInfo2(obsHighlight),
227473
227473
  ...viewInfo && viewInfo.projectFromId ? viewInfo.projectFromId(obsHighlight) : [null, null]
227474
227474
  ] : [null, null, null];
227475
227475
  return cellInfo ? jsxRuntimeExports.jsx(Tooltip2D, { x: x2, y: y2, parentUuid, sourceUuid, parentWidth: width2, parentHeight: height2, children: jsxRuntimeExports.jsx(TooltipContent, { info: cellInfo, featureType, featureLabelsMap }) }) : null;
@@ -231881,7 +231881,7 @@ function EmbeddingScatterplotSubscriber(props) {
231881
231881
  initialTargetY,
231882
231882
  averageFillDensity
231883
231883
  ]);
231884
- const getObsInfo = useGetObsInfo(observationsLabel, obsLabelsTypes, obsLabelsData, obsSetsMembership);
231884
+ const getObsInfo2 = useGetObsInfo(observationsLabel, obsLabelsTypes, obsLabelsData, obsSetsMembership);
231885
231885
  const cellSelectionSet = useMemo$1(() => new Set(cellSelection), [cellSelection]);
231886
231886
  const getCellIsSelected = useCallback((object2, { index: index2 }) => (cellSelectionSet || /* @__PURE__ */ new Set([])).has(obsEmbeddingIndex[index2]) ? 1 : 0, [cellSelectionSet, obsEmbeddingIndex]);
231887
231887
  const cellRadius = cellRadiusMode === "manual" ? cellRadiusFixed : dynamicCellRadius;
@@ -232038,7 +232038,7 @@ function EmbeddingScatterplotSubscriber(props) {
232038
232038
  embeddingContoursVisible,
232039
232039
  circleInfo,
232040
232040
  featureSelection: geneSelection
232041
- }), tooltipsVisible && width2 && height2 ? jsxRuntimeExports.jsx(ScatterplotTooltipSubscriber, { parentUuid: uuid2, obsHighlight: cellHighlight, width: width2, height: height2, getObsInfo, featureType, featureLabelsMap }) : null, jsxRuntimeExports.jsx(Legend, {
232041
+ }), tooltipsVisible && width2 && height2 ? jsxRuntimeExports.jsx(ScatterplotTooltipSubscriber, { parentUuid: uuid2, obsHighlight: cellHighlight, width: width2, height: height2, getObsInfo: getObsInfo2, featureType, featureLabelsMap }) : null, jsxRuntimeExports.jsx(Legend, {
232042
232042
  visible: true,
232043
232043
  theme,
232044
232044
  featureType,
@@ -232318,7 +232318,7 @@ function GatingSubscriber(props) {
232318
232318
  matrixObsIndex: obsIndex,
232319
232319
  expressionData: uint8ExpressionData
232320
232320
  });
232321
- const getObsInfo = useCallback((obsId) => {
232321
+ const getObsInfo2 = useCallback((obsId) => {
232322
232322
  const selectedTransformName = VALUE_TRANSFORM_OPTIONS.find((o2) => o2.value === featureValueTransform)?.name;
232323
232323
  const genePrefix = featureValueTransform ? `${selectedTransformName} ` : "";
232324
232324
  const obsIdx = obsIndex?.indexOf(obsId);
@@ -232349,7 +232349,7 @@ function GatingSubscriber(props) {
232349
232349
  setZoom(null);
232350
232350
  }, gatingFeatureValueTransformCoefficient: featureValueTransformCoefficient, setGatingFeatureValueTransformCoefficient: setFeatureValueTransformCoefficient, geneSelectOptions: featureIndex, transformOptions: VALUE_TRANSFORM_OPTIONS }) }), children: [jsxRuntimeExports.jsx(EmptyMessage, { visible: !(gatingFeatureSelectionX && gatingFeatureSelectionY), message: `Select two ${pluralize(featureType, 2)} in the plot settings.` }), jsxRuntimeExports.jsx(ScatterplotWrapper, { ref: deckRef, uuid: uuid2, theme, hideTools: !(gatingFeatureSelectionX && gatingFeatureSelectionY), hideRecenter: !(gatingFeatureSelectionX && gatingFeatureSelectionY), viewState: { zoom: zoom2, target: [targetX2, targetY2, targetZ] }, setViewState, originalViewState, obsEmbeddingIndex: obsIndex, obsEmbedding: obsXY, cellFilter, cellSelection, cellHighlight, cellColors, cellSetPolygons, cellSetLabelSize, cellSetLabelsVisible, cellSetPolygonsVisible, setCellFilter, setCellSelection: setCellSelectionProp, setCellHighlight, cellRadius, cellOpacity, cellColorEncoding, geneExpressionColormap, geneExpressionColormapRange, setComponentHover: () => {
232351
232351
  setComponentHover(uuid2);
232352
- }, updateViewInfo: setComponentViewInfo, getExpressionValue, getCellIsSelected, embeddingPointsVisible: true }), !disableTooltip && jsxRuntimeExports.jsx(ScatterplotTooltipSubscriber, { parentUuid: uuid2, obsHighlight: cellHighlight, width: width2, height: height2, getObsInfo })] });
232352
+ }, updateViewInfo: setComponentViewInfo, getExpressionValue, getCellIsSelected, embeddingPointsVisible: true }), !disableTooltip && jsxRuntimeExports.jsx(ScatterplotTooltipSubscriber, { parentUuid: uuid2, obsHighlight: cellHighlight, width: width2, height: height2, getObsInfo: getObsInfo2 })] });
232353
232353
  }
232354
232354
  var DEFAULT_CONFIG = {
232355
232355
  // minimum relative difference between two compared values,
@@ -247757,7 +247757,7 @@ function uri2href(url) {
247757
247757
  }
247758
247758
  throw Error(`Protocol not supported, got: ${JSON.stringify(protocol)}`);
247759
247759
  }
247760
- function fetch_range$1(url, offset2, length2, opts2 = {}) {
247760
+ function fetch_range(url, offset2, length2, opts2 = {}) {
247761
247761
  if (offset2 !== void 0 && length2 !== void 0) {
247762
247762
  opts2 = {
247763
247763
  ...opts2,
@@ -247769,7 +247769,7 @@ function fetch_range$1(url, offset2, length2, opts2 = {}) {
247769
247769
  }
247770
247770
  return fetch(url, opts2);
247771
247771
  }
247772
- function merge_init$1(storeOverrides, requestOverrides) {
247772
+ function merge_init(storeOverrides, requestOverrides) {
247773
247773
  return {
247774
247774
  ...storeOverrides,
247775
247775
  ...requestOverrides,
@@ -247783,7 +247783,7 @@ function assert$5(expression2, msg = "") {
247783
247783
  if (!expression2)
247784
247784
  throw new Error(msg);
247785
247785
  }
247786
- function resolve$2(root2, path2) {
247786
+ function resolve$1(root2, path2) {
247787
247787
  const base2 = typeof root2 === "string" ? new URL(root2) : root2;
247788
247788
  if (!base2.pathname.endsWith("/")) {
247789
247789
  base2.pathname += "/";
@@ -247792,7 +247792,7 @@ function resolve$2(root2, path2) {
247792
247792
  resolved.search = base2.search;
247793
247793
  return resolved;
247794
247794
  }
247795
- async function handle_response$1(response) {
247795
+ async function handle_response(response) {
247796
247796
  if (response.status === 404) {
247797
247797
  return void 0;
247798
247798
  }
@@ -247801,7 +247801,7 @@ async function handle_response$1(response) {
247801
247801
  }
247802
247802
  throw new Error(`Unexpected response status ${response.status} ${response.statusText}`);
247803
247803
  }
247804
- async function fetch_suffix$1(url, suffix_length, init2, use_suffix_request) {
247804
+ async function fetch_suffix(url, suffix_length, init2, use_suffix_request) {
247805
247805
  if (use_suffix_request) {
247806
247806
  return fetch(url, {
247807
247807
  ...init2,
@@ -247814,9 +247814,9 @@ async function fetch_suffix$1(url, suffix_length, init2, use_suffix_request) {
247814
247814
  }
247815
247815
  let content_length = response.headers.get("Content-Length");
247816
247816
  let length2 = Number(content_length);
247817
- return fetch_range$1(url, length2 - suffix_length, length2, init2);
247817
+ return fetch_range(url, length2 - suffix_length, length2, init2);
247818
247818
  }
247819
- let FetchStore$1 = class FetchStore {
247819
+ class FetchStore {
247820
247820
  #overrides;
247821
247821
  #use_suffix_request;
247822
247822
  constructor(url, options = {}) {
@@ -247825,25 +247825,25 @@ let FetchStore$1 = class FetchStore {
247825
247825
  this.#use_suffix_request = options.useSuffixRequest ?? false;
247826
247826
  }
247827
247827
  #merge_init(overrides) {
247828
- return merge_init$1(this.#overrides, overrides);
247828
+ return merge_init(this.#overrides, overrides);
247829
247829
  }
247830
247830
  async get(key2, options = {}) {
247831
- let href2 = resolve$2(this.url, key2).href;
247831
+ let href2 = resolve$1(this.url, key2).href;
247832
247832
  let response = await fetch(href2, this.#merge_init(options));
247833
- return handle_response$1(response);
247833
+ return handle_response(response);
247834
247834
  }
247835
247835
  async getRange(key2, range2, options = {}) {
247836
- let url = resolve$2(this.url, key2);
247836
+ let url = resolve$1(this.url, key2);
247837
247837
  let init2 = this.#merge_init(options);
247838
247838
  let response;
247839
247839
  if ("suffixLength" in range2) {
247840
- response = await fetch_suffix$1(url, range2.suffixLength, init2, this.#use_suffix_request);
247840
+ response = await fetch_suffix(url, range2.suffixLength, init2, this.#use_suffix_request);
247841
247841
  } else {
247842
- response = await fetch_range$1(url, range2.offset, range2.length, init2);
247842
+ response = await fetch_range(url, range2.offset, range2.length, init2);
247843
247843
  }
247844
- return handle_response$1(response);
247844
+ return handle_response(response);
247845
247845
  }
247846
- };
247846
+ }
247847
247847
  let BoolArray$1 = class BoolArray {
247848
247848
  #bytes;
247849
247849
  constructor(x2, byteOffset, length2) {
@@ -250135,7 +250135,7 @@ class HTTPRangeReader {
250135
250135
  if (size2 === 0) {
250136
250136
  return new Uint8Array(0);
250137
250137
  }
250138
- const req = await fetch_range$1(this.url, offset2, size2, this.#overrides);
250138
+ const req = await fetch_range(this.url, offset2, size2, this.#overrides);
250139
250139
  assert$5(req.ok, `failed http request ${this.url}, status: ${req.status} offset: ${offset2} size: ${size2}: ${req.statusText}`);
250140
250140
  return new Uint8Array(await req.arrayBuffer());
250141
250141
  }
@@ -250403,7 +250403,7 @@ class ReferenceStore {
250403
250403
  if (!url) {
250404
250404
  throw Error(`No url for key ${key2}, and no target url provided.`);
250405
250405
  }
250406
- let res = await fetch_range$1(uri2href(url), offset2, size2, merge_init$1(this.#overrides, opts2));
250406
+ let res = await fetch_range(uri2href(url), offset2, size2, merge_init(this.#overrides, opts2));
250407
250407
  if (res.status === 200 || res.status === 206) {
250408
250408
  return new Uint8Array(await res.arrayBuffer());
250409
250409
  }
@@ -250418,7 +250418,7 @@ class ReferenceStore {
250418
250418
  return ReferenceStore.fromSpec(spec, opts2);
250419
250419
  }
250420
250420
  }
250421
- class RelaxedFetchStore extends FetchStore$1 {
250421
+ class RelaxedFetchStore extends FetchStore {
250422
250422
  // This allows returning `undefined` for 403 responses,
250423
250423
  // as opposed to completely erroring.
250424
250424
  // Needed due to https://github.com/manzt/zarrita.js/pull/212
@@ -251422,8 +251422,8 @@ function SpatialOptions(props) {
251422
251422
  return `${labelPrefix} for spatial gene expression colormap range`;
251423
251423
  }, id: `gene-expression-colormap-range-${spatialOptionsId}`, valueLabelDisplay: "auto", step: 5e-3, min: 0, max: 1 }) })] })] }) : null] });
251424
251424
  }
251425
- function SpatialTooltipSubscriber(props) {
251426
- const { parentUuid, obsHighlight, width: width2, height: height2, getObsInfo, hoverData, hoverCoord, hoverMode, useHoverInfoForTooltip, getObsIdFromHoverData, featureType, featureLabelsMap } = props;
251425
+ function SpatialTooltipSubscriber$1(props) {
251426
+ const { parentUuid, obsHighlight, width: width2, height: height2, getObsInfo: getObsInfo2, hoverData, hoverCoord, hoverMode, useHoverInfoForTooltip, getObsIdFromHoverData, featureType, featureLabelsMap } = props;
251427
251427
  const sourceUuid = useComponentHover();
251428
251428
  const viewInfo = useComponentViewInfo(parentUuid);
251429
251429
  let [cellInfo, x2, y2] = [null, null, null];
@@ -251431,7 +251431,7 @@ function SpatialTooltipSubscriber(props) {
251431
251431
  const obsId = getObsIdFromHoverData(hoverData);
251432
251432
  if (obsId) {
251433
251433
  [cellInfo, x2, y2] = [
251434
- getObsInfo(obsId, hoverMode),
251434
+ getObsInfo2(obsId, hoverMode),
251435
251435
  ...hoverCoord || [null, null]
251436
251436
  ];
251437
251437
  }
@@ -251439,14 +251439,14 @@ function SpatialTooltipSubscriber(props) {
251439
251439
  const obsId = getObsIdFromHoverData(hoverData);
251440
251440
  if (obsId) {
251441
251441
  [cellInfo, x2, y2] = [
251442
- getObsInfo(obsId, hoverMode),
251442
+ getObsInfo2(obsId, hoverMode),
251443
251443
  ...hoverCoord || [null, null]
251444
251444
  ];
251445
251445
  }
251446
- } else if (!useHoverInfoForTooltip && getObsInfo && obsHighlight) {
251446
+ } else if (!useHoverInfoForTooltip && getObsInfo2 && obsHighlight) {
251447
251447
  const obsId = obsHighlight;
251448
251448
  [cellInfo, x2, y2] = [
251449
- getObsInfo(obsId, hoverMode),
251449
+ getObsInfo2(obsId, hoverMode),
251450
251450
  ...viewInfo && viewInfo.projectFromId ? viewInfo.projectFromId(obsId) : [null, null]
251451
251451
  ];
251452
251452
  }
@@ -251620,7 +251620,7 @@ function SpatialSubscriber$1(props) {
251620
251620
  matrixObsIndex
251621
251621
  ]);
251622
251622
  const cellSelection = useMemo$1(() => Array.from(cellColors.keys()), [cellColors]);
251623
- const getObsInfo = useGetObsInfo(observationsLabel, obsLabelsTypes, obsLabelsData, obsSetsMembership);
251623
+ const getObsInfo2 = useGetObsInfo(observationsLabel, obsLabelsTypes, obsLabelsData, obsSetsMembership);
251624
251624
  const getTooltipObsInfo = useCallback((tooltipObsId, tooltipObsType) => {
251625
251625
  if (tooltipObsType === HOVER_MODE.MOLECULE_LAYER) {
251626
251626
  return {
@@ -251628,8 +251628,8 @@ function SpatialSubscriber$1(props) {
251628
251628
  "Molecule Name": obsLocationsLabels[tooltipObsId]
251629
251629
  };
251630
251630
  }
251631
- return getObsInfo(tooltipObsId);
251632
- }, [getObsInfo, obsLocationsLabels]);
251631
+ return getObsInfo2(tooltipObsId);
251632
+ }, [getObsInfo2, obsLocationsLabels]);
251633
251633
  const [hoverData, setHoverData] = useState(null);
251634
251634
  const [hoverCoord, setHoverCoord] = useState(null);
251635
251635
  const [hoverMode, setHoverMode] = useState(null);
@@ -251757,7 +251757,7 @@ function SpatialSubscriber$1(props) {
251757
251757
  orbitAxis
251758
251758
  }, setViewState, originalViewState, imageLayerDefs: imageLayers, obsSegmentationsLayerDefs: cellsLayer, obsLocationsLayerDefs: moleculesLayer, neighborhoodLayerDefs: neighborhoodsLayer, obsLocationsIndex, obsSegmentationsIndex, obsLocations, obsLocationsLabels, obsLocationsFeatureIndex, hasSegmentations: hasSegmentationsData, obsSegmentations, obsSegmentationsType, obsCentroids, obsCentroidsIndex, cellFilter, cellSelection, cellHighlight, cellColors, neighborhoods, imageLayerLoaders: resolutionFilteredImageLayerLoaders, setCellFilter, setCellSelection: setCellSelectionProp, setCellHighlight, setHoverInfo, setMoleculeHighlight, setComponentHover: () => {
251759
251759
  setComponentHover(uuid2);
251760
- }, updateViewInfo: setComponentViewInfo, imageLayerCallbacks, segmentationLayerCallbacks, spatialAxisFixed, geneExpressionColormap, geneExpressionColormapRange, expressionData: shiftedExpressionDataForBitmask, cellColorEncoding, getExpressionValue, theme, useFullResolutionImage, photometricInterpretation }), tooltipsVisible && jsxRuntimeExports.jsx(SpatialTooltipSubscriber, { parentUuid: uuid2, obsHighlight: cellHighlight || moleculeHighlight, width: width2, height: height2, getObsInfo: getTooltipObsInfo, useHoverInfoForTooltip, hoverData, hoverCoord, hoverMode, getObsIdFromHoverData, featureType, featureLabelsMap }), jsxRuntimeExports.jsx(Legend, {
251760
+ }, updateViewInfo: setComponentViewInfo, imageLayerCallbacks, segmentationLayerCallbacks, spatialAxisFixed, geneExpressionColormap, geneExpressionColormapRange, expressionData: shiftedExpressionDataForBitmask, cellColorEncoding, getExpressionValue, theme, useFullResolutionImage, photometricInterpretation }), tooltipsVisible && jsxRuntimeExports.jsx(SpatialTooltipSubscriber$1, { parentUuid: uuid2, obsHighlight: cellHighlight || moleculeHighlight, width: width2, height: height2, getObsInfo: getTooltipObsInfo, useHoverInfoForTooltip, hoverData, hoverCoord, hoverMode, getObsIdFromHoverData, featureType, featureLabelsMap }), jsxRuntimeExports.jsx(Legend, {
251761
251761
  visible: true,
251762
251762
  // Fix to dark theme due to black background of spatial plot.
251763
251763
  theme: "dark",
@@ -253018,6 +253018,117 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
253018
253018
  }
253019
253019
  }
253020
253020
  const SpatialWrapper = forwardRef$1((props, deckRef) => jsxRuntimeExports.jsx(Spatial2, { ...props, deckRef }));
253021
+ function TooltipChild(props) {
253022
+ const { x: x2, y: y2, parentUuid, sourceUuid, width: width2, height: height2, info: info2, tooltipsVisible, tooltipCrosshairsVisible, featureType, featureLabelsMap } = props;
253023
+ const visible = parentUuid === sourceUuid ? tooltipsVisible : tooltipCrosshairsVisible;
253024
+ return visible ? jsxRuntimeExports.jsx(Tooltip2D, { x: x2, y: y2, parentUuid, sourceUuid, parentWidth: width2, parentHeight: height2, children: jsxRuntimeExports.jsx(TooltipContent, { info: info2, featureType, featureLabelsMap }) }) : null;
253025
+ }
253026
+ function getXY(obsHighlight, viewInfo, obsIndex, obsLocations, useHoverInfoForTooltip, projectedHoverCoord) {
253027
+ const hasObsCoordinates = useHoverInfoForTooltip ? true : obsIndex && obsLocations;
253028
+ if (!hasObsCoordinates)
253029
+ return null;
253030
+ const obsI = obsIndex?.indexOf(obsHighlight);
253031
+ if (obsI < 0)
253032
+ return null;
253033
+ if (useHoverInfoForTooltip) {
253034
+ return [projectedHoverCoord?.[0], projectedHoverCoord?.[1]];
253035
+ }
253036
+ const obsCoord = [obsLocations?.data[0][obsI] || 0, obsLocations?.data[1][obsI] || 0, 0];
253037
+ const projectedObsCoord = viewInfo?.project(obsCoord);
253038
+ return [projectedObsCoord?.[0], projectedObsCoord?.[1]];
253039
+ }
253040
+ function getObsInfo(obsSetsData, obsType, obsId) {
253041
+ let result = {
253042
+ [`${capitalize$3(obsType)} ID`]: obsId
253043
+ };
253044
+ if (obsSetsData?.obsSetsMembership) {
253045
+ const obsMembership = obsSetsData.obsSetsMembership.get(obsId) || [];
253046
+ if (obsMembership) {
253047
+ result = {
253048
+ ...result,
253049
+ ...Object.fromEntries(obsMembership.flatMap((path2) => path2.slice(1).map((pathEl, elLevel) => [
253050
+ `${path2[0]}${path2.length > 2 ? ` L${elLevel + 1}` : ""}`,
253051
+ pathEl
253052
+ ])))
253053
+ };
253054
+ }
253055
+ }
253056
+ return result;
253057
+ }
253058
+ function SpatialTooltipSubscriber(props) {
253059
+ const {
253060
+ parentUuid,
253061
+ width: width2,
253062
+ height: height2,
253063
+ hoverCoord,
253064
+ featureType,
253065
+ featureLabelsMap,
253066
+ // Points
253067
+ obsPoints,
253068
+ pointLayerScopes,
253069
+ pointLayerCoordination,
253070
+ // Spots
253071
+ obsSpots,
253072
+ spotLayerScopes,
253073
+ spotLayerCoordination,
253074
+ // Segmentations
253075
+ obsSegmentationsLocations,
253076
+ segmentationLayerScopes,
253077
+ segmentationChannelScopesByLayer,
253078
+ segmentationChannelCoordination,
253079
+ obsSegmentationsSetsData,
253080
+ // Images
253081
+ imageLayerScopes,
253082
+ imageLayerCoordination
253083
+ } = props;
253084
+ const sourceUuid = useComponentHover();
253085
+ const viewInfo = useComponentViewInfo(parentUuid);
253086
+ const useHoverInfoForTooltip = sourceUuid === parentUuid && hoverCoord;
253087
+ const projectedHoverCoord = useHoverInfoForTooltip ? viewInfo?.project(hoverCoord) : null;
253088
+ let yOffset = -30;
253089
+ return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [projectedHoverCoord && imageLayerScopes?.map((layerScope) => {
253090
+ const { pixelHighlight, tooltipsVisible, spatialLayerVisible } = imageLayerCoordination?.[0]?.[layerScope] || {};
253091
+ return tooltipsVisible && pixelHighlight && spatialLayerVisible ? jsxRuntimeExports.jsx(TooltipChild, { parentUuid, sourceUuid, width: width2, height: height2, info: {
253092
+ "Pixel Value": JSON.stringify(pixelHighlight)
253093
+ }, x: projectedHoverCoord?.[0], y: projectedHoverCoord?.[1] + (yOffset += 30), featureType, featureLabelsMap }, layerScope) : null;
253094
+ }), segmentationLayerScopes?.flatMap((layerScope) => segmentationChannelScopesByLayer?.[layerScope]?.map((channelScope) => {
253095
+ const { obsType, obsHighlight, tooltipsVisible, tooltipCrosshairsVisible, spatialChannelVisible } = segmentationChannelCoordination?.[0]?.[layerScope]?.[channelScope] || {};
253096
+ const obsSetsData = obsSegmentationsSetsData?.[layerScope]?.[channelScope];
253097
+ const obsInfo = getObsInfo(obsSetsData, obsType, obsHighlight);
253098
+ if (!obsHighlight || !spatialChannelVisible || !tooltipsVisible && !tooltipCrosshairsVisible)
253099
+ return null;
253100
+ const { obsIndex, obsLocations } = obsSegmentationsLocations?.[layerScope]?.[channelScope] || {};
253101
+ const xy = getXY(obsHighlight, viewInfo, obsIndex, obsLocations, useHoverInfoForTooltip, projectedHoverCoord);
253102
+ if (!xy)
253103
+ return null;
253104
+ const [x2, y2] = xy;
253105
+ return jsxRuntimeExports.jsx(TooltipChild, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: obsInfo, x: x2, y: y2 + (yOffset += 20 + 15 * Object.keys(obsInfo).length), featureType, featureLabelsMap }, `${layerScope}-${channelScope}`);
253106
+ })), spotLayerScopes?.map((layerScope) => {
253107
+ const { obsType, obsHighlight, tooltipsVisible, tooltipCrosshairsVisible, spatialLayerVisible } = spotLayerCoordination?.[0]?.[layerScope] || {};
253108
+ if (!obsHighlight || !spatialLayerVisible || !tooltipsVisible && !tooltipCrosshairsVisible)
253109
+ return null;
253110
+ const { obsIndex, obsSpots: obsLocations } = obsSpots?.[layerScope] || {};
253111
+ const xy = getXY(obsHighlight, viewInfo, obsIndex, obsLocations, useHoverInfoForTooltip, projectedHoverCoord);
253112
+ if (!xy)
253113
+ return null;
253114
+ const [x2, y2] = xy;
253115
+ return jsxRuntimeExports.jsx(TooltipChild, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: {
253116
+ [`${capitalize$3(obsType)} ID`]: obsHighlight
253117
+ }, x: x2, y: y2 + (yOffset += 30), featureType, featureLabelsMap }, layerScope);
253118
+ }), pointLayerScopes?.map((layerScope) => {
253119
+ const { obsType, obsHighlight, tooltipsVisible, tooltipCrosshairsVisible, spatialLayerVisible } = pointLayerCoordination?.[0]?.[layerScope] || {};
253120
+ if (!obsHighlight || !spatialLayerVisible || !tooltipsVisible && !tooltipCrosshairsVisible)
253121
+ return null;
253122
+ const { obsIndex, obsPoints: obsLocations } = obsPoints?.[layerScope] || {};
253123
+ const xy = getXY(obsHighlight, viewInfo, obsIndex, obsLocations, useHoverInfoForTooltip, projectedHoverCoord);
253124
+ if (!xy)
253125
+ return null;
253126
+ const [x2, y2] = xy;
253127
+ return jsxRuntimeExports.jsx(TooltipChild, { parentUuid, sourceUuid, tooltipsVisible, tooltipCrosshairsVisible, width: width2, height: height2, info: {
253128
+ [`${capitalize$3(obsType)} ID`]: obsHighlight
253129
+ }, x: x2, y: y2 + (yOffset += 30), featureType, featureLabelsMap }, layerScope);
253130
+ })] });
253131
+ }
253021
253132
  class ErrorBoundary extends React__default.Component {
253022
253133
  constructor(props) {
253023
253134
  super(props);
@@ -253036,12 +253147,12 @@ class ErrorBoundary extends React__default.Component {
253036
253147
  }
253037
253148
  }
253038
253149
  const LazySpatialThree = React__default.lazy(async () => {
253039
- const { SpatialWrapper: SpatialWrapper2 } = await import("./index-De5hOIAN.js");
253150
+ const { SpatialWrapper: SpatialWrapper2 } = await import("./index-S_FSh1nk.js");
253040
253151
  return { default: SpatialWrapper2 };
253041
253152
  });
253042
253153
  const SpatialThreeAdapter = React__default.forwardRef((props, ref2) => jsxRuntimeExports.jsx("div", { ref: ref2, style: { width: "100%", height: "100%" }, children: jsxRuntimeExports.jsx(ErrorBoundary, { children: jsxRuntimeExports.jsx(Suspense, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(LazySpatialThree, { ...props }) }) }) }));
253043
253154
  const LazySpatialAccelerated = React__default.lazy(async () => {
253044
- const { SpatialWrapper: SpatialWrapper2 } = await import("./index-CoLUuXiI.js");
253155
+ const { SpatialWrapper: SpatialWrapper2 } = await import("./index-BAP2AnIF.js");
253045
253156
  return { default: SpatialWrapper2 };
253046
253157
  });
253047
253158
  const SpatialAcceleratedAdapter = React__default.forwardRef((props, ref2) => jsxRuntimeExports.jsx("div", { ref: ref2, style: { width: "100%", height: "100%" }, children: jsxRuntimeExports.jsx(ErrorBoundary, { children: jsxRuntimeExports.jsx(Suspense, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(LazySpatialAccelerated, { ...props }) }) }) }));
@@ -253530,7 +253641,29 @@ function SpatialSubscriber(props) {
253530
253641
  target: [targetX2, targetY2, targetZ],
253531
253642
  rotationX,
253532
253643
  rotationOrbit
253533
- } : DEFAULT_VIEW_STATE, orbitAxis, spatialAxisFixed, setViewState: isValidViewState ? setViewState : SET_VIEW_STATE_NOOP, originalViewState, spatialRenderingMode, updateViewInfo: setComponentViewInfo, delegateHover, obsPoints: obsPointsData, pointLayerScopes, pointLayerCoordination, pointMultiObsLabels: pointMultiObsLabelsData, obsSpots: obsSpotsData, spotLayerScopes, spotLayerCoordination, obsSpotsSets: obsSpotsSetsData, spotMatrixIndices: spotMultiIndicesData, spotMultiExpressionData: spotMultiExpressionNormData, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, obsSegmentations: obsSegmentationsData, obsSegmentationsLocations: obsSegmentationsLocationsData, obsSegmentationsSets: obsSegmentationsSetsData, segmentationMatrixIndices: segmentationMultiIndicesData, segmentationMultiExpressionData: segmentationMultiExpressionNormData, bitmaskValueIsIndex, images: imageData, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination }), jsxRuntimeExports.jsx(
253644
+ } : DEFAULT_VIEW_STATE, orbitAxis, spatialAxisFixed, setViewState: isValidViewState ? setViewState : SET_VIEW_STATE_NOOP, originalViewState, spatialRenderingMode, updateViewInfo: setComponentViewInfo, delegateHover, obsPoints: obsPointsData, pointLayerScopes, pointLayerCoordination, pointMultiObsLabels: pointMultiObsLabelsData, obsSpots: obsSpotsData, spotLayerScopes, spotLayerCoordination, obsSpotsSets: obsSpotsSetsData, spotMatrixIndices: spotMultiIndicesData, spotMultiExpressionData: spotMultiExpressionNormData, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, obsSegmentations: obsSegmentationsData, obsSegmentationsLocations: obsSegmentationsLocationsData, obsSegmentationsSets: obsSegmentationsSetsData, segmentationMatrixIndices: segmentationMultiIndicesData, segmentationMultiExpressionData: segmentationMultiExpressionNormData, bitmaskValueIsIndex, images: imageData, imageLayerScopes, imageLayerCoordination, imageChannelScopesByLayer, imageChannelCoordination }), !disableTooltip && jsxRuntimeExports.jsx(SpatialTooltipSubscriber, {
253645
+ parentUuid: uuid2,
253646
+ width: width2,
253647
+ height: height2,
253648
+ hoverCoord,
253649
+ // Points
253650
+ obsPoints: obsPointsData,
253651
+ pointLayerScopes,
253652
+ pointLayerCoordination,
253653
+ // Spots
253654
+ obsSpots: obsSpotsData,
253655
+ spotLayerScopes,
253656
+ spotLayerCoordination,
253657
+ // Segmentations
253658
+ obsSegmentationsLocations: obsSegmentationsLocationsData,
253659
+ segmentationLayerScopes,
253660
+ segmentationChannelScopesByLayer,
253661
+ segmentationChannelCoordination,
253662
+ obsSegmentationsSetsData,
253663
+ // Images
253664
+ imageLayerScopes,
253665
+ imageLayerCoordination
253666
+ }), jsxRuntimeExports.jsx(
253534
253667
  MultiLegend,
253535
253668
  {
253536
253669
  // Fix to dark theme due to black background of spatial plot.
@@ -254365,11 +254498,11 @@ const Heatmap$1 = forwardRef$1((props, deckRef) => {
254365
254498
  });
254366
254499
  Heatmap$1.displayName = "Heatmap";
254367
254500
  function HeatmapTooltipSubscriber(props) {
254368
- const { parentUuid, width: width2, height: height2, transpose: transpose2, getObsInfo, getFeatureInfo, obsHighlight, featureHighlight, featureType, featureLabelsMap } = props;
254501
+ const { parentUuid, width: width2, height: height2, transpose: transpose2, getObsInfo: getObsInfo2, getFeatureInfo, obsHighlight, featureHighlight, featureType, featureLabelsMap } = props;
254369
254502
  const sourceUuid = useComponentHover();
254370
254503
  const viewInfo = useComponentViewInfo(parentUuid);
254371
- const [cellInfo, cellCoord] = obsHighlight && getObsInfo ? [
254372
- getObsInfo(obsHighlight),
254504
+ const [cellInfo, cellCoord] = obsHighlight && getObsInfo2 ? [
254505
+ getObsInfo2(obsHighlight),
254373
254506
  viewInfo && viewInfo.projectFromId ? viewInfo.projectFromId(obsHighlight, null)[transpose2 ? 0 : 1] : null
254374
254507
  ] : [null, null];
254375
254508
  const [geneInfo, geneCoord] = featureHighlight && getFeatureInfo ? [
@@ -254477,7 +254610,7 @@ function HeatmapSubscriber(props) {
254477
254610
  cellSetSelection,
254478
254611
  obsIndex
254479
254612
  ]);
254480
- const getObsInfo = useGetObsInfo(observationsLabel, obsLabelsTypes, obsLabelsData, obsSetsMembership);
254613
+ const getObsInfo2 = useGetObsInfo(observationsLabel, obsLabelsTypes, obsLabelsData, obsSetsMembership);
254481
254614
  const getObsMembership = useGetObsMembership(obsSetsMembership);
254482
254615
  const getFeatureInfo = useCallback((featureId2) => {
254483
254616
  if (featureId2) {
@@ -254517,7 +254650,7 @@ function HeatmapSubscriber(props) {
254517
254650
  setTargetY(target2[1]);
254518
254651
  }, colormapRange: geneExpressionColormapRange, setColormapRange: setGeneExpressionColormapRange, height: height2, width: width2, theme, uuid: uuid2, uint8ObsFeatureMatrix: uint8ObsFeatureMatrix?.data, cellColors, colormap: geneExpressionColormap, setIsRendering, setCellHighlight, setGeneHighlight, featureLabelsMap, obsIndex, featureIndex, setTrackHighlight, setComponentHover: () => {
254519
254652
  setComponentHover(uuid2);
254520
- }, updateViewInfo: setComponentViewInfo, observationsTitle, variablesTitle, variablesDashes: false, observationsDashes: false, cellColorLabels, useDevicePixels: true, onHeatmapClick, setColorEncoding: setHoveredColorEncoding }), tooltipsVisible && jsxRuntimeExports.jsx(HeatmapTooltipSubscriber, { parentUuid: uuid2, width: width2, height: height2, transpose: transpose2, getObsInfo, getFeatureInfo, obsHighlight: cellHighlight, featureHighlight: geneHighlight, featureType, featureLabelsMap }), jsxRuntimeExports.jsx(Legend, { visible: true, theme, featureType, featureValueType, obsColorEncoding: "geneExpression", considerSelections: false, featureSelection: geneSelection, obsSetSelection: cellSetSelection, featureValueColormap: geneExpressionColormap, featureValueColormapRange: geneExpressionColormapRange, extent: obsFeatureMatrixExtent })] });
254653
+ }, updateViewInfo: setComponentViewInfo, observationsTitle, variablesTitle, variablesDashes: false, observationsDashes: false, cellColorLabels, useDevicePixels: true, onHeatmapClick, setColorEncoding: setHoveredColorEncoding }), tooltipsVisible && jsxRuntimeExports.jsx(HeatmapTooltipSubscriber, { parentUuid: uuid2, width: width2, height: height2, transpose: transpose2, getObsInfo: getObsInfo2, getFeatureInfo, obsHighlight: cellHighlight, featureHighlight: geneHighlight, featureType, featureLabelsMap }), jsxRuntimeExports.jsx(Legend, { visible: true, theme, featureType, featureValueType, obsColorEncoding: "geneExpression", considerSelections: false, featureSelection: geneSelection, obsSetSelection: cellSetSelection, featureValueColormap: geneExpressionColormap, featureValueColormapRange: geneExpressionColormapRange, extent: obsFeatureMatrixExtent })] });
254521
254654
  }
254522
254655
  function _classCallCheck(a2, n3) {
254523
254656
  if (!(a2 instanceof n3)) throw new TypeError("Cannot call a class as a function");
@@ -265938,89 +266071,6 @@ function set_from_chunk_binary(dest, src, bytes_per_element2, projections2) {
265938
266071
  }, bytes_per_element2, projs);
265939
266072
  }
265940
266073
  }
265941
- function fetch_range(url, offset2, length2, opts2 = {}) {
265942
- if (offset2 !== void 0 && length2 !== void 0) {
265943
- opts2 = {
265944
- ...opts2,
265945
- headers: {
265946
- ...opts2.headers,
265947
- Range: `bytes=${offset2}-${offset2 + length2 - 1}`
265948
- }
265949
- };
265950
- }
265951
- return fetch(url, opts2);
265952
- }
265953
- function merge_init(storeOverrides, requestOverrides) {
265954
- return {
265955
- ...storeOverrides,
265956
- ...requestOverrides,
265957
- headers: {
265958
- ...storeOverrides.headers,
265959
- ...requestOverrides.headers
265960
- }
265961
- };
265962
- }
265963
- function resolve$1(root2, path2) {
265964
- const base2 = typeof root2 === "string" ? new URL(root2) : root2;
265965
- if (!base2.pathname.endsWith("/")) {
265966
- base2.pathname += "/";
265967
- }
265968
- const resolved = new URL(path2.slice(1), base2);
265969
- resolved.search = base2.search;
265970
- return resolved;
265971
- }
265972
- async function handle_response(response) {
265973
- if (response.status === 404) {
265974
- return void 0;
265975
- }
265976
- if (response.status === 200 || response.status === 206) {
265977
- return new Uint8Array(await response.arrayBuffer());
265978
- }
265979
- throw new Error(`Unexpected response status ${response.status} ${response.statusText}`);
265980
- }
265981
- async function fetch_suffix(url, suffix_length, init2, use_suffix_request) {
265982
- if (use_suffix_request) {
265983
- return fetch(url, {
265984
- ...init2,
265985
- headers: { ...init2.headers, Range: `bytes=-${suffix_length}` }
265986
- });
265987
- }
265988
- let response = await fetch(url, { ...init2, method: "HEAD" });
265989
- if (!response.ok) {
265990
- return response;
265991
- }
265992
- let content_length = response.headers.get("Content-Length");
265993
- let length2 = Number(content_length);
265994
- return fetch_range(url, length2 - suffix_length, length2, init2);
265995
- }
265996
- class FetchStore2 {
265997
- #overrides;
265998
- #use_suffix_request;
265999
- constructor(url, options = {}) {
266000
- this.url = url;
266001
- this.#overrides = options.overrides ?? {};
266002
- this.#use_suffix_request = options.useSuffixRequest ?? false;
266003
- }
266004
- #merge_init(overrides) {
266005
- return merge_init(this.#overrides, overrides);
266006
- }
266007
- async get(key2, options = {}) {
266008
- let href2 = resolve$1(this.url, key2).href;
266009
- let response = await fetch(href2, this.#merge_init(options));
266010
- return handle_response(response);
266011
- }
266012
- async getRange(key2, range2, options = {}) {
266013
- let url = resolve$1(this.url, key2);
266014
- let init2 = this.#merge_init(options);
266015
- let response;
266016
- if ("suffixLength" in range2) {
266017
- response = await fetch_suffix(url, range2.suffixLength, init2, this.#use_suffix_request);
266018
- } else {
266019
- response = await fetch_range(url, range2.offset, range2.length, init2);
266020
- }
266021
- return handle_response(response);
266022
- }
266023
- }
266024
266074
  function multivecChunksToTileDenseArray(chunks, tileShape, isRow) {
266025
266075
  const fullTileLength = isRow ? tileShape[1] : tileShape[0] * tileShape[1];
266026
266076
  const fullTileArray = new Float32Array(fullTileLength);
@@ -266066,7 +266116,7 @@ var ZarrMultivecDataFetcher = function ZarrMultivecDataFetcher2(HGC, ...args) {
266066
266116
  this.storeRoot = Promise.resolve(ZarrMultivecDataFetcher2.urlToStoreRoot[dataConfig.url]);
266067
266117
  } else if (dataConfig.url) {
266068
266118
  const { url, options = {} } = dataConfig;
266069
- this.store = new FetchStore2(url, options);
266119
+ this.store = new FetchStore(url, options);
266070
266120
  this.storeRoot = Promise.resolve(root(this.store));
266071
266121
  }
266072
266122
  if (dataConfig.row !== void 0) {
@@ -266242,7 +266292,7 @@ function HiglassGlobalStyles(props) {
266242
266292
  }
266243
266293
  register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
266244
266294
  const LazyHiGlassComponent = React__default.lazy(async () => {
266245
- const { HiGlassComponent } = await import("./higlass-DOnQ6srf.js");
266295
+ const { HiGlassComponent } = await import("./higlass-n5FnMrCn.js");
266246
266296
  return { default: HiGlassComponent };
266247
266297
  });
266248
266298
  const HG_SIZE = 800;
@@ -269189,7 +269239,7 @@ function NeuroglancerGlobalStyles(props) {
269189
269239
  const { classes: classes2 } = props;
269190
269240
  return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(GlobalStyles$3, { styles: globalNeuroglancerCss }), jsxRuntimeExports.jsx(ScopedGlobalStyles, { styles: globalNeuroglancerStyles, parentClassName: classes2.neuroglancerWrapper })] });
269191
269241
  }
269192
- const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-DLpKRSC5.js"));
269242
+ const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-Cd-eoVyU.js"));
269193
269243
  function createWorker() {
269194
269244
  return new WorkerFactory();
269195
269245
  }
@@ -354087,6 +354137,24 @@ class ObsLabelsCsvLoader extends CsvLoader {
354087
354137
  return this.cachedResult;
354088
354138
  }
354089
354139
  }
354140
+ class VitessceConfigViewHConcat {
354141
+ constructor(views) {
354142
+ this.views = views;
354143
+ }
354144
+ }
354145
+ class VitessceConfigViewVConcat {
354146
+ constructor(views) {
354147
+ this.views = views;
354148
+ }
354149
+ }
354150
+ function hconcat(...views) {
354151
+ const vcvhc = new VitessceConfigViewHConcat(views);
354152
+ return vcvhc;
354153
+ }
354154
+ function vconcat(...views) {
354155
+ const vcvvc = new VitessceConfigViewVConcat(views);
354156
+ return vcvvc;
354157
+ }
354090
354158
  class CoordinationLevel {
354091
354159
  constructor(value2) {
354092
354160
  this.value = value2;
@@ -354105,6 +354173,233 @@ class CoordinationLevel {
354105
354173
  function CL(value2) {
354106
354174
  return new CoordinationLevel(value2);
354107
354175
  }
354176
+ class AbstractAutoConfig {
354177
+ constructor(parsedStore) {
354178
+ const { url, fileType, zmetadata } = parsedStore;
354179
+ this.url = url;
354180
+ this.fileType = fileType;
354181
+ this.zmetadata = zmetadata;
354182
+ }
354183
+ // eslint-disable-next-line class-methods-use-this
354184
+ addFiles(vc, dataset) {
354185
+ throw new Error("The addFiles() method has not been implemented.");
354186
+ }
354187
+ // eslint-disable-next-line class-methods-use-this
354188
+ addViews(vc, dataset, layoutOption) {
354189
+ throw new Error("The addViews() method has not been implemented.");
354190
+ }
354191
+ }
354192
+ class AnnDataAutoConfig extends AbstractAutoConfig {
354193
+ getOptions() {
354194
+ const { zmetadata } = this;
354195
+ const options = {
354196
+ obsEmbedding: [],
354197
+ obsSets: []
354198
+ };
354199
+ zmetadata.forEach(({ path: path2, attrs }) => {
354200
+ const lowerPath = path2.toLowerCase();
354201
+ const relPath = path2.substring(1);
354202
+ if (["/x"].includes(lowerPath)) {
354203
+ options.obsFeatureMatrix = {
354204
+ path: relPath
354205
+ // TODO: Also check the shape of X.
354206
+ // If X is very large, try to initialize initial-filtering properties
354207
+ // (will require that /var contains a boolean column however.)
354208
+ };
354209
+ }
354210
+ if (["/obsm/x_spatial", "/obsm/spatial"].includes(lowerPath)) {
354211
+ options.obsLocations = {
354212
+ path: relPath
354213
+ };
354214
+ }
354215
+ if (["/obsm/x_umap", "/obsm/umap"].includes(lowerPath)) {
354216
+ options.obsEmbedding.push({ path: relPath, embeddingType: "UMAP" });
354217
+ }
354218
+ if (["/obsm/x_tsne", "/obsm/tsne"].includes(lowerPath)) {
354219
+ options.obsEmbedding.push({ path: relPath, embeddingType: "t-SNE" });
354220
+ }
354221
+ if (["/obsm/x_pca", "/obsm/pca"].includes(lowerPath)) {
354222
+ options.obsEmbedding.push({ path: relPath, embeddingType: "PCA" });
354223
+ }
354224
+ const supportedObsSetsPaths = [
354225
+ "cluster",
354226
+ "clusters",
354227
+ "subcluster",
354228
+ "cell_type",
354229
+ "celltype",
354230
+ "leiden",
354231
+ "louvain",
354232
+ "disease",
354233
+ "organism",
354234
+ "self_reported_ethnicity",
354235
+ "tissue",
354236
+ "sex"
354237
+ ].map((colname) => `/obs/${colname}`);
354238
+ if (supportedObsSetsPaths.includes(lowerPath)) {
354239
+ const name2 = relPath.split("/").at(-1);
354240
+ options.obsSets.push({ path: relPath, name: name2 });
354241
+ }
354242
+ });
354243
+ return options;
354244
+ }
354245
+ addFiles(vc, dataset) {
354246
+ const { url, fileType } = this;
354247
+ dataset.addFile({
354248
+ url,
354249
+ fileType,
354250
+ options: this.getOptions()
354251
+ // TODO: coordination values?
354252
+ });
354253
+ }
354254
+ // eslint-disable-next-line class-methods-use-this
354255
+ addViews(vc, dataset, layoutOption) {
354256
+ }
354257
+ }
354258
+ class SpatialDataAutoConfig extends AbstractAutoConfig {
354259
+ getOptions() {
354260
+ const { zmetadata } = this;
354261
+ const options = {};
354262
+ const availableElements = zmetadata.filter(({ path: path2 }) => {
354263
+ const relPath = path2.substring(1);
354264
+ return relPath.match(/^(tables|table|images|labels|shapes|points)\/([^/]*)$/);
354265
+ });
354266
+ availableElements.forEach(({ path: path2, attrs }) => {
354267
+ const relPath = path2.substring(1);
354268
+ const firstCoordinateSystem = attrs?.multiscales?.[0]?.coordinateTransformations?.[0]?.output?.name;
354269
+ if (relPath.match(/^(images)\/([^/]*)$/)) {
354270
+ options.image = {
354271
+ path: relPath,
354272
+ coordinateSystem: firstCoordinateSystem
354273
+ // TODO: support a fileUid property in the schema?
354274
+ };
354275
+ }
354276
+ if (relPath.match(/^(labels)\/([^/]*)$/)) {
354277
+ options.obsSegmentations = {
354278
+ path: relPath,
354279
+ coordinateSystem: firstCoordinateSystem
354280
+ // TODO: support a fileUid property in the schema?
354281
+ };
354282
+ }
354283
+ if (relPath.match(/^(shapes)\/([^/]*)$/)) {
354284
+ options.obsSpots = {
354285
+ path: relPath,
354286
+ coordinateSystem: firstCoordinateSystem
354287
+ };
354288
+ }
354289
+ if (relPath.match(/^(points)\/([^/]*)$/)) {
354290
+ options.obsPoints = {
354291
+ path: relPath,
354292
+ coordinateSystem: firstCoordinateSystem
354293
+ };
354294
+ }
354295
+ if (relPath.match(/^(tables|table)\/([^/]*)$/)) {
354296
+ const tableEls = zmetadata.filter(({ path: subpath }) => subpath.startsWith(path2));
354297
+ const hasX = tableEls.find((el) => el.path === `${path2}/X`);
354298
+ if (hasX) {
354299
+ options.obsFeatureMatrix = {
354300
+ path: hasX.path.substring(1)
354301
+ // region: null,
354302
+ };
354303
+ }
354304
+ const hasObs = tableEls.find((el) => el.path === `${path2}/obs`);
354305
+ if (hasObs) {
354306
+ const columnOrder = hasObs.attrs?.["column-order"];
354307
+ options.obsSets = {
354308
+ // region: null,
354309
+ tablePath: relPath,
354310
+ obsSets: columnOrder.map((c2) => ({
354311
+ // TODO: determine whether this column is string/categorical.
354312
+ // TODO: determine whether this column contains too many
354313
+ // categories to make sense to consider a cell set.
354314
+ path: `${hasObs.path.substring(1)}/${c2}`,
354315
+ name: c2
354316
+ }))
354317
+ };
354318
+ }
354319
+ }
354320
+ });
354321
+ return options;
354322
+ }
354323
+ addFiles(vc, dataset) {
354324
+ const { url, fileType } = this;
354325
+ dataset.addFile({
354326
+ url,
354327
+ fileType,
354328
+ options: this.getOptions()
354329
+ // TODO: coordination values?
354330
+ });
354331
+ }
354332
+ // eslint-disable-next-line class-methods-use-this
354333
+ addViews(vc, dataset, layoutOption) {
354334
+ const options = this.getOptions();
354335
+ const spatialView = vc.addView(dataset, "spatialBeta");
354336
+ const lcView = vc.addView(dataset, "layerControllerBeta");
354337
+ const controlViews = [lcView];
354338
+ if (options.obsSets) {
354339
+ const obsSets = vc.addView(dataset, "obsSets");
354340
+ controlViews.push(obsSets);
354341
+ }
354342
+ if (options.obsFeatureMatrix) {
354343
+ const featureList = vc.addView(dataset, "featureList");
354344
+ controlViews.push(featureList);
354345
+ }
354346
+ vc.layout(hconcat(spatialView, vconcat(...controlViews)));
354347
+ }
354348
+ }
354349
+ class OmeAutoConfig extends AbstractAutoConfig {
354350
+ addFiles(vc, dataset) {
354351
+ const { url, fileType } = this;
354352
+ dataset.addFile({
354353
+ url,
354354
+ fileType
354355
+ // TODO: options?
354356
+ // TODO: coordination values?
354357
+ });
354358
+ }
354359
+ // eslint-disable-next-line class-methods-use-this
354360
+ addViews(vc, dataset, layoutOption) {
354361
+ const spatialView = vc.addView(dataset, "spatialBeta");
354362
+ const lcView = vc.addView(dataset, "layerControllerBeta");
354363
+ vc.layout(hconcat(spatialView, lcView));
354364
+ }
354365
+ }
354366
+ ({
354367
+ [FileType$1.IMAGE_OME_TIFF]: [".ome.tif", ".ome.tiff", ".ome.tf2", ".ome.tf8"],
354368
+ [FileType$1.IMAGE_OME_ZARR]: [".ome.zarr"],
354369
+ [FileType$1.IMAGE_OME_ZARR_ZIP]: [".ome.zarr.zip"],
354370
+ [FileType$1.ANNDATA_ZARR]: [".ad.zarr", ".h5ad.zarr", ".adata.zarr", ".anndata.zarr"],
354371
+ [FileType$1.ANNDATA_ZARR_ZIP]: [".ad.zarr.zip", ".h5ad.zarr.zip", ".adata.zarr.zip", ".anndata.zarr.zip"],
354372
+ // TODO: how to handle h5ad-based AnnData (since needs reference JSON file).
354373
+ // Perhaps just assume one H5AD+one JSON (or .ref.json) file correspond to each other?
354374
+ [FileType$1.SPATIALDATA_ZARR]: [".sd.zarr", ".sdata.zarr", ".spatialdata.zarr"],
354375
+ [FileType$1.SPATIALDATA_ZARR_ZIP]: [".sd.zarr.zip", ".sdata.zarr.zip", ".spatialdata.zarr.zip"]
354376
+ });
354377
+ ({
354378
+ // OME-TIFF
354379
+ [FileType$1.IMAGE_OME_TIFF]: OmeAutoConfig,
354380
+ [FileType$1.OBS_SEGMENTATIONS_OME_TIFF]: OmeAutoConfig,
354381
+ // OME-Zarr
354382
+ [FileType$1.IMAGE_OME_ZARR]: OmeAutoConfig,
354383
+ [FileType$1.IMAGE_OME_ZARR_ZIP]: OmeAutoConfig,
354384
+ [FileType$1.OBS_SEGMENTATIONS_OME_ZARR]: OmeAutoConfig,
354385
+ [FileType$1.OBS_SEGMENTATIONS_OME_ZARR_ZIP]: OmeAutoConfig,
354386
+ // AnnData
354387
+ [FileType$1.ANNDATA_ZARR]: AnnDataAutoConfig,
354388
+ [FileType$1.ANNDATA_ZARR_ZIP]: AnnDataAutoConfig,
354389
+ // SpatialData
354390
+ [FileType$1.SPATIALDATA_ZARR]: SpatialDataAutoConfig,
354391
+ [FileType$1.SPATIALDATA_ZARR_ZIP]: SpatialDataAutoConfig
354392
+ });
354393
+ [
354394
+ FileType$1.ANNDATA_ZARR,
354395
+ FileType$1.ANNDATA_ZARR_ZIP,
354396
+ FileType$1.SPATIALDATA_ZARR,
354397
+ FileType$1.SPATIALDATA_ZARR_ZIP,
354398
+ FileType$1.IMAGE_OME_ZARR,
354399
+ FileType$1.IMAGE_OME_ZARR_ZIP,
354400
+ FileType$1.OBS_SEGMENTATIONS_OME_ZARR,
354401
+ FileType$1.OBS_SEGMENTATIONS_OME_ZARR_ZIP
354402
+ ];
354108
354403
  class ObsSpotsCsvLoader extends CsvLoader {
354109
354404
  loadFromCache(data2) {
354110
354405
  if (this.cachedResult) {
@@ -372946,6 +373241,36 @@ function getDataView(source2) {
372946
373241
  }
372947
373242
  return null;
372948
373243
  }
373244
+ function toFloat32Array(input) {
373245
+ if (input instanceof Float32Array) {
373246
+ return input;
373247
+ }
373248
+ if (input instanceof BigInt64Array) {
373249
+ const floats = new Float32Array(input.length);
373250
+ for (let i2 = 0; i2 < input.length; i2++) {
373251
+ floats[i2] = Number(input[i2]);
373252
+ }
373253
+ return floats;
373254
+ }
373255
+ if (input instanceof Float64Array) {
373256
+ return new Float32Array(input);
373257
+ }
373258
+ if (input instanceof Array) {
373259
+ return new Float32Array(input);
373260
+ }
373261
+ log$b.warn("toFloat32Array expected Float32Array, Float64Array, BigInt64Array, or Array input");
373262
+ return new Float32Array(input);
373263
+ }
373264
+ function downcastIfBigIntArray(input) {
373265
+ if (input instanceof BigInt64Array) {
373266
+ const downcasted = new Int32Array(input.length);
373267
+ for (let i2 = 0; i2 < input.length; i2++) {
373268
+ downcasted[i2] = Number(input[i2]);
373269
+ }
373270
+ return downcasted;
373271
+ }
373272
+ return input;
373273
+ }
372949
373274
  const shapesElementRegex = /^shapes\/([^/]*)$/;
372950
373275
  const shapesSubElementRegex = /^shapes\/([^/]*)\/(.*)$/;
372951
373276
  function getShapesElementPath(arrPath) {
@@ -372971,26 +373296,6 @@ function getParquetPath$1(arrPath) {
372971
373296
  }
372972
373297
  throw new Error(`Cannot determine parquet path for shapes array path: ${arrPath}`);
372973
373298
  }
372974
- function toFloat32Array(input) {
372975
- if (input instanceof Float32Array) {
372976
- return input;
372977
- }
372978
- if (input instanceof BigInt64Array) {
372979
- const floats = new Float32Array(input.length);
372980
- for (let i2 = 0; i2 < input.length; i2++) {
372981
- floats[i2] = Number(input[i2]);
372982
- }
372983
- return floats;
372984
- }
372985
- if (input instanceof Float64Array) {
372986
- return new Float32Array(input);
372987
- }
372988
- if (input instanceof Array) {
372989
- return new Float32Array(input);
372990
- }
372991
- log$b.warn("toFloat32Array expected Float32Array, Float64Array, BigInt64Array, or Array input");
372992
- return new Float32Array(input);
372993
- }
372994
373299
  class SpatialDataShapesSource extends SpatialDataTableSource {
372995
373300
  /**
372996
373301
  *
@@ -373078,11 +373383,17 @@ class SpatialDataShapesSource extends SpatialDataTableSource {
373078
373383
  _decodeWkbColumnFlat(geometryColumn) {
373079
373384
  const wkb = new WKB();
373080
373385
  const arr = geometryColumn.toArray();
373081
- return arr.map((geom) => (
373082
- /** @type {[number, number]} */
373083
- /** @type {any} */
373084
- wkb.readGeometry(geom).getFlatCoordinates()
373085
- ));
373386
+ return arr.map((geom) => {
373387
+ const coords = (
373388
+ /** @type {any} */
373389
+ wkb.readGeometry(geom).getFlatCoordinates()
373390
+ );
373391
+ const downcastedCoords = (
373392
+ /** @type {[number, number]} */
373393
+ coords.map((coord) => Number(coord))
373394
+ );
373395
+ return downcastedCoords;
373396
+ });
373086
373397
  }
373087
373398
  /**
373088
373399
  * Helper to decode WKB geometry column as nested coordinates (for polygons).
@@ -373099,7 +373410,12 @@ class SpatialDataShapesSource extends SpatialDataTableSource {
373099
373410
  /** @type {any} */
373100
373411
  wkb.readGeometry(geom).getCoordinates()
373101
373412
  );
373102
- return coords[0];
373413
+ const firstPolygon = coords[0];
373414
+ for (let i2 = 0; i2 < firstPolygon.length; i2++) {
373415
+ firstPolygon[i2] = /** @type {[number, number]} */
373416
+ firstPolygon[i2].map((coord) => Number(coord));
373417
+ }
373418
+ return firstPolygon;
373103
373419
  });
373104
373420
  }
373105
373421
  /**
@@ -373259,7 +373575,7 @@ class SpatialDataPointsSource extends SpatialDataTableSource {
373259
373575
  if (!column2) {
373260
373576
  throw new Error(`Column "${name2}" not found in the arrow table.`);
373261
373577
  }
373262
- return column2.toArray();
373578
+ return downcastIfBigIntArray(column2.toArray());
373263
373579
  });
373264
373580
  return {
373265
373581
  shape: [axisColumnArrs.length, arrowTable.numRows],