@vitessce/constants-internal 2.0.2 → 2.0.3

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.mjs ADDED
@@ -0,0 +1,540 @@
1
+ const ViewType = {
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 = {
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 = {
29
+ ANNDATA_ZARR: "anndata.zarr",
30
+ OBS_EMBEDDING_CSV: "obsEmbedding.csv",
31
+ OBS_LOCATIONS_CSV: "obsLocations.csv",
32
+ OBS_LABELS_CSV: "obsLabels.csv",
33
+ FEATURE_LABELS_CSV: "featureLabels.csv",
34
+ OBS_FEATURE_MATRIX_CSV: "obsFeatureMatrix.csv",
35
+ OBS_SEGMENTATIONS_JSON: "obsSegmentations.json",
36
+ OBS_SETS_CSV: "obsSets.csv",
37
+ OBS_SETS_JSON: "obsSets.json",
38
+ IMAGE_OME_ZARR: "image.ome-zarr",
39
+ OBS_FEATURE_MATRIX_ANNDATA_ZARR: "obsFeatureMatrix.anndata.zarr",
40
+ OBS_SETS_ANNDATA_ZARR: "obsSets.anndata.zarr",
41
+ OBS_EMBEDDING_ANNDATA_ZARR: "obsEmbedding.anndata.zarr",
42
+ OBS_LOCATIONS_ANNDATA_ZARR: "obsLocations.anndata.zarr",
43
+ OBS_SEGMENTATIONS_ANNDATA_ZARR: "obsSegmentations.anndata.zarr",
44
+ OBS_LABELS_ANNDATA_ZARR: "obsLabels.anndata.zarr",
45
+ FEATURE_LABELS_ANNDATA_ZARR: "featureLabels.anndata.zarr",
46
+ OBS_FEATURE_MATRIX_MUDATA_ZARR: "obsFeatureMatrix.mudata.zarr",
47
+ OBS_SETS_MUDATA_ZARR: "obsSets.mudata.zarr",
48
+ OBS_EMBEDDING_MUDATA_ZARR: "obsEmbedding.mudata.zarr",
49
+ OBS_LOCATIONS_MUDATA_ZARR: "obsLocations.mudata.zarr",
50
+ OBS_SEGMENTATIONS_MUDATA_ZARR: "obsSegmentations.mudata.zarr",
51
+ OBS_LABELS_MUDATA_ZARR: "obsLabels.mudata.zarr",
52
+ FEATURE_LABELS_MUDATA_ZARR: "featureLabels.mudata.zarr",
53
+ GENOMIC_PROFILES_ZARR: "genomic-profiles.zarr",
54
+ NEIGHBORHOODS_JSON: "neighborhoods.json",
55
+ OBS_EMBEDDING_CELLS_JSON: "obsEmbedding.cells.json",
56
+ OBS_SEGMENTATIONS_CELLS_JSON: "obsSegmentations.cells.json",
57
+ OBS_LOCATIONS_CELLS_JSON: "obsLocations.cells.json",
58
+ OBS_LABELS_CELLS_JSON: "obsLabels.cells.json",
59
+ OBS_SETS_CELL_SETS_JSON: "obsSets.cell-sets.json",
60
+ OBS_FEATURE_MATRIX_GENES_JSON: "obsFeatureMatrix.genes.json",
61
+ OBS_FEATURE_MATRIX_CLUSTERS_JSON: "obsFeatureMatrix.clusters.json",
62
+ OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR: "obsFeatureMatrix.expression-matrix.zarr",
63
+ IMAGE_RASTER_JSON: "image.raster.json",
64
+ OBS_SEGMENTATIONS_RASTER_JSON: "obsSegmentations.raster.json",
65
+ OBS_LOCATIONS_MOLECULES_JSON: "obsLocations.molecules.json",
66
+ OBS_LABELS_MOLECULES_JSON: "obsLabels.molecules.json",
67
+ CELLS_JSON: "cells.json",
68
+ CELL_SETS_JSON: "cell-sets.json",
69
+ ANNDATA_CELL_SETS_ZARR: "anndata-cell-sets.zarr",
70
+ ANNDATA_CELLS_ZARR: "anndata-cells.zarr",
71
+ EXPRESSION_MATRIX_ZARR: "expression-matrix.zarr",
72
+ MOLECULES_JSON: "molecules.json",
73
+ RASTER_JSON: "raster.json",
74
+ RASTER_OME_ZARR: "raster.ome-zarr",
75
+ CLUSTERS_JSON: "clusters.json",
76
+ GENES_JSON: "genes.json",
77
+ ANNDATA_EXPRESSION_MATRIX_ZARR: "anndata-expression-matrix.zarr"
78
+ };
79
+ const CoordinationType = {
80
+ DATASET: "dataset",
81
+ OBS_TYPE: "obsType",
82
+ FEATURE_TYPE: "featureType",
83
+ FEATURE_VALUE_TYPE: "featureValueType",
84
+ OBS_LABELS_TYPE: "obsLabelsType",
85
+ EMBEDDING_TYPE: "embeddingType",
86
+ EMBEDDING_ZOOM: "embeddingZoom",
87
+ EMBEDDING_ROTATION: "embeddingRotation",
88
+ EMBEDDING_TARGET_X: "embeddingTargetX",
89
+ EMBEDDING_TARGET_Y: "embeddingTargetY",
90
+ EMBEDDING_TARGET_Z: "embeddingTargetZ",
91
+ EMBEDDING_OBS_SET_POLYGONS_VISIBLE: "embeddingObsSetPolygonsVisible",
92
+ EMBEDDING_OBS_SET_LABELS_VISIBLE: "embeddingObsSetLabelsVisible",
93
+ EMBEDDING_OBS_SET_LABEL_SIZE: "embeddingObsSetLabelSize",
94
+ EMBEDDING_OBS_RADIUS: "embeddingObsRadius",
95
+ EMBEDDING_OBS_RADIUS_MODE: "embeddingObsRadiusMode",
96
+ EMBEDDING_OBS_OPACITY: "embeddingObsOpacity",
97
+ EMBEDDING_OBS_OPACITY_MODE: "embeddingObsOpacityMode",
98
+ SPATIAL_ZOOM: "spatialZoom",
99
+ SPATIAL_ROTATION: "spatialRotation",
100
+ SPATIAL_TARGET_X: "spatialTargetX",
101
+ SPATIAL_TARGET_Y: "spatialTargetY",
102
+ SPATIAL_TARGET_Z: "spatialTargetZ",
103
+ SPATIAL_ROTATION_X: "spatialRotationX",
104
+ SPATIAL_ROTATION_Y: "spatialRotationY",
105
+ SPATIAL_ROTATION_Z: "spatialRotationZ",
106
+ SPATIAL_ROTATION_ORBIT: "spatialRotationOrbit",
107
+ SPATIAL_ORBIT_AXIS: "spatialOrbitAxis",
108
+ SPATIAL_AXIS_FIXED: "spatialAxisFixed",
109
+ HEATMAP_ZOOM_X: "heatmapZoomX",
110
+ HEATMAP_ZOOM_Y: "heatmapZoomY",
111
+ HEATMAP_TARGET_X: "heatmapTargetX",
112
+ HEATMAP_TARGET_Y: "heatmapTargetY",
113
+ OBS_FILTER: "obsFilter",
114
+ OBS_HIGHLIGHT: "obsHighlight",
115
+ OBS_SET_SELECTION: "obsSetSelection",
116
+ OBS_SET_HIGHLIGHT: "obsSetHighlight",
117
+ OBS_SET_COLOR: "obsSetColor",
118
+ FEATURE_FILTER: "featureFilter",
119
+ FEATURE_HIGHLIGHT: "featureHighlight",
120
+ FEATURE_SELECTION: "featureSelection",
121
+ FEATURE_VALUE_COLORMAP: "featureValueColormap",
122
+ FEATURE_VALUE_TRANSFORM: "featureValueTransform",
123
+ FEATURE_VALUE_COLORMAP_RANGE: "featureValueColormapRange",
124
+ OBS_COLOR_ENCODING: "obsColorEncoding",
125
+ SPATIAL_IMAGE_LAYER: "spatialImageLayer",
126
+ SPATIAL_SEGMENTATION_LAYER: "spatialSegmentationLayer",
127
+ SPATIAL_POINT_LAYER: "spatialPointLayer",
128
+ SPATIAL_NEIGHBORHOOD_LAYER: "spatialNeighborhoodLayer",
129
+ GENOMIC_ZOOM_X: "genomicZoomX",
130
+ GENOMIC_ZOOM_Y: "genomicZoomY",
131
+ GENOMIC_TARGET_X: "genomicTargetX",
132
+ GENOMIC_TARGET_Y: "genomicTargetY",
133
+ ADDITIONAL_OBS_SETS: "additionalObsSets",
134
+ MOLECULE_HIGHLIGHT: "moleculeHighlight",
135
+ GATING_FEATURE_SELECTION_X: "gatingFeatureSelectionX",
136
+ GATING_FEATURE_SELECTION_Y: "gatingFeatureSelectionY",
137
+ FEATURE_VALUE_TRANSFORM_COEFFICIENT: "featureValueTransformCoefficient"
138
+ };
139
+ const STATUS = {
140
+ LOADING: "loading",
141
+ SUCCESS: "success",
142
+ ERROR: "error"
143
+ };
144
+ const FILE_TYPE_DATA_TYPE_MAPPING = {
145
+ [FileType.OBS_EMBEDDING_CSV]: DataType.OBS_EMBEDDING,
146
+ [FileType.OBS_LOCATIONS_CSV]: DataType.OBS_LOCATIONS,
147
+ [FileType.OBS_LABELS_CSV]: DataType.OBS_LABELS,
148
+ [FileType.FEATURE_LABELS_CSV]: DataType.FEATURE_LABELS,
149
+ [FileType.OBS_FEATURE_MATRIX_CSV]: DataType.OBS_FEATURE_MATRIX,
150
+ [FileType.OBS_SEGMENTATIONS_JSON]: DataType.OBS_SEGMENTATIONS,
151
+ [FileType.OBS_SETS_CSV]: DataType.OBS_SETS,
152
+ [FileType.OBS_SETS_JSON]: DataType.OBS_SETS,
153
+ [FileType.IMAGE_OME_ZARR]: DataType.IMAGE,
154
+ [FileType.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType.OBS_FEATURE_MATRIX,
155
+ [FileType.OBS_SETS_ANNDATA_ZARR]: DataType.OBS_SETS,
156
+ [FileType.OBS_EMBEDDING_ANNDATA_ZARR]: DataType.OBS_EMBEDDING,
157
+ [FileType.OBS_LOCATIONS_ANNDATA_ZARR]: DataType.OBS_LOCATIONS,
158
+ [FileType.OBS_SEGMENTATIONS_ANNDATA_ZARR]: DataType.OBS_SEGMENTATIONS,
159
+ [FileType.OBS_LABELS_ANNDATA_ZARR]: DataType.OBS_LABELS,
160
+ [FileType.FEATURE_LABELS_ANNDATA_ZARR]: DataType.FEATURE_LABELS,
161
+ [FileType.OBS_FEATURE_MATRIX_MUDATA_ZARR]: DataType.OBS_FEATURE_MATRIX,
162
+ [FileType.OBS_SETS_MUDATA_ZARR]: DataType.OBS_SETS,
163
+ [FileType.OBS_EMBEDDING_MUDATA_ZARR]: DataType.OBS_EMBEDDING,
164
+ [FileType.OBS_LOCATIONS_MUDATA_ZARR]: DataType.OBS_LOCATIONS,
165
+ [FileType.OBS_SEGMENTATIONS_MUDATA_ZARR]: DataType.OBS_SEGMENTATIONS,
166
+ [FileType.OBS_LABELS_MUDATA_ZARR]: DataType.OBS_LABELS,
167
+ [FileType.FEATURE_LABELS_MUDATA_ZARR]: DataType.FEATURE_LABELS,
168
+ [FileType.OBS_EMBEDDING_CELLS_JSON]: DataType.OBS_EMBEDDING,
169
+ [FileType.OBS_LOCATIONS_CELLS_JSON]: DataType.OBS_LOCATIONS,
170
+ [FileType.OBS_SEGMENTATIONS_CELLS_JSON]: DataType.OBS_SEGMENTATIONS,
171
+ [FileType.OBS_LABELS_CELLS_JSON]: DataType.OBS_LABELS,
172
+ [FileType.OBS_SETS_CELL_SETS_JSON]: DataType.OBS_SETS,
173
+ [FileType.OBS_FEATURE_MATRIX_GENES_JSON]: DataType.OBS_FEATURE_MATRIX,
174
+ [FileType.OBS_FEATURE_MATRIX_CLUSTERS_JSON]: DataType.OBS_FEATURE_MATRIX,
175
+ [FileType.OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR]: DataType.OBS_FEATURE_MATRIX,
176
+ [FileType.IMAGE_RASTER_JSON]: DataType.IMAGE,
177
+ [FileType.OBS_SEGMENTATIONS_RASTER_JSON]: DataType.OBS_SEGMENTATIONS,
178
+ [FileType.OBS_LOCATIONS_MOLECULES_JSON]: DataType.OBS_LOCATIONS,
179
+ [FileType.OBS_LABELS_MOLECULES_JSON]: DataType.OBS_LABELS,
180
+ [FileType.GENOMIC_PROFILES_ZARR]: DataType.GENOMIC_PROFILES,
181
+ [FileType.NEIGHBORHOODS_JSON]: DataType.NEIGHBORHOODS
182
+ };
183
+ const DATA_TYPE_COORDINATION_VALUE_USAGE = {
184
+ [DataType.OBS_SEGMENTATIONS]: [
185
+ CoordinationType.OBS_TYPE
186
+ ],
187
+ [DataType.OBS_EMBEDDING]: [
188
+ CoordinationType.OBS_TYPE,
189
+ CoordinationType.EMBEDDING_TYPE
190
+ ],
191
+ [DataType.OBS_LOCATIONS]: [
192
+ CoordinationType.OBS_TYPE
193
+ ],
194
+ [DataType.OBS_LABELS]: [
195
+ CoordinationType.OBS_TYPE,
196
+ CoordinationType.OBS_LABELS_TYPE
197
+ ],
198
+ [DataType.FEATURE_LABELS]: [
199
+ CoordinationType.FEATURE_TYPE
200
+ ],
201
+ [DataType.OBS_SETS]: [
202
+ CoordinationType.OBS_TYPE
203
+ ],
204
+ [DataType.OBS_FEATURE_MATRIX]: [
205
+ CoordinationType.OBS_TYPE,
206
+ CoordinationType.FEATURE_TYPE,
207
+ CoordinationType.FEATURE_VALUE_TYPE
208
+ ],
209
+ [DataType.GENOMIC_PROFILES]: [],
210
+ [DataType.IMAGE]: [],
211
+ [DataType.NEIGHBORHOODS]: []
212
+ };
213
+ const DEFAULT_COORDINATION_VALUES = {
214
+ [CoordinationType.OBS_TYPE]: "cell",
215
+ [CoordinationType.FEATURE_TYPE]: "gene",
216
+ [CoordinationType.FEATURE_VALUE_TYPE]: "expression",
217
+ [CoordinationType.OBS_LABELS_TYPE]: null,
218
+ [CoordinationType.EMBEDDING_ZOOM]: null,
219
+ [CoordinationType.EMBEDDING_ROTATION]: 0,
220
+ [CoordinationType.EMBEDDING_TARGET_X]: null,
221
+ [CoordinationType.EMBEDDING_TARGET_Y]: null,
222
+ [CoordinationType.EMBEDDING_TARGET_Z]: 0,
223
+ [CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE]: false,
224
+ [CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE]: false,
225
+ [CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE]: 14,
226
+ [CoordinationType.EMBEDDING_OBS_RADIUS]: 1,
227
+ [CoordinationType.EMBEDDING_OBS_RADIUS_MODE]: "auto",
228
+ [CoordinationType.EMBEDDING_OBS_OPACITY]: 1,
229
+ [CoordinationType.EMBEDDING_OBS_OPACITY_MODE]: "auto",
230
+ [CoordinationType.SPATIAL_ZOOM]: null,
231
+ [CoordinationType.SPATIAL_ROTATION]: 0,
232
+ [CoordinationType.SPATIAL_TARGET_X]: null,
233
+ [CoordinationType.SPATIAL_TARGET_Y]: null,
234
+ [CoordinationType.SPATIAL_TARGET_Z]: null,
235
+ [CoordinationType.SPATIAL_ROTATION_X]: null,
236
+ [CoordinationType.SPATIAL_ROTATION_Y]: null,
237
+ [CoordinationType.SPATIAL_ROTATION_Z]: null,
238
+ [CoordinationType.SPATIAL_AXIS_FIXED]: false,
239
+ [CoordinationType.SPATIAL_ROTATION_ORBIT]: 0,
240
+ [CoordinationType.SPATIAL_ORBIT_AXIS]: "Y",
241
+ [CoordinationType.SPATIAL_IMAGE_LAYER]: null,
242
+ [CoordinationType.SPATIAL_SEGMENTATION_LAYER]: null,
243
+ [CoordinationType.SPATIAL_POINT_LAYER]: null,
244
+ [CoordinationType.SPATIAL_NEIGHBORHOOD_LAYER]: null,
245
+ [CoordinationType.HEATMAP_ZOOM_X]: 0,
246
+ [CoordinationType.HEATMAP_ZOOM_Y]: 0,
247
+ [CoordinationType.HEATMAP_TARGET_X]: 0,
248
+ [CoordinationType.HEATMAP_TARGET_Y]: 0,
249
+ [CoordinationType.FEATURE_VALUE_COLORMAP]: "plasma",
250
+ [CoordinationType.FEATURE_VALUE_COLORMAP_RANGE]: [0, 1],
251
+ [CoordinationType.FEATURE_VALUE_TRANSFORM]: null,
252
+ [CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT]: 1,
253
+ [CoordinationType.FEATURE_FILTER]: null,
254
+ [CoordinationType.FEATURE_HIGHLIGHT]: null,
255
+ [CoordinationType.FEATURE_SELECTION]: null,
256
+ [CoordinationType.OBS_FILTER]: null,
257
+ [CoordinationType.OBS_HIGHLIGHT]: null,
258
+ [CoordinationType.OBS_SET_SELECTION]: null,
259
+ [CoordinationType.OBS_SET_HIGHLIGHT]: null,
260
+ [CoordinationType.OBS_SET_COLOR]: null,
261
+ [CoordinationType.OBS_COLOR_ENCODING]: "cellSetSelection",
262
+ [CoordinationType.GENOMIC_ZOOM_X]: 0,
263
+ [CoordinationType.GENOMIC_ZOOM_Y]: 0,
264
+ [CoordinationType.GENOMIC_TARGET_X]: 15499999995e-1,
265
+ [CoordinationType.GENOMIC_TARGET_Y]: 15499999995e-1,
266
+ [CoordinationType.ADDITIONAL_OBS_SETS]: null,
267
+ [CoordinationType.MOLECULE_HIGHLIGHT]: null,
268
+ [CoordinationType.GATING_FEATURE_SELECTION_X]: null,
269
+ [CoordinationType.GATING_FEATURE_SELECTION_Y]: null
270
+ };
271
+ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
272
+ CoordinationType.HEATMAP_ZOOM_X,
273
+ CoordinationType.HEATMAP_ZOOM_Y,
274
+ CoordinationType.HEATMAP_TARGET_X,
275
+ CoordinationType.HEATMAP_TARGET_Y,
276
+ CoordinationType.EMBEDDING_ZOOM,
277
+ CoordinationType.EMBEDDING_TARGET_X,
278
+ CoordinationType.EMBEDDING_TARGET_Y,
279
+ CoordinationType.EMBEDDING_TARGET_Z,
280
+ CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
281
+ CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE,
282
+ CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE,
283
+ CoordinationType.EMBEDDING_OBS_RADIUS,
284
+ CoordinationType.EMBEDDING_OBS_OPACITY
285
+ ];
286
+ const COMPONENT_COORDINATION_TYPES = {
287
+ [ViewType.SCATTERPLOT]: [
288
+ CoordinationType.DATASET,
289
+ CoordinationType.OBS_TYPE,
290
+ CoordinationType.FEATURE_TYPE,
291
+ CoordinationType.FEATURE_VALUE_TYPE,
292
+ CoordinationType.OBS_LABELS_TYPE,
293
+ CoordinationType.EMBEDDING_TYPE,
294
+ CoordinationType.EMBEDDING_ZOOM,
295
+ CoordinationType.EMBEDDING_ROTATION,
296
+ CoordinationType.EMBEDDING_TARGET_X,
297
+ CoordinationType.EMBEDDING_TARGET_Y,
298
+ CoordinationType.EMBEDDING_TARGET_Z,
299
+ CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
300
+ CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE,
301
+ CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE,
302
+ CoordinationType.EMBEDDING_OBS_RADIUS,
303
+ CoordinationType.EMBEDDING_OBS_RADIUS_MODE,
304
+ CoordinationType.EMBEDDING_OBS_OPACITY,
305
+ CoordinationType.EMBEDDING_OBS_OPACITY_MODE,
306
+ CoordinationType.OBS_FILTER,
307
+ CoordinationType.OBS_HIGHLIGHT,
308
+ CoordinationType.OBS_SET_SELECTION,
309
+ CoordinationType.OBS_SET_HIGHLIGHT,
310
+ CoordinationType.OBS_SET_COLOR,
311
+ CoordinationType.FEATURE_HIGHLIGHT,
312
+ CoordinationType.FEATURE_SELECTION,
313
+ CoordinationType.FEATURE_VALUE_COLORMAP,
314
+ CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
315
+ CoordinationType.OBS_COLOR_ENCODING,
316
+ CoordinationType.ADDITIONAL_OBS_SETS
317
+ ],
318
+ [ViewType.GATING]: [
319
+ CoordinationType.DATASET,
320
+ CoordinationType.OBS_TYPE,
321
+ CoordinationType.FEATURE_TYPE,
322
+ CoordinationType.FEATURE_VALUE_TYPE,
323
+ CoordinationType.EMBEDDING_TYPE,
324
+ CoordinationType.EMBEDDING_ZOOM,
325
+ CoordinationType.EMBEDDING_ROTATION,
326
+ CoordinationType.EMBEDDING_TARGET_X,
327
+ CoordinationType.EMBEDDING_TARGET_Y,
328
+ CoordinationType.EMBEDDING_TARGET_Z,
329
+ CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
330
+ CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE,
331
+ CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE,
332
+ CoordinationType.EMBEDDING_OBS_RADIUS,
333
+ CoordinationType.EMBEDDING_OBS_RADIUS_MODE,
334
+ CoordinationType.EMBEDDING_OBS_OPACITY,
335
+ CoordinationType.EMBEDDING_OBS_OPACITY_MODE,
336
+ CoordinationType.OBS_FILTER,
337
+ CoordinationType.OBS_HIGHLIGHT,
338
+ CoordinationType.OBS_SET_SELECTION,
339
+ CoordinationType.OBS_SET_HIGHLIGHT,
340
+ CoordinationType.OBS_SET_COLOR,
341
+ CoordinationType.FEATURE_HIGHLIGHT,
342
+ CoordinationType.FEATURE_SELECTION,
343
+ CoordinationType.FEATURE_VALUE_COLORMAP,
344
+ CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
345
+ CoordinationType.OBS_COLOR_ENCODING,
346
+ CoordinationType.ADDITIONAL_OBS_SETS,
347
+ CoordinationType.FEATURE_VALUE_TRANSFORM,
348
+ CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
349
+ CoordinationType.GATING_FEATURE_SELECTION_X,
350
+ CoordinationType.GATING_FEATURE_SELECTION_Y
351
+ ],
352
+ [ViewType.SPATIAL]: [
353
+ CoordinationType.DATASET,
354
+ CoordinationType.OBS_TYPE,
355
+ CoordinationType.OBS_LABELS_TYPE,
356
+ CoordinationType.FEATURE_TYPE,
357
+ CoordinationType.FEATURE_VALUE_TYPE,
358
+ CoordinationType.SPATIAL_ZOOM,
359
+ CoordinationType.SPATIAL_ROTATION,
360
+ CoordinationType.SPATIAL_IMAGE_LAYER,
361
+ CoordinationType.SPATIAL_SEGMENTATION_LAYER,
362
+ CoordinationType.SPATIAL_POINT_LAYER,
363
+ CoordinationType.SPATIAL_NEIGHBORHOOD_LAYER,
364
+ CoordinationType.SPATIAL_TARGET_X,
365
+ CoordinationType.SPATIAL_TARGET_Y,
366
+ CoordinationType.SPATIAL_TARGET_Z,
367
+ CoordinationType.SPATIAL_ROTATION_X,
368
+ CoordinationType.SPATIAL_ROTATION_Y,
369
+ CoordinationType.SPATIAL_ROTATION_Z,
370
+ CoordinationType.SPATIAL_ROTATION_ORBIT,
371
+ CoordinationType.SPATIAL_ORBIT_AXIS,
372
+ CoordinationType.SPATIAL_AXIS_FIXED,
373
+ CoordinationType.OBS_FILTER,
374
+ CoordinationType.OBS_HIGHLIGHT,
375
+ CoordinationType.OBS_SET_SELECTION,
376
+ CoordinationType.OBS_SET_HIGHLIGHT,
377
+ CoordinationType.OBS_SET_COLOR,
378
+ CoordinationType.FEATURE_HIGHLIGHT,
379
+ CoordinationType.FEATURE_SELECTION,
380
+ CoordinationType.FEATURE_VALUE_COLORMAP,
381
+ CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
382
+ CoordinationType.OBS_COLOR_ENCODING,
383
+ CoordinationType.ADDITIONAL_OBS_SETS,
384
+ CoordinationType.MOLECULE_HIGHLIGHT
385
+ ],
386
+ [ViewType.HEATMAP]: [
387
+ CoordinationType.DATASET,
388
+ CoordinationType.OBS_TYPE,
389
+ CoordinationType.OBS_LABELS_TYPE,
390
+ CoordinationType.FEATURE_TYPE,
391
+ CoordinationType.FEATURE_VALUE_TYPE,
392
+ CoordinationType.HEATMAP_ZOOM_X,
393
+ CoordinationType.HEATMAP_ZOOM_Y,
394
+ CoordinationType.HEATMAP_TARGET_X,
395
+ CoordinationType.HEATMAP_TARGET_Y,
396
+ CoordinationType.OBS_FILTER,
397
+ CoordinationType.OBS_HIGHLIGHT,
398
+ CoordinationType.OBS_SET_SELECTION,
399
+ CoordinationType.OBS_SET_HIGHLIGHT,
400
+ CoordinationType.OBS_SET_COLOR,
401
+ CoordinationType.FEATURE_FILTER,
402
+ CoordinationType.FEATURE_HIGHLIGHT,
403
+ CoordinationType.FEATURE_SELECTION,
404
+ CoordinationType.FEATURE_VALUE_COLORMAP,
405
+ CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
406
+ CoordinationType.OBS_COLOR_ENCODING,
407
+ CoordinationType.ADDITIONAL_OBS_SETS
408
+ ],
409
+ [ViewType.OBS_SETS]: [
410
+ CoordinationType.DATASET,
411
+ CoordinationType.OBS_TYPE,
412
+ CoordinationType.OBS_SET_SELECTION,
413
+ CoordinationType.OBS_SET_HIGHLIGHT,
414
+ CoordinationType.OBS_SET_COLOR,
415
+ CoordinationType.OBS_COLOR_ENCODING,
416
+ CoordinationType.ADDITIONAL_OBS_SETS,
417
+ CoordinationType.FEATURE_SELECTION
418
+ ],
419
+ [ViewType.OBS_SET_SIZES]: [
420
+ CoordinationType.DATASET,
421
+ CoordinationType.OBS_TYPE,
422
+ CoordinationType.OBS_SET_SELECTION,
423
+ CoordinationType.OBS_SET_HIGHLIGHT,
424
+ CoordinationType.OBS_SET_COLOR,
425
+ CoordinationType.ADDITIONAL_OBS_SETS
426
+ ],
427
+ [ViewType.STATUS]: [
428
+ CoordinationType.DATASET,
429
+ CoordinationType.OBS_HIGHLIGHT,
430
+ CoordinationType.FEATURE_HIGHLIGHT,
431
+ CoordinationType.OBS_SET_HIGHLIGHT,
432
+ CoordinationType.MOLECULE_HIGHLIGHT
433
+ ],
434
+ [ViewType.FEATURE_LIST]: [
435
+ CoordinationType.DATASET,
436
+ CoordinationType.OBS_TYPE,
437
+ CoordinationType.FEATURE_TYPE,
438
+ CoordinationType.FEATURE_VALUE_TYPE,
439
+ CoordinationType.FEATURE_FILTER,
440
+ CoordinationType.FEATURE_HIGHLIGHT,
441
+ CoordinationType.FEATURE_SELECTION,
442
+ CoordinationType.OBS_COLOR_ENCODING,
443
+ CoordinationType.OBS_SET_SELECTION
444
+ ],
445
+ [ViewType.OBS_SET_FEATURE_VALUE_DISTRIBUTION]: [
446
+ CoordinationType.DATASET,
447
+ CoordinationType.OBS_TYPE,
448
+ CoordinationType.FEATURE_TYPE,
449
+ CoordinationType.FEATURE_VALUE_TYPE,
450
+ CoordinationType.FEATURE_SELECTION,
451
+ CoordinationType.FEATURE_VALUE_TRANSFORM,
452
+ CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
453
+ CoordinationType.OBS_SET_SELECTION,
454
+ CoordinationType.OBS_SET_HIGHLIGHT,
455
+ CoordinationType.OBS_SET_COLOR,
456
+ CoordinationType.ADDITIONAL_OBS_SETS
457
+ ],
458
+ [ViewType.FEATURE_VALUE_HISTOGRAM]: [
459
+ CoordinationType.DATASET,
460
+ CoordinationType.OBS_TYPE,
461
+ CoordinationType.FEATURE_TYPE,
462
+ CoordinationType.FEATURE_VALUE_TYPE,
463
+ CoordinationType.FEATURE_SELECTION
464
+ ],
465
+ [ViewType.LAYER_CONTROLLER]: [
466
+ CoordinationType.DATASET,
467
+ CoordinationType.OBS_TYPE,
468
+ CoordinationType.FEATURE_TYPE,
469
+ CoordinationType.FEATURE_VALUE_TYPE,
470
+ CoordinationType.SPATIAL_IMAGE_LAYER,
471
+ CoordinationType.SPATIAL_SEGMENTATION_LAYER,
472
+ CoordinationType.SPATIAL_POINT_LAYER,
473
+ CoordinationType.SPATIAL_NEIGHBORHOOD_LAYER,
474
+ CoordinationType.SPATIAL_ZOOM,
475
+ CoordinationType.SPATIAL_TARGET_X,
476
+ CoordinationType.SPATIAL_TARGET_Y,
477
+ CoordinationType.SPATIAL_TARGET_Z,
478
+ CoordinationType.SPATIAL_ROTATION_X,
479
+ CoordinationType.SPATIAL_ROTATION_Y,
480
+ CoordinationType.SPATIAL_ROTATION_Z,
481
+ CoordinationType.SPATIAL_ROTATION_ORBIT,
482
+ CoordinationType.SPATIAL_ORBIT_AXIS
483
+ ],
484
+ [ViewType.GENOMIC_PROFILES]: [
485
+ CoordinationType.DATASET,
486
+ CoordinationType.OBS_TYPE,
487
+ CoordinationType.FEATURE_TYPE,
488
+ CoordinationType.FEATURE_VALUE_TYPE,
489
+ CoordinationType.GENOMIC_ZOOM_X,
490
+ CoordinationType.GENOMIC_ZOOM_Y,
491
+ CoordinationType.GENOMIC_TARGET_X,
492
+ CoordinationType.GENOMIC_TARGET_Y,
493
+ CoordinationType.FEATURE_FILTER,
494
+ CoordinationType.FEATURE_HIGHLIGHT,
495
+ CoordinationType.FEATURE_SELECTION,
496
+ CoordinationType.OBS_SET_SELECTION,
497
+ CoordinationType.OBS_SET_HIGHLIGHT,
498
+ CoordinationType.OBS_SET_COLOR,
499
+ CoordinationType.ADDITIONAL_OBS_SETS
500
+ ],
501
+ [ViewType.DESCRIPTION]: [
502
+ CoordinationType.DATASET,
503
+ CoordinationType.SPATIAL_IMAGE_LAYER
504
+ ],
505
+ higlass: [
506
+ CoordinationType.DATASET,
507
+ CoordinationType.GENOMIC_ZOOM_X,
508
+ CoordinationType.GENOMIC_ZOOM_Y,
509
+ CoordinationType.GENOMIC_TARGET_X,
510
+ CoordinationType.GENOMIC_TARGET_Y,
511
+ CoordinationType.FEATURE_FILTER,
512
+ CoordinationType.FEATURE_HIGHLIGHT,
513
+ CoordinationType.FEATURE_SELECTION
514
+ ]
515
+ };
516
+ const note = "This file is regenerated by push-demo.sh.";
517
+ const version = "2.0.3";
518
+ const branch = "release-v2.0.3";
519
+ const date = "2023-02-07";
520
+ const hash = "ca9494c3";
521
+ const version$1 = {
522
+ note,
523
+ version,
524
+ branch,
525
+ date,
526
+ hash
527
+ };
528
+ export {
529
+ AUTO_INDEPENDENT_COORDINATION_TYPES,
530
+ COMPONENT_COORDINATION_TYPES,
531
+ CoordinationType,
532
+ DATA_TYPE_COORDINATION_VALUE_USAGE,
533
+ DEFAULT_COORDINATION_VALUES,
534
+ DataType,
535
+ FILE_TYPE_DATA_TYPE_MAPPING,
536
+ FileType,
537
+ version$1 as META_VERSION,
538
+ STATUS,
539
+ ViewType
540
+ };
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/constants-internal",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -8,17 +8,17 @@
8
8
  "url": "git+https://github.com/vitessce/vitessce.git"
9
9
  },
10
10
  "license": "MIT",
11
- "main": "dist/index.js",
11
+ "main": "dist/index.mjs",
12
12
  "files": [
13
- "dist"
13
+ "dist",
14
+ "src"
14
15
  ],
15
16
  "devDependencies": {
16
17
  "vite": "^3.0.0",
17
18
  "vitest": "^0.23.4"
18
19
  },
19
20
  "scripts": {
20
- "start": "tsc --watch",
21
- "build": "tsc",
21
+ "bundle": "pnpm exec vite build -c ../../scripts/vite.config.js",
22
22
  "test": "pnpm exec vitest --run -r ../../ --dir ."
23
23
  }
24
24
  }
@@ -0,0 +1,85 @@
1
+ import { FileType, DataType, CoordinationType } from './constants';
2
+
3
+ /**
4
+ * Mapping from file types to data types. Each file type
5
+ * should correspond to one data type. Multiple file types
6
+ * can map onto the same data type.
7
+ */
8
+ export const FILE_TYPE_DATA_TYPE_MAPPING = {
9
+ // For new file types
10
+ [FileType.OBS_EMBEDDING_CSV]: DataType.OBS_EMBEDDING,
11
+ [FileType.OBS_LOCATIONS_CSV]: DataType.OBS_LOCATIONS,
12
+ [FileType.OBS_LABELS_CSV]: DataType.OBS_LABELS,
13
+ [FileType.FEATURE_LABELS_CSV]: DataType.FEATURE_LABELS,
14
+ [FileType.OBS_FEATURE_MATRIX_CSV]: DataType.OBS_FEATURE_MATRIX,
15
+ [FileType.OBS_SEGMENTATIONS_JSON]: DataType.OBS_SEGMENTATIONS,
16
+ [FileType.OBS_SETS_CSV]: DataType.OBS_SETS,
17
+ [FileType.OBS_SETS_JSON]: DataType.OBS_SETS,
18
+ [FileType.IMAGE_OME_ZARR]: DataType.IMAGE,
19
+ [FileType.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType.OBS_FEATURE_MATRIX,
20
+ [FileType.OBS_SETS_ANNDATA_ZARR]: DataType.OBS_SETS,
21
+ [FileType.OBS_EMBEDDING_ANNDATA_ZARR]: DataType.OBS_EMBEDDING,
22
+ [FileType.OBS_LOCATIONS_ANNDATA_ZARR]: DataType.OBS_LOCATIONS,
23
+ [FileType.OBS_SEGMENTATIONS_ANNDATA_ZARR]: DataType.OBS_SEGMENTATIONS,
24
+ [FileType.OBS_LABELS_ANNDATA_ZARR]: DataType.OBS_LABELS,
25
+ [FileType.FEATURE_LABELS_ANNDATA_ZARR]: DataType.FEATURE_LABELS,
26
+ [FileType.OBS_FEATURE_MATRIX_MUDATA_ZARR]: DataType.OBS_FEATURE_MATRIX,
27
+ [FileType.OBS_SETS_MUDATA_ZARR]: DataType.OBS_SETS,
28
+ [FileType.OBS_EMBEDDING_MUDATA_ZARR]: DataType.OBS_EMBEDDING,
29
+ [FileType.OBS_LOCATIONS_MUDATA_ZARR]: DataType.OBS_LOCATIONS,
30
+ [FileType.OBS_SEGMENTATIONS_MUDATA_ZARR]: DataType.OBS_SEGMENTATIONS,
31
+ [FileType.OBS_LABELS_MUDATA_ZARR]: DataType.OBS_LABELS,
32
+ [FileType.FEATURE_LABELS_MUDATA_ZARR]: DataType.FEATURE_LABELS,
33
+ // For new file types to support old file types
34
+ [FileType.OBS_EMBEDDING_CELLS_JSON]: DataType.OBS_EMBEDDING,
35
+ [FileType.OBS_LOCATIONS_CELLS_JSON]: DataType.OBS_LOCATIONS,
36
+ [FileType.OBS_SEGMENTATIONS_CELLS_JSON]: DataType.OBS_SEGMENTATIONS,
37
+ [FileType.OBS_LABELS_CELLS_JSON]: DataType.OBS_LABELS,
38
+ [FileType.OBS_SETS_CELL_SETS_JSON]: DataType.OBS_SETS,
39
+ [FileType.OBS_FEATURE_MATRIX_GENES_JSON]: DataType.OBS_FEATURE_MATRIX,
40
+ [FileType.OBS_FEATURE_MATRIX_CLUSTERS_JSON]: DataType.OBS_FEATURE_MATRIX,
41
+ [FileType.OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR]: DataType.OBS_FEATURE_MATRIX,
42
+ [FileType.IMAGE_RASTER_JSON]: DataType.IMAGE,
43
+ [FileType.OBS_SEGMENTATIONS_RASTER_JSON]: DataType.OBS_SEGMENTATIONS,
44
+ [FileType.OBS_LOCATIONS_MOLECULES_JSON]: DataType.OBS_LOCATIONS,
45
+ [FileType.OBS_LABELS_MOLECULES_JSON]: DataType.OBS_LABELS,
46
+ // For old file types
47
+ [FileType.GENOMIC_PROFILES_ZARR]: DataType.GENOMIC_PROFILES,
48
+ [FileType.NEIGHBORHOODS_JSON]: DataType.NEIGHBORHOODS,
49
+ };
50
+
51
+ /**
52
+ * Store a mapping from data types to the coordination types used
53
+ * for matching using the coordinationValues field of file definitions.
54
+ * This enables inferring default values, simplifying view config writing.
55
+ */
56
+ export const DATA_TYPE_COORDINATION_VALUE_USAGE = {
57
+ [DataType.OBS_SEGMENTATIONS]: [
58
+ CoordinationType.OBS_TYPE,
59
+ ],
60
+ [DataType.OBS_EMBEDDING]: [
61
+ CoordinationType.OBS_TYPE,
62
+ CoordinationType.EMBEDDING_TYPE,
63
+ ],
64
+ [DataType.OBS_LOCATIONS]: [
65
+ CoordinationType.OBS_TYPE,
66
+ ],
67
+ [DataType.OBS_LABELS]: [
68
+ CoordinationType.OBS_TYPE,
69
+ CoordinationType.OBS_LABELS_TYPE,
70
+ ],
71
+ [DataType.FEATURE_LABELS]: [
72
+ CoordinationType.FEATURE_TYPE,
73
+ ],
74
+ [DataType.OBS_SETS]: [
75
+ CoordinationType.OBS_TYPE,
76
+ ],
77
+ [DataType.OBS_FEATURE_MATRIX]: [
78
+ CoordinationType.OBS_TYPE,
79
+ CoordinationType.FEATURE_TYPE,
80
+ CoordinationType.FEATURE_VALUE_TYPE,
81
+ ],
82
+ [DataType.GENOMIC_PROFILES]: [],
83
+ [DataType.IMAGE]: [],
84
+ [DataType.NEIGHBORHOODS]: [],
85
+ };
@@ -0,0 +1,14 @@
1
+ import { DataType } from './constants';
2
+ import {
3
+ DATA_TYPE_COORDINATION_VALUE_USAGE,
4
+ } from './constant-relationships';
5
+
6
+ describe('src/app/constant-relationships.js', () => {
7
+ describe('DataType-to-CoordinationType usage mapping', () => {
8
+ it('every data type is mapped to an array of coordination types', () => {
9
+ const dataTypes = Object.values(DataType).sort();
10
+ const mappedDataTypes = Object.keys(DATA_TYPE_COORDINATION_VALUE_USAGE).sort();
11
+ expect(dataTypes.length).toEqual(mappedDataTypes.length);
12
+ });
13
+ });
14
+ });