@astrato-io/visualizations 0.10.0 → 0.10.1
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/CHANGELOG.md +10 -0
- package/README.md +3 -3
- package/VISUALIZATION_DEFINITIONS.md +65 -12
- package/chunks/{Button-CCF851ea.js → Button-Dn3rJrYf.js} +2 -2
- package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-BFeu06Yb.js} +4 -4
- package/chunks/{FieldTypeIcon-D_MzsdfY.js → FieldTypeIcon-DrMoGpHJ.js} +2 -2
- package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-ClO6GUjN.js} +2 -2
- package/chunks/{MenuOption-CQpT79AP.js → MenuOption-Czc34u4q.js} +7 -7
- package/chunks/{Title-C-p4ZarD.js → Title-BgYnaVTR.js} +3 -3
- package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-BMu9uRax.js} +8 -8
- package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-CVir0wkl.js} +3 -3
- package/chunks/{bar-layout-DStC-GNV.js → bar-layout-C_UgRlVl.js} +2 -2
- package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-DYuFdi9J.js} +8 -8
- package/chunks/{builder-CScg1TOS.js → builder-C-TKA-My.js} +11 -11
- package/chunks/{coloring-9jU3s_-p.js → coloring-BtnPiQ_o.js} +16 -16
- package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter--zrZxRV9.js} +1 -1
- package/chunks/defaults-Dtk7fg3C.js +3 -0
- package/chunks/{definitions-C4grxhye.js → definitions-CT304NDn.js} +77 -51
- package/chunks/{escobar-CjirINHP.js → escobar-CvEV2ES1.js} +6126 -6059
- package/chunks/{extend-preset-D-l9u_we.js → extend-preset-D9-JP92b.js} +396 -396
- package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CXeZznks.js} +7 -7
- package/chunks/{filtering-C1zakrrX.js → filtering-8_bFv-jb.js} +84 -84
- package/chunks/{handlers-ZviIUC-j.js → handlers-C6CZ0XJA.js} +5620 -5608
- package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-BXiJ1SZS.js} +2 -2
- package/chunks/{isEqual-Ch9OEye3.js → isEqual-D8Ay63xR.js} +1 -1
- package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-Bu8gGZu5.js} +1 -1
- package/chunks/{line.compiler-De5fiKuR.js → line.compiler-DmHpmQCC.js} +4 -4
- package/chunks/{logger-CKRjhSHQ.js → logger-DdZpR7xZ.js} +65 -65
- package/chunks/{map.compiler-CKzorLgK.js → map.compiler-Q_Y1Pvat.js} +12 -14
- package/chunks/{metadata-Bb9pTXrq.js → metadata-BQm_TXI1.js} +1 -1
- package/chunks/{number.compiler-CaTmJkmi.js → number.compiler-DQdg6zTy.js} +4 -4
- package/chunks/{operations-DZoY50VX.js → operations-DKQWuLL7.js} +9469 -9451
- package/chunks/{range-D1BTmFMp.js → range-BdhzvYQ_.js} +2 -2
- package/chunks/{react-dom-Dgv2azN2.js → react-dom-BGP4tbXV.js} +1 -1
- package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-BZpyDnJy.js} +1 -1
- package/chunks/{requirements-NHNrR8Ie.js → requirements-e8Fe96ag.js} +29 -29
- package/chunks/{shared-UitWpq1J.js → shared-C_2F90xq.js} +478 -472
- package/chunks/{standalone-wgFAVnnm.js → standalone-4MsKiqs0.js} +130 -130
- package/chunks/standalone-B794g9pE.js +1012 -0
- package/chunks/{standalone-BBu90BhK.js → standalone-B8ZSqauS.js} +59 -59
- package/chunks/standalone-BA2YXyJS.js +422 -0
- package/chunks/{standalone-DtBk_iUz.js → standalone-BDrXVxlP.js} +4 -4
- package/chunks/{standalone-U0WJwFlG.js → standalone-BE_ONgiG.js} +64 -64
- package/chunks/{standalone-BOzHA_d4.js → standalone-BTY3w_JA.js} +24 -24
- package/chunks/{standalone-BEekPuA12.js → standalone-BgumbdaJ2.js} +101 -101
- package/chunks/{standalone-Bnnr87pc.js → standalone-BkbiH-o8.js} +174 -174
- package/chunks/{standalone-xGV0dqPV.js → standalone-Blh4qejk.js} +197 -197
- package/chunks/{standalone-DxBAyqAu.js → standalone-CXY4FpF7.js} +278 -277
- package/chunks/{standalone-CVknVdUC.js → standalone-CY_kjarf.js} +18 -18
- package/chunks/{standalone-BapqaniK.js → standalone-CaTxAydz.js} +54 -54
- package/chunks/{standalone-CRdDZYeM.js → standalone-Cc98Pdr6.js} +829 -829
- package/chunks/standalone-Cl0TSfqC.js +396 -0
- package/chunks/{standalone-B0U6c3su.js → standalone-CsoMmE9T.js} +80 -80
- package/chunks/standalone-DH0xTEes.js +2 -0
- package/chunks/{standalone-ByKKqT5L.js → standalone-DHRalbVO.js} +268 -268
- package/chunks/{standalone-CbPk8bKn.js → standalone-DNh9NcMa.js} +109 -109
- package/chunks/standalone-DcnHjNnC.js +2 -0
- package/chunks/{standalone-Ck63MZzj.js → standalone-DflyWtuR.js} +107 -107
- package/chunks/standalone-DrHdGkY7.js +762 -0
- package/chunks/standalone-c_rROMtx.js +287 -0
- package/chunks/{standalone-DibjA73M.js → standalone-drcFLeN6.js} +2 -2
- package/chunks/{standalone-swGs70tD.js → standalone-wOWRCpdn.js} +26 -26
- package/chunks/{standalone-DCFY1MAV.js → standalone-z0o52o5t.js} +4191 -4191
- package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-COaHE9VD.js} +18 -18
- package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-CdnCWzhd.js} +1 -1
- package/chunks/{utils-3Igg6xmO.js → utils-DganVptf.js} +491 -483
- package/chunks/{view-DdMLZySj.js → view-Bzlros43.js} +158 -158
- package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-D7i6oh1Z.js} +23 -12
- package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-CiIhFEa5.js} +2497 -2497
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +1 -1
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +1 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- package/docs/operations/histogram.md +1 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +2 -2
- package/docs/operations/line.md +19 -1
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +1 -1
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +1 -1
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +2 -2
- package/index.js +54 -54
- package/metadata.js +2 -2
- package/operations.js +5 -5
- package/package.json +67 -67
- package/src/definitions/index.d.ts +7 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +31 -5
- package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
- package/src/types.d.ts +28 -28
- package/chunks/defaults-cyNhn37t.js +0 -3
- package/chunks/standalone-BR2JuRIC.js +0 -422
- package/chunks/standalone-BwJqDj2Z.js +0 -396
- package/chunks/standalone-CRfDOO1x.js +0 -287
- package/chunks/standalone-DZDGX3aa.js +0 -518
- package/chunks/standalone-DhfgeJIk.js +0 -1012
- package/chunks/standalone-KMQPsNsq.js +0 -2
- package/chunks/standalone-MBLSvsrY.js +0 -2
|
@@ -1,216 +1,216 @@
|
|
|
1
|
-
import { As as e,
|
|
2
|
-
import {
|
|
3
|
-
import { T as
|
|
4
|
-
import { z as
|
|
5
|
-
var
|
|
6
|
-
orientation:
|
|
7
|
-
selectionMode:
|
|
1
|
+
import { As as e, Cs as t, Io as n, Lo as r, Ss as i, ds as a, js as o, r as s, ul as c, vs as l, ys as u } from "./visualization-filters-D7i6oh1Z.js";
|
|
2
|
+
import { $p as d, Cm as f, Gh as ee, Hg as te, Kg as ne, Lh as re, Lm as ie, Mh as ae, Nh as oe, Rg as se, Sg as ce, Uh as le, Wh as ue, Yg as de, Ym as p, _h as m, am as fe, b_ as pe, ch as me, cm as he, fh as ge, g_ as _e, gh as ve, hh as ye, i_ as be, ih as xe, im as h, jh as Se, mh as Ce, nh as we, nm as g, p_ as _, ph as Te, s_ as Ee, sh as De, sm as Oe, uh as ke } from "./handlers-C6CZ0XJA.js";
|
|
3
|
+
import { T as Ae, d as je, t as Me, y as v } from "./operations-DKQWuLL7.js";
|
|
4
|
+
import { z as y } from "zod";
|
|
5
|
+
var b = c(), Ne = y.object({
|
|
6
|
+
orientation: y.enum(["horizontal", "vertical"]).optional(),
|
|
7
|
+
selectionMode: y.enum([
|
|
8
8
|
"inherit",
|
|
9
9
|
"auto",
|
|
10
10
|
"manual"
|
|
11
11
|
]).optional(),
|
|
12
|
-
enableAddingNewFilters:
|
|
13
|
-
enableAssociativeFilter:
|
|
14
|
-
showClearAll:
|
|
15
|
-
showChartBreakdown:
|
|
16
|
-
selectableFieldKeys:
|
|
17
|
-
}).strict(),
|
|
18
|
-
settings:
|
|
19
|
-
type:
|
|
20
|
-
version:
|
|
21
|
-
}).strict(),
|
|
22
|
-
distinct:
|
|
23
|
-
name:
|
|
24
|
-
resultType:
|
|
25
|
-
}).strict(),
|
|
26
|
-
aggregations:
|
|
27
|
-
dataType:
|
|
28
|
-
fieldKey:
|
|
29
|
-
isManualData:
|
|
30
|
-
kind:
|
|
31
|
-
name:
|
|
32
|
-
view:
|
|
33
|
-
}).strict(),
|
|
34
|
-
description:
|
|
35
|
-
id:
|
|
36
|
-
key:
|
|
37
|
-
name:
|
|
38
|
-
views:
|
|
39
|
-
}).passthrough(),
|
|
40
|
-
dimension:
|
|
41
|
-
type:
|
|
42
|
-
}),
|
|
43
|
-
measure:
|
|
44
|
-
type:
|
|
45
|
-
}),
|
|
46
|
-
calculation:
|
|
47
|
-
type:
|
|
48
|
-
}),
|
|
49
|
-
fieldKey:
|
|
50
|
-
item: Re,
|
|
51
|
-
kind: b.literal("dimension"),
|
|
52
|
-
name: b.string().min(1)
|
|
53
|
-
}).strict(), He = b.object({
|
|
54
|
-
fieldKey: w,
|
|
12
|
+
enableAddingNewFilters: y.boolean().optional(),
|
|
13
|
+
enableAssociativeFilter: y.boolean().optional(),
|
|
14
|
+
showClearAll: y.boolean().optional(),
|
|
15
|
+
showChartBreakdown: y.boolean().optional(),
|
|
16
|
+
selectableFieldKeys: y.array(y.string()).optional()
|
|
17
|
+
}).strict(), Pe = y.object({
|
|
18
|
+
settings: Ne.optional(),
|
|
19
|
+
type: y.literal("astrato-app-filter-bar"),
|
|
20
|
+
version: y.literal(1)
|
|
21
|
+
}).strict(), x = (e) => e, S = y.string().trim().min(1).max(100), C = y.string().min(1).refine((e) => e.trim().length > 0, "Field key cannot be blank."), Fe = x(Ee.shape.dataType), Ie = x(be.shape.formatType), Le = y.object({
|
|
22
|
+
distinct: y.boolean().optional(),
|
|
23
|
+
name: y.string().trim().min(1),
|
|
24
|
+
resultType: y.string().optional()
|
|
25
|
+
}).strict(), Re = y.object({
|
|
26
|
+
aggregations: y.array(Le).default([]),
|
|
27
|
+
dataType: Fe,
|
|
28
|
+
fieldKey: C,
|
|
29
|
+
isManualData: y.boolean().optional(),
|
|
30
|
+
kind: y.literal("field").default("field"),
|
|
31
|
+
name: y.string().min(1),
|
|
32
|
+
view: y.string().min(1)
|
|
33
|
+
}).strict(), w = y.object({
|
|
34
|
+
description: y.string().optional(),
|
|
35
|
+
id: y.string().min(1).optional(),
|
|
36
|
+
key: C,
|
|
37
|
+
name: y.string().min(1),
|
|
38
|
+
views: y.array(y.string()).optional()
|
|
39
|
+
}).passthrough(), ze = w.extend({
|
|
40
|
+
dimension: y.record(y.string(), y.unknown()),
|
|
41
|
+
type: y.literal("dimension")
|
|
42
|
+
}), Be = w.extend({
|
|
43
|
+
measure: y.object({ aggregation: y.string().min(1) }).passthrough(),
|
|
44
|
+
type: y.literal("measure")
|
|
45
|
+
}), Ve = w.extend({
|
|
46
|
+
calculation: y.record(y.string(), y.unknown()),
|
|
47
|
+
type: y.literal("calculation")
|
|
48
|
+
}), He = y.object({
|
|
49
|
+
fieldKey: C,
|
|
55
50
|
item: ze,
|
|
56
|
-
kind:
|
|
57
|
-
name:
|
|
58
|
-
}).strict(), Ue =
|
|
59
|
-
fieldKey:
|
|
51
|
+
kind: y.literal("dimension"),
|
|
52
|
+
name: y.string().min(1)
|
|
53
|
+
}).strict(), Ue = y.object({
|
|
54
|
+
fieldKey: C,
|
|
60
55
|
item: Be,
|
|
61
|
-
kind:
|
|
62
|
-
name:
|
|
63
|
-
}).strict(),
|
|
64
|
-
|
|
65
|
-
Ve,
|
|
56
|
+
kind: y.literal("measure"),
|
|
57
|
+
name: y.string().min(1)
|
|
58
|
+
}).strict(), We = y.object({
|
|
59
|
+
fieldKey: C,
|
|
60
|
+
item: Ve,
|
|
61
|
+
kind: y.literal("calculation"),
|
|
62
|
+
name: y.string().min(1)
|
|
63
|
+
}).strict(), T = y.union([
|
|
64
|
+
Re,
|
|
66
65
|
He,
|
|
67
|
-
Ue
|
|
66
|
+
Ue,
|
|
67
|
+
We
|
|
68
68
|
]).superRefine((e, t) => {
|
|
69
69
|
e.kind !== "field" && e.item.key !== e.fieldKey && t.addIssue({
|
|
70
70
|
code: "custom",
|
|
71
71
|
message: "Semantic item key must match fieldKey.",
|
|
72
72
|
path: ["item", "key"]
|
|
73
73
|
});
|
|
74
|
-
}),
|
|
75
|
-
currency:
|
|
76
|
-
currencyIsPrefix:
|
|
77
|
-
formatString:
|
|
78
|
-
formatType:
|
|
79
|
-
negativeType:
|
|
80
|
-
}).strict(),
|
|
81
|
-
dateLevel:
|
|
82
|
-
mode:
|
|
83
|
-
}).strict(),
|
|
84
|
-
datePart:
|
|
85
|
-
mode:
|
|
86
|
-
}).strict()]),
|
|
87
|
-
fieldKey:
|
|
88
|
-
format:
|
|
74
|
+
}), Ge = y.object({
|
|
75
|
+
currency: y.string().min(1).optional(),
|
|
76
|
+
currencyIsPrefix: y.boolean().optional(),
|
|
77
|
+
formatString: y.string().optional(),
|
|
78
|
+
formatType: Ie.optional(),
|
|
79
|
+
negativeType: x(be.shape.negativeType.unwrap()).optional()
|
|
80
|
+
}).strict(), Ke = y.discriminatedUnion("mode", [y.object({
|
|
81
|
+
dateLevel: x(y.enum(b.DateLevel)).describe("Year-aware bucket, such as month over time."),
|
|
82
|
+
mode: y.literal("level")
|
|
83
|
+
}).strict(), y.object({
|
|
84
|
+
datePart: x(y.enum(b.DatePart)).describe("Date part, such as month of year."),
|
|
85
|
+
mode: y.literal("part")
|
|
86
|
+
}).strict()]), E = y.object({
|
|
87
|
+
fieldKey: C,
|
|
88
|
+
format: Ge.pick({
|
|
89
89
|
formatString: !0,
|
|
90
90
|
formatType: !0
|
|
91
91
|
}).optional(),
|
|
92
|
-
ref:
|
|
93
|
-
showNullValues:
|
|
94
|
-
temporalGrouping:
|
|
95
|
-
}).strict(),
|
|
96
|
-
placements:
|
|
97
|
-
textColor:
|
|
98
|
-
visible:
|
|
99
|
-
}).strict(),
|
|
100
|
-
aggregation:
|
|
101
|
-
dataLabels:
|
|
102
|
-
fieldKey:
|
|
103
|
-
format:
|
|
104
|
-
ref:
|
|
105
|
-
}).strict(),
|
|
106
|
-
fieldKey:
|
|
107
|
-
operator:
|
|
108
|
-
value:
|
|
109
|
-
}).strict(),
|
|
110
|
-
fieldKey:
|
|
111
|
-
operator:
|
|
112
|
-
valueFrom:
|
|
113
|
-
valueTo:
|
|
114
|
-
}).strict(),
|
|
115
|
-
fieldKey:
|
|
116
|
-
operator:
|
|
117
|
-
values:
|
|
118
|
-
}).strict(),
|
|
119
|
-
fieldKey:
|
|
120
|
-
operator:
|
|
121
|
-
}).strict(),
|
|
122
|
-
qe,
|
|
92
|
+
ref: S,
|
|
93
|
+
showNullValues: y.boolean().optional(),
|
|
94
|
+
temporalGrouping: Ke.describe("Groups a date dimension. Applied before format; format must then suit the grouping.").optional()
|
|
95
|
+
}).strict(), qe = y.object({
|
|
96
|
+
placements: y.array(x(y.enum(_e))).min(1).describe("Positions tried in order. Inside labels sit at the end of the bar.").optional(),
|
|
97
|
+
textColor: _.describe("Label text color in every placement. Omit to keep the automatic contrast color.").optional(),
|
|
98
|
+
visible: y.boolean()
|
|
99
|
+
}).strict(), D = y.object({
|
|
100
|
+
aggregation: y.string().trim().min(1).describe("Required for a raw field measure; omit for a predefined measure or calculation.").optional(),
|
|
101
|
+
dataLabels: qe.optional(),
|
|
102
|
+
fieldKey: C,
|
|
103
|
+
format: Ge.optional(),
|
|
104
|
+
ref: S
|
|
105
|
+
}).strict(), Je = y.object({
|
|
106
|
+
fieldKey: C,
|
|
107
|
+
operator: x(y.enum(re)),
|
|
108
|
+
value: y.string()
|
|
109
|
+
}).strict(), Ye = y.object({
|
|
110
|
+
fieldKey: C,
|
|
111
|
+
operator: x(y.enum(oe)),
|
|
112
|
+
valueFrom: y.string(),
|
|
113
|
+
valueTo: y.string()
|
|
114
|
+
}).strict(), Xe = y.object({
|
|
115
|
+
fieldKey: C,
|
|
116
|
+
operator: x(y.enum(Se)),
|
|
117
|
+
values: y.array(y.string()).min(1)
|
|
118
|
+
}).strict(), Ze = y.object({
|
|
119
|
+
fieldKey: C,
|
|
120
|
+
operator: x(y.enum(ae))
|
|
121
|
+
}).strict(), Qe = y.union([
|
|
123
122
|
Je,
|
|
124
123
|
Ye,
|
|
125
|
-
Xe
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
124
|
+
Xe,
|
|
125
|
+
Ze
|
|
126
|
+
]), O = y.lazy(() => y.object({
|
|
127
|
+
filters: y.array(y.union([Qe, O])),
|
|
128
|
+
operator: y.enum(["and", "or"])
|
|
129
|
+
}).strict()), k = y.object({
|
|
130
|
+
by: S,
|
|
131
|
+
direction: x(se.shape.sortDirection),
|
|
132
|
+
enabled: y.boolean().optional()
|
|
133
|
+
}).strict(), $e = y.object({
|
|
134
|
+
by: S,
|
|
135
|
+
count: y.number().int().positive(),
|
|
136
|
+
direction: x(se.shape.sortDirection),
|
|
137
|
+
showOthers: y.boolean().optional()
|
|
138
|
+
}).strict(), et = y.object({
|
|
139
|
+
queryLimit: y.number().int().positive().optional(),
|
|
140
|
+
topN: $e.optional()
|
|
141
|
+
}).strict(), tt = y.object({
|
|
142
|
+
position: x(de.shape.position).optional(),
|
|
143
|
+
title: y.string().optional(),
|
|
144
|
+
visible: y.boolean().optional()
|
|
145
|
+
}).strict(), A = y.object({
|
|
146
|
+
labelsVisible: y.boolean().optional(),
|
|
147
|
+
lineVisible: y.boolean().optional(),
|
|
148
|
+
ticksVisible: y.boolean().optional(),
|
|
149
|
+
title: y.string().optional(),
|
|
150
|
+
titleVisible: y.boolean().optional()
|
|
151
|
+
}).strict(), nt = y.union([y.object({
|
|
152
|
+
max: y.number().optional(),
|
|
153
|
+
min: y.number().optional().describe("Must be less than max when both are set")
|
|
154
|
+
}).strict(), y.object({ startsAtZero: y.boolean() }).strict()]).describe("Fix min, max or both, or set startsAtZero on an axis fitted to the data"), rt = y.array(ce).optional().describe("Shaded ranges drawn across the plot between two primary measure axis values"), it = le({}), at = le({ dimension: S.describe(`Alias of a dimension in data.dimensions. ${ee}`) }), ot = ue({ measure: S.describe("Alias of the measure in data.measures whose value is compared") }), st = "Colors bound to dimension values, eg. \"Happy\" is dark teal. The first matching entry wins, ahead of rules and the palette. For ordered bands, add one entry per band with colors taken along a ramp.", ct = y.array(ot).min(1).describe("Colors bound to measure thresholds, eg. red when sales is below 100. The first matching rule wins."), j = (e) => y.object({
|
|
155
|
+
overwrites: y.array(e.requiresOverwriteDimension ? at : it).min(1).describe(st).optional(),
|
|
156
|
+
...e.rules ? { rules: ct.optional() } : {}
|
|
157
|
+
}).strict(), lt = {
|
|
158
|
+
inverted: y.boolean().optional().describe("Reverse the direction of the axis values, eg. to put rank 1 at the top"),
|
|
159
|
+
range: nt.optional()
|
|
160
|
+
}, M = { bands: rt }, ut = { scale: x(y.enum(pe)).optional() };
|
|
161
|
+
A.extend({
|
|
163
162
|
...lt,
|
|
163
|
+
...M,
|
|
164
164
|
...ut
|
|
165
165
|
}).strict();
|
|
166
166
|
var N = ({ logScale: e = !1, primaryMeasureBands: t = !1, rangedMeasureAxes: n = [] } = {}) => {
|
|
167
|
-
let r = (t, r) =>
|
|
168
|
-
...n.includes(t) ?
|
|
169
|
-
...r ?
|
|
167
|
+
let r = (t, r) => A.extend({
|
|
168
|
+
...n.includes(t) ? lt : {},
|
|
169
|
+
...r ? M : {},
|
|
170
170
|
...e ? ut : {}
|
|
171
171
|
}).strict();
|
|
172
|
-
return
|
|
173
|
-
dimension:
|
|
172
|
+
return y.object({
|
|
173
|
+
dimension: A.optional(),
|
|
174
174
|
primaryMeasure: r("primaryMeasure", t).optional(),
|
|
175
175
|
secondaryMeasure: r("secondaryMeasure", !1).optional()
|
|
176
176
|
}).strict();
|
|
177
177
|
};
|
|
178
178
|
N();
|
|
179
|
-
var dt =
|
|
179
|
+
var dt = y.object({
|
|
180
180
|
axes: N({
|
|
181
181
|
logScale: !0,
|
|
182
182
|
primaryMeasureBands: !0,
|
|
183
183
|
rangedMeasureAxes: ["primaryMeasure", "secondaryMeasure"]
|
|
184
184
|
}).optional(),
|
|
185
|
-
legend:
|
|
186
|
-
orientation:
|
|
187
|
-
}).strict(), ft =
|
|
188
|
-
data:
|
|
189
|
-
dimensions:
|
|
190
|
-
measures:
|
|
185
|
+
legend: tt.optional(),
|
|
186
|
+
orientation: x(y.enum(r)).optional()
|
|
187
|
+
}).strict(), ft = x(y.enum([l.Groups, l.Stacked])).describe("How several measures, or a series dimension, share a category: \"groups\" side by side, \"stacked\" into one bar. Ignored for one dimension with one measure. Defaults to groups for several measures on one dimension, otherwise stacked."), pt = D.extend({ axis: y.enum(["primary", "secondary"]).optional() }), mt = y.object({
|
|
188
|
+
data: y.object({
|
|
189
|
+
dimensions: y.array(E),
|
|
190
|
+
measures: y.array(pt).min(1)
|
|
191
191
|
}).strict(),
|
|
192
|
-
filterGroup:
|
|
193
|
-
limiting:
|
|
192
|
+
filterGroup: O.optional(),
|
|
193
|
+
limiting: et.optional(),
|
|
194
194
|
presentation: dt.extend({
|
|
195
|
-
coloring:
|
|
195
|
+
coloring: j({ rules: !0 }).optional(),
|
|
196
196
|
layout: ft.optional()
|
|
197
197
|
}).optional(),
|
|
198
|
-
sorting:
|
|
199
|
-
type:
|
|
200
|
-
version:
|
|
201
|
-
}).strict(), ht =
|
|
202
|
-
let
|
|
198
|
+
sorting: y.array(k).optional(),
|
|
199
|
+
type: y.literal("bar"),
|
|
200
|
+
version: y.literal(1)
|
|
201
|
+
}).strict(), ht = y.object({ visible: y.boolean() }).strict(), gt = (e, t) => y.array(e).min(t.min).max(t.max), P = (e, t) => {
|
|
202
|
+
let n = {};
|
|
203
203
|
if (t.dimensions.max > 0) {
|
|
204
|
-
let e = gt(
|
|
205
|
-
|
|
204
|
+
let e = gt(E, t.dimensions);
|
|
205
|
+
n.dimensions = t.dimensions.min === 0 ? e.optional() : e;
|
|
206
206
|
}
|
|
207
207
|
if (t.measures.max > 0) {
|
|
208
|
-
let e = t.dataLabels ?
|
|
208
|
+
let e = t.dataLabels ? D.omit({ dataLabels: !0 }).extend({ dataLabels: ht.optional() }) : D.omit({ dataLabels: !0 }), r = t.comboSeriesTypes ? e.extend({ seriesType: y.enum([
|
|
209
209
|
"bar",
|
|
210
210
|
"line",
|
|
211
211
|
"point"
|
|
212
|
-
]).optional() }) : e, i = gt(t.measureAxis ?
|
|
213
|
-
|
|
212
|
+
]).optional() }) : e, i = gt(t.measureAxis ? r.extend({ axis: y.enum(["primary", "secondary"]).optional() }) : r, t.measures);
|
|
213
|
+
n.measures = t.measures.min === 0 ? i.optional() : i;
|
|
214
214
|
}
|
|
215
215
|
let i = {};
|
|
216
216
|
if (t.axes) {
|
|
@@ -219,26 +219,26 @@ var dt = b.object({
|
|
|
219
219
|
primaryMeasureBands: t.measureAxisBands,
|
|
220
220
|
rangedMeasureAxes: t.rangedMeasureAxes
|
|
221
221
|
});
|
|
222
|
-
i.axes = (t.secondaryDimensionAxis ? e.extend({ secondaryDimension:
|
|
222
|
+
i.axes = (t.secondaryDimensionAxis ? e.extend({ secondaryDimension: A.optional() }) : e).optional();
|
|
223
223
|
}
|
|
224
|
-
t.conditionalColoring && (i.coloring =
|
|
225
|
-
compact:
|
|
226
|
-
direction:
|
|
224
|
+
t.conditionalColoring && (i.coloring = j(t.conditionalColoring).optional()), t.dataLabels && (i.dataLabels = ht.optional()), t.gaugeDisplayMode && (i.displayMode = y.enum(["bar", "radial"]).optional()), t.legend && (i.legend = tt.optional()), t.orientation && (i.orientation = x(y.enum(r)).optional()), t.treeLayout && (i.layout = y.object({
|
|
225
|
+
compact: y.boolean().optional(),
|
|
226
|
+
direction: y.enum([
|
|
227
227
|
"bottom",
|
|
228
228
|
"left",
|
|
229
229
|
"right",
|
|
230
230
|
"top"
|
|
231
231
|
]).optional(),
|
|
232
|
-
forceAutoFit:
|
|
233
|
-
initialExpandedLevels:
|
|
232
|
+
forceAutoFit: y.boolean().optional(),
|
|
233
|
+
initialExpandedLevels: y.number().int().min(0).optional()
|
|
234
234
|
}).strict().optional());
|
|
235
235
|
let a = {
|
|
236
|
-
data:
|
|
237
|
-
filterGroup:
|
|
238
|
-
type:
|
|
239
|
-
version:
|
|
236
|
+
data: y.object(n).strict(),
|
|
237
|
+
filterGroup: O.optional(),
|
|
238
|
+
type: y.literal(e),
|
|
239
|
+
version: y.literal(1)
|
|
240
240
|
};
|
|
241
|
-
return t.queryLimit && (a.limiting =
|
|
241
|
+
return t.queryLimit && (a.limiting = y.object({ queryLimit: y.number().int().positive().optional() }).strict().optional()), Object.keys(i).length > 0 && (a.presentation = y.object(i).strict().optional()), t.sorting && (a.sorting = y.array(k).optional()), y.object(a).strict().superRefine((n, r) => {
|
|
242
242
|
let i = n.data, a = t.validateCounts?.(i.dimensions?.length ?? 0, i.measures?.length ?? 0);
|
|
243
243
|
a && r.addIssue({
|
|
244
244
|
code: "custom",
|
|
@@ -458,7 +458,7 @@ var dt = b.object({
|
|
|
458
458
|
dataLabels: !0,
|
|
459
459
|
dimensions: {
|
|
460
460
|
min: 0,
|
|
461
|
-
max:
|
|
461
|
+
max: 1
|
|
462
462
|
},
|
|
463
463
|
measureAxisBands: !0,
|
|
464
464
|
measures: {
|
|
@@ -466,7 +466,8 @@ var dt = b.object({
|
|
|
466
466
|
max: 100
|
|
467
467
|
},
|
|
468
468
|
orientation: !0,
|
|
469
|
-
rangedMeasureAxes: ["primaryMeasure"]
|
|
469
|
+
rangedMeasureAxes: ["primaryMeasure"],
|
|
470
|
+
validateCounts: (e, t) => e === 1 && t !== 2 ? "Waterfall charts with a dimension require exactly two measures." : void 0
|
|
470
471
|
}), At = P("word-cloud", {
|
|
471
472
|
conditionalColoring: { rules: !0 },
|
|
472
473
|
dimensions: {
|
|
@@ -477,41 +478,41 @@ var dt = b.object({
|
|
|
477
478
|
min: 1,
|
|
478
479
|
max: 1
|
|
479
480
|
}
|
|
480
|
-
}), jt =
|
|
481
|
+
}), jt = y.enum(["dropdown", "listbox"]), Mt = y.object({
|
|
481
482
|
mode: jt.optional(),
|
|
482
|
-
quickSelect:
|
|
483
|
-
responsive:
|
|
484
|
-
searchable:
|
|
485
|
-
showProgressBar:
|
|
486
|
-
}).strict(), Nt =
|
|
487
|
-
data:
|
|
483
|
+
quickSelect: y.boolean().optional(),
|
|
484
|
+
responsive: y.boolean().optional(),
|
|
485
|
+
searchable: y.boolean().optional(),
|
|
486
|
+
showProgressBar: y.boolean().optional()
|
|
487
|
+
}).strict(), Nt = y.object({
|
|
488
|
+
data: y.object({ field: E.omit({
|
|
488
489
|
format: !0,
|
|
489
490
|
showNullValues: !0,
|
|
490
491
|
temporalGrouping: !0
|
|
491
492
|
}) }).strict(),
|
|
492
493
|
presentation: Mt.optional(),
|
|
493
|
-
type:
|
|
494
|
-
version:
|
|
495
|
-
}).strict(), Pt =
|
|
496
|
-
axis:
|
|
497
|
-
dataPointShape:
|
|
498
|
-
}), Ft =
|
|
499
|
-
density:
|
|
500
|
-
visible:
|
|
494
|
+
type: y.literal("filter"),
|
|
495
|
+
version: y.literal(1)
|
|
496
|
+
}).strict(), Pt = D.omit({ dataLabels: !0 }).extend({
|
|
497
|
+
axis: y.enum(["primary", "secondary"]).optional(),
|
|
498
|
+
dataPointShape: x(ne.shape.dataPointShape)
|
|
499
|
+
}), Ft = y.object({
|
|
500
|
+
density: te.optional(),
|
|
501
|
+
visible: y.boolean()
|
|
501
502
|
}).strict(), It = dt.extend({
|
|
502
|
-
coloring:
|
|
503
|
+
coloring: j({ rules: !1 }).optional(),
|
|
503
504
|
dataLabels: Ft.optional()
|
|
504
|
-
}), Lt =
|
|
505
|
-
data:
|
|
506
|
-
dimensions:
|
|
507
|
-
measures:
|
|
505
|
+
}), Lt = y.object({
|
|
506
|
+
data: y.object({
|
|
507
|
+
dimensions: y.array(E).min(1),
|
|
508
|
+
measures: y.array(Pt).min(1)
|
|
508
509
|
}).strict(),
|
|
509
|
-
filterGroup:
|
|
510
|
-
limiting:
|
|
510
|
+
filterGroup: O.optional(),
|
|
511
|
+
limiting: y.object({ queryLimit: y.number().int().positive().optional() }).strict().optional(),
|
|
511
512
|
presentation: It.optional(),
|
|
512
|
-
sorting:
|
|
513
|
-
type:
|
|
514
|
-
version:
|
|
513
|
+
sorting: y.array(k).optional(),
|
|
514
|
+
type: y.literal("line"),
|
|
515
|
+
version: y.literal(1)
|
|
515
516
|
}).strict().superRefine((e, t) => {
|
|
516
517
|
e.presentation?.coloring && e.data.dimensions.length < 2 && t.addIssue({
|
|
517
518
|
code: "custom",
|
|
@@ -529,53 +530,53 @@ var dt = b.object({
|
|
|
529
530
|
]
|
|
530
531
|
});
|
|
531
532
|
});
|
|
532
|
-
}), Rt =
|
|
533
|
+
}), Rt = E.pick({
|
|
533
534
|
fieldKey: !0,
|
|
534
535
|
ref: !0
|
|
535
|
-
}), zt =
|
|
536
|
+
}), zt = D.pick({
|
|
536
537
|
aggregation: !0,
|
|
537
538
|
fieldKey: !0,
|
|
538
539
|
ref: !0
|
|
539
|
-
}), Bt = zt.extend({ role:
|
|
540
|
+
}), Bt = zt.extend({ role: y.enum([
|
|
540
541
|
"geo",
|
|
541
542
|
"secondGeo",
|
|
542
543
|
"thirdGeo",
|
|
543
544
|
"fourthGeo",
|
|
544
545
|
"size",
|
|
545
546
|
"measure"
|
|
546
|
-
]) }), F =
|
|
547
|
+
]) }), F = y.enum([
|
|
547
548
|
"latLng",
|
|
548
549
|
"geoPoint",
|
|
549
550
|
"geoHash"
|
|
550
|
-
]), I =
|
|
551
|
-
name:
|
|
552
|
-
ref:
|
|
553
|
-
visible:
|
|
554
|
-
}), Vt =
|
|
555
|
-
dimensions:
|
|
556
|
-
measures:
|
|
557
|
-
supportingMeasures:
|
|
551
|
+
]), I = y.object({
|
|
552
|
+
name: y.string().trim().min(1).optional(),
|
|
553
|
+
ref: S.describe("Reference unique among all layers and data items; resolvedLayerRefs returns it as { kind: \"layer\", id }."),
|
|
554
|
+
visible: y.boolean().optional()
|
|
555
|
+
}), Vt = y.object({
|
|
556
|
+
dimensions: y.array(Rt).length(1),
|
|
557
|
+
measures: y.array(Bt).min(1),
|
|
558
|
+
supportingMeasures: y.array(zt).optional()
|
|
558
559
|
}).strict(), L = I.extend({
|
|
559
560
|
data: Vt,
|
|
560
|
-
filterGroup:
|
|
561
|
-
}), Ht =
|
|
562
|
-
color:
|
|
563
|
-
opacity:
|
|
561
|
+
filterGroup: O.optional()
|
|
562
|
+
}), Ht = xe.partial().strict(), R = y.object({
|
|
563
|
+
color: _.optional(),
|
|
564
|
+
opacity: Ce
|
|
564
565
|
}).strict(), Ut = I.extend({
|
|
565
|
-
type:
|
|
566
|
-
presentation:
|
|
566
|
+
type: y.literal("map"),
|
|
567
|
+
presentation: x(ke.pick({
|
|
567
568
|
mapType: !0,
|
|
568
569
|
opacity: !0,
|
|
569
570
|
apiKey: !0,
|
|
570
571
|
mapLanguage: !0,
|
|
571
572
|
politicalView: !0
|
|
572
573
|
}).extend({
|
|
573
|
-
layerType:
|
|
574
|
+
layerType: y.enum([
|
|
574
575
|
"default",
|
|
575
576
|
"humanitarian",
|
|
576
577
|
"cycle"
|
|
577
578
|
]),
|
|
578
|
-
layerStyle:
|
|
579
|
+
layerStyle: y.enum([
|
|
579
580
|
"default",
|
|
580
581
|
"greyscale",
|
|
581
582
|
"black",
|
|
@@ -583,67 +584,67 @@ var dt = b.object({
|
|
|
583
584
|
])
|
|
584
585
|
}).partial().strict()).optional()
|
|
585
586
|
}).strict(), Wt = I.extend({
|
|
586
|
-
type:
|
|
587
|
-
image:
|
|
588
|
-
position:
|
|
589
|
-
opacity:
|
|
587
|
+
type: y.literal("image"),
|
|
588
|
+
image: me.shape.image.strict(),
|
|
589
|
+
position: me.shape.position.strict(),
|
|
590
|
+
opacity: Ce
|
|
590
591
|
}).strict(), Gt = L.extend({
|
|
591
|
-
type:
|
|
592
|
+
type: y.literal("point"),
|
|
592
593
|
locationType: F,
|
|
593
|
-
presentation:
|
|
594
|
-
shape:
|
|
594
|
+
presentation: x(R.extend({
|
|
595
|
+
shape: ve.shape.shape,
|
|
595
596
|
sizing: Ht.optional(),
|
|
596
|
-
labelsVisible:
|
|
597
|
+
labelsVisible: y.boolean().optional()
|
|
597
598
|
}).strict()).optional()
|
|
598
599
|
}).strict(), Kt = L.extend({
|
|
599
|
-
type:
|
|
600
|
-
presentation:
|
|
601
|
-
strokeEnabled:
|
|
602
|
-
strokeColor:
|
|
603
|
-
strokeWidth:
|
|
604
|
-
labelsVisible:
|
|
600
|
+
type: y.literal("shape"),
|
|
601
|
+
presentation: x(R.extend({
|
|
602
|
+
strokeEnabled: m.shape.strokeEnabled,
|
|
603
|
+
strokeColor: m.shape.strokeColor,
|
|
604
|
+
strokeWidth: m.shape.strokeWidth,
|
|
605
|
+
labelsVisible: y.boolean().optional()
|
|
605
606
|
}).strict()).optional()
|
|
606
607
|
}).strict(), qt = L.extend({
|
|
607
|
-
type:
|
|
608
|
+
type: y.literal("heatMap"),
|
|
608
609
|
locationType: F,
|
|
609
|
-
presentation:
|
|
610
|
-
heat:
|
|
610
|
+
presentation: x(y.object({
|
|
611
|
+
heat: De.pick({
|
|
611
612
|
radius: !0,
|
|
612
613
|
maxZoom: !0,
|
|
613
614
|
blur: !0,
|
|
614
615
|
changeHeatWhenZooming: !0
|
|
615
616
|
}).partial().strict().optional(),
|
|
616
|
-
value:
|
|
617
|
+
value: Te.partial().strict().optional()
|
|
617
618
|
}).strict()).optional()
|
|
618
619
|
}).strict(), Jt = L.extend({
|
|
619
|
-
type:
|
|
620
|
-
data: Vt.extend({ dimensions:
|
|
620
|
+
type: y.literal("pointConnection"),
|
|
621
|
+
data: Vt.extend({ dimensions: y.array(Rt).length(2) }).strict(),
|
|
621
622
|
locationType: F,
|
|
622
623
|
secondLocationType: F,
|
|
623
|
-
presentation:
|
|
624
|
+
presentation: x(R.extend({
|
|
624
625
|
sizing: Ht.optional(),
|
|
625
|
-
useGeodesicLines:
|
|
626
|
-
lineStyle:
|
|
627
|
-
arrow:
|
|
626
|
+
useGeodesicLines: y.boolean().optional(),
|
|
627
|
+
lineStyle: ye.shape.lineStyle.optional(),
|
|
628
|
+
arrow: we.partial().strict().optional()
|
|
628
629
|
}).strict()).optional()
|
|
629
|
-
}).strict(), Yt =
|
|
630
|
+
}).strict(), Yt = y.discriminatedUnion("type", [
|
|
630
631
|
Ut,
|
|
631
632
|
Wt,
|
|
632
633
|
Gt,
|
|
633
634
|
Kt,
|
|
634
635
|
qt,
|
|
635
636
|
Jt
|
|
636
|
-
]), Xt =
|
|
637
|
-
type:
|
|
638
|
-
version:
|
|
639
|
-
layers:
|
|
640
|
-
view:
|
|
641
|
-
}).strict(), Zt =
|
|
642
|
-
data:
|
|
643
|
-
filterGroup:
|
|
644
|
-
type:
|
|
645
|
-
version:
|
|
646
|
-
}).strict(), Qt =
|
|
637
|
+
]), Xt = y.object({
|
|
638
|
+
type: y.literal("map"),
|
|
639
|
+
version: y.literal(1),
|
|
640
|
+
layers: y.array(Yt).min(1).describe("Layers in stacking order, topmost first. Include a map layer explicitly when a basemap is wanted."),
|
|
641
|
+
view: x(ge.partial().strict()).optional()
|
|
642
|
+
}).strict(), Zt = y.object({
|
|
643
|
+
data: y.object({ measure: D.omit({ dataLabels: !0 }) }).strict(),
|
|
644
|
+
filterGroup: O.optional(),
|
|
645
|
+
type: y.literal("number"),
|
|
646
|
+
version: y.literal(1)
|
|
647
|
+
}).strict(), Qt = x(ie.pick({
|
|
647
648
|
endDateLabel: !0,
|
|
648
649
|
pickerState: !0,
|
|
649
650
|
pickerType: !0,
|
|
@@ -652,32 +653,32 @@ var dt = b.object({
|
|
|
652
653
|
startDateLabel: !0,
|
|
653
654
|
timePickerVisibility: !0,
|
|
654
655
|
weekStart: !0
|
|
655
|
-
}).partial()), $t =
|
|
656
|
-
data:
|
|
656
|
+
}).partial()), $t = y.object({
|
|
657
|
+
data: y.object({ field: E.omit({
|
|
657
658
|
format: !0,
|
|
658
659
|
showNullValues: !0,
|
|
659
660
|
temporalGrouping: !0
|
|
660
661
|
}) }).strict(),
|
|
661
662
|
settings: Qt.optional(),
|
|
662
|
-
type:
|
|
663
|
-
version:
|
|
664
|
-
}).strict(), en =
|
|
665
|
-
settings:
|
|
666
|
-
type:
|
|
667
|
-
version:
|
|
668
|
-
}).strict(), tn =
|
|
669
|
-
settings:
|
|
670
|
-
blur:
|
|
671
|
-
fit:
|
|
672
|
-
opacity:
|
|
673
|
-
saturation:
|
|
674
|
-
shadow:
|
|
675
|
-
source:
|
|
663
|
+
type: y.literal("date-picker"),
|
|
664
|
+
version: y.literal(1)
|
|
665
|
+
}).strict(), en = y.object({
|
|
666
|
+
settings: y.object({ url: y.string().url().nullable() }).strict(),
|
|
667
|
+
type: y.literal("iframe"),
|
|
668
|
+
version: y.literal(1)
|
|
669
|
+
}).strict(), tn = y.object({
|
|
670
|
+
settings: x(y.object({
|
|
671
|
+
blur: f.shape.blur.optional(),
|
|
672
|
+
fit: f.shape.image.unwrap().shape.imageFit.optional(),
|
|
673
|
+
opacity: f.shape.opacity.optional(),
|
|
674
|
+
saturation: f.shape.saturation.optional(),
|
|
675
|
+
shadow: f.shape.shadow.optional(),
|
|
676
|
+
source: je.optional()
|
|
676
677
|
}).strict()),
|
|
677
|
-
type:
|
|
678
|
-
version:
|
|
679
|
-
}).strict(), nn =
|
|
680
|
-
settings:
|
|
678
|
+
type: y.literal("image"),
|
|
679
|
+
version: y.literal(1)
|
|
680
|
+
}).strict(), nn = y.object({
|
|
681
|
+
settings: x(he.pick({
|
|
681
682
|
backgroundColor: !0,
|
|
682
683
|
backgroundType: !0,
|
|
683
684
|
borderEnabled: !0,
|
|
@@ -692,12 +693,12 @@ var dt = b.object({
|
|
|
692
693
|
shape: !0,
|
|
693
694
|
strokeColor: !0
|
|
694
695
|
}).partial().strict()),
|
|
695
|
-
type:
|
|
696
|
-
version:
|
|
697
|
-
}).strict(), z =
|
|
698
|
-
settings:
|
|
696
|
+
type: y.literal("shape"),
|
|
697
|
+
version: y.literal(1)
|
|
698
|
+
}).strict(), z = Oe.shape.simpleTextObjectSettings, rn = y.object({
|
|
699
|
+
settings: x(y.object({
|
|
699
700
|
align: z.shape.align.optional(),
|
|
700
|
-
content:
|
|
701
|
+
content: y.string().optional(),
|
|
701
702
|
fontFamily: z.shape.fontFamily.optional(),
|
|
702
703
|
fontSize: z.shape.fontSize.optional(),
|
|
703
704
|
position: z.shape.position.optional(),
|
|
@@ -706,140 +707,140 @@ var dt = b.object({
|
|
|
706
707
|
textColor: z.shape.textColor.optional(),
|
|
707
708
|
wordWrap: z.shape.wordWrap.optional()
|
|
708
709
|
}).strict()),
|
|
709
|
-
type:
|
|
710
|
-
version:
|
|
711
|
-
}).strict(), an =
|
|
712
|
-
settings:
|
|
713
|
-
customLabel:
|
|
714
|
-
hideLabel:
|
|
715
|
-
inputType:
|
|
716
|
-
placeholder:
|
|
717
|
-
responsive:
|
|
718
|
-
variableId:
|
|
710
|
+
type: y.literal("simpleTextObject"),
|
|
711
|
+
version: y.literal(1)
|
|
712
|
+
}).strict(), an = y.object({
|
|
713
|
+
settings: x(y.object({
|
|
714
|
+
customLabel: p.shape.commonSettings.shape.customLabel.optional(),
|
|
715
|
+
hideLabel: p.shape.commonSettings.shape.hideLabel.optional(),
|
|
716
|
+
inputType: p.shape.type.optional(),
|
|
717
|
+
placeholder: p.shape.commonSettings.shape.placeholder.optional(),
|
|
718
|
+
responsive: p.shape.commonSettings.shape.responsive.optional(),
|
|
719
|
+
variableId: p.shape.commonSettings.shape.variableId.optional()
|
|
719
720
|
}).strict()),
|
|
720
|
-
type:
|
|
721
|
-
version:
|
|
722
|
-
}).strict(), on =
|
|
723
|
-
data:
|
|
721
|
+
type: y.literal("atomic-input"),
|
|
722
|
+
version: y.literal(1)
|
|
723
|
+
}).strict(), on = y.object({
|
|
724
|
+
data: y.object({ field: E.omit({
|
|
724
725
|
format: !0,
|
|
725
726
|
showNullValues: !0,
|
|
726
727
|
temporalGrouping: !0
|
|
727
728
|
}) }).strict(),
|
|
728
|
-
settings:
|
|
729
|
+
settings: x(fe.pick({
|
|
729
730
|
layout: !0,
|
|
730
731
|
quickSelect: !0,
|
|
731
732
|
range: !0,
|
|
732
733
|
step: !0
|
|
733
734
|
}).partial()).optional(),
|
|
734
|
-
type:
|
|
735
|
-
version:
|
|
736
|
-
}).strict(), sn =
|
|
737
|
-
columns:
|
|
738
|
-
structure:
|
|
739
|
-
}).strict(), un =
|
|
740
|
-
dimensions:
|
|
741
|
-
measures:
|
|
742
|
-
structure:
|
|
743
|
-
}).strict(), dn =
|
|
744
|
-
columnDimensions:
|
|
745
|
-
measures:
|
|
746
|
-
rowDimensions:
|
|
747
|
-
structure:
|
|
748
|
-
}).strict(), fn =
|
|
735
|
+
type: y.literal("slider"),
|
|
736
|
+
version: y.literal(1)
|
|
737
|
+
}).strict(), sn = E.extend({ role: y.literal("dimension") }), B = D.omit({ dataLabels: !0 }), cn = B.extend({ role: y.literal("measure") }), ln = y.object({
|
|
738
|
+
columns: y.array(y.discriminatedUnion("role", [sn, cn])).min(1),
|
|
739
|
+
structure: y.literal("normal").optional()
|
|
740
|
+
}).strict(), un = y.object({
|
|
741
|
+
dimensions: y.array(E).min(1),
|
|
742
|
+
measures: y.array(B).min(1),
|
|
743
|
+
structure: y.literal("expandable")
|
|
744
|
+
}).strict(), dn = y.object({
|
|
745
|
+
columnDimensions: y.array(E).min(1),
|
|
746
|
+
measures: y.array(B).min(1),
|
|
747
|
+
rowDimensions: y.array(E).min(1),
|
|
748
|
+
structure: y.literal("pivot")
|
|
749
|
+
}).strict(), fn = y.union([
|
|
749
750
|
ln,
|
|
750
751
|
un,
|
|
751
752
|
dn
|
|
752
|
-
]), pn =
|
|
753
|
-
applyTo:
|
|
754
|
-
enabled:
|
|
755
|
-
showRecordsCount:
|
|
756
|
-
style:
|
|
757
|
-
backgroundColor:
|
|
758
|
-
fontColor:
|
|
759
|
-
fontStyle:
|
|
760
|
-
position:
|
|
761
|
-
responsiveHeight:
|
|
753
|
+
]), pn = y.object({
|
|
754
|
+
applyTo: d.shape.applyTo,
|
|
755
|
+
enabled: d.shape.enabled,
|
|
756
|
+
showRecordsCount: d.shape.showRecordsCount,
|
|
757
|
+
style: y.object({
|
|
758
|
+
backgroundColor: h.shape.backgroundColor.optional(),
|
|
759
|
+
fontColor: h.shape.fontColor.optional(),
|
|
760
|
+
fontStyle: g.optional(),
|
|
761
|
+
position: h.shape.position.optional(),
|
|
762
|
+
responsiveHeight: h.shape.responsive
|
|
762
763
|
}).strict().optional()
|
|
763
|
-
}).strict(), mn =
|
|
764
|
-
background:
|
|
765
|
-
color:
|
|
766
|
-
evenColor:
|
|
767
|
-
oddColor:
|
|
768
|
-
type:
|
|
764
|
+
}).strict(), mn = y.object({
|
|
765
|
+
background: y.object({
|
|
766
|
+
color: _.optional(),
|
|
767
|
+
evenColor: _.optional(),
|
|
768
|
+
oddColor: _.optional(),
|
|
769
|
+
type: y.enum([
|
|
769
770
|
"none",
|
|
770
771
|
"single",
|
|
771
772
|
"zebra"
|
|
772
773
|
])
|
|
773
774
|
}).strict().optional(),
|
|
774
|
-
body:
|
|
775
|
-
fontColor:
|
|
776
|
-
fontFamily:
|
|
777
|
-
fontSize:
|
|
778
|
-
fontStyle:
|
|
779
|
-
horizontalAlign:
|
|
775
|
+
body: y.object({
|
|
776
|
+
fontColor: _.optional(),
|
|
777
|
+
fontFamily: y.string().trim().min(1).optional(),
|
|
778
|
+
fontSize: y.number().positive().optional(),
|
|
779
|
+
fontStyle: g.optional(),
|
|
780
|
+
horizontalAlign: y.enum([
|
|
780
781
|
"auto",
|
|
781
782
|
"center",
|
|
782
783
|
"left",
|
|
783
784
|
"right"
|
|
784
785
|
]).optional(),
|
|
785
|
-
verticalAlign:
|
|
786
|
+
verticalAlign: y.enum([
|
|
786
787
|
"auto",
|
|
787
788
|
"bottom",
|
|
788
789
|
"middle",
|
|
789
790
|
"top"
|
|
790
791
|
]).optional()
|
|
791
792
|
}).strict().optional(),
|
|
792
|
-
borders:
|
|
793
|
-
color:
|
|
794
|
-
dividerColor:
|
|
795
|
-
dividers:
|
|
793
|
+
borders: y.object({
|
|
794
|
+
color: _.optional(),
|
|
795
|
+
dividerColor: _.optional(),
|
|
796
|
+
dividers: y.enum([
|
|
796
797
|
"all",
|
|
797
798
|
"auto",
|
|
798
799
|
"horizontal",
|
|
799
800
|
"none",
|
|
800
801
|
"vertical"
|
|
801
802
|
]).optional(),
|
|
802
|
-
enabled:
|
|
803
|
-
lineStyle:
|
|
803
|
+
enabled: y.boolean(),
|
|
804
|
+
lineStyle: y.enum([
|
|
804
805
|
"dashed",
|
|
805
806
|
"dotted",
|
|
806
807
|
"line"
|
|
807
808
|
]).optional(),
|
|
808
|
-
radius:
|
|
809
|
-
strokeWidth:
|
|
809
|
+
radius: y.number().nonnegative().optional(),
|
|
810
|
+
strokeWidth: y.number().nonnegative().optional()
|
|
810
811
|
}).strict().optional(),
|
|
811
|
-
header:
|
|
812
|
-
backgroundColor:
|
|
813
|
-
borderColor:
|
|
814
|
-
fontColor:
|
|
815
|
-
fontFamily:
|
|
816
|
-
fontSize:
|
|
817
|
-
fontStyle:
|
|
818
|
-
responsiveHeight:
|
|
812
|
+
header: y.object({
|
|
813
|
+
backgroundColor: _.optional(),
|
|
814
|
+
borderColor: _.optional(),
|
|
815
|
+
fontColor: _.optional(),
|
|
816
|
+
fontFamily: y.string().trim().min(1).optional(),
|
|
817
|
+
fontSize: y.number().positive().optional(),
|
|
818
|
+
fontStyle: g.optional(),
|
|
819
|
+
responsiveHeight: y.boolean().optional()
|
|
819
820
|
}).strict().optional(),
|
|
820
|
-
highlight:
|
|
821
|
-
backgroundColor:
|
|
822
|
-
mode:
|
|
821
|
+
highlight: y.object({
|
|
822
|
+
backgroundColor: _.optional(),
|
|
823
|
+
mode: y.enum([
|
|
823
824
|
"column",
|
|
824
825
|
"none",
|
|
825
826
|
"row",
|
|
826
827
|
"row-and-column"
|
|
827
828
|
]),
|
|
828
|
-
textColor:
|
|
829
|
+
textColor: _.optional()
|
|
829
830
|
}).strict().optional(),
|
|
830
|
-
layout:
|
|
831
|
-
columnWidthBehavior:
|
|
832
|
-
rowHeight:
|
|
831
|
+
layout: y.object({
|
|
832
|
+
columnWidthBehavior: y.enum(["responsive", "static"]).optional(),
|
|
833
|
+
rowHeight: y.number().positive().optional()
|
|
833
834
|
}).strict().optional()
|
|
834
|
-
}).strict(), hn =
|
|
835
|
+
}).strict(), hn = y.object({
|
|
835
836
|
data: fn,
|
|
836
|
-
filterGroup:
|
|
837
|
-
limiting:
|
|
837
|
+
filterGroup: O.optional(),
|
|
838
|
+
limiting: y.object({ queryLimit: y.number().int().positive().optional() }).strict().optional(),
|
|
838
839
|
presentation: mn.optional(),
|
|
839
|
-
sorting:
|
|
840
|
+
sorting: y.array(k).optional(),
|
|
840
841
|
totals: pn.optional(),
|
|
841
|
-
type:
|
|
842
|
-
version:
|
|
842
|
+
type: y.literal("table"),
|
|
843
|
+
version: y.literal(1)
|
|
843
844
|
}).strict(), V = (e) => typeof e == "object" && !!e && !Array.isArray(e), gn = (e) => {
|
|
844
845
|
let t = e.fieldKey ?? e.key;
|
|
845
846
|
return typeof t == "string" ? t : void 0;
|
|
@@ -859,7 +860,7 @@ var dt = b.object({
|
|
|
859
860
|
}, vn = (e, t) => {
|
|
860
861
|
let n = e.type;
|
|
861
862
|
if (!(n === "dimension" && V(e.dimension) || n === "measure" && V(e.measure) || n === "calculation" && V(e.calculation))) return;
|
|
862
|
-
let r =
|
|
863
|
+
let r = T.safeParse({
|
|
863
864
|
fieldKey: e.key,
|
|
864
865
|
item: e,
|
|
865
866
|
kind: n,
|
|
@@ -869,11 +870,11 @@ var dt = b.object({
|
|
|
869
870
|
return r.data;
|
|
870
871
|
}, yn = (e, t) => {
|
|
871
872
|
if (!V(e)) throw Error(`Available field at index ${t} must be an object.`);
|
|
872
|
-
let n =
|
|
873
|
+
let n = T.safeParse(e);
|
|
873
874
|
if (n.success) return n.data;
|
|
874
875
|
let r = vn(e, t);
|
|
875
876
|
if (r) return r;
|
|
876
|
-
let i = Array.isArray(e.aggregations) ? e.aggregations : Array.isArray(e.aggregators) ? e.aggregators : [], a =
|
|
877
|
+
let i = Array.isArray(e.aggregations) ? e.aggregations : Array.isArray(e.aggregators) ? e.aggregators : [], a = T.safeParse({
|
|
877
878
|
aggregations: i.map((e) => V(e) ? {
|
|
878
879
|
distinct: e.distinct,
|
|
879
880
|
name: e.name ?? e.funcName,
|
|
@@ -898,83 +899,88 @@ var dt = b.object({
|
|
|
898
899
|
}, xn = (e) => e.kind === "field" ? [...new Set(e.aggregations.flatMap((e) => [e.name, ...e.distinct ? [`${e.name}_DISTINCT`] : []]))] : [], Sn = (e, t) => e.kind === "field" || t === "dimension" && e.kind === "dimension" || t === "measure" && (e.kind === "measure" || e.kind === "calculation"), Cn = (e) => {
|
|
899
900
|
if (e.kind !== "dimension") return e.kind;
|
|
900
901
|
}, wn = (e) => ({
|
|
901
|
-
...
|
|
902
|
+
...u(e.item),
|
|
902
903
|
id: e.item.id ?? e.fieldKey
|
|
903
|
-
}),
|
|
904
|
-
aggregators:
|
|
904
|
+
}), H = (n) => n.map((n) => n.kind === "dimension" ? t(wn(n)) : n.kind === "measure" || n.kind === "calculation" ? i(wn(n)) : {
|
|
905
|
+
aggregators: e(n.aggregations.map((e) => ({
|
|
905
906
|
distinct: e.distinct ?? !1,
|
|
906
907
|
name: e.name,
|
|
907
908
|
resultType: e.resultType
|
|
908
909
|
}))),
|
|
909
|
-
dataType:
|
|
910
|
-
isManualData:
|
|
911
|
-
key:
|
|
912
|
-
name:
|
|
913
|
-
view:
|
|
914
|
-
views: [
|
|
915
|
-
}),
|
|
910
|
+
dataType: n.dataType,
|
|
911
|
+
isManualData: n.isManualData,
|
|
912
|
+
key: n.fieldKey,
|
|
913
|
+
name: n.name,
|
|
914
|
+
view: n.view,
|
|
915
|
+
views: [n.view]
|
|
916
|
+
}), Tn = (e, t) => {
|
|
916
917
|
let n = Math.min(e.length, t.length), r = 0;
|
|
917
918
|
for (; r < n && e[r].toLocaleLowerCase() === t[r].toLocaleLowerCase();) r += 1;
|
|
918
919
|
return r;
|
|
919
|
-
},
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
],
|
|
920
|
+
}, En = (e, t) => [...t].sort((t, n) => Tn(e, n.fieldKey) - Tn(e, t.fieldKey) || t.fieldKey.localeCompare(n.fieldKey)).slice(0, 5).map((e) => e.fieldKey), Dn = [
|
|
921
|
+
b.FieldType.DATE,
|
|
922
|
+
b.FieldType.TIME,
|
|
923
|
+
b.FieldType.TIMESTAMP,
|
|
924
|
+
b.FieldType.TIMESTAMP_TZ
|
|
925
|
+
], U = (e, t, n, r) => ({
|
|
925
926
|
...r ? { allowedValues: r } : {},
|
|
926
927
|
code: e,
|
|
927
928
|
message: n,
|
|
928
929
|
path: t
|
|
929
|
-
}),
|
|
930
|
+
}), On = (e) => xn(e).filter((e) => !!o(e)), kn = (e, t) => {
|
|
930
931
|
let n = t.find((t) => t.fieldKey === e.fieldKey);
|
|
931
|
-
return n?.kind === "field" ?
|
|
932
|
-
},
|
|
932
|
+
return n?.kind === "field" ? On(n).find((t) => t.toLocaleUpperCase() === e.aggregation?.toLocaleUpperCase()) : void 0;
|
|
933
|
+
}, An = (e, t) => {
|
|
933
934
|
let n = t.find((t) => t.fieldKey === e.fieldKey);
|
|
934
|
-
return n?.kind === "measure" ? n.item.measure.aggregation :
|
|
935
|
-
},
|
|
936
|
-
let r = t.find((t) => t.fieldKey === e.fieldKey), i = r ? Cn(r) : void 0, a =
|
|
935
|
+
return n?.kind === "measure" ? n.item.measure.aggregation : kn(e, t);
|
|
936
|
+
}, jn = (e, t, n = {}) => {
|
|
937
|
+
let r = t.find((t) => t.fieldKey === e.fieldKey), i = r ? Cn(r) : void 0, a = kn(e, t);
|
|
937
938
|
return {
|
|
938
939
|
...n,
|
|
939
940
|
key: e.fieldKey,
|
|
940
941
|
...i ? { sourceKind: i } : {},
|
|
941
942
|
...a ? { aggregation: a } : {}
|
|
942
943
|
};
|
|
943
|
-
},
|
|
944
|
+
}, W = (e, t, n, r) => {
|
|
944
945
|
let i = t.find((t) => t.fieldKey === e.fieldKey);
|
|
945
|
-
if (!i) return [
|
|
946
|
-
if (!Sn(i, r)) return [
|
|
947
|
-
if (r !== "measure") return e.temporalGrouping ?
|
|
948
|
-
if (i.kind !== "field") return e.aggregation === void 0 ? [] : [
|
|
949
|
-
let a =
|
|
950
|
-
return e.aggregation ? a.some((t) => t.toLocaleUpperCase() === e.aggregation?.toLocaleUpperCase()) ? [] : [
|
|
951
|
-
},
|
|
946
|
+
if (!i) return [U("unknown_field_key", [...n, "fieldKey"], `Field key "${e.fieldKey}" is not available.`, En(e.fieldKey, t))];
|
|
947
|
+
if (!Sn(i, r)) return [U("invalid_field_role", [...n, "fieldKey"], `Available item "${e.fieldKey}" of kind "${i.kind}" cannot be used as a ${r}.`)];
|
|
948
|
+
if (r !== "measure") return e.temporalGrouping ? Nn(e, t, n, Dn, "a temporally grouped dimension") : [];
|
|
949
|
+
if (i.kind !== "field") return e.aggregation === void 0 ? [] : [U("invalid_aggregation", [...n, "aggregation"], `Aggregation must be omitted for semantic ${i.kind} "${e.fieldKey}".`)];
|
|
950
|
+
let a = On(i);
|
|
951
|
+
return e.aggregation ? a.some((t) => t.toLocaleUpperCase() === e.aggregation?.toLocaleUpperCase()) ? [] : [U("invalid_aggregation", [...n, "aggregation"], `Aggregation "${e.aggregation}" is not available for field key "${e.fieldKey}".`, a)] : [U("invalid_aggregation", [...n, "aggregation"], `Aggregation is required for raw field "${e.fieldKey}" when it is used as a measure.`, a)];
|
|
952
|
+
}, Mn = (e, t, n, r) => e.flatMap((e, i) => W(e, t, [...n, i], r)), Nn = (e, t, n, r, i) => {
|
|
952
953
|
let a = t.find((t) => t.fieldKey === e.fieldKey);
|
|
953
|
-
return a?.kind !== "field" || r.includes(a.dataType) ? [] : [
|
|
954
|
-
},
|
|
954
|
+
return a?.kind !== "field" || r.includes(a.dataType) ? [] : [U("invalid_field_role", [...n, "fieldKey"], `Raw field "${e.fieldKey}" has data type "${a.dataType}" and cannot be used as ${i}.`, [...r])];
|
|
955
|
+
}, Pn = (e, t, n = ["filterGroup"]) => e ? e.filters.flatMap((e, r) => {
|
|
955
956
|
let i = [
|
|
956
957
|
...n,
|
|
957
958
|
"filters",
|
|
958
959
|
r
|
|
959
960
|
];
|
|
960
|
-
|
|
961
|
+
if ("filters" in e) return Pn(e, t, i);
|
|
962
|
+
let a = W({
|
|
961
963
|
fieldKey: e.fieldKey,
|
|
962
964
|
ref: `filter:${r}`
|
|
963
965
|
}, t, i, "dimension");
|
|
964
|
-
|
|
966
|
+
return a.length > 0 ? a : Fn(e.fieldKey, t, i);
|
|
967
|
+
}) : [], Fn = (e, t, n) => {
|
|
968
|
+
let r = t.find((t) => t.fieldKey === e);
|
|
969
|
+
return r?.kind !== "field" || r.dataType === void 0 || r.dataType === b.FieldType.STRING ? [] : [U("invalid_filter", [...n, "fieldKey"], `Static filters only support string fields, but "${e}" has data type "${r.dataType}". Filter a string field instead.`)];
|
|
970
|
+
}, G = (e) => e.reduce((e, t) => typeof t == "number" ? `${e}[${t}]` : /^[A-Za-z_$][\w$]*$/.test(t) ? e ? `${e}.${t}` : t : `${e}[${JSON.stringify(t)}]`, "") || "definition", K = (e) => {
|
|
965
971
|
if (typeof e == "number" && !Number.isFinite(e)) return String(e);
|
|
966
972
|
try {
|
|
967
973
|
return JSON.stringify(e) ?? String(e);
|
|
968
974
|
} catch {
|
|
969
975
|
return String(e);
|
|
970
976
|
}
|
|
971
|
-
},
|
|
977
|
+
}, q = (e, t) => t.reduce((e, t) => typeof e == "object" && e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0, e), In = (e) => {
|
|
972
978
|
if (e.code === "invalid_value") return e.values;
|
|
973
979
|
if (e.code !== "invalid_union" || e.errors.length === 0) return;
|
|
974
980
|
let t = e.errors.map((e) => e.length === 1 && e[0].path.length === 0 ? In(e[0]) : void 0);
|
|
975
981
|
return t.every((e) => e !== void 0) ? [...new Set(t.flat())] : void 0;
|
|
976
982
|
}, Ln = (e) => e.filter((e) => typeof e != "symbol"), Rn = (e, t, n = []) => {
|
|
977
|
-
let r = (e, n) => e.code === "invalid_union" && e.path.length === 0 ? e.errors.length > 0 && e.errors.every((e) => e.some((e) => r(e, n))) : e.code === "invalid_value" && e.path.length === 1 &&
|
|
983
|
+
let r = (e, n) => e.code === "invalid_union" && e.path.length === 0 ? e.errors.length > 0 && e.errors.every((e) => e.some((e) => r(e, n))) : e.code === "invalid_value" && e.path.length === 1 && q(t, [...n, ...Ln(e.path)]) !== void 0, i = (e, a) => {
|
|
978
984
|
let o = [...a, ...Ln(e.path)];
|
|
979
985
|
if (e.code === "unrecognized_keys") return e.keys.map((r) => {
|
|
980
986
|
let i = [
|
|
@@ -985,17 +991,17 @@ var dt = b.object({
|
|
|
985
991
|
return {
|
|
986
992
|
code: "invalid_structure",
|
|
987
993
|
path: i,
|
|
988
|
-
message: `${
|
|
994
|
+
message: `${G(i)}: Unrecognized key.`,
|
|
989
995
|
details: {
|
|
990
|
-
received:
|
|
996
|
+
received: q(t, [...o, r]),
|
|
991
997
|
zodCode: e.code
|
|
992
998
|
}
|
|
993
999
|
};
|
|
994
1000
|
});
|
|
995
|
-
let s = [...n, ...o], c =
|
|
1001
|
+
let s = [...n, ...o], c = q(t, o), l = In(e), u = {
|
|
996
1002
|
received: c,
|
|
997
1003
|
zodCode: e.code
|
|
998
|
-
}, d = l ? `Unsupported value ${
|
|
1004
|
+
}, d = l ? `Unsupported value ${K(c)}. Allowed values: ${l.map(K).join(", ")}.` : `${e.message}. Received: ${K(c)}.`;
|
|
999
1005
|
if (e.code === "invalid_union" && !l && e.errors.length > 0) {
|
|
1000
1006
|
let t = e.errors, n = t.filter((e) => !e.some((e) => r(e, o))), a = n.length > 0 ? n : t, s = a.length === 1 ? a : a.filter((e) => !e.some((e) => e.code === "unrecognized_keys"));
|
|
1001
1007
|
if (s.length === 1) return s[0].flatMap((e) => i(e, o));
|
|
@@ -1005,7 +1011,7 @@ var dt = b.object({
|
|
|
1005
1011
|
return [{
|
|
1006
1012
|
code: "invalid_structure",
|
|
1007
1013
|
path: s,
|
|
1008
|
-
message: `${
|
|
1014
|
+
message: `${G(s)}: ${d}`,
|
|
1009
1015
|
details: u,
|
|
1010
1016
|
...l ? { allowedValues: l } : {}
|
|
1011
1017
|
}];
|
|
@@ -1013,25 +1019,25 @@ var dt = b.object({
|
|
|
1013
1019
|
return e.issues.flatMap((e) => i(e, []));
|
|
1014
1020
|
};
|
|
1015
1021
|
s();
|
|
1016
|
-
var zn = (e,
|
|
1017
|
-
let r = "legend" in e && !!e.legend, i =
|
|
1018
|
-
return
|
|
1022
|
+
var zn = (e, t) => {
|
|
1023
|
+
let r = "legend" in e && !!e.legend, i = t.position !== void 0 || t.title !== void 0, a = [];
|
|
1024
|
+
return t.visible !== void 0 && (t.visible || i || r) ? a.push({
|
|
1019
1025
|
name: "setLegendEnabled",
|
|
1020
|
-
payload:
|
|
1021
|
-
}) :
|
|
1026
|
+
payload: t.visible
|
|
1027
|
+
}) : t.visible === void 0 && i && !r && a.push({
|
|
1022
1028
|
name: "setLegendEnabled",
|
|
1023
1029
|
payload: !0
|
|
1024
|
-
}),
|
|
1030
|
+
}), t.position === void 0 ? (t.visible === !0 || i && !r) && a.push({
|
|
1025
1031
|
name: "setLegendPosition",
|
|
1026
|
-
payload:
|
|
1032
|
+
payload: n.Right
|
|
1027
1033
|
}) : a.push({
|
|
1028
1034
|
name: "setLegendPosition",
|
|
1029
|
-
payload:
|
|
1030
|
-
}),
|
|
1035
|
+
payload: t.position
|
|
1036
|
+
}), t.title !== void 0 && a.push({
|
|
1031
1037
|
name: "setLegendTitle",
|
|
1032
|
-
payload:
|
|
1038
|
+
payload: t.title
|
|
1033
1039
|
}), a;
|
|
1034
|
-
},
|
|
1040
|
+
}, J = (e, t, n, r = {}) => ({
|
|
1035
1041
|
code: e,
|
|
1036
1042
|
message: n,
|
|
1037
1043
|
path: t,
|
|
@@ -1039,7 +1045,7 @@ var zn = (e, n) => {
|
|
|
1039
1045
|
}), Bn = (e, t, n, r, i, a) => ({
|
|
1040
1046
|
name: e,
|
|
1041
1047
|
payload: {
|
|
1042
|
-
...
|
|
1048
|
+
...Y(t),
|
|
1043
1049
|
[i]: a
|
|
1044
1050
|
},
|
|
1045
1051
|
definitionContext: {
|
|
@@ -1068,14 +1074,14 @@ var zn = (e, n) => {
|
|
|
1068
1074
|
ref: n,
|
|
1069
1075
|
kind: o
|
|
1070
1076
|
}
|
|
1071
|
-
}),
|
|
1077
|
+
}), Y = (e) => ({
|
|
1072
1078
|
dataItemInternalKey: e.dataItemInternalKey,
|
|
1073
1079
|
dataItemUniqueSignature: e.dataItemUniqueSignature
|
|
1074
1080
|
}), Hn = (e) => {
|
|
1075
1081
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
1076
1082
|
return e.forEach(({ items: e, path: r }) => {
|
|
1077
1083
|
e.forEach((e, i) => {
|
|
1078
|
-
n.has(e.ref) && t.push(
|
|
1084
|
+
n.has(e.ref) && t.push(J("duplicate_alias", [
|
|
1079
1085
|
...r,
|
|
1080
1086
|
i,
|
|
1081
1087
|
"ref"
|
|
@@ -1086,14 +1092,14 @@ var zn = (e, n) => {
|
|
|
1086
1092
|
let n = e, r = n.referencedData;
|
|
1087
1093
|
return t.every((e) => !Array.isArray(n[e]) || n[e].length === 0) && (typeof r != "object" || !r || Object.keys(r).length === 0);
|
|
1088
1094
|
}, Wn = (e, t) => ({
|
|
1089
|
-
availableFields:
|
|
1095
|
+
availableFields: H(e.availableFields),
|
|
1090
1096
|
input: e,
|
|
1091
1097
|
resolvedRefs: {},
|
|
1092
1098
|
vSpec: t
|
|
1093
|
-
}),
|
|
1099
|
+
}), Gn = (e, t, n, r, i) => ({
|
|
1094
1100
|
name: e,
|
|
1095
1101
|
payload: {
|
|
1096
|
-
...
|
|
1102
|
+
...Y(t),
|
|
1097
1103
|
...i
|
|
1098
1104
|
},
|
|
1099
1105
|
definitionContext: {
|
|
@@ -1102,7 +1108,7 @@ var zn = (e, n) => {
|
|
|
1102
1108
|
ref: n,
|
|
1103
1109
|
kind: t.kind
|
|
1104
1110
|
}
|
|
1105
|
-
}),
|
|
1111
|
+
}), Kn = (e) => "value" in e ? { value: e.value } : "values" in e ? {
|
|
1106
1112
|
secondValue: e.values.join(","),
|
|
1107
1113
|
value: ","
|
|
1108
1114
|
} : "valueFrom" in e ? {
|
|
@@ -1112,40 +1118,40 @@ var zn = (e, n) => {
|
|
|
1112
1118
|
filters: e.filters.map((e) => "filters" in e ? X(e) : {
|
|
1113
1119
|
fieldKey: e.fieldKey,
|
|
1114
1120
|
operator: e.operator,
|
|
1115
|
-
values:
|
|
1121
|
+
values: Kn(e)
|
|
1116
1122
|
}),
|
|
1117
1123
|
operator: e.operator
|
|
1118
|
-
}),
|
|
1124
|
+
}), qn = (e, t) => (e ?? []).flatMap((e, n) => t.includes(e.by) ? [] : [J("unknown_alias", [
|
|
1119
1125
|
"sorting",
|
|
1120
1126
|
n,
|
|
1121
1127
|
"by"
|
|
1122
|
-
], `Reference "${e.by}" does not exist.`, { allowedValues: t })]), Z = ["presentation", "coloring"],
|
|
1128
|
+
], `Reference "${e.by}" does not exist.`, { allowedValues: t })]), Z = ["presentation", "coloring"], Jn = (e, t, n) => [...(e?.overwrites ?? []).flatMap(({ dimension: e }, n) => e === void 0 || t.includes(e) ? [] : [J("unknown_alias", [
|
|
1123
1129
|
...Z,
|
|
1124
1130
|
"overwrites",
|
|
1125
1131
|
n,
|
|
1126
1132
|
"dimension"
|
|
1127
|
-
], `Dimension reference "${e}" does not exist.`, { allowedValues: t })]), ...(e?.rules ?? []).flatMap(({ measure: e }, t) => n.includes(e) ? [] : [
|
|
1133
|
+
], `Dimension reference "${e}" does not exist.`, { allowedValues: t })]), ...(e?.rules ?? []).flatMap(({ measure: e }, t) => n.includes(e) ? [] : [J("unknown_alias", [
|
|
1128
1134
|
...Z,
|
|
1129
1135
|
"rules",
|
|
1130
1136
|
t,
|
|
1131
1137
|
"measure"
|
|
1132
|
-
], `Measure reference "${e}" does not exist.`, { allowedValues: n })])],
|
|
1138
|
+
], `Measure reference "${e}" does not exist.`, { allowedValues: n })])], Yn = (e, t) => {
|
|
1133
1139
|
let n = t.safeParse(e.vSpec);
|
|
1134
1140
|
return n.success ? {
|
|
1135
1141
|
resolvedRefs: e.resolvedRefs,
|
|
1136
1142
|
success: !0,
|
|
1137
1143
|
vSpec: n.data
|
|
1138
1144
|
} : {
|
|
1139
|
-
issues: [
|
|
1145
|
+
issues: [J("invalid_compiled_vspec", [], "Compiled vSpec failed final validation.", { details: { issues: n.error.issues } })],
|
|
1140
1146
|
success: !1
|
|
1141
1147
|
};
|
|
1142
|
-
}, Q = (e) => "startsAtZero" in e ? {} : e,
|
|
1148
|
+
}, Q = (e) => "startsAtZero" in e ? {} : e, Xn = (e) => {
|
|
1143
1149
|
let { max: t, min: n } = Q(e);
|
|
1144
|
-
return n !== void 0 && t !== void 0 ?
|
|
1145
|
-
},
|
|
1150
|
+
return n !== void 0 && t !== void 0 ? a.MinMax : n === void 0 ? t === void 0 ? a.Auto : a.Max : a.Min;
|
|
1151
|
+
}, Zn = (e) => {
|
|
1146
1152
|
for (let [t, n] of Object.entries(e ?? {})) {
|
|
1147
1153
|
let { max: e, min: r } = n?.range ? Q(n.range) : {};
|
|
1148
|
-
if (r !== void 0 && e !== void 0 && r >= e) return
|
|
1154
|
+
if (r !== void 0 && e !== void 0 && r >= e) return J("invalid_structure", [
|
|
1149
1155
|
"presentation",
|
|
1150
1156
|
"axes",
|
|
1151
1157
|
t,
|
|
@@ -1153,10 +1159,10 @@ var zn = (e, n) => {
|
|
|
1153
1159
|
"min"
|
|
1154
1160
|
], `Axis range min (${r}) must be less than max (${e}).`);
|
|
1155
1161
|
}
|
|
1156
|
-
},
|
|
1162
|
+
}, Qn = (e, t) => {
|
|
1157
1163
|
let n = [];
|
|
1158
1164
|
t.inverted !== void 0 && n.push({
|
|
1159
|
-
name:
|
|
1165
|
+
name: v.SET_INVERT_AXIS,
|
|
1160
1166
|
payload: {
|
|
1161
1167
|
axisName: e,
|
|
1162
1168
|
invertAxis: t.inverted
|
|
@@ -1165,27 +1171,27 @@ var zn = (e, n) => {
|
|
|
1165
1171
|
let { range: r } = t;
|
|
1166
1172
|
if (r) {
|
|
1167
1173
|
n.push({
|
|
1168
|
-
name:
|
|
1174
|
+
name: v.SET_AXIS_RANGE_OPTION,
|
|
1169
1175
|
payload: {
|
|
1170
1176
|
axisName: e,
|
|
1171
|
-
axisRangeOption:
|
|
1177
|
+
axisRangeOption: Xn(r)
|
|
1172
1178
|
}
|
|
1173
1179
|
});
|
|
1174
1180
|
let { max: t, min: i } = Q(r);
|
|
1175
1181
|
i !== void 0 && n.push({
|
|
1176
|
-
name:
|
|
1182
|
+
name: v.SET_AXIS_RANGE_MIN,
|
|
1177
1183
|
payload: {
|
|
1178
1184
|
axisName: e,
|
|
1179
1185
|
minValue: i
|
|
1180
1186
|
}
|
|
1181
1187
|
}), t !== void 0 && n.push({
|
|
1182
|
-
name:
|
|
1188
|
+
name: v.SET_AXIS_RANGE_MAX,
|
|
1183
1189
|
payload: {
|
|
1184
1190
|
axisName: e,
|
|
1185
1191
|
maxValue: t
|
|
1186
1192
|
}
|
|
1187
1193
|
}), "startsAtZero" in r && n.push({
|
|
1188
|
-
name:
|
|
1194
|
+
name: v.SET_AXIS_STARTS_AT_ZERO,
|
|
1189
1195
|
payload: {
|
|
1190
1196
|
axisName: e,
|
|
1191
1197
|
startsAtZero: r.startsAtZero
|
|
@@ -1193,7 +1199,7 @@ var zn = (e, n) => {
|
|
|
1193
1199
|
});
|
|
1194
1200
|
}
|
|
1195
1201
|
return n;
|
|
1196
|
-
},
|
|
1202
|
+
}, $n = (e) => {
|
|
1197
1203
|
let t = Object.entries(e).find(([, e]) => e.success === !1);
|
|
1198
1204
|
return t ? {
|
|
1199
1205
|
id: t[0],
|
|
@@ -1203,11 +1209,11 @@ var zn = (e, n) => {
|
|
|
1203
1209
|
let r = t.map((e, t) => ({
|
|
1204
1210
|
...e,
|
|
1205
1211
|
id: e.id ?? `definition:${t}`
|
|
1206
|
-
})), i = await
|
|
1212
|
+
})), i = await Me(e.vSpec, e.availableFields, r.map(({ id: e, name: t, payload: n }) => ({
|
|
1207
1213
|
id: e,
|
|
1208
1214
|
name: t,
|
|
1209
1215
|
payload: n
|
|
1210
|
-
})), e.input.variables ?? [], [], e.input.theme), a =
|
|
1216
|
+
})), e.input.variables ?? [], [], e.input.theme), a = $n(i.results);
|
|
1211
1217
|
if (!a) return {
|
|
1212
1218
|
state: {
|
|
1213
1219
|
...e,
|
|
@@ -1215,9 +1221,9 @@ var zn = (e, n) => {
|
|
|
1215
1221
|
},
|
|
1216
1222
|
success: !0
|
|
1217
1223
|
};
|
|
1218
|
-
let o = r.find((e) => e.id === a.id), s = o?.definitionContext, c = s?.path ?? n, l = o?.name ?? a.id, u = a.result.error ?? "Operation failed.", d = s ? `Cannot apply ${
|
|
1224
|
+
let o = r.find((e) => e.id === a.id), s = o?.definitionContext, c = s?.path ?? n, l = o?.name ?? a.id, u = a.result.error ?? "Operation failed.", d = s ? `Cannot apply ${K(s.received)} to ${s.kind} ${K(s.ref)}` : "Operation failed";
|
|
1219
1225
|
return {
|
|
1220
|
-
issue:
|
|
1226
|
+
issue: J("operation_failed", c, `${G(c)}: ${d} (operation "${l}"): ${u}`, { details: {
|
|
1221
1227
|
error: a.result.error,
|
|
1222
1228
|
operationId: a.id,
|
|
1223
1229
|
operationName: l,
|
|
@@ -1229,7 +1235,7 @@ var zn = (e, n) => {
|
|
|
1229
1235
|
} }),
|
|
1230
1236
|
success: !1
|
|
1231
1237
|
};
|
|
1232
|
-
},
|
|
1238
|
+
}, er = (e, t) => {
|
|
1233
1239
|
if (!e || typeof e.data != "object" || e.data === null || !("dataItem" in e.data)) return;
|
|
1234
1240
|
let n = e.data.dataItem;
|
|
1235
1241
|
if (!(typeof n != "object" || !n || !("internalKey" in n) || typeof n.internalKey != "string" || !("uniqueSignature" in n) || typeof n.uniqueSignature != "string")) return {
|
|
@@ -1237,14 +1243,14 @@ var zn = (e, n) => {
|
|
|
1237
1243
|
dataItemUniqueSignature: n.uniqueSignature,
|
|
1238
1244
|
kind: t
|
|
1239
1245
|
};
|
|
1240
|
-
},
|
|
1241
|
-
let o = `${n}:${t.ref}`, s = await
|
|
1246
|
+
}, tr = async (e, t, n, r, i, a) => {
|
|
1247
|
+
let o = `${n}:${t.ref}`, s = await Me(e.vSpec, e.availableFields, [{
|
|
1242
1248
|
id: o,
|
|
1243
1249
|
name: r,
|
|
1244
1250
|
payload: i
|
|
1245
|
-
}], e.input.variables ?? [], [], e.input.theme), c =
|
|
1251
|
+
}], e.input.variables ?? [], [], e.input.theme), c = $n(s.results), l = er(s.results[o], n);
|
|
1246
1252
|
return c || !l ? {
|
|
1247
|
-
issue:
|
|
1253
|
+
issue: J("operation_failed", a, c?.result.error ?? `${n} operation did not return the created data-item identity.`),
|
|
1248
1254
|
success: !1
|
|
1249
1255
|
} : {
|
|
1250
1256
|
state: {
|
|
@@ -1257,7 +1263,7 @@ var zn = (e, n) => {
|
|
|
1257
1263
|
},
|
|
1258
1264
|
success: !0
|
|
1259
1265
|
};
|
|
1260
|
-
},
|
|
1266
|
+
}, nr = (e, t, n, r) => {
|
|
1261
1267
|
let i = [
|
|
1262
1268
|
"formatType",
|
|
1263
1269
|
"formatString",
|
|
@@ -1272,20 +1278,20 @@ var zn = (e, n) => {
|
|
|
1272
1278
|
return i !== void 0 && s ? [Bn(s, o, t.ref, t.path ?? [...r, a], e, i)] : [];
|
|
1273
1279
|
});
|
|
1274
1280
|
}), r);
|
|
1275
|
-
},
|
|
1281
|
+
}, rr = (e, t, n, r) => $(e, t.flatMap((t, i) => t.temporalGrouping ? [Gn(n, e.resolvedRefs[t.ref], t.ref, t.path ?? [...r, i], t.temporalGrouping)] : []), r), ir = (e, t, n, r) => $(e, t.flatMap((t) => t.showNullValues === void 0 ? [] : [{
|
|
1276
1282
|
name: n,
|
|
1277
1283
|
payload: {
|
|
1278
|
-
...
|
|
1284
|
+
...Y(e.resolvedRefs[t.ref]),
|
|
1279
1285
|
changes: { showNullValues: t.showNullValues }
|
|
1280
1286
|
}
|
|
1281
|
-
}]), r),
|
|
1287
|
+
}]), r), ar = (e, t) => t ? $(e, [{
|
|
1282
1288
|
id: "filterGroup",
|
|
1283
1289
|
name: "setStaticFilterGroup",
|
|
1284
1290
|
payload: X(t)
|
|
1285
1291
|
}], ["filterGroup"]) : Promise.resolve({
|
|
1286
1292
|
state: e,
|
|
1287
1293
|
success: !0
|
|
1288
|
-
}),
|
|
1294
|
+
}), or = (e, t, n, r) => {
|
|
1289
1295
|
if (!t?.length) return Promise.resolve({
|
|
1290
1296
|
state: e,
|
|
1291
1297
|
success: !0
|
|
@@ -1300,7 +1306,7 @@ var zn = (e, n) => {
|
|
|
1300
1306
|
}))].map((e, t) => {
|
|
1301
1307
|
let n = `${e.dataItemInternalKey}:${e.dataItemUniqueSignature}`, r = o.get(n), s = i.find((e) => `${e.dataItem.internalKey}:${e.dataItem.uniqueSignature}` === n);
|
|
1302
1308
|
return {
|
|
1303
|
-
...
|
|
1309
|
+
...Y(e),
|
|
1304
1310
|
newIndex: t,
|
|
1305
1311
|
sortDirection: (r ? a.get(r)?.direction : void 0) ?? s?.sortDirection ?? "asc"
|
|
1306
1312
|
};
|
|
@@ -1308,24 +1314,24 @@ var zn = (e, n) => {
|
|
|
1308
1314
|
}, ...t.map((t) => ({
|
|
1309
1315
|
name: r,
|
|
1310
1316
|
payload: {
|
|
1311
|
-
...
|
|
1317
|
+
...Y(e.resolvedRefs[t.by]),
|
|
1312
1318
|
enabled: t.enabled ?? !0
|
|
1313
1319
|
}
|
|
1314
1320
|
}))], ["sorting"]);
|
|
1315
|
-
},
|
|
1321
|
+
}, sr = (e, t) => {
|
|
1316
1322
|
let n = [];
|
|
1317
1323
|
return t?.overwrites && n.push({
|
|
1318
|
-
name:
|
|
1324
|
+
name: Ae.SET_COLORING_OVERWRITES,
|
|
1319
1325
|
payload: { overwrites: t.overwrites.map(({ dimension: t, ...n }) => t === void 0 ? n : {
|
|
1320
1326
|
...n,
|
|
1321
|
-
dimension:
|
|
1327
|
+
dimension: Y(e.resolvedRefs[t])
|
|
1322
1328
|
}) }
|
|
1323
1329
|
}), t?.rules && n.push({
|
|
1324
|
-
name:
|
|
1330
|
+
name: Ae.SET_COLORING_RULES,
|
|
1325
1331
|
payload: { rules: t.rules.map(({ measure: t, ...n }) => ({
|
|
1326
1332
|
...n,
|
|
1327
|
-
measure:
|
|
1333
|
+
measure: Y(e.resolvedRefs[t])
|
|
1328
1334
|
})) }
|
|
1329
1335
|
}), $(e, n, Z);
|
|
1330
1336
|
};
|
|
1331
|
-
export { St as $,
|
|
1337
|
+
export { St as $, Pn as A, on as B, Hn as C, An as D, jn as E, an as F, Nt as G, Zt as H, $t as I, vt as J, _t as K, en as L, bn as M, H as N, W as O, hn as P, Tt as Q, tn as R, Jn as S, Rn as T, Xt as U, rn as V, Lt as W, xt as X, Ct as Y, bt as Z, Zn as _, nr as a, At as at, X as b, Qn as c, Pe as ct, J as d, Ot as et, zn as f, Yn as g, $ as h, ar as i, kt as it, Nn as j, Mn as k, Bn as l, Gn as m, sr as n, Et as nt, or as o, mt as ot, Vn as p, wt as q, ir as r, Dt as rt, rr as s, T as st, tr as t, yt as tt, Wn as u, Un as v, G as w, qn as x, Y as y, nn as z };
|