@milaboratories/miplots4 1.0.130 → 1.0.132
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/heatmap/components/Annotations/Annotation.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.js +34 -33
- package/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/heatmap/components/Chart.d.ts.map +1 -1
- package/dist/heatmap/components/Chart.js +90 -85
- package/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/heatmap/components/types.d.ts +2 -1
- package/dist/heatmap/components/types.d.ts.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +6 -3
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.js +59 -60
- package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/scatterplot/components/ChartTooltip.d.ts.map +1 -1
- package/dist/scatterplot/components/ChartTooltip.js +42 -40
- package/dist/scatterplot/components/ChartTooltip.js.map +1 -1
- package/dist/scatterplot/dots.d.ts +2 -1
- package/dist/scatterplot/dots.d.ts.map +1 -1
- package/dist/scatterplot/dots.js +26 -27
- package/dist/scatterplot/dots.js.map +1 -1
- package/dist/scatterplot/getLayersData.d.ts.map +1 -1
- package/dist/scatterplot/getLayersData.js +15 -12
- package/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/scatterplot/index.d.ts.map +1 -1
- package/dist/scatterplot/index.js +66 -72
- package/dist/scatterplot/index.js.map +1 -1
- package/dist/scatterplot/utils/createLegendInfo.d.ts +3 -3
- package/dist/scatterplot/utils/createLegendInfo.d.ts.map +1 -1
- package/dist/scatterplot/utils/createLegendInfo.js +44 -39
- package/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/scatterplot/utils/formatColumnValue.d.ts +5 -0
- package/dist/scatterplot/utils/formatColumnValue.d.ts.map +1 -0
- package/dist/scatterplot/utils/formatColumnValue.js +11 -0
- package/dist/scatterplot/utils/formatColumnValue.js.map +1 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.d.ts +8 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.d.ts.map +1 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.js +18 -0
- package/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
- package/dist/scatterplot-umap/SettingsImpl.d.ts +6 -3
- package/dist/scatterplot-umap/SettingsImpl.d.ts.map +1 -1
- package/dist/scatterplot-umap/SettingsImpl.js +54 -55
- package/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.d.ts.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.js +88 -86
- package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/scatterplot-umap/index.d.ts.map +1 -1
- package/dist/scatterplot-umap/index.js +98 -92
- package/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/types/bubble.d.ts +44 -12
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/common.d.ts +18 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/dendro.d.ts +111 -8
- package/dist/types/dendro.d.ts.map +1 -1
- package/dist/types/discrete.d.ts +105 -28
- package/dist/types/discrete.d.ts.map +1 -1
- package/dist/types/heatmap.d.ts +187 -28
- package/dist/types/heatmap.d.ts.map +1 -1
- package/dist/types/histogram.d.ts +42 -20
- package/dist/types/histogram.d.ts.map +1 -1
- package/dist/types/scatterplot-umap.d.ts +259 -71
- package/dist/types/scatterplot-umap.d.ts.map +1 -1
- package/dist/types/scatterplot-umap.js +22 -16
- package/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/types/scatterplot.d.ts +273 -71
- package/dist/types/scatterplot.d.ts.map +1 -1
- package/dist/types/scatterplot.js +16 -10
- package/dist/types/scatterplot.js.map +1 -1
- package/dist/utils/arraysAreDifferent.d.ts +2 -0
- package/dist/utils/arraysAreDifferent.d.ts.map +1 -0
- package/dist/utils/arraysAreDifferent.js +7 -0
- package/dist/utils/arraysAreDifferent.js.map +1 -0
- package/dist/utils/getChartEdgeSides.d.ts +1 -1
- package/package.json +1 -1
package/dist/types/bubble.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
name: string;
|
|
10
10
|
show?: boolean | undefined;
|
|
11
|
-
position?: "
|
|
11
|
+
position?: "left" | "center" | "right" | undefined;
|
|
12
12
|
}, {
|
|
13
13
|
name: string;
|
|
14
14
|
show?: boolean | undefined;
|
|
15
|
-
position?: "
|
|
15
|
+
position?: "left" | "center" | "right" | undefined;
|
|
16
16
|
}>;
|
|
17
17
|
size: z.ZodOptional<z.ZodObject<{
|
|
18
18
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -32,10 +32,10 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
32
32
|
position: z.ZodOptional<z.ZodEnum<["inside", "right", "top", "bottom"]>>;
|
|
33
33
|
}, "strip", z.ZodTypeAny, {
|
|
34
34
|
show?: boolean | undefined;
|
|
35
|
-
position?: "right" | "
|
|
35
|
+
position?: "right" | "inside" | "top" | "bottom" | undefined;
|
|
36
36
|
}, {
|
|
37
37
|
show?: boolean | undefined;
|
|
38
|
-
position?: "right" | "
|
|
38
|
+
position?: "right" | "inside" | "top" | "bottom" | undefined;
|
|
39
39
|
}>>;
|
|
40
40
|
frame: z.ZodOptional<z.ZodObject<{
|
|
41
41
|
type: z.ZodOptional<z.ZodEnum<["left", "bottom", "left-bottom", "full", "empty"]>>;
|
|
@@ -57,64 +57,76 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
57
57
|
valueSize: z.ZodObject<{
|
|
58
58
|
type: z.ZodLiteral<"column">;
|
|
59
59
|
value: z.ZodString;
|
|
60
|
+
format: z.ZodOptional<z.ZodString>;
|
|
60
61
|
label: z.ZodOptional<z.ZodString>;
|
|
61
62
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
62
63
|
}, "strip", z.ZodTypeAny, {
|
|
63
64
|
type: "column";
|
|
64
65
|
value: string;
|
|
66
|
+
format?: string | undefined;
|
|
65
67
|
label?: string | undefined;
|
|
66
68
|
valueLabels?: string | undefined;
|
|
67
69
|
}, {
|
|
68
70
|
type: "column";
|
|
69
71
|
value: string;
|
|
72
|
+
format?: string | undefined;
|
|
70
73
|
label?: string | undefined;
|
|
71
74
|
valueLabels?: string | undefined;
|
|
72
75
|
}>;
|
|
73
76
|
valueColor: z.ZodObject<{
|
|
74
77
|
type: z.ZodLiteral<"column">;
|
|
75
78
|
value: z.ZodString;
|
|
79
|
+
format: z.ZodOptional<z.ZodString>;
|
|
76
80
|
label: z.ZodOptional<z.ZodString>;
|
|
77
81
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
78
82
|
}, "strip", z.ZodTypeAny, {
|
|
79
83
|
type: "column";
|
|
80
84
|
value: string;
|
|
85
|
+
format?: string | undefined;
|
|
81
86
|
label?: string | undefined;
|
|
82
87
|
valueLabels?: string | undefined;
|
|
83
88
|
}, {
|
|
84
89
|
type: "column";
|
|
85
90
|
value: string;
|
|
91
|
+
format?: string | undefined;
|
|
86
92
|
label?: string | undefined;
|
|
87
93
|
valueLabels?: string | undefined;
|
|
88
94
|
}>;
|
|
89
95
|
xColumn: z.ZodObject<{
|
|
90
96
|
type: z.ZodLiteral<"column">;
|
|
91
97
|
value: z.ZodString;
|
|
98
|
+
format: z.ZodOptional<z.ZodString>;
|
|
92
99
|
label: z.ZodOptional<z.ZodString>;
|
|
93
100
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
94
101
|
}, "strip", z.ZodTypeAny, {
|
|
95
102
|
type: "column";
|
|
96
103
|
value: string;
|
|
104
|
+
format?: string | undefined;
|
|
97
105
|
label?: string | undefined;
|
|
98
106
|
valueLabels?: string | undefined;
|
|
99
107
|
}, {
|
|
100
108
|
type: "column";
|
|
101
109
|
value: string;
|
|
110
|
+
format?: string | undefined;
|
|
102
111
|
label?: string | undefined;
|
|
103
112
|
valueLabels?: string | undefined;
|
|
104
113
|
}>;
|
|
105
114
|
yColumn: z.ZodObject<{
|
|
106
115
|
type: z.ZodLiteral<"column">;
|
|
107
116
|
value: z.ZodString;
|
|
117
|
+
format: z.ZodOptional<z.ZodString>;
|
|
108
118
|
label: z.ZodOptional<z.ZodString>;
|
|
109
119
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
110
120
|
}, "strip", z.ZodTypeAny, {
|
|
111
121
|
type: "column";
|
|
112
122
|
value: string;
|
|
123
|
+
format?: string | undefined;
|
|
113
124
|
label?: string | undefined;
|
|
114
125
|
valueLabels?: string | undefined;
|
|
115
126
|
}, {
|
|
116
127
|
type: "column";
|
|
117
128
|
value: string;
|
|
129
|
+
format?: string | undefined;
|
|
118
130
|
label?: string | undefined;
|
|
119
131
|
valueLabels?: string | undefined;
|
|
120
132
|
}>;
|
|
@@ -169,7 +181,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
169
181
|
axisLabelsAngle: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<45>, z.ZodLiteral<90>]>>;
|
|
170
182
|
}, "strip", z.ZodTypeAny, {
|
|
171
183
|
title?: string | undefined;
|
|
172
|
-
position?: "
|
|
184
|
+
position?: "left" | "right" | undefined;
|
|
173
185
|
showTicks?: boolean | undefined;
|
|
174
186
|
sorting?: "asc" | "desc" | undefined;
|
|
175
187
|
showTitle?: boolean | undefined;
|
|
@@ -177,7 +189,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
177
189
|
axisLabelsAngle?: 0 | 45 | 90 | undefined;
|
|
178
190
|
}, {
|
|
179
191
|
title?: string | undefined;
|
|
180
|
-
position?: "
|
|
192
|
+
position?: "left" | "right" | undefined;
|
|
181
193
|
showTicks?: boolean | undefined;
|
|
182
194
|
sorting?: "asc" | "desc" | undefined;
|
|
183
195
|
showTitle?: boolean | undefined;
|
|
@@ -187,16 +199,19 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
187
199
|
facetBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
188
200
|
type: z.ZodLiteral<"column">;
|
|
189
201
|
value: z.ZodString;
|
|
202
|
+
format: z.ZodOptional<z.ZodString>;
|
|
190
203
|
label: z.ZodOptional<z.ZodString>;
|
|
191
204
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
192
205
|
}, "strip", z.ZodTypeAny, {
|
|
193
206
|
type: "column";
|
|
194
207
|
value: string;
|
|
208
|
+
format?: string | undefined;
|
|
195
209
|
label?: string | undefined;
|
|
196
210
|
valueLabels?: string | undefined;
|
|
197
211
|
}, {
|
|
198
212
|
type: "column";
|
|
199
213
|
value: string;
|
|
214
|
+
format?: string | undefined;
|
|
200
215
|
label?: string | undefined;
|
|
201
216
|
valueLabels?: string | undefined;
|
|
202
217
|
}>, "many">>;
|
|
@@ -224,16 +239,19 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
224
239
|
content: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
225
240
|
type: z.ZodLiteral<"column">;
|
|
226
241
|
value: z.ZodString;
|
|
242
|
+
format: z.ZodOptional<z.ZodString>;
|
|
227
243
|
label: z.ZodOptional<z.ZodString>;
|
|
228
244
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
229
245
|
}, "strip", z.ZodTypeAny, {
|
|
230
246
|
type: "column";
|
|
231
247
|
value: string;
|
|
248
|
+
format?: string | undefined;
|
|
232
249
|
label?: string | undefined;
|
|
233
250
|
valueLabels?: string | undefined;
|
|
234
251
|
}, {
|
|
235
252
|
type: "column";
|
|
236
253
|
value: string;
|
|
254
|
+
format?: string | undefined;
|
|
237
255
|
label?: string | undefined;
|
|
238
256
|
valueLabels?: string | undefined;
|
|
239
257
|
}>, "many">>;
|
|
@@ -242,6 +260,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
242
260
|
content?: {
|
|
243
261
|
type: "column";
|
|
244
262
|
value: string;
|
|
263
|
+
format?: string | undefined;
|
|
245
264
|
label?: string | undefined;
|
|
246
265
|
valueLabels?: string | undefined;
|
|
247
266
|
}[] | undefined;
|
|
@@ -250,6 +269,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
250
269
|
content?: {
|
|
251
270
|
type: "column";
|
|
252
271
|
value: string;
|
|
272
|
+
format?: string | undefined;
|
|
253
273
|
label?: string | undefined;
|
|
254
274
|
valueLabels?: string | undefined;
|
|
255
275
|
}[] | undefined;
|
|
@@ -260,29 +280,33 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
260
280
|
title: {
|
|
261
281
|
name: string;
|
|
262
282
|
show?: boolean | undefined;
|
|
263
|
-
position?: "
|
|
283
|
+
position?: "left" | "center" | "right" | undefined;
|
|
264
284
|
};
|
|
265
285
|
valueSize: {
|
|
266
286
|
type: "column";
|
|
267
287
|
value: string;
|
|
288
|
+
format?: string | undefined;
|
|
268
289
|
label?: string | undefined;
|
|
269
290
|
valueLabels?: string | undefined;
|
|
270
291
|
};
|
|
271
292
|
valueColor: {
|
|
272
293
|
type: "column";
|
|
273
294
|
value: string;
|
|
295
|
+
format?: string | undefined;
|
|
274
296
|
label?: string | undefined;
|
|
275
297
|
valueLabels?: string | undefined;
|
|
276
298
|
};
|
|
277
299
|
xColumn: {
|
|
278
300
|
type: "column";
|
|
279
301
|
value: string;
|
|
302
|
+
format?: string | undefined;
|
|
280
303
|
label?: string | undefined;
|
|
281
304
|
valueLabels?: string | undefined;
|
|
282
305
|
};
|
|
283
306
|
yColumn: {
|
|
284
307
|
type: "column";
|
|
285
308
|
value: string;
|
|
309
|
+
format?: string | undefined;
|
|
286
310
|
label?: string | undefined;
|
|
287
311
|
valueLabels?: string | undefined;
|
|
288
312
|
};
|
|
@@ -300,13 +324,14 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
300
324
|
} | undefined;
|
|
301
325
|
legend?: {
|
|
302
326
|
show?: boolean | undefined;
|
|
303
|
-
position?: "right" | "
|
|
327
|
+
position?: "right" | "inside" | "top" | "bottom" | undefined;
|
|
304
328
|
} | undefined;
|
|
305
329
|
tooltips?: {
|
|
306
330
|
show?: boolean | undefined;
|
|
307
331
|
content?: {
|
|
308
332
|
type: "column";
|
|
309
333
|
value: string;
|
|
334
|
+
format?: string | undefined;
|
|
310
335
|
label?: string | undefined;
|
|
311
336
|
valueLabels?: string | undefined;
|
|
312
337
|
}[] | undefined;
|
|
@@ -329,7 +354,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
329
354
|
} | undefined;
|
|
330
355
|
yAxis?: {
|
|
331
356
|
title?: string | undefined;
|
|
332
|
-
position?: "
|
|
357
|
+
position?: "left" | "right" | undefined;
|
|
333
358
|
showTicks?: boolean | undefined;
|
|
334
359
|
sorting?: "asc" | "desc" | undefined;
|
|
335
360
|
showTitle?: boolean | undefined;
|
|
@@ -339,6 +364,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
339
364
|
facetBy?: {
|
|
340
365
|
type: "column";
|
|
341
366
|
value: string;
|
|
367
|
+
format?: string | undefined;
|
|
342
368
|
label?: string | undefined;
|
|
343
369
|
valueLabels?: string | undefined;
|
|
344
370
|
}[] | undefined;
|
|
@@ -354,29 +380,33 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
354
380
|
title: {
|
|
355
381
|
name: string;
|
|
356
382
|
show?: boolean | undefined;
|
|
357
|
-
position?: "
|
|
383
|
+
position?: "left" | "center" | "right" | undefined;
|
|
358
384
|
};
|
|
359
385
|
valueSize: {
|
|
360
386
|
type: "column";
|
|
361
387
|
value: string;
|
|
388
|
+
format?: string | undefined;
|
|
362
389
|
label?: string | undefined;
|
|
363
390
|
valueLabels?: string | undefined;
|
|
364
391
|
};
|
|
365
392
|
valueColor: {
|
|
366
393
|
type: "column";
|
|
367
394
|
value: string;
|
|
395
|
+
format?: string | undefined;
|
|
368
396
|
label?: string | undefined;
|
|
369
397
|
valueLabels?: string | undefined;
|
|
370
398
|
};
|
|
371
399
|
xColumn: {
|
|
372
400
|
type: "column";
|
|
373
401
|
value: string;
|
|
402
|
+
format?: string | undefined;
|
|
374
403
|
label?: string | undefined;
|
|
375
404
|
valueLabels?: string | undefined;
|
|
376
405
|
};
|
|
377
406
|
yColumn: {
|
|
378
407
|
type: "column";
|
|
379
408
|
value: string;
|
|
409
|
+
format?: string | undefined;
|
|
380
410
|
label?: string | undefined;
|
|
381
411
|
valueLabels?: string | undefined;
|
|
382
412
|
};
|
|
@@ -394,13 +424,14 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
394
424
|
} | undefined;
|
|
395
425
|
legend?: {
|
|
396
426
|
show?: boolean | undefined;
|
|
397
|
-
position?: "right" | "
|
|
427
|
+
position?: "right" | "inside" | "top" | "bottom" | undefined;
|
|
398
428
|
} | undefined;
|
|
399
429
|
tooltips?: {
|
|
400
430
|
show?: boolean | undefined;
|
|
401
431
|
content?: {
|
|
402
432
|
type: "column";
|
|
403
433
|
value: string;
|
|
434
|
+
format?: string | undefined;
|
|
404
435
|
label?: string | undefined;
|
|
405
436
|
valueLabels?: string | undefined;
|
|
406
437
|
}[] | undefined;
|
|
@@ -423,7 +454,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
423
454
|
} | undefined;
|
|
424
455
|
yAxis?: {
|
|
425
456
|
title?: string | undefined;
|
|
426
|
-
position?: "
|
|
457
|
+
position?: "left" | "right" | undefined;
|
|
427
458
|
showTicks?: boolean | undefined;
|
|
428
459
|
sorting?: "asc" | "desc" | undefined;
|
|
429
460
|
showTitle?: boolean | undefined;
|
|
@@ -433,6 +464,7 @@ export declare const BubblesSettingsSchema: z.ZodObject<{
|
|
|
433
464
|
facetBy?: {
|
|
434
465
|
type: "column";
|
|
435
466
|
value: string;
|
|
467
|
+
format?: string | undefined;
|
|
436
468
|
label?: string | undefined;
|
|
437
469
|
valueLabels?: string | undefined;
|
|
438
470
|
}[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubble.d.ts","sourceRoot":"","sources":["../../src/types/bubble.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAYtB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"bubble.d.ts","sourceRoot":"","sources":["../../src/types/bubble.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAYtB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8DhC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -21,16 +21,19 @@ export type TitlePosition = z.infer<typeof TitlePositionSchema>;
|
|
|
21
21
|
export declare const ColumnNameSchema: z.ZodObject<{
|
|
22
22
|
type: z.ZodLiteral<"column">;
|
|
23
23
|
value: z.ZodString;
|
|
24
|
+
format: z.ZodOptional<z.ZodString>;
|
|
24
25
|
label: z.ZodOptional<z.ZodString>;
|
|
25
26
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
26
27
|
}, "strip", z.ZodTypeAny, {
|
|
27
28
|
type: "column";
|
|
28
29
|
value: string;
|
|
30
|
+
format?: string | undefined;
|
|
29
31
|
label?: string | undefined;
|
|
30
32
|
valueLabels?: string | undefined;
|
|
31
33
|
}, {
|
|
32
34
|
type: "column";
|
|
33
35
|
value: string;
|
|
36
|
+
format?: string | undefined;
|
|
34
37
|
label?: string | undefined;
|
|
35
38
|
valueLabels?: string | undefined;
|
|
36
39
|
}>;
|
|
@@ -99,16 +102,19 @@ export declare function categoricalAesMappingFromValueSchema<ValueType extends z
|
|
|
99
102
|
columnName: z.ZodObject<{
|
|
100
103
|
type: z.ZodLiteral<"column">;
|
|
101
104
|
value: z.ZodString;
|
|
105
|
+
format: z.ZodOptional<z.ZodString>;
|
|
102
106
|
label: z.ZodOptional<z.ZodString>;
|
|
103
107
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
104
108
|
}, "strip", z.ZodTypeAny, {
|
|
105
109
|
type: "column";
|
|
106
110
|
value: string;
|
|
111
|
+
format?: string | undefined;
|
|
107
112
|
label?: string | undefined;
|
|
108
113
|
valueLabels?: string | undefined;
|
|
109
114
|
}, {
|
|
110
115
|
type: "column";
|
|
111
116
|
value: string;
|
|
117
|
+
format?: string | undefined;
|
|
112
118
|
label?: string | undefined;
|
|
113
119
|
valueLabels?: string | undefined;
|
|
114
120
|
}>;
|
|
@@ -117,6 +123,7 @@ export declare function categoricalAesMappingFromValueSchema<ValueType extends z
|
|
|
117
123
|
columnName: {
|
|
118
124
|
type: "column";
|
|
119
125
|
value: string;
|
|
126
|
+
format?: string | undefined;
|
|
120
127
|
label?: string | undefined;
|
|
121
128
|
valueLabels?: string | undefined;
|
|
122
129
|
};
|
|
@@ -125,6 +132,7 @@ export declare function categoricalAesMappingFromValueSchema<ValueType extends z
|
|
|
125
132
|
columnName: {
|
|
126
133
|
type: "column";
|
|
127
134
|
value: string;
|
|
135
|
+
format?: string | undefined;
|
|
128
136
|
label?: string | undefined;
|
|
129
137
|
valueLabels?: string | undefined;
|
|
130
138
|
};
|
|
@@ -134,16 +142,19 @@ export declare function continuousAesMappingFromValueSchema<ValueType extends z.
|
|
|
134
142
|
columnName: z.ZodObject<{
|
|
135
143
|
type: z.ZodLiteral<"column">;
|
|
136
144
|
value: z.ZodString;
|
|
145
|
+
format: z.ZodOptional<z.ZodString>;
|
|
137
146
|
label: z.ZodOptional<z.ZodString>;
|
|
138
147
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
139
148
|
}, "strip", z.ZodTypeAny, {
|
|
140
149
|
type: "column";
|
|
141
150
|
value: string;
|
|
151
|
+
format?: string | undefined;
|
|
142
152
|
label?: string | undefined;
|
|
143
153
|
valueLabels?: string | undefined;
|
|
144
154
|
}, {
|
|
145
155
|
type: "column";
|
|
146
156
|
value: string;
|
|
157
|
+
format?: string | undefined;
|
|
147
158
|
label?: string | undefined;
|
|
148
159
|
valueLabels?: string | undefined;
|
|
149
160
|
}>;
|
|
@@ -154,6 +165,7 @@ export declare function continuousAesMappingFromValueSchema<ValueType extends z.
|
|
|
154
165
|
columnName: {
|
|
155
166
|
type: "column";
|
|
156
167
|
value: string;
|
|
168
|
+
format?: string | undefined;
|
|
157
169
|
label?: string | undefined;
|
|
158
170
|
valueLabels?: string | undefined;
|
|
159
171
|
};
|
|
@@ -164,6 +176,7 @@ export declare function continuousAesMappingFromValueSchema<ValueType extends z.
|
|
|
164
176
|
columnName: {
|
|
165
177
|
type: "column";
|
|
166
178
|
value: string;
|
|
179
|
+
format?: string | undefined;
|
|
167
180
|
label?: string | undefined;
|
|
168
181
|
valueLabels?: string | undefined;
|
|
169
182
|
};
|
|
@@ -190,16 +203,19 @@ export declare const AxisSettingsSchema: z.ZodObject<{
|
|
|
190
203
|
title: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
191
204
|
type: z.ZodLiteral<"column">;
|
|
192
205
|
value: z.ZodString;
|
|
206
|
+
format: z.ZodOptional<z.ZodString>;
|
|
193
207
|
label: z.ZodOptional<z.ZodString>;
|
|
194
208
|
valueLabels: z.ZodOptional<z.ZodString>;
|
|
195
209
|
}, "strip", z.ZodTypeAny, {
|
|
196
210
|
type: "column";
|
|
197
211
|
value: string;
|
|
212
|
+
format?: string | undefined;
|
|
198
213
|
label?: string | undefined;
|
|
199
214
|
valueLabels?: string | undefined;
|
|
200
215
|
}, {
|
|
201
216
|
type: "column";
|
|
202
217
|
value: string;
|
|
218
|
+
format?: string | undefined;
|
|
203
219
|
label?: string | undefined;
|
|
204
220
|
valueLabels?: string | undefined;
|
|
205
221
|
}>]>>;
|
|
@@ -218,6 +234,7 @@ export declare const AxisSettingsSchema: z.ZodObject<{
|
|
|
218
234
|
title?: string | {
|
|
219
235
|
type: "column";
|
|
220
236
|
value: string;
|
|
237
|
+
format?: string | undefined;
|
|
221
238
|
label?: string | undefined;
|
|
222
239
|
valueLabels?: string | undefined;
|
|
223
240
|
} | undefined;
|
|
@@ -236,6 +253,7 @@ export declare const AxisSettingsSchema: z.ZodObject<{
|
|
|
236
253
|
title?: string | {
|
|
237
254
|
type: "column";
|
|
238
255
|
value: string;
|
|
256
|
+
format?: string | undefined;
|
|
239
257
|
label?: string | undefined;
|
|
240
258
|
valueLabels?: string | undefined;
|
|
241
259
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MA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AAC,CAAC,EAAC,kBAAkB,KAAK,IAAI,CAAC;CAC9D,CAAC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAA;AAC3E,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAA;AAC7E,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAA;AAC5E,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAA"}
|
package/dist/types/common.js
CHANGED
|
@@ -28,6 +28,8 @@ const m = o.union([o.string(), o.number(), o.null()]), a = [
|
|
|
28
28
|
], i = o.enum(a), l = ["solid", "dashed", "dotted", "dotdash", "longdash", "twodash"], t = o.enum(l), r = ["left", "bottom", "left-bottom", "full", "empty"], g = o.enum(r), s = ["inside", "right", "top", "bottom"], b = o.enum(s), c = ["left", "center", "right"], h = o.enum(c), e = o.object({
|
|
29
29
|
type: o.literal("column"),
|
|
30
30
|
value: o.string(),
|
|
31
|
+
format: o.optional(o.string()),
|
|
32
|
+
// d3 format
|
|
31
33
|
label: o.optional(o.string()),
|
|
32
34
|
valueLabels: o.optional(o.string())
|
|
33
35
|
}), u = o.object({
|
package/dist/types/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../src/types/common.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { LassoControlsState, Polygon } from '../scatterplot-umap/types';\nimport type { CategoricalAesFromColumn, ContinuousAesFromColumn } from './scatterplot';\n\nexport type DataValue = string | number | null;\nexport type Category = string;\nexport const DataValueSchema = z.union([z.string(), z.number(), z.null()]);\n\nexport type Row = Record<string, DataValue>\n\nexport type Color = string;\n\n// numbered according ggplot2 symbols, 19 (third size of black circle) is missed\nexport const POINT_SHAPE = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n '13',\n '14',\n '15',\n '16',\n '17',\n '18',\n '20',\n '21',\n '22',\n '23',\n '24',\n '25',\n] as const;\nexport const PointShapeSchema = z.enum(POINT_SHAPE);\nexport type PointShape = z.infer<typeof PointShapeSchema>;\n\nconst LINE_SHAPE = ['solid', 'dashed', 'dotted', 'dotdash', 'longdash', 'twodash'] as const;\nexport const LineShapeSchema = z.enum(LINE_SHAPE);\nexport type LineShape = z.infer<typeof LineShapeSchema>;\n\nconst FRAME_TYPE = ['left', 'bottom', 'left-bottom', 'full', 'empty'] as const;\nexport const FrameTypeSchema = z.enum(FRAME_TYPE);\nexport type FrameType = z.infer<typeof FrameTypeSchema>;\n\nconst LEGEND_POSITION = ['inside', 'right', 'top', 'bottom'] as const;\nexport const LegendPositionSchema = z.enum(LEGEND_POSITION);\nexport type LegendPosition = z.infer<typeof LegendPositionSchema>;\n\nexport const TITLE_POSITION = ['left', 'center', 'right'] as const;\nexport const TitlePositionSchema = z.enum(TITLE_POSITION);\nexport type TitlePosition = z.infer<typeof TitlePositionSchema>;\n\nexport const ColumnNameSchema = z.object({\n type: z.literal('column'),\n value: z.string(),\n label: z.optional(z.string()),\n valueLabels: z.optional(z.string())\n});\nexport type ColumnName = z.infer<typeof ColumnNameSchema>\n\nexport type AesItem = {\n fillColor?: Color;\n lineColor?: Color;\n lineWidth?: number;\n lineShape?: LineShape;\n dotShape?: PointShape;\n dotSize?: number;\n dotFill?: Color;\n};\nexport const AesItemSchema = z.object({\n fillColor: z.optional(z.string()),\n lineColor: z.optional(z.string()),\n lineWidth: z.optional(z.number()),\n lineShape: z.optional(LineShapeSchema),\n dotShape: z.optional(PointShapeSchema),\n dotSize: z.optional(z.number()),\n dotFill: z.optional(z.string()),\n});\n\nexport const AesRecordSchema = z.record(AesItemSchema);\nexport type AesRecord = z.infer<typeof AesRecordSchema>;\n\nexport function categoricalAesMappingFromValueSchema<ValueType extends z.ZodTypeAny>(\n valueSchema: ValueType,\n) {\n return z.object({\n columnName: ColumnNameSchema,\n valuesMap: z.record(valueSchema),\n });\n}\nexport function continuousAesMappingFromValueSchema<ValueType extends z.ZodTypeAny>(\n valueSchema: ValueType,\n) {\n return z.object({\n columnName: ColumnNameSchema,\n domain: z.array(z.number()),\n range: z.array(valueSchema),\n type: z.optional(z.union([z.literal('linear'), z.literal('log')]))\n });\n}\n\nexport function isCategoricalAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType> | unknown\n): item is CategoricalAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return item !== null && 'valuesMap' in item;\n}\n\nexport function isContinuousAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType> | unknown\n): item is ContinuousAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return item !== null && 'domain' in item && 'range' in item;\n}\n\nexport type AxisSettings = {\n title?: string | ColumnName;\n scale?: 'linear' | 'log';\n showGrid?: boolean;\n // for discrete X axis - lines between groups, to improve groups recognizing\n linesBetweenCategories?: boolean;\n showTicks?: boolean;\n labelsPosition?: 'center' | '45deg' | '90deg';\n significantLines?: number[],\n significantLinesStyle?: LineShape,\n symmetricRange?: number // to get some value perfectly in the middle of axis\n upperValue?: number // limits\n lowerValue?: number\n};\n\nexport const AxisSettingsSchema = z.object({\n title: z.optional(z.union([z.string(), ColumnNameSchema])),\n scale: z.optional(z.union([z.literal('linear'), z.literal('log')])),\n showGrid: z.optional(z.boolean()),\n linesBetweenCategories: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n labelsPosition: z.optional(z.union([z.literal('center'), z.literal('45deg'), z.literal('90deg')])),\n significantLines: z.optional(z.array(z.number())),\n significantLinesStyle: z.optional(LineShapeSchema),\n symmetricRange: z.optional(z.number()),\n upperValue: z.optional(z.number()),\n lowerValue: z.optional(z.number()),\n hiddenLabels: z.optional(z.boolean())\n});\n\nexport interface SettingsInterface {\n type: string;\n}\n\nexport type ClickEventData = {\n x: number;\n y: number;\n info: unknown;\n}\n\nexport type PolygonData = [number, number][];\n\nexport type ChartEventHandlers<T> = T;\nexport type DendroEventHandlers = ChartEventHandlers<[(d:ClickEventData) => void]>\nexport type ScatterplotEventHandlers = ChartEventHandlers<{\n onPolygonUpdate: (d:number[], p: Polygon[]) => void;\n onTooltipHintSwitch: (d:boolean) => void;\n onLassoStateChange: () => void;\n onLassoControlsStateUpdate: (v:LassoControlsState) => void;\n}>\nexport type BubbleEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type DiscreteEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type HeatmapEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type HistogramEventHandlers = ChartEventHandlers<[(d:boolean) => void]>"],"names":["DataValueSchema","z","POINT_SHAPE","PointShapeSchema","LINE_SHAPE","LineShapeSchema","FRAME_TYPE","FrameTypeSchema","LEGEND_POSITION","LegendPositionSchema","TITLE_POSITION","TitlePositionSchema","ColumnNameSchema","AesItemSchema","AesRecordSchema","categoricalAesMappingFromValueSchema","valueSchema","continuousAesMappingFromValueSchema","isCategoricalAes","item","isContinuousAes","AxisSettingsSchema"],"mappings":";AAMO,MAAMA,IAAkBC,EAAE,MAAM,CAACA,EAAE,UAAUA,EAAE,OAAA,GAAUA,EAAE,KAAA,CAAM,CAAC,GAO5DC,IAAc;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,E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|
1
|
+
{"version":3,"file":"common.js","sources":["../../src/types/common.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { LassoControlsState, Polygon } from '../scatterplot-umap/types';\nimport type { CategoricalAesFromColumn, ContinuousAesFromColumn } from './scatterplot';\n\nexport type DataValue = string | number | null;\nexport type Category = string;\nexport const DataValueSchema = z.union([z.string(), z.number(), z.null()]);\n\nexport type Row = Record<string, DataValue>\n\nexport type Color = string;\n\n// numbered according ggplot2 symbols, 19 (third size of black circle) is missed\nexport const POINT_SHAPE = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '10',\n '11',\n '12',\n '13',\n '14',\n '15',\n '16',\n '17',\n '18',\n '20',\n '21',\n '22',\n '23',\n '24',\n '25',\n] as const;\nexport const PointShapeSchema = z.enum(POINT_SHAPE);\nexport type PointShape = z.infer<typeof PointShapeSchema>;\n\nconst LINE_SHAPE = ['solid', 'dashed', 'dotted', 'dotdash', 'longdash', 'twodash'] as const;\nexport const LineShapeSchema = z.enum(LINE_SHAPE);\nexport type LineShape = z.infer<typeof LineShapeSchema>;\n\nconst FRAME_TYPE = ['left', 'bottom', 'left-bottom', 'full', 'empty'] as const;\nexport const FrameTypeSchema = z.enum(FRAME_TYPE);\nexport type FrameType = z.infer<typeof FrameTypeSchema>;\n\nconst LEGEND_POSITION = ['inside', 'right', 'top', 'bottom'] as const;\nexport const LegendPositionSchema = z.enum(LEGEND_POSITION);\nexport type LegendPosition = z.infer<typeof LegendPositionSchema>;\n\nexport const TITLE_POSITION = ['left', 'center', 'right'] as const;\nexport const TitlePositionSchema = z.enum(TITLE_POSITION);\nexport type TitlePosition = z.infer<typeof TitlePositionSchema>;\n\nexport const ColumnNameSchema = z.object({\n type: z.literal('column'),\n value: z.string(),\n format: z.optional(z.string()), // d3 format\n label: z.optional(z.string()),\n valueLabels: z.optional(z.string())\n});\nexport type ColumnName = z.infer<typeof ColumnNameSchema>\n\nexport type AesItem = {\n fillColor?: Color;\n lineColor?: Color;\n lineWidth?: number;\n lineShape?: LineShape;\n dotShape?: PointShape;\n dotSize?: number;\n dotFill?: Color;\n};\nexport const AesItemSchema = z.object({\n fillColor: z.optional(z.string()),\n lineColor: z.optional(z.string()),\n lineWidth: z.optional(z.number()),\n lineShape: z.optional(LineShapeSchema),\n dotShape: z.optional(PointShapeSchema),\n dotSize: z.optional(z.number()),\n dotFill: z.optional(z.string()),\n});\n\nexport const AesRecordSchema = z.record(AesItemSchema);\nexport type AesRecord = z.infer<typeof AesRecordSchema>;\n\nexport function categoricalAesMappingFromValueSchema<ValueType extends z.ZodTypeAny>(\n valueSchema: ValueType,\n) {\n return z.object({\n columnName: ColumnNameSchema,\n valuesMap: z.record(valueSchema),\n });\n}\nexport function continuousAesMappingFromValueSchema<ValueType extends z.ZodTypeAny>(\n valueSchema: ValueType,\n) {\n return z.object({\n columnName: ColumnNameSchema,\n domain: z.array(z.number()),\n range: z.array(valueSchema),\n type: z.optional(z.union([z.literal('linear'), z.literal('log')]))\n });\n}\n\nexport function isCategoricalAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType> | unknown\n): item is CategoricalAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return item !== null && 'valuesMap' in item;\n}\n\nexport function isContinuousAes<InputType extends string | number | PointShape | LineShape>(\n item: InputType | CategoricalAesFromColumn<InputType> | ContinuousAesFromColumn<InputType> | unknown\n): item is ContinuousAesFromColumn<InputType> {\n if (typeof item !== 'object') {\n return false;\n }\n return item !== null && 'domain' in item && 'range' in item;\n}\n\nexport type AxisSettings = {\n title?: string | ColumnName;\n scale?: 'linear' | 'log';\n showGrid?: boolean;\n // for discrete X axis - lines between groups, to improve groups recognizing\n linesBetweenCategories?: boolean;\n showTicks?: boolean;\n labelsPosition?: 'center' | '45deg' | '90deg';\n significantLines?: number[],\n significantLinesStyle?: LineShape,\n symmetricRange?: number // to get some value perfectly in the middle of axis\n upperValue?: number // limits\n lowerValue?: number\n};\n\nexport const AxisSettingsSchema = z.object({\n title: z.optional(z.union([z.string(), ColumnNameSchema])),\n scale: z.optional(z.union([z.literal('linear'), z.literal('log')])),\n showGrid: z.optional(z.boolean()),\n linesBetweenCategories: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n labelsPosition: z.optional(z.union([z.literal('center'), z.literal('45deg'), z.literal('90deg')])),\n significantLines: z.optional(z.array(z.number())),\n significantLinesStyle: z.optional(LineShapeSchema),\n symmetricRange: z.optional(z.number()),\n upperValue: z.optional(z.number()),\n lowerValue: z.optional(z.number()),\n hiddenLabels: z.optional(z.boolean())\n});\n\nexport interface SettingsInterface {\n type: string;\n}\n\nexport type ClickEventData = {\n x: number;\n y: number;\n info: unknown;\n}\n\nexport type PolygonData = [number, number][];\n\nexport type ChartEventHandlers<T> = T;\nexport type DendroEventHandlers = ChartEventHandlers<[(d:ClickEventData) => void]>\nexport type ScatterplotEventHandlers = ChartEventHandlers<{\n onPolygonUpdate: (d:number[], p: Polygon[]) => void;\n onTooltipHintSwitch: (d:boolean) => void;\n onLassoStateChange: () => void;\n onLassoControlsStateUpdate: (v:LassoControlsState) => void;\n}>\nexport type BubbleEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type DiscreteEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type HeatmapEventHandlers = ChartEventHandlers<[(d:boolean) => void]>\nexport type HistogramEventHandlers = ChartEventHandlers<[(d:boolean) => void]>"],"names":["DataValueSchema","z","POINT_SHAPE","PointShapeSchema","LINE_SHAPE","LineShapeSchema","FRAME_TYPE","FrameTypeSchema","LEGEND_POSITION","LegendPositionSchema","TITLE_POSITION","TitlePositionSchema","ColumnNameSchema","AesItemSchema","AesRecordSchema","categoricalAesMappingFromValueSchema","valueSchema","continuousAesMappingFromValueSchema","isCategoricalAes","item","isContinuousAes","AxisSettingsSchema"],"mappings":";AAMO,MAAMA,IAAkBC,EAAE,MAAM,CAACA,EAA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