@astrato-io/visualizations 0.0.0-stage → 0.6.4

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.
Files changed (145) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +93 -0
  3. package/README.md +843 -2
  4. package/THIRD_PARTY_NOTICES.md +8387 -0
  5. package/VISUALIZATION_DEFINITIONS.md +2378 -0
  6. package/chunks/LinearProgress-CUZ0D8_t.js +253 -0
  7. package/chunks/Radio-Ciu-F4CU.js +957 -0
  8. package/chunks/ToggleButton-BCJc3Jlc.js +153 -0
  9. package/chunks/_baseFlatten-DPXPOrea.js +7076 -0
  10. package/chunks/accessors-DemrDevR.js +128 -0
  11. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +55 -0
  12. package/chunks/bar.compiler-oqaPzIut.js +370 -0
  13. package/chunks/color-settings-ZIvgNTq1.js +10 -0
  14. package/chunks/coloring-C16AUZEi.js +663 -0
  15. package/chunks/data-item-resolution-1lvYB5ln.js +53 -0
  16. package/chunks/debounce-fn-CUixuz45.js +7 -0
  17. package/chunks/escobar-BGqT1EsE.js +34580 -0
  18. package/chunks/event-bus-KiSiCJrC.js +2683 -0
  19. package/chunks/events-WZut5Ow6.js +4 -0
  20. package/chunks/extend-BKUkc4_i.js +37 -0
  21. package/chunks/filter.compiler-CuLtc_02.js +60 -0
  22. package/chunks/filtering-Yq4DEa0t.js +953 -0
  23. package/chunks/gauge-target-type-BkKXAqkX.js +4 -0
  24. package/chunks/grouping-type-BX_9Ix5q.js +3 -0
  25. package/chunks/interfaces-VUY4_yVO.js +8742 -0
  26. package/chunks/line-settings-DfYTUyPz.js +4 -0
  27. package/chunks/line.compiler-BpA_6Tc7.js +188 -0
  28. package/chunks/metadata-CPXdYoln.js +28 -0
  29. package/chunks/number.compiler-DbkWcG4S.js +44 -0
  30. package/chunks/pie-uv42Eqal.js +10 -0
  31. package/chunks/range-DrzdfBX4.js +22 -0
  32. package/chunks/registry-CExpGJ1N.js +920 -0
  33. package/chunks/requirements-DNhuShLS.js +6 -0
  34. package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
  35. package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
  36. package/chunks/shared-CKDL4hx9.js +1171 -0
  37. package/chunks/src-BC7cGcJ-.js +2024 -0
  38. package/chunks/src-BOS6SqkZ.js +67 -0
  39. package/chunks/src-C0LgoUWY.js +26105 -0
  40. package/chunks/src-Cum_2NLV.js +12145 -0
  41. package/chunks/src-D9XogOrc.js +422 -0
  42. package/chunks/src-Dun_jXtz.js +10295 -0
  43. package/chunks/src-DvX5LU9T.js +14742 -0
  44. package/chunks/standalone-87YV_m9n.js +687 -0
  45. package/chunks/standalone-BDCwI6Hn.js +4619 -0
  46. package/chunks/standalone-BH5NqDwp.js +1763 -0
  47. package/chunks/standalone-BLVAWLNJ.js +385 -0
  48. package/chunks/standalone-BPomtAVs.js +2 -0
  49. package/chunks/standalone-BXyBcUOQ.js +2 -0
  50. package/chunks/standalone-BYm1UjLr.js +140 -0
  51. package/chunks/standalone-BllF4rDp.js +383 -0
  52. package/chunks/standalone-BmfMt74U.js +726 -0
  53. package/chunks/standalone-BqWyrnZI.js +281 -0
  54. package/chunks/standalone-C85u7U6I.js +340 -0
  55. package/chunks/standalone-CCNtaJ7s.js +741 -0
  56. package/chunks/standalone-CDQnr6qT.js +345 -0
  57. package/chunks/standalone-CNyNHKVx.js +674 -0
  58. package/chunks/standalone-CY57qwZ-.js +1129 -0
  59. package/chunks/standalone-CZynjFG7.js +12979 -0
  60. package/chunks/standalone-D5vnf-9y.js +3943 -0
  61. package/chunks/standalone-DFPva_ku.js +299 -0
  62. package/chunks/standalone-DQxxNwF8.js +675 -0
  63. package/chunks/standalone-DS9T0FZ-.js +830 -0
  64. package/chunks/standalone-Dx3MLlrO.js +512 -0
  65. package/chunks/standalone-DzixzZAL.js +411 -0
  66. package/chunks/standalone-QJ1kKMnO.js +6 -0
  67. package/chunks/standalone-jiz0L2Dg.js +3855 -0
  68. package/chunks/standalone-lBm9hQ-q.js +179 -0
  69. package/chunks/standalone-rJ45Zfl1.js +68 -0
  70. package/chunks/stroke-dash-UgMEcCS4.js +6 -0
  71. package/chunks/table.compiler-BrXkm4Fz.js +213 -0
  72. package/chunks/toInteger-DVZr-D1j.js +11 -0
  73. package/chunks/treemap-x_zmJoG7.js +23 -0
  74. package/chunks/typeof-CJDtcySz.js +13 -0
  75. package/chunks/types-dVVCsDWD.js +4 -0
  76. package/chunks/ui-D1HQNIBy.js +54039 -0
  77. package/chunks/url-utils-B17gj_mr.js +5501 -0
  78. package/chunks/useFieldName-oqQ3bvnO.js +7 -0
  79. package/chunks/utils-Ba9T0TqC.js +31097 -0
  80. package/chunks/view-CLqWMV7Z.js +156 -0
  81. package/definitions.js +3 -0
  82. package/docs/operations/astrato-app-filter-bar.md +161 -0
  83. package/docs/operations/bar.md +7050 -0
  84. package/docs/operations/combo.md +5825 -0
  85. package/docs/operations/date-picker.md +644 -0
  86. package/docs/operations/distribution-gauge.md +3218 -0
  87. package/docs/operations/dot.md +5662 -0
  88. package/docs/operations/filter.md +1507 -0
  89. package/docs/operations/gauge.md +3452 -0
  90. package/docs/operations/heatMap.md +6026 -0
  91. package/docs/operations/histogram.md +1870 -0
  92. package/docs/operations/iframe.md +56 -0
  93. package/docs/operations/image.md +177 -0
  94. package/docs/operations/index.md +46 -0
  95. package/docs/operations/line.md +6468 -0
  96. package/docs/operations/number.md +3969 -0
  97. package/docs/operations/pie.md +6089 -0
  98. package/docs/operations/radar.md +4646 -0
  99. package/docs/operations/sankey.md +3210 -0
  100. package/docs/operations/scatter.md +6075 -0
  101. package/docs/operations/shape.md +315 -0
  102. package/docs/operations/simpleTextObject.md +706 -0
  103. package/docs/operations/slider.md +230 -0
  104. package/docs/operations/table.md +8790 -0
  105. package/docs/operations/tree.md +2874 -0
  106. package/docs/operations/treemap.md +3619 -0
  107. package/docs/operations/waterfall.md +2938 -0
  108. package/docs/operations/word-cloud.md +3071 -0
  109. package/getters.js +18 -0
  110. package/index.js +1183 -0
  111. package/metadata.js +20 -0
  112. package/operations.js +64 -0
  113. package/package.json +191 -4
  114. package/src/definitions/index.d.ts +2 -0
  115. package/src/definitions/shared/index.d.ts +5 -0
  116. package/src/definitions/shared/lib/available-fields.d.ts +36 -0
  117. package/src/definitions/shared/lib/compilers/index.d.ts +7 -0
  118. package/src/definitions/shared/lib/registry/compile.d.ts +2 -0
  119. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +587 -0
  120. package/src/definitions/shared/lib/registry/index.d.ts +3 -0
  121. package/src/definitions/shared/lib/registry/validation.d.ts +3 -0
  122. package/src/definitions/shared/lib/schemas/app-filter-bar.schema.d.ts +22 -0
  123. package/src/definitions/shared/lib/schemas/bar.schema.d.ts +73 -0
  124. package/src/definitions/shared/lib/schemas/broad-chart.schema.d.ts +68 -0
  125. package/src/definitions/shared/lib/schemas/common.schema.d.ts +304 -0
  126. package/src/definitions/shared/lib/schemas/filter.schema.d.ts +22 -0
  127. package/src/definitions/shared/lib/schemas/index.d.ts +9 -0
  128. package/src/definitions/shared/lib/schemas/line.schema.d.ts +72 -0
  129. package/src/definitions/shared/lib/schemas/number.schema.d.ts +21 -0
  130. package/src/definitions/shared/lib/schemas/object.schema.d.ts +215 -0
  131. package/src/definitions/shared/lib/schemas/table.schema.d.ts +458 -0
  132. package/src/definitions/shared/lib/types/compilation.types.d.ts +36 -0
  133. package/src/definitions/shared/lib/types/definition.types.d.ts +2 -0
  134. package/src/definitions/shared/lib/types/descriptor.types.d.ts +39 -0
  135. package/src/definitions/shared/lib/types/index.d.ts +3 -0
  136. package/src/getters/index.d.ts +30 -0
  137. package/src/index.d.ts +4 -0
  138. package/src/metadata/index.d.ts +4 -0
  139. package/src/operations/index.d.ts +30 -0
  140. package/src/registry/index.d.ts +6 -0
  141. package/src/runtime/index.d.ts +2 -0
  142. package/src/types.d.ts +307 -0
  143. package/src/visualization-catalog.d.ts +82 -0
  144. package/src/web-components/index.d.ts +12 -0
  145. package/styles.css +2 -0
@@ -0,0 +1,179 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Ta as t, no as n, qo as r, ro as i } from "./interfaces-VUY4_yVO.js";
3
+ import { G as a, Ki as o, W as s, Zt as c, d as l, wi as u } from "./utils-Ba9T0TqC.js";
4
+ import { t as d } from "./stroke-dash-UgMEcCS4.js";
5
+ import { s as f } from "./coloring-C16AUZEi.js";
6
+ var p = /* @__PURE__ */ e(o()), m = (e) => e === i.Line || e === i.Elbow, h = {
7
+ shape: i.Square,
8
+ backgroundColor: { code: "#c4c4c4" },
9
+ backgroundType: "color",
10
+ lineThickness: 2,
11
+ borderEnabled: !1,
12
+ borderRadiusX: 0,
13
+ borderRadiusY: 0,
14
+ preserveAspectRatio: !0,
15
+ strokeColor: { code: "#8d8d8d" },
16
+ imageFit: n.Fill,
17
+ strokeDash: null,
18
+ imageURL: null,
19
+ scale: 1,
20
+ rotate: 0,
21
+ heightBasedSize: !1
22
+ }, g = (e, t) => {
23
+ let n = { ...e?.shapeSettings }, a = 0, o = 0, s = n?.borderEnabled ?? h.borderEnabled;
24
+ (n?.shape === i.Square || n?.shape === i.Rectangle) && n?.borderRadius && (a = n?.borderRadius, o = a, n?.preserveAspectRatio || (t?.width > t?.height ? o = (t?.width || 1) / (t?.height || 1) * o : a = (t?.height || 1) / (t?.width || 1) * a)), m(n?.shape) && (n.backgroundColor = { code: "none" }, s = !0);
25
+ let c = n?.rotate ?? h.rotate;
26
+ n?.shape === i.Line && n?.heightBasedSize && (c += 90);
27
+ let l = n?.borderStyle === r.Line ? void 0 : n?.strokeDash ?? h.strokeDash;
28
+ return {
29
+ backgroundType: n?.backgroundType ?? "color",
30
+ shape: n?.shape ?? h.shape,
31
+ backgroundColor: n?.backgroundColor?.code ? n?.backgroundColor : h.backgroundColor,
32
+ imageURL: n?.imageURL ?? h.imageURL,
33
+ imageFit: n?.imageFit ?? h.imageFit,
34
+ strokeDash: l,
35
+ lineThickness: n?.lineThickness ?? h.lineThickness,
36
+ borderEnabled: s,
37
+ strokeColor: n?.strokeColor?.code ? n?.strokeColor : h.strokeColor,
38
+ preserveAspectRatio: n?.preserveAspectRatio ?? h.preserveAspectRatio,
39
+ scale: n?.scale ?? h.scale,
40
+ rotate: c,
41
+ heightBasedSize: n?.heightBasedSize ?? h.heightBasedSize,
42
+ borderRadiusX: a,
43
+ borderRadiusY: o
44
+ };
45
+ }, _ = u(), v = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
46
+ d: "M0,50 L70,40 L70,20 L100,50 L70,80 L70,60 Z",
47
+ vectorEffect: "non-scaling-stroke",
48
+ ...e
49
+ }), y = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("circle", {
50
+ cx: "50",
51
+ cy: "50",
52
+ r: "49.5",
53
+ strokeWidth: "{0.02em}",
54
+ vectorEffect: "non-scaling-stroke",
55
+ ...e
56
+ }), b = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
57
+ d: "M0,0L100, 0L100, 100",
58
+ vectorEffect: "non-scaling-stroke",
59
+ ...e
60
+ }), x = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("path", {
61
+ d: "M50,7.2857421875 l38.7369140625,21.4685546875 v42.4912109375 L50,92.7142578125 L11.2630859375,71.245703125 V28.754296875 L50,7.2857421875 M50,0z",
62
+ vectorEffect: "non-scaling-stroke",
63
+ ...e
64
+ }), S = ({ heightBasedSize: e, ...t }) => e ? /* @__PURE__ */ (0, _.jsx)("path", {
65
+ d: "M50,0L50, 100",
66
+ vectorEffect: "non-scaling-stroke",
67
+ ...t
68
+ }) : /* @__PURE__ */ (0, _.jsx)("path", {
69
+ d: "M0,50L100, 50",
70
+ vectorEffect: "non-scaling-stroke",
71
+ ...t
72
+ }), C = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("rect", {
73
+ x: "0",
74
+ y: "0",
75
+ width: "100",
76
+ height: "100",
77
+ strokeWidth: "{0.02em}",
78
+ vectorEffect: "non-scaling-stroke",
79
+ ...e
80
+ }), w = ({ ...e }) => /* @__PURE__ */ (0, _.jsx)("polygon", {
81
+ points: "50,0 93.3,75 6.7,75",
82
+ vectorEffect: "non-scaling-stroke",
83
+ ...e
84
+ }), T = (e) => {
85
+ switch (e) {
86
+ case i.Circle: return y;
87
+ case i.Rectangle:
88
+ case i.Square: return C;
89
+ case i.Triangle: return w;
90
+ case i.Hexagon: return x;
91
+ case i.Line: return S;
92
+ case i.Arrow: return v;
93
+ case i.Elbow: return b;
94
+ default: return C;
95
+ }
96
+ }, E = a({
97
+ mainContainer: {
98
+ width: "100%",
99
+ height: "100%",
100
+ display: "flex",
101
+ lineHeight: 1,
102
+ overflow: "hidden"
103
+ },
104
+ svg: {
105
+ width: "100%",
106
+ height: "100%",
107
+ transition: "ease-in-out 300ms"
108
+ },
109
+ shapeGroup: {
110
+ width: "100%",
111
+ height: "100%",
112
+ transition: "ease-in-out 300ms"
113
+ }
114
+ }), D = ({ patternId: e, imgUrl: t, onLoadCallback: r, imageFit: i = n.Fill }) => /* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("pattern", {
115
+ id: e,
116
+ viewBox: "0 0 1 1",
117
+ patternUnits: "objectBoundingBox",
118
+ width: "100%",
119
+ height: "100%",
120
+ preserveAspectRatio: i,
121
+ children: /* @__PURE__ */ (0, _.jsx)("image", {
122
+ xlinkHref: t,
123
+ x: "0",
124
+ y: "0",
125
+ width: "1",
126
+ height: "1",
127
+ preserveAspectRatio: i,
128
+ onLoad: r,
129
+ onError: r
130
+ })
131
+ }) }), O = c(({ vSpec: e, vTheme: n, elementSize: r }) => {
132
+ let a = n || t, o = g(e, r), c = E(), u = l(), h = T(o.shape), v = `${s()}-background-image-fill`, y = `${s()}-insideStroke`, b = f(a, o.backgroundColor?.code), x = f(a, o.strokeColor?.code), S = d(o.strokeDash), C = o.shape === i.Line ? o.lineThickness / 2 : o.lineThickness;
133
+ return (0, p.useEffect)(() => {
134
+ (!o.imageURL || o.backgroundType === "color") && u();
135
+ }, []), /* @__PURE__ */ (0, _.jsx)("div", {
136
+ className: c.mainContainer,
137
+ "data-testid": "shape-container",
138
+ children: /* @__PURE__ */ (0, _.jsxs)("svg", {
139
+ viewBox: "0 0 100 100",
140
+ className: c.svg,
141
+ style: { transform: `rotate(${o.rotate ?? 0}deg) scale(${o.scale ?? 1})` },
142
+ preserveAspectRatio: o.preserveAspectRatio ? "" : "none",
143
+ children: [
144
+ o.backgroundType === "image" ? /* @__PURE__ */ (0, _.jsx)(D, {
145
+ patternId: v,
146
+ imgUrl: o.imageURL,
147
+ imageFit: o.imageFit,
148
+ onLoadCallback: () => u()
149
+ }) : null,
150
+ /* @__PURE__ */ (0, _.jsx)("defs", { children: /* @__PURE__ */ (0, _.jsx)("clipPath", {
151
+ id: y,
152
+ className: c.shapeGroup,
153
+ style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
154
+ children: /* @__PURE__ */ (0, _.jsx)(h, {
155
+ rx: `${o.borderRadiusX ?? 0}px`,
156
+ ry: `${o.borderRadiusY ?? 0}px`
157
+ })
158
+ }) }),
159
+ /* @__PURE__ */ (0, _.jsx)("g", {
160
+ className: c.shapeGroup,
161
+ style: { opacity: o.opacity === void 0 ? 1 : o.opacity },
162
+ fill: o.imageURL && o.backgroundType === "image" ? `url(#${v})` : b,
163
+ stroke: x,
164
+ strokeWidth: `${o.borderEnabled ? C : 0}px`,
165
+ strokeDasharray: S,
166
+ children: /* @__PURE__ */ (0, _.jsx)("g", {
167
+ clipPath: m(o.shape) ? void 0 : `url(#${y})`,
168
+ children: /* @__PURE__ */ (0, _.jsx)(h, {
169
+ rx: `${o.borderRadiusX ?? 0}px`,
170
+ ry: `${o.borderRadiusY ?? 0}px`,
171
+ ...o.shape === i.Line ? { heightBasedSize: o.heightBasedSize } : {}
172
+ })
173
+ })
174
+ })
175
+ ]
176
+ })
177
+ });
178
+ });
179
+ export { O as Shape };
@@ -0,0 +1,68 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Pn as t, vr as n } from "./interfaces-VUY4_yVO.js";
3
+ import { G as r, Ki as i, d as a, wi as o, xn as s } from "./utils-Ba9T0TqC.js";
4
+ var c = /* @__PURE__ */ e(i()), l = r({
5
+ iframeWrapper: {
6
+ width: "100%",
7
+ height: "100%",
8
+ display: "flex",
9
+ justifyContent: "center",
10
+ alignItems: "center",
11
+ position: "relative"
12
+ },
13
+ overlay: {
14
+ position: "absolute",
15
+ top: 0,
16
+ left: 0,
17
+ width: "100%",
18
+ height: "100%",
19
+ backgroundColor: "transparent",
20
+ pointerEvents: "all",
21
+ zIndex: 1
22
+ },
23
+ emptyState: {
24
+ width: "100%",
25
+ height: "100%"
26
+ }
27
+ }), u = o(), d = n(), f = ({ vSpec: e = d }) => {
28
+ let n = t(e.iframeSettings.url, null), r = a(), i = l(), o = s();
29
+ if ((0, c.useEffect)(() => {
30
+ r();
31
+ }, []), !n) return /* @__PURE__ */ (0, u.jsx)("div", {
32
+ className: i.emptyState,
33
+ "data-testid": "iframe-empty-container"
34
+ });
35
+ let f = "\n allow-scripts\n allow-forms\n allow-same-origin\n allow-popups\n allow-popups-to-escape-sandbox\n allow-modals\n allow-downloads\n ", p = "\n autoplay\n clipboard-write\n clipboard-read\n ";
36
+ return o.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, u.jsxs)("div", {
37
+ className: i.iframeWrapper,
38
+ "data-testid": "iframe-container",
39
+ children: [/* @__PURE__ */ (0, u.jsx)("iframe", {
40
+ src: n,
41
+ width: "100%",
42
+ height: "100%",
43
+ style: { border: "none" },
44
+ sandbox: f,
45
+ allow: p,
46
+ loading: "lazy",
47
+ referrerPolicy: "no-referrer-when-downgrade",
48
+ "data-testid": "iframe-content"
49
+ }), /* @__PURE__ */ (0, u.jsx)("div", {
50
+ className: i.overlay,
51
+ "data-testid": "iframe-overlay"
52
+ })]
53
+ }) : /* @__PURE__ */ (0, u.jsx)("div", {
54
+ className: i.iframeWrapper,
55
+ "data-testid": "iframe-container",
56
+ children: /* @__PURE__ */ (0, u.jsx)("iframe", {
57
+ src: n,
58
+ width: "100%",
59
+ height: "100%",
60
+ style: { border: "none" },
61
+ sandbox: f,
62
+ allow: p,
63
+ loading: "lazy",
64
+ referrerPolicy: "no-referrer-when-downgrade"
65
+ })
66
+ });
67
+ };
68
+ export { f as IframeObject };
@@ -0,0 +1,6 @@
1
+ function e(e) {
2
+ if (!e) return;
3
+ let { space: t = 0, width: n = 1 } = e;
4
+ return `${n}, ${t}`;
5
+ }
6
+ export { e as t };
@@ -0,0 +1,213 @@
1
+ import { Js as e, rs as t, tc as n } from "./interfaces-VUY4_yVO.js";
2
+ import { qu as r } from "./src-Dun_jXtz.js";
3
+ import { p as i } from "./src-C0LgoUWY.js";
4
+ import { A as a, C as o, d as s, g as c, h as l, i as u, o as d, p as f, s as p, t as m, u as h, v as g, w as _, x as v, y } from "./shared-CKDL4hx9.js";
5
+ import { a as b, r as x, t as S } from "./data-item-resolution-1lvYB5ln.js";
6
+ var C = {
7
+ all: t.ShowAll,
8
+ auto: t.Auto,
9
+ horizontal: t.ShowHorizontal,
10
+ none: t.NoBorders,
11
+ vertical: t.ShowVertical
12
+ }, w = (e) => e.flatMap(([e, t]) => t === void 0 ? [] : [{
13
+ name: e,
14
+ payload: t
15
+ }]), T = (e) => e ? w([
16
+ [i.SET_TABLE_COLUMN_WIDTH_BEHAVIOR, e.columnWidthBehavior],
17
+ [i.SET_TABLE_FIXED_ROW_HEIGHT_ENABLED, e.rowHeight !== void 0 || void 0],
18
+ [i.SET_TABLE_FIXED_ROW_HEIGHT_VALUE, e.rowHeight]
19
+ ]) : [], E = (e) => e ? w([
20
+ [i.SET_TABLE_BACKGROUND_TYPE, e.type],
21
+ [i.SET_TABLE_BACKGROUND_COLOR, e.color],
22
+ [i.SET_TABLE_ODD_BACKGROUND_COLOR, e.oddColor],
23
+ [i.SET_TABLE_EVEN_BACKGROUND_COLOR, e.evenColor]
24
+ ]) : [], D = (e) => e ? w([
25
+ [i.SET_TABLE_BODY_FONT_FAMILY, e.fontFamily],
26
+ [i.SET_TABLE_BODY_FONT_SIZE, e.fontSize],
27
+ [i.SET_TABLE_ALL_COLUMNS_FONT_COLOR, e.fontColor],
28
+ [i.SET_TABLE_ALL_COLUMNS_FONT_STYLE, e.fontStyle],
29
+ [i.SET_TABLE_ALL_COLUMNS_HORIZONTAL_ALIGN, e.horizontalAlign],
30
+ [i.SET_TABLE_ALL_COLUMNS_VERTICAL_ALIGN, e.verticalAlign]
31
+ ]) : [], O = (e) => e ? w([
32
+ [i.SET_TABLE_HEADER_BACKGROUND_COLOR, e.backgroundColor],
33
+ [i.SET_TABLE_HEADER_BORDER_COLOR, e.borderColor],
34
+ [i.SET_TABLE_HEADER_FONT_COLOR, e.fontColor],
35
+ [i.SET_TABLE_HEADER_FONT_FAMILY, e.fontFamily],
36
+ [i.SET_TABLE_HEADER_FONT_SIZE, e.fontSize],
37
+ [i.SET_TABLE_HEADER_FONT_STYLE, e.fontStyle],
38
+ [i.SET_TABLE_HEADER_RESPONSIVE_HEIGHT, e.responsiveHeight]
39
+ ]) : [], k = (e) => e ? w([
40
+ [i.SET_TABLE_BORDER_ENABLED, e.enabled],
41
+ [i.SET_TABLE_BORDER_COLOR, e.color],
42
+ [i.SET_TABLE_BORDER_LINE_STYLE, e.lineStyle],
43
+ [i.SET_TABLE_BORDER_RADIUS, e.radius],
44
+ [i.SET_TABLE_BORDER_STROKE_WIDTH, e.strokeWidth],
45
+ [i.SET_TABLE_COLUMN_BORDERS, e.dividers === void 0 ? void 0 : C[e.dividers]],
46
+ [i.SET_TABLE_COLUMN_BORDER_COLOR, e.dividerColor]
47
+ ]) : [], A = (e) => e ? w([
48
+ [i.SET_TABLE_HIGHLIGHT_MODE, e.mode],
49
+ [i.SET_TABLE_HIGHLIGHT_BACKGROUND_COLOR, e.backgroundColor],
50
+ [i.SET_TABLE_HIGHLIGHT_TEXT_COLOR, e.textColor]
51
+ ]) : [], j = (e) => e ? [
52
+ ...T(e.layout),
53
+ ...E(e.background),
54
+ ...D(e.body),
55
+ ...O(e.header),
56
+ ...k(e.borders),
57
+ ...A(e.highlight)
58
+ ] : [], M = (e) => e ? w([
59
+ [i.SET_TABLE_TOTALS_ENABLED, e.enabled],
60
+ [i.SET_TABLE_TOTALS_SHOW_RECORDS_COUNT, e.showRecordsCount],
61
+ [i.SET_TABLE_TOTALS_APPLY_TO, e.applyTo],
62
+ [i.SET_TABLE_TOTALS_BACKGROUND_COLOR, e.style?.backgroundColor],
63
+ [i.SET_TABLE_TOTALS_FONT_COLOR, e.style?.fontColor],
64
+ [i.SET_TABLE_TOTALS_FONT_STYLE, e.style?.fontStyle],
65
+ [i.SET_TABLE_TOTALS_POSITION, e.style?.position],
66
+ [i.SET_TABLE_TOTALS_RESPONSIVE_HEIGHT, e.style?.responsiveHeight]
67
+ ]) : [], N = (e, t) => l(e, t.flatMap((t) => t.role !== "dimension" || t.showNullValues === void 0 ? [] : [{
68
+ name: i.SET_COLUMN_SHOW_NULL_VALUES,
69
+ payload: {
70
+ ...y(e.resolvedRefs[t.ref]),
71
+ showNullValues: t.showNullValues
72
+ }
73
+ }]), ["data"]), P = (e, t, n, r = !1) => ({
74
+ ...e,
75
+ path: n,
76
+ role: t,
77
+ topDimension: r
78
+ }), F = (e) => "columns" in e ? [{
79
+ items: e.columns.map((e, t) => P(e, e.role, [
80
+ "data",
81
+ "columns",
82
+ t
83
+ ])),
84
+ path: ["data", "columns"]
85
+ }] : e.structure === "expandable" ? [{
86
+ items: e.dimensions.map((e, t) => P(e, "dimension", [
87
+ "data",
88
+ "dimensions",
89
+ t
90
+ ])),
91
+ path: ["data", "dimensions"]
92
+ }, {
93
+ items: e.measures.map((e, t) => P(e, "measure", [
94
+ "data",
95
+ "measures",
96
+ t
97
+ ])),
98
+ path: ["data", "measures"]
99
+ }] : [
100
+ {
101
+ items: e.rowDimensions.map((e, t) => P(e, "dimension", [
102
+ "data",
103
+ "rowDimensions",
104
+ t
105
+ ])),
106
+ path: ["data", "rowDimensions"]
107
+ },
108
+ {
109
+ items: e.columnDimensions.map((e, t) => P(e, "dimension", [
110
+ "data",
111
+ "columnDimensions",
112
+ t
113
+ ], !0)),
114
+ path: ["data", "columnDimensions"]
115
+ },
116
+ {
117
+ items: e.measures.map((e, t) => P(e, "measure", [
118
+ "data",
119
+ "measures",
120
+ t
121
+ ])),
122
+ path: ["data", "measures"]
123
+ }
124
+ ], I = (t) => {
125
+ if (!(!("structure" in t) || t.structure === void 0)) switch (t.structure) {
126
+ case "normal": return e.Normal;
127
+ case "expandable": return e.Hierarchical;
128
+ case "pivot": return e.Pivot;
129
+ }
130
+ }, L = (e, t, r) => {
131
+ let i = [
132
+ "formatType",
133
+ "formatString",
134
+ "currency",
135
+ "currencyIsPrefix",
136
+ "negativeType"
137
+ ];
138
+ return l(e, t.flatMap((t) => {
139
+ let a = e.availableFields.find((e) => e.key === t.fieldKey), o = a ? n(a) : t.fieldKey;
140
+ return i.flatMap((e) => {
141
+ let n = t.format?.[e], i = r[e];
142
+ return n !== void 0 && i ? [f(i, o, t.ref, t.path, e, n, t.role)] : [];
143
+ });
144
+ }), ["data"]);
145
+ }, R = async (e) => {
146
+ let t = a.safeParse(e.definition);
147
+ if (!t.success) return {
148
+ issues: _(t.error, e.definition),
149
+ success: !1
150
+ };
151
+ let n = r.safeParse(e.baseVSpec);
152
+ if (!n.success) return {
153
+ issues: [s("invalid_structure", ["baseVSpec"], "Base table vSpec is invalid.", { details: { issues: n.error.issues } })],
154
+ success: !1
155
+ };
156
+ let f = n.data;
157
+ if (!g(f, [
158
+ "columns",
159
+ "dimensions",
160
+ "measures",
161
+ "supportingMeasures",
162
+ "sortingMeasures"
163
+ ])) return {
164
+ issues: [s("non_fresh_base_vspec", ["baseVSpec"], "Table definitions require a fresh base vSpec.")],
165
+ success: !1
166
+ };
167
+ let y = t.data, C = F(y.data), w = C.flatMap((e) => e.items), T = [
168
+ ...w.flatMap((t) => x(t, e.availableFields, t.path, t.role)),
169
+ ...o(C),
170
+ ...b(y.filterGroup, e.availableFields),
171
+ ...v(y.sorting, w.map((e) => e.ref))
172
+ ];
173
+ if (T.length) return {
174
+ issues: T,
175
+ success: !1
176
+ };
177
+ let E = {
178
+ state: h(e, f),
179
+ success: !0
180
+ }, D = I(y.data);
181
+ D !== void 0 && (E = await l(E.state, [{
182
+ name: i.SET_TABLE_DATA_STRUCTURE,
183
+ payload: D
184
+ }], ["data", "structure"]));
185
+ for (let t of w) {
186
+ if ("issue" in E) return {
187
+ issues: [E.issue],
188
+ success: !1
189
+ };
190
+ E = await m(E.state, t, t.role, i.ADD_COLUMN, t.role === "measure" ? S(t, e.availableFields, { columnType: t.role }) : {
191
+ columnType: t.role,
192
+ key: t.fieldKey,
193
+ topDimension: t.topDimension
194
+ }, t.path);
195
+ }
196
+ return "issue" in E || (E = await N(E.state, w), "issue" in E) || (E = await p(E.state, w.filter((e) => e.role === "dimension"), i.SET_COLUMN_TEMPORAL_GROUPING, ["data"]), "issue" in E) || (E = await L(E.state, w, {
197
+ currency: i.SET_COLUMN_CURRENCY,
198
+ currencyIsPrefix: i.SET_COLUMN_CURRENCY_IS_PREFIX,
199
+ formatString: i.SET_COLUMN_FORMAT_STRING,
200
+ formatType: i.SET_COLUMN_FORMAT_TYPE,
201
+ negativeType: i.SET_COLUMN_NEGATIVE_TYPE
202
+ }), "issue" in E) || (E = await l(E.state, j(y.presentation), ["presentation"]), "issue" in E) || (E = await u(E.state, y.filterGroup), "issue" in E) || (E = await d(E.state, y.sorting, i.CHANGE_SORT_ORDER_AND_DIRECTION, i.TOGGLE_SORTING_ITEM), "issue" in E) || (E = await l(E.state, y.limiting?.queryLimit === void 0 ? [] : [{
203
+ name: i.SET_QUERY_LIMIT,
204
+ payload: y.limiting.queryLimit
205
+ }], ["limiting"]), "issue" in E) ? {
206
+ issues: [E.issue],
207
+ success: !1
208
+ } : (E = await l(E.state, M(y.totals), ["totals"]), "issue" in E ? {
209
+ issues: [E.issue],
210
+ success: !1
211
+ } : c(E.state, r));
212
+ };
213
+ export { R as compileTableVisualizationDefinition };
@@ -0,0 +1,11 @@
1
+ import { t as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { i as t } from "./coloring-C16AUZEi.js";
3
+ var n = /* @__PURE__ */ e(((e, n) => {
4
+ var r = t();
5
+ function i(e) {
6
+ var t = r(e), n = t % 1;
7
+ return t === t ? n ? t - n : t : 0;
8
+ }
9
+ n.exports = i;
10
+ }));
11
+ export { n as t };
@@ -0,0 +1,23 @@
1
+ var e = "rgba(150, 150, 150, 0.3)", t = {
2
+ cellPaddingMin: 0,
3
+ cellPaddingMax: 16,
4
+ cellRadiusMin: 0,
5
+ cellRadiusMax: 16,
6
+ headerNumLevelsMin: 0,
7
+ headerNumLevelsMax: 5,
8
+ labelFontSizeMin: 6,
9
+ labelFontSizeMax: 50
10
+ }, n = { labeling: {
11
+ header: {
12
+ show: !0,
13
+ numLevels: 1,
14
+ showDimensionValue: !0,
15
+ showMeasureValue: !1
16
+ },
17
+ leaf: {
18
+ show: !0,
19
+ showDimensionValue: !0,
20
+ showMeasureValue: !0
21
+ }
22
+ } };
23
+ export { t as n, n as r, e as t };
@@ -0,0 +1,13 @@
1
+ import { t as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ var t = /* @__PURE__ */ e(((e, t) => {
3
+ function n(e) {
4
+ "@babel/helpers - typeof";
5
+ return t.exports = n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
6
+ return typeof e;
7
+ } : function(e) {
8
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
9
+ }, t.exports.__esModule = !0, t.exports.default = t.exports, n(e);
10
+ }
11
+ t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
12
+ }));
13
+ export { t };
@@ -0,0 +1,4 @@
1
+ var e = /* @__PURE__ */ function(e) {
2
+ return e.Stacked = "stacked", e.Groups = "groups", e.Offset = "offset", e.Bars = "bars", e;
3
+ }({});
4
+ export { e as t };