carta-frontend 5.0.0-dev → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/build/asset-manifest.json +5 -5
  3. package/build/index.html +1 -1
  4. package/build/static/css/main.4f08d1bb.css +1 -0
  5. package/build/static/js/index.f5ea988d.worker.js +2 -0
  6. package/build/static/js/{main.3eb48ba0.js → main.8626e15a.js} +2 -2
  7. package/build/static/js/zfp_wrapper.wasm +0 -0
  8. package/docs_website/docs/code-snippet-tutorial/image-fitting.mdx +7 -5
  9. package/docs_website/docs/code-snippet-tutorial/quick-start.mdx +1 -1
  10. package/docs_website/docs/code-snippet-tutorial/regions.mdx +1 -1
  11. package/docs_website/docs/contributing/github-workflow.md +4 -4
  12. package/docs_website/docs/contributing/release-guidelines.md +9 -9
  13. package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/quick-start.mdx +1 -1
  14. package/docs_website/versioned_docs/version-4.1.0/code-snippet-tutorial/regions.mdx +1 -1
  15. package/docs_website/versioned_docs/version-4.1.0/contributing/github-workflow.md +4 -4
  16. package/docs_website/versioned_docs/version-4.1.0/contributing/release-guidelines.md +9 -9
  17. package/docs_website/versioned_docs/version-5.0.0-beta.1c/code-snippet-tutorial/quick-start.mdx +1 -1
  18. package/docs_website/versioned_docs/version-5.0.0-beta.1c/code-snippet-tutorial/regions.mdx +1 -1
  19. package/docs_website/versioned_docs/version-5.0.0-beta.1c/contributing/github-workflow.md +4 -4
  20. package/docs_website/versioned_docs/version-5.0.0-beta.1c/contributing/release-guidelines.md +9 -9
  21. package/package.json +5 -4
  22. package/schemas/.github/workflows/AddToCartaVisProject.yml +23 -0
  23. package/schemas/.prettierrc.json +18 -0
  24. package/schemas/CMakeLists.txt +15 -0
  25. package/schemas/README.md +1 -0
  26. package/schemas/_config.yml +7 -0
  27. package/schemas/controller_config_schema_1.json +343 -0
  28. package/schemas/controller_config_schema_2.json +685 -0
  29. package/schemas/layout_schema_2.json +440 -0
  30. package/schemas/preference_backend_schema_1.json +81 -0
  31. package/schemas/preference_backend_schema_2.json +118 -0
  32. package/schemas/preference_schema_1.json +410 -0
  33. package/schemas/preferences_schema_2.json +434 -0
  34. package/schemas/schemacompiler.c +200 -0
  35. package/schemas/snippet_schema_1.json +45 -0
  36. package/schemas/workspace_schema_1.json +573 -0
  37. package/build/static/css/main.f89d4550.css +0 -1
  38. package/build/static/js/index.73b34931.worker.js +0 -2
  39. /package/build/static/js/{index.73b34931.worker.js.LICENSE.txt → index.f5ea988d.worker.js.LICENSE.txt} +0 -0
  40. /package/build/static/js/{main.3eb48ba0.js.LICENSE.txt → main.8626e15a.js.LICENSE.txt} +0 -0
@@ -0,0 +1,434 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Preferences",
4
+ "description": "Schema for CARTA Preferences (Version 2)",
5
+ "$id": "https://cartavis.org/schemas/preferences_schema_2.json",
6
+ "type": "object",
7
+ "required": ["version"],
8
+ "properties": {
9
+ "version": {
10
+ "description": "The version of the preferences contained",
11
+ "type": "integer",
12
+ "minimum": 1,
13
+ "maximum": 2
14
+ },
15
+ "username": {
16
+ "description": "Deprecated option",
17
+ "type": "string",
18
+ "minLength": 1
19
+ },
20
+ "theme": {
21
+ "type": "string",
22
+ "enum": ["auto", "light", "dark"]
23
+ },
24
+ "autoLaunch": {
25
+ "type": "boolean"
26
+ },
27
+ "fileSortingString": {
28
+ "type": "string",
29
+ "pattern": "^([+\\-])(date|filename|type|size)$"
30
+ },
31
+ "fileFilteringType": {
32
+ "type": "string",
33
+ "enum": ["fuzzy", "unix", "regex"]
34
+ },
35
+ "layout": {
36
+ "type": "string"
37
+ },
38
+ "cursorPosition": {
39
+ "type": "string",
40
+ "enum": ["fixed", "tracking"]
41
+ },
42
+ "zoomMode": {
43
+ "type": "string",
44
+ "enum": ["fit", "full"]
45
+ },
46
+ "zoomPoint": {
47
+ "type": "string",
48
+ "enum": ["cursor", "center"]
49
+ },
50
+ "dragPanning": {
51
+ "type": "boolean"
52
+ },
53
+ "spectralMatchingType": {
54
+ "type": "string",
55
+ "enum": ["VRAD", "VOPT", "FREQ", "WAVE", "AWAV", "CHANNEL"]
56
+ },
57
+ "wcsMatchingType": {
58
+ "description": "Deprecated option",
59
+ "type": "integer",
60
+ "minimum": 0,
61
+ "maximum": 3
62
+ },
63
+ "transparentImageBackground": {
64
+ "type": "boolean"
65
+ },
66
+ "scaling": {
67
+ "type": "integer",
68
+ "minimum": 0,
69
+ "maximum": 7
70
+ },
71
+ "colormap": {
72
+ "type": "string"
73
+ },
74
+ "percentile": {
75
+ "type": "number",
76
+ "exclusiveMaximum": 100,
77
+ "exclusiveMinimum": 0
78
+ },
79
+ "scalingAlpha": {
80
+ "type": "number",
81
+ "minimum": 1
82
+ },
83
+ "scalingGamma": {
84
+ "type": "number",
85
+ "exclusiveMinimum": 0
86
+ },
87
+ "nanColorHex": {
88
+ "type": "string",
89
+ "description": "TODO: validate color string"
90
+ },
91
+ "nanAlpha": {
92
+ "type": "number",
93
+ "minimum": 0,
94
+ "maximum": 1
95
+ },
96
+ "useSmoothedBiasContrast": {
97
+ "type": "boolean"
98
+ },
99
+ "contourGeneratorType": {
100
+ "type": "string",
101
+ "enum": ["start-step-multiplier", "min-max-scaling", "percentages-ref.value", "mean-sigma-list"]
102
+ },
103
+ "contourSmoothingMode": {
104
+ "type": "integer",
105
+ "minimum": 0,
106
+ "maximum": 2
107
+ },
108
+ "contourSmoothingFactor": {
109
+ "type": "integer",
110
+ "minimum": 0
111
+ },
112
+ "contourNumLevels": {
113
+ "type": "integer",
114
+ "minimum": 1
115
+ },
116
+ "contourThickness": {
117
+ "type": "number",
118
+ "minimum": 0
119
+ },
120
+ "contourColormapEnabled": {
121
+ "type": "boolean"
122
+ },
123
+ "contourColor": {
124
+ "type": "string",
125
+ "description": "TODO: validate color string"
126
+ },
127
+ "contourColormap": {
128
+ "type": "string"
129
+ },
130
+ "vectorOverlayPixelAveraging": {
131
+ "type": "number",
132
+ "minimum": 2,
133
+ "default": 4
134
+ },
135
+ "vectorOverlayFractionalIntensity": {
136
+ "type": "boolean",
137
+ "default": false
138
+ },
139
+ "vectorOverlayThickness": {
140
+ "type": "number",
141
+ "minimum": 0
142
+ },
143
+ "vectorOverlayColormapEnabled": {
144
+ "type": "boolean"
145
+ },
146
+ "vectorOverlayColor": {
147
+ "type": "string",
148
+ "description": "TODO: validate color string",
149
+ "default": "#ffffff"
150
+ },
151
+ "vectorOverlayColormap": {
152
+ "type": "string",
153
+ "default": "viridis"
154
+ },
155
+ "astColor": {
156
+ "type": "string",
157
+ "description": "TODO: validate color string"
158
+ },
159
+ "astGridVisible": {
160
+ "type": "boolean"
161
+ },
162
+ "astLabelsVisible": {
163
+ "type": "boolean"
164
+ },
165
+ "wcsType": {
166
+ "type": "string",
167
+ "enum": ["automatic", "degrees", "sexagesimal"]
168
+ },
169
+ "colorbarVisible": {
170
+ "type": "boolean"
171
+ },
172
+ "colorbarInteractive": {
173
+ "type": "boolean"
174
+ },
175
+ "colorbarPosition": {
176
+ "type": "string",
177
+ "enum": ["right", "top", "bottom"]
178
+ },
179
+ "colorbarWidth": {
180
+ "type": "integer",
181
+ "minimum": 1,
182
+ "maximum": 100
183
+ },
184
+ "colorbarTicksDensity": {
185
+ "type": "number",
186
+ "minimum": 0.2,
187
+ "maximum": 20
188
+ },
189
+ "colorbarLabelVisible": {
190
+ "type": "boolean"
191
+ },
192
+ "beamVisible": {
193
+ "type": "boolean"
194
+ },
195
+ "beamColor": {
196
+ "type": "string"
197
+ },
198
+ "beamType": {
199
+ "type": "string",
200
+ "enum": ["open", "solid"]
201
+ },
202
+ "beamWidth": {
203
+ "type": "number",
204
+ "minimum": 0
205
+ },
206
+ "regionColor": {
207
+ "type": "string",
208
+ "description": "TODO: validate color string"
209
+ },
210
+ "regionLineWidth": {
211
+ "type": "number",
212
+ "minimum": 0
213
+ },
214
+ "regionDashLength": {
215
+ "type": "integer",
216
+ "minimum": 0
217
+ },
218
+ "regionType": {
219
+ "type": "integer",
220
+ "minimum": 0,
221
+ "maximum": 6
222
+ },
223
+ "regionCreationMode": {
224
+ "type": "string",
225
+ "enum": ["center", "corner"]
226
+ },
227
+ "regionSize": {
228
+ "type": "number",
229
+ "minimum": 1
230
+ },
231
+ "imageCompressionQuality": {
232
+ "type": "integer",
233
+ "minimum": 4,
234
+ "maximum": 32
235
+ },
236
+ "animationCompressionQuality": {
237
+ "type": "integer",
238
+ "minimum": 4,
239
+ "maximum": 32
240
+ },
241
+ "GPUTileCache": {
242
+ "type": "integer",
243
+ "multipleOf": 256,
244
+ "minimum": 1024
245
+ },
246
+ "systemTileCache": {
247
+ "type": "integer",
248
+ "multipleOf": 128,
249
+ "minimum": 1024
250
+ },
251
+ "contourDecimation": {
252
+ "type": "integer",
253
+ "minimum": 1,
254
+ "maximum": 32
255
+ },
256
+ "contourCompressionLevel": {
257
+ "type": "integer",
258
+ "minimum": 0,
259
+ "maximum": 19
260
+ },
261
+ "contourChunkSize": {
262
+ "type": "integer",
263
+ "multipleOf": 25000,
264
+ "minimum": 25000,
265
+ "maximum": 1000000
266
+ },
267
+ "contourControlMapWidth": {
268
+ "type": "integer",
269
+ "multipleOf": 128,
270
+ "minimum": 128,
271
+ "maximum": 1024
272
+ },
273
+ "streamContoursWhileZooming": {
274
+ "type": "boolean"
275
+ },
276
+ "lowBandwidthMode": {
277
+ "type": "boolean"
278
+ },
279
+ "stopAnimationPlayback": {
280
+ "type": "integer",
281
+ "minimum": 5,
282
+ "maximum": 30
283
+ },
284
+ "pixelGridVisible": {
285
+ "type": "boolean"
286
+ },
287
+ "pixelGridColor": {
288
+ "type": "string"
289
+ },
290
+ "codeSnippetsEnabled": {
291
+ "type": "boolean"
292
+ },
293
+ "limitOverlayRedraw": {
294
+ "type": "boolean",
295
+ "default": true
296
+ },
297
+ "cursorInfoVisible": {
298
+ "type": "string",
299
+ "enum": ["always", "activeImage", "hideTiled", "never"],
300
+ "default": "activeImage"
301
+ },
302
+ "keepLastUsedFolder": {
303
+ "type": "boolean",
304
+ "default": false
305
+ },
306
+ "lastUsedFolder": {
307
+ "type": "string",
308
+ "default": ""
309
+ },
310
+ "imageMultiPanelEnabled": {
311
+ "type": "boolean",
312
+ "default": false
313
+ },
314
+ "imagePanelMode": {
315
+ "type": "string",
316
+ "enum": ["dynamic", "fixed"],
317
+ "default": "dynamic"
318
+ },
319
+ "imagePanelColumns": {
320
+ "type": "number",
321
+ "minimum": 1,
322
+ "default": 2
323
+ },
324
+ "imagePanelRows": {
325
+ "type": "number",
326
+ "minimum": 1,
327
+ "default": 2
328
+ },
329
+ "statsPanelEnabled": {
330
+ "type": "boolean",
331
+ "default": false
332
+ },
333
+ "statsPanelMode": {
334
+ "type": "integer",
335
+ "minimum": 0,
336
+ "default": 0
337
+ },
338
+ "telemetryUuid": {
339
+ "type": "string"
340
+ },
341
+ "telemetryMode": {
342
+ "type": "string",
343
+ "enum": ["none", "minimal", "usage"],
344
+ "default": "usage"
345
+ },
346
+ "telemetryConsentShown": {
347
+ "type": "boolean",
348
+ "default": false
349
+ },
350
+ "telemetryLogging": {
351
+ "type": "boolean",
352
+ "default": false
353
+ },
354
+ "fileFilterMode": {
355
+ "type": "string",
356
+ "enum": ["content", "extension", "all"],
357
+ "default": "content"
358
+ },
359
+ "pvAxesOrderReverse": {
360
+ "type": "boolean"
361
+ },
362
+ "autoWCSMatching": {
363
+ "type": "integer",
364
+ "minimum": 0,
365
+ "maximum": 7
366
+ },
367
+ "colormapHex": {
368
+ "type": "string"
369
+ },
370
+ "colormapHexStart": {
371
+ "type": "string"
372
+ },
373
+ "dynamicLayoutEnable": {
374
+ "type": "boolean"
375
+ },
376
+ "isHighDimPriority": {
377
+ "type": "boolean"
378
+ },
379
+ "dynamicLayout": {
380
+ "type": "object"
381
+ },
382
+ "annotationColor": {
383
+ "type": "string"
384
+ },
385
+ "annotationLineWidth": {
386
+ "type": "number"
387
+ },
388
+ "annotationDashLength": {
389
+ "type": "number"
390
+ },
391
+ "pointAnnotationShape": {
392
+ "type": "integer",
393
+ "minimum": 0,
394
+ "maximum": 7
395
+ },
396
+ "pointAnnotationWidth": {
397
+ "type": "number"
398
+ },
399
+ "textAnnotationLineWidth": {
400
+ "type": "number"
401
+ },
402
+ "stopAnimationPlaybackMinutes": {
403
+ "type": "number"
404
+ },
405
+ "pvPreviewCubeSizeLimit": {
406
+ "type": "number"
407
+ },
408
+ "pvPreviewCubeSizeLimitUnit": {
409
+ "type": "string",
410
+ "enum": ["TB", "GB", "MB", "kB", "B"]
411
+ },
412
+ "logEventList": {
413
+ "type": "array",
414
+ "items": {
415
+ "type": "number"
416
+ }
417
+ },
418
+ "catalogDisplayedColumnSize": {
419
+ "type": "number"
420
+ },
421
+ "catalogTableSeparatorPosition": {
422
+ "type": "string"
423
+ },
424
+ "checkNewRelease": {
425
+ "type": "boolean"
426
+ },
427
+ "latestRelease": {
428
+ "type": "string"
429
+ },
430
+ "compatibilityAipsBeamSupport": {
431
+ "type": "boolean"
432
+ }
433
+ }
434
+ }
@@ -0,0 +1,200 @@
1
+ /* This program converts a schema file into a header which can be included in
2
+ the CARTA backend at compile time. The header contains an unsigned char array
3
+ containing the raw data, an unsigned int containing the array length, and a
4
+ std::string constructed from these variables.
5
+
6
+ Based on: https://github.com/mortie/strliteral
7
+ */
8
+
9
+ #include <stdlib.h>
10
+ #include <stdio.h>
11
+ #include <stdint.h>
12
+ #include <string.h>
13
+ #include <ctype.h>
14
+
15
+ static void make_identifier(char *str) {
16
+ char c;
17
+ size_t i;
18
+ for (i = 0; (c = str[i]) != '\0'; ++i) {
19
+ if (c == '.') {
20
+ str[i] = '\0';
21
+ return;
22
+ } else if (!(
23
+ (c >= '0' && c <= '9') ||
24
+ (c >= 'a' && c <= 'z') ||
25
+ (c >= 'A' && c <= 'Z'))) {
26
+ str[i] = '_';
27
+ }
28
+ }
29
+ }
30
+
31
+ static void make_headername(char *str) {
32
+ char c;
33
+ size_t i;
34
+ for (i = 0; (c = str[i]) != '\0'; ++i) {
35
+ if (c >= 'a' && c <= 'z') {
36
+ str[i] = toupper((unsigned char) c);
37
+ }
38
+ }
39
+ }
40
+
41
+ /* strdup is actually a POSIX thing, not a C thing, so don't use it */
42
+ static char *dupstr(char *str) {
43
+ size_t len = strlen(str);
44
+ char *dup = malloc(len + 1);
45
+ strcpy(dup, str);
46
+ dup[len] = '\0';
47
+ return dup;
48
+ }
49
+
50
+ int main(int argc, char **argv) {
51
+ int ret = 0;
52
+ char *inp = "stdin", *outp = "stdout";
53
+ FILE *inf = stdin, *outf = stdout;
54
+ char *inbase = NULL;
55
+ char *ident = NULL;
56
+ char *headername = NULL;
57
+ char *buffer = NULL;
58
+ char *conststr = "const ";
59
+ int alwaysescape = 0;
60
+ size_t maxlength = 100;
61
+
62
+ if (argc < 3) {
63
+ fprintf(stderr, "USAGE: schemacompiler <input> <output>\n");
64
+ goto fail;
65
+ }
66
+
67
+ inp = argv[1];
68
+ inf = fopen(inp, "rb");
69
+ if (inf == NULL) {
70
+ perror(inp);
71
+ goto fail;
72
+ }
73
+
74
+ (inbase = strrchr(inp, '/')) ? ++inbase : (inbase = inp);
75
+ ident = dupstr(inbase);
76
+ make_identifier(ident);
77
+
78
+ headername = dupstr(ident);
79
+ make_headername(headername);
80
+
81
+ outp = argv[2];
82
+ outf = fopen(outp, "w");
83
+ if (outf == NULL) {
84
+ perror(outp);
85
+ goto fail;
86
+ }
87
+
88
+ if (fprintf(outf, "#ifndef _%s\n#define _%s\n\nnamespace CARTASCHEMA {\n\n",
89
+ headername, headername) < 0) {
90
+ perror("write header");
91
+ goto fail;
92
+ }
93
+
94
+ if (fprintf(outf, "%sunsigned char %s_char[] =\n\t\"", conststr, ident) < 0) {
95
+ perror("write char header");
96
+ goto fail;
97
+ }
98
+
99
+ buffer = malloc(maxlength + 4);
100
+
101
+ size_t linechar = 0;
102
+ size_t length = 0;
103
+ int c;
104
+ while ((c = fgetc(inf)) != EOF) {
105
+ if (alwaysescape) {
106
+ buffer[linechar++] = '\\';
107
+ buffer[linechar++] = '0' + ((c & 0700) >> 6);
108
+ buffer[linechar++] = '0' + ((c & 0070) >> 3);
109
+ buffer[linechar++] = '0' + ((c & 0007) >> 0);
110
+ } else if (c >= 32 && c <= 126 && c != '"' && c != '\\' && c != '?' && c != ':' && c != '%') {
111
+ buffer[linechar++] = (char)c;
112
+ } else if (c == '\r') {
113
+ buffer[linechar++] = '\\';
114
+ buffer[linechar++] = 'r';
115
+ } else if (c == '\n') {
116
+ buffer[linechar++] = '\\';
117
+ buffer[linechar++] = 'n';
118
+ } else if (c == '\t') {
119
+ buffer[linechar++] = '\\';
120
+ buffer[linechar++] = 't';
121
+ } else if (c == '\"') {
122
+ buffer[linechar++] = '\\';
123
+ buffer[linechar++] = '"';
124
+ } else if (c == '\\') {
125
+ buffer[linechar++] = '\\';
126
+ buffer[linechar++] = '\\';
127
+ } else {
128
+ buffer[linechar++] = '\\';
129
+ buffer[linechar++] = '0' + ((c & 0700) >> 6);
130
+ buffer[linechar++] = '0' + ((c & 0070) >> 3);
131
+ buffer[linechar++] = '0' + ((c & 0007) >> 0);
132
+ }
133
+
134
+ length += 1;
135
+
136
+ if (linechar >= maxlength) {
137
+ if (fwrite(buffer, 1, linechar, outf) != linechar) {
138
+ perror("write");
139
+ goto fail;
140
+ }
141
+
142
+ if (fwrite("\"\n\t\"", 1, 4, outf) != 4) {
143
+ perror("write");
144
+ goto fail;
145
+ }
146
+
147
+ linechar = 0;
148
+ }
149
+ }
150
+
151
+ if (linechar >= 1) {
152
+ if (fwrite(buffer, 1, linechar, outf) != linechar) {
153
+ perror("write buffer");
154
+ goto fail;
155
+ }
156
+ }
157
+
158
+ if (ferror(inf)) {
159
+ perror("read");
160
+ goto fail;
161
+ }
162
+
163
+ if (fprintf(outf, "\";\n\n%sunsigned int %s_len = %u;\n",
164
+ conststr, ident, (unsigned int)length) < 0) {
165
+ perror("write char footer");
166
+ goto fail;
167
+ }
168
+
169
+ if (fprintf(outf, "\ninline std::string_view %s(reinterpret_cast<%schar*>(%s_char), %s_len);\n",
170
+ ident, conststr, ident, ident) < 0) {
171
+ perror("write string");
172
+ goto fail;
173
+ }
174
+
175
+ if (fprintf(outf, "\n} // CARTASCHEMA\n#endif // _%s\n",
176
+ headername) < 0) {
177
+ perror("write footer");
178
+ goto fail;
179
+ }
180
+
181
+ if (fclose(inf) == EOF) {
182
+ perror("close");
183
+ goto fail;
184
+ }
185
+
186
+ if (fclose(outf) == EOF) {
187
+ perror("close");
188
+ goto fail;
189
+ }
190
+
191
+ exit:
192
+ free(ident);
193
+ free(headername);
194
+ free(buffer);
195
+ return ret;
196
+
197
+ fail:
198
+ ret = 1;
199
+ goto exit;
200
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Snippet",
4
+ "description": "Schema for CARTA Snippet (Version 1)",
5
+ "$id": "https://cartavis.org/schemas/snippet_schema_1.json",
6
+ "type": "object",
7
+ "required": ["snippetVersion", "frontendVersion", "code"],
8
+ "properties": {
9
+ "snippetVersion": {
10
+ "description": "The version of the snippet contained",
11
+ "type": "integer",
12
+ "minimum": 1,
13
+ "maximum": 1
14
+ },
15
+ "frontendVersion": {
16
+ "description": "The version of the frontend targeted by this snippet",
17
+ "type": "string"
18
+ },
19
+ "code": {
20
+ "description": "Snippet source code",
21
+ "type": "string"
22
+ },
23
+ "tags": {
24
+ "description": "List of tags associated with this snippet",
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string"
28
+ }
29
+ },
30
+ "categories": {
31
+ "description": "List of categories under which to place this snippet",
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string"
35
+ }
36
+ },
37
+ "requires": {
38
+ "description": "List of snippets (by name) which need to be run before running this snippet",
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ }
43
+ }
44
+ }
45
+ }