@blueprint-chart/lib 2.2.1 → 2.2.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.
- package/dist/index.js +1 -1
- package/dist/lib/lib.iife.js +7 -7
- package/dist/node-backend/index.js +402 -406
- package/dist/{render-bpc-BMDQndK4.js → render-bpc-BnD9HqZ-.js} +534 -538
- package/dist/runtime.js +1 -1
- package/package.json +1 -1
|
@@ -70,15 +70,15 @@ var _ = Object.create, v = Object.defineProperty, y = Object.getOwnPropertyDescr
|
|
|
70
70
|
return e.Colors = "colors", e.Boolean = "boolean", e.Select = "select", e.Text = "text", e.NumberFormat = "numberFormat", e.DateFormat = "dateFormat", e;
|
|
71
71
|
}({}), Y = /* @__PURE__ */ function(e) {
|
|
72
72
|
return e.Off = "", e.Auto = "auto", e.Outside = "outside", e.Inside = "inside", e;
|
|
73
|
-
}({}), te = /* @__PURE__ */ function(e) {
|
|
74
|
-
return e.Linear = "linear", e.MonotoneX = "monotoneX", e.Step = "step", e.StepBefore = "stepBefore", e.StepAfter = "stepAfter", e.Basis = "basis", e.Cardinal = "cardinal", e.CatmullRom = "catmullRom", e;
|
|
75
73
|
}({}), X = /* @__PURE__ */ function(e) {
|
|
76
|
-
return e.
|
|
74
|
+
return e.Linear = "linear", e.MonotoneX = "monotoneX", e.Step = "step", e.StepBefore = "stepBefore", e.StepAfter = "stepAfter", e.Basis = "basis", e.Cardinal = "cardinal", e.CatmullRom = "catmullRom", e;
|
|
77
75
|
}({}), Z = /* @__PURE__ */ function(e) {
|
|
78
|
-
return e.
|
|
76
|
+
return e.Sort = "sort", e.Filter = "filter", e.HideColumns = "hide-columns", e.Transpose = "transpose", e.Parse = "parse", e.Rename = "rename", e.GroupBy = "group-by", e.Computed = "computed", e;
|
|
79
77
|
}({}), Q = /* @__PURE__ */ function(e) {
|
|
78
|
+
return e.Equals = "equals", e.NotEquals = "not-equals", e.Contains = "contains", e.GreaterThan = "greater-than", e.LessThan = "less-than", e;
|
|
79
|
+
}({}), $ = /* @__PURE__ */ function(e) {
|
|
80
80
|
return e.Type = "type", e.String = "string", e.Numeric = "numeric", e.Date = "date", e;
|
|
81
|
-
}({}),
|
|
81
|
+
}({}), te = [
|
|
82
82
|
{
|
|
83
83
|
name: "Blueprint",
|
|
84
84
|
label: "Blueprint",
|
|
@@ -644,14 +644,14 @@ var _ = Object.create, v = Object.defineProperty, y = Object.getOwnPropertyDescr
|
|
|
644
644
|
"#c71a08"
|
|
645
645
|
]
|
|
646
646
|
}
|
|
647
|
-
], ne = Object.fromEntries(
|
|
647
|
+
], ne = Object.fromEntries(te.map((e) => [e.name, e.colors]));
|
|
648
648
|
function re(e) {
|
|
649
649
|
if (!e) return;
|
|
650
650
|
let t = ne[e];
|
|
651
651
|
return t ? [...t] : void 0;
|
|
652
652
|
}
|
|
653
653
|
function ie() {
|
|
654
|
-
return
|
|
654
|
+
return te;
|
|
655
655
|
}
|
|
656
656
|
//#endregion
|
|
657
657
|
//#region src/charts/date-parse.ts
|
|
@@ -3733,64 +3733,64 @@ function sa(e, t, r = {}, i = !1) {
|
|
|
3733
3733
|
for (let t of e.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range")) for (let [e, n] of On(t)) o.set(e, n);
|
|
3734
3734
|
e.replaceChildren();
|
|
3735
3735
|
}
|
|
3736
|
-
let { body: d } = ke(e, r.frame), f = t.series ?? [], p = f.filter((e) => !Qi(e.name, r.seriesOverrides)), m = p.map((e) => e.name), h = Ki(r.colors ?? ra, f.length), g = r.seriesOverrides, _ = r.directLabelling === !0 || r.directLabelling === "auto" && r.legend !== !0 || !!r.directLabelling && r.directLabelling !== "auto", v = _ ? "direct" : r.legend === !1 ? "none" : "legend", y = r.valueLabels ?? !1, b = r.valueLabelPosition ?? G.Auto, x = typeof r.directLabelling == "string" ? r.directLabelling : r.directLabelling ? Y.Auto : Y.Off, S = r.legend !== !1 && !_, C = wt(d).width, w = r.legendPosition ?? "top", T = C > 0 && C < 350 && (w === "left" || w === "right") ? "top" : w, E = r.legendAnchor ?? "start", D = p.flatMap((e) => e.values), O = bt(D, r.verticalAxis?.range, r.verticalAxis?.numberFormat, r.verticalAxis?.scaleType), k = St(C, r.verticalAxis?.labelPosition, r.horizontalAxis?.labelPosition, r.verticalAxis?.direction, O), A = Math.max(0, C - (k.left ?? 50) - (k.right ?? 20)),
|
|
3737
|
-
j !== void 0 && (k.bottom = j);
|
|
3738
|
-
let M = k.top != null, N = Math.max(0, C - (k.left ?? 50) - (k.right ?? 20)), P = S ? Li(m, T, N) : {
|
|
3736
|
+
let { body: d } = ke(e, r.frame), f = t.series ?? [], p = f.filter((e) => !Qi(e.name, r.seriesOverrides)), m = p.map((e) => e.name), h = Ki(r.colors ?? ra, f.length), g = r.seriesOverrides, _ = r.directLabelling === !0 || r.directLabelling === "auto" && r.legend !== !0 || !!r.directLabelling && r.directLabelling !== "auto", v = _ ? "direct" : r.legend === !1 ? "none" : "legend", y = r.valueLabels ?? !1, b = r.valueLabelPosition ?? G.Auto, x = typeof r.directLabelling == "string" ? r.directLabelling : r.directLabelling ? Y.Auto : Y.Off, S = r.legend !== !1 && !_, C = wt(d).width, w = r.legendPosition ?? "top", T = C > 0 && C < 350 && (w === "left" || w === "right") ? "top" : w, E = r.legendAnchor ?? "start", D = p.flatMap((e) => e.values), O = bt(D, r.verticalAxis?.range, r.verticalAxis?.numberFormat, r.verticalAxis?.scaleType), k = St(C, r.verticalAxis?.labelPosition, r.horizontalAxis?.labelPosition, r.verticalAxis?.direction, O), A = k.top != null, j = Math.max(0, C - (k.left ?? 50) - (k.right ?? 20)), M = S ? Li(m, T, j) : {
|
|
3739
3737
|
width: 0,
|
|
3740
3738
|
height: 0
|
|
3741
|
-
},
|
|
3742
|
-
S && T === "top" && (
|
|
3743
|
-
let
|
|
3744
|
-
(
|
|
3745
|
-
let
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3739
|
+
}, N = S ? M.height + 15 : 0, P = { ...k };
|
|
3740
|
+
S && T === "top" && (P.top = N + (A ? 15 : 0)), S && T === "left" && (P.left = (P.left ?? 50) + M.width + 10), S && T === "right" && (P.right = (P.right ?? 20) + M.width + 10);
|
|
3741
|
+
let F = Math.max(0, C - (P.left ?? 50) - (P.right ?? 20));
|
|
3742
|
+
P.bottom = (nn(t.labels, F, r.horizontalAxis) ?? Math.max(P.bottom ?? 24, 24)) + (T === "bottom" ? N : 0);
|
|
3743
|
+
let I = _ || !!g?.some((e) => e.labelMode === "direct"), L = y !== !1 || !!g?.some((e) => e.valueLabels), R = I && x !== Y.Inside, z = L && b !== G.Inside, B = R && z ? aa : ia;
|
|
3744
|
+
(R || z) && (P.top = (P.top ?? 0) + B + oa);
|
|
3745
|
+
let { chartArea: V, width: H, height: U, margin: W } = Et(d, P), K = ct(s, W), [q, ee] = _e(D, r.verticalAxis?.range, r.verticalAxis?.scaleType);
|
|
3746
|
+
if (r.valueLabels && q < 0 && r.verticalAxis?.range?.min == null) {
|
|
3747
|
+
let e = ee - q;
|
|
3748
|
+
q -= e * .1;
|
|
3749
|
+
}
|
|
3750
|
+
let J = t.labels;
|
|
3751
3751
|
if (r.sortMode === "total") {
|
|
3752
3752
|
let e = t.labels.map((e, t) => ({
|
|
3753
3753
|
label: e,
|
|
3754
3754
|
index: t,
|
|
3755
3755
|
total: p.reduce((e, n) => e + (n.values[t] ?? 0), 0)
|
|
3756
3756
|
}));
|
|
3757
|
-
e.sort((e, t) => t.total - e.total),
|
|
3757
|
+
e.sort((e, t) => t.total - e.total), J = e.map((e) => e.label);
|
|
3758
3758
|
}
|
|
3759
|
-
let X = n.scaleBand().domain(
|
|
3760
|
-
u.attach(
|
|
3759
|
+
let X = n.scaleBand().domain(J).range([0, H]).padding(ge(r.barGap)), Z = n.scaleBand().domain(m).range([0, X.bandwidth()]).padding(.05), Q = r.verticalAxis?.scaleType === "log", $ = Q ? n.scaleSymlog().domain([q, ee]).nice().range([U, 0]) : n.scaleLinear().domain([q, ee]).nice().range([U, 0]);
|
|
3760
|
+
u.attach(V, K), u.update({
|
|
3761
3761
|
vertical: {
|
|
3762
3762
|
scale: $,
|
|
3763
|
-
height:
|
|
3763
|
+
height: U,
|
|
3764
3764
|
options: {
|
|
3765
3765
|
...r.verticalAxis,
|
|
3766
|
-
gridWidth:
|
|
3767
|
-
topPadding:
|
|
3766
|
+
gridWidth: H,
|
|
3767
|
+
topPadding: W.top
|
|
3768
3768
|
}
|
|
3769
3769
|
},
|
|
3770
3770
|
horizontal: {
|
|
3771
3771
|
scale: X,
|
|
3772
|
-
height:
|
|
3772
|
+
height: U,
|
|
3773
3773
|
options: {
|
|
3774
3774
|
...r.horizontalAxis,
|
|
3775
|
-
width:
|
|
3775
|
+
width: H
|
|
3776
3776
|
}
|
|
3777
3777
|
}
|
|
3778
|
-
}), !Q &&
|
|
3779
|
-
let
|
|
3778
|
+
}), !Q && q < 0 && ee > 0 && n.select(V).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", H).attr("y1", $(0)).attr("y2", $(0)).attr("stroke", "#666").attr("stroke-width", 1);
|
|
3779
|
+
let te = /* @__PURE__ */ new Map();
|
|
3780
3780
|
r.sortMode === "within-groups" && t.labels.forEach((e, t) => {
|
|
3781
3781
|
let n = p.map((e) => ({
|
|
3782
3782
|
name: e.name,
|
|
3783
3783
|
value: e.values[t]
|
|
3784
3784
|
}));
|
|
3785
3785
|
n.sort((e, t) => t.value - e.value), n.forEach((t, n) => {
|
|
3786
|
-
|
|
3786
|
+
te.set(`${e}\0${t.name}`, m[n]);
|
|
3787
3787
|
});
|
|
3788
3788
|
});
|
|
3789
|
-
let
|
|
3789
|
+
let ne = [];
|
|
3790
3790
|
t.labels.forEach((e, t) => {
|
|
3791
3791
|
p.forEach((n) => {
|
|
3792
|
-
let i = f.findIndex((e) => e.name === n.name), a = r.sortMode === "within-groups" ?
|
|
3793
|
-
|
|
3792
|
+
let i = f.findIndex((e) => e.name === n.name), a = r.sortMode === "within-groups" ? te.get(`${e}\0${n.name}`) ?? n.name : n.name;
|
|
3793
|
+
ne.push({
|
|
3794
3794
|
label: e,
|
|
3795
3795
|
series: a,
|
|
3796
3796
|
seriesName: n.name,
|
|
@@ -3799,18 +3799,18 @@ function sa(e, t, r = {}, i = !1) {
|
|
|
3799
3799
|
});
|
|
3800
3800
|
});
|
|
3801
3801
|
});
|
|
3802
|
-
let
|
|
3802
|
+
let re = V.ownerSVGElement, ie = xr(re, e, "bars", {
|
|
3803
3803
|
x: 0,
|
|
3804
3804
|
y: 0,
|
|
3805
|
-
width:
|
|
3806
|
-
height:
|
|
3807
|
-
}),
|
|
3808
|
-
if (i) for (let e of c) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"),
|
|
3809
|
-
Br(
|
|
3805
|
+
width: H,
|
|
3806
|
+
height: U
|
|
3807
|
+
}), ae = n.select(V).append("g").attr("clip-path", `url(#${ie})`), oe = Or(e), se = Zr(r.highlights, ne.map((e) => e.seriesName)), ce = hr(r.colorizes), le = ae.append("g").node();
|
|
3808
|
+
if (i) for (let e of c) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"), le.appendChild(e);
|
|
3809
|
+
Br(oe, {
|
|
3810
3810
|
role: "mark-per-cell",
|
|
3811
|
-
parent:
|
|
3811
|
+
parent: le,
|
|
3812
3812
|
selector: ".bc-bar-multi",
|
|
3813
|
-
data:
|
|
3813
|
+
data: ne,
|
|
3814
3814
|
key: (e) => `${e.label}\0${e.seriesName}`,
|
|
3815
3815
|
insert: (e) => e.append("rect").attr("class", "bc-bar bc-bar-multi"),
|
|
3816
3816
|
attrs: (e) => {
|
|
@@ -3820,32 +3820,32 @@ function sa(e, t, r = {}, i = !1) {
|
|
|
3820
3820
|
y: Math.min($(0), $(e.value)),
|
|
3821
3821
|
width: Z.bandwidth(),
|
|
3822
3822
|
height: Math.abs($(e.value) - $(0)),
|
|
3823
|
-
fill:
|
|
3823
|
+
fill: ce.get(e.seriesName) ?? t
|
|
3824
3824
|
};
|
|
3825
|
-
return n < 1 && (r["fill-opacity"] = n),
|
|
3825
|
+
return n < 1 && (r["fill-opacity"] = n), se.size > 0 ? {
|
|
3826
3826
|
...r,
|
|
3827
|
-
opacity: Qr(
|
|
3827
|
+
opacity: Qr(se, e.seriesName)
|
|
3828
3828
|
} : r;
|
|
3829
3829
|
}
|
|
3830
3830
|
});
|
|
3831
|
-
let
|
|
3832
|
-
left:
|
|
3833
|
-
top:
|
|
3834
|
-
width:
|
|
3835
|
-
height:
|
|
3831
|
+
let ue = {
|
|
3832
|
+
left: W.left,
|
|
3833
|
+
top: W.top,
|
|
3834
|
+
width: H,
|
|
3835
|
+
height: U
|
|
3836
3836
|
};
|
|
3837
|
-
Jr(
|
|
3838
|
-
svg:
|
|
3839
|
-
clipId:
|
|
3840
|
-
group:
|
|
3837
|
+
Jr(oe, {
|
|
3838
|
+
svg: re,
|
|
3839
|
+
clipId: ie,
|
|
3840
|
+
group: V,
|
|
3841
3841
|
from: l,
|
|
3842
|
-
to:
|
|
3842
|
+
to: ue,
|
|
3843
3843
|
active: i && c.length > 0
|
|
3844
3844
|
});
|
|
3845
|
-
let
|
|
3846
|
-
if (r.tooltips &&
|
|
3847
|
-
width:
|
|
3848
|
-
height:
|
|
3845
|
+
let de = Cr(ae);
|
|
3846
|
+
if (r.tooltips && de.use(wn({ numberFormat: r.verticalAxis?.numberFormat })), r.crosshair && de.use(En({
|
|
3847
|
+
width: H,
|
|
3848
|
+
height: U,
|
|
3849
3849
|
direction: r.crosshairDirection,
|
|
3850
3850
|
style: r.crosshairStyle,
|
|
3851
3851
|
color: r.crosshairColor
|
|
@@ -3854,66 +3854,66 @@ function sa(e, t, r = {}, i = !1) {
|
|
|
3854
3854
|
label: e,
|
|
3855
3855
|
value: Math.max(...p.map((e) => e.values[t] ?? 0))
|
|
3856
3856
|
}));
|
|
3857
|
-
|
|
3857
|
+
de.use(mr(r.annotations, {
|
|
3858
3858
|
scaleX: X,
|
|
3859
3859
|
scaleY: $,
|
|
3860
3860
|
data: n,
|
|
3861
|
-
width:
|
|
3862
|
-
height:
|
|
3861
|
+
width: H,
|
|
3862
|
+
height: U,
|
|
3863
3863
|
backgroundColor: Ze(e),
|
|
3864
3864
|
transition: i,
|
|
3865
3865
|
priorAnnotations: o
|
|
3866
3866
|
}));
|
|
3867
3867
|
}
|
|
3868
|
-
let
|
|
3869
|
-
|
|
3868
|
+
let fe = () => de.draw(ne);
|
|
3869
|
+
oe.state === "committing" ? oe.register(fe) : fe(), vr(e, {
|
|
3870
3870
|
chartType: "bar-multi",
|
|
3871
|
-
margin:
|
|
3872
|
-
plotRect:
|
|
3873
|
-
}), a && (jt(
|
|
3874
|
-
let
|
|
3871
|
+
margin: W,
|
|
3872
|
+
plotRect: ue
|
|
3873
|
+
}), a && (jt(ae.node()), Nt(e, a));
|
|
3874
|
+
let pe = /* @__PURE__ */ new Set();
|
|
3875
3875
|
p.forEach((e) => {
|
|
3876
|
-
$i(e.name, v, g) === "direct" &&
|
|
3876
|
+
$i(e.name, v, g) === "direct" && pe.add(e.name);
|
|
3877
3877
|
});
|
|
3878
|
-
let
|
|
3879
|
-
function
|
|
3878
|
+
let me = pe.size > 0, he = Ze(e), ve = r.directLabelAnchor ?? "middle";
|
|
3879
|
+
function ye() {
|
|
3880
3880
|
return b === G.Inside ? G.Inside : (G.Outside, G.Outside);
|
|
3881
3881
|
}
|
|
3882
|
-
function
|
|
3883
|
-
return x === Y.Inside ? G.Inside : x === Y.Outside ? G.Outside : y ?
|
|
3882
|
+
function be(e) {
|
|
3883
|
+
return x === Y.Inside ? G.Inside : x === Y.Outside ? G.Outside : y ? ye() : G.Outside;
|
|
3884
3884
|
}
|
|
3885
|
-
function
|
|
3885
|
+
function xe(e, t, n) {
|
|
3886
3886
|
return n === "start" ? e + 12 : n === "end" ? e + t - 4 : e + t / 2;
|
|
3887
3887
|
}
|
|
3888
|
-
let
|
|
3889
|
-
|
|
3888
|
+
let Se = n.select(V).append("g").attr("class", "bc-value-labels");
|
|
3889
|
+
ne.forEach((e) => {
|
|
3890
3890
|
if (!ea(e.seriesName, y, g)) return;
|
|
3891
|
-
let t = (X(e.label) ?? 0) + (Z(e.series) ?? 0) + Z.bandwidth() / 2, n = Math.min($(0), $(e.value)), r = Math.abs($(e.value) - $(0)), i =
|
|
3892
|
-
i === G.Inside ? (l = Ye(Ji(e.seriesName, e.seriesIndex, h, g)), u = "central", c = a &&
|
|
3891
|
+
let t = (X(e.label) ?? 0) + (Z(e.series) ?? 0) + Z.bandwidth() / 2, n = Math.min($(0), $(e.value)), r = Math.abs($(e.value) - $(0)), i = ye(), a = me && pe.has(e.seriesName), o = e.value < 0, s = n + r, c, l, u;
|
|
3892
|
+
i === G.Inside ? (l = Ye(Ji(e.seriesName, e.seriesIndex, h, g)), u = "central", c = a && be(r) === G.Inside ? xe(n, r, ve) + 14 : n + r / 2) : (l = "currentColor", o ? (c = a && be(r) === G.Outside ? s + aa : s + ia, u = "hanging") : (c = a && be(r) === G.Outside ? n - aa : n - ia, u = "auto")), oi({
|
|
3893
3893
|
text: String(e.value),
|
|
3894
3894
|
placement: i === G.Inside ? "inside" : "outside",
|
|
3895
3895
|
orientation: "vertical",
|
|
3896
3896
|
barWidth: Z.bandwidth(),
|
|
3897
3897
|
barHeight: r
|
|
3898
|
-
}) &&
|
|
3899
|
-
}),
|
|
3900
|
-
if (!
|
|
3901
|
-
let t = (X(e.label) ?? 0) + (Z(e.series) ?? 0) + Z.bandwidth() / 2, r = Math.min($(0), $(e.value)), i = Math.abs($(e.value) - $(0)), a = g?.find((t) => t.name === e.seriesName)?.labelText || e.seriesName, o =
|
|
3898
|
+
}) && Se.append("text").attr("class", "bc-value-label").attr("data-series", e.seriesName).attr("x", t).attr("y", c).attr("text-anchor", "middle").attr("dominant-baseline", u).attr("font-size", "11px").attr("fill", l).text(String(e.value));
|
|
3899
|
+
}), ne.forEach((e) => {
|
|
3900
|
+
if (!pe.has(e.seriesName)) return;
|
|
3901
|
+
let t = (X(e.label) ?? 0) + (Z(e.series) ?? 0) + Z.bandwidth() / 2, r = Math.min($(0), $(e.value)), i = Math.abs($(e.value) - $(0)), a = g?.find((t) => t.name === e.seriesName)?.labelText || e.seriesName, o = be(i), s = Ji(e.seriesName, e.seriesIndex, h, g), c = n.select(V).append("text").attr("class", "bc-direct-label").attr("data-series", e.seriesName).attr("x", t).attr("text-anchor", "middle").attr("font-size", "10px").text(a);
|
|
3902
3902
|
if (o === G.Inside) {
|
|
3903
|
-
let e =
|
|
3904
|
-
c.attr("y", e).attr("fill", Ye(s)),
|
|
3905
|
-
} else c.attr("y", r - ia).attr("fill", Qe(s,
|
|
3903
|
+
let e = xe(r, i, ve);
|
|
3904
|
+
c.attr("y", e).attr("fill", Ye(s)), ve === "middle" && c.attr("dominant-baseline", "central");
|
|
3905
|
+
} else c.attr("y", r - ia).attr("fill", Qe(s, he));
|
|
3906
3906
|
});
|
|
3907
|
-
let
|
|
3908
|
-
if (S &&
|
|
3909
|
-
let e =
|
|
3907
|
+
let Ce = m.filter((e) => $i(e, v, g) === "legend");
|
|
3908
|
+
if (S && Ce.length > 0) {
|
|
3909
|
+
let e = Ce.map((e) => Ji(e, f.findIndex((t) => t.name === e), h, g)), t = 0, n = 0;
|
|
3910
3910
|
if (T === "top") {
|
|
3911
|
-
let e =
|
|
3912
|
-
n = -(
|
|
3913
|
-
} else T === "bottom" ? n =
|
|
3914
|
-
Wi(
|
|
3915
|
-
left:
|
|
3916
|
-
right:
|
|
3911
|
+
let e = A ? 15 : 0;
|
|
3912
|
+
n = -(M.height + 10 + e);
|
|
3913
|
+
} else T === "bottom" ? n = U + Math.max(W.bottom - N, 0) : T === "left" ? t = -(M.width + 10) : T === "right" && (t = H + 10);
|
|
3914
|
+
Wi(V, Ce, e, n, T, E, H, U, t, [], {
|
|
3915
|
+
left: W.left,
|
|
3916
|
+
right: W.right
|
|
3917
3917
|
});
|
|
3918
3918
|
}
|
|
3919
3919
|
}
|
|
@@ -4083,7 +4083,7 @@ function ba(e, t, r = {}, i = !1) {
|
|
|
4083
4083
|
for (let e of a) ee.appendChild(e);
|
|
4084
4084
|
for (let e of o) J.appendChild(e);
|
|
4085
4085
|
}
|
|
4086
|
-
let Y = Or(e),
|
|
4086
|
+
let Y = Or(e), X = [{
|
|
4087
4087
|
name: "line",
|
|
4088
4088
|
points: E
|
|
4089
4089
|
}];
|
|
@@ -4091,7 +4091,7 @@ function ba(e, t, r = {}, i = !1) {
|
|
|
4091
4091
|
role: "series-area",
|
|
4092
4092
|
parent: ee,
|
|
4093
4093
|
selector: ".bc-area",
|
|
4094
|
-
data: U ?
|
|
4094
|
+
data: U ? X : [],
|
|
4095
4095
|
key: (e) => e.name,
|
|
4096
4096
|
insert: (e) => e.append("path").attr("class", "bc-area"),
|
|
4097
4097
|
attrs: (e) => ({
|
|
@@ -4103,7 +4103,7 @@ function ba(e, t, r = {}, i = !1) {
|
|
|
4103
4103
|
role: "series-line",
|
|
4104
4104
|
parent: J,
|
|
4105
4105
|
selector: ".bc-line",
|
|
4106
|
-
data:
|
|
4106
|
+
data: X,
|
|
4107
4107
|
key: (e) => e.name,
|
|
4108
4108
|
insert: (e) => e.append("path").attr("class", "bc-line"),
|
|
4109
4109
|
attrs: (e) => ({
|
|
@@ -4112,7 +4112,7 @@ function ba(e, t, r = {}, i = !1) {
|
|
|
4112
4112
|
stroke: V
|
|
4113
4113
|
})
|
|
4114
4114
|
}), n.select(B).append("g").selectAll(".bc-dot").data(D, (e) => e.label).enter().append("circle").attr("class", "bc-dot").attr("cx", (e) => A(e)).attr("cy", (e) => P(e.value)).attr("r", 3).attr("fill", V).attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none");
|
|
4115
|
-
let
|
|
4115
|
+
let Z = {
|
|
4116
4116
|
left: x.left,
|
|
4117
4117
|
top: x.top,
|
|
4118
4118
|
width: y + 2,
|
|
@@ -4123,7 +4123,7 @@ function ba(e, t, r = {}, i = !1) {
|
|
|
4123
4123
|
clipId: R,
|
|
4124
4124
|
group: v,
|
|
4125
4125
|
from: d,
|
|
4126
|
-
to:
|
|
4126
|
+
to: Z,
|
|
4127
4127
|
active: i && (a.length > 0 || o.length > 0)
|
|
4128
4128
|
}), r.annotations?.length && pr(v, r.annotations, {
|
|
4129
4129
|
scaleX: k,
|
|
@@ -4171,7 +4171,7 @@ function ba(e, t, r = {}, i = !1) {
|
|
|
4171
4171
|
vr(e, {
|
|
4172
4172
|
chartType: "line",
|
|
4173
4173
|
margin: x,
|
|
4174
|
-
plotRect:
|
|
4174
|
+
plotRect: Z
|
|
4175
4175
|
}), c && (jt(z.node()), Nt(e, c));
|
|
4176
4176
|
}
|
|
4177
4177
|
//#endregion
|
|
@@ -4324,45 +4324,43 @@ function Pa(e, t, r = {}, i = !1) {
|
|
|
4324
4324
|
width: 0,
|
|
4325
4325
|
height: 0
|
|
4326
4326
|
}, V = w ? L.height + 15 : 0, H = { ...N };
|
|
4327
|
-
w && D === "top" && (H.top = V + (F ? 15 : 0)), w && D === "
|
|
4328
|
-
let U =
|
|
4329
|
-
U
|
|
4330
|
-
let { chartArea: W, width: G, height: K, margin: q } = Et(m, H), ee = ct(d, q), [J, Y] = _e(j, r.verticalAxis?.range, r.verticalAxis?.scaleType, !1), te = n.scalePoint().domain(a.labels).range([0, G]).padding(r.edgePadding ? .6 : 0), X = te, Z = (e) => te(a.labels[e]) ?? 0, Q = r.verticalAxis?.scaleType === "log" ? n.scaleSymlog().domain([J, Y]).nice().range([K, 0]) : n.scaleLinear().domain([J, Y]).nice().range([K, 0]), $ = Q.domain(), ne = $[0] < 0 && $[1] > 0 ? Q(0) : void 0;
|
|
4331
|
-
p.attach(W, ee), p.update({
|
|
4327
|
+
w && D === "top" && (H.top = V + (F ? 15 : 0)), w && D === "left" && (H.left = (H.left ?? 50) + L.width + 10), w && D === "right" && (H.right = (H.right ?? 20) + L.width + 10), P > 0 && (H.right = (H.right ?? 20) + P), H.bottom = (nn(a.labels, Math.max(0, T - (H.left ?? 50) - (H.right ?? 20)), r.horizontalAxis) ?? Math.max(H.bottom ?? 24, 24)) + (D === "bottom" ? V : 0);
|
|
4328
|
+
let { chartArea: U, width: W, height: G, margin: K } = Et(m, H), q = ct(d, K), [ee, J] = _e(j, r.verticalAxis?.range, r.verticalAxis?.scaleType, !1), Y = n.scalePoint().domain(a.labels).range([0, W]).padding(r.edgePadding ? .6 : 0), X = Y, Z = (e) => Y(a.labels[e]) ?? 0, Q = r.verticalAxis?.scaleType === "log" ? n.scaleSymlog().domain([ee, J]).nice().range([G, 0]) : n.scaleLinear().domain([ee, J]).nice().range([G, 0]), $ = Q.domain(), te = $[0] < 0 && $[1] > 0 ? Q(0) : void 0;
|
|
4329
|
+
p.attach(U, q), p.update({
|
|
4332
4330
|
vertical: {
|
|
4333
4331
|
scale: Q,
|
|
4334
|
-
height:
|
|
4332
|
+
height: G,
|
|
4335
4333
|
options: {
|
|
4336
4334
|
...r.verticalAxis,
|
|
4337
|
-
gridWidth:
|
|
4338
|
-
topPadding:
|
|
4335
|
+
gridWidth: W,
|
|
4336
|
+
topPadding: K.top
|
|
4339
4337
|
}
|
|
4340
4338
|
},
|
|
4341
4339
|
horizontal: {
|
|
4342
4340
|
scale: X,
|
|
4343
|
-
height:
|
|
4341
|
+
height: G,
|
|
4344
4342
|
options: {
|
|
4345
4343
|
...r.horizontalAxis,
|
|
4346
|
-
width:
|
|
4347
|
-
zeroY:
|
|
4344
|
+
width: W,
|
|
4345
|
+
zeroY: te
|
|
4348
4346
|
}
|
|
4349
4347
|
}
|
|
4350
4348
|
});
|
|
4351
|
-
let
|
|
4349
|
+
let ne = U.ownerSVGElement, re = xr(ne, e, "plot", {
|
|
4352
4350
|
x: 0,
|
|
4353
4351
|
y: 0,
|
|
4354
|
-
width:
|
|
4355
|
-
height:
|
|
4356
|
-
}),
|
|
4352
|
+
width: W,
|
|
4353
|
+
height: G
|
|
4354
|
+
}), ie = n.select(U).append("g").attr("clip-path", `url(#${re})`), ae = ie.node(), oe = g.map((e) => ({
|
|
4357
4355
|
name: e.name,
|
|
4358
4356
|
values: e.values,
|
|
4359
4357
|
colorIndex: h.findIndex((t) => t.name === e.name)
|
|
4360
|
-
})),
|
|
4361
|
-
r.areaFills?.length && Fa(
|
|
4362
|
-
let
|
|
4358
|
+
})), se = la(r.interpolation);
|
|
4359
|
+
r.areaFills?.length && Fa(ae, r.areaFills, g, Z, a.labels.length, Q, se);
|
|
4360
|
+
let ce = (e) => Number.isFinite(e), le = [];
|
|
4363
4361
|
g.forEach((e, t) => {
|
|
4364
4362
|
a.labels.forEach((n, r) => {
|
|
4365
|
-
|
|
4363
|
+
ce(e.values[r]) && le.push({
|
|
4366
4364
|
label: n,
|
|
4367
4365
|
value: e.values[r],
|
|
4368
4366
|
series: e.name,
|
|
@@ -4370,95 +4368,95 @@ function Pa(e, t, r = {}, i = !1) {
|
|
|
4370
4368
|
});
|
|
4371
4369
|
});
|
|
4372
4370
|
});
|
|
4373
|
-
let
|
|
4371
|
+
let ue = r.lineSymbols, de = {
|
|
4374
4372
|
solid: "",
|
|
4375
4373
|
dotted: "2,4",
|
|
4376
4374
|
dashed: "8,4",
|
|
4377
4375
|
"dash-dot": "8,4,2,4"
|
|
4378
|
-
},
|
|
4376
|
+
}, fe = r.valueLabels ?? !1, pe = Zr(r.highlights, v), me = r.areaFill ?? !1, ge = r.areaFillOpacity ?? .2, ve = (e) => y.get(e.name) ?? Ji(e.name, e.colorIndex, _, b), ye = n.area().curve(se).defined(ce).x((e, t) => Z(t)).y0(G).y1((e) => Q(e)), be = Or(e), xe = n.select(ae).append("g").node(), Se = n.select(ae).append("g").node(), Ce = new Set(oe.map((e) => e.name));
|
|
4379
4377
|
if (i) {
|
|
4380
|
-
for (let e of o)
|
|
4381
|
-
for (let e of s)
|
|
4378
|
+
for (let e of o) Ce.has(e.__data__?.name ?? "") && xe.appendChild(e);
|
|
4379
|
+
for (let e of s) Ce.has(e.__data__?.name ?? "") && Se.appendChild(e);
|
|
4382
4380
|
}
|
|
4383
|
-
Br(
|
|
4381
|
+
Br(be, {
|
|
4384
4382
|
role: "series-area",
|
|
4385
|
-
parent:
|
|
4383
|
+
parent: xe,
|
|
4386
4384
|
selector: ".bc-area",
|
|
4387
|
-
data:
|
|
4385
|
+
data: me ? oe : [],
|
|
4388
4386
|
key: (e) => e.name,
|
|
4389
4387
|
insert: (e) => e.append("path").attr("class", "bc-area"),
|
|
4390
4388
|
attrs: (e) => ({
|
|
4391
4389
|
"data-series": e.name,
|
|
4392
|
-
d:
|
|
4393
|
-
fill:
|
|
4394
|
-
opacity: Qr(
|
|
4390
|
+
d: ye(e.values) ?? "",
|
|
4391
|
+
fill: ve(e),
|
|
4392
|
+
opacity: Qr(pe, e.name, ge)
|
|
4395
4393
|
})
|
|
4396
|
-
}), Br(
|
|
4394
|
+
}), Br(be, {
|
|
4397
4395
|
role: "series-line",
|
|
4398
|
-
parent:
|
|
4396
|
+
parent: Se,
|
|
4399
4397
|
selector: ".bc-line",
|
|
4400
|
-
data:
|
|
4398
|
+
data: oe,
|
|
4401
4399
|
key: (e) => e.name,
|
|
4402
4400
|
insert: (e) => e.append("path").attr("class", "bc-line"),
|
|
4403
4401
|
attrs: (e) => {
|
|
4404
|
-
let t = Zi(e.name, r.interpolation ?? "linear", b), i = n.line().curve(la(t)).defined(
|
|
4402
|
+
let t = Zi(e.name, r.interpolation ?? "linear", b), i = n.line().curve(la(t)).defined(ce).x((e, t) => Z(t)).y((e) => Q(e));
|
|
4405
4403
|
return {
|
|
4406
4404
|
"data-series": e.name,
|
|
4407
4405
|
d: i(e.values) ?? "",
|
|
4408
4406
|
fill: "none",
|
|
4409
|
-
stroke:
|
|
4407
|
+
stroke: ve(e),
|
|
4410
4408
|
style: `stroke-width:${Xi(e.name, b)}`,
|
|
4411
|
-
"stroke-dasharray":
|
|
4412
|
-
opacity: Qr(
|
|
4409
|
+
"stroke-dasharray": de[Yi(e.name, b)] ?? "",
|
|
4410
|
+
opacity: Qr(pe, e.name, 1)
|
|
4413
4411
|
};
|
|
4414
4412
|
}
|
|
4415
|
-
}), n.select(
|
|
4413
|
+
}), n.select(ae).append("g").selectAll(".bc-dot").data(le, (e) => e.label + "\0" + e.series).enter().append("circle").attr("class", "bc-dot").attr("data-series", (e) => e.series).attr("cx", (e) => Z(a.labels.indexOf(e.label))).attr("cy", (e) => Q(e.value)).attr("r", 3).attr("fill", (e) => ve({
|
|
4416
4414
|
name: e.series,
|
|
4417
4415
|
values: [],
|
|
4418
4416
|
colorIndex: e.colorIndex
|
|
4419
4417
|
})).attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none");
|
|
4420
|
-
let
|
|
4421
|
-
left:
|
|
4422
|
-
top:
|
|
4423
|
-
width:
|
|
4424
|
-
height:
|
|
4418
|
+
let we = {
|
|
4419
|
+
left: K.left,
|
|
4420
|
+
top: K.top,
|
|
4421
|
+
width: W,
|
|
4422
|
+
height: G
|
|
4425
4423
|
};
|
|
4426
|
-
if (Jr(
|
|
4427
|
-
svg:
|
|
4428
|
-
clipId:
|
|
4429
|
-
group:
|
|
4424
|
+
if (Jr(be, {
|
|
4425
|
+
svg: ne,
|
|
4426
|
+
clipId: re,
|
|
4427
|
+
group: U,
|
|
4430
4428
|
from: f,
|
|
4431
|
-
to:
|
|
4429
|
+
to: we,
|
|
4432
4430
|
active: i && (s.length > 0 || o.length > 0)
|
|
4433
4431
|
}), r.annotations?.length) {
|
|
4434
4432
|
let t = a.labels.map((e, t) => ({
|
|
4435
4433
|
label: e,
|
|
4436
4434
|
value: g[0]?.values[t] ?? 0
|
|
4437
4435
|
}));
|
|
4438
|
-
pr(
|
|
4436
|
+
pr(U, r.annotations, {
|
|
4439
4437
|
scaleX: X,
|
|
4440
4438
|
scaleY: Q,
|
|
4441
4439
|
data: t,
|
|
4442
|
-
width:
|
|
4443
|
-
height:
|
|
4440
|
+
width: W,
|
|
4441
|
+
height: G,
|
|
4444
4442
|
backgroundColor: Ze(e),
|
|
4445
4443
|
transition: i,
|
|
4446
4444
|
priorAnnotations: u
|
|
4447
4445
|
});
|
|
4448
4446
|
}
|
|
4449
|
-
let
|
|
4450
|
-
|
|
4451
|
-
if (!ea(e.series,
|
|
4447
|
+
let Te = n.select(U).insert("g", () => ae.nextSibling).attr("class", "bc-value-labels");
|
|
4448
|
+
le.forEach((e) => {
|
|
4449
|
+
if (!ea(e.series, fe, b)) return;
|
|
4452
4450
|
let t = Z(a.labels.indexOf(e.label)), n = Q(e.value), r = fi(String(e.value), t, n, {
|
|
4453
|
-
width:
|
|
4454
|
-
height:
|
|
4455
|
-
margin:
|
|
4451
|
+
width: W,
|
|
4452
|
+
height: G,
|
|
4453
|
+
margin: K
|
|
4456
4454
|
});
|
|
4457
|
-
|
|
4458
|
-
}), (r.tooltips || r.crosshair) && ha(
|
|
4459
|
-
width:
|
|
4460
|
-
height:
|
|
4461
|
-
points:
|
|
4455
|
+
Te.append("text").attr("class", "bc-value-label").attr("data-series", e.series).attr("x", r.x).attr("y", r.y).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text(String(e.value));
|
|
4456
|
+
}), (r.tooltips || r.crosshair) && ha(U, {
|
|
4457
|
+
width: W,
|
|
4458
|
+
height: G,
|
|
4459
|
+
points: le.map((e) => ({
|
|
4462
4460
|
cx: Z(a.labels.indexOf(e.label)),
|
|
4463
4461
|
cy: Q(e.value),
|
|
4464
4462
|
label: e.label,
|
|
@@ -4474,68 +4472,68 @@ function Pa(e, t, r = {}, i = !1) {
|
|
|
4474
4472
|
numberFormat: r.verticalAxis?.numberFormat,
|
|
4475
4473
|
container: e
|
|
4476
4474
|
});
|
|
4477
|
-
let
|
|
4475
|
+
let Ee = ue ? {
|
|
4478
4476
|
name: "",
|
|
4479
4477
|
lineSymbols: !0,
|
|
4480
|
-
symbolShape:
|
|
4481
|
-
symbolShowOn:
|
|
4482
|
-
symbolStyle:
|
|
4483
|
-
symbolSize:
|
|
4484
|
-
symbolOpacity:
|
|
4485
|
-
} : void 0,
|
|
4478
|
+
symbolShape: ue.symbol,
|
|
4479
|
+
symbolShowOn: ue.showOn,
|
|
4480
|
+
symbolStyle: ue.style,
|
|
4481
|
+
symbolSize: ue.size,
|
|
4482
|
+
symbolOpacity: ue.opacity
|
|
4483
|
+
} : void 0, De = a.labels.length;
|
|
4486
4484
|
g.forEach((e, t) => {
|
|
4487
|
-
let r = na(e.name,
|
|
4485
|
+
let r = na(e.name, Ee, b);
|
|
4488
4486
|
if (!r) return;
|
|
4489
4487
|
let o = {
|
|
4490
|
-
symbol: r.symbolShape ??
|
|
4491
|
-
showOn: r.symbolShowOn ??
|
|
4492
|
-
style: r.symbolStyle ??
|
|
4493
|
-
size: r.symbolSize ??
|
|
4494
|
-
opacity: r.symbolOpacity ??
|
|
4488
|
+
symbol: r.symbolShape ?? ue?.symbol ?? R.Circle,
|
|
4489
|
+
showOn: r.symbolShowOn ?? ue?.showOn ?? z.FirstLast,
|
|
4490
|
+
style: r.symbolStyle ?? ue?.style ?? B.Filled,
|
|
4491
|
+
size: r.symbolSize ?? ue?.size ?? 3.5,
|
|
4492
|
+
opacity: r.symbolOpacity ?? ue?.opacity ?? 1
|
|
4495
4493
|
}, s = a.labels.map((n, r) => ({
|
|
4496
4494
|
cx: Z(r),
|
|
4497
4495
|
cy: Q(e.values[r]),
|
|
4498
4496
|
color: Ji(e.name, t, _, b),
|
|
4499
4497
|
index: r
|
|
4500
4498
|
})).filter((e) => Number.isFinite(e.cy)), l = c.find((t) => t.getAttribute("data-series-name") === e.name), u, d = !1;
|
|
4501
|
-
l ? (
|
|
4499
|
+
l ? (U.appendChild(l), u = n.select(l), d = !0) : u = n.select(U).append("g").attr("class", "bc-symbols").attr("data-series", e.name).attr("data-series-name", e.name), ya(u, s, De, o, i && d);
|
|
4502
4500
|
});
|
|
4503
|
-
let
|
|
4501
|
+
let Oe = a.labels.length - 1, Ae = Z(Oe) + 6, je = [];
|
|
4504
4502
|
if (g.forEach((e, t) => {
|
|
4505
4503
|
if ($i(e.name, S, b) !== "direct") return;
|
|
4506
|
-
let n = e.values[
|
|
4504
|
+
let n = e.values[Oe];
|
|
4507
4505
|
if (!Number.isFinite(n)) return;
|
|
4508
4506
|
let r = b?.find((t) => t.name === e.name)?.labelText || e.name;
|
|
4509
|
-
|
|
4507
|
+
je.push({
|
|
4510
4508
|
name: e.name,
|
|
4511
4509
|
index: t,
|
|
4512
4510
|
naturalY: Q(n),
|
|
4513
4511
|
text: r
|
|
4514
4512
|
});
|
|
4515
|
-
}),
|
|
4516
|
-
|
|
4517
|
-
let e = Ea(
|
|
4518
|
-
|
|
4519
|
-
n.select(
|
|
4513
|
+
}), je.length > 0) {
|
|
4514
|
+
je.sort((e, t) => e.naturalY - t.naturalY);
|
|
4515
|
+
let e = Ea(je.map((e) => e.naturalY), 0, G, 14);
|
|
4516
|
+
je.forEach((t, r) => {
|
|
4517
|
+
n.select(U).append("text").attr("class", "bc-direct-label").attr("data-series", t.name).attr("x", Ae).attr("y", e[r]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", Ji(t.name, t.index, _, b)).text(t.text);
|
|
4520
4518
|
});
|
|
4521
4519
|
}
|
|
4522
|
-
let
|
|
4523
|
-
if (w &&
|
|
4524
|
-
let e =
|
|
4520
|
+
let Me = v.filter((e) => $i(e, S, b) === "legend");
|
|
4521
|
+
if (w && Me.length > 0) {
|
|
4522
|
+
let e = Me.map((e) => Ji(e, h.findIndex((t) => t.name === e), _, b)), t = 0, n = 0;
|
|
4525
4523
|
if (D === "top") {
|
|
4526
4524
|
let e = F ? 15 : 0;
|
|
4527
4525
|
n = -(L.height + 10 + e);
|
|
4528
|
-
} else D === "bottom" ? n =
|
|
4529
|
-
Wi(
|
|
4530
|
-
left:
|
|
4531
|
-
right:
|
|
4526
|
+
} else D === "bottom" ? n = G + Math.max(K.bottom - V, 0) : D === "left" ? t = -(L.width + 10) : D === "right" && (t = W + 10);
|
|
4527
|
+
Wi(U, Me, e, n, D, O, W, G, t, [], {
|
|
4528
|
+
left: K.left,
|
|
4529
|
+
right: K.right
|
|
4532
4530
|
});
|
|
4533
4531
|
}
|
|
4534
4532
|
vr(e, {
|
|
4535
4533
|
chartType: "line-multi",
|
|
4536
|
-
margin:
|
|
4537
|
-
plotRect:
|
|
4538
|
-
}), l && (jt(
|
|
4534
|
+
margin: K,
|
|
4535
|
+
plotRect: we
|
|
4536
|
+
}), l && (jt(ie.node()), Nt(e, l));
|
|
4539
4537
|
}
|
|
4540
4538
|
function Fa(e, t, r, i, a, o, s) {
|
|
4541
4539
|
let c = n.select(e).append("g").attr("class", "bc-area-fills");
|
|
@@ -4837,7 +4835,7 @@ function Wa(e, t, r = {}, i = !1) {
|
|
|
4837
4835
|
"stroke-width": 2
|
|
4838
4836
|
})
|
|
4839
4837
|
}), n.select(B).append("g").selectAll(".bc-dot").data(D, (e) => e.label).enter().append("circle").attr("class", "bc-dot").attr("cx", (e) => A(e)).attr("cy", (e) => P(e.value)).attr("r", 3).attr("fill", V).attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none");
|
|
4840
|
-
let
|
|
4838
|
+
let X = {
|
|
4841
4839
|
left: x.left,
|
|
4842
4840
|
top: x.top,
|
|
4843
4841
|
width: y,
|
|
@@ -4848,7 +4846,7 @@ function Wa(e, t, r = {}, i = !1) {
|
|
|
4848
4846
|
clipId: R,
|
|
4849
4847
|
group: v,
|
|
4850
4848
|
from: d,
|
|
4851
|
-
to:
|
|
4849
|
+
to: X,
|
|
4852
4850
|
active: i && (a.length > 0 || o.length > 0)
|
|
4853
4851
|
}), r.annotations?.length && pr(v, r.annotations, {
|
|
4854
4852
|
scaleX: k,
|
|
@@ -4896,7 +4894,7 @@ function Wa(e, t, r = {}, i = !1) {
|
|
|
4896
4894
|
vr(e, {
|
|
4897
4895
|
chartType: "area",
|
|
4898
4896
|
margin: x,
|
|
4899
|
-
plotRect:
|
|
4897
|
+
plotRect: X
|
|
4900
4898
|
}), c && (jt(z.node()), Nt(e, c));
|
|
4901
4899
|
}
|
|
4902
4900
|
//#endregion
|
|
@@ -4978,13 +4976,11 @@ function Ja(e, t, r = {}, i = !1) {
|
|
|
4978
4976
|
width: 0,
|
|
4979
4977
|
height: 0
|
|
4980
4978
|
}, J = T ? q.height + 15 : 0, Y = { ...U };
|
|
4981
|
-
T && k === "top" && (Y.top = J + (G ? 15 : 0)), T && k === "
|
|
4982
|
-
let te =
|
|
4983
|
-
|
|
4984
|
-
let { chartArea: X, width: Z, height: Q, margin: $ } = Et(p, Y), ne = ct(u, $), re = n.scalePoint().domain(a.labels).range([0, Z]).padding(r.edgePadding ? .6 : 0), ie = re, ae = (e) => re(a.labels[e]) ?? 0, [oe, se] = _e(z, r.verticalAxis?.range, r.verticalAxis?.scaleType), ce = (r.verticalAxis?.scaleType === O.Log ? n.scaleSymlog() : n.scaleLinear()).domain([oe, se]).nice().range([Q, 0]);
|
|
4985
|
-
f.attach(X, ne), f.update({
|
|
4979
|
+
T && k === "top" && (Y.top = J + (G ? 15 : 0)), T && k === "left" && (Y.left = (Y.left ?? 50) + q.width + 10), T && k === "right" && (Y.right = (Y.right ?? 20) + q.width + 10), W > 0 && (Y.right = (Y.right ?? 20) + W), Y.bottom = (nn(a.labels, Math.max(0, E - (Y.left ?? 50) - (Y.right ?? 20)), r.horizontalAxis) ?? Math.max(Y.bottom ?? 24, 24)) + (k === "bottom" ? J : 0);
|
|
4980
|
+
let { chartArea: X, width: Z, height: Q, margin: $ } = Et(p, Y), te = ct(u, $), ne = n.scalePoint().domain(a.labels).range([0, Z]).padding(r.edgePadding ? .6 : 0), re = ne, ie = (e) => ne(a.labels[e]) ?? 0, [ae, oe] = _e(z, r.verticalAxis?.range, r.verticalAxis?.scaleType), se = (r.verticalAxis?.scaleType === O.Log ? n.scaleSymlog() : n.scaleLinear()).domain([ae, oe]).nice().range([Q, 0]);
|
|
4981
|
+
f.attach(X, te), f.update({
|
|
4986
4982
|
vertical: {
|
|
4987
|
-
scale:
|
|
4983
|
+
scale: se,
|
|
4988
4984
|
height: Q,
|
|
4989
4985
|
options: {
|
|
4990
4986
|
...r.verticalAxis,
|
|
@@ -4994,7 +4990,7 @@ function Ja(e, t, r = {}, i = !1) {
|
|
|
4994
4990
|
}
|
|
4995
4991
|
},
|
|
4996
4992
|
horizontal: {
|
|
4997
|
-
scale:
|
|
4993
|
+
scale: re,
|
|
4998
4994
|
height: Q,
|
|
4999
4995
|
options: {
|
|
5000
4996
|
...r.horizontalAxis,
|
|
@@ -5002,68 +4998,68 @@ function Ja(e, t, r = {}, i = !1) {
|
|
|
5002
4998
|
}
|
|
5003
4999
|
}
|
|
5004
5000
|
});
|
|
5005
|
-
let
|
|
5001
|
+
let ce = X.ownerSVGElement, le = xr(ce, e, "plot", {
|
|
5006
5002
|
x: 0,
|
|
5007
5003
|
y: 0,
|
|
5008
5004
|
width: Z,
|
|
5009
5005
|
height: Q
|
|
5010
|
-
}),
|
|
5006
|
+
}), ue = n.select(X).append("g").attr("clip-path", `url(#${le})`), de = ue.node(), fe = la(r.interpolation ?? "monotoneX"), pe = L.map((e) => {
|
|
5011
5007
|
let t = h.findIndex((t) => t.name === e.key), n;
|
|
5012
|
-
return n = j ? Array.from(e).map((e) => [
|
|
5008
|
+
return n = j ? Array.from(e).map((e) => [se(e[0]), se(e[1])]) : (F.find((t) => t.name === e.key)?.values ?? []).map((e) => [se(0), se(e)]), {
|
|
5013
5009
|
name: e.key,
|
|
5014
5010
|
points: n,
|
|
5015
5011
|
colorIndex: t >= 0 ? t : 0
|
|
5016
5012
|
};
|
|
5017
|
-
}),
|
|
5013
|
+
}), me = Zr(r.highlights, pe.map((e) => e.name)), ge = me.size > 0, ve = r.areaFillOpacity == null ? .85 : r.areaFillOpacity, ye = (e) => x.get(e.name) ?? Ji(e.name, e.colorIndex, _, b), be = n.area().curve(fe).x((e, t) => ie(t)).y0((e) => e[0]).y1((e) => e[1]), xe = n.select(de).append("g").node(), Se = n.select(de).append("g").node();
|
|
5018
5014
|
if (i) {
|
|
5019
|
-
for (let e of o)
|
|
5020
|
-
for (let e of s)
|
|
5015
|
+
for (let e of o) xe.appendChild(e);
|
|
5016
|
+
for (let e of s) Se.appendChild(e);
|
|
5021
5017
|
}
|
|
5022
|
-
let
|
|
5023
|
-
Br(
|
|
5018
|
+
let Ce = Or(e);
|
|
5019
|
+
Br(Ce, {
|
|
5024
5020
|
role: "series-area",
|
|
5025
|
-
parent:
|
|
5021
|
+
parent: xe,
|
|
5026
5022
|
selector: ".bc-area",
|
|
5027
|
-
data:
|
|
5023
|
+
data: pe,
|
|
5028
5024
|
key: (e) => e.name,
|
|
5029
5025
|
insert: (e) => e.append("path").attr("class", "bc-area"),
|
|
5030
5026
|
attrs: (e) => ({
|
|
5031
5027
|
"data-series": e.name,
|
|
5032
|
-
d:
|
|
5033
|
-
fill:
|
|
5034
|
-
opacity:
|
|
5028
|
+
d: be(e.points) ?? "",
|
|
5029
|
+
fill: ye(e),
|
|
5030
|
+
opacity: ge ? Qr(me, e.name, ve) : ve
|
|
5035
5031
|
})
|
|
5036
|
-
}), Br(
|
|
5032
|
+
}), Br(Ce, {
|
|
5037
5033
|
role: "series-line",
|
|
5038
|
-
parent:
|
|
5034
|
+
parent: Se,
|
|
5039
5035
|
selector: ".bc-line",
|
|
5040
|
-
data: P ?
|
|
5036
|
+
data: P ? pe : [],
|
|
5041
5037
|
key: (e) => e.name,
|
|
5042
5038
|
insert: (e) => e.append("path").attr("class", "bc-line"),
|
|
5043
5039
|
attrs: (e) => {
|
|
5044
|
-
let t = Zi(e.name, r.interpolation ?? "monotoneX", b), i = n.line().curve(la(t)).x((e, t) =>
|
|
5040
|
+
let t = Zi(e.name, r.interpolation ?? "monotoneX", b), i = n.line().curve(la(t)).x((e, t) => ie(t)).y((e) => e[1]);
|
|
5045
5041
|
return {
|
|
5046
5042
|
"data-series": e.name,
|
|
5047
5043
|
d: i(e.points) ?? "",
|
|
5048
5044
|
fill: "none",
|
|
5049
|
-
stroke:
|
|
5045
|
+
stroke: ye(e),
|
|
5050
5046
|
"stroke-width": 1,
|
|
5051
|
-
opacity:
|
|
5047
|
+
opacity: ge ? Qr(me, e.name, 1) : 1
|
|
5052
5048
|
};
|
|
5053
5049
|
}
|
|
5054
5050
|
});
|
|
5055
|
-
let
|
|
5051
|
+
let we = {
|
|
5056
5052
|
left: $.left,
|
|
5057
5053
|
top: $.top,
|
|
5058
5054
|
width: Z,
|
|
5059
5055
|
height: Q
|
|
5060
5056
|
};
|
|
5061
|
-
if (Jr(
|
|
5062
|
-
svg:
|
|
5063
|
-
clipId:
|
|
5057
|
+
if (Jr(Ce, {
|
|
5058
|
+
svg: ce,
|
|
5059
|
+
clipId: le,
|
|
5064
5060
|
group: X,
|
|
5065
5061
|
from: d,
|
|
5066
|
-
to:
|
|
5062
|
+
to: we,
|
|
5067
5063
|
active: i && (o.length > 0 || s.length > 0)
|
|
5068
5064
|
}), r.annotations?.length) {
|
|
5069
5065
|
let t = a.labels.map((e, t) => ({
|
|
@@ -5071,8 +5067,8 @@ function Ja(e, t, r = {}, i = !1) {
|
|
|
5071
5067
|
value: g[0]?.values[t] ?? 0
|
|
5072
5068
|
}));
|
|
5073
5069
|
pr(X, r.annotations, {
|
|
5074
|
-
scaleX:
|
|
5075
|
-
scaleY:
|
|
5070
|
+
scaleX: re,
|
|
5071
|
+
scaleY: se,
|
|
5076
5072
|
data: t,
|
|
5077
5073
|
width: Z,
|
|
5078
5074
|
height: Q,
|
|
@@ -5088,8 +5084,8 @@ function Ja(e, t, r = {}, i = !1) {
|
|
|
5088
5084
|
Array.from(e).forEach((r, i) => {
|
|
5089
5085
|
let o = r[1] - r[0];
|
|
5090
5086
|
t.push({
|
|
5091
|
-
cx:
|
|
5092
|
-
cy:
|
|
5087
|
+
cx: ie(i),
|
|
5088
|
+
cy: se(r[1]),
|
|
5093
5089
|
label: a.labels[i],
|
|
5094
5090
|
value: Math.round(o * 100) / 100,
|
|
5095
5091
|
series: e.key,
|
|
@@ -5109,35 +5105,35 @@ function Ja(e, t, r = {}, i = !1) {
|
|
|
5109
5105
|
container: e
|
|
5110
5106
|
});
|
|
5111
5107
|
}
|
|
5112
|
-
let
|
|
5108
|
+
let Te = a.labels.length - 1, Ee = ie(Te) + 6, De = [];
|
|
5113
5109
|
if (g.forEach((e, t) => {
|
|
5114
5110
|
if ($i(e.name, C, b) !== "direct") return;
|
|
5115
5111
|
let n = L.find((t) => t.key === e.name);
|
|
5116
5112
|
if (!n) return;
|
|
5117
|
-
let r = n[
|
|
5113
|
+
let r = n[Te];
|
|
5118
5114
|
if (!r) return;
|
|
5119
|
-
let i =
|
|
5120
|
-
|
|
5115
|
+
let i = se((r[0] + r[1]) / 2), a = b?.find((t) => t.name === e.name)?.labelText || e.name;
|
|
5116
|
+
De.push({
|
|
5121
5117
|
name: e.name,
|
|
5122
5118
|
index: t,
|
|
5123
5119
|
naturalY: i,
|
|
5124
5120
|
text: a
|
|
5125
5121
|
});
|
|
5126
|
-
}),
|
|
5127
|
-
|
|
5128
|
-
let e = Ea(
|
|
5129
|
-
|
|
5130
|
-
n.select(X).append("text").attr("class", "bc-direct-label").attr("data-series", t.name).attr("x",
|
|
5122
|
+
}), De.length > 0) {
|
|
5123
|
+
De.sort((e, t) => e.naturalY - t.naturalY);
|
|
5124
|
+
let e = Ea(De.map((e) => e.naturalY), 0, Q, 14);
|
|
5125
|
+
De.forEach((t, r) => {
|
|
5126
|
+
n.select(X).append("text").attr("class", "bc-direct-label").attr("data-series", t.name).attr("x", Ee).attr("y", e[r]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", Ji(t.name, t.index, _, b)).text(t.text);
|
|
5131
5127
|
});
|
|
5132
5128
|
}
|
|
5133
|
-
let
|
|
5134
|
-
if (T &&
|
|
5135
|
-
let e =
|
|
5129
|
+
let Oe = y.filter((e) => $i(e, C, b) === "legend");
|
|
5130
|
+
if (T && Oe.length > 0) {
|
|
5131
|
+
let e = Oe.map((e) => Ji(e, h.findIndex((t) => t.name === e), _, b)), t = 0, n = 0;
|
|
5136
5132
|
if (k === "top") {
|
|
5137
5133
|
let e = G ? 15 : 0;
|
|
5138
5134
|
n = -(q.height + 10 + e);
|
|
5139
|
-
} else k === "bottom" ? n = Q +
|
|
5140
|
-
Wi(X,
|
|
5135
|
+
} else k === "bottom" ? n = Q + Math.max($.bottom - J, 0) : k === "left" ? t = -(q.width + 10) : k === "right" && (t = Z + 10);
|
|
5136
|
+
Wi(X, Oe, e, n, k, A, Z, Q, t, [], {
|
|
5141
5137
|
left: $.left,
|
|
5142
5138
|
right: $.right
|
|
5143
5139
|
});
|
|
@@ -5145,8 +5141,8 @@ function Ja(e, t, r = {}, i = !1) {
|
|
|
5145
5141
|
vr(e, {
|
|
5146
5142
|
chartType: "area-stacked",
|
|
5147
5143
|
margin: $,
|
|
5148
|
-
plotRect:
|
|
5149
|
-
}), c && (jt(
|
|
5144
|
+
plotRect: we
|
|
5145
|
+
}), c && (jt(ue.node()), Nt(e, c));
|
|
5150
5146
|
}
|
|
5151
5147
|
//#endregion
|
|
5152
5148
|
//#region src/charts/types/column-stacked/column-stacked.ts
|
|
@@ -5191,52 +5187,52 @@ function Za(e, t, r = {}, i = !1) {
|
|
|
5191
5187
|
labels: t.labels,
|
|
5192
5188
|
values: t.values,
|
|
5193
5189
|
series: p
|
|
5194
|
-
}, C = r.stackMode === ee.Percent, w = Xa(C ? Ka(S) : Ga(S), t.labels, f), T = C ? 100 : n.max(w, (e) => e.y1) ?? 0, E = C ? Math.min(0, n.min(w, (e) => e.y0) ?? 0) : 0, D = C ? [E, T] : w.flatMap((e) => [e.y0, e.y1]), k = bt(D, r.verticalAxis?.range, r.verticalAxis?.numberFormat, r.verticalAxis?.scaleType), A = St(v, r.verticalAxis?.labelPosition, r.horizontalAxis?.labelPosition, r.verticalAxis?.direction, k), j = Math.max(0, v - (A.left ?? 50) - (A.right ?? 20)),
|
|
5195
|
-
M !== void 0 && (A.bottom = M);
|
|
5196
|
-
let N = A.top != null, P = Math.max(0, v - (A.left ?? 50) - (A.right ?? 20)), F = _ ? Li(m, b, P) : {
|
|
5190
|
+
}, C = r.stackMode === ee.Percent, w = Xa(C ? Ka(S) : Ga(S), t.labels, f), T = C ? 100 : n.max(w, (e) => e.y1) ?? 0, E = C ? Math.min(0, n.min(w, (e) => e.y0) ?? 0) : 0, D = C ? [E, T] : w.flatMap((e) => [e.y0, e.y1]), k = bt(D, r.verticalAxis?.range, r.verticalAxis?.numberFormat, r.verticalAxis?.scaleType), A = St(v, r.verticalAxis?.labelPosition, r.horizontalAxis?.labelPosition, r.verticalAxis?.direction, k), j = A.top != null, M = Math.max(0, v - (A.left ?? 50) - (A.right ?? 20)), N = _ ? Li(m, b, M) : {
|
|
5197
5191
|
width: 0,
|
|
5198
5192
|
height: 0
|
|
5199
|
-
},
|
|
5200
|
-
_ && b === "top" && (
|
|
5201
|
-
let
|
|
5193
|
+
}, P = _ ? N.height + 15 : 0, F = { ...A };
|
|
5194
|
+
_ && b === "top" && (F.top = P + (j ? 15 : 0)), _ && b === "left" && (F.left = (F.left ?? 50) + N.width + 10), _ && b === "right" && (F.right = (F.right ?? 20) + N.width + 10);
|
|
5195
|
+
let I = Math.max(0, v - (F.left ?? 50) - (F.right ?? 20));
|
|
5196
|
+
F.bottom = (nn(t.labels, I, r.horizontalAxis) ?? Math.max(F.bottom ?? 24, 24)) + (b === "bottom" ? P : 0);
|
|
5197
|
+
let { chartArea: L, width: R, height: z, margin: B } = Et(d, F), V = ct(c, B), H = t.labels;
|
|
5202
5198
|
if (r.sortMode === "total") {
|
|
5203
5199
|
let e = t.labels.map((e, t) => ({
|
|
5204
5200
|
label: e,
|
|
5205
5201
|
index: t,
|
|
5206
5202
|
total: p.reduce((e, n) => e + (n.values[t] ?? 0), 0)
|
|
5207
5203
|
}));
|
|
5208
|
-
e.sort((e, t) => t.total - e.total),
|
|
5204
|
+
e.sort((e, t) => t.total - e.total), H = e.map((e) => e.label);
|
|
5209
5205
|
}
|
|
5210
|
-
let
|
|
5211
|
-
u.attach(
|
|
5206
|
+
let U = n.scaleBand().domain(H).range([0, R]).padding(ge(r.barGap)), [W, G] = _e(D, r.verticalAxis?.range, r.verticalAxis?.scaleType), K = (r.verticalAxis?.scaleType === O.Log ? n.scaleSymlog() : n.scaleLinear()).domain([W, G]).nice().range([z, 0]);
|
|
5207
|
+
u.attach(L, V), u.update({
|
|
5212
5208
|
vertical: {
|
|
5213
|
-
scale:
|
|
5214
|
-
height:
|
|
5209
|
+
scale: K,
|
|
5210
|
+
height: z,
|
|
5215
5211
|
options: {
|
|
5216
5212
|
...r.verticalAxis,
|
|
5217
|
-
gridWidth:
|
|
5218
|
-
topPadding:
|
|
5213
|
+
gridWidth: R,
|
|
5214
|
+
topPadding: B.top
|
|
5219
5215
|
}
|
|
5220
5216
|
},
|
|
5221
5217
|
horizontal: {
|
|
5222
|
-
scale:
|
|
5223
|
-
height:
|
|
5218
|
+
scale: U,
|
|
5219
|
+
height: z,
|
|
5224
5220
|
options: {
|
|
5225
5221
|
...r.horizontalAxis,
|
|
5226
|
-
width:
|
|
5222
|
+
width: R
|
|
5227
5223
|
}
|
|
5228
5224
|
}
|
|
5229
5225
|
});
|
|
5230
|
-
let
|
|
5226
|
+
let q = L.ownerSVGElement, J = xr(q, e, "bars", {
|
|
5231
5227
|
x: 0,
|
|
5232
5228
|
y: 0,
|
|
5233
|
-
width:
|
|
5234
|
-
height:
|
|
5235
|
-
}),
|
|
5236
|
-
if (i) for (let e of a) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"),
|
|
5229
|
+
width: R,
|
|
5230
|
+
height: z
|
|
5231
|
+
}), Y = n.select(L).append("g").attr("clip-path", `url(#${J})`), X = H === t.labels ? w : H.flatMap((e) => w.filter((t) => t.label === e)), Z = hr(r.colorizes), Q = Zr(r.highlights, w.map((e) => e.seriesName)), $ = Or(e), te = Y.append("g").node();
|
|
5232
|
+
if (i) for (let e of a) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"), te.appendChild(e);
|
|
5237
5233
|
Br($, {
|
|
5238
5234
|
role: "mark-per-cell",
|
|
5239
|
-
parent:
|
|
5235
|
+
parent: te,
|
|
5240
5236
|
selector: ".bc-bar-stacked",
|
|
5241
5237
|
data: X,
|
|
5242
5238
|
key: (e) => e.label + "\0" + e.seriesName,
|
|
@@ -5244,33 +5240,33 @@ function Za(e, t, r = {}, i = !1) {
|
|
|
5244
5240
|
attrs: (e) => {
|
|
5245
5241
|
let t = Z.get(e.seriesName) ?? Ji(e.seriesName, e.seriesIndex, h, g), n = ta(e.seriesName, g), r = {
|
|
5246
5242
|
"data-series": e.seriesName,
|
|
5247
|
-
x:
|
|
5248
|
-
y:
|
|
5249
|
-
width:
|
|
5250
|
-
height:
|
|
5243
|
+
x: U(e.label) ?? 0,
|
|
5244
|
+
y: K(e.y1),
|
|
5245
|
+
width: U.bandwidth(),
|
|
5246
|
+
height: K(e.y0) - K(e.y1),
|
|
5251
5247
|
fill: t
|
|
5252
5248
|
};
|
|
5253
5249
|
return n < 1 && (r["fill-opacity"] = n), Q.size > 0 && (r.opacity = Qr(Q, e.seriesName)), r;
|
|
5254
5250
|
}
|
|
5255
5251
|
});
|
|
5256
|
-
let
|
|
5257
|
-
left:
|
|
5258
|
-
top:
|
|
5259
|
-
width:
|
|
5260
|
-
height:
|
|
5252
|
+
let ne = {
|
|
5253
|
+
left: B.left,
|
|
5254
|
+
top: B.top,
|
|
5255
|
+
width: R,
|
|
5256
|
+
height: z
|
|
5261
5257
|
};
|
|
5262
5258
|
Jr($, {
|
|
5263
|
-
svg:
|
|
5264
|
-
clipId:
|
|
5265
|
-
group:
|
|
5259
|
+
svg: q,
|
|
5260
|
+
clipId: J,
|
|
5261
|
+
group: L,
|
|
5266
5262
|
from: l,
|
|
5267
|
-
to:
|
|
5263
|
+
to: ne,
|
|
5268
5264
|
active: i && a.length > 0
|
|
5269
5265
|
});
|
|
5270
|
-
let
|
|
5271
|
-
if (r.tooltips &&
|
|
5272
|
-
width:
|
|
5273
|
-
height:
|
|
5266
|
+
let re = Cr(Y);
|
|
5267
|
+
if (r.tooltips && re.use(wn({ numberFormat: r.verticalAxis?.numberFormat })), r.crosshair && re.use(En({
|
|
5268
|
+
width: R,
|
|
5269
|
+
height: z,
|
|
5274
5270
|
direction: r.crosshairDirection,
|
|
5275
5271
|
style: r.crosshairStyle,
|
|
5276
5272
|
color: r.crosshairColor
|
|
@@ -5279,45 +5275,45 @@ function Za(e, t, r = {}, i = !1) {
|
|
|
5279
5275
|
label: e,
|
|
5280
5276
|
value: p.reduce((e, n) => e + (n.values[t] ?? 0), 0)
|
|
5281
5277
|
}));
|
|
5282
|
-
|
|
5283
|
-
scaleX:
|
|
5284
|
-
scaleY:
|
|
5278
|
+
re.use(mr(r.annotations, {
|
|
5279
|
+
scaleX: U,
|
|
5280
|
+
scaleY: K,
|
|
5285
5281
|
data: n,
|
|
5286
|
-
width:
|
|
5287
|
-
height:
|
|
5282
|
+
width: R,
|
|
5283
|
+
height: z,
|
|
5288
5284
|
backgroundColor: Ze(e),
|
|
5289
5285
|
transition: i,
|
|
5290
5286
|
priorAnnotations: s
|
|
5291
5287
|
}));
|
|
5292
5288
|
}
|
|
5293
|
-
let
|
|
5294
|
-
$.state === "committing" ? $.register(
|
|
5289
|
+
let ie = () => re.draw(X);
|
|
5290
|
+
$.state === "committing" ? $.register(ie) : ie(), vr(e, {
|
|
5295
5291
|
chartType: "column-stacked",
|
|
5296
|
-
margin:
|
|
5297
|
-
plotRect:
|
|
5298
|
-
}), o && (jt(
|
|
5299
|
-
let
|
|
5292
|
+
margin: B,
|
|
5293
|
+
plotRect: ne
|
|
5294
|
+
}), o && (jt(Y.node()), Nt(e, o));
|
|
5295
|
+
let ae = r.valueLabels ?? !1, oe = n.rollup(X, (e) => n.max(e, (e) => e.y1) ?? 0, (e) => e.label), se = n.select(L).append("g").attr("class", "bc-value-labels");
|
|
5300
5296
|
if (X.forEach((e) => {
|
|
5301
|
-
if (!ea(e.seriesName,
|
|
5302
|
-
let t = (
|
|
5297
|
+
if (!ea(e.seriesName, ae, g)) return;
|
|
5298
|
+
let t = (U(e.label) ?? 0) + U.bandwidth() / 2, n = Math.abs(K(e.y0) - K(e.y1)), i = K(e.y0) - n / 2, a = C ? `${Math.round(e.y0 < 0 ? -e.value : e.value)}%` : r.valueLabels === "percent" ? Ne(e.value, oe.get(e.label) ?? 0) : String(Math.round(e.value * 100) / 100);
|
|
5303
5299
|
if (!oi({
|
|
5304
5300
|
text: a,
|
|
5305
5301
|
placement: "inside",
|
|
5306
5302
|
orientation: "vertical",
|
|
5307
|
-
barWidth:
|
|
5303
|
+
barWidth: U.bandwidth(),
|
|
5308
5304
|
barHeight: n
|
|
5309
5305
|
})) return;
|
|
5310
5306
|
let o = Z.get(e.seriesName) ?? Ji(e.seriesName, e.seriesIndex, h, g);
|
|
5311
|
-
|
|
5307
|
+
se.append("text").attr("class", "bc-value-label").attr("data-series", e.seriesName).attr("x", t).attr("y", i).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Ye(o)).text(a);
|
|
5312
5308
|
}), _ && m.length > 0) {
|
|
5313
5309
|
let e = m.map((e) => Ji(e, f.findIndex((t) => t.name === e), h, g)), t = 0, n = 0;
|
|
5314
5310
|
if (b === "top") {
|
|
5315
|
-
let e =
|
|
5316
|
-
n = -(
|
|
5317
|
-
} else b === "bottom" ? n =
|
|
5318
|
-
Wi(
|
|
5319
|
-
left:
|
|
5320
|
-
right:
|
|
5311
|
+
let e = j ? 15 : 0;
|
|
5312
|
+
n = -(N.height + 10 + e);
|
|
5313
|
+
} else b === "bottom" ? n = z + Math.max(B.bottom - P, 0) : b === "left" ? t = -(N.width + 10) : b === "right" && (t = R + 10);
|
|
5314
|
+
Wi(L, m, e, n, b, x, R, z, t, [], {
|
|
5315
|
+
left: B.left,
|
|
5316
|
+
right: B.right
|
|
5321
5317
|
});
|
|
5322
5318
|
}
|
|
5323
5319
|
}
|
|
@@ -5400,27 +5396,27 @@ function eo(e, t, r = {}, i = !1) {
|
|
|
5400
5396
|
},
|
|
5401
5397
|
order: "horizontal-first"
|
|
5402
5398
|
});
|
|
5403
|
-
let
|
|
5399
|
+
let X = z.ownerSVGElement, Z = xr(X, e, "bars", {
|
|
5404
5400
|
x: 0,
|
|
5405
5401
|
y: 0,
|
|
5406
5402
|
width: B,
|
|
5407
5403
|
height: V
|
|
5408
|
-
}),
|
|
5404
|
+
}), Q = n.select(z).append("g").attr("clip-path", `url(#${Z})`), $ = W === t.labels ? w : W.flatMap((e) => w.filter((t) => t.label === e)), te = k ? mi(Y.bandwidth()) : 0, ne = hr(r.colorizes), re = Zr(r.highlights, w.map((e) => e.seriesName)), ie = Or(e), ae = Q.append("g").node();
|
|
5409
5405
|
if (i) for (let e of a) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"), ae.appendChild(e);
|
|
5410
5406
|
Br(ie, {
|
|
5411
5407
|
role: "mark-per-cell",
|
|
5412
5408
|
parent: ae,
|
|
5413
5409
|
selector: ".bc-bar-stacked",
|
|
5414
|
-
data:
|
|
5410
|
+
data: $,
|
|
5415
5411
|
key: (e) => e.label + "\0" + e.seriesName,
|
|
5416
5412
|
insert: (e) => e.append("rect").attr("class", "bc-bar bc-bar-stacked"),
|
|
5417
5413
|
attrs: (e) => {
|
|
5418
5414
|
let t = ne.get(e.seriesName) ?? Ji(e.seriesName, e.seriesIndex, h, g), n = ta(e.seriesName, g), r = {
|
|
5419
5415
|
"data-series": e.seriesName,
|
|
5420
5416
|
x: J(e.y0),
|
|
5421
|
-
y: (Y(e.label) ?? 0) +
|
|
5417
|
+
y: (Y(e.label) ?? 0) + te,
|
|
5422
5418
|
width: J(e.y1) - J(e.y0),
|
|
5423
|
-
height: Math.max(0, Y.bandwidth() -
|
|
5419
|
+
height: Math.max(0, Y.bandwidth() - te),
|
|
5424
5420
|
fill: t
|
|
5425
5421
|
};
|
|
5426
5422
|
return n < 1 && (r["fill-opacity"] = n), re.size > 0 && (r.opacity = Qr(re, e.seriesName)), r;
|
|
@@ -5433,14 +5429,14 @@ function eo(e, t, r = {}, i = !1) {
|
|
|
5433
5429
|
height: V
|
|
5434
5430
|
};
|
|
5435
5431
|
Jr(ie, {
|
|
5436
|
-
svg:
|
|
5437
|
-
clipId:
|
|
5432
|
+
svg: X,
|
|
5433
|
+
clipId: Z,
|
|
5438
5434
|
group: z,
|
|
5439
5435
|
from: l,
|
|
5440
5436
|
to: oe,
|
|
5441
5437
|
active: i && a.length > 0
|
|
5442
5438
|
});
|
|
5443
|
-
let se = Cr(
|
|
5439
|
+
let se = Cr(Q);
|
|
5444
5440
|
if (r.tooltips && se.use(wn({ numberFormat: r.verticalAxis?.numberFormat })), r.crosshair && se.use(En({
|
|
5445
5441
|
width: B,
|
|
5446
5442
|
height: V,
|
|
@@ -5465,12 +5461,12 @@ function eo(e, t, r = {}, i = !1) {
|
|
|
5465
5461
|
priorAnnotations: s
|
|
5466
5462
|
}));
|
|
5467
5463
|
}
|
|
5468
|
-
let ce = () => se.draw(
|
|
5464
|
+
let ce = () => se.draw($);
|
|
5469
5465
|
if (ie.state === "committing" ? ie.register(ce) : ce(), vr(e, {
|
|
5470
5466
|
chartType: "bar-stacked",
|
|
5471
5467
|
margin: H,
|
|
5472
5468
|
plotRect: oe
|
|
5473
|
-
}), o && (jt(
|
|
5469
|
+
}), o && (jt(Q.node()), Nt(e, o)), k) {
|
|
5474
5470
|
let e = n.select(z).append("g").attr("class", "bc-category-labels");
|
|
5475
5471
|
for (let t of W) {
|
|
5476
5472
|
let n = Y(t) ?? 0;
|
|
@@ -5479,7 +5475,7 @@ function eo(e, t, r = {}, i = !1) {
|
|
|
5479
5475
|
}
|
|
5480
5476
|
let le = r.valueLabels ?? !1, ue = r.valueLabelPosition ?? G.Auto, de = /* @__PURE__ */ new Set(), fe = /* @__PURE__ */ new Map();
|
|
5481
5477
|
for (let e of W) {
|
|
5482
|
-
let t =
|
|
5478
|
+
let t = $.filter((t) => t.label === e).sort((e, t) => e.y1 - t.y1);
|
|
5483
5479
|
if (t.length > 0) {
|
|
5484
5480
|
let e = t[t.length - 1];
|
|
5485
5481
|
de.add(e.label + "\0" + e.seriesName);
|
|
@@ -5489,10 +5485,10 @@ function eo(e, t, r = {}, i = !1) {
|
|
|
5489
5485
|
}
|
|
5490
5486
|
}
|
|
5491
5487
|
}
|
|
5492
|
-
let pe = /* @__PURE__ */ new Map(), me = n.rollup(
|
|
5493
|
-
if (
|
|
5488
|
+
let pe = /* @__PURE__ */ new Map(), me = n.rollup($, (e) => n.max(e, (e) => e.y1) ?? 0, (e) => e.label), he = n.select(z).append("g").attr("class", "bc-value-labels");
|
|
5489
|
+
if ($.forEach((e) => {
|
|
5494
5490
|
if (!ea(e.seriesName, le, g)) return;
|
|
5495
|
-
let t = C ? `${Math.round(e.y0 < 0 ? -e.value : e.value)}%` : r.valueLabels === "percent" ? Ne(e.value, me.get(e.label) ?? 0) : String(Math.round(e.value * 100) / 100), n = J(e.y1) - J(e.y0), i = t.length * 6.5 + 8, a = n >= i, o = (Y(e.label) ?? 0) +
|
|
5491
|
+
let t = C ? `${Math.round(e.y0 < 0 ? -e.value : e.value)}%` : r.valueLabels === "percent" ? Ne(e.value, me.get(e.label) ?? 0) : String(Math.round(e.value * 100) / 100), n = J(e.y1) - J(e.y0), i = t.length * 6.5 + 8, a = n >= i, o = (Y(e.label) ?? 0) + te + (Y.bandwidth() - te) / 2, s = Ji(e.seriesName, e.seriesIndex, h, g), c = de.has(e.label + "\0" + e.seriesName), l = ue === G.Outside || ue === G.Auto && !a && c, u = oi({
|
|
5496
5492
|
text: t,
|
|
5497
5493
|
placement: l ? "outside" : "inside",
|
|
5498
5494
|
orientation: "horizontal",
|
|
@@ -5626,11 +5622,11 @@ function uo(e, t, r = {}, i = !1) {
|
|
|
5626
5622
|
height: N
|
|
5627
5623
|
}), W = n.select(j).append("g").attr("clip-path", `url(#${U})`), K = n.select(j).append("g").attr("class", "bc-split-headers");
|
|
5628
5624
|
for (let e of B) K.append("text").attr("class", "bc-split-header").attr("x", e.xOffset + e.panelWidth / 2).attr("y", -10).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("font-weight", "600").attr("fill", "currentColor").text(so(e.seriesName, e.panelWidth));
|
|
5629
|
-
let q = lo(B, I, t.labels, f), ee = Zr(r.highlights, q.map((e) => e.seriesName)), J = hr(r.colorizes), Y = Or(e),
|
|
5630
|
-
if (i) for (let e of a) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"),
|
|
5625
|
+
let q = lo(B, I, t.labels, f), ee = Zr(r.highlights, q.map((e) => e.seriesName)), J = hr(r.colorizes), Y = Or(e), X = W.append("g").node();
|
|
5626
|
+
if (i) for (let e of a) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"), X.appendChild(e);
|
|
5631
5627
|
Br(Y, {
|
|
5632
5628
|
role: "mark-per-cell",
|
|
5633
|
-
parent:
|
|
5629
|
+
parent: X,
|
|
5634
5630
|
selector: ".bc-bar-split",
|
|
5635
5631
|
data: q,
|
|
5636
5632
|
key: (e) => e.label + "\0" + e.seriesName,
|
|
@@ -5647,7 +5643,7 @@ function uo(e, t, r = {}, i = !1) {
|
|
|
5647
5643
|
return n < 1 && (r["fill-opacity"] = n), ee.size > 0 && (r.opacity = Qr(ee, e.seriesName)), r;
|
|
5648
5644
|
}
|
|
5649
5645
|
});
|
|
5650
|
-
let
|
|
5646
|
+
let Z = {
|
|
5651
5647
|
left: P.left,
|
|
5652
5648
|
top: P.top,
|
|
5653
5649
|
width: M,
|
|
@@ -5658,11 +5654,11 @@ function uo(e, t, r = {}, i = !1) {
|
|
|
5658
5654
|
clipId: U,
|
|
5659
5655
|
group: j,
|
|
5660
5656
|
from: c,
|
|
5661
|
-
to:
|
|
5657
|
+
to: Z,
|
|
5662
5658
|
active: i && a.length > 0
|
|
5663
5659
|
});
|
|
5664
|
-
let
|
|
5665
|
-
if (r.tooltips &&
|
|
5660
|
+
let Q = Cr(W);
|
|
5661
|
+
if (r.tooltips && Q.use(wn({ numberFormat: r.verticalAxis?.numberFormat })), r.crosshair && Q.use(En({
|
|
5666
5662
|
width: M,
|
|
5667
5663
|
height: N,
|
|
5668
5664
|
direction: r.crosshairDirection,
|
|
@@ -5674,7 +5670,7 @@ function uo(e, t, r = {}, i = !1) {
|
|
|
5674
5670
|
label: e,
|
|
5675
5671
|
value: a?.values[t] ?? 0
|
|
5676
5672
|
}));
|
|
5677
|
-
|
|
5673
|
+
Q.use(mr(r.annotations, {
|
|
5678
5674
|
scaleX: R,
|
|
5679
5675
|
scaleY: n.xScale,
|
|
5680
5676
|
data: o,
|
|
@@ -5686,11 +5682,11 @@ function uo(e, t, r = {}, i = !1) {
|
|
|
5686
5682
|
priorAnnotations: l
|
|
5687
5683
|
}));
|
|
5688
5684
|
}
|
|
5689
|
-
let
|
|
5690
|
-
if (Y.state === "committing" ? Y.register(
|
|
5685
|
+
let $ = () => Q.draw(q);
|
|
5686
|
+
if (Y.state === "committing" ? Y.register($) : $(), vr(e, {
|
|
5691
5687
|
chartType: "bar-split",
|
|
5692
5688
|
margin: P,
|
|
5693
|
-
plotRect:
|
|
5689
|
+
plotRect: Z
|
|
5694
5690
|
}), o && (jt(W.node()), Nt(e, o)), C) {
|
|
5695
5691
|
let e = n.select(j).append("g").attr("class", "bc-category-labels");
|
|
5696
5692
|
for (let t of I) {
|
|
@@ -5698,9 +5694,9 @@ function uo(e, t, r = {}, i = !1) {
|
|
|
5698
5694
|
e.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", n + 13 / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(t);
|
|
5699
5695
|
}
|
|
5700
5696
|
}
|
|
5701
|
-
let
|
|
5697
|
+
let te = r.valueLabels ?? !0, ne = r.valueLabelPosition ?? G.Auto, re = n.select(j).append("g").attr("class", "bc-value-labels");
|
|
5702
5698
|
if (q.forEach((e) => {
|
|
5703
|
-
if (!ea(e.seriesName,
|
|
5699
|
+
if (!ea(e.seriesName, te, g)) return;
|
|
5704
5700
|
let t = B.find((t) => t.seriesName === e.seriesName);
|
|
5705
5701
|
if (!t) return;
|
|
5706
5702
|
let n = Ji(e.seriesName, e.seriesIndex, h, g), r = e.xPos + e.barWidth, i = Math.max(0, R.bandwidth() - z), a = (R(e.label) ?? 0) + z + i / 2, o = r + ro + di(String(e.value)) <= t.xOffset + t.panelWidth, s = ne === G.Inside || !o || ne === G.Auto && e.barWidth > 30;
|
|
@@ -5794,12 +5790,12 @@ function po(e, t, r = {}, i = !1) {
|
|
|
5794
5790
|
Y.append("line").attr("class", "bc-bar-separator").attr("x1", 0).attr("x2", P).attr("y1", n).attr("y2", n).attr("stroke", "currentColor").attr("opacity", .15);
|
|
5795
5791
|
}
|
|
5796
5792
|
}
|
|
5797
|
-
let
|
|
5793
|
+
let X = [];
|
|
5798
5794
|
for (let e of z) {
|
|
5799
5795
|
let n = t.labels.indexOf(e);
|
|
5800
5796
|
for (let t of p) {
|
|
5801
5797
|
let r = f.findIndex((e) => e.name === t.name);
|
|
5802
|
-
|
|
5798
|
+
X.push({
|
|
5803
5799
|
label: e,
|
|
5804
5800
|
seriesName: t.name,
|
|
5805
5801
|
seriesIndex: r,
|
|
@@ -5807,17 +5803,17 @@ function po(e, t, r = {}, i = !1) {
|
|
|
5807
5803
|
});
|
|
5808
5804
|
}
|
|
5809
5805
|
}
|
|
5810
|
-
let
|
|
5811
|
-
if (i) for (let e of a) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"),
|
|
5812
|
-
Br(
|
|
5806
|
+
let Z = Zr(r.highlights, X.map((e) => e.seriesName)), Q = hr(r.colorizes), $ = Or(e), te = Y.append("g").node();
|
|
5807
|
+
if (i) for (let e of a) e.removeAttribute("opacity"), e.removeAttribute("fill-opacity"), te.appendChild(e);
|
|
5808
|
+
Br($, {
|
|
5813
5809
|
role: "mark-per-cell",
|
|
5814
|
-
parent:
|
|
5810
|
+
parent: te,
|
|
5815
5811
|
selector: ".bc-bar-grouped",
|
|
5816
|
-
data:
|
|
5812
|
+
data: X,
|
|
5817
5813
|
key: (e) => e.label + "\0" + e.seriesName,
|
|
5818
5814
|
insert: (e) => e.append("rect").attr("class", "bc-bar bc-bar-grouped"),
|
|
5819
5815
|
attrs: (e) => {
|
|
5820
|
-
let t =
|
|
5816
|
+
let t = Q.get(e.seriesName) ?? Ji(e.seriesName, e.seriesIndex, g, _), n = ta(e.seriesName, _), r = {
|
|
5821
5817
|
"data-series": e.seriesName,
|
|
5822
5818
|
x: q(0),
|
|
5823
5819
|
y: (B(e.label) ?? 0) + V + (U(e.seriesName) ?? 0),
|
|
@@ -5825,7 +5821,7 @@ function po(e, t, r = {}, i = !1) {
|
|
|
5825
5821
|
height: U.bandwidth(),
|
|
5826
5822
|
fill: t
|
|
5827
5823
|
};
|
|
5828
|
-
return n < 1 && (r["fill-opacity"] = n),
|
|
5824
|
+
return n < 1 && (r["fill-opacity"] = n), Z.size > 0 && (r.opacity = Qr(Z, e.seriesName)), r;
|
|
5829
5825
|
}
|
|
5830
5826
|
});
|
|
5831
5827
|
let ne = {
|
|
@@ -5834,7 +5830,7 @@ function po(e, t, r = {}, i = !1) {
|
|
|
5834
5830
|
width: P,
|
|
5835
5831
|
height: F
|
|
5836
5832
|
};
|
|
5837
|
-
Jr(
|
|
5833
|
+
Jr($, {
|
|
5838
5834
|
svg: ee,
|
|
5839
5835
|
clipId: J,
|
|
5840
5836
|
group: N,
|
|
@@ -5867,8 +5863,8 @@ function po(e, t, r = {}, i = !1) {
|
|
|
5867
5863
|
priorAnnotations: l
|
|
5868
5864
|
}));
|
|
5869
5865
|
}
|
|
5870
|
-
let ie = () => re.draw(
|
|
5871
|
-
if (
|
|
5866
|
+
let ie = () => re.draw(X);
|
|
5867
|
+
if ($.state === "committing" ? $.register(ie) : ie(), vr(e, {
|
|
5872
5868
|
chartType: "bar-grouped",
|
|
5873
5869
|
margin: I,
|
|
5874
5870
|
plotRect: ne
|
|
@@ -5880,7 +5876,7 @@ function po(e, t, r = {}, i = !1) {
|
|
|
5880
5876
|
}
|
|
5881
5877
|
}
|
|
5882
5878
|
let ae = r.valueLabels ?? !0, oe = r.valueLabelPosition ?? G.Auto, se = n.select(N).append("g").attr("class", "bc-value-labels");
|
|
5883
|
-
if (
|
|
5879
|
+
if (X.forEach((e) => {
|
|
5884
5880
|
if (!ea(e.seriesName, ae, _)) return;
|
|
5885
5881
|
let t = Ji(e.seriesName, e.seriesIndex, g, _), n = Math.max(0, q(e.value) - q(0)), r = q(0) + n, i = (B(e.label) ?? 0) + V + (U(e.seriesName) ?? 0) + U.bandwidth() / 2, a = oe === G.Inside || oe === G.Auto && n > 30;
|
|
5886
5882
|
if (!oi({
|
|
@@ -6375,38 +6371,38 @@ var vo = [
|
|
|
6375
6371
|
key: "interpolation",
|
|
6376
6372
|
type: J.Select,
|
|
6377
6373
|
label: "Line interpolation",
|
|
6378
|
-
default:
|
|
6374
|
+
default: X.Linear,
|
|
6379
6375
|
choices: [
|
|
6380
6376
|
{
|
|
6381
|
-
value:
|
|
6377
|
+
value: X.Linear,
|
|
6382
6378
|
text: "Linear"
|
|
6383
6379
|
},
|
|
6384
6380
|
{
|
|
6385
|
-
value:
|
|
6381
|
+
value: X.MonotoneX,
|
|
6386
6382
|
text: "Monotone"
|
|
6387
6383
|
},
|
|
6388
6384
|
{
|
|
6389
|
-
value:
|
|
6385
|
+
value: X.Step,
|
|
6390
6386
|
text: "Step"
|
|
6391
6387
|
},
|
|
6392
6388
|
{
|
|
6393
|
-
value:
|
|
6389
|
+
value: X.StepBefore,
|
|
6394
6390
|
text: "Step (before)"
|
|
6395
6391
|
},
|
|
6396
6392
|
{
|
|
6397
|
-
value:
|
|
6393
|
+
value: X.StepAfter,
|
|
6398
6394
|
text: "Step (after)"
|
|
6399
6395
|
},
|
|
6400
6396
|
{
|
|
6401
|
-
value:
|
|
6397
|
+
value: X.Basis,
|
|
6402
6398
|
text: "Basis"
|
|
6403
6399
|
},
|
|
6404
6400
|
{
|
|
6405
|
-
value:
|
|
6401
|
+
value: X.Cardinal,
|
|
6406
6402
|
text: "Cardinal"
|
|
6407
6403
|
},
|
|
6408
6404
|
{
|
|
6409
|
-
value:
|
|
6405
|
+
value: X.CatmullRom,
|
|
6410
6406
|
text: "Catmull-Rom"
|
|
6411
6407
|
}
|
|
6412
6408
|
]
|
|
@@ -6620,7 +6616,7 @@ var gs = hs({
|
|
|
6620
6616
|
horizontalRange: !0
|
|
6621
6617
|
}), bs = {
|
|
6622
6618
|
...ds,
|
|
6623
|
-
default:
|
|
6619
|
+
default: X.MonotoneX
|
|
6624
6620
|
}, xs = {
|
|
6625
6621
|
...Mo,
|
|
6626
6622
|
default: K.Vertical
|
|
@@ -7245,16 +7241,16 @@ function kc(e, t, n) {
|
|
|
7245
7241
|
//#endregion
|
|
7246
7242
|
//#region src/transforms/applyFilter.ts
|
|
7247
7243
|
function Ac(e, t, n) {
|
|
7248
|
-
if (!n && t !==
|
|
7244
|
+
if (!n && t !== Q.Equals && t !== Q.NotEquals) return !0;
|
|
7249
7245
|
switch (t) {
|
|
7250
|
-
case
|
|
7251
|
-
case
|
|
7252
|
-
case
|
|
7253
|
-
case
|
|
7246
|
+
case Q.Equals: return e === n;
|
|
7247
|
+
case Q.NotEquals: return e !== n;
|
|
7248
|
+
case Q.Contains: return e.toLowerCase().includes(n.toLowerCase());
|
|
7249
|
+
case Q.GreaterThan: {
|
|
7254
7250
|
let t = Number(e.replace(/[,%$€£¥₹]/g, "").trim()), r = Number(n);
|
|
7255
7251
|
return !Number.isNaN(t) && !Number.isNaN(r) && t > r;
|
|
7256
7252
|
}
|
|
7257
|
-
case
|
|
7253
|
+
case Q.LessThan: {
|
|
7258
7254
|
let t = Number(e.replace(/[,%$€£¥₹]/g, "").trim()), r = Number(n);
|
|
7259
7255
|
return !Number.isNaN(t) && !Number.isNaN(r) && t < r;
|
|
7260
7256
|
}
|
|
@@ -7264,7 +7260,7 @@ function Ac(e, t, n) {
|
|
|
7264
7260
|
function jc(e, t) {
|
|
7265
7261
|
let n = e.columns.indexOf(t.column);
|
|
7266
7262
|
if (n < 0 || !t.column) return e;
|
|
7267
|
-
let r = e.rows.filter((e) => Ac(e[n] ?? "", t.condition ??
|
|
7263
|
+
let r = e.rows.filter((e) => Ac(e[n] ?? "", t.condition ?? Q.Equals, t.value ?? ""));
|
|
7268
7264
|
return {
|
|
7269
7265
|
...e,
|
|
7270
7266
|
rows: r
|
|
@@ -7350,7 +7346,7 @@ var Bc = [
|
|
|
7350
7346
|
id: "to-number",
|
|
7351
7347
|
label: "To Number",
|
|
7352
7348
|
description: "Strip non-numeric characters and convert to number",
|
|
7353
|
-
category:
|
|
7349
|
+
category: $.Type,
|
|
7354
7350
|
accepts: Bc,
|
|
7355
7351
|
outputType: "number"
|
|
7356
7352
|
},
|
|
@@ -7358,7 +7354,7 @@ var Bc = [
|
|
|
7358
7354
|
id: "to-string",
|
|
7359
7355
|
label: "To String",
|
|
7360
7356
|
description: "Keep value as plain text",
|
|
7361
|
-
category:
|
|
7357
|
+
category: $.Type,
|
|
7362
7358
|
accepts: Bc,
|
|
7363
7359
|
outputType: "string"
|
|
7364
7360
|
},
|
|
@@ -7366,7 +7362,7 @@ var Bc = [
|
|
|
7366
7362
|
id: "to-date",
|
|
7367
7363
|
label: "To Date",
|
|
7368
7364
|
description: "Parse text into an ISO date",
|
|
7369
|
-
category:
|
|
7365
|
+
category: $.Type,
|
|
7370
7366
|
accepts: Bc,
|
|
7371
7367
|
outputType: "date"
|
|
7372
7368
|
},
|
|
@@ -7374,7 +7370,7 @@ var Bc = [
|
|
|
7374
7370
|
id: "to-boolean",
|
|
7375
7371
|
label: "To Boolean",
|
|
7376
7372
|
description: "Map yes/no, true/false, 1/0 to boolean",
|
|
7377
|
-
category:
|
|
7373
|
+
category: $.Type,
|
|
7378
7374
|
accepts: Bc,
|
|
7379
7375
|
outputType: "string"
|
|
7380
7376
|
},
|
|
@@ -7382,7 +7378,7 @@ var Bc = [
|
|
|
7382
7378
|
id: "parse-json",
|
|
7383
7379
|
label: "Parse JSON",
|
|
7384
7380
|
description: "Parse JSON string and optionally extract a key",
|
|
7385
|
-
category:
|
|
7381
|
+
category: $.Type,
|
|
7386
7382
|
accepts: ["string"],
|
|
7387
7383
|
outputType: "string",
|
|
7388
7384
|
params: ["key"]
|
|
@@ -7391,7 +7387,7 @@ var Bc = [
|
|
|
7391
7387
|
id: "trim",
|
|
7392
7388
|
label: "Trim",
|
|
7393
7389
|
description: "Remove leading and trailing whitespace",
|
|
7394
|
-
category:
|
|
7390
|
+
category: $.String,
|
|
7395
7391
|
accepts: Bc,
|
|
7396
7392
|
outputType: "string"
|
|
7397
7393
|
},
|
|
@@ -7399,7 +7395,7 @@ var Bc = [
|
|
|
7399
7395
|
id: "lowercase",
|
|
7400
7396
|
label: "Lowercase",
|
|
7401
7397
|
description: "Convert all characters to lowercase",
|
|
7402
|
-
category:
|
|
7398
|
+
category: $.String,
|
|
7403
7399
|
accepts: Bc,
|
|
7404
7400
|
outputType: "string"
|
|
7405
7401
|
},
|
|
@@ -7407,7 +7403,7 @@ var Bc = [
|
|
|
7407
7403
|
id: "uppercase",
|
|
7408
7404
|
label: "Uppercase",
|
|
7409
7405
|
description: "Convert all characters to uppercase",
|
|
7410
|
-
category:
|
|
7406
|
+
category: $.String,
|
|
7411
7407
|
accepts: Bc,
|
|
7412
7408
|
outputType: "string"
|
|
7413
7409
|
},
|
|
@@ -7415,7 +7411,7 @@ var Bc = [
|
|
|
7415
7411
|
id: "title-case",
|
|
7416
7412
|
label: "Title Case",
|
|
7417
7413
|
description: "Capitalize the first letter of each word",
|
|
7418
|
-
category:
|
|
7414
|
+
category: $.String,
|
|
7419
7415
|
accepts: Bc,
|
|
7420
7416
|
outputType: "string"
|
|
7421
7417
|
},
|
|
@@ -7423,7 +7419,7 @@ var Bc = [
|
|
|
7423
7419
|
id: "slugify",
|
|
7424
7420
|
label: "Slugify",
|
|
7425
7421
|
description: "Lowercase and replace non-alphanumeric with hyphens",
|
|
7426
|
-
category:
|
|
7422
|
+
category: $.String,
|
|
7427
7423
|
accepts: Bc,
|
|
7428
7424
|
outputType: "string"
|
|
7429
7425
|
},
|
|
@@ -7431,7 +7427,7 @@ var Bc = [
|
|
|
7431
7427
|
id: "regex-replace",
|
|
7432
7428
|
label: "Regex Replace",
|
|
7433
7429
|
description: "Find and replace using a regular expression",
|
|
7434
|
-
category:
|
|
7430
|
+
category: $.String,
|
|
7435
7431
|
accepts: Bc,
|
|
7436
7432
|
outputType: "string",
|
|
7437
7433
|
params: ["pattern", "replacement"]
|
|
@@ -7440,7 +7436,7 @@ var Bc = [
|
|
|
7440
7436
|
id: "extract",
|
|
7441
7437
|
label: "Extract Substring",
|
|
7442
7438
|
description: "Extract a portion of text by character position",
|
|
7443
|
-
category:
|
|
7439
|
+
category: $.String,
|
|
7444
7440
|
accepts: Bc,
|
|
7445
7441
|
outputType: "string",
|
|
7446
7442
|
params: ["start", "end"]
|
|
@@ -7449,7 +7445,7 @@ var Bc = [
|
|
|
7449
7445
|
id: "pad-start",
|
|
7450
7446
|
label: "Pad Start",
|
|
7451
7447
|
description: "Pad the beginning to a fixed length",
|
|
7452
|
-
category:
|
|
7448
|
+
category: $.String,
|
|
7453
7449
|
accepts: Bc,
|
|
7454
7450
|
outputType: "string",
|
|
7455
7451
|
params: ["length", "char"]
|
|
@@ -7458,7 +7454,7 @@ var Bc = [
|
|
|
7458
7454
|
id: "pad-end",
|
|
7459
7455
|
label: "Pad End",
|
|
7460
7456
|
description: "Pad the end to a fixed length",
|
|
7461
|
-
category:
|
|
7457
|
+
category: $.String,
|
|
7462
7458
|
accepts: Bc,
|
|
7463
7459
|
outputType: "string",
|
|
7464
7460
|
params: ["length", "char"]
|
|
@@ -7467,7 +7463,7 @@ var Bc = [
|
|
|
7467
7463
|
id: "remove-diacritics",
|
|
7468
7464
|
label: "Remove Diacritics",
|
|
7469
7465
|
description: "Strip accents and diacritical marks",
|
|
7470
|
-
category:
|
|
7466
|
+
category: $.String,
|
|
7471
7467
|
accepts: Bc,
|
|
7472
7468
|
outputType: "string"
|
|
7473
7469
|
},
|
|
@@ -7475,7 +7471,7 @@ var Bc = [
|
|
|
7475
7471
|
id: "split",
|
|
7476
7472
|
label: "Split into Columns",
|
|
7477
7473
|
description: "Split values by a separator into new columns",
|
|
7478
|
-
category:
|
|
7474
|
+
category: $.String,
|
|
7479
7475
|
accepts: Bc,
|
|
7480
7476
|
outputType: "string",
|
|
7481
7477
|
params: ["separator", "limit"]
|
|
@@ -7484,7 +7480,7 @@ var Bc = [
|
|
|
7484
7480
|
id: "round",
|
|
7485
7481
|
label: "Round",
|
|
7486
7482
|
description: "Round to a number of decimal places",
|
|
7487
|
-
category:
|
|
7483
|
+
category: $.Numeric,
|
|
7488
7484
|
accepts: ["number"],
|
|
7489
7485
|
outputType: "number",
|
|
7490
7486
|
params: ["decimals"]
|
|
@@ -7493,7 +7489,7 @@ var Bc = [
|
|
|
7493
7489
|
id: "floor",
|
|
7494
7490
|
label: "Floor",
|
|
7495
7491
|
description: "Round down to the nearest integer",
|
|
7496
|
-
category:
|
|
7492
|
+
category: $.Numeric,
|
|
7497
7493
|
accepts: ["number"],
|
|
7498
7494
|
outputType: "number"
|
|
7499
7495
|
},
|
|
@@ -7501,7 +7497,7 @@ var Bc = [
|
|
|
7501
7497
|
id: "ceil",
|
|
7502
7498
|
label: "Ceiling",
|
|
7503
7499
|
description: "Round up to the nearest integer",
|
|
7504
|
-
category:
|
|
7500
|
+
category: $.Numeric,
|
|
7505
7501
|
accepts: ["number"],
|
|
7506
7502
|
outputType: "number"
|
|
7507
7503
|
},
|
|
@@ -7509,7 +7505,7 @@ var Bc = [
|
|
|
7509
7505
|
id: "abs",
|
|
7510
7506
|
label: "Absolute Value",
|
|
7511
7507
|
description: "Remove the sign (make positive)",
|
|
7512
|
-
category:
|
|
7508
|
+
category: $.Numeric,
|
|
7513
7509
|
accepts: ["number"],
|
|
7514
7510
|
outputType: "number"
|
|
7515
7511
|
},
|
|
@@ -7517,7 +7513,7 @@ var Bc = [
|
|
|
7517
7513
|
id: "clamp",
|
|
7518
7514
|
label: "Clamp",
|
|
7519
7515
|
description: "Constrain values between a min and max",
|
|
7520
|
-
category:
|
|
7516
|
+
category: $.Numeric,
|
|
7521
7517
|
accepts: ["number"],
|
|
7522
7518
|
outputType: "number",
|
|
7523
7519
|
params: ["min", "max"]
|
|
@@ -7526,7 +7522,7 @@ var Bc = [
|
|
|
7526
7522
|
id: "log",
|
|
7527
7523
|
label: "Logarithm",
|
|
7528
7524
|
description: "Natural log — compress wide-range values for charting",
|
|
7529
|
-
category:
|
|
7525
|
+
category: $.Numeric,
|
|
7530
7526
|
accepts: ["number"],
|
|
7531
7527
|
outputType: "number"
|
|
7532
7528
|
},
|
|
@@ -7534,7 +7530,7 @@ var Bc = [
|
|
|
7534
7530
|
id: "exp",
|
|
7535
7531
|
label: "Exponential",
|
|
7536
7532
|
description: "Raise e to the power of each value",
|
|
7537
|
-
category:
|
|
7533
|
+
category: $.Numeric,
|
|
7538
7534
|
accepts: ["number"],
|
|
7539
7535
|
outputType: "number"
|
|
7540
7536
|
},
|
|
@@ -7542,7 +7538,7 @@ var Bc = [
|
|
|
7542
7538
|
id: "normalize",
|
|
7543
7539
|
label: "Normalize (0–1)",
|
|
7544
7540
|
description: "Scale values to 0–1 range for cross-series comparison",
|
|
7545
|
-
category:
|
|
7541
|
+
category: $.Numeric,
|
|
7546
7542
|
accepts: ["number"],
|
|
7547
7543
|
outputType: "number"
|
|
7548
7544
|
},
|
|
@@ -7550,7 +7546,7 @@ var Bc = [
|
|
|
7550
7546
|
id: "standardize",
|
|
7551
7547
|
label: "Standardize (z-score)",
|
|
7552
7548
|
description: "Center around mean, scale by std deviation",
|
|
7553
|
-
category:
|
|
7549
|
+
category: $.Numeric,
|
|
7554
7550
|
accepts: ["number"],
|
|
7555
7551
|
outputType: "number"
|
|
7556
7552
|
},
|
|
@@ -7558,7 +7554,7 @@ var Bc = [
|
|
|
7558
7554
|
id: "bin",
|
|
7559
7555
|
label: "Bin/Bucket",
|
|
7560
7556
|
description: "Group values into fixed-size buckets",
|
|
7561
|
-
category:
|
|
7557
|
+
category: $.Numeric,
|
|
7562
7558
|
accepts: ["number"],
|
|
7563
7559
|
outputType: "number",
|
|
7564
7560
|
params: ["size"]
|
|
@@ -7567,7 +7563,7 @@ var Bc = [
|
|
|
7567
7563
|
id: "extract-year",
|
|
7568
7564
|
label: "Extract Year",
|
|
7569
7565
|
description: "Get the four-digit year as a number",
|
|
7570
|
-
category:
|
|
7566
|
+
category: $.Date,
|
|
7571
7567
|
accepts: ["date"],
|
|
7572
7568
|
outputType: "number"
|
|
7573
7569
|
},
|
|
@@ -7575,7 +7571,7 @@ var Bc = [
|
|
|
7575
7571
|
id: "extract-month",
|
|
7576
7572
|
label: "Extract Month",
|
|
7577
7573
|
description: "Get the month (1–12) as a number",
|
|
7578
|
-
category:
|
|
7574
|
+
category: $.Date,
|
|
7579
7575
|
accepts: ["date"],
|
|
7580
7576
|
outputType: "number"
|
|
7581
7577
|
},
|
|
@@ -7583,7 +7579,7 @@ var Bc = [
|
|
|
7583
7579
|
id: "extract-day",
|
|
7584
7580
|
label: "Extract Day",
|
|
7585
7581
|
description: "Get the day of the month as a number",
|
|
7586
|
-
category:
|
|
7582
|
+
category: $.Date,
|
|
7587
7583
|
accepts: ["date"],
|
|
7588
7584
|
outputType: "number"
|
|
7589
7585
|
},
|
|
@@ -7591,7 +7587,7 @@ var Bc = [
|
|
|
7591
7587
|
id: "extract-weekday",
|
|
7592
7588
|
label: "Extract Weekday",
|
|
7593
7589
|
description: "Get the day name (Monday, Tuesday, …)",
|
|
7594
|
-
category:
|
|
7590
|
+
category: $.Date,
|
|
7595
7591
|
accepts: ["date"],
|
|
7596
7592
|
outputType: "string"
|
|
7597
7593
|
},
|
|
@@ -7599,7 +7595,7 @@ var Bc = [
|
|
|
7599
7595
|
id: "extract-hour",
|
|
7600
7596
|
label: "Extract Hour",
|
|
7601
7597
|
description: "Get the hour (0–23) as a number",
|
|
7602
|
-
category:
|
|
7598
|
+
category: $.Date,
|
|
7603
7599
|
accepts: ["date"],
|
|
7604
7600
|
outputType: "number"
|
|
7605
7601
|
},
|
|
@@ -7607,7 +7603,7 @@ var Bc = [
|
|
|
7607
7603
|
id: "shift-date",
|
|
7608
7604
|
label: "Shift Date",
|
|
7609
7605
|
description: "Add or subtract days, months, or years",
|
|
7610
|
-
category:
|
|
7606
|
+
category: $.Date,
|
|
7611
7607
|
accepts: ["date"],
|
|
7612
7608
|
outputType: "date",
|
|
7613
7609
|
params: ["amount", "unit"]
|
|
@@ -7616,7 +7612,7 @@ var Bc = [
|
|
|
7616
7612
|
id: "truncate-date",
|
|
7617
7613
|
label: "Truncate to Period",
|
|
7618
7614
|
description: "Round down to start of week, month, quarter, or year",
|
|
7619
|
-
category:
|
|
7615
|
+
category: $.Date,
|
|
7620
7616
|
accepts: ["date"],
|
|
7621
7617
|
outputType: "date",
|
|
7622
7618
|
params: ["period"]
|
|
@@ -7625,7 +7621,7 @@ var Bc = [
|
|
|
7625
7621
|
id: "date-diff",
|
|
7626
7622
|
label: "Duration Since",
|
|
7627
7623
|
description: "Days between each date and a reference date",
|
|
7628
|
-
category:
|
|
7624
|
+
category: $.Date,
|
|
7629
7625
|
accepts: ["date"],
|
|
7630
7626
|
outputType: "number",
|
|
7631
7627
|
params: ["reference"]
|
|
@@ -7946,7 +7942,7 @@ function fl(e) {
|
|
|
7946
7942
|
}
|
|
7947
7943
|
//#endregion
|
|
7948
7944
|
//#region src/transforms/index.ts
|
|
7949
|
-
var pl = new Set(Object.values(
|
|
7945
|
+
var pl = new Set(Object.values(Z));
|
|
7950
7946
|
function ml(e, t, n, r) {
|
|
7951
7947
|
let i = {
|
|
7952
7948
|
columns: [...t],
|
|
@@ -7954,25 +7950,25 @@ function ml(e, t, n, r) {
|
|
|
7954
7950
|
columnTypes: [...r]
|
|
7955
7951
|
};
|
|
7956
7952
|
for (let t of e) switch (t.type) {
|
|
7957
|
-
case
|
|
7953
|
+
case Z.Sort:
|
|
7958
7954
|
i = rl(i, t.config);
|
|
7959
7955
|
break;
|
|
7960
|
-
case
|
|
7956
|
+
case Z.Filter:
|
|
7961
7957
|
i = jc(i, t.config);
|
|
7962
7958
|
break;
|
|
7963
|
-
case
|
|
7959
|
+
case Z.HideColumns:
|
|
7964
7960
|
i = zc(i, t.config);
|
|
7965
7961
|
break;
|
|
7966
|
-
case
|
|
7962
|
+
case Z.Transpose:
|
|
7967
7963
|
i = il(i);
|
|
7968
7964
|
break;
|
|
7969
|
-
case
|
|
7965
|
+
case Z.Parse:
|
|
7970
7966
|
i = tl(i, t.config);
|
|
7971
7967
|
break;
|
|
7972
|
-
case
|
|
7968
|
+
case Z.Rename:
|
|
7973
7969
|
i = nl(i, t.config);
|
|
7974
7970
|
break;
|
|
7975
|
-
case
|
|
7971
|
+
case Z.GroupBy: i = Rc(i, t.config);
|
|
7976
7972
|
}
|
|
7977
7973
|
return i;
|
|
7978
7974
|
}
|