@vitessce/dev 3.3.1 → 3.3.3

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.
@@ -96,7 +96,9 @@ const FileType$2 = {
96
96
  OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
97
97
  OBS_SETS_CSV: "obsSets.csv",
98
98
  OBS_SETS_JSON: "obsSets.json",
99
+ // OME-Zarr
99
100
  IMAGE_OME_ZARR: "image.ome-zarr",
101
+ OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
100
102
  // AnnData
101
103
  OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
102
104
  OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
@@ -279,6 +281,7 @@ const STATUS$1 = {
279
281
  };
280
282
  const DATA_TYPE_COORDINATION_VALUE_USAGE = {
281
283
  [DataType$3.OBS_SEGMENTATIONS]: [
284
+ CoordinationType$2.FILE_UID,
282
285
  CoordinationType$2.OBS_TYPE
283
286
  ],
284
287
  [DataType$3.OBS_EMBEDDING]: [
@@ -310,7 +313,9 @@ const DATA_TYPE_COORDINATION_VALUE_USAGE = {
310
313
  CoordinationType$2.FEATURE_VALUE_TYPE
311
314
  ],
312
315
  [DataType$3.GENOMIC_PROFILES]: [],
313
- [DataType$3.IMAGE]: [],
316
+ [DataType$3.IMAGE]: [
317
+ CoordinationType$2.FILE_UID
318
+ ],
314
319
  [DataType$3.NEIGHBORHOODS]: []
315
320
  };
316
321
  const AUTO_INDEPENDENT_COORDINATION_TYPES = [
@@ -636,7 +641,9 @@ const COMPONENT_COORDINATION_TYPES = {
636
641
  CoordinationType$2.SPATIAL_SEGMENTATION_FILLED,
637
642
  CoordinationType$2.SPATIAL_SEGMENTATION_STROKE_WIDTH,
638
643
  CoordinationType$2.IMAGE_CHANNEL,
644
+ CoordinationType$2.IMAGE_LAYER,
639
645
  CoordinationType$2.SEGMENTATION_CHANNEL,
646
+ CoordinationType$2.SEGMENTATION_LAYER,
640
647
  CoordinationType$2.SPATIAL_CHANNEL_VISIBLE,
641
648
  CoordinationType$2.SPATIAL_CHANNEL_OPACITY,
642
649
  CoordinationType$2.SPATIAL_CHANNEL_WINDOW,
@@ -654,6 +661,9 @@ const COMPONENT_COORDINATION_TYPES = {
654
661
  CoordinationType$2.SPATIAL_SPOT_STROKE_WIDTH,
655
662
  CoordinationType$2.SPATIAL_LAYER_COLOR,
656
663
  CoordinationType$2.OBS_COLOR_ENCODING,
664
+ CoordinationType$2.FEATURE_VALUE_COLORMAP,
665
+ CoordinationType$2.FEATURE_VALUE_COLORMAP_RANGE,
666
+ CoordinationType$2.FEATURE_SELECTION,
657
667
  CoordinationType$2.TOOLTIPS_VISIBLE,
658
668
  CoordinationType$2.TOOLTIP_CROSSHAIRS_VISIBLE,
659
669
  CoordinationType$2.LEGEND_VISIBLE,
@@ -694,10 +704,10 @@ const COMPONENT_COORDINATION_TYPES = {
694
704
  ]
695
705
  };
696
706
  const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
697
- const version$6 = "3.3.1";
698
- const date$3 = "2023-11-08";
707
+ const version$6 = "3.3.3";
708
+ const date$3 = "2024-01-25";
699
709
  const branch = "changeset-release/main";
700
- const hash$1 = "8e897a20";
710
+ const hash$1 = "c2264756";
701
711
  const META_VERSION = {
702
712
  note,
703
713
  version: version$6,
@@ -1319,6 +1329,24 @@ function getNextScope(prevScopes) {
1319
1329
  } while (prevScopes.includes(nextScope));
1320
1330
  return nextScope;
1321
1331
  }
1332
+ function createPrefixedGetNextScopeNumeric(prefix2) {
1333
+ return (prevScopes) => {
1334
+ let nextScopeInt = 0;
1335
+ let nextScopeStr;
1336
+ do {
1337
+ nextScopeStr = `${prefix2}${nextScopeInt}`;
1338
+ nextScopeInt += 1;
1339
+ } while (prevScopes.includes(nextScopeStr));
1340
+ return nextScopeStr;
1341
+ };
1342
+ }
1343
+ function getInitialCoordinationScopePrefix(datasetUid, dataType) {
1344
+ return `init_${datasetUid}_${dataType}_`;
1345
+ }
1346
+ function getInitialCoordinationScopeName(datasetUid, dataType, i2 = null) {
1347
+ const prefix2 = getInitialCoordinationScopePrefix(datasetUid, dataType);
1348
+ return `${prefix2}${i2 === null ? 0 : i2}`;
1349
+ }
1322
1350
  const DEFAULT_DARK_COLOR = [50, 50, 50];
1323
1351
  const DEFAULT_LIGHT_COLOR$3 = [200, 200, 200];
1324
1352
  function getDefaultColor(theme) {
@@ -1460,12 +1488,12 @@ var root$l = freeGlobal$6 || freeSelf$3 || Function("return this")();
1460
1488
  const root$m = root$l;
1461
1489
  var Symbol$c = root$m.Symbol;
1462
1490
  const Symbol$d = Symbol$c;
1463
- var objectProto$I = Object.prototype;
1464
- var hasOwnProperty$B = objectProto$I.hasOwnProperty;
1465
- var nativeObjectToString$5 = objectProto$I.toString;
1491
+ var objectProto$H = Object.prototype;
1492
+ var hasOwnProperty$A = objectProto$H.hasOwnProperty;
1493
+ var nativeObjectToString$5 = objectProto$H.toString;
1466
1494
  var symToStringTag$5 = Symbol$d ? Symbol$d.toStringTag : void 0;
1467
1495
  function getRawTag$4(value2) {
1468
- var isOwn = hasOwnProperty$B.call(value2, symToStringTag$5), tag2 = value2[symToStringTag$5];
1496
+ var isOwn = hasOwnProperty$A.call(value2, symToStringTag$5), tag2 = value2[symToStringTag$5];
1469
1497
  try {
1470
1498
  value2[symToStringTag$5] = void 0;
1471
1499
  var unmasked = true;
@@ -1481,8 +1509,8 @@ function getRawTag$4(value2) {
1481
1509
  }
1482
1510
  return result;
1483
1511
  }
1484
- var objectProto$H = Object.prototype;
1485
- var nativeObjectToString$4 = objectProto$H.toString;
1512
+ var objectProto$G = Object.prototype;
1513
+ var nativeObjectToString$4 = objectProto$G.toString;
1486
1514
  function objectToString$5(value2) {
1487
1515
  return nativeObjectToString$4.call(value2);
1488
1516
  }
@@ -1595,12 +1623,12 @@ var maskSrcKey$2 = function() {
1595
1623
  function isMasked$4(func) {
1596
1624
  return !!maskSrcKey$2 && maskSrcKey$2 in func;
1597
1625
  }
1598
- var funcProto$7 = Function.prototype;
1599
- var funcToString$7 = funcProto$7.toString;
1626
+ var funcProto$6 = Function.prototype;
1627
+ var funcToString$6 = funcProto$6.toString;
1600
1628
  function toSource$6(func) {
1601
1629
  if (func != null) {
1602
1630
  try {
1603
- return funcToString$7.call(func);
1631
+ return funcToString$6.call(func);
1604
1632
  } catch (e3) {
1605
1633
  }
1606
1634
  try {
@@ -1612,11 +1640,11 @@ function toSource$6(func) {
1612
1640
  }
1613
1641
  var reRegExpChar$2 = /[\\^$.*+?()[\]{}|]/g;
1614
1642
  var reIsHostCtor$2 = /^\[object .+?Constructor\]$/;
1615
- var funcProto$6 = Function.prototype, objectProto$G = Object.prototype;
1616
- var funcToString$6 = funcProto$6.toString;
1617
- var hasOwnProperty$A = objectProto$G.hasOwnProperty;
1643
+ var funcProto$5 = Function.prototype, objectProto$F = Object.prototype;
1644
+ var funcToString$5 = funcProto$5.toString;
1645
+ var hasOwnProperty$z = objectProto$F.hasOwnProperty;
1618
1646
  var reIsNative$2 = RegExp(
1619
- "^" + funcToString$6.call(hasOwnProperty$A).replace(reRegExpChar$2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1647
+ "^" + funcToString$5.call(hasOwnProperty$z).replace(reRegExpChar$2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1620
1648
  );
1621
1649
  function baseIsNative$4(value2) {
1622
1650
  if (!isObject$l(value2) || isMasked$4(value2)) {
@@ -1776,11 +1804,11 @@ function baseAssignValue$4(object2, key2, value2) {
1776
1804
  function eq$e(value2, other) {
1777
1805
  return value2 === other || value2 !== value2 && other !== other;
1778
1806
  }
1779
- var objectProto$F = Object.prototype;
1780
- var hasOwnProperty$z = objectProto$F.hasOwnProperty;
1807
+ var objectProto$E = Object.prototype;
1808
+ var hasOwnProperty$y = objectProto$E.hasOwnProperty;
1781
1809
  function assignValue$3(object2, key2, value2) {
1782
1810
  var objValue = object2[key2];
1783
- if (!(hasOwnProperty$z.call(object2, key2) && eq$e(objValue, value2)) || value2 === void 0 && !(key2 in object2)) {
1811
+ if (!(hasOwnProperty$y.call(object2, key2) && eq$e(objValue, value2)) || value2 === void 0 && !(key2 in object2)) {
1784
1812
  baseAssignValue$4(object2, key2, value2);
1785
1813
  }
1786
1814
  }
@@ -1839,27 +1867,9 @@ function isIterateeCall$2(value2, index2, object2) {
1839
1867
  }
1840
1868
  return false;
1841
1869
  }
1842
- function createAssigner$2(assigner) {
1843
- return baseRest$2(function(object2, sources) {
1844
- var index2 = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0;
1845
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0;
1846
- if (guard && isIterateeCall$2(sources[0], sources[1], guard)) {
1847
- customizer = length2 < 3 ? void 0 : customizer;
1848
- length2 = 1;
1849
- }
1850
- object2 = Object(object2);
1851
- while (++index2 < length2) {
1852
- var source2 = sources[index2];
1853
- if (source2) {
1854
- assigner(object2, source2, index2, customizer);
1855
- }
1856
- }
1857
- return object2;
1858
- });
1859
- }
1860
- var objectProto$E = Object.prototype;
1870
+ var objectProto$D = Object.prototype;
1861
1871
  function isPrototype$6(value2) {
1862
- var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$E;
1872
+ var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$D;
1863
1873
  return value2 === proto;
1864
1874
  }
1865
1875
  function baseTimes$4(n3, iteratee) {
@@ -1873,13 +1883,13 @@ var argsTag$a = "[object Arguments]";
1873
1883
  function baseIsArguments$4(value2) {
1874
1884
  return isObjectLike$h(value2) && baseGetTag$d(value2) == argsTag$a;
1875
1885
  }
1876
- var objectProto$D = Object.prototype;
1877
- var hasOwnProperty$y = objectProto$D.hasOwnProperty;
1878
- var propertyIsEnumerable$5 = objectProto$D.propertyIsEnumerable;
1886
+ var objectProto$C = Object.prototype;
1887
+ var hasOwnProperty$x = objectProto$C.hasOwnProperty;
1888
+ var propertyIsEnumerable$5 = objectProto$C.propertyIsEnumerable;
1879
1889
  var isArguments$7 = baseIsArguments$4(function() {
1880
1890
  return arguments;
1881
1891
  }()) ? baseIsArguments$4 : function(value2) {
1882
- return isObjectLike$h(value2) && hasOwnProperty$y.call(value2, "callee") && !propertyIsEnumerable$5.call(value2, "callee");
1892
+ return isObjectLike$h(value2) && hasOwnProperty$x.call(value2, "callee") && !propertyIsEnumerable$5.call(value2, "callee");
1883
1893
  };
1884
1894
  const isArguments$8 = isArguments$7;
1885
1895
  function stubFalse$2() {
@@ -1892,11 +1902,11 @@ var Buffer$3 = moduleExports$2 ? root$m.Buffer : void 0;
1892
1902
  var nativeIsBuffer = Buffer$3 ? Buffer$3.isBuffer : void 0;
1893
1903
  var isBuffer$9 = nativeIsBuffer || stubFalse$2;
1894
1904
  const isBuffer$a = isBuffer$9;
1895
- var argsTag$9 = "[object Arguments]", arrayTag$7 = "[object Array]", boolTag$9 = "[object Boolean]", dateTag$9 = "[object Date]", errorTag$7 = "[object Error]", funcTag$6 = "[object Function]", mapTag$e = "[object Map]", numberTag$9 = "[object Number]", objectTag$c = "[object Object]", regexpTag$9 = "[object RegExp]", setTag$e = "[object Set]", stringTag$a = "[object String]", weakMapTag$7 = "[object WeakMap]";
1905
+ var argsTag$9 = "[object Arguments]", arrayTag$7 = "[object Array]", boolTag$9 = "[object Boolean]", dateTag$9 = "[object Date]", errorTag$7 = "[object Error]", funcTag$6 = "[object Function]", mapTag$e = "[object Map]", numberTag$9 = "[object Number]", objectTag$b = "[object Object]", regexpTag$9 = "[object RegExp]", setTag$e = "[object Set]", stringTag$a = "[object String]", weakMapTag$7 = "[object WeakMap]";
1896
1906
  var arrayBufferTag$9 = "[object ArrayBuffer]", dataViewTag$c = "[object DataView]", float32Tag$6 = "[object Float32Array]", float64Tag$6 = "[object Float64Array]", int8Tag$6 = "[object Int8Array]", int16Tag$6 = "[object Int16Array]", int32Tag$6 = "[object Int32Array]", uint8Tag$6 = "[object Uint8Array]", uint8ClampedTag$6 = "[object Uint8ClampedArray]", uint16Tag$6 = "[object Uint16Array]", uint32Tag$6 = "[object Uint32Array]";
1897
1907
  var typedArrayTags$2 = {};
1898
1908
  typedArrayTags$2[float32Tag$6] = typedArrayTags$2[float64Tag$6] = typedArrayTags$2[int8Tag$6] = typedArrayTags$2[int16Tag$6] = typedArrayTags$2[int32Tag$6] = typedArrayTags$2[uint8Tag$6] = typedArrayTags$2[uint8ClampedTag$6] = typedArrayTags$2[uint16Tag$6] = typedArrayTags$2[uint32Tag$6] = true;
1899
- typedArrayTags$2[argsTag$9] = typedArrayTags$2[arrayTag$7] = typedArrayTags$2[arrayBufferTag$9] = typedArrayTags$2[boolTag$9] = typedArrayTags$2[dataViewTag$c] = typedArrayTags$2[dateTag$9] = typedArrayTags$2[errorTag$7] = typedArrayTags$2[funcTag$6] = typedArrayTags$2[mapTag$e] = typedArrayTags$2[numberTag$9] = typedArrayTags$2[objectTag$c] = typedArrayTags$2[regexpTag$9] = typedArrayTags$2[setTag$e] = typedArrayTags$2[stringTag$a] = typedArrayTags$2[weakMapTag$7] = false;
1909
+ typedArrayTags$2[argsTag$9] = typedArrayTags$2[arrayTag$7] = typedArrayTags$2[arrayBufferTag$9] = typedArrayTags$2[boolTag$9] = typedArrayTags$2[dataViewTag$c] = typedArrayTags$2[dateTag$9] = typedArrayTags$2[errorTag$7] = typedArrayTags$2[funcTag$6] = typedArrayTags$2[mapTag$e] = typedArrayTags$2[numberTag$9] = typedArrayTags$2[objectTag$b] = typedArrayTags$2[regexpTag$9] = typedArrayTags$2[setTag$e] = typedArrayTags$2[stringTag$a] = typedArrayTags$2[weakMapTag$7] = false;
1900
1910
  function baseIsTypedArray$4(value2) {
1901
1911
  return isObjectLike$h(value2) && isLength$7(value2.length) && !!typedArrayTags$2[baseGetTag$d(value2)];
1902
1912
  }
@@ -1923,12 +1933,12 @@ const nodeUtil$5 = nodeUtil$4;
1923
1933
  var nodeIsTypedArray$2 = nodeUtil$5 && nodeUtil$5.isTypedArray;
1924
1934
  var isTypedArray$7 = nodeIsTypedArray$2 ? baseUnary$6(nodeIsTypedArray$2) : baseIsTypedArray$4;
1925
1935
  const isTypedArray$8 = isTypedArray$7;
1926
- var objectProto$C = Object.prototype;
1927
- var hasOwnProperty$x = objectProto$C.hasOwnProperty;
1936
+ var objectProto$B = Object.prototype;
1937
+ var hasOwnProperty$w = objectProto$B.hasOwnProperty;
1928
1938
  function arrayLikeKeys$5(value2, inherited) {
1929
1939
  var isArr = isArray$l(value2), isArg = !isArr && isArguments$8(value2), isBuff = !isArr && !isArg && isBuffer$a(value2), isType = !isArr && !isArg && !isBuff && isTypedArray$8(value2), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes$4(value2.length, String) : [], length2 = result.length;
1930
1940
  for (var key2 in value2) {
1931
- if ((inherited || hasOwnProperty$x.call(value2, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
1941
+ if ((inherited || hasOwnProperty$w.call(value2, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
1932
1942
  (key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1933
1943
  isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1934
1944
  isType && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties.
@@ -1945,15 +1955,15 @@ function overArg$5(func, transform4) {
1945
1955
  }
1946
1956
  var nativeKeys$4 = overArg$5(Object.keys, Object);
1947
1957
  const nativeKeys$5 = nativeKeys$4;
1948
- var objectProto$B = Object.prototype;
1949
- var hasOwnProperty$w = objectProto$B.hasOwnProperty;
1958
+ var objectProto$A = Object.prototype;
1959
+ var hasOwnProperty$v = objectProto$A.hasOwnProperty;
1950
1960
  function baseKeys$4(object2) {
1951
1961
  if (!isPrototype$6(object2)) {
1952
1962
  return nativeKeys$5(object2);
1953
1963
  }
1954
1964
  var result = [];
1955
1965
  for (var key2 in Object(object2)) {
1956
- if (hasOwnProperty$w.call(object2, key2) && key2 != "constructor") {
1966
+ if (hasOwnProperty$v.call(object2, key2) && key2 != "constructor") {
1957
1967
  result.push(key2);
1958
1968
  }
1959
1969
  }
@@ -1971,15 +1981,15 @@ function nativeKeysIn$2(object2) {
1971
1981
  }
1972
1982
  return result;
1973
1983
  }
1974
- var objectProto$A = Object.prototype;
1975
- var hasOwnProperty$v = objectProto$A.hasOwnProperty;
1984
+ var objectProto$z = Object.prototype;
1985
+ var hasOwnProperty$u = objectProto$z.hasOwnProperty;
1976
1986
  function baseKeysIn$2(object2) {
1977
1987
  if (!isObject$l(object2)) {
1978
1988
  return nativeKeysIn$2(object2);
1979
1989
  }
1980
1990
  var isProto = isPrototype$6(object2), result = [];
1981
1991
  for (var key2 in object2) {
1982
- if (!(key2 == "constructor" && (isProto || !hasOwnProperty$v.call(object2, key2)))) {
1992
+ if (!(key2 == "constructor" && (isProto || !hasOwnProperty$u.call(object2, key2)))) {
1983
1993
  result.push(key2);
1984
1994
  }
1985
1995
  }
@@ -2011,21 +2021,21 @@ function hashDelete$4(key2) {
2011
2021
  return result;
2012
2022
  }
2013
2023
  var HASH_UNDEFINED$8 = "__lodash_hash_undefined__";
2014
- var objectProto$z = Object.prototype;
2015
- var hasOwnProperty$u = objectProto$z.hasOwnProperty;
2024
+ var objectProto$y = Object.prototype;
2025
+ var hasOwnProperty$t = objectProto$y.hasOwnProperty;
2016
2026
  function hashGet$4(key2) {
2017
2027
  var data2 = this.__data__;
2018
2028
  if (nativeCreate$b) {
2019
2029
  var result = data2[key2];
2020
2030
  return result === HASH_UNDEFINED$8 ? void 0 : result;
2021
2031
  }
2022
- return hasOwnProperty$u.call(data2, key2) ? data2[key2] : void 0;
2032
+ return hasOwnProperty$t.call(data2, key2) ? data2[key2] : void 0;
2023
2033
  }
2024
- var objectProto$y = Object.prototype;
2025
- var hasOwnProperty$t = objectProto$y.hasOwnProperty;
2034
+ var objectProto$x = Object.prototype;
2035
+ var hasOwnProperty$s = objectProto$x.hasOwnProperty;
2026
2036
  function hashHas$4(key2) {
2027
2037
  var data2 = this.__data__;
2028
- return nativeCreate$b ? data2[key2] !== void 0 : hasOwnProperty$t.call(data2, key2);
2038
+ return nativeCreate$b ? data2[key2] !== void 0 : hasOwnProperty$s.call(data2, key2);
2029
2039
  }
2030
2040
  var HASH_UNDEFINED$7 = "__lodash_hash_undefined__";
2031
2041
  function hashSet$4(key2, value2) {
@@ -2263,22 +2273,6 @@ function flatRest(func) {
2263
2273
  }
2264
2274
  var getPrototype$4 = overArg$5(Object.getPrototypeOf, Object);
2265
2275
  const getPrototype$5 = getPrototype$4;
2266
- var objectTag$b = "[object Object]";
2267
- var funcProto$5 = Function.prototype, objectProto$x = Object.prototype;
2268
- var funcToString$5 = funcProto$5.toString;
2269
- var hasOwnProperty$s = objectProto$x.hasOwnProperty;
2270
- var objectCtorString$1 = funcToString$5.call(Object);
2271
- function isPlainObject$5(value2) {
2272
- if (!isObjectLike$h(value2) || baseGetTag$d(value2) != objectTag$b) {
2273
- return false;
2274
- }
2275
- var proto = getPrototype$5(value2);
2276
- if (proto === null) {
2277
- return true;
2278
- }
2279
- var Ctor = hasOwnProperty$s.call(proto, "constructor") && proto.constructor;
2280
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString$5.call(Ctor) == objectCtorString$1;
2281
- }
2282
2276
  function baseClamp(number2, lower2, upper) {
2283
2277
  if (number2 === number2) {
2284
2278
  if (upper !== void 0) {
@@ -3069,86 +3063,9 @@ function debounce$5(func, wait2, options) {
3069
3063
  debounced.flush = flush2;
3070
3064
  return debounced;
3071
3065
  }
3072
- function assignMergeValue$3(object2, key2, value2) {
3073
- if (value2 !== void 0 && !eq$e(object2[key2], value2) || value2 === void 0 && !(key2 in object2)) {
3074
- baseAssignValue$4(object2, key2, value2);
3075
- }
3076
- }
3077
3066
  function isArrayLikeObject$2(value2) {
3078
3067
  return isObjectLike$h(value2) && isArrayLike$9(value2);
3079
3068
  }
3080
- function safeGet$3(object2, key2) {
3081
- if (key2 === "constructor" && typeof object2[key2] === "function") {
3082
- return;
3083
- }
3084
- if (key2 == "__proto__") {
3085
- return;
3086
- }
3087
- return object2[key2];
3088
- }
3089
- function toPlainObject$2(value2) {
3090
- return copyObject$6(value2, keysIn$6(value2));
3091
- }
3092
- function baseMergeDeep$2(object2, source2, key2, srcIndex, mergeFunc, customizer, stack2) {
3093
- var objValue = safeGet$3(object2, key2), srcValue = safeGet$3(source2, key2), stacked = stack2.get(srcValue);
3094
- if (stacked) {
3095
- assignMergeValue$3(object2, key2, stacked);
3096
- return;
3097
- }
3098
- var newValue = customizer ? customizer(objValue, srcValue, key2 + "", object2, source2, stack2) : void 0;
3099
- var isCommon = newValue === void 0;
3100
- if (isCommon) {
3101
- var isArr = isArray$l(srcValue), isBuff = !isArr && isBuffer$a(srcValue), isTyped = !isArr && !isBuff && isTypedArray$8(srcValue);
3102
- newValue = srcValue;
3103
- if (isArr || isBuff || isTyped) {
3104
- if (isArray$l(objValue)) {
3105
- newValue = objValue;
3106
- } else if (isArrayLikeObject$2(objValue)) {
3107
- newValue = copyArray$3(objValue);
3108
- } else if (isBuff) {
3109
- isCommon = false;
3110
- newValue = cloneBuffer$2(srcValue, true);
3111
- } else if (isTyped) {
3112
- isCommon = false;
3113
- newValue = cloneTypedArray$3(srcValue, true);
3114
- } else {
3115
- newValue = [];
3116
- }
3117
- } else if (isPlainObject$5(srcValue) || isArguments$8(srcValue)) {
3118
- newValue = objValue;
3119
- if (isArguments$8(objValue)) {
3120
- newValue = toPlainObject$2(objValue);
3121
- } else if (!isObject$l(objValue) || isFunction$b(objValue)) {
3122
- newValue = initCloneObject$3(srcValue);
3123
- }
3124
- } else {
3125
- isCommon = false;
3126
- }
3127
- }
3128
- if (isCommon) {
3129
- stack2.set(srcValue, newValue);
3130
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
3131
- stack2["delete"](srcValue);
3132
- }
3133
- assignMergeValue$3(object2, key2, newValue);
3134
- }
3135
- function baseMerge$2(object2, source2, srcIndex, customizer, stack2) {
3136
- if (object2 === source2) {
3137
- return;
3138
- }
3139
- baseFor$4(source2, function(srcValue, key2) {
3140
- stack2 || (stack2 = new Stack$8());
3141
- if (isObject$l(srcValue)) {
3142
- baseMergeDeep$2(object2, source2, key2, srcIndex, baseMerge$2, customizer, stack2);
3143
- } else {
3144
- var newValue = customizer ? customizer(safeGet$3(object2, key2), srcValue, key2 + "", object2, source2, stack2) : void 0;
3145
- if (newValue === void 0) {
3146
- newValue = srcValue;
3147
- }
3148
- assignMergeValue$3(object2, key2, newValue);
3149
- }
3150
- }, keysIn$6);
3151
- }
3152
3069
  function arrayIncludesWith(array2, value2, comparator2) {
3153
3070
  var index2 = -1, length2 = array2 == null ? 0 : array2.length;
3154
3071
  while (++index2 < length2) {
@@ -3240,10 +3157,6 @@ function baseSum(array2, iteratee) {
3240
3157
  }
3241
3158
  return result;
3242
3159
  }
3243
- var merge$7 = createAssigner$2(function(object2, source2, srcIndex) {
3244
- baseMerge$2(object2, source2, srcIndex);
3245
- });
3246
- const merge$8 = merge$7;
3247
3160
  function baseSet(object2, path2, value2, customizer) {
3248
3161
  if (!isObject$l(object2)) {
3249
3162
  return object2;
@@ -11791,13 +11704,22 @@ const imageOmeTiffSchema = z.object({
11791
11704
  offsetsUrl: z.string().optional(),
11792
11705
  coordinateTransformations: omeCoordinateTransformations.optional()
11793
11706
  });
11707
+ const obsSegmentationsOmeTiffSchema = imageOmeTiffSchema.extend({
11708
+ obsTypesFromChannelNames: z.boolean().optional()
11709
+ });
11794
11710
  const imageOmeZarrSchema = z.object({
11795
11711
  coordinateTransformations: omeCoordinateTransformations.optional()
11796
11712
  });
11713
+ const obsSegmentationsOmeZarrSchema = imageOmeZarrSchema.extend({
11714
+ obsTypesFromChannelNames: z.boolean().optional()
11715
+ });
11797
11716
  const imageSpatialdataSchema = imageOmeZarrSchema.extend({
11798
11717
  path: z.string()
11799
11718
  });
11800
11719
  const obsSegmentationsSpatialdataSchema = z.object({
11720
+ // TODO: should this also extend the imageOmeZarrSchema?
11721
+ // TODO: should this be renamed labelsSpatialdataSchema?
11722
+ // TODO: support obsTypesFromChannelNames?
11801
11723
  path: z.string()
11802
11724
  });
11803
11725
  z.object({
@@ -11882,6 +11804,19 @@ const anndataZarrSchema = z.object({
11882
11804
  z.array(annDataConvenienceObsEmbeddingItem)
11883
11805
  ])
11884
11806
  }).partial();
11807
+ const spatialdataZarrSchema = z.object({
11808
+ // TODO: should `image` be a special schema
11809
+ // to allow specifying fileUid (like for embeddingType)?
11810
+ image: imageSpatialdataSchema,
11811
+ // TODO: should this be a special schema
11812
+ // to allow specifying fileUid (like for embeddingType)?
11813
+ labels: obsSegmentationsSpatialdataSchema,
11814
+ obsFeatureMatrix: obsFeatureMatrixSpatialdataSchema,
11815
+ obsSpots: obsSpotsSpatialdataSchema,
11816
+ // TODO: obsPoints
11817
+ // TODO: obsLocations
11818
+ obsSets: obsSetsSpatialdataSchema
11819
+ }).partial();
11885
11820
  const cellsJsonSchema = z.object({
11886
11821
  obsLabelsTypes: z.array(z.string()).optional(),
11887
11822
  embeddingTypes: z.array(z.string()).optional()
@@ -19719,11 +19654,12 @@ class VitessceConfigCoordinationScope {
19719
19654
  * Construct a new coordination scope instance.
19720
19655
  * @param {string} cType The coordination type for this coordination scope.
19721
19656
  * @param {string} cScope The name of the coordination scope.
19657
+ * @param {[any]} cValue Optional. The coordination value of the coordination scope.
19722
19658
  */
19723
- constructor(cType, cScope) {
19659
+ constructor(cType, cScope, cValue = null) {
19724
19660
  this.cType = cType;
19725
19661
  this.cScope = cScope;
19726
- this.cValue = null;
19662
+ this.cValue = cValue;
19727
19663
  }
19728
19664
  /**
19729
19665
  * Set the coordination value of the coordination scope.
@@ -19820,6 +19756,7 @@ class VitessceConfig {
19820
19756
  layout: [],
19821
19757
  initStrategy: "auto"
19822
19758
  };
19759
+ this.getNextScope = getNextScope;
19823
19760
  }
19824
19761
  /**
19825
19762
  * Add a new dataset to the config.
@@ -19833,7 +19770,7 @@ class VitessceConfig {
19833
19770
  addDataset(name2 = void 0, description2 = void 0, options = void 0) {
19834
19771
  const { uid: uid2 } = options || {};
19835
19772
  const prevDatasetUids = this.config.datasets.map((d) => d.dataset.uid);
19836
- const nextUid = uid2 || getNextScope(prevDatasetUids);
19773
+ const nextUid = uid2 || this.getNextScope(prevDatasetUids);
19837
19774
  const newDataset = new VitessceConfigDataset(nextUid, name2, description2);
19838
19775
  this.config.datasets.push(newDataset);
19839
19776
  const [newScope] = this.addCoordination(CoordinationType$2.DATASET);
@@ -19886,7 +19823,7 @@ class VitessceConfig {
19886
19823
  const result = [];
19887
19824
  cTypes.forEach((cType) => {
19888
19825
  const prevScopes = this.config.coordinationSpace[cType] ? Object.keys(this.config.coordinationSpace[cType]) : [];
19889
- const scope = new VitessceConfigCoordinationScope(cType, getNextScope(prevScopes));
19826
+ const scope = new VitessceConfigCoordinationScope(cType, this.getNextScope(prevScopes));
19890
19827
  if (!this.config.coordinationSpace[scope.cType]) {
19891
19828
  this.config.coordinationSpace[scope.cType] = {};
19892
19829
  }
@@ -19903,7 +19840,7 @@ class VitessceConfig {
19903
19840
  addMetaCoordination() {
19904
19841
  const prevMetaScopes = this.config.coordinationSpace[CoordinationType$2.META_COORDINATION_SCOPES] ? Object.keys(this.config.coordinationSpace[CoordinationType$2.META_COORDINATION_SCOPES]) : [];
19905
19842
  const prevMetaByScopes = this.config.coordinationSpace[CoordinationType$2.META_COORDINATION_SCOPES_BY] ? Object.keys(this.config.coordinationSpace[CoordinationType$2.META_COORDINATION_SCOPES_BY]) : [];
19906
- const metaContainer = new VitessceConfigMetaCoordinationScope(getNextScope(prevMetaScopes), getNextScope(prevMetaByScopes));
19843
+ const metaContainer = new VitessceConfigMetaCoordinationScope(this.getNextScope(prevMetaScopes), this.getNextScope(prevMetaByScopes));
19907
19844
  if (!this.config.coordinationSpace[CoordinationType$2.META_COORDINATION_SCOPES]) {
19908
19845
  this.config.coordinationSpace[CoordinationType$2.META_COORDINATION_SCOPES] = {};
19909
19846
  }
@@ -19930,6 +19867,9 @@ class VitessceConfig {
19930
19867
  addCoordinationByObject(input) {
19931
19868
  const processLevel = (level) => {
19932
19869
  const result = {};
19870
+ if (level === null) {
19871
+ return result;
19872
+ }
19933
19873
  Object.entries(level).forEach(([cType, nextLevelOrInitialValue]) => {
19934
19874
  if (nextLevelOrInitialValue instanceof CoordinationLevel) {
19935
19875
  const nextLevel = nextLevelOrInitialValue.value;
@@ -20004,10 +19944,18 @@ class VitessceConfig {
20004
19944
  * instance, or a `CoordinationLevel` instance.
20005
19945
  * The CL function takes an array of objects as its argument, and returns a CoordinationLevel
20006
19946
  * instance, to support nesting.
20007
- * @param {boolean} meta Should meta-coordination be used? Optional. By default, true.
19947
+ * @param {object|null} options
19948
+ * @param {bool} options.meta Should meta-coordination be used? Optional.
19949
+ * By default, true.
19950
+ * @param {string|null} options.scopePrefix A prefix to add to all
19951
+ * coordination scope names. Optional.
20008
19952
  * @returns {VitessceConfig} This, to allow chaining.
20009
19953
  */
20010
- linkViewsByObject(views, input, meta2 = true) {
19954
+ linkViewsByObject(views, input, options = null) {
19955
+ const { meta: meta2 = true, scopePrefix = null } = options || {};
19956
+ if (scopePrefix) {
19957
+ this.getNextScope = createPrefixedGetNextScopeNumeric(scopePrefix);
19958
+ }
20011
19959
  const scopes = this.addCoordinationByObject(input);
20012
19960
  if (meta2) {
20013
19961
  const metaScope = this.addMetaCoordination();
@@ -20020,8 +19968,28 @@ class VitessceConfig {
20020
19968
  view.useCoordinationByObject(scopes);
20021
19969
  });
20022
19970
  }
19971
+ if (scopePrefix) {
19972
+ this.getNextScope = getNextScope;
19973
+ }
20023
19974
  return this;
20024
19975
  }
19976
+ /**
19977
+ * Set the value for a coordination scope.
19978
+ * If a coordination object for the coordination type does not yet exist
19979
+ * in the coordination space, it will be created.
19980
+ * @param {string} cType The coordination type.
19981
+ * @param {string} cScope The coordination scope.
19982
+ * @param {any} cValue The initial value for the coordination scope.
19983
+ * @returns {VitessceConfigCoordinationScope} A coordination scope instance.
19984
+ */
19985
+ setCoordinationValue(cType, cScope, cValue) {
19986
+ const scope = new VitessceConfigCoordinationScope(cType, cScope, cValue);
19987
+ if (!this.config.coordinationSpace[scope.cType]) {
19988
+ this.config.coordinationSpace[scope.cType] = {};
19989
+ }
19990
+ this.config.coordinationSpace[scope.cType][scope.cScope] = scope;
19991
+ return scope;
19992
+ }
20025
19993
  /**
20026
19994
  * Set the layout of views.
20027
19995
  * @param {VitessceConfigView|VitessceConfigViewHConcat|VitessceConfigViewVConcat} viewConcat A
@@ -20108,6 +20076,22 @@ class VitessceConfig {
20108
20076
  return vc;
20109
20077
  }
20110
20078
  }
20079
+ function getCoordinationSpaceAndScopes(partialCoordinationValues, scopePrefix) {
20080
+ const vc = new VitessceConfig({ schemaVersion: "1.0.16", name: "__dummy__" });
20081
+ vc.getNextScope = createPrefixedGetNextScopeNumeric(scopePrefix);
20082
+ const dataset = vc.addDataset("__dummy__");
20083
+ const v12 = vc.addView(dataset, "__dummy__");
20084
+ vc.linkViewsByObject([v12], partialCoordinationValues, { meta: true });
20085
+ const vcJson = vc.toJSON();
20086
+ const { coordinationSpace } = vcJson;
20087
+ const { coordinationScopes } = vcJson.layout[0];
20088
+ const { coordinationScopesBy } = vcJson.layout[0];
20089
+ return {
20090
+ coordinationSpace,
20091
+ coordinationScopes,
20092
+ coordinationScopesBy
20093
+ };
20094
+ }
20111
20095
  const SINGLE_CELL_WITH_HEATMAP_VIEWS = {
20112
20096
  obsSets: { x: 4, y: 0, w: 4, h: 4 },
20113
20097
  obsSetSizes: { x: 8, y: 0, w: 4, h: 4 },
@@ -44815,7 +44799,7 @@ function getMetaScope(coordinationScopes, coordinationSpace, parameter) {
44815
44799
  if (metaScopes && metaSpace) {
44816
44800
  const metaScopesArr = Array.isArray(metaScopes) ? metaScopes : [metaScopes];
44817
44801
  metaScopesArr.forEach((metaScope) => {
44818
- if (metaSpace[metaScope][parameter]) {
44802
+ if (metaSpace[metaScope]?.[parameter]) {
44819
44803
  latestMetaScope = metaScope;
44820
44804
  }
44821
44805
  });
@@ -45019,7 +45003,15 @@ function getScopes(coordinationScopes, metaSpace) {
45019
45003
  if (metaScopes && metaSpace) {
45020
45004
  const metaScopesArr = Array.isArray(metaScopes) ? metaScopes : [metaScopes];
45021
45005
  metaScopesArr.forEach((metaScope) => {
45022
- result = merge$8(result, metaSpace[metaScope]);
45006
+ let o1 = result;
45007
+ const o2 = metaSpace[metaScope] || {};
45008
+ Object.entries(o2).forEach(([cType, cScope]) => {
45009
+ o1 = {
45010
+ ...o1,
45011
+ [cType]: cScope
45012
+ };
45013
+ });
45014
+ result = o1;
45023
45015
  });
45024
45016
  }
45025
45017
  }
@@ -45032,7 +45024,25 @@ function getScopesBy(coordinationScopes, coordinationScopesBy, metaSpaceBy) {
45032
45024
  if (metaSpaceBy && metaScopesBy) {
45033
45025
  const metaScopesArr = Array.isArray(metaScopesBy) ? metaScopesBy : [metaScopesBy];
45034
45026
  metaScopesArr.forEach((metaScope) => {
45035
- result = merge$8(result, metaSpaceBy[metaScope]);
45027
+ let o1 = result;
45028
+ const o2 = metaSpaceBy[metaScope] || {};
45029
+ Object.entries(o2).forEach(([primaryType, primaryObj]) => {
45030
+ Object.entries(primaryObj).forEach(([secondaryType, secondaryObj]) => {
45031
+ Object.entries(secondaryObj).forEach(([primaryScope, secondaryScopeVal]) => {
45032
+ o1 = {
45033
+ ...o1,
45034
+ [primaryType]: {
45035
+ ...o1?.[primaryType] || {},
45036
+ [secondaryType]: {
45037
+ ...o1?.[primaryType]?.[secondaryType] || {},
45038
+ [primaryScope]: secondaryScopeVal
45039
+ }
45040
+ }
45041
+ };
45042
+ });
45043
+ });
45044
+ });
45045
+ result = o1;
45036
45046
  });
45037
45047
  }
45038
45048
  }
@@ -45087,6 +45097,78 @@ const createViewConfigStore = (initialLoaders, initialConfig) => create$b((set3)
45087
45097
  }
45088
45098
  };
45089
45099
  }),
45100
+ mergeCoordination: (newCoordinationValues, scopePrefix, viewUid) => set3((state) => {
45101
+ const { coordinationSpace, layout: layout2 } = state.viewConfig;
45102
+ const { coordinationSpace: newCoordinationSpace, coordinationScopes } = getCoordinationSpaceAndScopes(newCoordinationValues, scopePrefix);
45103
+ Object.entries(newCoordinationSpace).forEach(([coordinationType, coordinationObj]) => {
45104
+ if (coordinationType === CoordinationType$2.META_COORDINATION_SCOPES) {
45105
+ Object.entries(coordinationObj).forEach(([coordinationScope, coordinationValue]) => {
45106
+ coordinationSpace[coordinationType] = {
45107
+ ...coordinationSpace[coordinationType],
45108
+ [coordinationScope]: {
45109
+ ...coordinationValue,
45110
+ ...coordinationSpace[coordinationType]?.[coordinationScope] || {}
45111
+ }
45112
+ };
45113
+ });
45114
+ } else if (coordinationType === CoordinationType$2.META_COORDINATION_SCOPES_BY) {
45115
+ Object.entries(coordinationObj).forEach(([coordinationScope, coordinationValue]) => {
45116
+ Object.entries(coordinationValue).forEach(([primaryType, primaryObj]) => {
45117
+ Object.entries(primaryObj).forEach(([secondaryType, secondaryObj]) => {
45118
+ coordinationSpace[coordinationType] = {
45119
+ ...coordinationSpace[coordinationType],
45120
+ [coordinationScope]: {
45121
+ ...coordinationSpace[coordinationType]?.[coordinationScope] || {},
45122
+ [primaryType]: {
45123
+ ...coordinationSpace[coordinationType]?.[coordinationScope]?.[primaryType] || {},
45124
+ [secondaryType]: {
45125
+ ...secondaryObj,
45126
+ ...coordinationSpace[coordinationType]?.[coordinationScope]?.[primaryType]?.[secondaryType] || {}
45127
+ }
45128
+ }
45129
+ }
45130
+ };
45131
+ });
45132
+ });
45133
+ });
45134
+ } else {
45135
+ coordinationSpace[coordinationType] = {
45136
+ ...coordinationObj,
45137
+ // Existing coordination values should be preserved,
45138
+ // so that user-defined values take precedence over auto-initialization values.
45139
+ ...coordinationSpace[coordinationType] || {}
45140
+ };
45141
+ }
45142
+ });
45143
+ const newViewConfig = {
45144
+ ...state.viewConfig,
45145
+ coordinationSpace: {
45146
+ ...coordinationSpace
45147
+ },
45148
+ layout: layout2.map((viewObj) => {
45149
+ if (viewObj.uid === viewUid) {
45150
+ return {
45151
+ ...viewObj,
45152
+ coordinationScopes: {
45153
+ ...viewObj.coordinationScopes,
45154
+ [CoordinationType$2.META_COORDINATION_SCOPES]: [
45155
+ ...coordinationScopes[CoordinationType$2.META_COORDINATION_SCOPES] || [],
45156
+ ...viewObj.coordinationScopes[CoordinationType$2.META_COORDINATION_SCOPES] || []
45157
+ ],
45158
+ [CoordinationType$2.META_COORDINATION_SCOPES_BY]: [
45159
+ ...coordinationScopes[CoordinationType$2.META_COORDINATION_SCOPES_BY] || [],
45160
+ ...viewObj.coordinationScopes[CoordinationType$2.META_COORDINATION_SCOPES_BY] || []
45161
+ ]
45162
+ }
45163
+ };
45164
+ }
45165
+ return viewObj;
45166
+ })
45167
+ };
45168
+ return {
45169
+ viewConfig: newViewConfig
45170
+ };
45171
+ }),
45090
45172
  removeImageChannelInMetaCoordinationScopes: (coordinationScopesRaw, layerScope, channelScope) => set3((state) => {
45091
45173
  const { coordinationSpace } = state.viewConfig;
45092
45174
  return {
@@ -45509,6 +45591,9 @@ function useChangeLayout() {
45509
45591
  function useSetLoaders() {
45510
45592
  return useViewConfigStore((state) => state.setLoaders);
45511
45593
  }
45594
+ function useMergeCoordination() {
45595
+ return useViewConfigStore((state) => state.mergeCoordination);
45596
+ }
45512
45597
  function useSetViewConfig(viewConfigStoreApi) {
45513
45598
  const setViewConfigRef = useRef(viewConfigStoreApi.getState().setViewConfig);
45514
45599
  const setViewConfig = setViewConfigRef.current;
@@ -51591,7 +51676,7 @@ function useRowHeight(config3, initialRowHeight, height2, margin2, padding2) {
51591
51676
  return [rowHeight, containerRef];
51592
51677
  }
51593
51678
  function withDefaults(coordinationValues, dataType, fileType, datasetUid, defaultCoordinationValues) {
51594
- const defaultKeys = DATA_TYPE_COORDINATION_VALUE_USAGE[dataType].filter((k) => Object.keys(defaultCoordinationValues).includes(k) && defaultCoordinationValues[k] && !Object.keys(coordinationValues).includes(k));
51679
+ const defaultKeys = DATA_TYPE_COORDINATION_VALUE_USAGE[dataType].filter((k) => Object.keys(defaultCoordinationValues).includes(k) && !Object.keys(coordinationValues).includes(k));
51595
51680
  const defaultValues = pick$4(defaultCoordinationValues, defaultKeys);
51596
51681
  const coordinationValuesWithDefaults = {
51597
51682
  ...defaultValues,
@@ -51870,6 +51955,24 @@ function tickStep$1(start, stop3, count2) {
51870
51955
  step1 *= 2;
51871
51956
  return stop3 < start ? -step1 : step1;
51872
51957
  }
51958
+ function max$5(values3, valueof) {
51959
+ let max2;
51960
+ if (valueof === void 0) {
51961
+ for (const value2 of values3) {
51962
+ if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
51963
+ max2 = value2;
51964
+ }
51965
+ }
51966
+ } else {
51967
+ let index2 = -1;
51968
+ for (let value2 of values3) {
51969
+ if ((value2 = valueof(value2, ++index2, values3)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
51970
+ max2 = value2;
51971
+ }
51972
+ }
51973
+ }
51974
+ return max2;
51975
+ }
51873
51976
  function quantileSorted$1(values3, p, valueof = number$a) {
51874
51977
  if (!(n3 = values3.length))
51875
51978
  return;
@@ -52421,7 +52524,7 @@ function getAltText(config3) {
52421
52524
  const padding$2 = 10;
52422
52525
  const margin = 5;
52423
52526
  function VitessceGrid(props2) {
52424
- const { success, configKey, rowHeight: initialRowHeight, config: config3, theme, height: height2, isBounded, viewTypes, fileTypes, coordinationTypes } = props2;
52527
+ const { success, configKey, rowHeight: initialRowHeight, config: config3, theme, height: height2, isBounded, viewTypes, fileTypes, coordinationTypes, stores } = props2;
52425
52528
  const [rowHeight, containerRef] = useRowHeight(config3, initialRowHeight, height2, margin, padding$2);
52426
52529
  const onResize = useEmitGridResize();
52427
52530
  const [componentWidth] = useClosestVitessceContainerSize(containerRef);
@@ -52446,7 +52549,7 @@ function VitessceGrid(props2) {
52446
52549
  let newLoaders = null;
52447
52550
  let newConfig = null;
52448
52551
  if (success) {
52449
- newLoaders = createLoaders(config3.datasets, config3.description, fileTypes, coordinationTypes);
52552
+ newLoaders = createLoaders(config3.datasets, config3.description, fileTypes, coordinationTypes, stores);
52450
52553
  newConfig = config3;
52451
52554
  }
52452
52555
  setViewConfig(newConfig);
@@ -52784,7 +52887,7 @@ function VitS(props2) {
52784
52887
  }
52785
52888
  return createViewConfigStore(null, null);
52786
52889
  }, [success, configKey]);
52787
- return success ? jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient, children: jsxRuntimeExports.jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, children: jsxRuntimeExports.jsxs(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: [jsxRuntimeExports.jsx(VitessceGrid, { success, configKey, viewTypes, fileTypes, coordinationTypes, config: configOrWarning, rowHeight, height: height2, theme, isBounded }), jsxRuntimeExports.jsx(CallbackPublisher, { onWarn, onConfigChange, onLoaderChange, validateOnConfigChange, pluginSpecificConfigSchema })] }) }, configKey) }) }) }) : jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(Warning, { ...configOrWarning }) }) });
52890
+ return success ? jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient, children: jsxRuntimeExports.jsx(ViewConfigProvider, { createStore: createViewConfigStoreClosure, children: jsxRuntimeExports.jsxs(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: [jsxRuntimeExports.jsx(VitessceGrid, { success, configKey, viewTypes, fileTypes, coordinationTypes, config: configOrWarning, rowHeight, height: height2, theme, isBounded, stores }), jsxRuntimeExports.jsx(CallbackPublisher, { onWarn, onConfigChange, onLoaderChange, validateOnConfigChange, pluginSpecificConfigSchema })] }) }, configKey) }) }) }) : jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(Warning, { ...configOrWarning }) }) });
52788
52891
  }
52789
52892
  const AddIcon = createSvgIcon(/* @__PURE__ */ React$6.createElement("path", {
52790
52893
  d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
@@ -52923,7 +53026,8 @@ function PlotOptions(props2) {
52923
53026
  const { options } = props2;
52924
53027
  const [open2, setOpen] = useState(false);
52925
53028
  const classes = useStyles$r();
52926
- return options ? jsxRuntimeExports.jsx(PopperMenu, { open: open2, setOpen, buttonIcon: jsxRuntimeExports.jsx(SettingsIconWithArrow, { open: open2 }), buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open plot options menu", children: options }) : null;
53029
+ const buttonIcon = useMemo(() => jsxRuntimeExports.jsx(SettingsIconWithArrow, { open: open2 }), [open2]);
53030
+ return options ? jsxRuntimeExports.jsx(PopperMenu, { open: open2, setOpen, buttonIcon, buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open plot options menu", children: options }) : null;
52927
53031
  }
52928
53032
  function CloudDownloadIconWithArrow({ open: open2 }) {
52929
53033
  return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(CloudDownloadIcon, {}), open2 ? jsxRuntimeExports.jsx(ArrowDropUpIcon, {}) : jsxRuntimeExports.jsx(ArrowDropDownIcon, {})] });
@@ -52932,7 +53036,8 @@ function DownloadOptions(props2) {
52932
53036
  const { urls: urls2 } = props2;
52933
53037
  const [open2, setOpen] = useState(false);
52934
53038
  const classes = useStyles$r();
52935
- return urls2 && urls2.length ? jsxRuntimeExports.jsx(PopperMenu, { open: open2, setOpen, buttonIcon: jsxRuntimeExports.jsx(CloudDownloadIconWithArrow, { open: open2 }), buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open download options menu", children: urls2.map(({ url, name: name2 }) => jsxRuntimeExports.jsx(MenuItem$1, { dense: true, getArialLabel: () => `Click to download ${name2}`, children: jsxRuntimeExports.jsxs(Link$1, { underline: "always", href: url, target: "_blank", rel: "noopener", className: classes.downloadLink, children: ["Download ", name2] }) }, `${url}_${name2}`)) }) : null;
53039
+ const buttonIcon = useMemo(() => jsxRuntimeExports.jsx(CloudDownloadIconWithArrow, { open: open2 }), [open2]);
53040
+ return urls2 && urls2.length ? jsxRuntimeExports.jsx(PopperMenu, { open: open2, setOpen, buttonIcon, buttonClassName: classes.iconButton, placement: "bottom-end", "aria-label": "Open download options menu", children: urls2.map(({ url, name: name2 }) => jsxRuntimeExports.jsx(MenuItem$1, { dense: true, "aria-label": `Click to download ${name2}`, children: jsxRuntimeExports.jsxs(Link$1, { underline: "always", href: url, target: "_blank", rel: "noopener", className: classes.downloadLink, children: ["Download ", name2] }) }, `${url}_${name2}`)) }) : null;
52936
53041
  }
52937
53042
  function ClosePaneButton(props2) {
52938
53043
  const { removeGridComponent } = props2;
@@ -52940,11 +53045,11 @@ function ClosePaneButton(props2) {
52940
53045
  return jsxRuntimeExports.jsx(IconButton$2, { onClick: removeGridComponent, size: "small", className: classes.iconButton, title: "close", "aria-label": "Close panel button", children: jsxRuntimeExports.jsx(CloseIcon, {}) });
52941
53046
  }
52942
53047
  function TitleInfo(props2) {
52943
- const { title: title2, info: info2, children: children3, isScroll, isSpatial, removeGridComponent, urls: urls2, isReady, options } = props2;
53048
+ const { title: title2, info: info2, children: children3, isScroll, isSpatial, removeGridComponent, urls: urls2, isReady, options, closeButtonVisible = true, downloadButtonVisible = true } = props2;
52944
53049
  const classes = useTitleStyles();
52945
53050
  return (
52946
53051
  // d-flex without wrapping div is not always full height; I don't understand the root cause.
52947
- jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs("div", { className: classes.title, role: "banner", children: [jsxRuntimeExports.jsx("div", { className: classes.titleLeft, role: "heading", "aria-level": "1", children: title2 }), jsxRuntimeExports.jsx("div", { className: classes.titleInfo, title: info2, role: "note", children: info2 }), jsxRuntimeExports.jsxs("div", { className: classes.titleButtons, role: "toolbar", "aria-label": "Plot options and controls", children: [jsxRuntimeExports.jsx(PlotOptions, { options }), jsxRuntimeExports.jsx(DownloadOptions, { urls: urls2 }), jsxRuntimeExports.jsx(ClosePaneButton, { removeGridComponent })] })] }), jsxRuntimeExports.jsxs("div", { className: clsx(TOOLTIP_ANCESTOR, classes.card, {
53052
+ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs("div", { className: classes.title, role: "banner", children: [jsxRuntimeExports.jsx("div", { className: classes.titleLeft, role: "heading", "aria-level": "1", children: title2 }), jsxRuntimeExports.jsx("div", { className: classes.titleInfo, title: info2, role: "note", children: info2 }), jsxRuntimeExports.jsxs("div", { className: classes.titleButtons, role: "toolbar", "aria-label": "Plot options and controls", children: [jsxRuntimeExports.jsx(PlotOptions, { options }), downloadButtonVisible ? jsxRuntimeExports.jsx(DownloadOptions, { urls: urls2 }) : null, closeButtonVisible ? jsxRuntimeExports.jsx(ClosePaneButton, { removeGridComponent }) : null] })] }), jsxRuntimeExports.jsxs("div", { className: clsx(TOOLTIP_ANCESTOR, classes.card, {
52948
53053
  [classes.scrollCard]: isScroll,
52949
53054
  [classes.spatialCard]: isSpatial,
52950
53055
  [classes.noScrollCard]: !isScroll && !isSpatial
@@ -53035,7 +53140,7 @@ async function dataQueryFn(ctx2) {
53035
53140
  if (!payload)
53036
53141
  return placeholderObject;
53037
53142
  const { data: data2, url, coordinationValues } = payload;
53038
- const urls2 = Array.isArray(url) ? url : [{ url, name: dataType }];
53143
+ const urls2 = (Array.isArray(url) ? url : [{ url, name: dataType }]).filter((d) => d.url);
53039
53144
  return { data: data2, coordinationValues, urls: urls2 };
53040
53145
  }
53041
53146
  if (isRequired) {
@@ -53077,7 +53182,7 @@ function useDataType(dataType, loaders, dataset, isRequired, coordinationSetters
53077
53182
  const dataStatus = isFetching ? STATUS$1.LOADING : status;
53078
53183
  return [loadedData, dataStatus, urls2];
53079
53184
  }
53080
- function useDataTypeMulti(dataType, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOnObj) {
53185
+ function useDataTypeMulti(dataType, loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOnObj, mergeCoordination, viewUid) {
53081
53186
  const placeholderObject = useMemo(() => ({}), []);
53082
53187
  const setWarning = useSetWarning();
53083
53188
  const matchOnEntries = matchOnObj ? Object.entries(matchOnObj) : [];
@@ -53103,8 +53208,18 @@ function useDataTypeMulti(dataType, loaders, dataset, isRequired, coordinationSe
53103
53208
  const dataStatus = anyLoading ? STATUS$1.LOADING : anyError ? STATUS$1.ERROR : STATUS$1.SUCCESS;
53104
53209
  const isSuccess = dataStatus === STATUS$1.SUCCESS;
53105
53210
  useEffect(() => {
53106
- dataQueries.map((q) => q.data?.coordinationValues).filter((v) => Boolean(v)).forEach((coordinationValues) => {
53107
- initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
53211
+ dataQueries.filter((q) => Boolean(q.data?.coordinationValues)).forEach((q) => {
53212
+ const { coordinationValues } = q.data;
53213
+ if (mergeCoordination) {
53214
+ mergeCoordination(
53215
+ coordinationValues,
53216
+ // Auto-generate based on the dataset and data type.
53217
+ getInitialCoordinationScopePrefix(dataset, dataType),
53218
+ viewUid
53219
+ );
53220
+ } else {
53221
+ initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
53222
+ }
53108
53223
  });
53109
53224
  }, [isSuccess]);
53110
53225
  useEffect(() => {
@@ -53249,7 +53364,7 @@ function useObsFeatureMatrixIndices(loaders, dataset, isRequired, matchOn) {
53249
53364
  obsIndex: payloadData2.rows,
53250
53365
  featureIndex: payloadData2.cols
53251
53366
  },
53252
- urls: [{ url: url2, name: DataType$3.OBS_FEATURE_MATRIX }]
53367
+ urls: url2 ? [{ url: url2, name: DataType$3.OBS_FEATURE_MATRIX }] : null
53253
53368
  };
53254
53369
  }
53255
53370
  const payload = await loader2.load();
@@ -53283,7 +53398,7 @@ function useObsFeatureMatrixIndices(loaders, dataset, isRequired, matchOn) {
53283
53398
  }, [error2, setWarning]);
53284
53399
  return [loadedData, dataStatus, urls2];
53285
53400
  }
53286
- function useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset) {
53401
+ function useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, viewUid) {
53287
53402
  const obsTypeCoordination = useComplexCoordination([
53288
53403
  CoordinationType$2.OBS_TYPE
53289
53404
  ], coordinationScopes, coordinationScopesBy, CoordinationType$2.POINT_LAYER);
@@ -53294,10 +53409,10 @@ function useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, da
53294
53409
  // indirect dependencies here.
53295
53410
  [coordinationScopes, coordinationScopesBy]
53296
53411
  );
53297
- const [obsPointsData, obsPointsDataStatus, obsPointsUrls] = useDataTypeMulti(DataType$3.OBS_POINTS, loaders, dataset, false, {}, {}, matchOnObj);
53412
+ const [obsPointsData, obsPointsDataStatus, obsPointsUrls] = useDataTypeMulti(DataType$3.OBS_POINTS, loaders, dataset, false, {}, {}, matchOnObj, mergeCoordination, viewUid);
53298
53413
  return [obsPointsData, obsPointsDataStatus, obsPointsUrls];
53299
53414
  }
53300
- function useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset) {
53415
+ function useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, viewUid) {
53301
53416
  const obsTypeCoordination = useComplexCoordination([
53302
53417
  CoordinationType$2.OBS_TYPE
53303
53418
  ], coordinationScopes, coordinationScopesBy, CoordinationType$2.SPOT_LAYER);
@@ -53308,7 +53423,7 @@ function useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dat
53308
53423
  // indirect dependencies here.
53309
53424
  [coordinationScopes, coordinationScopesBy]
53310
53425
  );
53311
- const [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls] = useDataTypeMulti(DataType$3.OBS_SPOTS, loaders, dataset, false, {}, {}, matchOnObj);
53426
+ const [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls] = useDataTypeMulti(DataType$3.OBS_SPOTS, loaders, dataset, false, {}, {}, matchOnObj, mergeCoordination, viewUid);
53312
53427
  return [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls];
53313
53428
  }
53314
53429
  function useSpotMultiObsSets(coordinationScopes, coordinationScopesBy, loaders, dataset) {
@@ -53334,7 +53449,7 @@ function useMultiObsLabels(coordinationScopes, obsType, loaders, dataset) {
53334
53449
  const [obsLabelsData, obsLabelsDataStatus, obsLabelsUrls] = useDataTypeMulti(DataType$3.OBS_LABELS, loaders, dataset, false, {}, {}, obsLabelsMatchOnObj);
53335
53450
  return [obsLabelsTypes, obsLabelsData, obsLabelsDataStatus, obsLabelsUrls];
53336
53451
  }
53337
- function useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset) {
53452
+ function useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, viewUid) {
53338
53453
  const imageCoordination = useComplexCoordination([
53339
53454
  CoordinationType$2.FILE_UID
53340
53455
  ], coordinationScopes, coordinationScopesBy, CoordinationType$2.SEGMENTATION_LAYER);
@@ -53345,10 +53460,10 @@ function useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, load
53345
53460
  // indirect dependencies here.
53346
53461
  [coordinationScopes, coordinationScopesBy]
53347
53462
  );
53348
- const [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls] = useDataTypeMulti(DataType$3.OBS_SEGMENTATIONS, loaders, dataset, false, {}, {}, matchOnObj);
53463
+ const [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls] = useDataTypeMulti(DataType$3.OBS_SEGMENTATIONS, loaders, dataset, false, {}, {}, matchOnObj, mergeCoordination, viewUid);
53349
53464
  return [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls];
53350
53465
  }
53351
- function useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset) {
53466
+ function useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, viewUid) {
53352
53467
  const imageCoordination = useComplexCoordination([
53353
53468
  CoordinationType$2.FILE_UID
53354
53469
  ], coordinationScopes, coordinationScopesBy, CoordinationType$2.IMAGE_LAYER);
@@ -53359,7 +53474,7 @@ function useMultiImages(coordinationScopes, coordinationScopesBy, loaders, datas
53359
53474
  // indirect dependencies here.
53360
53475
  [coordinationScopes, coordinationScopesBy]
53361
53476
  );
53362
- const [imageData, imageDataStatus, imageUrls] = useDataTypeMulti(DataType$3.IMAGE, loaders, dataset, false, {}, {}, matchOnObj);
53477
+ const [imageData, imageDataStatus, imageUrls] = useDataTypeMulti(DataType$3.IMAGE, loaders, dataset, false, {}, {}, matchOnObj, mergeCoordination, viewUid);
53363
53478
  return [imageData, imageDataStatus, imageUrls];
53364
53479
  }
53365
53480
  function getFeatureSelectionQueryKeyScopeTuplesAux(allSelections, allMatchOnObj, depth, dataset, dataType, isRequired, prevLevelScopes, currSelection, currMatchOn) {
@@ -53530,7 +53645,7 @@ function useFeatureSelectionMultiLevel(loaders, dataset, isRequired, matchOnObj,
53530
53645
  const nestedExtents = nestFeatureSelectionQueryResults(queryKeyScopeTuples, flatExtents);
53531
53646
  const nestedNormData = nestFeatureSelectionQueryResults(queryKeyScopeTuples, flatNormData);
53532
53647
  return [nestedGeneData, nestedLoadedGeneName, nestedExtents, nestedNormData];
53533
- }, [featureQueries.reduce((a2, h2) => a2 + h2.dataUpdatedAt, 0)]);
53648
+ }, [featureQueries.reduce((a2, h2) => a2 + h2.dataUpdatedAt, 0), queryKeyScopeTuples]);
53534
53649
  return [geneData, loadedGeneName, extents, normData, dataStatus];
53535
53650
  }
53536
53651
  async function matrixIndicesQueryFn(ctx2) {
@@ -53592,7 +53707,7 @@ function useObsFeatureMatrixIndicesMultiLevel(loaders, dataset, isRequired, matc
53592
53707
  const indicesData = useMemo(() => {
53593
53708
  const nestedIndicesData = nestQueryResults(queryKeyScopeTuples, flatIndicesData);
53594
53709
  return nestedIndicesData;
53595
- }, [indicesQueries.reduce((a2, h2) => a2 + h2.dataUpdatedAt, 0)]);
53710
+ }, [indicesQueries.reduce((a2, h2) => a2 + h2.dataUpdatedAt, 0), queryKeyScopeTuples]);
53596
53711
  return [indicesData, dataStatus];
53597
53712
  }
53598
53713
  function useDataTypeMultiLevel(loaders, dataset, isRequired, matchOnObj, depth, dataType) {
@@ -53619,7 +53734,7 @@ function useDataTypeMultiLevel(loaders, dataset, isRequired, matchOnObj, depth,
53619
53734
  const locationsData = useMemo(() => {
53620
53735
  const nestedIndicesData = nestQueryResults(queryKeyScopeTuples, flatIndicesData);
53621
53736
  return nestedIndicesData;
53622
- }, [locationsQueries.reduce((a2, h2) => a2 + h2.dataUpdatedAt, 0)]);
53737
+ }, [locationsQueries.reduce((a2, h2) => a2 + h2.dataUpdatedAt, 0), queryKeyScopeTuples]);
53623
53738
  return [locationsData, dataStatus];
53624
53739
  }
53625
53740
  function useObsLocationsMultiLevel(loaders, dataset, isRequired, matchOnObj, depth) {
@@ -53647,6 +53762,7 @@ function useSegmentationMultiFeatureSelection(coordinationScopes, coordinationSc
53647
53762
  // indirect dependencies here.
53648
53763
  [coordinationScopes, coordinationScopesBy]
53649
53764
  );
53765
+ const useMemoDependency = Object.values(featureSelectionCoordination[0] || {}).flatMap((layerVal) => Object.values(layerVal).map((cVal) => cVal.featureSelection));
53650
53766
  const selections = useMemo(
53651
53767
  () => fromEntries(Object.entries(featureSelectionCoordination[0]).map(([layerScope, layerVal]) => [
53652
53768
  layerScope,
@@ -53656,7 +53772,9 @@ function useSegmentationMultiFeatureSelection(coordinationScopes, coordinationSc
53656
53772
  [
53657
53773
  coordinationScopes,
53658
53774
  coordinationScopesBy,
53659
- ...Object.values(featureSelectionCoordination[0] || {}).flatMap((layerVal) => Object.values(layerVal).map((cVal) => cVal.featureSelection))
53775
+ // We need to ensure there are always the same number of
53776
+ // entries in the full dependency array.
53777
+ JSON.stringify(useMemoDependency.length > 0 ? useMemoDependency : [null])
53660
53778
  ]
53661
53779
  );
53662
53780
  const [featureData, loadedSelections, extents, normData, featureStatus] = useFeatureSelectionMultiLevel(loaders, dataset, false, matchOnObj, selections, 2);
@@ -54086,7 +54204,7 @@ function Description(props2) {
54086
54204
  return jsxRuntimeExports.jsxs("div", { className: classes.description, children: [jsxRuntimeExports.jsx("p", { children: description2 }), metadata2 && Array.from(metadata2.entries()).map(([layerIndex, { name: layerName, metadata: metadataRecord }]) => metadataRecord && Object.entries(metadataRecord).length > 0 ? jsxRuntimeExports.jsxs("details", { children: [jsxRuntimeExports.jsx("summary", { children: layerName }), jsxRuntimeExports.jsx("div", { className: classes.metadataContainer, children: jsxRuntimeExports.jsx("table", { children: jsxRuntimeExports.jsx("tbody", { children: Object.entries(metadataRecord).map(([key2, value2]) => jsxRuntimeExports.jsxs("tr", { children: [jsxRuntimeExports.jsx("th", { title: key2, children: key2 }), jsxRuntimeExports.jsx("td", { title: value2, children: value2 })] }, key2)) }) }) })] }, layerIndex) : null)] });
54087
54205
  }
54088
54206
  function DescriptionSubscriber(props2) {
54089
- const { coordinationScopes, description: descriptionOverride, removeGridComponent, theme, title: title2 = "Description" } = props2;
54207
+ const { coordinationScopes, description: descriptionOverride, removeGridComponent, theme, title: title2 = "Description", closeButtonVisible } = props2;
54090
54208
  const loaders = useLoaders();
54091
54209
  const [{ dataset, spatialImageLayer: rasterLayers }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.DESCRIPTION], coordinationScopes);
54092
54210
  const [description2] = useDescription(loaders, dataset);
@@ -54108,7 +54226,7 @@ function DescriptionSubscriber(props2) {
54108
54226
  }
54109
54227
  return result;
54110
54228
  }, [rasterLayers, imageLayerMeta, imageLayerLoaders]);
54111
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, removeGridComponent, isScroll: true, theme, isReady, children: jsxRuntimeExports.jsx(Description, { description: descriptionOverride || description2, metadata: metadata2 }) });
54229
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, removeGridComponent, isScroll: true, theme, isReady, children: jsxRuntimeExports.jsx(Description, { description: descriptionOverride || description2, metadata: metadata2 }) });
54112
54230
  }
54113
54231
  var _global = { exports: {} };
54114
54232
  var global$6 = _global.exports = typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math ? self : Function("return this")();
@@ -66556,7 +66674,7 @@ function SetsManager(props2) {
66556
66674
  }
66557
66675
  const packageJson = { name: "vitessce" };
66558
66676
  function ObsSetsManagerSubscriber(props2) {
66559
- const { coordinationScopes, removeGridComponent, theme, title: titleOverride } = props2;
66677
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: titleOverride } = props2;
66560
66678
  const loaders = useLoaders();
66561
66679
  const setWarning = useSetWarning();
66562
66680
  const [{ dataset, obsType, obsSetSelection: cellSetSelection, obsSetExpansion: cellSetExpansion, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, obsColorEncoding: cellColorEncoding }, { setObsSetSelection: setCellSetSelection, setObsColorEncoding: setCellColorEncoding, setObsSetColor: setCellSetColor, setObsSetExpansion: setCellSetExpansion, setAdditionalObsSets: setAdditionalCellSets }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.OBS_SETS], coordinationScopes);
@@ -66949,7 +67067,7 @@ function ObsSetsManagerSubscriber(props2) {
66949
67067
  setWarning,
66950
67068
  theme
66951
67069
  ]);
66952
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, removeGridComponent, urls: urls2, theme, isReady, children: manager });
67070
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, children: manager });
66953
67071
  }
66954
67072
  function tree_add$1(d) {
66955
67073
  var x2 = +this._x.call(null, d), y2 = +this._y.call(null, d);
@@ -170202,16 +170320,16 @@ async function getDecoder(fileDirectory) {
170202
170320
  const Decoder = await importFn();
170203
170321
  return new Decoder(fileDirectory);
170204
170322
  }
170205
- addDecoder([void 0, 1], () => import("./raw-367b085b.js").then((m2) => m2.default));
170206
- addDecoder(5, () => import("./lzw-3c38ef38.js").then((m2) => m2.default));
170323
+ addDecoder([void 0, 1], () => import("./raw-f79f69c9.js").then((m2) => m2.default));
170324
+ addDecoder(5, () => import("./lzw-385da6fb.js").then((m2) => m2.default));
170207
170325
  addDecoder(6, () => {
170208
170326
  throw new Error("old style JPEG compression is not supported.");
170209
170327
  });
170210
- addDecoder(7, () => import("./jpeg-8349089f.js").then((m2) => m2.default));
170211
- addDecoder([8, 32946], () => import("./deflate-38551de0.js").then((m2) => m2.default));
170212
- addDecoder(32773, () => import("./packbits-ffd38b8f.js").then((m2) => m2.default));
170213
- addDecoder(34887, () => import("./lerc-4449a2af.js").then((m2) => m2.default));
170214
- addDecoder(50001, () => import("./webimage-2c7bf8d5.js").then((m2) => m2.default));
170328
+ addDecoder(7, () => import("./jpeg-c8d27cff.js").then((m2) => m2.default));
170329
+ addDecoder([8, 32946], () => import("./deflate-d4e561ec.js").then((m2) => m2.default));
170330
+ addDecoder(32773, () => import("./packbits-48af1346.js").then((m2) => m2.default));
170331
+ addDecoder(34887, () => import("./lerc-a7e69cfb.js").then((m2) => m2.default));
170332
+ addDecoder(50001, () => import("./webimage-f08d90a2.js").then((m2) => m2.default));
170215
170333
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
170216
170334
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
170217
170335
  }
@@ -184490,15 +184608,15 @@ function normalize$4(arr) {
184490
184608
  const data2 = new Uint8Array(arr.map((i2) => Math.floor((i2 - min2) * ratio)));
184491
184609
  return data2;
184492
184610
  }
184493
- function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, texSize) {
184611
+ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode, texSize) {
184494
184612
  let totalValuesLength = 0;
184495
184613
  let totalColorsLength = 0;
184496
184614
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
184497
184615
  if (isSetColorMode) {
184498
- totalValuesLength += setColorValues[channelIndex]?.obsIndex?.length || 0;
184499
184616
  totalColorsLength += (setColorValues[channelIndex]?.setColors?.length || 0) * 3;
184617
+ totalValuesLength += setColorValues[channelIndex]?.obsIndex ? max$5(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
184500
184618
  } else {
184501
- totalValuesLength += multiFeatureValues[channelIndex]?.length || 0;
184619
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$5(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : multiFeatureValues[channelIndex]?.length || 0;
184502
184620
  }
184503
184621
  });
184504
184622
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -184516,12 +184634,20 @@ function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSet
184516
184634
  let indexOffset = 0;
184517
184635
  let colorOffset = 0;
184518
184636
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
184637
+ const matrixObsIndex = multiMatrixObsIndex[channelIndex];
184638
+ const bitmaskValueIsIndex = matrixObsIndex === null;
184519
184639
  if (isSetColorMode) {
184520
184640
  const { setColorIndices, setColors, obsIndex } = setColorValues[channelIndex] || {};
184521
184641
  if (setColorIndices && setColors && obsIndex) {
184522
184642
  for (let i2 = 0; i2 < obsIndex.length; i2++) {
184523
- const colorIndex = setColorIndices.get(String(i2 + 1));
184524
- totalData[indexOffset + i2] = colorIndex === void 0 ? 0 : colorIndex + 1;
184643
+ let obsId = String(i2 + 1);
184644
+ let obsI = i2;
184645
+ if (!bitmaskValueIsIndex) {
184646
+ obsId = obsIndex[i2];
184647
+ obsI = parseInt(obsId) - 1;
184648
+ }
184649
+ const colorIndex = setColorIndices.get(obsId);
184650
+ totalData[indexOffset + obsI] = colorIndex === void 0 ? 0 : colorIndex + 1;
184525
184651
  }
184526
184652
  for (let i2 = 0; i2 < setColors.length; i2++) {
184527
184653
  const { color: [r3, g2, b2] } = setColors[i2];
@@ -184536,7 +184662,16 @@ function multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSet
184536
184662
  colorOffset += setColors?.length || 0;
184537
184663
  } else {
184538
184664
  const featureArr = multiFeatureValues[channelIndex];
184539
- totalData.set(normalize$4(featureArr), indexOffset);
184665
+ const normalizedFeatureArr = normalize$4(featureArr);
184666
+ if (!bitmaskValueIsIndex && matrixObsIndex) {
184667
+ for (let i2 = 0; i2 < matrixObsIndex.length; i2++) {
184668
+ const obsId = matrixObsIndex[i2];
184669
+ const obsI = parseInt(obsId) - 1;
184670
+ totalData[indexOffset + obsI] = normalizedFeatureArr[i2];
184671
+ }
184672
+ } else {
184673
+ totalData.set(normalizedFeatureArr, indexOffset);
184674
+ }
184540
184675
  indicesOffsets.push(indexOffset);
184541
184676
  indexOffset += featureArr.length;
184542
184677
  colorsOffsets.push(colorOffset);
@@ -184563,6 +184698,17 @@ function padWithDefault(arr, defaultValue2, padWidth) {
184563
184698
  function getColor(arr) {
184564
184699
  return arr ? arr.map((v) => v / 255) : [0, 0, 0];
184565
184700
  }
184701
+ function isEqualShallow(prevArr, nextArr) {
184702
+ if (prevArr === nextArr) {
184703
+ return true;
184704
+ }
184705
+ if (Array.isArray(prevArr) && Array.isArray(nextArr)) {
184706
+ if (prevArr.length === nextArr.length) {
184707
+ return !prevArr.some((v, i2) => v !== nextArr[i2] && (!Array.isArray(v) && !Array.isArray(nextArr[i2]) || (v.length > 0 || nextArr[i2].length > 0)));
184708
+ }
184709
+ }
184710
+ return prevArr === nextArr;
184711
+ }
184566
184712
  const defaultProps = {
184567
184713
  channelStrokeWidths: { type: "array", value: null, compare: true },
184568
184714
  channelsFilled: { type: "array", value: null, compare: true },
@@ -184572,6 +184718,7 @@ const defaultProps = {
184572
184718
  colormap: { type: "string", value: GLSL_COLORMAP_DEFAULT, compare: true },
184573
184719
  expressionData: { type: "object", value: null, compare: true },
184574
184720
  multiFeatureValues: { type: "array", value: null, compare: true },
184721
+ multiMatrixObsIndex: { type: "array", value: null, compare: true },
184575
184722
  setColorValues: { type: "array", value: null, compare: true },
184576
184723
  channelFeatureValueColormaps: { type: "array", value: null, compare: true },
184577
184724
  channelFeatureValueColormapRanges: { type: "array", value: null, compare: true },
@@ -184618,9 +184765,9 @@ class BitmaskLayer2 extends XRLayer {
184618
184765
  }
184619
184766
  updateState({ props: props2, oldProps, changeFlags }) {
184620
184767
  super.updateState({ props: props2, oldProps, changeFlags });
184621
- if (props2.multiFeatureValues !== oldProps.multiFeatureValues || props2.setColorValues !== oldProps.setColorValues || props2.channelIsSetColorMode !== oldProps.channelIsSetColorMode) {
184622
- const { multiFeatureValues, setColorValues, channelIsSetColorMode } = this.props;
184623
- const [valueTex, colorTex, valueTexOffsets, colorTexOffsets, valueTexHeight, colorTexHeight] = this.multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode);
184768
+ if (!isEqualShallow(props2.multiFeatureValues, oldProps.multiFeatureValues) || !isEqualShallow(props2.multiMatrixObsIndex, oldProps.multiMatrixObsIndex) || !isEqualShallow(props2.setColorValues, oldProps.setColorValues) || !isEqualShallow(props2.channelIsSetColorMode, oldProps.channelIsSetColorMode)) {
184769
+ const { multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode } = this.props;
184770
+ const [valueTex, colorTex, valueTexOffsets, colorTexOffsets, valueTexHeight, colorTexHeight] = this.multiSetsToTexture(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode);
184624
184771
  this.setState({
184625
184772
  valueTex,
184626
184773
  colorTex,
@@ -184772,9 +184919,9 @@ class BitmaskLayer2 extends XRLayer {
184772
184919
  type: GL$1.FLOAT
184773
184920
  });
184774
184921
  }
184775
- multiSetsToTexture(multiFeatureValues, setColorValues, channelIsSetColorMode) {
184922
+ multiSetsToTexture(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode) {
184776
184923
  const isWebGL2On = isWebGL2$1(this.context.gl);
184777
- const [totalData, valueTexHeight, indicesOffsets, totalColors, colorTexHeight, colorsOffsets] = multiSetsToTextureData(multiFeatureValues, setColorValues, channelIsSetColorMode, MULTI_FEATURE_TEX_SIZE);
184924
+ const [totalData, valueTexHeight, indicesOffsets, totalColors, colorTexHeight, colorsOffsets] = multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColorValues, channelIsSetColorMode, MULTI_FEATURE_TEX_SIZE);
184778
184925
  return [
184779
184926
  // Color indices texture
184780
184927
  new Texture2D(this.context.gl, {
@@ -187913,6 +188060,8 @@ function EmbeddingScatterplotSubscriber(props2) {
187913
188060
  const {
187914
188061
  uuid,
187915
188062
  coordinationScopes,
188063
+ closeButtonVisible,
188064
+ downloadButtonVisible,
187916
188065
  removeGridComponent,
187917
188066
  theme,
187918
188067
  observationsLabelOverride,
@@ -188068,7 +188217,7 @@ function EmbeddingScatterplotSubscriber(props2) {
188068
188217
  setTargetY(target2[1]);
188069
188218
  setTargetZ(target2[2] || 0);
188070
188219
  };
188071
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(observationsLabel, cellsCount)}`, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, tooltipsVisible, setTooltipsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange }), children: [jsxRuntimeExports.jsx(ScatterplotWrapper, { ref: deckRef, uuid, theme, viewState: { zoom: zoom2, target: [targetX2, targetY2, targetZ] }, setViewState, originalViewState, obsEmbeddingIndex, obsEmbedding, cellFilter, cellSelection, cellHighlight, cellColors, cellSetPolygons, cellSetLabelSize, cellSetLabelsVisible, cellSetPolygonsVisible, setCellFilter, setCellSelection: setCellSelectionProp, setCellHighlight, cellRadius, cellOpacity, cellColorEncoding, geneExpressionColormap, geneExpressionColormapRange, setComponentHover: () => {
188220
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(observationsLabel, cellsCount)}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, tooltipsVisible, setTooltipsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange }), children: [jsxRuntimeExports.jsx(ScatterplotWrapper, { ref: deckRef, uuid, theme, viewState: { zoom: zoom2, target: [targetX2, targetY2, targetZ] }, setViewState, originalViewState, obsEmbeddingIndex, obsEmbedding, cellFilter, cellSelection, cellHighlight, cellColors, cellSetPolygons, cellSetLabelSize, cellSetLabelsVisible, cellSetPolygonsVisible, setCellFilter, setCellSelection: setCellSelectionProp, setCellHighlight, cellRadius, cellOpacity, cellColorEncoding, geneExpressionColormap, geneExpressionColormapRange, setComponentHover: () => {
188072
188221
  setComponentHover(uuid);
188073
188222
  }, updateViewInfo: setComponentViewInfo, getExpressionValue, getCellIsSelected }), tooltipsVisible && jsxRuntimeExports.jsx(ScatterplotTooltipSubscriber, { parentUuid: uuid, obsHighlight: cellHighlight, width: width2, height: height2, getObsInfo }), jsxRuntimeExports.jsx(Legend, { visible: true, theme, featureType, featureValueType, obsColorEncoding: cellColorEncoding, featureSelection: geneSelection, featureLabelsMap, featureValueColormap: geneExpressionColormap, featureValueColormapRange: geneExpressionColormapRange, extent: expressionExtents?.[0] })] });
188074
188223
  }
@@ -188117,6 +188266,8 @@ function GatingSubscriber(props2) {
188117
188266
  const {
188118
188267
  uuid,
188119
188268
  coordinationScopes,
188269
+ closeButtonVisible,
188270
+ downloadButtonVisible,
188120
188271
  removeGridComponent,
188121
188272
  theme,
188122
188273
  disableTooltip = false,
@@ -188306,7 +188457,7 @@ function GatingSubscriber(props2) {
188306
188457
  gatingFeatureSelectionY,
188307
188458
  obsType
188308
188459
  ]);
188309
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(obsType, cellsCount)}`, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel: obsType, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, children: jsxRuntimeExports.jsx(GatingScatterplotOptions, { featureType, gatingFeatureSelectionX, setGatingFeatureSelectionX, gatingFeatureSelectionY, setGatingFeatureSelectionY, gatingFeatureValueTransform: featureValueTransform, setGatingFeatureValueTransform: (newValue) => {
188460
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(obsType, cellsCount)}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(ScatterplotOptions, { observationsLabel: obsType, cellRadius: cellRadiusFixed, setCellRadius: setCellRadiusFixed, cellRadiusMode, setCellRadiusMode, cellOpacity: cellOpacityFixed, setCellOpacity: setCellOpacityFixed, cellOpacityMode, setCellOpacityMode, cellSetLabelsVisible, setCellSetLabelsVisible, cellSetLabelSize, setCellSetLabelSize, cellSetPolygonsVisible, setCellSetPolygonsVisible, cellColorEncoding, setCellColorEncoding, geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, children: jsxRuntimeExports.jsx(GatingScatterplotOptions, { featureType, gatingFeatureSelectionX, setGatingFeatureSelectionX, gatingFeatureSelectionY, setGatingFeatureSelectionY, gatingFeatureValueTransform: featureValueTransform, setGatingFeatureValueTransform: (newValue) => {
188310
188461
  setFeatureValueTransform(newValue);
188311
188462
  setTargetX(null);
188312
188463
  setTargetY(null);
@@ -205248,8 +205399,7 @@ class ZarritaPixelSource extends ZarrPixelSource {
205248
205399
  this._readChunks = false;
205249
205400
  }
205250
205401
  }
205251
- async function loadOmeZarr(url, requestInit2) {
205252
- const root2 = await zarrOpenRoot(url, requestInit2);
205402
+ async function loadOmeZarr(root2) {
205253
205403
  const { data: data2, rootAttrs, labels: labels2 } = await loadMultiscales(root2);
205254
205404
  const tileSize = guessTileSize(data2[0]);
205255
205405
  const pyramid = data2.map((arr) => new ZarritaPixelSource(createZarrArrayAdapter(arr), labels2, tileSize));
@@ -206085,7 +206235,7 @@ function SpatialTooltipSubscriber$1(props2) {
206085
206235
  return cellInfo ? jsxRuntimeExports.jsx(Tooltip2D, { x: x2, y: y2, parentUuid, sourceUuid, parentWidth: width2, parentHeight: height2, children: jsxRuntimeExports.jsx(TooltipContent, { info: cellInfo }) }) : null;
206086
206236
  }
206087
206237
  function SpatialSubscriber$1(props2) {
206088
- const { uuid, coordinationScopes, removeGridComponent, observationsLabelOverride, subobservationsLabelOverride: subobservationsLabel = "molecule", theme, title: title2 = "Spatial", disable3d, globalDisable3d, useFullResolutionImage = {}, channelNamesVisible = false } = props2;
206238
+ const { uuid, coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, observationsLabelOverride, subobservationsLabelOverride: subobservationsLabel = "molecule", theme, title: title2 = "Spatial", disable3d, globalDisable3d, useFullResolutionImage = {}, channelNamesVisible = false } = props2;
206089
206239
  const loaders = useLoaders();
206090
206240
  const setComponentHover = useSetComponentHover();
206091
206241
  const setComponentViewInfo = useSetComponentViewInfo(uuid);
@@ -206331,7 +206481,7 @@ function SpatialSubscriber$1(props2) {
206331
206481
  }
206332
206482
  return [names, colors2];
206333
206483
  }, [imageLayers, imageLayerLoaders]);
206334
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, removeGridComponent, isReady, options, children: [jsxRuntimeExports.jsx("div", { style: {
206484
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady, options, children: [jsxRuntimeExports.jsx("div", { style: {
206335
206485
  position: "absolute",
206336
206486
  bottom: "5px",
206337
206487
  left: "5px",
@@ -206590,6 +206740,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
206590
206740
  this.prevSpotSetColor = {};
206591
206741
  this.prevSpotSetSelection = {};
206592
206742
  this.segmentationToMatrixIndexMap = {};
206743
+ this.segmentationToMatrixIndexArr = {};
206593
206744
  this.segmentationColors = {};
206594
206745
  this.segmentationExpressionGetters = {};
206595
206746
  this.prevSegmentationSetColor = {};
@@ -206847,7 +206998,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
206847
206998
  return spatialRenderingMode === "3D";
206848
206999
  }
206849
207000
  // New createImageLayer function.
206850
- createBitmaskSegmentationLayer(layerScope, layerCoordination, channelScopes, channelCoordination, image2, layerFeatureValues) {
207001
+ createBitmaskSegmentationLayer(layerScope, layerCoordination, channelScopes, channelCoordination, image2, layerFeatureValues, layerMatrixObsIndices, bitmaskValueIsIndex) {
206851
207002
  const { delegateHover, targetT, targetZ } = this.props;
206852
207003
  const data2 = image2?.obsSegmentations?.instance?.getData();
206853
207004
  if (!data2) {
@@ -206888,6 +207039,11 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
206888
207039
  modelMatrix: layerDefModelMatrix,
206889
207040
  // hoveredCell: Number(this.props.cellHighlight),
206890
207041
  multiFeatureValues: channelScopes.map((cScope) => layerFeatureValues?.[cScope]?.[0] || []),
207042
+ // Pass in the matrixObsIndex to account for the fact that
207043
+ // the obsIndex of the obsFeatureMatrix
207044
+ // may not be ["1", "2", "3", "4", ... "N"] and
207045
+ // instead may be ["3", "20", "4", "6"].
207046
+ multiMatrixObsIndex: channelScopes.map((cScope) => bitmaskValueIsIndex ? null : layerMatrixObsIndices?.[cScope] || null),
206891
207047
  setColorValues: channelScopes.map((cScope) => this.segmentationColors?.[layerScope]?.[cScope] || []),
206892
207048
  renderSubLayers: renderSubBitmaskLayers,
206893
207049
  loader: data2,
@@ -207030,12 +207186,22 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
207030
207186
  });
207031
207187
  }
207032
207188
  createSegmentationLayers() {
207033
- const { obsSegmentations = {}, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, segmentationLayerCallbacks = [], segmentationMultiExpressionData } = this.props;
207189
+ const { obsSegmentations = {}, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, segmentationLayerCallbacks = [], segmentationMultiExpressionData, bitmaskValueIsIndex } = this.props;
207034
207190
  return segmentationLayerScopes.map((layerScope) => {
207035
207191
  if (obsSegmentations[layerScope]) {
207036
207192
  const { obsSegmentationsType } = obsSegmentations[layerScope];
207037
207193
  if (obsSegmentationsType === "bitmask") {
207038
- return this.createBitmaskSegmentationLayer(layerScope, segmentationLayerCoordination[0][layerScope], segmentationChannelScopesByLayer[layerScope], segmentationChannelCoordination[0][layerScope], obsSegmentations[layerScope], segmentationMultiExpressionData?.[layerScope]);
207194
+ return this.createBitmaskSegmentationLayer(
207195
+ layerScope,
207196
+ segmentationLayerCoordination[0][layerScope],
207197
+ segmentationChannelScopesByLayer[layerScope],
207198
+ segmentationChannelCoordination[0][layerScope],
207199
+ obsSegmentations[layerScope],
207200
+ segmentationMultiExpressionData?.[layerScope],
207201
+ this.segmentationToMatrixIndexArr?.[layerScope],
207202
+ // TODO: get this from the layer coordination.
207203
+ bitmaskValueIsIndex
207204
+ );
207039
207205
  }
207040
207206
  if (obsSegmentationsType === "polygon") {
207041
207207
  return this.createPolygonSegmentationLayer(layerScope, segmentationLayerCoordination[0][layerScope], segmentationChannelScopesByLayer[layerScope], segmentationChannelCoordination[0][layerScope], obsSegmentations[layerScope], segmentationMultiExpressionData?.[layerScope]);
@@ -207203,6 +207369,12 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
207203
207369
  }
207204
207370
  this.segmentationToMatrixIndexMap[layerScope][channelScope] = instanceObsIndex.map((key2) => matrixIndexMap.get(key2));
207205
207371
  }
207372
+ if (matrixObsIndex) {
207373
+ if (!this.segmentationToMatrixIndexArr[layerScope]) {
207374
+ this.segmentationToMatrixIndexArr[layerScope] = {};
207375
+ }
207376
+ this.segmentationToMatrixIndexArr[layerScope][channelScope] = matrixObsIndex;
207377
+ }
207206
207378
  }
207207
207379
  onUpdateAllSegmentationsIndexData() {
207208
207380
  const { segmentationLayerScopes, segmentationChannelScopesByLayer } = this.props;
@@ -207218,7 +207390,7 @@ class Spatial2 extends AbstractSpatialOrScatterplot {
207218
207390
  const expressionData = segmentationMultiExpressionData?.[layerScope]?.[channelScope];
207219
207391
  const toMatrixIndexMap = this.segmentationToMatrixIndexMap?.[layerScope]?.[channelScope];
207220
207392
  const getExpressionValue = (entry2, { index: instanceIndex }) => {
207221
- if (toMatrixIndexMap && expressionData && expressionData[0]) {
207393
+ if (expressionData && expressionData[0]) {
207222
207394
  const rowIndex = toMatrixIndexMap[instanceIndex];
207223
207395
  const val = expressionData[0][rowIndex];
207224
207396
  return val;
@@ -207663,10 +207835,25 @@ function getHoverData(hoverInfo, layerType) {
207663
207835
  return null;
207664
207836
  }
207665
207837
  function SpatialSubscriber(props2) {
207666
- const { uuid, coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, removeGridComponent, observationsLabelOverride, subobservationsLabelOverride: subobservationsLabel = "molecule", theme, disableTooltip = false, title: title2 = "Spatial" } = props2;
207838
+ const {
207839
+ uuid,
207840
+ coordinationScopes: coordinationScopesRaw,
207841
+ coordinationScopesBy: coordinationScopesByRaw,
207842
+ closeButtonVisible,
207843
+ downloadButtonVisible,
207844
+ removeGridComponent,
207845
+ observationsLabelOverride,
207846
+ subobservationsLabelOverride: subobservationsLabel = "molecule",
207847
+ theme,
207848
+ disableTooltip = false,
207849
+ title: title2 = "Spatial",
207850
+ bitmaskValueIsIndex = false
207851
+ // TODO: move to coordination type
207852
+ } = props2;
207667
207853
  const loaders = useLoaders();
207668
207854
  const setComponentHover = useSetComponentHover();
207669
207855
  const setComponentViewInfo = useSetComponentViewInfo(uuid);
207856
+ const mergeCoordination = useMergeCoordination();
207670
207857
  const coordinationScopes = useCoordinationScopes(coordinationScopesRaw);
207671
207858
  const coordinationScopesBy = useCoordinationScopesBy(coordinationScopes, coordinationScopesByRaw);
207672
207859
  const [{ dataset, obsType, featureType, featureValueType, spatialZoom: zoom2, spatialTargetX: targetX2, spatialTargetY: targetY2, spatialTargetZ: targetZ, spatialTargetT: targetT, spatialRenderingMode, spatialRotationX: rotationX, spatialRotationOrbit: rotationOrbit, spatialOrbitAxis: orbitAxis, spatialAxisFixed }, { setSpatialZoom: setZoom, setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.SPATIAL_BETA], coordinationScopes);
@@ -207763,18 +207950,18 @@ function SpatialSubscriber(props2) {
207763
207950
  ], coordinationScopes, coordinationScopesBy, CoordinationType$2.POINT_LAYER);
207764
207951
  const is3dMode = spatialRenderingMode === "3D";
207765
207952
  const [width2, height2, deckRef] = useDeckCanvasSize();
207766
- const [obsPointsData, obsPointsDataStatus, obsPointsUrls] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset);
207953
+ const [obsPointsData, obsPointsDataStatus, obsPointsUrls] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
207767
207954
  const [pointMultiObsLabelsData, pointMultiObsLabelsDataStatus] = usePointMultiObsLabels(coordinationScopes, coordinationScopesBy, loaders, dataset);
207768
- const [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset);
207955
+ const [obsSpotsData, obsSpotsDataStatus, obsSpotsUrls] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
207769
207956
  const [obsSpotsSetsData, obsSpotsSetsDataStatus] = useSpotMultiObsSets(coordinationScopes, coordinationScopesBy, loaders, dataset);
207770
207957
  const [spotMultiExpressionData, spotMultiLoadedFeatureSelection, spotMultiExpressionExtents, spotMultiExpressionNormData, spotMultiFeatureSelectionStatus] = useSpotMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset);
207771
207958
  const [spotMultiIndicesData, spotMultiIndicesDataStatus] = useSpotMultiObsFeatureMatrixIndices(coordinationScopes, coordinationScopesBy, loaders, dataset);
207772
207959
  const [obsSegmentationsLocationsData, obsSegmentationsLocationsDataStatus] = useSegmentationMultiObsLocations(coordinationScopes, coordinationScopesBy, loaders, dataset);
207773
- const [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset);
207960
+ const [obsSegmentationsData, obsSegmentationsDataStatus, obsSegmentationsUrls] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
207774
207961
  const [obsSegmentationsSetsData, obsSegmentationsSetsDataStatus] = useSegmentationMultiObsSets(coordinationScopes, coordinationScopesBy, loaders, dataset);
207775
207962
  const [segmentationMultiExpressionData, segmentationMultiLoadedFeatureSelection, segmentationMultiExpressionExtents, segmentationMultiExpressionNormData, segmentationMultiFeatureSelectionStatus] = useSegmentationMultiFeatureSelection(coordinationScopes, coordinationScopesBy, loaders, dataset);
207776
207963
  const [segmentationMultiIndicesData, segmentationMultiIndicesDataStatus] = useSegmentationMultiObsFeatureMatrixIndices(coordinationScopes, coordinationScopesBy, loaders, dataset);
207777
- const [imageData, imageDataStatus, imageUrls] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset);
207964
+ const [imageData, imageDataStatus, imageUrls] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
207778
207965
  const isReadyToComputeInitialViewState = useReady([
207779
207966
  obsPointsDataStatus,
207780
207967
  obsSpotsDataStatus,
@@ -207935,7 +208122,7 @@ function SpatialSubscriber(props2) {
207935
208122
  if (layerType === "segmentation-bitmask") {
207936
208123
  const { obsIndex } = segmentationMultiIndicesData?.[segmentationLayerScope]?.[channelScope] || {};
207937
208124
  obsI -= 1;
207938
- if (obsIndex) {
208125
+ if (obsIndex && bitmaskValueIsIndex) {
207939
208126
  obsId = obsIndex?.[obsI];
207940
208127
  } else {
207941
208128
  obsId = String(obsI);
@@ -207999,7 +208186,7 @@ function SpatialSubscriber(props2) {
207999
208186
  return false;
208000
208187
  });
208001
208188
  const isSelectable = spotLayerScopes.length > 0 || pointLayerScopes.length > 0 || segmentationLayerScopes.flatMap((layerScope) => segmentationChannelScopesByLayer[layerScope].map((channelScope) => obsSegmentationsLocationsData?.[layerScope]?.[channelScope])).length > 0;
208002
- return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, removeGridComponent, isReady, children: [jsxRuntimeExports.jsx(SpatialWrapper, {
208189
+ return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: subtitle, isSpatial: true, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady, children: [jsxRuntimeExports.jsx(SpatialWrapper, {
208003
208190
  ref: deckRef,
208004
208191
  uuid,
208005
208192
  width: width2,
@@ -208044,6 +208231,7 @@ function SpatialSubscriber(props2) {
208044
208231
  obsSegmentationsSets: obsSegmentationsSetsData,
208045
208232
  segmentationMatrixIndices: segmentationMultiIndicesData,
208046
208233
  segmentationMultiExpressionData: segmentationMultiExpressionNormData,
208234
+ bitmaskValueIsIndex,
208047
208235
  // Images
208048
208236
  images: imageData,
208049
208237
  imageLayerScopes,
@@ -208962,7 +209150,7 @@ function HeatmapOptions(props2) {
208962
209150
  }) })] }), jsxRuntimeExports.jsxs(TableRow$1, { children: [jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: jsxRuntimeExports.jsx("label", { htmlFor: `heatmap-gene-expression-colormap-range-${heatmapOptionsId}`, children: "Gene Expression Colormap Range" }) }), jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: jsxRuntimeExports.jsx(Slider$1, { classes: { root: classes.slider, valueLabel: classes.sliderValueLabel }, value: geneExpressionColormapRange, onChange: handleColormapRangeChangeDebounced, getAriaLabel: (index2) => index2 === 0 ? "Low value colormap range slider" : "High value colormap range slider", id: `heatmap-gene-expression-colormap-range-${heatmapOptionsId}`, valueLabelDisplay: "auto", step: 5e-3, min: 0, max: 1 }) })] })] });
208963
209151
  }
208964
209152
  function HeatmapSubscriber(props2) {
208965
- const { uuid, coordinationScopes, removeGridComponent, theme, transpose: transpose2, observationsLabelOverride, variablesLabelOverride, title: title2 = "Heatmap" } = props2;
209153
+ const { uuid, coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, transpose: transpose2, observationsLabelOverride, variablesLabelOverride, title: title2 = "Heatmap" } = props2;
208966
209154
  const loaders = useLoaders();
208967
209155
  const setComponentHover = useSetComponentHover();
208968
209156
  const setComponentViewInfo = useSetComponentViewInfo(uuid);
@@ -209038,7 +209226,7 @@ function HeatmapSubscriber(props2) {
209038
209226
  ], [observationsLabel]);
209039
209227
  const selectedCount = cellColors.size;
209040
209228
  return jsxRuntimeExports.jsxs(TitleInfo, { title: title2, info: `${commaNumber(cellsCount)} ${pluralize(observationsLabel, cellsCount)} × ${commaNumber(genesCount)} ${pluralize(variablesLabel, genesCount)},
209041
- with ${commaNumber(selectedCount)} ${pluralize(observationsLabel, selectedCount)} selected`, urls: urls2, theme, removeGridComponent, isReady: isReady && !isRendering, options: jsxRuntimeExports.jsx(HeatmapOptions, { geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, tooltipsVisible, setTooltipsVisible }), children: [jsxRuntimeExports.jsx(Heatmap$1, { ref: deckRef, transpose: transpose2, viewState: { zoom: zoomX, target: [targetX2, targetY2] }, setViewState: ({ zoom: zoom2, target: target2 }) => {
209229
+ with ${commaNumber(selectedCount)} ${pluralize(observationsLabel, selectedCount)} selected`, urls: urls2, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, isReady: isReady && !isRendering, options: jsxRuntimeExports.jsx(HeatmapOptions, { geneExpressionColormap, setGeneExpressionColormap, geneExpressionColormapRange, setGeneExpressionColormapRange, tooltipsVisible, setTooltipsVisible }), children: [jsxRuntimeExports.jsx(Heatmap$1, { ref: deckRef, transpose: transpose2, viewState: { zoom: zoomX, target: [targetX2, targetY2] }, setViewState: ({ zoom: zoom2, target: target2 }) => {
209042
209230
  setZoomX(zoom2);
209043
209231
  setZoomY(zoom2);
209044
209232
  setTargetX(target2[0]);
@@ -213440,7 +213628,7 @@ function FeatureListOptions(props2) {
213440
213628
  } }) })] })] }) : null] });
213441
213629
  }
213442
213630
  function FeatureListSubscriber(props2) {
213443
- const { coordinationScopes, removeGridComponent, variablesLabelOverride, theme, title: titleOverride, enableMultiSelect = false, showTable = false, sort: sort2 = "alphabetical", sortKey: sortKey2 = null } = props2;
213631
+ const { coordinationScopes, removeGridComponent, variablesLabelOverride, theme, title: titleOverride, enableMultiSelect = false, showTable = false, sort: sort2 = "alphabetical", sortKey: sortKey2 = null, closeButtonVisible, downloadButtonVisible } = props2;
213444
213632
  const loaders = useLoaders();
213445
213633
  const [{ dataset, obsType, featureType, featureSelection: geneSelection, featureFilter: geneFilter, obsColorEncoding: cellColorEncoding }, { setFeatureSelection: setGeneSelection, setFeatureFilter: setGeneFilter, setFeatureHighlight: setGeneHighlight, setObsColorEncoding: setCellColorEncoding }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.FEATURE_LIST], coordinationScopes);
213446
213634
  const variablesLabel = variablesLabelOverride || featureType;
@@ -213475,6 +213663,8 @@ function FeatureListSubscriber(props2) {
213475
213663
  // even though this no longer uses the TitleInfo component's
213476
213664
  // scroll css (SelectableTable is virtual scroll).
213477
213665
  isScroll: true,
213666
+ closeButtonVisible,
213667
+ downloadButtonVisible,
213478
213668
  removeGridComponent,
213479
213669
  isReady,
213480
213670
  urls: urls2,
@@ -213915,8 +214105,8 @@ const Slicer = ({ xSlice, ySlice, zSlice, handleSlicerSetting, loader: loader2,
213915
214105
  ]
213916
214106
  ];
213917
214107
  const classes = useSlicerStyles();
213918
- const Slicers = sliceValuesAndSetSliceFunctions.map(([val, setVal, label2, [min2, max2]]) => jsxRuntimeExports.jsxs(Grid$3, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "center", children: [jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 1, children: jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginBottom: 0 }, variant: "h2", children: [label2, ":"] }) }), jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 11, children: jsxRuntimeExports.jsx(Slider$1, { disabled: !use3d, className: !use3d ? classes.disabled : classes.enabled, value: val, onChange: (e3, v) => setVal(v), valueLabelDisplay: "auto", valueLabelFormat: (v) => abbreviateNumber(v), "aria-label": `Volume options ${label2} slider`, min: min2, max: max2, step: 5e-3, orientation: "horizontal" }) })] }, label2));
213919
- return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginTop: 16, marginBottom: 0 }, variant: "h2", children: ["Clipping Planes:", " "] }), " ", Slicers] });
214108
+ const Slicers = sliceValuesAndSetSliceFunctions.map(([val, setVal, label2, [min2, max2]]) => jsxRuntimeExports.jsxs(Grid$3, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "center", children: [jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 1, children: jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginBottom: 0 }, children: [label2, ":"] }) }), jsxRuntimeExports.jsx(Grid$3, { item: true, xs: 11, children: jsxRuntimeExports.jsx(Slider$1, { disabled: !use3d, className: !use3d ? classes.disabled : classes.enabled, value: val, onChange: (e3, v) => setVal(v), valueLabelDisplay: "auto", valueLabelFormat: (v) => abbreviateNumber(v), "aria-label": `Volume options ${label2} slider`, min: min2, max: max2, step: 5e-3, orientation: "horizontal" }) })] }, label2));
214109
+ return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Typography$1, { className: !use3d ? classes.disabled : classes.enabled, style: { marginTop: 16, marginBottom: 0 }, children: ["Clipping Planes:", " "] }), " ", Slicers] });
213920
214110
  };
213921
214111
  const renderingOptions = Object.values(RENDERING_MODES);
213922
214112
  function RenderingModeSelect({ handleRenderingModeChange, renderingMode, use3d }) {
@@ -214251,6 +214441,8 @@ function ImageAddButton({ imageOptions, handleImageAdd }) {
214251
214441
  const LayerControllerMemoized = React__default.memo(forwardRef((props2, ref2) => {
214252
214442
  const {
214253
214443
  title: title2,
214444
+ closeButtonVisible,
214445
+ downloadButtonVisible,
214254
214446
  removeGridComponent,
214255
214447
  theme,
214256
214448
  isReady,
@@ -214296,7 +214488,7 @@ const LayerControllerMemoized = React__default.memo(forwardRef((props2, ref2) =>
214296
214488
  enableLayerButtonsWithOneLayer
214297
214489
  } = props2;
214298
214490
  const shouldShowImageLayerButton = Boolean(enableLayerButtonsWithOneLayer || imageLayerLoaders?.length > 1);
214299
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsxs("div", { className: "layer-controller-container", ref: ref2, children: [moleculesLayer && jsxRuntimeExports.jsx(VectorLayerController, { label: "Molecules", layerType: "molecules", layer: moleculesLayer, handleLayerChange: setMoleculesLayer }, `${dataset}-molecules`), cellsLayer && obsSegmentationsType === "polygon" && jsxRuntimeExports.jsx(VectorLayerController, { label: `${capitalize$2(obsType)} Segmentations`, layerType: "cells", layer: cellsLayer, handleLayerChange: setCellsLayer }, `${dataset}-cells`), cellsLayer && obsSegmentationsType === "bitmask" && cellsLayer.map((layer, i2) => {
214491
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsxs("div", { className: "layer-controller-container", ref: ref2, children: [moleculesLayer && jsxRuntimeExports.jsx(VectorLayerController, { label: "Molecules", layerType: "molecules", layer: moleculesLayer, handleLayerChange: setMoleculesLayer }, `${dataset}-molecules`), cellsLayer && obsSegmentationsType === "polygon" && jsxRuntimeExports.jsx(VectorLayerController, { label: `${capitalize$2(obsType)} Segmentations`, layerType: "cells", layer: cellsLayer, handleLayerChange: setCellsLayer }, `${dataset}-cells`), cellsLayer && obsSegmentationsType === "bitmask" && cellsLayer.map((layer, i2) => {
214300
214492
  const { index: index2 } = layer;
214301
214493
  const loader2 = segmentationLayerLoaders?.[index2];
214302
214494
  const layerMeta = segmentationLayerMeta?.[index2];
@@ -214411,7 +214603,7 @@ const LayerControllerMemoized = React__default.memo(forwardRef((props2, ref2) =>
214411
214603
  }), shouldShowImageLayerButton ? jsxRuntimeExports.jsx(Grid$3, { item: true, children: jsxRuntimeExports.jsx(ImageAddButton, { imageOptions: imageLayerMeta, handleImageAdd }) }) : null] }) });
214412
214604
  }));
214413
214605
  function LayerControllerSubscriber$1(props2) {
214414
- const { coordinationScopes, removeGridComponent, theme, title: title2 = "Spatial Layers", disable3d, globalDisable3d, disableChannelsIfRgbDetected, enableLayerButtonsWithOneLayer } = props2;
214606
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: title2 = "Spatial Layers", disable3d, globalDisable3d, disableChannelsIfRgbDetected, enableLayerButtonsWithOneLayer } = props2;
214415
214607
  const loaders = useLoaders();
214416
214608
  const [{ dataset, obsType, spatialImageLayer: rasterLayers, spatialSegmentationLayer: cellsLayer, spatialPointLayer: moleculesLayer }, { setSpatialImageLayer: setRasterLayers, setSpatialSegmentationLayer: setCellsLayer, setSpatialPointLayer: setMoleculesLayer, setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.LAYER_CONTROLLER], coordinationScopes);
214417
214609
  const [{ imageLayerCallbacks, areLoadingImageChannels, segmentationLayerCallbacks, areLoadingSegmentationChannels }, { setImageLayerCallbacks, setAreLoadingImageChannels, setSegmentationLayerCallbacks, setAreLoadingSegmentationChannels }] = useAuxiliaryCoordination(COMPONENT_COORDINATION_TYPES.layerController, coordinationScopes);
@@ -214467,6 +214659,8 @@ function LayerControllerSubscriber$1(props2) {
214467
214659
  return jsxRuntimeExports.jsx(LayerControllerMemoized, {
214468
214660
  ref: layerControllerRef,
214469
214661
  title: title2,
214662
+ closeButtonVisible,
214663
+ downloadButtonVisible,
214470
214664
  removeGridComponent,
214471
214665
  theme,
214472
214666
  isReady,
@@ -215069,8 +215263,9 @@ function LayerController(props2) {
215069
215263
  return jsxRuntimeExports.jsxs("div", { children: [anyLayerHasZ ? jsxRuntimeExports.jsx(GlobalDimensionSlider, { label: "Z", targetValue: targetZ, setTargetValue: setTargetZ, max: maxZ, spatialRenderingMode, setSpatialRenderingMode }) : null, anyLayerHasT ? jsxRuntimeExports.jsx(GlobalDimensionSlider, { label: "T", targetValue: targetT, setTargetValue: setTargetT, max: maxT }) : null, pointLayerScopes && reversedPointLayerScopes.map((layerScope) => jsxRuntimeExports.jsx(PointLayerController, { theme, layerScope, layerCoordination: pointLayerCoordination[0][layerScope], setLayerCoordination: pointLayerCoordination[1][layerScope] }, layerScope)), spotLayerScopes && reversedSpotLayerScopes.map((layerScope) => jsxRuntimeExports.jsx(SpotLayerController, { theme, layerScope, layerCoordination: spotLayerCoordination[0][layerScope], setLayerCoordination: spotLayerCoordination[1][layerScope] }, layerScope)), segmentationLayerScopes && reversedSegmentationLayerScopes.map((layerScope) => jsxRuntimeExports.jsx(SegmentationLayerController, { theme, layerScope, layerCoordination: segmentationLayerCoordination[0][layerScope], setLayerCoordination: segmentationLayerCoordination[1][layerScope], channelScopes: segmentationChannelScopesByLayer[layerScope], channelCoordination: segmentationChannelCoordination[0][layerScope], setChannelCoordination: segmentationChannelCoordination[1][layerScope] }, layerScope)), imageLayerScopes && reversedImageLayerScopes.map((layerScope) => jsxRuntimeExports.jsx(ImageLayerController, { theme, coordinationScopesRaw, layerScope, layerCoordination: imageLayerCoordination[0][layerScope], setLayerCoordination: imageLayerCoordination[1][layerScope], channelScopes: imageChannelScopesByLayer[layerScope], channelCoordination: imageChannelCoordination[0][layerScope], setChannelCoordination: imageChannelCoordination[1][layerScope], image: images[layerScope]?.image?.instance, featureIndex: images[layerScope]?.featureIndex, targetT, targetZ, spatialRenderingMode }, layerScope))] });
215070
215264
  }
215071
215265
  function LayerControllerSubscriber(props2) {
215072
- const { coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, removeGridComponent, theme, title: title2 = "Spatial Layers" } = props2;
215266
+ const { coordinationScopes: coordinationScopesRaw, coordinationScopesBy: coordinationScopesByRaw, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: title2 = "Spatial Layers", uuid } = props2;
215073
215267
  const loaders = useLoaders();
215268
+ const mergeCoordination = useMergeCoordination();
215074
215269
  const coordinationScopes = useCoordinationScopes(coordinationScopesRaw);
215075
215270
  const coordinationScopesBy = useCoordinationScopesBy(coordinationScopes, coordinationScopesByRaw);
215076
215271
  const [{ dataset, spatialTargetT: targetT, spatialTargetZ: targetZ, spatialRenderingMode }, { setSpatialTargetX: setTargetX, setSpatialTargetY: setTargetY, setSpatialTargetZ: setTargetZ, setSpatialTargetT: setTargetT, setSpatialRotationX: setRotationX, setSpatialRotationOrbit: setRotationOrbit, setSpatialZoom: setZoom, setSpatialRenderingMode }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.LAYER_CONTROLLER_BETA], coordinationScopes);
@@ -215160,17 +215355,17 @@ function LayerControllerSubscriber(props2) {
215160
215355
  const layerControllerRef = useRef();
215161
215356
  useClosestVitessceContainerSize(layerControllerRef);
215162
215357
  useWindowDimensions();
215163
- const [obsSegmentationsData, obsSegmentationsDataStatus] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset);
215164
- const [imageData, imageDataStatus] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset);
215165
- const [obsSpotsData, obsSpotsDataStatus] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset);
215166
- const [obsPointsData, obsPointsDataStatus] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset);
215358
+ const [obsSegmentationsData, obsSegmentationsDataStatus] = useMultiObsSegmentations(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
215359
+ const [imageData, imageDataStatus] = useMultiImages(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
215360
+ const [obsSpotsData, obsSpotsDataStatus] = useMultiObsSpots(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
215361
+ const [obsPointsData, obsPointsDataStatus] = useMultiObsPoints(coordinationScopes, coordinationScopesBy, loaders, dataset, mergeCoordination, uuid);
215167
215362
  const isReady = useReady([
215168
215363
  obsSpotsDataStatus,
215169
215364
  obsPointsDataStatus,
215170
215365
  obsSegmentationsDataStatus,
215171
215366
  imageDataStatus
215172
215367
  ]);
215173
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsx(LayerController, { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images: imageData, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination }) });
215368
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, isScroll: true, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, children: jsxRuntimeExports.jsx(LayerController, { theme, coordinationScopesRaw, segmentationLayerScopes, segmentationLayerCoordination, segmentationChannelScopesByLayer, segmentationChannelCoordination, images: imageData, imageLayerScopes, imageLayerCoordination, targetT, targetZ, setTargetT, setTargetZ, spatialRenderingMode, setSpatialRenderingMode, imageChannelScopesByLayer, imageChannelCoordination, spotLayerScopes, spotLayerCoordination, pointLayerScopes, pointLayerCoordination }) });
215174
215369
  }
215175
215370
  const useStyles$3 = makeStyles(() => ({
215176
215371
  info: {
@@ -215204,7 +215399,7 @@ function Status(props2) {
215204
215399
  return messages2;
215205
215400
  }
215206
215401
  function StatusSubscriber(props2) {
215207
- const { coordinationScopes, removeGridComponent, theme, title: title2 = "Status" } = props2;
215402
+ const { coordinationScopes, closeButtonVisible, removeGridComponent, theme, title: title2 = "Status" } = props2;
215208
215403
  const [{ obsHighlight: cellHighlight, featureHighlight: geneHighlight, moleculeHighlight }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.STATUS], coordinationScopes);
215209
215404
  const warn2 = useWarning();
215210
215405
  const infos = [
@@ -215213,7 +215408,7 @@ function StatusSubscriber(props2) {
215213
215408
  ...moleculeHighlight ? [`Hovered gene ${moleculeHighlight}`] : []
215214
215409
  ];
215215
215410
  const info2 = infos.join("; ");
215216
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, theme, removeGridComponent, isScroll: true, isReady: true, children: jsxRuntimeExports.jsx(Status, { warn: warn2, info: info2 }) });
215411
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, theme, closeButtonVisible, removeGridComponent, isScroll: true, isReady: true, children: jsxRuntimeExports.jsx(Status, { warn: warn2, info: info2 }) });
215217
215412
  }
215218
215413
  window.higlassTracks = window.higlassTracks || {};
215219
215414
  window.higlassTracksByType = window.higlassTracksByType || {};
@@ -215465,7 +215660,7 @@ const HIGLASS_BUNDLE_VERSION = "1.11.13";
215465
215660
  const HIGLASS_CSS_URL = `https://unpkg.com/${HIGLASS_PKG_NAME}@${HIGLASS_BUNDLE_VERSION}/dist/hglib.css`;
215466
215661
  register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
215467
215662
  const LazyHiGlassComponent = React__default.lazy(async () => {
215468
- const { HiGlassComponent } = await import("./hglib-3a7613d1.js").then((n3) => n3.h);
215663
+ const { HiGlassComponent } = await import("./hglib-8cc3a278.js").then((n3) => n3.h);
215469
215664
  return { default: HiGlassComponent };
215470
215665
  });
215471
215666
  const HG_SIZE = 800;
@@ -215594,10 +215789,10 @@ HiGlassLazy.defaultProps = {
215594
215789
  };
215595
215790
  const urls = [];
215596
215791
  function HiGlassSubscriber(props2) {
215597
- const { coordinationScopes, theme, hgViewConfig, removeGridComponent } = props2;
215792
+ const { coordinationScopes, theme, hgViewConfig, closeButtonVisible, downloadButtonVisible, removeGridComponent } = props2;
215598
215793
  const [width2, height2, containerRef] = useGridItemSize();
215599
215794
  const classes = useStyles$2();
215600
- return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: "HiGlass", removeGridComponent, theme, isReady: true, urls, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) }) }) });
215795
+ return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: "HiGlass", closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady: true, urls, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) }) }) });
215601
215796
  }
215602
215797
  const REFERENCE_TILESETS = {
215603
215798
  hg38: {
@@ -215618,7 +215813,7 @@ const REFERENCE_TILESETS = {
215618
215813
  }
215619
215814
  };
215620
215815
  function GenomicProfilesSubscriber(props2) {
215621
- const { coordinationScopes, theme, removeGridComponent, profileTrackUidKey = "path", profileTrackNameKey = null, higlassServer = "https://higlass.io/api/v1", assembly = "hg38", title: title2 = "Genomic Profiles" } = props2;
215816
+ const { coordinationScopes, theme, closeButtonVisible, downloadButtonVisible, removeGridComponent, profileTrackUidKey = "path", profileTrackNameKey = null, higlassServer = "https://higlass.io/api/v1", assembly = "hg38", title: title2 = "Genomic Profiles" } = props2;
215622
215817
  const [width2, height2, containerRef] = useGridItemSize();
215623
215818
  const loaders = useLoaders();
215624
215819
  const [{ dataset, obsSetColor: cellSetColor, obsSetSelection: cellSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.GENOMIC_PROFILES], coordinationScopes);
@@ -215748,7 +215943,7 @@ function GenomicProfilesSubscriber(props2) {
215748
215943
  assembly
215749
215944
  ]);
215750
215945
  const classes = useStyles$2();
215751
- return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: title2, removeGridComponent, theme, isReady, urls: urls2, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: hgViewConfig ? jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) : null }) }) });
215946
+ return jsxRuntimeExports.jsx("div", { className: classes.higlassTitleWrapper, children: jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, isReady, urls: urls2, children: jsxRuntimeExports.jsx("div", { className: classes.higlassLazyWrapper, ref: containerRef, children: hgViewConfig ? jsxRuntimeExports.jsx(HiGlassLazy, { coordinationScopes, theme, hgViewConfig, height: height2 }) : null }) }) });
215752
215947
  }
215753
215948
  function CellSetExpressionPlotOptions(props2) {
215754
215949
  const { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions } = props2;
@@ -272402,7 +272597,7 @@ function useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCe
272402
272597
  return [expressionArr, setArr, expressionMax];
272403
272598
  }
272404
272599
  function CellSetExpressionPlotSubscriber(props2) {
272405
- const { coordinationScopes, removeGridComponent, theme } = props2;
272600
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme } = props2;
272406
272601
  const classes = useStyles();
272407
272602
  const loaders = useLoaders();
272408
272603
  const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, featureValueTransform, featureValueTransformCoefficient, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets }, { setFeatureValueTransform, setFeatureValueTransformCoefficient }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.OBS_SET_FEATURE_VALUE_DISTRIBUTION], coordinationScopes);
@@ -272426,7 +272621,7 @@ function CellSetExpressionPlotSubscriber(props2) {
272426
272621
  const [expressionArr, setArr, expressionMax] = useExpressionByCellSet(expressionData, obsIndex, cellSets, additionalCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient, theme);
272427
272622
  const firstGeneSelected = geneSelection && geneSelection.length >= 1 ? featureLabelsMap?.get(geneSelection[0]) || geneSelection[0] : null;
272428
272623
  const selectedTransformName = transformOptions.find((o2) => o2.value === featureValueTransform)?.name;
272429
- return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression by ${capitalize$2(obsType)} Set${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(CellSetExpressionPlotOptions, { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions }), children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: expressionArr ? jsxRuntimeExports.jsx(CellSetExpressionPlot, { domainMax: expressionMax, colors: setArr, data: expressionArr, theme, width: width2, height: height2, obsType, featureValueType, featureValueTransformName: selectedTransformName }) : jsxRuntimeExports.jsxs("span", { children: ["Select a ", featureType, "."] }) }) });
272624
+ return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression by ${capitalize$2(obsType)} Set${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, options: jsxRuntimeExports.jsx(CellSetExpressionPlotOptions, { featureValueTransform, setFeatureValueTransform, featureValueTransformCoefficient, setFeatureValueTransformCoefficient, transformOptions }), children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: expressionArr ? jsxRuntimeExports.jsx(CellSetExpressionPlot, { domainMax: expressionMax, colors: setArr, data: expressionArr, theme, width: width2, height: height2, obsType, featureValueType, featureValueTransformName: selectedTransformName }) : jsxRuntimeExports.jsxs("span", { children: ["Select a ", featureType, "."] }) }) });
272430
272625
  }
272431
272626
  function CellSetSizesPlot(props2) {
272432
272627
  const { data: rawData, theme, width: width2, height: height2, marginRight = 90, marginBottom = 120, keyLength = 36, obsType, onBarSelect } = props2;
@@ -272546,7 +272741,7 @@ function CellSetSizesPlot(props2) {
272546
272741
  return jsxRuntimeExports.jsx(VegaPlot, { data: data2, spec, signalListeners, getTooltipText });
272547
272742
  }
272548
272743
  function CellSetSizesPlotSubscriber(props2) {
272549
- const { coordinationScopes, removeGridComponent, theme, title: titleOverride } = props2;
272744
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme, title: titleOverride } = props2;
272550
272745
  const classes = useStyles();
272551
272746
  const loaders = useLoaders();
272552
272747
  const [{ dataset, obsType, obsSetSelection: cellSetSelection, obsSetColor: cellSetColor, additionalObsSets: additionalCellSets, obsSetExpansion: cellSetExpansion }, { setObsSetSelection: setCellSetSelection, setObsSetColor: setCellSetColor }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.OBS_SET_SIZES], coordinationScopes);
@@ -272593,7 +272788,7 @@ function CellSetSizesPlotSubscriber(props2) {
272593
272788
  setCellSetSelection([...cellSetSelection, setNamePath]);
272594
272789
  }
272595
272790
  };
272596
- return jsxRuntimeExports.jsx(TitleInfo, { title: title2, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(CellSetSizesPlot, { data: data2, onBarSelect, theme, width: width2, height: height2, obsType }) }) });
272791
+ return jsxRuntimeExports.jsx(TitleInfo, { title: title2, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(CellSetSizesPlot, { data: data2, onBarSelect, theme, width: width2, height: height2, obsType }) }) });
272597
272792
  }
272598
272793
  function ExpressionHistogram(props2) {
272599
272794
  const { geneSelection, data: data2, theme, width: width2, height: height2, marginRight = 90, marginBottom = 50, onSelect } = props2;
@@ -272651,7 +272846,7 @@ function ExpressionHistogram(props2) {
272651
272846
  return jsxRuntimeExports.jsx(VegaPlot, { data: data2, signalListeners, spec });
272652
272847
  }
272653
272848
  function ExpressionHistogramSubscriber(props2) {
272654
- const { coordinationScopes, removeGridComponent, theme } = props2;
272849
+ const { coordinationScopes, closeButtonVisible, downloadButtonVisible, removeGridComponent, theme } = props2;
272655
272850
  const classes = useStyles();
272656
272851
  const loaders = useLoaders();
272657
272852
  const [{ dataset, obsType, featureType, featureValueType, featureSelection: geneSelection, additionalObsSets: additionalCellSets, obsSetColor: cellSetColor }, { setAdditionalObsSets: setAdditionalCellSets, setObsSetColor: setCellSetColor, setObsColorEncoding: setCellColorEncoding, setObsSetSelection: setCellSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.FEATURE_VALUE_HISTOGRAM], coordinationScopes);
@@ -272700,7 +272895,7 @@ function ExpressionHistogramSubscriber(props2) {
272700
272895
  setCellSetSelection,
272701
272896
  firstGeneSelected
272702
272897
  ]);
272703
- return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression Histogram${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(ExpressionHistogram, { geneSelection, onSelect, data: data2, theme, width: width2, height: height2 }) }) });
272898
+ return jsxRuntimeExports.jsx(TitleInfo, { title: `Expression Histogram${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, closeButtonVisible, downloadButtonVisible, removeGridComponent, urls: urls2, theme, isReady, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(ExpressionHistogram, { geneSelection, onSelect, data: data2, theme, width: width2, height: height2 }) }) });
272704
272899
  }
272705
272900
  class CsvSource {
272706
272901
  constructor({ url, requestInit: requestInit2 }) {
@@ -272824,6 +273019,32 @@ class ObsSpotsCsvLoader extends CsvLoader {
272824
273019
  this.cachedResult = { obsIndex, obsSpots };
272825
273020
  return this.cachedResult;
272826
273021
  }
273022
+ async load() {
273023
+ const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
273024
+ if (payload instanceof AbstractLoaderError) {
273025
+ return Promise.reject(payload);
273026
+ }
273027
+ const coordinationValues = {
273028
+ spotLayer: CL({
273029
+ obsType: "spot",
273030
+ // obsColorEncoding: 'spatialLayerColor',
273031
+ // spatialLayerColor: [255, 255, 255],
273032
+ spatialLayerVisible: true,
273033
+ spatialLayerOpacity: 1,
273034
+ spatialSpotRadius: 10
273035
+ // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
273036
+ // after resolving https://github.com/vitessce/vitessce/issues/1760
273037
+ // featureValueColormapRange: [0, 1],
273038
+ // obsHighlight: null,
273039
+ // obsSetColor: null,
273040
+ // obsSetSelection: null,
273041
+ // additionalObsSets: null,
273042
+ })
273043
+ };
273044
+ const { data: data2, url } = payload;
273045
+ const result = this.loadFromCache(data2);
273046
+ return Promise.resolve(new LoaderResult(result, url, coordinationValues));
273047
+ }
272827
273048
  }
272828
273049
  class ObsPointsCsvLoader extends CsvLoader {
272829
273050
  loadFromCache(data2) {
@@ -272841,6 +273062,31 @@ class ObsPointsCsvLoader extends CsvLoader {
272841
273062
  this.cachedResult = { obsIndex, obsPoints };
272842
273063
  return this.cachedResult;
272843
273064
  }
273065
+ async load() {
273066
+ const payload = await this.getSourceData().catch((reason) => Promise.resolve(reason));
273067
+ if (payload instanceof AbstractLoaderError) {
273068
+ return Promise.reject(payload);
273069
+ }
273070
+ const coordinationValues = {
273071
+ pointLayer: CL({
273072
+ obsType: "point",
273073
+ // obsColorEncoding: 'spatialLayerColor',
273074
+ // spatialLayerColor: [255, 255, 255],
273075
+ spatialLayerVisible: true,
273076
+ spatialLayerOpacity: 1
273077
+ // TODO: support a point radius?
273078
+ // featureValueColormapRange: [0, 1],
273079
+ // obsHighlight: null,
273080
+ // obsSetColor: null,
273081
+ // obsSetSelection: null,
273082
+ // additionalObsSets: null,
273083
+ // obsLabelsType: null,
273084
+ })
273085
+ };
273086
+ const { data: data2, url } = payload;
273087
+ const result = this.loadFromCache(data2);
273088
+ return Promise.resolve(new LoaderResult(result, url, coordinationValues));
273089
+ }
272844
273090
  }
272845
273091
  class ObsLocationsCsvLoader extends CsvLoader {
272846
273092
  loadFromCache(data2) {
@@ -273001,9 +273247,34 @@ class ObsSegmentationsJsonLoader extends JsonLoader {
273001
273247
  if (payload instanceof AbstractLoaderError) {
273002
273248
  return Promise.reject(payload);
273003
273249
  }
273250
+ const channelCoordination = [{
273251
+ // obsType: null,
273252
+ spatialChannelColor: [255, 255, 255],
273253
+ spatialChannelVisible: true,
273254
+ spatialChannelOpacity: 1,
273255
+ spatialChannelWindow: null,
273256
+ // featureType: 'feature',
273257
+ // featureValueType: 'value',
273258
+ obsColorEncoding: "spatialChannelColor",
273259
+ spatialSegmentationFilled: true,
273260
+ spatialSegmentationStrokeWidth: 1,
273261
+ obsHighlight: null
273262
+ }];
273263
+ const coordinationValues = {
273264
+ // spatialTargetZ: imageWrapper.getDefaultTargetZ(),
273265
+ // spatialTargetT: imageWrapper.getDefaultTargetT(),
273266
+ segmentationLayer: CL([
273267
+ {
273268
+ fileUid: this.coordinationValues?.fileUid || null,
273269
+ spatialLayerOpacity: 1,
273270
+ spatialLayerVisible: true,
273271
+ segmentationChannel: CL(channelCoordination)
273272
+ }
273273
+ ])
273274
+ };
273004
273275
  const { data: data2, url } = payload;
273005
273276
  const result = this.loadFromCache(data2);
273006
- return Promise.resolve(new LoaderResult(result, url));
273277
+ return Promise.resolve(new LoaderResult(result, url, coordinationValues));
273007
273278
  }
273008
273279
  }
273009
273280
  class ObsSetsJsonLoader extends JsonLoader {
@@ -273369,7 +273640,8 @@ async function initLoader(imageData) {
273369
273640
  }
273370
273641
  case "ome-zarr": {
273371
273642
  const { coordinateTransformations: coordinateTransformationsFromOptions } = metadata2 || {};
273372
- const loader2 = await loadOmeZarr(url, requestInit2);
273643
+ const root2 = await zarrOpenRoot(url, requestInit2);
273644
+ const loader2 = await loadOmeZarr(root2);
273373
273645
  const { metadata: loaderMetadata } = loader2;
273374
273646
  const { omero, multiscales } = loaderMetadata;
273375
273647
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
@@ -273501,6 +273773,9 @@ class ZarrDataSource {
273501
273773
  this.storeRoot = zarrOpenRoot(url, requestInit2);
273502
273774
  }
273503
273775
  }
273776
+ getStoreRoot(path2) {
273777
+ return this.storeRoot.resolve(path2);
273778
+ }
273504
273779
  /**
273505
273780
  * Class method for decoding json from the store.
273506
273781
  * @param {string} key A path to the item.
@@ -273508,13 +273783,14 @@ class ZarrDataSource {
273508
273783
  * that resolves to the parsed JSON if successful.
273509
273784
  * @throws This may throw an error.
273510
273785
  */
273511
- async getJson(key2) {
273786
+ async getJson(key2, storeRootParam = null) {
273512
273787
  const { storeRoot } = this;
273788
+ const storeRootToUse = storeRootParam || storeRoot;
273513
273789
  let dirKey = key2;
273514
273790
  if (key2.endsWith(".zattrs") || key2.endsWith(".zarray") || key2.endsWith(".zgroup")) {
273515
273791
  dirKey = key2.substring(0, key2.length - 8);
273516
273792
  }
273517
- return (await open(storeRoot.resolve(dirKey))).attrs;
273793
+ return (await open(storeRootToUse.resolve(dirKey))).attrs;
273518
273794
  }
273519
273795
  }
273520
273796
  function dirname(path2) {
@@ -274324,10 +274600,28 @@ class ObsSpotsAnndataLoader extends AbstractTwoStepLoader {
274324
274600
  if (superResult instanceof AbstractLoaderError) {
274325
274601
  return Promise.reject(superResult);
274326
274602
  }
274603
+ const coordinationValues = {
274604
+ spotLayer: CL({
274605
+ obsType: "spot",
274606
+ // obsColorEncoding: 'spatialLayerColor',
274607
+ // spatialLayerColor: [255, 255, 255],
274608
+ spatialLayerVisible: true,
274609
+ spatialLayerOpacity: 1,
274610
+ spatialSpotRadius: 10
274611
+ // TODO: get this from adata.uns if possible.
274612
+ // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
274613
+ // after resolving https://github.com/vitessce/vitessce/issues/1760
274614
+ // featureValueColormapRange: [0, 1],
274615
+ // obsHighlight: null,
274616
+ // obsSetColor: null,
274617
+ // obsSetSelection: null,
274618
+ // additionalObsSets: null,
274619
+ })
274620
+ };
274327
274621
  return Promise.all([
274328
274622
  this.dataSource.loadObsIndex(path2),
274329
274623
  this.loadSpots()
274330
- ]).then(([obsIndex, obsSpots]) => Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null)));
274624
+ ]).then(([obsIndex, obsSpots]) => Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null, coordinationValues)));
274331
274625
  }
274332
274626
  }
274333
274627
  class ObsPointsAnndataLoader extends AbstractTwoStepLoader {
@@ -274353,10 +274647,26 @@ class ObsPointsAnndataLoader extends AbstractTwoStepLoader {
274353
274647
  if (superResult instanceof AbstractLoaderError) {
274354
274648
  return Promise.reject(superResult);
274355
274649
  }
274650
+ const coordinationValues = {
274651
+ pointLayer: CL({
274652
+ obsType: "point",
274653
+ // obsColorEncoding: 'spatialLayerColor',
274654
+ // spatialLayerColor: [255, 255, 255],
274655
+ spatialLayerVisible: true,
274656
+ spatialLayerOpacity: 1
274657
+ // TODO: support a point radius?
274658
+ // featureValueColormapRange: [0, 1],
274659
+ // obsHighlight: null,
274660
+ // obsSetColor: null,
274661
+ // obsSetSelection: null,
274662
+ // additionalObsSets: null,
274663
+ // obsLabelsType: null,
274664
+ })
274665
+ };
274356
274666
  return Promise.all([
274357
274667
  this.dataSource.loadObsIndex(path2),
274358
274668
  this.loadPoints()
274359
- ]).then(([obsIndex, obsPoints]) => Promise.resolve(new LoaderResult({ obsIndex, obsPoints }, null)));
274669
+ ]).then(([obsIndex, obsPoints]) => Promise.resolve(new LoaderResult({ obsIndex, obsPoints }, null, coordinationValues)));
274360
274670
  }
274361
274671
  }
274362
274672
  class ObsLocationsAnndataLoader extends AbstractTwoStepLoader {
@@ -274429,8 +274739,33 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
274429
274739
  if (superResult instanceof AbstractLoaderError) {
274430
274740
  return Promise.reject(superResult);
274431
274741
  }
274742
+ const channelCoordination = [{
274743
+ // obsType: null,
274744
+ spatialChannelColor: [255, 255, 255],
274745
+ spatialChannelVisible: true,
274746
+ spatialChannelOpacity: 1,
274747
+ spatialChannelWindow: null,
274748
+ // featureType: 'feature',
274749
+ // featureValueType: 'value',
274750
+ obsColorEncoding: "spatialChannelColor",
274751
+ spatialSegmentationFilled: true,
274752
+ spatialSegmentationStrokeWidth: 1,
274753
+ obsHighlight: null
274754
+ }];
274432
274755
  const coordinationValues = {
274433
- spatialSegmentationLayer: DEFAULT_CELLS_LAYER
274756
+ // Old
274757
+ spatialSegmentationLayer: DEFAULT_CELLS_LAYER,
274758
+ // New
274759
+ // spatialTargetZ: imageWrapper.getDefaultTargetZ(),
274760
+ // spatialTargetT: imageWrapper.getDefaultTargetT(),
274761
+ segmentationLayer: CL([
274762
+ {
274763
+ fileUid: this.coordinationValues?.fileUid || null,
274764
+ spatialLayerOpacity: 1,
274765
+ spatialLayerVisible: true,
274766
+ segmentationChannel: CL(channelCoordination)
274767
+ }
274768
+ ])
274434
274769
  };
274435
274770
  return Promise.all([
274436
274771
  this.dataSource.loadObsIndex(path2),
@@ -274439,7 +274774,7 @@ class ObsSegmentationsAnndataLoader extends AbstractTwoStepLoader {
274439
274774
  obsIndex,
274440
274775
  obsSegmentations,
274441
274776
  obsSegmentationsType: "polygon"
274442
- }, coordinationValues)));
274777
+ }, null, coordinationValues)));
274443
274778
  }
274444
274779
  }
274445
274780
  class ObsSetsAnndataLoader extends AbstractTwoStepLoader {
@@ -274636,20 +274971,20 @@ class ImageWrapper {
274636
274971
  return result;
274637
274972
  }
274638
274973
  getNumChannels() {
274639
- if ("Pixels" in this.vivLoader.metadata) {
274640
- const { Pixels: { Channels } } = this.vivLoader.metadata;
274641
- return Channels.length;
274642
- }
274643
- if ("omero" in this.vivLoader.metadata) {
274644
- const { omero: { channels: channels2 } } = this.vivLoader.metadata;
274645
- return channels2.length;
274974
+ if ("image-label" in this.vivLoader.metadata) {
274975
+ return 1;
274646
274976
  }
274647
274977
  if ("channels_metadata" in this.vivLoader.metadata) {
274648
274978
  const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
274649
274979
  return channelsMetadata?.channels.length || 0;
274650
274980
  }
274651
- if ("image-label" in this.vivLoader.metadata) {
274652
- return 1;
274981
+ if ("omero" in this.vivLoader.metadata) {
274982
+ const { omero: { channels: channels2 } } = this.vivLoader.metadata;
274983
+ return channels2.length;
274984
+ }
274985
+ if ("Pixels" in this.vivLoader.metadata) {
274986
+ const { Pixels: { Channels } } = this.vivLoader.metadata;
274987
+ return Channels.length;
274653
274988
  }
274654
274989
  return 0;
274655
274990
  }
@@ -274658,9 +274993,8 @@ class ImageWrapper {
274658
274993
  const { Pixels: { Channels } } = this.vivLoader.metadata;
274659
274994
  return Channels.map((channel, i2) => channel.Name || `Channel ${i2}`);
274660
274995
  }
274661
- if ("omero" in this.vivLoader.metadata) {
274662
- const { omero: { channels: channels2 } } = this.vivLoader.metadata;
274663
- return channels2.map((channel, i2) => channel.label || `Channel ${i2}`);
274996
+ if ("image-label" in this.vivLoader.metadata) {
274997
+ return ["labels"];
274664
274998
  }
274665
274999
  if ("channels_metadata" in this.vivLoader.metadata) {
274666
275000
  const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
@@ -274668,9 +275002,33 @@ class ImageWrapper {
274668
275002
  return channelsMetadata.channels.map((channel) => `Channel ${channel.label}`);
274669
275003
  }
274670
275004
  }
275005
+ if ("omero" in this.vivLoader.metadata) {
275006
+ const { omero: { channels: channels2 } } = this.vivLoader.metadata;
275007
+ return channels2.map((channel, i2) => channel.label || `Channel ${i2}`);
275008
+ }
274671
275009
  return [];
274672
275010
  }
275011
+ // TODO: support passing a custom color palette array.
274673
275012
  getChannelObjects() {
275013
+ if ("image-label" in this.vivLoader.metadata) {
275014
+ return [{
275015
+ name: "labels",
275016
+ defaultColor: [255, 255, 255],
275017
+ defaultWindow: [0, 255],
275018
+ autoDefaultColor: [0, 0, 0]
275019
+ }];
275020
+ }
275021
+ if ("channels_metadata" in this.vivLoader.metadata) {
275022
+ const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
275023
+ if (channelsMetadata && Array.isArray(channelsMetadata?.channels)) {
275024
+ return channelsMetadata.channels.map((channel, i2) => ({
275025
+ name: `Channel ${channel.label}`,
275026
+ defaultColor: void 0,
275027
+ defaultWindow: void 0,
275028
+ autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
275029
+ }));
275030
+ }
275031
+ }
274674
275032
  if ("omero" in this.vivLoader.metadata) {
274675
275033
  const { omero: { channels: channels2 } } = this.vivLoader.metadata;
274676
275034
  return channels2.map((channel, i2) => ({
@@ -274689,17 +275047,6 @@ class ImageWrapper {
274689
275047
  autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
274690
275048
  }));
274691
275049
  }
274692
- if ("channels_metadata" in this.vivLoader.metadata) {
274693
- const { channels_metadata: channelsMetadata } = this.vivLoader.metadata;
274694
- if (channelsMetadata && Array.isArray(channelsMetadata?.channels)) {
274695
- return channelsMetadata.channels.map((channel, i2) => ({
274696
- name: `Channel ${channel.label}`,
274697
- defaultColor: void 0,
274698
- defaultWindow: void 0,
274699
- autoDefaultColor: VIEWER_PALETTE[i2 % VIEWER_PALETTE.length]
274700
- }));
274701
- }
274702
- }
274703
275050
  return [];
274704
275051
  }
274705
275052
  getDtype() {
@@ -274788,15 +275135,41 @@ class ImageWrapper {
274788
275135
  const { shape: shape2 } = Array.isArray(loader2.data) ? loader2.data[0] : loader2.data;
274789
275136
  return isInterleaved$1(shape2);
274790
275137
  }
275138
+ getPhotometricInterpretation() {
275139
+ const loader2 = this.vivLoader;
275140
+ if ("Pixels" in loader2.metadata) {
275141
+ const source2 = Array.isArray(loader2.data) ? loader2.data[0] : loader2.data;
275142
+ if ("meta" in source2) {
275143
+ const { meta: meta2 } = source2;
275144
+ if (meta2 && "photometricInterpretation" in meta2) {
275145
+ const numericValue = meta2.photometricInterpretation;
275146
+ if (numericValue === 2) {
275147
+ return "RGB";
275148
+ }
275149
+ }
275150
+ }
275151
+ }
275152
+ if ("omero" in loader2.metadata) {
275153
+ const { omero: { rdefs: { model } } } = loader2.metadata;
275154
+ if (model === "color") {
275155
+ return "RGB";
275156
+ }
275157
+ }
275158
+ return "BlackIsZero";
275159
+ }
274791
275160
  }
274792
275161
  class OmeZarrLoader extends AbstractTwoStepLoader {
275162
+ constructor(dataSource, params2) {
275163
+ super(dataSource, params2);
275164
+ this.storeRoot = this.dataSource.storeRoot;
275165
+ }
274793
275166
  async load() {
274794
- const payload = await this.dataSource.getJson(".zattrs").catch((reason) => Promise.resolve(reason));
275167
+ const payload = await this.dataSource.getJson(".zattrs", this.storeRoot).catch((reason) => Promise.resolve(reason));
274795
275168
  if (payload instanceof AbstractLoaderError) {
274796
275169
  return Promise.reject(payload);
274797
275170
  }
274798
275171
  const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
274799
- const loader2 = await loadOmeZarr(this.url, this.requestInit);
275172
+ const loader2 = await loadOmeZarr(this.storeRoot);
274800
275173
  const imageWrapper = new ImageWrapper(loader2, this.options);
274801
275174
  const { metadata: metadata2, data: data2 } = loader2;
274802
275175
  const { omero, multiscales, channels_metadata: spatialDataChannels, "image-label": imageLabel } = metadata2;
@@ -274879,8 +275252,31 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
274879
275252
  }
274880
275253
  ];
274881
275254
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = await initializeRasterLayersAndChannels(imagesWithLoaderCreators, void 0);
275255
+ const channelObjects2 = imageWrapper.getChannelObjects();
275256
+ const channelCoordination = channelObjects2.slice(0, 5).map((channelObj, i2) => ({
275257
+ spatialTargetC: i2,
275258
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
275259
+ spatialChannelVisible: true,
275260
+ spatialChannelOpacity: 1,
275261
+ spatialChannelWindow: channelObj.defaultWindow || null
275262
+ }));
274882
275263
  const coordinationValues = {
274883
- spatialImageLayer: autoImageLayers
275264
+ // Old
275265
+ spatialImageLayer: autoImageLayers,
275266
+ // New
275267
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
275268
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
275269
+ imageLayer: CL([
275270
+ {
275271
+ fileUid: this.coordinationValues?.fileUid || null,
275272
+ spatialLayerOpacity: 1,
275273
+ spatialLayerVisible: true,
275274
+ photometricInterpretation: imageWrapper.getPhotometricInterpretation(),
275275
+ volumetricRenderingAlgorithm: "maximumIntensityProjection",
275276
+ spatialTargetResolution: null,
275277
+ imageChannel: CL(channelCoordination)
275278
+ }
275279
+ ])
274884
275280
  };
274885
275281
  return Promise.resolve(new LoaderResult({
274886
275282
  image: {
@@ -274890,17 +275286,51 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
274890
275286
  // TODO: make this the root value of LoaderResult.image.
274891
275287
  },
274892
275288
  featureIndex: imageWrapper.getChannelNames()
274893
- }, [], coordinationValues));
275289
+ }, null, coordinationValues));
275290
+ }
275291
+ }
275292
+ class OmeZarrAsObsSegmentationsLoader extends OmeZarrLoader {
275293
+ async load() {
275294
+ const { obsTypesFromChannelNames } = this.options || {};
275295
+ const result = await super.load();
275296
+ const imageWrapper = result.data.image.instance;
275297
+ const channelObjects = imageWrapper.getChannelObjects();
275298
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
275299
+ spatialTargetC: i2,
275300
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
275301
+ spatialChannelVisible: true,
275302
+ spatialChannelOpacity: 1,
275303
+ spatialChannelWindow: channelObj.defaultWindow || null,
275304
+ // featureType: 'feature',
275305
+ // featureValueType: 'value',
275306
+ obsColorEncoding: "spatialChannelColor",
275307
+ spatialSegmentationFilled: true,
275308
+ spatialSegmentationStrokeWidth: 1,
275309
+ obsHighlight: null,
275310
+ ...obsTypesFromChannelNames ? { obsType: channelObj.name } : {}
275311
+ }));
275312
+ const coordinationValues = {
275313
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
275314
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
275315
+ segmentationLayer: CL([
275316
+ {
275317
+ fileUid: this.coordinationValues?.fileUid || null,
275318
+ spatialLayerOpacity: 1,
275319
+ spatialLayerVisible: true,
275320
+ segmentationChannel: CL(channelCoordination)
275321
+ }
275322
+ ])
275323
+ };
275324
+ return Promise.resolve(new LoaderResult({
275325
+ obsSegmentationsType: "bitmask",
275326
+ obsSegmentations: result.data.image
275327
+ }, result.url, coordinationValues));
274894
275328
  }
274895
275329
  }
274896
275330
  class SpatialDataImageLoader extends OmeZarrLoader {
274897
275331
  constructor(dataSource, params2) {
274898
- const newParams = {
274899
- ...params2,
274900
- url: `${params2.url}/${params2.options.path}`
274901
- };
274902
- super(dataSource, newParams);
274903
- this.dataSource = dataSource;
275332
+ super(dataSource, params2);
275333
+ this.storeRoot = this.dataSource.getStoreRoot(params2.options.path);
274904
275334
  }
274905
275335
  }
274906
275336
  class SpatialDataLabelsLoader extends SpatialDataImageLoader {
@@ -274913,12 +275343,44 @@ class SpatialDataLabelsLoader extends SpatialDataImageLoader {
274913
275343
  obsSegmentations: result.data.image,
274914
275344
  obsSegmentationsType: "bitmask"
274915
275345
  };
275346
+ const imageWrapper = result.data.obsSegmentations.instance;
275347
+ const channelObjects = imageWrapper.getChannelObjects();
275348
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
275349
+ spatialTargetC: i2,
275350
+ // obsType: channelObj.name,
275351
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
275352
+ spatialChannelVisible: true,
275353
+ spatialChannelOpacity: 1,
275354
+ spatialChannelWindow: channelObj.defaultWindow || null,
275355
+ // featureType: 'feature',
275356
+ // featureValueType: 'value',
275357
+ obsColorEncoding: "spatialChannelColor",
275358
+ spatialSegmentationFilled: true,
275359
+ spatialSegmentationStrokeWidth: 1,
275360
+ obsHighlight: null
275361
+ }));
275362
+ const coordinationValues = {
275363
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
275364
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
275365
+ segmentationLayer: CL([
275366
+ {
275367
+ fileUid: this.coordinationValues?.fileUid || null,
275368
+ spatialLayerOpacity: 1,
275369
+ spatialLayerVisible: true,
275370
+ segmentationChannel: CL(channelCoordination)
275371
+ }
275372
+ ])
275373
+ };
275374
+ result.coordinationValues = coordinationValues;
274916
275375
  return Promise.resolve(result);
274917
275376
  }
274918
275377
  }
274919
275378
  function getCoordsPath(path2) {
274920
275379
  return `${path2}/coords`;
274921
275380
  }
275381
+ function getRadiusPath(path2) {
275382
+ return `${path2}/radius`;
275383
+ }
274922
275384
  class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
274923
275385
  /**
274924
275386
  * Class method for loading embedding coordinates, such as those from UMAP or t-SNE.
@@ -274936,6 +275398,18 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
274936
275398
  this.locations = Promise.resolve(null);
274937
275399
  return this.locations;
274938
275400
  }
275401
+ loadRadius() {
275402
+ const { path: path2 } = this.options;
275403
+ if (this.radius) {
275404
+ return this.radius;
275405
+ }
275406
+ if (!this.radius) {
275407
+ this.radius = this.dataSource.loadNumeric(getRadiusPath(path2));
275408
+ return this.radius;
275409
+ }
275410
+ this.radius = Promise.resolve(null);
275411
+ return this.radius;
275412
+ }
274939
275413
  async load() {
274940
275414
  const { path: path2, tablePath } = this.options;
274941
275415
  const superResult = await super.load().catch((reason) => Promise.resolve(reason));
@@ -274944,8 +275418,29 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
274944
275418
  }
274945
275419
  return Promise.all([
274946
275420
  this.dataSource.loadObsIndex(getCoordsPath(path2), tablePath),
274947
- this.loadSpots()
274948
- ]).then(([obsIndex, obsSpots]) => Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null)));
275421
+ this.loadSpots(),
275422
+ this.loadRadius()
275423
+ ]).then(([obsIndex, obsSpots, obsRadius]) => {
275424
+ const spatialSpotRadius = obsRadius?.data?.[0];
275425
+ const coordinationValues = {
275426
+ spotLayer: CL({
275427
+ obsType: "spot",
275428
+ // obsColorEncoding: 'spatialLayerColor',
275429
+ // spatialLayerColor: [255, 255, 255],
275430
+ spatialLayerVisible: true,
275431
+ spatialLayerOpacity: 1,
275432
+ spatialSpotRadius
275433
+ // TODO: spatialSpotRadiusUnit: 'µm' or 'um'
275434
+ // after resolving https://github.com/vitessce/vitessce/issues/1760
275435
+ // featureValueColormapRange: [0, 1],
275436
+ // obsHighlight: null,
275437
+ // obsSetColor: null,
275438
+ // obsSetSelection: null,
275439
+ // additionalObsSets: null,
275440
+ })
275441
+ };
275442
+ return Promise.resolve(new LoaderResult({ obsIndex, obsSpots }, null, coordinationValues));
275443
+ });
274949
275444
  }
274950
275445
  }
274951
275446
  class SpatialDataObsSetsLoader extends ObsSetsAnndataLoader {
@@ -275012,6 +275507,14 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
275012
275507
  const urls2 = [
275013
275508
  { url, name: image2.name }
275014
275509
  ];
275510
+ const channelObjects = imageWrapper.getChannelObjects();
275511
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
275512
+ spatialTargetC: i2,
275513
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
275514
+ spatialChannelVisible: true,
275515
+ spatialChannelOpacity: 1,
275516
+ spatialChannelWindow: channelObj.defaultWindow || null
275517
+ }));
275015
275518
  const imagesWithLoaderCreators = [
275016
275519
  {
275017
275520
  ...image2,
@@ -275025,7 +275528,22 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
275025
275528
  return this.autoImageCache.then((autoImages) => {
275026
275529
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
275027
275530
  const coordinationValues = {
275028
- spatialImageLayer: autoImageLayers
275531
+ // Old
275532
+ spatialImageLayer: autoImageLayers,
275533
+ // New
275534
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
275535
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
275536
+ imageLayer: CL([
275537
+ {
275538
+ fileUid: this.coordinationValues?.fileUid || null,
275539
+ spatialLayerOpacity: 1,
275540
+ spatialLayerVisible: true,
275541
+ photometricInterpretation: imageWrapper.getPhotometricInterpretation(),
275542
+ volumetricRenderingAlgorithm: "maximumIntensityProjection",
275543
+ spatialTargetResolution: null,
275544
+ imageChannel: CL(channelCoordination)
275545
+ }
275546
+ ])
275029
275547
  };
275030
275548
  return new LoaderResult({
275031
275549
  image: {
@@ -275042,7 +275560,7 @@ class OmeTiffLoader extends AbstractTwoStepLoader {
275042
275560
  class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
275043
275561
  async load() {
275044
275562
  const { url, requestInit: requestInit2 } = this;
275045
- const { coordinateTransformations: coordinateTransformationsFromOptions } = this.options || {};
275563
+ const { coordinateTransformations: coordinateTransformationsFromOptions, obsTypesFromChannelNames } = this.options || {};
275046
275564
  const offsets2 = await this.loadOffsets();
275047
275565
  const loader2 = await loadOmeTiff(url, { offsets: offsets2, headers: requestInit2?.headers });
275048
275566
  const imageWrapper = new ImageWrapper(loader2, this.options);
@@ -275064,6 +275582,21 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
275064
275582
  }
275065
275583
  };
275066
275584
  const urls2 = [{ url, name: image2.name }];
275585
+ const channelObjects = imageWrapper.getChannelObjects();
275586
+ const channelCoordination = channelObjects.slice(0, 5).map((channelObj, i2) => ({
275587
+ spatialTargetC: i2,
275588
+ spatialChannelColor: (channelObj.defaultColor || channelObj.autoDefaultColor).slice(0, 3),
275589
+ spatialChannelVisible: true,
275590
+ spatialChannelOpacity: 1,
275591
+ spatialChannelWindow: channelObj.defaultWindow || null,
275592
+ // featureType: 'feature',
275593
+ // featureValueType: 'value',
275594
+ obsColorEncoding: "spatialChannelColor",
275595
+ spatialSegmentationFilled: true,
275596
+ spatialSegmentationStrokeWidth: 1,
275597
+ obsHighlight: null,
275598
+ ...obsTypesFromChannelNames ? { obsType: channelObj.name } : {}
275599
+ }));
275067
275600
  const imagesWithLoaderCreators = [
275068
275601
  {
275069
275602
  ...image2,
@@ -275080,7 +275613,19 @@ class OmeTiffAsObsSegmentationsLoader extends OmeTiffLoader {
275080
275613
  return this.autoImageCache.then((autoImages) => {
275081
275614
  const [autoImageLayers, imageLayerLoaders, imageLayerMeta] = autoImages;
275082
275615
  const coordinationValues = {
275083
- spatialSegmentationLayer: autoImageLayers
275616
+ // Old
275617
+ spatialSegmentationLayer: autoImageLayers,
275618
+ // New
275619
+ spatialTargetZ: imageWrapper.getDefaultTargetZ(),
275620
+ spatialTargetT: imageWrapper.getDefaultTargetT(),
275621
+ segmentationLayer: CL([
275622
+ {
275623
+ fileUid: this.coordinationValues?.fileUid || null,
275624
+ spatialLayerOpacity: 1,
275625
+ spatialLayerVisible: true,
275626
+ segmentationChannel: CL(channelCoordination)
275627
+ }
275628
+ ])
275084
275629
  };
275085
275630
  return new LoaderResult({
275086
275631
  obsSegmentationsType: "bitmask",
@@ -275264,6 +275809,83 @@ function expandAnndataZarr(fileDef) {
275264
275809
  }] : []
275265
275810
  ];
275266
275811
  }
275812
+ function expandSpatialdataZarr(fileDef) {
275813
+ const baseFileDef = {
275814
+ url: fileDef.url,
275815
+ requestInit: fileDef.requestInit,
275816
+ coordinationValues: {
275817
+ ...fileDef.coordinationValues,
275818
+ obsType: fileDef.coordinationValues?.obsType || "cell",
275819
+ featureType: fileDef.coordinationValues?.featureType || "gene",
275820
+ featureValueType: fileDef.coordinationValues?.featureValueType || "expression"
275821
+ }
275822
+ };
275823
+ const extraCoordinationValues = {};
275824
+ Object.entries(baseFileDef.coordinationValues).forEach(([key2, value2]) => {
275825
+ if (!expectedCoordinationTypes.includes(key2)) {
275826
+ extraCoordinationValues[key2] = value2;
275827
+ }
275828
+ });
275829
+ const { options = {} } = fileDef;
275830
+ return [
275831
+ // obsFeatureMatrix
275832
+ ...options.obsFeatureMatrix ? [{
275833
+ ...baseFileDef,
275834
+ fileType: FileType$2.OBS_FEATURE_MATRIX_SPATIALDATA_ZARR,
275835
+ options: options.obsFeatureMatrix,
275836
+ coordinationValues: {
275837
+ ...extraCoordinationValues,
275838
+ obsType: baseFileDef.coordinationValues.obsType,
275839
+ featureType: baseFileDef.coordinationValues.featureType,
275840
+ featureValueType: baseFileDef.coordinationValues.featureValueType
275841
+ }
275842
+ }] : [],
275843
+ // obsSets
275844
+ ...options.obsSets ? [{
275845
+ ...baseFileDef,
275846
+ fileType: FileType$2.OBS_SETS_SPATIALDATA_ZARR,
275847
+ options: options.obsSets,
275848
+ coordinationValues: {
275849
+ ...extraCoordinationValues,
275850
+ obsType: baseFileDef.coordinationValues.obsType
275851
+ }
275852
+ }] : [],
275853
+ // obsSpots
275854
+ ...options.obsSpots ? [{
275855
+ ...baseFileDef,
275856
+ fileType: FileType$2.OBS_SPOTS_SPATIALDATA_ZARR,
275857
+ options: options.obsSpots,
275858
+ coordinationValues: {
275859
+ ...extraCoordinationValues,
275860
+ obsType: baseFileDef.coordinationValues.obsType
275861
+ }
275862
+ }] : [],
275863
+ // TODO: obsPoints?
275864
+ // TODO: obsLocations?
275865
+ // image
275866
+ ...options.image ? [{
275867
+ ...baseFileDef,
275868
+ fileType: FileType$2.IMAGE_SPATIALDATA_ZARR,
275869
+ options: options.image,
275870
+ coordinationValues: {
275871
+ ...extraCoordinationValues,
275872
+ featureType: baseFileDef.coordinationValues.featureType
275873
+ // TODO: fileUid?
275874
+ }
275875
+ }] : [],
275876
+ // labels
275877
+ ...options.labels ? [{
275878
+ ...baseFileDef,
275879
+ fileType: FileType$2.LABELS_SPATIALDATA_ZARR,
275880
+ options: options.labels,
275881
+ coordinationValues: {
275882
+ ...extraCoordinationValues,
275883
+ obsType: baseFileDef.coordinationValues.obsType
275884
+ // TODO: fileUid?
275885
+ }
275886
+ }] : []
275887
+ ];
275888
+ }
275267
275889
  function expandMoleculesJson(fileDef) {
275268
275890
  const baseFileDef = {
275269
275891
  ...fileDef,
@@ -275588,7 +276210,8 @@ const baseFileTypes = [
275588
276210
  // All OME file types
275589
276211
  makeFileType(FileType$2.IMAGE_OME_ZARR, DataType$3.IMAGE, OmeZarrLoader, ZarrDataSource, imageOmeZarrSchema),
275590
276212
  makeFileType(FileType$2.IMAGE_OME_TIFF, DataType$3.IMAGE, OmeTiffLoader, OmeTiffSource, imageOmeTiffSchema),
275591
- makeFileType(FileType$2.OBS_SEGMENTATIONS_OME_TIFF, DataType$3.OBS_SEGMENTATIONS, OmeTiffAsObsSegmentationsLoader, OmeTiffSource, imageOmeZarrSchema),
276213
+ makeFileType(FileType$2.OBS_SEGMENTATIONS_OME_ZARR, DataType$3.OBS_SEGMENTATIONS, OmeZarrAsObsSegmentationsLoader, ZarrDataSource, obsSegmentationsOmeZarrSchema),
276214
+ makeFileType(FileType$2.OBS_SEGMENTATIONS_OME_TIFF, DataType$3.OBS_SEGMENTATIONS, OmeTiffAsObsSegmentationsLoader, OmeTiffSource, obsSegmentationsOmeTiffSchema),
275592
276215
  // SpatialData file types
275593
276216
  makeFileType(FileType$2.IMAGE_SPATIALDATA_ZARR, DataType$3.IMAGE, SpatialDataImageLoader, ZarrDataSource, imageSpatialdataSchema),
275594
276217
  // TODO: create a new loader for labels that returns obsSegmentations with obsSegmentationsType: 'bitmask'
@@ -275617,7 +276240,7 @@ const baseFileTypes = [
275617
276240
  ];
275618
276241
  const baseJointFileTypes = [
275619
276242
  new PluginJointFileType(FileType$2.ANNDATA_ZARR, expandAnndataZarr, anndataZarrSchema),
275620
- // new PluginJointFileType(FileType.SPATIALDATA_ZARR, expandSpatialdataZarr, spatialdataZarrSchema),
276243
+ new PluginJointFileType(FileType$2.SPATIALDATA_ZARR, expandSpatialdataZarr, spatialdataZarrSchema),
275621
276244
  // For legacy file types:
275622
276245
  new PluginJointFileType(FileType$2.ANNDATA_CELLS_ZARR, expandAnndataCellsZarr, anndataCellsZarrSchema),
275623
276246
  new PluginJointFileType(FileType$2.ANNDATA_CELL_SETS_ZARR, expandAnndataCellSetsZarr, anndataCellSetsZarrSchema),
@@ -275716,7 +276339,7 @@ const baseCoordinationTypes = [
275716
276339
  new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_VISIBLE, true, z.boolean()),
275717
276340
  new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_OPACITY, 1, z.number()),
275718
276341
  new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_WINDOW, null, z.array(z.number()).length(2).nullable()),
275719
- new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_COLOR, null, z.array(z.number()).length(3).nullable()),
276342
+ new PluginCoordinationType(CoordinationType$2.SPATIAL_CHANNEL_COLOR, [255, 255, 255], z.array(z.number()).length(3).nullable()),
275720
276343
  new PluginCoordinationType(CoordinationType$2.SPATIAL_SEGMENTATION_FILLED, true, z.boolean()),
275721
276344
  new PluginCoordinationType(CoordinationType$2.SPATIAL_SEGMENTATION_STROKE_WIDTH, 1, z.number()),
275722
276345
  // Reference: https://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html
@@ -278248,14 +278871,17 @@ export {
278248
278871
  VitessceConfig as i,
278249
278872
  hconcat as j,
278250
278873
  CL as k,
278251
- generateConfig as l,
278252
- getHintOptions as m,
278253
- HINT_TYPE_TO_FILE_TYPE_MAP as n,
278874
+ getCoordinationSpaceAndScopes as l,
278875
+ generateConfig as m,
278876
+ getHintOptions as n,
278254
278877
  objectAssign$2 as o,
278255
- Vitessce as p,
278256
- PluginViewType as q,
278257
- PluginCoordinationType as r,
278258
- PluginJointFileType as s,
278878
+ HINT_TYPE_TO_FILE_TYPE_MAP as p,
278879
+ getInitialCoordinationScopePrefix as q,
278880
+ getInitialCoordinationScopeName as r,
278881
+ Vitessce as s,
278882
+ PluginViewType as t,
278883
+ PluginCoordinationType as u,
278259
278884
  vconcat as v,
278885
+ PluginJointFileType as w,
278260
278886
  z
278261
278887
  };