@vitessce/constants 2.0.0-beta.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
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 { 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';
8
+ function makeConstantWithDeprecationMessage(currObj, oldObj) {
9
+ const handler = {
10
+ get(obj, prop) {
11
+ const oldKeys = Object.keys(oldObj);
12
+ if (oldKeys.includes(prop)) {
13
+ console.warn(`Notice about the constant mapping ${prop}: '${oldObj[prop][0]}':\n${oldObj[prop][1]}`);
14
+ return oldObj[prop];
15
+ }
16
+ return obj[prop];
17
+ },
18
+ };
19
+ const objWithMessage = new Proxy(currObj, handler);
20
+ return objWithMessage;
21
+ }
22
+ export const ViewType = makeConstantWithDeprecationMessage(ViewTypeCurr, ViewTypeOld);
23
+ export const DataType = makeConstantWithDeprecationMessage(DataTypeCurr, DataTypeOld);
24
+ export const FileType = makeConstantWithDeprecationMessage(FileTypeCurr, FileTypeOld);
25
+ export const CoordinationType = makeConstantWithDeprecationMessage(CoordinationTypeCurr, CoordinationTypeOld);
@@ -0,0 +1,157 @@
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
+ export const DataType = {
28
+ CELLS: [
29
+ 'cells',
30
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsEmbedding instead.',
31
+ ],
32
+ CELL_SETS: [
33
+ 'cell-sets',
34
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsSets instead.',
35
+ ],
36
+ EXPRESSION_MATRIX: [
37
+ 'expression-matrix',
38
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsFeatureMatrix instead.',
39
+ ],
40
+ MOLECULES: [
41
+ 'molecules',
42
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See obsLocations instead.',
43
+ ],
44
+ RASTER: [
45
+ 'raster',
46
+ 'This data type was removed. Associated file types were re-implemented as joint file types. See image and obsSegmentations instead.',
47
+ ],
48
+ };
49
+ export const FileType = {};
50
+ function makeChangeMessage(newTypeName, newVersion) {
51
+ return `This coordination type was changed to ${newTypeName} in view config schema version ${newVersion}`;
52
+ }
53
+ export const CoordinationType = {
54
+ SPATIAL_LAYERS: [
55
+ 'spatialLayers',
56
+ 'This coordination type was split into multiple coordination types in view config schema version 1.0.1',
57
+ ],
58
+ // Spatial layers
59
+ SPATIAL_RASTER_LAYERS: [
60
+ 'spatialRasterLayers',
61
+ makeChangeMessage('spatialImageLayer', '1.0.11'),
62
+ ],
63
+ SPATIAL_CELLS_LAYER: [
64
+ 'spatialCellsLayer',
65
+ makeChangeMessage('spatialSegmentationLayer', '1.0.11'),
66
+ ],
67
+ SPATIAL_MOLECULES_LAYER: [
68
+ 'spatialMoleculesLayer',
69
+ makeChangeMessage('spatialPointLayer', '1.0.11'),
70
+ ],
71
+ SPATIAL_NEIGHBORHOODS_LAYER: [
72
+ 'spatialNeighborhoodsLayer',
73
+ makeChangeMessage('spatialNeighborhoodLayer', '1.0.11'),
74
+ ],
75
+ // Cell -> Obs
76
+ EMBEDDING_CELL_SET_POLYGONS_VISIBLE: [
77
+ 'embeddingCellSetPolygonsVisible',
78
+ makeChangeMessage('embeddingObsSetPolygonsVisible', '1.0.11'),
79
+ ],
80
+ EMBEDDING_CELL_SET_LABELS_VISIBLE: [
81
+ 'embeddingCellSetLabelsVisible',
82
+ makeChangeMessage('embeddingObsSetLabelsVisible', '1.0.11'),
83
+ ],
84
+ EMBEDDING_CELL_SET_LABEL_SIZE: [
85
+ 'embeddingCellSetLabelSize',
86
+ makeChangeMessage('embeddingObsSetLabelSize', '1.0.11'),
87
+ ],
88
+ EMBEDDING_CELL_RADIUS: [
89
+ 'embeddingCellRadius',
90
+ makeChangeMessage('embeddingObsRadius', '1.0.11'),
91
+ ],
92
+ EMBEDDING_CELL_RADIUS_MODE: [
93
+ 'embeddingCellRadiusMode',
94
+ makeChangeMessage('embeddingObsRadiusMode', '1.0.11'),
95
+ ],
96
+ EMBEDDING_CELL_OPACITY: [
97
+ 'embeddingCellOpacity',
98
+ makeChangeMessage('embeddingObsOpacity', '1.0.11'),
99
+ ],
100
+ EMBEDDING_CELL_OPACITY_MODE: [
101
+ 'embeddingCellOpacityMode',
102
+ makeChangeMessage('embeddingObsOpacityMode', '1.0.11'),
103
+ ],
104
+ CELL_FILTER: [
105
+ 'cellFilter',
106
+ makeChangeMessage('obsFilter', '1.0.11'),
107
+ ],
108
+ CELL_HIGHLIGHT: [
109
+ 'cellHighlight',
110
+ makeChangeMessage('obsHighlight', '1.0.11'),
111
+ ],
112
+ CELL_SET_SELECTION: [
113
+ 'cellSetSelection',
114
+ makeChangeMessage('obsSetSelection', '1.0.11'),
115
+ ],
116
+ CELL_SET_HIGHLIGHT: [
117
+ 'cellSetHighlight',
118
+ makeChangeMessage('obsSetHighlight', '1.0.11'),
119
+ ],
120
+ CELL_SET_COLOR: [
121
+ 'cellSetColor',
122
+ makeChangeMessage('obsSetColor', '1.0.11'),
123
+ ],
124
+ CELL_COLOR_ENCODING: [
125
+ 'cellColorEncoding',
126
+ makeChangeMessage('obsColorEncoding', '1.0.11'),
127
+ ],
128
+ ADDITIONAL_CELL_SETS: [
129
+ 'additionalCellSets',
130
+ makeChangeMessage('additionalObsSets', '1.0.11'),
131
+ ],
132
+ // Gene -> Feature
133
+ GENE_FILTER: [
134
+ 'geneFilter',
135
+ makeChangeMessage('featureFilter', '1.0.11'),
136
+ ],
137
+ GENE_HIGHLIGHT: [
138
+ 'geneHighlight',
139
+ makeChangeMessage('featureHighlight', '1.0.11'),
140
+ ],
141
+ GENE_SELECTION: [
142
+ 'geneSelection',
143
+ makeChangeMessage('featureSelection', '1.0.11'),
144
+ ],
145
+ GENE_EXPRESSION_COLORMAP: [
146
+ 'geneExpressionColormap',
147
+ makeChangeMessage('featureValueColormap', '1.0.11'),
148
+ ],
149
+ GENE_EXPRESSION_TRANSFORM: [
150
+ 'geneExpressionTransform',
151
+ makeChangeMessage('featureValueTransform', '1.0.11'),
152
+ ],
153
+ GENE_EXPRESSION_COLORMAP_RANGE: [
154
+ 'geneExpressionColormapRange',
155
+ makeChangeMessage('featureValueColormapRange', '1.0.11'),
156
+ ],
157
+ };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { ViewType, DataType, FileType, CoordinationType, } from './constants-merged';
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@vitessce/constants",
3
+ "version": "2.0.0-beta.0",
4
+ "author": "Gehlenborg Lab",
5
+ "homepage": "http://vitessce.io",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/vitessce/vitessce.git"
9
+ },
10
+ "license": "MIT",
11
+ "main": "dist/index.js",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "dependencies": {
16
+ "@vitessce/constants-internal": "2.0.0-beta.0"
17
+ },
18
+ "scripts": {
19
+ "start": "tsc --watch",
20
+ "build": "tsc"
21
+ }
22
+ }