@blueprint-chart/lib 2.17.0 → 2.18.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/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as o, Ct as s, D as c, Dt as l, E as u, Et as d, F as f, Ft as p, G as m, Gt as h, H as g, Ht as ee, I as te, It as _, J as v, Jt as ne, K as re, Kt as ie, L as ae, Lt as oe, M as y, Mt as se, N as ce, Nt as le, O as ue, Ot as de, P as b, Pt as fe, Q as pe, Qt as me, R as x, Rt as he, S as ge, St as _e, T as ve, Tt as ye, U as S, Ut as be, V as xe, Vt as Se, W as Ce, Wt as we, X as Te, Xt as Ee, Y as De, Yt as Oe, Z as ke, Zt as Ae, _ as je, _t as Me, a as Ne, an as Pe, at as Fe, b as Ie, bt as Le, c as Re, cn as ze, ct as Be, d as Ve, dt as He, en as Ue, et as We, f as Ge, ft as Ke, g as qe, gt as Je, h as Ye, ht as Xe, i as C, in as Ze, it as Qe, j as $e, jt as et, k as w, kt as tt, l as nt, ln as rt, lt as it, m as at, mt as ot, n as st, nn as ct, nt as lt, o as ut, on as dt, ot as ft, p as pt, pt as mt, q as ht, qt as gt, r as _t, rn as vt, rt as yt, s as bt, sn as xt, st as St, t as Ct, tn as wt, tt as Tt, u as Et, ut as Dt, v as Ot, vt as kt, w as At, wt as jt, x as Mt, xt as Nt, y as Pt, yt as Ft, z as T, zt as It } from "./render-bpc-CPj5h-p4.js";
2
- import { c as Lt, i as Rt, s as zt, t as Bt } from "./runtime-CT02Shsd.js";
3
- import E from "chroma-js";
1
+ import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as o, Ct as s, D as c, Dt as l, E as u, Et as d, F as f, Ft as p, G as m, Gt as h, H as g, Ht as ee, I as te, It as _, J as v, Jt as ne, K as re, Kt as ie, L as y, Lt as ae, M as b, Mt as oe, N as se, Nt as ce, O as le, Ot as ue, P as de, Pt as x, Q as fe, Qt as pe, R as S, Rt as me, S as he, St as ge, T as _e, Tt as ve, U as ye, Ut as be, V as C, Vt as xe, W as Se, Wt as Ce, X as we, Xt as Te, Y as Ee, Yt as De, Z as Oe, Zt as ke, _ as Ae, _t as je, a as Me, an as Ne, at as Pe, b as Fe, bt as Ie, c as Le, cn as Re, ct as ze, d as Be, dt as Ve, en as He, et as Ue, f as We, ft as Ge, g as Ke, gt as qe, h as Je, ht as Ye, i as w, in as Xe, it as Ze, j as Qe, jt as $e, k as T, kt as E, l as et, lt as tt, m as nt, mt as rt, n as it, nn as at, nt as ot, o as st, on as ct, ot as lt, p as ut, pt as dt, q as ft, qt as pt, r as mt, rn as ht, rt as gt, s as _t, sn as vt, st as yt, t as bt, tn as xt, tt as St, u as Ct, ut as wt, v as Tt, vt as Et, w as Dt, wt as Ot, x as kt, xt as At, y as jt, yt as Mt, z as Nt, zt as Pt } from "./render-bpc-jhkrsEsh.js";
2
+ import { c as Ft, i as It, l as Lt, s as Rt, t as zt } from "./runtime-BTUG9Tha.js";
3
+ import D from "chroma-js";
4
4
  //#region src/recommendations/intent.ts
5
- var Vt = [
5
+ var Bt = [
6
6
  {
7
7
  intent: "range",
8
8
  pattern: /\b(range|high and low|high\/low|margin of error|confidence interval|confidence|interval|plus or minus|spread between)\b/i
@@ -32,97 +32,97 @@ var Vt = [
32
32
  pattern: /\b(compares?|compared|comparison|versus|vs\.?|more than|difference between|across|than)\b/i
33
33
  }
34
34
  ];
35
- function Ht(e) {
35
+ function Vt(e) {
36
36
  if (e === void 0 || e.trim() === "") return "none";
37
- for (let t of Vt) if (t.pattern.test(e)) return t.intent;
37
+ for (let t of Bt) if (t.pattern.test(e)) return t.intent;
38
38
  return "none";
39
39
  }
40
40
  //#endregion
41
41
  //#region src/recommendations/decisionTable.ts
42
- var D = (e, t, n) => ({
42
+ var O = (e, t, n) => ({
43
43
  type: e,
44
44
  fitness: t,
45
45
  reason: n
46
- }), O = {
46
+ }), k = {
47
47
  "1cat+1num": {
48
48
  none: (e) => {
49
- let t = [D("bar-vertical", "best", "1 categorical + 1 numeric — classic bar chart"), D("bar-horizontal", "good", "Horizontal bars work well for long labels")];
50
- return e <= 8 && (t.push(D("donut", "good", `${e} items — suitable for part-of-whole`)), t.push(D("pie", "alternative", "Pie chart for part-of-whole"))), t;
49
+ let t = [O("bar-vertical", "best", "1 categorical + 1 numeric — classic bar chart"), O("bar-horizontal", "good", "Horizontal bars work well for long labels")];
50
+ return e <= 8 && (t.push(O("donut", "good", `${e} items — suitable for part-of-whole`)), t.push(O("pie", "alternative", "Pie chart for part-of-whole"))), t;
51
51
  },
52
- comparison: (e) => O["1cat+1num"].none(e),
53
- ranking: () => [D("bar-horizontal", "best", "Ranked categories read best as horizontal bars"), D("bar-vertical", "good", "Vertical bars also work for ranking")],
52
+ comparison: (e) => k["1cat+1num"].none(e),
53
+ ranking: () => [O("bar-horizontal", "best", "Ranked categories read best as horizontal bars"), O("bar-vertical", "good", "Vertical bars also work for ranking")],
54
54
  "part-to-whole": (e) => e <= 5 ? [
55
- D("pie", "best", `${e} slices — pie reads cleanly for very small N`),
56
- D("donut", "good", "Donut for part-of-whole with a center label"),
57
- D("bar-vertical", "alternative", "Bars if precise comparison matters")
55
+ O("pie", "best", `${e} slices — pie reads cleanly for very small N`),
56
+ O("donut", "good", "Donut for part-of-whole with a center label"),
57
+ O("bar-vertical", "alternative", "Bars if precise comparison matters")
58
58
  ] : e <= 8 ? [
59
- D("donut", "best", `${e} slices — donut for part-of-whole`),
60
- D("pie", "good", "Pie for part-of-whole"),
61
- D("bar-vertical", "alternative", "Bars if precise comparison matters")
62
- ] : [D("bar-vertical", "best", `${e} categories — too many for a readable pie`), D("bar-horizontal", "good", "Horizontal bars for long labels")],
63
- range: () => [D("bar-vertical", "best", "A single numeric column carries no range — plain bars read the value directly"), D("bar-horizontal", "good", "Horizontal bars work well for long labels")]
59
+ O("donut", "best", `${e} slices — donut for part-of-whole`),
60
+ O("pie", "good", "Pie for part-of-whole"),
61
+ O("bar-vertical", "alternative", "Bars if precise comparison matters")
62
+ ] : [O("bar-vertical", "best", `${e} categories — too many for a readable pie`), O("bar-horizontal", "good", "Horizontal bars for long labels")],
63
+ range: () => [O("bar-vertical", "best", "A single numeric column carries no range — plain bars read the value directly"), O("bar-horizontal", "good", "Horizontal bars work well for long labels")]
64
64
  },
65
65
  "1cat+Nnum": {
66
- none: () => [D("bar-multi", "best", "1 categorical + multiple numeric columns — compare groups"), D("line-multi", "good", "Can also show as a multi-line chart")],
67
- comparison: (e) => O["1cat+Nnum"].none(e),
68
- ranking: (e) => O["1cat+Nnum"].none(e),
69
- trend: () => [D("line-multi", "best", "A trend or crossover story reads best as lines, even over categorical periods"), D("bar-multi", "alternative", "Grouped bars if per-period comparison matters more than the trend")],
66
+ none: () => [O("bar-multi", "best", "1 categorical + multiple numeric columns — compare groups"), O("line-multi", "good", "Can also show as a multi-line chart")],
67
+ comparison: (e) => k["1cat+Nnum"].none(e),
68
+ ranking: (e) => k["1cat+Nnum"].none(e),
69
+ trend: () => [O("line-multi", "best", "A trend or crossover story reads best as lines, even over categorical periods"), O("bar-multi", "alternative", "Grouped bars if per-period comparison matters more than the trend")],
70
70
  "part-to-whole": () => [
71
- D("bar-stacked", "best", "Stacked bars show composition within each category"),
72
- D("column-stacked", "good", "Stacked columns for the same composition"),
73
- D("bar-multi", "alternative", "Grouped bars if comparison beats composition")
71
+ O("bar-stacked", "best", "Stacked bars show composition within each category"),
72
+ O("column-stacked", "good", "Stacked columns for the same composition"),
73
+ O("bar-multi", "alternative", "Grouped bars if comparison beats composition")
74
74
  ],
75
75
  "composition-over-time": () => [
76
- D("column-stacked", "best", "Stacked columns show composition across discrete periods"),
77
- D("bar-stacked", "good", "Stacked bars for the same composition"),
78
- D("area-stacked", "alternative", "Stacked area if the periods are continuous time")
76
+ O("column-stacked", "best", "Stacked columns show composition across discrete periods"),
77
+ O("bar-stacked", "good", "Stacked bars for the same composition"),
78
+ O("area-stacked", "alternative", "Stacked area if the periods are continuous time")
79
79
  ],
80
- relationship: () => [D("scatter", "best", "Two numeric columns per item — a scatter plot shows how they move together"), D("line-multi", "alternative", "Lines if the categories have a natural order")],
81
- range: () => [D("dot-plot", "best", "A dot with a bar from low to high shows each value with its margin. Set dotStyle = \"range\" and pick the low and high columns"), D("bar-split", "alternative", "Split bars if each bound should read as its own panel")]
80
+ relationship: () => [O("scatter", "best", "Two numeric columns per item — a scatter plot shows how they move together"), O("line-multi", "alternative", "Lines if the categories have a natural order")],
81
+ range: () => [O("dot-plot", "best", "A dot with a bar from low to high shows each value with its margin. Set dotStyle = \"range\" and pick the low and high columns"), O("bar-split", "alternative", "Split bars if each bound should read as its own panel")]
82
82
  },
83
83
  "1cat+text+Nnum": {
84
- none: () => [D("scatter", "best", "A label, a text column and several numbers — plot one number against another"), D("bar-multi", "alternative", "Grouped bars if comparing values per row matters more")],
85
- relationship: (e) => O["1cat+text+Nnum"].none(e)
84
+ none: () => [O("scatter", "best", "A label, a text column and several numbers — plot one number against another"), O("bar-multi", "alternative", "Grouped bars if comparing values per row matters more")],
85
+ relationship: (e) => k["1cat+text+Nnum"].none(e)
86
86
  },
87
87
  "1date+1num": {
88
- none: () => [D("line", "best", "1 date + 1 numeric column — ideal for trend"), D("bar-vertical", "alternative", "Can also show as bars")],
88
+ none: () => [O("line", "best", "1 date + 1 numeric column — ideal for trend"), O("bar-vertical", "alternative", "Can also show as bars")],
89
89
  trend: () => [
90
- D("line", "best", "1 date + 1 numeric column — ideal for trend"),
91
- D("area", "good", "Filled area emphasizes magnitude over time"),
92
- D("bar-vertical", "alternative", "Can also show as bars")
90
+ O("line", "best", "1 date + 1 numeric column — ideal for trend"),
91
+ O("area", "good", "Filled area emphasizes magnitude over time"),
92
+ O("bar-vertical", "alternative", "Can also show as bars")
93
93
  ],
94
- comparison: () => [D("bar-vertical", "best", "Bars for comparing discrete time points"), D("line", "good", "Line if the trend matters more than the comparison")],
95
- ranking: () => [D("bar-vertical", "best", "Bars for ranking discrete time points"), D("line", "good", "Line for the underlying trend")],
96
- "part-to-whole": () => [D("area", "best", "Filled area reads as magnitude/share over time"), D("line", "good", "Line for the underlying trend")],
97
- "composition-over-time": () => [D("area", "best", "Filled area shows magnitude over time"), D("line", "good", "Line for the underlying trend")]
94
+ comparison: () => [O("bar-vertical", "best", "Bars for comparing discrete time points"), O("line", "good", "Line if the trend matters more than the comparison")],
95
+ ranking: () => [O("bar-vertical", "best", "Bars for ranking discrete time points"), O("line", "good", "Line for the underlying trend")],
96
+ "part-to-whole": () => [O("area", "best", "Filled area reads as magnitude/share over time"), O("line", "good", "Line for the underlying trend")],
97
+ "composition-over-time": () => [O("area", "best", "Filled area shows magnitude over time"), O("line", "good", "Line for the underlying trend")]
98
98
  },
99
99
  "1date+Nnum": {
100
- none: () => [D("line-multi", "best", "1 date + multiple numeric columns — compare trends"), D("bar-multi", "alternative", "Can also show as grouped bars")],
101
- trend: (e) => O["1date+Nnum"].none(e),
102
- comparison: (e) => O["1date+Nnum"].none(e),
103
- ranking: (e) => O["1date+Nnum"].none(e),
100
+ none: () => [O("line-multi", "best", "1 date + multiple numeric columns — compare trends"), O("bar-multi", "alternative", "Can also show as grouped bars")],
101
+ trend: (e) => k["1date+Nnum"].none(e),
102
+ comparison: (e) => k["1date+Nnum"].none(e),
103
+ ranking: (e) => k["1date+Nnum"].none(e),
104
104
  "composition-over-time": () => [
105
- D("area-stacked", "best", "Stacked area shows composition over continuous time"),
106
- D("column-stacked", "good", "Stacked columns for the same composition"),
107
- D("line-multi", "alternative", "Multi-line if composition is not the point")
105
+ O("area-stacked", "best", "Stacked area shows composition over continuous time"),
106
+ O("column-stacked", "good", "Stacked columns for the same composition"),
107
+ O("line-multi", "alternative", "Multi-line if composition is not the point")
108
108
  ],
109
- "part-to-whole": () => [D("area-stacked", "best", "Stacked area shows share over time"), D("line-multi", "good", "Multi-line if absolute trends matter more")]
109
+ "part-to-whole": () => [O("area-stacked", "best", "Stacked area shows share over time"), O("line-multi", "good", "Multi-line if absolute trends matter more")]
110
110
  },
111
- other: { none: () => [D("bar-vertical", "good", "Default bar chart recommendation")] }
111
+ other: { none: () => [O("bar-vertical", "good", "Default bar chart recommendation")] }
112
112
  };
113
- function Ut(e, t, n) {
114
- let r = O[e], i = r[t] ?? r.none;
115
- return i ? i(n) : [D("bar-vertical", "good", "Default bar chart recommendation")];
113
+ function Ht(e, t, n) {
114
+ let r = k[e], i = r[t] ?? r.none;
115
+ return i ? i(n) : [O("bar-vertical", "good", "Default bar chart recommendation")];
116
116
  }
117
117
  //#endregion
118
118
  //#region src/recommendations/shape.ts
119
- function Wt(e, t) {
119
+ function Ut(e, t) {
120
120
  let n = e[0] === "date", r = e.filter((e) => e === "string").length, i = n ? e.filter((e) => e === "date").length : 0, a = e.filter((e) => e === "number" || e === "date" && !n).length;
121
121
  return i === 1 && r === 0 && a >= 1 ? a === 1 ? "1date+1num" : "1date+Nnum" : r === 1 && i === 0 && a >= 1 ? a === 1 ? "1cat+1num" : "1cat+Nnum" : e[0] === "string" && i === 0 && r >= 2 && a >= 2 ? "1cat+text+Nnum" : "other";
122
122
  }
123
123
  //#endregion
124
124
  //#region src/recommendations/types.ts
125
- var Gt = {
125
+ var Wt = {
126
126
  "bar-vertical": "Vertical Bar Chart",
127
127
  "bar-horizontal": "Horizontal Bar Chart",
128
128
  "bar-multi": "Grouped Bar Chart",
@@ -141,21 +141,21 @@ var Gt = {
141
141
  };
142
142
  //#endregion
143
143
  //#region src/recommendations/recommend.ts
144
- function Kt(e, t, n) {
145
- return e.length === 0 ? [] : Ut(Wt(e, t), Ht(n), t).map((e) => ({
144
+ function Gt(e, t, n) {
145
+ return e.length === 0 ? [] : Ht(Ut(e, t), Vt(n), t).map((e) => ({
146
146
  chartType: e.type,
147
- label: Gt[e.type] ?? e.type,
147
+ label: Wt[e.type] ?? e.type,
148
148
  fitness: e.fitness,
149
149
  reason: e.reason
150
150
  }));
151
151
  }
152
152
  //#endregion
153
153
  //#region src/charts/colorblind.ts
154
- var qt = {
154
+ var Kt = {
155
155
  protanopia: "Protanopia (no red)",
156
156
  deuteranopia: "Deuteranopia (no green)",
157
157
  tritanopia: "Tritanopia (no blue)"
158
- }, Jt = {
158
+ }, qt = {
159
159
  protanopia: [
160
160
  .152286,
161
161
  1.052583,
@@ -223,27 +223,27 @@ var qt = {
223
223
  0
224
224
  ]
225
225
  };
226
- function Yt(e) {
226
+ function Jt(e) {
227
227
  return `bc-cvd-${e}`;
228
228
  }
229
- function Xt(e) {
229
+ function Yt(e) {
230
230
  let t = "http://www.w3.org/2000/svg", n = document.createElementNS(t, "filter");
231
- n.setAttribute("id", Yt(e)), n.setAttribute("color-interpolation-filters", "linearRGB");
231
+ n.setAttribute("id", Jt(e)), n.setAttribute("color-interpolation-filters", "linearRGB");
232
232
  let r = document.createElementNS(t, "feColorMatrix");
233
- return r.setAttribute("type", "matrix"), r.setAttribute("values", Jt[e].join(" ")), n.appendChild(r), n;
233
+ return r.setAttribute("type", "matrix"), r.setAttribute("values", qt[e].join(" ")), n.appendChild(r), n;
234
234
  }
235
- function Zt(e) {
235
+ function Xt(e) {
236
236
  return e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
237
237
  }
238
- function k(e) {
238
+ function A(e) {
239
239
  return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
240
240
  }
241
- function Qt(e, t) {
242
- let [n, r, i] = (E.valid(e) ? E(e) : E("#000")).rgb().map((e) => Zt(e / 255)), a = Jt[t], o = k(a[0] * n + a[1] * r + a[2] * i), s = k(a[5] * n + a[6] * r + a[7] * i), c = k(a[10] * n + a[11] * r + a[12] * i), l = (e) => Math.min(255, Math.max(0, Math.round(e * 255)));
243
- return E(l(o), l(s), l(c)).hex();
241
+ function Zt(e, t) {
242
+ let [n, r, i] = (D.valid(e) ? D(e) : D("#000")).rgb().map((e) => Xt(e / 255)), a = qt[t], o = A(a[0] * n + a[1] * r + a[2] * i), s = A(a[5] * n + a[6] * r + a[7] * i), c = A(a[10] * n + a[11] * r + a[12] * i), l = (e) => Math.min(255, Math.max(0, Math.round(e * 255)));
243
+ return D(l(o), l(s), l(c)).hex();
244
244
  }
245
- var $t = 10;
246
- function en(e) {
245
+ var Qt = 10;
246
+ function $t(e) {
247
247
  if (e.length < 2) return [];
248
248
  let t = [
249
249
  "protanopia",
@@ -251,10 +251,10 @@ function en(e) {
251
251
  "tritanopia"
252
252
  ], n = [];
253
253
  for (let r of t) {
254
- let t = e.map((e) => Qt(e, r)), i = [];
254
+ let t = e.map((e) => Zt(e, r)), i = [];
255
255
  for (let n = 0; n < t.length; n++) for (let r = n + 1; r < t.length; r++) {
256
- let a = E.deltaE(t[n], t[r]);
257
- a < $t && i.push({
256
+ let a = D.deltaE(t[n], t[r]);
257
+ a < Qt && i.push({
258
258
  a: e[n],
259
259
  b: e[r],
260
260
  deltaE: a
@@ -262,7 +262,7 @@ function en(e) {
262
262
  }
263
263
  i.length > 0 && n.push({
264
264
  type: r,
265
- label: qt[r],
265
+ label: Kt[r],
266
266
  pairs: i
267
267
  });
268
268
  }
@@ -270,158 +270,158 @@ function en(e) {
270
270
  }
271
271
  //#endregion
272
272
  //#region src/dsl/serializer.ts
273
- function A(e, t) {
273
+ function j(e, t) {
274
274
  return (e ?? []).flatMap((e) => e.split("\n").map((e) => `${t}// ${e.trim()}`));
275
275
  }
276
- function j(e, t) {
276
+ function M(e, t) {
277
277
  return t == null ? e : t.includes("\n") ? `${e} /* ${t} */` : `${e} // ${t}`;
278
278
  }
279
- function M(e, t) {
280
- return [...A(e.trailingComments, `${t} `), j(`${t}}`, e.trailingComment)];
279
+ function N(e, t) {
280
+ return [...j(e.trailingComments, `${t} `), M(`${t}}`, e.trailingComment)];
281
281
  }
282
- function N(e) {
283
- return typeof e.value == "number" ? e.isPercentage ? `${e.value}%` : `${e.value}` : typeof e.value == "string" && e.value.startsWith("#") ? T(e.value) : typeof e.value == "string" && /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e.value) ? e.value : T(String(e.value));
282
+ function P(e) {
283
+ return typeof e.value == "number" ? e.isPercentage ? `${e.value}%` : `${e.value}` : typeof e.value == "string" && e.value.startsWith("#") ? S(e.value) : typeof e.value == "string" && /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e.value) ? e.value : S(String(e.value));
284
284
  }
285
- function tn(e) {
286
- return /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e) ? e : T(e);
285
+ function en(e) {
286
+ return /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e) ? e : S(e);
287
287
  }
288
- function P(e, t) {
289
- let n = j(`${t}${tn(e.key)} = ${N(e)}`, e.trailingComment);
290
- return [...A(e.leadingComments, t), n].join("\n");
288
+ function F(e, t) {
289
+ let n = M(`${t}${en(e.key)} = ${P(e)}`, e.trailingComment);
290
+ return [...j(e.leadingComments, t), n].join("\n");
291
291
  }
292
- function nn(e, t) {
292
+ function tn(e, t) {
293
293
  let n;
294
- return n = e.key === "series" && e.quotedKey && !(e.values && e.values.length > 1) ? `${t}"series" = ${N(e)}` : e.values && e.values.length > 1 ? `${t}${e.key === "series" && !e.quotedKey ? e.key : T(e.key)} = ${e.values.map((e) => typeof e == "number" ? `${e}` : T(String(e))).join(",")}` : `${t}${tn(e.key)} = ${N(e)}`, [...A(e.leadingComments, t), j(n, e.trailingComment)].join("\n");
295
- }
296
- function F(e, t) {
297
- let n = [...A(e.leadingComments, t), `${t}data {`];
298
- for (let r of e.entries) n.push(nn(r, `${t} `));
299
- return n.push(...M(e, t)), n.join("\n");
294
+ return n = e.key === "series" && e.quotedKey && !(e.values && e.values.length > 1) ? `${t}"series" = ${P(e)}` : e.values && e.values.length > 1 ? `${t}${e.key === "series" && !e.quotedKey ? e.key : S(e.key)} = ${e.values.map((e) => typeof e == "number" ? `${e}` : S(String(e))).join(",")}` : `${t}${en(e.key)} = ${P(e)}`, [...j(e.leadingComments, t), M(n, e.trailingComment)].join("\n");
300
295
  }
301
296
  function I(e, t) {
302
- let n = e.fromHighlight ? "highlight" : "colorize", r = [...A(e.leadingComments, t), `${t}${n} ${T(e.target)} {`];
303
- for (let n of e.properties) r.push(P(n, `${t} `));
304
- return r.push(...M(e, t)), r.join("\n");
297
+ let n = [...j(e.leadingComments, t), `${t}data {`];
298
+ for (let r of e.entries) n.push(tn(r, `${t} `));
299
+ return n.push(...N(e, t)), n.join("\n");
305
300
  }
306
301
  function L(e, t) {
307
- return [...A(e.leadingComments, t), j(`${t}highlight ${T(e.target)}`, e.trailingComment)].join("\n");
302
+ let n = e.fromHighlight ? "highlight" : "colorize", r = [...j(e.leadingComments, t), `${t}${n} ${S(e.target)} {`];
303
+ for (let n of e.properties) r.push(F(n, `${t} `));
304
+ return r.push(...N(e, t)), r.join("\n");
308
305
  }
309
306
  function R(e, t) {
310
- let n = [...A(e.leadingComments, t), `${t}area-fill ${T(e.from)} ${T(e.to)} {`];
311
- for (let r of e.properties) n.push(P(r, `${t} `));
312
- return n.push(...M(e, t)), n.join("\n");
307
+ return [...j(e.leadingComments, t), M(`${t}highlight ${S(e.target)}`, e.trailingComment)].join("\n");
313
308
  }
314
309
  function z(e, t) {
315
- let n = e.kind ?? r.Point;
316
- if (n === r.Range) {
317
- let n = [...A(e.leadingComments, t), `${t}range {`];
318
- for (let r of e.properties) n.push(P(r, `${t} `));
319
- return n.push(...M(e, t)), n.join("\n");
310
+ let n = [...j(e.leadingComments, t), `${t}area-fill ${S(e.from)} ${S(e.to)} {`];
311
+ for (let r of e.properties) n.push(F(r, `${t} `));
312
+ return n.push(...N(e, t)), n.join("\n");
313
+ }
314
+ function B(e, t) {
315
+ let n = e.kind ?? E.Point;
316
+ if (n === E.Range) {
317
+ let n = [...j(e.leadingComments, t), `${t}range {`];
318
+ for (let r of e.properties) n.push(F(r, `${t} `));
319
+ return n.push(...N(e, t)), n.join("\n");
320
320
  }
321
- if (n === r.Free) {
322
- let n = [...A(e.leadingComments, t), `${t}note {`];
323
- for (let r of e.properties) n.push(P(r, `${t} `));
324
- return n.push(...M(e, t)), n.join("\n");
321
+ if (n === E.Free) {
322
+ let n = [...j(e.leadingComments, t), `${t}note {`];
323
+ for (let r of e.properties) n.push(F(r, `${t} `));
324
+ return n.push(...N(e, t)), n.join("\n");
325
325
  }
326
- let i = "target" in e ? e.target : "", a = [...A(e.leadingComments, t), `${t}annotation ${T(i)} {`];
327
- for (let n of e.properties) a.push(P(n, `${t} `));
328
- return a.push(...M(e, t)), a.join("\n");
326
+ let r = "target" in e ? e.target : "", i = [...j(e.leadingComments, t), `${t}annotation ${S(r)} {`];
327
+ for (let n of e.properties) i.push(F(n, `${t} `));
328
+ return i.push(...N(e, t)), i.join("\n");
329
329
  }
330
- function B(e, t) {
331
- let n = [...A(e.leadingComments, t), `${t}series ${T(e.name)} {`];
332
- for (let r of e.properties) n.push(P(r, `${t} `));
333
- return n.push(...M(e, t)), n.join("\n");
330
+ function nn(e, t) {
331
+ let n = [...j(e.leadingComments, t), `${t}series ${S(e.name)} {`];
332
+ for (let r of e.properties) n.push(F(r, `${t} `));
333
+ return n.push(...N(e, t)), n.join("\n");
334
334
  }
335
335
  function rn(e, t) {
336
- let n = e.name == null ? `${t}scene {` : `${t}scene ${T(e.name)} {`, r = [...A(e.leadingComments, t), n];
337
- for (let n of e.properties) r.push(P(n, `${t} `));
338
- e.data && r.push(F(e.data, `${t} `));
339
- for (let n of e.colorizes) r.push(I(n, `${t} `));
340
- for (let n of e.highlights) r.push(L(n, `${t} `));
341
- for (let n of e.areaFills) r.push(R(n, `${t} `));
342
- for (let n of e.annotations) r.push(z(n, `${t} `));
343
- for (let n of e.series) r.push(B(n, `${t} `));
336
+ let n = e.name == null ? `${t}scene {` : `${t}scene ${S(e.name)} {`, r = [...j(e.leadingComments, t), n];
337
+ for (let n of e.properties) r.push(F(n, `${t} `));
338
+ e.data && r.push(I(e.data, `${t} `));
339
+ for (let n of e.colorizes) r.push(L(n, `${t} `));
340
+ for (let n of e.highlights) r.push(R(n, `${t} `));
341
+ for (let n of e.areaFills) r.push(z(n, `${t} `));
342
+ for (let n of e.annotations) r.push(B(n, `${t} `));
343
+ for (let n of e.series) r.push(nn(n, `${t} `));
344
344
  for (let n of e.transforms) r.push(V(n, `${t} `));
345
- return r.push(...M(e, t)), r.join("\n");
345
+ return r.push(...N(e, t)), r.join("\n");
346
346
  }
347
347
  function V(e, t) {
348
- let n = [...A(e.leadingComments, t), `${t}transform ${e.transformType} {`];
349
- for (let r of e.properties) n.push(P(r, `${t} `));
350
- return n.push(...M(e, t)), n.join("\n");
348
+ let n = [...j(e.leadingComments, t), `${t}transform ${e.transformType} {`];
349
+ for (let r of e.properties) n.push(F(r, `${t} `));
350
+ return n.push(...N(e, t)), n.join("\n");
351
351
  }
352
352
  function an(e, t, n) {
353
- let r = g(n).find((t) => t.key === e);
353
+ let r = C(n).find((t) => t.key === e);
354
354
  return !r || r.default === void 0 ? !1 : String(r.default) === String(t);
355
355
  }
356
356
  function on(e) {
357
357
  let t = [`chart ${e.chartType} {`];
358
- for (let n of e.properties) t.push(P(n, " "));
359
- e.data && t.push(F(e.data, " "));
360
- for (let n of e.colorizes) t.push(I(n, " "));
361
- for (let n of e.highlights) t.push(L(n, " "));
362
- for (let n of e.areaFills) t.push(R(n, " "));
363
- for (let n of e.annotations) t.push(z(n, " "));
364
- for (let n of e.series) t.push(B(n, " "));
358
+ for (let n of e.properties) t.push(F(n, " "));
359
+ e.data && t.push(I(e.data, " "));
360
+ for (let n of e.colorizes) t.push(L(n, " "));
361
+ for (let n of e.highlights) t.push(R(n, " "));
362
+ for (let n of e.areaFills) t.push(z(n, " "));
363
+ for (let n of e.annotations) t.push(B(n, " "));
364
+ for (let n of e.series) t.push(nn(n, " "));
365
365
  for (let n of e.scenes) t.push(rn(n, " "));
366
366
  for (let n of e.transforms) t.push(V(n, " "));
367
- return t.push(...A(e.trailingComments, " "), "}"), t.join("\n");
367
+ return t.push(...j(e.trailingComments, " "), "}"), t.join("\n");
368
368
  }
369
369
  function sn(e) {
370
370
  return new Map(e.map((e) => [e.key, e.value]));
371
371
  }
372
372
  function H(e, t, n, r) {
373
- let i = g(n).find((t) => t.key === e);
373
+ let i = C(n).find((t) => t.key === e);
374
374
  return i ? r.has(e) ? String(r.get(e)) === String(t) : i.default !== void 0 && String(i.default) === String(t) : !1;
375
375
  }
376
376
  function cn(e, t, n, r) {
377
- let i = [...A(e.leadingComments, t), `${t}series ${T(e.name)} {`];
378
- for (let a of e.properties) (a.isPercentage || !H(a.key, a.value, n, r)) && i.push(P(a, `${t} `));
379
- return i.push(...M(e, t)), i.join("\n");
377
+ let i = [...j(e.leadingComments, t), `${t}series ${S(e.name)} {`];
378
+ for (let a of e.properties) (a.isPercentage || !H(a.key, a.value, n, r)) && i.push(F(a, `${t} `));
379
+ return i.push(...N(e, t)), i.join("\n");
380
380
  }
381
381
  function ln(e, t, n, r) {
382
- let i = e.properties.find((e) => e.key === "type"), a = i ? String(i.value) : n, o = e.name == null ? `${t}scene {` : `${t}scene ${T(e.name)} {`, s = [...A(e.leadingComments, t), o], c = new Map(r);
382
+ let i = e.properties.find((e) => e.key === "type"), a = i ? String(i.value) : n, o = e.name == null ? `${t}scene {` : `${t}scene ${S(e.name)} {`, s = [...j(e.leadingComments, t), o], c = new Map(r);
383
383
  for (let n of e.properties) {
384
384
  if (n.key === "type") {
385
- s.push(P(n, `${t} `));
385
+ s.push(F(n, `${t} `));
386
386
  continue;
387
387
  }
388
- c.set(n.key, n.value), (n.isPercentage || !H(n.key, n.value, a, r)) && s.push(P(n, `${t} `));
388
+ c.set(n.key, n.value), (n.isPercentage || !H(n.key, n.value, a, r)) && s.push(F(n, `${t} `));
389
389
  }
390
- e.data && s.push(F(e.data, `${t} `));
391
- for (let n of e.colorizes) s.push(I(n, `${t} `));
392
- for (let n of e.highlights) s.push(L(n, `${t} `));
393
- for (let n of e.areaFills) s.push(R(n, `${t} `));
394
- for (let n of e.annotations) s.push(z(n, `${t} `));
390
+ e.data && s.push(I(e.data, `${t} `));
391
+ for (let n of e.colorizes) s.push(L(n, `${t} `));
392
+ for (let n of e.highlights) s.push(R(n, `${t} `));
393
+ for (let n of e.areaFills) s.push(z(n, `${t} `));
394
+ for (let n of e.annotations) s.push(B(n, `${t} `));
395
395
  for (let n of e.series) s.push(cn(n, `${t} `, a, c));
396
396
  for (let n of e.transforms) s.push(V(n, `${t} `));
397
- return s.push(...M(e, t)), s.join("\n");
397
+ return s.push(...N(e, t)), s.join("\n");
398
398
  }
399
399
  function un(e) {
400
400
  let t = [`chart ${e.chartType} {`], n = /* @__PURE__ */ new Map();
401
- for (let r of e.properties) (r.isPercentage || !H(r.key, r.value, e.chartType, n)) && t.push(P(r, " "));
402
- e.data && t.push(F(e.data, " "));
403
- for (let n of e.colorizes) t.push(I(n, " "));
404
- for (let n of e.highlights) t.push(L(n, " "));
405
- for (let n of e.areaFills) t.push(R(n, " "));
406
- for (let n of e.annotations) t.push(z(n, " "));
401
+ for (let r of e.properties) (r.isPercentage || !H(r.key, r.value, e.chartType, n)) && t.push(F(r, " "));
402
+ e.data && t.push(I(e.data, " "));
403
+ for (let n of e.colorizes) t.push(L(n, " "));
404
+ for (let n of e.highlights) t.push(R(n, " "));
405
+ for (let n of e.areaFills) t.push(z(n, " "));
406
+ for (let n of e.annotations) t.push(B(n, " "));
407
407
  let r = sn(e.properties);
408
408
  for (let n of e.series) t.push(cn(n, " ", e.chartType, r));
409
409
  for (let n of e.scenes) t.push(ln(n, " ", e.chartType, r));
410
410
  for (let n of e.transforms) t.push(V(n, " "));
411
- return t.push(...A(e.trailingComments, " "), "}"), t.join("\n");
411
+ return t.push(...j(e.trailingComments, " "), "}"), t.join("\n");
412
412
  }
413
413
  function dn(e) {
414
414
  let t = [`chart ${e.chartType} {`];
415
- for (let n of e.properties) an(n.key, n.value, e.chartType) || t.push(P(n, " "));
416
- e.data && t.push(F(e.data, " "));
417
- for (let n of e.colorizes) t.push(I(n, " "));
418
- for (let n of e.highlights) t.push(L(n, " "));
419
- for (let n of e.areaFills) t.push(R(n, " "));
420
- for (let n of e.annotations) t.push(z(n, " "));
421
- for (let n of e.series) t.push(B(n, " "));
415
+ for (let n of e.properties) an(n.key, n.value, e.chartType) || t.push(F(n, " "));
416
+ e.data && t.push(I(e.data, " "));
417
+ for (let n of e.colorizes) t.push(L(n, " "));
418
+ for (let n of e.highlights) t.push(R(n, " "));
419
+ for (let n of e.areaFills) t.push(z(n, " "));
420
+ for (let n of e.annotations) t.push(B(n, " "));
421
+ for (let n of e.series) t.push(nn(n, " "));
422
422
  for (let n of e.scenes) t.push(rn(n, " "));
423
423
  for (let n of e.transforms) t.push(V(n, " "));
424
- return t.push(...A(e.trailingComments, " "), "}"), t.join("\n");
424
+ return t.push(...j(e.trailingComments, " "), "}"), t.join("\n");
425
425
  }
426
426
  //#endregion
427
427
  //#region src/dsl/suggest.ts
@@ -464,7 +464,7 @@ var pn = [
464
464
  y: "vertical"
465
465
  };
466
466
  function gn(e) {
467
- return [...pe(e), ...(e.textColumns ?? []).map((e) => e.name)];
467
+ return [...Oe(e), ...(e.textColumns ?? []).map((e) => e.name)];
468
468
  }
469
469
  function _n(e, t, n, r) {
470
470
  let i = gn(e);
@@ -495,31 +495,31 @@ function yn(e) {
495
495
  message: `Trend line skipped${e === "overall" ? "" : ` for ${e}`}: needs at least 3 points.`
496
496
  }));
497
497
  }
498
- function bn(e, n) {
499
- return ["x", "y"].flatMap((r) => ["min", "max"].flatMap((i) => {
500
- let a = n[r]?.[i];
501
- return e[r] !== t.Log || a === void 0 || String(a).trim() === "" || !(Number(a) <= 0) ? [] : [{
498
+ function bn(e, t) {
499
+ return ["x", "y"].flatMap((n) => ["min", "max"].flatMap((r) => {
500
+ let i = t[n]?.[r];
501
+ return e[n] !== pe.Log || i === void 0 || String(i).trim() === "" || !(Number(i) <= 0) ? [] : [{
502
502
  code: "log-range-ignored",
503
503
  severity: "warning",
504
- message: `${`${hn[r]}Range${i === "min" ? "Min" : "Max"}`} must be above 0 on a log axis; it is ignored.`
504
+ message: `${`${hn[n]}Range${r === "min" ? "Min" : "Max"}`} must be above 0 on a log axis; it is ignored.`
505
505
  }];
506
506
  }));
507
507
  }
508
- function xn(t, n, r, i, a) {
509
- let o = _n(t, n, pn, "error"), s = e(t, n);
510
- if (!s.y) return [...o, {
508
+ function xn(e, t, n, r, i) {
509
+ let a = _n(e, t, pn, "error"), o = fe(e, t);
510
+ if (!o.y) return [...a, {
511
511
  code: "scatter-missing-y",
512
512
  severity: "error",
513
513
  key: "y",
514
514
  message: "Scatter needs at least two numeric columns."
515
515
  }];
516
- let c = bn(r, i);
517
- if (o.length) return [...o, ...c];
518
- let { points: l, dropped: u } = Te(t, s, r), d = v(a) ? De(l, a, r).skipped : [];
516
+ let s = bn(n, r);
517
+ if (a.length) return [...a, ...s];
518
+ let { points: c, dropped: l } = Ee(e, o, n), u = ft(i) ? v(c, i, n).skipped : [];
519
519
  return [
520
- ...vn(u, mn),
521
- ...yn(d),
522
- ...c
520
+ ...vn(l, mn),
521
+ ...yn(u),
522
+ ...s
523
523
  ];
524
524
  }
525
525
  //#endregion
@@ -547,14 +547,14 @@ function Tn(e, t) {
547
547
  }] : [];
548
548
  }
549
549
  function En(e, t) {
550
- return e.dotStyle !== a.Range || t === "range" ? [] : [{
550
+ return e.dotStyle !== Pt.Range || t === "range" ? [] : [{
551
551
  code: "missing-range-columns",
552
552
  severity: "warning",
553
553
  message: "Range style needs a low and a high column. Pick them in low and high."
554
554
  }];
555
555
  }
556
556
  function Dn(e, t, n) {
557
- let r = ht(e, t), { rows: i, dropped: a } = m(e, r, n);
557
+ let r = re(e, t), { rows: i, dropped: a } = Se(e, r, n);
558
558
  return [
559
559
  ..._n(e, t, Sn, "warning"),
560
560
  ...En(t, r.mode),
@@ -608,7 +608,7 @@ var On = /* @__PURE__ */ new Set([
608
608
  "fixedHeight",
609
609
  "fixedWidth",
610
610
  "maxWidth"
611
- ]), G = ut, jn = /* @__PURE__ */ new Set([
611
+ ]), G = st, jn = /* @__PURE__ */ new Set([
612
612
  "text",
613
613
  "repeat",
614
614
  "textColor",
@@ -689,7 +689,7 @@ function Ln(e, t, n) {
689
689
  }
690
690
  function Rn(e, t, n, r) {
691
691
  let i = t.value, a = String(i).toLowerCase();
692
- if (e.type === fe.Boolean) {
692
+ if (e.type === ce.Boolean) {
693
693
  if (e.key === "valueLabels" && a === "percent" || i === !0 || i === !1 || a === "true" || a === "false") return;
694
694
  r.push({
695
695
  code: "invalid-boolean",
@@ -706,7 +706,7 @@ function Rn(e, t, n, r) {
706
706
  }
707
707
  }
708
708
  function zn(e, t, n, r) {
709
- let i = g(e), a = /* @__PURE__ */ new Set([...i.map((e) => e.key), ...On]);
709
+ let i = C(e), a = /* @__PURE__ */ new Set([...i.map((e) => e.key), ...On]);
710
710
  for (let o of t) {
711
711
  let t = `${n}.${o.key}`;
712
712
  Ln(o, t, r);
@@ -726,36 +726,36 @@ function zn(e, t, n, r) {
726
726
  }
727
727
  }
728
728
  function Bn(e) {
729
- return e === r.Range ? Pn : e === r.Free ? Fn : jn;
729
+ return e === E.Range ? Pn : e === E.Free ? Fn : jn;
730
730
  }
731
731
  function Vn(e) {
732
- return de[e];
732
+ return l[e];
733
733
  }
734
734
  function Hn(e, t, n) {
735
- e.forEach((e, i) => {
736
- let a = e.kind ?? r.Point, o = Bn(a), s = Vn(a);
737
- for (let r of e.properties) {
738
- let e = `${t}.${s}[${i}].${r.key}`;
739
- Ln(r, e, n), !o.has(r.key) && n.push({
735
+ e.forEach((e, r) => {
736
+ let i = e.kind ?? E.Point, a = Bn(i), o = Vn(i);
737
+ for (let i of e.properties) {
738
+ let e = `${t}.${o}[${r}].${i.key}`;
739
+ Ln(i, e, n), !a.has(i.key) && n.push({
740
740
  code: "unknown-annotation-property",
741
741
  path: e,
742
- message: `Unknown ${s} property "${r.key}"; it will be silently ignored.`,
743
- suggestion: U(r.key, o)
742
+ message: `Unknown ${o} property "${i.key}"; it will be silently ignored.`,
743
+ suggestion: U(i.key, a)
744
744
  });
745
745
  }
746
- let c = y(e.properties).get("repeat");
747
- if (c !== void 0) {
748
- let e = String(c).toLowerCase();
749
- e === "true" || e === "false" || typeof c == "number" && Number.isInteger(c) && c >= 1 || n.push({
746
+ let s = b(e.properties).get("repeat");
747
+ if (s !== void 0) {
748
+ let e = String(s).toLowerCase();
749
+ e === "true" || e === "false" || typeof s == "number" && Number.isInteger(s) && s >= 1 || n.push({
750
750
  code: "invalid-annotation-repeat",
751
- message: `repeat must be false, true, or a positive integer (got ${String(c)})`,
752
- path: `${t}.${s}[${i}].repeat`
751
+ message: `repeat must be false, true, or a positive integer (got ${String(s)})`,
752
+ path: `${t}.${o}[${r}].repeat`
753
753
  });
754
754
  }
755
755
  });
756
756
  }
757
757
  function Un(e, t, n, r) {
758
- let i = g(e);
758
+ let i = C(e);
759
759
  t.forEach((e, t) => {
760
760
  for (let a of e.properties) {
761
761
  let e = `${n}.series[${t}].${a.key}`;
@@ -829,7 +829,7 @@ function Kn(e, t) {
829
829
  });
830
830
  }
831
831
  function qn(e) {
832
- let t = [], n = [], r = S(), i = r.includes(e.chartType);
832
+ let t = [], n = [], r = g(), i = r.includes(e.chartType);
833
833
  i || t.push({
834
834
  code: "unknown-chart-type",
835
835
  path: "chartType",
@@ -841,10 +841,10 @@ function qn(e) {
841
841
  code: "missing-data",
842
842
  path: "data",
843
843
  message: e.data && e.data.entries.length === 0 ? "Data block is empty." : "Chart has no data."
844
- }), e.data && Jn(e.data.entries, n), e.data && Yn(e.data.entries, n), Kn(e, n), e.chartType === p.Scatter && Zn(e.data, e.properties, "chart", "data", t, n), e.chartType === p.DotPlot && Qn(e.data, e.properties, "chart", "data", n), e.scenes.forEach((r, i) => {
844
+ }), e.data && Jn(e.data.entries, n), e.data && Yn(e.data.entries, n), Kn(e, n), e.chartType === x.Scatter && Zn(e.data, e.properties, "chart", "data", t, n), e.chartType === x.DotPlot && Qn(e.data, e.properties, "chart", "data", n), e.scenes.forEach((r, i) => {
845
845
  Xn(r, e.chartType, i, t);
846
846
  let a = r.properties.find((e) => e.key === "type")?.value ?? e.chartType;
847
- a === p.Scatter && Zn(r.data, [...e.properties, ...r.properties], `scene[${i}]`, `scene[${i}].data`, t, n), a === p.DotPlot && Qn(r.data, [...e.properties, ...r.properties], `scene[${i}]`, `scene[${i}].data`, n);
847
+ a === x.Scatter && Zn(r.data, [...e.properties, ...r.properties], `scene[${i}]`, `scene[${i}].data`, t, n), a === x.DotPlot && Qn(r.data, [...e.properties, ...r.properties], `scene[${i}]`, `scene[${i}].data`, n);
848
848
  }), {
849
849
  valid: t.length === 0,
850
850
  errors: t,
@@ -879,16 +879,16 @@ function Yn(e, t) {
879
879
  }
880
880
  function Xn(e, t, n, r) {
881
881
  let i = `scene[${n}]`, a = e.properties.find((e) => e.key === "type")?.value, o = a == null ? t : String(a);
882
- a != null && !S().includes(o) ? r.push({
882
+ a != null && !g().includes(o) ? r.push({
883
883
  code: "unknown-chart-type",
884
884
  path: `${i}.type`,
885
885
  message: `Unknown chart type "${o}".`,
886
- suggestion: U(o, S())
886
+ suggestion: U(o, g())
887
887
  }) : (zn(o, e.properties, i, r), Un(o, e.series, i, r)), Wn(e.transforms, i, r), Hn(e.annotations, i, r);
888
888
  }
889
889
  function Zn(e, t, n, r, i, a) {
890
890
  if (!e || e.entries.length === 0) return;
891
- let o = y(t), s = (e) => o.has(e) ? String(o.get(e)) : void 0, c = (e) => s(e), l = (e) => ({
891
+ let o = b(t), s = (e) => o.has(e) ? String(o.get(e)) : void 0, c = (e) => s(e), l = (e) => ({
892
892
  min: s(`${e}RangeMin`),
893
893
  max: s(`${e}RangeMax`)
894
894
  }), u = {
@@ -903,16 +903,16 @@ function Zn(e, t, n, r, i, a) {
903
903
  x: l("horizontal"),
904
904
  y: l("vertical")
905
905
  };
906
- for (let t of xn(x(w(e)), u, d, f, s("trend"))) (t.severity === "error" ? i : a).push($n(t, t.key ? `${n}.${t.key}` : r));
906
+ for (let t of xn(y(T(e)), u, d, f, s("trend"))) (t.severity === "error" ? i : a).push($n(t, t.key ? `${n}.${t.key}` : r));
907
907
  }
908
908
  function Qn(e, t, n, r, i) {
909
909
  if (!e || e.entries.length === 0) return;
910
- let a = y(t), o = (e) => a.has(e) ? String(a.get(e)) : void 0, s = {
910
+ let a = b(t), o = (e) => a.has(e) ? String(a.get(e)) : void 0, s = {
911
911
  dotStyle: o("dotStyle"),
912
912
  low: o("low"),
913
913
  high: o("high")
914
914
  };
915
- for (let t of Dn(x(w(e)), s, o("horizontalScaleType"))) i.push($n(t, t.key ? `${n}.${t.key}` : r));
915
+ for (let t of Dn(y(T(e)), s, o("horizontalScaleType"))) i.push($n(t, t.key ? `${n}.${t.key}` : r));
916
916
  }
917
917
  function $n({ code: e, message: t, suggestion: n }, r) {
918
918
  return {
@@ -945,7 +945,7 @@ function Cr(e) {
945
945
  return n ? [`series = "${String(n.value)}"`, ...t.filter((e) => !(e.key === "series" && !e.quotedKey)).map((e) => `"${e.key}" = "${String(e.value)}"`)].join("\n") : t.map((e) => `"${e.key}" = ${String(e.value)}`).join("\n");
946
946
  }
947
947
  function q(e, t) {
948
- let n = b(t);
948
+ let n = Rt(t);
949
949
  return {
950
950
  id: e,
951
951
  title: xr(n, "title"),
@@ -1004,7 +1004,7 @@ function Or() {
1004
1004
  };
1005
1005
  },
1006
1006
  renderToContainer(e, t, n) {
1007
- st(e, t, {
1007
+ it(e, t, {
1008
1008
  sceneIndex: n.sceneIndex,
1009
1009
  thumbnail: n.thumbnail ?? !1,
1010
1010
  transition: !1,
@@ -1087,32 +1087,32 @@ function Kr(e) {
1087
1087
  return /r?em$/.test(e) ? t * 16 : t;
1088
1088
  }
1089
1089
  function qr(e) {
1090
- let t = e.frame ?? {}, n = Ur(e.theme), [r, i, a, o] = l(t.padding ?? Rr).map(Kr), s = Math.max(e.width - o - i, 1), c = Gr(), u = [], d = r;
1091
- t.title && (d = Z(u, X(t.title, s, Mr, !0, c), {
1090
+ let t = e.frame ?? {}, n = Ur(e.theme), [r, i, a, o] = d(t.padding ?? Rr).map(Kr), s = Math.max(e.width - o - i, 1), c = Gr(), l = [], u = r;
1091
+ t.title && (u = Z(l, X(t.title, s, Mr, !0, c), {
1092
1092
  x: o,
1093
- top: d,
1093
+ top: u,
1094
1094
  fontSize: Mr,
1095
1095
  fontWeight: "bold",
1096
1096
  fill: n.color
1097
- })), t.description && (d = Z(u, X(t.description, s, Nr, !1, c), {
1097
+ })), t.description && (u = Z(l, X(t.description, s, Nr, !1, c), {
1098
1098
  x: o,
1099
- top: t.title ? d + Pr : d,
1099
+ top: t.title ? u + Pr : u,
1100
1100
  fontSize: Nr,
1101
1101
  fill: n.color
1102
1102
  }));
1103
- let f = d, p = t.note ? X(t.note, s, J, !1, c) : [], m = c(zr, J, !1), h = [t.byline, t.source ? Br + t.source : ""].filter(Boolean).join(Vr), g = h ? X(h, Math.max(s - m - Ir, 1), J, !1, c) : [], ee = Math.max(g.length, 1), te = p.length * J * Y + Fr + ee * J * Y + a, _ = Math.max(e.height - f - te, Lr), v = f + _;
1104
- return v = Z(u, p, {
1103
+ let f = u, p = t.note ? X(t.note, s, J, !1, c) : [], m = c(zr, J, !1), h = [t.byline, t.source ? Br + t.source : ""].filter(Boolean).join(Vr), g = h ? X(h, Math.max(s - m - Ir, 1), J, !1, c) : [], ee = Math.max(g.length, 1), te = p.length * J * Y + Fr + ee * J * Y + a, _ = Math.max(e.height - f - te, Lr), v = f + _;
1104
+ return v = Z(l, p, {
1105
1105
  x: o,
1106
1106
  top: v,
1107
1107
  fontSize: J,
1108
1108
  fontStyle: "italic",
1109
1109
  fill: n.color
1110
- }) + Fr, Z(u, g, {
1110
+ }) + Fr, Z(l, g, {
1111
1111
  x: o,
1112
1112
  top: v,
1113
1113
  fontSize: J,
1114
1114
  fill: n.color
1115
- }), Z(u, [zr], {
1115
+ }), Z(l, [zr], {
1116
1116
  x: e.width - i,
1117
1117
  top: v,
1118
1118
  fontSize: J,
@@ -1128,7 +1128,7 @@ function qr(e) {
1128
1128
  width: s,
1129
1129
  height: _
1130
1130
  },
1131
- blocks: u,
1131
+ blocks: l,
1132
1132
  background: t.transparentBackground ? null : n.background,
1133
1133
  color: n.color,
1134
1134
  fontFamily: jr
@@ -1177,7 +1177,7 @@ async function $r() {
1177
1177
  async function ei(e, t = {}) {
1178
1178
  let n;
1179
1179
  try {
1180
- n = Ne(b(e));
1180
+ n = Me(Rt(e));
1181
1181
  } catch (e) {
1182
1182
  throw new Tr(e instanceof Error ? e.message : String(e), { cause: e });
1183
1183
  }
@@ -1190,7 +1190,7 @@ async function ei(e, t = {}) {
1190
1190
  let { background: n, color: r } = Ur(t);
1191
1191
  e.style.backgroundColor = n, e.style.setProperty("--bc-text-color", r);
1192
1192
  }
1193
- let s = t.theme === "auto" ? void 0 : t.theme, c = s ? null : zt();
1193
+ let s = t.theme === "auto" ? void 0 : t.theme, c = s ? null : Ft();
1194
1194
  function l(e) {
1195
1195
  return s ?? e ?? (c?.matches ? "dark" : void 0);
1196
1196
  }
@@ -1198,7 +1198,7 @@ async function ei(e, t = {}) {
1198
1198
  r.renderToContainer(e, n, {
1199
1199
  sceneIndex: i,
1200
1200
  thumbnail: t,
1201
- theme: l(C(n, i).theme)
1201
+ theme: l(w(n, i).theme)
1202
1202
  });
1203
1203
  }
1204
1204
  let d = /* @__PURE__ */ new Map();
@@ -1208,7 +1208,7 @@ async function ei(e, t = {}) {
1208
1208
  }), d.size || c?.removeEventListener("change", f);
1209
1209
  }
1210
1210
  function p(e) {
1211
- let t = e.width ?? a.width, s = e.height ?? a.height, c = C(n, a.sceneIndex), d = l(c.theme);
1211
+ let t = e.width ?? a.width, s = e.height ?? a.height, c = w(n, a.sceneIndex), d = l(c.theme);
1212
1212
  if (!i) {
1213
1213
  let { container: e, cleanup: n } = r.createContainer(t, s);
1214
1214
  try {
@@ -1225,7 +1225,7 @@ async function ei(e, t = {}) {
1225
1225
  }), { container: p, cleanup: m } = r.createContainer(f.plot.width, f.plot.height);
1226
1226
  try {
1227
1227
  o(p, d), u(p, !0, a.sceneIndex);
1228
- let e = _t(c.chartType, c.frame, c.data);
1228
+ let e = mt(c.chartType, c.frame, c.data);
1229
1229
  return Yr(f, r.serializeSvg(p), e);
1230
1230
  } finally {
1231
1231
  m();
@@ -1263,4 +1263,4 @@ async function ei(e, t = {}) {
1263
1263
  return m;
1264
1264
  }
1265
1265
  //#endregion
1266
- export { de as ANNOTATION_KIND_KEYWORD, tt as Anchor, r as AnnotationKind, et as AnnotationLineStyle, se as ArrowDirection, le as AxisDirection, Be as BC_TRANSITION_NAME, fe as ChartOptionType, Tr as ChartParseError, p as ChartType, _ as CompassDirection, oe as CrosshairDirection, he as CrosshairStyle, jt as DEFAULT_BAR_GAP, Dt as DEFAULT_COLORS, It as DirectLabelMode, a as DotStyle, Se as DslNodeType, ee as FilterCondition, be as FrameSizing, we as GridStyle, h as Interpolation, ie as LabelPosition, gt as LabelRotation, ne as LegendPosition, Oe as LineStyle, ke as MAPPING_NONE, Dr as MissingNodeRenderDepsError, Ot as NULL_VALUE, Ee as Orientation, Ae as ParseOperationCategory, Er as PngBrowserUnsupportedError, Rt as RESIZE_MESSAGE, me as RangeAnchor, t as ScaleType, Fe as SceneTransition, Ue as SortDirection, wt as SortMode, ct as StackMode, vt as StrokeStyle, Ze as SymbolShape, Pe as SymbolShowOn, dt as SymbolStyle, ut as TRANSFORM_TYPES, xt as TickPosition, ze as TransformType, rt as ValueLabelPosition, Le as adjustColorsForBackground, bt as applyTransformNodes, Re as applyTransformNodesToChartData, nt as applyTransformSteps, Ne as astToDefinition, ae as buildChartOptions, Yr as buildFrameSvg, Bt as buildSrcdoc, Ve as chartDataToTable, en as checkCvdColors, Ht as classifyIntent, Ge as cleanNumericValue, Xe as commitFadeOut, dn as compactSerialize, un as compactSerializeDeep, At as convertAnnotations, ve as convertAreaFills, u as convertColorizes, c as convertHighlights, ue as convertSeriesOverrides, Ft as createCanvas, Xt as createCvdSvgFilter, d as createFrame, w as dataEntriesToString, pt as detectColumnTypes, re as detectRangeColumn, n as extractChartTypeOptions, $e as extractSceneOverrides, Je as fadeIn, yt as featureJoin, St as getCachedChart, xe as getChart, g as getChartOptions, f as getChartTypeDefaults, Yt as getCvdFilterId, Ie as getOutputType, ft as getSceneTransition, Me as getTransitionDuration, at as isDateValue, Ye as isNumberValue, We as isSeriesHidden, Mt as isTypeCompatible, S as listCharts, He as listPalettes, Lt as listThemes, pe as numericColumns, b as parse, qe as parseBpcData, x as parseData, ge as parseOperationMap, o as parseOperations, y as propertyMap, T as quoteDslString, Kt as recommendCharts, Ce as registerChart, ei as render, Ct as renderBpc, st as renderChart, mt as renderHorizontalAxis, it as renderLegend, ot as renderVerticalAxis, Nt as resolveBackgroundColor, ye as resolveBarGapPadding, te as resolveChartTypeOptions, ht as resolveDotPlotMapping, Ke as resolvePalette, e as resolveScatterMapping, C as resolveScene, Tt as resolveSeriesColor, lt as resolveSeriesInterpolation, wr as samples, on as serialize, je as serializeTableData, Wt as shapeOf, Qt as simulateCvdColor, kt as snapshotForFadeOut, Qe as snapshotLiveAttrs, i as stripDigitGroupSpaces, ce as toBool, Et as transformNodesToSteps, Pt as transformValue, qn as validateChart, _e as wcagContrastRatio, s as wcagLevel };
1266
+ export { l as ANNOTATION_KIND_KEYWORD, ue as Anchor, E as AnnotationKind, r as AnnotationLineStyle, $e as ArrowDirection, oe as AxisDirection, yt as BC_TRANSITION_NAME, ce as ChartOptionType, Tr as ChartParseError, x as ChartType, p as CompassDirection, _ as CrosshairDirection, ae as CrosshairStyle, s as DEFAULT_BAR_GAP, tt as DEFAULT_COLORS, me as DirectLabelMode, Pt as DotStyle, a as DslNodeType, xe as FilterCondition, ee as FrameSizing, be as GridStyle, Ce as Interpolation, h as LabelPosition, ie as LabelRotation, pt as LegendPosition, ne as LineStyle, we as MAPPING_NONE, Dr as MissingNodeRenderDepsError, Tt as NULL_VALUE, De as Orientation, Te as ParseOperationCategory, Er as PngBrowserUnsupportedError, It as RESIZE_MESSAGE, ke as RangeAnchor, pe as ScaleType, Ze as SceneTransition, t as SortDirection, He as SortMode, xt as StackMode, at as StrokeStyle, ht as SymbolShape, Xe as SymbolShowOn, Ne as SymbolStyle, st as TRANSFORM_TYPES, ct as TickPosition, vt as TransformType, Re as ValueLabelPosition, Mt as adjustColorsForBackground, _t as applyTransformNodes, Le as applyTransformNodesToChartData, et as applyTransformSteps, Me as astToDefinition, te as buildChartOptions, Yr as buildFrameSvg, zt as buildSrcdoc, Be as chartDataToTable, $t as checkCvdColors, Vt as classifyIntent, We as cleanNumericValue, rt as commitFadeOut, dn as compactSerialize, un as compactSerializeDeep, Dt as convertAnnotations, _e as convertAreaFills, u as convertColorizes, c as convertHighlights, le as convertSeriesOverrides, Et as createCanvas, Yt as createCvdSvgFilter, ve as createFrame, T as dataEntriesToString, ut as detectColumnTypes, m as detectRangeColumn, n as extractChartTypeOptions, Qe as extractSceneOverrides, Ye as fadeIn, ot as featureJoin, lt as getCachedChart, i as getChart, C as getChartOptions, de as getChartTypeDefaults, Jt as getCvdFilterId, Fe as getOutputType, Pe as getSceneTransition, qe as getTransitionDuration, nt as isDateValue, Je as isNumberValue, e as isSeriesHidden, kt as isTypeCompatible, g as listCharts, wt as listPalettes, Lt as listThemes, Oe as numericColumns, Rt as parse, Ke as parseBpcData, y as parseData, he as parseOperationMap, o as parseOperations, b as propertyMap, S as quoteDslString, Gt as recommendCharts, ye as registerChart, ei as render, bt as renderBpc, it as renderChart, Ge as renderHorizontalAxis, ze as renderLegend, dt as renderVerticalAxis, Ie as resolveBackgroundColor, Ot as resolveBarGapPadding, f as resolveChartTypeOptions, re as resolveDotPlotMapping, Ve as resolvePalette, fe as resolveScatterMapping, w as resolveScene, Ue as resolveSeriesColor, St as resolveSeriesInterpolation, wr as samples, on as serialize, Ae as serializeTableData, Ut as shapeOf, Zt as simulateCvdColor, je as snapshotForFadeOut, gt as snapshotLiveAttrs, Nt as stripDigitGroupSpaces, se as toBool, Ct as transformNodesToSteps, jt as transformValue, qn as validateChart, At as wcagContrastRatio, ge as wcagLevel };