@vitessce/constants 2.0.3-beta.0 → 3.0.0

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
@@ -1 +1,357 @@
1
- export { ViewType, DataType, FileType, CoordinationType, } from './constants-merged';
1
+ const ViewType$2 = {
2
+ DESCRIPTION: "description",
3
+ STATUS: "status",
4
+ SCATTERPLOT: "scatterplot",
5
+ SPATIAL: "spatial",
6
+ HEATMAP: "heatmap",
7
+ LAYER_CONTROLLER: "layerController",
8
+ GENOMIC_PROFILES: "genomicProfiles",
9
+ GATING: "gating",
10
+ FEATURE_LIST: "featureList",
11
+ OBS_SETS: "obsSets",
12
+ OBS_SET_SIZES: "obsSetSizes",
13
+ OBS_SET_FEATURE_VALUE_DISTRIBUTION: "obsSetFeatureValueDistribution",
14
+ FEATURE_VALUE_HISTOGRAM: "featureValueHistogram"
15
+ };
16
+ const DataType$2 = {
17
+ OBS_LABELS: "obsLabels",
18
+ OBS_EMBEDDING: "obsEmbedding",
19
+ OBS_LOCATIONS: "obsLocations",
20
+ OBS_FEATURE_MATRIX: "obsFeatureMatrix",
21
+ OBS_SETS: "obsSets",
22
+ FEATURE_LABELS: "featureLabels",
23
+ IMAGE: "image",
24
+ OBS_SEGMENTATIONS: "obsSegmentations",
25
+ NEIGHBORHOODS: "neighborhoods",
26
+ GENOMIC_PROFILES: "genomic-profiles"
27
+ };
28
+ const FileType$2 = {
29
+ // Joint file types
30
+ ANNDATA_ZARR: "anndata.zarr",
31
+ // Atomic file types
32
+ OBS_EMBEDDING_CSV: "obsEmbedding.csv",
33
+ OBS_LOCATIONS_CSV: "obsLocations.csv",
34
+ OBS_LABELS_CSV: "obsLabels.csv",
35
+ FEATURE_LABELS_CSV: "featureLabels.csv",
36
+ OBS_FEATURE_MATRIX_CSV: "obsFeatureMatrix.csv",
37
+ OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
38
+ OBS_SETS_CSV: "obsSets.csv",
39
+ OBS_SETS_JSON: "obsSets.json",
40
+ IMAGE_OME_ZARR: "image.ome-zarr",
41
+ // AnnData
42
+ OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
43
+ OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
44
+ OBS_EMBEDDING_ANNDATA_ZARR: "obsEmbedding.anndata.zarr",
45
+ OBS_LOCATIONS_ANNDATA_ZARR: "obsLocations.anndata.zarr",
46
+ OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
47
+ OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
48
+ FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
49
+ // MuData
50
+ OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
51
+ OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
52
+ OBS_EMBEDDING_MUDATA_ZARR: "obsEmbedding.mudata.zarr",
53
+ OBS_LOCATIONS_MUDATA_ZARR: "obsLocations.mudata.zarr",
54
+ OBS_SEGMENTATIONS_MUDATA_ZARR: "obsSegmentations.mudata.zarr",
55
+ OBS_LABELS_MUDATA_ZARR: "obsLabels.mudata.zarr",
56
+ FEATURE_LABELS_MUDATA_ZARR: "featureLabels.mudata.zarr",
57
+ GENOMIC_PROFILES_ZARR: "genomic-profiles.zarr",
58
+ NEIGHBORHOODS_JSON: "neighborhoods.json",
59
+ // OME-TIFF
60
+ IMAGE_OME_TIFF: "image.ome-tiff",
61
+ OBS_SEGMENTATIONS_OME_TIFF: "obsSegmentations.ome-tiff",
62
+ // New file types to support old file types:
63
+ // - cells.json
64
+ OBS_EMBEDDING_CELLS_JSON: "obsEmbedding.cells.json",
65
+ OBS_SEGMENTATIONS_CELLS_JSON: "obsSegmentations.cells.json",
66
+ OBS_LOCATIONS_CELLS_JSON: "obsLocations.cells.json",
67
+ OBS_LABELS_CELLS_JSON: "obsLabels.cells.json",
68
+ // - cell-sets.json
69
+ OBS_SETS_CELL_SETS_JSON: "obsSets.cell-sets.json",
70
+ // - genes.json
71
+ OBS_FEATURE_MATRIX_GENES_JSON: "obsFeatureMatrix.genes.json",
72
+ // - clusters.json
73
+ OBS_FEATURE_MATRIX_CLUSTERS_JSON: "obsFeatureMatrix.clusters.json",
74
+ // - expression-matrix.zarr
75
+ OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR: "obsFeatureMatrix.expression-matrix.zarr",
76
+ // - raster.json
77
+ IMAGE_RASTER_JSON: "image.raster.json",
78
+ OBS_SEGMENTATIONS_RASTER_JSON: "obsSegmentations.raster.json",
79
+ // - molecules.json
80
+ OBS_LOCATIONS_MOLECULES_JSON: "obsLocations.molecules.json",
81
+ OBS_LABELS_MOLECULES_JSON: "obsLabels.molecules.json",
82
+ // Legacy joint file types
83
+ CELLS_JSON: "cells.json",
84
+ CELL_SETS_JSON: "cell-sets.json",
85
+ ANNDATA_CELL_SETS_ZARR: "anndata-cell-sets.zarr",
86
+ ANNDATA_CELLS_ZARR: "anndata-cells.zarr",
87
+ EXPRESSION_MATRIX_ZARR: "expression-matrix.zarr",
88
+ MOLECULES_JSON: "molecules.json",
89
+ RASTER_JSON: "raster.json",
90
+ RASTER_OME_ZARR: "raster.ome-zarr",
91
+ CLUSTERS_JSON: "clusters.json",
92
+ GENES_JSON: "genes.json",
93
+ ANNDATA_EXPRESSION_MATRIX_ZARR: "anndata-expression-matrix.zarr"
94
+ };
95
+ const CoordinationType$2 = {
96
+ DATASET: "dataset",
97
+ // Entity types
98
+ OBS_TYPE: "obsType",
99
+ FEATURE_TYPE: "featureType",
100
+ FEATURE_VALUE_TYPE: "featureValueType",
101
+ OBS_LABELS_TYPE: "obsLabelsType",
102
+ // Other types
103
+ EMBEDDING_TYPE: "embeddingType",
104
+ EMBEDDING_ZOOM: "embeddingZoom",
105
+ EMBEDDING_ROTATION: "embeddingRotation",
106
+ EMBEDDING_TARGET_X: "embeddingTargetX",
107
+ EMBEDDING_TARGET_Y: "embeddingTargetY",
108
+ EMBEDDING_TARGET_Z: "embeddingTargetZ",
109
+ EMBEDDING_OBS_SET_POLYGONS_VISIBLE: "embeddingObsSetPolygonsVisible",
110
+ EMBEDDING_OBS_SET_LABELS_VISIBLE: "embeddingObsSetLabelsVisible",
111
+ EMBEDDING_OBS_SET_LABEL_SIZE: "embeddingObsSetLabelSize",
112
+ EMBEDDING_OBS_RADIUS: "embeddingObsRadius",
113
+ EMBEDDING_OBS_RADIUS_MODE: "embeddingObsRadiusMode",
114
+ EMBEDDING_OBS_OPACITY: "embeddingObsOpacity",
115
+ EMBEDDING_OBS_OPACITY_MODE: "embeddingObsOpacityMode",
116
+ SPATIAL_ZOOM: "spatialZoom",
117
+ SPATIAL_ROTATION: "spatialRotation",
118
+ SPATIAL_TARGET_X: "spatialTargetX",
119
+ SPATIAL_TARGET_Y: "spatialTargetY",
120
+ SPATIAL_TARGET_Z: "spatialTargetZ",
121
+ SPATIAL_ROTATION_X: "spatialRotationX",
122
+ SPATIAL_ROTATION_Y: "spatialRotationY",
123
+ SPATIAL_ROTATION_Z: "spatialRotationZ",
124
+ SPATIAL_ROTATION_ORBIT: "spatialRotationOrbit",
125
+ SPATIAL_ORBIT_AXIS: "spatialOrbitAxis",
126
+ SPATIAL_AXIS_FIXED: "spatialAxisFixed",
127
+ HEATMAP_ZOOM_X: "heatmapZoomX",
128
+ HEATMAP_ZOOM_Y: "heatmapZoomY",
129
+ HEATMAP_TARGET_X: "heatmapTargetX",
130
+ HEATMAP_TARGET_Y: "heatmapTargetY",
131
+ OBS_FILTER: "obsFilter",
132
+ OBS_HIGHLIGHT: "obsHighlight",
133
+ OBS_SET_SELECTION: "obsSetSelection",
134
+ OBS_SET_HIGHLIGHT: "obsSetHighlight",
135
+ OBS_SET_EXPANSION: "obsSetExpansion",
136
+ OBS_SET_COLOR: "obsSetColor",
137
+ FEATURE_FILTER: "featureFilter",
138
+ FEATURE_HIGHLIGHT: "featureHighlight",
139
+ FEATURE_SELECTION: "featureSelection",
140
+ FEATURE_VALUE_COLORMAP: "featureValueColormap",
141
+ FEATURE_VALUE_TRANSFORM: "featureValueTransform",
142
+ FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
143
+ OBS_COLOR_ENCODING: "obsColorEncoding",
144
+ SPATIAL_IMAGE_LAYER: "spatialImageLayer",
145
+ SPATIAL_SEGMENTATION_LAYER: "spatialSegmentationLayer",
146
+ SPATIAL_POINT_LAYER: "spatialPointLayer",
147
+ SPATIAL_NEIGHBORHOOD_LAYER: "spatialNeighborhoodLayer",
148
+ GENOMIC_ZOOM_X: "genomicZoomX",
149
+ GENOMIC_ZOOM_Y: "genomicZoomY",
150
+ GENOMIC_TARGET_X: "genomicTargetX",
151
+ GENOMIC_TARGET_Y: "genomicTargetY",
152
+ ADDITIONAL_OBS_SETS: "additionalObsSets",
153
+ // TODO: use obsHighlight rather than moleculeHighlight.
154
+ MOLECULE_HIGHLIGHT: "moleculeHighlight",
155
+ GATING_FEATURE_SELECTION_X: "gatingFeatureSelectionX",
156
+ GATING_FEATURE_SELECTION_Y: "gatingFeatureSelectionY",
157
+ FEATURE_VALUE_TRANSFORM_COEFFICIENT: "featureValueTransformCoefficient",
158
+ TOOLTIPS_VISIBLE: "tooltipsVisible"
159
+ };
160
+ const ViewType$1 = {
161
+ GENES: [
162
+ "genes",
163
+ "This view type was renamed to featureList in schema version 1.0.15."
164
+ ],
165
+ CELL_SETS: [
166
+ "cellSets",
167
+ "This view type was renamed to obsSets in schema version 1.0.15."
168
+ ],
169
+ CELL_SET_SIZES: [
170
+ "cellSetSizes",
171
+ "This view type was renamed to obsSetSizes in schema version 1.0.15."
172
+ ],
173
+ CELL_SET_EXPRESSION: [
174
+ "cellSetExpression",
175
+ "This view type was renamed to obsSetFeatureValueDistribution in schema version 1.0.15."
176
+ ],
177
+ EXPRESSION_HISTOGRAM: [
178
+ "expressionHistogram",
179
+ "This view type was renamed to featureValueHistogram in schema version 1.0.15."
180
+ ]
181
+ };
182
+ const DataType$1 = {
183
+ CELLS: [
184
+ "cells",
185
+ "This data type was removed. Associated file types were re-implemented as joint file types. See obsEmbedding instead."
186
+ ],
187
+ CELL_SETS: [
188
+ "cell-sets",
189
+ "This data type was removed. Associated file types were re-implemented as joint file types. See obsSets instead."
190
+ ],
191
+ EXPRESSION_MATRIX: [
192
+ "expression-matrix",
193
+ "This data type was removed. Associated file types were re-implemented as joint file types. See obsFeatureMatrix instead."
194
+ ],
195
+ MOLECULES: [
196
+ "molecules",
197
+ "This data type was removed. Associated file types were re-implemented as joint file types. See obsLocations instead."
198
+ ],
199
+ RASTER: [
200
+ "raster",
201
+ "This data type was removed. Associated file types were re-implemented as joint file types. See image and obsSegmentations instead."
202
+ ]
203
+ };
204
+ const FileType$1 = {};
205
+ function makeChangeMessage(newTypeName, newVersion) {
206
+ return [
207
+ `This coordination type was changed to ${newTypeName} in view config schema version ${newVersion}`,
208
+ newVersion,
209
+ newTypeName
210
+ ];
211
+ }
212
+ const CoordinationType$1 = {
213
+ SPATIAL_LAYERS: [
214
+ "spatialLayers",
215
+ "This coordination type was split into multiple coordination types in view config schema version 1.0.1",
216
+ "1.0.1",
217
+ "multiple"
218
+ // Not used for spatialLayers (since it was split into multiple).
219
+ ],
220
+ // Spatial layers
221
+ SPATIAL_RASTER_LAYERS: [
222
+ "spatialRasterLayers",
223
+ ...makeChangeMessage("spatialImageLayer", "1.0.11")
224
+ ],
225
+ SPATIAL_CELLS_LAYER: [
226
+ "spatialCellsLayer",
227
+ ...makeChangeMessage("spatialSegmentationLayer", "1.0.11")
228
+ ],
229
+ SPATIAL_MOLECULES_LAYER: [
230
+ "spatialMoleculesLayer",
231
+ ...makeChangeMessage("spatialPointLayer", "1.0.11")
232
+ ],
233
+ SPATIAL_NEIGHBORHOODS_LAYER: [
234
+ "spatialNeighborhoodsLayer",
235
+ ...makeChangeMessage("spatialNeighborhoodLayer", "1.0.11")
236
+ ],
237
+ // Cell -> Obs
238
+ EMBEDDING_CELL_SET_POLYGONS_VISIBLE: [
239
+ "embeddingCellSetPolygonsVisible",
240
+ ...makeChangeMessage("embeddingObsSetPolygonsVisible", "1.0.11")
241
+ ],
242
+ EMBEDDING_CELL_SET_LABELS_VISIBLE: [
243
+ "embeddingCellSetLabelsVisible",
244
+ ...makeChangeMessage("embeddingObsSetLabelsVisible", "1.0.11")
245
+ ],
246
+ EMBEDDING_CELL_SET_LABEL_SIZE: [
247
+ "embeddingCellSetLabelSize",
248
+ ...makeChangeMessage("embeddingObsSetLabelSize", "1.0.11")
249
+ ],
250
+ EMBEDDING_CELL_RADIUS: [
251
+ "embeddingCellRadius",
252
+ ...makeChangeMessage("embeddingObsRadius", "1.0.11")
253
+ ],
254
+ EMBEDDING_CELL_RADIUS_MODE: [
255
+ "embeddingCellRadiusMode",
256
+ ...makeChangeMessage("embeddingObsRadiusMode", "1.0.11")
257
+ ],
258
+ EMBEDDING_CELL_OPACITY: [
259
+ "embeddingCellOpacity",
260
+ ...makeChangeMessage("embeddingObsOpacity", "1.0.11")
261
+ ],
262
+ EMBEDDING_CELL_OPACITY_MODE: [
263
+ "embeddingCellOpacityMode",
264
+ ...makeChangeMessage("embeddingObsOpacityMode", "1.0.11")
265
+ ],
266
+ CELL_FILTER: [
267
+ "cellFilter",
268
+ ...makeChangeMessage("obsFilter", "1.0.11")
269
+ ],
270
+ CELL_HIGHLIGHT: [
271
+ "cellHighlight",
272
+ ...makeChangeMessage("obsHighlight", "1.0.11")
273
+ ],
274
+ CELL_SET_SELECTION: [
275
+ "cellSetSelection",
276
+ ...makeChangeMessage("obsSetSelection", "1.0.11")
277
+ ],
278
+ CELL_SET_HIGHLIGHT: [
279
+ "cellSetHighlight",
280
+ ...makeChangeMessage("obsSetHighlight", "1.0.11")
281
+ ],
282
+ CELL_SET_COLOR: [
283
+ "cellSetColor",
284
+ ...makeChangeMessage("obsSetColor", "1.0.11")
285
+ ],
286
+ CELL_COLOR_ENCODING: [
287
+ "cellColorEncoding",
288
+ ...makeChangeMessage("obsColorEncoding", "1.0.11")
289
+ ],
290
+ ADDITIONAL_CELL_SETS: [
291
+ "additionalCellSets",
292
+ ...makeChangeMessage("additionalObsSets", "1.0.11")
293
+ ],
294
+ // Gene -> Feature
295
+ GENE_FILTER: [
296
+ "geneFilter",
297
+ ...makeChangeMessage("featureFilter", "1.0.11")
298
+ ],
299
+ GENE_HIGHLIGHT: [
300
+ "geneHighlight",
301
+ ...makeChangeMessage("featureHighlight", "1.0.11")
302
+ ],
303
+ GENE_SELECTION: [
304
+ "geneSelection",
305
+ ...makeChangeMessage("featureSelection", "1.0.11")
306
+ ],
307
+ GENE_EXPRESSION_COLORMAP: [
308
+ "geneExpressionColormap",
309
+ ...makeChangeMessage("featureValueColormap", "1.0.11")
310
+ ],
311
+ GENE_EXPRESSION_TRANSFORM: [
312
+ "geneExpressionTransform",
313
+ ...makeChangeMessage("featureValueTransform", "1.0.11")
314
+ ],
315
+ GENE_EXPRESSION_COLORMAP_RANGE: [
316
+ "geneExpressionColormapRange",
317
+ ...makeChangeMessage("featureValueColormapRange", "1.0.11")
318
+ ]
319
+ };
320
+ function makeConstantWithDeprecationMessage(currObj, oldObj) {
321
+ const handler = {
322
+ get(obj, prop) {
323
+ const oldKeys = Object.keys(oldObj);
324
+ if (oldKeys.includes(prop)) {
325
+ console.warn(`Notice about the constant mapping ${prop}: '${oldObj[prop][0]}':
326
+ ${oldObj[prop][1]}`);
327
+ return oldObj[prop];
328
+ }
329
+ return obj[prop];
330
+ }
331
+ };
332
+ const objWithMessage = new Proxy(currObj, handler);
333
+ return objWithMessage;
334
+ }
335
+ const ViewType = makeConstantWithDeprecationMessage(
336
+ ViewType$2,
337
+ ViewType$1
338
+ );
339
+ const DataType = makeConstantWithDeprecationMessage(
340
+ DataType$2,
341
+ DataType$1
342
+ );
343
+ const FileType = makeConstantWithDeprecationMessage(
344
+ FileType$2,
345
+ FileType$1
346
+ );
347
+ const CoordinationType = makeConstantWithDeprecationMessage(
348
+ CoordinationType$2,
349
+ CoordinationType$1
350
+ );
351
+ export {
352
+ CoordinationType,
353
+ DataType,
354
+ FileType,
355
+ CoordinationType$1 as OldCoordinationType,
356
+ ViewType
357
+ };
@@ -0,0 +1,5 @@
1
+ export const ViewType: any;
2
+ export const DataType: any;
3
+ export const FileType: any;
4
+ export const CoordinationType: any;
5
+ //# sourceMappingURL=constants-merged.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-merged.d.ts","sourceRoot":"","sources":["../src/constants-merged.js"],"names":[],"mappings":"AAkCA,2BAGE;AACF,2BAGE;AACF,2BAGE;AACF,mCAGE"}
@@ -4,7 +4,7 @@
4
4
  * backwards compatibility.
5
5
  */
6
6
  import { ViewType as ViewTypeCurr, DataType as DataTypeCurr, FileType as FileTypeCurr, CoordinationType as CoordinationTypeCurr, } from '@vitessce/constants-internal';
7
- import { ViewType as ViewTypeOld, DataType as DataTypeOld, FileType as FileTypeOld, CoordinationType as CoordinationTypeOld, } from './constants-old';
7
+ import { ViewType as ViewTypeOld, DataType as DataTypeOld, FileType as FileTypeOld, CoordinationType as CoordinationTypeOld, } from './constants-old.js';
8
8
  function makeConstantWithDeprecationMessage(currObj, oldObj) {
9
9
  const handler = {
10
10
  get(obj, prop) {
@@ -16,6 +16,7 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
16
16
  return obj[prop];
17
17
  },
18
18
  };
19
+ // eslint-disable-next-line no-undef
19
20
  const objWithMessage = new Proxy(currObj, handler);
20
21
  return objWithMessage;
21
22
  }
@@ -0,0 +1,44 @@
1
+ export namespace ViewType {
2
+ const GENES: string[];
3
+ const CELL_SETS: string[];
4
+ const CELL_SET_SIZES: string[];
5
+ const CELL_SET_EXPRESSION: string[];
6
+ const EXPRESSION_HISTOGRAM: string[];
7
+ }
8
+ export namespace DataType {
9
+ export const CELLS: string[];
10
+ const CELL_SETS_1: string[];
11
+ export { CELL_SETS_1 as CELL_SETS };
12
+ export const EXPRESSION_MATRIX: string[];
13
+ export const MOLECULES: string[];
14
+ export const RASTER: string[];
15
+ }
16
+ export const FileType: {};
17
+ export namespace CoordinationType {
18
+ const SPATIAL_LAYERS: string[];
19
+ const SPATIAL_RASTER_LAYERS: any[];
20
+ const SPATIAL_CELLS_LAYER: any[];
21
+ const SPATIAL_MOLECULES_LAYER: any[];
22
+ const SPATIAL_NEIGHBORHOODS_LAYER: any[];
23
+ const EMBEDDING_CELL_SET_POLYGONS_VISIBLE: any[];
24
+ const EMBEDDING_CELL_SET_LABELS_VISIBLE: any[];
25
+ const EMBEDDING_CELL_SET_LABEL_SIZE: any[];
26
+ const EMBEDDING_CELL_RADIUS: any[];
27
+ const EMBEDDING_CELL_RADIUS_MODE: any[];
28
+ const EMBEDDING_CELL_OPACITY: any[];
29
+ const EMBEDDING_CELL_OPACITY_MODE: any[];
30
+ const CELL_FILTER: any[];
31
+ const CELL_HIGHLIGHT: any[];
32
+ const CELL_SET_SELECTION: any[];
33
+ const CELL_SET_HIGHLIGHT: any[];
34
+ const CELL_SET_COLOR: any[];
35
+ const CELL_COLOR_ENCODING: any[];
36
+ const ADDITIONAL_CELL_SETS: any[];
37
+ const GENE_FILTER: any[];
38
+ const GENE_HIGHLIGHT: any[];
39
+ const GENE_SELECTION: any[];
40
+ const GENE_EXPRESSION_COLORMAP: any[];
41
+ const GENE_EXPRESSION_TRANSFORM: any[];
42
+ const GENE_EXPRESSION_COLORMAP_RANGE: any[];
43
+ }
44
+ //# sourceMappingURL=constants-old.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-old.d.ts","sourceRoot":"","sources":["../src/constants-old.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkDA,0BAA2B"}
@@ -48,110 +48,116 @@ export const DataType = {
48
48
  };
49
49
  export const FileType = {};
50
50
  function makeChangeMessage(newTypeName, newVersion) {
51
- return `This coordination type was changed to ${newTypeName} in view config schema version ${newVersion}`;
51
+ return [
52
+ `This coordination type was changed to ${newTypeName} in view config schema version ${newVersion}`,
53
+ newVersion,
54
+ newTypeName,
55
+ ];
52
56
  }
53
57
  export const CoordinationType = {
54
58
  SPATIAL_LAYERS: [
55
59
  'spatialLayers',
56
60
  'This coordination type was split into multiple coordination types in view config schema version 1.0.1',
61
+ '1.0.1',
62
+ 'multiple', // Not used for spatialLayers (since it was split into multiple).
57
63
  ],
58
64
  // Spatial layers
59
65
  SPATIAL_RASTER_LAYERS: [
60
66
  'spatialRasterLayers',
61
- makeChangeMessage('spatialImageLayer', '1.0.11'),
67
+ ...makeChangeMessage('spatialImageLayer', '1.0.11'),
62
68
  ],
63
69
  SPATIAL_CELLS_LAYER: [
64
70
  'spatialCellsLayer',
65
- makeChangeMessage('spatialSegmentationLayer', '1.0.11'),
71
+ ...makeChangeMessage('spatialSegmentationLayer', '1.0.11'),
66
72
  ],
67
73
  SPATIAL_MOLECULES_LAYER: [
68
74
  'spatialMoleculesLayer',
69
- makeChangeMessage('spatialPointLayer', '1.0.11'),
75
+ ...makeChangeMessage('spatialPointLayer', '1.0.11'),
70
76
  ],
71
77
  SPATIAL_NEIGHBORHOODS_LAYER: [
72
78
  'spatialNeighborhoodsLayer',
73
- makeChangeMessage('spatialNeighborhoodLayer', '1.0.11'),
79
+ ...makeChangeMessage('spatialNeighborhoodLayer', '1.0.11'),
74
80
  ],
75
81
  // Cell -> Obs
76
82
  EMBEDDING_CELL_SET_POLYGONS_VISIBLE: [
77
83
  'embeddingCellSetPolygonsVisible',
78
- makeChangeMessage('embeddingObsSetPolygonsVisible', '1.0.11'),
84
+ ...makeChangeMessage('embeddingObsSetPolygonsVisible', '1.0.11'),
79
85
  ],
80
86
  EMBEDDING_CELL_SET_LABELS_VISIBLE: [
81
87
  'embeddingCellSetLabelsVisible',
82
- makeChangeMessage('embeddingObsSetLabelsVisible', '1.0.11'),
88
+ ...makeChangeMessage('embeddingObsSetLabelsVisible', '1.0.11'),
83
89
  ],
84
90
  EMBEDDING_CELL_SET_LABEL_SIZE: [
85
91
  'embeddingCellSetLabelSize',
86
- makeChangeMessage('embeddingObsSetLabelSize', '1.0.11'),
92
+ ...makeChangeMessage('embeddingObsSetLabelSize', '1.0.11'),
87
93
  ],
88
94
  EMBEDDING_CELL_RADIUS: [
89
95
  'embeddingCellRadius',
90
- makeChangeMessage('embeddingObsRadius', '1.0.11'),
96
+ ...makeChangeMessage('embeddingObsRadius', '1.0.11'),
91
97
  ],
92
98
  EMBEDDING_CELL_RADIUS_MODE: [
93
99
  'embeddingCellRadiusMode',
94
- makeChangeMessage('embeddingObsRadiusMode', '1.0.11'),
100
+ ...makeChangeMessage('embeddingObsRadiusMode', '1.0.11'),
95
101
  ],
96
102
  EMBEDDING_CELL_OPACITY: [
97
103
  'embeddingCellOpacity',
98
- makeChangeMessage('embeddingObsOpacity', '1.0.11'),
104
+ ...makeChangeMessage('embeddingObsOpacity', '1.0.11'),
99
105
  ],
100
106
  EMBEDDING_CELL_OPACITY_MODE: [
101
107
  'embeddingCellOpacityMode',
102
- makeChangeMessage('embeddingObsOpacityMode', '1.0.11'),
108
+ ...makeChangeMessage('embeddingObsOpacityMode', '1.0.11'),
103
109
  ],
104
110
  CELL_FILTER: [
105
111
  'cellFilter',
106
- makeChangeMessage('obsFilter', '1.0.11'),
112
+ ...makeChangeMessage('obsFilter', '1.0.11'),
107
113
  ],
108
114
  CELL_HIGHLIGHT: [
109
115
  'cellHighlight',
110
- makeChangeMessage('obsHighlight', '1.0.11'),
116
+ ...makeChangeMessage('obsHighlight', '1.0.11'),
111
117
  ],
112
118
  CELL_SET_SELECTION: [
113
119
  'cellSetSelection',
114
- makeChangeMessage('obsSetSelection', '1.0.11'),
120
+ ...makeChangeMessage('obsSetSelection', '1.0.11'),
115
121
  ],
116
122
  CELL_SET_HIGHLIGHT: [
117
123
  'cellSetHighlight',
118
- makeChangeMessage('obsSetHighlight', '1.0.11'),
124
+ ...makeChangeMessage('obsSetHighlight', '1.0.11'),
119
125
  ],
120
126
  CELL_SET_COLOR: [
121
127
  'cellSetColor',
122
- makeChangeMessage('obsSetColor', '1.0.11'),
128
+ ...makeChangeMessage('obsSetColor', '1.0.11'),
123
129
  ],
124
130
  CELL_COLOR_ENCODING: [
125
131
  'cellColorEncoding',
126
- makeChangeMessage('obsColorEncoding', '1.0.11'),
132
+ ...makeChangeMessage('obsColorEncoding', '1.0.11'),
127
133
  ],
128
134
  ADDITIONAL_CELL_SETS: [
129
135
  'additionalCellSets',
130
- makeChangeMessage('additionalObsSets', '1.0.11'),
136
+ ...makeChangeMessage('additionalObsSets', '1.0.11'),
131
137
  ],
132
138
  // Gene -> Feature
133
139
  GENE_FILTER: [
134
140
  'geneFilter',
135
- makeChangeMessage('featureFilter', '1.0.11'),
141
+ ...makeChangeMessage('featureFilter', '1.0.11'),
136
142
  ],
137
143
  GENE_HIGHLIGHT: [
138
144
  'geneHighlight',
139
- makeChangeMessage('featureHighlight', '1.0.11'),
145
+ ...makeChangeMessage('featureHighlight', '1.0.11'),
140
146
  ],
141
147
  GENE_SELECTION: [
142
148
  'geneSelection',
143
- makeChangeMessage('featureSelection', '1.0.11'),
149
+ ...makeChangeMessage('featureSelection', '1.0.11'),
144
150
  ],
145
151
  GENE_EXPRESSION_COLORMAP: [
146
152
  'geneExpressionColormap',
147
- makeChangeMessage('featureValueColormap', '1.0.11'),
153
+ ...makeChangeMessage('featureValueColormap', '1.0.11'),
148
154
  ],
149
155
  GENE_EXPRESSION_TRANSFORM: [
150
156
  'geneExpressionTransform',
151
- makeChangeMessage('featureValueTransform', '1.0.11'),
157
+ ...makeChangeMessage('featureValueTransform', '1.0.11'),
152
158
  ],
153
159
  GENE_EXPRESSION_COLORMAP_RANGE: [
154
160
  'geneExpressionColormapRange',
155
- makeChangeMessage('featureValueColormapRange', '1.0.11'),
161
+ ...makeChangeMessage('featureValueColormapRange', '1.0.11'),
156
162
  ],
157
163
  };
@@ -0,0 +1,3 @@
1
+ export { CoordinationType as OldCoordinationType } from "./constants-old.js";
2
+ export { ViewType, DataType, FileType, CoordinationType } from "./constants-merged.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export { ViewType, DataType, FileType, CoordinationType, } from './constants-merged.js';
2
+ // For internal usage:
3
+ export { CoordinationType as OldCoordinationType } from './constants-old.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/constants",
3
- "version": "2.0.3-beta.0",
3
+ "version": "3.0.0",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -8,15 +8,24 @@
8
8
  "url": "git+https://github.com/vitessce/vitessce.git"
9
9
  },
10
10
  "license": "MIT",
11
+ "type": "module",
11
12
  "main": "dist/index.js",
12
13
  "files": [
13
- "dist"
14
+ "src",
15
+ "dist",
16
+ "dist-tsc"
14
17
  ],
15
18
  "dependencies": {
16
- "@vitessce/constants-internal": "2.0.3-beta.0"
19
+ "@vitessce/constants-internal": "3.0.0"
17
20
  },
18
21
  "scripts": {
19
- "start": "tsc --watch",
20
- "build": "tsc"
22
+ "bundle": "pnpm exec vite build -c ../../scripts/vite.config.js"
23
+ },
24
+ "module": "dist/index.js",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist-tsc/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ }
21
30
  }
22
31
  }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The exports from this file are not intended to be used for internal development.
3
+ * They are only meant to be exported from the package's main index.js to enable
4
+ * backwards compatibility.
5
+ */
6
+ import {
7
+ ViewType as ViewTypeCurr,
8
+ DataType as DataTypeCurr,
9
+ FileType as FileTypeCurr,
10
+ CoordinationType as CoordinationTypeCurr,
11
+ } from '@vitessce/constants-internal';
12
+ import {
13
+ ViewType as ViewTypeOld,
14
+ DataType as DataTypeOld,
15
+ FileType as FileTypeOld,
16
+ CoordinationType as CoordinationTypeOld,
17
+ } from './constants-old.js';
18
+
19
+ function makeConstantWithDeprecationMessage(currObj, oldObj) {
20
+ const handler = {
21
+ get(obj, prop) {
22
+ const oldKeys = Object.keys(oldObj);
23
+ if (oldKeys.includes(prop)) {
24
+ console.warn(`Notice about the constant mapping ${prop}: '${oldObj[prop][0]}':\n${oldObj[prop][1]}`);
25
+ return oldObj[prop];
26
+ }
27
+ return obj[prop];
28
+ },
29
+ };
30
+ // eslint-disable-next-line no-undef
31
+ const objWithMessage = new Proxy(currObj, handler);
32
+ return objWithMessage;
33
+ }
34
+
35
+ export const ViewType = makeConstantWithDeprecationMessage(
36
+ ViewTypeCurr,
37
+ ViewTypeOld,
38
+ );
39
+ export const DataType = makeConstantWithDeprecationMessage(
40
+ DataTypeCurr,
41
+ DataTypeOld,
42
+ );
43
+ export const FileType = makeConstantWithDeprecationMessage(
44
+ FileTypeCurr,
45
+ FileTypeOld,
46
+ );
47
+ export const CoordinationType = makeConstantWithDeprecationMessage(
48
+ CoordinationTypeCurr,
49
+ CoordinationTypeOld,
50
+ );
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Old constant values with deprecation log messages.
3
+ * Values should be tuples like [oldValue, deprecationMessage].
4
+ */
5
+ export const ViewType = {
6
+ GENES: [
7
+ 'genes',
8
+ 'This view type was renamed to featureList in schema version 1.0.15.',
9
+ ],
10
+ CELL_SETS: [
11
+ 'cellSets',
12
+ 'This view type was renamed to obsSets in schema version 1.0.15.',
13
+ ],
14
+ CELL_SET_SIZES: [
15
+ 'cellSetSizes',
16
+ 'This view type was renamed to obsSetSizes in schema version 1.0.15.',
17
+ ],
18
+ CELL_SET_EXPRESSION: [
19
+ 'cellSetExpression',
20
+ 'This view type was renamed to obsSetFeatureValueDistribution in schema version 1.0.15.',
21
+ ],
22
+ EXPRESSION_HISTOGRAM: [
23
+ 'expressionHistogram',
24
+ 'This view type was renamed to featureValueHistogram in schema version 1.0.15.',
25
+ ],
26
+ };
27
+
28
+ export const DataType = {
29
+ CELLS: [
30
+ 'cells',
31
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsEmbedding instead.',
32
+ ],
33
+ CELL_SETS: [
34
+ 'cell-sets',
35
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsSets instead.',
36
+ ],
37
+ EXPRESSION_MATRIX: [
38
+ 'expression-matrix',
39
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsFeatureMatrix instead.',
40
+ ],
41
+ MOLECULES: [
42
+ 'molecules',
43
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsLocations instead.',
44
+ ],
45
+ RASTER: [
46
+ 'raster',
47
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See image and obsSegmentations instead.',
48
+ ],
49
+ };
50
+
51
+ export const FileType = {};
52
+
53
+ function makeChangeMessage(newTypeName, newVersion) {
54
+ return [
55
+ `This coordination type was changed to ${newTypeName} in view config schema version ${newVersion}`,
56
+ newVersion,
57
+ newTypeName,
58
+ ];
59
+ }
60
+
61
+ export const CoordinationType = {
62
+ SPATIAL_LAYERS: [
63
+ 'spatialLayers',
64
+ 'This coordination type was split into multiple coordination types in view config schema version 1.0.1',
65
+ '1.0.1',
66
+ 'multiple', // Not used for spatialLayers (since it was split into multiple).
67
+ ],
68
+ // Spatial layers
69
+ SPATIAL_RASTER_LAYERS: [
70
+ 'spatialRasterLayers',
71
+ ...makeChangeMessage('spatialImageLayer', '1.0.11'),
72
+ ],
73
+ SPATIAL_CELLS_LAYER: [
74
+ 'spatialCellsLayer',
75
+ ...makeChangeMessage('spatialSegmentationLayer', '1.0.11'),
76
+ ],
77
+ SPATIAL_MOLECULES_LAYER: [
78
+ 'spatialMoleculesLayer',
79
+ ...makeChangeMessage('spatialPointLayer', '1.0.11'),
80
+ ],
81
+ SPATIAL_NEIGHBORHOODS_LAYER: [
82
+ 'spatialNeighborhoodsLayer',
83
+ ...makeChangeMessage('spatialNeighborhoodLayer', '1.0.11'),
84
+ ],
85
+ // Cell -> Obs
86
+ EMBEDDING_CELL_SET_POLYGONS_VISIBLE: [
87
+ 'embeddingCellSetPolygonsVisible',
88
+ ...makeChangeMessage('embeddingObsSetPolygonsVisible', '1.0.11'),
89
+ ],
90
+ EMBEDDING_CELL_SET_LABELS_VISIBLE: [
91
+ 'embeddingCellSetLabelsVisible',
92
+ ...makeChangeMessage('embeddingObsSetLabelsVisible', '1.0.11'),
93
+ ],
94
+ EMBEDDING_CELL_SET_LABEL_SIZE: [
95
+ 'embeddingCellSetLabelSize',
96
+ ...makeChangeMessage('embeddingObsSetLabelSize', '1.0.11'),
97
+ ],
98
+ EMBEDDING_CELL_RADIUS: [
99
+ 'embeddingCellRadius',
100
+ ...makeChangeMessage('embeddingObsRadius', '1.0.11'),
101
+ ],
102
+ EMBEDDING_CELL_RADIUS_MODE: [
103
+ 'embeddingCellRadiusMode',
104
+ ...makeChangeMessage('embeddingObsRadiusMode', '1.0.11'),
105
+ ],
106
+ EMBEDDING_CELL_OPACITY: [
107
+ 'embeddingCellOpacity',
108
+ ...makeChangeMessage('embeddingObsOpacity', '1.0.11'),
109
+ ],
110
+ EMBEDDING_CELL_OPACITY_MODE: [
111
+ 'embeddingCellOpacityMode',
112
+ ...makeChangeMessage('embeddingObsOpacityMode', '1.0.11'),
113
+ ],
114
+ CELL_FILTER: [
115
+ 'cellFilter',
116
+ ...makeChangeMessage('obsFilter', '1.0.11'),
117
+ ],
118
+ CELL_HIGHLIGHT: [
119
+ 'cellHighlight',
120
+ ...makeChangeMessage('obsHighlight', '1.0.11'),
121
+ ],
122
+ CELL_SET_SELECTION: [
123
+ 'cellSetSelection',
124
+ ...makeChangeMessage('obsSetSelection', '1.0.11'),
125
+ ],
126
+ CELL_SET_HIGHLIGHT: [
127
+ 'cellSetHighlight',
128
+ ...makeChangeMessage('obsSetHighlight', '1.0.11'),
129
+ ],
130
+ CELL_SET_COLOR: [
131
+ 'cellSetColor',
132
+ ...makeChangeMessage('obsSetColor', '1.0.11'),
133
+ ],
134
+ CELL_COLOR_ENCODING: [
135
+ 'cellColorEncoding',
136
+ ...makeChangeMessage('obsColorEncoding', '1.0.11'),
137
+ ],
138
+ ADDITIONAL_CELL_SETS: [
139
+ 'additionalCellSets',
140
+ ...makeChangeMessage('additionalObsSets', '1.0.11'),
141
+ ],
142
+ // Gene -> Feature
143
+ GENE_FILTER: [
144
+ 'geneFilter',
145
+ ...makeChangeMessage('featureFilter', '1.0.11'),
146
+ ],
147
+ GENE_HIGHLIGHT: [
148
+ 'geneHighlight',
149
+ ...makeChangeMessage('featureHighlight', '1.0.11'),
150
+ ],
151
+ GENE_SELECTION: [
152
+ 'geneSelection',
153
+ ...makeChangeMessage('featureSelection', '1.0.11'),
154
+ ],
155
+ GENE_EXPRESSION_COLORMAP: [
156
+ 'geneExpressionColormap',
157
+ ...makeChangeMessage('featureValueColormap', '1.0.11'),
158
+ ],
159
+ GENE_EXPRESSION_TRANSFORM: [
160
+ 'geneExpressionTransform',
161
+ ...makeChangeMessage('featureValueTransform', '1.0.11'),
162
+ ],
163
+ GENE_EXPRESSION_COLORMAP_RANGE: [
164
+ 'geneExpressionColormapRange',
165
+ ...makeChangeMessage('featureValueColormapRange', '1.0.11'),
166
+ ],
167
+ };
package/src/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export {
2
+ ViewType, DataType, FileType, CoordinationType,
3
+ } from './constants-merged.js';
4
+ // For internal usage:
5
+ export { CoordinationType as OldCoordinationType } from './constants-old.js';