@blueprint-chart/lib 1.8.0 → 1.8.2

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.
@@ -6627,14 +6627,22 @@ Ji(_.AreaStacked, ki, [
6627
6627
  ...go
6628
6628
  ]);
6629
6629
  //#endregion
6630
- //#region src/charts/chart-helpers.ts
6630
+ //#region src/charts/number-parse.ts
6631
6631
  function wo(e) {
6632
- let t = e?.trim();
6632
+ return e.replace(/(\d)\s+(?=\d)/g, "$1");
6633
+ }
6634
+ function To(e) {
6635
+ return wo(e.replace(/^"(.*)"$/, "$1")).replace(/%$/, "").trim();
6636
+ }
6637
+ function Eo(e) {
6638
+ let t = To(e?.trim() ?? "");
6633
6639
  if (!t) return;
6634
- let n = Number.parseFloat(t);
6640
+ let n = Number(t);
6635
6641
  return Number.isFinite(n) ? n : void 0;
6636
6642
  }
6637
- function To(e) {
6643
+ //#endregion
6644
+ //#region src/charts/chart-helpers.ts
6645
+ function Do(e) {
6638
6646
  let t = e.split("\n").map((e) => e.trim()).filter(Boolean), n = [], r = [], i = t[0]?.match(/^series\s*=\s*(.+)$/);
6639
6647
  if (i) {
6640
6648
  let e = i[1].trim(), r = e.includes("\",\"") ? e.split(",").map((e) => e.trim().replace(/^"|"$/g, "")) : e.replace(/^"|"$/g, "").split(",").map((e) => e.trim()), a = r.map(() => []);
@@ -6643,7 +6651,7 @@ function To(e) {
6643
6651
  if (o) {
6644
6652
  n.push(o[1]);
6645
6653
  let e = o[2].split(",");
6646
- for (let t = 0; t < r.length; t++) a[t].push(wo(e[t]));
6654
+ for (let t = 0; t < r.length; t++) a[t].push(Eo(e[t]));
6647
6655
  }
6648
6656
  }
6649
6657
  let o = r.map((e, t) => ({
@@ -6658,36 +6666,36 @@ function To(e) {
6658
6666
  }
6659
6667
  for (let e of t) {
6660
6668
  let t = e.match(/^"([^"]+)"\s*=\s*(.+)$/);
6661
- t && (n.push(t[1]), r.push(wo(t[2])));
6669
+ t && (n.push(t[1]), r.push(Eo(t[2])));
6662
6670
  }
6663
6671
  return {
6664
6672
  labels: n,
6665
6673
  values: r
6666
6674
  };
6667
6675
  }
6668
- function Eo(e, t) {
6676
+ function Oo(e, t) {
6669
6677
  let n = {}, r = Ot(e.colorPalette);
6670
6678
  return r ? n.colors = r : e.colors && e.colors.length > 0 && (n.colors = e.colors), e.autoContrast && t && n.colors && (n.colors = ve(n.colors, t)), e.allowDarkMode !== void 0 && (n.allowDarkMode = e.allowDarkMode), n;
6671
6679
  }
6672
- function Do(e) {
6680
+ function ko(e) {
6673
6681
  let t = {};
6674
6682
  return e.legend !== void 0 && (t.legend = e.legend), e.legendPosition !== void 0 && (t.legendPosition = e.legendPosition), e.legendAnchor !== void 0 && (t.legendAnchor = e.legendAnchor), e.directLabelling !== void 0 && (t.directLabelling = e.directLabelling), e.directLabelAnchor !== void 0 && (t.directLabelAnchor = e.directLabelAnchor), t;
6675
6683
  }
6676
- function Oo(e) {
6684
+ function Ao(e) {
6677
6685
  if (!(e.showVerticalTicks !== void 0 || e.verticalGridStyle !== void 0 || e.verticalNumberFormat !== void 0 || e.showVerticalAxis !== void 0 || e.verticalAxisDirection !== void 0 || e.verticalScaleType !== void 0 || e.verticalLabelPosition !== void 0 || e.verticalRangeMin || e.verticalRangeMax)) return {};
6678
6686
  let t = {};
6679
6687
  e.showVerticalTicks !== void 0 && (t.showTicks = e.showVerticalTicks), e.verticalAxisDirection !== void 0 && (t.direction = e.verticalAxisDirection), e.verticalGridStyle !== void 0 && (t.gridStyle = e.verticalGridStyle), e.verticalNumberFormat !== void 0 && (t.numberFormat = e.verticalNumberFormat), e.showVerticalAxis !== void 0 && (t.showAxis = e.showVerticalAxis), e.verticalScaleType !== void 0 && (t.scaleType = e.verticalScaleType), e.verticalLabelPosition !== void 0 && (t.labelPosition = e.verticalLabelPosition);
6680
6688
  let n = $e(e.verticalRangeMin ?? ""), r = $e(e.verticalRangeMax ?? "");
6681
6689
  return (n !== void 0 || r !== void 0) && (t.range = {}, n !== void 0 && (t.range.min = n), r !== void 0 && (t.range.max = r)), { verticalAxis: t };
6682
6690
  }
6683
- function ko(e) {
6691
+ function jo(e) {
6684
6692
  if (!(e.showHorizontalTicks !== void 0 || e.horizontalGridStyle !== void 0 || e.horizontalNumberFormat !== void 0 || e.showHorizontalAxis !== void 0 || e.horizontalScaleType !== void 0 || e.horizontalLabelPosition !== void 0 || e.horizontalLabelRotation !== void 0 || e.horizontalRangeMin || e.horizontalRangeMax)) return {};
6685
6693
  let t = {};
6686
6694
  e.showHorizontalTicks !== void 0 && (t.showTicks = e.showHorizontalTicks), e.horizontalGridStyle !== void 0 && (t.gridStyle = e.horizontalGridStyle), e.horizontalNumberFormat !== void 0 && (t.numberFormat = e.horizontalNumberFormat), e.showHorizontalAxis !== void 0 && (t.showAxis = e.showHorizontalAxis), e.horizontalScaleType !== void 0 && (t.scaleType = e.horizontalScaleType), e.horizontalLabelPosition !== void 0 && (t.labelPosition = e.horizontalLabelPosition), e.horizontalLabelRotation !== void 0 && (t.labelRotation = e.horizontalLabelRotation);
6687
6695
  let n = $e(e.horizontalRangeMin ?? ""), r = $e(e.horizontalRangeMax ?? "");
6688
6696
  return (n !== void 0 || r !== void 0) && (t.range = {}, n !== void 0 && (t.range.min = n), r !== void 0 && (t.range.max = r)), { horizontalAxis: t };
6689
6697
  }
6690
- function Ao(e) {
6698
+ function Mo(e) {
6691
6699
  return e.lineSymbols ? { lineSymbols: {
6692
6700
  symbol: e.lineSymbolShape ?? M.Circle,
6693
6701
  showOn: e.lineSymbolShowOn ?? N.FirstLast,
@@ -6696,13 +6704,13 @@ function Ao(e) {
6696
6704
  opacity: parseFloat(e.lineSymbolOpacity ?? "1") || 1
6697
6705
  } } : {};
6698
6706
  }
6699
- function jo(e, t) {
6707
+ function No(e, t) {
6700
6708
  let n = {
6701
- ...Eo(e, t),
6702
- ...Do(e),
6703
- ...Oo(e),
6709
+ ...Oo(e, t),
6704
6710
  ...ko(e),
6705
- ...Ao(e)
6711
+ ...Ao(e),
6712
+ ...jo(e),
6713
+ ...Mo(e)
6706
6714
  };
6707
6715
  e.interpolation !== void 0 && (n.interpolation = e.interpolation), e.valueLabels !== void 0 && (n.valueLabels = e.valueLabels), e.valueLabelPosition !== void 0 && (n.valueLabelPosition = e.valueLabelPosition), e.tooltips !== void 0 && (n.tooltips = e.tooltips), e.crosshair !== void 0 && (n.crosshair = e.crosshair), e.crosshairDirection && (n.crosshairDirection = e.crosshairDirection), e.crosshairStyle && (n.crosshairStyle = e.crosshairStyle), e.crosshairColor && (n.crosshairColor = e.crosshairColor), e.displayAsPercentage !== void 0 && (n.displayAsPercentage = e.displayAsPercentage), e.showTotal !== void 0 && (n.showTotal = e.showTotal), e.showLabels !== void 0 && (n.showLabels = e.showLabels), e.showValues !== void 0 && (n.showValues = e.showValues), e.swapLabelValue !== void 0 && (n.swapLabelValue = e.swapLabelValue);
6708
6716
  let r = parseInt(e.sliceMax ?? "", 10);
@@ -6716,17 +6724,17 @@ function jo(e, t) {
6716
6724
  }
6717
6725
  //#endregion
6718
6726
  //#region src/charts/resolve.ts
6719
- var Mo = Object.create(null);
6720
- function No(e) {
6721
- if (!Mo[e]) {
6727
+ var Po = Object.create(null);
6728
+ function Fo(e) {
6729
+ if (!Po[e]) {
6722
6730
  let t = {};
6723
6731
  for (let n of Xi(e)) n.default !== void 0 && (t[n.key] = n.default);
6724
- Mo[e] = t;
6732
+ Po[e] = t;
6725
6733
  }
6726
- return Mo[e];
6734
+ return Po[e];
6727
6735
  }
6728
- function Po(e, t) {
6729
- let n = No(e);
6736
+ function Io(e, t) {
6737
+ let n = Fo(e);
6730
6738
  return t.colors?.length ? {
6731
6739
  ...n,
6732
6740
  colorPalette: void 0,
@@ -6738,12 +6746,12 @@ function Po(e, t) {
6738
6746
  }
6739
6747
  //#endregion
6740
6748
  //#region src/dsl/grammar.js
6741
- function Fo(e) {
6749
+ function Lo(e) {
6742
6750
  let t = 0;
6743
6751
  for (let n of e) n.type === "data" && t++;
6744
6752
  return t;
6745
6753
  }
6746
- function Io(e) {
6754
+ function Ro(e) {
6747
6755
  let t = {
6748
6756
  properties: [],
6749
6757
  data: null,
@@ -6784,7 +6792,7 @@ function Io(e) {
6784
6792
  }
6785
6793
  return t;
6786
6794
  }
6787
- function Lo(e) {
6795
+ function zo(e) {
6788
6796
  let t = {
6789
6797
  properties: [],
6790
6798
  data: null,
@@ -6821,7 +6829,7 @@ function Lo(e) {
6821
6829
  }
6822
6830
  return t;
6823
6831
  }
6824
- var Ro = class extends SyntaxError {
6832
+ var Bo = class extends SyntaxError {
6825
6833
  constructor(e, t, n, r) {
6826
6834
  super(e), this.expected = t, this.found = n, this.location = r, this.name = "SyntaxError";
6827
6835
  }
@@ -6892,7 +6900,7 @@ var Ro = class extends SyntaxError {
6892
6900
  return "Expected " + l(e) + " but " + u(t) + " found.";
6893
6901
  }
6894
6902
  };
6895
- function zo(e, t) {
6903
+ function Vo(e, t) {
6896
6904
  t = t === void 0 ? {} : t;
6897
6905
  let n = {}, r = t.grammarSource, i = { Chart: jt }, a = jt, o = "chart", s = "data", c = "colorize", l = "highlight", u = "area-fill", d = "annotation", f = "range", p = "note", m = "series", h = "scene", g = "transform", _ = /^[ \t]/, v = /^[^\t\n\r{}=]/, y = /^[a-zA-Z_#]/, b = /^[a-zA-Z0-9_#\-]/, x = /^[0-9]/, S = /^[eE]/, C = /^[+\-]/, w = /^[^"\\]/, T = /^[0-9a-fA-F]/, E = /^[^\n]/, D = /^[ \t\n\r]/, O = St("chart", !1), k = St("{", !1), A = St("}", !1), j = Ct([" ", " "], !1, !1, !1), M = St("data", !1), N = St("=", !1), P = St(",", !1), F = St(" ", !1), I = Ct([
6898
6906
  " ",
@@ -6924,8 +6932,8 @@ function zo(e, t) {
6924
6932
  "\r"
6925
6933
  ], !1, !1, !1), xe = Et("whitespace");
6926
6934
  function Se(e, t) {
6927
- Fo(t) > 1 && bt("duplicate data block — a chart or scene may define at most one data { } block");
6928
- let n = Io(t);
6935
+ Lo(t) > 1 && bt("duplicate data block — a chart or scene may define at most one data { } block");
6936
+ let n = Ro(t);
6929
6937
  return {
6930
6938
  type: "chart",
6931
6939
  chartType: e,
@@ -7077,8 +7085,8 @@ function zo(e, t) {
7077
7085
  bt("series needs a quoted name, e.g. series \"Revenue\" { ... }");
7078
7086
  }
7079
7087
  function qe(e, t) {
7080
- Fo(t) > 1 && bt("duplicate data block — a chart or scene may define at most one data { } block");
7081
- let n = Lo(t);
7088
+ Lo(t) > 1 && bt("duplicate data block — a chart or scene may define at most one data { } block");
7089
+ let n = zo(t);
7082
7090
  return {
7083
7091
  type: "scene",
7084
7092
  name: e ?? null,
@@ -7253,10 +7261,10 @@ function zo(e, t) {
7253
7261
  Y < _t || (Y > _t && (_t = Y, vt = []), vt.push(e));
7254
7262
  }
7255
7263
  function kt(e, t) {
7256
- return new Ro(e, null, null, t);
7264
+ return new Bo(e, null, null, t);
7257
7265
  }
7258
7266
  function At(e, t, n) {
7259
- return new Ro(Ro.buildMessage(e, t), e, t, n);
7267
+ return new Bo(Bo.buildMessage(e, t), e, t, n);
7260
7268
  }
7261
7269
  function jt() {
7262
7270
  let t, r, i, a, s, c, l, u;
@@ -7612,9 +7620,9 @@ function zo(e, t) {
7612
7620
  }
7613
7621
  //#endregion
7614
7622
  //#region src/dsl/parser.ts
7615
- function Bo(e) {
7623
+ function Ho(e) {
7616
7624
  try {
7617
- return zo(e);
7625
+ return Vo(e);
7618
7626
  } catch (e) {
7619
7627
  if (e instanceof Error && "location" in e) {
7620
7628
  let t = e.location, n = /* @__PURE__ */ SyntaxError(`${e.message} at ${t.start.line}:${t.start.column}`);
@@ -7625,21 +7633,21 @@ function Bo(e) {
7625
7633
  }
7626
7634
  //#endregion
7627
7635
  //#region src/dsl/converter.ts
7628
- function Vo(e) {
7636
+ function Uo(e) {
7629
7637
  return new Map(e.map((e) => [e.key, e.value]));
7630
7638
  }
7631
- function Ho(e, t) {
7632
- let n = Vo(t), r = Xi(e), i = new Set(r.map((e) => e.key)), a = {};
7639
+ function Wo(e, t) {
7640
+ let n = Uo(t), r = Xi(e), i = new Set(r.map((e) => e.key)), a = {};
7633
7641
  for (let e of r) {
7634
7642
  let t = n.get(e.key);
7635
7643
  t !== void 0 && i.has(e.key) && (e.type === W.Colors ? a[e.key] = String(t).split(",").map((e) => e.trim()).filter(Boolean) : e.type === W.Boolean ? e.key === "valueLabels" && String(t).toLowerCase() === "percent" ? a[e.key] = "percent" : a[e.key] = t === "true" || t === !0 : a[e.key] = String(t));
7636
7644
  }
7637
7645
  return a;
7638
7646
  }
7639
- function Uo(e) {
7647
+ function Go(e) {
7640
7648
  return !(/^-?\d+(\.\d+)?$/.test(e) || /^-?\d+(\.\d+)?%$/.test(e) || /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e));
7641
7649
  }
7642
- function Wo(e) {
7650
+ function Ko(e) {
7643
7651
  return e.entries.map((e) => {
7644
7652
  if (e.values && e.values.length > 1) {
7645
7653
  if (e.key === "series" && !e.quotedKey) return `series = ${e.values.map((e) => `"${e}"`).join(",")}`;
@@ -7647,17 +7655,17 @@ function Wo(e) {
7647
7655
  return `"${e.key}" = ${t}`;
7648
7656
  }
7649
7657
  let t = e.isPercentage ? `${e.value}%` : String(e.value);
7650
- return e.key === "series" && !e.quotedKey ? `series = "${t}"` : typeof e.value == "string" && Uo(t) ? `"${e.key}" = "${t}"` : `"${e.key}" = ${t}`;
7658
+ return e.key === "series" && !e.quotedKey ? `series = "${t}"` : typeof e.value == "string" && Go(t) ? `"${e.key}" = "${t}"` : `"${e.key}" = ${t}`;
7651
7659
  }).join("\n");
7652
7660
  }
7653
- function Go(e, t) {
7654
- let n = Vo(e.properties), r = n.get("type"), i = r ?? t;
7661
+ function qo(e, t) {
7662
+ let n = Uo(e.properties), r = n.get("type"), i = r ?? t;
7655
7663
  return {
7656
7664
  name: e.name,
7657
7665
  chartType: r,
7658
7666
  properties: n,
7659
7667
  data: e.data,
7660
- chartTypeOptions: Ho(i, e.properties),
7668
+ chartTypeOptions: Wo(i, e.properties),
7661
7669
  colorizes: e.colorizes,
7662
7670
  highlights: e.highlights,
7663
7671
  areaFills: e.areaFills,
@@ -7666,32 +7674,32 @@ function Go(e, t) {
7666
7674
  transforms: e.transforms
7667
7675
  };
7668
7676
  }
7669
- function Ko(e, t) {
7677
+ function Jo(e, t) {
7670
7678
  let n = e.find((e) => e.key === t);
7671
7679
  return n ? String(n.value) : void 0;
7672
7680
  }
7673
- function qo(e, t) {
7681
+ function Yo(e, t) {
7674
7682
  let n = e.find((e) => e.key === t);
7675
7683
  if (n) return n.isPercentage, n.value;
7676
7684
  }
7677
- function Jo(e) {
7685
+ function Xo(e) {
7678
7686
  let t = e.find((e) => e.key === "maxWidth");
7679
7687
  if (t) return t.isPercentage ? `${t.value}%` : t.value;
7680
7688
  }
7681
- var Yo = (e) => e === "true" || e === !0;
7682
- function Xo(e) {
7689
+ var Zo = (e) => e === "true" || e === !0;
7690
+ function Qo(e) {
7683
7691
  return e.map((e) => ({
7684
7692
  target: e.target,
7685
- color: Ko(e.properties, "color") ?? "#e15759",
7686
- label: Ko(e.properties, "label")
7693
+ color: Jo(e.properties, "color") ?? "#e15759",
7694
+ label: Jo(e.properties, "label")
7687
7695
  }));
7688
7696
  }
7689
- function Zo(e) {
7697
+ function $o(e) {
7690
7698
  return e.map((e) => ({ target: e.target }));
7691
7699
  }
7692
- function Qo(e) {
7700
+ function es(e) {
7693
7701
  return e.map((e) => {
7694
- let t = Vo(e.properties);
7702
+ let t = Uo(e.properties);
7695
7703
  return {
7696
7704
  from: e.from,
7697
7705
  to: e.to,
@@ -7702,64 +7710,64 @@ function Qo(e) {
7702
7710
  };
7703
7711
  });
7704
7712
  }
7705
- function $o(e) {
7713
+ function ts(e) {
7706
7714
  let t = e.get("repeat");
7707
7715
  if (t === !0 || t === "true") return "always";
7708
7716
  if (t === void 0 || t === !1 || t === "false") return;
7709
7717
  let n = Number(t);
7710
7718
  return Number.isInteger(n) && n >= 1 ? n : void 0;
7711
7719
  }
7712
- function es(e) {
7720
+ function ns(e) {
7713
7721
  return e.map((e) => {
7714
- let t = Vo(e.properties), n = e.kind ?? O.Point;
7722
+ let t = Uo(e.properties), n = e.kind ?? O.Point;
7715
7723
  if (n === O.Range) {
7716
7724
  let e = {
7717
7725
  kind: O.Range,
7718
7726
  start: t.has("start") ? isNaN(Number(t.get("start"))) ? String(t.get("start")) : Number(t.get("start")) : 0,
7719
7727
  end: t.has("end") ? isNaN(Number(t.get("end"))) ? String(t.get("end")) : Number(t.get("end")) : 0
7720
7728
  };
7721
- return e.repeat = $o(t), t.has("orientation") && (e.orientation = String(t.get("orientation"))), t.has("startAnchor") && (e.startAnchor = String(t.get("startAnchor"))), t.has("endAnchor") && (e.endAnchor = String(t.get("endAnchor"))), t.has("bgColor") && (e.bgColor = String(t.get("bgColor"))), t.has("bgOpacity") && (e.bgOpacity = Number(t.get("bgOpacity"))), t.has("direction") && (e.direction = String(t.get("direction"))), t.has("text") && (e.text = String(t.get("text"))), t.has("textColor") && (e.textColor = String(t.get("textColor"))), e;
7729
+ return e.repeat = ts(t), t.has("orientation") && (e.orientation = String(t.get("orientation"))), t.has("startAnchor") && (e.startAnchor = String(t.get("startAnchor"))), t.has("endAnchor") && (e.endAnchor = String(t.get("endAnchor"))), t.has("bgColor") && (e.bgColor = String(t.get("bgColor"))), t.has("bgOpacity") && (e.bgOpacity = Number(t.get("bgOpacity"))), t.has("direction") && (e.direction = String(t.get("direction"))), t.has("text") && (e.text = String(t.get("text"))), t.has("textColor") && (e.textColor = String(t.get("textColor"))), e;
7722
7730
  }
7723
7731
  if (n === O.Free) {
7724
7732
  let n = {
7725
7733
  kind: O.Free,
7726
7734
  text: String(t.get("text") ?? ""),
7727
- x: qo(e.properties, "x") ?? 0,
7728
- y: qo(e.properties, "y") ?? 0
7735
+ x: Yo(e.properties, "x") ?? 0,
7736
+ y: Yo(e.properties, "y") ?? 0
7729
7737
  };
7730
- n.repeat = $o(t), t.has("textColor") && (n.textColor = String(t.get("textColor")));
7731
- let r = Jo(e.properties);
7732
- return r !== void 0 && (n.maxWidth = r), t.has("textOutline") && (n.textOutline = Yo(t.get("textOutline"))), n;
7738
+ n.repeat = ts(t), t.has("textColor") && (n.textColor = String(t.get("textColor")));
7739
+ let r = Xo(e.properties);
7740
+ return r !== void 0 && (n.maxWidth = r), t.has("textOutline") && (n.textOutline = Zo(t.get("textOutline"))), n;
7733
7741
  }
7734
7742
  let r = "target" in e ? e.target : "", i = {
7735
7743
  kind: O.Point,
7736
7744
  target: r,
7737
7745
  text: String(t.get("text") ?? "")
7738
7746
  };
7739
- i.repeat = $o(t), t.has("textColor") && (i.textColor = String(t.get("textColor")));
7740
- let a = Jo(e.properties);
7741
- return a !== void 0 && (i.maxWidth = a), t.has("textOutline") && (i.textOutline = Yo(t.get("textOutline"))), t.has("showLine") && (i.showLine = Yo(t.get("showLine"))), t.has("anchorDirection") && (i.anchorDirection = String(t.get("anchorDirection"))), t.has("textOffsetX") && (i.textOffsetX = Number(t.get("textOffsetX"))), t.has("textOffsetY") && (i.textOffsetY = Number(t.get("textOffsetY"))), t.has("lineStyle") && (i.lineStyle = String(t.get("lineStyle"))), t.has("lineWeight") && (i.lineWeight = Number(t.get("lineWeight"))), t.has("showArrow") && (i.showArrow = Yo(t.get("showArrow"))), t.has("lineTargetDistance") && (i.lineTargetDistance = Number(t.get("lineTargetDistance"))), t.has("showCircle") && (i.showCircle = Yo(t.get("showCircle"))), t.has("circleSize") && (i.circleSize = Number(t.get("circleSize"))), t.has("circleStyle") && (i.circleStyle = String(t.get("circleStyle"))), t.has("circleColor") && (i.circleColor = String(t.get("circleColor"))), i;
7747
+ i.repeat = ts(t), t.has("textColor") && (i.textColor = String(t.get("textColor")));
7748
+ let a = Xo(e.properties);
7749
+ return a !== void 0 && (i.maxWidth = a), t.has("textOutline") && (i.textOutline = Zo(t.get("textOutline"))), t.has("showLine") && (i.showLine = Zo(t.get("showLine"))), t.has("anchorDirection") && (i.anchorDirection = String(t.get("anchorDirection"))), t.has("textOffsetX") && (i.textOffsetX = Number(t.get("textOffsetX"))), t.has("textOffsetY") && (i.textOffsetY = Number(t.get("textOffsetY"))), t.has("lineStyle") && (i.lineStyle = String(t.get("lineStyle"))), t.has("lineWeight") && (i.lineWeight = Number(t.get("lineWeight"))), t.has("showArrow") && (i.showArrow = Zo(t.get("showArrow"))), t.has("lineTargetDistance") && (i.lineTargetDistance = Number(t.get("lineTargetDistance"))), t.has("showCircle") && (i.showCircle = Zo(t.get("showCircle"))), t.has("circleSize") && (i.circleSize = Number(t.get("circleSize"))), t.has("circleStyle") && (i.circleStyle = String(t.get("circleStyle"))), t.has("circleColor") && (i.circleColor = String(t.get("circleColor"))), i;
7742
7750
  });
7743
7751
  }
7744
- function ts(e) {
7752
+ function rs(e) {
7745
7753
  return e.map((e) => {
7746
- let t = Vo(e.properties), n = { name: e.name };
7754
+ let t = Uo(e.properties), n = { name: e.name };
7747
7755
  if (t.has("color") && (n.color = String(t.get("color"))), t.has("lineWidth") && (n.lineWidth = Number(t.get("lineWidth"))), t.has("dash") && (n.dash = String(t.get("dash"))), t.has("interpolation") && (n.interpolation = String(t.get("interpolation"))), t.has("labelMode") && (n.labelMode = String(t.get("labelMode"))), t.has("labelText") && (n.labelText = String(t.get("labelText"))), t.has("valueLabels")) {
7748
7756
  let e = t.get("valueLabels");
7749
- n.valueLabels = String(e).toLowerCase() === "percent" ? "percent" : Yo(e);
7757
+ n.valueLabels = String(e).toLowerCase() === "percent" ? "percent" : Zo(e);
7750
7758
  }
7751
- return t.has("lineSymbols") && (n.lineSymbols = Yo(t.get("lineSymbols"))), t.has("hidden") && (n.hidden = Yo(t.get("hidden"))), t.has("symbolShape") && (n.symbolShape = String(t.get("symbolShape"))), t.has("symbolShowOn") && (n.symbolShowOn = String(t.get("symbolShowOn"))), t.has("symbolStyle") && (n.symbolStyle = String(t.get("symbolStyle"))), t.has("symbolSize") && (n.symbolSize = Number(t.get("symbolSize"))), t.has("symbolOpacity") && (n.symbolOpacity = Number(t.get("symbolOpacity"))), n;
7759
+ return t.has("lineSymbols") && (n.lineSymbols = Zo(t.get("lineSymbols"))), t.has("hidden") && (n.hidden = Zo(t.get("hidden"))), t.has("symbolShape") && (n.symbolShape = String(t.get("symbolShape"))), t.has("symbolShowOn") && (n.symbolShowOn = String(t.get("symbolShowOn"))), t.has("symbolStyle") && (n.symbolStyle = String(t.get("symbolStyle"))), t.has("symbolSize") && (n.symbolSize = Number(t.get("symbolSize"))), t.has("symbolOpacity") && (n.symbolOpacity = Number(t.get("symbolOpacity"))), n;
7752
7760
  });
7753
7761
  }
7754
7762
  //#endregion
7755
7763
  //#region src/render/ast-to-definition.ts
7756
- var ns = /* @__PURE__ */ new Set();
7757
- function rs(e, t, n) {
7764
+ var is = /* @__PURE__ */ new Set();
7765
+ function as(e, t, n) {
7758
7766
  let r = t;
7759
- for (let t of e) t.transformType === "sort" ? r = I.Total : ns.has(t.transformType) || (ns.add(t.transformType), console.warn(`[blueprint-chart] Unknown transform "${t.transformType}" in ${n}; ignored.`));
7767
+ for (let t of e) t.transformType === "sort" ? r = I.Total : is.has(t.transformType) || (is.add(t.transformType), console.warn(`[blueprint-chart] Unknown transform "${t.transformType}" in ${n}; ignored.`));
7760
7768
  return r;
7761
7769
  }
7762
- function is(e) {
7770
+ function os(e) {
7763
7771
  let t = (t) => {
7764
7772
  let n = e.get(t);
7765
7773
  return n == null ? void 0 : String(n) || void 0;
@@ -7775,18 +7783,18 @@ function is(e) {
7775
7783
  };
7776
7784
  return Object.values(r).some((e) => e !== void 0) ? r : void 0;
7777
7785
  }
7778
- function as(e) {
7779
- let t = Vo(e.properties), n = To(e.data ? Wo(e.data) : ""), r = t.get("sort"), i = r == null ? void 0 : String(r), a = i === F.Ascending || i === F.Descending ? i : void 0, o = t.get("theme"), s = t.get("sortMode"), c;
7780
- return (s === I.Total || s === I.WithinGroups || s === I.None) && (c = s), c = rs(e.transforms, c, "chart"), {
7786
+ function ss(e) {
7787
+ let t = Uo(e.properties), n = Do(e.data ? Ko(e.data) : ""), r = t.get("sort"), i = r == null ? void 0 : String(r), a = i === F.Ascending || i === F.Descending ? i : void 0, o = t.get("theme"), s = t.get("sortMode"), c;
7788
+ return (s === I.Total || s === I.WithinGroups || s === I.None) && (c = s), c = as(e.transforms, c, "chart"), {
7781
7789
  chartType: e.chartType,
7782
7790
  data: n,
7783
7791
  properties: e.properties,
7784
- frame: is(t),
7785
- colorizes: Xo(e.colorizes),
7786
- highlights: Zo(e.highlights),
7787
- areaFills: Qo(e.areaFills),
7788
- annotations: es(e.annotations),
7789
- seriesOverrides: ts(e.series),
7792
+ frame: os(t),
7793
+ colorizes: Qo(e.colorizes),
7794
+ highlights: $o(e.highlights),
7795
+ areaFills: es(e.areaFills),
7796
+ annotations: ns(e.annotations),
7797
+ seriesOverrides: rs(e.series),
7790
7798
  scenes: e.scenes,
7791
7799
  sort: a,
7792
7800
  sortMode: c,
@@ -7795,13 +7803,13 @@ function as(e) {
7795
7803
  }
7796
7804
  //#endregion
7797
7805
  //#region src/render/resolve-scene.ts
7798
- var os = /* @__PURE__ */ new Set();
7799
- function ss(e, t, n) {
7806
+ var cs = /* @__PURE__ */ new Set();
7807
+ function ls(e, t, n) {
7800
7808
  let r = t;
7801
- for (let t of e) t.transformType === "sort" ? r = I.Total : os.has(t.transformType) || (os.add(t.transformType), console.warn(`[blueprint-chart] Unknown transform "${t.transformType}" in ${n}; ignored.`));
7809
+ for (let t of e) t.transformType === "sort" ? r = I.Total : cs.has(t.transformType) || (cs.add(t.transformType), console.warn(`[blueprint-chart] Unknown transform "${t.transformType}" in ${n}; ignored.`));
7802
7810
  return r;
7803
7811
  }
7804
- function cs() {
7812
+ function us() {
7805
7813
  return {
7806
7814
  properties: /* @__PURE__ */ new Map(),
7807
7815
  chartTypeOptions: {},
@@ -7812,14 +7820,14 @@ function cs() {
7812
7820
  transforms: []
7813
7821
  };
7814
7822
  }
7815
- function ls(e, t, n) {
7816
- let r = cs();
7823
+ function ds(e, t, n) {
7824
+ let r = us();
7817
7825
  for (let i = 0; i <= t; i++) {
7818
- let a = e[i], o = Vo(a.properties), s = o.get("type");
7826
+ let a = e[i], o = Uo(a.properties), s = o.get("type");
7819
7827
  s && (r.chartType = s);
7820
7828
  let c = r.chartType ?? n;
7821
7829
  a.data && (r.data = a.data);
7822
- let l = Ho(c, a.properties);
7830
+ let l = Wo(c, a.properties);
7823
7831
  r.chartTypeOptions = {
7824
7832
  ...r.chartTypeOptions,
7825
7833
  ...l
@@ -7828,11 +7836,11 @@ function ls(e, t, n) {
7828
7836
  }
7829
7837
  return r;
7830
7838
  }
7831
- function us(e, t, n) {
7839
+ function fs(e, t, n) {
7832
7840
  return n < e ? !1 : t === "always" || n <= e + (typeof t == "number" ? t : 0);
7833
7841
  }
7834
- function ds(e, t) {
7835
- let n = e.options ?? (e.properties ? Po(e.chartType, Ho(e.chartType, e.properties)) : {}), r = {
7842
+ function ps(e, t) {
7843
+ let n = e.options ?? (e.properties ? Io(e.chartType, Wo(e.chartType, e.properties)) : {}), r = {
7836
7844
  chartType: e.chartType,
7837
7845
  data: e.data,
7838
7846
  options: n,
@@ -7850,25 +7858,25 @@ function ds(e, t) {
7850
7858
  theme: e.theme
7851
7859
  };
7852
7860
  if (t == null || !e.scenes || t < 0 || t >= e.scenes.length) return r;
7853
- let i = ls(e.scenes, t, e.chartType), a = i.chartType ?? e.chartType, o = i.data ? To(Wo(i.data)) : r.data, s = Object.keys(i.chartTypeOptions).length > 0 ? Po(a, {
7861
+ let i = ds(e.scenes, t, e.chartType), a = i.chartType ?? e.chartType, o = i.data ? Do(Ko(i.data)) : r.data, s = Object.keys(i.chartTypeOptions).length > 0 ? Io(a, {
7854
7862
  ...n,
7855
7863
  ...i.chartTypeOptions
7856
- }) : n, c = i.colorizes.length > 0 ? Xo(i.colorizes) : i.data ? [] : r.colorizes, l = t == null ? r.highlights : Zo(i.highlights), u = i.areaFills.length > 0 ? Qo(i.areaFills) : r.areaFills, d = (e.annotations ?? []).map((e, t) => ({
7864
+ }) : n, c = i.colorizes.length > 0 ? Qo(i.colorizes) : i.data ? [] : r.colorizes, l = t == null ? r.highlights : $o(i.highlights), u = i.areaFills.length > 0 ? es(i.areaFills) : r.areaFills, d = (e.annotations ?? []).map((e, t) => ({
7857
7865
  anchor: -1,
7858
7866
  key: e.key ?? `base:${t}:${e.kind}`,
7859
7867
  config: e
7860
7868
  }));
7861
- for (let n = 0; n <= t; n++) es(e.scenes[n].annotations).forEach((e, t) => {
7869
+ for (let n = 0; n <= t; n++) ns(e.scenes[n].annotations).forEach((e, t) => {
7862
7870
  d.push({
7863
7871
  anchor: n,
7864
7872
  key: e.key ?? `s${n}:${t}:${e.kind}`,
7865
7873
  config: e
7866
7874
  });
7867
7875
  });
7868
- let f = d.filter(({ anchor: e, config: n }) => us(e, n.repeat, t)).map(({ key: e, config: t }) => ({
7876
+ let f = d.filter(({ anchor: e, config: n }) => fs(e, n.repeat, t)).map(({ key: e, config: t }) => ({
7869
7877
  ...t,
7870
7878
  key: e
7871
- })), p = i.seriesOverrides.length > 0 ? ts(i.seriesOverrides) : r.seriesOverrides, m = ss(i.transforms, r.sortMode, `scene ${t}`), h = [
7879
+ })), p = i.seriesOverrides.length > 0 ? rs(i.seriesOverrides) : r.seriesOverrides, m = ls(i.transforms, r.sortMode, `scene ${t}`), h = [
7872
7880
  "title",
7873
7881
  "description",
7874
7882
  "source",
@@ -7900,52 +7908,52 @@ function ds(e, t) {
7900
7908
  }
7901
7909
  //#endregion
7902
7910
  //#region src/render/layout-constraints.ts
7903
- var fs = /* @__PURE__ */ new WeakMap();
7904
- function ps(e) {
7905
- let t = fs.get(e);
7911
+ var ms = /* @__PURE__ */ new WeakMap();
7912
+ function hs(e) {
7913
+ let t = ms.get(e);
7906
7914
  if (!(!t || t.size === 0)) {
7907
7915
  for (let n of t) e.style[n] = "";
7908
7916
  t.clear();
7909
7917
  }
7910
7918
  }
7911
- function ms(e, t) {
7912
- let n = fs.get(e);
7913
- n || (n = /* @__PURE__ */ new Set(), fs.set(e, n)), n.add(t);
7919
+ function gs(e, t) {
7920
+ let n = ms.get(e);
7921
+ n || (n = /* @__PURE__ */ new Set(), ms.set(e, n)), n.add(t);
7914
7922
  }
7915
- function hs(e, t, n) {
7916
- if (ps(e), n.ignoreLayout || !t) return { constrained: !1 };
7917
- let r = Vo(t), i = r.get("heightMode"), a = r.get("aspectRatio"), o = r.get("fixedHeight"), s = !1;
7923
+ function _s(e, t, n) {
7924
+ if (hs(e), n.ignoreLayout || !t) return { constrained: !1 };
7925
+ let r = Uo(t), i = r.get("heightMode"), a = r.get("aspectRatio"), o = r.get("fixedHeight"), s = !1;
7918
7926
  if (i === "aspect-ratio" && a) {
7919
7927
  let t = String(a).split(":").map(Number);
7920
- t.length === 2 && t[0] > 0 && t[1] > 0 && (e.style.aspectRatio = `${t[0]} / ${t[1]}`, e.style.height = "auto", ms(e, "aspectRatio"), ms(e, "height"), s = !0);
7921
- } else i === "fixed" && o && (e.style.height = `${o}px`, ms(e, "height"), s = !0);
7922
- return s && (e.style.display = "flex", e.style.flexDirection = "column", e.style.overflow = "hidden", ms(e, "display"), ms(e, "flexDirection"), ms(e, "overflow")), { constrained: s };
7928
+ t.length === 2 && t[0] > 0 && t[1] > 0 && (e.style.aspectRatio = `${t[0]} / ${t[1]}`, e.style.height = "auto", gs(e, "aspectRatio"), gs(e, "height"), s = !0);
7929
+ } else i === "fixed" && o && (e.style.height = `${o}px`, gs(e, "height"), s = !0);
7930
+ return s && (e.style.display = "flex", e.style.flexDirection = "column", e.style.overflow = "hidden", gs(e, "display"), gs(e, "flexDirection"), gs(e, "overflow")), { constrained: s };
7923
7931
  }
7924
7932
  //#endregion
7925
7933
  //#region src/render/cross-type-fade.ts
7926
- var gs = /* @__PURE__ */ new WeakMap();
7927
- function _s(e) {
7934
+ var vs = /* @__PURE__ */ new WeakMap();
7935
+ function ys(e) {
7928
7936
  e.querySelectorAll("[data-bc-fade-overlay]").forEach((e) => {
7929
7937
  typeof e.getAnimations == "function" && e.getAnimations().forEach((e) => e.cancel()), e.remove();
7930
7938
  });
7931
7939
  }
7932
- function vs(e, t, n) {
7940
+ function bs(e, t, n) {
7933
7941
  if (!n) return null;
7934
- let r = gs.get(e);
7935
- return !r || r === t ? null : (_s(e), He(e));
7942
+ let r = vs.get(e);
7943
+ return !r || r === t ? null : (ys(e), He(e));
7936
7944
  }
7937
- function ys(e, t, n) {
7938
- if (gs.set(e, t), n) {
7945
+ function xs(e, t, n) {
7946
+ if (vs.set(e, t), n) {
7939
7947
  let t = e.querySelector(".bc-frame .bc-frame-body");
7940
7948
  t && Ve(t), Ue(e, n);
7941
7949
  }
7942
7950
  }
7943
- function bs(e) {
7944
- gs.delete(e), _s(e);
7951
+ function Ss(e) {
7952
+ vs.delete(e), ys(e);
7945
7953
  }
7946
7954
  //#endregion
7947
7955
  //#region src/render/post-render.ts
7948
- function xs(e, t, n) {
7956
+ function Cs(e, t, n) {
7949
7957
  let r = e.querySelector(".bc-frame");
7950
7958
  if (!r) return;
7951
7959
  let i = [];
@@ -7957,9 +7965,9 @@ function xs(e, t, n) {
7957
7965
  }
7958
7966
  //#endregion
7959
7967
  //#region src/render/render-chart.ts
7960
- function Ss(e, t, n = {}) {
7961
- if (n.transition || (zn(e).interrupt(), e.replaceChildren(), bs(e)), t.data.labels.length === 0) {
7962
- n.transition && (zn(e).interrupt(), e.replaceChildren(), bs(e));
7968
+ function ws(e, t, n = {}) {
7969
+ if (n.transition || (zn(e).interrupt(), e.replaceChildren(), Ss(e)), t.data.labels.length === 0) {
7970
+ n.transition && (zn(e).interrupt(), e.replaceChildren(), Ss(e));
7963
7971
  return;
7964
7972
  }
7965
7973
  let r = t;
@@ -7971,11 +7979,11 @@ function Ss(e, t, n = {}) {
7971
7979
  }
7972
7980
  r = e;
7973
7981
  }
7974
- let i = hs(e, r.properties, n), a = ds(r, n.sceneIndex), o = Yi(a.chartType);
7982
+ let i = _s(e, r.properties, n), a = ps(r, n.sceneIndex), o = Yi(a.chartType);
7975
7983
  if (!o) return;
7976
- let s = vs(e, a.chartType, !!n.transition);
7984
+ let s = bs(e, a.chartType, !!n.transition);
7977
7985
  s && e.replaceChildren();
7978
- let c = pe(e), l = jo(a.options, c), u;
7986
+ let c = pe(e), l = No(a.options, c), u;
7979
7987
  if (n.thumbnail) u = null;
7980
7988
  else {
7981
7989
  let e = a.frame?.padding ?? n.padding ?? "16px";
@@ -7998,31 +8006,31 @@ function Ss(e, t, n = {}) {
7998
8006
  }, !!n.transition), n.transition && d.commit({
7999
8007
  duration: Be(),
8000
8008
  mode: n.transitionMode
8001
- }), xs(e, { theme: n.theme ?? a.theme }, i), ys(e, a.chartType, s);
8009
+ }), Cs(e, { theme: n.theme ?? a.theme }, i), xs(e, a.chartType, s);
8002
8010
  }
8003
8011
  //#endregion
8004
8012
  //#region src/render/render-bpc.ts
8005
- function Cs(e, t, n) {
8013
+ function Ts(e, t, n) {
8006
8014
  let r = document.createElement("div");
8007
8015
  r.style.cssText = "color: #888; font-family: monospace; padding: 0.75rem; white-space: pre-wrap;", r.textContent = `Blueprint Chart: ${t}\n${n}`, e.replaceChildren(r);
8008
8016
  }
8009
- function ws(e, t, n) {
8017
+ function Es(e, t, n) {
8010
8018
  if (!t) {
8011
8019
  n?.transition || e.replaceChildren();
8012
8020
  return;
8013
8021
  }
8014
8022
  let r;
8015
8023
  try {
8016
- r = Bo(t);
8024
+ r = Ho(t);
8017
8025
  } catch (t) {
8018
- Cs(e, "could not parse chart", t instanceof Error ? t.message : String(t));
8026
+ Ts(e, "could not parse chart", t instanceof Error ? t.message : String(t));
8019
8027
  return;
8020
8028
  }
8021
8029
  try {
8022
- Ss(e, as(r), n);
8030
+ ws(e, ss(r), n);
8023
8031
  } catch (t) {
8024
- Cs(e, "could not render chart", t instanceof Error ? t.message : String(t));
8032
+ Ts(e, "could not render chart", t instanceof Error ? t.message : String(t));
8025
8033
  }
8026
8034
  }
8027
8035
  //#endregion
8028
- export { v as $, Fn as A, Ve as B, Br as C, P as Ct, Wn as D, Zn as E, Ot as F, pe as G, He as H, Tt as I, re as J, ue as K, yt as L, At as M, jt as N, Vn as O, Q as P, E as Q, qe as R, Ji as S, N as St, zr as T, z as Tt, Ie as U, Le as V, ve as W, R as X, k as Y, O as Z, jo as _, F as _t, es as a, G as at, Xi as b, D as bt, Zo as c, b as ct, Ho as d, S as dt, W as et, Go as f, L as ft, Po as g, y as gt, No as h, A as ht, as as i, V as it, On as j, zn as k, ts as l, K as lt, Bo as m, j as mt, Ss as n, T as nt, Qo as o, q as ot, Vo as p, U as pt, de as q, ds as r, B as rt, Xo as s, w as st, ws as t, _ as tt, Wo as u, x as ut, To as v, I as vt, Ir as w, C as wt, Zi as x, M as xt, Yi as y, H as yt, Ue as z };
8036
+ export { E as $, zn as A, Ue as B, Ji as C, N as Ct, Zn as D, zr as E, z as Et, Q as F, ve as G, Le as H, Ot as I, de as J, pe as K, Tt as L, On as M, At as N, Wn as O, jt as P, O as Q, yt as R, Zi as S, M as St, Ir as T, C as Tt, He as U, Ve as V, Ie as W, k as X, re as Y, R as Z, No as _, y as _t, ns as a, V as at, Yi as b, H as bt, $o as c, w as ct, Wo as d, x as dt, v as et, qo as f, S as ft, Io as g, A as gt, Fo as h, j as ht, ss as i, B as it, Fn as j, Vn as k, rs as l, b as lt, Ho as m, U as mt, ws as n, _ as nt, es as o, G as ot, Uo as p, L as pt, ue as q, ps as r, T as rt, Qo as s, q as st, Es as t, W as tt, Ko as u, K as ut, Do as v, F as vt, Br as w, P as wt, Xi as x, D as xt, wo as y, I as yt, qe as z };
package/dist/runtime.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./render-bpc-Bp2OTJmu.js";
1
+ import { t as e } from "./render-bpc-By-iMMKD.js";
2
2
  import { n as t } from "./runtime-BnrDRLyH.js";
3
3
  //#region src/runtime/scenes.ts
4
4
  function n(e, t, n) {