@astrato-io/visualizations 0.6.5 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -2
- package/THIRD_PARTY_NOTICES.md +2 -229
- package/VISUALIZATION_DEFINITIONS.md +68 -114
- package/chunks/Button-BrGKp9Nm.js +110 -0
- package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
- package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
- package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
- package/chunks/MenuOption-ByRqhRdX.js +3934 -0
- package/chunks/Title-CO5dP1ma.js +1691 -0
- package/chunks/ToggleButton-KOBAimC1.js +112 -0
- package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
- package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
- package/chunks/builder-DEDvNq1k.js +201 -0
- package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
- package/chunks/color-settings-3VRlf_Vw.js +6 -0
- package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
- package/chunks/coloring-CncX_JRX.js +278 -0
- package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
- package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
- package/chunks/event-bus-CrLB-Y8z.js +3 -0
- package/chunks/extend-preset-CUFNpmPe.js +4398 -0
- package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
- package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
- package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
- package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
- package/chunks/isEqual-B8loyPsC.js +12 -0
- package/chunks/label-format-type-weq1XfcX.js +8 -0
- package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
- package/chunks/logger-DpQtYQnX.js +1163 -0
- package/chunks/lookup-BWllin0q.js +36 -0
- package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
- package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
- package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
- package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
- package/chunks/registry-KervaxqJ.js +31 -0
- package/chunks/render-wrappers-OEmtaM8g.js +2 -0
- package/chunks/{registry-CsQQzukD.js → requirements-PAoRaJyb.js} +304 -336
- package/chunks/responsive.styles-DSiOGD7u.js +82 -0
- package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
- package/chunks/src-77e3mC7i.js +391 -0
- package/chunks/standalone-B55oyW6c.js +689 -0
- package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
- package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
- package/chunks/standalone-BMTCb10X.js +179 -0
- package/chunks/standalone-BXKRE_Se.js +468 -0
- package/chunks/standalone-Bes8srx1.js +354 -0
- package/chunks/standalone-BjZp0QMe.js +2 -0
- package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
- package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
- package/chunks/standalone-C8qAelL4.js +2 -0
- package/chunks/standalone-CJvIXsQE.js +743 -0
- package/chunks/standalone-CLmGb7nn2.js +355 -0
- package/chunks/standalone-CM5XcAN5.js +52327 -0
- package/chunks/standalone-CXNP6-xD.js +420 -0
- package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
- package/chunks/standalone-DLlyRIE6.js +287 -0
- package/chunks/standalone-DMcI1afI.js +396 -0
- package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
- package/chunks/standalone-DT0wKji7.js +6 -0
- package/chunks/{standalone-0M4HlmDW2.js → standalone-DVTJwsTY.js} +1109 -1035
- package/chunks/standalone-DW6NT205.js +518 -0
- package/chunks/standalone-DYQIQH4c.js +2095 -0
- package/chunks/standalone-D__XCp-h.js +1003 -0
- package/chunks/standalone-XTgSsTAa.js +354 -0
- package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
- package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
- package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
- package/chunks/useFieldName-Cjn9KCVp.js +7 -0
- package/chunks/useSlotProps-DLbQp4lc.js +166 -0
- package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
- package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
- package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
- package/chunks/web-components-DqClFkgO.js +1185 -0
- package/chunks/with-html-element-D0uY2zjI.js +7328 -0
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +31 -14
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +3 -3
- package/docs/operations/distribution-gauge.md +13 -13
- package/docs/operations/dot.md +13 -13
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +13 -13
- package/docs/operations/heatMap.md +13 -13
- 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 +3 -3
- package/docs/operations/line.md +7 -7
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +13 -13
- package/docs/operations/radar.md +7 -7
- package/docs/operations/sankey.md +13 -13
- package/docs/operations/scatter.md +13 -13
- 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 +18 -1
- package/docs/operations/tree.md +51 -37
- package/docs/operations/treemap.md +63 -49
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +13 -13
- package/getters.js +7 -7
- package/index.js +3 -1183
- package/metadata.js +18 -18
- package/operations.js +13 -13
- package/package.json +106 -55
- package/render.js +10 -0
- package/src/charts/bar.d.ts +1 -0
- package/src/charts/combo.d.ts +1 -0
- package/src/charts/dot.d.ts +1 -0
- package/src/charts/gauge-distribution.d.ts +1 -0
- package/src/charts/gauge.d.ts +1 -0
- package/src/charts/heat-map.d.ts +1 -0
- package/src/charts/histogram.d.ts +1 -0
- package/src/charts/line.d.ts +1 -0
- package/src/charts/pie.d.ts +1 -0
- package/src/charts/radar.d.ts +1 -0
- package/src/charts/sankey.d.ts +1 -0
- package/src/charts/scatter.d.ts +1 -0
- package/src/charts/table.d.ts +1 -0
- package/src/charts/tree.d.ts +1 -0
- package/src/charts/treemap.d.ts +1 -0
- package/src/charts/waterfall.d.ts +1 -0
- package/src/charts/word-cloud.d.ts +1 -0
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
- package/src/definitions/model/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
- package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/getters/index.d.ts +3 -3
- package/src/index.d.ts +1 -1
- package/src/objects/app-filter-bar.d.ts +1 -0
- package/src/objects/date-picker.d.ts +1 -0
- package/src/objects/filter.d.ts +1 -0
- package/src/objects/iframe.d.ts +1 -0
- package/src/objects/image.d.ts +1 -0
- package/src/objects/number.d.ts +1 -0
- package/src/objects/shape.d.ts +1 -0
- package/src/objects/slider.d.ts +1 -0
- package/src/objects/text.d.ts +1 -0
- package/src/operations/index.d.ts +3 -3
- package/src/registry/create-visualization-registry.d.ts +5 -0
- package/src/render/index.d.ts +34 -0
- package/src/runtime/index.d.ts +2 -2
- package/src/types.d.ts +9 -4
- package/src/web-components/index.d.ts +3 -3
- package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
- package/chunks/builder-B6dWSIdD.js +0 -12289
- package/chunks/coloring-B1XAfg6b.js +0 -664
- package/chunks/events-WZut5Ow6.js +0 -4
- package/chunks/grouping-type-On4s9Thj.js +0 -3
- package/chunks/requirements-DYjZCFyf.js +0 -6
- package/chunks/standalone-0ashe9w1.js +0 -411
- package/chunks/standalone-B7jax8wa.js +0 -339
- package/chunks/standalone-BK0VYU-l.js +0 -463
- package/chunks/standalone-BZV5vOwA.js +0 -6
- package/chunks/standalone-BhDrWj4p.js +0 -1980
- package/chunks/standalone-BvaKdky9.js +0 -344
- package/chunks/standalone-BwtM31-f.js +0 -2
- package/chunks/standalone-CC1VUjO32.js +0 -299
- package/chunks/standalone-CoLrAxRV.js +0 -13198
- package/chunks/standalone-DCtRoTWg.js +0 -675
- package/chunks/standalone-DUDFTBqL.js +0 -833
- package/chunks/standalone-DhZkX9Td.js +0 -2
- package/chunks/standalone-DtLElfuM.js +0 -512
- package/chunks/standalone-G9Q4Uczu.js +0 -726
- package/chunks/standalone-_DeX21JJ.js +0 -383
- package/chunks/standalone-gFhKZh8m.js +0 -179
- package/chunks/standalone-tDNy-SFH.js +0 -281
- package/chunks/ui-DQWtv2iM.js +0 -63551
- package/chunks/useFieldName-BvdcoJRl.js +0 -7
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
+
import { Bt as t, Ei as n, Vt as r, it as i, ln as a, ri as o, un as s } from "./utils-vdmi_2PK.js";
|
|
3
|
+
import { $t as c } from "./escobar-DRhRMYRE.js";
|
|
4
|
+
import { c as l, d as u, l as d, n as f, r as p, t as m, u as h } from "./DefaultPropsProvider-BsfB7QTn.js";
|
|
5
|
+
import { t as g } from "./colorManipulator-D8Pjy1pf.js";
|
|
6
|
+
var _ = /* @__PURE__ */ e(n());
|
|
7
|
+
s(), r();
|
|
8
|
+
function v(e) {
|
|
9
|
+
return h("MuiToggleButton", e);
|
|
10
|
+
}
|
|
11
|
+
var y = d("MuiToggleButton", [
|
|
12
|
+
"root",
|
|
13
|
+
"disabled",
|
|
14
|
+
"selected",
|
|
15
|
+
"standard",
|
|
16
|
+
"primary",
|
|
17
|
+
"secondary",
|
|
18
|
+
"sizeSmall",
|
|
19
|
+
"sizeMedium",
|
|
20
|
+
"sizeLarge",
|
|
21
|
+
"fullWidth"
|
|
22
|
+
]), b = /*#__PURE__*/ _.createContext({}), x = /*#__PURE__*/ _.createContext(void 0);
|
|
23
|
+
function S(e, t) {
|
|
24
|
+
return t === void 0 || e === void 0 ? !1 : Array.isArray(t) ? t.indexOf(e) >= 0 : e === t;
|
|
25
|
+
}
|
|
26
|
+
var C = o(), w = ["value"], T = [
|
|
27
|
+
"children",
|
|
28
|
+
"className",
|
|
29
|
+
"color",
|
|
30
|
+
"disabled",
|
|
31
|
+
"disableFocusRipple",
|
|
32
|
+
"fullWidth",
|
|
33
|
+
"onChange",
|
|
34
|
+
"onClick",
|
|
35
|
+
"selected",
|
|
36
|
+
"size",
|
|
37
|
+
"value"
|
|
38
|
+
], E = (e) => {
|
|
39
|
+
let { classes: t, fullWidth: n, selected: r, disabled: i, size: a, color: o } = e;
|
|
40
|
+
return l({ root: [
|
|
41
|
+
"root",
|
|
42
|
+
r && "selected",
|
|
43
|
+
i && "disabled",
|
|
44
|
+
n && "fullWidth",
|
|
45
|
+
`size${f(a)}`,
|
|
46
|
+
o
|
|
47
|
+
] }, v, t);
|
|
48
|
+
}, D = p(c, {
|
|
49
|
+
name: "MuiToggleButton",
|
|
50
|
+
slot: "Root",
|
|
51
|
+
overridesResolver: (e, t) => {
|
|
52
|
+
let { ownerState: n } = e;
|
|
53
|
+
return [t.root, t[`size${f(n.size)}`]];
|
|
54
|
+
}
|
|
55
|
+
})(({ theme: e, ownerState: t }) => {
|
|
56
|
+
let n = t.color === "standard" ? e.palette.text.primary : e.palette[t.color].main, r;
|
|
57
|
+
return e.vars && (n = t.color === "standard" ? e.vars.palette.text.primary : e.vars.palette[t.color].main, r = t.color === "standard" ? e.vars.palette.text.primaryChannel : e.vars.palette[t.color].mainChannel), a({}, e.typography.button, {
|
|
58
|
+
borderRadius: (e.vars || e).shape.borderRadius,
|
|
59
|
+
padding: 11,
|
|
60
|
+
border: `1px solid ${(e.vars || e).palette.divider}`,
|
|
61
|
+
color: (e.vars || e).palette.action.active
|
|
62
|
+
}, t.fullWidth && { width: "100%" }, {
|
|
63
|
+
[`&.${y.disabled}`]: {
|
|
64
|
+
color: (e.vars || e).palette.action.disabled,
|
|
65
|
+
border: `1px solid ${(e.vars || e).palette.action.disabledBackground}`
|
|
66
|
+
},
|
|
67
|
+
"&:hover": {
|
|
68
|
+
textDecoration: "none",
|
|
69
|
+
backgroundColor: e.vars ? `rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})` : g(e.palette.text.primary, e.palette.action.hoverOpacity),
|
|
70
|
+
"@media (hover: none)": { backgroundColor: "transparent" }
|
|
71
|
+
},
|
|
72
|
+
[`&.${y.selected}`]: {
|
|
73
|
+
color: n,
|
|
74
|
+
backgroundColor: e.vars ? `rgba(${r} / ${e.vars.palette.action.selectedOpacity})` : g(n, e.palette.action.selectedOpacity),
|
|
75
|
+
"&:hover": {
|
|
76
|
+
backgroundColor: e.vars ? `rgba(${r} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : g(n, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
77
|
+
"@media (hover: none)": { backgroundColor: e.vars ? `rgba(${r} / ${e.vars.palette.action.selectedOpacity})` : g(n, e.palette.action.selectedOpacity) }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, t.size === "small" && {
|
|
81
|
+
padding: 7,
|
|
82
|
+
fontSize: e.typography.pxToRem(13)
|
|
83
|
+
}, t.size === "large" && {
|
|
84
|
+
padding: 15,
|
|
85
|
+
fontSize: e.typography.pxToRem(15)
|
|
86
|
+
});
|
|
87
|
+
}), O = /*#__PURE__*/ _.forwardRef(function(e, n) {
|
|
88
|
+
let r = _.useContext(b), { value: o } = r, s = t(r, w), c = _.useContext(x), l = m({
|
|
89
|
+
props: i(a({}, s, { selected: S(e.value, o) }), e),
|
|
90
|
+
name: "MuiToggleButton"
|
|
91
|
+
}), { children: d, className: f, color: p = "standard", disabled: h = !1, disableFocusRipple: g = !1, fullWidth: v = !1, onChange: y, onClick: O, selected: k, size: A = "medium", value: j } = l, M = t(l, T), N = a({}, l, {
|
|
92
|
+
color: p,
|
|
93
|
+
disabled: h,
|
|
94
|
+
disableFocusRipple: g,
|
|
95
|
+
fullWidth: v,
|
|
96
|
+
size: A
|
|
97
|
+
}), P = E(N), F = (e) => {
|
|
98
|
+
O && (O(e, j), e.defaultPrevented) || y && y(e, j);
|
|
99
|
+
}, I = c || "";
|
|
100
|
+
return /*#__PURE__*/ (0, C.jsx)(D, a({
|
|
101
|
+
className: u(s.className, P.root, f, I),
|
|
102
|
+
disabled: h,
|
|
103
|
+
focusRipple: !g,
|
|
104
|
+
ref: n,
|
|
105
|
+
onClick: F,
|
|
106
|
+
onChange: y,
|
|
107
|
+
value: j,
|
|
108
|
+
ownerState: N,
|
|
109
|
+
"aria-pressed": k
|
|
110
|
+
}, M, { children: d }));
|
|
111
|
+
});
|
|
112
|
+
export { y as i, x as n, b as r, O as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { m as l } from "./operations-
|
|
1
|
+
import { T as e, d as t, g as n, h as r, st as i, u as a, v as o } from "./shared-Bn4N5QcZ.js";
|
|
2
|
+
import { Bf as s, gd as c } from "./handlers-TOT-7INo.js";
|
|
3
|
+
import { m as l } from "./operations-Dh4v1Ovt.js";
|
|
4
4
|
var u = async (u) => {
|
|
5
5
|
let d = c(u);
|
|
6
6
|
if (d) return {
|
|
@@ -11,19 +11,19 @@ var u = async (u) => {
|
|
|
11
11
|
}],
|
|
12
12
|
success: !1
|
|
13
13
|
};
|
|
14
|
-
let f =
|
|
14
|
+
let f = i.safeParse(u.definition);
|
|
15
15
|
if (!f.success) return {
|
|
16
|
-
issues:
|
|
16
|
+
issues: e(f.error, u.definition),
|
|
17
17
|
success: !1
|
|
18
18
|
};
|
|
19
19
|
let p = s.safeParse(u.baseVSpec);
|
|
20
20
|
if (!p.success) return {
|
|
21
|
-
issues: [
|
|
21
|
+
issues: [t("invalid_structure", ["baseVSpec"], "Base app filter bar vSpec is invalid.")],
|
|
22
22
|
success: !1
|
|
23
23
|
};
|
|
24
24
|
let m = p.data;
|
|
25
|
-
if (!
|
|
26
|
-
issues: [
|
|
25
|
+
if (!o(m, [])) return {
|
|
26
|
+
issues: [t("non_fresh_base_vspec", ["baseVSpec"], "App filter bar definitions require a fresh base vSpec.")],
|
|
27
27
|
success: !1
|
|
28
28
|
};
|
|
29
29
|
let h = f.data.settings ?? {}, g = [
|
|
@@ -55,10 +55,10 @@ var u = async (u) => {
|
|
|
55
55
|
name: l.SET_SELECTABLE_FIELD_KEYS,
|
|
56
56
|
payload: h.selectableFieldKeys
|
|
57
57
|
}]
|
|
58
|
-
], _ = await
|
|
58
|
+
], _ = await r(a(u, m), g, ["settings"]);
|
|
59
59
|
return "issue" in _ ? {
|
|
60
60
|
issues: [_.issue],
|
|
61
61
|
success: !1
|
|
62
|
-
} :
|
|
62
|
+
} : n(_.state, s);
|
|
63
63
|
};
|
|
64
64
|
export { u as compileAppFilterBarVisualizationDefinition };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { _ as x, b as S, t as C, u as w, v as T, w as E } from "./operations-
|
|
1
|
+
import { Ua as e, r as t } from "./visualization-filters-Cc4KU-l-.js";
|
|
2
|
+
import { A as n, D as r, E as i, N as a, S as o, T as s, _ as c, at as l, b as u, c as d, d as f, f as p, h as m, k as h, l as g, m as _, n as v } from "./shared-Bn4N5QcZ.js";
|
|
3
|
+
import { Ef as y, gd as b } from "./handlers-TOT-7INo.js";
|
|
4
|
+
import { _ as x, b as S, t as C, u as w, v as T, w as E } from "./operations-Dh4v1Ovt.js";
|
|
5
5
|
t();
|
|
6
6
|
var D = (e) => {
|
|
7
7
|
let t = [...e.data.dimensions.map((e, t) => ({
|
|
@@ -20,26 +20,26 @@ var D = (e) => {
|
|
|
20
20
|
t,
|
|
21
21
|
"ref"
|
|
22
22
|
]
|
|
23
|
-
}))], n = t.map(({ item: e }) => e.ref), r = new Set(n), i = /* @__PURE__ */ new Set(),
|
|
23
|
+
}))], n = t.map(({ item: e }) => e.ref), r = new Set(n), i = /* @__PURE__ */ new Set(), a = [];
|
|
24
24
|
t.forEach(({ item: e, path: t }) => {
|
|
25
|
-
i.has(e.ref) &&
|
|
25
|
+
i.has(e.ref) && a.push(f("duplicate_alias", t, `Reference "${e.ref}" is duplicated.`)), i.add(e.ref);
|
|
26
26
|
}), e.sorting?.forEach((e, t) => {
|
|
27
|
-
r.has(e.by) ||
|
|
27
|
+
r.has(e.by) || a.push(f("unknown_alias", [
|
|
28
28
|
"sorting",
|
|
29
29
|
t,
|
|
30
30
|
"by"
|
|
31
31
|
], `Reference "${e.by}" does not exist.`, { allowedValues: n }));
|
|
32
|
-
}),
|
|
32
|
+
}), a.push(...o(e.presentation?.coloring, e.data.dimensions.map((e) => e.ref), e.data.measures.map((e) => e.ref)));
|
|
33
33
|
let s = e.limiting?.topN?.by;
|
|
34
|
-
return s && !e.data.measures.some((e) => e.ref === s) &&
|
|
34
|
+
return s && !e.data.measures.some((e) => e.ref === s) && a.push(f("unknown_alias", [
|
|
35
35
|
"limiting",
|
|
36
36
|
"topN",
|
|
37
37
|
"by"
|
|
38
|
-
], `Measure reference "${s}" does not exist.`, { allowedValues: e.data.measures.map((e) => e.ref) })),
|
|
38
|
+
], `Measure reference "${s}" does not exist.`, { allowedValues: e.data.measures.map((e) => e.ref) })), a;
|
|
39
39
|
}, O = (e) => {
|
|
40
|
-
if (e.type !== "bar") return
|
|
40
|
+
if (e.type !== "bar") return f("unsupported_visualization", ["baseVSpec", "type"], `Definition type "bar" cannot compile against base vSpec type "${e.type}".`);
|
|
41
41
|
let t = e;
|
|
42
|
-
return t.dimensions.length > 0 || t.measures.length > 0 || (t.supportingMeasures?.length ?? 0) > 0 || Object.keys(t.referencedData).length > 0 ?
|
|
42
|
+
return t.dimensions.length > 0 || t.measures.length > 0 || (t.supportingMeasures?.length ?? 0) > 0 || Object.keys(t.referencedData).length > 0 ? f("non_fresh_base_vspec", ["baseVSpec"], "Bar visualization definitions can only compile against a fresh base vSpec.") : void 0;
|
|
43
43
|
}, k = {
|
|
44
44
|
formatString: "setDimensionFormatString",
|
|
45
45
|
formatType: "setDimensionFormatType"
|
|
@@ -64,59 +64,59 @@ var D = (e) => {
|
|
|
64
64
|
kind: t
|
|
65
65
|
};
|
|
66
66
|
}, N = async (e, t) => {
|
|
67
|
-
let
|
|
68
|
-
for (let [e,
|
|
69
|
-
let t = `dimension:${
|
|
67
|
+
let n = e;
|
|
68
|
+
for (let [e, r] of t.data.dimensions.entries()) {
|
|
69
|
+
let t = `dimension:${r.ref}`, i = await C(n.vSpec, n.availableFields, [{
|
|
70
70
|
id: t,
|
|
71
71
|
name: w.ADD_DIMENSION,
|
|
72
|
-
payload: { key:
|
|
73
|
-
}],
|
|
72
|
+
payload: { key: r.fieldKey }
|
|
73
|
+
}], n.input.variables ?? [], [], n.input.theme), a = j(i.results), o = M(i.results[t], "dimension");
|
|
74
74
|
if (a || !o) return {
|
|
75
|
-
issue:
|
|
75
|
+
issue: f("operation_failed", [
|
|
76
76
|
"data",
|
|
77
77
|
"dimensions",
|
|
78
78
|
e
|
|
79
79
|
], a?.result.error ?? "Dimension operation did not return the created data-item identity."),
|
|
80
80
|
success: !1
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
...
|
|
82
|
+
n = {
|
|
83
|
+
...n,
|
|
84
84
|
resolvedRefs: {
|
|
85
|
-
...
|
|
86
|
-
[
|
|
85
|
+
...n.resolvedRefs,
|
|
86
|
+
[r.ref]: o
|
|
87
87
|
},
|
|
88
88
|
vSpec: i.vSpec
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
for (let [
|
|
92
|
-
let t =
|
|
91
|
+
for (let [a, o] of t.data.measures.entries()) {
|
|
92
|
+
let t = r(o, e.input.availableFields), s = `measure:${o.ref}`, c = await C(n.vSpec, n.availableFields, [{
|
|
93
93
|
id: s,
|
|
94
94
|
name: w.ADD_MEASURE,
|
|
95
|
-
payload: o
|
|
96
|
-
}],
|
|
97
|
-
if (l || !
|
|
98
|
-
issue:
|
|
95
|
+
payload: i(o, e.input.availableFields)
|
|
96
|
+
}], n.input.variables ?? [], [], n.input.theme), l = j(c.results), u = M(c.results[s], "measure");
|
|
97
|
+
if (l || !u) return {
|
|
98
|
+
issue: f("operation_failed", [
|
|
99
99
|
"data",
|
|
100
100
|
"measures",
|
|
101
|
-
|
|
101
|
+
a
|
|
102
102
|
], l?.result.error ?? "Measure operation did not return the created data-item identity."),
|
|
103
103
|
success: !1
|
|
104
104
|
};
|
|
105
|
-
|
|
106
|
-
...
|
|
105
|
+
n = {
|
|
106
|
+
...n,
|
|
107
107
|
measureAggregations: {
|
|
108
|
-
...
|
|
109
|
-
[
|
|
108
|
+
...n.measureAggregations,
|
|
109
|
+
[o.ref]: t
|
|
110
110
|
},
|
|
111
111
|
resolvedRefs: {
|
|
112
|
-
...
|
|
113
|
-
[
|
|
112
|
+
...n.resolvedRefs,
|
|
113
|
+
[o.ref]: u
|
|
114
114
|
},
|
|
115
115
|
vSpec: c.vSpec
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
return {
|
|
119
|
-
state:
|
|
119
|
+
state: n,
|
|
120
120
|
success: !0
|
|
121
121
|
};
|
|
122
122
|
}, P = (e) => ({
|
|
@@ -132,15 +132,15 @@ var D = (e) => {
|
|
|
132
132
|
...P(i),
|
|
133
133
|
changes: { showNullValues: t.showNullValues }
|
|
134
134
|
}
|
|
135
|
-
}), t.temporalGrouping && n.push(
|
|
135
|
+
}), t.temporalGrouping && n.push(_("setDimensionTemporalGrouping", i, t.ref, [
|
|
136
136
|
"data",
|
|
137
137
|
"dimensions",
|
|
138
138
|
r
|
|
139
|
-
], t.temporalGrouping)), t.format?.formatType !== void 0 && n.push(
|
|
139
|
+
], t.temporalGrouping)), t.format?.formatType !== void 0 && n.push(g(k.formatType, i, t.ref, [
|
|
140
140
|
"data",
|
|
141
141
|
"dimensions",
|
|
142
142
|
r
|
|
143
|
-
], "formatType", t.format.formatType)), t.format?.formatString !== void 0 && n.push(
|
|
143
|
+
], "formatType", t.format.formatType)), t.format?.formatString !== void 0 && n.push(g(k.formatString, i, t.ref, [
|
|
144
144
|
"data",
|
|
145
145
|
"dimensions",
|
|
146
146
|
r
|
|
@@ -155,7 +155,7 @@ var D = (e) => {
|
|
|
155
155
|
"negativeType"
|
|
156
156
|
].forEach((e) => {
|
|
157
157
|
let a = t.format?.[e];
|
|
158
|
-
a !== void 0 && n.push(
|
|
158
|
+
a !== void 0 && n.push(g(A[e], i, t.ref, [
|
|
159
159
|
"data",
|
|
160
160
|
"measures",
|
|
161
161
|
r
|
|
@@ -179,11 +179,11 @@ var D = (e) => {
|
|
|
179
179
|
secondaryAxis: t.axis === "secondary"
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
|
-
}),
|
|
183
|
-
}, I = (e, t) =>
|
|
182
|
+
}), m(e, n, ["data"]);
|
|
183
|
+
}, I = (e, t) => m(e, t.filterGroup ? [{
|
|
184
184
|
id: "filterGroup",
|
|
185
185
|
name: "setStaticFilterGroup",
|
|
186
|
-
payload:
|
|
186
|
+
payload: u(t.filterGroup)
|
|
187
187
|
}] : [], ["filterGroup"]), L = async (t, n) => {
|
|
188
188
|
if (!n.sorting?.length) return {
|
|
189
189
|
state: t,
|
|
@@ -200,7 +200,7 @@ var D = (e) => {
|
|
|
200
200
|
newIndex: n,
|
|
201
201
|
sortDirection: (r ? i.get(r)?.direction : void 0) ?? s?.sortDirection ?? e.Asc
|
|
202
202
|
};
|
|
203
|
-
}), u = await
|
|
203
|
+
}), u = await m(t, [{
|
|
204
204
|
name: w.CHANGE_SORT_ORDER_AND_DIRECTION,
|
|
205
205
|
payload: { changeRequests: l }
|
|
206
206
|
}], ["sorting"]);
|
|
@@ -212,7 +212,7 @@ var D = (e) => {
|
|
|
212
212
|
enabled: e.enabled ?? !0
|
|
213
213
|
}
|
|
214
214
|
}));
|
|
215
|
-
return u = await
|
|
215
|
+
return u = await m(u.state, d, ["sorting"]), u;
|
|
216
216
|
}, R = (e, t) => {
|
|
217
217
|
let n = [], { limiting: r } = t;
|
|
218
218
|
if (r?.queryLimit !== void 0 && n.push({
|
|
@@ -240,9 +240,9 @@ var D = (e) => {
|
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
return
|
|
243
|
+
return m(e, n, ["limiting"]);
|
|
244
244
|
}, z = (e, t) => {
|
|
245
|
-
let n = [], { presentation: r } = t, i =
|
|
245
|
+
let n = [], { presentation: r } = t, i = c(r?.axes);
|
|
246
246
|
if (i) return Promise.resolve({
|
|
247
247
|
issue: i,
|
|
248
248
|
success: !1
|
|
@@ -252,7 +252,7 @@ var D = (e) => {
|
|
|
252
252
|
payload: r.orientation
|
|
253
253
|
});
|
|
254
254
|
let a = r?.legend;
|
|
255
|
-
a && n.push(...
|
|
255
|
+
a && n.push(...p(e.vSpec, a)), Object.entries(r?.axes ?? {}).forEach(([e, t]) => {
|
|
256
256
|
t.titleVisible !== void 0 && n.push({
|
|
257
257
|
name: w.SET_SHOW_AXIS_TITLE,
|
|
258
258
|
payload: {
|
|
@@ -283,7 +283,7 @@ var D = (e) => {
|
|
|
283
283
|
axisName: e,
|
|
284
284
|
showAxisLine: t.lineVisible
|
|
285
285
|
}
|
|
286
|
-
}), n.push(...
|
|
286
|
+
}), n.push(...d(e, t)), "scale" in t && t.scale !== void 0 && n.push({
|
|
287
287
|
name: T.SET_AXIS_SCALE,
|
|
288
288
|
payload: {
|
|
289
289
|
axisName: e,
|
|
@@ -295,9 +295,9 @@ var D = (e) => {
|
|
|
295
295
|
return o && n.push({
|
|
296
296
|
name: S.SET_MEASURE_AXIS_BANDS,
|
|
297
297
|
payload: { bands: o }
|
|
298
|
-
}),
|
|
298
|
+
}), m(e, n, ["presentation"]);
|
|
299
299
|
}, B = async (e) => {
|
|
300
|
-
let t =
|
|
300
|
+
let t = b(e);
|
|
301
301
|
if (t) return {
|
|
302
302
|
issues: [{
|
|
303
303
|
code: "invalid_structure",
|
|
@@ -306,68 +306,68 @@ var D = (e) => {
|
|
|
306
306
|
}],
|
|
307
307
|
success: !1
|
|
308
308
|
};
|
|
309
|
-
let
|
|
310
|
-
if (!
|
|
311
|
-
issues:
|
|
309
|
+
let r = l.safeParse(e.definition);
|
|
310
|
+
if (!r.success) return {
|
|
311
|
+
issues: s(r.error, e.definition),
|
|
312
312
|
success: !1
|
|
313
313
|
};
|
|
314
|
-
let
|
|
315
|
-
if (!
|
|
316
|
-
issues: [
|
|
314
|
+
let i = y.safeParse(e.baseVSpec);
|
|
315
|
+
if (!i.success) return {
|
|
316
|
+
issues: [f("invalid_structure", ["baseVSpec"], "Base bar vSpec is invalid.", { details: { issues: i.error.issues } })],
|
|
317
317
|
success: !1
|
|
318
318
|
};
|
|
319
|
-
let o =
|
|
320
|
-
if (
|
|
321
|
-
issues: [
|
|
319
|
+
let o = i.data, c = O(o);
|
|
320
|
+
if (c) return {
|
|
321
|
+
issues: [c],
|
|
322
322
|
success: !1
|
|
323
323
|
};
|
|
324
|
-
let
|
|
324
|
+
let u = r.data.data.measures.find((e) => e.ref === r.data.limiting?.topN?.by), d = (u ? e.availableFields.find((e) => e.fieldKey === u.fieldKey) : void 0)?.kind === "measure" ? [f("unsupported_feature", [
|
|
325
325
|
"limiting",
|
|
326
326
|
"topN",
|
|
327
327
|
"by"
|
|
328
|
-
], "Top N ranking by a predefined measure is not supported by the current query builder. Use a raw field or calculation.")] : [],
|
|
329
|
-
...D(
|
|
330
|
-
...
|
|
331
|
-
...
|
|
332
|
-
...
|
|
333
|
-
...
|
|
328
|
+
], "Top N ranking by a predefined measure is not supported by the current query builder. Use a raw field or calculation.")] : [], p = [
|
|
329
|
+
...D(r.data),
|
|
330
|
+
...h(r.data.data.dimensions, e.availableFields, ["data", "dimensions"], "dimension"),
|
|
331
|
+
...h(r.data.data.measures, e.availableFields, ["data", "measures"], "measure"),
|
|
332
|
+
...n(r.data.filterGroup, e.availableFields),
|
|
333
|
+
...d
|
|
334
334
|
];
|
|
335
|
-
if (
|
|
336
|
-
issues:
|
|
335
|
+
if (p.length > 0) return {
|
|
336
|
+
issues: p,
|
|
337
337
|
success: !1
|
|
338
338
|
};
|
|
339
|
-
let
|
|
340
|
-
availableFields:
|
|
339
|
+
let m = await N({
|
|
340
|
+
availableFields: a(e.availableFields),
|
|
341
341
|
input: e,
|
|
342
342
|
measureAggregations: {},
|
|
343
343
|
resolvedRefs: {},
|
|
344
344
|
vSpec: o
|
|
345
|
-
},
|
|
345
|
+
}, r.data), g = [
|
|
346
346
|
F,
|
|
347
347
|
I,
|
|
348
348
|
L,
|
|
349
349
|
R,
|
|
350
350
|
z,
|
|
351
|
-
(e, t) =>
|
|
351
|
+
(e, t) => v(e, t.presentation?.coloring)
|
|
352
352
|
];
|
|
353
|
-
for (let e of
|
|
354
|
-
if ("issue" in
|
|
355
|
-
issues: [
|
|
353
|
+
for (let e of g) {
|
|
354
|
+
if ("issue" in m) return {
|
|
355
|
+
issues: [m.issue],
|
|
356
356
|
success: !1
|
|
357
357
|
};
|
|
358
|
-
|
|
358
|
+
m = await e(m.state, r.data);
|
|
359
359
|
}
|
|
360
|
-
if ("issue" in
|
|
361
|
-
issues: [
|
|
360
|
+
if ("issue" in m) return {
|
|
361
|
+
issues: [m.issue],
|
|
362
362
|
success: !1
|
|
363
363
|
};
|
|
364
|
-
let
|
|
365
|
-
return
|
|
366
|
-
resolvedRefs:
|
|
364
|
+
let _ = y.safeParse(m.state.vSpec);
|
|
365
|
+
return _.success ? {
|
|
366
|
+
resolvedRefs: m.state.resolvedRefs,
|
|
367
367
|
success: !0,
|
|
368
|
-
vSpec:
|
|
368
|
+
vSpec: _.data
|
|
369
369
|
} : {
|
|
370
|
-
issues: [
|
|
370
|
+
issues: [f("invalid_compiled_vspec", [], "Compiled bar vSpec failed final validation.", { details: { issues: _.error.issues } })],
|
|
371
371
|
success: !1
|
|
372
372
|
};
|
|
373
373
|
};
|