@vitessce/csv 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.
Files changed (2) hide show
  1. package/dist/index.js +303 -40
  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 {
@@ -334,7 +620,8 @@ const ViewType$1 = {
334
620
  FEATURE_BAR_PLOT: "featureBarPlot",
335
621
  BIOMARKER_SELECT: "biomarkerSelect",
336
622
  LINK_CONTROLLER: "linkController",
337
- DUAL_SCATTERPLOT: "dualScatterplot"
623
+ DUAL_SCATTERPLOT: "dualScatterplot",
624
+ TREEMAP: "treemap"
338
625
  };
339
626
  const DataType$1 = {
340
627
  OBS_LABELS: "obsLabels",
@@ -388,6 +675,7 @@ const FileType$1 = {
388
675
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
389
676
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
390
677
  SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
678
+ SAMPLE_SETS_ANNDATA_ZARR: "sampleSets.anndata.zarr",
391
679
  // AnnData - zipped
392
680
  OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
393
681
  OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
@@ -400,6 +688,7 @@ const FileType$1 = {
400
688
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
401
689
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
402
690
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
691
+ SAMPLE_SETS_ANNDATA_ZARR_ZIP: "sampleSets.anndata.zarr.zip",
403
692
  // AnnData - h5ad via reference spec
404
693
  OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
405
694
  OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
@@ -412,6 +701,7 @@ const FileType$1 = {
412
701
  OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
413
702
  FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
414
703
  SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
704
+ SAMPLE_SETS_ANNDATA_H5AD: "sampleSets.anndata.h5ad",
415
705
  // SpatialData
416
706
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
417
707
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -603,46 +893,16 @@ const CoordinationType$1 = {
603
893
  SAMPLE_SET_FILTER: "sampleSetFilter",
604
894
  SAMPLE_FILTER_MODE: "sampleFilterMode",
605
895
  SAMPLE_SET_COLOR: "sampleSetColor",
896
+ SAMPLE_HIGHLIGHT: "sampleHighlight",
606
897
  EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
607
898
  EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
608
899
  EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
609
900
  EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
610
901
  CONTOUR_COLOR_ENCODING: "contourColorEncoding",
611
- CONTOUR_COLOR: "contourColor"
902
+ CONTOUR_COLOR: "contourColor",
903
+ // Treemap
904
+ HIERARCHY_LEVELS: "hierarchyLevels"
612
905
  };
613
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
614
- function getDefaultExportFromCjs(x) {
615
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
616
- }
617
- function getAugmentedNamespace(n) {
618
- if (n.__esModule)
619
- return n;
620
- var f = n.default;
621
- if (typeof f == "function") {
622
- var a = function a2() {
623
- if (this instanceof a2) {
624
- var args = [null];
625
- args.push.apply(args, arguments);
626
- var Ctor = Function.bind.apply(f, args);
627
- return new Ctor();
628
- }
629
- return f.apply(this, arguments);
630
- };
631
- a.prototype = f.prototype;
632
- } else
633
- a = {};
634
- Object.defineProperty(a, "__esModule", { value: true });
635
- Object.keys(n).forEach(function(k) {
636
- var d = Object.getOwnPropertyDescriptor(n, k);
637
- Object.defineProperty(a, k, d.get ? d : {
638
- enumerable: true,
639
- get: function() {
640
- return n[k];
641
- }
642
- });
643
- });
644
- return a;
645
- }
646
906
  function commonjsRequire(path) {
647
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.');
648
908
  }
@@ -7430,7 +7690,7 @@ function upgradeFrom1_0_14(config) {
7430
7690
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
7431
7691
  var _a;
7432
7692
  if ((_a = viewDef.props) == null ? void 0 : _a[oldProp]) {
7433
- 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.`);
7434
7694
  }
7435
7695
  });
7436
7696
  });
@@ -7453,7 +7713,7 @@ function upgradeFrom1_0_15(config) {
7453
7713
  Object.entries(coordinationScopes).forEach(([coordinationType, coordinationScope]) => {
7454
7714
  if (!Array.isArray(coordinationScope) && typeof coordinationScope === "object") {
7455
7715
  if (coordinationType === "dataset") {
7456
- 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.");
7457
7717
  }
7458
7718
  coordinationScopesBy.dataset[coordinationType] = coordinationScope;
7459
7719
  } else if (Array.isArray(coordinationScope) || typeof coordinationScope === "string") {
@@ -9812,7 +10072,7 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
9812
10072
  const oldKeys = Object.keys(oldObj);
9813
10073
  const propKey = String(prop);
9814
10074
  if (oldKeys.includes(propKey)) {
9815
- console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
10075
+ log.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
9816
10076
  ${oldObj[propKey][1]}`);
9817
10077
  return oldObj[propKey];
9818
10078
  }
@@ -9910,6 +10170,9 @@ const annDataObsSetsArr = z.array(z.object({
9910
10170
  z.object({
9911
10171
  obsSets: annDataObsSetsArr
9912
10172
  });
10173
+ z.object({
10174
+ sampleSets: annDataObsSetsArr
10175
+ });
9913
10176
  const annDataObsFeatureColumnsArr = z.array(z.object({
9914
10177
  path: z.string()
9915
10178
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/csv",
3
- "version": "3.5.6",
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.6",
22
- "@vitessce/sets-utils": "3.5.6",
23
- "@vitessce/abstract": "3.5.6",
24
- "@vitessce/config": "3.5.6"
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",