@vitessce/schemas 3.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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -0
  3. package/dist/index.js +16360 -0
  4. package/dist-tsc/file-def-options-legacy.d.ts +72 -0
  5. package/dist-tsc/file-def-options-legacy.d.ts.map +1 -0
  6. package/dist-tsc/file-def-options-legacy.js +28 -0
  7. package/dist-tsc/file-def-options.d.ts +417 -0
  8. package/dist-tsc/file-def-options.d.ts.map +1 -0
  9. package/dist-tsc/file-def-options.js +139 -0
  10. package/dist-tsc/index.d.ts +11 -0
  11. package/dist-tsc/index.d.ts.map +1 -0
  12. package/dist-tsc/index.js +10 -0
  13. package/dist-tsc/previous-config-meta.d.ts +251 -0
  14. package/dist-tsc/previous-config-meta.d.ts.map +1 -0
  15. package/dist-tsc/previous-config-meta.js +22 -0
  16. package/dist-tsc/previous-config-schemas.d.ts +4053 -0
  17. package/dist-tsc/previous-config-schemas.d.ts.map +1 -0
  18. package/dist-tsc/previous-config-schemas.js +204 -0
  19. package/dist-tsc/previous-config-upgraders.d.ts +25 -0
  20. package/dist-tsc/previous-config-upgraders.d.ts.map +1 -0
  21. package/dist-tsc/previous-config-upgraders.js +589 -0
  22. package/dist-tsc/raster-json.d.ts +274 -0
  23. package/dist-tsc/raster-json.d.ts.map +1 -0
  24. package/dist-tsc/raster-json.js +36 -0
  25. package/dist-tsc/schema-builders.d.ts +465 -0
  26. package/dist-tsc/schema-builders.d.ts.map +1 -0
  27. package/dist-tsc/schema-builders.js +127 -0
  28. package/dist-tsc/shared.d.ts +145 -0
  29. package/dist-tsc/shared.d.ts.map +1 -0
  30. package/dist-tsc/shared.js +100 -0
  31. package/dist-tsc/spatial-layers.d.ts +112 -0
  32. package/dist-tsc/spatial-layers.d.ts.map +1 -0
  33. package/dist-tsc/spatial-layers.js +81 -0
  34. package/dist-tsc/view-config-utils.test.d.ts +2 -0
  35. package/dist-tsc/view-config-utils.test.d.ts.map +1 -0
  36. package/dist-tsc/view-config-utils.test.fixtures.d.ts +495 -0
  37. package/dist-tsc/view-config-utils.test.fixtures.d.ts.map +1 -0
  38. package/dist-tsc/view-config-utils.test.fixtures.js +881 -0
  39. package/dist-tsc/view-config-utils.test.js +23 -0
  40. package/dist-tsc/view-config-versions.d.ts +6 -0
  41. package/dist-tsc/view-config-versions.d.ts.map +1 -0
  42. package/dist-tsc/view-config-versions.js +78 -0
  43. package/package.json +49 -0
  44. package/src/file-def-options-legacy.js +34 -0
  45. package/src/file-def-options.ts +158 -0
  46. package/src/index.ts +41 -0
  47. package/src/missing-types.d.ts +1 -0
  48. package/src/previous-config-meta.ts +85 -0
  49. package/src/previous-config-schemas.ts +259 -0
  50. package/src/previous-config-upgraders.ts +739 -0
  51. package/src/raster-json.ts +38 -0
  52. package/src/schema-builders.ts +179 -0
  53. package/src/shared.ts +158 -0
  54. package/src/spatial-layers.ts +103 -0
  55. package/src/view-config-utils.test.fixtures.ts +901 -0
  56. package/src/view-config-utils.test.ts +39 -0
  57. package/src/view-config-versions.ts +87 -0
@@ -0,0 +1,145 @@
1
+ import { z } from 'zod';
2
+ export declare const coordinationTypeName: z.ZodString;
3
+ export declare const coordinationScopeName: z.ZodString;
4
+ export declare const componentCoordinationScopes: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
5
+ export declare const componentCoordinationScopesBy: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>>;
6
+ export declare const rgbArray: z.ZodArray<z.ZodNumber, "many">;
7
+ declare const treeNodeBase: z.ZodObject<{
8
+ name: z.ZodString;
9
+ color: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ name: string;
12
+ color?: number[] | undefined;
13
+ }, {
14
+ name: string;
15
+ color?: number[] | undefined;
16
+ }>;
17
+ declare const treeNodeLeaf: z.ZodObject<{
18
+ name: z.ZodString;
19
+ color: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
20
+ set: z.ZodArray<z.ZodString, "many">;
21
+ }, "strip", z.ZodTypeAny, {
22
+ set: string[];
23
+ name: string;
24
+ color?: number[] | undefined;
25
+ }, {
26
+ set: string[];
27
+ name: string;
28
+ color?: number[] | undefined;
29
+ }>;
30
+ declare type TreeNodeLeaf = z.input<typeof treeNodeLeaf>;
31
+ declare type TreeNodeNonLeaf = z.input<typeof treeNodeBase> & {
32
+ children: Array<TreeNodeNonLeaf | TreeNodeLeaf>;
33
+ };
34
+ declare const treeNodeLeafProbabilistic: z.ZodObject<{
35
+ name: z.ZodString;
36
+ color: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
37
+ set: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodNullable<z.ZodNumber>], null>, "many">;
38
+ }, "strip", z.ZodTypeAny, {
39
+ set: [string, number | null][];
40
+ name: string;
41
+ color?: number[] | undefined;
42
+ }, {
43
+ set: [string, number | null][];
44
+ name: string;
45
+ color?: number[] | undefined;
46
+ }>;
47
+ declare type TreeNodeLeafProbabilistic = z.infer<typeof treeNodeLeafProbabilistic>;
48
+ declare type TreeNodeNonLeafProbabilistic = (z.infer<typeof treeNodeBase> & {
49
+ children: Array<TreeNodeNonLeafProbabilistic | TreeNodeLeafProbabilistic>;
50
+ });
51
+ declare type TreeNode = TreeNodeLeaf | TreeNodeNonLeaf | TreeNodeLeafProbabilistic | TreeNodeNonLeafProbabilistic;
52
+ /**
53
+ * Transform a node object using a transform function.
54
+ * @param {object} node A node object.
55
+ * @param {function} predicate Returns true if a node matches a condition of interest.
56
+ * @param {function} transform Takes the node matching the predicate as input, returns
57
+ * a transformed version of the node.
58
+ * @param {array} transformedPaths This array parameter is mutated. The path of
59
+ * each transformed node is appended to this array.
60
+ * @param {string[]} The current path of the node being updated, used internally
61
+ * during recursion.
62
+ * @returns {object} The updated node.
63
+ */
64
+ export declare function nodeTransform(node: TreeNode, predicate: (a: TreeNode, b?: any) => boolean, transform: (a: any, b?: any) => any, transformedPaths: Array<string[]>, currPath?: string[] | null): TreeNode;
65
+ export declare const obsSetsSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
66
+ version: z.ZodLiteral<"0.1.3">;
67
+ tree: z.ZodArray<z.ZodType<TreeNodeNonLeafProbabilistic, z.ZodTypeDef, TreeNodeNonLeafProbabilistic>, "many">;
68
+ }, "strip", z.ZodTypeAny, {
69
+ version: "0.1.3";
70
+ tree: TreeNodeNonLeafProbabilistic[];
71
+ }, {
72
+ version: "0.1.3";
73
+ tree: TreeNodeNonLeafProbabilistic[];
74
+ }>, z.ZodObject<{
75
+ version: z.ZodLiteral<"0.1.2">;
76
+ tree: z.ZodArray<z.ZodType<TreeNodeNonLeaf, z.ZodTypeDef, TreeNodeNonLeaf>, "many">;
77
+ }, "strip", z.ZodTypeAny, {
78
+ version: "0.1.2";
79
+ tree: TreeNodeNonLeaf[];
80
+ }, {
81
+ version: "0.1.2";
82
+ tree: TreeNodeNonLeaf[];
83
+ }>]>, {
84
+ version: "0.1.3";
85
+ tree: TreeNodeNonLeafProbabilistic[];
86
+ }, {
87
+ version: "0.1.2";
88
+ tree: TreeNodeNonLeaf[];
89
+ } | {
90
+ version: "0.1.3";
91
+ tree: TreeNodeNonLeafProbabilistic[];
92
+ }>;
93
+ export declare const obsSetsTabularSchema: z.ZodArray<z.ZodObject<{
94
+ groupName: z.ZodString;
95
+ setName: z.ZodString;
96
+ setColor: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
97
+ obsId: z.ZodString;
98
+ predictionScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ groupName: string;
101
+ setName: string;
102
+ obsId: string;
103
+ setColor?: number[] | undefined;
104
+ predictionScore?: number | null | undefined;
105
+ }, {
106
+ groupName: string;
107
+ setName: string;
108
+ obsId: string;
109
+ setColor?: number[] | undefined;
110
+ predictionScore?: number | null | undefined;
111
+ }>, "many">;
112
+ export declare const obsSetPath: z.ZodArray<z.ZodString, "many">;
113
+ export declare const requestInit: z.ZodObject<{
114
+ method: z.ZodOptional<z.ZodString>;
115
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
116
+ body: z.ZodOptional<z.ZodString>;
117
+ mode: z.ZodOptional<z.ZodString>;
118
+ credentials: z.ZodOptional<z.ZodString>;
119
+ cache: z.ZodOptional<z.ZodString>;
120
+ redirect: z.ZodOptional<z.ZodString>;
121
+ referrer: z.ZodOptional<z.ZodString>;
122
+ integrity: z.ZodOptional<z.ZodString>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ method?: string | undefined;
125
+ headers?: Record<string, any> | undefined;
126
+ body?: string | undefined;
127
+ mode?: string | undefined;
128
+ credentials?: string | undefined;
129
+ cache?: string | undefined;
130
+ redirect?: string | undefined;
131
+ referrer?: string | undefined;
132
+ integrity?: string | undefined;
133
+ }, {
134
+ method?: string | undefined;
135
+ headers?: Record<string, any> | undefined;
136
+ body?: string | undefined;
137
+ mode?: string | undefined;
138
+ credentials?: string | undefined;
139
+ cache?: string | undefined;
140
+ redirect?: string | undefined;
141
+ referrer?: string | undefined;
142
+ integrity?: string | undefined;
143
+ }>;
144
+ export {};
145
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAShD,eAAO,MAAM,2BAA2B,sFAGvC,CAAC;AAEF,eAAO,MAAM,6BAA6B,0IAMzC,CAAC;AAEF,eAAO,MAAM,QAAQ,iCACT,CAAC;AAEb,QAAA,MAAM,YAAY;;;;;;;;;EAGhB,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;EAEhB,CAAC;AAEH,aAAK,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAEjD,aAAK,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,GAAG;IACpD,QAAQ,EAAE,KAAK,CAAC,eAAe,GAAG,YAAY,CAAC,CAAC;CACjD,CAAC;AAWF,QAAA,MAAM,yBAAyB;;;;;;;;;;;;EAE7B,CAAC;AAEH,aAAK,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E,aAAK,4BAA4B,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,GAAG;IAClE,QAAQ,EAAE,KAAK,CAAC,4BAA4B,GAAG,yBAAyB,CAAC,CAAC;CAC3E,CAAC,CAAC;AAcH,aAAK,QAAQ,GACX,YAAY,GACV,eAAe,GACf,yBAAyB,GACzB,4BAA4B,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,OAAO,EAC5C,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,EACnC,gBAAgB,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,EACjC,QAAQ,GAAE,MAAM,EAAE,GAAG,IAAW,GAC/B,QAAQ,CAoBV;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;EAetB,CAAC;AAEL,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;WAM9B,CAAC;AAEJ,eAAO,MAAM,UAAU,iCAAsB,CAAC;AAE9C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUtB,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { z } from 'zod';
2
+ export const coordinationTypeName = z.string();
3
+ export const coordinationScopeName = z.string();
4
+ const stringOrStringArray = z.union([
5
+ z.string(),
6
+ z.array(z.string()),
7
+ ]);
8
+ const oneOrMoreCoordinationScopeNames = stringOrStringArray;
9
+ export const componentCoordinationScopes = z.record(coordinationTypeName, oneOrMoreCoordinationScopeNames);
10
+ export const componentCoordinationScopesBy = z.record(coordinationTypeName, z.record(coordinationTypeName, z.record(coordinationScopeName, oneOrMoreCoordinationScopeNames)));
11
+ export const rgbArray = z.array(z.number())
12
+ .length(3);
13
+ const treeNodeBase = z.object({
14
+ name: z.string(),
15
+ color: rgbArray.optional(),
16
+ });
17
+ const treeNodeLeaf = treeNodeBase.extend({
18
+ set: z.array(z.string()),
19
+ });
20
+ const treeNodeNonLeaf = treeNodeBase.extend({
21
+ children: z.lazy(() => z.array(z.union([treeNodeNonLeaf, treeNodeLeaf]))),
22
+ });
23
+ const cellSets2 = z.object({
24
+ version: z.literal('0.1.2'),
25
+ tree: z.array(treeNodeNonLeaf),
26
+ });
27
+ const treeNodeLeafProbabilistic = treeNodeBase.extend({
28
+ set: z.array(z.tuple([z.string(), z.number().nullable()])),
29
+ });
30
+ const treeNodeNonLeafProbabilistic = treeNodeBase
31
+ .extend({
32
+ children: z.lazy(() => z.array(z.union([treeNodeNonLeafProbabilistic, treeNodeLeafProbabilistic]))),
33
+ });
34
+ const cellSets3 = z.object({
35
+ version: z.literal('0.1.3'),
36
+ tree: z.array(treeNodeNonLeafProbabilistic),
37
+ });
38
+ /**
39
+ * Transform a node object using a transform function.
40
+ * @param {object} node A node object.
41
+ * @param {function} predicate Returns true if a node matches a condition of interest.
42
+ * @param {function} transform Takes the node matching the predicate as input, returns
43
+ * a transformed version of the node.
44
+ * @param {array} transformedPaths This array parameter is mutated. The path of
45
+ * each transformed node is appended to this array.
46
+ * @param {string[]} The current path of the node being updated, used internally
47
+ * during recursion.
48
+ * @returns {object} The updated node.
49
+ */
50
+ export function nodeTransform(node, predicate, transform, transformedPaths, currPath = null) {
51
+ let newPath;
52
+ if (!currPath) {
53
+ newPath = [node.name];
54
+ }
55
+ else {
56
+ newPath = [...currPath];
57
+ }
58
+ if (predicate(node, newPath)) {
59
+ transformedPaths.push(newPath);
60
+ return transform(node, newPath);
61
+ }
62
+ if ('children' in node) {
63
+ return {
64
+ ...node,
65
+ children: node.children.map((child) => nodeTransform(child, predicate, transform, transformedPaths, newPath.concat([child.name]))),
66
+ };
67
+ }
68
+ return node;
69
+ }
70
+ export const obsSetsSchema = z.union([cellSets3, cellSets2])
71
+ .transform((v) => {
72
+ if (v.version === '0.1.3')
73
+ return v;
74
+ // To upgrade from cell-sets schema 0.1.2 to 0.1.3,
75
+ // add a confidence value of null for each cell ID.
76
+ return {
77
+ ...v,
78
+ version: '0.1.3',
79
+ tree: v.tree.map(levelZeroNode => nodeTransform(levelZeroNode, (n) => !('children' in n) && Array.isArray(n.set), (n) => ({ ...n, set: n.set.map((itemId) => ([itemId, null])) }), [])),
80
+ };
81
+ });
82
+ export const obsSetsTabularSchema = z.array(z.object({
83
+ groupName: z.string(),
84
+ setName: z.string(),
85
+ setColor: rgbArray.optional(),
86
+ obsId: z.string(),
87
+ predictionScore: z.number().nullable().optional(),
88
+ }));
89
+ export const obsSetPath = z.array(z.string());
90
+ export const requestInit = z.object({
91
+ method: z.string().optional(),
92
+ headers: z.record(z.any()).optional(),
93
+ body: z.string().optional(),
94
+ mode: z.string().optional(),
95
+ credentials: z.string().optional(),
96
+ cache: z.string().optional(),
97
+ redirect: z.string().optional(),
98
+ referrer: z.string().optional(),
99
+ integrity: z.string().optional(),
100
+ });
@@ -0,0 +1,112 @@
1
+ import { z } from 'zod';
2
+ export declare const imageLayerObj: z.ZodArray<z.ZodObject<{
3
+ channels: z.ZodArray<z.ZodObject<{
4
+ color: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
5
+ selection: z.ZodRecord<z.ZodString, z.ZodAny>;
6
+ slider: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
7
+ visible: z.ZodOptional<z.ZodBoolean>;
8
+ }, "strict", z.ZodTypeAny, {
9
+ selection: Record<string, any>;
10
+ color?: number[] | undefined;
11
+ slider?: number[] | undefined;
12
+ visible?: boolean | undefined;
13
+ }, {
14
+ selection: Record<string, any>;
15
+ color?: number[] | undefined;
16
+ slider?: number[] | undefined;
17
+ visible?: boolean | undefined;
18
+ }>, "many">;
19
+ colormap: z.ZodNullable<z.ZodString>;
20
+ transparentColor: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
21
+ index: z.ZodNumber;
22
+ opacity: z.ZodNumber;
23
+ modelMatrix: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
24
+ domainType: z.ZodOptional<z.ZodEnum<["Full", "Min/Max"]>>;
25
+ resolution: z.ZodOptional<z.ZodNumber>;
26
+ xSlice: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
27
+ renderingMode: z.ZodOptional<z.ZodString>;
28
+ ySlice: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
29
+ zSlice: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
30
+ type: z.ZodOptional<z.ZodEnum<["raster", "bitmask"]>>;
31
+ use3d: z.ZodOptional<z.ZodBoolean>;
32
+ visible: z.ZodOptional<z.ZodBoolean>;
33
+ }, "strict", z.ZodTypeAny, {
34
+ channels: {
35
+ selection: Record<string, any>;
36
+ color?: number[] | undefined;
37
+ slider?: number[] | undefined;
38
+ visible?: boolean | undefined;
39
+ }[];
40
+ colormap: string | null;
41
+ index: number;
42
+ opacity: number;
43
+ transparentColor?: number[] | null | undefined;
44
+ modelMatrix?: number[] | undefined;
45
+ domainType?: "Full" | "Min/Max" | undefined;
46
+ resolution?: number | undefined;
47
+ xSlice?: any[] | null | undefined;
48
+ renderingMode?: string | undefined;
49
+ ySlice?: any[] | null | undefined;
50
+ zSlice?: any[] | null | undefined;
51
+ type?: "raster" | "bitmask" | undefined;
52
+ use3d?: boolean | undefined;
53
+ visible?: boolean | undefined;
54
+ }, {
55
+ channels: {
56
+ selection: Record<string, any>;
57
+ color?: number[] | undefined;
58
+ slider?: number[] | undefined;
59
+ visible?: boolean | undefined;
60
+ }[];
61
+ colormap: string | null;
62
+ index: number;
63
+ opacity: number;
64
+ transparentColor?: number[] | null | undefined;
65
+ modelMatrix?: number[] | undefined;
66
+ domainType?: "Full" | "Min/Max" | undefined;
67
+ resolution?: number | undefined;
68
+ xSlice?: any[] | null | undefined;
69
+ renderingMode?: string | undefined;
70
+ ySlice?: any[] | null | undefined;
71
+ zSlice?: any[] | null | undefined;
72
+ type?: "raster" | "bitmask" | undefined;
73
+ use3d?: boolean | undefined;
74
+ visible?: boolean | undefined;
75
+ }>, "many">;
76
+ export declare const cellsLayerObj: z.ZodObject<{
77
+ visible: z.ZodBoolean;
78
+ stroked: z.ZodBoolean;
79
+ radius: z.ZodNumber;
80
+ opacity: z.ZodNumber;
81
+ }, "strip", z.ZodTypeAny, {
82
+ visible: boolean;
83
+ opacity: number;
84
+ stroked: boolean;
85
+ radius: number;
86
+ }, {
87
+ visible: boolean;
88
+ opacity: number;
89
+ stroked: boolean;
90
+ radius: number;
91
+ }>;
92
+ export declare const neighborhoodsLayerObj: z.ZodObject<{
93
+ visible: z.ZodBoolean;
94
+ }, "strip", z.ZodTypeAny, {
95
+ visible: boolean;
96
+ }, {
97
+ visible: boolean;
98
+ }>;
99
+ export declare const moleculesLayerObj: z.ZodObject<{
100
+ visible: z.ZodBoolean;
101
+ radius: z.ZodNumber;
102
+ opacity: z.ZodNumber;
103
+ }, "strip", z.ZodTypeAny, {
104
+ visible: boolean;
105
+ opacity: number;
106
+ radius: number;
107
+ }, {
108
+ visible: boolean;
109
+ opacity: number;
110
+ radius: number;
111
+ }>;
112
+ //# sourceMappingURL=spatial-layers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial-layers.d.ts","sourceRoot":"","sources":["../src/spatial-layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAmFzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;EAKxB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;EAEhC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ export const imageLayerObj = z.array(z.object({
3
+ channels: z.array(z.object({
4
+ color: z.array(z.number())
5
+ .describe('The color to use when rendering this channel under the null colormap.')
6
+ .optional(),
7
+ selection: z.record(z.any())
8
+ .describe('Determines the channel selection, e.g. some Z and time slice.'),
9
+ slider: z.array(z.number())
10
+ .describe('Determines the range for color mapping.')
11
+ .optional(),
12
+ visible: z.boolean()
13
+ .describe('Determines whether this channel of the layer will be rendered in the spatial component.')
14
+ .optional(),
15
+ })
16
+ .strict()),
17
+ colormap: z.string()
18
+ .nullable(),
19
+ transparentColor: z.array(z.number().describe('One of R G or B (0 - 255).'))
20
+ .length(3)
21
+ .describe('Determines the color to be set to opacity 0')
22
+ .nullable()
23
+ .optional(),
24
+ index: z
25
+ .number()
26
+ .describe('The index of the layer among the array of layers available in the image file.'),
27
+ opacity: z.number(),
28
+ modelMatrix: z.array(z.number())
29
+ .length(16)
30
+ .describe('transformation matrix for this layer')
31
+ .optional(),
32
+ domainType: z.enum(['Full', 'Min/Max'])
33
+ .describe('Determines the extent of the channel slider input element in the layer controller.')
34
+ .optional(),
35
+ resolution: z.number()
36
+ .describe('Resolution of 3D volumetric rendering')
37
+ .optional(),
38
+ xSlice: z.array(z.any())
39
+ .length(2)
40
+ .describe('Slice bounds')
41
+ .nullable()
42
+ .optional(),
43
+ renderingMode: z
44
+ .string()
45
+ .describe('Rendering mode of 3D volumetric rendering')
46
+ .optional(),
47
+ ySlice: z.array(z.any())
48
+ .length(2)
49
+ .describe('Slice bounds')
50
+ .nullable()
51
+ .optional(),
52
+ zSlice: z.array(z.any())
53
+ .length(2)
54
+ .describe('Slice bounds')
55
+ .nullable()
56
+ .optional(),
57
+ type: z.enum(['raster', 'bitmask'])
58
+ .optional(),
59
+ use3d: z.boolean()
60
+ .optional(),
61
+ visible: z
62
+ .boolean()
63
+ .describe('Determines whether this entire layer will be rendered in the spatial component.')
64
+ .optional(),
65
+ })
66
+ .strict()
67
+ .describe('The properties of this object are the rendering settings for the raster layer.'));
68
+ export const cellsLayerObj = z.object({
69
+ visible: z.boolean(),
70
+ stroked: z.boolean(),
71
+ radius: z.number(),
72
+ opacity: z.number(),
73
+ });
74
+ export const neighborhoodsLayerObj = z.object({
75
+ visible: z.boolean(),
76
+ });
77
+ export const moleculesLayerObj = z.object({
78
+ visible: z.boolean(),
79
+ radius: z.number(),
80
+ opacity: z.number(),
81
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=view-config-utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-config-utils.test.d.ts","sourceRoot":"","sources":["../src/view-config-utils.test.ts"],"names":[],"mappings":""}