@milaboratories/miplots4 1.0.162 → 1.0.163
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/common/BandAxis.d.ts +2 -1
- package/dist/common/BandAxis.js +19 -18
- package/dist/common/BandAxis.js.map +1 -1
- package/dist/common/ContinuousAxis.js +20 -20
- package/dist/common/ContinuousAxis.js.map +1 -1
- package/dist/common/Legend.js +3 -3
- package/dist/common/Legend.js.map +1 -1
- package/dist/discrete/DiscreteSettingsImpl.d.ts +6 -4
- package/dist/discrete/DiscreteSettingsImpl.js +9 -9
- package/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
- package/dist/discrete/constants.d.ts +1 -1
- package/dist/discrete/constants.js +1 -1
- package/dist/discrete/constants.js.map +1 -1
- package/dist/discrete/index.js +107 -106
- package/dist/discrete/index.js.map +1 -1
- package/dist/discrete/layers/bar.js +25 -22
- package/dist/discrete/layers/bar.js.map +1 -1
- package/dist/discrete/layers/errorbars.js +57 -48
- package/dist/discrete/layers/errorbars.js.map +1 -1
- package/dist/discrete/layers/lines.js +40 -31
- package/dist/discrete/layers/lines.js.map +1 -1
- package/dist/discrete/layers/stackedBar.js.map +1 -1
- package/dist/heatmap/fillCellsData.js +49 -46
- package/dist/heatmap/fillCellsData.js.map +1 -1
- package/dist/histogram/ChartRenderer.js +57 -54
- package/dist/histogram/ChartRenderer.js.map +1 -1
- package/dist/histogram/constants.d.ts +1 -1
- package/dist/histogram/constants.js.map +1 -1
- package/dist/histogram/index.js +58 -51
- package/dist/histogram/index.js.map +1 -1
- package/dist/scatterplot/ChartRenderer.js +89 -89
- package/dist/scatterplot/ChartRenderer.js.map +1 -1
- package/dist/scatterplot/components/ChartAxis.js +30 -30
- package/dist/scatterplot/components/ChartAxis.js.map +1 -1
- package/dist/scatterplot/components/ChartAxisTitles.js +22 -22
- package/dist/scatterplot/components/ChartAxisTitles.js.map +1 -1
- package/dist/scatterplot/constants.d.ts +1 -1
- package/dist/scatterplot/constants.js +1 -1
- package/dist/scatterplot/constants.js.map +1 -1
- package/dist/scatterplot/dots.d.ts +1 -1
- package/dist/scatterplot/dots.js +14 -14
- package/dist/scatterplot/dots.js.map +1 -1
- package/dist/scatterplot/index.js +94 -79
- package/dist/scatterplot/index.js.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.d.ts +1 -1
- package/dist/scatterplot-umap/ChartRenderer.js +14 -14
- package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.js +38 -38
- package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/types/bubble.d.ts +5 -5
- package/dist/types/bubble.js +40 -40
- package/dist/types/bubble.js.map +1 -1
- package/dist/types/common.d.ts +25 -2
- package/dist/types/common.js +16 -15
- package/dist/types/common.js.map +1 -1
- package/dist/types/discrete.d.ts +66 -56
- package/dist/types/discrete.js +40 -38
- package/dist/types/discrete.js.map +1 -1
- package/dist/types/heatmap.d.ts +5 -6
- package/dist/types/heatmap.js +29 -29
- package/dist/types/heatmap.js.map +1 -1
- package/package.json +1 -1
package/dist/types/bubble.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ColumnNameSchema as
|
|
2
|
-
import { optional as e, union as
|
|
1
|
+
import { ColumnNameSchema as t, AggregationMethodSchema as p, FrameTypeSchema as y, LegendPositionSchema as u, TitlePositionSchema as g } from "./common.js";
|
|
2
|
+
import { optional as e, union as c, literal as r, boolean as s, string as n, object as o, number as a, null as h, array as i, enum as l, record as d } from "../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js";
|
|
3
3
|
const m = {
|
|
4
|
-
title: e(
|
|
5
|
-
showTicks: e(
|
|
6
|
-
showTitle: e(
|
|
7
|
-
showAxisLabels: e(
|
|
8
|
-
axisLabelsAngle: e(
|
|
9
|
-
},
|
|
4
|
+
title: e(n()),
|
|
5
|
+
showTicks: e(s()),
|
|
6
|
+
showTitle: e(s()),
|
|
7
|
+
showAxisLabels: e(s()),
|
|
8
|
+
axisLabelsAngle: e(c([r(0), r(45), r(90)]))
|
|
9
|
+
}, S = o({
|
|
10
10
|
type: r("bubble"),
|
|
11
11
|
title: o({
|
|
12
|
-
name:
|
|
13
|
-
show: e(
|
|
14
|
-
position: e(
|
|
12
|
+
name: n(),
|
|
13
|
+
show: e(s()),
|
|
14
|
+
position: e(g)
|
|
15
15
|
}),
|
|
16
16
|
size: e(
|
|
17
17
|
o({
|
|
@@ -22,65 +22,65 @@ const m = {
|
|
|
22
22
|
),
|
|
23
23
|
legend: e(
|
|
24
24
|
o({
|
|
25
|
-
show: e(
|
|
26
|
-
position: e(
|
|
25
|
+
show: e(s()),
|
|
26
|
+
position: e(u)
|
|
27
27
|
})
|
|
28
28
|
),
|
|
29
|
-
frame: e(o({ type: e(
|
|
29
|
+
frame: e(o({ type: e(y) })),
|
|
30
30
|
facetSettings: e(
|
|
31
31
|
o({
|
|
32
32
|
nRows: e(a()),
|
|
33
33
|
nCols: e(a())
|
|
34
34
|
})
|
|
35
35
|
),
|
|
36
|
-
valueSize:
|
|
37
|
-
valueColor:
|
|
38
|
-
xColumn:
|
|
39
|
-
yColumn:
|
|
40
|
-
xGroupBy: e(
|
|
41
|
-
yGroupBy: e(
|
|
36
|
+
valueSize: t,
|
|
37
|
+
valueColor: t,
|
|
38
|
+
xColumn: t,
|
|
39
|
+
yColumn: t,
|
|
40
|
+
xGroupBy: e(i(t)),
|
|
41
|
+
yGroupBy: e(i(t)),
|
|
42
42
|
keysOrder: e(
|
|
43
43
|
// x, y, grouping, facet keys in user's order
|
|
44
|
-
|
|
44
|
+
d(n(), i(n()))
|
|
45
45
|
),
|
|
46
46
|
normalization: e(o({
|
|
47
|
-
direction:
|
|
48
|
-
method:
|
|
49
|
-
colorRange: e(
|
|
50
|
-
sizeRange: e(
|
|
47
|
+
direction: l(["row", "column"]),
|
|
48
|
+
method: l(["standardScaling", "meanNormalization"]),
|
|
49
|
+
colorRange: e(i(a())),
|
|
50
|
+
sizeRange: e(i(a()))
|
|
51
51
|
})),
|
|
52
52
|
aggregation: e(o({
|
|
53
|
-
x: e(
|
|
54
|
-
y: e(
|
|
55
|
-
method: e(
|
|
53
|
+
x: e(s()),
|
|
54
|
+
y: e(s()),
|
|
55
|
+
method: e(p)
|
|
56
56
|
})),
|
|
57
57
|
xAxis: e(o({
|
|
58
58
|
...m,
|
|
59
|
-
sorting: e(
|
|
60
|
-
position: e(
|
|
59
|
+
sorting: e(l(["asc", "desc"])),
|
|
60
|
+
position: e(l(["top", "bottom"]))
|
|
61
61
|
})),
|
|
62
62
|
yAxis: e(o({
|
|
63
63
|
...m,
|
|
64
|
-
sorting: e(
|
|
65
|
-
position: e(
|
|
64
|
+
sorting: e(l(["asc", "desc"])),
|
|
65
|
+
position: e(l(["left", "right"]))
|
|
66
66
|
})),
|
|
67
|
-
facetBy: e(
|
|
67
|
+
facetBy: e(i(t)),
|
|
68
68
|
aes: e(o({
|
|
69
|
-
colorsList: e(
|
|
69
|
+
colorsList: e(i(n())),
|
|
70
70
|
minRadius: e(a()),
|
|
71
71
|
maxRadius: e(a()),
|
|
72
|
-
cellStrokeColor: e(
|
|
73
|
-
emptyCellColor: e(
|
|
72
|
+
cellStrokeColor: e(n()),
|
|
73
|
+
emptyCellColor: e(n())
|
|
74
74
|
})),
|
|
75
75
|
tooltips: e(
|
|
76
76
|
o({
|
|
77
|
-
show: e(
|
|
78
|
-
content: e(
|
|
77
|
+
show: e(s()),
|
|
78
|
+
content: e(i(t))
|
|
79
79
|
})
|
|
80
80
|
),
|
|
81
|
-
NAValueAs: e(
|
|
81
|
+
NAValueAs: e(c([a(), h()]))
|
|
82
82
|
});
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
S as BubblesSettingsSchema
|
|
85
85
|
};
|
|
86
86
|
//# sourceMappingURL=bubble.js.map
|
package/dist/types/bubble.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubble.js","sources":["../../src/types/bubble.ts"],"sourcesContent":["import {\n ColumnNameSchema,\n FrameTypeSchema,\n LegendPositionSchema,\n TitlePositionSchema,\n} from './common';\nimport { z } from 'zod';\n\nconst axisCommonSchema = {\n title: z.optional(z.string()),\n showTicks: z.optional(z.boolean()),\n showTitle: z.optional(z.boolean()),\n showAxisLabels: z.optional(z.boolean()),\n axisLabelsAngle: z.optional(z.union([z.literal(0), z.literal(45), z.literal(90)])),\n};\n\n//const InheritAesSchema = z.object({type: z.literal('grouping'), value: z.string()}); // link to aes mapped to column\n\nexport const BubblesSettingsSchema = z.object({\n type: z.literal('bubble'),\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n size: z.optional(\n z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n cellSize: z.optional(z.number())\n })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n frame: z.optional(z.object({ type: z.optional(FrameTypeSchema) })),\n facetSettings: z.optional(\n z.object({\n nRows: z.optional(z.number()),\n nCols: z.optional(z.number()),\n })\n ),\n valueSize: ColumnNameSchema,\n valueColor: ColumnNameSchema,\n xColumn: ColumnNameSchema,\n yColumn: ColumnNameSchema,\n xGroupBy: z.optional(z.array(ColumnNameSchema)),\n yGroupBy: z.optional(z.array(ColumnNameSchema)),\n keysOrder: z.optional( // x, y, grouping, facet keys in user's order\n z.record(z.string(), z.array(z.string()))\n ),\n normalization: z.optional(z.object({\n direction: z.enum(['row', 'column']),\n method: z.enum(['standardScaling', 'meanNormalization']),\n colorRange: z.optional(z.array(z.number())),\n sizeRange: z.optional(z.array(z.number())),\n })),\n aggregation: z.optional(z.object({\n x: z.optional(z.boolean()),\n y: z.optional(z.boolean()),\n method: z.optional(
|
|
1
|
+
{"version":3,"file":"bubble.js","sources":["../../src/types/bubble.ts"],"sourcesContent":["import {\n AggregationMethodSchema,\n ColumnNameSchema,\n FrameTypeSchema,\n LegendPositionSchema,\n TitlePositionSchema,\n} from './common';\nimport { z } from 'zod';\n\nconst axisCommonSchema = {\n title: z.optional(z.string()),\n showTicks: z.optional(z.boolean()),\n showTitle: z.optional(z.boolean()),\n showAxisLabels: z.optional(z.boolean()),\n axisLabelsAngle: z.optional(z.union([z.literal(0), z.literal(45), z.literal(90)])),\n};\n\n//const InheritAesSchema = z.object({type: z.literal('grouping'), value: z.string()}); // link to aes mapped to column\n\nexport const BubblesSettingsSchema = z.object({\n type: z.literal('bubble'),\n title: z.object({\n name: z.string(),\n show: z.optional(z.boolean()),\n position: z.optional(TitlePositionSchema),\n }),\n size: z.optional(\n z.object({\n width: z.optional(z.number()),\n height: z.optional(z.number()),\n cellSize: z.optional(z.number())\n })\n ),\n legend: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n position: z.optional(LegendPositionSchema),\n })\n ),\n frame: z.optional(z.object({ type: z.optional(FrameTypeSchema) })),\n facetSettings: z.optional(\n z.object({\n nRows: z.optional(z.number()),\n nCols: z.optional(z.number()),\n })\n ),\n valueSize: ColumnNameSchema,\n valueColor: ColumnNameSchema,\n xColumn: ColumnNameSchema,\n yColumn: ColumnNameSchema,\n xGroupBy: z.optional(z.array(ColumnNameSchema)),\n yGroupBy: z.optional(z.array(ColumnNameSchema)),\n keysOrder: z.optional( // x, y, grouping, facet keys in user's order\n z.record(z.string(), z.array(z.string()))\n ),\n normalization: z.optional(z.object({\n direction: z.enum(['row', 'column']),\n method: z.enum(['standardScaling', 'meanNormalization']),\n colorRange: z.optional(z.array(z.number())),\n sizeRange: z.optional(z.array(z.number())),\n })),\n aggregation: z.optional(z.object({\n x: z.optional(z.boolean()),\n y: z.optional(z.boolean()),\n method: z.optional(AggregationMethodSchema),\n })),\n xAxis: z.optional(z.object({\n ...axisCommonSchema,\n sorting: z.optional(z.enum(['asc', 'desc'])),\n position: z.optional(z.enum(['top', 'bottom'])),\n })),\n yAxis: z.optional(z.object({\n ...axisCommonSchema,\n sorting: z.optional(z.enum(['asc', 'desc'])),\n position: z.optional(z.enum(['left', 'right'])),\n })),\n facetBy: z.optional(z.array(ColumnNameSchema)),\n aes: z.optional(z.object({\n colorsList: z.optional(z.array(z.string())),\n minRadius: z.optional(z.number()),\n maxRadius: z.optional(z.number()),\n cellStrokeColor: z.optional(z.string()),\n emptyCellColor: z.optional(z.string()),\n })),\n tooltips: z.optional(\n z.object({\n show: z.optional(z.boolean()),\n content: z.optional(z.array(ColumnNameSchema)),\n })\n ),\n NAValueAs: z.optional(z.union([z.number(), z.null()])),\n});\n\nexport type BubbleSettings = z.infer<typeof BubblesSettingsSchema>;\n"],"names":["axisCommonSchema","z.optional","z.string","z.boolean","z.union","z.literal","BubblesSettingsSchema","z.object","TitlePositionSchema","z.number","LegendPositionSchema","FrameTypeSchema","ColumnNameSchema","z.array","z.record","z.enum","AggregationMethodSchema","z.null"],"mappings":";;AASA,MAAMA,IAAmB;AAAA,EACrB,OAAOC,EAAWC,GAAU;AAAA,EAC5B,WAAWD,EAAWE,GAAW;AAAA,EACjC,WAAWF,EAAWE,GAAW;AAAA,EACjC,gBAAgBF,EAAWE,GAAW;AAAA,EACtC,iBAAiBF,EAAWG,EAAQ,CAACC,EAAU,CAAC,GAAGA,EAAU,EAAE,GAAGA,EAAU,EAAE,CAAC,CAAC,CAAC;AACrF,GAIaC,IAAwBC,EAAS;AAAA,EAC1C,MAAMF,EAAU,QAAQ;AAAA,EACxB,OAAOE,EAAS;AAAA,IACZ,MAAML,EAAE;AAAA,IACR,MAAMD,EAAWE,GAAW;AAAA,IAC5B,UAAUF,EAAWO,CAAmB;AAAA,EAAA,CAC3C;AAAA,EACD,MAAMP;AAAAA,IACFM,EAAS;AAAA,MACL,OAAON,EAAWQ,GAAU;AAAA,MAC5B,QAAQR,EAAWQ,GAAU;AAAA,MAC7B,UAAUR,EAAWQ,GAAU;AAAA,IAAA,CAClC;AAAA,EAAA;AAAA,EAEL,QAAQR;AAAAA,IACJM,EAAS;AAAA,MACL,MAAMN,EA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AAA,IACH,SAASC,EAAWc,EAAO,CAAC,OAAO,MAAM,CAAC,CAAC;AAAA,IAC3C,UAAUd,EAAWc,EAAO,CAAC,QAAQ,OAAO,CAAC,CAAC;AAAA,EAAA,CACjD,CAAC;AAAA,EACF,SAASd,EAAWY,EAAQD,CAAgB,CAAC;AAAA,EAC7C,KAAKX,EAAWM,EAAS;AAAA,IACrB,YAAYN,EAAWY,EAAQX,EAAE,CAAQ,CAAC;AAAA,IAC1C,WAAWD,EAAWQ,GAAU;AAAA,IAChC,WAAWR,EAAWQ,GAAU;AAAA,IAChC,iBAAiBR,EAAWC,GAAU;AAAA,IACtC,gBAAgBD,EAAWC,GAAU;AAAA,EAAA,CACxC,CAAC;AAAA,EACF,UAAUD;AAAAA,IACNM,EAAS;AAAA,MACL,MAAMN,EAAWE,GAAW;AAAA,MAC5B,SAASF,EAAWY,EAAQD,CAAgB,CAAC;AAAA,IAAA,CAChD;AAAA,EAAA;AAAA,EAEL,WAAWX,EAAWG,EAAQ,CAACK,EAAE,GAAUQ,EAAE,CAAM,CAAC,CAAC;AACzD,CAAC;"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export type Category = string;
|
|
|
6
6
|
export declare const DataValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNull]>;
|
|
7
7
|
export type Row = Record<string, DataValue>;
|
|
8
8
|
export type Color = string;
|
|
9
|
+
export declare const AggregationMethodSchema: z.ZodEnum<["sum", "mean", "median", "min", "max"]>;
|
|
10
|
+
export type AggregationMethod = z.infer<typeof AggregationMethodSchema>;
|
|
9
11
|
export declare const POINT_SHAPE: readonly ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "20", "21", "22", "23", "24", "25"];
|
|
10
12
|
export declare const PointShapeSchema: z.ZodEnum<["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "20", "21", "22", "23", "24", "25"]>;
|
|
11
13
|
export type PointShape = z.infer<typeof PointShapeSchema>;
|
|
@@ -464,7 +466,7 @@ export type HeatmapEventHandlers = ChartEventHandlers<{
|
|
|
464
466
|
export type BubbleEventHandlers = ChartEventHandlers<[(d: boolean) => void]>;
|
|
465
467
|
export type DiscreteEventHandlers = ChartEventHandlers<[(d: boolean) => void]>;
|
|
466
468
|
export type HistogramEventHandlers = ChartEventHandlers<[(d: boolean) => void]>;
|
|
467
|
-
export type ErrorTypes = 'tooManyFacets' | 'tooManyPrimaryGroups' | 'tooManySecondaryGroups' | 'unknownError';
|
|
469
|
+
export type ErrorTypes = 'tooManyFacets' | 'tooManyPrimaryGroups' | 'tooManySecondaryGroups' | 'tooManyScatterplotGroupsX' | 'tooManyScatterplotGroupsY' | 'tooManyHistogramGroups' | 'unknownError';
|
|
468
470
|
type ErrorInfoBase = {
|
|
469
471
|
type: ErrorTypes;
|
|
470
472
|
info: unknown;
|
|
@@ -490,6 +492,27 @@ export interface ErrorInfoSecondaryGroups extends ErrorInfoBase {
|
|
|
490
492
|
maxCount: number;
|
|
491
493
|
};
|
|
492
494
|
}
|
|
495
|
+
export interface ErrorInfoScatterplotGroupsX extends ErrorInfoBase {
|
|
496
|
+
type: 'tooManyScatterplotGroupsX';
|
|
497
|
+
info: {
|
|
498
|
+
count: number;
|
|
499
|
+
maxCount: number;
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
export interface ErrorInfoScatterplotGroupsY extends ErrorInfoBase {
|
|
503
|
+
type: 'tooManyScatterplotGroupsY';
|
|
504
|
+
info: {
|
|
505
|
+
count: number;
|
|
506
|
+
maxCount: number;
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
export interface ErrorInfoHistogramGroups extends ErrorInfoBase {
|
|
510
|
+
type: 'tooManyHistogramGroups';
|
|
511
|
+
info: {
|
|
512
|
+
count: number;
|
|
513
|
+
maxCount: number;
|
|
514
|
+
};
|
|
515
|
+
}
|
|
493
516
|
export interface ErrorInfoUnknown extends ErrorInfoBase {
|
|
494
517
|
type: 'unknownError';
|
|
495
518
|
info: {
|
|
@@ -497,7 +520,7 @@ export interface ErrorInfoUnknown extends ErrorInfoBase {
|
|
|
497
520
|
stack: string | undefined;
|
|
498
521
|
};
|
|
499
522
|
}
|
|
500
|
-
export type ErrorInfo = ErrorInfoFacets | ErrorInfoPrimaryGroups | ErrorInfoSecondaryGroups | ErrorInfoUnknown;
|
|
523
|
+
export type ErrorInfo = ErrorInfoFacets | ErrorInfoPrimaryGroups | ErrorInfoSecondaryGroups | ErrorInfoScatterplotGroupsX | ErrorInfoScatterplotGroupsY | ErrorInfoHistogramGroups | ErrorInfoUnknown;
|
|
501
524
|
export declare function isErrorInfo(value: unknown): value is ErrorInfo;
|
|
502
525
|
export declare function getUnknownErrorInfo(error: Error): ErrorInfoUnknown;
|
|
503
526
|
export {};
|
package/dist/types/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { union as a, string as o, number as t, null as h, enum as c, object as l, optional as e, literal as s, record as m, boolean as i, array as r } from "../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js";
|
|
2
|
-
const I = a([o(), t(), h()]), d = [
|
|
2
|
+
const I = a([o(), t(), h()]), w = c(["sum", "mean", "median", "min", "max"]), d = [
|
|
3
3
|
"0",
|
|
4
4
|
"1",
|
|
5
5
|
"2",
|
|
@@ -25,7 +25,7 @@ const I = a([o(), t(), h()]), d = [
|
|
|
25
25
|
"23",
|
|
26
26
|
"24",
|
|
27
27
|
"25"
|
|
28
|
-
],
|
|
28
|
+
], g = c(d), S = ["solid", "dashed", "dotted", "dotdash", "longdash", "twodash"], p = c(S), f = ["left", "bottom", "left-bottom", "full", "empty"], N = c(f), y = ["inside", "right", "top", "bottom"], k = c(y), T = ["left", "center", "right"], C = c(T), u = l({
|
|
29
29
|
type: s("column"),
|
|
30
30
|
value: o(),
|
|
31
31
|
format: e(o()),
|
|
@@ -37,17 +37,17 @@ const I = a([o(), t(), h()]), d = [
|
|
|
37
37
|
lineColor: e(o()),
|
|
38
38
|
lineWidth: e(t()),
|
|
39
39
|
lineShape: e(p),
|
|
40
|
-
dotShape: e(
|
|
40
|
+
dotShape: e(g),
|
|
41
41
|
dotSize: e(t()),
|
|
42
42
|
dotFill: e(o())
|
|
43
|
-
}),
|
|
43
|
+
}), M = m(b);
|
|
44
44
|
function j(n) {
|
|
45
45
|
return l({
|
|
46
46
|
columnName: u,
|
|
47
47
|
valuesMap: m(n)
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function x(n) {
|
|
51
51
|
return l({
|
|
52
52
|
columnName: u,
|
|
53
53
|
domain: r(t()),
|
|
@@ -55,7 +55,7 @@ function F(n) {
|
|
|
55
55
|
type: e(a([s("linear"), s("log")]))
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function F(n) {
|
|
59
59
|
return typeof n != "object" ? !1 : n !== null && "valuesMap" in n;
|
|
60
60
|
}
|
|
61
61
|
function O(n) {
|
|
@@ -86,7 +86,7 @@ const A = a([s("center"), s("45deg"), s("90deg")]), E = l({
|
|
|
86
86
|
function _(n) {
|
|
87
87
|
return typeof n == "object" && n !== null && "type" in n && "info" in n;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function D(n) {
|
|
90
90
|
return {
|
|
91
91
|
type: "unknownError",
|
|
92
92
|
info: {
|
|
@@ -97,24 +97,25 @@ function x(n) {
|
|
|
97
97
|
}
|
|
98
98
|
export {
|
|
99
99
|
b as AesItemSchema,
|
|
100
|
-
|
|
100
|
+
M as AesRecordSchema,
|
|
101
|
+
w as AggregationMethodSchema,
|
|
101
102
|
L as AxisSettingsContinuousSchema,
|
|
102
103
|
E as AxisSettingsDiscreteSchema,
|
|
103
104
|
V as AxisSettingsSchema,
|
|
104
105
|
u as ColumnNameSchema,
|
|
105
106
|
I as DataValueSchema,
|
|
106
107
|
A as DiscreteLabelsPositionSchema,
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
N as FrameTypeSchema,
|
|
109
|
+
k as LegendPositionSchema,
|
|
109
110
|
p as LineShapeSchema,
|
|
110
111
|
d as POINT_SHAPE,
|
|
111
|
-
|
|
112
|
+
g as PointShapeSchema,
|
|
112
113
|
T as TITLE_POSITION,
|
|
113
|
-
|
|
114
|
+
C as TitlePositionSchema,
|
|
114
115
|
j as categoricalAesMappingFromValueSchema,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
x as continuousAesMappingFromValueSchema,
|
|
117
|
+
D as getUnknownErrorInfo,
|
|
118
|
+
F as isCategoricalAes,
|
|
118
119
|
O as isContinuousAes,
|
|
119
120
|
_ as isErrorInfo
|
|
120
121
|
};
|
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 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 const DiscreteLabelsPositionSchema = z.union([z.literal('center'), z.literal('45deg'), z.literal('90deg')]);\n\nexport const AxisSettingsDiscreteSchema = z.object({\n title: z.optional(z.union([z.string(), ColumnNameSchema])),\n scale: z.optional(z.literal('discrete')),\n keys: z.optional(z.array(z.union([z.string(), z.number()]))),\n labels: z.optional(z.record(z.string())),\n showGrid: z.optional(z.boolean()),\n linesBetweenCategories: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n labelsPosition: z.optional(DiscreteLabelsPositionSchema),\n hiddenLabels: z.optional(z.boolean())\n});\nexport const AxisSettingsContinuousSchema = 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 showTicks: z.optional(z.boolean()),\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 const AxisSettingsSchema = z.union([AxisSettingsDiscreteSchema, AxisSettingsContinuousSchema]);\n\nexport type AxisSettings = z.infer<typeof AxisSettingsSchema>\nexport type AxisSettingsDiscrete = z.infer<typeof AxisSettingsDiscreteSchema>;\nexport type AxisSettingsContinuous = z.infer<typeof AxisSettingsContinuousSchema>;\n\nexport type DiscreteLabelsPosition = z.infer<typeof DiscreteLabelsPositionSchema>;\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 HeatmapEventHandlers = ChartEventHandlers<{\n onTooltipHintSwitch: (d: boolean) => void;\n onLoadingChange: (d: boolean) => void;\n}>\n\nexport type BubbleEventHandlers = ChartEventHandlers<[(d: boolean) => void]>\nexport type DiscreteEventHandlers = ChartEventHandlers<[(d: boolean) => void]>\nexport type HistogramEventHandlers = ChartEventHandlers<[(d: boolean) => void]>\n\nexport type ErrorTypes = 'tooManyFacets' | 'tooManyPrimaryGroups' | 'tooManySecondaryGroups' | 'unknownError';\ntype ErrorInfoBase = { type: ErrorTypes, info: unknown };\nexport interface ErrorInfoFacets extends ErrorInfoBase {\n type: 'tooManyFacets';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoPrimaryGroups extends ErrorInfoBase {\n type: 'tooManyPrimaryGroups';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoSecondaryGroups extends ErrorInfoBase {\n type: 'tooManySecondaryGroups';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoUnknown extends ErrorInfoBase {\n type: 'unknownError';\n info: {\n message: string;\n stack: string | undefined;\n };\n}\nexport type ErrorInfo = ErrorInfoFacets | ErrorInfoPrimaryGroups | ErrorInfoSecondaryGroups | ErrorInfoUnknown;\nexport function isErrorInfo(value: unknown): value is ErrorInfo {\n return typeof value === 'object' && value !== null && 'type' in value && 'info' in value;\n}\nexport function getUnknownErrorInfo(error: Error): ErrorInfoUnknown {\n return {\n type: 'unknownError',\n info: {\n message: error.message,\n stack: error.stack,\n },\n };\n}"],"names":["DataValueSchema","z.union","z.string","z.number","z.null","POINT_SHAPE","PointShapeSchema","z.enum","LINE_SHAPE","LineShapeSchema","FRAME_TYPE","FrameTypeSchema","LEGEND_POSITION","LegendPositionSchema","TITLE_POSITION","TitlePositionSchema","ColumnNameSchema","z.object","z.literal","z.optional","AesItemSchema","AesRecordSchema","z.record","categoricalAesMappingFromValueSchema","valueSchema","continuousAesMappingFromValueSchema","z.array","isCategoricalAes","item","isContinuousAes","DiscreteLabelsPositionSchema","AxisSettingsDiscreteSchema","z.boolean","AxisSettingsContinuousSchema","AxisSettingsSchema","isErrorInfo","value","getUnknownErrorInfo","error"],"mappings":";AAMO,MAAMA,IAAkBC,EAAQ,CAACC,EAAE,GAAUC,EAAE,GAAUC,GAAQ,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,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GACaC,IAAmBC,EAAOF,CAAW,GAG5CG,IAAa,CAAC,SAAS,UAAU,UAAU,WAAW,YAAY,SAAS,GACpEC,IAAkBF,EAAOC,CAAU,GAG1CE,IAAa,CAAC,QAAQ,UAAU,eAAe,QAAQ,OAAO,GACvDC,IAAkBJ,EAAOG,CAAU,GAG1CE,IAAkB,CAAC,UAAU,SAAS,OAAO,QAAQ,GAC9CC,IAAuBN,EAAOK,CAAe,GAG7CE,IAAiB,CAAC,QAAQ,UAAU,OAAO,GAC3CC,IAAsBR,EAAOO,CAAc,GAG3CE,IAAmBC,EAAS;AAAA,EACrC,MAAMC,EAAU,QAAQ;AAAA,EACxB,OAAOhB,EAAE;AAAA,EACT,QAAQiB,EAAW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zB,EAAQ,CAACC,KAAYC,GAAU,CAAC,CAAC,CAAC;AAAA,EAC3D,QAAQgB,EAAWG,EAASpB,EAAE,CAAQ,CAAC;AAAA,EACvC,UAAUiB,EAAWa,GAAW;AAAA,EAChC,wBAAwBb,EAAWa,GAAW;AAAA,EAC9C,WAAWb,EAAWa,GAAW;AAAA,EACjC,gBAAgBb,EAAWW,CAA4B;AAAA,EACvD,cAAcX,EAAWa,GAAW;AACxC,CAAC,GACYC,IAA+BhB,EAAS;AAAA,EACjD,OAAOE,EAAWlB,EAAQ,CAACC,EAAE,GAAUc,CAAgB,CAAC,CAAC;AAAA,EACzD,OAAOG,EAAWlB,EAAQ,CAACiB,EAAU,QAAQ,GAAGA,EAAU,KAAK,CAAC,CAAC,CAAC;AAAA,EAClE,UAAUC,EAAWa,GAAW;AAAA,EAChC,WAAWb,EAAWa,GAAW;AAAA,EACjC,kBAAkBb,EAAWO,EAAQvB,EAAE,CAAQ,CAAC;AAAA,EAChD,uBAAuBgB,EAAWV,CAAe;AAAA,EACjD,gBAAgBU,EAAWhB,GAAU;AAAA,EACrC,YAAYgB,EAAWhB,GAAU;AAAA,EACjC,YAAYgB,EAAWhB,GAAU;AAAA,EACjC,cAAcgB,EAAWa,GAAW;AACxC,CAAC,GAEYE,IAAqBjC,EAAQ,CAAC8B,GAA4BE,CAA4B,CAAC;AAoE7F,SAASE,EAAYC,GAAoC;AAC5D,SAAO,OAAOA,KAAU,YAAYA,MAAU,QAAQ,UAAUA,KAAS,UAAUA;AACvF;AACO,SAASC,EAAoBC,GAAgC;AAChE,SAAO;AAAA,IACH,MAAM;AAAA,IACN,MAAM;AAAA,MACF,SAASA,EAAM;AAAA,MACf,OAAOA,EAAM;AAAA,IAAA;AAAA,EACjB;AAER;"}
|
|
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\nexport const AggregationMethodSchema = z.enum(['sum', 'mean', 'median', 'min', 'max']);\nexport type AggregationMethod = z.infer<typeof AggregationMethodSchema>;\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 const DiscreteLabelsPositionSchema = z.union([z.literal('center'), z.literal('45deg'), z.literal('90deg')]);\n\nexport const AxisSettingsDiscreteSchema = z.object({\n title: z.optional(z.union([z.string(), ColumnNameSchema])),\n scale: z.optional(z.literal('discrete')),\n keys: z.optional(z.array(z.union([z.string(), z.number()]))),\n labels: z.optional(z.record(z.string())),\n showGrid: z.optional(z.boolean()),\n linesBetweenCategories: z.optional(z.boolean()),\n showTicks: z.optional(z.boolean()),\n labelsPosition: z.optional(DiscreteLabelsPositionSchema),\n hiddenLabels: z.optional(z.boolean())\n});\nexport const AxisSettingsContinuousSchema = 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 showTicks: z.optional(z.boolean()),\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 const AxisSettingsSchema = z.union([AxisSettingsDiscreteSchema, AxisSettingsContinuousSchema]);\n\nexport type AxisSettings = z.infer<typeof AxisSettingsSchema>\nexport type AxisSettingsDiscrete = z.infer<typeof AxisSettingsDiscreteSchema>;\nexport type AxisSettingsContinuous = z.infer<typeof AxisSettingsContinuousSchema>;\n\nexport type DiscreteLabelsPosition = z.infer<typeof DiscreteLabelsPositionSchema>;\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 HeatmapEventHandlers = ChartEventHandlers<{\n onTooltipHintSwitch: (d: boolean) => void;\n onLoadingChange: (d: boolean) => void;\n}>\n\nexport type BubbleEventHandlers = ChartEventHandlers<[(d: boolean) => void]>\nexport type DiscreteEventHandlers = ChartEventHandlers<[(d: boolean) => void]>\nexport type HistogramEventHandlers = ChartEventHandlers<[(d: boolean) => void]>\n\nexport type ErrorTypes = 'tooManyFacets' \n| 'tooManyPrimaryGroups' | 'tooManySecondaryGroups'\n| 'tooManyScatterplotGroupsX' | 'tooManyScatterplotGroupsY'\n| 'tooManyHistogramGroups'\n| 'unknownError';\ntype ErrorInfoBase = { type: ErrorTypes, info: unknown };\nexport interface ErrorInfoFacets extends ErrorInfoBase {\n type: 'tooManyFacets';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoPrimaryGroups extends ErrorInfoBase {\n type: 'tooManyPrimaryGroups';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoSecondaryGroups extends ErrorInfoBase {\n type: 'tooManySecondaryGroups';\n info: {\n count: number;\n maxCount: number;\n };\n}\n\nexport interface ErrorInfoScatterplotGroupsX extends ErrorInfoBase {\n type: 'tooManyScatterplotGroupsX';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoScatterplotGroupsY extends ErrorInfoBase {\n type: 'tooManyScatterplotGroupsY';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoHistogramGroups extends ErrorInfoBase {\n type: 'tooManyHistogramGroups';\n info: {\n count: number;\n maxCount: number;\n };\n}\nexport interface ErrorInfoUnknown extends ErrorInfoBase {\n type: 'unknownError';\n info: {\n message: string;\n stack: string | undefined;\n };\n}\nexport type ErrorInfo = ErrorInfoFacets | ErrorInfoPrimaryGroups | ErrorInfoSecondaryGroups | ErrorInfoScatterplotGroupsX | ErrorInfoScatterplotGroupsY | ErrorInfoHistogramGroups | ErrorInfoUnknown;\nexport function isErrorInfo(value: unknown): value is ErrorInfo {\n return typeof value === 'object' && value !== null && 'type' in value && 'info' in value;\n}\nexport function getUnknownErrorInfo(error: Error): ErrorInfoUnknown {\n return {\n type: 'unknownError',\n info: {\n message: error.message,\n stack: error.stack,\n },\n };\n}"],"names":["DataValueSchema","z.union","z.string","z.number","z.null","AggregationMethodSchema","z.enum","POINT_SHAPE","PointShapeSchema","LINE_SHAPE","LineShapeSchema","FRAME_TYPE","FrameTypeSchema","LEGEND_POSITION","LegendPositionSchema","TITLE_POSITION","TitlePositionSchema","ColumnNameSchema","z.object","z.literal","z.optional","AesItemSchema","AesRecordSchema","z.record","categoricalAesMappingFromValueSchema","valueSchema","continuousAesMappingFromValueSchema","z.array","isCategoricalAes","item","isContinuousAes","DiscreteLabelsPositionSchema","AxisSettingsDiscreteSchema","z.boolean","AxisSettingsContinuousSchema","AxisSettingsSchema","isErrorInfo","value","getUnknownErrorInfo","error"],"mappings":";AAMO,MAAMA,IAAkBC,EAAQ,CAACC,EAAE,GAAUC,EAAE,GAAUC,GAAQ,CAAC,GAM5DC,IAA0BC,EAAO,CAAC,OAAO,QAAQ,UAAU,OAAO,KAAK,CAAC,GAIxEC,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,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GACaC,IAAmBF,EAAOC,CAAW,GAG5CE,IAAa,CAAC,SAAS,UAAU,UAAU,WAAW,YAAY,SAAS,GACpEC,IAAkBJ,EAAOG,CAAU,GAG1CE,IAAa,CAAC,QAAQ,UAAU,eAAe,QAAQ,OAAO,GACvDC,IAAkBN,EAAOK,CAAU,GAG1CE,IAAkB,CAAC,UAAU,SAAS,OAAO,QAAQ,GAC9CC,IAAuBR,EAAOO,CAAe,GAG7CE,IAAiB,CAAC,QAAQ,UAAU,OAAO,GAC3CC,IAAsBV,EAAOS,CAAc,GAG3CE,IAAmBC,EAAS;AAAA,EACrC,MAAMC,EAAU,QAAQ;AAAA,EACxB,OAAOjB,EAAE;AAAA,EACT,QAAQkB,EAAWlB,GAAU;AAAA;AAAA,EAC7B,OAAOkB,EAAWlB,GA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