@vitessce/all 3.5.6 → 3.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -969,6 +969,258 @@ var reactJsxRuntime_development = {};
969
969
  jsxRuntime.exports = reactJsxRuntime_development;
970
970
  }
971
971
  var jsxRuntimeExports = jsxRuntime.exports;
972
+ var loglevel = { exports: {} };
973
+ (function(module2) {
974
+ (function(root2, definition2) {
975
+ if (module2.exports) {
976
+ module2.exports = definition2();
977
+ } else {
978
+ root2.log = definition2();
979
+ }
980
+ })(commonjsGlobal$1, function() {
981
+ var noop2 = function() {
982
+ };
983
+ var undefinedType2 = "undefined";
984
+ var isIE2 = typeof window !== undefinedType2 && typeof window.navigator !== undefinedType2 && /Trident\/|MSIE /.test(window.navigator.userAgent);
985
+ var logMethods = [
986
+ "trace",
987
+ "debug",
988
+ "info",
989
+ "warn",
990
+ "error"
991
+ ];
992
+ var _loggersByName = {};
993
+ var defaultLogger = null;
994
+ function bindMethod(obj, methodName) {
995
+ var method2 = obj[methodName];
996
+ if (typeof method2.bind === "function") {
997
+ return method2.bind(obj);
998
+ } else {
999
+ try {
1000
+ return Function.prototype.bind.call(method2, obj);
1001
+ } catch (e3) {
1002
+ return function() {
1003
+ return Function.prototype.apply.apply(method2, [obj, arguments]);
1004
+ };
1005
+ }
1006
+ }
1007
+ }
1008
+ function traceForIE() {
1009
+ if (console.log) {
1010
+ if (console.log.apply) {
1011
+ console.log.apply(console, arguments);
1012
+ } else {
1013
+ Function.prototype.apply.apply(console.log, [console, arguments]);
1014
+ }
1015
+ }
1016
+ if (console.trace)
1017
+ console.trace();
1018
+ }
1019
+ function realMethod(methodName) {
1020
+ if (methodName === "debug") {
1021
+ methodName = "log";
1022
+ }
1023
+ if (typeof console === undefinedType2) {
1024
+ return false;
1025
+ } else if (methodName === "trace" && isIE2) {
1026
+ return traceForIE;
1027
+ } else if (console[methodName] !== void 0) {
1028
+ return bindMethod(console, methodName);
1029
+ } else if (console.log !== void 0) {
1030
+ return bindMethod(console, "log");
1031
+ } else {
1032
+ return noop2;
1033
+ }
1034
+ }
1035
+ function replaceLoggingMethods() {
1036
+ var level = this.getLevel();
1037
+ for (var i2 = 0; i2 < logMethods.length; i2++) {
1038
+ var methodName = logMethods[i2];
1039
+ this[methodName] = i2 < level ? noop2 : this.methodFactory(methodName, level, this.name);
1040
+ }
1041
+ this.log = this.debug;
1042
+ if (typeof console === undefinedType2 && level < this.levels.SILENT) {
1043
+ return "No console available for logging";
1044
+ }
1045
+ }
1046
+ function enableLoggingWhenConsoleArrives(methodName) {
1047
+ return function() {
1048
+ if (typeof console !== undefinedType2) {
1049
+ replaceLoggingMethods.call(this);
1050
+ this[methodName].apply(this, arguments);
1051
+ }
1052
+ };
1053
+ }
1054
+ function defaultMethodFactory(methodName, _level, _loggerName) {
1055
+ return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
1056
+ }
1057
+ function Logger(name2, factory2) {
1058
+ var self2 = this;
1059
+ var inheritedLevel;
1060
+ var defaultLevel;
1061
+ var userLevel;
1062
+ var storageKey = "loglevel";
1063
+ if (typeof name2 === "string") {
1064
+ storageKey += ":" + name2;
1065
+ } else if (typeof name2 === "symbol") {
1066
+ storageKey = void 0;
1067
+ }
1068
+ function persistLevelIfPossible(levelNum) {
1069
+ var levelName = (logMethods[levelNum] || "silent").toUpperCase();
1070
+ if (typeof window === undefinedType2 || !storageKey)
1071
+ return;
1072
+ try {
1073
+ window.localStorage[storageKey] = levelName;
1074
+ return;
1075
+ } catch (ignore2) {
1076
+ }
1077
+ try {
1078
+ window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
1079
+ } catch (ignore2) {
1080
+ }
1081
+ }
1082
+ function getPersistedLevel() {
1083
+ var storedLevel;
1084
+ if (typeof window === undefinedType2 || !storageKey)
1085
+ return;
1086
+ try {
1087
+ storedLevel = window.localStorage[storageKey];
1088
+ } catch (ignore2) {
1089
+ }
1090
+ if (typeof storedLevel === undefinedType2) {
1091
+ try {
1092
+ var cookie = window.document.cookie;
1093
+ var cookieName = encodeURIComponent(storageKey);
1094
+ var location = cookie.indexOf(cookieName + "=");
1095
+ if (location !== -1) {
1096
+ storedLevel = /^([^;]+)/.exec(
1097
+ cookie.slice(location + cookieName.length + 1)
1098
+ )[1];
1099
+ }
1100
+ } catch (ignore2) {
1101
+ }
1102
+ }
1103
+ if (self2.levels[storedLevel] === void 0) {
1104
+ storedLevel = void 0;
1105
+ }
1106
+ return storedLevel;
1107
+ }
1108
+ function clearPersistedLevel() {
1109
+ if (typeof window === undefinedType2 || !storageKey)
1110
+ return;
1111
+ try {
1112
+ window.localStorage.removeItem(storageKey);
1113
+ } catch (ignore2) {
1114
+ }
1115
+ try {
1116
+ window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
1117
+ } catch (ignore2) {
1118
+ }
1119
+ }
1120
+ function normalizeLevel(input) {
1121
+ var level = input;
1122
+ if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
1123
+ level = self2.levels[level.toUpperCase()];
1124
+ }
1125
+ if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
1126
+ return level;
1127
+ } else {
1128
+ throw new TypeError("log.setLevel() called with invalid level: " + input);
1129
+ }
1130
+ }
1131
+ self2.name = name2;
1132
+ self2.levels = {
1133
+ "TRACE": 0,
1134
+ "DEBUG": 1,
1135
+ "INFO": 2,
1136
+ "WARN": 3,
1137
+ "ERROR": 4,
1138
+ "SILENT": 5
1139
+ };
1140
+ self2.methodFactory = factory2 || defaultMethodFactory;
1141
+ self2.getLevel = function() {
1142
+ if (userLevel != null) {
1143
+ return userLevel;
1144
+ } else if (defaultLevel != null) {
1145
+ return defaultLevel;
1146
+ } else {
1147
+ return inheritedLevel;
1148
+ }
1149
+ };
1150
+ self2.setLevel = function(level, persist) {
1151
+ userLevel = normalizeLevel(level);
1152
+ if (persist !== false) {
1153
+ persistLevelIfPossible(userLevel);
1154
+ }
1155
+ return replaceLoggingMethods.call(self2);
1156
+ };
1157
+ self2.setDefaultLevel = function(level) {
1158
+ defaultLevel = normalizeLevel(level);
1159
+ if (!getPersistedLevel()) {
1160
+ self2.setLevel(level, false);
1161
+ }
1162
+ };
1163
+ self2.resetLevel = function() {
1164
+ userLevel = null;
1165
+ clearPersistedLevel();
1166
+ replaceLoggingMethods.call(self2);
1167
+ };
1168
+ self2.enableAll = function(persist) {
1169
+ self2.setLevel(self2.levels.TRACE, persist);
1170
+ };
1171
+ self2.disableAll = function(persist) {
1172
+ self2.setLevel(self2.levels.SILENT, persist);
1173
+ };
1174
+ self2.rebuild = function() {
1175
+ if (defaultLogger !== self2) {
1176
+ inheritedLevel = normalizeLevel(defaultLogger.getLevel());
1177
+ }
1178
+ replaceLoggingMethods.call(self2);
1179
+ if (defaultLogger === self2) {
1180
+ for (var childName in _loggersByName) {
1181
+ _loggersByName[childName].rebuild();
1182
+ }
1183
+ }
1184
+ };
1185
+ inheritedLevel = normalizeLevel(
1186
+ defaultLogger ? defaultLogger.getLevel() : "WARN"
1187
+ );
1188
+ var initialLevel = getPersistedLevel();
1189
+ if (initialLevel != null) {
1190
+ userLevel = normalizeLevel(initialLevel);
1191
+ }
1192
+ replaceLoggingMethods.call(self2);
1193
+ }
1194
+ defaultLogger = new Logger();
1195
+ defaultLogger.getLogger = function getLogger(name2) {
1196
+ if (typeof name2 !== "symbol" && typeof name2 !== "string" || name2 === "") {
1197
+ throw new TypeError("You must supply a name when creating a logger.");
1198
+ }
1199
+ var logger2 = _loggersByName[name2];
1200
+ if (!logger2) {
1201
+ logger2 = _loggersByName[name2] = new Logger(
1202
+ name2,
1203
+ defaultLogger.methodFactory
1204
+ );
1205
+ }
1206
+ return logger2;
1207
+ };
1208
+ var _log = typeof window !== undefinedType2 ? window.log : void 0;
1209
+ defaultLogger.noConflict = function() {
1210
+ if (typeof window !== undefinedType2 && window.log === defaultLogger) {
1211
+ window.log = _log;
1212
+ }
1213
+ return defaultLogger;
1214
+ };
1215
+ defaultLogger.getLoggers = function getLoggers2() {
1216
+ return _loggersByName;
1217
+ };
1218
+ defaultLogger["default"] = defaultLogger;
1219
+ return defaultLogger;
1220
+ });
1221
+ })(loglevel);
1222
+ var loglevelExports = loglevel.exports;
1223
+ const log$c = /* @__PURE__ */ getDefaultExportFromCjs$1(loglevelExports);
972
1224
  var util;
973
1225
  (function(util2) {
974
1226
  util2.assertEqual = (val) => val;
@@ -7139,6 +7391,27 @@ function getNextScope(prevScopes) {
7139
7391
  } while (prevScopes.includes(nextScope));
7140
7392
  return nextScope;
7141
7393
  }
7394
+ const identityFunc = (d) => d;
7395
+ function unnestMap(map2, keys4, aggFunc) {
7396
+ if (keys4.length < 2) {
7397
+ throw new Error("Insufficient number of keys passed to flattenInternMap");
7398
+ }
7399
+ const aggFuncToUse = !aggFunc ? identityFunc : aggFunc;
7400
+ return Array.from(map2.entries()).flatMap(([k, v2]) => {
7401
+ if (v2 instanceof Map) {
7402
+ const keysWithoutFirst = [...keys4];
7403
+ keysWithoutFirst.splice(0, 1);
7404
+ return unnestMap(v2, keysWithoutFirst, aggFuncToUse).map((childObj) => ({
7405
+ [keys4[0]]: k,
7406
+ ...childObj
7407
+ }));
7408
+ }
7409
+ return {
7410
+ [keys4[0]]: k,
7411
+ [keys4[1]]: aggFuncToUse(v2)
7412
+ };
7413
+ });
7414
+ }
7142
7415
  const DEFAULT_DARK_COLOR = [50, 50, 50];
7143
7416
  const DEFAULT_LIGHT_COLOR$3 = [200, 200, 200];
7144
7417
  const DEFAULT_LIGHT2_COLOR = [235, 235, 235];
@@ -7190,16 +7463,16 @@ const COLORMAP_OPTIONS = [
7190
7463
  ];
7191
7464
  const DEFAULT_GL_OPTIONS$1 = { webgl2: true };
7192
7465
  function createDefaultUpdateCellsHover(componentName) {
7193
- return (hoverInfo) => console.warn(`${componentName} updateCellsHover: ${hoverInfo.cellId}`);
7466
+ return (hoverInfo) => log$c.warn(`${componentName} updateCellsHover: ${hoverInfo.cellId}`);
7194
7467
  }
7195
7468
  function createDefaultUpdateGenesHover(componentName) {
7196
- return (hoverInfo) => console.warn(`${componentName} updateGenesHover: ${hoverInfo.geneId}`);
7469
+ return (hoverInfo) => log$c.warn(`${componentName} updateGenesHover: ${hoverInfo.geneId}`);
7197
7470
  }
7198
7471
  function createDefaultUpdateTracksHover(componentName) {
7199
- return (hoverInfo) => console.warn(`${componentName} updateTracksHover: ${hoverInfo}`);
7472
+ return (hoverInfo) => log$c.warn(`${componentName} updateTracksHover: ${hoverInfo}`);
7200
7473
  }
7201
7474
  function createDefaultUpdateViewInfo(componentName) {
7202
- return (viewInfo) => console.warn(`${componentName} updateViewInfo: ${viewInfo}`);
7475
+ return (viewInfo) => log$c.warn(`${componentName} updateViewInfo: ${viewInfo}`);
7203
7476
  }
7204
7477
  function copyUint8Array(arr) {
7205
7478
  const newBuffer = new ArrayBuffer(arr.buffer.byteLength);
@@ -7701,7 +7974,7 @@ function upgradeFrom1_0_14(config3) {
7701
7974
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
7702
7975
  var _a3;
7703
7976
  if ((_a3 = viewDef.props) == null ? void 0 : _a3[oldProp]) {
7704
- console.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
7977
+ log$c.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
7705
7978
  }
7706
7979
  });
7707
7980
  });
@@ -7724,7 +7997,7 @@ function upgradeFrom1_0_15(config3) {
7724
7997
  Object.entries(coordinationScopes).forEach(([coordinationType, coordinationScope]) => {
7725
7998
  if (!Array.isArray(coordinationScope) && typeof coordinationScope === "object") {
7726
7999
  if (coordinationType === "dataset") {
7727
- console.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
8000
+ log$c.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
7728
8001
  }
7729
8002
  coordinationScopesBy.dataset[coordinationType] = coordinationScope;
7730
8003
  } else if (Array.isArray(coordinationScope) || typeof coordinationScope === "string") {
@@ -9937,7 +10210,8 @@ const ViewType$1 = {
9937
10210
  FEATURE_BAR_PLOT: "featureBarPlot",
9938
10211
  BIOMARKER_SELECT: "biomarkerSelect",
9939
10212
  LINK_CONTROLLER: "linkController",
9940
- DUAL_SCATTERPLOT: "dualScatterplot"
10213
+ DUAL_SCATTERPLOT: "dualScatterplot",
10214
+ TREEMAP: "treemap"
9941
10215
  };
9942
10216
  const DataType$3 = {
9943
10217
  OBS_LABELS: "obsLabels",
@@ -10013,6 +10287,7 @@ const FileType$1 = {
10013
10287
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
10014
10288
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
10015
10289
  SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
10290
+ SAMPLE_SETS_ANNDATA_ZARR: "sampleSets.anndata.zarr",
10016
10291
  // AnnData - zipped
10017
10292
  OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
10018
10293
  OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
@@ -10025,6 +10300,7 @@ const FileType$1 = {
10025
10300
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
10026
10301
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
10027
10302
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
10303
+ SAMPLE_SETS_ANNDATA_ZARR_ZIP: "sampleSets.anndata.zarr.zip",
10028
10304
  // AnnData - h5ad via reference spec
10029
10305
  OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
10030
10306
  OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
@@ -10037,6 +10313,7 @@ const FileType$1 = {
10037
10313
  OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
10038
10314
  FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
10039
10315
  SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
10316
+ SAMPLE_SETS_ANNDATA_H5AD: "sampleSets.anndata.h5ad",
10040
10317
  // SpatialData
10041
10318
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
10042
10319
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -10228,12 +10505,15 @@ const CoordinationType$1 = {
10228
10505
  SAMPLE_SET_FILTER: "sampleSetFilter",
10229
10506
  SAMPLE_FILTER_MODE: "sampleFilterMode",
10230
10507
  SAMPLE_SET_COLOR: "sampleSetColor",
10508
+ SAMPLE_HIGHLIGHT: "sampleHighlight",
10231
10509
  EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
10232
10510
  EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
10233
10511
  EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
10234
10512
  EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
10235
10513
  CONTOUR_COLOR_ENCODING: "contourColorEncoding",
10236
- CONTOUR_COLOR: "contourColor"
10514
+ CONTOUR_COLOR: "contourColor",
10515
+ // Treemap
10516
+ HIERARCHY_LEVELS: "hierarchyLevels"
10237
10517
  };
10238
10518
  const STATUS$1 = {
10239
10519
  LOADING: "loading",
@@ -10259,7 +10539,8 @@ const ViewHelpMapping = {
10259
10539
  OBS_SET_FEATURE_VALUE_DISTRIBUTION: "The observation set feature value distribution view displays a violin plot with values (e.g., expression values) per set (e.g., cell type) for the selected feature (e.g., gene).",
10260
10540
  FEATURE_VALUE_HISTOGRAM: "The feature value histogram displays the distribution of values (e.g., expression) for the selected feature (e.g., gene).",
10261
10541
  DOT_PLOT: "The dot plot displays summary information about expression of the selected features (e.g., genes) for each selected observation set (e.g., cell type).",
10262
- FEATURE_BAR_PLOT: "The feature bar plot displays one bar per observation (e.g., cell) along the x-axis, where the value of a selected feature (e.g., gene) is encoded along the y-axis."
10542
+ FEATURE_BAR_PLOT: "The feature bar plot displays one bar per observation (e.g., cell) along the x-axis, where the value of a selected feature (e.g., gene) is encoded along the y-axis.",
10543
+ TREEMAP: "The treemap provides an overview of the current state of sample-level or cell-level selection and filtering."
10263
10544
  };
10264
10545
  const ALT_ZARR_STORE_TYPES = {
10265
10546
  // For AnnData:
@@ -10307,6 +10588,10 @@ const ALT_ZARR_STORE_TYPES = {
10307
10588
  zip: FileType$1.SAMPLE_EDGES_ANNDATA_ZARR_ZIP,
10308
10589
  h5ad: FileType$1.SAMPLE_EDGES_ANNDATA_H5AD
10309
10590
  },
10591
+ [FileType$1.SAMPLE_SETS_ANNDATA_ZARR]: {
10592
+ zip: FileType$1.SAMPLE_SETS_ANNDATA_ZARR_ZIP,
10593
+ h5ad: FileType$1.SAMPLE_SETS_ANNDATA_H5AD
10594
+ },
10310
10595
  // For OME-Zarr:
10311
10596
  [FileType$1.IMAGE_OME_ZARR]: {
10312
10597
  zip: FileType$1.IMAGE_OME_ZARR_ZIP
@@ -10793,6 +11078,32 @@ const COMPONENT_COORDINATION_TYPES = {
10793
11078
  CoordinationType$1.OBS_SET_SELECTION,
10794
11079
  CoordinationType$1.OBS_SET_FILTER
10795
11080
  // TODO: create coordination types for internal state of the biomarker selection view?
11081
+ ],
11082
+ [ViewType$1.TREEMAP]: [
11083
+ CoordinationType$1.DATASET,
11084
+ CoordinationType$1.OBS_TYPE,
11085
+ CoordinationType$1.FEATURE_TYPE,
11086
+ CoordinationType$1.FEATURE_VALUE_TYPE,
11087
+ CoordinationType$1.OBS_FILTER,
11088
+ CoordinationType$1.OBS_HIGHLIGHT,
11089
+ CoordinationType$1.OBS_SET_SELECTION,
11090
+ CoordinationType$1.OBS_SET_FILTER,
11091
+ CoordinationType$1.OBS_SELECTION,
11092
+ CoordinationType$1.OBS_SELECTION_MODE,
11093
+ CoordinationType$1.OBS_SET_HIGHLIGHT,
11094
+ CoordinationType$1.OBS_SET_COLOR,
11095
+ CoordinationType$1.OBS_COLOR_ENCODING,
11096
+ CoordinationType$1.ADDITIONAL_OBS_SETS,
11097
+ CoordinationType$1.SAMPLE_TYPE,
11098
+ CoordinationType$1.SAMPLE_SET_SELECTION,
11099
+ CoordinationType$1.SAMPLE_SET_FILTER,
11100
+ CoordinationType$1.SAMPLE_SET_COLOR,
11101
+ CoordinationType$1.SAMPLE_SELECTION,
11102
+ CoordinationType$1.SAMPLE_SELECTION_MODE,
11103
+ CoordinationType$1.SAMPLE_FILTER,
11104
+ CoordinationType$1.SAMPLE_FILTER_MODE,
11105
+ CoordinationType$1.SAMPLE_HIGHLIGHT,
11106
+ CoordinationType$1.HIERARCHY_LEVELS
10796
11107
  ]
10797
11108
  };
10798
11109
  const GLOBAL_LABELS = ["z", "t"];
@@ -10985,7 +11296,7 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
10985
11296
  const oldKeys = Object.keys(oldObj);
10986
11297
  const propKey = String(prop);
10987
11298
  if (oldKeys.includes(propKey)) {
10988
- console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
11299
+ log$c.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
10989
11300
  ${oldObj[propKey][1]}`);
10990
11301
  return oldObj[propKey];
10991
11302
  }
@@ -11125,6 +11436,9 @@ const annDataObsSetsArr = z.array(z.object({
11125
11436
  const annDataObsSets = z.object({
11126
11437
  obsSets: annDataObsSetsArr
11127
11438
  });
11439
+ const annDataSampleSets = z.object({
11440
+ sampleSets: annDataObsSetsArr
11441
+ });
11128
11442
  const annDataObsFeatureColumnsArr = z.array(z.object({
11129
11443
  path: z.string()
11130
11444
  }));
@@ -11215,6 +11529,7 @@ const obsPointsAnndataSchema = annDataObsLocations;
11215
11529
  const obsLocationsAnndataSchema = annDataObsLocations;
11216
11530
  const obsSegmentationsAnndataSchema = annDataObsSegmentations;
11217
11531
  const obsSetsAnndataSchema = annDataObsSets;
11532
+ const sampleSetsAnndataSchema = annDataSampleSets;
11218
11533
  const obsFeatureMatrixAnndataSchema = annDataObsFeatureMatrix;
11219
11534
  const obsLabelsAnndataSchema = annDataObsLabels;
11220
11535
  const featureLabelsAnndataSchema = annDataFeatureLabels;
@@ -52712,8 +53027,8 @@ function downloadForUser(dataString, fileName) {
52712
53027
  downloadAnchorNode.click();
52713
53028
  downloadAnchorNode.remove();
52714
53029
  }
52715
- class InternMap extends Map {
52716
- constructor(entries2, key2 = keyof) {
53030
+ let InternMap$1 = class InternMap extends Map {
53031
+ constructor(entries2, key2 = keyof$1) {
52717
53032
  super();
52718
53033
  Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
52719
53034
  if (entries2 != null)
@@ -52721,20 +53036,20 @@ class InternMap extends Map {
52721
53036
  this.set(key22, value2);
52722
53037
  }
52723
53038
  get(key2) {
52724
- return super.get(intern_get(this, key2));
53039
+ return super.get(intern_get$1(this, key2));
52725
53040
  }
52726
53041
  has(key2) {
52727
- return super.has(intern_get(this, key2));
53042
+ return super.has(intern_get$1(this, key2));
52728
53043
  }
52729
53044
  set(key2, value2) {
52730
- return super.set(intern_set(this, key2), value2);
53045
+ return super.set(intern_set$1(this, key2), value2);
52731
53046
  }
52732
53047
  delete(key2) {
52733
- return super.delete(intern_delete(this, key2));
53048
+ return super.delete(intern_delete$1(this, key2));
52734
53049
  }
52735
- }
53050
+ };
52736
53051
  class InternSet extends Set {
52737
- constructor(values3, key2 = keyof) {
53052
+ constructor(values3, key2 = keyof$1) {
52738
53053
  super();
52739
53054
  Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
52740
53055
  if (values3 != null)
@@ -52742,27 +53057,27 @@ class InternSet extends Set {
52742
53057
  this.add(value2);
52743
53058
  }
52744
53059
  has(value2) {
52745
- return super.has(intern_get(this, value2));
53060
+ return super.has(intern_get$1(this, value2));
52746
53061
  }
52747
53062
  add(value2) {
52748
- return super.add(intern_set(this, value2));
53063
+ return super.add(intern_set$1(this, value2));
52749
53064
  }
52750
53065
  delete(value2) {
52751
- return super.delete(intern_delete(this, value2));
53066
+ return super.delete(intern_delete$1(this, value2));
52752
53067
  }
52753
53068
  }
52754
- function intern_get({ _intern, _key }, value2) {
53069
+ function intern_get$1({ _intern, _key }, value2) {
52755
53070
  const key2 = _key(value2);
52756
53071
  return _intern.has(key2) ? _intern.get(key2) : value2;
52757
53072
  }
52758
- function intern_set({ _intern, _key }, value2) {
53073
+ function intern_set$1({ _intern, _key }, value2) {
52759
53074
  const key2 = _key(value2);
52760
53075
  if (_intern.has(key2))
52761
53076
  return _intern.get(key2);
52762
53077
  _intern.set(key2, value2);
52763
53078
  return value2;
52764
53079
  }
52765
- function intern_delete({ _intern, _key }, value2) {
53080
+ function intern_delete$1({ _intern, _key }, value2) {
52766
53081
  const key2 = _key(value2);
52767
53082
  if (_intern.has(key2)) {
52768
53083
  value2 = _intern.get(key2);
@@ -52770,7 +53085,7 @@ function intern_delete({ _intern, _key }, value2) {
52770
53085
  }
52771
53086
  return value2;
52772
53087
  }
52773
- function keyof(value2) {
53088
+ function keyof$1(value2) {
52774
53089
  return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
52775
53090
  }
52776
53091
  function dataToCellSetsTree(data2, options) {
@@ -52783,7 +53098,7 @@ function dataToCellSetsTree(data2, options) {
52783
53098
  children: []
52784
53099
  };
52785
53100
  if (cellSetIds.length > 0 && Array.isArray(cellSetIds[0])) {
52786
- const levelSets = new InternMap([], JSON.stringify);
53101
+ const levelSets = new InternMap$1([], JSON.stringify);
52787
53102
  cellNames[j].forEach((id2, i2) => {
52788
53103
  const classes = cellSetIds.map((col) => col[i2]);
52789
53104
  if (levelSets.has(classes)) {
@@ -52897,7 +53212,7 @@ function getCellColors(params2) {
52897
53212
  return /* @__PURE__ */ new Map();
52898
53213
  }
52899
53214
  function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetSelection, obsIndex, mergedCellSets, cellSetSelection, arraysToStratify) {
52900
- const result = new InternMap([], JSON.stringify);
53215
+ const result = new InternMap$1([], JSON.stringify);
52901
53216
  const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
52902
53217
  const hasCellSetSelection = Array.isArray(cellSetSelection) && cellSetSelection.length > 0;
52903
53218
  const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
@@ -52912,10 +53227,10 @@ function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetS
52912
53227
  const sampleSetInfo = sampleSets && sampleSetSelection ? treeToObsIdsBySetNames(sampleSets, sampleSetSelection) : null;
52913
53228
  const cellSetInfo = mergedCellSets && cellSetSelection ? treeToObsIdsBySetNames(mergedCellSets, cellSetSelection) : null;
52914
53229
  cellSetKeys.forEach((cellSetKey) => {
52915
- result.set(cellSetKey, new InternMap([], JSON.stringify));
53230
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
52916
53231
  sampleSetKeys.forEach((sampleSetKey) => {
52917
53232
  var _a3, _b3;
52918
- result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
53233
+ result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
52919
53234
  const sampleIdsInSampleSet = (_a3 = sampleSetInfo && sampleSetKey ? sampleSetInfo == null ? void 0 : sampleSetInfo.find((n3) => isEqual$5(n3.path, sampleSetKey)) : null) == null ? void 0 : _a3.ids;
52920
53235
  const obsIdsInSampleSet = sampleIdsInSampleSet ? sampleIdsInSampleSet.flatMap((sampleId) => (sampleIdToObsIdsMap == null ? void 0 : sampleIdToObsIdsMap.get(sampleId)) || []) : null;
52921
53236
  const obsIdsInCellSet = (_b3 = cellSetInfo && cellSetKey ? cellSetInfo == null ? void 0 : cellSetInfo.find((n3) => isEqual$5(n3.path, cellSetKey)) : null) == null ? void 0 : _b3.ids;
@@ -52957,7 +53272,7 @@ function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetS
52957
53272
  sampleSetKeys.forEach((sampleSetKey) => {
52958
53273
  const finalInsertionIndex = result.get(cellSetKey).get(sampleSetKey).get("i");
52959
53274
  if (finalInsertionIndex !== result.get(cellSetKey).get(sampleSetKey).get("obsIndex").length) {
52960
- console.warn("The final insertion index is lower than expected.");
53275
+ log$c.warn("The final insertion index is lower than expected.");
52961
53276
  }
52962
53277
  result.get(cellSetKey).get(sampleSetKey).delete("i");
52963
53278
  });
@@ -52965,7 +53280,7 @@ function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetS
52965
53280
  return result;
52966
53281
  }
52967
53282
  function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, mergedCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient) {
52968
- const result = new InternMap([], JSON.stringify);
53283
+ const result = new InternMap$1([], JSON.stringify);
52969
53284
  const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
52970
53285
  const hasCellSetSelection = Array.isArray(cellSetSelection) && cellSetSelection.length > 0;
52971
53286
  const hasGeneSelection = Array.isArray(geneSelection) && geneSelection.length > 0;
@@ -52973,9 +53288,9 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
52973
53288
  const cellSetKeys = hasCellSetSelection ? cellSetSelection : [null];
52974
53289
  const geneKeys = hasGeneSelection ? geneSelection : [null];
52975
53290
  cellSetKeys.forEach((cellSetKey) => {
52976
- result.set(cellSetKey, new InternMap([], JSON.stringify));
53291
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
52977
53292
  sampleSetKeys.forEach((sampleSetKey) => {
52978
- result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
53293
+ result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
52979
53294
  geneKeys.forEach((geneKey) => {
52980
53295
  result.get(cellSetKey).get(sampleSetKey).set(geneKey, []);
52981
53296
  });
@@ -53007,9 +53322,9 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
53007
53322
  return [null, null];
53008
53323
  }
53009
53324
  function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
53010
- const result = new InternMap([], JSON.stringify);
53325
+ const result = new InternMap$1([], JSON.stringify);
53011
53326
  Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
53012
- result.set(cellSetKey, new InternMap([], JSON.stringify));
53327
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
53013
53328
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
53014
53329
  const values3 = secondLevelInternMap.get(geneSelection[0]);
53015
53330
  result.get(cellSetKey).set(sampleSetKey, values3);
@@ -66837,9 +67152,76 @@ function extent$2(values3, valueof) {
66837
67152
  }
66838
67153
  return [min2, max2];
66839
67154
  }
67155
+ class InternMap2 extends Map {
67156
+ constructor(entries2, key2 = keyof) {
67157
+ super();
67158
+ Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
67159
+ if (entries2 != null)
67160
+ for (const [key22, value2] of entries2)
67161
+ this.set(key22, value2);
67162
+ }
67163
+ get(key2) {
67164
+ return super.get(intern_get(this, key2));
67165
+ }
67166
+ has(key2) {
67167
+ return super.has(intern_get(this, key2));
67168
+ }
67169
+ set(key2, value2) {
67170
+ return super.set(intern_set(this, key2), value2);
67171
+ }
67172
+ delete(key2) {
67173
+ return super.delete(intern_delete(this, key2));
67174
+ }
67175
+ }
67176
+ function intern_get({ _intern, _key }, value2) {
67177
+ const key2 = _key(value2);
67178
+ return _intern.has(key2) ? _intern.get(key2) : value2;
67179
+ }
67180
+ function intern_set({ _intern, _key }, value2) {
67181
+ const key2 = _key(value2);
67182
+ if (_intern.has(key2))
67183
+ return _intern.get(key2);
67184
+ _intern.set(key2, value2);
67185
+ return value2;
67186
+ }
67187
+ function intern_delete({ _intern, _key }, value2) {
67188
+ const key2 = _key(value2);
67189
+ if (_intern.has(key2)) {
67190
+ value2 = _intern.get(value2);
67191
+ _intern.delete(key2);
67192
+ }
67193
+ return value2;
67194
+ }
67195
+ function keyof(value2) {
67196
+ return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
67197
+ }
66840
67198
  function identity$i(x2) {
66841
67199
  return x2;
66842
67200
  }
67201
+ function rollup(values3, reduce2, ...keys4) {
67202
+ return nest$1(values3, identity$i, reduce2, keys4);
67203
+ }
67204
+ function nest$1(values3, map2, reduce2, keys4) {
67205
+ return function regroup(values22, i2) {
67206
+ if (i2 >= keys4.length)
67207
+ return reduce2(values22);
67208
+ const groups2 = new InternMap2();
67209
+ const keyof2 = keys4[i2++];
67210
+ let index2 = -1;
67211
+ for (const value2 of values22) {
67212
+ const key2 = keyof2(value2, ++index2, values22);
67213
+ const group2 = groups2.get(key2);
67214
+ if (group2)
67215
+ group2.push(value2);
67216
+ else
67217
+ groups2.set(key2, [value2]);
67218
+ }
67219
+ for (const [key2, values32] of groups2) {
67220
+ groups2.set(key2, regroup(values32, i2));
67221
+ }
67222
+ return map2(groups2);
67223
+ }(values3, 0);
67224
+ }
66843
67225
  var array$8 = Array.prototype;
66844
67226
  var slice$8 = array$8.slice;
66845
67227
  function constant$a(x2) {
@@ -172663,16 +173045,16 @@ async function getDecoder(fileDirectory) {
172663
173045
  const Decoder = await importFn();
172664
173046
  return new Decoder(fileDirectory);
172665
173047
  }
172666
- addDecoder([void 0, 1], () => import("./raw-f68bddd1.js").then((m2) => m2.default));
172667
- addDecoder(5, () => import("./lzw-bc73fdec.js").then((m2) => m2.default));
173048
+ addDecoder([void 0, 1], () => import("./raw-13d1e148.js").then((m2) => m2.default));
173049
+ addDecoder(5, () => import("./lzw-bb4fcd5c.js").then((m2) => m2.default));
172668
173050
  addDecoder(6, () => {
172669
173051
  throw new Error("old style JPEG compression is not supported.");
172670
173052
  });
172671
- addDecoder(7, () => import("./jpeg-8b9a25d4.js").then((m2) => m2.default));
172672
- addDecoder([8, 32946], () => import("./deflate-35fbdf1d.js").then((m2) => m2.default));
172673
- addDecoder(32773, () => import("./packbits-2a588df1.js").then((m2) => m2.default));
172674
- addDecoder(34887, () => import("./lerc-34155be5.js").then((m2) => m2.default));
172675
- addDecoder(50001, () => import("./webimage-1743d05f.js").then((m2) => m2.default));
173053
+ addDecoder(7, () => import("./jpeg-6c54524a.js").then((m2) => m2.default));
173054
+ addDecoder([8, 32946], () => import("./deflate-04bafa55.js").then((m2) => m2.default));
173055
+ addDecoder(32773, () => import("./packbits-8de5f515.js").then((m2) => m2.default));
173056
+ addDecoder(34887, () => import("./lerc-df637713.js").then((m2) => m2.default));
173057
+ addDecoder(50001, () => import("./webimage-3d32244e.js").then((m2) => m2.default));
172676
173058
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
172677
173059
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
172678
173060
  }
@@ -186094,10 +186476,10 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
186094
186476
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
186095
186477
  const colorTexHeight = Math.max(2, Math.ceil(totalColorsLength / texSize));
186096
186478
  if (valueTexHeight > texSize) {
186097
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
186479
+ log$c.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
186098
186480
  }
186099
186481
  if (colorTexHeight > texSize) {
186100
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
186482
+ log$c.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
186101
186483
  }
186102
186484
  const totalData = new Uint8Array(texSize * valueTexHeight);
186103
186485
  const totalColors = new Uint8Array(texSize * colorTexHeight);
@@ -188922,7 +189304,7 @@ function initInterpolator$1(domain2, interpolator) {
188922
189304
  }
188923
189305
  const implicit$1 = Symbol("implicit");
188924
189306
  function ordinal$1() {
188925
- var index2 = new InternMap(), domain2 = [], range2 = [], unknown = implicit$1;
189307
+ var index2 = new InternMap$1(), domain2 = [], range2 = [], unknown = implicit$1;
188926
189308
  function scale2(d) {
188927
189309
  let i2 = index2.get(d);
188928
189310
  if (i2 === void 0) {
@@ -188935,7 +189317,7 @@ function ordinal$1() {
188935
189317
  scale2.domain = function(_2) {
188936
189318
  if (!arguments.length)
188937
189319
  return domain2.slice();
188938
- domain2 = [], index2 = new InternMap();
189320
+ domain2 = [], index2 = new InternMap$1();
188939
189321
  for (const value2 of _2) {
188940
189322
  if (index2.has(value2))
188941
189323
  continue;
@@ -193087,11 +193469,11 @@ function EmbeddingScatterplotSubscriber(props) {
193087
193469
  })] });
193088
193470
  }
193089
193471
  function DualEmbeddingScatterplotSubscriber(props) {
193090
- const { coordinationScopes } = props;
193472
+ const { uuid, coordinationScopes } = props;
193091
193473
  const [{ sampleSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.DUAL_SCATTERPLOT], coordinationScopes);
193092
193474
  const caseSampleSetSelection = useMemo(() => (sampleSetSelection == null ? void 0 : sampleSetSelection[0]) ? [sampleSetSelection[0]] : null, [sampleSetSelection]);
193093
193475
  const ctrlSampleSetSelection = useMemo(() => (sampleSetSelection == null ? void 0 : sampleSetSelection[1]) ? [sampleSetSelection[1]] : null, [sampleSetSelection]);
193094
- return jsxRuntimeExports.jsxs("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "row" }, children: [jsxRuntimeExports.jsx("div", { style: { width: "50%", display: "flex", flexDirection: "column" }, children: jsxRuntimeExports.jsx(EmbeddingScatterplotSubscriber, { ...props, sampleSetSelection: caseSampleSetSelection }) }), jsxRuntimeExports.jsx("div", { style: { width: "50%", display: "flex", flexDirection: "column" }, children: jsxRuntimeExports.jsx(EmbeddingScatterplotSubscriber, { ...props, title: "", sampleSetSelection: ctrlSampleSetSelection }) })] });
193476
+ return jsxRuntimeExports.jsxs("div", { style: { width: "100%", height: "100%", display: "flex", flexDirection: "row" }, children: [jsxRuntimeExports.jsx("div", { style: { width: "50%", display: "flex", flexDirection: "column" }, children: jsxRuntimeExports.jsx(EmbeddingScatterplotSubscriber, { ...props, uuid: `${uuid}-case`, sampleSetSelection: caseSampleSetSelection }) }), jsxRuntimeExports.jsx("div", { style: { width: "50%", display: "flex", flexDirection: "column" }, children: jsxRuntimeExports.jsx(EmbeddingScatterplotSubscriber, { ...props, uuid: `${uuid}-ctrl`, sampleSetSelection: ctrlSampleSetSelection }) })] });
193095
193477
  }
193096
193478
  function GatingScatterplotOptions(props) {
193097
193479
  const { featureType, gatingFeatureSelectionX, setGatingFeatureSelectionX, gatingFeatureSelectionY, setGatingFeatureSelectionY, gatingFeatureValueTransform, setGatingFeatureValueTransform, gatingFeatureValueTransformCoefficient, setGatingFeatureValueTransformCoefficient, geneSelectOptions, transformOptions } = props;
@@ -208793,7 +209175,7 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
208793
209175
  if (type2 === "sequence") {
208794
209176
  return normalizeCoordinateTransformations(transform4.transformations, datasets);
208795
209177
  }
208796
- console.warn(`Coordinate transformation type "${type2}" is not supported.`);
209178
+ log$c.warn(`Coordinate transformation type "${type2}" is not supported.`);
208797
209179
  }
208798
209180
  return transform4;
208799
209181
  });
@@ -212653,7 +213035,7 @@ function SpatialSubscriber$1(props) {
212653
213035
  ]);
212654
213036
  useEffect(() => {
212655
213037
  if (!hasSegmentationsData && cellsLayer && !obsSegmentations && !obsSegmentationsIndex && obsCentroids && obsCentroidsIndex) {
212656
- console.warn("Rendering cell segmentation diamonds for backwards compatibility.");
213038
+ log$c.warn("Rendering cell segmentation diamonds for backwards compatibility.");
212657
213039
  }
212658
213040
  }, [
212659
213041
  hasSegmentationsData,
@@ -214132,7 +214514,7 @@ class ErrorBoundary extends React__default.Component {
214132
214514
  }
214133
214515
  }
214134
214516
  const LazySpatialThree = React__default.lazy(async () => {
214135
- const { SpatialWrapper: SpatialWrapper2 } = await import("./index-91aca3e4.js");
214517
+ const { SpatialWrapper: SpatialWrapper2 } = await import("./index-0b46e436.js");
214136
214518
  return { default: SpatialWrapper2 };
214137
214519
  });
214138
214520
  const SpatialThreeAdapter = React__default.forwardRef((props, ref2) => jsxRuntimeExports.jsx("div", { ref: ref2, style: { width: "100%", height: "100%" }, children: jsxRuntimeExports.jsx(ErrorBoundary, { children: jsxRuntimeExports.jsx(Suspense, { fallback: jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: jsxRuntimeExports.jsx(LazySpatialThree, { ...props }) }) }) }));
@@ -223120,7 +223502,7 @@ function LinkController(props) {
223120
223502
  };
223121
223503
  (_a3 = connection.current) == null ? void 0 : _a3.send(JSON.stringify(message));
223122
223504
  } catch (error2) {
223123
- console.error("Unable to send Configuration to Server", error2);
223505
+ log$c.error("Unable to send Configuration to Server", error2);
223124
223506
  }
223125
223507
  }
223126
223508
  }, [id2, socketOpen, sync]);
@@ -223137,7 +223519,7 @@ function LinkController(props) {
223137
223519
  }).then((response) => response.json()).then((response) => {
223138
223520
  setLinkID(response.link_id);
223139
223521
  }).catch((err2) => {
223140
- console.error("Fetch Error :-S", err2);
223522
+ log$c.error("Fetch Error :-S", err2);
223141
223523
  });
223142
223524
  }
223143
223525
  }, [linkID, linkEndpoint]);
@@ -223153,27 +223535,27 @@ function LinkController(props) {
223153
223535
  if (linkID !== null) {
223154
223536
  const ws2 = new WebSocket(websocketEndpoint, ["Authorization", authToken, linkID]);
223155
223537
  ws2.addEventListener("open", (event2) => {
223156
- console.log("Open", event2);
223538
+ log$c.log("Open", event2);
223157
223539
  setSocketOpen(true);
223158
223540
  });
223159
223541
  ws2.addEventListener("connecting", (event2) => {
223160
- console.log("Connecting", event2);
223542
+ log$c.log("Connecting", event2);
223161
223543
  setSocketOpen(false);
223162
223544
  });
223163
223545
  ws2.addEventListener("error", (event2) => {
223164
- console.log("Error", event2);
223546
+ log$c.log("Error", event2);
223165
223547
  });
223166
223548
  ws2.addEventListener("close", (event2) => {
223167
- console.log("Close", event2);
223549
+ log$c.log("Close", event2);
223168
223550
  });
223169
223551
  ws2.addEventListener("message", (event2) => {
223170
- console.log("Message", event2);
223552
+ log$c.log("Message", event2);
223171
223553
  const eventData = event2.data;
223172
223554
  if (eventData.includes(";")) {
223173
223555
  if (eventData.split(";")[0] === id2) {
223174
- console.log("Message from ourselves");
223556
+ log$c.log("Message from ourselves");
223175
223557
  } else {
223176
- console.log("Message from server ");
223558
+ log$c.log("Message from server ");
223177
223559
  if (sync) {
223178
223560
  setConfig({
223179
223561
  ...JSON.parse(decodeURI(atob(eventData.split(";")[1]))),
@@ -223893,7 +224275,7 @@ const useStyles$3 = makeStyles((theme) => ({
223893
224275
  }));
223894
224276
  register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
223895
224277
  const LazyHiGlassComponent = React__default.lazy(async () => {
223896
- const { HiGlassComponent } = await import("./higlass-6360c0eb.js");
224278
+ const { HiGlassComponent } = await import("./higlass-4fa163b9.js");
223897
224279
  return { default: HiGlassComponent };
223898
224280
  });
223899
224281
  const HG_SIZE = 800;
@@ -229093,7 +229475,10 @@ function CellSetExpressionPlot(props) {
229093
229475
  stratificationSide = ordinal$1().domain(sampleSetNames).range(["left", "right"]);
229094
229476
  stratificationColor = ordinal$1().domain(sampleSetNames).range(
229095
229477
  // TODO: check for full path equality here.
229096
- sampleSetNames.map((name2) => sampleSetColor == null ? void 0 : sampleSetColor.find((d) => d.path.at(-1) === name2).color).map(colorArrayToString)
229478
+ sampleSetNames.map((name2) => {
229479
+ var _a3;
229480
+ return ((_a3 = sampleSetColor == null ? void 0 : sampleSetColor.find((d) => d.path.at(-1) === name2)) == null ? void 0 : _a3.color) || [125, 125, 125];
229481
+ }).map(colorArrayToString)
229097
229482
  );
229098
229483
  }
229099
229484
  const {
@@ -229224,11 +229609,11 @@ function summarize(iterable, keepZeros) {
229224
229609
  };
229225
229610
  }
229226
229611
  function dotStratifiedExpressionData(stratifiedResult, posThreshold) {
229227
- const result = new InternMap([], JSON.stringify);
229612
+ const result = new InternMap$1([], JSON.stringify);
229228
229613
  Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
229229
- result.set(cellSetKey, new InternMap([], JSON.stringify));
229614
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
229230
229615
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
229231
- result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
229616
+ result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
229232
229617
  Array.from(secondLevelInternMap.entries()).forEach(([geneKey, values3]) => {
229233
229618
  if (values3) {
229234
229619
  const exprMean = mean$1(values3);
@@ -229246,9 +229631,9 @@ function dotStratifiedExpressionData(stratifiedResult, posThreshold) {
229246
229631
  return result;
229247
229632
  }
229248
229633
  function summarizeStratifiedExpressionData(stratifiedResult, keepZeros) {
229249
- const summarizedResult = new InternMap([], JSON.stringify);
229634
+ const summarizedResult = new InternMap$1([], JSON.stringify);
229250
229635
  Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
229251
- summarizedResult.set(cellSetKey, new InternMap([], JSON.stringify));
229636
+ summarizedResult.set(cellSetKey, new InternMap$1([], JSON.stringify));
229252
229637
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
229253
229638
  const values3 = secondLevelInternMap;
229254
229639
  const summary = summarize(values3, keepZeros);
@@ -248439,10 +248824,10 @@ const Tiles = {
248439
248824
  resquarify: treemapResquarify
248440
248825
  };
248441
248826
  const Output$4 = ["x0", "y0", "x1", "y1", "depth", "children"];
248442
- function Treemap(params2) {
248827
+ function Treemap$1(params2) {
248443
248828
  HierarchyLayout.call(this, params2);
248444
248829
  }
248445
- Treemap.Definition = {
248830
+ Treemap$1.Definition = {
248446
248831
  "type": "Treemap",
248447
248832
  "metadata": {
248448
248833
  "tree": true,
@@ -248508,7 +248893,7 @@ Treemap.Definition = {
248508
248893
  "default": Output$4
248509
248894
  }]
248510
248895
  };
248511
- inherits(Treemap, HierarchyLayout, {
248896
+ inherits(Treemap$1, HierarchyLayout, {
248512
248897
  /**
248513
248898
  * Treemap layout generator. Adds 'method' and 'ratio' parameters
248514
248899
  * to configure the underlying tile method.
@@ -248539,7 +248924,7 @@ const tree = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
248539
248924
  stratify: Stratify,
248540
248925
  tree: Tree,
248541
248926
  treelinks: TreeLinks,
248542
- treemap: Treemap
248927
+ treemap: Treemap$1
248543
248928
  }, Symbol.toStringTag, { value: "Module" }));
248544
248929
  const ALPHA_MASK = 4278190080;
248545
248930
  function baseBitmaps($2, data2) {
@@ -281142,8 +281527,8 @@ function useExpressionSummaries(sampleEdges, sampleSets, sampleSetSelection, exp
281142
281527
  if (stratifiedData) {
281143
281528
  const dotData = dotStratifiedExpressionData(stratifiedData, posThreshold);
281144
281529
  const geneToUuid = new Map(geneSelection == null ? void 0 : geneSelection.map((gene) => [gene, v4$1()]));
281145
- const cellSetToUuid = new InternMap(cellSetSelection == null ? void 0 : cellSetSelection.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
281146
- const sampleSetToUuid = new InternMap(sampleSetSelection == null ? void 0 : sampleSetSelection.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
281530
+ const cellSetToUuid = new InternMap$1(cellSetSelection == null ? void 0 : cellSetSelection.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
281531
+ const sampleSetToUuid = new InternMap$1(sampleSetSelection == null ? void 0 : sampleSetSelection.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
281147
281532
  const result = [];
281148
281533
  Array.from(dotData.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
281149
281534
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
@@ -281386,6 +281771,235 @@ function FeatureBarPlotSubscriber(props) {
281386
281771
  ]);
281387
281772
  return jsxRuntimeExports.jsx(TitleInfo, { title: `Feature Values${firstGeneSelected ? ` (${firstGeneSelected})` : ""}`, removeGridComponent, urls: urls2, theme, isReady, helpText, children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: expressionArr ? jsxRuntimeExports.jsx(FeatureBarPlot, { yMin, yMax: expressionMax, yUnits, data: expressionArr, theme, width: width2, height: height2, obsType, cellHighlight, cellSetSelection, additionalCellSets, cellSetColor, featureType, featureValueType, featureName: firstGeneSelected, onBarSelect, onBarHighlight }) : jsxRuntimeExports.jsxs("span", { children: ["Select a ", featureType, "."] }) }) });
281388
281773
  }
281774
+ function uidGenerator(prefix2) {
281775
+ let i2 = 0;
281776
+ return () => {
281777
+ i2 += 1;
281778
+ return { id: `${prefix2}-${i2}`, href: `#${prefix2}-${i2}` };
281779
+ };
281780
+ }
281781
+ function getColorScale(setSelectionArr, setColorArr, theme) {
281782
+ var _a3;
281783
+ return ordinal$1().domain(setSelectionArr || []).range(((_a3 = setSelectionArr == null ? void 0 : setSelectionArr.map((setNamePath) => {
281784
+ var _a4;
281785
+ return ((_a4 = setColorArr == null ? void 0 : setColorArr.find((d) => isEqual$5(d.path, setNamePath))) == null ? void 0 : _a4.color) || getDefaultColor(theme);
281786
+ })) == null ? void 0 : _a3.map(colorArrayToString)) || []);
281787
+ }
281788
+ function Treemap(props) {
281789
+ const { obsCounts, obsColorEncoding, hierarchyLevels, theme, width: width2, height: height2, obsType, sampleType, obsSetColor, sampleSetColor, obsSetSelection, sampleSetSelection, marginTop = 5, marginRight = 5, marginLeft = 80, marginBottom } = props;
281790
+ const hierarchyData = useMemo(() => {
281791
+ if (!obsCounts) {
281792
+ return null;
281793
+ }
281794
+ let map2;
281795
+ if (isEqual$5(hierarchyLevels, ["sampleSet", "obsSet"])) {
281796
+ map2 = rollup(obsCounts, (D2) => D2[0].value, (d) => d.sampleSetPath, (d) => d.obsSetPath);
281797
+ } else if (isEqual$5(hierarchyLevels, ["obsSet", "sampleSet"])) {
281798
+ map2 = rollup(obsCounts, (D2) => D2[0].value, (d) => d.obsSetPath, (d) => d.sampleSetPath);
281799
+ } else {
281800
+ throw new Error("Unexpected levels value.");
281801
+ }
281802
+ return hierarchy(map2);
281803
+ }, [obsCounts, hierarchyLevels]);
281804
+ const [obsSetColorScale, sampleSetColorScale] = useMemo(() => [
281805
+ getColorScale(obsSetSelection, obsSetColor, theme),
281806
+ getColorScale(sampleSetSelection, sampleSetColor, theme)
281807
+ ], [obsSetSelection, sampleSetSelection, sampleSetColor, obsSetColor, theme]);
281808
+ const treemapLeaves = useMemo(() => {
281809
+ const treemapFunc = treemap().tile(treemapBinary).size([width2, height2]).padding(1).round(true);
281810
+ const treemapLayout = treemapFunc(hierarchyData.sum((d) => d[1]).sort((a2, b2) => b2[1] - a2[1]));
281811
+ return treemapLayout.leaves();
281812
+ }, [hierarchyData, width2, height2]);
281813
+ const svgRef = useRef();
281814
+ useEffect(() => {
281815
+ const domElement = svgRef.current;
281816
+ const svg2 = select$1(domElement);
281817
+ svg2.selectAll("g").remove();
281818
+ svg2.attr("width", width2).attr("height", height2).attr("viewBox", [0, 0, width2, height2]).attr("style", "font: 10px sans-serif");
281819
+ if (!treemapLeaves || !obsSetSelection || !sampleSetSelection) {
281820
+ return;
281821
+ }
281822
+ const leaf = svg2.selectAll("g").data(treemapLeaves).join("g").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
281823
+ leaf.append("title").text((d) => {
281824
+ var _a3;
281825
+ const cellCount = (_a3 = d.data) == null ? void 0 : _a3[1];
281826
+ const primaryPathString = JSON.stringify(d.data[0]);
281827
+ const secondaryPathString = JSON.stringify(d.parent.data[0]);
281828
+ return `${cellCount.toLocaleString()} ${pluralize(obsType, cellCount)} in ${primaryPathString} and ${secondaryPathString}`;
281829
+ });
281830
+ const getLeafUid = uidGenerator("leaf");
281831
+ const getClipUid = uidGenerator("clip");
281832
+ const colorScale2 = obsColorEncoding === "sampleSetSelection" ? sampleSetColorScale : obsSetColorScale;
281833
+ const getPathForColoring = (d) => {
281834
+ var _a3, _b3, _c3, _d2, _e2, _f3;
281835
+ return (
281836
+ // eslint-disable-next-line no-nested-ternary
281837
+ obsColorEncoding === "sampleSetSelection" ? hierarchyLevels[0] === "obsSet" ? (_a3 = d.data) == null ? void 0 : _a3[0] : (_c3 = (_b3 = d.parent) == null ? void 0 : _b3.data) == null ? void 0 : _c3[0] : hierarchyLevels[0] === "sampleSet" ? (_d2 = d.data) == null ? void 0 : _d2[0] : (_f3 = (_e2 = d.parent) == null ? void 0 : _e2.data) == null ? void 0 : _f3[0]
281838
+ );
281839
+ };
281840
+ leaf.append("rect").attr("id", (d) => {
281841
+ d.leafUid = getLeafUid();
281842
+ return d.leafUid.id;
281843
+ }).attr("fill", (d) => colorScale2(getPathForColoring(d))).attr("fill-opacity", 0.8).attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
281844
+ leaf.append("clipPath").attr("id", (d) => {
281845
+ d.clipUid = getClipUid();
281846
+ return d.clipUid.id;
281847
+ }).append("use").attr("xlink:href", (d) => d.leafUid.href);
281848
+ leaf.append("text").attr("clip-path", (d) => `url(${d.clipUid.href})`).selectAll("tspan").data((d) => {
281849
+ var _a3, _b3, _c3, _d2, _e2, _f3, _g2;
281850
+ return [
281851
+ // Each element in this array corresponds to a line of text.
281852
+ (_b3 = (_a3 = d.data) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.at(-1),
281853
+ (_e2 = (_d2 = (_c3 = d.parent) == null ? void 0 : _c3.data) == null ? void 0 : _d2[0]) == null ? void 0 : _e2.at(-1),
281854
+ `${(_f3 = d.data) == null ? void 0 : _f3[1].toLocaleString()} ${pluralize(obsType, (_g2 = d.data) == null ? void 0 : _g2[1])}`
281855
+ ];
281856
+ }).join("tspan").attr("x", 3).attr("y", (d, i2, nodes) => `${(i2 === nodes.length - 1) * 0.3 + 1.1 + i2 * 0.9}em`).text((d) => d);
281857
+ }, [
281858
+ width2,
281859
+ height2,
281860
+ marginLeft,
281861
+ marginBottom,
281862
+ theme,
281863
+ marginTop,
281864
+ marginRight,
281865
+ obsType,
281866
+ sampleType,
281867
+ treemapLeaves,
281868
+ sampleSetColor,
281869
+ sampleSetSelection,
281870
+ obsSetSelection,
281871
+ obsSetColor,
281872
+ obsSetColorScale,
281873
+ sampleSetColorScale,
281874
+ obsColorEncoding,
281875
+ hierarchyLevels
281876
+ ]);
281877
+ return jsxRuntimeExports.jsx("svg", { ref: svgRef, style: {
281878
+ top: 0,
281879
+ left: 0,
281880
+ width: `${width2}px`,
281881
+ height: `${height2}px`,
281882
+ position: "relative"
281883
+ } });
281884
+ }
281885
+ function TreemapOptions(props) {
281886
+ const { children: children2, obsType, sampleType, hierarchyLevels, setHierarchyLevels, obsColorEncoding, setObsColorEncoding } = props;
281887
+ const treemapOptionsId = $bdb11010cef70236$export$f680877a34711e37();
281888
+ const classes = usePlotOptionsStyles();
281889
+ function handleColorEncodingChange(event2) {
281890
+ setObsColorEncoding(event2.target.value);
281891
+ }
281892
+ function handleHierarchyLevelsOrderingChange(event2) {
281893
+ if (event2.target.value === "sampleSet") {
281894
+ setHierarchyLevels(["sampleSet", "obsSet"]);
281895
+ } else {
281896
+ setHierarchyLevels(["obsSet", "sampleSet"]);
281897
+ }
281898
+ }
281899
+ const primaryHierarchyLevel = isEqual$5(hierarchyLevels, ["sampleSet", "obsSet"]) ? "sampleSet" : "obsSet";
281900
+ return jsxRuntimeExports.jsxs(OptionsContainer, { children: [children2, jsxRuntimeExports.jsxs(TableRow$1, { children: [jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: jsxRuntimeExports.jsx("label", { htmlFor: `cell-color-encoding-select-${treemapOptionsId}`, children: "Color Encoding" }) }), jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: jsxRuntimeExports.jsxs(OptionSelect, { className: classes.select, value: obsColorEncoding, onChange: handleColorEncodingChange, inputProps: {
281901
+ id: `cell-color-encoding-select-${treemapOptionsId}`
281902
+ }, children: [jsxRuntimeExports.jsxs("option", { value: "cellSetSelection", children: [capitalize$2(obsType), " Sets"] }), jsxRuntimeExports.jsxs("option", { value: "sampleSetSelection", children: [capitalize$2(sampleType), " Sets"] })] }) })] }), jsxRuntimeExports.jsxs(TableRow$1, { children: [jsxRuntimeExports.jsx(TableCell$1, { className: classes.labelCell, variant: "head", scope: "row", children: jsxRuntimeExports.jsx("label", { htmlFor: `treemap-set-hierarchy-levels-${treemapOptionsId}`, children: "Primary Hierarchy Level" }) }), jsxRuntimeExports.jsx(TableCell$1, { className: classes.inputCell, variant: "body", children: jsxRuntimeExports.jsxs(OptionSelect, { className: classes.select, value: primaryHierarchyLevel, onChange: handleHierarchyLevelsOrderingChange, inputProps: {
281903
+ id: `hierarchy-level-select-${treemapOptionsId}`
281904
+ }, children: [jsxRuntimeExports.jsxs("option", { value: "obsSet", children: [capitalize$2(obsType), " Sets"] }), jsxRuntimeExports.jsxs("option", { value: "sampleSet", children: [capitalize$2(sampleType), " Sets"] })] }) })] })] });
281905
+ }
281906
+ const DEFAULT_HIERARCHY_LEVELS = ["obsSet", "sampleSet"];
281907
+ function TreemapSubscriber(props) {
281908
+ const { coordinationScopes, removeGridComponent, theme, helpText = ViewHelpMapping.TREEMAP } = props;
281909
+ const classes = useStyles$2();
281910
+ const loaders = useLoaders();
281911
+ const [{ dataset, obsType, featureType, featureValueType, obsFilter, obsHighlight, obsSetSelection, obsSetFilter, obsSelection, obsSelectionMode, obsSetHighlight, obsSetColor, obsColorEncoding, additionalObsSets, sampleType, sampleSetSelection, sampleSetFilter, sampleSetColor, sampleSelection, sampleSelectionMode, sampleFilter, sampleFilterMode, sampleHighlight, hierarchyLevels }, { setObsFilter, setObsSelection: setObsSelection2, setObsSetFilter, setObsSetSelection, setObsSelectionMode, setObsFilterMode, setObsHighlight, setObsSetColor, setObsColorEncoding, setAdditionalObsSets, setSampleFilter, setSampleSetFilter, setSampleFilterMode, setSampleSelection, setSampleSetSelection, setSampleSelectionMode, setSampleHighlight, setSampleSetColor, setHierarchyLevels }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$1.TREEMAP], coordinationScopes);
281912
+ const [width2, height2, containerRef] = useGridItemSize();
281913
+ const [{ obsIndex }, matrixIndicesStatus, matrixIndicesUrls] = useObsFeatureMatrixIndices(loaders, dataset, false, { obsType, featureType, featureValueType });
281914
+ const [{ obsSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(loaders, dataset, true, {}, {}, { obsType });
281915
+ const [{ sampleIndex, sampleSets }, sampleSetsStatus, sampleSetsUrls] = useSampleSetsData(
281916
+ loaders,
281917
+ dataset,
281918
+ // TODO: support `false`, i.e., configurations in which
281919
+ // there are no sampleSets
281920
+ true,
281921
+ { setSampleSetColor },
281922
+ { sampleSetColor },
281923
+ { sampleType }
281924
+ );
281925
+ const [{ sampleEdges }, sampleEdgesStatus, sampleEdgesUrls] = useSampleEdgesData(
281926
+ loaders,
281927
+ dataset,
281928
+ // TODO: support `false`, i.e., configurations in which
281929
+ // there are no sampleEdges
281930
+ true,
281931
+ {},
281932
+ {},
281933
+ { obsType, sampleType }
281934
+ );
281935
+ const isReady = useReady([
281936
+ matrixIndicesStatus,
281937
+ obsSetsStatus,
281938
+ sampleSetsStatus,
281939
+ sampleEdgesStatus
281940
+ ]);
281941
+ const urls2 = useUrls([
281942
+ matrixIndicesUrls,
281943
+ obsSetsUrls,
281944
+ sampleSetsUrls,
281945
+ sampleEdgesUrls
281946
+ ]);
281947
+ const mergedObsSets = useMemo(() => mergeObsSets(obsSets, additionalObsSets), [obsSets, additionalObsSets]);
281948
+ const mergedSampleSets = useMemo(() => mergeObsSets(sampleSets, null), [sampleSets]);
281949
+ const obsCount = (obsIndex == null ? void 0 : obsIndex.length) || 0;
281950
+ const sampleCount = (sampleIndex == null ? void 0 : sampleIndex.length) || 0;
281951
+ const [obsCounts, sampleCounts] = useMemo(() => {
281952
+ var _a3, _b3;
281953
+ const obsResult = new InternMap$1([], JSON.stringify);
281954
+ const sampleResult = new InternMap$1([], JSON.stringify);
281955
+ const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
281956
+ const hasCellSetSelection = Array.isArray(obsSetSelection) && obsSetSelection.length > 0;
281957
+ const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
281958
+ const cellSetKeys = hasCellSetSelection ? obsSetSelection : [null];
281959
+ cellSetKeys.forEach((cellSetKey) => {
281960
+ obsResult.set(cellSetKey, new InternMap$1([], JSON.stringify));
281961
+ sampleSetKeys.forEach((sampleSetKey) => {
281962
+ obsResult.get(cellSetKey).set(sampleSetKey, 0);
281963
+ });
281964
+ });
281965
+ const sampleSetSizes = treeToSetSizesBySetNames(mergedSampleSets, sampleSetSelection, sampleSetSelection, sampleSetColor, theme);
281966
+ sampleSetKeys.forEach((sampleSetKey) => {
281967
+ var _a4;
281968
+ const sampleSetSize = (_a4 = sampleSetSizes.find((d) => isEqual$5(d.setNamePath, sampleSetKey))) == null ? void 0 : _a4.size;
281969
+ sampleResult.set(sampleSetKey, sampleSetSize || 0);
281970
+ });
281971
+ if (mergedObsSets && obsSetSelection) {
281972
+ const sampleIdToSetMap = sampleSets && sampleSetSelection ? treeToSelectedSetMap(sampleSets, sampleSetSelection) : null;
281973
+ const cellIdToSetMap = treeToSelectedSetMap(mergedObsSets, obsSetSelection);
281974
+ for (let i2 = 0; i2 < obsIndex.length; i2 += 1) {
281975
+ const obsId = obsIndex[i2];
281976
+ const cellSet = cellIdToSetMap == null ? void 0 : cellIdToSetMap.get(obsId);
281977
+ const sampleId = sampleEdges == null ? void 0 : sampleEdges.get(obsId);
281978
+ const sampleSet = sampleId ? sampleIdToSetMap == null ? void 0 : sampleIdToSetMap.get(sampleId) : null;
281979
+ if (hasSampleSetSelection && !sampleSet) {
281980
+ continue;
281981
+ }
281982
+ const prevObsCount = (_a3 = obsResult.get(cellSet)) == null ? void 0 : _a3.get(sampleSet);
281983
+ (_b3 = obsResult.get(cellSet)) == null ? void 0 : _b3.set(sampleSet, prevObsCount + 1);
281984
+ }
281985
+ }
281986
+ return [
281987
+ unnestMap(obsResult, ["obsSetPath", "sampleSetPath", "value"]),
281988
+ unnestMap(sampleResult, ["sampleSetPath", "value"])
281989
+ ];
281990
+ }, [
281991
+ obsIndex,
281992
+ sampleEdges,
281993
+ sampleSets,
281994
+ obsSetColor,
281995
+ sampleSetColor,
281996
+ mergedObsSets,
281997
+ obsSetSelection,
281998
+ mergedSampleSets
281999
+ // TODO: consider filtering-related coordination values
282000
+ ]);
282001
+ return jsxRuntimeExports.jsx(TitleInfo, { title: `Treemap of ${capitalize$2(pluralize(obsType, 2))}`, info: `${commaNumber(obsCount)} ${pluralize(obsType, obsCount)} from ${commaNumber(sampleCount)} ${pluralize(sampleType, sampleCount)}`, removeGridComponent, urls: urls2, theme, isReady, helpText, options: jsxRuntimeExports.jsx(TreemapOptions, { obsType, sampleType, obsColorEncoding, setObsColorEncoding, hierarchyLevels: hierarchyLevels || DEFAULT_HIERARCHY_LEVELS, setHierarchyLevels }), children: jsxRuntimeExports.jsx("div", { ref: containerRef, className: classes.vegaContainer, children: jsxRuntimeExports.jsx(Treemap, { obsCounts, sampleCounts, obsColorEncoding, hierarchyLevels: hierarchyLevels || DEFAULT_HIERARCHY_LEVELS, theme, width: width2, height: height2, obsType, sampleType, obsSetColor, sampleSetColor, obsSetSelection, sampleSetSelection }) }) });
282002
+ }
281389
282003
  class LoaderResult {
281390
282004
  /**
281391
282005
  * @param {LoaderDataType} data
@@ -281450,10 +282064,11 @@ class LoaderValidationError extends AbstractLoaderError {
281450
282064
  this.datasetFileType = datasetFileType;
281451
282065
  this.datasetUrl = datasetUrl;
281452
282066
  this.reason = reason;
282067
+ this.message = `${datasetType} from ${datasetUrl}: validation failed`;
281453
282068
  }
281454
282069
  warnInConsole() {
281455
- const { datasetType, datasetUrl, reason } = this;
281456
- console.warn(`${datasetType} from ${datasetUrl}: validation failed`, JSON.stringify(reason, null, 2));
282070
+ const { reason, message } = this;
282071
+ log$c.warn(message, JSON.stringify(reason, null, 2));
281457
282072
  }
281458
282073
  }
281459
282074
  class DataSourceFetchError extends AbstractLoaderError {
@@ -281462,10 +282077,11 @@ class DataSourceFetchError extends AbstractLoaderError {
281462
282077
  this.source = source2;
281463
282078
  this.url = url;
281464
282079
  this.headers = headers;
282080
+ this.message = `${source2} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`;
281465
282081
  }
281466
282082
  warnInConsole() {
281467
- const { source: source2, url, headers } = this;
281468
- console.warn(`${source2} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`);
282083
+ const { message } = this;
282084
+ log$c.warn(message);
281469
282085
  }
281470
282086
  }
281471
282087
  class CsvSource {
@@ -282276,7 +282892,7 @@ async function initLoader(imageData) {
282276
282892
  const { metadata: loaderMetadata } = loader2;
282277
282893
  const { omero, multiscales } = loaderMetadata;
282278
282894
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
282279
- console.error("Multiscales array must exist and have at least one element");
282895
+ log$c.error("Multiscales array must exist and have at least one element");
282280
282896
  }
282281
282897
  const { coordinateTransformations } = multiscales[0];
282282
282898
  const axes = getNgffAxes(multiscales[0].axes);
@@ -282354,7 +282970,7 @@ class RasterJsonAsImageLoader extends RasterLoader {
282354
282970
  }
282355
282971
  });
282356
282972
  if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
282357
- console.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
282973
+ log$c.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
282358
282974
  }
282359
282975
  return new LoaderResult({
282360
282976
  image: loaders.length > 0 && meta2.length > 0 ? { loaders, meta: meta2 } : null
@@ -282386,7 +283002,7 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
282386
283002
  }
282387
283003
  });
282388
283004
  if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
282389
- console.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
283005
+ log$c.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
282390
283006
  }
282391
283007
  return new LoaderResult(loaders.length > 0 && meta2.length > 0 ? {
282392
283008
  obsSegmentationsType: "bitmask",
@@ -282449,7 +283065,7 @@ function basename(path2) {
282449
283065
  const arr = path2.split("/");
282450
283066
  const result = arr.at(-1);
282451
283067
  if (!result) {
282452
- console.error("basename of path is empty", path2);
283068
+ log$c.error("basename of path is empty", path2);
282453
283069
  return "";
282454
283070
  }
282455
283071
  return result;
@@ -282620,6 +283236,16 @@ class AnnDataSource extends ZarrDataSource {
282620
283236
  this.obsIndex = this.getJson("obs/.zattrs").then(({ _index }) => this.getFlatArrDecompressed(`/obs/${_index}`));
282621
283237
  return this.obsIndex;
282622
283238
  }
283239
+ /**
283240
+ * Class method for loading the obs index.
283241
+ * @param {string|undefined} path Used by subclasses.
283242
+ * @returns {Promise<string[]>} An promise for a zarr array
283243
+ * containing the indices.
283244
+ */
283245
+ loadDataFrameIndex(path2 = void 0) {
283246
+ const dfPath = path2 ? dirname(path2) : "";
283247
+ return this.getJson(`${dfPath}/.zattrs`).then(({ _index }) => this.getFlatArrDecompressed(`${dfPath.length > 0 ? "/" : ""}${dfPath}/${_index}`));
283248
+ }
282623
283249
  /**
282624
283250
  * Class method for loading the var index.
282625
283251
  * @param {string|undefined} path Used by subclasses.
@@ -282731,7 +283357,7 @@ class AnnDataSource extends ZarrDataSource {
282731
283357
  try {
282732
283358
  val = await this._loadElement(`${path2}/${key2}`);
282733
283359
  } catch (e3) {
282734
- console.error(`Error in _loadDict: could not load ${key2}`);
283360
+ log$c.error(`Error in _loadDict: could not load ${key2}`);
282735
283361
  }
282736
283362
  result[key2] = val;
282737
283363
  }));
@@ -283616,6 +284242,68 @@ class SampleEdgesAnndataLoader extends AbstractTwoStepLoader {
283616
284242
  });
283617
284243
  }
283618
284244
  }
284245
+ class SampleSetsAnndataLoader extends AbstractTwoStepLoader {
284246
+ loadObsIndices() {
284247
+ var _a3;
284248
+ const { options } = this;
284249
+ const obsIndexPromises = (_a3 = options.sampleSets) == null ? void 0 : _a3.map(({ path: path2 }) => path2).map((pathOrPaths) => {
284250
+ if (Array.isArray(pathOrPaths)) {
284251
+ if (pathOrPaths.length > 0) {
284252
+ return this.dataSource.loadDataFrameIndex(pathOrPaths[0]);
284253
+ }
284254
+ return this.dataSource.loadDataFrameIndex();
284255
+ }
284256
+ return this.dataSource.loadDataFrameIndex(pathOrPaths);
284257
+ });
284258
+ return Promise.all(obsIndexPromises);
284259
+ }
284260
+ loadCellSetIds() {
284261
+ var _a3;
284262
+ const { options } = this;
284263
+ const cellSetZarrLocation = (_a3 = options.sampleSets) == null ? void 0 : _a3.map(({ path: path2 }) => path2);
284264
+ return this.dataSource.loadObsColumns(cellSetZarrLocation);
284265
+ }
284266
+ loadCellSetScores() {
284267
+ var _a3;
284268
+ const { options } = this;
284269
+ const cellSetScoreZarrLocation = (_a3 = options.sampleSets) == null ? void 0 : _a3.map((option) => option.scorePath || void 0);
284270
+ return this.dataSource.loadObsColumns(cellSetScoreZarrLocation);
284271
+ }
284272
+ async load() {
284273
+ const superResult = await super.load().catch((reason) => Promise.resolve(reason));
284274
+ if (superResult instanceof AbstractLoaderError) {
284275
+ return Promise.reject(superResult);
284276
+ }
284277
+ if (!this.cachedResult) {
284278
+ const { options } = this;
284279
+ this.cachedResult = Promise.all([
284280
+ this.dataSource.loadDataFrameIndex(),
284281
+ this.loadObsIndices(),
284282
+ this.loadCellSetIds(),
284283
+ this.loadCellSetScores()
284284
+ ]).then((data2) => [
284285
+ data2[0],
284286
+ dataToCellSetsTree([data2[1], data2[2], data2[3]], options.sampleSets)
284287
+ ]);
284288
+ }
284289
+ const [obsIndex, obsSets] = await this.cachedResult;
284290
+ const obsSetsMembership = treeToMembershipMap(obsSets);
284291
+ const coordinationValues = {};
284292
+ const { tree: tree2 } = obsSets;
284293
+ const newAutoSetSelectionParentName = tree2[0].name;
284294
+ tree2[0].children.map((node2) => [
284295
+ newAutoSetSelectionParentName,
284296
+ node2.name
284297
+ ]);
284298
+ const newAutoSetColors = initializeCellSetColor(obsSets, []);
284299
+ coordinationValues.sampleSetColor = newAutoSetColors;
284300
+ return Promise.resolve(new LoaderResult({
284301
+ sampleIndex: obsIndex,
284302
+ sampleSets: obsSets,
284303
+ sampleSetsMembership: obsSetsMembership
284304
+ }, null, coordinationValues));
284305
+ }
284306
+ }
283619
284307
  class GenomicProfilesZarrLoader extends AbstractTwoStepLoader {
283620
284308
  loadAttrs() {
283621
284309
  if (this.attrs) {
@@ -283749,7 +284437,7 @@ class ImageWrapper {
283749
284437
  const channelNames = this.getChannelNames();
283750
284438
  const channelIndex = channelNames.indexOf(channelSpecifier);
283751
284439
  if (channelIndex === -1) {
283752
- console.error(`Channel ${channelSpecifier} not found in image.`);
284440
+ log$c.error(`Channel ${channelSpecifier} not found in image.`);
283753
284441
  }
283754
284442
  return channelIndex;
283755
284443
  }
@@ -283923,11 +284611,11 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
283923
284611
  const isSpatialData = !!spatialDataChannels || !!imageLabel;
283924
284612
  const isLabels = !!imageLabel;
283925
284613
  if (!isSpatialData && !omero) {
283926
- console.error("image.ome-zarr must have omero metadata in attributes.");
284614
+ log$c.error("image.ome-zarr must have omero metadata in attributes.");
283927
284615
  return Promise.reject(payload);
283928
284616
  }
283929
284617
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
283930
- console.error("Multiscales array must exist and have at least one element");
284618
+ log$c.error("Multiscales array must exist and have at least one element");
283931
284619
  }
283932
284620
  const { datasets, coordinateTransformations: coordinateTransformationsFromFile, name: imageName } = multiscales[0];
283933
284621
  const axes = getNgffAxes(multiscales[0].axes);
@@ -284237,7 +284925,7 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
284237
284925
  const xScaleFactor = scaleFactors[0];
284238
284926
  const yScaleFactor = scaleFactors[1];
284239
284927
  if (xScaleFactor !== yScaleFactor) {
284240
- console.warn("Using x-axis scale factor for transformation of obsSpots, but x and y scale factors are not equal");
284928
+ log$c.warn("Using x-axis scale factor for transformation of obsSpots, but x and y scale factors are not equal");
284241
284929
  }
284242
284930
  for (let i2 = 0; i2 < this.radius.shape[0]; i2++) {
284243
284931
  this.radius.data[i2] *= xScaleFactor;
@@ -342043,7 +342731,8 @@ const baseViewTypes = [
342043
342731
  makeViewType(ViewType$1.GENOMIC_PROFILES, GenomicProfilesSubscriber),
342044
342732
  makeViewType(ViewType$1.DOT_PLOT, DotPlotSubscriber),
342045
342733
  makeViewType(ViewType$1.BIOMARKER_SELECT, BiomarkerSelectSubscriber),
342046
- makeViewType(ViewType$1.LINK_CONTROLLER, LinkControllerSubscriber)
342734
+ makeViewType(ViewType$1.LINK_CONTROLLER, LinkControllerSubscriber),
342735
+ makeViewType(ViewType$1.TREEMAP, TreemapSubscriber)
342047
342736
  ];
342048
342737
  const baseFileTypes = [
342049
342738
  // All CSV file types
@@ -342071,6 +342760,7 @@ const baseFileTypes = [
342071
342760
  ...makeZarrFileTypes(FileType$1.OBS_SEGMENTATIONS_ANNDATA_ZARR, DataType$3.OBS_SEGMENTATIONS, ObsSegmentationsAnndataLoader, AnnDataSource, obsSegmentationsAnndataSchema),
342072
342761
  ...makeZarrFileTypes(FileType$1.FEATURE_LABELS_ANNDATA_ZARR, DataType$3.FEATURE_LABELS, FeatureLabelsAnndataLoader, AnnDataSource, featureLabelsAnndataSchema),
342073
342762
  ...makeZarrFileTypes(FileType$1.SAMPLE_EDGES_ANNDATA_ZARR, DataType$3.SAMPLE_EDGES, SampleEdgesAnndataLoader, AnnDataSource, sampleEdgesAnndataSchema),
342763
+ ...makeZarrFileTypes(FileType$1.SAMPLE_SETS_ANNDATA_ZARR, DataType$3.SAMPLE_SETS, SampleSetsAnndataLoader, AnnDataSource, sampleSetsAnndataSchema),
342074
342764
  // All MuData file types
342075
342765
  makeFileType(FileType$1.OBS_SETS_MUDATA_ZARR, DataType$3.OBS_SETS, ObsSetsAnndataLoader, MuDataSource, obsSetsAnndataSchema),
342076
342766
  makeFileType(FileType$1.OBS_EMBEDDING_MUDATA_ZARR, DataType$3.OBS_EMBEDDING, ObsEmbeddingAnndataLoader, MuDataSource, obsEmbeddingAnndataSchema),
@@ -342355,12 +343045,14 @@ const baseCoordinationTypes = [
342355
343045
  color: rgbArray
342356
343046
  })).nullable()
342357
343047
  ),
343048
+ new PluginCoordinationType(CoordinationType$1.SAMPLE_HIGHLIGHT, null, z.string().nullable()),
342358
343049
  new PluginCoordinationType(CoordinationType$1.EMBEDDING_POINTS_VISIBLE, true, z.boolean()),
342359
343050
  new PluginCoordinationType(CoordinationType$1.EMBEDDING_CONTOURS_VISIBLE, false, z.boolean()),
342360
343051
  new PluginCoordinationType(CoordinationType$1.EMBEDDING_CONTOURS_FILLED, true, z.boolean()),
342361
343052
  new PluginCoordinationType(CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES, null, z.array(z.number()).nullable()),
342362
343053
  new PluginCoordinationType(CoordinationType$1.CONTOUR_COLOR_ENCODING, "cellSetSelection", z.enum(["cellSetSelection", "sampleSetSelection", "contourColor"])),
342363
- new PluginCoordinationType(CoordinationType$1.CONTOUR_COLOR, null, rgbArray.nullable())
343054
+ new PluginCoordinationType(CoordinationType$1.CONTOUR_COLOR, null, rgbArray.nullable()),
343055
+ new PluginCoordinationType(CoordinationType$1.HIERARCHY_LEVELS, null, z.array(z.enum(["sampleSet", "obsSet"])).nullable())
342364
343056
  ];
342365
343057
  const baseAsyncFunctions = [
342366
343058
  new PluginAsyncFunction(AsyncFunctionType.AUTOCOMPLETE_FEATURE, autocompleteFeature),
@@ -342386,7 +343078,7 @@ function Vitessce(props) {
342386
343078
  const validConfig = upgradeAndParse(config3, onConfigUpgrade);
342387
343079
  return [validConfig, true];
342388
343080
  } catch (e3) {
342389
- console.error(e3);
343081
+ log$c.error(e3);
342390
343082
  return [
342391
343083
  {
342392
343084
  title: "Config validation or upgrade failed.",