@vitessce/vit-s 2.0.3-beta.0 → 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.
Files changed (184) hide show
  1. package/dist/index.mjs +84801 -0
  2. package/{dist → dist-tsc}/index.js +2 -2
  3. package/package.json +7 -7
  4. package/src/CallbackPublisher.js +81 -0
  5. package/src/LoadingIndicator.js +34 -0
  6. package/src/TitleInfo.js +240 -0
  7. package/src/VitS.js +180 -0
  8. package/src/VitessceGrid.js +110 -0
  9. package/src/VitessceGrid.test.jsx +48 -0
  10. package/src/Warning.js +62 -0
  11. package/{dist → src}/classNames.js +0 -0
  12. package/src/component-registry.js +21 -0
  13. package/src/data/AbstractLoader.js +46 -0
  14. package/{dist → src}/data/AbstractTwoStepLoader.js +5 -4
  15. package/src/data/LoaderResult.js +8 -0
  16. package/{dist → src}/data/index.js +0 -0
  17. package/src/data/loader-registry.js +19 -0
  18. package/src/data-hook-utils.js +197 -0
  19. package/src/data-hooks.js +354 -0
  20. package/src/errors/AbstractLoaderError.js +14 -0
  21. package/src/errors/DataSourceFetchError.js +15 -0
  22. package/src/errors/DatasetNotFoundError.js +23 -0
  23. package/src/errors/LoaderNotFoundError.js +24 -0
  24. package/src/errors/LoaderValidationError.js +23 -0
  25. package/src/errors/OptionsValidationError.js +25 -0
  26. package/{dist → src}/errors/index.js +0 -0
  27. package/src/file-options-schemas-legacy.js +139 -0
  28. package/src/file-options-schemas-legacy.test.js +138 -0
  29. package/src/file-options-schemas.js +327 -0
  30. package/src/file-options-schemas.test.js +26 -0
  31. package/src/hooks.js +252 -0
  32. package/src/index.js +101 -0
  33. package/src/joint-file-types-legacy.js +298 -0
  34. package/src/joint-file-types-legacy.test.js +412 -0
  35. package/src/joint-file-types.js +171 -0
  36. package/src/joint-file-types.test.js +144 -0
  37. package/{dist/schemas.js → src/json-schemas.js} +6 -1
  38. package/{dist → src}/plugins.js +102 -70
  39. package/src/plugins.test.fixtures.js +78 -0
  40. package/src/plugins.test.js +42 -0
  41. package/src/schemas/config-0.1.0.schema.json +85 -0
  42. package/src/schemas/config-1.0.0.schema.json +733 -0
  43. package/src/schemas/config-1.0.1.schema.json +909 -0
  44. package/src/schemas/config-1.0.10.schema.json +969 -0
  45. package/src/schemas/config-1.0.11.schema.json +990 -0
  46. package/src/schemas/config-1.0.12.schema.json +997 -0
  47. package/src/schemas/config-1.0.13.schema.json +1013 -0
  48. package/src/schemas/config-1.0.14.schema.json +1048 -0
  49. package/src/schemas/config-1.0.15.schema.json +1048 -0
  50. package/src/schemas/config-1.0.16.schema.json +1069 -0
  51. package/src/schemas/config-1.0.16.schema.test.js +32 -0
  52. package/src/schemas/config-1.0.2.schema.json +911 -0
  53. package/src/schemas/config-1.0.3.schema.json +911 -0
  54. package/src/schemas/config-1.0.4.schema.json +949 -0
  55. package/src/schemas/config-1.0.5.schema.json +949 -0
  56. package/src/schemas/config-1.0.6.schema.json +950 -0
  57. package/src/schemas/config-1.0.7.schema.json +950 -0
  58. package/src/schemas/config-1.0.8.schema.json +966 -0
  59. package/src/schemas/config-1.0.9.schema.json +965 -0
  60. package/src/schemas/fixtures/cellSets.good.json +16 -0
  61. package/src/schemas/fixtures/config-1.0.1.bad.json +1 -0
  62. package/src/schemas/fixtures/config-1.0.1.bad.message.json +11 -0
  63. package/src/schemas/fixtures/config-1.0.1.good.json +37 -0
  64. package/src/schemas/fixtures/config-1.0.2.bad.json +1 -0
  65. package/src/schemas/fixtures/config-1.0.2.bad.message.json +11 -0
  66. package/src/schemas/fixtures/config-1.0.2.good.json +38 -0
  67. package/src/schemas/fixtures/config-1.0.3.bad.json +1 -0
  68. package/src/schemas/fixtures/config-1.0.3.bad.message.json +11 -0
  69. package/src/schemas/fixtures/config-1.0.3.good.json +38 -0
  70. package/src/schemas/fixtures/obsSets.bad.json +1 -0
  71. package/src/schemas/fixtures/obsSets.bad.message.json +11 -0
  72. package/src/schemas/fixtures/obsSets.good.json +16 -0
  73. package/src/schemas/fixtures/obsSetsTabular.bad.json +1 -0
  74. package/src/schemas/fixtures/obsSetsTabular.bad.message.json +11 -0
  75. package/src/schemas/fixtures/obsSetsTabular.good.json +26 -0
  76. package/src/schemas/fixtures/raster.bad.json +1 -0
  77. package/src/schemas/fixtures/raster.bad.message.json +11 -0
  78. package/src/schemas/fixtures/raster.good.json +39 -0
  79. package/src/schemas/obsSets.schema.js +195 -0
  80. package/src/schemas/obsSetsTabular.schema.js +39 -0
  81. package/src/schemas/raster.schema.js +121 -0
  82. package/src/schemas/schema-schema.sh +34 -0
  83. package/{dist → src}/schemas/schema.test-old.js +0 -1
  84. package/src/shared-mui/components.js +79 -0
  85. package/src/shared-mui/container.js +212 -0
  86. package/src/shared-mui/styles.js +110 -0
  87. package/src/shared-plot-options/CellColorEncodingOption.js +43 -0
  88. package/src/shared-plot-options/OptionSelect.js +19 -0
  89. package/src/shared-plot-options/OptionsContainer.js +26 -0
  90. package/{dist → src}/shared-plot-options/index.js +0 -0
  91. package/src/shared-plot-options/styles.js +49 -0
  92. package/src/state/hooks.js +633 -0
  93. package/src/view-config-upgraders.js +628 -0
  94. package/src/view-config-utils.js +315 -0
  95. package/src/view-config-utils.test.fixtures.js +893 -0
  96. package/src/view-config-utils.test.js +95 -0
  97. package/src/view-config-versions.js +68 -0
  98. package/src/vitessce-grid-layout/VitessceGridLayout.js +158 -0
  99. package/src/vitessce-grid-layout/VitessceGridLayout.test.jsx +56 -0
  100. package/{dist → src}/vitessce-grid-layout/index.js +0 -0
  101. package/src/vitessce-grid-layout/layout-utils.js +76 -0
  102. package/src/vitessce-grid-layout/layout-utils.test.js +167 -0
  103. package/src/vitessce-grid-utils.js +160 -0
  104. package/dist/CallbackPublisher.js +0 -68
  105. package/dist/LoadingIndicator.js +0 -27
  106. package/dist/TitleInfo.js +0 -151
  107. package/dist/VitS.js +0 -117
  108. package/dist/Vitessce.integration.test.js +0 -36
  109. package/dist/Vitessce.js +0 -101
  110. package/dist/VitessceGrid.js +0 -59
  111. package/dist/VitessceGrid.test.js +0 -36
  112. package/dist/Warning.js +0 -45
  113. package/dist/component-registry.js +0 -16
  114. package/dist/data/AbstractLoader.js +0 -35
  115. package/dist/data/LoaderResult.js +0 -7
  116. package/dist/data/loader-registry.js +0 -15
  117. package/dist/data-hook-utils.js +0 -175
  118. package/dist/data-hooks.js +0 -241
  119. package/dist/errors/AbstractLoaderError.js +0 -13
  120. package/dist/errors/DataSourceFetchError.js +0 -13
  121. package/dist/errors/DatasetNotFoundError.js +0 -17
  122. package/dist/errors/LoaderNotFoundError.js +0 -17
  123. package/dist/errors/LoaderValidationError.js +0 -15
  124. package/dist/errors/OptionsValidationError.js +0 -15
  125. package/dist/export-utils.js +0 -70
  126. package/dist/export-utils.test.js +0 -66
  127. package/dist/file-options-schemas-legacy.js +0 -136
  128. package/dist/file-options-schemas-legacy.test.js +0 -126
  129. package/dist/file-options-schemas.js +0 -322
  130. package/dist/file-options-schemas.test.js +0 -23
  131. package/dist/hooks.js +0 -215
  132. package/dist/joint-file-types-legacy.js +0 -278
  133. package/dist/joint-file-types-legacy.test.js +0 -400
  134. package/dist/joint-file-types.js +0 -148
  135. package/dist/joint-file-types.test.js +0 -139
  136. package/dist/loader-registry.js +0 -98
  137. package/dist/plugins.test.fixtures.js +0 -76
  138. package/dist/plugins.test.js +0 -30
  139. package/dist/schemas/PrettyJsonSchema.js +0 -34
  140. package/dist/schemas/config-0.1.0.schema.json +0 -84
  141. package/dist/schemas/config-1.0.0.schema.json +0 -733
  142. package/dist/schemas/config-1.0.1.schema.json +0 -909
  143. package/dist/schemas/config-1.0.10.schema.json +0 -969
  144. package/dist/schemas/config-1.0.11.schema.json +0 -990
  145. package/dist/schemas/config-1.0.12.schema.json +0 -997
  146. package/dist/schemas/config-1.0.13.schema.json +0 -1013
  147. package/dist/schemas/config-1.0.14.schema.json +0 -1048
  148. package/dist/schemas/config-1.0.15.schema.json +0 -1048
  149. package/dist/schemas/config-1.0.15.schema.test.js +0 -22
  150. package/dist/schemas/config-1.0.16.schema.json +0 -1109
  151. package/dist/schemas/config-1.0.16.schema.test.js +0 -22
  152. package/dist/schemas/config-1.0.2.schema.json +0 -910
  153. package/dist/schemas/config-1.0.3.schema.json +0 -910
  154. package/dist/schemas/config-1.0.4.schema.json +0 -949
  155. package/dist/schemas/config-1.0.5.schema.json +0 -949
  156. package/dist/schemas/config-1.0.6.schema.json +0 -949
  157. package/dist/schemas/config-1.0.7.schema.json +0 -949
  158. package/dist/schemas/config-1.0.8.schema.json +0 -965
  159. package/dist/schemas/config-1.0.9.schema.json +0 -965
  160. package/dist/schemas/obs-sets-tabular.schema.js +0 -37
  161. package/dist/schemas/obs-sets.schema.js +0 -194
  162. package/dist/schemas/obsSets.schema.js +0 -195
  163. package/dist/schemas/obsSetsTabular.schema.js +0 -38
  164. package/dist/schemas/raster.schema.js +0 -120
  165. package/dist/schemas/schema.test.js +0 -46
  166. package/dist/schemas-extra.js +0 -3
  167. package/dist/shared-mui/components.js +0 -35
  168. package/dist/shared-mui/container.js +0 -211
  169. package/dist/shared-mui/styles.js +0 -107
  170. package/dist/shared-plot-options/CellColorEncodingOption.js +0 -18
  171. package/dist/shared-plot-options/OptionSelect.js +0 -12
  172. package/dist/shared-plot-options/OptionsContainer.js +0 -12
  173. package/dist/shared-plot-options/styles.js +0 -48
  174. package/dist/state/hooks.js +0 -549
  175. package/dist/view-config-upgraders.js +0 -525
  176. package/dist/view-config-utils.js +0 -286
  177. package/dist/view-config-utils.test.fixtures.js +0 -765
  178. package/dist/view-config-utils.test.js +0 -66
  179. package/dist/view-config-versions.js +0 -47
  180. package/dist/vitessce-grid-layout/VitessceGridLayout.js +0 -95
  181. package/dist/vitessce-grid-layout/VitessceGridLayout.test.js +0 -40
  182. package/dist/vitessce-grid-layout/layout-utils.js +0 -60
  183. package/dist/vitessce-grid-layout/layout-utils.test.js +0 -146
  184. package/dist/vitessce-grid-utils.js +0 -140
@@ -1,37 +0,0 @@
1
- export const obsSetsTabularSchema = {
2
- $schema: 'http://json-schema.org/draft-07/schema#',
3
- $id: 'https://github.com/vitessce/vitessce/#obsSetsTabular',
4
- title: 'Vitessce obs sets data, tabular format',
5
- definitions: {
6
- colorArray: {
7
- type: 'array',
8
- items: { type: 'integer', minimum: 0, maximum: 255 },
9
- minItems: 3,
10
- maxItems: 3,
11
- },
12
- },
13
- type: 'array',
14
- items: {
15
- type: 'object',
16
- additionalProperties: false,
17
- required: ['groupName', 'setName', 'obsId'],
18
- properties: {
19
- groupName: { type: 'string' },
20
- setName: { type: 'string' },
21
- setColor: { $ref: '#/definitions/colorArray' },
22
- obsId: { type: 'string' },
23
- predictionScore: {
24
- oneOf: [
25
- {
26
- type: 'number',
27
- minimum: 0.0,
28
- maximum: 1.0,
29
- },
30
- {
31
- type: 'null',
32
- },
33
- ],
34
- },
35
- },
36
- },
37
- };
@@ -1,194 +0,0 @@
1
- export const obsSetsSchema = {
2
- $schema: 'http://json-schema.org/draft-07/schema#',
3
- $id: 'https://github.com/vitessce/vitessce/#cell-sets',
4
- title: 'Vitessce obs sets data',
5
- type: 'object',
6
- definitions: {
7
- stringArray: {
8
- type: 'array',
9
- items: {
10
- type: 'string',
11
- },
12
- },
13
- stringProbabilityTupleArray: {
14
- type: 'array',
15
- items: {
16
- type: 'array',
17
- additionalItems: false,
18
- items: [
19
- {
20
- type: 'string',
21
- },
22
- {
23
- oneOf: [
24
- {
25
- type: 'number',
26
- minimum: 0.0,
27
- maximum: 1.0,
28
- },
29
- {
30
- type: 'null',
31
- },
32
- ],
33
- },
34
- ],
35
- },
36
- },
37
- colorArray: {
38
- type: 'array',
39
- items: {
40
- type: 'integer',
41
- minimum: 0,
42
- maximum: 255,
43
- },
44
- minItems: 3,
45
- maxItems: 3,
46
- },
47
- treeNodeLeaf: {
48
- type: 'object',
49
- additionalProperties: false,
50
- required: ['name'],
51
- properties: {
52
- name: {
53
- type: 'string',
54
- },
55
- color: {
56
- $ref: '#/definitions/colorArray',
57
- },
58
- set: {
59
- $ref: '#/definitions/stringArray',
60
- },
61
- },
62
- },
63
- treeNodeNonLeaf: {
64
- type: 'object',
65
- additionalProperties: false,
66
- required: ['name'],
67
- properties: {
68
- name: {
69
- type: 'string',
70
- },
71
- color: {
72
- $ref: '#/definitions/colorArray',
73
- },
74
- children: {
75
- type: 'array',
76
- items: {
77
- $ref: '#/definitions/treeNode',
78
- },
79
- },
80
- },
81
- },
82
- treeNode: {
83
- oneOf: [
84
- {
85
- $ref: '#/definitions/treeNodeNonLeaf',
86
- },
87
- {
88
- $ref: '#/definitions/treeNodeLeaf',
89
- },
90
- ],
91
- },
92
- 'version0.1.2': {
93
- type: 'object',
94
- additionalProperties: false,
95
- required: ['version', 'datatype', 'tree'],
96
- properties: {
97
- dataset: {
98
- type: 'string',
99
- },
100
- version: {
101
- type: 'string',
102
- enum: ['0.1.2'],
103
- },
104
- datatype: {
105
- type: 'string',
106
- enum: ['cell', 'obs'],
107
- },
108
- tree: {
109
- type: 'array',
110
- items: {
111
- $ref: '#/definitions/treeNodeNonLeaf',
112
- },
113
- },
114
- },
115
- },
116
- treeNodeLeafProbabilistic: {
117
- type: 'object',
118
- additionalProperties: false,
119
- required: ['name'],
120
- properties: {
121
- name: {
122
- type: 'string',
123
- },
124
- color: {
125
- $ref: '#/definitions/colorArray',
126
- },
127
- set: {
128
- $ref: '#/definitions/stringProbabilityTupleArray',
129
- },
130
- },
131
- },
132
- treeNodeNonLeafProbabilistic: {
133
- type: 'object',
134
- additionalProperties: false,
135
- required: ['name'],
136
- properties: {
137
- name: {
138
- type: 'string',
139
- },
140
- color: {
141
- $ref: '#/definitions/colorArray',
142
- },
143
- children: {
144
- type: 'array',
145
- items: {
146
- $ref: '#/definitions/treeNodeProbabilistic',
147
- },
148
- },
149
- },
150
- },
151
- treeNodeProbabilistic: {
152
- oneOf: [
153
- {
154
- $ref: '#/definitions/treeNodeNonLeafProbabilistic',
155
- },
156
- {
157
- $ref: '#/definitions/treeNodeLeafProbabilistic',
158
- },
159
- ],
160
- },
161
- 'version0.1.3': {
162
- type: 'object',
163
- additionalProperties: false,
164
- required: ['version', 'datatype', 'tree'],
165
- properties: {
166
- dataset: {
167
- type: 'string',
168
- },
169
- version: {
170
- type: 'string',
171
- enum: ['0.1.3'],
172
- },
173
- datatype: {
174
- type: 'string',
175
- enum: ['cell', 'obs'],
176
- },
177
- tree: {
178
- type: 'array',
179
- items: {
180
- $ref: '#/definitions/treeNodeNonLeafProbabilistic',
181
- },
182
- },
183
- },
184
- },
185
- },
186
- oneOf: [
187
- {
188
- $ref: '#/definitions/version0.1.2',
189
- },
190
- {
191
- $ref: '#/definitions/version0.1.3',
192
- },
193
- ],
194
- };
@@ -1,195 +0,0 @@
1
- const schema = {
2
- $schema: 'http://json-schema.org/draft-07/schema#',
3
- $id: 'https://github.com/vitessce/vitessce/#cell-sets',
4
- title: 'Vitessce obs sets data',
5
- type: 'object',
6
- definitions: {
7
- stringArray: {
8
- type: 'array',
9
- items: {
10
- type: 'string',
11
- },
12
- },
13
- stringProbabilityTupleArray: {
14
- type: 'array',
15
- items: {
16
- type: 'array',
17
- additionalItems: false,
18
- items: [
19
- {
20
- type: 'string',
21
- },
22
- {
23
- oneOf: [
24
- {
25
- type: 'number',
26
- minimum: 0.0,
27
- maximum: 1.0,
28
- },
29
- {
30
- type: 'null',
31
- },
32
- ],
33
- },
34
- ],
35
- },
36
- },
37
- colorArray: {
38
- type: 'array',
39
- items: {
40
- type: 'integer',
41
- minimum: 0,
42
- maximum: 255,
43
- },
44
- minItems: 3,
45
- maxItems: 3,
46
- },
47
- treeNodeLeaf: {
48
- type: 'object',
49
- additionalProperties: false,
50
- required: ['name'],
51
- properties: {
52
- name: {
53
- type: 'string',
54
- },
55
- color: {
56
- $ref: '#/definitions/colorArray',
57
- },
58
- set: {
59
- $ref: '#/definitions/stringArray',
60
- },
61
- },
62
- },
63
- treeNodeNonLeaf: {
64
- type: 'object',
65
- additionalProperties: false,
66
- required: ['name'],
67
- properties: {
68
- name: {
69
- type: 'string',
70
- },
71
- color: {
72
- $ref: '#/definitions/colorArray',
73
- },
74
- children: {
75
- type: 'array',
76
- items: {
77
- $ref: '#/definitions/treeNode',
78
- },
79
- },
80
- },
81
- },
82
- treeNode: {
83
- oneOf: [
84
- {
85
- $ref: '#/definitions/treeNodeNonLeaf',
86
- },
87
- {
88
- $ref: '#/definitions/treeNodeLeaf',
89
- },
90
- ],
91
- },
92
- 'version0.1.2': {
93
- type: 'object',
94
- additionalProperties: false,
95
- required: ['version', 'datatype', 'tree'],
96
- properties: {
97
- dataset: {
98
- type: 'string',
99
- },
100
- version: {
101
- type: 'string',
102
- enum: ['0.1.2'],
103
- },
104
- datatype: {
105
- type: 'string',
106
- enum: ['cell', 'obs'],
107
- },
108
- tree: {
109
- type: 'array',
110
- items: {
111
- $ref: '#/definitions/treeNodeNonLeaf',
112
- },
113
- },
114
- },
115
- },
116
- treeNodeLeafProbabilistic: {
117
- type: 'object',
118
- additionalProperties: false,
119
- required: ['name'],
120
- properties: {
121
- name: {
122
- type: 'string',
123
- },
124
- color: {
125
- $ref: '#/definitions/colorArray',
126
- },
127
- set: {
128
- $ref: '#/definitions/stringProbabilityTupleArray',
129
- },
130
- },
131
- },
132
- treeNodeNonLeafProbabilistic: {
133
- type: 'object',
134
- additionalProperties: false,
135
- required: ['name'],
136
- properties: {
137
- name: {
138
- type: 'string',
139
- },
140
- color: {
141
- $ref: '#/definitions/colorArray',
142
- },
143
- children: {
144
- type: 'array',
145
- items: {
146
- $ref: '#/definitions/treeNodeProbabilistic',
147
- },
148
- },
149
- },
150
- },
151
- treeNodeProbabilistic: {
152
- oneOf: [
153
- {
154
- $ref: '#/definitions/treeNodeNonLeafProbabilistic',
155
- },
156
- {
157
- $ref: '#/definitions/treeNodeLeafProbabilistic',
158
- },
159
- ],
160
- },
161
- 'version0.1.3': {
162
- type: 'object',
163
- additionalProperties: false,
164
- required: ['version', 'datatype', 'tree'],
165
- properties: {
166
- dataset: {
167
- type: 'string',
168
- },
169
- version: {
170
- type: 'string',
171
- enum: ['0.1.3'],
172
- },
173
- datatype: {
174
- type: 'string',
175
- enum: ['cell', 'obs'],
176
- },
177
- tree: {
178
- type: 'array',
179
- items: {
180
- $ref: '#/definitions/treeNodeNonLeafProbabilistic',
181
- },
182
- },
183
- },
184
- },
185
- },
186
- oneOf: [
187
- {
188
- $ref: '#/definitions/version0.1.2',
189
- },
190
- {
191
- $ref: '#/definitions/version0.1.3',
192
- },
193
- ],
194
- };
195
- export default schema;
@@ -1,38 +0,0 @@
1
- const schema = {
2
- $schema: 'http://json-schema.org/draft-07/schema#',
3
- $id: 'https://github.com/vitessce/vitessce/#obsSetsTabular',
4
- title: 'Vitessce obs sets data, tabular format',
5
- definitions: {
6
- colorArray: {
7
- type: 'array',
8
- items: { type: 'integer', minimum: 0, maximum: 255 },
9
- minItems: 3,
10
- maxItems: 3,
11
- },
12
- },
13
- type: 'array',
14
- items: {
15
- type: 'object',
16
- additionalProperties: false,
17
- required: ['groupName', 'setName', 'obsId'],
18
- properties: {
19
- groupName: { type: 'string' },
20
- setName: { type: 'string' },
21
- setColor: { $ref: '#/definitions/colorArray' },
22
- obsId: { type: 'string' },
23
- predictionScore: {
24
- oneOf: [
25
- {
26
- type: 'number',
27
- minimum: 0.0,
28
- maximum: 1.0,
29
- },
30
- {
31
- type: 'null',
32
- },
33
- ],
34
- },
35
- },
36
- },
37
- };
38
- export default schema;
@@ -1,120 +0,0 @@
1
- const schema = {
2
- $schema: 'http://json-schema.org/draft-07/schema#',
3
- $id: 'https://github.com/vitessce/vitessce/#raster',
4
- title: 'Vitessce image data',
5
- type: 'object',
6
- definitions: {
7
- transform: {
8
- type: 'object',
9
- additionalProperties: false,
10
- oneOf: [{ required: ['scale', 'translate'] }, { required: ['matrix'] }],
11
- properties: {
12
- scale: { type: 'number' },
13
- translate: {
14
- type: 'object',
15
- additionalProperties: false,
16
- required: ['y', 'x'],
17
- properties: {
18
- y: { type: 'number' },
19
- x: { type: 'number' },
20
- },
21
- },
22
- matrix: {
23
- type: 'array',
24
- items: { type: 'number' },
25
- minItems: 16,
26
- maxItems: 16,
27
- },
28
- },
29
- },
30
- dimensions: {
31
- type: 'array',
32
- items: {
33
- type: 'object',
34
- additionalProperties: false,
35
- required: ['field', 'type', 'values'],
36
- properties: {
37
- field: { type: 'string' },
38
- type: {
39
- type: 'string',
40
- enum: ['quantitative', 'nominal', 'ordinal', 'temporal'],
41
- },
42
- values: {
43
- type: ['array', 'null'],
44
- items: { type: 'string' },
45
- },
46
- },
47
- },
48
- },
49
- metadata: {
50
- type: 'object',
51
- additionalProperties: false,
52
- anyOf: [{ required: ['dimensions', 'isPyramid'] }, { required: ['transform'] }, { required: ['omeTiffOffsetsUrl'] }, { required: ['isBitmask'] }],
53
- properties: {
54
- dimensions: { $ref: '#/definitions/dimensions' },
55
- isPyramid: { type: 'boolean' },
56
- transform: { $ref: '#/definitions/transform' },
57
- isBitmask: { type: 'boolean' },
58
- omeTiffOffsetsUrl: { type: 'string', format: 'uri' },
59
- },
60
- },
61
- requestInit: {
62
- type: 'object',
63
- additionalProperties: false,
64
- required: [],
65
- properties: {
66
- method: {
67
- type: 'string',
68
- },
69
- headers: {
70
- type: 'object',
71
- },
72
- body: {
73
- type: 'string',
74
- },
75
- mode: {
76
- type: 'string',
77
- },
78
- credentials: {
79
- type: 'string',
80
- },
81
- cache: {
82
- type: 'string',
83
- },
84
- redirect: {
85
- type: 'string',
86
- },
87
- referrer: {
88
- type: 'string',
89
- },
90
- integrity: {
91
- type: 'string',
92
- },
93
- },
94
- },
95
- image: {
96
- type: 'object',
97
- additionalProperties: false,
98
- required: ['name', 'url', 'type'],
99
- properties: {
100
- name: { type: 'string' },
101
- url: { type: 'string', format: 'uri' },
102
- type: { type: 'string' },
103
- metadata: { $ref: '#/definitions/metadata' },
104
- requestInit: { $ref: '#/definitions/requestInit' },
105
- },
106
- },
107
- },
108
- additionalProperties: false,
109
- required: ['schemaVersion', 'images'],
110
- properties: {
111
- schemaVersion: { type: 'string' },
112
- usePhysicalSizeScaling: { type: 'boolean', description: 'Default is false: passing true in will infer scaling from the reported physcial size' },
113
- renderLayers: { type: 'array', items: { type: 'string' } },
114
- images: {
115
- type: 'array',
116
- items: { $ref: '#/definitions/image' },
117
- },
118
- },
119
- };
120
- export default schema;
@@ -1,46 +0,0 @@
1
- import Ajv from 'ajv';
2
- /* eslint-disable import/no-dynamic-require */
3
- /* eslint-disable global-require */
4
- describe('schemas', () => {
5
- [
6
- 'config-1.0.1',
7
- 'obsSets',
8
- 'obsSetsTabular',
9
- 'raster',
10
- ].forEach((type) => {
11
- const schemaFile = `${type}.schema.json`;
12
- describe(schemaFile, () => {
13
- const schema = require(`./${schemaFile}`);
14
- let validate;
15
- if (type === 'config-1.0.1') {
16
- const obsSets = require('./obsSets.schema.json');
17
- const raster = require('./raster.schema.json');
18
- validate = new Ajv()
19
- .addSchema(obsSets)
20
- .addSchema(raster)
21
- .compile(schema);
22
- }
23
- else {
24
- validate = new Ajv().compile(schema);
25
- }
26
- const [goodFixture, badFixture, badMessage] = [
27
- 'good', 'bad', 'bad.message',
28
- ].map(stem => `${type}.${stem}.json`);
29
- it(`passes ${goodFixture}`, () => {
30
- const data = require(`./fixtures/${goodFixture}`);
31
- const valid = validate(data);
32
- if (!valid) {
33
- console.warn(validate.errors);
34
- }
35
- expect(valid).toEqual(true);
36
- });
37
- it(`fails ${badFixture}`, () => {
38
- const data = require(`./fixtures/${badFixture}`);
39
- const message = require(`./fixtures/${badMessage}`);
40
- const valid = validate(data);
41
- expect(valid).toEqual(false);
42
- expect(validate.errors).toEqual(message);
43
- });
44
- });
45
- });
46
- });
@@ -1,3 +0,0 @@
1
- export { schema as rasterSchema } from './schemas/raster.schema';
2
- export { schema as obsSetsSchema } from './schemas/obs-sets.schema';
3
- export { schema as obsSetsTabularSchema } from './schemas/obs-sets-tabular.schema';
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useRef } from 'react';
3
- import { makeStyles } from '@material-ui/core/styles';
4
- import Paper from '@material-ui/core/Paper';
5
- import Popper from '@material-ui/core/Popper';
6
- import IconButton from '@material-ui/core/IconButton';
7
- import MenuList from '@material-ui/core/MenuList';
8
- import ClickAwayListener from '@material-ui/core/ClickAwayListener';
9
- import Fade from '@material-ui/core/Fade';
10
- import { useVitessceContainer } from '../hooks';
11
- const useStyles = makeStyles(() => ({
12
- paper: {
13
- maxHeight: 200,
14
- overflow: 'auto',
15
- },
16
- container: {
17
- position: 'relative',
18
- left: 0,
19
- top: 0,
20
- },
21
- }));
22
- export function PopperMenu(props) {
23
- const { buttonIcon, open, setOpen, children, buttonClassName, placement = 'bottom-end', } = props;
24
- const classes = useStyles();
25
- const anchorRef = useRef();
26
- const handleClick = () => {
27
- setOpen(prev => !prev);
28
- };
29
- const handleClose = () => {
30
- setOpen(false);
31
- };
32
- const id = open ? 'v-popover-menu' : undefined;
33
- const getTooltipContainer = useVitessceContainer(anchorRef);
34
- return (_jsxs("div", { ref: anchorRef, className: classes.container, children: [_jsx(IconButton, { "aria-describedby": id, onClick: handleClick, size: "small", className: buttonClassName, children: buttonIcon }), _jsx(Popper, { id: id, open: open, anchorEl: anchorRef && anchorRef.current, container: getTooltipContainer, onClose: handleClose, placement: placement, transition: true, children: ({ TransitionProps }) => (_jsx(ClickAwayListener, { onClickAway: handleClose, children: _jsx(Fade, { ...TransitionProps, timeout: 100, children: _jsx(Paper, { elevation: 4, className: classes.paper, children: _jsx(MenuList, { children: children }) }) }) })) })] }));
35
- }