@vitessce/dev 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.
@@ -70,7 +70,8 @@ const ViewType$2 = {
70
70
  FEATURE_BAR_PLOT: "featureBarPlot",
71
71
  BIOMARKER_SELECT: "biomarkerSelect",
72
72
  LINK_CONTROLLER: "linkController",
73
- DUAL_SCATTERPLOT: "dualScatterplot"
73
+ DUAL_SCATTERPLOT: "dualScatterplot",
74
+ TREEMAP: "treemap"
74
75
  };
75
76
  const DataType$4 = {
76
77
  OBS_LABELS: "obsLabels",
@@ -146,6 +147,7 @@ const FileType$2 = {
146
147
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
147
148
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
148
149
  SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
150
+ SAMPLE_SETS_ANNDATA_ZARR: "sampleSets.anndata.zarr",
149
151
  // AnnData - zipped
150
152
  OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
151
153
  OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
@@ -158,6 +160,7 @@ const FileType$2 = {
158
160
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
159
161
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
160
162
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
163
+ SAMPLE_SETS_ANNDATA_ZARR_ZIP: "sampleSets.anndata.zarr.zip",
161
164
  // AnnData - h5ad via reference spec
162
165
  OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
163
166
  OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
@@ -170,6 +173,7 @@ const FileType$2 = {
170
173
  OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
171
174
  FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
172
175
  SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
176
+ SAMPLE_SETS_ANNDATA_H5AD: "sampleSets.anndata.h5ad",
173
177
  // SpatialData
174
178
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
175
179
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -361,12 +365,15 @@ const CoordinationType$2 = {
361
365
  SAMPLE_SET_FILTER: "sampleSetFilter",
362
366
  SAMPLE_FILTER_MODE: "sampleFilterMode",
363
367
  SAMPLE_SET_COLOR: "sampleSetColor",
368
+ SAMPLE_HIGHLIGHT: "sampleHighlight",
364
369
  EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
365
370
  EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
366
371
  EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
367
372
  EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
368
373
  CONTOUR_COLOR_ENCODING: "contourColorEncoding",
369
- CONTOUR_COLOR: "contourColor"
374
+ CONTOUR_COLOR: "contourColor",
375
+ // Treemap
376
+ HIERARCHY_LEVELS: "hierarchyLevels"
370
377
  };
371
378
  const STATUS$1 = {
372
379
  LOADING: "loading",
@@ -392,7 +399,8 @@ const ViewHelpMapping = {
392
399
  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).",
393
400
  FEATURE_VALUE_HISTOGRAM: "The feature value histogram displays the distribution of values (e.g., expression) for the selected feature (e.g., gene).",
394
401
  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).",
395
- 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."
402
+ 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.",
403
+ TREEMAP: "The treemap provides an overview of the current state of sample-level or cell-level selection and filtering."
396
404
  };
397
405
  const DATA_TYPE_COORDINATION_VALUE_USAGE = {
398
406
  [DataType$4.OBS_SEGMENTATIONS]: [
@@ -486,6 +494,10 @@ const ALT_ZARR_STORE_TYPES = {
486
494
  zip: FileType$2.SAMPLE_EDGES_ANNDATA_ZARR_ZIP,
487
495
  h5ad: FileType$2.SAMPLE_EDGES_ANNDATA_H5AD
488
496
  },
497
+ [FileType$2.SAMPLE_SETS_ANNDATA_ZARR]: {
498
+ zip: FileType$2.SAMPLE_SETS_ANNDATA_ZARR_ZIP,
499
+ h5ad: FileType$2.SAMPLE_SETS_ANNDATA_H5AD
500
+ },
489
501
  // For OME-Zarr:
490
502
  [FileType$2.IMAGE_OME_ZARR]: {
491
503
  zip: FileType$2.IMAGE_OME_ZARR_ZIP
@@ -987,13 +999,39 @@ const COMPONENT_COORDINATION_TYPES = {
987
999
  CoordinationType$2.OBS_SET_SELECTION,
988
1000
  CoordinationType$2.OBS_SET_FILTER
989
1001
  // TODO: create coordination types for internal state of the biomarker selection view?
1002
+ ],
1003
+ [ViewType$2.TREEMAP]: [
1004
+ CoordinationType$2.DATASET,
1005
+ CoordinationType$2.OBS_TYPE,
1006
+ CoordinationType$2.FEATURE_TYPE,
1007
+ CoordinationType$2.FEATURE_VALUE_TYPE,
1008
+ CoordinationType$2.OBS_FILTER,
1009
+ CoordinationType$2.OBS_HIGHLIGHT,
1010
+ CoordinationType$2.OBS_SET_SELECTION,
1011
+ CoordinationType$2.OBS_SET_FILTER,
1012
+ CoordinationType$2.OBS_SELECTION,
1013
+ CoordinationType$2.OBS_SELECTION_MODE,
1014
+ CoordinationType$2.OBS_SET_HIGHLIGHT,
1015
+ CoordinationType$2.OBS_SET_COLOR,
1016
+ CoordinationType$2.OBS_COLOR_ENCODING,
1017
+ CoordinationType$2.ADDITIONAL_OBS_SETS,
1018
+ CoordinationType$2.SAMPLE_TYPE,
1019
+ CoordinationType$2.SAMPLE_SET_SELECTION,
1020
+ CoordinationType$2.SAMPLE_SET_FILTER,
1021
+ CoordinationType$2.SAMPLE_SET_COLOR,
1022
+ CoordinationType$2.SAMPLE_SELECTION,
1023
+ CoordinationType$2.SAMPLE_SELECTION_MODE,
1024
+ CoordinationType$2.SAMPLE_FILTER,
1025
+ CoordinationType$2.SAMPLE_FILTER_MODE,
1026
+ CoordinationType$2.SAMPLE_HIGHLIGHT,
1027
+ CoordinationType$2.HIERARCHY_LEVELS
990
1028
  ]
991
1029
  };
992
1030
  const note = "This file is autogenerated by .changeset/post-changelog.mjs.";
993
- const version$6 = "3.5.6";
994
- const date$5 = "2025-01-29";
1031
+ const version$6 = "3.5.7";
1032
+ const date$5 = "2025-02-19";
995
1033
  const branch = "changeset-release/main";
996
- const hash$1 = "c8eedf07";
1034
+ const hash$1 = "a4bc3a6a";
997
1035
  const META_VERSION = {
998
1036
  note,
999
1037
  version: version$6,
@@ -1025,6 +1063,324 @@ const DEFAULT_RASTER_LAYER_PROPS = {
1025
1063
  // viv.RENDERING_MODES.ADDITIVE,
1026
1064
  use3d: false
1027
1065
  };
1066
+ var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1067
+ function getDefaultExportFromCjs$1(x2) {
1068
+ return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
1069
+ }
1070
+ function getAugmentedNamespace(n3) {
1071
+ if (n3.__esModule)
1072
+ return n3;
1073
+ var f2 = n3.default;
1074
+ if (typeof f2 == "function") {
1075
+ var a2 = function a3() {
1076
+ if (this instanceof a3) {
1077
+ var args = [null];
1078
+ args.push.apply(args, arguments);
1079
+ var Ctor = Function.bind.apply(f2, args);
1080
+ return new Ctor();
1081
+ }
1082
+ return f2.apply(this, arguments);
1083
+ };
1084
+ a2.prototype = f2.prototype;
1085
+ } else
1086
+ a2 = {};
1087
+ Object.defineProperty(a2, "__esModule", { value: true });
1088
+ Object.keys(n3).forEach(function(k) {
1089
+ var d = Object.getOwnPropertyDescriptor(n3, k);
1090
+ Object.defineProperty(a2, k, d.get ? d : {
1091
+ enumerable: true,
1092
+ get: function() {
1093
+ return n3[k];
1094
+ }
1095
+ });
1096
+ });
1097
+ return a2;
1098
+ }
1099
+ var loglevel = { exports: {} };
1100
+ (function(module2) {
1101
+ (function(root2, definition2) {
1102
+ if (module2.exports) {
1103
+ module2.exports = definition2();
1104
+ } else {
1105
+ root2.log = definition2();
1106
+ }
1107
+ })(commonjsGlobal$1, function() {
1108
+ var noop3 = function() {
1109
+ };
1110
+ var undefinedType2 = "undefined";
1111
+ var isIE2 = typeof window !== undefinedType2 && typeof window.navigator !== undefinedType2 && /Trident\/|MSIE /.test(window.navigator.userAgent);
1112
+ var logMethods = [
1113
+ "trace",
1114
+ "debug",
1115
+ "info",
1116
+ "warn",
1117
+ "error"
1118
+ ];
1119
+ var _loggersByName = {};
1120
+ var defaultLogger2 = null;
1121
+ function bindMethod(obj, methodName) {
1122
+ var method2 = obj[methodName];
1123
+ if (typeof method2.bind === "function") {
1124
+ return method2.bind(obj);
1125
+ } else {
1126
+ try {
1127
+ return Function.prototype.bind.call(method2, obj);
1128
+ } catch (e3) {
1129
+ return function() {
1130
+ return Function.prototype.apply.apply(method2, [obj, arguments]);
1131
+ };
1132
+ }
1133
+ }
1134
+ }
1135
+ function traceForIE() {
1136
+ if (console.log) {
1137
+ if (console.log.apply) {
1138
+ console.log.apply(console, arguments);
1139
+ } else {
1140
+ Function.prototype.apply.apply(console.log, [console, arguments]);
1141
+ }
1142
+ }
1143
+ if (console.trace)
1144
+ console.trace();
1145
+ }
1146
+ function realMethod(methodName) {
1147
+ if (methodName === "debug") {
1148
+ methodName = "log";
1149
+ }
1150
+ if (typeof console === undefinedType2) {
1151
+ return false;
1152
+ } else if (methodName === "trace" && isIE2) {
1153
+ return traceForIE;
1154
+ } else if (console[methodName] !== void 0) {
1155
+ return bindMethod(console, methodName);
1156
+ } else if (console.log !== void 0) {
1157
+ return bindMethod(console, "log");
1158
+ } else {
1159
+ return noop3;
1160
+ }
1161
+ }
1162
+ function replaceLoggingMethods() {
1163
+ var level = this.getLevel();
1164
+ for (var i2 = 0; i2 < logMethods.length; i2++) {
1165
+ var methodName = logMethods[i2];
1166
+ this[methodName] = i2 < level ? noop3 : this.methodFactory(methodName, level, this.name);
1167
+ }
1168
+ this.log = this.debug;
1169
+ if (typeof console === undefinedType2 && level < this.levels.SILENT) {
1170
+ return "No console available for logging";
1171
+ }
1172
+ }
1173
+ function enableLoggingWhenConsoleArrives(methodName) {
1174
+ return function() {
1175
+ if (typeof console !== undefinedType2) {
1176
+ replaceLoggingMethods.call(this);
1177
+ this[methodName].apply(this, arguments);
1178
+ }
1179
+ };
1180
+ }
1181
+ function defaultMethodFactory(methodName, _level, _loggerName) {
1182
+ return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
1183
+ }
1184
+ function Logger(name2, factory2) {
1185
+ var self2 = this;
1186
+ var inheritedLevel;
1187
+ var defaultLevel;
1188
+ var userLevel;
1189
+ var storageKey = "loglevel";
1190
+ if (typeof name2 === "string") {
1191
+ storageKey += ":" + name2;
1192
+ } else if (typeof name2 === "symbol") {
1193
+ storageKey = void 0;
1194
+ }
1195
+ function persistLevelIfPossible(levelNum) {
1196
+ var levelName = (logMethods[levelNum] || "silent").toUpperCase();
1197
+ if (typeof window === undefinedType2 || !storageKey)
1198
+ return;
1199
+ try {
1200
+ window.localStorage[storageKey] = levelName;
1201
+ return;
1202
+ } catch (ignore2) {
1203
+ }
1204
+ try {
1205
+ window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
1206
+ } catch (ignore2) {
1207
+ }
1208
+ }
1209
+ function getPersistedLevel() {
1210
+ var storedLevel;
1211
+ if (typeof window === undefinedType2 || !storageKey)
1212
+ return;
1213
+ try {
1214
+ storedLevel = window.localStorage[storageKey];
1215
+ } catch (ignore2) {
1216
+ }
1217
+ if (typeof storedLevel === undefinedType2) {
1218
+ try {
1219
+ var cookie = window.document.cookie;
1220
+ var cookieName = encodeURIComponent(storageKey);
1221
+ var location = cookie.indexOf(cookieName + "=");
1222
+ if (location !== -1) {
1223
+ storedLevel = /^([^;]+)/.exec(
1224
+ cookie.slice(location + cookieName.length + 1)
1225
+ )[1];
1226
+ }
1227
+ } catch (ignore2) {
1228
+ }
1229
+ }
1230
+ if (self2.levels[storedLevel] === void 0) {
1231
+ storedLevel = void 0;
1232
+ }
1233
+ return storedLevel;
1234
+ }
1235
+ function clearPersistedLevel() {
1236
+ if (typeof window === undefinedType2 || !storageKey)
1237
+ return;
1238
+ try {
1239
+ window.localStorage.removeItem(storageKey);
1240
+ } catch (ignore2) {
1241
+ }
1242
+ try {
1243
+ window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
1244
+ } catch (ignore2) {
1245
+ }
1246
+ }
1247
+ function normalizeLevel(input) {
1248
+ var level = input;
1249
+ if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
1250
+ level = self2.levels[level.toUpperCase()];
1251
+ }
1252
+ if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
1253
+ return level;
1254
+ } else {
1255
+ throw new TypeError("log.setLevel() called with invalid level: " + input);
1256
+ }
1257
+ }
1258
+ self2.name = name2;
1259
+ self2.levels = {
1260
+ "TRACE": 0,
1261
+ "DEBUG": 1,
1262
+ "INFO": 2,
1263
+ "WARN": 3,
1264
+ "ERROR": 4,
1265
+ "SILENT": 5
1266
+ };
1267
+ self2.methodFactory = factory2 || defaultMethodFactory;
1268
+ self2.getLevel = function() {
1269
+ if (userLevel != null) {
1270
+ return userLevel;
1271
+ } else if (defaultLevel != null) {
1272
+ return defaultLevel;
1273
+ } else {
1274
+ return inheritedLevel;
1275
+ }
1276
+ };
1277
+ self2.setLevel = function(level, persist) {
1278
+ userLevel = normalizeLevel(level);
1279
+ if (persist !== false) {
1280
+ persistLevelIfPossible(userLevel);
1281
+ }
1282
+ return replaceLoggingMethods.call(self2);
1283
+ };
1284
+ self2.setDefaultLevel = function(level) {
1285
+ defaultLevel = normalizeLevel(level);
1286
+ if (!getPersistedLevel()) {
1287
+ self2.setLevel(level, false);
1288
+ }
1289
+ };
1290
+ self2.resetLevel = function() {
1291
+ userLevel = null;
1292
+ clearPersistedLevel();
1293
+ replaceLoggingMethods.call(self2);
1294
+ };
1295
+ self2.enableAll = function(persist) {
1296
+ self2.setLevel(self2.levels.TRACE, persist);
1297
+ };
1298
+ self2.disableAll = function(persist) {
1299
+ self2.setLevel(self2.levels.SILENT, persist);
1300
+ };
1301
+ self2.rebuild = function() {
1302
+ if (defaultLogger2 !== self2) {
1303
+ inheritedLevel = normalizeLevel(defaultLogger2.getLevel());
1304
+ }
1305
+ replaceLoggingMethods.call(self2);
1306
+ if (defaultLogger2 === self2) {
1307
+ for (var childName in _loggersByName) {
1308
+ _loggersByName[childName].rebuild();
1309
+ }
1310
+ }
1311
+ };
1312
+ inheritedLevel = normalizeLevel(
1313
+ defaultLogger2 ? defaultLogger2.getLevel() : "WARN"
1314
+ );
1315
+ var initialLevel = getPersistedLevel();
1316
+ if (initialLevel != null) {
1317
+ userLevel = normalizeLevel(initialLevel);
1318
+ }
1319
+ replaceLoggingMethods.call(self2);
1320
+ }
1321
+ defaultLogger2 = new Logger();
1322
+ defaultLogger2.getLogger = function getLogger(name2) {
1323
+ if (typeof name2 !== "symbol" && typeof name2 !== "string" || name2 === "") {
1324
+ throw new TypeError("You must supply a name when creating a logger.");
1325
+ }
1326
+ var logger2 = _loggersByName[name2];
1327
+ if (!logger2) {
1328
+ logger2 = _loggersByName[name2] = new Logger(
1329
+ name2,
1330
+ defaultLogger2.methodFactory
1331
+ );
1332
+ }
1333
+ return logger2;
1334
+ };
1335
+ var _log2 = typeof window !== undefinedType2 ? window.log : void 0;
1336
+ defaultLogger2.noConflict = function() {
1337
+ if (typeof window !== undefinedType2 && window.log === defaultLogger2) {
1338
+ window.log = _log2;
1339
+ }
1340
+ return defaultLogger2;
1341
+ };
1342
+ defaultLogger2.getLoggers = function getLoggers2() {
1343
+ return _loggersByName;
1344
+ };
1345
+ defaultLogger2["default"] = defaultLogger2;
1346
+ return defaultLogger2;
1347
+ });
1348
+ })(loglevel);
1349
+ var loglevelExports = loglevel.exports;
1350
+ const log$f = /* @__PURE__ */ getDefaultExportFromCjs$1(loglevelExports);
1351
+ const LogLevel = {
1352
+ SILENT: "silent",
1353
+ INFO: "info",
1354
+ WARN: "warn",
1355
+ ERROR: "error",
1356
+ DEBUG: "debug",
1357
+ TRACE: "trace"
1358
+ // default value
1359
+ };
1360
+ const OrderedLogLevels = [
1361
+ LogLevel.TRACE,
1362
+ LogLevel.DEBUG,
1363
+ LogLevel.INFO,
1364
+ LogLevel.WARN,
1365
+ LogLevel.ERROR
1366
+ ];
1367
+ const DEFAULT_DEBUG_MODE = false;
1368
+ const DEFAULT_LOG_LEVEL = LogLevel.TRACE;
1369
+ function getLogLevel() {
1370
+ return log$f.getLevel();
1371
+ }
1372
+ function setLogLevel(level) {
1373
+ if (Object.values(LogLevel).includes(level)) {
1374
+ log$f.setLevel(level);
1375
+ } else {
1376
+ log$f.warn("Log level is not valid");
1377
+ }
1378
+ }
1379
+ function atLeastLogLevel(someLevel) {
1380
+ const currLevel = getLogLevel();
1381
+ const numericTarget = OrderedLogLevels.indexOf(someLevel);
1382
+ return currLevel <= numericTarget;
1383
+ }
1028
1384
  const ViewType$1 = {
1029
1385
  GENES: [
1030
1386
  "genes",
@@ -1191,7 +1547,7 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
1191
1547
  const oldKeys = Object.keys(oldObj);
1192
1548
  const propKey = String(prop);
1193
1549
  if (oldKeys.includes(propKey)) {
1194
- console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
1550
+ log$f.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
1195
1551
  ${oldObj[propKey][1]}`);
1196
1552
  return oldObj[propKey];
1197
1553
  }
@@ -1205,39 +1561,6 @@ const ViewType = makeConstantWithDeprecationMessage(ViewType$2, ViewType$1);
1205
1561
  const DataType$2 = makeConstantWithDeprecationMessage(DataType$4, DataType$3);
1206
1562
  const FileType = makeConstantWithDeprecationMessage(FileType$2, FileType$1);
1207
1563
  const CoordinationType = makeConstantWithDeprecationMessage(CoordinationType$2, CoordinationType$1);
1208
- var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1209
- function getDefaultExportFromCjs$1(x2) {
1210
- return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
1211
- }
1212
- function getAugmentedNamespace(n3) {
1213
- if (n3.__esModule)
1214
- return n3;
1215
- var f2 = n3.default;
1216
- if (typeof f2 == "function") {
1217
- var a2 = function a3() {
1218
- if (this instanceof a3) {
1219
- var args = [null];
1220
- args.push.apply(args, arguments);
1221
- var Ctor = Function.bind.apply(f2, args);
1222
- return new Ctor();
1223
- }
1224
- return f2.apply(this, arguments);
1225
- };
1226
- a2.prototype = f2.prototype;
1227
- } else
1228
- a2 = {};
1229
- Object.defineProperty(a2, "__esModule", { value: true });
1230
- Object.keys(n3).forEach(function(k) {
1231
- var d = Object.getOwnPropertyDescriptor(n3, k);
1232
- Object.defineProperty(a2, k, d.get ? d : {
1233
- enumerable: true,
1234
- get: function() {
1235
- return n3[k];
1236
- }
1237
- });
1238
- });
1239
- return a2;
1240
- }
1241
1564
  function commonjsRequire(path2) {
1242
1565
  throw new Error('Could not dynamically require "' + path2 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
1243
1566
  }
@@ -1661,6 +1984,27 @@ function getInitialCoordinationScopeName(datasetUid, dataType, i2 = null) {
1661
1984
  const prefix2 = getInitialCoordinationScopePrefix(datasetUid, dataType);
1662
1985
  return `${prefix2}${i2 === null ? 0 : i2}`;
1663
1986
  }
1987
+ const identityFunc = (d) => d;
1988
+ function unnestMap(map2, keys4, aggFunc) {
1989
+ if (keys4.length < 2) {
1990
+ throw new Error("Insufficient number of keys passed to flattenInternMap");
1991
+ }
1992
+ const aggFuncToUse = !aggFunc ? identityFunc : aggFunc;
1993
+ return Array.from(map2.entries()).flatMap(([k, v2]) => {
1994
+ if (v2 instanceof Map) {
1995
+ const keysWithoutFirst = [...keys4];
1996
+ keysWithoutFirst.splice(0, 1);
1997
+ return unnestMap(v2, keysWithoutFirst, aggFuncToUse).map((childObj) => ({
1998
+ [keys4[0]]: k,
1999
+ ...childObj
2000
+ }));
2001
+ }
2002
+ return {
2003
+ [keys4[0]]: k,
2004
+ [keys4[1]]: aggFuncToUse(v2)
2005
+ };
2006
+ });
2007
+ }
1664
2008
  const DEFAULT_DARK_COLOR = [50, 50, 50];
1665
2009
  const DEFAULT_LIGHT_COLOR$3 = [200, 200, 200];
1666
2010
  const DEFAULT_LIGHT2_COLOR = [235, 235, 235];
@@ -1712,16 +2056,16 @@ const COLORMAP_OPTIONS = [
1712
2056
  ];
1713
2057
  const DEFAULT_GL_OPTIONS$1 = { webgl2: true };
1714
2058
  function createDefaultUpdateCellsHover(componentName) {
1715
- return (hoverInfo) => console.warn(`${componentName} updateCellsHover: ${hoverInfo.cellId}`);
2059
+ return (hoverInfo) => log$f.warn(`${componentName} updateCellsHover: ${hoverInfo.cellId}`);
1716
2060
  }
1717
2061
  function createDefaultUpdateGenesHover(componentName) {
1718
- return (hoverInfo) => console.warn(`${componentName} updateGenesHover: ${hoverInfo.geneId}`);
2062
+ return (hoverInfo) => log$f.warn(`${componentName} updateGenesHover: ${hoverInfo.geneId}`);
1719
2063
  }
1720
2064
  function createDefaultUpdateTracksHover(componentName) {
1721
- return (hoverInfo) => console.warn(`${componentName} updateTracksHover: ${hoverInfo}`);
2065
+ return (hoverInfo) => log$f.warn(`${componentName} updateTracksHover: ${hoverInfo}`);
1722
2066
  }
1723
2067
  function createDefaultUpdateViewInfo(componentName) {
1724
- return (viewInfo) => console.warn(`${componentName} updateViewInfo: ${viewInfo}`);
2068
+ return (viewInfo) => log$f.warn(`${componentName} updateViewInfo: ${viewInfo}`);
1725
2069
  }
1726
2070
  function copyUint8Array(arr) {
1727
2071
  const newBuffer = new ArrayBuffer(arr.buffer.byteLength);
@@ -3035,7 +3379,7 @@ async function generateViewDefinition(url, vc, dataset, hintsConfig) {
3035
3379
  fileConfig = await configInstance.composeFileConfig();
3036
3380
  viewsConfig = await configInstance.composeViewsConfig(hintsConfig);
3037
3381
  } catch (error2) {
3038
- console.error(error2);
3382
+ log$f.error(error2);
3039
3383
  return Promise.reject(error2);
3040
3384
  }
3041
3385
  dataset.addFile(fileConfig);
@@ -36208,7 +36552,7 @@ function upgradeFrom1_0_14(config3) {
36208
36552
  newLayout.forEach((viewDef) => {
36209
36553
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
36210
36554
  if (viewDef.props?.[oldProp]) {
36211
- console.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
36555
+ log$f.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
36212
36556
  }
36213
36557
  });
36214
36558
  });
@@ -36231,7 +36575,7 @@ function upgradeFrom1_0_15(config3) {
36231
36575
  Object.entries(coordinationScopes).forEach(([coordinationType, coordinationScope]) => {
36232
36576
  if (!Array.isArray(coordinationScope) && typeof coordinationScope === "object") {
36233
36577
  if (coordinationType === "dataset") {
36234
- console.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
36578
+ log$f.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
36235
36579
  }
36236
36580
  coordinationScopesBy.dataset[coordinationType] = coordinationScope;
36237
36581
  } else if (Array.isArray(coordinationScope) || typeof coordinationScope === "string") {
@@ -38621,6 +38965,9 @@ const annDataObsSetsArr = z.array(z.object({
38621
38965
  const annDataObsSets = z.object({
38622
38966
  obsSets: annDataObsSetsArr
38623
38967
  });
38968
+ const annDataSampleSets = z.object({
38969
+ sampleSets: annDataObsSetsArr
38970
+ });
38624
38971
  const annDataObsFeatureColumnsArr = z.array(z.object({
38625
38972
  path: z.string()
38626
38973
  }));
@@ -38711,6 +39058,7 @@ const obsPointsAnndataSchema = annDataObsLocations;
38711
39058
  const obsLocationsAnndataSchema = annDataObsLocations;
38712
39059
  const obsSegmentationsAnndataSchema = annDataObsSegmentations;
38713
39060
  const obsSetsAnndataSchema = annDataObsSets;
39061
+ const sampleSetsAnndataSchema = annDataSampleSets;
38714
39062
  const obsFeatureMatrixAnndataSchema = annDataObsFeatureMatrix;
38715
39063
  const obsLabelsAnndataSchema = annDataObsLabels;
38716
39064
  const featureLabelsAnndataSchema = annDataFeatureLabels;
@@ -46070,8 +46418,8 @@ VitessceGridLayout.defaultProps = {
46070
46418
  padding: 10,
46071
46419
  margin: 10
46072
46420
  };
46073
- class InternMap extends Map {
46074
- constructor(entries2, key2 = keyof) {
46421
+ let InternMap$1 = class InternMap extends Map {
46422
+ constructor(entries2, key2 = keyof$1) {
46075
46423
  super();
46076
46424
  Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
46077
46425
  if (entries2 != null)
@@ -46079,20 +46427,20 @@ class InternMap extends Map {
46079
46427
  this.set(key3, value2);
46080
46428
  }
46081
46429
  get(key2) {
46082
- return super.get(intern_get(this, key2));
46430
+ return super.get(intern_get$1(this, key2));
46083
46431
  }
46084
46432
  has(key2) {
46085
- return super.has(intern_get(this, key2));
46433
+ return super.has(intern_get$1(this, key2));
46086
46434
  }
46087
46435
  set(key2, value2) {
46088
- return super.set(intern_set(this, key2), value2);
46436
+ return super.set(intern_set$1(this, key2), value2);
46089
46437
  }
46090
46438
  delete(key2) {
46091
- return super.delete(intern_delete(this, key2));
46439
+ return super.delete(intern_delete$1(this, key2));
46092
46440
  }
46093
- }
46441
+ };
46094
46442
  class InternSet extends Set {
46095
- constructor(values3, key2 = keyof) {
46443
+ constructor(values3, key2 = keyof$1) {
46096
46444
  super();
46097
46445
  Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
46098
46446
  if (values3 != null)
@@ -46100,27 +46448,27 @@ class InternSet extends Set {
46100
46448
  this.add(value2);
46101
46449
  }
46102
46450
  has(value2) {
46103
- return super.has(intern_get(this, value2));
46451
+ return super.has(intern_get$1(this, value2));
46104
46452
  }
46105
46453
  add(value2) {
46106
- return super.add(intern_set(this, value2));
46454
+ return super.add(intern_set$1(this, value2));
46107
46455
  }
46108
46456
  delete(value2) {
46109
- return super.delete(intern_delete(this, value2));
46457
+ return super.delete(intern_delete$1(this, value2));
46110
46458
  }
46111
46459
  }
46112
- function intern_get({ _intern, _key }, value2) {
46460
+ function intern_get$1({ _intern, _key }, value2) {
46113
46461
  const key2 = _key(value2);
46114
46462
  return _intern.has(key2) ? _intern.get(key2) : value2;
46115
46463
  }
46116
- function intern_set({ _intern, _key }, value2) {
46464
+ function intern_set$1({ _intern, _key }, value2) {
46117
46465
  const key2 = _key(value2);
46118
46466
  if (_intern.has(key2))
46119
46467
  return _intern.get(key2);
46120
46468
  _intern.set(key2, value2);
46121
46469
  return value2;
46122
46470
  }
46123
- function intern_delete({ _intern, _key }, value2) {
46471
+ function intern_delete$1({ _intern, _key }, value2) {
46124
46472
  const key2 = _key(value2);
46125
46473
  if (_intern.has(key2)) {
46126
46474
  value2 = _intern.get(key2);
@@ -46128,7 +46476,7 @@ function intern_delete({ _intern, _key }, value2) {
46128
46476
  }
46129
46477
  return value2;
46130
46478
  }
46131
- function keyof(value2) {
46479
+ function keyof$1(value2) {
46132
46480
  return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
46133
46481
  }
46134
46482
  class LoaderResult {
@@ -46195,10 +46543,11 @@ class LoaderValidationError extends AbstractLoaderError {
46195
46543
  this.datasetFileType = datasetFileType;
46196
46544
  this.datasetUrl = datasetUrl;
46197
46545
  this.reason = reason;
46546
+ this.message = `${datasetType} from ${datasetUrl}: validation failed`;
46198
46547
  }
46199
46548
  warnInConsole() {
46200
- const { datasetType, datasetUrl, reason } = this;
46201
- console.warn(`${datasetType} from ${datasetUrl}: validation failed`, JSON.stringify(reason, null, 2));
46549
+ const { reason, message } = this;
46550
+ log$f.warn(message, JSON.stringify(reason, null, 2));
46202
46551
  }
46203
46552
  }
46204
46553
  class LoaderNotFoundError extends AbstractLoaderError {
@@ -46209,14 +46558,11 @@ class LoaderNotFoundError extends AbstractLoaderError {
46209
46558
  this.dataset = dataset;
46210
46559
  this.fileType = fileType;
46211
46560
  this.viewCoordinationValues = viewCoordinationValues;
46561
+ this.message = `Expected to match on { ${Object.entries(viewCoordinationValues || {}).map(([k, v2]) => `${k}: ${v2 ?? "null"}`).join(", ")} }`;
46212
46562
  }
46213
46563
  warnInConsole() {
46214
- const { loaders, viewCoordinationValues } = this;
46215
- console.warn(
46216
- // eslint-disable-next-line prefer-template
46217
- `Expected to match on { ${Object.entries(viewCoordinationValues).map(([k, v2]) => k + ": " + v2).join(", ")} }`,
46218
- loaders
46219
- );
46564
+ const { loaders, message } = this;
46565
+ log$f.warn(message, loaders);
46220
46566
  }
46221
46567
  }
46222
46568
  class DataSourceFetchError extends AbstractLoaderError {
@@ -46225,10 +46571,11 @@ class DataSourceFetchError extends AbstractLoaderError {
46225
46571
  this.source = source2;
46226
46572
  this.url = url;
46227
46573
  this.headers = headers;
46574
+ this.message = `${source2} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`;
46228
46575
  }
46229
46576
  warnInConsole() {
46230
- const { source: source2, url, headers } = this;
46231
- console.warn(`${source2} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`);
46577
+ const { message } = this;
46578
+ log$f.warn(message);
46232
46579
  }
46233
46580
  }
46234
46581
  function getSourceAndLoaderFromFileType(type3, fileTypes) {
@@ -46305,7 +46652,7 @@ function withDefaults(coordinationValues, dataType, fileType, datasetUid, defaul
46305
46652
  ...coordinationValues
46306
46653
  };
46307
46654
  if (!isEqual$5(coordinationValues, coordinationValuesWithDefaults)) {
46308
- console.warn(`Using coordination value defaults for file type ${fileType} in dataset ${datasetUid}
46655
+ log$f.warn(`Using coordination value defaults for file type ${fileType} in dataset ${datasetUid}
46309
46656
  Before: ${JSON.stringify(coordinationValues)}
46310
46657
  After: ${JSON.stringify(coordinationValuesWithDefaults)}`);
46311
46658
  }
@@ -46313,7 +46660,7 @@ After: ${JSON.stringify(coordinationValuesWithDefaults)}`);
46313
46660
  }
46314
46661
  function createLoaders(datasets, configDescription, fileTypes, coordinationTypes, stores) {
46315
46662
  const result = {};
46316
- const dataSources = new InternMap([], JSON.stringify);
46663
+ const dataSources = new InternMap$1([], JSON.stringify);
46317
46664
  const defaultCoordinationValues = Object.fromEntries(coordinationTypes.map((ct2) => [ct2.name, ct2.defaultValue]));
46318
46665
  datasets.forEach((dataset) => {
46319
46666
  const datasetLoaders = {
@@ -46344,7 +46691,7 @@ function createLoaders(datasets, configDescription, fileTypes, coordinationTypes
46344
46691
  if (datasetLoaders.loaders[dataType]) {
46345
46692
  datasetLoaders.loaders[dataType].set(coordinationValuesWithDefaults, loader2);
46346
46693
  } else {
46347
- datasetLoaders.loaders[dataType] = new InternMap([
46694
+ datasetLoaders.loaders[dataType] = new InternMap$1([
46348
46695
  [coordinationValuesWithDefaults, loader2]
46349
46696
  ], JSON.stringify);
46350
46697
  }
@@ -46494,9 +46841,76 @@ function extent$2(values3, valueof) {
46494
46841
  }
46495
46842
  return [min2, max2];
46496
46843
  }
46844
+ class InternMap2 extends Map {
46845
+ constructor(entries2, key2 = keyof) {
46846
+ super();
46847
+ Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key2 } });
46848
+ if (entries2 != null)
46849
+ for (const [key3, value2] of entries2)
46850
+ this.set(key3, value2);
46851
+ }
46852
+ get(key2) {
46853
+ return super.get(intern_get(this, key2));
46854
+ }
46855
+ has(key2) {
46856
+ return super.has(intern_get(this, key2));
46857
+ }
46858
+ set(key2, value2) {
46859
+ return super.set(intern_set(this, key2), value2);
46860
+ }
46861
+ delete(key2) {
46862
+ return super.delete(intern_delete(this, key2));
46863
+ }
46864
+ }
46865
+ function intern_get({ _intern, _key }, value2) {
46866
+ const key2 = _key(value2);
46867
+ return _intern.has(key2) ? _intern.get(key2) : value2;
46868
+ }
46869
+ function intern_set({ _intern, _key }, value2) {
46870
+ const key2 = _key(value2);
46871
+ if (_intern.has(key2))
46872
+ return _intern.get(key2);
46873
+ _intern.set(key2, value2);
46874
+ return value2;
46875
+ }
46876
+ function intern_delete({ _intern, _key }, value2) {
46877
+ const key2 = _key(value2);
46878
+ if (_intern.has(key2)) {
46879
+ value2 = _intern.get(value2);
46880
+ _intern.delete(key2);
46881
+ }
46882
+ return value2;
46883
+ }
46884
+ function keyof(value2) {
46885
+ return value2 !== null && typeof value2 === "object" ? value2.valueOf() : value2;
46886
+ }
46497
46887
  function identity$j(x2) {
46498
46888
  return x2;
46499
46889
  }
46890
+ function rollup(values3, reduce2, ...keys4) {
46891
+ return nest$1(values3, identity$j, reduce2, keys4);
46892
+ }
46893
+ function nest$1(values3, map2, reduce2, keys4) {
46894
+ return function regroup(values4, i2) {
46895
+ if (i2 >= keys4.length)
46896
+ return reduce2(values4);
46897
+ const groups = new InternMap2();
46898
+ const keyof2 = keys4[i2++];
46899
+ let index2 = -1;
46900
+ for (const value2 of values4) {
46901
+ const key2 = keyof2(value2, ++index2, values4);
46902
+ const group2 = groups.get(key2);
46903
+ if (group2)
46904
+ group2.push(value2);
46905
+ else
46906
+ groups.set(key2, [value2]);
46907
+ }
46908
+ for (const [key2, values5] of groups) {
46909
+ groups.set(key2, regroup(values5, i2));
46910
+ }
46911
+ return map2(groups);
46912
+ }(values3, 0);
46913
+ }
46500
46914
  var array$8 = Array.prototype;
46501
46915
  var slice$8 = array$8.slice;
46502
46916
  function constant$b(x2) {
@@ -47329,11 +47743,15 @@ function Warning(props) {
47329
47743
  const classes = useStyles$v();
47330
47744
  return jsxRuntimeExports.jsx("div", { className: VITESSCE_CONTAINER, children: jsxRuntimeExports.jsx("div", { className: clsx(classes.warningLayout, classes.containerFluid), children: jsxRuntimeExports.jsx("div", { className: classes.row, children: jsxRuntimeExports.jsxs("div", { className: classes.warningCard, children: [jsxRuntimeExports.jsx("h1", { children: title2 }), preformatted ? jsxRuntimeExports.jsx("pre", { children: preformatted }) : null, jsxRuntimeExports.jsx("p", { children: unformatted })] }) }) }) });
47331
47745
  }
47746
+ function DebugWindow({ debugErrors }) {
47747
+ const classes = useStyles$v();
47748
+ return jsxRuntimeExports.jsx("div", { className: VITESSCE_CONTAINER, children: jsxRuntimeExports.jsx("div", { className: clsx(classes.warningLayout, classes.containerFluid), children: jsxRuntimeExports.jsx("div", { className: classes.row, children: jsxRuntimeExports.jsx("div", { className: classes.warningCard, children: debugErrors.map((error2, index2) => jsxRuntimeExports.jsxs("div", { children: [index2 === 0 && jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsxs("h1", { children: ["Error Type: ", error2.name] }), Object.keys(error2).map((key2) => key2 !== "name" && key2 !== "message" && jsxRuntimeExports.jsxs("p", { children: [key2.charAt(0).toUpperCase() + key2.slice(1), ": ", error2[key2]] }, key2))] }), jsxRuntimeExports.jsxs("p", { children: ["Error: ", error2.message] })] }, error2.message || index2)) }) }) }) });
47749
+ }
47332
47750
  function validateViewConfig(viewConfig, pluginSpecificConfigSchema) {
47333
47751
  try {
47334
47752
  pluginSpecificConfigSchema.parse(viewConfig);
47335
47753
  } catch (e3) {
47336
- console.error(e3);
47754
+ log$f.error(e3);
47337
47755
  }
47338
47756
  }
47339
47757
  function CallbackPublisher(props) {
@@ -47368,10 +47786,12 @@ function CallbackPublisher(props) {
47368
47786
  return null;
47369
47787
  }
47370
47788
  function logConfig(config3, name2) {
47371
- console.groupCollapsed(`🚄 VitS (${META_VERSION.version}) ${name2}`);
47372
- console.info(`data:,${JSON.stringify(config3)}`);
47373
- console.info(JSON.stringify(config3, null, 2));
47374
- console.groupEnd();
47789
+ if (atLeastLogLevel(LogLevel.INFO)) {
47790
+ console.groupCollapsed(`🚄 VitS (${META_VERSION.version}) ${name2}`);
47791
+ console.info(`data:,${JSON.stringify(config3)}`);
47792
+ console.info(JSON.stringify(config3, null, 2));
47793
+ console.groupEnd();
47794
+ }
47375
47795
  }
47376
47796
  function getExistingScopesForCoordinationType(config3, coordinationType) {
47377
47797
  const spaceScopes = Object.keys(config3?.coordinationSpace?.[coordinationType] || {});
@@ -47541,12 +47961,18 @@ function createGenerateClassName(customPrefix) {
47541
47961
  };
47542
47962
  }
47543
47963
  function VitS(props) {
47544
- const { config: config3, stores, rowHeight, height: height2, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid: uid2 = null, remountOnUidChange = true, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, asyncFunctions: asyncFunctionsProp, warning: warning2, pageMode = false, children: children3 } = props;
47964
+ const { config: config3, stores, rowHeight, height: height2, theme, onWarn, onConfigChange, onLoaderChange, validateConfig = true, validateOnConfigChange = false, isBounded = false, uid: uid2 = null, remountOnUidChange = true, viewTypes: viewTypesProp, fileTypes: fileTypesProp, jointFileTypes: jointFileTypesProp, coordinationTypes: coordinationTypesProp, asyncFunctions: asyncFunctionsProp, warning: warning2, pageMode = false, children: children3, debugMode = DEFAULT_DEBUG_MODE, logLevel = DEFAULT_LOG_LEVEL } = props;
47965
+ const [debugErrors, setDebugErrors] = useState([]);
47545
47966
  const viewTypes = useMemo(() => viewTypesProp || [], [viewTypesProp]);
47546
47967
  const fileTypes = useMemo(() => fileTypesProp || [], [fileTypesProp]);
47547
47968
  const jointFileTypes = useMemo(() => jointFileTypesProp || [], [jointFileTypesProp]);
47548
47969
  const coordinationTypes = useMemo(() => coordinationTypesProp || [], [coordinationTypesProp]);
47549
47970
  const generateClassName2 = useMemo(() => createGenerateClassName(uid2), [uid2]);
47971
+ useLayoutEffect$1(() => {
47972
+ setLogLevel(logLevel);
47973
+ }, [logLevel]);
47974
+ useLayoutEffect$1(() => {
47975
+ }, [debugMode]);
47550
47976
  const configVersion = config3?.version;
47551
47977
  const configKey = useMemo(() => {
47552
47978
  if (config3?.uid) {
@@ -47628,6 +48054,9 @@ function VitS(props) {
47628
48054
  }
47629
48055
  return createViewConfigStore(null, null);
47630
48056
  }, [success, configKey]);
48057
+ if (debugMode && debugErrors.length > 0) {
48058
+ return jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(DebugWindow, { debugErrors }) }) });
48059
+ }
47631
48060
  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, ...remountOnUidChange ? { key: configKey } : {}, children: jsxRuntimeExports.jsx(AuxiliaryProvider, { createStore: createAuxiliaryStore, children: jsxRuntimeExports.jsxs(AsyncFunctionsContext.Provider, { value: asyncFunctions, children: [jsxRuntimeExports.jsx(VitessceGrid, { pageMode, success, configKey, viewTypes, fileTypes, coordinationTypes, config: configOrWarning, rowHeight, height: height2, theme, isBounded, stores, children: children3 }), jsxRuntimeExports.jsx(CallbackPublisher, { onWarn, onConfigChange, onLoaderChange, validateOnConfigChange, pluginSpecificConfigSchema })] }) }) }) }) }) }) : jsxRuntimeExports.jsx(StylesProvider, { generateClassName: generateClassName2, children: jsxRuntimeExports.jsx(ThemeProvider, { theme: muiTheme[theme], children: jsxRuntimeExports.jsx(Warning, { ...configOrWarning }) }) });
47632
48061
  }
47633
48062
  const AddIcon = createSvgIcon(/* @__PURE__ */ React$6.createElement("path", {
@@ -47823,8 +48252,8 @@ function TitleInfo(props) {
47823
48252
  }
47824
48253
  function warn$2(error2, setWarning) {
47825
48254
  setWarning(error2.message);
47826
- console.warn(error2.message);
47827
- console.error(error2.stack);
48255
+ log$f.warn(error2.message);
48256
+ log$f.error(error2.stack);
47828
48257
  if (error2 instanceof AbstractLoaderError) {
47829
48258
  error2.warnInConsole();
47830
48259
  }
@@ -67607,7 +68036,7 @@ function dataToCellSetsTree(data2, options) {
67607
68036
  children: []
67608
68037
  };
67609
68038
  if (cellSetIds.length > 0 && Array.isArray(cellSetIds[0])) {
67610
- const levelSets = new InternMap([], JSON.stringify);
68039
+ const levelSets = new InternMap$1([], JSON.stringify);
67611
68040
  cellNames[j].forEach((id2, i2) => {
67612
68041
  const classes = cellSetIds.map((col) => col[i2]);
67613
68042
  if (levelSets.has(classes)) {
@@ -67721,7 +68150,7 @@ function getCellColors(params2) {
67721
68150
  return /* @__PURE__ */ new Map();
67722
68151
  }
67723
68152
  function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetSelection, obsIndex, mergedCellSets, cellSetSelection, arraysToStratify) {
67724
- const result = new InternMap([], JSON.stringify);
68153
+ const result = new InternMap$1([], JSON.stringify);
67725
68154
  const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
67726
68155
  const hasCellSetSelection = Array.isArray(cellSetSelection) && cellSetSelection.length > 0;
67727
68156
  const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
@@ -67736,9 +68165,9 @@ function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetS
67736
68165
  const sampleSetInfo = sampleSets && sampleSetSelection ? treeToObsIdsBySetNames(sampleSets, sampleSetSelection) : null;
67737
68166
  const cellSetInfo = mergedCellSets && cellSetSelection ? treeToObsIdsBySetNames(mergedCellSets, cellSetSelection) : null;
67738
68167
  cellSetKeys.forEach((cellSetKey) => {
67739
- result.set(cellSetKey, new InternMap([], JSON.stringify));
68168
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
67740
68169
  sampleSetKeys.forEach((sampleSetKey) => {
67741
- result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
68170
+ result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
67742
68171
  const sampleIdsInSampleSet = (sampleSetInfo && sampleSetKey ? sampleSetInfo?.find((n3) => isEqual$5(n3.path, sampleSetKey)) : null)?.ids;
67743
68172
  const obsIdsInSampleSet = sampleIdsInSampleSet ? sampleIdsInSampleSet.flatMap((sampleId) => sampleIdToObsIdsMap?.get(sampleId) || []) : null;
67744
68173
  const obsIdsInCellSet = (cellSetInfo && cellSetKey ? cellSetInfo?.find((n3) => isEqual$5(n3.path, cellSetKey)) : null)?.ids;
@@ -67780,7 +68209,7 @@ function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetS
67780
68209
  sampleSetKeys.forEach((sampleSetKey) => {
67781
68210
  const finalInsertionIndex = result.get(cellSetKey).get(sampleSetKey).get("i");
67782
68211
  if (finalInsertionIndex !== result.get(cellSetKey).get(sampleSetKey).get("obsIndex").length) {
67783
- console.warn("The final insertion index is lower than expected.");
68212
+ log$f.warn("The final insertion index is lower than expected.");
67784
68213
  }
67785
68214
  result.get(cellSetKey).get(sampleSetKey).delete("i");
67786
68215
  });
@@ -67788,7 +68217,7 @@ function stratifyArrays(sampleEdges, sampleIdToObsIdsMap, sampleSets, sampleSetS
67788
68217
  return result;
67789
68218
  }
67790
68219
  function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, expressionData, obsIndex, mergedCellSets, geneSelection, cellSetSelection, cellSetColor, featureValueTransform, featureValueTransformCoefficient) {
67791
- const result = new InternMap([], JSON.stringify);
68220
+ const result = new InternMap$1([], JSON.stringify);
67792
68221
  const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
67793
68222
  const hasCellSetSelection = Array.isArray(cellSetSelection) && cellSetSelection.length > 0;
67794
68223
  const hasGeneSelection = Array.isArray(geneSelection) && geneSelection.length > 0;
@@ -67796,9 +68225,9 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
67796
68225
  const cellSetKeys = hasCellSetSelection ? cellSetSelection : [null];
67797
68226
  const geneKeys = hasGeneSelection ? geneSelection : [null];
67798
68227
  cellSetKeys.forEach((cellSetKey) => {
67799
- result.set(cellSetKey, new InternMap([], JSON.stringify));
68228
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
67800
68229
  sampleSetKeys.forEach((sampleSetKey) => {
67801
- result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
68230
+ result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
67802
68231
  geneKeys.forEach((geneKey) => {
67803
68232
  result.get(cellSetKey).get(sampleSetKey).set(geneKey, []);
67804
68233
  });
@@ -67829,9 +68258,9 @@ function stratifyExpressionData(sampleEdges, sampleSets, sampleSetSelection, exp
67829
68258
  return [null, null];
67830
68259
  }
67831
68260
  function aggregateStratifiedExpressionData(stratifiedResult, geneSelection) {
67832
- const result = new InternMap([], JSON.stringify);
68261
+ const result = new InternMap$1([], JSON.stringify);
67833
68262
  Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
67834
- result.set(cellSetKey, new InternMap([], JSON.stringify));
68263
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
67835
68264
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
67836
68265
  const values3 = secondLevelInternMap.get(geneSelection[0]);
67837
68266
  result.get(cellSetKey).set(sampleSetKey, values3);
@@ -68741,9 +69170,9 @@ var isSymbol$6 = USE_NATIVE && typeof $Symbol$1.iterator == "symbol" ? function(
68741
69170
  } : function(it2) {
68742
69171
  return it2 instanceof $Symbol$1;
68743
69172
  };
68744
- var $defineProperty$3 = function defineProperty2(it2, key2, D2) {
69173
+ var $defineProperty$4 = function defineProperty2(it2, key2, D2) {
68745
69174
  if (it2 === ObjectProto)
68746
- $defineProperty$3(OPSymbols, key2, D2);
69175
+ $defineProperty$4(OPSymbols, key2, D2);
68747
69176
  anObject(it2);
68748
69177
  key2 = toPrimitive(key2, true);
68749
69178
  anObject(D2);
@@ -68768,7 +69197,7 @@ var $defineProperties = function defineProperties2(it2, P2) {
68768
69197
  var l2 = keys4.length;
68769
69198
  var key2;
68770
69199
  while (l2 > i2)
68771
- $defineProperty$3(it2, key2 = keys4[i2++], P2[key2]);
69200
+ $defineProperty$4(it2, key2 = keys4[i2++], P2[key2]);
68772
69201
  return it2;
68773
69202
  };
68774
69203
  var $create = function create3(it2, P2) {
@@ -68833,7 +69262,7 @@ if (!USE_NATIVE) {
68833
69262
  return this._k;
68834
69263
  });
68835
69264
  $GOPD.f = $getOwnPropertyDescriptor;
68836
- $DP.f = $defineProperty$3;
69265
+ $DP.f = $defineProperty$4;
68837
69266
  _objectGopn.f = gOPNExt.f = $getOwnPropertyNames;
68838
69267
  require_objectPie().f = $propertyIsEnumerable;
68839
69268
  $GOPS.f = $getOwnPropertySymbols;
@@ -68876,7 +69305,7 @@ $export$2($export$2.S + $export$2.F * !USE_NATIVE, "Object", {
68876
69305
  // 19.1.2.2 Object.create(O [, Properties])
68877
69306
  create: $create,
68878
69307
  // 19.1.2.4 Object.defineProperty(O, P, Attributes)
68879
- defineProperty: $defineProperty$3,
69308
+ defineProperty: $defineProperty$4,
68880
69309
  // 19.1.2.3 Object.defineProperties(O, Properties)
68881
69310
  defineProperties: $defineProperties,
68882
69311
  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
@@ -151753,24 +152182,16 @@ var getIntrinsic = function GetIntrinsic(name2, allowMissing) {
151753
152182
  return value2;
151754
152183
  };
151755
152184
  var callBind$3 = { exports: {} };
151756
- var esDefineProperty;
151757
- var hasRequiredEsDefineProperty;
151758
- function requireEsDefineProperty() {
151759
- if (hasRequiredEsDefineProperty)
151760
- return esDefineProperty;
151761
- hasRequiredEsDefineProperty = 1;
151762
- var GetIntrinsic3 = getIntrinsic;
151763
- var $defineProperty2 = GetIntrinsic3("%Object.defineProperty%", true) || false;
151764
- if ($defineProperty2) {
151765
- try {
151766
- $defineProperty2({}, "a", { value: 1 });
151767
- } catch (e3) {
151768
- $defineProperty2 = false;
151769
- }
152185
+ var GetIntrinsic$4 = getIntrinsic;
152186
+ var $defineProperty$3 = GetIntrinsic$4("%Object.defineProperty%", true) || false;
152187
+ if ($defineProperty$3) {
152188
+ try {
152189
+ $defineProperty$3({}, "a", { value: 1 });
152190
+ } catch (e3) {
152191
+ $defineProperty$3 = false;
151770
152192
  }
151771
- esDefineProperty = $defineProperty2;
151772
- return esDefineProperty;
151773
152193
  }
152194
+ var esDefineProperty = $defineProperty$3;
151774
152195
  var GetIntrinsic$3 = getIntrinsic;
151775
152196
  var $gOPD$1 = GetIntrinsic$3("%Object.getOwnPropertyDescriptor%", true);
151776
152197
  if ($gOPD$1) {
@@ -151781,7 +152202,7 @@ if ($gOPD$1) {
151781
152202
  }
151782
152203
  }
151783
152204
  var gopd$1 = $gOPD$1;
151784
- var $defineProperty$2 = requireEsDefineProperty();
152205
+ var $defineProperty$2 = esDefineProperty;
151785
152206
  var $SyntaxError = syntax;
151786
152207
  var $TypeError$3 = type$1;
151787
152208
  var gopd = gopd$1;
@@ -151822,7 +152243,7 @@ var defineDataProperty$1 = function defineDataProperty(obj, property2, value2) {
151822
152243
  throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
151823
152244
  }
151824
152245
  };
151825
- var $defineProperty$1 = requireEsDefineProperty();
152246
+ var $defineProperty$1 = esDefineProperty;
151826
152247
  var hasPropertyDescriptors$1 = function hasPropertyDescriptors() {
151827
152248
  return !!$defineProperty$1;
151828
152249
  };
@@ -151891,7 +152312,7 @@ var setFunctionLength = function setFunctionLength2(fn2, length2) {
151891
152312
  var $apply = GetIntrinsic3("%Function.prototype.apply%");
151892
152313
  var $call = GetIntrinsic3("%Function.prototype.call%");
151893
152314
  var $reflectApply = GetIntrinsic3("%Reflect.apply%", true) || bind4.call($call, $apply);
151894
- var $defineProperty2 = requireEsDefineProperty();
152315
+ var $defineProperty2 = esDefineProperty;
151895
152316
  var $max = GetIntrinsic3("%Math.max%");
151896
152317
  module2.exports = function callBind2(originalFunction) {
151897
152318
  if (typeof originalFunction !== "function") {
@@ -186254,16 +186675,16 @@ async function getDecoder(fileDirectory) {
186254
186675
  const Decoder = await importFn();
186255
186676
  return new Decoder(fileDirectory);
186256
186677
  }
186257
- addDecoder([void 0, 1], () => import("./raw-96242ba0.js").then((m2) => m2.default));
186258
- addDecoder(5, () => import("./lzw-16c4832e.js").then((m2) => m2.default));
186678
+ addDecoder([void 0, 1], () => import("./raw-6916b128.js").then((m2) => m2.default));
186679
+ addDecoder(5, () => import("./lzw-93ca1380.js").then((m2) => m2.default));
186259
186680
  addDecoder(6, () => {
186260
186681
  throw new Error("old style JPEG compression is not supported.");
186261
186682
  });
186262
- addDecoder(7, () => import("./jpeg-73010abe.js").then((m2) => m2.default));
186263
- addDecoder([8, 32946], () => import("./deflate-1792f9ac.js").then((m2) => m2.default));
186264
- addDecoder(32773, () => import("./packbits-4a3e6a99.js").then((m2) => m2.default));
186265
- addDecoder(34887, () => import("./lerc-73b57874.js").then((m2) => m2.default));
186266
- addDecoder(50001, () => import("./webimage-a69885c6.js").then((m2) => m2.default));
186683
+ addDecoder(7, () => import("./jpeg-3edfc0bd.js").then((m2) => m2.default));
186684
+ addDecoder([8, 32946], () => import("./deflate-e42f8666.js").then((m2) => m2.default));
186685
+ addDecoder(32773, () => import("./packbits-6e34f5c8.js").then((m2) => m2.default));
186686
+ addDecoder(34887, () => import("./lerc-0d506426.js").then((m2) => m2.default));
186687
+ addDecoder(50001, () => import("./webimage-35ffb81e.js").then((m2) => m2.default));
186267
186688
  function copyNewSize(array2, width2, height2, samplesPerPixel = 1) {
186268
186689
  return new (Object.getPrototypeOf(array2)).constructor(width2 * height2 * samplesPerPixel);
186269
186690
  }
@@ -199668,10 +200089,10 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
199668
200089
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
199669
200090
  const colorTexHeight = Math.max(2, Math.ceil(totalColorsLength / texSize));
199670
200091
  if (valueTexHeight > texSize) {
199671
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
200092
+ log$f.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
199672
200093
  }
199673
200094
  if (colorTexHeight > texSize) {
199674
- console.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
200095
+ log$f.error("Error: length of concatenated quantitative feature values larger than maximum texture size");
199675
200096
  }
199676
200097
  const totalData = new Uint8Array(texSize * valueTexHeight);
199677
200098
  const totalColors = new Uint8Array(texSize * colorTexHeight);
@@ -202207,7 +202628,7 @@ function initInterpolator$1(domain2, interpolator) {
202207
202628
  }
202208
202629
  const implicit$1 = Symbol("implicit");
202209
202630
  function ordinal$1() {
202210
- var index2 = new InternMap(), domain2 = [], range2 = [], unknown = implicit$1;
202631
+ var index2 = new InternMap$1(), domain2 = [], range2 = [], unknown = implicit$1;
202211
202632
  function scale2(d) {
202212
202633
  let i2 = index2.get(d);
202213
202634
  if (i2 === void 0) {
@@ -202220,7 +202641,7 @@ function ordinal$1() {
202220
202641
  scale2.domain = function(_2) {
202221
202642
  if (!arguments.length)
202222
202643
  return domain2.slice();
202223
- domain2 = [], index2 = new InternMap();
202644
+ domain2 = [], index2 = new InternMap$1();
202224
202645
  for (const value2 of _2) {
202225
202646
  if (index2.has(value2))
202226
202647
  continue;
@@ -206364,11 +206785,11 @@ function EmbeddingScatterplotSubscriber(props) {
206364
206785
  })] });
206365
206786
  }
206366
206787
  function DualEmbeddingScatterplotSubscriber(props) {
206367
- const { coordinationScopes } = props;
206788
+ const { uuid, coordinationScopes } = props;
206368
206789
  const [{ sampleSetSelection }] = useCoordination(COMPONENT_COORDINATION_TYPES[ViewType$2.DUAL_SCATTERPLOT], coordinationScopes);
206369
206790
  const caseSampleSetSelection = useMemo(() => sampleSetSelection?.[0] ? [sampleSetSelection[0]] : null, [sampleSetSelection]);
206370
206791
  const ctrlSampleSetSelection = useMemo(() => sampleSetSelection?.[1] ? [sampleSetSelection[1]] : null, [sampleSetSelection]);
206371
- 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 }) })] });
206792
+ 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 }) })] });
206372
206793
  }
206373
206794
  function GatingScatterplotOptions(props) {
206374
206795
  const { featureType, gatingFeatureSelectionX, setGatingFeatureSelectionX, gatingFeatureSelectionY, setGatingFeatureSelectionY, gatingFeatureValueTransform, setGatingFeatureValueTransform, gatingFeatureValueTransformCoefficient, setGatingFeatureValueTransformCoefficient, geneSelectOptions, transformOptions } = props;
@@ -222048,7 +222469,7 @@ function normalizeCoordinateTransformations(coordinateTransformations, datasets)
222048
222469
  if (type3 === "sequence") {
222049
222470
  return normalizeCoordinateTransformations(transform4.transformations, datasets);
222050
222471
  }
222051
- console.warn(`Coordinate transformation type "${type3}" is not supported.`);
222472
+ log$f.warn(`Coordinate transformation type "${type3}" is not supported.`);
222052
222473
  }
222053
222474
  return transform4;
222054
222475
  });
@@ -225898,7 +226319,7 @@ function SpatialSubscriber$1(props) {
225898
226319
  ]);
225899
226320
  useEffect(() => {
225900
226321
  if (!hasSegmentationsData && cellsLayer && !obsSegmentations && !obsSegmentationsIndex && obsCentroids && obsCentroidsIndex) {
225901
- console.warn("Rendering cell segmentation diamonds for backwards compatibility.");
226322
+ log$f.warn("Rendering cell segmentation diamonds for backwards compatibility.");
225902
226323
  }
225903
226324
  }, [
225904
226325
  hasSegmentationsData,
@@ -227302,7 +227723,7 @@ class ErrorBoundary extends React__default.Component {
227302
227723
  }
227303
227724
  }
227304
227725
  const LazySpatialThree = React__default.lazy(async () => {
227305
- const { SpatialWrapper: SpatialWrapper2 } = await import("./index-b992752d.js");
227726
+ const { SpatialWrapper: SpatialWrapper2 } = await import("./index-632c59c9.js");
227306
227727
  return { default: SpatialWrapper2 };
227307
227728
  });
227308
227729
  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 }) }) }) }));
@@ -235034,7 +235455,7 @@ function LinkController(props) {
235034
235455
  };
235035
235456
  connection.current?.send(JSON.stringify(message));
235036
235457
  } catch (error2) {
235037
- console.error("Unable to send Configuration to Server", error2);
235458
+ log$f.error("Unable to send Configuration to Server", error2);
235038
235459
  }
235039
235460
  }
235040
235461
  }, [id2, socketOpen, sync]);
@@ -235051,7 +235472,7 @@ function LinkController(props) {
235051
235472
  }).then((response) => response.json()).then((response) => {
235052
235473
  setLinkID(response.link_id);
235053
235474
  }).catch((err2) => {
235054
- console.error("Fetch Error :-S", err2);
235475
+ log$f.error("Fetch Error :-S", err2);
235055
235476
  });
235056
235477
  }
235057
235478
  }, [linkID, linkEndpoint]);
@@ -235067,27 +235488,27 @@ function LinkController(props) {
235067
235488
  if (linkID !== null) {
235068
235489
  const ws2 = new WebSocket(websocketEndpoint, ["Authorization", authToken, linkID]);
235069
235490
  ws2.addEventListener("open", (event2) => {
235070
- console.log("Open", event2);
235491
+ log$f.log("Open", event2);
235071
235492
  setSocketOpen(true);
235072
235493
  });
235073
235494
  ws2.addEventListener("connecting", (event2) => {
235074
- console.log("Connecting", event2);
235495
+ log$f.log("Connecting", event2);
235075
235496
  setSocketOpen(false);
235076
235497
  });
235077
235498
  ws2.addEventListener("error", (event2) => {
235078
- console.log("Error", event2);
235499
+ log$f.log("Error", event2);
235079
235500
  });
235080
235501
  ws2.addEventListener("close", (event2) => {
235081
- console.log("Close", event2);
235502
+ log$f.log("Close", event2);
235082
235503
  });
235083
235504
  ws2.addEventListener("message", (event2) => {
235084
- console.log("Message", event2);
235505
+ log$f.log("Message", event2);
235085
235506
  const eventData = event2.data;
235086
235507
  if (eventData.includes(";")) {
235087
235508
  if (eventData.split(";")[0] === id2) {
235088
- console.log("Message from ourselves");
235509
+ log$f.log("Message from ourselves");
235089
235510
  } else {
235090
- console.log("Message from server ");
235511
+ log$f.log("Message from server ");
235091
235512
  if (sync) {
235092
235513
  setConfig({
235093
235514
  ...JSON.parse(decodeURI(atob(eventData.split(";")[1]))),
@@ -235806,7 +236227,7 @@ const useStyles$3 = makeStyles((theme) => ({
235806
236227
  }));
235807
236228
  register({ dataFetcher: ZarrMultivecDataFetcher_default, config: ZarrMultivecDataFetcher_default.config }, { pluginType: "dataFetcher" });
235808
236229
  const LazyHiGlassComponent = React__default.lazy(async () => {
235809
- const { HiGlassComponent } = await import("./higlass-9bad2d6d.js");
236230
+ const { HiGlassComponent } = await import("./higlass-16c69035.js");
235810
236231
  return { default: HiGlassComponent };
235811
236232
  });
235812
236233
  const HG_SIZE = 800;
@@ -241005,7 +241426,7 @@ function CellSetExpressionPlot(props) {
241005
241426
  stratificationSide = ordinal$1().domain(sampleSetNames).range(["left", "right"]);
241006
241427
  stratificationColor = ordinal$1().domain(sampleSetNames).range(
241007
241428
  // TODO: check for full path equality here.
241008
- sampleSetNames.map((name2) => sampleSetColor?.find((d) => d.path.at(-1) === name2).color).map(colorArrayToString)
241429
+ sampleSetNames.map((name2) => sampleSetColor?.find((d) => d.path.at(-1) === name2)?.color || [125, 125, 125]).map(colorArrayToString)
241009
241430
  );
241010
241431
  }
241011
241432
  const {
@@ -241136,11 +241557,11 @@ function summarize(iterable, keepZeros) {
241136
241557
  };
241137
241558
  }
241138
241559
  function dotStratifiedExpressionData(stratifiedResult, posThreshold) {
241139
- const result = new InternMap([], JSON.stringify);
241560
+ const result = new InternMap$1([], JSON.stringify);
241140
241561
  Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
241141
- result.set(cellSetKey, new InternMap([], JSON.stringify));
241562
+ result.set(cellSetKey, new InternMap$1([], JSON.stringify));
241142
241563
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
241143
- result.get(cellSetKey).set(sampleSetKey, new InternMap([], JSON.stringify));
241564
+ result.get(cellSetKey).set(sampleSetKey, new InternMap$1([], JSON.stringify));
241144
241565
  Array.from(secondLevelInternMap.entries()).forEach(([geneKey, values3]) => {
241145
241566
  if (values3) {
241146
241567
  const exprMean = mean$1(values3);
@@ -241158,9 +241579,9 @@ function dotStratifiedExpressionData(stratifiedResult, posThreshold) {
241158
241579
  return result;
241159
241580
  }
241160
241581
  function summarizeStratifiedExpressionData(stratifiedResult, keepZeros) {
241161
- const summarizedResult = new InternMap([], JSON.stringify);
241582
+ const summarizedResult = new InternMap$1([], JSON.stringify);
241162
241583
  Array.from(stratifiedResult.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
241163
- summarizedResult.set(cellSetKey, new InternMap([], JSON.stringify));
241584
+ summarizedResult.set(cellSetKey, new InternMap$1([], JSON.stringify));
241164
241585
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
241165
241586
  const values3 = secondLevelInternMap;
241166
241587
  const summary = summarize(values3, keepZeros);
@@ -260350,10 +260771,10 @@ const Tiles = {
260350
260771
  resquarify: treemapResquarify
260351
260772
  };
260352
260773
  const Output$4 = ["x0", "y0", "x1", "y1", "depth", "children"];
260353
- function Treemap(params2) {
260774
+ function Treemap$1(params2) {
260354
260775
  HierarchyLayout.call(this, params2);
260355
260776
  }
260356
- Treemap.Definition = {
260777
+ Treemap$1.Definition = {
260357
260778
  "type": "Treemap",
260358
260779
  "metadata": {
260359
260780
  "tree": true,
@@ -260419,7 +260840,7 @@ Treemap.Definition = {
260419
260840
  "default": Output$4
260420
260841
  }]
260421
260842
  };
260422
- inherits(Treemap, HierarchyLayout, {
260843
+ inherits(Treemap$1, HierarchyLayout, {
260423
260844
  /**
260424
260845
  * Treemap layout generator. Adds 'method' and 'ratio' parameters
260425
260846
  * to configure the underlying tile method.
@@ -260450,7 +260871,7 @@ const tree = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
260450
260871
  stratify: Stratify,
260451
260872
  tree: Tree,
260452
260873
  treelinks: TreeLinks,
260453
- treemap: Treemap
260874
+ treemap: Treemap$1
260454
260875
  }, Symbol.toStringTag, { value: "Module" }));
260455
260876
  const ALPHA_MASK = 4278190080;
260456
260877
  function baseBitmaps($2, data2) {
@@ -293068,8 +293489,8 @@ function useExpressionSummaries(sampleEdges, sampleSets, sampleSetSelection, exp
293068
293489
  if (stratifiedData) {
293069
293490
  const dotData = dotStratifiedExpressionData(stratifiedData, posThreshold);
293070
293491
  const geneToUuid = new Map(geneSelection?.map((gene) => [gene, v4$1()]));
293071
- const cellSetToUuid = new InternMap(cellSetSelection?.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
293072
- const sampleSetToUuid = new InternMap(sampleSetSelection?.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
293492
+ const cellSetToUuid = new InternMap$1(cellSetSelection?.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
293493
+ const sampleSetToUuid = new InternMap$1(sampleSetSelection?.map((sampleSet) => [sampleSet, v4$1()]), JSON.stringify);
293073
293494
  const result = [];
293074
293495
  Array.from(dotData.entries()).forEach(([cellSetKey, firstLevelInternMap]) => {
293075
293496
  Array.from(firstLevelInternMap.entries()).forEach(([sampleSetKey, secondLevelInternMap]) => {
@@ -293310,6 +293731,222 @@ function FeatureBarPlotSubscriber(props) {
293310
293731
  ]);
293311
293732
  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, "."] }) }) });
293312
293733
  }
293734
+ function uidGenerator(prefix2) {
293735
+ let i2 = 0;
293736
+ return () => {
293737
+ i2 += 1;
293738
+ return { id: `${prefix2}-${i2}`, href: `#${prefix2}-${i2}` };
293739
+ };
293740
+ }
293741
+ function getColorScale(setSelectionArr, setColorArr, theme) {
293742
+ return ordinal$1().domain(setSelectionArr || []).range(setSelectionArr?.map((setNamePath) => setColorArr?.find((d) => isEqual$5(d.path, setNamePath))?.color || getDefaultColor(theme))?.map(colorArrayToString) || []);
293743
+ }
293744
+ function Treemap(props) {
293745
+ const { obsCounts, obsColorEncoding, hierarchyLevels, theme, width: width2, height: height2, obsType, sampleType, obsSetColor, sampleSetColor, obsSetSelection, sampleSetSelection, marginTop = 5, marginRight = 5, marginLeft = 80, marginBottom } = props;
293746
+ const hierarchyData = useMemo(() => {
293747
+ if (!obsCounts) {
293748
+ return null;
293749
+ }
293750
+ let map2;
293751
+ if (isEqual$5(hierarchyLevels, ["sampleSet", "obsSet"])) {
293752
+ map2 = rollup(obsCounts, (D2) => D2[0].value, (d) => d.sampleSetPath, (d) => d.obsSetPath);
293753
+ } else if (isEqual$5(hierarchyLevels, ["obsSet", "sampleSet"])) {
293754
+ map2 = rollup(obsCounts, (D2) => D2[0].value, (d) => d.obsSetPath, (d) => d.sampleSetPath);
293755
+ } else {
293756
+ throw new Error("Unexpected levels value.");
293757
+ }
293758
+ return hierarchy(map2);
293759
+ }, [obsCounts, hierarchyLevels]);
293760
+ const [obsSetColorScale, sampleSetColorScale] = useMemo(() => [
293761
+ getColorScale(obsSetSelection, obsSetColor, theme),
293762
+ getColorScale(sampleSetSelection, sampleSetColor, theme)
293763
+ ], [obsSetSelection, sampleSetSelection, sampleSetColor, obsSetColor, theme]);
293764
+ const treemapLeaves = useMemo(() => {
293765
+ const treemapFunc = treemap().tile(treemapBinary).size([width2, height2]).padding(1).round(true);
293766
+ const treemapLayout = treemapFunc(hierarchyData.sum((d) => d[1]).sort((a2, b2) => b2[1] - a2[1]));
293767
+ return treemapLayout.leaves();
293768
+ }, [hierarchyData, width2, height2]);
293769
+ const svgRef = useRef();
293770
+ useEffect(() => {
293771
+ const domElement = svgRef.current;
293772
+ const svg2 = select$1(domElement);
293773
+ svg2.selectAll("g").remove();
293774
+ svg2.attr("width", width2).attr("height", height2).attr("viewBox", [0, 0, width2, height2]).attr("style", "font: 10px sans-serif");
293775
+ if (!treemapLeaves || !obsSetSelection || !sampleSetSelection) {
293776
+ return;
293777
+ }
293778
+ const leaf = svg2.selectAll("g").data(treemapLeaves).join("g").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
293779
+ leaf.append("title").text((d) => {
293780
+ const cellCount = d.data?.[1];
293781
+ const primaryPathString = JSON.stringify(d.data[0]);
293782
+ const secondaryPathString = JSON.stringify(d.parent.data[0]);
293783
+ return `${cellCount.toLocaleString()} ${pluralize(obsType, cellCount)} in ${primaryPathString} and ${secondaryPathString}`;
293784
+ });
293785
+ const getLeafUid = uidGenerator("leaf");
293786
+ const getClipUid = uidGenerator("clip");
293787
+ const colorScale2 = obsColorEncoding === "sampleSetSelection" ? sampleSetColorScale : obsSetColorScale;
293788
+ const getPathForColoring = (d) => (
293789
+ // eslint-disable-next-line no-nested-ternary
293790
+ obsColorEncoding === "sampleSetSelection" ? hierarchyLevels[0] === "obsSet" ? d.data?.[0] : d.parent?.data?.[0] : hierarchyLevels[0] === "sampleSet" ? d.data?.[0] : d.parent?.data?.[0]
293791
+ );
293792
+ leaf.append("rect").attr("id", (d) => {
293793
+ d.leafUid = getLeafUid();
293794
+ return d.leafUid.id;
293795
+ }).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);
293796
+ leaf.append("clipPath").attr("id", (d) => {
293797
+ d.clipUid = getClipUid();
293798
+ return d.clipUid.id;
293799
+ }).append("use").attr("xlink:href", (d) => d.leafUid.href);
293800
+ leaf.append("text").attr("clip-path", (d) => `url(${d.clipUid.href})`).selectAll("tspan").data((d) => [
293801
+ // Each element in this array corresponds to a line of text.
293802
+ d.data?.[0]?.at(-1),
293803
+ d.parent?.data?.[0]?.at(-1),
293804
+ `${d.data?.[1].toLocaleString()} ${pluralize(obsType, d.data?.[1])}`
293805
+ ]).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);
293806
+ }, [
293807
+ width2,
293808
+ height2,
293809
+ marginLeft,
293810
+ marginBottom,
293811
+ theme,
293812
+ marginTop,
293813
+ marginRight,
293814
+ obsType,
293815
+ sampleType,
293816
+ treemapLeaves,
293817
+ sampleSetColor,
293818
+ sampleSetSelection,
293819
+ obsSetSelection,
293820
+ obsSetColor,
293821
+ obsSetColorScale,
293822
+ sampleSetColorScale,
293823
+ obsColorEncoding,
293824
+ hierarchyLevels
293825
+ ]);
293826
+ return jsxRuntimeExports.jsx("svg", { ref: svgRef, style: {
293827
+ top: 0,
293828
+ left: 0,
293829
+ width: `${width2}px`,
293830
+ height: `${height2}px`,
293831
+ position: "relative"
293832
+ } });
293833
+ }
293834
+ function TreemapOptions(props) {
293835
+ const { children: children3, obsType, sampleType, hierarchyLevels, setHierarchyLevels, obsColorEncoding, setObsColorEncoding } = props;
293836
+ const treemapOptionsId = $bdb11010cef70236$export$f680877a34711e37();
293837
+ const classes = useStyles$r();
293838
+ function handleColorEncodingChange(event2) {
293839
+ setObsColorEncoding(event2.target.value);
293840
+ }
293841
+ function handleHierarchyLevelsOrderingChange(event2) {
293842
+ if (event2.target.value === "sampleSet") {
293843
+ setHierarchyLevels(["sampleSet", "obsSet"]);
293844
+ } else {
293845
+ setHierarchyLevels(["obsSet", "sampleSet"]);
293846
+ }
293847
+ }
293848
+ const primaryHierarchyLevel = isEqual$5(hierarchyLevels, ["sampleSet", "obsSet"]) ? "sampleSet" : "obsSet";
293849
+ return jsxRuntimeExports.jsxs(OptionsContainer, { children: [children3, 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: {
293850
+ id: `cell-color-encoding-select-${treemapOptionsId}`
293851
+ }, 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: {
293852
+ id: `hierarchy-level-select-${treemapOptionsId}`
293853
+ }, children: [jsxRuntimeExports.jsxs("option", { value: "obsSet", children: [capitalize$2(obsType), " Sets"] }), jsxRuntimeExports.jsxs("option", { value: "sampleSet", children: [capitalize$2(sampleType), " Sets"] })] }) })] })] });
293854
+ }
293855
+ const DEFAULT_HIERARCHY_LEVELS = ["obsSet", "sampleSet"];
293856
+ function TreemapSubscriber(props) {
293857
+ const { coordinationScopes, removeGridComponent, theme, helpText = ViewHelpMapping.TREEMAP } = props;
293858
+ const classes = useStyles$2();
293859
+ const loaders = useLoaders();
293860
+ 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$2.TREEMAP], coordinationScopes);
293861
+ const [width2, height2, containerRef] = useGridItemSize();
293862
+ const [{ obsIndex }, matrixIndicesStatus, matrixIndicesUrls] = useObsFeatureMatrixIndices(loaders, dataset, false, { obsType, featureType, featureValueType });
293863
+ const [{ obsSets }, obsSetsStatus, obsSetsUrls] = useObsSetsData(loaders, dataset, true, {}, {}, { obsType });
293864
+ const [{ sampleIndex, sampleSets }, sampleSetsStatus, sampleSetsUrls] = useSampleSetsData(
293865
+ loaders,
293866
+ dataset,
293867
+ // TODO: support `false`, i.e., configurations in which
293868
+ // there are no sampleSets
293869
+ true,
293870
+ { setSampleSetColor },
293871
+ { sampleSetColor },
293872
+ { sampleType }
293873
+ );
293874
+ const [{ sampleEdges }, sampleEdgesStatus, sampleEdgesUrls] = useSampleEdgesData(
293875
+ loaders,
293876
+ dataset,
293877
+ // TODO: support `false`, i.e., configurations in which
293878
+ // there are no sampleEdges
293879
+ true,
293880
+ {},
293881
+ {},
293882
+ { obsType, sampleType }
293883
+ );
293884
+ const isReady = useReady([
293885
+ matrixIndicesStatus,
293886
+ obsSetsStatus,
293887
+ sampleSetsStatus,
293888
+ sampleEdgesStatus
293889
+ ]);
293890
+ const urls2 = useUrls([
293891
+ matrixIndicesUrls,
293892
+ obsSetsUrls,
293893
+ sampleSetsUrls,
293894
+ sampleEdgesUrls
293895
+ ]);
293896
+ const mergedObsSets = useMemo(() => mergeObsSets(obsSets, additionalObsSets), [obsSets, additionalObsSets]);
293897
+ const mergedSampleSets = useMemo(() => mergeObsSets(sampleSets, null), [sampleSets]);
293898
+ const obsCount = obsIndex?.length || 0;
293899
+ const sampleCount = sampleIndex?.length || 0;
293900
+ const [obsCounts, sampleCounts] = useMemo(() => {
293901
+ const obsResult = new InternMap$1([], JSON.stringify);
293902
+ const sampleResult = new InternMap$1([], JSON.stringify);
293903
+ const hasSampleSetSelection = Array.isArray(sampleSetSelection) && sampleSetSelection.length > 0;
293904
+ const hasCellSetSelection = Array.isArray(obsSetSelection) && obsSetSelection.length > 0;
293905
+ const sampleSetKeys = hasSampleSetSelection ? sampleSetSelection : [null];
293906
+ const cellSetKeys = hasCellSetSelection ? obsSetSelection : [null];
293907
+ cellSetKeys.forEach((cellSetKey) => {
293908
+ obsResult.set(cellSetKey, new InternMap$1([], JSON.stringify));
293909
+ sampleSetKeys.forEach((sampleSetKey) => {
293910
+ obsResult.get(cellSetKey).set(sampleSetKey, 0);
293911
+ });
293912
+ });
293913
+ const sampleSetSizes = treeToSetSizesBySetNames(mergedSampleSets, sampleSetSelection, sampleSetSelection, sampleSetColor, theme);
293914
+ sampleSetKeys.forEach((sampleSetKey) => {
293915
+ const sampleSetSize = sampleSetSizes.find((d) => isEqual$5(d.setNamePath, sampleSetKey))?.size;
293916
+ sampleResult.set(sampleSetKey, sampleSetSize || 0);
293917
+ });
293918
+ if (mergedObsSets && obsSetSelection) {
293919
+ const sampleIdToSetMap = sampleSets && sampleSetSelection ? treeToSelectedSetMap(sampleSets, sampleSetSelection) : null;
293920
+ const cellIdToSetMap = treeToSelectedSetMap(mergedObsSets, obsSetSelection);
293921
+ for (let i2 = 0; i2 < obsIndex.length; i2 += 1) {
293922
+ const obsId = obsIndex[i2];
293923
+ const cellSet = cellIdToSetMap?.get(obsId);
293924
+ const sampleId = sampleEdges?.get(obsId);
293925
+ const sampleSet = sampleId ? sampleIdToSetMap?.get(sampleId) : null;
293926
+ if (hasSampleSetSelection && !sampleSet) {
293927
+ continue;
293928
+ }
293929
+ const prevObsCount = obsResult.get(cellSet)?.get(sampleSet);
293930
+ obsResult.get(cellSet)?.set(sampleSet, prevObsCount + 1);
293931
+ }
293932
+ }
293933
+ return [
293934
+ unnestMap(obsResult, ["obsSetPath", "sampleSetPath", "value"]),
293935
+ unnestMap(sampleResult, ["sampleSetPath", "value"])
293936
+ ];
293937
+ }, [
293938
+ obsIndex,
293939
+ sampleEdges,
293940
+ sampleSets,
293941
+ obsSetColor,
293942
+ sampleSetColor,
293943
+ mergedObsSets,
293944
+ obsSetSelection,
293945
+ mergedSampleSets
293946
+ // TODO: consider filtering-related coordination values
293947
+ ]);
293948
+ 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 }) }) });
293949
+ }
293313
293950
  class CsvSource {
293314
293951
  constructor({ url, requestInit: requestInit2 }) {
293315
293952
  this.url = url;
@@ -294098,7 +294735,7 @@ async function initLoader(imageData) {
294098
294735
  const { metadata: loaderMetadata } = loader2;
294099
294736
  const { omero, multiscales } = loaderMetadata;
294100
294737
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
294101
- console.error("Multiscales array must exist and have at least one element");
294738
+ log$f.error("Multiscales array must exist and have at least one element");
294102
294739
  }
294103
294740
  const { coordinateTransformations } = multiscales[0];
294104
294741
  const axes = getNgffAxes(multiscales[0].axes);
@@ -294174,7 +294811,7 @@ class RasterJsonAsImageLoader extends RasterLoader {
294174
294811
  }
294175
294812
  });
294176
294813
  if (!coordinationValues?.spatialImageLayer) {
294177
- console.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
294814
+ log$f.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
294178
294815
  }
294179
294816
  return new LoaderResult({
294180
294817
  image: loaders.length > 0 && meta2.length > 0 ? { loaders, meta: meta2 } : null
@@ -294204,7 +294841,7 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
294204
294841
  }
294205
294842
  });
294206
294843
  if (!coordinationValues?.spatialImageLayer) {
294207
- console.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
294844
+ log$f.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
294208
294845
  }
294209
294846
  return new LoaderResult(loaders.length > 0 && meta2.length > 0 ? {
294210
294847
  obsSegmentationsType: "bitmask",
@@ -294267,7 +294904,7 @@ function basename(path2) {
294267
294904
  const arr = path2.split("/");
294268
294905
  const result = arr.at(-1);
294269
294906
  if (!result) {
294270
- console.error("basename of path is empty", path2);
294907
+ log$f.error("basename of path is empty", path2);
294271
294908
  return "";
294272
294909
  }
294273
294910
  return result;
@@ -294437,6 +295074,16 @@ class AnnDataSource extends ZarrDataSource {
294437
295074
  this.obsIndex = this.getJson("obs/.zattrs").then(({ _index }) => this.getFlatArrDecompressed(`/obs/${_index}`));
294438
295075
  return this.obsIndex;
294439
295076
  }
295077
+ /**
295078
+ * Class method for loading the obs index.
295079
+ * @param {string|undefined} path Used by subclasses.
295080
+ * @returns {Promise<string[]>} An promise for a zarr array
295081
+ * containing the indices.
295082
+ */
295083
+ loadDataFrameIndex(path2 = void 0) {
295084
+ const dfPath = path2 ? dirname(path2) : "";
295085
+ return this.getJson(`${dfPath}/.zattrs`).then(({ _index }) => this.getFlatArrDecompressed(`${dfPath.length > 0 ? "/" : ""}${dfPath}/${_index}`));
295086
+ }
294440
295087
  /**
294441
295088
  * Class method for loading the var index.
294442
295089
  * @param {string|undefined} path Used by subclasses.
@@ -294548,7 +295195,7 @@ class AnnDataSource extends ZarrDataSource {
294548
295195
  try {
294549
295196
  val = await this._loadElement(`${path2}/${key2}`);
294550
295197
  } catch (e3) {
294551
- console.error(`Error in _loadDict: could not load ${key2}`);
295198
+ log$f.error(`Error in _loadDict: could not load ${key2}`);
294552
295199
  }
294553
295200
  result[key2] = val;
294554
295201
  }));
@@ -295428,6 +296075,65 @@ class SampleEdgesAnndataLoader extends AbstractTwoStepLoader {
295428
296075
  });
295429
296076
  }
295430
296077
  }
296078
+ class SampleSetsAnndataLoader extends AbstractTwoStepLoader {
296079
+ loadObsIndices() {
296080
+ const { options } = this;
296081
+ const obsIndexPromises = options.sampleSets?.map(({ path: path2 }) => path2).map((pathOrPaths) => {
296082
+ if (Array.isArray(pathOrPaths)) {
296083
+ if (pathOrPaths.length > 0) {
296084
+ return this.dataSource.loadDataFrameIndex(pathOrPaths[0]);
296085
+ }
296086
+ return this.dataSource.loadDataFrameIndex();
296087
+ }
296088
+ return this.dataSource.loadDataFrameIndex(pathOrPaths);
296089
+ });
296090
+ return Promise.all(obsIndexPromises);
296091
+ }
296092
+ loadCellSetIds() {
296093
+ const { options } = this;
296094
+ const cellSetZarrLocation = options.sampleSets?.map(({ path: path2 }) => path2);
296095
+ return this.dataSource.loadObsColumns(cellSetZarrLocation);
296096
+ }
296097
+ loadCellSetScores() {
296098
+ const { options } = this;
296099
+ const cellSetScoreZarrLocation = options.sampleSets?.map((option) => option.scorePath || void 0);
296100
+ return this.dataSource.loadObsColumns(cellSetScoreZarrLocation);
296101
+ }
296102
+ async load() {
296103
+ const superResult = await super.load().catch((reason) => Promise.resolve(reason));
296104
+ if (superResult instanceof AbstractLoaderError) {
296105
+ return Promise.reject(superResult);
296106
+ }
296107
+ if (!this.cachedResult) {
296108
+ const { options } = this;
296109
+ this.cachedResult = Promise.all([
296110
+ this.dataSource.loadDataFrameIndex(),
296111
+ this.loadObsIndices(),
296112
+ this.loadCellSetIds(),
296113
+ this.loadCellSetScores()
296114
+ ]).then((data2) => [
296115
+ data2[0],
296116
+ dataToCellSetsTree([data2[1], data2[2], data2[3]], options.sampleSets)
296117
+ ]);
296118
+ }
296119
+ const [obsIndex, obsSets] = await this.cachedResult;
296120
+ const obsSetsMembership = treeToMembershipMap(obsSets);
296121
+ const coordinationValues = {};
296122
+ const { tree: tree2 } = obsSets;
296123
+ const newAutoSetSelectionParentName = tree2[0].name;
296124
+ tree2[0].children.map((node2) => [
296125
+ newAutoSetSelectionParentName,
296126
+ node2.name
296127
+ ]);
296128
+ const newAutoSetColors = initializeCellSetColor(obsSets, []);
296129
+ coordinationValues.sampleSetColor = newAutoSetColors;
296130
+ return Promise.resolve(new LoaderResult({
296131
+ sampleIndex: obsIndex,
296132
+ sampleSets: obsSets,
296133
+ sampleSetsMembership: obsSetsMembership
296134
+ }, null, coordinationValues));
296135
+ }
296136
+ }
295431
296137
  class GenomicProfilesZarrLoader extends AbstractTwoStepLoader {
295432
296138
  loadAttrs() {
295433
296139
  if (this.attrs) {
@@ -295561,7 +296267,7 @@ class ImageWrapper {
295561
296267
  const channelNames = this.getChannelNames();
295562
296268
  const channelIndex = channelNames.indexOf(channelSpecifier);
295563
296269
  if (channelIndex === -1) {
295564
- console.error(`Channel ${channelSpecifier} not found in image.`);
296270
+ log$f.error(`Channel ${channelSpecifier} not found in image.`);
295565
296271
  }
295566
296272
  return channelIndex;
295567
296273
  }
@@ -295734,11 +296440,11 @@ class OmeZarrLoader extends AbstractTwoStepLoader {
295734
296440
  const isSpatialData = !!spatialDataChannels || !!imageLabel;
295735
296441
  const isLabels = !!imageLabel;
295736
296442
  if (!isSpatialData && !omero) {
295737
- console.error("image.ome-zarr must have omero metadata in attributes.");
296443
+ log$f.error("image.ome-zarr must have omero metadata in attributes.");
295738
296444
  return Promise.reject(payload);
295739
296445
  }
295740
296446
  if (!Array.isArray(multiscales) || multiscales.length === 0) {
295741
- console.error("Multiscales array must exist and have at least one element");
296447
+ log$f.error("Multiscales array must exist and have at least one element");
295742
296448
  }
295743
296449
  const { datasets, coordinateTransformations: coordinateTransformationsFromFile, name: imageName } = multiscales[0];
295744
296450
  const axes = getNgffAxes(multiscales[0].axes);
@@ -296046,7 +296752,7 @@ class SpatialDataObsSpotsLoader extends AbstractTwoStepLoader {
296046
296752
  const xScaleFactor = scaleFactors[0];
296047
296753
  const yScaleFactor = scaleFactors[1];
296048
296754
  if (xScaleFactor !== yScaleFactor) {
296049
- console.warn("Using x-axis scale factor for transformation of obsSpots, but x and y scale factors are not equal");
296755
+ log$f.warn("Using x-axis scale factor for transformation of obsSpots, but x and y scale factors are not equal");
296050
296756
  }
296051
296757
  for (let i2 = 0; i2 < this.radius.shape[0]; i2++) {
296052
296758
  this.radius.data[i2] *= xScaleFactor;
@@ -353833,7 +354539,8 @@ const baseViewTypes = [
353833
354539
  makeViewType(ViewType$2.GENOMIC_PROFILES, GenomicProfilesSubscriber),
353834
354540
  makeViewType(ViewType$2.DOT_PLOT, DotPlotSubscriber),
353835
354541
  makeViewType(ViewType$2.BIOMARKER_SELECT, BiomarkerSelectSubscriber),
353836
- makeViewType(ViewType$2.LINK_CONTROLLER, LinkControllerSubscriber)
354542
+ makeViewType(ViewType$2.LINK_CONTROLLER, LinkControllerSubscriber),
354543
+ makeViewType(ViewType$2.TREEMAP, TreemapSubscriber)
353837
354544
  ];
353838
354545
  const baseFileTypes = [
353839
354546
  // All CSV file types
@@ -353861,6 +354568,7 @@ const baseFileTypes = [
353861
354568
  ...makeZarrFileTypes(FileType$2.OBS_SEGMENTATIONS_ANNDATA_ZARR, DataType$4.OBS_SEGMENTATIONS, ObsSegmentationsAnndataLoader, AnnDataSource, obsSegmentationsAnndataSchema),
353862
354569
  ...makeZarrFileTypes(FileType$2.FEATURE_LABELS_ANNDATA_ZARR, DataType$4.FEATURE_LABELS, FeatureLabelsAnndataLoader, AnnDataSource, featureLabelsAnndataSchema),
353863
354570
  ...makeZarrFileTypes(FileType$2.SAMPLE_EDGES_ANNDATA_ZARR, DataType$4.SAMPLE_EDGES, SampleEdgesAnndataLoader, AnnDataSource, sampleEdgesAnndataSchema),
354571
+ ...makeZarrFileTypes(FileType$2.SAMPLE_SETS_ANNDATA_ZARR, DataType$4.SAMPLE_SETS, SampleSetsAnndataLoader, AnnDataSource, sampleSetsAnndataSchema),
353864
354572
  // All MuData file types
353865
354573
  makeFileType(FileType$2.OBS_SETS_MUDATA_ZARR, DataType$4.OBS_SETS, ObsSetsAnndataLoader, MuDataSource, obsSetsAnndataSchema),
353866
354574
  makeFileType(FileType$2.OBS_EMBEDDING_MUDATA_ZARR, DataType$4.OBS_EMBEDDING, ObsEmbeddingAnndataLoader, MuDataSource, obsEmbeddingAnndataSchema),
@@ -354053,12 +354761,14 @@ const baseCoordinationTypes = [
354053
354761
  path: obsSetPath,
354054
354762
  color: rgbArray
354055
354763
  })).nullable()),
354764
+ new PluginCoordinationType(CoordinationType$2.SAMPLE_HIGHLIGHT, null, z.string().nullable()),
354056
354765
  new PluginCoordinationType(CoordinationType$2.EMBEDDING_POINTS_VISIBLE, true, z.boolean()),
354057
354766
  new PluginCoordinationType(CoordinationType$2.EMBEDDING_CONTOURS_VISIBLE, false, z.boolean()),
354058
354767
  new PluginCoordinationType(CoordinationType$2.EMBEDDING_CONTOURS_FILLED, true, z.boolean()),
354059
354768
  new PluginCoordinationType(CoordinationType$2.EMBEDDING_CONTOUR_PERCENTILES, null, z.array(z.number()).nullable()),
354060
354769
  new PluginCoordinationType(CoordinationType$2.CONTOUR_COLOR_ENCODING, "cellSetSelection", z.enum(["cellSetSelection", "sampleSetSelection", "contourColor"])),
354061
- new PluginCoordinationType(CoordinationType$2.CONTOUR_COLOR, null, rgbArray.nullable())
354770
+ new PluginCoordinationType(CoordinationType$2.CONTOUR_COLOR, null, rgbArray.nullable()),
354771
+ new PluginCoordinationType(CoordinationType$2.HIERARCHY_LEVELS, null, z.array(z.enum(["sampleSet", "obsSet"])).nullable())
354062
354772
  ];
354063
354773
  const baseAsyncFunctions = [
354064
354774
  new PluginAsyncFunction(AsyncFunctionType.AUTOCOMPLETE_FEATURE, autocompleteFeature),
@@ -354076,7 +354786,7 @@ function Vitessce(props) {
354076
354786
  const validConfig = upgradeAndParse(config3, onConfigUpgrade);
354077
354787
  return [validConfig, true];
354078
354788
  } catch (e3) {
354079
- console.error(e3);
354789
+ log$f.error(e3);
354080
354790
  return [
354081
354791
  {
354082
354792
  title: "Config validation or upgrade failed.",
@@ -356539,7 +357249,7 @@ function encodeConfInUrl({ conf, onOverMaximumUrlLength = () => {
356539
357249
  if (newParams.length > maxLength) {
356540
357250
  const willWorkOn = Object.entries(MAX_BROWSER_URL_LENGTHS).filter((entry2) => entry2[1] > newParams.length).map((entry2) => entry2[0]);
356541
357251
  const message = `Configuration is ${compressedConf.length} characters; max URL for ${browser2} is ${maxLength}: it will work on ${willWorkOn.join(", ") || "no browser"}.`;
356542
- console.error(message);
357252
+ log$f.error(message);
356543
357253
  onOverMaximumUrlLength({ message, willWorkOn });
356544
357254
  }
356545
357255
  return newParams;