@astrato-io/visualizations 0.6.4 → 0.6.5
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 +0 -0
- package/THIRD_PARTY_NOTICES.md +94 -4
- package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
- package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
- package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
- package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
- package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
- package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
- package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
- package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
- package/chunks/filter.compiler-DBsyRBJt.js +70 -0
- package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
- package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
- package/chunks/handlers-VTBfIZYZ.js +13072 -0
- package/chunks/isEqual-BDxAhUo8.js +7514 -0
- package/chunks/line.compiler-CzdM5Ld0.js +198 -0
- package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
- package/chunks/number.compiler-G-R7y16P.js +53 -0
- package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
- package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
- package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
- package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
- package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
- package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
- package/chunks/standalone-0ashe9w1.js +411 -0
- package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
- package/chunks/standalone-BK0VYU-l.js +463 -0
- package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
- package/chunks/standalone-BZV5vOwA.js +6 -0
- package/chunks/standalone-BhDrWj4p.js +1980 -0
- package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
- package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
- package/chunks/standalone-BwtM31-f.js +2 -0
- package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
- package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
- package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
- package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
- package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
- package/chunks/standalone-DCtRoTWg.js +675 -0
- package/chunks/standalone-DUDFTBqL.js +833 -0
- package/chunks/standalone-DhZkX9Td.js +2 -0
- package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
- package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
- package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
- package/chunks/standalone-_DeX21JJ.js +383 -0
- package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
- package/chunks/standalone-tDNy-SFH.js +281 -0
- package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
- package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
- package/chunks/table.compiler-tb914oj3.js +222 -0
- package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
- package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
- package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
- package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
- package/definitions.js +3 -3
- package/docs/operations/astrato-app-filter-bar.md +17 -17
- package/docs/operations/bar.md +989 -1071
- package/docs/operations/combo.md +717 -738
- package/docs/operations/date-picker.md +25 -25
- package/docs/operations/distribution-gauge.md +471 -607
- package/docs/operations/dot.md +787 -879
- package/docs/operations/filter.md +139 -163
- package/docs/operations/gauge.md +491 -627
- package/docs/operations/heatMap.md +834 -916
- package/docs/operations/histogram.md +166 -180
- package/docs/operations/iframe.md +5 -5
- package/docs/operations/image.md +16 -16
- package/docs/operations/index.md +12 -12
- package/docs/operations/line.md +811 -888
- package/docs/operations/number.md +470 -536
- package/docs/operations/pie.md +825 -958
- package/docs/operations/radar.md +599 -679
- package/docs/operations/sankey.md +462 -584
- package/docs/operations/scatter.md +823 -929
- package/docs/operations/shape.md +34 -34
- package/docs/operations/simpleTextObject.md +18 -25
- package/docs/operations/slider.md +33 -43
- package/docs/operations/table.md +1160 -1150
- package/docs/operations/tree.md +354 -361
- package/docs/operations/treemap.md +545 -637
- package/docs/operations/waterfall.md +369 -379
- package/docs/operations/word-cloud.md +512 -583
- package/getters.js +3 -3
- package/index.js +51 -51
- package/metadata.js +3 -3
- package/operations.js +7 -7
- package/package.json +80 -86
- package/src/definitions/index.d.ts +2 -2
- package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
- package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
- package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
- package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
- package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
- package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
- package/src/definitions/model/definitions/index.d.ts +23 -0
- package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
- package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
- package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
- package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
- package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
- package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
- package/src/definitions/model/definitions/types/index.d.ts +3 -0
- package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
- package/chunks/Radio-Ciu-F4CU.js +0 -957
- package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
- package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
- package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
- package/chunks/bar.compiler-oqaPzIut.js +0 -370
- package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
- package/chunks/event-bus-KiSiCJrC.js +0 -2683
- package/chunks/filter.compiler-CuLtc_02.js +0 -60
- package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
- package/chunks/interfaces-VUY4_yVO.js +0 -8742
- package/chunks/line-settings-DfYTUyPz.js +0 -4
- package/chunks/line.compiler-BpA_6Tc7.js +0 -188
- package/chunks/number.compiler-DbkWcG4S.js +0 -44
- package/chunks/pie-uv42Eqal.js +0 -10
- package/chunks/src-Dun_jXtz.js +0 -10295
- package/chunks/standalone-87YV_m9n.js +0 -687
- package/chunks/standalone-BLVAWLNJ.js +0 -385
- package/chunks/standalone-BPomtAVs.js +0 -2
- package/chunks/standalone-BXyBcUOQ.js +0 -2
- package/chunks/standalone-BllF4rDp.js +0 -383
- package/chunks/standalone-BqWyrnZI.js +0 -281
- package/chunks/standalone-DQxxNwF8.js +0 -675
- package/chunks/standalone-DS9T0FZ-.js +0 -830
- package/chunks/standalone-DzixzZAL.js +0 -411
- package/chunks/standalone-QJ1kKMnO.js +0 -6
- package/chunks/table.compiler-BrXkm4Fz.js +0 -213
- package/chunks/toInteger-DVZr-D1j.js +0 -11
- package/chunks/treemap-x_zmJoG7.js +0 -23
- package/chunks/types-dVVCsDWD.js +0 -4
- package/chunks/view-CLqWMV7Z.js +0 -156
- package/src/definitions/shared/index.d.ts +0 -5
- package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
- package/src/definitions/shared/lib/registry/index.d.ts +0 -3
- package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
- package/src/definitions/shared/lib/types/index.d.ts +0 -3
- package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
- /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
- /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { T as he, d as ge, t as v, y } from "./src-C0LgoUWY.js";
|
|
1
|
+
import { Mo as e, No as t, Wc as n, a as r, bs as i, ms as a, ps as o, rs as s, us as c, xs as l } from "./isEqual-BDxAhUo8.js";
|
|
2
|
+
import { Df as u, Gp as ee, Jd as d, Kd as f, Pm as te, Qd as ne, Sm as re, Tm as ie, Ud as p, Vm as ae, Yd as oe, Zd as se, ep as ce, fp as le, jm as m, mp as ue, np as de, op as fe, pf as h, pm as pe, pp as me, rm as he, sm as ge, tp as _e, um as ve, zf as g } from "./handlers-VTBfIZYZ.js";
|
|
3
|
+
import { T as _, d as ye, t as v, y } from "./operations-CTNUX6Sy.js";
|
|
5
4
|
import { z as b } from "zod";
|
|
6
|
-
var x =
|
|
5
|
+
var x = n(), be = b.object({
|
|
6
|
+
orientation: b.enum(["horizontal", "vertical"]).optional(),
|
|
7
|
+
selectionMode: b.enum([
|
|
8
|
+
"inherit",
|
|
9
|
+
"auto",
|
|
10
|
+
"manual"
|
|
11
|
+
]).optional(),
|
|
12
|
+
enableAddingNewFilters: b.boolean().optional(),
|
|
13
|
+
enableAssociativeFilter: b.boolean().optional(),
|
|
14
|
+
showClearAll: b.boolean().optional(),
|
|
15
|
+
showChartBreakdown: b.boolean().optional(),
|
|
16
|
+
selectableFieldKeys: b.array(b.string()).optional()
|
|
17
|
+
}).strict(), xe = b.object({
|
|
18
|
+
settings: be.optional(),
|
|
19
|
+
type: b.literal("astrato-app-filter-bar"),
|
|
20
|
+
version: b.literal(1)
|
|
21
|
+
}).strict(), S = (e) => e, C = b.string().trim().min(1).max(100), w = b.string().min(1).refine((e) => e.trim().length > 0, "Field key cannot be blank."), Se = S(ie.shape.dataType), Ce = S(re.shape.formatType), we = b.object({
|
|
7
22
|
distinct: b.boolean().optional(),
|
|
8
23
|
name: b.string().trim().min(1),
|
|
9
24
|
resultType: b.string().optional()
|
|
10
|
-
}).strict(),
|
|
11
|
-
aggregations: b.array(
|
|
12
|
-
dataType:
|
|
25
|
+
}).strict(), Te = b.object({
|
|
26
|
+
aggregations: b.array(we).default([]),
|
|
27
|
+
dataType: Se,
|
|
13
28
|
fieldKey: w,
|
|
14
29
|
isManualData: b.boolean().optional(),
|
|
15
30
|
kind: b.literal("field").default("field"),
|
|
16
31
|
name: b.string().min(1),
|
|
17
|
-
schema: b.string().min(1),
|
|
18
32
|
view: b.string().min(1)
|
|
19
33
|
}).strict(), T = b.object({
|
|
20
34
|
description: b.string().optional(),
|
|
@@ -22,188 +36,188 @@ var x = r(), S = (e) => e, C = b.string().trim().min(1).max(100), w = b.string()
|
|
|
22
36
|
key: w,
|
|
23
37
|
name: b.string().min(1),
|
|
24
38
|
views: b.array(b.string()).optional()
|
|
25
|
-
}).passthrough(),
|
|
39
|
+
}).passthrough(), Ee = T.extend({
|
|
26
40
|
dimension: b.record(b.string(), b.unknown()),
|
|
27
41
|
type: b.literal("dimension")
|
|
28
|
-
}),
|
|
42
|
+
}), De = T.extend({
|
|
29
43
|
measure: b.object({ aggregation: b.string().min(1) }).passthrough(),
|
|
30
44
|
type: b.literal("measure")
|
|
31
|
-
}),
|
|
45
|
+
}), Oe = T.extend({
|
|
32
46
|
calculation: b.record(b.string(), b.unknown()),
|
|
33
47
|
type: b.literal("calculation")
|
|
34
|
-
}),
|
|
48
|
+
}), ke = b.object({
|
|
35
49
|
fieldKey: w,
|
|
36
|
-
item:
|
|
50
|
+
item: Ee,
|
|
37
51
|
kind: b.literal("dimension"),
|
|
38
52
|
name: b.string().min(1)
|
|
39
|
-
}).strict(),
|
|
53
|
+
}).strict(), Ae = b.object({
|
|
40
54
|
fieldKey: w,
|
|
41
|
-
item:
|
|
55
|
+
item: De,
|
|
42
56
|
kind: b.literal("measure"),
|
|
43
57
|
name: b.string().min(1)
|
|
44
|
-
}).strict(),
|
|
58
|
+
}).strict(), je = b.object({
|
|
45
59
|
fieldKey: w,
|
|
46
|
-
item:
|
|
60
|
+
item: Oe,
|
|
47
61
|
kind: b.literal("calculation"),
|
|
48
62
|
name: b.string().min(1)
|
|
49
63
|
}).strict(), E = b.union([
|
|
50
|
-
be,
|
|
51
|
-
we,
|
|
52
64
|
Te,
|
|
53
|
-
|
|
65
|
+
ke,
|
|
66
|
+
Ae,
|
|
67
|
+
je
|
|
54
68
|
]).superRefine((e, t) => {
|
|
55
69
|
e.kind !== "field" && e.item.key !== e.fieldKey && t.addIssue({
|
|
56
70
|
code: "custom",
|
|
57
71
|
message: "Semantic item key must match fieldKey.",
|
|
58
72
|
path: ["item", "key"]
|
|
59
73
|
});
|
|
60
|
-
}),
|
|
74
|
+
}), Me = b.object({
|
|
61
75
|
currency: b.string().min(1).optional(),
|
|
62
76
|
currencyIsPrefix: b.boolean().optional(),
|
|
63
77
|
formatString: b.string().optional(),
|
|
64
|
-
formatType:
|
|
65
|
-
negativeType: S(
|
|
66
|
-
}).strict(),
|
|
78
|
+
formatType: Ce.optional(),
|
|
79
|
+
negativeType: S(re.shape.negativeType.unwrap()).optional()
|
|
80
|
+
}).strict(), Ne = b.discriminatedUnion("mode", [b.object({
|
|
67
81
|
dateLevel: S(b.enum(x.DateLevel)).describe("Year-aware bucket, such as month over time."),
|
|
68
82
|
mode: b.literal("level")
|
|
69
83
|
}).strict(), b.object({
|
|
70
84
|
datePart: S(b.enum(x.DatePart)).describe("Date part, such as month of year."),
|
|
71
85
|
mode: b.literal("part")
|
|
72
|
-
}).strict()]),
|
|
86
|
+
}).strict()]), D = b.object({
|
|
73
87
|
fieldKey: w,
|
|
74
|
-
format:
|
|
88
|
+
format: Me.pick({
|
|
75
89
|
formatString: !0,
|
|
76
90
|
formatType: !0
|
|
77
91
|
}).optional(),
|
|
78
92
|
ref: C,
|
|
79
93
|
showNullValues: b.boolean().optional(),
|
|
80
|
-
temporalGrouping:
|
|
81
|
-
}).strict(),
|
|
82
|
-
placements: b.array(S(b.enum(
|
|
94
|
+
temporalGrouping: Ne.describe("Groups a date dimension. Applied before format; format must then suit the grouping.").optional()
|
|
95
|
+
}).strict(), Pe = b.object({
|
|
96
|
+
placements: b.array(S(b.enum(te))).min(1).optional(),
|
|
83
97
|
visible: b.boolean()
|
|
84
|
-
}).strict(),
|
|
98
|
+
}).strict(), O = b.object({
|
|
85
99
|
aggregation: b.string().trim().min(1).describe("Required for a raw field measure; omit for a predefined measure or calculation.").optional(),
|
|
86
|
-
dataLabels:
|
|
100
|
+
dataLabels: Pe.optional(),
|
|
87
101
|
fieldKey: w,
|
|
88
|
-
format:
|
|
102
|
+
format: Me.optional(),
|
|
89
103
|
ref: C
|
|
90
|
-
}).strict(),
|
|
104
|
+
}).strict(), Fe = b.object({
|
|
91
105
|
fieldKey: w,
|
|
92
|
-
operator: S(b.enum(
|
|
106
|
+
operator: S(b.enum(fe)),
|
|
93
107
|
value: b.string()
|
|
94
|
-
}).strict(),
|
|
108
|
+
}).strict(), Ie = b.object({
|
|
95
109
|
fieldKey: w,
|
|
96
|
-
operator: S(b.enum(
|
|
110
|
+
operator: S(b.enum(de)),
|
|
97
111
|
valueFrom: b.string(),
|
|
98
112
|
valueTo: b.string()
|
|
99
|
-
}).strict(),
|
|
113
|
+
}).strict(), Le = b.object({
|
|
100
114
|
fieldKey: w,
|
|
101
|
-
operator: S(b.enum(
|
|
115
|
+
operator: S(b.enum(ce)),
|
|
102
116
|
values: b.array(b.string()).min(1)
|
|
103
|
-
}).strict(),
|
|
117
|
+
}).strict(), Re = b.object({
|
|
104
118
|
fieldKey: w,
|
|
105
|
-
operator: S(b.enum(
|
|
106
|
-
}).strict(),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
]),
|
|
112
|
-
filters: b.array(b.union([
|
|
119
|
+
operator: S(b.enum(_e))
|
|
120
|
+
}).strict(), ze = b.union([
|
|
121
|
+
Fe,
|
|
122
|
+
Ie,
|
|
123
|
+
Le,
|
|
124
|
+
Re
|
|
125
|
+
]), k = b.lazy(() => b.object({
|
|
126
|
+
filters: b.array(b.union([ze, k])),
|
|
113
127
|
operator: b.enum(["and", "or"])
|
|
114
|
-
}).strict()),
|
|
128
|
+
}).strict()), A = b.object({
|
|
115
129
|
by: C,
|
|
116
|
-
direction: S(
|
|
130
|
+
direction: S(he.shape.sortDirection),
|
|
117
131
|
enabled: b.boolean().optional()
|
|
118
|
-
}).strict(),
|
|
132
|
+
}).strict(), Be = b.object({
|
|
119
133
|
by: C,
|
|
120
134
|
count: b.number().int().positive(),
|
|
121
|
-
direction: S(
|
|
135
|
+
direction: S(he.shape.sortDirection),
|
|
122
136
|
showOthers: b.boolean().optional()
|
|
123
|
-
}).strict(),
|
|
137
|
+
}).strict(), Ve = b.object({
|
|
124
138
|
queryLimit: b.number().int().positive().optional(),
|
|
125
|
-
topN:
|
|
126
|
-
}).strict(),
|
|
127
|
-
position: S(
|
|
139
|
+
topN: Be.optional()
|
|
140
|
+
}).strict(), j = b.object({
|
|
141
|
+
position: S(pe.shape.position).optional(),
|
|
128
142
|
title: b.string().optional(),
|
|
129
143
|
visible: b.boolean().optional()
|
|
130
|
-
}).strict(),
|
|
144
|
+
}).strict(), M = b.object({
|
|
131
145
|
labelsVisible: b.boolean().optional(),
|
|
132
146
|
lineVisible: b.boolean().optional(),
|
|
133
147
|
ticksVisible: b.boolean().optional(),
|
|
134
148
|
title: b.string().optional(),
|
|
135
149
|
titleVisible: b.boolean().optional()
|
|
136
|
-
}).strict(),
|
|
150
|
+
}).strict(), He = b.union([b.object({
|
|
137
151
|
max: b.number().optional(),
|
|
138
152
|
min: b.number().optional().describe("Must be less than max when both are set")
|
|
139
|
-
}).strict(), b.object({ startsAtZero: b.boolean() }).strict()]).describe("Fix min, max or both, or set startsAtZero on an axis fitted to the data"),
|
|
140
|
-
overwrites: b.array(e.requiresOverwriteDimension ?
|
|
141
|
-
...e.rules ? { rules:
|
|
142
|
-
}).strict(),
|
|
153
|
+
}).strict(), b.object({ startsAtZero: b.boolean() }).strict()]).describe("Fix min, max or both, or set startsAtZero on an axis fitted to the data"), Ue = b.array(ee).optional().describe("Shaded ranges drawn across the plot between two primary measure axis values"), We = le({}), Ge = le({ dimension: C.describe(`Alias of a dimension in data.dimensions. ${ue}`) }), Ke = me({ measure: C.describe("Alias of the measure in data.measures whose value is compared") }), qe = "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.", Je = b.array(Ke).min(1).describe("Colors bound to measure thresholds, eg. red when sales is below 100. The first matching rule wins."), N = (e) => b.object({
|
|
154
|
+
overwrites: b.array(e.requiresOverwriteDimension ? Ge : We).min(1).describe(qe).optional(),
|
|
155
|
+
...e.rules ? { rules: Je.optional() } : {}
|
|
156
|
+
}).strict(), Ye = {
|
|
143
157
|
inverted: b.boolean().optional().describe("Reverse the direction of the axis values, eg. to put rank 1 at the top"),
|
|
144
|
-
range:
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
...
|
|
148
|
-
...
|
|
149
|
-
...
|
|
158
|
+
range: He.optional()
|
|
159
|
+
}, Xe = { bands: Ue }, Ze = { scale: S(b.enum(ae)).optional() };
|
|
160
|
+
M.extend({
|
|
161
|
+
...Ye,
|
|
162
|
+
...Xe,
|
|
163
|
+
...Ze
|
|
150
164
|
}).strict();
|
|
151
|
-
var
|
|
152
|
-
let r = (t, r) =>
|
|
153
|
-
...n.includes(t) ?
|
|
154
|
-
...r ?
|
|
155
|
-
...e ?
|
|
165
|
+
var P = ({ logScale: e = !1, primaryMeasureBands: t = !1, rangedMeasureAxes: n = [] } = {}) => {
|
|
166
|
+
let r = (t, r) => M.extend({
|
|
167
|
+
...n.includes(t) ? Ye : {},
|
|
168
|
+
...r ? Xe : {},
|
|
169
|
+
...e ? Ze : {}
|
|
156
170
|
}).strict();
|
|
157
171
|
return b.object({
|
|
158
|
-
dimension:
|
|
172
|
+
dimension: M.optional(),
|
|
159
173
|
primaryMeasure: r("primaryMeasure", t).optional(),
|
|
160
174
|
secondaryMeasure: r("secondaryMeasure", !1).optional()
|
|
161
175
|
}).strict();
|
|
162
176
|
};
|
|
163
|
-
|
|
164
|
-
var
|
|
165
|
-
axes:
|
|
177
|
+
P();
|
|
178
|
+
var Qe = b.object({
|
|
179
|
+
axes: P({
|
|
166
180
|
logScale: !0,
|
|
167
181
|
primaryMeasureBands: !0,
|
|
168
182
|
rangedMeasureAxes: ["primaryMeasure", "secondaryMeasure"]
|
|
169
183
|
}).optional(),
|
|
170
|
-
legend:
|
|
184
|
+
legend: j.optional(),
|
|
171
185
|
orientation: S(b.enum(t)).optional()
|
|
172
|
-
}).strict(),
|
|
186
|
+
}).strict(), $e = O.extend({ axis: b.enum(["primary", "secondary"]).optional() }), et = b.object({
|
|
173
187
|
data: b.object({
|
|
174
|
-
dimensions: b.array(
|
|
175
|
-
measures: b.array(
|
|
188
|
+
dimensions: b.array(D).min(1),
|
|
189
|
+
measures: b.array($e).min(1)
|
|
176
190
|
}).strict(),
|
|
177
|
-
filterGroup:
|
|
178
|
-
limiting:
|
|
179
|
-
presentation:
|
|
180
|
-
sorting: b.array(
|
|
191
|
+
filterGroup: k.optional(),
|
|
192
|
+
limiting: Ve.optional(),
|
|
193
|
+
presentation: Qe.extend({ coloring: N({ rules: !0 }).optional() }).optional(),
|
|
194
|
+
sorting: b.array(A).optional(),
|
|
181
195
|
type: b.literal("bar"),
|
|
182
196
|
version: b.literal(1)
|
|
183
|
-
}).strict(),
|
|
197
|
+
}).strict(), tt = b.object({ visible: b.boolean() }).strict(), nt = (e, t) => b.array(e).min(t.min).max(t.max), F = (e, n) => {
|
|
184
198
|
let r = {};
|
|
185
199
|
if (n.dimensions.max > 0) {
|
|
186
|
-
let e =
|
|
200
|
+
let e = nt(D, n.dimensions);
|
|
187
201
|
r.dimensions = n.dimensions.min === 0 ? e.optional() : e;
|
|
188
202
|
}
|
|
189
203
|
if (n.measures.max > 0) {
|
|
190
|
-
let e = n.dataLabels ?
|
|
204
|
+
let e = n.dataLabels ? O.omit({ dataLabels: !0 }).extend({ dataLabels: tt.optional() }) : O.omit({ dataLabels: !0 }), t = n.comboSeriesTypes ? e.extend({ seriesType: b.enum([
|
|
191
205
|
"bar",
|
|
192
206
|
"line",
|
|
193
207
|
"point"
|
|
194
|
-
]).optional() }) : e, i =
|
|
208
|
+
]).optional() }) : e, i = nt(n.measureAxis ? t.extend({ axis: b.enum(["primary", "secondary"]).optional() }) : t, n.measures);
|
|
195
209
|
r.measures = n.measures.min === 0 ? i.optional() : i;
|
|
196
210
|
}
|
|
197
211
|
let i = {};
|
|
198
212
|
if (n.axes) {
|
|
199
|
-
let e =
|
|
213
|
+
let e = P({
|
|
200
214
|
logScale: n.measureAxisScale,
|
|
201
215
|
primaryMeasureBands: n.measureAxisBands,
|
|
202
216
|
rangedMeasureAxes: n.rangedMeasureAxes
|
|
203
217
|
});
|
|
204
|
-
i.axes = (n.secondaryDimensionAxis ? e.extend({ secondaryDimension:
|
|
218
|
+
i.axes = (n.secondaryDimensionAxis ? e.extend({ secondaryDimension: M.optional() }) : e).optional();
|
|
205
219
|
}
|
|
206
|
-
n.conditionalColoring && (i.coloring =
|
|
220
|
+
n.conditionalColoring && (i.coloring = N(n.conditionalColoring).optional()), n.dataLabels && (i.dataLabels = tt.optional()), n.gaugeDisplayMode && (i.displayMode = b.enum(["bar", "radial"]).optional()), n.legend && (i.legend = j.optional()), n.orientation && (i.orientation = S(b.enum(t)).optional()), n.treeLayout && (i.layout = b.object({
|
|
207
221
|
compact: b.boolean().optional(),
|
|
208
222
|
direction: b.enum([
|
|
209
223
|
"bottom",
|
|
@@ -216,11 +230,11 @@ var z = b.object({
|
|
|
216
230
|
}).strict().optional());
|
|
217
231
|
let a = {
|
|
218
232
|
data: b.object(r).strict(),
|
|
219
|
-
filterGroup:
|
|
233
|
+
filterGroup: k.optional(),
|
|
220
234
|
type: b.literal(e),
|
|
221
235
|
version: b.literal(1)
|
|
222
236
|
};
|
|
223
|
-
return n.queryLimit && (a.limiting = b.object({ queryLimit: b.number().int().positive().optional() }).strict().optional()), Object.keys(i).length > 0 && (a.presentation = b.object(i).strict().optional()), n.sorting && (a.sorting = b.array(
|
|
237
|
+
return n.queryLimit && (a.limiting = b.object({ queryLimit: b.number().int().positive().optional() }).strict().optional()), Object.keys(i).length > 0 && (a.presentation = b.object(i).strict().optional()), n.sorting && (a.sorting = b.array(A).optional()), b.object(a).strict().superRefine((t, r) => {
|
|
224
238
|
let i = t.data, a = n.validateCounts?.(i.dimensions?.length ?? 0, i.measures?.length ?? 0);
|
|
225
239
|
a && r.addIssue({
|
|
226
240
|
code: "custom",
|
|
@@ -234,7 +248,7 @@ var z = b.object({
|
|
|
234
248
|
path: ["presentation", "coloring"]
|
|
235
249
|
}), n.validateDefinition?.(t, r);
|
|
236
250
|
});
|
|
237
|
-
},
|
|
251
|
+
}, rt = F("combo", {
|
|
238
252
|
axes: !0,
|
|
239
253
|
comboSeriesTypes: !0,
|
|
240
254
|
dataLabels: !0,
|
|
@@ -284,7 +298,7 @@ var z = b.object({
|
|
|
284
298
|
});
|
|
285
299
|
});
|
|
286
300
|
}
|
|
287
|
-
}),
|
|
301
|
+
}), it = F("dot", {
|
|
288
302
|
conditionalColoring: { rules: !0 },
|
|
289
303
|
axes: !0,
|
|
290
304
|
dimensions: {
|
|
@@ -298,7 +312,7 @@ var z = b.object({
|
|
|
298
312
|
},
|
|
299
313
|
orientation: !0,
|
|
300
314
|
rangedMeasureAxes: ["primaryMeasure"]
|
|
301
|
-
}),
|
|
315
|
+
}), at = F("scatter", {
|
|
302
316
|
conditionalColoring: { rules: !0 },
|
|
303
317
|
axes: !0,
|
|
304
318
|
dimensions: {
|
|
@@ -313,7 +327,7 @@ var z = b.object({
|
|
|
313
327
|
queryLimit: !0,
|
|
314
328
|
rangedMeasureAxes: ["primaryMeasure", "secondaryMeasure"],
|
|
315
329
|
sorting: !0
|
|
316
|
-
}),
|
|
330
|
+
}), ot = F("histogram", {
|
|
317
331
|
axes: !0,
|
|
318
332
|
dimensions: {
|
|
319
333
|
min: 1,
|
|
@@ -327,7 +341,7 @@ var z = b.object({
|
|
|
327
341
|
},
|
|
328
342
|
orientation: !0,
|
|
329
343
|
rangedMeasureAxes: ["primaryMeasure"]
|
|
330
|
-
}),
|
|
344
|
+
}), st = F("heatMap", {
|
|
331
345
|
conditionalColoring: { rules: !0 },
|
|
332
346
|
axes: !0,
|
|
333
347
|
dimensions: {
|
|
@@ -342,7 +356,7 @@ var z = b.object({
|
|
|
342
356
|
queryLimit: !0,
|
|
343
357
|
secondaryDimensionAxis: !0,
|
|
344
358
|
sorting: !0
|
|
345
|
-
}),
|
|
359
|
+
}), ct = F("radar", {
|
|
346
360
|
conditionalColoring: {
|
|
347
361
|
minDimensions: 2,
|
|
348
362
|
rules: !1
|
|
@@ -360,7 +374,7 @@ var z = b.object({
|
|
|
360
374
|
if (e === 0 && t < 2) return "Radar charts without dimensions require at least two measures.";
|
|
361
375
|
if (e > 0 && t > 1) return "Radar charts with dimensions support exactly one measure.";
|
|
362
376
|
}
|
|
363
|
-
}),
|
|
377
|
+
}), lt = F("gauge", {
|
|
364
378
|
conditionalColoring: { rules: !0 },
|
|
365
379
|
dimensions: {
|
|
366
380
|
min: 0,
|
|
@@ -373,7 +387,7 @@ var z = b.object({
|
|
|
373
387
|
max: 20
|
|
374
388
|
},
|
|
375
389
|
validateCounts: (e, t) => e === 1 && t > 2 ? "Gauge charts with a dimension support at most two measures." : void 0
|
|
376
|
-
}),
|
|
390
|
+
}), ut = F("distribution-gauge", {
|
|
377
391
|
conditionalColoring: { rules: !0 },
|
|
378
392
|
dimensions: {
|
|
379
393
|
min: 0,
|
|
@@ -385,7 +399,7 @@ var z = b.object({
|
|
|
385
399
|
min: 1,
|
|
386
400
|
max: 20
|
|
387
401
|
}
|
|
388
|
-
}),
|
|
402
|
+
}), dt = F("pie", {
|
|
389
403
|
conditionalColoring: { rules: !0 },
|
|
390
404
|
dimensions: {
|
|
391
405
|
min: 1,
|
|
@@ -398,7 +412,7 @@ var z = b.object({
|
|
|
398
412
|
},
|
|
399
413
|
queryLimit: !0,
|
|
400
414
|
sorting: !0
|
|
401
|
-
}),
|
|
415
|
+
}), ft = F("tree", {
|
|
402
416
|
dimensions: {
|
|
403
417
|
min: 0,
|
|
404
418
|
max: 10
|
|
@@ -411,7 +425,7 @@ var z = b.object({
|
|
|
411
425
|
sorting: !0,
|
|
412
426
|
treeLayout: !0,
|
|
413
427
|
validateCounts: (e, t) => e + t === 0 ? "Tree charts require at least one dimension or measure." : e > 0 && t > 1 ? "Tree charts with dimensions support at most one measure." : void 0
|
|
414
|
-
}),
|
|
428
|
+
}), pt = F("treemap", {
|
|
415
429
|
conditionalColoring: { rules: !0 },
|
|
416
430
|
dimensions: {
|
|
417
431
|
min: 1,
|
|
@@ -422,7 +436,7 @@ var z = b.object({
|
|
|
422
436
|
min: 1,
|
|
423
437
|
max: 1
|
|
424
438
|
}
|
|
425
|
-
}),
|
|
439
|
+
}), mt = F("sankey", {
|
|
426
440
|
conditionalColoring: {
|
|
427
441
|
requiresOverwriteDimension: !0,
|
|
428
442
|
rules: !0
|
|
@@ -435,7 +449,7 @@ var z = b.object({
|
|
|
435
449
|
min: 1,
|
|
436
450
|
max: 1
|
|
437
451
|
}
|
|
438
|
-
}),
|
|
452
|
+
}), ht = F("waterfall", {
|
|
439
453
|
axes: !0,
|
|
440
454
|
dataLabels: !0,
|
|
441
455
|
dimensions: {
|
|
@@ -449,7 +463,7 @@ var z = b.object({
|
|
|
449
463
|
},
|
|
450
464
|
orientation: !0,
|
|
451
465
|
rangedMeasureAxes: ["primaryMeasure"]
|
|
452
|
-
}),
|
|
466
|
+
}), gt = F("word-cloud", {
|
|
453
467
|
conditionalColoring: { rules: !0 },
|
|
454
468
|
dimensions: {
|
|
455
469
|
min: 1,
|
|
@@ -459,55 +473,39 @@ var z = b.object({
|
|
|
459
473
|
min: 1,
|
|
460
474
|
max: 1
|
|
461
475
|
}
|
|
462
|
-
}),
|
|
463
|
-
mode:
|
|
476
|
+
}), _t = b.enum(["dropdown", "listbox"]), vt = b.object({
|
|
477
|
+
mode: _t.optional(),
|
|
464
478
|
quickSelect: b.boolean().optional(),
|
|
465
479
|
responsive: b.boolean().optional(),
|
|
466
480
|
searchable: b.boolean().optional(),
|
|
467
481
|
showProgressBar: b.boolean().optional()
|
|
468
|
-
}).strict(),
|
|
469
|
-
data: b.object({ field:
|
|
482
|
+
}).strict(), yt = b.object({
|
|
483
|
+
data: b.object({ field: D.omit({
|
|
470
484
|
format: !0,
|
|
471
485
|
showNullValues: !0,
|
|
472
486
|
temporalGrouping: !0
|
|
473
487
|
}) }).strict(),
|
|
474
|
-
presentation:
|
|
488
|
+
presentation: vt.optional(),
|
|
475
489
|
type: b.literal("filter"),
|
|
476
490
|
version: b.literal(1)
|
|
477
|
-
}).strict(),
|
|
478
|
-
orientation: b.enum(["horizontal", "vertical"]).optional(),
|
|
479
|
-
selectionMode: b.enum([
|
|
480
|
-
"inherit",
|
|
481
|
-
"auto",
|
|
482
|
-
"manual"
|
|
483
|
-
]).optional(),
|
|
484
|
-
enableAddingNewFilters: b.boolean().optional(),
|
|
485
|
-
enableAssociativeFilter: b.boolean().optional(),
|
|
486
|
-
showClearAll: b.boolean().optional(),
|
|
487
|
-
showChartBreakdown: b.boolean().optional(),
|
|
488
|
-
selectableFieldKeys: b.array(b.string()).optional()
|
|
489
|
-
}).strict(), lt = b.object({
|
|
490
|
-
settings: ct.optional(),
|
|
491
|
-
type: b.literal("astrato-app-filter-bar"),
|
|
492
|
-
version: b.literal(1)
|
|
493
|
-
}).strict(), ut = k.omit({ dataLabels: !0 }).extend({
|
|
491
|
+
}).strict(), bt = O.omit({ dataLabels: !0 }).extend({
|
|
494
492
|
axis: b.enum(["primary", "secondary"]).optional(),
|
|
495
|
-
dataPointShape: S(
|
|
496
|
-
}),
|
|
497
|
-
density:
|
|
493
|
+
dataPointShape: S(ve.shape.dataPointShape)
|
|
494
|
+
}), xt = b.object({
|
|
495
|
+
density: ge.optional(),
|
|
498
496
|
visible: b.boolean()
|
|
499
|
-
}).strict(),
|
|
500
|
-
coloring:
|
|
501
|
-
dataLabels:
|
|
502
|
-
}),
|
|
497
|
+
}).strict(), St = Qe.extend({
|
|
498
|
+
coloring: N({ rules: !1 }).optional(),
|
|
499
|
+
dataLabels: xt.optional()
|
|
500
|
+
}), Ct = b.object({
|
|
503
501
|
data: b.object({
|
|
504
|
-
dimensions: b.array(
|
|
505
|
-
measures: b.array(
|
|
502
|
+
dimensions: b.array(D).min(1),
|
|
503
|
+
measures: b.array(bt).min(1)
|
|
506
504
|
}).strict(),
|
|
507
|
-
filterGroup:
|
|
505
|
+
filterGroup: k.optional(),
|
|
508
506
|
limiting: b.object({ queryLimit: b.number().int().positive().optional() }).strict().optional(),
|
|
509
|
-
presentation:
|
|
510
|
-
sorting: b.array(
|
|
507
|
+
presentation: St.optional(),
|
|
508
|
+
sorting: b.array(A).optional(),
|
|
511
509
|
type: b.literal("line"),
|
|
512
510
|
version: b.literal(1)
|
|
513
511
|
}).strict().superRefine((e, t) => {
|
|
@@ -527,12 +525,12 @@ var z = b.object({
|
|
|
527
525
|
]
|
|
528
526
|
});
|
|
529
527
|
});
|
|
530
|
-
}),
|
|
531
|
-
data: b.object({ measure:
|
|
532
|
-
filterGroup:
|
|
528
|
+
}), wt = b.object({
|
|
529
|
+
data: b.object({ measure: O.omit({ dataLabels: !0 }) }).strict(),
|
|
530
|
+
filterGroup: k.optional(),
|
|
533
531
|
type: b.literal("number"),
|
|
534
532
|
version: b.literal(1)
|
|
535
|
-
}).strict(),
|
|
533
|
+
}).strict(), Tt = S(u.pick({
|
|
536
534
|
endDateLabel: !0,
|
|
537
535
|
pickerState: !0,
|
|
538
536
|
pickerType: !0,
|
|
@@ -541,32 +539,32 @@ var z = b.object({
|
|
|
541
539
|
startDateLabel: !0,
|
|
542
540
|
timePickerVisibility: !0,
|
|
543
541
|
weekStart: !0
|
|
544
|
-
}).partial()),
|
|
545
|
-
data: b.object({ field:
|
|
542
|
+
}).partial()), Et = b.object({
|
|
543
|
+
data: b.object({ field: D.omit({
|
|
546
544
|
format: !0,
|
|
547
545
|
showNullValues: !0,
|
|
548
546
|
temporalGrouping: !0
|
|
549
547
|
}) }).strict(),
|
|
550
|
-
settings:
|
|
548
|
+
settings: Tt.optional(),
|
|
551
549
|
type: b.literal("date-picker"),
|
|
552
550
|
version: b.literal(1)
|
|
553
|
-
}).strict(),
|
|
551
|
+
}).strict(), Dt = b.object({
|
|
554
552
|
settings: b.object({ url: b.string().url().nullable() }).strict(),
|
|
555
553
|
type: b.literal("iframe"),
|
|
556
554
|
version: b.literal(1)
|
|
557
|
-
}).strict(),
|
|
555
|
+
}).strict(), Ot = b.object({
|
|
558
556
|
settings: S(b.object({
|
|
559
|
-
blur:
|
|
560
|
-
fit:
|
|
561
|
-
opacity:
|
|
562
|
-
saturation:
|
|
563
|
-
shadow:
|
|
564
|
-
source:
|
|
557
|
+
blur: h.shape.blur.optional(),
|
|
558
|
+
fit: h.shape.image.unwrap().shape.imageFit.optional(),
|
|
559
|
+
opacity: h.shape.opacity.optional(),
|
|
560
|
+
saturation: h.shape.saturation.optional(),
|
|
561
|
+
shadow: h.shape.shadow.optional(),
|
|
562
|
+
source: ye.optional()
|
|
565
563
|
}).strict()),
|
|
566
564
|
type: b.literal("image"),
|
|
567
565
|
version: b.literal(1)
|
|
568
|
-
}).strict(),
|
|
569
|
-
settings: S(
|
|
566
|
+
}).strict(), kt = b.object({
|
|
567
|
+
settings: S(ne.pick({
|
|
570
568
|
backgroundColor: !0,
|
|
571
569
|
backgroundType: !0,
|
|
572
570
|
borderEnabled: !0,
|
|
@@ -583,38 +581,38 @@ var z = b.object({
|
|
|
583
581
|
}).partial().strict()),
|
|
584
582
|
type: b.literal("shape"),
|
|
585
583
|
version: b.literal(1)
|
|
586
|
-
}).strict(),
|
|
584
|
+
}).strict(), I = se.shape.simpleTextObjectSettings, At = b.object({
|
|
587
585
|
settings: S(b.object({
|
|
588
|
-
align:
|
|
586
|
+
align: I.shape.align.optional(),
|
|
589
587
|
content: b.string().optional(),
|
|
590
|
-
fontFamily:
|
|
591
|
-
fontSize:
|
|
592
|
-
position:
|
|
593
|
-
representation:
|
|
594
|
-
responsive:
|
|
595
|
-
textColor:
|
|
596
|
-
wordWrap:
|
|
588
|
+
fontFamily: I.shape.fontFamily.optional(),
|
|
589
|
+
fontSize: I.shape.fontSize.optional(),
|
|
590
|
+
position: I.shape.position.optional(),
|
|
591
|
+
representation: I.shape.representation.optional(),
|
|
592
|
+
responsive: I.shape.responsive.optional(),
|
|
593
|
+
textColor: I.shape.textColor.optional(),
|
|
594
|
+
wordWrap: I.shape.wordWrap.optional()
|
|
597
595
|
}).strict()),
|
|
598
596
|
type: b.literal("simpleTextObject"),
|
|
599
597
|
version: b.literal(1)
|
|
600
|
-
}).strict(),
|
|
598
|
+
}).strict(), jt = b.object({
|
|
601
599
|
settings: S(b.object({
|
|
602
|
-
customLabel:
|
|
603
|
-
hideLabel:
|
|
604
|
-
inputType:
|
|
605
|
-
placeholder:
|
|
606
|
-
responsive:
|
|
607
|
-
variableId:
|
|
600
|
+
customLabel: g.shape.commonSettings.shape.customLabel.optional(),
|
|
601
|
+
hideLabel: g.shape.commonSettings.shape.hideLabel.optional(),
|
|
602
|
+
inputType: g.shape.type.optional(),
|
|
603
|
+
placeholder: g.shape.commonSettings.shape.placeholder.optional(),
|
|
604
|
+
responsive: g.shape.commonSettings.shape.responsive.optional(),
|
|
605
|
+
variableId: g.shape.commonSettings.shape.variableId.optional()
|
|
608
606
|
}).strict()),
|
|
609
607
|
type: b.literal("atomic-input"),
|
|
610
608
|
version: b.literal(1)
|
|
611
|
-
}).strict(),
|
|
612
|
-
data: b.object({ field:
|
|
609
|
+
}).strict(), Mt = b.object({
|
|
610
|
+
data: b.object({ field: D.omit({
|
|
613
611
|
format: !0,
|
|
614
612
|
showNullValues: !0,
|
|
615
613
|
temporalGrouping: !0
|
|
616
614
|
}) }).strict(),
|
|
617
|
-
settings: S(
|
|
615
|
+
settings: S(oe.pick({
|
|
618
616
|
layout: !0,
|
|
619
617
|
quickSelect: !0,
|
|
620
618
|
range: !0,
|
|
@@ -622,38 +620,38 @@ var z = b.object({
|
|
|
622
620
|
}).partial()).optional(),
|
|
623
621
|
type: b.literal("slider"),
|
|
624
622
|
version: b.literal(1)
|
|
625
|
-
}).strict(),
|
|
626
|
-
columns: b.array(b.discriminatedUnion("role", [
|
|
623
|
+
}).strict(), Nt = D.extend({ role: b.literal("dimension") }), L = O.omit({ dataLabels: !0 }), Pt = L.extend({ role: b.literal("measure") }), Ft = b.object({
|
|
624
|
+
columns: b.array(b.discriminatedUnion("role", [Nt, Pt])).min(1),
|
|
627
625
|
structure: b.literal("normal").optional()
|
|
628
|
-
}).strict(),
|
|
629
|
-
dimensions: b.array(
|
|
630
|
-
measures: b.array(
|
|
626
|
+
}).strict(), It = b.object({
|
|
627
|
+
dimensions: b.array(D).min(1),
|
|
628
|
+
measures: b.array(L).min(1),
|
|
631
629
|
structure: b.literal("expandable")
|
|
632
|
-
}).strict(),
|
|
633
|
-
columnDimensions: b.array(
|
|
634
|
-
measures: b.array(
|
|
635
|
-
rowDimensions: b.array(
|
|
630
|
+
}).strict(), Lt = b.object({
|
|
631
|
+
columnDimensions: b.array(D).min(1),
|
|
632
|
+
measures: b.array(L).min(1),
|
|
633
|
+
rowDimensions: b.array(D).min(1),
|
|
636
634
|
structure: b.literal("pivot")
|
|
637
|
-
}).strict(),
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
]),
|
|
635
|
+
}).strict(), Rt = b.union([
|
|
636
|
+
Ft,
|
|
637
|
+
It,
|
|
638
|
+
Lt
|
|
639
|
+
]), zt = b.object({
|
|
642
640
|
applyTo: p.shape.applyTo,
|
|
643
641
|
enabled: p.shape.enabled,
|
|
644
642
|
showRecordsCount: p.shape.showRecordsCount,
|
|
645
643
|
style: b.object({
|
|
646
|
-
backgroundColor:
|
|
647
|
-
fontColor:
|
|
648
|
-
fontStyle:
|
|
649
|
-
position:
|
|
650
|
-
responsiveHeight:
|
|
644
|
+
backgroundColor: d.shape.backgroundColor.optional(),
|
|
645
|
+
fontColor: d.shape.fontColor.optional(),
|
|
646
|
+
fontStyle: f.optional(),
|
|
647
|
+
position: d.shape.position.optional(),
|
|
648
|
+
responsiveHeight: d.shape.responsive
|
|
651
649
|
}).strict().optional()
|
|
652
|
-
}).strict(),
|
|
650
|
+
}).strict(), Bt = b.object({
|
|
653
651
|
background: b.object({
|
|
654
|
-
color:
|
|
655
|
-
evenColor:
|
|
656
|
-
oddColor:
|
|
652
|
+
color: m.optional(),
|
|
653
|
+
evenColor: m.optional(),
|
|
654
|
+
oddColor: m.optional(),
|
|
657
655
|
type: b.enum([
|
|
658
656
|
"none",
|
|
659
657
|
"single",
|
|
@@ -661,10 +659,10 @@ var z = b.object({
|
|
|
661
659
|
])
|
|
662
660
|
}).strict().optional(),
|
|
663
661
|
body: b.object({
|
|
664
|
-
fontColor:
|
|
662
|
+
fontColor: m.optional(),
|
|
665
663
|
fontFamily: b.string().trim().min(1).optional(),
|
|
666
664
|
fontSize: b.number().positive().optional(),
|
|
667
|
-
fontStyle:
|
|
665
|
+
fontStyle: f.optional(),
|
|
668
666
|
horizontalAlign: b.enum([
|
|
669
667
|
"auto",
|
|
670
668
|
"center",
|
|
@@ -679,8 +677,8 @@ var z = b.object({
|
|
|
679
677
|
]).optional()
|
|
680
678
|
}).strict().optional(),
|
|
681
679
|
borders: b.object({
|
|
682
|
-
color:
|
|
683
|
-
dividerColor:
|
|
680
|
+
color: m.optional(),
|
|
681
|
+
dividerColor: m.optional(),
|
|
684
682
|
dividers: b.enum([
|
|
685
683
|
"all",
|
|
686
684
|
"auto",
|
|
@@ -698,43 +696,43 @@ var z = b.object({
|
|
|
698
696
|
strokeWidth: b.number().nonnegative().optional()
|
|
699
697
|
}).strict().optional(),
|
|
700
698
|
header: b.object({
|
|
701
|
-
backgroundColor:
|
|
702
|
-
borderColor:
|
|
703
|
-
fontColor:
|
|
699
|
+
backgroundColor: m.optional(),
|
|
700
|
+
borderColor: m.optional(),
|
|
701
|
+
fontColor: m.optional(),
|
|
704
702
|
fontFamily: b.string().trim().min(1).optional(),
|
|
705
703
|
fontSize: b.number().positive().optional(),
|
|
706
|
-
fontStyle:
|
|
704
|
+
fontStyle: f.optional(),
|
|
707
705
|
responsiveHeight: b.boolean().optional()
|
|
708
706
|
}).strict().optional(),
|
|
709
707
|
highlight: b.object({
|
|
710
|
-
backgroundColor:
|
|
708
|
+
backgroundColor: m.optional(),
|
|
711
709
|
mode: b.enum([
|
|
712
710
|
"column",
|
|
713
711
|
"none",
|
|
714
712
|
"row",
|
|
715
713
|
"row-and-column"
|
|
716
714
|
]),
|
|
717
|
-
textColor:
|
|
715
|
+
textColor: m.optional()
|
|
718
716
|
}).strict().optional(),
|
|
719
717
|
layout: b.object({
|
|
720
718
|
columnWidthBehavior: b.enum(["responsive", "static"]).optional(),
|
|
721
719
|
rowHeight: b.number().positive().optional()
|
|
722
720
|
}).strict().optional()
|
|
723
|
-
}).strict(),
|
|
724
|
-
data:
|
|
725
|
-
filterGroup:
|
|
721
|
+
}).strict(), Vt = b.object({
|
|
722
|
+
data: Rt,
|
|
723
|
+
filterGroup: k.optional(),
|
|
726
724
|
limiting: b.object({ queryLimit: b.number().int().positive().optional() }).strict().optional(),
|
|
727
|
-
presentation:
|
|
728
|
-
sorting: b.array(
|
|
729
|
-
totals:
|
|
725
|
+
presentation: Bt.optional(),
|
|
726
|
+
sorting: b.array(A).optional(),
|
|
727
|
+
totals: zt.optional(),
|
|
730
728
|
type: b.literal("table"),
|
|
731
729
|
version: b.literal(1)
|
|
732
|
-
}).strict(),
|
|
730
|
+
}).strict(), R = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ht = (e) => {
|
|
733
731
|
let t = e.fieldKey ?? e.key;
|
|
734
732
|
return typeof t == "string" ? t : void 0;
|
|
735
|
-
},
|
|
733
|
+
}, Ut = (e) => {
|
|
736
734
|
if (Array.isArray(e)) return e;
|
|
737
|
-
if (!
|
|
735
|
+
if (!R(e)) throw Error("Available field metadata must be an array or an object.");
|
|
738
736
|
return [
|
|
739
737
|
"fields",
|
|
740
738
|
"dimensions",
|
|
@@ -745,9 +743,9 @@ var z = b.object({
|
|
|
745
743
|
if (!Array.isArray(n)) throw Error(`Available field metadata "${t}" must be an array.`);
|
|
746
744
|
return n;
|
|
747
745
|
});
|
|
748
|
-
},
|
|
746
|
+
}, Wt = (e, t) => {
|
|
749
747
|
let n = e.type;
|
|
750
|
-
if (!(n === "dimension" &&
|
|
748
|
+
if (!(n === "dimension" && R(e.dimension) || n === "measure" && R(e.measure) || n === "calculation" && R(e.calculation))) return;
|
|
751
749
|
let r = E.safeParse({
|
|
752
750
|
fieldKey: e.key,
|
|
753
751
|
item: e,
|
|
@@ -756,42 +754,41 @@ var z = b.object({
|
|
|
756
754
|
});
|
|
757
755
|
if (!r.success) throw Error(`Invalid available semantic item at index ${t}: ${r.error.message}`);
|
|
758
756
|
return r.data;
|
|
759
|
-
},
|
|
760
|
-
if (!
|
|
757
|
+
}, Gt = (e, t) => {
|
|
758
|
+
if (!R(e)) throw Error(`Available field at index ${t} must be an object.`);
|
|
761
759
|
let n = E.safeParse(e);
|
|
762
760
|
if (n.success) return n.data;
|
|
763
|
-
let r =
|
|
761
|
+
let r = Wt(e, t);
|
|
764
762
|
if (r) return r;
|
|
765
763
|
let i = Array.isArray(e.aggregations) ? e.aggregations : Array.isArray(e.aggregators) ? e.aggregators : [], a = E.safeParse({
|
|
766
|
-
aggregations: i.map((e) =>
|
|
764
|
+
aggregations: i.map((e) => R(e) ? {
|
|
767
765
|
distinct: e.distinct,
|
|
768
766
|
name: e.name ?? e.funcName,
|
|
769
767
|
resultType: e.resultType
|
|
770
768
|
} : e),
|
|
771
769
|
dataType: e.dataType,
|
|
772
|
-
fieldKey:
|
|
770
|
+
fieldKey: Ht(e),
|
|
773
771
|
isManualData: e.isManualData,
|
|
774
772
|
kind: "field",
|
|
775
773
|
name: e.name,
|
|
776
|
-
schema: e.schema,
|
|
777
774
|
view: e.view
|
|
778
775
|
});
|
|
779
776
|
if (!a.success) throw Error(`Invalid available field at index ${t}: ${a.error.message}`);
|
|
780
777
|
return a.data;
|
|
781
|
-
},
|
|
782
|
-
let t =
|
|
778
|
+
}, Kt = (e) => {
|
|
779
|
+
let t = Ut(e).map(Gt), n = /* @__PURE__ */ new Map();
|
|
783
780
|
return t.forEach((e, t) => {
|
|
784
781
|
let r = n.get(e.fieldKey);
|
|
785
782
|
if (r !== void 0) throw Error(`Duplicate available field key "${e.fieldKey}" at indexes ${r} and ${t}.`);
|
|
786
783
|
n.set(e.fieldKey, t);
|
|
787
784
|
}), t;
|
|
788
|
-
},
|
|
785
|
+
}, qt = (e) => e.kind === "field" ? [...new Set(e.aggregations.flatMap((e) => [e.name, ...e.distinct ? [`${e.name}_DISTINCT`] : []]))] : [], Jt = (e, t) => e.kind === "field" || t === "dimension" && e.kind === "dimension" || t === "measure" && (e.kind === "measure" || e.kind === "calculation"), Yt = (e) => {
|
|
789
786
|
if (e.kind !== "dimension") return e.kind;
|
|
790
|
-
},
|
|
791
|
-
...
|
|
787
|
+
}, z = (e) => ({
|
|
788
|
+
...c(e.item),
|
|
792
789
|
id: e.item.id ?? e.fieldKey
|
|
793
|
-
}),
|
|
794
|
-
aggregators:
|
|
790
|
+
}), B = (e) => e.map((e) => e.kind === "dimension" ? a(z(e)) : e.kind === "measure" || e.kind === "calculation" ? o(z(e)) : {
|
|
791
|
+
aggregators: i(e.aggregations.map((e) => ({
|
|
795
792
|
distinct: e.distinct ?? !1,
|
|
796
793
|
name: e.name,
|
|
797
794
|
resultType: e.resultType
|
|
@@ -800,22 +797,70 @@ var z = b.object({
|
|
|
800
797
|
isManualData: e.isManualData,
|
|
801
798
|
key: e.fieldKey,
|
|
802
799
|
name: e.name,
|
|
803
|
-
schema: e.schema,
|
|
804
800
|
view: e.view,
|
|
805
801
|
views: [e.view]
|
|
806
|
-
}),
|
|
802
|
+
}), V = (e, t) => {
|
|
803
|
+
let n = Math.min(e.length, t.length), r = 0;
|
|
804
|
+
for (; r < n && e[r].toLocaleLowerCase() === t[r].toLocaleLowerCase();) r += 1;
|
|
805
|
+
return r;
|
|
806
|
+
}, Xt = (e, t) => [...t].sort((t, n) => V(e, n.fieldKey) - V(e, t.fieldKey) || t.fieldKey.localeCompare(n.fieldKey)).slice(0, 5).map((e) => e.fieldKey), Zt = [
|
|
807
|
+
x.FieldType.DATE,
|
|
808
|
+
x.FieldType.TIME,
|
|
809
|
+
x.FieldType.TIMESTAMP,
|
|
810
|
+
x.FieldType.TIMESTAMP_TZ
|
|
811
|
+
], H = (e, t, n, r) => ({
|
|
812
|
+
...r ? { allowedValues: r } : {},
|
|
813
|
+
code: e,
|
|
814
|
+
message: n,
|
|
815
|
+
path: t
|
|
816
|
+
}), U = (e) => qt(e).filter((e) => !!l(e)), Qt = (e, t) => {
|
|
817
|
+
let n = t.find((t) => t.fieldKey === e.fieldKey);
|
|
818
|
+
return n?.kind === "field" ? U(n).find((t) => t.toLocaleUpperCase() === e.aggregation?.toLocaleUpperCase()) : void 0;
|
|
819
|
+
}, $t = (e, t) => {
|
|
820
|
+
let n = t.find((t) => t.fieldKey === e.fieldKey);
|
|
821
|
+
return n?.kind === "measure" ? n.item.measure.aggregation : Qt(e, t);
|
|
822
|
+
}, en = (e, t, n = {}) => {
|
|
823
|
+
let r = t.find((t) => t.fieldKey === e.fieldKey), i = r ? Yt(r) : void 0, a = Qt(e, t);
|
|
824
|
+
return {
|
|
825
|
+
...n,
|
|
826
|
+
key: e.fieldKey,
|
|
827
|
+
...i ? { sourceKind: i } : {},
|
|
828
|
+
...a ? { aggregation: a } : {}
|
|
829
|
+
};
|
|
830
|
+
}, W = (e, t, n, r) => {
|
|
831
|
+
let i = t.find((t) => t.fieldKey === e.fieldKey);
|
|
832
|
+
if (!i) return [H("unknown_field_key", [...n, "fieldKey"], `Field key "${e.fieldKey}" is not available.`, Xt(e.fieldKey, t))];
|
|
833
|
+
if (!Jt(i, r)) return [H("invalid_field_role", [...n, "fieldKey"], `Available item "${e.fieldKey}" of kind "${i.kind}" cannot be used as a ${r}.`)];
|
|
834
|
+
if (r !== "measure") return e.temporalGrouping ? nn(e, t, n, Zt, "a temporally grouped dimension") : [];
|
|
835
|
+
if (i.kind !== "field") return e.aggregation === void 0 ? [] : [H("invalid_aggregation", [...n, "aggregation"], `Aggregation must be omitted for semantic ${i.kind} "${e.fieldKey}".`)];
|
|
836
|
+
let a = U(i);
|
|
837
|
+
return e.aggregation ? a.some((t) => t.toLocaleUpperCase() === e.aggregation?.toLocaleUpperCase()) ? [] : [H("invalid_aggregation", [...n, "aggregation"], `Aggregation "${e.aggregation}" is not available for field key "${e.fieldKey}".`, a)] : [H("invalid_aggregation", [...n, "aggregation"], `Aggregation is required for raw field "${e.fieldKey}" when it is used as a measure.`, a)];
|
|
838
|
+
}, tn = (e, t, n, r) => e.flatMap((e, i) => W(e, t, [...n, i], r)), nn = (e, t, n, r, i) => {
|
|
839
|
+
let a = t.find((t) => t.fieldKey === e.fieldKey);
|
|
840
|
+
return a?.kind !== "field" || r.includes(a.dataType) ? [] : [H("invalid_field_role", [...n, "fieldKey"], `Raw field "${e.fieldKey}" has data type "${a.dataType}" and cannot be used as ${i}.`, [...r])];
|
|
841
|
+
}, rn = (e, t, n = ["filterGroup"]) => e ? e.filters.flatMap((e, r) => {
|
|
842
|
+
let i = [
|
|
843
|
+
...n,
|
|
844
|
+
"filters",
|
|
845
|
+
r
|
|
846
|
+
];
|
|
847
|
+
return "filters" in e ? rn(e, t, i) : W({
|
|
848
|
+
fieldKey: e.fieldKey,
|
|
849
|
+
ref: `filter:${r}`
|
|
850
|
+
}, t, i, "dimension");
|
|
851
|
+
}) : [], 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) => {
|
|
807
852
|
if (typeof e == "number" && !Number.isFinite(e)) return String(e);
|
|
808
853
|
try {
|
|
809
854
|
return JSON.stringify(e) ?? String(e);
|
|
810
855
|
} catch {
|
|
811
856
|
return String(e);
|
|
812
857
|
}
|
|
813
|
-
},
|
|
858
|
+
}, an = (e, t) => t.reduce((e, t) => typeof e == "object" && e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0, e), on = (e) => {
|
|
814
859
|
if (e.code === "invalid_value") return e.values;
|
|
815
860
|
if (e.code !== "invalid_union" || e.errors.length === 0) return;
|
|
816
|
-
let t = e.errors.map((e) => e.length === 1 && e[0].path.length === 0 ?
|
|
861
|
+
let t = e.errors.map((e) => e.length === 1 && e[0].path.length === 0 ? on(e[0]) : void 0);
|
|
817
862
|
return t.every((e) => e !== void 0) ? [...new Set(t.flat())] : void 0;
|
|
818
|
-
},
|
|
863
|
+
}, sn = (e, t, n = []) => {
|
|
819
864
|
let r = (e, i) => {
|
|
820
865
|
let a = [...i, ...e.path.filter((e) => typeof e != "symbol")];
|
|
821
866
|
if (e.code === "unrecognized_keys") return e.keys.map((r) => {
|
|
@@ -827,17 +872,17 @@ var z = b.object({
|
|
|
827
872
|
return {
|
|
828
873
|
code: "invalid_structure",
|
|
829
874
|
path: i,
|
|
830
|
-
message: `${
|
|
875
|
+
message: `${G(i)}: Unrecognized key.`,
|
|
831
876
|
details: {
|
|
832
|
-
received:
|
|
877
|
+
received: an(t, [...a, r]),
|
|
833
878
|
zodCode: e.code
|
|
834
879
|
}
|
|
835
880
|
};
|
|
836
881
|
});
|
|
837
|
-
let o = [...n, ...a], s =
|
|
882
|
+
let o = [...n, ...a], s = an(t, a), c = on(e), l = {
|
|
838
883
|
received: s,
|
|
839
884
|
zodCode: e.code
|
|
840
|
-
}, u = c ? `Unsupported value ${
|
|
885
|
+
}, u = c ? `Unsupported value ${K(s)}. Allowed values: ${c.map(K).join(", ")}.` : `${e.message}. Received: ${K(s)}.`;
|
|
841
886
|
if (e.code === "invalid_union" && !c && e.errors.length > 0) {
|
|
842
887
|
let t = e.errors.filter((e) => !e.some((e) => e.code === "unrecognized_keys"));
|
|
843
888
|
if (t.length === 1) return t[0].flatMap((e) => r(e, a));
|
|
@@ -847,13 +892,15 @@ var z = b.object({
|
|
|
847
892
|
return [{
|
|
848
893
|
code: "invalid_structure",
|
|
849
894
|
path: o,
|
|
850
|
-
message: `${
|
|
895
|
+
message: `${G(o)}: ${u}`,
|
|
851
896
|
details: l,
|
|
852
897
|
...c ? { allowedValues: c } : {}
|
|
853
898
|
}];
|
|
854
899
|
};
|
|
855
900
|
return e.issues.flatMap((e) => r(e, []));
|
|
856
|
-
}
|
|
901
|
+
};
|
|
902
|
+
r();
|
|
903
|
+
var cn = (t, n) => {
|
|
857
904
|
let r = "legend" in t && !!t.legend, i = n.position !== void 0 || n.title !== void 0, a = [];
|
|
858
905
|
return n.visible !== void 0 && (n.visible || i || r) ? a.push({
|
|
859
906
|
name: "setLegendEnabled",
|
|
@@ -871,51 +918,15 @@ var z = b.object({
|
|
|
871
918
|
name: "setLegendTitle",
|
|
872
919
|
payload: n.title
|
|
873
920
|
}), a;
|
|
874
|
-
},
|
|
921
|
+
}, q = (e, t, n, r = {}) => ({
|
|
875
922
|
code: e,
|
|
876
923
|
message: n,
|
|
877
924
|
path: t,
|
|
878
925
|
...r
|
|
879
|
-
}),
|
|
880
|
-
let t = Object.entries(e).find(([, e]) => e.success === !1);
|
|
881
|
-
return t ? {
|
|
882
|
-
id: t[0],
|
|
883
|
-
result: t[1]
|
|
884
|
-
} : void 0;
|
|
885
|
-
}, Y = async (e, t, n) => {
|
|
886
|
-
let r = t.map((e, t) => ({
|
|
887
|
-
...e,
|
|
888
|
-
id: e.id ?? `definition:${t}`
|
|
889
|
-
})), i = await v(e.vSpec, e.availableFields, r.map(({ id: e, name: t, payload: n }) => ({
|
|
890
|
-
id: e,
|
|
891
|
-
name: t,
|
|
892
|
-
payload: n
|
|
893
|
-
})), e.input.variables ?? [], [], e.input.theme), a = Kt(i.results);
|
|
894
|
-
if (!a) return {
|
|
895
|
-
state: {
|
|
896
|
-
...e,
|
|
897
|
-
vSpec: i.vSpec
|
|
898
|
-
},
|
|
899
|
-
success: !0
|
|
900
|
-
};
|
|
901
|
-
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 ${q(s.received)} to ${s.kind} ${q(s.ref)}` : "Operation failed";
|
|
902
|
-
return {
|
|
903
|
-
issue: J("operation_failed", c, `${K(c)}: ${d} (operation "${l}"): ${u}`, { details: {
|
|
904
|
-
error: a.result.error,
|
|
905
|
-
operationId: a.id,
|
|
906
|
-
operationName: l,
|
|
907
|
-
...s ? {
|
|
908
|
-
received: s.received,
|
|
909
|
-
ref: s.ref,
|
|
910
|
-
role: s.kind
|
|
911
|
-
} : {}
|
|
912
|
-
} }),
|
|
913
|
-
success: !1
|
|
914
|
-
};
|
|
915
|
-
}, qt = (e, t, n, r, i, a) => ({
|
|
926
|
+
}), ln = (e, t, n, r, i, a) => ({
|
|
916
927
|
name: e,
|
|
917
928
|
payload: {
|
|
918
|
-
...
|
|
929
|
+
...J(t),
|
|
919
930
|
[i]: a
|
|
920
931
|
},
|
|
921
932
|
definitionContext: {
|
|
@@ -928,7 +939,7 @@ var z = b.object({
|
|
|
928
939
|
ref: n,
|
|
929
940
|
kind: t.kind
|
|
930
941
|
}
|
|
931
|
-
}),
|
|
942
|
+
}), un = (e, t, n, r, i, a, o) => ({
|
|
932
943
|
name: e,
|
|
933
944
|
payload: {
|
|
934
945
|
name: t,
|
|
@@ -944,75 +955,32 @@ var z = b.object({
|
|
|
944
955
|
ref: n,
|
|
945
956
|
kind: o
|
|
946
957
|
}
|
|
947
|
-
}),
|
|
948
|
-
if (!e || typeof e.data != "object" || e.data === null || !("dataItem" in e.data)) return;
|
|
949
|
-
let n = e.data.dataItem;
|
|
950
|
-
if (!(typeof n != "object" || !n || !("internalKey" in n) || typeof n.internalKey != "string" || !("uniqueSignature" in n) || typeof n.uniqueSignature != "string")) return {
|
|
951
|
-
dataItemInternalKey: n.internalKey,
|
|
952
|
-
dataItemUniqueSignature: n.uniqueSignature,
|
|
953
|
-
kind: t
|
|
954
|
-
};
|
|
955
|
-
}, X = (e) => ({
|
|
958
|
+
}), J = (e) => ({
|
|
956
959
|
dataItemInternalKey: e.dataItemInternalKey,
|
|
957
960
|
dataItemUniqueSignature: e.dataItemUniqueSignature
|
|
958
|
-
}),
|
|
961
|
+
}), dn = (e) => {
|
|
959
962
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
960
963
|
return e.forEach(({ items: e, path: r }) => {
|
|
961
964
|
e.forEach((e, i) => {
|
|
962
|
-
n.has(e.ref) && t.push(
|
|
965
|
+
n.has(e.ref) && t.push(q("duplicate_alias", [
|
|
963
966
|
...r,
|
|
964
967
|
i,
|
|
965
968
|
"ref"
|
|
966
969
|
], `Reference "${e.ref}" is duplicated.`)), n.add(e.ref);
|
|
967
970
|
});
|
|
968
971
|
}), t;
|
|
969
|
-
},
|
|
972
|
+
}, fn = (e, t) => {
|
|
970
973
|
let n = e, r = n.referencedData;
|
|
971
974
|
return t.every((e) => !Array.isArray(n[e]) || n[e].length === 0) && (typeof r != "object" || !r || Object.keys(r).length === 0);
|
|
972
|
-
},
|
|
973
|
-
availableFields:
|
|
975
|
+
}, pn = (e, t) => ({
|
|
976
|
+
availableFields: B(e.availableFields),
|
|
974
977
|
input: e,
|
|
975
978
|
resolvedRefs: {},
|
|
976
979
|
vSpec: t
|
|
977
|
-
}),
|
|
978
|
-
let o = `${n}:${t.ref}`, s = await v(e.vSpec, e.availableFields, [{
|
|
979
|
-
id: o,
|
|
980
|
-
name: r,
|
|
981
|
-
payload: i
|
|
982
|
-
}], e.input.variables ?? [], [], e.input.theme), c = Kt(s.results), l = Yt(s.results[o], n);
|
|
983
|
-
return c || !l ? {
|
|
984
|
-
issue: J("operation_failed", a, c?.result.error ?? `${n} operation did not return the created data-item identity.`),
|
|
985
|
-
success: !1
|
|
986
|
-
} : {
|
|
987
|
-
state: {
|
|
988
|
-
...e,
|
|
989
|
-
resolvedRefs: {
|
|
990
|
-
...e.resolvedRefs,
|
|
991
|
-
[t.ref]: l
|
|
992
|
-
},
|
|
993
|
-
vSpec: s.vSpec
|
|
994
|
-
},
|
|
995
|
-
success: !0
|
|
996
|
-
};
|
|
997
|
-
}, en = (e, t, n, r) => {
|
|
998
|
-
let i = [
|
|
999
|
-
"formatType",
|
|
1000
|
-
"formatString",
|
|
1001
|
-
"currency",
|
|
1002
|
-
"currencyIsPrefix",
|
|
1003
|
-
"negativeType"
|
|
1004
|
-
];
|
|
1005
|
-
return Y(e, t.flatMap((t, a) => {
|
|
1006
|
-
let o = e.resolvedRefs[t.ref];
|
|
1007
|
-
return i.flatMap((e) => {
|
|
1008
|
-
let i = t.format?.[e], s = n[e];
|
|
1009
|
-
return i !== void 0 && s ? [qt(s, o, t.ref, t.path ?? [...r, a], e, i)] : [];
|
|
1010
|
-
});
|
|
1011
|
-
}), r);
|
|
1012
|
-
}, tn = (e, t, n, r, i) => ({
|
|
980
|
+
}), mn = (e, t, n, r, i) => ({
|
|
1013
981
|
name: e,
|
|
1014
982
|
payload: {
|
|
1015
|
-
...
|
|
983
|
+
...J(t),
|
|
1016
984
|
...i
|
|
1017
985
|
},
|
|
1018
986
|
definitionContext: {
|
|
@@ -1021,105 +989,50 @@ var z = b.object({
|
|
|
1021
989
|
ref: n,
|
|
1022
990
|
kind: t.kind
|
|
1023
991
|
}
|
|
1024
|
-
}),
|
|
1025
|
-
name: n,
|
|
1026
|
-
payload: {
|
|
1027
|
-
...X(e.resolvedRefs[t.ref]),
|
|
1028
|
-
changes: { showNullValues: t.showNullValues }
|
|
1029
|
-
}
|
|
1030
|
-
}]), r), an = (e) => "value" in e ? { value: e.value } : "values" in e ? {
|
|
992
|
+
}), hn = (e) => "value" in e ? { value: e.value } : "values" in e ? {
|
|
1031
993
|
secondValue: e.values.join(","),
|
|
1032
994
|
value: ","
|
|
1033
995
|
} : "valueFrom" in e ? {
|
|
1034
996
|
valueFrom: e.valueFrom,
|
|
1035
997
|
valueTo: e.valueTo
|
|
1036
|
-
} : {},
|
|
1037
|
-
filters: e.filters.map((e) => "filters" in e ?
|
|
998
|
+
} : {}, Y = (e) => ({
|
|
999
|
+
filters: e.filters.map((e) => "filters" in e ? Y(e) : {
|
|
1038
1000
|
fieldKey: e.fieldKey,
|
|
1039
1001
|
operator: e.operator,
|
|
1040
|
-
values:
|
|
1002
|
+
values: hn(e)
|
|
1041
1003
|
}),
|
|
1042
1004
|
operator: e.operator
|
|
1043
|
-
}),
|
|
1044
|
-
id: "filterGroup",
|
|
1045
|
-
name: "setStaticFilterGroup",
|
|
1046
|
-
payload: Z(t)
|
|
1047
|
-
}], ["filterGroup"]) : Promise.resolve({
|
|
1048
|
-
state: e,
|
|
1049
|
-
success: !0
|
|
1050
|
-
}), sn = (e, t, n, r) => {
|
|
1051
|
-
if (!t?.length) return Promise.resolve({
|
|
1052
|
-
state: e,
|
|
1053
|
-
success: !0
|
|
1054
|
-
});
|
|
1055
|
-
let i = e.vSpec.querySettings?.sortingOrder ?? [], a = new Map(t.map((e) => [e.by, e])), o = new Map(Object.entries(e.resolvedRefs).map(([e, t]) => [`${t.dataItemInternalKey}:${t.dataItemUniqueSignature}`, e])), s = t.map((t) => e.resolvedRefs[t.by]), c = new Set(s.map((e) => `${e.dataItemInternalKey}:${e.dataItemUniqueSignature}`));
|
|
1056
|
-
return Y(e, [{
|
|
1057
|
-
name: n,
|
|
1058
|
-
payload: { changeRequests: [...s, ...i.filter((e) => !c.has(`${e.dataItem.internalKey}:${e.dataItem.uniqueSignature}`)).map((e) => ({
|
|
1059
|
-
dataItemInternalKey: e.dataItem.internalKey,
|
|
1060
|
-
dataItemUniqueSignature: e.dataItem.uniqueSignature,
|
|
1061
|
-
kind: "dimension"
|
|
1062
|
-
}))].map((e, t) => {
|
|
1063
|
-
let n = `${e.dataItemInternalKey}:${e.dataItemUniqueSignature}`, r = o.get(n), s = i.find((e) => `${e.dataItem.internalKey}:${e.dataItem.uniqueSignature}` === n);
|
|
1064
|
-
return {
|
|
1065
|
-
...X(e),
|
|
1066
|
-
newIndex: t,
|
|
1067
|
-
sortDirection: (r ? a.get(r)?.direction : void 0) ?? s?.sortDirection ?? "asc"
|
|
1068
|
-
};
|
|
1069
|
-
}) }
|
|
1070
|
-
}, ...t.map((t) => ({
|
|
1071
|
-
name: r,
|
|
1072
|
-
payload: {
|
|
1073
|
-
...X(e.resolvedRefs[t.by]),
|
|
1074
|
-
enabled: t.enabled ?? !0
|
|
1075
|
-
}
|
|
1076
|
-
}))], ["sorting"]);
|
|
1077
|
-
}, cn = (e, t) => (e ?? []).flatMap((e, n) => t.includes(e.by) ? [] : [J("unknown_alias", [
|
|
1005
|
+
}), gn = (e, t) => (e ?? []).flatMap((e, n) => t.includes(e.by) ? [] : [q("unknown_alias", [
|
|
1078
1006
|
"sorting",
|
|
1079
1007
|
n,
|
|
1080
1008
|
"by"
|
|
1081
|
-
], `Reference "${e.by}" does not exist.`, { allowedValues: t })]),
|
|
1082
|
-
...
|
|
1009
|
+
], `Reference "${e.by}" does not exist.`, { allowedValues: t })]), X = ["presentation", "coloring"], _n = (e, t, n) => [...(e?.overwrites ?? []).flatMap(({ dimension: e }, n) => e === void 0 || t.includes(e) ? [] : [q("unknown_alias", [
|
|
1010
|
+
...X,
|
|
1083
1011
|
"overwrites",
|
|
1084
1012
|
n,
|
|
1085
1013
|
"dimension"
|
|
1086
|
-
], `Dimension reference "${e}" does not exist.`, { allowedValues: t })]), ...(e?.rules ?? []).flatMap(({ measure: e }, t) => n.includes(e) ? [] : [
|
|
1087
|
-
...
|
|
1014
|
+
], `Dimension reference "${e}" does not exist.`, { allowedValues: t })]), ...(e?.rules ?? []).flatMap(({ measure: e }, t) => n.includes(e) ? [] : [q("unknown_alias", [
|
|
1015
|
+
...X,
|
|
1088
1016
|
"rules",
|
|
1089
1017
|
t,
|
|
1090
1018
|
"measure"
|
|
1091
|
-
], `Measure reference "${e}" does not exist.`, { allowedValues: n })])],
|
|
1092
|
-
let n = [];
|
|
1093
|
-
return t?.overwrites && n.push({
|
|
1094
|
-
name: he.SET_COLORING_OVERWRITES,
|
|
1095
|
-
payload: { overwrites: t.overwrites.map(({ dimension: t, ...n }) => t === void 0 ? n : {
|
|
1096
|
-
...n,
|
|
1097
|
-
dimension: X(e.resolvedRefs[t])
|
|
1098
|
-
}) }
|
|
1099
|
-
}), t?.rules && n.push({
|
|
1100
|
-
name: he.SET_COLORING_RULES,
|
|
1101
|
-
payload: { rules: t.rules.map(({ measure: t, ...n }) => ({
|
|
1102
|
-
...n,
|
|
1103
|
-
measure: X(e.resolvedRefs[t])
|
|
1104
|
-
})) }
|
|
1105
|
-
}), Y(e, n, Q);
|
|
1106
|
-
}, dn = (e, t) => {
|
|
1019
|
+
], `Measure reference "${e}" does not exist.`, { allowedValues: n })])], vn = (e, t) => {
|
|
1107
1020
|
let n = t.safeParse(e.vSpec);
|
|
1108
1021
|
return n.success ? {
|
|
1109
1022
|
resolvedRefs: e.resolvedRefs,
|
|
1110
1023
|
success: !0,
|
|
1111
1024
|
vSpec: n.data
|
|
1112
1025
|
} : {
|
|
1113
|
-
issues: [
|
|
1026
|
+
issues: [q("invalid_compiled_vspec", [], "Compiled vSpec failed final validation.", { details: { issues: n.error.issues } })],
|
|
1114
1027
|
success: !1
|
|
1115
1028
|
};
|
|
1116
|
-
},
|
|
1117
|
-
let { max: t, min: n } =
|
|
1118
|
-
return n !== void 0 && t !== void 0 ?
|
|
1119
|
-
},
|
|
1029
|
+
}, Z = (e) => "startsAtZero" in e ? {} : e, yn = (e) => {
|
|
1030
|
+
let { max: t, min: n } = Z(e);
|
|
1031
|
+
return n !== void 0 && t !== void 0 ? s.MinMax : n === void 0 ? t === void 0 ? s.Auto : s.Max : s.Min;
|
|
1032
|
+
}, bn = (e) => {
|
|
1120
1033
|
for (let [t, n] of Object.entries(e ?? {})) {
|
|
1121
|
-
let { max: e, min: r } = n?.range ?
|
|
1122
|
-
if (r !== void 0 && e !== void 0 && r >= e) return
|
|
1034
|
+
let { max: e, min: r } = n?.range ? Z(n.range) : {};
|
|
1035
|
+
if (r !== void 0 && e !== void 0 && r >= e) return q("invalid_structure", [
|
|
1123
1036
|
"presentation",
|
|
1124
1037
|
"axes",
|
|
1125
1038
|
t,
|
|
@@ -1127,7 +1040,7 @@ var z = b.object({
|
|
|
1127
1040
|
"min"
|
|
1128
1041
|
], `Axis range min (${r}) must be less than max (${e}).`);
|
|
1129
1042
|
}
|
|
1130
|
-
},
|
|
1043
|
+
}, xn = (e, t) => {
|
|
1131
1044
|
let n = [];
|
|
1132
1045
|
t.inverted !== void 0 && n.push({
|
|
1133
1046
|
name: y.SET_INVERT_AXIS,
|
|
@@ -1142,10 +1055,10 @@ var z = b.object({
|
|
|
1142
1055
|
name: y.SET_AXIS_RANGE_OPTION,
|
|
1143
1056
|
payload: {
|
|
1144
1057
|
axisName: e,
|
|
1145
|
-
axisRangeOption:
|
|
1058
|
+
axisRangeOption: yn(r)
|
|
1146
1059
|
}
|
|
1147
1060
|
});
|
|
1148
|
-
let { max: t, min: i } =
|
|
1061
|
+
let { max: t, min: i } = Z(r);
|
|
1149
1062
|
i !== void 0 && n.push({
|
|
1150
1063
|
name: y.SET_AXIS_RANGE_MIN,
|
|
1151
1064
|
payload: {
|
|
@@ -1167,5 +1080,139 @@ var z = b.object({
|
|
|
1167
1080
|
});
|
|
1168
1081
|
}
|
|
1169
1082
|
return n;
|
|
1083
|
+
}, Q = (e) => {
|
|
1084
|
+
let t = Object.entries(e).find(([, e]) => e.success === !1);
|
|
1085
|
+
return t ? {
|
|
1086
|
+
id: t[0],
|
|
1087
|
+
result: t[1]
|
|
1088
|
+
} : void 0;
|
|
1089
|
+
}, $ = async (e, t, n) => {
|
|
1090
|
+
let r = t.map((e, t) => ({
|
|
1091
|
+
...e,
|
|
1092
|
+
id: e.id ?? `definition:${t}`
|
|
1093
|
+
})), i = await v(e.vSpec, e.availableFields, r.map(({ id: e, name: t, payload: n }) => ({
|
|
1094
|
+
id: e,
|
|
1095
|
+
name: t,
|
|
1096
|
+
payload: n
|
|
1097
|
+
})), e.input.variables ?? [], [], e.input.theme), a = Q(i.results);
|
|
1098
|
+
if (!a) return {
|
|
1099
|
+
state: {
|
|
1100
|
+
...e,
|
|
1101
|
+
vSpec: i.vSpec
|
|
1102
|
+
},
|
|
1103
|
+
success: !0
|
|
1104
|
+
};
|
|
1105
|
+
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.", ee = s ? `Cannot apply ${K(s.received)} to ${s.kind} ${K(s.ref)}` : "Operation failed";
|
|
1106
|
+
return {
|
|
1107
|
+
issue: q("operation_failed", c, `${G(c)}: ${ee} (operation "${l}"): ${u}`, { details: {
|
|
1108
|
+
error: a.result.error,
|
|
1109
|
+
operationId: a.id,
|
|
1110
|
+
operationName: l,
|
|
1111
|
+
...s ? {
|
|
1112
|
+
received: s.received,
|
|
1113
|
+
ref: s.ref,
|
|
1114
|
+
role: s.kind
|
|
1115
|
+
} : {}
|
|
1116
|
+
} }),
|
|
1117
|
+
success: !1
|
|
1118
|
+
};
|
|
1119
|
+
}, Sn = (e, t) => {
|
|
1120
|
+
if (!e || typeof e.data != "object" || e.data === null || !("dataItem" in e.data)) return;
|
|
1121
|
+
let n = e.data.dataItem;
|
|
1122
|
+
if (!(typeof n != "object" || !n || !("internalKey" in n) || typeof n.internalKey != "string" || !("uniqueSignature" in n) || typeof n.uniqueSignature != "string")) return {
|
|
1123
|
+
dataItemInternalKey: n.internalKey,
|
|
1124
|
+
dataItemUniqueSignature: n.uniqueSignature,
|
|
1125
|
+
kind: t
|
|
1126
|
+
};
|
|
1127
|
+
}, Cn = async (e, t, n, r, i, a) => {
|
|
1128
|
+
let o = `${n}:${t.ref}`, s = await v(e.vSpec, e.availableFields, [{
|
|
1129
|
+
id: o,
|
|
1130
|
+
name: r,
|
|
1131
|
+
payload: i
|
|
1132
|
+
}], e.input.variables ?? [], [], e.input.theme), c = Q(s.results), l = Sn(s.results[o], n);
|
|
1133
|
+
return c || !l ? {
|
|
1134
|
+
issue: q("operation_failed", a, c?.result.error ?? `${n} operation did not return the created data-item identity.`),
|
|
1135
|
+
success: !1
|
|
1136
|
+
} : {
|
|
1137
|
+
state: {
|
|
1138
|
+
...e,
|
|
1139
|
+
resolvedRefs: {
|
|
1140
|
+
...e.resolvedRefs,
|
|
1141
|
+
[t.ref]: l
|
|
1142
|
+
},
|
|
1143
|
+
vSpec: s.vSpec
|
|
1144
|
+
},
|
|
1145
|
+
success: !0
|
|
1146
|
+
};
|
|
1147
|
+
}, wn = (e, t, n, r) => {
|
|
1148
|
+
let i = [
|
|
1149
|
+
"formatType",
|
|
1150
|
+
"formatString",
|
|
1151
|
+
"currency",
|
|
1152
|
+
"currencyIsPrefix",
|
|
1153
|
+
"negativeType"
|
|
1154
|
+
];
|
|
1155
|
+
return $(e, t.flatMap((t, a) => {
|
|
1156
|
+
let o = e.resolvedRefs[t.ref];
|
|
1157
|
+
return i.flatMap((e) => {
|
|
1158
|
+
let i = t.format?.[e], s = n[e];
|
|
1159
|
+
return i !== void 0 && s ? [ln(s, o, t.ref, t.path ?? [...r, a], e, i)] : [];
|
|
1160
|
+
});
|
|
1161
|
+
}), r);
|
|
1162
|
+
}, Tn = (e, t, n, r) => $(e, t.flatMap((t, i) => t.temporalGrouping ? [mn(n, e.resolvedRefs[t.ref], t.ref, t.path ?? [...r, i], t.temporalGrouping)] : []), r), En = (e, t, n, r) => $(e, t.flatMap((t) => t.showNullValues === void 0 ? [] : [{
|
|
1163
|
+
name: n,
|
|
1164
|
+
payload: {
|
|
1165
|
+
...J(e.resolvedRefs[t.ref]),
|
|
1166
|
+
changes: { showNullValues: t.showNullValues }
|
|
1167
|
+
}
|
|
1168
|
+
}]), r), Dn = (e, t) => t ? $(e, [{
|
|
1169
|
+
id: "filterGroup",
|
|
1170
|
+
name: "setStaticFilterGroup",
|
|
1171
|
+
payload: Y(t)
|
|
1172
|
+
}], ["filterGroup"]) : Promise.resolve({
|
|
1173
|
+
state: e,
|
|
1174
|
+
success: !0
|
|
1175
|
+
}), On = (e, t, n, r) => {
|
|
1176
|
+
if (!t?.length) return Promise.resolve({
|
|
1177
|
+
state: e,
|
|
1178
|
+
success: !0
|
|
1179
|
+
});
|
|
1180
|
+
let i = e.vSpec.querySettings?.sortingOrder ?? [], a = new Map(t.map((e) => [e.by, e])), o = new Map(Object.entries(e.resolvedRefs).map(([e, t]) => [`${t.dataItemInternalKey}:${t.dataItemUniqueSignature}`, e])), s = t.map((t) => e.resolvedRefs[t.by]), c = new Set(s.map((e) => `${e.dataItemInternalKey}:${e.dataItemUniqueSignature}`));
|
|
1181
|
+
return $(e, [{
|
|
1182
|
+
name: n,
|
|
1183
|
+
payload: { changeRequests: [...s, ...i.filter((e) => !c.has(`${e.dataItem.internalKey}:${e.dataItem.uniqueSignature}`)).map((e) => ({
|
|
1184
|
+
dataItemInternalKey: e.dataItem.internalKey,
|
|
1185
|
+
dataItemUniqueSignature: e.dataItem.uniqueSignature,
|
|
1186
|
+
kind: "dimension"
|
|
1187
|
+
}))].map((e, t) => {
|
|
1188
|
+
let n = `${e.dataItemInternalKey}:${e.dataItemUniqueSignature}`, r = o.get(n), s = i.find((e) => `${e.dataItem.internalKey}:${e.dataItem.uniqueSignature}` === n);
|
|
1189
|
+
return {
|
|
1190
|
+
...J(e),
|
|
1191
|
+
newIndex: t,
|
|
1192
|
+
sortDirection: (r ? a.get(r)?.direction : void 0) ?? s?.sortDirection ?? "asc"
|
|
1193
|
+
};
|
|
1194
|
+
}) }
|
|
1195
|
+
}, ...t.map((t) => ({
|
|
1196
|
+
name: r,
|
|
1197
|
+
payload: {
|
|
1198
|
+
...J(e.resolvedRefs[t.by]),
|
|
1199
|
+
enabled: t.enabled ?? !0
|
|
1200
|
+
}
|
|
1201
|
+
}))], ["sorting"]);
|
|
1202
|
+
}, kn = (e, t) => {
|
|
1203
|
+
let n = [];
|
|
1204
|
+
return t?.overwrites && n.push({
|
|
1205
|
+
name: _.SET_COLORING_OVERWRITES,
|
|
1206
|
+
payload: { overwrites: t.overwrites.map(({ dimension: t, ...n }) => t === void 0 ? n : {
|
|
1207
|
+
...n,
|
|
1208
|
+
dimension: J(e.resolvedRefs[t])
|
|
1209
|
+
}) }
|
|
1210
|
+
}), t?.rules && n.push({
|
|
1211
|
+
name: _.SET_COLORING_RULES,
|
|
1212
|
+
payload: { rules: t.rules.map(({ measure: t, ...n }) => ({
|
|
1213
|
+
...n,
|
|
1214
|
+
measure: J(e.resolvedRefs[t])
|
|
1215
|
+
})) }
|
|
1216
|
+
}), $(e, n, X);
|
|
1170
1217
|
};
|
|
1171
|
-
export {
|
|
1218
|
+
export { at as $, nn as A, At as B, dn as C, W as D, $t as E, Et as F, ut as G, Ct as H, Dt as I, st as J, it as K, Ot as L, B as M, Vt as N, tn as O, jt as P, mt as Q, kt as R, _n as S, en as T, yt as U, wt as V, rt as W, dt as X, ot as Y, ct as Z, bn as _, wn as a, E as at, Y as b, xn as c, q as d, ft as et, cn as f, vn as g, $ as h, Dn as i, et as it, Kt as j, rn as k, ln as l, mn as m, kn as n, ht as nt, On as o, xe as ot, un as p, lt as q, En as r, gt as rt, Tn as s, Cn as t, pt as tt, pn as u, fn as v, sn as w, gn as x, J as y, Mt as z };
|