@vitessce/config 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.
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ const FileType = {
34
34
  OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
35
35
  FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
36
36
  SAMPLE_EDGES_ANNDATA_ZARR: "sampleEdges.anndata.zarr",
37
+ SAMPLE_SETS_ANNDATA_ZARR: "sampleSets.anndata.zarr",
37
38
  // AnnData - zipped
38
39
  OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: "obsFeatureMatrix.anndata.zarr.zip",
39
40
  OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: "obsFeatureColumns.anndata.zarr.zip",
@@ -46,6 +47,7 @@ const FileType = {
46
47
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
47
48
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
48
49
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
50
+ SAMPLE_SETS_ANNDATA_ZARR_ZIP: "sampleSets.anndata.zarr.zip",
49
51
  // AnnData - h5ad via reference spec
50
52
  OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
51
53
  OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
@@ -58,6 +60,7 @@ const FileType = {
58
60
  OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
59
61
  FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
60
62
  SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
63
+ SAMPLE_SETS_ANNDATA_H5AD: "sampleSets.anndata.h5ad",
61
64
  // SpatialData
62
65
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
63
66
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -159,15 +162,23 @@ const CoordinationType = {
159
162
  HEATMAP_ZOOM_Y: "heatmapZoomY",
160
163
  HEATMAP_TARGET_X: "heatmapTargetX",
161
164
  HEATMAP_TARGET_Y: "heatmapTargetY",
162
- OBS_FILTER: "obsFilter",
163
165
  OBS_HIGHLIGHT: "obsHighlight",
166
+ OBS_SELECTION: "obsSelection",
164
167
  OBS_SET_SELECTION: "obsSetSelection",
168
+ OBS_SELECTION_MODE: "obsSelectionMode",
169
+ OBS_FILTER: "obsFilter",
170
+ OBS_SET_FILTER: "obsSetFilter",
171
+ OBS_FILTER_MODE: "obsFilterMode",
165
172
  OBS_SET_HIGHLIGHT: "obsSetHighlight",
166
173
  OBS_SET_EXPANSION: "obsSetExpansion",
167
174
  OBS_SET_COLOR: "obsSetColor",
168
- FEATURE_FILTER: "featureFilter",
169
175
  FEATURE_HIGHLIGHT: "featureHighlight",
170
176
  FEATURE_SELECTION: "featureSelection",
177
+ FEATURE_SET_SELECTION: "featureSetSelection",
178
+ FEATURE_SELECTION_MODE: "featureSelectionMode",
179
+ FEATURE_FILTER: "featureFilter",
180
+ FEATURE_SET_FILTER: "featureSetFilter",
181
+ FEATURE_FILTER_MODE: "featureFilterMode",
171
182
  FEATURE_VALUE_COLORMAP: "featureValueColormap",
172
183
  FEATURE_VALUE_TRANSFORM: "featureValueTransform",
173
184
  FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
@@ -234,14 +245,22 @@ const CoordinationType = {
234
245
  SPATIAL_CHANNEL_LABEL_SIZE: "spatialChannelLabelSize",
235
246
  // Multi-sample / comparative
236
247
  SAMPLE_TYPE: "sampleType",
248
+ SAMPLE_SELECTION: "sampleSelection",
237
249
  SAMPLE_SET_SELECTION: "sampleSetSelection",
250
+ SAMPLE_SELECTION_MODE: "sampleSelectionMode",
251
+ SAMPLE_FILTER: "sampleFilter",
252
+ SAMPLE_SET_FILTER: "sampleSetFilter",
253
+ SAMPLE_FILTER_MODE: "sampleFilterMode",
238
254
  SAMPLE_SET_COLOR: "sampleSetColor",
255
+ SAMPLE_HIGHLIGHT: "sampleHighlight",
239
256
  EMBEDDING_POINTS_VISIBLE: "embeddingPointsVisible",
240
257
  EMBEDDING_CONTOURS_VISIBLE: "embeddingContoursVisible",
241
258
  EMBEDDING_CONTOURS_FILLED: "embeddingContoursFilled",
242
259
  EMBEDDING_CONTOUR_PERCENTILES: "embeddingContourPercentiles",
243
260
  CONTOUR_COLOR_ENCODING: "contourColorEncoding",
244
- CONTOUR_COLOR: "contourColor"
261
+ CONTOUR_COLOR: "contourColor",
262
+ // Treemap
263
+ HIERARCHY_LEVELS: "hierarchyLevels"
245
264
  };
246
265
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
247
266
  function getDefaultExportFromCjs(x) {
@@ -651,6 +670,258 @@ function getInitialCoordinationScopeName(datasetUid, dataType, i = null) {
651
670
  const prefix = getInitialCoordinationScopePrefix(datasetUid, dataType);
652
671
  return `${prefix}${i === null ? 0 : i}`;
653
672
  }
673
+ var loglevel = { exports: {} };
674
+ (function(module) {
675
+ (function(root, definition) {
676
+ if (module.exports) {
677
+ module.exports = definition();
678
+ } else {
679
+ root.log = definition();
680
+ }
681
+ })(commonjsGlobal, function() {
682
+ var noop = function() {
683
+ };
684
+ var undefinedType = "undefined";
685
+ var isIE = typeof window !== undefinedType && typeof window.navigator !== undefinedType && /Trident\/|MSIE /.test(window.navigator.userAgent);
686
+ var logMethods = [
687
+ "trace",
688
+ "debug",
689
+ "info",
690
+ "warn",
691
+ "error"
692
+ ];
693
+ var _loggersByName = {};
694
+ var defaultLogger = null;
695
+ function bindMethod(obj, methodName) {
696
+ var method = obj[methodName];
697
+ if (typeof method.bind === "function") {
698
+ return method.bind(obj);
699
+ } else {
700
+ try {
701
+ return Function.prototype.bind.call(method, obj);
702
+ } catch (e) {
703
+ return function() {
704
+ return Function.prototype.apply.apply(method, [obj, arguments]);
705
+ };
706
+ }
707
+ }
708
+ }
709
+ function traceForIE() {
710
+ if (console.log) {
711
+ if (console.log.apply) {
712
+ console.log.apply(console, arguments);
713
+ } else {
714
+ Function.prototype.apply.apply(console.log, [console, arguments]);
715
+ }
716
+ }
717
+ if (console.trace)
718
+ console.trace();
719
+ }
720
+ function realMethod(methodName) {
721
+ if (methodName === "debug") {
722
+ methodName = "log";
723
+ }
724
+ if (typeof console === undefinedType) {
725
+ return false;
726
+ } else if (methodName === "trace" && isIE) {
727
+ return traceForIE;
728
+ } else if (console[methodName] !== void 0) {
729
+ return bindMethod(console, methodName);
730
+ } else if (console.log !== void 0) {
731
+ return bindMethod(console, "log");
732
+ } else {
733
+ return noop;
734
+ }
735
+ }
736
+ function replaceLoggingMethods() {
737
+ var level = this.getLevel();
738
+ for (var i = 0; i < logMethods.length; i++) {
739
+ var methodName = logMethods[i];
740
+ this[methodName] = i < level ? noop : this.methodFactory(methodName, level, this.name);
741
+ }
742
+ this.log = this.debug;
743
+ if (typeof console === undefinedType && level < this.levels.SILENT) {
744
+ return "No console available for logging";
745
+ }
746
+ }
747
+ function enableLoggingWhenConsoleArrives(methodName) {
748
+ return function() {
749
+ if (typeof console !== undefinedType) {
750
+ replaceLoggingMethods.call(this);
751
+ this[methodName].apply(this, arguments);
752
+ }
753
+ };
754
+ }
755
+ function defaultMethodFactory(methodName, _level, _loggerName) {
756
+ return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
757
+ }
758
+ function Logger(name, factory) {
759
+ var self2 = this;
760
+ var inheritedLevel;
761
+ var defaultLevel;
762
+ var userLevel;
763
+ var storageKey = "loglevel";
764
+ if (typeof name === "string") {
765
+ storageKey += ":" + name;
766
+ } else if (typeof name === "symbol") {
767
+ storageKey = void 0;
768
+ }
769
+ function persistLevelIfPossible(levelNum) {
770
+ var levelName = (logMethods[levelNum] || "silent").toUpperCase();
771
+ if (typeof window === undefinedType || !storageKey)
772
+ return;
773
+ try {
774
+ window.localStorage[storageKey] = levelName;
775
+ return;
776
+ } catch (ignore) {
777
+ }
778
+ try {
779
+ window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
780
+ } catch (ignore) {
781
+ }
782
+ }
783
+ function getPersistedLevel() {
784
+ var storedLevel;
785
+ if (typeof window === undefinedType || !storageKey)
786
+ return;
787
+ try {
788
+ storedLevel = window.localStorage[storageKey];
789
+ } catch (ignore) {
790
+ }
791
+ if (typeof storedLevel === undefinedType) {
792
+ try {
793
+ var cookie = window.document.cookie;
794
+ var cookieName = encodeURIComponent(storageKey);
795
+ var location = cookie.indexOf(cookieName + "=");
796
+ if (location !== -1) {
797
+ storedLevel = /^([^;]+)/.exec(
798
+ cookie.slice(location + cookieName.length + 1)
799
+ )[1];
800
+ }
801
+ } catch (ignore) {
802
+ }
803
+ }
804
+ if (self2.levels[storedLevel] === void 0) {
805
+ storedLevel = void 0;
806
+ }
807
+ return storedLevel;
808
+ }
809
+ function clearPersistedLevel() {
810
+ if (typeof window === undefinedType || !storageKey)
811
+ return;
812
+ try {
813
+ window.localStorage.removeItem(storageKey);
814
+ } catch (ignore) {
815
+ }
816
+ try {
817
+ window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
818
+ } catch (ignore) {
819
+ }
820
+ }
821
+ function normalizeLevel(input) {
822
+ var level = input;
823
+ if (typeof level === "string" && self2.levels[level.toUpperCase()] !== void 0) {
824
+ level = self2.levels[level.toUpperCase()];
825
+ }
826
+ if (typeof level === "number" && level >= 0 && level <= self2.levels.SILENT) {
827
+ return level;
828
+ } else {
829
+ throw new TypeError("log.setLevel() called with invalid level: " + input);
830
+ }
831
+ }
832
+ self2.name = name;
833
+ self2.levels = {
834
+ "TRACE": 0,
835
+ "DEBUG": 1,
836
+ "INFO": 2,
837
+ "WARN": 3,
838
+ "ERROR": 4,
839
+ "SILENT": 5
840
+ };
841
+ self2.methodFactory = factory || defaultMethodFactory;
842
+ self2.getLevel = function() {
843
+ if (userLevel != null) {
844
+ return userLevel;
845
+ } else if (defaultLevel != null) {
846
+ return defaultLevel;
847
+ } else {
848
+ return inheritedLevel;
849
+ }
850
+ };
851
+ self2.setLevel = function(level, persist) {
852
+ userLevel = normalizeLevel(level);
853
+ if (persist !== false) {
854
+ persistLevelIfPossible(userLevel);
855
+ }
856
+ return replaceLoggingMethods.call(self2);
857
+ };
858
+ self2.setDefaultLevel = function(level) {
859
+ defaultLevel = normalizeLevel(level);
860
+ if (!getPersistedLevel()) {
861
+ self2.setLevel(level, false);
862
+ }
863
+ };
864
+ self2.resetLevel = function() {
865
+ userLevel = null;
866
+ clearPersistedLevel();
867
+ replaceLoggingMethods.call(self2);
868
+ };
869
+ self2.enableAll = function(persist) {
870
+ self2.setLevel(self2.levels.TRACE, persist);
871
+ };
872
+ self2.disableAll = function(persist) {
873
+ self2.setLevel(self2.levels.SILENT, persist);
874
+ };
875
+ self2.rebuild = function() {
876
+ if (defaultLogger !== self2) {
877
+ inheritedLevel = normalizeLevel(defaultLogger.getLevel());
878
+ }
879
+ replaceLoggingMethods.call(self2);
880
+ if (defaultLogger === self2) {
881
+ for (var childName in _loggersByName) {
882
+ _loggersByName[childName].rebuild();
883
+ }
884
+ }
885
+ };
886
+ inheritedLevel = normalizeLevel(
887
+ defaultLogger ? defaultLogger.getLevel() : "WARN"
888
+ );
889
+ var initialLevel = getPersistedLevel();
890
+ if (initialLevel != null) {
891
+ userLevel = normalizeLevel(initialLevel);
892
+ }
893
+ replaceLoggingMethods.call(self2);
894
+ }
895
+ defaultLogger = new Logger();
896
+ defaultLogger.getLogger = function getLogger(name) {
897
+ if (typeof name !== "symbol" && typeof name !== "string" || name === "") {
898
+ throw new TypeError("You must supply a name when creating a logger.");
899
+ }
900
+ var logger = _loggersByName[name];
901
+ if (!logger) {
902
+ logger = _loggersByName[name] = new Logger(
903
+ name,
904
+ defaultLogger.methodFactory
905
+ );
906
+ }
907
+ return logger;
908
+ };
909
+ var _log = typeof window !== undefinedType ? window.log : void 0;
910
+ defaultLogger.noConflict = function() {
911
+ if (typeof window !== undefinedType && window.log === defaultLogger) {
912
+ window.log = _log;
913
+ }
914
+ return defaultLogger;
915
+ };
916
+ defaultLogger.getLoggers = function getLoggers() {
917
+ return _loggersByName;
918
+ };
919
+ defaultLogger["default"] = defaultLogger;
920
+ return defaultLogger;
921
+ });
922
+ })(loglevel);
923
+ var loglevelExports = loglevel.exports;
924
+ const log = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
654
925
  class VitessceConfigDatasetFile {
655
926
  /**
656
927
  * Construct a new file definition instance.
@@ -1962,7 +2233,7 @@ async function generateViewDefinition(url, vc, dataset, hintsConfig) {
1962
2233
  fileConfig = await configInstance.composeFileConfig();
1963
2234
  viewsConfig = await configInstance.composeViewsConfig(hintsConfig);
1964
2235
  } catch (error) {
1965
- console.error(error);
2236
+ log.error(error);
1966
2237
  return Promise.reject(error);
1967
2238
  }
1968
2239
  dataset.addFile(fileConfig);
@@ -1,4 +1,5 @@
1
1
  import { CoordinationType as ct, FileType } from '@vitessce/constants-internal';
2
+ import { log } from '@vitessce/globals';
2
3
  import { VitessceConfig, } from './VitessceConfig.js';
3
4
  import { HINTS_CONFIG, HINT_TYPE_TO_FILE_TYPE_MAP } from './constants.js';
4
5
  /**
@@ -450,7 +451,7 @@ async function generateViewDefinition(url, vc, dataset, hintsConfig) {
450
451
  viewsConfig = await configInstance.composeViewsConfig(hintsConfig);
451
452
  }
452
453
  catch (error) {
453
- console.error(error);
454
+ log.error(error);
454
455
  return Promise.reject(error);
455
456
  }
456
457
  dataset.addFile(fileConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/config",
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": {
@@ -16,8 +16,9 @@
16
16
  "dist-tsc"
17
17
  ],
18
18
  "dependencies": {
19
- "@vitessce/constants-internal": "3.5.5",
20
- "@vitessce/utils": "3.5.5"
19
+ "@vitessce/constants-internal": "3.5.7",
20
+ "@vitessce/utils": "3.5.7",
21
+ "@vitessce/globals": "3.5.7"
21
22
  },
22
23
  "scripts": {
23
24
  "bundle": "pnpm exec vite build -c ../../scripts/vite.config.js",
@@ -1,10 +1,10 @@
1
1
  import { CoordinationType as ct, FileType } from '@vitessce/constants-internal';
2
+ import { log } from '@vitessce/globals';
2
3
  import {
3
4
  VitessceConfig,
4
5
  } from './VitessceConfig.js';
5
6
 
6
7
  import { HINTS_CONFIG, HINT_TYPE_TO_FILE_TYPE_MAP } from './constants.js';
7
-
8
8
  /**
9
9
  * @param {Object} hintsConfig. The hints config for the given dataset.
10
10
  *
@@ -526,7 +526,7 @@ async function generateViewDefinition(url, vc, dataset, hintsConfig) {
526
526
  fileConfig = await configInstance.composeFileConfig();
527
527
  viewsConfig = await configInstance.composeViewsConfig(hintsConfig);
528
528
  } catch (error) {
529
- console.error(error);
529
+ log.error(error);
530
530
  return Promise.reject(error);
531
531
  }
532
532