@vitessce/csv 3.5.5 → 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.
Files changed (2) hide show
  1. package/dist/index.js +319 -42
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -186,16 +186,302 @@ class AbstractLoaderError {
186
186
  throw new Error("The warnInConsole() method has not been implemented.");
187
187
  }
188
188
  }
189
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
190
+ function getDefaultExportFromCjs(x) {
191
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
192
+ }
193
+ function getAugmentedNamespace(n) {
194
+ if (n.__esModule)
195
+ return n;
196
+ var f = n.default;
197
+ if (typeof f == "function") {
198
+ var a = function a2() {
199
+ if (this instanceof a2) {
200
+ var args = [null];
201
+ args.push.apply(args, arguments);
202
+ var Ctor = Function.bind.apply(f, args);
203
+ return new Ctor();
204
+ }
205
+ return f.apply(this, arguments);
206
+ };
207
+ a.prototype = f.prototype;
208
+ } else
209
+ a = {};
210
+ Object.defineProperty(a, "__esModule", { value: true });
211
+ Object.keys(n).forEach(function(k) {
212
+ var d = Object.getOwnPropertyDescriptor(n, k);
213
+ Object.defineProperty(a, k, d.get ? d : {
214
+ enumerable: true,
215
+ get: function() {
216
+ return n[k];
217
+ }
218
+ });
219
+ });
220
+ return a;
221
+ }
222
+ var loglevel = { exports: {} };
223
+ (function(module2) {
224
+ (function(root2, definition) {
225
+ if (module2.exports) {
226
+ module2.exports = definition();
227
+ } else {
228
+ root2.log = definition();
229
+ }
230
+ })(commonjsGlobal, function() {
231
+ var noop = function() {
232
+ };
233
+ var undefinedType2 = "undefined";
234
+ var isIE = typeof window !== undefinedType2 && typeof window.navigator !== undefinedType2 && /Trident\/|MSIE /.test(window.navigator.userAgent);
235
+ var logMethods = [
236
+ "trace",
237
+ "debug",
238
+ "info",
239
+ "warn",
240
+ "error"
241
+ ];
242
+ var _loggersByName = {};
243
+ var defaultLogger = null;
244
+ function bindMethod(obj, methodName) {
245
+ var method = obj[methodName];
246
+ if (typeof method.bind === "function") {
247
+ return method.bind(obj);
248
+ } else {
249
+ try {
250
+ return Function.prototype.bind.call(method, obj);
251
+ } catch (e) {
252
+ return function() {
253
+ return Function.prototype.apply.apply(method, [obj, arguments]);
254
+ };
255
+ }
256
+ }
257
+ }
258
+ function traceForIE() {
259
+ if (console.log) {
260
+ if (console.log.apply) {
261
+ console.log.apply(console, arguments);
262
+ } else {
263
+ Function.prototype.apply.apply(console.log, [console, arguments]);
264
+ }
265
+ }
266
+ if (console.trace)
267
+ console.trace();
268
+ }
269
+ function realMethod(methodName) {
270
+ if (methodName === "debug") {
271
+ methodName = "log";
272
+ }
273
+ if (typeof console === undefinedType2) {
274
+ return false;
275
+ } else if (methodName === "trace" && isIE) {
276
+ return traceForIE;
277
+ } else if (console[methodName] !== void 0) {
278
+ return bindMethod(console, methodName);
279
+ } else if (console.log !== void 0) {
280
+ return bindMethod(console, "log");
281
+ } else {
282
+ return noop;
283
+ }
284
+ }
285
+ function replaceLoggingMethods() {
286
+ var level = this.getLevel();
287
+ for (var i = 0; i < logMethods.length; i++) {
288
+ var methodName = logMethods[i];
289
+ this[methodName] = i < level ? noop : this.methodFactory(methodName, level, this.name);
290
+ }
291
+ this.log = this.debug;
292
+ if (typeof console === undefinedType2 && level < this.levels.SILENT) {
293
+ return "No console available for logging";
294
+ }
295
+ }
296
+ function enableLoggingWhenConsoleArrives(methodName) {
297
+ return function() {
298
+ if (typeof console !== undefinedType2) {
299
+ replaceLoggingMethods.call(this);
300
+ this[methodName].apply(this, arguments);
301
+ }
302
+ };
303
+ }
304
+ function defaultMethodFactory(methodName, _level, _loggerName) {
305
+ return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
306
+ }
307
+ function Logger(name, factory) {
308
+ var self2 = this;
309
+ var inheritedLevel;
310
+ var defaultLevel;
311
+ var userLevel;
312
+ var storageKey = "loglevel";
313
+ if (typeof name === "string") {
314
+ storageKey += ":" + name;
315
+ } else if (typeof name === "symbol") {
316
+ storageKey = void 0;
317
+ }
318
+ function persistLevelIfPossible(levelNum) {
319
+ var levelName = (logMethods[levelNum] || "silent").toUpperCase();
320
+ if (typeof window === undefinedType2 || !storageKey)
321
+ return;
322
+ try {
323
+ window.localStorage[storageKey] = levelName;
324
+ return;
325
+ } catch (ignore) {
326
+ }
327
+ try {
328
+ window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
329
+ } catch (ignore) {
330
+ }
331
+ }
332
+ function getPersistedLevel() {
333
+ var storedLevel;
334
+ if (typeof window === undefinedType2 || !storageKey)
335
+ return;
336
+ try {
337
+ storedLevel = window.localStorage[storageKey];
338
+ } catch (ignore) {
339
+ }
340
+ if (typeof storedLevel === undefinedType2) {
341
+ try {
342
+ var cookie = window.document.cookie;
343
+ var cookieName = encodeURIComponent(storageKey);
344
+ var location = cookie.indexOf(cookieName + "=");
345
+ if (location !== -1) {
346
+ storedLevel = /^([^;]+)/.exec(
347
+ cookie.slice(location + cookieName.length + 1)
348
+ )[1];
349
+ }
350
+ } catch (ignore) {
351
+ }
352
+ }
353
+ if (self2.levels[storedLevel] === void 0) {
354
+ storedLevel = void 0;
355
+ }
356
+ return storedLevel;
357
+ }
358
+ function clearPersistedLevel() {
359
+ if (typeof window === undefinedType2 || !storageKey)
360
+ return;
361
+ try {
362
+ window.localStorage.removeItem(storageKey);
363
+ } catch (ignore) {
364
+ }
365
+ try {
366
+ window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
367
+ } catch (ignore) {
368
+ }
369
+ }
370
+ function normalizeLevel(input) {
371
+ var level = input;
372
+ if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
373
+ level = self2.levels[level.toUpperCase()];
374
+ }
375
+ if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
376
+ return level;
377
+ } else {
378
+ throw new TypeError("log.setLevel() called with invalid level: " + input);
379
+ }
380
+ }
381
+ self2.name = name;
382
+ self2.levels = {
383
+ "TRACE": 0,
384
+ "DEBUG": 1,
385
+ "INFO": 2,
386
+ "WARN": 3,
387
+ "ERROR": 4,
388
+ "SILENT": 5
389
+ };
390
+ self2.methodFactory = factory || defaultMethodFactory;
391
+ self2.getLevel = function() {
392
+ if (userLevel != null) {
393
+ return userLevel;
394
+ } else if (defaultLevel != null) {
395
+ return defaultLevel;
396
+ } else {
397
+ return inheritedLevel;
398
+ }
399
+ };
400
+ self2.setLevel = function(level, persist) {
401
+ userLevel = normalizeLevel(level);
402
+ if (persist !== false) {
403
+ persistLevelIfPossible(userLevel);
404
+ }
405
+ return replaceLoggingMethods.call(self2);
406
+ };
407
+ self2.setDefaultLevel = function(level) {
408
+ defaultLevel = normalizeLevel(level);
409
+ if (!getPersistedLevel()) {
410
+ self2.setLevel(level, false);
411
+ }
412
+ };
413
+ self2.resetLevel = function() {
414
+ userLevel = null;
415
+ clearPersistedLevel();
416
+ replaceLoggingMethods.call(self2);
417
+ };
418
+ self2.enableAll = function(persist) {
419
+ self2.setLevel(self2.levels.TRACE, persist);
420
+ };
421
+ self2.disableAll = function(persist) {
422
+ self2.setLevel(self2.levels.SILENT, persist);
423
+ };
424
+ self2.rebuild = function() {
425
+ if (defaultLogger !== self2) {
426
+ inheritedLevel = normalizeLevel(defaultLogger.getLevel());
427
+ }
428
+ replaceLoggingMethods.call(self2);
429
+ if (defaultLogger === self2) {
430
+ for (var childName in _loggersByName) {
431
+ _loggersByName[childName].rebuild();
432
+ }
433
+ }
434
+ };
435
+ inheritedLevel = normalizeLevel(
436
+ defaultLogger ? defaultLogger.getLevel() : "WARN"
437
+ );
438
+ var initialLevel = getPersistedLevel();
439
+ if (initialLevel != null) {
440
+ userLevel = normalizeLevel(initialLevel);
441
+ }
442
+ replaceLoggingMethods.call(self2);
443
+ }
444
+ defaultLogger = new Logger();
445
+ defaultLogger.getLogger = function getLogger(name) {
446
+ if (typeof name !== "symbol" && typeof name !== "string" || name === "") {
447
+ throw new TypeError("You must supply a name when creating a logger.");
448
+ }
449
+ var logger = _loggersByName[name];
450
+ if (!logger) {
451
+ logger = _loggersByName[name] = new Logger(
452
+ name,
453
+ defaultLogger.methodFactory
454
+ );
455
+ }
456
+ return logger;
457
+ };
458
+ var _log = typeof window !== undefinedType2 ? window.log : void 0;
459
+ defaultLogger.noConflict = function() {
460
+ if (typeof window !== undefinedType2 && window.log === defaultLogger) {
461
+ window.log = _log;
462
+ }
463
+ return defaultLogger;
464
+ };
465
+ defaultLogger.getLoggers = function getLoggers() {
466
+ return _loggersByName;
467
+ };
468
+ defaultLogger["default"] = defaultLogger;
469
+ return defaultLogger;
470
+ });
471
+ })(loglevel);
472
+ var loglevelExports = loglevel.exports;
473
+ const log = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
189
474
  class DataSourceFetchError extends AbstractLoaderError {
190
475
  constructor(source, url, headers) {
191
476
  super(`${source} Error HTTP Status fetching from ${url}`);
192
477
  this.source = source;
193
478
  this.url = url;
194
479
  this.headers = headers;
480
+ this.message = `${source} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`;
195
481
  }
196
482
  warnInConsole() {
197
- const { source, url, headers } = this;
198
- console.warn(`${source} failed to fetch from ${url} with headers ${JSON.stringify(headers)}`);
483
+ const { message } = this;
484
+ log.warn(message);
199
485
  }
200
486
  }
201
487
  class CsvSource {
@@ -333,7 +619,9 @@ const ViewType$1 = {
333
619
  DOT_PLOT: "dotPlot",
334
620
  FEATURE_BAR_PLOT: "featureBarPlot",
335
621
  BIOMARKER_SELECT: "biomarkerSelect",
336
- LINK_CONTROLLER: "linkController"
622
+ LINK_CONTROLLER: "linkController",
623
+ DUAL_SCATTERPLOT: "dualScatterplot",
624
+ TREEMAP: "treemap"
337
625
  };
338
626
  const DataType$1 = {
339
627
  OBS_LABELS: "obsLabels",
@@ -387,6 +675,7 @@ const FileType$1 = {
387
675
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
388
676
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
389
677
  SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
678
+ SAMPLE_SETS_ANNDATA_ZARR: "sampleSets.anndata.zarr",
390
679
  // AnnData - zipped
391
680
  OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
392
681
  OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
@@ -399,6 +688,7 @@ const FileType$1 = {
399
688
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
400
689
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
401
690
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
691
+ SAMPLE_SETS_ANNDATA_ZARR_ZIP: "sampleSets.anndata.zarr.zip",
402
692
  // AnnData - h5ad via reference spec
403
693
  OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
404
694
  OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
@@ -411,6 +701,7 @@ const FileType$1 = {
411
701
  OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
412
702
  FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
413
703
  SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
704
+ SAMPLE_SETS_ANNDATA_H5AD: "sampleSets.anndata.h5ad",
414
705
  // SpatialData
415
706
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
416
707
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -512,15 +803,23 @@ const CoordinationType$1 = {
512
803
  HEATMAP_ZOOM_Y: "heatmapZoomY",
513
804
  HEATMAP_TARGET_X: "heatmapTargetX",
514
805
  HEATMAP_TARGET_Y: "heatmapTargetY",
515
- OBS_FILTER: "obsFilter",
516
806
  OBS_HIGHLIGHT: "obsHighlight",
807
+ OBS_SELECTION: "obsSelection",
517
808
  OBS_SET_SELECTION: "obsSetSelection",
809
+ OBS_SELECTION_MODE: "obsSelectionMode",
810
+ OBS_FILTER: "obsFilter",
811
+ OBS_SET_FILTER: "obsSetFilter",
812
+ OBS_FILTER_MODE: "obsFilterMode",
518
813
  OBS_SET_HIGHLIGHT: "obsSetHighlight",
519
814
  OBS_SET_EXPANSION: "obsSetExpansion",
520
815
  OBS_SET_COLOR: "obsSetColor",
521
- FEATURE_FILTER: "featureFilter",
522
816
  FEATURE_HIGHLIGHT: "featureHighlight",
523
817
  FEATURE_SELECTION: "featureSelection",
818
+ FEATURE_SET_SELECTION: "featureSetSelection",
819
+ FEATURE_SELECTION_MODE: "featureSelectionMode",
820
+ FEATURE_FILTER: "featureFilter",
821
+ FEATURE_SET_FILTER: "featureSetFilter",
822
+ FEATURE_FILTER_MODE: "featureFilterMode",
524
823
  FEATURE_VALUE_COLORMAP: "featureValueColormap",
525
824
  FEATURE_VALUE_TRANSFORM: "featureValueTransform",
526
825
  FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
@@ -587,48 +886,23 @@ const CoordinationType$1 = {
587
886
  SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
588
887
  // Multi-sample / comparative
589
888
  SAMPLE_TYPE: "sampleType",
889
+ SAMPLE_SELECTION: "sampleSelection",
590
890
  SAMPLE_SET_SELECTION: "sampleSetSelection",
891
+ SAMPLE_SELECTION_MODE: "sampleSelectionMode",
892
+ SAMPLE_FILTER: "sampleFilter",
893
+ SAMPLE_SET_FILTER: "sampleSetFilter",
894
+ SAMPLE_FILTER_MODE: "sampleFilterMode",
591
895
  SAMPLE_SET_COLOR: "sampleSetColor",
896
+ SAMPLE_HIGHLIGHT: "sampleHighlight",
592
897
  EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
593
898
  EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
594
899
  EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
595
900
  EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
596
901
  CONTOUR_COLOR_ENCODING: "contourColorEncoding",
597
- CONTOUR_COLOR: "contourColor"
902
+ CONTOUR_COLOR: "contourColor",
903
+ // Treemap
904
+ HIERARCHY_LEVELS: "hierarchyLevels"
598
905
  };
599
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
600
- function getDefaultExportFromCjs(x) {
601
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
602
- }
603
- function getAugmentedNamespace(n) {
604
- if (n.__esModule)
605
- return n;
606
- var f = n.default;
607
- if (typeof f == "function") {
608
- var a = function a2() {
609
- if (this instanceof a2) {
610
- var args = [null];
611
- args.push.apply(args, arguments);
612
- var Ctor = Function.bind.apply(f, args);
613
- return new Ctor();
614
- }
615
- return f.apply(this, arguments);
616
- };
617
- a.prototype = f.prototype;
618
- } else
619
- a = {};
620
- Object.defineProperty(a, "__esModule", { value: true });
621
- Object.keys(n).forEach(function(k) {
622
- var d = Object.getOwnPropertyDescriptor(n, k);
623
- Object.defineProperty(a, k, d.get ? d : {
624
- enumerable: true,
625
- get: function() {
626
- return n[k];
627
- }
628
- });
629
- });
630
- return a;
631
- }
632
906
  function commonjsRequire(path) {
633
907
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
634
908
  }
@@ -7416,7 +7690,7 @@ function upgradeFrom1_0_14(config) {
7416
7690
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
7417
7691
  var _a;
7418
7692
  if ((_a = viewDef.props) == null ? void 0 : _a[oldProp]) {
7419
- console.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
7693
+ log.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
7420
7694
  }
7421
7695
  });
7422
7696
  });
@@ -7439,7 +7713,7 @@ function upgradeFrom1_0_15(config) {
7439
7713
  Object.entries(coordinationScopes).forEach(([coordinationType, coordinationScope]) => {
7440
7714
  if (!Array.isArray(coordinationScope) && typeof coordinationScope === "object") {
7441
7715
  if (coordinationType === "dataset") {
7442
- console.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
7716
+ log.error("Expected coordinationScopes.dataset value to be either string or string[], but got object.");
7443
7717
  }
7444
7718
  coordinationScopesBy.dataset[coordinationType] = coordinationScope;
7445
7719
  } else if (Array.isArray(coordinationScope) || typeof coordinationScope === "string") {
@@ -9798,7 +10072,7 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
9798
10072
  const oldKeys = Object.keys(oldObj);
9799
10073
  const propKey = String(prop);
9800
10074
  if (oldKeys.includes(propKey)) {
9801
- console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
10075
+ log.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
9802
10076
  ${oldObj[propKey][1]}`);
9803
10077
  return oldObj[propKey];
9804
10078
  }
@@ -9896,6 +10170,9 @@ const annDataObsSetsArr = z.array(z.object({
9896
10170
  z.object({
9897
10171
  obsSets: annDataObsSetsArr
9898
10172
  });
10173
+ z.object({
10174
+ sampleSets: annDataObsSetsArr
10175
+ });
9899
10176
  const annDataObsFeatureColumnsArr = z.array(z.object({
9900
10177
  path: z.string()
9901
10178
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/csv",
3
- "version": "3.5.5",
3
+ "version": "3.5.7",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -18,10 +18,10 @@
18
18
  "dependencies": {
19
19
  "d3-array": "^2.4.0",
20
20
  "d3-dsv": "^1.1.1",
21
- "@vitessce/constants-internal": "3.5.5",
22
- "@vitessce/sets-utils": "3.5.5",
23
- "@vitessce/abstract": "3.5.5",
24
- "@vitessce/config": "3.5.5"
21
+ "@vitessce/constants-internal": "3.5.7",
22
+ "@vitessce/sets-utils": "3.5.7",
23
+ "@vitessce/abstract": "3.5.7",
24
+ "@vitessce/config": "3.5.7"
25
25
  },
26
26
  "scripts": {
27
27
  "bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",