@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 +540 -0
- package/{dist → dist-tsc}/index.js +0 -0
- package/package.json +5 -5
- package/src/constant-relationships.js +85 -0
- package/src/constant-relationships.test.js +14 -0
- package/src/constants.js +173 -0
- package/src/coordination.js +326 -0
- package/src/index.js +6 -0
- package/src/version.json +7 -0
- package/dist/constant-relationships.js +0 -76
- package/dist/constant-relationships.test.js +0 -11
- package/dist/constants.js +0 -159
- package/dist/coordination.js +0 -323
- package/dist/version.json +0 -7
package/src/constants.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file defines the current constant values.
|
|
3
|
+
* To deprecate a value, add it to ./constants-old.js
|
|
4
|
+
* with a corresponding log message.
|
|
5
|
+
*/
|
|
6
|
+
export const ViewType = {
|
|
7
|
+
DESCRIPTION: 'description',
|
|
8
|
+
STATUS: 'status',
|
|
9
|
+
SCATTERPLOT: 'scatterplot',
|
|
10
|
+
SPATIAL: 'spatial',
|
|
11
|
+
HEATMAP: 'heatmap',
|
|
12
|
+
LAYER_CONTROLLER: 'layerController',
|
|
13
|
+
GENOMIC_PROFILES: 'genomicProfiles',
|
|
14
|
+
GATING: 'gating',
|
|
15
|
+
FEATURE_LIST: 'featureList',
|
|
16
|
+
OBS_SETS: 'obsSets',
|
|
17
|
+
OBS_SET_SIZES: 'obsSetSizes',
|
|
18
|
+
OBS_SET_FEATURE_VALUE_DISTRIBUTION: 'obsSetFeatureValueDistribution',
|
|
19
|
+
FEATURE_VALUE_HISTOGRAM: 'featureValueHistogram',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const DataType = {
|
|
23
|
+
OBS_LABELS: 'obsLabels',
|
|
24
|
+
OBS_EMBEDDING: 'obsEmbedding',
|
|
25
|
+
OBS_LOCATIONS: 'obsLocations',
|
|
26
|
+
OBS_FEATURE_MATRIX: 'obsFeatureMatrix',
|
|
27
|
+
OBS_SETS: 'obsSets',
|
|
28
|
+
FEATURE_LABELS: 'featureLabels',
|
|
29
|
+
IMAGE: 'image',
|
|
30
|
+
OBS_SEGMENTATIONS: 'obsSegmentations',
|
|
31
|
+
NEIGHBORHOODS: 'neighborhoods',
|
|
32
|
+
GENOMIC_PROFILES: 'genomic-profiles',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export const FileType = {
|
|
37
|
+
// Joint file types
|
|
38
|
+
ANNDATA_ZARR: 'anndata.zarr',
|
|
39
|
+
// Atomic file types
|
|
40
|
+
OBS_EMBEDDING_CSV: 'obsEmbedding.csv',
|
|
41
|
+
OBS_LOCATIONS_CSV: 'obsLocations.csv',
|
|
42
|
+
OBS_LABELS_CSV: 'obsLabels.csv',
|
|
43
|
+
FEATURE_LABELS_CSV: 'featureLabels.csv',
|
|
44
|
+
OBS_FEATURE_MATRIX_CSV: 'obsFeatureMatrix.csv',
|
|
45
|
+
OBS_SEGMENTATIONS_JSON: 'obsSegmentations.json',
|
|
46
|
+
OBS_SETS_CSV: 'obsSets.csv',
|
|
47
|
+
OBS_SETS_JSON: 'obsSets.json',
|
|
48
|
+
IMAGE_OME_ZARR: 'image.ome-zarr',
|
|
49
|
+
// AnnData
|
|
50
|
+
OBS_FEATURE_MATRIX_ANNDATA_ZARR: 'obsFeatureMatrix.anndata.zarr',
|
|
51
|
+
OBS_SETS_ANNDATA_ZARR: 'obsSets.anndata.zarr',
|
|
52
|
+
OBS_EMBEDDING_ANNDATA_ZARR: 'obsEmbedding.anndata.zarr',
|
|
53
|
+
OBS_LOCATIONS_ANNDATA_ZARR: 'obsLocations.anndata.zarr',
|
|
54
|
+
OBS_SEGMENTATIONS_ANNDATA_ZARR: 'obsSegmentations.anndata.zarr',
|
|
55
|
+
OBS_LABELS_ANNDATA_ZARR: 'obsLabels.anndata.zarr',
|
|
56
|
+
FEATURE_LABELS_ANNDATA_ZARR: 'featureLabels.anndata.zarr',
|
|
57
|
+
// MuData
|
|
58
|
+
OBS_FEATURE_MATRIX_MUDATA_ZARR: 'obsFeatureMatrix.mudata.zarr',
|
|
59
|
+
OBS_SETS_MUDATA_ZARR: 'obsSets.mudata.zarr',
|
|
60
|
+
OBS_EMBEDDING_MUDATA_ZARR: 'obsEmbedding.mudata.zarr',
|
|
61
|
+
OBS_LOCATIONS_MUDATA_ZARR: 'obsLocations.mudata.zarr',
|
|
62
|
+
OBS_SEGMENTATIONS_MUDATA_ZARR: 'obsSegmentations.mudata.zarr',
|
|
63
|
+
OBS_LABELS_MUDATA_ZARR: 'obsLabels.mudata.zarr',
|
|
64
|
+
FEATURE_LABELS_MUDATA_ZARR: 'featureLabels.mudata.zarr',
|
|
65
|
+
GENOMIC_PROFILES_ZARR: 'genomic-profiles.zarr',
|
|
66
|
+
NEIGHBORHOODS_JSON: 'neighborhoods.json',
|
|
67
|
+
// New file types to support old file types:
|
|
68
|
+
// - cells.json
|
|
69
|
+
OBS_EMBEDDING_CELLS_JSON: 'obsEmbedding.cells.json',
|
|
70
|
+
OBS_SEGMENTATIONS_CELLS_JSON: 'obsSegmentations.cells.json',
|
|
71
|
+
OBS_LOCATIONS_CELLS_JSON: 'obsLocations.cells.json',
|
|
72
|
+
OBS_LABELS_CELLS_JSON: 'obsLabels.cells.json',
|
|
73
|
+
// - cell-sets.json
|
|
74
|
+
OBS_SETS_CELL_SETS_JSON: 'obsSets.cell-sets.json',
|
|
75
|
+
// - genes.json
|
|
76
|
+
OBS_FEATURE_MATRIX_GENES_JSON: 'obsFeatureMatrix.genes.json',
|
|
77
|
+
// - clusters.json
|
|
78
|
+
OBS_FEATURE_MATRIX_CLUSTERS_JSON: 'obsFeatureMatrix.clusters.json',
|
|
79
|
+
// - expression-matrix.zarr
|
|
80
|
+
OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR: 'obsFeatureMatrix.expression-matrix.zarr',
|
|
81
|
+
// - raster.json
|
|
82
|
+
IMAGE_RASTER_JSON: 'image.raster.json',
|
|
83
|
+
OBS_SEGMENTATIONS_RASTER_JSON: 'obsSegmentations.raster.json',
|
|
84
|
+
// - molecules.json
|
|
85
|
+
OBS_LOCATIONS_MOLECULES_JSON: 'obsLocations.molecules.json',
|
|
86
|
+
OBS_LABELS_MOLECULES_JSON: 'obsLabels.molecules.json',
|
|
87
|
+
// Legacy joint file types
|
|
88
|
+
CELLS_JSON: 'cells.json',
|
|
89
|
+
CELL_SETS_JSON: 'cell-sets.json',
|
|
90
|
+
ANNDATA_CELL_SETS_ZARR: 'anndata-cell-sets.zarr',
|
|
91
|
+
ANNDATA_CELLS_ZARR: 'anndata-cells.zarr',
|
|
92
|
+
EXPRESSION_MATRIX_ZARR: 'expression-matrix.zarr',
|
|
93
|
+
MOLECULES_JSON: 'molecules.json',
|
|
94
|
+
RASTER_JSON: 'raster.json',
|
|
95
|
+
RASTER_OME_ZARR: 'raster.ome-zarr',
|
|
96
|
+
CLUSTERS_JSON: 'clusters.json',
|
|
97
|
+
GENES_JSON: 'genes.json',
|
|
98
|
+
ANNDATA_EXPRESSION_MATRIX_ZARR: 'anndata-expression-matrix.zarr',
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Constants representing names of coordination types,
|
|
103
|
+
* to help prevent typos.
|
|
104
|
+
*/
|
|
105
|
+
export const CoordinationType = {
|
|
106
|
+
DATASET: 'dataset',
|
|
107
|
+
// Entity types
|
|
108
|
+
OBS_TYPE: 'obsType',
|
|
109
|
+
FEATURE_TYPE: 'featureType',
|
|
110
|
+
FEATURE_VALUE_TYPE: 'featureValueType',
|
|
111
|
+
OBS_LABELS_TYPE: 'obsLabelsType',
|
|
112
|
+
// Other types
|
|
113
|
+
EMBEDDING_TYPE: 'embeddingType',
|
|
114
|
+
EMBEDDING_ZOOM: 'embeddingZoom',
|
|
115
|
+
EMBEDDING_ROTATION: 'embeddingRotation',
|
|
116
|
+
EMBEDDING_TARGET_X: 'embeddingTargetX',
|
|
117
|
+
EMBEDDING_TARGET_Y: 'embeddingTargetY',
|
|
118
|
+
EMBEDDING_TARGET_Z: 'embeddingTargetZ',
|
|
119
|
+
EMBEDDING_OBS_SET_POLYGONS_VISIBLE: 'embeddingObsSetPolygonsVisible',
|
|
120
|
+
EMBEDDING_OBS_SET_LABELS_VISIBLE: 'embeddingObsSetLabelsVisible',
|
|
121
|
+
EMBEDDING_OBS_SET_LABEL_SIZE: 'embeddingObsSetLabelSize',
|
|
122
|
+
EMBEDDING_OBS_RADIUS: 'embeddingObsRadius',
|
|
123
|
+
EMBEDDING_OBS_RADIUS_MODE: 'embeddingObsRadiusMode',
|
|
124
|
+
EMBEDDING_OBS_OPACITY: 'embeddingObsOpacity',
|
|
125
|
+
EMBEDDING_OBS_OPACITY_MODE: 'embeddingObsOpacityMode',
|
|
126
|
+
SPATIAL_ZOOM: 'spatialZoom',
|
|
127
|
+
SPATIAL_ROTATION: 'spatialRotation',
|
|
128
|
+
SPATIAL_TARGET_X: 'spatialTargetX',
|
|
129
|
+
SPATIAL_TARGET_Y: 'spatialTargetY',
|
|
130
|
+
SPATIAL_TARGET_Z: 'spatialTargetZ',
|
|
131
|
+
SPATIAL_ROTATION_X: 'spatialRotationX',
|
|
132
|
+
SPATIAL_ROTATION_Y: 'spatialRotationY',
|
|
133
|
+
SPATIAL_ROTATION_Z: 'spatialRotationZ',
|
|
134
|
+
SPATIAL_ROTATION_ORBIT: 'spatialRotationOrbit',
|
|
135
|
+
SPATIAL_ORBIT_AXIS: 'spatialOrbitAxis',
|
|
136
|
+
SPATIAL_AXIS_FIXED: 'spatialAxisFixed',
|
|
137
|
+
HEATMAP_ZOOM_X: 'heatmapZoomX',
|
|
138
|
+
HEATMAP_ZOOM_Y: 'heatmapZoomY',
|
|
139
|
+
HEATMAP_TARGET_X: 'heatmapTargetX',
|
|
140
|
+
HEATMAP_TARGET_Y: 'heatmapTargetY',
|
|
141
|
+
OBS_FILTER: 'obsFilter',
|
|
142
|
+
OBS_HIGHLIGHT: 'obsHighlight',
|
|
143
|
+
OBS_SET_SELECTION: 'obsSetSelection',
|
|
144
|
+
OBS_SET_HIGHLIGHT: 'obsSetHighlight',
|
|
145
|
+
OBS_SET_COLOR: 'obsSetColor',
|
|
146
|
+
FEATURE_FILTER: 'featureFilter',
|
|
147
|
+
FEATURE_HIGHLIGHT: 'featureHighlight',
|
|
148
|
+
FEATURE_SELECTION: 'featureSelection',
|
|
149
|
+
FEATURE_VALUE_COLORMAP: 'featureValueColormap',
|
|
150
|
+
FEATURE_VALUE_TRANSFORM: 'featureValueTransform',
|
|
151
|
+
FEATURE_VALUE_COLORMAP_RANGE: 'featureValueColormapRange',
|
|
152
|
+
OBS_COLOR_ENCODING: 'obsColorEncoding',
|
|
153
|
+
SPATIAL_IMAGE_LAYER: 'spatialImageLayer',
|
|
154
|
+
SPATIAL_SEGMENTATION_LAYER: 'spatialSegmentationLayer',
|
|
155
|
+
SPATIAL_POINT_LAYER: 'spatialPointLayer',
|
|
156
|
+
SPATIAL_NEIGHBORHOOD_LAYER: 'spatialNeighborhoodLayer',
|
|
157
|
+
GENOMIC_ZOOM_X: 'genomicZoomX',
|
|
158
|
+
GENOMIC_ZOOM_Y: 'genomicZoomY',
|
|
159
|
+
GENOMIC_TARGET_X: 'genomicTargetX',
|
|
160
|
+
GENOMIC_TARGET_Y: 'genomicTargetY',
|
|
161
|
+
ADDITIONAL_OBS_SETS: 'additionalObsSets',
|
|
162
|
+
// TODO: use obsHighlight rather than moleculeHighlight.
|
|
163
|
+
MOLECULE_HIGHLIGHT: 'moleculeHighlight',
|
|
164
|
+
GATING_FEATURE_SELECTION_X: 'gatingFeatureSelectionX',
|
|
165
|
+
GATING_FEATURE_SELECTION_Y: 'gatingFeatureSelectionY',
|
|
166
|
+
FEATURE_VALUE_TRANSFORM_COEFFICIENT: 'featureValueTransformCoefficient',
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const STATUS = {
|
|
170
|
+
LOADING: 'loading',
|
|
171
|
+
SUCCESS: 'success',
|
|
172
|
+
ERROR: 'error',
|
|
173
|
+
};
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { CoordinationType, ViewType } from './constants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Coordination types may have default values,
|
|
5
|
+
* which can be defined here, and used by the
|
|
6
|
+
* auto initialization strategy.
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_COORDINATION_VALUES = {
|
|
9
|
+
[CoordinationType.OBS_TYPE]: 'cell',
|
|
10
|
+
[CoordinationType.FEATURE_TYPE]: 'gene',
|
|
11
|
+
[CoordinationType.FEATURE_VALUE_TYPE]: 'expression',
|
|
12
|
+
[CoordinationType.OBS_LABELS_TYPE]: null,
|
|
13
|
+
[CoordinationType.EMBEDDING_ZOOM]: null,
|
|
14
|
+
[CoordinationType.EMBEDDING_ROTATION]: 0,
|
|
15
|
+
[CoordinationType.EMBEDDING_TARGET_X]: null,
|
|
16
|
+
[CoordinationType.EMBEDDING_TARGET_Y]: null,
|
|
17
|
+
[CoordinationType.EMBEDDING_TARGET_Z]: 0,
|
|
18
|
+
[CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE]: false,
|
|
19
|
+
[CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE]: false,
|
|
20
|
+
[CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE]: 14,
|
|
21
|
+
[CoordinationType.EMBEDDING_OBS_RADIUS]: 1,
|
|
22
|
+
[CoordinationType.EMBEDDING_OBS_RADIUS_MODE]: 'auto',
|
|
23
|
+
[CoordinationType.EMBEDDING_OBS_OPACITY]: 1,
|
|
24
|
+
[CoordinationType.EMBEDDING_OBS_OPACITY_MODE]: 'auto',
|
|
25
|
+
[CoordinationType.SPATIAL_ZOOM]: null,
|
|
26
|
+
[CoordinationType.SPATIAL_ROTATION]: 0,
|
|
27
|
+
[CoordinationType.SPATIAL_TARGET_X]: null,
|
|
28
|
+
[CoordinationType.SPATIAL_TARGET_Y]: null,
|
|
29
|
+
[CoordinationType.SPATIAL_TARGET_Z]: null,
|
|
30
|
+
[CoordinationType.SPATIAL_ROTATION_X]: null,
|
|
31
|
+
[CoordinationType.SPATIAL_ROTATION_Y]: null,
|
|
32
|
+
[CoordinationType.SPATIAL_ROTATION_Z]: null,
|
|
33
|
+
[CoordinationType.SPATIAL_AXIS_FIXED]: false,
|
|
34
|
+
[CoordinationType.SPATIAL_ROTATION_ORBIT]: 0,
|
|
35
|
+
[CoordinationType.SPATIAL_ORBIT_AXIS]: 'Y',
|
|
36
|
+
[CoordinationType.SPATIAL_IMAGE_LAYER]: null,
|
|
37
|
+
[CoordinationType.SPATIAL_SEGMENTATION_LAYER]: null,
|
|
38
|
+
[CoordinationType.SPATIAL_POINT_LAYER]: null,
|
|
39
|
+
[CoordinationType.SPATIAL_NEIGHBORHOOD_LAYER]: null,
|
|
40
|
+
[CoordinationType.HEATMAP_ZOOM_X]: 0,
|
|
41
|
+
[CoordinationType.HEATMAP_ZOOM_Y]: 0,
|
|
42
|
+
[CoordinationType.HEATMAP_TARGET_X]: 0,
|
|
43
|
+
[CoordinationType.HEATMAP_TARGET_Y]: 0,
|
|
44
|
+
[CoordinationType.FEATURE_VALUE_COLORMAP]: 'plasma',
|
|
45
|
+
[CoordinationType.FEATURE_VALUE_COLORMAP_RANGE]: [0.0, 1.0],
|
|
46
|
+
[CoordinationType.FEATURE_VALUE_TRANSFORM]: null,
|
|
47
|
+
[CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT]: 1,
|
|
48
|
+
[CoordinationType.FEATURE_FILTER]: null,
|
|
49
|
+
[CoordinationType.FEATURE_HIGHLIGHT]: null,
|
|
50
|
+
[CoordinationType.FEATURE_SELECTION]: null,
|
|
51
|
+
[CoordinationType.OBS_FILTER]: null,
|
|
52
|
+
[CoordinationType.OBS_HIGHLIGHT]: null,
|
|
53
|
+
[CoordinationType.OBS_SET_SELECTION]: null,
|
|
54
|
+
[CoordinationType.OBS_SET_HIGHLIGHT]: null,
|
|
55
|
+
[CoordinationType.OBS_SET_COLOR]: null,
|
|
56
|
+
[CoordinationType.OBS_COLOR_ENCODING]: 'cellSetSelection',
|
|
57
|
+
[CoordinationType.GENOMIC_ZOOM_X]: 0,
|
|
58
|
+
[CoordinationType.GENOMIC_ZOOM_Y]: 0,
|
|
59
|
+
[CoordinationType.GENOMIC_TARGET_X]: 1549999999.5,
|
|
60
|
+
[CoordinationType.GENOMIC_TARGET_Y]: 1549999999.5,
|
|
61
|
+
[CoordinationType.ADDITIONAL_OBS_SETS]: null,
|
|
62
|
+
[CoordinationType.MOLECULE_HIGHLIGHT]: null,
|
|
63
|
+
[CoordinationType.GATING_FEATURE_SELECTION_X]: null,
|
|
64
|
+
[CoordinationType.GATING_FEATURE_SELECTION_Y]: null,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// The following coordination types should be
|
|
68
|
+
// initialized to independent scopes when
|
|
69
|
+
// initialized automatically.
|
|
70
|
+
// These make the resulting view config
|
|
71
|
+
// (after auto-initialization) behave
|
|
72
|
+
// like "legacy" Vitessce (pre-coordination model).
|
|
73
|
+
export const AUTO_INDEPENDENT_COORDINATION_TYPES = [
|
|
74
|
+
CoordinationType.HEATMAP_ZOOM_X,
|
|
75
|
+
CoordinationType.HEATMAP_ZOOM_Y,
|
|
76
|
+
CoordinationType.HEATMAP_TARGET_X,
|
|
77
|
+
CoordinationType.HEATMAP_TARGET_Y,
|
|
78
|
+
CoordinationType.EMBEDDING_ZOOM,
|
|
79
|
+
CoordinationType.EMBEDDING_TARGET_X,
|
|
80
|
+
CoordinationType.EMBEDDING_TARGET_Y,
|
|
81
|
+
CoordinationType.EMBEDDING_TARGET_Z,
|
|
82
|
+
CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
|
|
83
|
+
CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE,
|
|
84
|
+
CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE,
|
|
85
|
+
CoordinationType.EMBEDDING_OBS_RADIUS,
|
|
86
|
+
CoordinationType.EMBEDDING_OBS_OPACITY,
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Mapping from component type to
|
|
91
|
+
* supported coordination object types.
|
|
92
|
+
* This mapping can be used to determine
|
|
93
|
+
* which pieces of state that a component will
|
|
94
|
+
* need to get/set.
|
|
95
|
+
* Keys here are the component registry keys.
|
|
96
|
+
*/
|
|
97
|
+
export const COMPONENT_COORDINATION_TYPES = {
|
|
98
|
+
[ViewType.SCATTERPLOT]: [
|
|
99
|
+
CoordinationType.DATASET,
|
|
100
|
+
CoordinationType.OBS_TYPE,
|
|
101
|
+
CoordinationType.FEATURE_TYPE,
|
|
102
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
103
|
+
CoordinationType.OBS_LABELS_TYPE,
|
|
104
|
+
CoordinationType.EMBEDDING_TYPE,
|
|
105
|
+
CoordinationType.EMBEDDING_ZOOM,
|
|
106
|
+
CoordinationType.EMBEDDING_ROTATION,
|
|
107
|
+
CoordinationType.EMBEDDING_TARGET_X,
|
|
108
|
+
CoordinationType.EMBEDDING_TARGET_Y,
|
|
109
|
+
CoordinationType.EMBEDDING_TARGET_Z,
|
|
110
|
+
CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
|
|
111
|
+
CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE,
|
|
112
|
+
CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE,
|
|
113
|
+
CoordinationType.EMBEDDING_OBS_RADIUS,
|
|
114
|
+
CoordinationType.EMBEDDING_OBS_RADIUS_MODE,
|
|
115
|
+
CoordinationType.EMBEDDING_OBS_OPACITY,
|
|
116
|
+
CoordinationType.EMBEDDING_OBS_OPACITY_MODE,
|
|
117
|
+
CoordinationType.OBS_FILTER,
|
|
118
|
+
CoordinationType.OBS_HIGHLIGHT,
|
|
119
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
120
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
121
|
+
CoordinationType.OBS_SET_COLOR,
|
|
122
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
123
|
+
CoordinationType.FEATURE_SELECTION,
|
|
124
|
+
CoordinationType.FEATURE_VALUE_COLORMAP,
|
|
125
|
+
CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
|
|
126
|
+
CoordinationType.OBS_COLOR_ENCODING,
|
|
127
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
128
|
+
],
|
|
129
|
+
[ViewType.GATING]: [
|
|
130
|
+
CoordinationType.DATASET,
|
|
131
|
+
CoordinationType.OBS_TYPE,
|
|
132
|
+
CoordinationType.FEATURE_TYPE,
|
|
133
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
134
|
+
CoordinationType.EMBEDDING_TYPE,
|
|
135
|
+
CoordinationType.EMBEDDING_ZOOM,
|
|
136
|
+
CoordinationType.EMBEDDING_ROTATION,
|
|
137
|
+
CoordinationType.EMBEDDING_TARGET_X,
|
|
138
|
+
CoordinationType.EMBEDDING_TARGET_Y,
|
|
139
|
+
CoordinationType.EMBEDDING_TARGET_Z,
|
|
140
|
+
CoordinationType.EMBEDDING_OBS_SET_POLYGONS_VISIBLE,
|
|
141
|
+
CoordinationType.EMBEDDING_OBS_SET_LABELS_VISIBLE,
|
|
142
|
+
CoordinationType.EMBEDDING_OBS_SET_LABEL_SIZE,
|
|
143
|
+
CoordinationType.EMBEDDING_OBS_RADIUS,
|
|
144
|
+
CoordinationType.EMBEDDING_OBS_RADIUS_MODE,
|
|
145
|
+
CoordinationType.EMBEDDING_OBS_OPACITY,
|
|
146
|
+
CoordinationType.EMBEDDING_OBS_OPACITY_MODE,
|
|
147
|
+
CoordinationType.OBS_FILTER,
|
|
148
|
+
CoordinationType.OBS_HIGHLIGHT,
|
|
149
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
150
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
151
|
+
CoordinationType.OBS_SET_COLOR,
|
|
152
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
153
|
+
CoordinationType.FEATURE_SELECTION,
|
|
154
|
+
CoordinationType.FEATURE_VALUE_COLORMAP,
|
|
155
|
+
CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
|
|
156
|
+
CoordinationType.OBS_COLOR_ENCODING,
|
|
157
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
158
|
+
CoordinationType.FEATURE_VALUE_TRANSFORM,
|
|
159
|
+
CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
|
|
160
|
+
CoordinationType.GATING_FEATURE_SELECTION_X,
|
|
161
|
+
CoordinationType.GATING_FEATURE_SELECTION_Y,
|
|
162
|
+
],
|
|
163
|
+
[ViewType.SPATIAL]: [
|
|
164
|
+
CoordinationType.DATASET,
|
|
165
|
+
CoordinationType.OBS_TYPE,
|
|
166
|
+
CoordinationType.OBS_LABELS_TYPE,
|
|
167
|
+
CoordinationType.FEATURE_TYPE,
|
|
168
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
169
|
+
CoordinationType.SPATIAL_ZOOM,
|
|
170
|
+
CoordinationType.SPATIAL_ROTATION,
|
|
171
|
+
CoordinationType.SPATIAL_IMAGE_LAYER,
|
|
172
|
+
CoordinationType.SPATIAL_SEGMENTATION_LAYER,
|
|
173
|
+
CoordinationType.SPATIAL_POINT_LAYER,
|
|
174
|
+
CoordinationType.SPATIAL_NEIGHBORHOOD_LAYER,
|
|
175
|
+
CoordinationType.SPATIAL_TARGET_X,
|
|
176
|
+
CoordinationType.SPATIAL_TARGET_Y,
|
|
177
|
+
CoordinationType.SPATIAL_TARGET_Z,
|
|
178
|
+
CoordinationType.SPATIAL_ROTATION_X,
|
|
179
|
+
CoordinationType.SPATIAL_ROTATION_Y,
|
|
180
|
+
CoordinationType.SPATIAL_ROTATION_Z,
|
|
181
|
+
CoordinationType.SPATIAL_ROTATION_ORBIT,
|
|
182
|
+
CoordinationType.SPATIAL_ORBIT_AXIS,
|
|
183
|
+
CoordinationType.SPATIAL_AXIS_FIXED,
|
|
184
|
+
CoordinationType.OBS_FILTER,
|
|
185
|
+
CoordinationType.OBS_HIGHLIGHT,
|
|
186
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
187
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
188
|
+
CoordinationType.OBS_SET_COLOR,
|
|
189
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
190
|
+
CoordinationType.FEATURE_SELECTION,
|
|
191
|
+
CoordinationType.FEATURE_VALUE_COLORMAP,
|
|
192
|
+
CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
|
|
193
|
+
CoordinationType.OBS_COLOR_ENCODING,
|
|
194
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
195
|
+
CoordinationType.MOLECULE_HIGHLIGHT,
|
|
196
|
+
],
|
|
197
|
+
[ViewType.HEATMAP]: [
|
|
198
|
+
CoordinationType.DATASET,
|
|
199
|
+
CoordinationType.OBS_TYPE,
|
|
200
|
+
CoordinationType.OBS_LABELS_TYPE,
|
|
201
|
+
CoordinationType.FEATURE_TYPE,
|
|
202
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
203
|
+
CoordinationType.HEATMAP_ZOOM_X,
|
|
204
|
+
CoordinationType.HEATMAP_ZOOM_Y,
|
|
205
|
+
CoordinationType.HEATMAP_TARGET_X,
|
|
206
|
+
CoordinationType.HEATMAP_TARGET_Y,
|
|
207
|
+
CoordinationType.OBS_FILTER,
|
|
208
|
+
CoordinationType.OBS_HIGHLIGHT,
|
|
209
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
210
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
211
|
+
CoordinationType.OBS_SET_COLOR,
|
|
212
|
+
CoordinationType.FEATURE_FILTER,
|
|
213
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
214
|
+
CoordinationType.FEATURE_SELECTION,
|
|
215
|
+
CoordinationType.FEATURE_VALUE_COLORMAP,
|
|
216
|
+
CoordinationType.FEATURE_VALUE_COLORMAP_RANGE,
|
|
217
|
+
CoordinationType.OBS_COLOR_ENCODING,
|
|
218
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
219
|
+
],
|
|
220
|
+
[ViewType.OBS_SETS]: [
|
|
221
|
+
CoordinationType.DATASET,
|
|
222
|
+
CoordinationType.OBS_TYPE,
|
|
223
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
224
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
225
|
+
CoordinationType.OBS_SET_COLOR,
|
|
226
|
+
CoordinationType.OBS_COLOR_ENCODING,
|
|
227
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
228
|
+
CoordinationType.FEATURE_SELECTION,
|
|
229
|
+
],
|
|
230
|
+
[ViewType.OBS_SET_SIZES]: [
|
|
231
|
+
CoordinationType.DATASET,
|
|
232
|
+
CoordinationType.OBS_TYPE,
|
|
233
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
234
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
235
|
+
CoordinationType.OBS_SET_COLOR,
|
|
236
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
237
|
+
],
|
|
238
|
+
[ViewType.STATUS]: [
|
|
239
|
+
CoordinationType.DATASET,
|
|
240
|
+
CoordinationType.OBS_HIGHLIGHT,
|
|
241
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
242
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
243
|
+
CoordinationType.MOLECULE_HIGHLIGHT,
|
|
244
|
+
],
|
|
245
|
+
[ViewType.FEATURE_LIST]: [
|
|
246
|
+
CoordinationType.DATASET,
|
|
247
|
+
CoordinationType.OBS_TYPE,
|
|
248
|
+
CoordinationType.FEATURE_TYPE,
|
|
249
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
250
|
+
CoordinationType.FEATURE_FILTER,
|
|
251
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
252
|
+
CoordinationType.FEATURE_SELECTION,
|
|
253
|
+
CoordinationType.OBS_COLOR_ENCODING,
|
|
254
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
255
|
+
],
|
|
256
|
+
[ViewType.OBS_SET_FEATURE_VALUE_DISTRIBUTION]: [
|
|
257
|
+
CoordinationType.DATASET,
|
|
258
|
+
CoordinationType.OBS_TYPE,
|
|
259
|
+
CoordinationType.FEATURE_TYPE,
|
|
260
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
261
|
+
CoordinationType.FEATURE_SELECTION,
|
|
262
|
+
CoordinationType.FEATURE_VALUE_TRANSFORM,
|
|
263
|
+
CoordinationType.FEATURE_VALUE_TRANSFORM_COEFFICIENT,
|
|
264
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
265
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
266
|
+
CoordinationType.OBS_SET_COLOR,
|
|
267
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
268
|
+
],
|
|
269
|
+
[ViewType.FEATURE_VALUE_HISTOGRAM]: [
|
|
270
|
+
CoordinationType.DATASET,
|
|
271
|
+
CoordinationType.OBS_TYPE,
|
|
272
|
+
CoordinationType.FEATURE_TYPE,
|
|
273
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
274
|
+
CoordinationType.FEATURE_SELECTION,
|
|
275
|
+
],
|
|
276
|
+
[ViewType.LAYER_CONTROLLER]: [
|
|
277
|
+
CoordinationType.DATASET,
|
|
278
|
+
CoordinationType.OBS_TYPE,
|
|
279
|
+
CoordinationType.FEATURE_TYPE,
|
|
280
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
281
|
+
CoordinationType.SPATIAL_IMAGE_LAYER,
|
|
282
|
+
CoordinationType.SPATIAL_SEGMENTATION_LAYER,
|
|
283
|
+
CoordinationType.SPATIAL_POINT_LAYER,
|
|
284
|
+
CoordinationType.SPATIAL_NEIGHBORHOOD_LAYER,
|
|
285
|
+
CoordinationType.SPATIAL_ZOOM,
|
|
286
|
+
CoordinationType.SPATIAL_TARGET_X,
|
|
287
|
+
CoordinationType.SPATIAL_TARGET_Y,
|
|
288
|
+
CoordinationType.SPATIAL_TARGET_Z,
|
|
289
|
+
CoordinationType.SPATIAL_ROTATION_X,
|
|
290
|
+
CoordinationType.SPATIAL_ROTATION_Y,
|
|
291
|
+
CoordinationType.SPATIAL_ROTATION_Z,
|
|
292
|
+
CoordinationType.SPATIAL_ROTATION_ORBIT,
|
|
293
|
+
CoordinationType.SPATIAL_ORBIT_AXIS,
|
|
294
|
+
],
|
|
295
|
+
[ViewType.GENOMIC_PROFILES]: [
|
|
296
|
+
CoordinationType.DATASET,
|
|
297
|
+
CoordinationType.OBS_TYPE,
|
|
298
|
+
CoordinationType.FEATURE_TYPE,
|
|
299
|
+
CoordinationType.FEATURE_VALUE_TYPE,
|
|
300
|
+
CoordinationType.GENOMIC_ZOOM_X,
|
|
301
|
+
CoordinationType.GENOMIC_ZOOM_Y,
|
|
302
|
+
CoordinationType.GENOMIC_TARGET_X,
|
|
303
|
+
CoordinationType.GENOMIC_TARGET_Y,
|
|
304
|
+
CoordinationType.FEATURE_FILTER,
|
|
305
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
306
|
+
CoordinationType.FEATURE_SELECTION,
|
|
307
|
+
CoordinationType.OBS_SET_SELECTION,
|
|
308
|
+
CoordinationType.OBS_SET_HIGHLIGHT,
|
|
309
|
+
CoordinationType.OBS_SET_COLOR,
|
|
310
|
+
CoordinationType.ADDITIONAL_OBS_SETS,
|
|
311
|
+
],
|
|
312
|
+
[ViewType.DESCRIPTION]: [
|
|
313
|
+
CoordinationType.DATASET,
|
|
314
|
+
CoordinationType.SPATIAL_IMAGE_LAYER,
|
|
315
|
+
],
|
|
316
|
+
higlass: [
|
|
317
|
+
CoordinationType.DATASET,
|
|
318
|
+
CoordinationType.GENOMIC_ZOOM_X,
|
|
319
|
+
CoordinationType.GENOMIC_ZOOM_Y,
|
|
320
|
+
CoordinationType.GENOMIC_TARGET_X,
|
|
321
|
+
CoordinationType.GENOMIC_TARGET_Y,
|
|
322
|
+
CoordinationType.FEATURE_FILTER,
|
|
323
|
+
CoordinationType.FEATURE_HIGHLIGHT,
|
|
324
|
+
CoordinationType.FEATURE_SELECTION,
|
|
325
|
+
],
|
|
326
|
+
};
|
package/src/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ViewType, DataType, FileType, CoordinationType, STATUS,
|
|
3
|
+
} from './constants';
|
|
4
|
+
export { FILE_TYPE_DATA_TYPE_MAPPING, DATA_TYPE_COORDINATION_VALUE_USAGE } from './constant-relationships';
|
|
5
|
+
export { DEFAULT_COORDINATION_VALUES, AUTO_INDEPENDENT_COORDINATION_TYPES, COMPONENT_COORDINATION_TYPES } from './coordination';
|
|
6
|
+
export { default as META_VERSION } from './version.json';
|
package/src/version.json
ADDED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { FileType, DataType, CoordinationType } from './constants';
|
|
2
|
-
/**
|
|
3
|
-
* Mapping from file types to data types. Each file type
|
|
4
|
-
* should correspond to one data type. Multiple file types
|
|
5
|
-
* can map onto the same data type.
|
|
6
|
-
*/
|
|
7
|
-
export const FILE_TYPE_DATA_TYPE_MAPPING = {
|
|
8
|
-
// For new file types
|
|
9
|
-
[FileType.OBS_EMBEDDING_CSV]: DataType.OBS_EMBEDDING,
|
|
10
|
-
[FileType.OBS_LOCATIONS_CSV]: DataType.OBS_LOCATIONS,
|
|
11
|
-
[FileType.OBS_LABELS_CSV]: DataType.OBS_LABELS,
|
|
12
|
-
[FileType.FEATURE_LABELS_CSV]: DataType.FEATURE_LABELS,
|
|
13
|
-
[FileType.OBS_FEATURE_MATRIX_CSV]: DataType.OBS_FEATURE_MATRIX,
|
|
14
|
-
[FileType.OBS_SEGMENTATIONS_JSON]: DataType.OBS_SEGMENTATIONS,
|
|
15
|
-
[FileType.OBS_SETS_CSV]: DataType.OBS_SETS,
|
|
16
|
-
[FileType.OBS_SETS_JSON]: DataType.OBS_SETS,
|
|
17
|
-
[FileType.IMAGE_OME_ZARR]: DataType.IMAGE,
|
|
18
|
-
[FileType.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType.OBS_FEATURE_MATRIX,
|
|
19
|
-
[FileType.OBS_SETS_ANNDATA_ZARR]: DataType.OBS_SETS,
|
|
20
|
-
[FileType.OBS_EMBEDDING_ANNDATA_ZARR]: DataType.OBS_EMBEDDING,
|
|
21
|
-
[FileType.OBS_LOCATIONS_ANNDATA_ZARR]: DataType.OBS_LOCATIONS,
|
|
22
|
-
[FileType.OBS_SEGMENTATIONS_ANNDATA_ZARR]: DataType.OBS_SEGMENTATIONS,
|
|
23
|
-
[FileType.OBS_LABELS_ANNDATA_ZARR]: DataType.OBS_LABELS,
|
|
24
|
-
[FileType.FEATURE_LABELS_ANNDATA_ZARR]: DataType.FEATURE_LABELS,
|
|
25
|
-
// For new file types to support old file types
|
|
26
|
-
[FileType.OBS_EMBEDDING_CELLS_JSON]: DataType.OBS_EMBEDDING,
|
|
27
|
-
[FileType.OBS_LOCATIONS_CELLS_JSON]: DataType.OBS_LOCATIONS,
|
|
28
|
-
[FileType.OBS_SEGMENTATIONS_CELLS_JSON]: DataType.OBS_SEGMENTATIONS,
|
|
29
|
-
[FileType.OBS_LABELS_CELLS_JSON]: DataType.OBS_LABELS,
|
|
30
|
-
[FileType.OBS_SETS_CELL_SETS_JSON]: DataType.OBS_SETS,
|
|
31
|
-
[FileType.OBS_FEATURE_MATRIX_GENES_JSON]: DataType.OBS_FEATURE_MATRIX,
|
|
32
|
-
[FileType.OBS_FEATURE_MATRIX_CLUSTERS_JSON]: DataType.OBS_FEATURE_MATRIX,
|
|
33
|
-
[FileType.OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR]: DataType.OBS_FEATURE_MATRIX,
|
|
34
|
-
[FileType.IMAGE_RASTER_JSON]: DataType.IMAGE,
|
|
35
|
-
[FileType.OBS_SEGMENTATIONS_RASTER_JSON]: DataType.OBS_SEGMENTATIONS,
|
|
36
|
-
[FileType.OBS_LOCATIONS_MOLECULES_JSON]: DataType.OBS_LOCATIONS,
|
|
37
|
-
[FileType.OBS_LABELS_MOLECULES_JSON]: DataType.OBS_LABELS,
|
|
38
|
-
// For old file types
|
|
39
|
-
[FileType.GENOMIC_PROFILES_ZARR]: DataType.GENOMIC_PROFILES,
|
|
40
|
-
[FileType.NEIGHBORHOODS_JSON]: DataType.NEIGHBORHOODS,
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Store a mapping from data types to the coordination types used
|
|
44
|
-
* for matching using the coordinationValues field of file definitions.
|
|
45
|
-
* This enables inferring default values, simplifying view config writing.
|
|
46
|
-
*/
|
|
47
|
-
export const DATA_TYPE_COORDINATION_VALUE_USAGE = {
|
|
48
|
-
[DataType.OBS_SEGMENTATIONS]: [
|
|
49
|
-
CoordinationType.OBS_TYPE,
|
|
50
|
-
],
|
|
51
|
-
[DataType.OBS_EMBEDDING]: [
|
|
52
|
-
CoordinationType.OBS_TYPE,
|
|
53
|
-
CoordinationType.EMBEDDING_TYPE,
|
|
54
|
-
],
|
|
55
|
-
[DataType.OBS_LOCATIONS]: [
|
|
56
|
-
CoordinationType.OBS_TYPE,
|
|
57
|
-
],
|
|
58
|
-
[DataType.OBS_LABELS]: [
|
|
59
|
-
CoordinationType.OBS_TYPE,
|
|
60
|
-
CoordinationType.OBS_LABELS_TYPE,
|
|
61
|
-
],
|
|
62
|
-
[DataType.FEATURE_LABELS]: [
|
|
63
|
-
CoordinationType.FEATURE_TYPE,
|
|
64
|
-
],
|
|
65
|
-
[DataType.OBS_SETS]: [
|
|
66
|
-
CoordinationType.OBS_TYPE,
|
|
67
|
-
],
|
|
68
|
-
[DataType.OBS_FEATURE_MATRIX]: [
|
|
69
|
-
CoordinationType.OBS_TYPE,
|
|
70
|
-
CoordinationType.FEATURE_TYPE,
|
|
71
|
-
CoordinationType.FEATURE_VALUE_TYPE,
|
|
72
|
-
],
|
|
73
|
-
[DataType.GENOMIC_PROFILES]: [],
|
|
74
|
-
[DataType.IMAGE]: [],
|
|
75
|
-
[DataType.NEIGHBORHOODS]: [],
|
|
76
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DataType } from './constants';
|
|
2
|
-
import { DATA_TYPE_COORDINATION_VALUE_USAGE, } from './constant-relationships';
|
|
3
|
-
describe('src/app/constant-relationships.js', () => {
|
|
4
|
-
describe('DataType-to-CoordinationType usage mapping', () => {
|
|
5
|
-
it('every data type is mapped to an array of coordination types', () => {
|
|
6
|
-
const dataTypes = Object.values(DataType).sort();
|
|
7
|
-
const mappedDataTypes = Object.keys(DATA_TYPE_COORDINATION_VALUE_USAGE).sort();
|
|
8
|
-
expect(dataTypes.length).toEqual(mappedDataTypes.length);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
11
|
-
});
|