@astrato-io/visualizations 0.10.1 → 0.12.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.
Files changed (143) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +148 -5
  3. package/THIRD_PARTY_NOTICES.md +494 -0
  4. package/VISUALIZATION_DEFINITIONS.md +9 -146
  5. package/chunks/{Button-Dn3rJrYf.js → Button-CQdoKSXX.js} +3 -3
  6. package/chunks/{CircularProgress-BFeu06Yb.js → CircularProgress-DpT1lwWw.js} +20 -20
  7. package/chunks/FieldTypeIcon-Cg4F9Q5D.js +22 -0
  8. package/chunks/{LinearProgress-ClO6GUjN.js → LinearProgress-B7S0Q26A.js} +14 -14
  9. package/chunks/{MenuOption-Czc34u4q.js → MenuOption-DpKFJxmo.js} +167 -167
  10. package/chunks/{Title-BgYnaVTR.js → Title-m5damhc0.js} +37 -37
  11. package/chunks/{_createAggregator-BMu9uRax.js → _createAggregator-BA8_iU9q.js} +17 -17
  12. package/chunks/{app-filter-bar.compiler-CVir0wkl.js → app-filter-bar.compiler--T4Qz3Wu.js} +8 -8
  13. package/chunks/{bar-layout-C_UgRlVl.js → bar-layout-OFhxn2Go.js} +2 -2
  14. package/chunks/{bar.compiler-DYuFdi9J.js → bar.compiler-hWZBYYvV.js} +71 -69
  15. package/chunks/{builder-C-TKA-My.js → builder-7w_bgV_h.js} +106 -55
  16. package/chunks/{coloring-BtnPiQ_o.js → coloring-Cd6p0GQJ.js} +93 -88
  17. package/chunks/{createSimplePaletteValueFilter--zrZxRV9.js → createSimplePaletteValueFilter-CiJT8s1s.js} +169 -169
  18. package/chunks/defaults-CMFqXvaJ.js +3 -0
  19. package/chunks/{definitions-CT304NDn.js → definitions-DTauTjIX.js} +399 -398
  20. package/chunks/{escobar-CvEV2ES1.js → escobar-CMvphKSK.js} +4949 -4879
  21. package/chunks/{extend-preset-D9-JP92b.js → extend-preset-BpXttHFk.js} +449 -450
  22. package/chunks/{filter.compiler-CXeZznks.js → filter.compiler-DOGFweJz.js} +10 -10
  23. package/chunks/{filtering-8_bFv-jb.js → filtering-NOnDcGbo.js} +241 -241
  24. package/chunks/handlers-CyYFSfhM.js +15393 -0
  25. package/chunks/{icon-picker-styles-BXiJ1SZS.js → icon-picker-styles-DuSERhBU.js} +8 -8
  26. package/chunks/{isEqual-D8Ay63xR.js → isEqual-4f8yUUtC.js} +1 -1
  27. package/chunks/{isFocusVisible-Bu8gGZu5.js → isFocusVisible-Czm70MGc.js} +9 -9
  28. package/chunks/line.compiler-B-4H55_T.js +203 -0
  29. package/chunks/linear-Bq_r9l5S.js +264 -0
  30. package/chunks/{logger-DdZpR7xZ.js → logger-Cioob-QV.js} +74 -73
  31. package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
  32. package/chunks/{map.compiler-Q_Y1Pvat.js → map.compiler-Cv5V6EhF.js} +40 -40
  33. package/chunks/measure-axis-label-format-COy8U_dd.js +27 -0
  34. package/chunks/measure-format-default-B_kuGSzi.js +26 -0
  35. package/chunks/{metadata-BQm_TXI1.js → metadata-dGSe5UWy.js} +5 -5
  36. package/chunks/number.compiler-D7nMcEMv.js +57 -0
  37. package/chunks/{operations-DKQWuLL7.js → operations-CgfehCad.js} +11397 -11114
  38. package/chunks/{range-BdhzvYQ_.js → range-Dmwp9kVB.js} +2 -2
  39. package/chunks/{react-dom-BGP4tbXV.js → react-dom-CfuL-m78.js} +82 -82
  40. package/chunks/{render-wrappers-BZpyDnJy.js → render-wrappers--g-zPFBW.js} +1 -1
  41. package/chunks/{requirements-e8Fe96ag.js → requirements-DHayNJ2C.js} +245 -221
  42. package/chunks/{shared-C_2F90xq.js → shared-DoEN9nNM.js} +505 -494
  43. package/chunks/standalone-B3hRGgYi.js +773 -0
  44. package/chunks/{standalone-BkbiH-o8.js → standalone-BPNXgFft.js} +498 -759
  45. package/chunks/standalone-BPTT8XEu.js +424 -0
  46. package/chunks/standalone-BgAeHROc.js +2 -0
  47. package/chunks/{standalone-BE_ONgiG.js → standalone-BkQxag7M.js} +102 -102
  48. package/chunks/{standalone-Cc98Pdr6.js → standalone-Bxa3x6dg.js} +872 -872
  49. package/chunks/standalone-C0If-V6O.js +773 -0
  50. package/chunks/standalone-C1TOyflX.js +287 -0
  51. package/chunks/{standalone-CY_kjarf.js → standalone-CE5PwJN0.js} +18 -18
  52. package/chunks/{standalone-B8ZSqauS.js → standalone-CG7IFN6n.js} +120 -120
  53. package/chunks/{standalone-wOWRCpdn.js → standalone-CKlgGu80.js} +49 -49
  54. package/chunks/standalone-CNf-oA2U.js +355 -0
  55. package/chunks/{standalone-BDrXVxlP.js → standalone-CXPdWFlw.js} +14 -14
  56. package/chunks/{standalone-z0o52o5t.js → standalone-Cf0_5tbu.js} +5567 -5568
  57. package/chunks/{standalone-Cl0TSfqC.js → standalone-DMi4-Vp3.js} +122 -122
  58. package/chunks/{standalone-DNh9NcMa.js → standalone-DTEX67C8.js} +154 -154
  59. package/chunks/{standalone-DHRalbVO.js → standalone-DU46-kYv.js} +279 -279
  60. package/chunks/standalone-Dbn3jSH6.js +690 -0
  61. package/chunks/{standalone-CsoMmE9T.js → standalone-DdcAL_k_.js} +839 -843
  62. package/chunks/standalone-DwCIA0UG.js +1057 -0
  63. package/chunks/standalone-Dz13tl3P.js +357 -0
  64. package/chunks/standalone-H9GFzFk_.js +8377 -0
  65. package/chunks/{standalone-CaTxAydz.js → standalone-MduR0qre.js} +2227 -1000
  66. package/chunks/standalone-ejTz66P3.js +2 -0
  67. package/chunks/{standalone-DflyWtuR.js → standalone-keB-0wK3.js} +216 -216
  68. package/chunks/{standalone-BTY3w_JA.js → standalone-nnkuQd0K.js} +28 -28
  69. package/chunks/standalone-vGGR6Vcn.js +6 -0
  70. package/chunks/{table.compiler-COaHE9VD.js → table.compiler-mS4UvhLT.js} +31 -31
  71. package/chunks/theme-MYp6Rj1J.js +232 -0
  72. package/chunks/{useFieldName-CdnCWzhd.js → useFieldName-AdSak4Ch.js} +1 -1
  73. package/chunks/{utils-DganVptf.js → utils-CUKgR7it.js} +4216 -4070
  74. package/chunks/{view-Bzlros43.js → view-BeYwpcVD.js} +1561 -1561
  75. package/chunks/{visualization-filters-D7i6oh1Z.js → visualization-filters-B9qik5_K.js} +2683 -2342
  76. package/chunks/{with-html-element-CiIhFEa5.js → with-html-element-1GSeLT59.js} +3712 -3682
  77. package/definitions.js +2 -2
  78. package/docs/operations/astrato-app-filter-bar.md +1 -1
  79. package/docs/operations/bar.md +144 -32
  80. package/docs/operations/combo.md +79 -17
  81. package/docs/operations/date-picker.md +4 -4
  82. package/docs/operations/distribution-gauge.md +18 -16
  83. package/docs/operations/dot.md +107 -24
  84. package/docs/operations/filter.md +10 -8
  85. package/docs/operations/gauge.md +20 -18
  86. package/docs/operations/heatMap.md +73 -21
  87. package/docs/operations/histogram.md +45 -12
  88. package/docs/operations/iframe.md +1 -1
  89. package/docs/operations/image.md +1 -1
  90. package/docs/operations/index.md +12 -11
  91. package/docs/operations/line.md +86 -24
  92. package/docs/operations/map.md +5274 -0
  93. package/docs/operations/number.md +10 -9
  94. package/docs/operations/pie.md +23 -21
  95. package/docs/operations/radar.md +13 -11
  96. package/docs/operations/sankey.md +19 -17
  97. package/docs/operations/scatter.md +111 -28
  98. package/docs/operations/shape.md +5 -5
  99. package/docs/operations/simpleTextObject.md +4 -4
  100. package/docs/operations/slider.md +1 -1
  101. package/docs/operations/table.md +27 -25
  102. package/docs/operations/tree.md +5 -3
  103. package/docs/operations/treemap.md +70 -18
  104. package/docs/operations/waterfall.md +40 -7
  105. package/docs/operations/word-cloud.md +69 -17
  106. package/getters.js +3 -3
  107. package/index.js +585 -612
  108. package/metadata.js +2 -2
  109. package/operations.js +25 -18
  110. package/package.json +74 -70
  111. package/src/definitions/index.d.ts +1 -7
  112. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +3 -48
  113. package/src/definitions/model/definitions/schema-registry.d.ts +15 -14
  114. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +3 -3
  115. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
  116. package/src/definitions/model/definitions/schemas/common.schema.d.ts +19 -6
  117. package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
  118. package/src/definitions/model/definitions/schemas/line.schema.d.ts +4 -3
  119. package/src/definitions/model/definitions/schemas/number.schema.d.ts +1 -1
  120. package/src/definitions/model/definitions/schemas/table.schema.d.ts +14 -14
  121. package/src/index.d.ts +1 -1
  122. package/src/operations/index.d.ts +11 -1
  123. package/src/types.d.ts +166 -1
  124. package/src/visualization-catalog.d.ts +3 -0
  125. package/styles.css +1 -1
  126. package/chunks/FieldTypeIcon-DrMoGpHJ.js +0 -22
  127. package/chunks/color-rules-DYJL4fIW.js +0 -15
  128. package/chunks/color-settings-DJFoFTip.js +0 -5
  129. package/chunks/defaults-Dtk7fg3C.js +0 -3
  130. package/chunks/handlers-C6CZ0XJA.js +0 -15399
  131. package/chunks/line.compiler-DmHpmQCC.js +0 -198
  132. package/chunks/number.compiler-DQdg6zTy.js +0 -53
  133. package/chunks/standalone-4MsKiqs0.js +0 -355
  134. package/chunks/standalone-B794g9pE.js +0 -1012
  135. package/chunks/standalone-BA2YXyJS.js +0 -422
  136. package/chunks/standalone-BgumbdaJ2.js +0 -357
  137. package/chunks/standalone-Blh4qejk.js +0 -689
  138. package/chunks/standalone-CXY4FpF7.js +0 -773
  139. package/chunks/standalone-DH0xTEes.js +0 -2
  140. package/chunks/standalone-DcnHjNnC.js +0 -2
  141. package/chunks/standalone-DrHdGkY7.js +0 -762
  142. package/chunks/standalone-c_rROMtx.js +0 -287
  143. package/chunks/standalone-drcFLeN6.js +0 -6
@@ -1,9 +1,9 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { ao as t, es as n, io as r, lc as i, sa as a } from "./visualization-filters-D7i6oh1Z.js";
3
- import { U as o, W as s, ci as c, f as l, jt as u, zr as d } from "./utils-DganVptf.js";
2
+ import { Fo as t, Ms as n, Po as r, Sa as i, Uc as a } from "./visualization-filters-B9qik5_K.js";
3
+ import { G as o, Mt as s, Ur as c, W as l, f as u, fi as d } from "./utils-CUKgR7it.js";
4
4
  import { t as f } from "./stroke-dash-UgMEcCS4.js";
5
- import { s as p } from "./coloring-BtnPiQ_o.js";
6
- var m = /* @__PURE__ */ e(c()), h = (e) => e === t.Line || e === t.Elbow, g = {
5
+ import { c as p } from "./coloring-Cd6p0GQJ.js";
6
+ var m = /* @__PURE__ */ e(d()), h = (e) => e === t.Line || e === t.Elbow, g = {
7
7
  shape: t.Square,
8
8
  backgroundColor: { code: "#c4c4c4" },
9
9
  backgroundType: "color",
@@ -42,7 +42,7 @@ var m = /* @__PURE__ */ e(c()), h = (e) => e === t.Line || e === t.Elbow, g = {
42
42
  borderRadiusX: a,
43
43
  borderRadiusY: o
44
44
  };
45
- }, v = d(), y = ({ ...e }) => /* @__PURE__ */ (0, v.jsx)("path", {
45
+ }, v = c(), y = ({ ...e }) => /* @__PURE__ */ (0, v.jsx)("path", {
46
46
  d: "M0,50 L70,40 L70,20 L100,50 L70,80 L70,60 Z",
47
47
  vectorEffect: "non-scaling-stroke",
48
48
  ...e
@@ -93,7 +93,7 @@ var m = /* @__PURE__ */ e(c()), h = (e) => e === t.Line || e === t.Elbow, g = {
93
93
  case t.Elbow: return x;
94
94
  default: return w;
95
95
  }
96
- }, D = s({
96
+ }, D = o({
97
97
  mainContainer: {
98
98
  width: "100%",
99
99
  height: "100%",
@@ -128,47 +128,47 @@ var m = /* @__PURE__ */ e(c()), h = (e) => e === t.Line || e === t.Elbow, g = {
128
128
  onLoad: n,
129
129
  onError: n
130
130
  })
131
- }) }), k = u(({ vSpec: e, vTheme: n, elementSize: r }) => {
132
- let s = n || a, c = _(e && i(e) ? e : void 0, r), u = D(), d = l(), y = E(c.shape), b = `${o()}-background-image-fill`, x = `${o()}-insideStroke`, S = p(s, c.backgroundColor?.code), C = p(s, c.strokeColor?.code), w = f(c.strokeDash), T = c.lineThickness ?? g.lineThickness, k = c.shape === t.Line ? T / 2 : T;
131
+ }) }), k = s(({ vSpec: e, vTheme: n, elementSize: r }) => {
132
+ let o = n || i, s = _(e && a(e) ? e : void 0, r), c = D(), d = u(), y = E(s.shape), b = `${l()}-background-image-fill`, x = `${l()}-insideStroke`, S = p(o, s.backgroundColor?.code), C = p(o, s.strokeColor?.code), w = f(s.strokeDash), T = s.lineThickness ?? g.lineThickness, k = s.shape === t.Line ? T / 2 : T;
133
133
  return (0, m.useEffect)(() => {
134
- (!c.imageURL || c.backgroundType === "color") && d();
134
+ (!s.imageURL || s.backgroundType === "color") && d();
135
135
  }, []), /* @__PURE__ */ (0, v.jsx)("div", {
136
- className: u.mainContainer,
136
+ className: c.mainContainer,
137
137
  "data-testid": "shape-container",
138
138
  children: /* @__PURE__ */ (0, v.jsxs)("svg", {
139
139
  viewBox: "0 0 100 100",
140
- className: u.svg,
141
- style: { transform: `rotate(${c.rotate ?? 0}deg) scale(${c.scale ?? 1})` },
142
- preserveAspectRatio: c.preserveAspectRatio ? "" : "none",
140
+ className: c.svg,
141
+ style: { transform: `rotate(${s.rotate ?? 0}deg) scale(${s.scale ?? 1})` },
142
+ preserveAspectRatio: s.preserveAspectRatio ? "" : "none",
143
143
  children: [
144
- c.backgroundType === "image" && c.imageURL !== void 0 ? /* @__PURE__ */ (0, v.jsx)(O, {
144
+ s.backgroundType === "image" && s.imageURL !== void 0 ? /* @__PURE__ */ (0, v.jsx)(O, {
145
145
  patternId: b,
146
- imgUrl: c.imageURL,
147
- imageFit: c.imageFit,
146
+ imgUrl: s.imageURL,
147
+ imageFit: s.imageFit,
148
148
  onLoadCallback: () => d()
149
149
  }) : null,
150
150
  /* @__PURE__ */ (0, v.jsx)("defs", { children: /* @__PURE__ */ (0, v.jsx)("clipPath", {
151
151
  id: x,
152
- className: u.shapeGroup,
153
- style: { opacity: c.opacity === void 0 ? 1 : c.opacity },
152
+ className: c.shapeGroup,
153
+ style: { opacity: s.opacity === void 0 ? 1 : s.opacity },
154
154
  children: /* @__PURE__ */ (0, v.jsx)(y, {
155
- rx: `${c.borderRadiusX ?? 0}px`,
156
- ry: `${c.borderRadiusY ?? 0}px`
155
+ rx: `${s.borderRadiusX ?? 0}px`,
156
+ ry: `${s.borderRadiusY ?? 0}px`
157
157
  })
158
158
  }) }),
159
159
  /* @__PURE__ */ (0, v.jsx)("g", {
160
- className: u.shapeGroup,
161
- style: { opacity: c.opacity === void 0 ? 1 : c.opacity },
162
- fill: c.imageURL && c.backgroundType === "image" ? `url(#${b})` : S,
160
+ className: c.shapeGroup,
161
+ style: { opacity: s.opacity === void 0 ? 1 : s.opacity },
162
+ fill: s.imageURL && s.backgroundType === "image" ? `url(#${b})` : S,
163
163
  stroke: C,
164
- strokeWidth: `${c.borderEnabled ? k : 0}px`,
164
+ strokeWidth: `${s.borderEnabled ? k : 0}px`,
165
165
  strokeDasharray: w,
166
166
  children: /* @__PURE__ */ (0, v.jsx)("g", {
167
- clipPath: h(c.shape) ? void 0 : `url(#${x})`,
167
+ clipPath: h(s.shape) ? void 0 : `url(#${x})`,
168
168
  children: /* @__PURE__ */ (0, v.jsx)(y, {
169
- rx: `${c.borderRadiusX ?? 0}px`,
170
- ry: `${c.borderRadiusY ?? 0}px`,
171
- ...c.shape === t.Line ? { heightBasedSize: c.heightBasedSize } : {}
169
+ rx: `${s.borderRadiusX ?? 0}px`,
170
+ ry: `${s.borderRadiusY ?? 0}px`,
171
+ ...s.shape === t.Line ? { heightBasedSize: s.heightBasedSize } : {}
172
172
  })
173
173
  })
174
174
  })
@@ -0,0 +1,6 @@
1
+ import "./rolldown-runtime-DleVn1XH.js";
2
+ import { Mt as e, Ur as t, fi as n } from "./utils-CUKgR7it.js";
3
+ import { n as r } from "./standalone-DwCIA0UG.js";
4
+ n();
5
+ var i = t(), a = e((e) => /* @__PURE__ */ (0, i.jsx)(r, { ...e }));
6
+ export { a as HistogramChart };
@@ -1,14 +1,14 @@
1
- import { _c as e, r as t, us as n, wc as r } from "./visualization-filters-D7i6oh1Z.js";
2
- import { A as i, C as a, E as o, O as s, P as c, T as l, d as u, g as d, h as f, i as p, o as m, p as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./shared-C_2F90xq.js";
3
- import { Qp as S, jp as C } from "./handlers-C6CZ0XJA.js";
4
- import { p as w } from "./operations-DKQWuLL7.js";
5
- t();
1
+ import { Hs as e, Zc as t, d as n, il as r } from "./visualization-filters-B9qik5_K.js";
2
+ import { C as i, D as a, F as o, T as s, d as c, g as l, h as u, i as d, j as f, k as p, o as m, p as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./shared-DoEN9nNM.js";
3
+ import { Fp as S, nm as C } from "./handlers-CyYFSfhM.js";
4
+ import { v as w } from "./operations-CgfehCad.js";
5
+ n();
6
6
  var T = {
7
- all: n.ShowAll,
8
- auto: n.Auto,
9
- horizontal: n.ShowHorizontal,
10
- none: n.NoBorders,
11
- vertical: n.ShowVertical
7
+ all: e.ShowAll,
8
+ auto: e.Auto,
9
+ horizontal: e.ShowHorizontal,
10
+ none: e.NoBorders,
11
+ vertical: e.ShowVertical
12
12
  }, E = (e) => e.flatMap(([e, t]) => t === void 0 ? [] : [{
13
13
  name: e,
14
14
  payload: t
@@ -115,13 +115,13 @@ var T = {
115
115
  ])),
116
116
  path: ["data", "measures"]
117
117
  }
118
- ], L = (t) => {
119
- if (!(!("structure" in t) || t.structure === void 0)) switch (t.structure) {
120
- case "normal": return e.Normal;
121
- case "expandable": return e.Hierarchical;
122
- case "pivot": return e.Pivot;
118
+ ], L = (e) => {
119
+ if (!(!("structure" in e) || e.structure === void 0)) switch (e.structure) {
120
+ case "normal": return t.Normal;
121
+ case "expandable": return t.Hierarchical;
122
+ case "pivot": return t.Pivot;
123
123
  }
124
- }, R = (e, t) => f(e, t.flatMap((t) => t.role !== "dimension" || t.showNullValues === void 0 ? [] : [{
124
+ }, R = (e, t) => u(e, t.flatMap((t) => t.role !== "dimension" || t.showNullValues === void 0 ? [] : [{
125
125
  name: w.SET_COLUMN_SHOW_NULL_VALUES,
126
126
  payload: {
127
127
  ...x(e.resolvedRefs[t.ref]),
@@ -135,7 +135,7 @@ var T = {
135
135
  "currencyIsPrefix",
136
136
  "negativeType"
137
137
  ];
138
- return f(e, t.flatMap((t) => {
138
+ return u(e, t.flatMap((t) => {
139
139
  let a = e.availableFields.find((e) => e.key === t.fieldKey), o = a ? r(a) : t.fieldKey;
140
140
  return i.flatMap((e) => {
141
141
  let r = t.format?.[e], i = n[e];
@@ -143,7 +143,7 @@ var T = {
143
143
  });
144
144
  }), ["data"]);
145
145
  }, B = async (e) => {
146
- let t = C(e);
146
+ let t = S(e);
147
147
  if (t) return {
148
148
  issues: [{
149
149
  code: "invalid_structure",
@@ -152,14 +152,14 @@ var T = {
152
152
  }],
153
153
  success: !1
154
154
  };
155
- let n = c.safeParse(e.definition);
155
+ let n = o.safeParse(e.definition);
156
156
  if (!n.success) return {
157
- issues: l(n.error, e.definition),
157
+ issues: s(n.error, e.definition),
158
158
  success: !1
159
159
  };
160
- let r = S.safeParse(e.baseVSpec);
160
+ let r = C.safeParse(e.baseVSpec);
161
161
  if (!r.success) return {
162
- issues: [u("invalid_structure", ["baseVSpec"], "Base table vSpec is invalid.", { details: { issues: r.error.issues } })],
162
+ issues: [c("invalid_structure", ["baseVSpec"], "Base table vSpec is invalid.", { details: { issues: r.error.issues } })],
163
163
  success: !1
164
164
  };
165
165
  let h = r.data;
@@ -170,13 +170,13 @@ var T = {
170
170
  "supportingMeasures",
171
171
  "sortingMeasures"
172
172
  ])) return {
173
- issues: [u("non_fresh_base_vspec", ["baseVSpec"], "Table definitions require a fresh base vSpec.")],
173
+ issues: [c("non_fresh_base_vspec", ["baseVSpec"], "Table definitions require a fresh base vSpec.")],
174
174
  success: !1
175
175
  };
176
176
  let x = n.data, T = I(x.data), E = T.flatMap((e) => e.items), D = [
177
- ...E.flatMap((t) => s(t, e.availableFields, t.path, t.role)),
178
- ...a(T),
179
- ...i(x.filterGroup, e.availableFields),
177
+ ...E.flatMap((t) => p(t, e.availableFields, t.path, t.role)),
178
+ ...i(T),
179
+ ...f(x.filterGroup, e.availableFields),
180
180
  ...b(x.sorting, E.map((e) => e.ref))
181
181
  ];
182
182
  if (D.length) return {
@@ -187,7 +187,7 @@ var T = {
187
187
  state: v(e, h),
188
188
  success: !0
189
189
  }, k = L(x.data);
190
- k !== void 0 && (O = await f(O.state, [{
190
+ k !== void 0 && (O = await u(O.state, [{
191
191
  name: w.SET_TABLE_DATA_STRUCTURE,
192
192
  payload: k
193
193
  }], ["data", "structure"]));
@@ -196,7 +196,7 @@ var T = {
196
196
  issues: [O.issue],
197
197
  success: !1
198
198
  };
199
- O = await _(O.state, t, t.role, w.ADD_COLUMN, t.role === "measure" ? o(t, e.availableFields, { columnType: t.role }) : {
199
+ O = await _(O.state, t, t.role, w.ADD_COLUMN, t.role === "measure" ? a(t, e.availableFields, { columnType: t.role }) : {
200
200
  columnType: t.role,
201
201
  key: t.fieldKey,
202
202
  topDimension: t.topDimension
@@ -208,15 +208,15 @@ var T = {
208
208
  formatString: w.SET_COLUMN_FORMAT_STRING,
209
209
  formatType: w.SET_COLUMN_FORMAT_TYPE,
210
210
  negativeType: w.SET_COLUMN_NEGATIVE_TYPE
211
- }), "issue" in O) || (O = await f(O.state, N(x.presentation), ["presentation"]), "issue" in O) || (O = await p(O.state, x.filterGroup), "issue" in O) || (O = await m(O.state, x.sorting, w.CHANGE_SORT_ORDER_AND_DIRECTION, w.TOGGLE_SORTING_ITEM), "issue" in O) || (O = await f(O.state, x.limiting?.queryLimit === void 0 ? [] : [{
211
+ }), "issue" in O) || (O = await u(O.state, N(x.presentation), ["presentation"]), "issue" in O) || (O = await d(O.state, x.filterGroup), "issue" in O) || (O = await m(O.state, x.sorting, w.CHANGE_SORT_ORDER_AND_DIRECTION, w.TOGGLE_SORTING_ITEM), "issue" in O) || (O = await u(O.state, x.limiting?.queryLimit === void 0 ? [] : [{
212
212
  name: w.SET_QUERY_LIMIT,
213
213
  payload: x.limiting.queryLimit
214
214
  }], ["limiting"]), "issue" in O) ? {
215
215
  issues: [O.issue],
216
216
  success: !1
217
- } : (O = await f(O.state, P(x.totals), ["totals"]), "issue" in O ? {
217
+ } : (O = await u(O.state, P(x.totals), ["totals"]), "issue" in O ? {
218
218
  issues: [O.issue],
219
219
  success: !1
220
- } : d(O.state, S));
220
+ } : l(O.state, C));
221
221
  };
222
222
  export { B as compileTableVisualizationDefinition };
@@ -0,0 +1,232 @@
1
+ import { Sa as e, c as t, i as n, r } from "./visualization-filters-B9qik5_K.js";
2
+ var i = "system-ui, sans-serif", a = ["--astrato-font-family", "--font-family"], o = 3e3, s = 250, c = "Aa0 ", l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new Set([
3
+ "serif",
4
+ "sans-serif",
5
+ "monospace",
6
+ "cursive",
7
+ "fantasy",
8
+ "system-ui",
9
+ "ui-serif",
10
+ "ui-sans-serif",
11
+ "ui-monospace",
12
+ "ui-rounded",
13
+ "emoji",
14
+ "math",
15
+ "fangsong"
16
+ ]), d = (e) => {
17
+ let t = e.trim().replace(/[,;\s]+$/, "");
18
+ return t ? /(^|,)\s*(sans-serif|system-ui)\s*(,|$)/i.test(t) ? t : `${t}, ${i}` : i;
19
+ }, f = (e) => {
20
+ let t = e ?? (typeof document > "u" ? void 0 : document), n = t?.defaultView;
21
+ if (!t || !n) return;
22
+ let r = n.getComputedStyle(t.documentElement);
23
+ for (let e of a) {
24
+ let t = r.getPropertyValue(e).trim();
25
+ if (t) return t;
26
+ }
27
+ return (t.body ? n.getComputedStyle(t.body).fontFamily.trim() : "") || void 0;
28
+ }, p = (e, t) => d(e?.trim() || f(t) || "system-ui, sans-serif"), m = (e) => e.trim().replace(/^["']|["']$/g, "").toLowerCase(), h = (e) => (e ?? (typeof document > "u" ? void 0 : document))?.fonts, g = (e) => (e.match(/"[^"]*"|'[^']*'|[^,]+/g) ?? []).map((e) => e.trim()).filter((e) => e && !u.has(m(e))), _ = (e, t) => {
29
+ let n = /* @__PURE__ */ new Set();
30
+ return t.forEach((e) => n.add(m(e.family))), g(e).find((e) => n.has(m(e)));
31
+ }, v = async (e, t) => {
32
+ let n = h(t), r = n?.load ? _(e, n) : void 0;
33
+ if (!n || !r) return;
34
+ let i = l.get(n);
35
+ i || (i = /* @__PURE__ */ new Map(), l.set(n, i));
36
+ let a = m(r), s = i.get(a);
37
+ if (!s) {
38
+ let e = i;
39
+ s = (async () => {
40
+ let t;
41
+ try {
42
+ let i = Promise.resolve().then(() => n.load(`12px ${r}`, c));
43
+ i.then(() => e.delete(a), () => e.delete(a)), await Promise.race([i, new Promise((e) => {
44
+ t = setTimeout(e, o);
45
+ })]);
46
+ } catch {
47
+ e.delete(a);
48
+ } finally {
49
+ clearTimeout(t);
50
+ }
51
+ })(), i.set(a, s);
52
+ }
53
+ await s;
54
+ }, y = (e, t, n) => {
55
+ let r = h(n), i = new Set(g(e).map(m));
56
+ if (!r?.addEventListener || !i.size) return () => void 0;
57
+ let a = !0, o = t, c, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = (e) => {
58
+ let t = e.filter((e) => i.has(m(e.family)) && !u.has(e));
59
+ a && t.length && (t.forEach((e) => u.add(e)), o?.());
60
+ }, f = (e = !1) => {
61
+ r.forEach((t) => {
62
+ !i.has(m(t.family)) || l.has(t) || (l.add(t), t.status === "loaded" ? e ? u.add(t) : d([t]) : t.loaded?.then(() => d([t]), () => void 0));
63
+ });
64
+ }, p = () => {
65
+ clearTimeout(c), f(), a && r.status === "loading" && (c = setTimeout(p, s));
66
+ }, _ = (e) => {
67
+ d(e.fontfaces ?? []), p();
68
+ };
69
+ return r.addEventListener("loading", p), r.addEventListener("loadingdone", _), f(!0), p(), () => {
70
+ a = !1, o = void 0, clearTimeout(c), l.clear(), u.clear(), r.removeEventListener("loading", p), r.removeEventListener("loadingdone", _);
71
+ };
72
+ }, b = d(e.fonts.general.fontFamily ?? ""), x = "light", S = {
73
+ light: {
74
+ text: e.fonts.general.color ?? "",
75
+ surface: e.colors.sheetBackgroundColor ?? "",
76
+ gridline: e.objectStyles.gridLines.color ?? "",
77
+ axisLine: e.axis.dimension.lineColor,
78
+ axisLabel: e.axis.dimension.labelColor
79
+ },
80
+ dark: {
81
+ text: "#e4e4ea",
82
+ surface: "#1e1e24",
83
+ gridline: "#4a4a52",
84
+ axisLine: "#4a4a52",
85
+ axisLabel: "#a6a6b0"
86
+ }
87
+ }, C = "#2e2e36", w = (e) => typeof e == "object" && !!e && !Array.isArray(e), T = (e) => w(e) && "light" in e && "dark" in e, E = (e) => e === "light" || e === "dark", D = (e, t) => T(e) ? e[t] : e, O = (e, t) => e?.map((e) => ({
88
+ id: e.id,
89
+ name: e.name ?? e.id,
90
+ colors: D(e.colors, t) ?? []
91
+ })), k = (e, t) => ({
92
+ ...e,
93
+ fontFamily: t
94
+ }), A = (e) => {
95
+ let t = Object.entries(e).filter(([, e]) => e !== void 0);
96
+ return t.length ? Object.fromEntries(t) : void 0;
97
+ }, j = (e, t, n) => {
98
+ let r = e?.colors, i = (e) => t === "dark" ? e : void 0, a = A({
99
+ hoverStroke: n(r?.selection?.hoverStroke) ?? i(S.dark.text),
100
+ mutedFill: n(r?.selection?.mutedFill),
101
+ mutedOpacity: e?.mutedOpacity
102
+ });
103
+ return A({
104
+ fontSizes: A({ ...e?.fontSizes }),
105
+ tooltip: A({
106
+ background: n(r?.tooltip?.background),
107
+ text: n(r?.tooltip?.text)
108
+ }),
109
+ dataLabel: A({
110
+ onDark: n(r?.dataLabel?.onDark),
111
+ onLight: n(r?.dataLabel?.onLight)
112
+ }),
113
+ selection: a,
114
+ status: A({
115
+ positive: n(r?.status?.positive),
116
+ negative: n(r?.status?.negative),
117
+ total: n(r?.status?.total)
118
+ }),
119
+ table: A({ rowHighlight: n(r?.table?.rowHighlight) ?? i(C) }),
120
+ null: n(r?.null),
121
+ others: n(r?.others)
122
+ });
123
+ }, M = ({ fontFamily: t, titleFontFamily: n = t, theme: r, mode: i = x }) => {
124
+ let a = S[i], o = r?.colors, s = r?.palettes, c = (e) => D(e, i), l = c(o?.primary), u = D(o?.brand, i), d = l || u?.length ? [...l ? [l] : [], ...u ?? []] : void 0, f = O(s?.categorical, i), p = O(s?.sequential, i), m = O(s?.diverging, i), h = c(o?.text) ?? a.text, g = c(o?.surface), _ = c(o?.axis?.line) ?? a.axisLine, v = {
125
+ lineColor: _,
126
+ tickColor: c(o?.axis?.tick) ?? _,
127
+ labelColor: c(o?.axis?.label) ?? a.axisLabel,
128
+ titleColor: c(o?.axis?.title) ?? c(o?.axis?.label) ?? a.axisLabel
129
+ }, y = j(r, i, c);
130
+ return {
131
+ ...e,
132
+ ...y ? { chart: y } : {},
133
+ colors: {
134
+ ...e.colors,
135
+ brandColors: d ?? e.colors.brandColors,
136
+ categorical: f?.length ? f : e.colors.categorical,
137
+ defaultCategorical: s?.defaultCategorical ?? f?.[0]?.id ?? e.colors.defaultCategorical,
138
+ gradient: p?.length ? p : e.colors.gradient,
139
+ defaultGradient: s?.defaultSequential ?? p?.[0]?.id ?? e.colors.defaultGradient,
140
+ sheetBackgroundColor: g ?? a.surface,
141
+ ...m?.length ? { diverging: m } : {},
142
+ ...s?.defaultDiverging || m?.length ? { defaultDiverging: s?.defaultDiverging ?? m?.[0]?.id } : {}
143
+ },
144
+ fonts: {
145
+ general: {
146
+ color: h,
147
+ fontFamily: t
148
+ },
149
+ title: {
150
+ color: c(o?.title) ?? e.fonts.title.color,
151
+ fontFamily: n
152
+ }
153
+ },
154
+ navigation: {
155
+ ...e.navigation,
156
+ activeItem: {
157
+ ...e.navigation.activeItem,
158
+ font: k(e.navigation.activeItem.font, t)
159
+ },
160
+ item: {
161
+ ...e.navigation.item,
162
+ font: k(e.navigation.item.font, t)
163
+ }
164
+ },
165
+ objectStyles: {
166
+ ...e.objectStyles,
167
+ backgroundColor: g ?? e.objectStyles.backgroundColor,
168
+ border: { color: c(o?.border) ?? e.objectStyles.border.color },
169
+ gridLines: { color: c(o?.gridline) ?? a.gridline }
170
+ },
171
+ axis: {
172
+ dimension: { ...v },
173
+ measure: { ...v }
174
+ }
175
+ };
176
+ }, N = (e, t) => {
177
+ if (e !== void 0 && typeof e != "string") throw TypeError(`theme.${t} must be a string.`);
178
+ }, P = (e, t, n, r) => {
179
+ if (e !== void 0 && !(T(e) ? [e.light, e.dark] : [e]).every(n)) throw TypeError(`theme.${t} must be ${r}, or a { light, dark } pair of them.`);
180
+ }, F = (e) => typeof e == "string", I = /* @__PURE__ */ new Set([
181
+ "axis",
182
+ "tooltip",
183
+ "dataLabel",
184
+ "selection",
185
+ "status",
186
+ "table"
187
+ ]), L = (e) => Array.isArray(e) && e.every(F), R = (e) => L(e) && e.length > 0, z = (e, t) => {
188
+ if (e !== void 0) {
189
+ if (!Array.isArray(e)) throw TypeError(`theme.palettes.${t} must be an array of palettes.`);
190
+ e.forEach((e, n) => {
191
+ if (!w(e) || typeof e.id != "string" || !e.id) throw TypeError(`theme.palettes.${t}[${n}] needs an id string.`);
192
+ if (N(e.name, `palettes.${t}[${n}].name`), P(e.colors, `palettes.${t}[${n}].colors`, R, "a non-empty array of colors"), e.colors === void 0) throw TypeError(`theme.palettes.${t}[${n}] needs colors.`);
193
+ });
194
+ }
195
+ }, B = (e) => {
196
+ if (e !== void 0) {
197
+ if (!w(e)) throw TypeError("The visualization theme must be an object.");
198
+ if (N(e.fontFamily, "fontFamily"), N(e.titleFontFamily, "titleFontFamily"), e.colors !== void 0) {
199
+ if (!w(e.colors)) throw TypeError("theme.colors must be an object.");
200
+ let { brand: t, ...n } = e.colors;
201
+ Object.entries(n).forEach(([e, t]) => {
202
+ if (!I.has(e)) {
203
+ P(t, `colors.${e}`, F, "a color string");
204
+ return;
205
+ }
206
+ if (t !== void 0) {
207
+ if (!w(t)) throw TypeError(`theme.colors.${e} must be an object.`);
208
+ Object.entries(t).forEach(([t, n]) => P(n, `colors.${e}.${t}`, F, "a color string"));
209
+ }
210
+ }), P(t, "colors.brand", L, "an array of colors");
211
+ }
212
+ if (e.fontSizes !== void 0) {
213
+ if (!w(e.fontSizes)) throw TypeError("theme.fontSizes must be an object.");
214
+ Object.entries(e.fontSizes).forEach(([e, t]) => {
215
+ if (t !== void 0 && (typeof t != "number" || !Number.isFinite(t) || t <= 0)) throw TypeError(`theme.fontSizes.${e} must be a positive number of pixels.`);
216
+ });
217
+ }
218
+ if (e.mutedOpacity !== void 0 && (typeof e.mutedOpacity != "number" || !(e.mutedOpacity >= 0 && e.mutedOpacity <= 1))) throw TypeError("theme.mutedOpacity must be a number from 0 to 1.");
219
+ if (e.palettes !== void 0) {
220
+ if (!w(e.palettes)) throw TypeError("theme.palettes must be an object.");
221
+ z(e.palettes.categorical, "categorical"), z(e.palettes.sequential, "sequential"), z(e.palettes.diverging, "diverging"), N(e.palettes.defaultDiverging, "palettes.defaultDiverging"), N(e.palettes.defaultCategorical, "palettes.defaultCategorical"), N(e.palettes.defaultSequential, "palettes.defaultSequential");
222
+ }
223
+ }
224
+ }, V = (i) => {
225
+ let a = [], o = (e, t, n, r) => {
226
+ e !== void 0 && ([...t ?? [], ...n].some((t) => t.id === e) || a.push(`theme.palettes.${r} "${e}" matches no palette; charts fall back to the built-in default.`));
227
+ };
228
+ return o(i?.palettes?.defaultCategorical, i?.palettes?.categorical, [...r, ...e.colors.categorical], "defaultCategorical"), o(i?.palettes?.defaultSequential, i?.palettes?.sequential, [...t, ...e.colors.gradient], "defaultSequential"), o(i?.palettes?.defaultDiverging, i?.palettes?.diverging, n, "defaultDiverging"), a;
229
+ }, H = (e) => {
230
+ if (!E(e)) throw TypeError("The visualization theme mode must be 'light' or 'dark'.");
231
+ };
232
+ export { x as a, v as c, b as i, y as l, H as n, V as o, M as r, p as s, B as t };
@@ -1,5 +1,5 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { F as t, ci as n } from "./utils-DganVptf.js";
2
+ import { I as t, fi as n } from "./utils-CUKgR7it.js";
3
3
  var r = /* @__PURE__ */ e(n()), i = (e) => {
4
4
  let n = t(), i = (0, r.useMemo)(() => n.reduce((e, t) => (e[t.key] = t.name, e), {}), e ?? [n]);
5
5
  return (e) => i[e];