@blueprint-chart/lib 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{embed-DxKuPk6P.js → embed-D0WZKRQq.js} +21 -11
- package/dist/embed.js +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/lib.iife.js +11 -1
- package/dist/node-backend/index.js +398 -397
- package/dist/{render-bpc-CnZB0sa5.js → render-bpc-CwYPC-oi.js} +272 -271
- package/dist/runtime/chart-css.d.ts +1 -1
- package/dist/runtime.js +2 -2
- package/package.json +1 -1
- package/src/charts/chart.scss +8 -2
|
@@ -13,9 +13,10 @@ import { fileURLToPath as qn } from "node:url";
|
|
|
13
13
|
import { resolve as Qa, dirname as Xn } from "node:path";
|
|
14
14
|
import { Resvg as ns } from "@resvg/resvg-js";
|
|
15
15
|
import { M as rn } from "./errors-poq5BHAK.js";
|
|
16
|
-
var Xt = /* @__PURE__ */ ((t) => (t.BarVertical = "bar-vertical", t.BarHorizontal = "bar-horizontal", t.BarMulti = "bar-multi", t.ColumnStacked = "column-stacked", t.BarStacked = "bar-stacked", t.BarSplit = "bar-split", t.BarGrouped = "bar-grouped", t.Line = "line", t.LineMulti = "line-multi", t.Area = "area", t.AreaStacked = "area-stacked", t.Donut = "donut", t.Pie = "pie", t.VerticalBar = "vertical-bar", t.HorizontalBar = "horizontal-bar", t))(Xt || {}),
|
|
16
|
+
var Xt = /* @__PURE__ */ ((t) => (t.BarVertical = "bar-vertical", t.BarHorizontal = "bar-horizontal", t.BarMulti = "bar-multi", t.ColumnStacked = "column-stacked", t.BarStacked = "bar-stacked", t.BarSplit = "bar-split", t.BarGrouped = "bar-grouped", t.Line = "line", t.LineMulti = "line-multi", t.Area = "area", t.AreaStacked = "area-stacked", t.Donut = "donut", t.Pie = "pie", t.VerticalBar = "vertical-bar", t.HorizontalBar = "horizontal-bar", t))(Xt || {}), De = /* @__PURE__ */ ((t) => (t.Left = "left", t.Right = "right", t))(De || {}), pa = /* @__PURE__ */ ((t) => (t.Linear = "linear", t.Log = "log", t))(pa || {}), Bt = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t.None = "none", t))(Bt || {}), Pt = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Inside = "inside", t.Outside = "outside", t.Off = "off", t))(Pt || {}), Ta = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(Ta || {}), Rt = /* @__PURE__ */ ((t) => (t.NW = "NW", t.N = "N", t.NE = "NE", t.E = "E", t.SE = "SE", t.S = "S", t.SW = "SW", t.W = "W", t.Center = "center", t))(Rt || {}), Vt = /* @__PURE__ */ ((t) => (t.Direct = "direct", t.CurveLeft = "curve-left", t.CurveRight = "curve-right", t.Elbow = "elbow", t))(Vt || {}), Ua = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dotted = "dotted", t.Dashed = "dashed", t))(Ua || {}), _t = /* @__PURE__ */ ((t) => (t.Point = "point", t.Range = "range", t.Free = "free", t))(_t || {}), Un = /* @__PURE__ */ ((t) => (t.Start = "start", t.Center = "center", t.End = "end", t))(Un || {}), oe = /* @__PURE__ */ ((t) => (t.Vertical = "vertical", t.Horizontal = "horizontal", t))(oe || {}), he = /* @__PURE__ */ ((t) => (t.Circle = "circle", t.Square = "square", t.Diamond = "diamond", t.Triangle = "triangle", t.TriangleDown = "triangleDown", t.Cross = "cross", t.Star = "star", t))(he || {}), be = /* @__PURE__ */ ((t) => (t.All = "all", t.First = "first", t.Last = "last", t.FirstLast = "firstLast", t))(be || {}), Zt = /* @__PURE__ */ ((t) => (t.Filled = "filled", t.Hollow = "hollow", t))(Zt || {}), Kt = /* @__PURE__ */ ((t) => (t.Ascending = "ascending", t.Descending = "descending", t.None = "none", t))(Kt || {}), Je = /* @__PURE__ */ ((t) => (t.Total = "total", t.WithinGroups = "within-groups", t.None = "none", t))(Je || {}), ba = /* @__PURE__ */ ((t) => (t.Top = "top", t.Bottom = "bottom", t.Left = "left", t.Right = "right", t))(ba || {}), Be = /* @__PURE__ */ ((t) => (t.Start = "start", t.Middle = "middle", t.End = "end", t))(Be || {}), St = /* @__PURE__ */ ((t) => (t.Inside = "inside", t.Outside = "outside", t.Auto = "auto", t))(St || {}), Wt = /* @__PURE__ */ ((t) => (t.Both = "both", t.Vertical = "vertical", t.Horizontal = "horizontal", t))(Wt || {}), ze = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t))(ze || {}), Qe = /* @__PURE__ */ ((t) => (t.Normal = "normal", t.Percent = "percent", t))(Qe || {}), Q = /* @__PURE__ */ ((t) => (t.Colors = "colors", t.Boolean = "boolean", t.Select = "select", t.Text = "text", t.NumberFormat = "numberFormat", t.DateFormat = "dateFormat", t))(Q || {}), qt = /* @__PURE__ */ ((t) => (t.Off = "", t.Auto = "auto", t.Outside = "outside", t.Inside = "inside", t))(qt || {}), Ce = /* @__PURE__ */ ((t) => (t.Linear = "linear", t.MonotoneX = "monotoneX", t.Step = "step", t.StepBefore = "stepBefore", t.StepAfter = "stepAfter", t.Basis = "basis", t.Cardinal = "cardinal", t.CatmullRom = "catmullRom", t))(Ce || {});
|
|
17
17
|
const jn = [
|
|
18
18
|
{ name: "Blueprint", label: "Blueprint", colors: ["#2563A0", "#D4A63A", "#C94044", "#2D8659", "#4B90CF", "#163A65"] },
|
|
19
|
+
{ name: "BlueprintBold", label: "Blueprint Bold", colors: ["#2563A0", "#DDF247", "#C94044", "#2D8659", "#D4A63A", "#163A65"] },
|
|
19
20
|
{ name: "JosefAlbers", label: "Albers", colors: ["#c00559", "#de1f6c", "#f3a20d", "#f07a13", "#de6716"] },
|
|
20
21
|
{ name: "Durorthod", label: "Amber", colors: ["#2c0c00", "#803c15", "#c6782c", "#ffa91d", "#fff3ad"] },
|
|
21
22
|
{ name: "X41", label: "Berry", colors: ["#411f6b", "#623976", "#be3979", "#db928a", "#e2c6a6"] },
|
|
@@ -160,11 +161,11 @@ function ds() {
|
|
|
160
161
|
ht.call(P, R), _ = _.replace(R, "");
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
|
-
return (function(
|
|
164
|
-
var H =
|
|
164
|
+
return (function(z) {
|
|
165
|
+
var H = z.afternoon;
|
|
165
166
|
if (H !== void 0) {
|
|
166
|
-
var J =
|
|
167
|
-
H ? J < 12 && (
|
|
167
|
+
var J = z.hours;
|
|
168
|
+
H ? J < 12 && (z.hours += 12) : J === 12 && (z.hours = 0), delete z.afternoon;
|
|
168
169
|
}
|
|
169
170
|
})(P), P;
|
|
170
171
|
};
|
|
@@ -178,13 +179,13 @@ function ds() {
|
|
|
178
179
|
var X = E[1];
|
|
179
180
|
if (typeof X == "string") {
|
|
180
181
|
var _ = E[2] === !0, P = E[3] === !0, I = _ || P, W = E[2];
|
|
181
|
-
P && (W = E[2]), o = this.$locale(), !_ && W && (o = A.Ls[W]), this.$d = (function(et, R,
|
|
182
|
+
P && (W = E[2]), o = this.$locale(), !_ && W && (o = A.Ls[W]), this.$d = (function(et, R, z, H) {
|
|
182
183
|
try {
|
|
183
184
|
if (["x", "X"].indexOf(R) > -1) return new Date((R === "X" ? 1e3 : 1) * et);
|
|
184
|
-
var J = b(R)(et), Z = J.year, at = J.month, ut = J.day, vt = J.hours, it = J.minutes, ct = J.seconds, bt = J.milliseconds, dt = J.zone, yt = J.week,
|
|
185
|
-
Z && !at || (gt = at > 0 ? at - 1 :
|
|
185
|
+
var J = b(R)(et), Z = J.year, at = J.month, ut = J.day, vt = J.hours, it = J.minutes, ct = J.seconds, bt = J.milliseconds, dt = J.zone, yt = J.week, B = /* @__PURE__ */ new Date(), q = ut || (Z || at ? 1 : B.getDate()), st = Z || B.getFullYear(), gt = 0;
|
|
186
|
+
Z && !at || (gt = at > 0 ? at - 1 : B.getMonth());
|
|
186
187
|
var ft, At = vt || 0, Tt = it || 0, kt = ct || 0, Lt = bt || 0;
|
|
187
|
-
return dt ? new Date(Date.UTC(st, gt, q, At, Tt, kt, Lt + 60 * dt.offset * 1e3)) :
|
|
188
|
+
return dt ? new Date(Date.UTC(st, gt, q, At, Tt, kt, Lt + 60 * dt.offset * 1e3)) : z ? new Date(Date.UTC(st, gt, q, At, Tt, kt, Lt)) : (ft = new Date(st, gt, q, At, Tt, kt, Lt), yt && (ft = H(ft).week(yt).toDate()), ft);
|
|
188
189
|
} catch {
|
|
189
190
|
return /* @__PURE__ */ new Date("");
|
|
190
191
|
}
|
|
@@ -256,7 +257,7 @@ function bs(t) {
|
|
|
256
257
|
}
|
|
257
258
|
return null;
|
|
258
259
|
}
|
|
259
|
-
function
|
|
260
|
+
function Da(t) {
|
|
260
261
|
const a = t.trim();
|
|
261
262
|
if (!a)
|
|
262
263
|
return;
|
|
@@ -315,7 +316,7 @@ function er(t, a) {
|
|
|
315
316
|
return t.map((r, n) => n);
|
|
316
317
|
const e = [];
|
|
317
318
|
for (let r = 0; r < t.length; r++) {
|
|
318
|
-
const n =
|
|
319
|
+
const n = Da(t[r]);
|
|
319
320
|
if (n === void 0) {
|
|
320
321
|
e.push(r);
|
|
321
322
|
continue;
|
|
@@ -524,7 +525,7 @@ function Kn(t, a) {
|
|
|
524
525
|
function Ae(t) {
|
|
525
526
|
return Et.valid(t) && Et.contrast(t, "#fff") >= Et.contrast(t, "#333") ? "#fff" : "#333";
|
|
526
527
|
}
|
|
527
|
-
const
|
|
528
|
+
const za = 4.5;
|
|
528
529
|
function ie(t) {
|
|
529
530
|
let a = t;
|
|
530
531
|
for (; a && a instanceof Element; ) {
|
|
@@ -540,10 +541,10 @@ function Jn(t, a = "#fff") {
|
|
|
540
541
|
return Et.valid(a) ? Ae(a) : "#333";
|
|
541
542
|
let e = Et(t);
|
|
542
543
|
const r = Kn(a, Et("#fff"));
|
|
543
|
-
if (Et.contrast(e, r) >=
|
|
544
|
+
if (Et.contrast(e, r) >= za)
|
|
544
545
|
return e.hex();
|
|
545
546
|
const n = r.luminance() > 0.5;
|
|
546
|
-
for (let l = 0; l < 20 && (e = n ? e.darken(0.3) : e.brighten(0.3), !(Et.contrast(e, r) >=
|
|
547
|
+
for (let l = 0; l < 20 && (e = n ? e.darken(0.3) : e.brighten(0.3), !(Et.contrast(e, r) >= za)); l++)
|
|
547
548
|
;
|
|
548
549
|
return e.hex();
|
|
549
550
|
}
|
|
@@ -558,7 +559,7 @@ function As(t, a) {
|
|
|
558
559
|
}
|
|
559
560
|
function ws(t, a, e) {
|
|
560
561
|
for (let r = 0; r < Qn; r++) {
|
|
561
|
-
if (Et.contrast(t, a) >=
|
|
562
|
+
if (Et.contrast(t, a) >= za)
|
|
562
563
|
return t;
|
|
563
564
|
t = e ? t.darken(Za) : t.brighten(Za);
|
|
564
565
|
}
|
|
@@ -569,14 +570,14 @@ function Ss(t, a, e, r) {
|
|
|
569
570
|
if (Et.deltaE(n, a) >= $r)
|
|
570
571
|
return n;
|
|
571
572
|
const l = sn(t, a, e, !r);
|
|
572
|
-
return Et.deltaE(l, a) > Et.deltaE(n, a) && Et.contrast(l, e) >=
|
|
573
|
+
return Et.deltaE(l, a) > Et.deltaE(n, a) && Et.contrast(l, e) >= za ? l : n;
|
|
573
574
|
}
|
|
574
575
|
function sn(t, a, e, r) {
|
|
575
576
|
let n = t, l = Et.deltaE(t, a), i = t;
|
|
576
577
|
for (let s = 0; s < Qn; s++) {
|
|
577
578
|
i = r ? i.darken(Za) : i.brighten(Za);
|
|
578
579
|
const o = Et.deltaE(i, a);
|
|
579
|
-
if (o > l && Et.contrast(i, e) >=
|
|
580
|
+
if (o > l && Et.contrast(i, e) >= za && (n = i, l = o), l >= $r)
|
|
580
581
|
break;
|
|
581
582
|
}
|
|
582
583
|
return n;
|
|
@@ -725,8 +726,8 @@ function pe(t, a, e) {
|
|
|
725
726
|
} else
|
|
726
727
|
a.remove();
|
|
727
728
|
}
|
|
728
|
-
const Ts = 60, Ca = 10, Ir = 1.3, Cs = 12,
|
|
729
|
-
function Ns(t, a, e =
|
|
729
|
+
const Ts = 60, Ca = 10, Ir = 1.3, Cs = 12, Ds = 3, zs = 14, Ps = 10;
|
|
730
|
+
function Ns(t, a, e = Ds) {
|
|
730
731
|
if (t === "")
|
|
731
732
|
return [""];
|
|
732
733
|
if (t.length * Ca <= a)
|
|
@@ -816,11 +817,11 @@ function Rs(t, a) {
|
|
|
816
817
|
const e = Na(t, a ?? null);
|
|
817
818
|
return Math.ceil(e) + Cs;
|
|
818
819
|
}
|
|
819
|
-
function
|
|
820
|
+
function Bs(t) {
|
|
820
821
|
let a = 1;
|
|
821
822
|
for (const e of t)
|
|
822
823
|
e.length > a && (a = e.length);
|
|
823
|
-
return a <= 1 ? 0 : a *
|
|
824
|
+
return a <= 1 ? 0 : a * zs + Ps;
|
|
824
825
|
}
|
|
825
826
|
function Rr(t, a, e = {}, r = 24) {
|
|
826
827
|
if (t.length === 0 || a <= 0 || e.labelPosition === "off" || e.labelPosition === "inside")
|
|
@@ -831,7 +832,7 @@ function Rr(t, a, e = {}, r = 24) {
|
|
|
831
832
|
if (l !== "vertical" && f) {
|
|
832
833
|
const u = nl(t, d, n);
|
|
833
834
|
if (u) {
|
|
834
|
-
const v =
|
|
835
|
+
const v = Bs(Array.from(u.values()));
|
|
835
836
|
return v > r ? v : void 0;
|
|
836
837
|
}
|
|
837
838
|
}
|
|
@@ -852,7 +853,7 @@ function nl(t, a, e) {
|
|
|
852
853
|
}
|
|
853
854
|
return n ? r : null;
|
|
854
855
|
}
|
|
855
|
-
function
|
|
856
|
+
function Ys(t, a) {
|
|
856
857
|
t.selectAll(".tick").each(function() {
|
|
857
858
|
const e = h.select(this), r = e.datum(), n = r instanceof Date ? r.toISOString() : String(r), l = a.get(n);
|
|
858
859
|
if (!l || l.length <= 1)
|
|
@@ -929,7 +930,7 @@ class Hs extends ea {
|
|
|
929
930
|
}
|
|
930
931
|
this.config("showTicks") || E.selectAll(".tick line").remove();
|
|
931
932
|
const X = s === "auto" ? "outside" : s;
|
|
932
|
-
X === "off" ? E.selectAll(".tick text").remove() : X === "inside" && E.selectAll(".tick text").attr("y", 0).attr("dy", "-0.6em"), w && X !== "off" ? E.selectAll(".tick text").attr("transform", "rotate(-90)").attr("text-anchor", "end").attr("x", l === "above" ? 9 : -9).attr("y", 0).attr("dy", "0.32em") : E.selectAll(".tick text").attr("transform", null), A && X !== "off" &&
|
|
933
|
+
X === "off" ? E.selectAll(".tick text").remove() : X === "inside" && E.selectAll(".tick text").attr("y", 0).attr("dy", "-0.6em"), w && X !== "off" ? E.selectAll(".tick text").attr("transform", "rotate(-90)").attr("text-anchor", "end").attr("x", l === "above" ? 9 : -9).attr("y", 0).attr("dy", "0.32em") : E.selectAll(".tick text").attr("transform", null), A && X !== "off" && Ys(E, A);
|
|
933
934
|
}
|
|
934
935
|
postDraw() {
|
|
935
936
|
const a = this.config("gridStyle"), e = this.config("height"), r = this.base.select(".bc-axis-horizontal").node();
|
|
@@ -947,7 +948,7 @@ function Gs(t, a, e) {
|
|
|
947
948
|
const cn = 30;
|
|
948
949
|
class _s extends ea {
|
|
949
950
|
initialize() {
|
|
950
|
-
this.configDefine("scale", { defaultValue: h.scaleLinear() }), this.configDefine("direction", { defaultValue:
|
|
951
|
+
this.configDefine("scale", { defaultValue: h.scaleLinear() }), this.configDefine("direction", { defaultValue: De.Left }), this.configDefine("showAxis", { defaultValue: !0 }), this.configDefine("showTicks", { defaultValue: !1 }), this.configDefine("gridStyle", { defaultValue: Bt.Dashed }), this.configDefine("gridWidth", { defaultValue: 0 }), this.configDefine("height", { defaultValue: 0 }), this.configDefine("ticks", { defaultValue: null }), this.configDefine("numberFormat", { defaultValue: null }), this.configDefine("labelPosition", { defaultValue: Pt.Auto }), this.configDefine("topPadding", { defaultValue: 0 }), this.configDefine("tickFormat", { defaultValue: null });
|
|
951
952
|
const a = this.base.append("g");
|
|
952
953
|
this.layer("axis", a, {
|
|
953
954
|
dataBind: (e, r) => e.selectAll(".bc-axis-vertical").data(r),
|
|
@@ -955,7 +956,7 @@ class _s extends ea {
|
|
|
955
956
|
events: {
|
|
956
957
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
957
958
|
"merge:transition": (e) => {
|
|
958
|
-
const r = this.config("scale"), n = this.config("direction"), l = this.config("showAxis"), i = this.config("showTicks"), s = this.config("labelPosition"), o = this.config("gridWidth"), c = this.config("height"), d = n ===
|
|
959
|
+
const r = this.config("scale"), n = this.config("direction"), l = this.config("showAxis"), i = this.config("showTicks"), s = this.config("labelPosition"), o = this.config("gridWidth"), c = this.config("height"), d = n === De.Right ? h.axisRight(r) : h.axisLeft(r);
|
|
959
960
|
i || d.tickSizeOuter(0);
|
|
960
961
|
const g = this.config("ticks");
|
|
961
962
|
if (g)
|
|
@@ -977,7 +978,7 @@ class _s extends ea {
|
|
|
977
978
|
const m = s === Pt.Auto ? o > 0 && o < 400 ? Pt.Inside : Pt.Outside : s;
|
|
978
979
|
if (m === Pt.Inside) {
|
|
979
980
|
const S = l ? 4 : 0, A = u > 0 ? e.selectAll(".tick text") : h.select(v).selectAll(".tick text");
|
|
980
|
-
n ===
|
|
981
|
+
n === De.Right ? A.attr("x", -S).attr("dy", "-0.4em").attr("text-anchor", "end") : A.attr("x", S).attr("dy", "-0.4em").attr("text-anchor", "start");
|
|
981
982
|
} else m === Pt.Off && h.select(v).selectAll(".tick text").attr("opacity", 0);
|
|
982
983
|
}
|
|
983
984
|
},
|
|
@@ -987,7 +988,7 @@ class _s extends ea {
|
|
|
987
988
|
},
|
|
988
989
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
989
990
|
enter: (e) => {
|
|
990
|
-
const r = this.config("scale"), n = this.config("direction"), l = this.config("labelPosition"), i = this.config("gridWidth"), s = this.config("height"), o = this.config("topPadding"), c = n ===
|
|
991
|
+
const r = this.config("scale"), n = this.config("direction"), l = this.config("labelPosition"), i = this.config("gridWidth"), s = this.config("height"), o = this.config("topPadding"), c = n === De.Right ? h.axisRight(r) : h.axisLeft(r);
|
|
991
992
|
this.config("showTicks") || c.tickSizeOuter(0);
|
|
992
993
|
const d = this.config("ticks");
|
|
993
994
|
if (d)
|
|
@@ -1009,7 +1010,7 @@ class _s extends ea {
|
|
|
1009
1010
|
const b = l === Pt.Auto ? i > 0 && i < 400 ? Pt.Inside : Pt.Outside : l;
|
|
1010
1011
|
if (b === Pt.Inside) {
|
|
1011
1012
|
const m = f ? 4 : 0;
|
|
1012
|
-
if (n ===
|
|
1013
|
+
if (n === De.Right ? e.selectAll(".tick text").attr("x", -m).attr("dy", "-0.4em").attr("text-anchor", "end") : e.selectAll(".tick text").attr("x", m).attr("dy", "-0.4em").attr("text-anchor", "start"), u ? e.selectAll(".tick line").attr("x2", n === De.Right ? -6 : 6) : e.selectAll(".tick line").remove(), o > 0 && f) {
|
|
1013
1014
|
const S = e.select(".domain");
|
|
1014
1015
|
if (!S.empty()) {
|
|
1015
1016
|
const A = S.attr("d"), w = A.replace(/V[\d.]+/, `V${-o}`);
|
|
@@ -1024,8 +1025,8 @@ class _s extends ea {
|
|
|
1024
1025
|
}
|
|
1025
1026
|
postDraw() {
|
|
1026
1027
|
const a = this.config("gridStyle"), e = this.config("gridWidth"), r = this.config("direction"), n = this.base.select(".bc-axis-vertical").node();
|
|
1027
|
-
if (n && a !==
|
|
1028
|
-
const l = r ===
|
|
1028
|
+
if (n && a !== Bt.None && e > 0) {
|
|
1029
|
+
const l = r === De.Right ? -e : e;
|
|
1029
1030
|
Vs(n, a, l);
|
|
1030
1031
|
}
|
|
1031
1032
|
}
|
|
@@ -1035,13 +1036,13 @@ function Vs(t, a, e) {
|
|
|
1035
1036
|
const r = ((s = t.ownerSVGElement) == null ? void 0 : s.parentElement) ?? document.documentElement, l = getComputedStyle(r).getPropertyValue("--bc-grid-color").trim() || "#ccc";
|
|
1036
1037
|
h.select(t).selectAll(".tick").each(function() {
|
|
1037
1038
|
const c = h.select(this).append("line").attr("class", "bc-grid-line").attr("x1", 0).attr("x2", e).attr("y1", 0).attr("y2", 0).attr("stroke", l).attr("stroke-width", 1);
|
|
1038
|
-
a ===
|
|
1039
|
+
a === Bt.Dashed ? c.attr("stroke-dasharray", "4,4") : a === Bt.Dotted && c.attr("stroke-dasharray", "1,3");
|
|
1039
1040
|
});
|
|
1040
1041
|
}
|
|
1041
1042
|
function Ws(t) {
|
|
1042
1043
|
return typeof t.step == "function";
|
|
1043
1044
|
}
|
|
1044
|
-
const
|
|
1045
|
+
const Ya = /* @__PURE__ */ new WeakMap();
|
|
1045
1046
|
class ye {
|
|
1046
1047
|
constructor(a) {
|
|
1047
1048
|
Te(this, "vGroup", null);
|
|
@@ -1053,11 +1054,11 @@ class ye {
|
|
|
1053
1054
|
this.container = a;
|
|
1054
1055
|
}
|
|
1055
1056
|
static for(a) {
|
|
1056
|
-
let e =
|
|
1057
|
-
return e || (e = new ye(a),
|
|
1057
|
+
let e = Ya.get(a);
|
|
1058
|
+
return e || (e = new ye(a), Ya.set(a, e)), e;
|
|
1058
1059
|
}
|
|
1059
1060
|
static clear(a) {
|
|
1060
|
-
|
|
1061
|
+
Ya.delete(a);
|
|
1061
1062
|
}
|
|
1062
1063
|
/**
|
|
1063
1064
|
* Remove axis groups from DOM before replaceChildren().
|
|
@@ -1165,7 +1166,7 @@ class ye {
|
|
|
1165
1166
|
* Tear down the service and remove from the WeakMap.
|
|
1166
1167
|
*/
|
|
1167
1168
|
destroy() {
|
|
1168
|
-
this.detach(), this.vChart = null, this.hChart = null, this.vGroup = null, this.hGroup = null, this.initialized = !1,
|
|
1169
|
+
this.detach(), this.vChart = null, this.hChart = null, this.vGroup = null, this.hGroup = null, this.initialized = !1, Ya.delete(this.container);
|
|
1169
1170
|
}
|
|
1170
1171
|
}
|
|
1171
1172
|
const ll = "bc-tooltip";
|
|
@@ -1244,11 +1245,11 @@ function Ue(t) {
|
|
|
1244
1245
|
}
|
|
1245
1246
|
function Us(t) {
|
|
1246
1247
|
switch (t) {
|
|
1247
|
-
case
|
|
1248
|
+
case ze.Solid:
|
|
1248
1249
|
return "none";
|
|
1249
|
-
case
|
|
1250
|
+
case ze.Dotted:
|
|
1250
1251
|
return "2,2";
|
|
1251
|
-
case
|
|
1252
|
+
case ze.Dashed:
|
|
1252
1253
|
default:
|
|
1253
1254
|
return "4,3";
|
|
1254
1255
|
}
|
|
@@ -1287,7 +1288,7 @@ function la(t) {
|
|
|
1287
1288
|
}
|
|
1288
1289
|
};
|
|
1289
1290
|
}
|
|
1290
|
-
function
|
|
1291
|
+
function Br(t) {
|
|
1291
1292
|
const a = t.querySelector(".bc-annotation-line");
|
|
1292
1293
|
if (!(!a || !a.hasAttribute("data-line-style")))
|
|
1293
1294
|
return {
|
|
@@ -1302,7 +1303,7 @@ function Yr(t) {
|
|
|
1302
1303
|
function de(t) {
|
|
1303
1304
|
const a = /* @__PURE__ */ new Map(), e = t.querySelectorAll("g[data-annotation-id]");
|
|
1304
1305
|
for (const r of e) {
|
|
1305
|
-
const n = r.getAttribute("data-annotation-id"), l =
|
|
1306
|
+
const n = r.getAttribute("data-annotation-id"), l = Br(r);
|
|
1306
1307
|
try {
|
|
1307
1308
|
const i = r.getBBox();
|
|
1308
1309
|
a.set(n, { id: n, element: r, rect: { x: i.x, y: i.y, width: i.width, height: i.height }, line: l });
|
|
@@ -1338,11 +1339,11 @@ function js(t, a) {
|
|
|
1338
1339
|
const e = Xe[t] ?? Xe.NW;
|
|
1339
1340
|
return { dx: e.dx * a, dy: e.dy * a };
|
|
1340
1341
|
}
|
|
1341
|
-
function
|
|
1342
|
+
function Yr(t) {
|
|
1342
1343
|
return "step" in t && !("bandwidth" in t);
|
|
1343
1344
|
}
|
|
1344
1345
|
function sl(t) {
|
|
1345
|
-
if ("bandwidth" in t ||
|
|
1346
|
+
if ("bandwidth" in t || Yr(t))
|
|
1346
1347
|
return !1;
|
|
1347
1348
|
const a = t.domain();
|
|
1348
1349
|
return a.length > 0 && a[0] instanceof Date;
|
|
@@ -1352,7 +1353,7 @@ function ol(t, a) {
|
|
|
1352
1353
|
const e = t;
|
|
1353
1354
|
return (e(a) ?? 0) + e.bandwidth() / 2;
|
|
1354
1355
|
}
|
|
1355
|
-
return
|
|
1356
|
+
return Yr(t) ? t(a) ?? 0 : sl(t) ? t(new Date(a)) : t(Number(a));
|
|
1356
1357
|
}
|
|
1357
1358
|
function fn(t, a) {
|
|
1358
1359
|
const e = (a.left + a.right) / 2, r = (a.top + a.bottom) / 2, n = dn[t] ?? dn.N;
|
|
@@ -1476,7 +1477,7 @@ function Ha(t, a, e = Un.Center) {
|
|
|
1476
1477
|
const r = a, n = r(String(t)) ?? 0, l = r.bandwidth(), i = r.step() - l;
|
|
1477
1478
|
return e === "start" ? n - i / 2 : e === "end" ? n + l + i / 2 : n + l / 2;
|
|
1478
1479
|
}
|
|
1479
|
-
if (
|
|
1480
|
+
if (Yr(a)) {
|
|
1480
1481
|
const r = a(String(t)) ?? 0, n = a.step() / 2;
|
|
1481
1482
|
return e === "start" ? r - n : e === "end" ? r + n : r;
|
|
1482
1483
|
}
|
|
@@ -1649,7 +1650,7 @@ function Nr(t, a, e, r) {
|
|
|
1649
1650
|
return `M ${t} ${a} L ${n} ${a} L ${e} ${r}`;
|
|
1650
1651
|
}
|
|
1651
1652
|
function lo(t, a) {
|
|
1652
|
-
const e = t.hasAttribute("marker-end"), r =
|
|
1653
|
+
const e = t.hasAttribute("marker-end"), r = Br(t.parentElement);
|
|
1653
1654
|
if (e && r) {
|
|
1654
1655
|
const n = h.select(t), l = t.getAttribute("d"), i = `M ${r.fromX} ${r.fromY} L ${r.fromX} ${r.fromY}`;
|
|
1655
1656
|
if (n.attr("d", i), r.style === Vt.Elbow) {
|
|
@@ -1685,7 +1686,7 @@ function so(t, a) {
|
|
|
1685
1686
|
return t.style !== a.style || t.departVertical !== a.departVertical ? !1 : Math.abs(t.fromX - a.fromX) <= _a && Math.abs(t.fromY - a.fromY) <= _a && Math.abs(t.toX - a.toX) <= _a && Math.abs(t.toY - a.toY) <= _a;
|
|
1686
1687
|
}
|
|
1687
1688
|
function oo(t, a, e) {
|
|
1688
|
-
const r =
|
|
1689
|
+
const r = Br(t.parentElement);
|
|
1689
1690
|
if (!r || so(a, r))
|
|
1690
1691
|
return;
|
|
1691
1692
|
const n = h.select(t);
|
|
@@ -2163,16 +2164,16 @@ function fe(t, a, e = 1) {
|
|
|
2163
2164
|
return t.size === 0 || t.has(a) ? e : Lo;
|
|
2164
2165
|
}
|
|
2165
2166
|
const ko = 11, Mo = 6.2, xn = ko, Oo = 8, To = 4, Co = 14;
|
|
2166
|
-
function
|
|
2167
|
+
function Do(t) {
|
|
2167
2168
|
return t.length * Mo;
|
|
2168
2169
|
}
|
|
2169
2170
|
function oa(t) {
|
|
2170
|
-
const a =
|
|
2171
|
+
const a = Do(t.text);
|
|
2171
2172
|
return t.placement === "inside" ? t.orientation === "horizontal" ? a <= t.barWidth - Oo && xn <= t.barHeight : xn <= t.barHeight - To && a <= t.barWidth : (t.orientation === "vertical" ? t.barWidth : t.barHeight) >= Co;
|
|
2172
2173
|
}
|
|
2173
2174
|
const fa = ["#4e79a7"], vn = 13;
|
|
2174
2175
|
function pl(t, a, e = {}, r = !1) {
|
|
2175
|
-
var
|
|
2176
|
+
var B, q, st, gt, ft, At, Tt, kt, Lt, Ct, Mt, U, nt, L;
|
|
2176
2177
|
Le(r);
|
|
2177
2178
|
let n = null, l, i, s, o = [];
|
|
2178
2179
|
const c = ye.for(t);
|
|
@@ -2180,11 +2181,11 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2180
2181
|
const p = ke(t);
|
|
2181
2182
|
i = p == null ? void 0 : p.margin, s = p == null ? void 0 : p.plotRect, c.detach(), (p == null ? void 0 : p.chartType) === "bar-vertical" ? o = Array.from(t.querySelectorAll(".bc-frame .bc-bar")) : p && (n = ge(t)), l = /* @__PURE__ */ new Map();
|
|
2182
2183
|
for (const x of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2183
|
-
for (const [y,
|
|
2184
|
-
l.set(y,
|
|
2184
|
+
for (const [y, D] of de(x))
|
|
2185
|
+
l.set(y, D);
|
|
2185
2186
|
t.replaceChildren();
|
|
2186
2187
|
}
|
|
2187
|
-
const { body: d } = we(t, e.frame), g = ce(d).width, f = e.categoryLabelLine === !0, u = ra(a.values, (
|
|
2188
|
+
const { body: d } = we(t, e.frame), g = ce(d).width, f = e.categoryLabelLine === !0, u = ra(a.values, (B = e.verticalAxis) == null ? void 0 : B.range, (q = e.verticalAxis) == null ? void 0 : q.numberFormat, (st = e.verticalAxis) == null ? void 0 : st.scaleType), v = f ? Pt.Off : (gt = e.horizontalAxis) == null ? void 0 : gt.labelPosition, b = Ne(g, (ft = e.verticalAxis) == null ? void 0 : ft.labelPosition, v, (At = e.verticalAxis) == null ? void 0 : At.direction, u);
|
|
2188
2189
|
if (!f) {
|
|
2189
2190
|
const p = Math.max(0, g - (b.left ?? 50) - (b.right ?? 20)), x = Rr(a.labels, p, e.horizontalAxis);
|
|
2190
2191
|
x !== void 0 && (b.bottom = x);
|
|
@@ -2207,7 +2208,7 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2207
2208
|
const p = R - et;
|
|
2208
2209
|
et -= p * 0.1;
|
|
2209
2210
|
}
|
|
2210
|
-
const
|
|
2211
|
+
const z = V ? h.scaleSymlog().domain([et, R]).nice().range([C, 0]) : h.scaleLinear().domain([et, R]).nice().range([C, 0]);
|
|
2211
2212
|
c.attach(m, $);
|
|
2212
2213
|
const H = _ && e.valueLabels && !P ? (() => {
|
|
2213
2214
|
const p = new Map(X.map((x) => [x.label, x.value]));
|
|
@@ -2218,9 +2219,9 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2218
2219
|
};
|
|
2219
2220
|
})() : { ...e.horizontalAxis, width: S }, J = f ? { ...H, labelPosition: Pt.Off } : H;
|
|
2220
2221
|
c.update({
|
|
2221
|
-
vertical: { scale:
|
|
2222
|
+
vertical: { scale: z, height: A, options: { ...e.verticalAxis, gridWidth: S, topPadding: w.top } },
|
|
2222
2223
|
horizontal: { scale: F, height: A, options: J }
|
|
2223
|
-
}), !V && et < 0 && R > 0 && h.select(m).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", S).attr("y1",
|
|
2224
|
+
}), !V && et < 0 && R > 0 && h.select(m).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", S).attr("y1", z(0)).attr("y2", z(0)).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2224
2225
|
const Z = Re(e.colorizes), at = new Set((e.highlights ?? []).map((p) => p.target)), ut = m.ownerSVGElement, vt = Ee(ut, t, "bars", { x: 0, y: 0, width: S, height: C }), it = h.select(ut).select("defs"), ct = vt.replace(/^bc-clip-/, ""), bt = h.select(m).append("g").attr("clip-path", `url(#${vt})`);
|
|
2225
2226
|
if (e.barBackground) {
|
|
2226
2227
|
const p = (e.colors ?? fa)[0], x = P ? W : X.map((y) => y.label);
|
|
@@ -2237,16 +2238,16 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2237
2238
|
if (!P && e.connectedColumns && X.length > 1) {
|
|
2238
2239
|
const p = e.colors ?? fa, x = e.connectionsOpacity ?? 0.15;
|
|
2239
2240
|
for (let y = 0; y < X.length - 1; y++) {
|
|
2240
|
-
const
|
|
2241
|
-
if (
|
|
2241
|
+
const D = X[y], K = X[y + 1];
|
|
2242
|
+
if (D.value == null || K.value == null || Number.isNaN(D.value) || Number.isNaN(K.value) || D.value === 0 || K.value === 0)
|
|
2242
2243
|
continue;
|
|
2243
|
-
const ot = (F(
|
|
2244
|
+
const ot = (F(D.label) ?? 0) + F.bandwidth(), N = F(K.label) ?? 0, mt = Math.min(z(0), z(D.value)), pt = Math.min(z(0), z(K.value)), M = z(0), tt = Z.get(D.label) ?? p[0], xt = Z.get(K.label) ?? p[0];
|
|
2244
2245
|
let wt;
|
|
2245
2246
|
if (tt === xt)
|
|
2246
2247
|
wt = tt;
|
|
2247
2248
|
else {
|
|
2248
|
-
const
|
|
2249
|
-
It.append("stop").attr("offset", "0%").attr("stop-color", tt), It.append("stop").attr("offset", "100%").attr("stop-color", xt), wt = `url(#${
|
|
2249
|
+
const Dt = `bc-conn-grad-${ct}-${y}`, It = it.append("linearGradient").attr("id", Dt).attr("x1", "0%").attr("x2", "100%").attr("y1", "0%").attr("y2", "0%");
|
|
2250
|
+
It.append("stop").attr("offset", "0%").attr("stop-color", tt), It.append("stop").attr("offset", "100%").attr("stop-color", xt), wt = `url(#${Dt})`;
|
|
2250
2251
|
}
|
|
2251
2252
|
bt.append("polygon").attr("class", "bc-bar-connection").attr("points", `${ot},${mt} ${N},${pt} ${N},${M} ${ot},${M}`).attr("fill", wt).attr("opacity", x).attr("pointer-events", "none");
|
|
2252
2253
|
}
|
|
@@ -2255,32 +2256,32 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2255
2256
|
if (P) {
|
|
2256
2257
|
const p = e.colors ?? fa, x = "#333";
|
|
2257
2258
|
if (e.connectedColumns && I.length > 1) {
|
|
2258
|
-
const y = e.colors ?? fa,
|
|
2259
|
+
const y = e.colors ?? fa, D = e.connectionsOpacity ?? 0.15;
|
|
2259
2260
|
for (let K = 0; K < I.length - 1; K++) {
|
|
2260
2261
|
const ot = I[K], N = I[K + 1];
|
|
2261
2262
|
if (N.isTotal || ot.value == null || N.value == null || Number.isNaN(ot.value) || Number.isNaN(N.value) || ot.value === 0 || N.value === 0)
|
|
2262
2263
|
continue;
|
|
2263
|
-
const mt = (F(ot.label) ?? 0) + F.bandwidth(), pt = F(N.label) ?? 0, M =
|
|
2264
|
+
const mt = (F(ot.label) ?? 0) + F.bandwidth(), pt = F(N.label) ?? 0, M = z(ot.y1), tt = z(N.y1), xt = z(ot.y0), wt = z(N.y0), Dt = Z.get(ot.label) ?? y[0], It = Z.get(N.label) ?? y[0];
|
|
2264
2265
|
let re;
|
|
2265
|
-
if (
|
|
2266
|
-
re =
|
|
2266
|
+
if (Dt === It)
|
|
2267
|
+
re = Dt;
|
|
2267
2268
|
else {
|
|
2268
2269
|
const xe = `bc-conn-grad-${ct}-${K}`, ne = it.append("linearGradient").attr("id", xe).attr("x1", "0%").attr("x2", "100%").attr("y1", "0%").attr("y2", "0%");
|
|
2269
|
-
ne.append("stop").attr("offset", "0%").attr("stop-color",
|
|
2270
|
+
ne.append("stop").attr("offset", "0%").attr("stop-color", Dt), ne.append("stop").attr("offset", "100%").attr("stop-color", It), re = `url(#${xe})`;
|
|
2270
2271
|
}
|
|
2271
|
-
bt.append("polygon").attr("class", "bc-bar-connection").attr("points", `${mt},${M} ${pt},${tt} ${pt},${wt} ${mt},${xt}`).attr("fill", re).attr("opacity",
|
|
2272
|
+
bt.append("polygon").attr("class", "bc-bar-connection").attr("points", `${mt},${M} ${pt},${tt} ${pt},${wt} ${mt},${xt}`).attr("fill", re).attr("opacity", D).attr("pointer-events", "none");
|
|
2272
2273
|
}
|
|
2273
2274
|
}
|
|
2274
2275
|
for (let y = 0; y < I.length - 1; y++) {
|
|
2275
|
-
const
|
|
2276
|
+
const D = I[y], K = I[y + 1];
|
|
2276
2277
|
if (K.isTotal)
|
|
2277
2278
|
break;
|
|
2278
|
-
bt.append("line").attr("class", "bc-waterfall-connector").attr("x1", (F(
|
|
2279
|
+
bt.append("line").attr("class", "bc-waterfall-connector").attr("x1", (F(D.label) ?? 0) + F.bandwidth()).attr("x2", F(K.label) ?? 0).attr("y1", z(D.y1)).attr("y2", z(D.y1)).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
|
|
2279
2280
|
}
|
|
2280
|
-
if (bt.selectAll(".bc-bar").data(I, (y) => y.label).enter().append("rect").attr("class", "bc-bar").attr("x", (y) => F(y.label) ?? 0).attr("y", (y) => Math.min(
|
|
2281
|
-
const y = e.valueLabelPosition ?? St.Auto,
|
|
2281
|
+
if (bt.selectAll(".bc-bar").data(I, (y) => y.label).enter().append("rect").attr("class", "bc-bar").attr("x", (y) => F(y.label) ?? 0).attr("y", (y) => Math.min(z(y.y0), z(y.y1))).attr("width", F.bandwidth()).attr("height", (y) => Math.abs(z(y.y0) - z(y.y1))).attr("fill", (y) => y.isTotal ? x : Z.get(y.label) ?? p[0]).attr("opacity", (y) => at.size > 0 ? fe(at, y.label) : null), e.valueLabels) {
|
|
2282
|
+
const y = e.valueLabelPosition ?? St.Auto, D = qe(((U = e.verticalAxis) == null ? void 0 : U.numberFormat) ?? ""), K = (ot) => D ? D(ot) : String(ot);
|
|
2282
2283
|
yt.selectAll(".bc-value-label").data(I, (ot) => ot.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("x", (ot) => (F(ot.label) ?? 0) + F.bandwidth() / 2).attr("y", (ot) => {
|
|
2283
|
-
const N = Math.min(
|
|
2284
|
+
const N = Math.min(z(ot.y0), z(ot.y1)), mt = Math.abs(z(ot.y0) - z(ot.y1));
|
|
2284
2285
|
return y === St.Inside ? N + mt / 2 : N - 4;
|
|
2285
2286
|
}).attr("text-anchor", "middle").attr("dominant-baseline", y === St.Inside ? "central" : "auto").attr("fill", (ot) => y === St.Inside ? Ae(ot.isTotal ? x : Z.get(ot.label) ?? p[0]) : "currentColor").text((ot) => _ ? ot.label : K(ot.isTotal ? ot.y1 : ot.value));
|
|
2286
2287
|
}
|
|
@@ -2298,9 +2299,9 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2298
2299
|
insert: (K) => K.append("rect").attr("class", "bc-bar"),
|
|
2299
2300
|
attrs: (K) => ({
|
|
2300
2301
|
x: F(K.label) ?? 0,
|
|
2301
|
-
y: Math.min(
|
|
2302
|
+
y: Math.min(z(0), z(K.value)),
|
|
2302
2303
|
width: F.bandwidth(),
|
|
2303
|
-
height: Math.abs(
|
|
2304
|
+
height: Math.abs(z(K.value) - z(0)),
|
|
2304
2305
|
fill: Z.get(K.label) ?? (e.colors ?? fa)[0],
|
|
2305
2306
|
opacity: fe(at, K.label)
|
|
2306
2307
|
})
|
|
@@ -2321,7 +2322,7 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2321
2322
|
color: e.crosshairColor
|
|
2322
2323
|
})), (L = e.annotations) != null && L.length && y.use(va(e.annotations, {
|
|
2323
2324
|
scaleX: F,
|
|
2324
|
-
scaleY:
|
|
2325
|
+
scaleY: z,
|
|
2325
2326
|
data: X,
|
|
2326
2327
|
width: S,
|
|
2327
2328
|
height: C,
|
|
@@ -2329,8 +2330,8 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2329
2330
|
transition: r,
|
|
2330
2331
|
priorAnnotations: l
|
|
2331
2332
|
}));
|
|
2332
|
-
const
|
|
2333
|
-
p.state === "committing" ? p.register(
|
|
2333
|
+
const D = () => y.draw(X);
|
|
2334
|
+
p.state === "committing" ? p.register(D) : D(), e.valueLabels && Po(yt, X, F, z, {
|
|
2334
2335
|
position: e.valueLabelPosition,
|
|
2335
2336
|
colorOverrides: Z,
|
|
2336
2337
|
colors: e.colors ?? fa,
|
|
@@ -2346,7 +2347,7 @@ function pl(t, a, e = {}, r = !1) {
|
|
|
2346
2347
|
}
|
|
2347
2348
|
Me(t, { chartType: "bar-vertical", margin: w, plotRect: G }), n && (me(bt.node()), pe(t, n));
|
|
2348
2349
|
}
|
|
2349
|
-
function
|
|
2350
|
+
function zo(t, a, e, r) {
|
|
2350
2351
|
const n = Math.abs(e(t.value) - e(0)), l = r === St.Inside, i = (a(t.label) ?? 0) + a.bandwidth() / 2, s = "middle";
|
|
2351
2352
|
let o, c;
|
|
2352
2353
|
return t.value < 0 ? l ? (o = e(t.value) - n / 2, c = "central") : (o = e(t.value) + 4, c = "hanging") : l ? (o = e(t.value) + n / 2, c = "central") : (o = e(t.value) - 4, c = "auto"), { tx: i, ty: o, anchor: s, baseline: c, isInside: l };
|
|
@@ -2372,7 +2373,7 @@ function Po(t, a, e, r, n) {
|
|
|
2372
2373
|
key: (f) => f.label,
|
|
2373
2374
|
insert: (f) => f.append("text").attr("class", "bc-value-label").attr("font-size", "11px"),
|
|
2374
2375
|
attrs: (f) => {
|
|
2375
|
-
const u =
|
|
2376
|
+
const u = zo(f, e, r, l);
|
|
2376
2377
|
return {
|
|
2377
2378
|
x: u.tx,
|
|
2378
2379
|
y: u.ty,
|
|
@@ -2398,7 +2399,7 @@ function Or(t) {
|
|
|
2398
2399
|
return t.length * 6.5;
|
|
2399
2400
|
}
|
|
2400
2401
|
function yl(t, a, e = {}, r = !1) {
|
|
2401
|
-
var
|
|
2402
|
+
var B, q, st, gt, ft, At, Tt, kt, Lt, Ct, Mt;
|
|
2402
2403
|
Le(r);
|
|
2403
2404
|
let n = null, l, i, s = [], o;
|
|
2404
2405
|
const c = ye.for(t);
|
|
@@ -2410,7 +2411,7 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2410
2411
|
l.set(L, p);
|
|
2411
2412
|
t.replaceChildren();
|
|
2412
2413
|
}
|
|
2413
|
-
const { body: d } = we(t, e.frame), g = ce(d).width, f = g > 0 && g < 400 && ((
|
|
2414
|
+
const { body: d } = we(t, e.frame), g = ce(d).width, f = g > 0 && g < 400 && ((B = e.verticalAxis) == null ? void 0 : B.labelPosition) !== "outside", u = e.categoryLabelLine === !0 || f, v = rr(a.labels), b = u ? Pt.Off : (q = e.verticalAxis) == null ? void 0 : q.labelPosition, m = Ne(g, b, (st = e.horizontalAxis) == null ? void 0 : st.labelPosition, (gt = e.verticalAxis) == null ? void 0 : gt.direction, v, (ft = e.horizontalAxis) == null ? void 0 : ft.showAxis), S = e.valueLabelPosition ?? St.Auto, A = e.swapLabelValue === !0;
|
|
2414
2415
|
if (e.valueLabels && S !== St.Inside)
|
|
2415
2416
|
if (A) {
|
|
2416
2417
|
const U = a.labels.reduce((L, p) => L.length > p.length ? L : p, ""), nt = Or(U) + Mr;
|
|
@@ -2431,7 +2432,7 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2431
2432
|
}
|
|
2432
2433
|
e.waterfallTotal && W.push({ label: "Total", value: U, x0: 0, x1: U, isTotal: !0 });
|
|
2433
2434
|
}
|
|
2434
|
-
const F = ((At = e.horizontalAxis) == null ? void 0 : At.scaleType) === "log", V = I ? W.flatMap((U) => [U.x0, U.x1]) : P.map((U) => U.value), [ht, et] = ya(V, (Tt = e.horizontalAxis) == null ? void 0 : Tt.range, (kt = e.horizontalAxis) == null ? void 0 : kt.scaleType), R = F ? h.scaleSymlog().domain([ht, et]).nice().range([0, k]) : h.scaleLinear().domain([ht, et]).nice().range([0, k]),
|
|
2435
|
+
const F = ((At = e.horizontalAxis) == null ? void 0 : At.scaleType) === "log", V = I ? W.flatMap((U) => [U.x0, U.x1]) : P.map((U) => U.value), [ht, et] = ya(V, (Tt = e.horizontalAxis) == null ? void 0 : Tt.range, (kt = e.horizontalAxis) == null ? void 0 : kt.scaleType), R = F ? h.scaleSymlog().domain([ht, et]).nice().range([0, k]) : h.scaleLinear().domain([ht, et]).nice().range([0, k]), z = I ? W.map((U) => U.label) : _, H = h.scaleBand().domain(z).range([0, C]).padding(aa(e.barGap)), J = A && e.valueLabels && !I ? (() => {
|
|
2435
2436
|
const U = new Map(P.map((nt) => [nt.label, nt.value]));
|
|
2436
2437
|
return {
|
|
2437
2438
|
...e.verticalAxis,
|
|
@@ -2446,10 +2447,10 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2446
2447
|
}), !F && ht < 0 && et > 0 && h.select(w).append("line").attr("class", "bc-zero-baseline").attr("x1", R(0)).attr("x2", R(0)).attr("y1", 0).attr("y2", C).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2447
2448
|
const at = Re(e.colorizes), ut = new Set((e.highlights ?? []).map((U) => U.target)), vt = w.ownerSVGElement, it = Ee(vt, t, "bars", { x: 0, y: 0, width: k, height: C }), ct = h.select(vt).select("defs"), bt = it.replace(/^bc-clip-/, ""), dt = h.select(w).append("g").attr("clip-path", `url(#${it})`);
|
|
2448
2449
|
if (e.barBackground) {
|
|
2449
|
-
const U = (e.colors ?? ua)[0], nt = I ?
|
|
2450
|
+
const U = (e.colors ?? ua)[0], nt = I ? z : P.map((L) => L.label);
|
|
2450
2451
|
dt.selectAll(".bc-bar-bg").data(nt, (L) => L).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (L) => (H(L) ?? 0) + E).attr("width", k).attr("height", H.bandwidth() - E).attr("fill", U).attr("opacity", 0.18);
|
|
2451
2452
|
}
|
|
2452
|
-
const yt = I ?
|
|
2453
|
+
const yt = I ? z : P.map((U) => U.label);
|
|
2453
2454
|
if (e.barSeparators && yt.length > 1) {
|
|
2454
2455
|
const U = H.step();
|
|
2455
2456
|
for (let nt = 1; nt < yt.length; nt++) {
|
|
@@ -2463,7 +2464,7 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2463
2464
|
const p = P[L], x = P[L + 1];
|
|
2464
2465
|
if (p.value == null || x.value == null || Number.isNaN(p.value) || Number.isNaN(x.value) || p.value === 0 || x.value === 0)
|
|
2465
2466
|
continue;
|
|
2466
|
-
const y = (H(p.label) ?? 0) + H.bandwidth(),
|
|
2467
|
+
const y = (H(p.label) ?? 0) + H.bandwidth(), D = (H(x.label) ?? 0) + E, K = Math.max(R(0), R(p.value)), ot = Math.max(R(0), R(x.value)), N = R(0), mt = at.get(p.label) ?? U[0], pt = at.get(x.label) ?? U[0];
|
|
2467
2468
|
let M;
|
|
2468
2469
|
if (mt === pt)
|
|
2469
2470
|
M = mt;
|
|
@@ -2471,7 +2472,7 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2471
2472
|
const tt = `bc-conn-grad-${bt}-${L}`, xt = ct.append("linearGradient").attr("id", tt).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
|
|
2472
2473
|
xt.append("stop").attr("offset", "0%").attr("stop-color", mt), xt.append("stop").attr("offset", "100%").attr("stop-color", pt), M = `url(#${tt})`;
|
|
2473
2474
|
}
|
|
2474
|
-
dt.append("polygon").attr("class", "bc-bar-connection").attr("points", `${K},${y} ${ot},${
|
|
2475
|
+
dt.append("polygon").attr("class", "bc-bar-connection").attr("points", `${K},${y} ${ot},${D} ${N},${D} ${N},${y}`).attr("fill", M).attr("opacity", nt).attr("pointer-events", "none");
|
|
2475
2476
|
}
|
|
2476
2477
|
}
|
|
2477
2478
|
if (I) {
|
|
@@ -2479,16 +2480,16 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2479
2480
|
if (e.connectedColumns && W.length > 1) {
|
|
2480
2481
|
const L = e.colors ?? ua, p = e.connectionsOpacity ?? 0.15;
|
|
2481
2482
|
for (let x = 0; x < W.length - 1; x++) {
|
|
2482
|
-
const y = W[x],
|
|
2483
|
-
if (
|
|
2483
|
+
const y = W[x], D = W[x + 1];
|
|
2484
|
+
if (D.isTotal || y.value == null || D.value == null || Number.isNaN(y.value) || Number.isNaN(D.value) || y.value === 0 || D.value === 0)
|
|
2484
2485
|
continue;
|
|
2485
|
-
const K = (H(y.label) ?? 0) + H.bandwidth(), ot = (H(
|
|
2486
|
+
const K = (H(y.label) ?? 0) + H.bandwidth(), ot = (H(D.label) ?? 0) + E, N = R(y.x1), mt = R(D.x1), pt = R(y.x0), M = R(D.x0), tt = at.get(y.label) ?? L[0], xt = at.get(D.label) ?? L[0];
|
|
2486
2487
|
let wt;
|
|
2487
2488
|
if (tt === xt)
|
|
2488
2489
|
wt = tt;
|
|
2489
2490
|
else {
|
|
2490
|
-
const
|
|
2491
|
-
It.append("stop").attr("offset", "0%").attr("stop-color", tt), It.append("stop").attr("offset", "100%").attr("stop-color", xt), wt = `url(#${
|
|
2491
|
+
const Dt = `bc-conn-grad-${bt}-${x}`, It = ct.append("linearGradient").attr("id", Dt).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
|
|
2492
|
+
It.append("stop").attr("offset", "0%").attr("stop-color", tt), It.append("stop").attr("offset", "100%").attr("stop-color", xt), wt = `url(#${Dt})`;
|
|
2492
2493
|
}
|
|
2493
2494
|
dt.append("polygon").attr("class", "bc-bar-connection").attr("points", `${N},${K} ${mt},${ot} ${M},${ot} ${pt},${K}`).attr("fill", wt).attr("opacity", p).attr("pointer-events", "none");
|
|
2494
2495
|
}
|
|
@@ -2500,11 +2501,11 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2500
2501
|
dt.append("line").attr("class", "bc-waterfall-connector").attr("x1", R(p.x1)).attr("x2", R(p.x1)).attr("y1", (H(p.label) ?? 0) + H.bandwidth()).attr("y2", (H(x.label) ?? 0) + E).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
|
|
2501
2502
|
}
|
|
2502
2503
|
if (dt.selectAll(".bc-bar").data(W, (L) => L.label).enter().append("rect").attr("class", "bc-bar").attr("x", (L) => Math.min(R(L.x0), R(L.x1))).attr("y", (L) => (H(L.label) ?? 0) + E).attr("width", (L) => Math.abs(R(L.x1) - R(L.x0))).attr("height", H.bandwidth() - E).attr("fill", (L) => L.isTotal ? nt : at.get(L.label) ?? U[0]).attr("opacity", (L) => ut.size > 0 ? fe(ut, L.label) : null), e.valueLabels) {
|
|
2503
|
-
const L = S, p = qe(((Lt = e.horizontalAxis) == null ? void 0 : Lt.numberFormat) ?? ""), x = (
|
|
2504
|
-
h.select(w).append("g").selectAll(".bc-value-label").data(W, (
|
|
2505
|
-
const K = Math.max(R(
|
|
2504
|
+
const L = S, p = qe(((Lt = e.horizontalAxis) == null ? void 0 : Lt.numberFormat) ?? ""), x = (D) => p ? p(D) : String(D);
|
|
2505
|
+
h.select(w).append("g").selectAll(".bc-value-label").data(W, (D) => D.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("dominant-baseline", "central").attr("y", (D) => (H(D.label) ?? 0) + E + (H.bandwidth() - E) / 2).attr("x", (D) => {
|
|
2506
|
+
const K = Math.max(R(D.x0), R(D.x1));
|
|
2506
2507
|
return L === St.Inside ? K - 4 : K + 4;
|
|
2507
|
-
}).attr("text-anchor", L === St.Inside ? "end" : "start").attr("fill", (
|
|
2508
|
+
}).attr("text-anchor", L === St.Inside ? "end" : "start").attr("fill", (D) => L === St.Inside ? Ae(D.isTotal ? nt : at.get(D.label) ?? U[0]) : "currentColor").text((D) => A ? D.label : x(D.isTotal ? D.x1 : D.value));
|
|
2508
2509
|
}
|
|
2509
2510
|
} else {
|
|
2510
2511
|
const U = Gt(t), nt = dt.append("g").node();
|
|
@@ -2569,7 +2570,7 @@ function yl(t, a, e = {}, r = !1) {
|
|
|
2569
2570
|
}
|
|
2570
2571
|
if (u) {
|
|
2571
2572
|
const U = h.select(w).append("g").attr("class", "bc-category-labels");
|
|
2572
|
-
for (const nt of
|
|
2573
|
+
for (const nt of z) {
|
|
2573
2574
|
const L = H(nt) ?? 0;
|
|
2574
2575
|
U.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", L + An / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(nt);
|
|
2575
2576
|
}
|
|
@@ -2633,7 +2634,7 @@ const xl = [
|
|
|
2633
2634
|
"#b07aa1",
|
|
2634
2635
|
"#ff9da7"
|
|
2635
2636
|
], Ro = 200, wn = 0.2;
|
|
2636
|
-
class
|
|
2637
|
+
class Bo extends ea {
|
|
2637
2638
|
initialize() {
|
|
2638
2639
|
this.configDefine("colors", { defaultValue: xl }), this.configDefine("yOffset", { defaultValue: -10 }), this.configDefine("layout", { defaultValue: "horizontal" }), this.configDefine("valueSuffixes", { defaultValue: [] }), this.configDefine("maxWidth", { defaultValue: 0 });
|
|
2639
2640
|
const a = this.base.append("g").attr("class", "bc-legend"), e = (r) => {
|
|
@@ -2666,7 +2667,7 @@ class Yo extends ea {
|
|
|
2666
2667
|
this.base.select(".bc-legend").attr("transform", `translate(0,${a})`);
|
|
2667
2668
|
}
|
|
2668
2669
|
}
|
|
2669
|
-
function
|
|
2670
|
+
function Yo(t) {
|
|
2670
2671
|
const a = h.select(t).selectAll(".bc-legend-item");
|
|
2671
2672
|
if (a.empty())
|
|
2672
2673
|
return;
|
|
@@ -2695,7 +2696,7 @@ function Bo(t) {
|
|
|
2695
2696
|
});
|
|
2696
2697
|
}
|
|
2697
2698
|
function je(t, a, e = xl, r = -10, n = "top", l = "start", i = 0, s = 0, o = 0, c = [], d = {}) {
|
|
2698
|
-
const g = n === "left" || n === "right" ? "vertical" : "horizontal", f = new
|
|
2699
|
+
const g = n === "left" || n === "right" ? "vertical" : "horizontal", f = new Bo(h.select(t));
|
|
2699
2700
|
f.config({ colors: e, yOffset: r, layout: g, valueSuffixes: c, maxWidth: i }), f.draw(a);
|
|
2700
2701
|
const u = t.querySelector(".bc-legend");
|
|
2701
2702
|
if (u) {
|
|
@@ -2716,7 +2717,7 @@ function je(t, a, e = xl, r = -10, n = "top", l = "start", i = 0, s = 0, o = 0,
|
|
|
2716
2717
|
let w = o, k = r;
|
|
2717
2718
|
g === "horizontal" ? l === "middle" ? w += -S + (i + S + A - v) / 2 : l === "end" ? w += i + A - v : w += -S : l === "middle" ? k += (s - b) / 2 : l === "end" && (k += s - b), u.setAttribute("transform", `translate(${w},${k})`);
|
|
2718
2719
|
}
|
|
2719
|
-
return
|
|
2720
|
+
return Yo(t), u;
|
|
2720
2721
|
}
|
|
2721
2722
|
function Ze(t, a, e) {
|
|
2722
2723
|
if (t.length === 0)
|
|
@@ -2736,43 +2737,43 @@ function Ze(t, a, e) {
|
|
|
2736
2737
|
function vl(t) {
|
|
2737
2738
|
return t.length === 0 ? 0 : Math.max(...t.map((e) => e.length)) * 7 + 10;
|
|
2738
2739
|
}
|
|
2739
|
-
function
|
|
2740
|
+
function Ye(t, a) {
|
|
2740
2741
|
return a == null ? void 0 : a.find((e) => e.name === t);
|
|
2741
2742
|
}
|
|
2742
2743
|
function $t(t, a, e, r) {
|
|
2743
|
-
const n =
|
|
2744
|
+
const n = Ye(t, r);
|
|
2744
2745
|
return (n == null ? void 0 : n.color) ?? e[a % e.length];
|
|
2745
2746
|
}
|
|
2746
2747
|
function Ho(t, a) {
|
|
2747
|
-
const e =
|
|
2748
|
+
const e = Ye(t, a);
|
|
2748
2749
|
return (e == null ? void 0 : e.dash) ?? "solid";
|
|
2749
2750
|
}
|
|
2750
2751
|
function Go(t, a) {
|
|
2751
|
-
const e =
|
|
2752
|
+
const e = Ye(t, a);
|
|
2752
2753
|
return (e == null ? void 0 : e.lineWidth) ?? 2;
|
|
2753
2754
|
}
|
|
2754
2755
|
function Al(t, a, e) {
|
|
2755
|
-
const r =
|
|
2756
|
+
const r = Ye(t, e);
|
|
2756
2757
|
return !(r != null && r.interpolation) || r.interpolation === "global" ? a : r.interpolation;
|
|
2757
2758
|
}
|
|
2758
2759
|
function ia(t, a) {
|
|
2759
|
-
const e =
|
|
2760
|
+
const e = Ye(t, a);
|
|
2760
2761
|
return (e == null ? void 0 : e.hidden) ?? !1;
|
|
2761
2762
|
}
|
|
2762
2763
|
function We(t, a, e) {
|
|
2763
|
-
const r =
|
|
2764
|
+
const r = Ye(t, e);
|
|
2764
2765
|
return !(r != null && r.labelMode) || r.labelMode === "global" ? a : r.labelMode;
|
|
2765
2766
|
}
|
|
2766
2767
|
function wa(t, a, e) {
|
|
2767
|
-
const r =
|
|
2768
|
+
const r = Ye(t, e);
|
|
2768
2769
|
return (r == null ? void 0 : r.valueLabels) !== void 0 ? r.valueLabels : a;
|
|
2769
2770
|
}
|
|
2770
2771
|
function Ea(t, a) {
|
|
2771
|
-
const e =
|
|
2772
|
+
const e = Ye(t, a);
|
|
2772
2773
|
return (e == null ? void 0 : e.opacity) ?? 1;
|
|
2773
2774
|
}
|
|
2774
2775
|
function _o(t, a, e) {
|
|
2775
|
-
const r =
|
|
2776
|
+
const r = Ye(t, e);
|
|
2776
2777
|
if ((r == null ? void 0 : r.lineSymbols) !== !1 && ((r == null ? void 0 : r.lineSymbols) === !0 || a))
|
|
2777
2778
|
return {
|
|
2778
2779
|
name: t,
|
|
@@ -2795,84 +2796,84 @@ const Vo = [
|
|
|
2795
2796
|
"#ff9da7"
|
|
2796
2797
|
];
|
|
2797
2798
|
function Wo(t, a, e = {}, r = !1) {
|
|
2798
|
-
var M, tt, xt, wt,
|
|
2799
|
+
var M, tt, xt, wt, Dt, It, re, xe, ne, $e, Ut, Yt, Ie;
|
|
2799
2800
|
Le(r);
|
|
2800
2801
|
let n = null, l, i, s = [], o;
|
|
2801
2802
|
const c = ye.for(t);
|
|
2802
2803
|
if (r) {
|
|
2803
|
-
const
|
|
2804
|
-
i =
|
|
2804
|
+
const Y = ke(t);
|
|
2805
|
+
i = Y == null ? void 0 : Y.margin, o = Y == null ? void 0 : Y.plotRect, c.detach(), (Y == null ? void 0 : Y.chartType) === "bar-multi" ? s = Array.from(t.querySelectorAll(".bc-frame .bc-bar-multi")) : Y && (n = ge(t)), l = /* @__PURE__ */ new Map();
|
|
2805
2806
|
for (const O of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2806
2807
|
for (const [j, lt] of de(O))
|
|
2807
2808
|
l.set(j, lt);
|
|
2808
2809
|
t.replaceChildren();
|
|
2809
2810
|
}
|
|
2810
|
-
const { body: d } = we(t, e.frame), g = a.series ?? [], f = g.filter((
|
|
2811
|
+
const { body: d } = we(t, e.frame), g = a.series ?? [], f = g.filter((Y) => !ia(Y.name, e.seriesOverrides)), u = f.map((Y) => Y.name), v = e.colors ?? Vo, b = e.seriesOverrides, m = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", S = m ? "direct" : e.legend !== !1 ? "legend" : "none", A = e.legend !== !1 && !m, w = ce(d).width, k = 350, C = e.legendPosition ?? "top", $ = w > 0 && w < k && (C === "left" || C === "right") ? "top" : C, G = e.legendAnchor ?? "start", E = f.flatMap((Y) => Y.values), X = ra(E, (M = e.verticalAxis) == null ? void 0 : M.range, (tt = e.verticalAxis) == null ? void 0 : tt.numberFormat, (xt = e.verticalAxis) == null ? void 0 : xt.scaleType), _ = Ne(w, (wt = e.verticalAxis) == null ? void 0 : wt.labelPosition, (Dt = e.horizontalAxis) == null ? void 0 : Dt.labelPosition, (It = e.verticalAxis) == null ? void 0 : It.direction, X), P = Math.max(0, w - (_.left ?? 50) - (_.right ?? 20)), I = Rr(a.labels, P, e.horizontalAxis);
|
|
2811
2812
|
I !== void 0 && (_.bottom = I);
|
|
2812
2813
|
const W = _.top != null, F = Math.max(0, w - (_.left ?? 50) - (_.right ?? 20)), V = A ? Ze(u, $, F) : { width: 0, height: 0 }, ht = A ? V.height + 15 : 0, et = { ..._ };
|
|
2813
2814
|
if (A && $ === "top") {
|
|
2814
|
-
const
|
|
2815
|
-
et.top = ht +
|
|
2815
|
+
const Y = W ? 15 : 0;
|
|
2816
|
+
et.top = ht + Y;
|
|
2816
2817
|
}
|
|
2817
2818
|
A && $ === "bottom" && (et.bottom = (et.bottom ?? 24) + ht), A && $ === "left" && (et.left = (et.left ?? 50) + V.width + 10), A && $ === "right" && (et.right = (et.right ?? 20) + V.width + 10);
|
|
2818
|
-
const { chartArea: R, width:
|
|
2819
|
+
const { chartArea: R, width: z, height: H, margin: J } = Se(d, et), Z = Pe(i, J);
|
|
2819
2820
|
let [at, ut] = ya(E, (re = e.verticalAxis) == null ? void 0 : re.range, (xe = e.verticalAxis) == null ? void 0 : xe.scaleType);
|
|
2820
2821
|
if (e.valueLabels && at < 0 && (($e = (ne = e.verticalAxis) == null ? void 0 : ne.range) == null ? void 0 : $e.min) == null) {
|
|
2821
|
-
const
|
|
2822
|
-
at -=
|
|
2822
|
+
const Y = ut - at;
|
|
2823
|
+
at -= Y * 0.1;
|
|
2823
2824
|
}
|
|
2824
2825
|
let vt = a.labels;
|
|
2825
2826
|
if (e.sortMode === "total") {
|
|
2826
|
-
const
|
|
2827
|
+
const Y = a.labels.map((O, j) => ({
|
|
2827
2828
|
label: O,
|
|
2828
2829
|
index: j,
|
|
2829
2830
|
total: f.reduce((lt, rt) => lt + (rt.values[j] ?? 0), 0)
|
|
2830
2831
|
}));
|
|
2831
|
-
|
|
2832
|
+
Y.sort((O, j) => j.total - O.total), vt = Y.map((O) => O.label);
|
|
2832
2833
|
}
|
|
2833
|
-
const it = h.scaleBand().domain(vt).range([0,
|
|
2834
|
+
const it = h.scaleBand().domain(vt).range([0, z]).padding(aa(e.barGap)), ct = h.scaleBand().domain(u).range([0, it.bandwidth()]).padding(0.05), bt = ((Ut = e.verticalAxis) == null ? void 0 : Ut.scaleType) === "log", dt = bt ? h.scaleSymlog().domain([at, ut]).nice().range([H, 0]) : h.scaleLinear().domain([at, ut]).nice().range([H, 0]);
|
|
2834
2835
|
c.attach(R, Z), c.update({
|
|
2835
|
-
vertical: { scale: dt, height: H, options: { ...e.verticalAxis, gridWidth:
|
|
2836
|
-
horizontal: { scale: it, height: H, options: { ...e.horizontalAxis, width:
|
|
2837
|
-
}), !bt && at < 0 && ut > 0 && h.select(R).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2",
|
|
2836
|
+
vertical: { scale: dt, height: H, options: { ...e.verticalAxis, gridWidth: z, topPadding: J.top } },
|
|
2837
|
+
horizontal: { scale: it, height: H, options: { ...e.horizontalAxis, width: z } }
|
|
2838
|
+
}), !bt && at < 0 && ut > 0 && h.select(R).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", z).attr("y1", dt(0)).attr("y2", dt(0)).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2838
2839
|
const yt = /* @__PURE__ */ new Map();
|
|
2839
|
-
e.sortMode === "within-groups" && a.labels.forEach((
|
|
2840
|
+
e.sortMode === "within-groups" && a.labels.forEach((Y, O) => {
|
|
2840
2841
|
const j = f.map((lt) => ({ name: lt.name, value: lt.values[O] }));
|
|
2841
2842
|
j.sort((lt, rt) => rt.value - lt.value), j.forEach((lt, rt) => {
|
|
2842
|
-
yt.set(`${
|
|
2843
|
+
yt.set(`${Y}\0${lt.name}`, u[rt]);
|
|
2843
2844
|
});
|
|
2844
2845
|
});
|
|
2845
|
-
const
|
|
2846
|
-
a.labels.forEach((
|
|
2846
|
+
const B = [];
|
|
2847
|
+
a.labels.forEach((Y, O) => {
|
|
2847
2848
|
f.forEach((j) => {
|
|
2848
|
-
const lt = g.findIndex((
|
|
2849
|
-
|
|
2849
|
+
const lt = g.findIndex((zt) => zt.name === j.name), rt = e.sortMode === "within-groups" ? yt.get(`${Y}\0${j.name}`) ?? j.name : j.name;
|
|
2850
|
+
B.push({ label: Y, series: rt, seriesName: j.name, value: j.values[O], seriesIndex: lt });
|
|
2850
2851
|
});
|
|
2851
2852
|
});
|
|
2852
|
-
const q = e.valueLabels ?? !1, st = R.ownerSVGElement, gt = Ee(st, t, "bars", { x: 0, y: 0, width:
|
|
2853
|
+
const q = e.valueLabels ?? !1, st = R.ownerSVGElement, gt = Ee(st, t, "bars", { x: 0, y: 0, width: z, height: H }), ft = h.select(R).append("g").attr("clip-path", `url(#${gt})`), At = Gt(t), Tt = Aa(e.highlights), kt = Re(e.colorizes), Lt = ft.append("g").node();
|
|
2853
2854
|
if (r)
|
|
2854
|
-
for (const
|
|
2855
|
-
|
|
2855
|
+
for (const Y of s)
|
|
2856
|
+
Y.removeAttribute("opacity"), Y.removeAttribute("fill-opacity"), Lt.appendChild(Y);
|
|
2856
2857
|
Ht(At, {
|
|
2857
2858
|
role: "mark-per-cell",
|
|
2858
2859
|
parent: Lt,
|
|
2859
2860
|
selector: ".bc-bar-multi",
|
|
2860
|
-
data:
|
|
2861
|
-
key: (
|
|
2862
|
-
insert: (
|
|
2863
|
-
attrs: (
|
|
2864
|
-
const O = $t(
|
|
2865
|
-
"data-series":
|
|
2866
|
-
x: (it(
|
|
2867
|
-
y: Math.min(dt(0), dt(
|
|
2861
|
+
data: B,
|
|
2862
|
+
key: (Y) => `${Y.label}\0${Y.seriesName}`,
|
|
2863
|
+
insert: (Y) => Y.append("rect").attr("class", "bc-bar bc-bar-multi"),
|
|
2864
|
+
attrs: (Y) => {
|
|
2865
|
+
const O = $t(Y.seriesName, Y.seriesIndex, v, b), j = Ea(Y.seriesName, b), lt = {
|
|
2866
|
+
"data-series": Y.seriesName,
|
|
2867
|
+
x: (it(Y.label) ?? 0) + (ct(Y.series) ?? 0),
|
|
2868
|
+
y: Math.min(dt(0), dt(Y.value)),
|
|
2868
2869
|
width: ct.bandwidth(),
|
|
2869
|
-
height: Math.abs(dt(
|
|
2870
|
-
fill: kt.get(
|
|
2870
|
+
height: Math.abs(dt(Y.value) - dt(0)),
|
|
2871
|
+
fill: kt.get(Y.seriesName) ?? O
|
|
2871
2872
|
};
|
|
2872
|
-
return j < 1 && (lt["fill-opacity"] = j), Tt.size > 0 ? { ...lt, opacity: fe(Tt,
|
|
2873
|
+
return j < 1 && (lt["fill-opacity"] = j), Tt.size > 0 ? { ...lt, opacity: fe(Tt, Y.seriesName) } : lt;
|
|
2873
2874
|
}
|
|
2874
2875
|
});
|
|
2875
|
-
const Ct = { left: J.left, top: J.top, width:
|
|
2876
|
+
const Ct = { left: J.left, top: J.top, width: z, height: H };
|
|
2876
2877
|
Fe(At, {
|
|
2877
2878
|
svg: st,
|
|
2878
2879
|
clipId: gt,
|
|
@@ -2882,76 +2883,76 @@ function Wo(t, a, e = {}, r = !1) {
|
|
|
2882
2883
|
active: r && s.length > 0
|
|
2883
2884
|
});
|
|
2884
2885
|
const Mt = sa(ft);
|
|
2885
|
-
if (e.tooltips && Mt.use(Ue({ numberFormat: (
|
|
2886
|
-
width:
|
|
2886
|
+
if (e.tooltips && Mt.use(Ue({ numberFormat: (Yt = e.verticalAxis) == null ? void 0 : Yt.numberFormat })), e.crosshair && Mt.use(la({
|
|
2887
|
+
width: z,
|
|
2887
2888
|
height: H,
|
|
2888
2889
|
direction: e.crosshairDirection,
|
|
2889
2890
|
style: e.crosshairStyle,
|
|
2890
2891
|
color: e.crosshairColor
|
|
2891
2892
|
})), (Ie = e.annotations) != null && Ie.length) {
|
|
2892
|
-
const
|
|
2893
|
+
const Y = a.labels.map((O, j) => ({
|
|
2893
2894
|
label: O,
|
|
2894
2895
|
value: Math.max(...f.map((lt) => lt.values[j] ?? 0))
|
|
2895
2896
|
}));
|
|
2896
|
-
Mt.use(va(e.annotations, { scaleX: it, scaleY: dt, data:
|
|
2897
|
+
Mt.use(va(e.annotations, { scaleX: it, scaleY: dt, data: Y, width: z, height: H, backgroundColor: ie(t), transition: r, priorAnnotations: l }));
|
|
2897
2898
|
}
|
|
2898
|
-
const U = () => Mt.draw(
|
|
2899
|
+
const U = () => Mt.draw(B);
|
|
2899
2900
|
At.state === "committing" ? At.register(U) : U(), Me(t, { chartType: "bar-multi", margin: J, plotRect: Ct }), n && (me(ft.node()), pe(t, n));
|
|
2900
2901
|
const nt = /* @__PURE__ */ new Set();
|
|
2901
|
-
f.forEach((
|
|
2902
|
-
We(
|
|
2902
|
+
f.forEach((Y) => {
|
|
2903
|
+
We(Y.name, S, b) === "direct" && nt.add(Y.name);
|
|
2903
2904
|
});
|
|
2904
|
-
const L = nt.size > 0, p = ie(t), x = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? qt.Auto : qt.Off, y = e.directLabelAnchor ?? "middle",
|
|
2905
|
+
const L = nt.size > 0, p = ie(t), x = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? qt.Auto : qt.Off, y = e.directLabelAnchor ?? "middle", D = e.valueLabelPosition ?? St.Auto;
|
|
2905
2906
|
function K() {
|
|
2906
|
-
return
|
|
2907
|
+
return D === St.Inside ? St.Inside : (D === St.Outside, St.Outside);
|
|
2907
2908
|
}
|
|
2908
|
-
function ot(
|
|
2909
|
+
function ot(Y) {
|
|
2909
2910
|
return x === qt.Inside ? St.Inside : x === qt.Outside ? St.Outside : q ? K() : St.Outside;
|
|
2910
2911
|
}
|
|
2911
|
-
function N(
|
|
2912
|
-
return j === "start" ?
|
|
2912
|
+
function N(Y, O, j) {
|
|
2913
|
+
return j === "start" ? Y + 12 : j === "end" ? Y + O - 4 : Y + O / 2;
|
|
2913
2914
|
}
|
|
2914
2915
|
const mt = h.select(R).append("g").attr("class", "bc-value-labels");
|
|
2915
|
-
|
|
2916
|
-
if (!wa(
|
|
2916
|
+
B.forEach((Y) => {
|
|
2917
|
+
if (!wa(Y.seriesName, q, b))
|
|
2917
2918
|
return;
|
|
2918
|
-
const O = (it(
|
|
2919
|
+
const O = (it(Y.label) ?? 0) + (ct(Y.series) ?? 0) + ct.bandwidth() / 2, j = Math.min(dt(0), dt(Y.value)), lt = Math.abs(dt(Y.value) - dt(0)), rt = K(), zt = L && nt.has(Y.seriesName), ue = Y.value < 0, Oe = j + lt;
|
|
2919
2920
|
let le, se, Ke;
|
|
2920
2921
|
if (rt === St.Inside) {
|
|
2921
|
-
const da = $t(
|
|
2922
|
-
se = Ae(da), Ke = "central",
|
|
2922
|
+
const da = $t(Y.seriesName, Y.seriesIndex, v, b);
|
|
2923
|
+
se = Ae(da), Ke = "central", zt && ot() === St.Inside ? le = N(j, lt, y) + 14 : le = j + lt / 2;
|
|
2923
2924
|
} else
|
|
2924
|
-
se = "currentColor", ue ? (le =
|
|
2925
|
+
se = "currentColor", ue ? (le = zt && ot() === St.Outside ? Oe + 16 : Oe + 4, Ke = "hanging") : (le = zt && ot() === St.Outside ? j - 16 : j - 4, Ke = "auto");
|
|
2925
2926
|
oa({
|
|
2926
|
-
text: String(
|
|
2927
|
+
text: String(Y.value),
|
|
2927
2928
|
placement: rt === St.Inside ? "inside" : "outside",
|
|
2928
2929
|
orientation: "vertical",
|
|
2929
2930
|
barWidth: ct.bandwidth(),
|
|
2930
2931
|
barHeight: lt
|
|
2931
|
-
}) && mt.append("text").attr("class", "bc-value-label").attr("data-series",
|
|
2932
|
-
}),
|
|
2932
|
+
}) && mt.append("text").attr("class", "bc-value-label").attr("data-series", Y.seriesName).attr("x", O).attr("y", le).attr("text-anchor", "middle").attr("dominant-baseline", Ke).attr("font-size", "11px").attr("fill", se).text(String(Y.value));
|
|
2933
|
+
}), B.forEach((Y) => {
|
|
2933
2934
|
var le;
|
|
2934
|
-
if (!nt.has(
|
|
2935
|
+
if (!nt.has(Y.seriesName))
|
|
2935
2936
|
return;
|
|
2936
|
-
const O = (it(
|
|
2937
|
-
if (
|
|
2937
|
+
const O = (it(Y.label) ?? 0) + (ct(Y.series) ?? 0) + ct.bandwidth() / 2, j = Math.min(dt(0), dt(Y.value)), lt = Math.abs(dt(Y.value) - dt(0)), rt = ((le = b == null ? void 0 : b.find((se) => se.name === Y.seriesName)) == null ? void 0 : le.labelText) || Y.seriesName, zt = ot(), ue = $t(Y.seriesName, Y.seriesIndex, v, b), Oe = h.select(R).append("text").attr("class", "bc-direct-label").attr("data-series", Y.seriesName).attr("x", O).attr("text-anchor", "middle").attr("font-size", "10px").text(rt);
|
|
2938
|
+
if (zt === St.Inside) {
|
|
2938
2939
|
const se = N(j, lt, y);
|
|
2939
2940
|
Oe.attr("y", se).attr("fill", Ae(ue)), y === "middle" && Oe.attr("dominant-baseline", "central");
|
|
2940
2941
|
} else
|
|
2941
2942
|
Oe.attr("y", j - 4).attr("fill", Jn(ue, p));
|
|
2942
2943
|
});
|
|
2943
|
-
const pt = u.filter((
|
|
2944
|
+
const pt = u.filter((Y) => We(Y, S, b) === "legend");
|
|
2944
2945
|
if (A && pt.length > 0) {
|
|
2945
|
-
const
|
|
2946
|
-
const rt = g.findIndex((
|
|
2946
|
+
const Y = pt.map((lt) => {
|
|
2947
|
+
const rt = g.findIndex((zt) => zt.name === lt);
|
|
2947
2948
|
return $t(lt, rt, v, b);
|
|
2948
2949
|
});
|
|
2949
2950
|
let O = 0, j = 0;
|
|
2950
2951
|
if ($ === "top") {
|
|
2951
2952
|
const lt = W ? 15 : 0;
|
|
2952
2953
|
j = -(V.height + 10 + lt);
|
|
2953
|
-
} else $ === "bottom" ? j = H + 25 : $ === "left" ? O = -(V.width + 10) : $ === "right" && (O =
|
|
2954
|
-
je(R, pt,
|
|
2954
|
+
} else $ === "bottom" ? j = H + 25 : $ === "left" ? O = -(V.width + 10) : $ === "right" && (O = z + 10);
|
|
2955
|
+
je(R, pt, Y, j, $, G, z, H, O, [], { left: J.left, right: J.right });
|
|
2955
2956
|
}
|
|
2956
2957
|
}
|
|
2957
2958
|
const qo = {
|
|
@@ -3004,7 +3005,7 @@ function sr(t, a) {
|
|
|
3004
3005
|
tooltip: l = !0,
|
|
3005
3006
|
crosshair: i = !1,
|
|
3006
3007
|
crosshairDirection: s = Wt.Both,
|
|
3007
|
-
crosshairStyle: o =
|
|
3008
|
+
crosshairStyle: o = ze.Dashed,
|
|
3008
3009
|
crosshairColor: c = "#999",
|
|
3009
3010
|
format: d = Uo(a.numberFormat),
|
|
3010
3011
|
container: g
|
|
@@ -3014,7 +3015,7 @@ function sr(t, a) {
|
|
|
3014
3015
|
};
|
|
3015
3016
|
return g && ma.set(g, F), F;
|
|
3016
3017
|
}
|
|
3017
|
-
const f = o ===
|
|
3018
|
+
const f = o === ze.Solid ? "none" : o === ze.Dotted ? "2,2" : "4,3", u = [...new Set(n.map((F) => F.cx))].sort((F, V) => F - V), v = h.select(t);
|
|
3018
3019
|
let b = null;
|
|
3019
3020
|
l && (Xo(), b = document.createElement("div"), b.className = wl, document.body.appendChild(b));
|
|
3020
3021
|
const m = ".bc-annotations", S = !v.select(m).empty(), A = (F) => S ? v.insert(F, m) : v.append(F), w = i && (s === Wt.Both || s === Wt.Vertical), k = i && (s === Wt.Both || s === Wt.Horizontal);
|
|
@@ -3027,20 +3028,20 @@ function sr(t, a) {
|
|
|
3027
3028
|
const ht = h.bisectCenter(u, F), et = u[ht], R = n.filter((J) => J.cx === et);
|
|
3028
3029
|
if (R.length === 0)
|
|
3029
3030
|
return null;
|
|
3030
|
-
let
|
|
3031
|
+
let z = R[0], H = Math.abs(R[0].cy - V);
|
|
3031
3032
|
for (let J = 1; J < R.length; J++) {
|
|
3032
3033
|
const Z = Math.abs(R[J].cy - V);
|
|
3033
|
-
Z < H && (
|
|
3034
|
+
Z < H && (z = R[J], H = Z);
|
|
3034
3035
|
}
|
|
3035
|
-
return
|
|
3036
|
+
return z;
|
|
3036
3037
|
}
|
|
3037
3038
|
const _ = (F) => {
|
|
3038
3039
|
const [V, ht] = h.pointer(F, t), et = X(V, ht);
|
|
3039
3040
|
et && (G.attr("cx", et.cx).attr("cy", et.cy).attr("stroke", et.color).style("display", null), b && (b.textContent = d(et), b.style.display = "block", Hn(G.node(), b, {
|
|
3040
3041
|
placement: "top",
|
|
3041
3042
|
middleware: [Gn(8), _n(), Vn()]
|
|
3042
|
-
}).then(({ x: R, y:
|
|
3043
|
-
b && (b.style.left = `${R}px`, b.style.top = `${
|
|
3043
|
+
}).then(({ x: R, y: z }) => {
|
|
3044
|
+
b && (b.style.left = `${R}px`, b.style.top = `${z}px`);
|
|
3044
3045
|
})), C && C.attr("x1", et.cx).attr("x2", et.cx).style("display", null), $ && $.attr("y1", et.cy).attr("y2", et.cy).style("display", null));
|
|
3045
3046
|
}, P = () => {
|
|
3046
3047
|
G.style("display", "none"), b && (b.style.display = "none"), C && C.style("display", "none"), $ && $.style("display", "none");
|
|
@@ -3103,32 +3104,32 @@ function Qo(t, a, e = {}, r = !1) {
|
|
|
3103
3104
|
if (r) {
|
|
3104
3105
|
const y = ke(t);
|
|
3105
3106
|
c = y == null ? void 0 : y.margin, d = y == null ? void 0 : y.plotRect, g.detach(), (y == null ? void 0 : y.chartType) === "line" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), l = Array.from(t.querySelectorAll(".bc-frame .bc-line")), i = t.querySelector(".bc-frame .bc-symbols")) : y && (s = ge(t)), o = /* @__PURE__ */ new Map();
|
|
3106
|
-
for (const
|
|
3107
|
-
for (const [K, ot] of de(
|
|
3107
|
+
for (const D of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3108
|
+
for (const [K, ot] of de(D))
|
|
3108
3109
|
o.set(K, ot);
|
|
3109
3110
|
t.replaceChildren();
|
|
3110
3111
|
}
|
|
3111
|
-
const { body: f } = we(t, e.frame), u = ce(f).width, v = ra(a.values, (gt = e.verticalAxis) == null ? void 0 : gt.range, (ft = e.verticalAxis) == null ? void 0 : ft.numberFormat, (At = e.verticalAxis) == null ? void 0 : At.scaleType), b = Ne(u, (Tt = e.verticalAxis) == null ? void 0 : Tt.labelPosition, (kt = e.horizontalAxis) == null ? void 0 : kt.labelPosition, (Lt = e.verticalAxis) == null ? void 0 : Lt.direction, v), { chartArea: m, width: S, height: A, margin: w } = Se(f, b), k = Pe(c, w), C = er(a.labels, (Ct = e.horizontalAxis) == null ? void 0 : Ct.range), $ = C.map((y) => a.labels[y]), G = C.map((y) => a.values[y]), E = $.map((y,
|
|
3112
|
+
const { body: f } = we(t, e.frame), u = ce(f).width, v = ra(a.values, (gt = e.verticalAxis) == null ? void 0 : gt.range, (ft = e.verticalAxis) == null ? void 0 : ft.numberFormat, (At = e.verticalAxis) == null ? void 0 : At.scaleType), b = Ne(u, (Tt = e.verticalAxis) == null ? void 0 : Tt.labelPosition, (kt = e.horizontalAxis) == null ? void 0 : kt.labelPosition, (Lt = e.verticalAxis) == null ? void 0 : Lt.direction, v), { chartArea: m, width: S, height: A, margin: w } = Se(f, b), k = Pe(c, w), C = er(a.labels, (Ct = e.horizontalAxis) == null ? void 0 : Ct.range), $ = C.map((y) => a.labels[y]), G = C.map((y) => a.values[y]), E = $.map((y, D) => ({
|
|
3112
3113
|
label: y,
|
|
3113
|
-
value: G[
|
|
3114
|
+
value: G[D]
|
|
3114
3115
|
})), X = h.scalePoint().domain($).range([0, S]).padding(e.edgePadding ? 0.6 : 0), _ = X, P = (y) => X(y.label) ?? 0, I = ((Mt = e.verticalAxis) == null ? void 0 : Mt.scaleType) === "log", [W, F] = ya(G, (U = e.verticalAxis) == null ? void 0 : U.range, (nt = e.verticalAxis) == null ? void 0 : nt.scaleType), V = I ? h.scaleSymlog().domain([W, F]).nice().range([A, 0]) : h.scaleLinear().domain([W, F]).nice().range([A, 0]), ht = V.domain(), et = ht[0] < 0 && ht[1] > 0 ? V(0) : void 0;
|
|
3115
3116
|
g.attach(m, k), g.update({
|
|
3116
3117
|
vertical: { scale: V, height: A, options: { ...e.verticalAxis, gridWidth: S, topPadding: w.top } },
|
|
3117
3118
|
horizontal: { scale: _, height: A, options: { ...e.horizontalAxis, width: S, zeroY: et } }
|
|
3118
3119
|
});
|
|
3119
|
-
const R = m.ownerSVGElement,
|
|
3120
|
+
const R = m.ownerSVGElement, z = Ee(R, t, "plot", { x: -1, y: -1, width: S + 2, height: A + 2 }), H = h.select(m).append("g").attr("clip-path", `url(#${z})`), J = H.node(), Z = ((L = e.colors) == null ? void 0 : L[0]) ?? Jo, at = ta(e.interpolation), ut = e.areaFill ?? !1, vt = e.areaFillOpacity ?? 0.2, it = h.area().curve(at).x((y) => P(y)).y0(A).y1((y) => V(y.value)), ct = h.line().curve(at).x((y) => P(y)).y((y) => V(y.value)), bt = h.select(J).append("g").node(), dt = h.select(J).append("g").node();
|
|
3120
3121
|
if (r) {
|
|
3121
3122
|
for (const y of n)
|
|
3122
3123
|
bt.appendChild(y);
|
|
3123
3124
|
for (const y of l)
|
|
3124
3125
|
dt.appendChild(y);
|
|
3125
3126
|
}
|
|
3126
|
-
const yt = Gt(t),
|
|
3127
|
+
const yt = Gt(t), B = [{ name: "line", points: E }];
|
|
3127
3128
|
Ht(yt, {
|
|
3128
3129
|
role: "series-area",
|
|
3129
3130
|
parent: bt,
|
|
3130
3131
|
selector: ".bc-area",
|
|
3131
|
-
data: ut ?
|
|
3132
|
+
data: ut ? B : [],
|
|
3132
3133
|
key: (y) => y.name,
|
|
3133
3134
|
insert: (y) => y.append("path").attr("class", "bc-area"),
|
|
3134
3135
|
attrs: (y) => ({
|
|
@@ -3140,7 +3141,7 @@ function Qo(t, a, e = {}, r = !1) {
|
|
|
3140
3141
|
role: "series-line",
|
|
3141
3142
|
parent: dt,
|
|
3142
3143
|
selector: ".bc-line",
|
|
3143
|
-
data:
|
|
3144
|
+
data: B,
|
|
3144
3145
|
key: (y) => y.name,
|
|
3145
3146
|
insert: (y) => y.append("path").attr("class", "bc-line"),
|
|
3146
3147
|
attrs: (y) => ({
|
|
@@ -3152,17 +3153,17 @@ function Qo(t, a, e = {}, r = !1) {
|
|
|
3152
3153
|
const st = { left: w.left, top: w.top, width: S + 2, height: A + 2 };
|
|
3153
3154
|
if (Fe(yt, {
|
|
3154
3155
|
svg: R,
|
|
3155
|
-
clipId:
|
|
3156
|
+
clipId: z,
|
|
3156
3157
|
group: m,
|
|
3157
3158
|
from: d,
|
|
3158
3159
|
to: st,
|
|
3159
3160
|
active: r && (n.length > 0 || l.length > 0)
|
|
3160
3161
|
}), (p = e.annotations) != null && p.length && nr(m, e.annotations, { scaleX: _, scaleY: V, data: E, width: S, height: A, backgroundColor: ie(t), transition: r, priorAnnotations: o }), e.tooltips || e.crosshair) {
|
|
3161
|
-
const y = E.map((
|
|
3162
|
-
cx: P(
|
|
3163
|
-
cy: V(
|
|
3164
|
-
label:
|
|
3165
|
-
value:
|
|
3162
|
+
const y = E.map((D) => ({
|
|
3163
|
+
cx: P(D),
|
|
3164
|
+
cy: V(D.value),
|
|
3165
|
+
label: D.label,
|
|
3166
|
+
value: D.value,
|
|
3166
3167
|
color: Z
|
|
3167
3168
|
}));
|
|
3168
3169
|
sr(m, {
|
|
@@ -3178,15 +3179,15 @@ function Qo(t, a, e = {}, r = !1) {
|
|
|
3178
3179
|
container: t
|
|
3179
3180
|
});
|
|
3180
3181
|
}
|
|
3181
|
-
if (e.valueLabels && h.select(J).append("g").selectAll(".bc-value-label").data(E, (
|
|
3182
|
+
if (e.valueLabels && h.select(J).append("g").selectAll(".bc-value-label").data(E, (D) => D.label).enter().append("text").attr("class", "bc-value-label").attr("x", (D) => P(D)).attr("y", (D) => V(D.value) - 8).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text((D) => String(D.value)), e.lineSymbols) {
|
|
3182
3183
|
const y = E.map((K, ot) => ({
|
|
3183
3184
|
cx: P(K),
|
|
3184
3185
|
cy: V(K.value),
|
|
3185
3186
|
color: Z,
|
|
3186
3187
|
index: ot
|
|
3187
3188
|
}));
|
|
3188
|
-
let
|
|
3189
|
-
i ? (m.appendChild(i),
|
|
3189
|
+
let D;
|
|
3190
|
+
i ? (m.appendChild(i), D = h.select(i)) : D = h.select(m).append("g").attr("class", "bc-symbols"), Vr(D, y, E.length, e.lineSymbols, r);
|
|
3190
3191
|
}
|
|
3191
3192
|
Me(t, { chartType: "line", margin: w, plotRect: st }), s && (me(H.node()), pe(t, s));
|
|
3192
3193
|
}
|
|
@@ -3274,7 +3275,7 @@ const ai = [
|
|
|
3274
3275
|
"#ff9da7"
|
|
3275
3276
|
];
|
|
3276
3277
|
function ri(t, a, e = {}, r = !1) {
|
|
3277
|
-
var Ie,
|
|
3278
|
+
var Ie, Y, O, j, lt, rt, zt, ue, Oe, le, se, Ke, da, Sr, Lr;
|
|
3278
3279
|
Le(r), lr(t);
|
|
3279
3280
|
let n = a, l = [], i = [], s = [], o = null, c, d, g;
|
|
3280
3281
|
const f = ye.for(t);
|
|
@@ -3294,13 +3295,13 @@ function ri(t, a, e = {}, r = !1) {
|
|
|
3294
3295
|
}));
|
|
3295
3296
|
const m = e.colors ?? ai, S = b.map((T) => T.name), A = Re(e.colorizes), w = e.seriesOverrides, k = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", C = k ? "direct" : e.legend !== !1 ? "legend" : "none", $ = S.filter((T) => We(T, C, w) === "direct"), G = e.legend !== !1 && !k, E = ce(u).width, X = 350, _ = e.legendPosition ?? "top", P = E > 0 && E < X && (_ === "left" || _ === "right") ? "top" : _, I = e.legendAnchor ?? "start", W = er(n.labels, (Ie = e.horizontalAxis) == null ? void 0 : Ie.range), F = W.map((T) => n.labels[T]);
|
|
3296
3297
|
b = b.map((T) => ({ ...T, values: W.map((Ot) => T.values[Ot]) })), n = { ...n, labels: F, series: b };
|
|
3297
|
-
const V = b.flatMap((T) => T.values), ht = ra(V, (
|
|
3298
|
+
const V = b.flatMap((T) => T.values), ht = ra(V, (Y = e.verticalAxis) == null ? void 0 : Y.range, (O = e.verticalAxis) == null ? void 0 : O.numberFormat, (j = e.verticalAxis) == null ? void 0 : j.scaleType), et = Ne(E, (lt = e.verticalAxis) == null ? void 0 : lt.labelPosition, (rt = e.horizontalAxis) == null ? void 0 : rt.labelPosition, (zt = e.verticalAxis) == null ? void 0 : zt.direction, ht), R = $.length > 0 ? vl($) : 0, z = et.top != null, H = Math.max(0, E - (et.left ?? 50) - (et.right ?? 20) - R), J = G ? Ze(S, P, H) : { width: 0, height: 0 }, Z = G ? J.height + 15 : 0, at = { ...et };
|
|
3298
3299
|
if (G && P === "top") {
|
|
3299
|
-
const T =
|
|
3300
|
+
const T = z ? 15 : 0;
|
|
3300
3301
|
at.top = Z + T;
|
|
3301
3302
|
}
|
|
3302
3303
|
G && P === "bottom" && (at.bottom = (at.bottom ?? 24) + Z), G && P === "left" && (at.left = (at.left ?? 50) + J.width + 10), G && P === "right" && (at.right = (at.right ?? 20) + J.width + 10), R > 0 && (at.right = (at.right ?? 20) + R);
|
|
3303
|
-
const { chartArea: ut, width: vt, height: it, margin: ct } = Se(u, at), bt = Pe(d, ct), [dt, yt] = ya(V, (ue = e.verticalAxis) == null ? void 0 : ue.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.scaleType),
|
|
3304
|
+
const { chartArea: ut, width: vt, height: it, margin: ct } = Se(u, at), bt = Pe(d, ct), [dt, yt] = ya(V, (ue = e.verticalAxis) == null ? void 0 : ue.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.scaleType), B = h.scalePoint().domain(n.labels).range([0, vt]).padding(e.edgePadding ? 0.6 : 0), q = B, st = (T) => B(n.labels[T]) ?? 0, ft = ((le = e.verticalAxis) == null ? void 0 : le.scaleType) === "log" ? h.scaleSymlog().domain([dt, yt]).nice().range([it, 0]) : h.scaleLinear().domain([dt, yt]).nice().range([it, 0]), At = ft.domain(), Tt = At[0] < 0 && At[1] > 0 ? ft(0) : void 0;
|
|
3304
3305
|
f.attach(ut, bt), f.update({
|
|
3305
3306
|
vertical: { scale: ft, height: it, options: { ...e.verticalAxis, gridWidth: vt, topPadding: ct.top } },
|
|
3306
3307
|
horizontal: { scale: q, height: it, options: { ...e.horizontalAxis, width: vt, zeroY: Tt } }
|
|
@@ -3322,7 +3323,7 @@ function ri(t, a, e = {}, r = !1) {
|
|
|
3322
3323
|
dotted: "2,4",
|
|
3323
3324
|
dashed: "8,4",
|
|
3324
3325
|
"dash-dot": "8,4,2,4"
|
|
3325
|
-
}, y = e.valueLabels ?? !1,
|
|
3326
|
+
}, y = e.valueLabels ?? !1, D = new Set((e.highlights ?? []).map((T) => T.target)), K = e.areaFill ?? !1, ot = e.areaFillOpacity ?? 0.2, N = (T) => A.get(T.name) ?? $t(T.name, T.colorIndex, m, w), mt = h.area().curve(nt).x((T, Ot) => st(Ot)).y0(it).y1((T) => ft(T)), pt = Gt(t), M = h.select(Mt).append("g").node(), tt = h.select(Mt).append("g").node(), xt = new Set(U.map((T) => T.name));
|
|
3326
3327
|
if (r) {
|
|
3327
3328
|
for (const T of l)
|
|
3328
3329
|
xt.has(((Ke = T.__data__) == null ? void 0 : Ke.name) ?? "") && M.appendChild(T);
|
|
@@ -3340,7 +3341,7 @@ function ri(t, a, e = {}, r = !1) {
|
|
|
3340
3341
|
"data-series": T.colorIndex,
|
|
3341
3342
|
d: mt(T.values) ?? "",
|
|
3342
3343
|
fill: N(T),
|
|
3343
|
-
opacity: fe(
|
|
3344
|
+
opacity: fe(D, T.name, ot)
|
|
3344
3345
|
})
|
|
3345
3346
|
}), Ht(pt, {
|
|
3346
3347
|
role: "series-line",
|
|
@@ -3358,17 +3359,17 @@ function ri(t, a, e = {}, r = !1) {
|
|
|
3358
3359
|
stroke: N(T),
|
|
3359
3360
|
"stroke-width": Go(T.name, w),
|
|
3360
3361
|
"stroke-dasharray": x[Ho(T.name, w)] ?? "",
|
|
3361
|
-
opacity: fe(
|
|
3362
|
+
opacity: fe(D, T.name, 1)
|
|
3362
3363
|
};
|
|
3363
3364
|
}
|
|
3364
3365
|
}), h.select(Mt).append("g").selectAll(".bc-dot").data(L, (T) => T.label + "\0" + T.series).enter().append("circle").attr("class", "bc-dot").attr("data-series", (T) => T.colorIndex).attr("cx", (T) => st(n.labels.indexOf(T.label))).attr("cy", (T) => ft(T.value)).attr("r", 3).attr("fill", (T) => N({ name: T.series, colorIndex: T.colorIndex })).attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none");
|
|
3365
|
-
const
|
|
3366
|
+
const Dt = { left: ct.left, top: ct.top, width: vt, height: it };
|
|
3366
3367
|
if (Fe(pt, {
|
|
3367
3368
|
svg: kt,
|
|
3368
3369
|
clipId: Lt,
|
|
3369
3370
|
group: ut,
|
|
3370
3371
|
from: g,
|
|
3371
|
-
to:
|
|
3372
|
+
to: Dt,
|
|
3372
3373
|
active: r && (i.length > 0 || l.length > 0)
|
|
3373
3374
|
}), (Sr = e.annotations) != null && Sr.length) {
|
|
3374
3375
|
const T = n.labels.map((Ot, Ft) => {
|
|
@@ -3448,20 +3449,20 @@ function ri(t, a, e = {}, r = !1) {
|
|
|
3448
3449
|
h.select(ut).append("text").attr("class", "bc-direct-label").attr("data-series", Nt.index).attr("x", $e).attr("y", Ft[jt]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", $t(Nt.name, Nt.index, m, w)).text(Nt.text);
|
|
3449
3450
|
});
|
|
3450
3451
|
}
|
|
3451
|
-
const
|
|
3452
|
-
if (G &&
|
|
3453
|
-
const T =
|
|
3452
|
+
const Yt = S.filter((T) => We(T, C, w) === "legend");
|
|
3453
|
+
if (G && Yt.length > 0) {
|
|
3454
|
+
const T = Yt.map((Nt) => {
|
|
3454
3455
|
const jt = v.findIndex((ve) => ve.name === Nt);
|
|
3455
3456
|
return $t(Nt, jt, m, w);
|
|
3456
3457
|
});
|
|
3457
3458
|
let Ot = 0, Ft = 0;
|
|
3458
3459
|
if (P === "top") {
|
|
3459
|
-
const Nt =
|
|
3460
|
+
const Nt = z ? 15 : 0;
|
|
3460
3461
|
Ft = -(J.height + 10 + Nt);
|
|
3461
3462
|
} else P === "bottom" ? Ft = it + 25 : P === "left" ? Ot = -(J.width + 10) : P === "right" && (Ot = vt + 10);
|
|
3462
|
-
je(ut,
|
|
3463
|
+
je(ut, Yt, T, Ft, P, I, vt, it, Ot, [], { left: ct.left, right: ct.right });
|
|
3463
3464
|
}
|
|
3464
|
-
Me(t, { chartType: "line-multi", margin: ct, plotRect:
|
|
3465
|
+
Me(t, { chartType: "line-multi", margin: ct, plotRect: Dt }), o && (me(Ct.node()), pe(t, o));
|
|
3465
3466
|
}
|
|
3466
3467
|
function ni(t, a, e, r, n, l, i) {
|
|
3467
3468
|
const s = h.select(t).append("g").attr("class", "bc-area-fills");
|
|
@@ -3542,8 +3543,8 @@ function Tl(t, a, e, r, n = !1) {
|
|
|
3542
3543
|
Le(n);
|
|
3543
3544
|
let l = null, i;
|
|
3544
3545
|
if (n) {
|
|
3545
|
-
const
|
|
3546
|
-
|
|
3546
|
+
const B = ke(t), q = r > 0 ? "donut" : "pie";
|
|
3547
|
+
B && B.chartType !== q && (l = ge(t)), i = /* @__PURE__ */ new Map();
|
|
3547
3548
|
for (const st of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3548
3549
|
for (const [gt, ft] of de(st))
|
|
3549
3550
|
i.set(gt, ft);
|
|
@@ -3552,39 +3553,39 @@ function Tl(t, a, e, r, n = !1) {
|
|
|
3552
3553
|
const { body: s } = we(t, e.frame);
|
|
3553
3554
|
let o = [...a.labels], c = [...a.values];
|
|
3554
3555
|
if (e.sort === Kt.Ascending || e.sort === Kt.Descending) {
|
|
3555
|
-
const
|
|
3556
|
-
|
|
3556
|
+
const B = o.map((q, st) => ({ label: q, value: c[st] }));
|
|
3557
|
+
B.sort((q, st) => e.sort === Kt.Ascending ? q.value - st.value : st.value - q.value), o = B.map((q) => q.label), c = B.map((q) => q.value);
|
|
3557
3558
|
}
|
|
3558
3559
|
if (e.sliceMax && e.sliceMax > 0 && o.length > e.sliceMax) {
|
|
3559
|
-
const
|
|
3560
|
+
const B = e.sliceMax - 1, q = o.slice(0, B), st = c.slice(0, B), gt = c.slice(B).reduce((ft, At) => ft + At, 0);
|
|
3560
3561
|
q.push(e.sliceGroupLabel ?? "Others"), st.push(gt), o = q, c = st;
|
|
3561
3562
|
}
|
|
3562
|
-
const d = c.reduce((
|
|
3563
|
+
const d = c.reduce((B, q) => B + q, 0), g = c.map((B) => d > 0 ? B / d * 100 : 0), f = e.colors ?? oi, u = f.length < o.length && f.length >= 2 ? Et.scale(f).mode("lch").colors(o.length) : f, v = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? qt.Auto : qt.Off, b = !!v && !(v === qt.Auto && e.legend === !0), S = (e.showValues ?? !0) && !b ? c.map((B, q) => `(${e.displayAsPercentage ? `${Math.round(g[q])}%` : String(B)})`) : [], A = e.legend !== !1 && !b, w = ce(s).width, k = 350, C = e.legendPosition ?? "top", $ = w > 0 && w < k && (C === "left" || C === "right") ? "top" : C, G = e.legendAnchor ?? "start", E = S.length > 0 ? o.map((B, q) => `${B} ${S[q]}`) : o, X = Math.max(0, w - 50 - 20), _ = A ? Ze(E, $, X) : { width: 0, height: 0 }, P = A ? _.height + 15 : 0, I = {};
|
|
3563
3564
|
if (A && $ === "top" && (I.top = P), A && $ === "bottom" && (I.bottom = 24 + P), A && $ === "left" && (I.left = 50 + _.width + 10), A && $ === "right" && (I.right = 20 + _.width + 10), b) {
|
|
3564
|
-
const
|
|
3565
|
+
const B = ce(s), q = 20, st = B.width - 2 * q, gt = (B.height > 0 ? B.height : 400) - 2 * q, ft = Math.min(st, gt) / 2, At = ei(o, ft);
|
|
3565
3566
|
I.left = (I.left ?? q) + At.left, I.right = (I.right ?? q) + At.right, I.top = (I.top ?? q) + At.top, I.bottom = (I.bottom ?? q) + At.bottom;
|
|
3566
3567
|
}
|
|
3567
|
-
const { chartArea: W, width: F, height: V, margin: ht } = Se(s, I), et = Math.min(F, V) / 2, R = et * r,
|
|
3568
|
+
const { chartArea: W, width: F, height: V, margin: ht } = Se(s, I), et = Math.min(F, V) / 2, R = et * r, z = h.scaleOrdinal().domain(o).range(u), H = h.pie().sort(null), J = h.arc().innerRadius(R).outerRadius(et), Z = h.select(W).append("g").attr("transform", `translate(${F / 2},${V / 2})`), at = Re(e.colorizes), ut = H(c), vt = ut.map((B, q) => ({
|
|
3568
3569
|
label: o[q],
|
|
3569
|
-
arc:
|
|
3570
|
-
color: at.get(o[q]) ??
|
|
3570
|
+
arc: B,
|
|
3571
|
+
color: at.get(o[q]) ?? z(o[q])
|
|
3571
3572
|
})), it = Gt(t), ct = Aa(e.highlights), bt = Z.append("g").node();
|
|
3572
3573
|
Ht(it, {
|
|
3573
3574
|
role: "mark-per-category",
|
|
3574
3575
|
parent: bt,
|
|
3575
3576
|
selector: ".bc-arc",
|
|
3576
3577
|
data: vt,
|
|
3577
|
-
key: (
|
|
3578
|
-
insert: (
|
|
3579
|
-
attrs: (
|
|
3580
|
-
const q = { d: J(
|
|
3581
|
-
return ct.size > 0 ? { ...q, opacity: fe(ct,
|
|
3578
|
+
key: (B) => B.label,
|
|
3579
|
+
insert: (B) => B.append("path").attr("class", "bc-arc"),
|
|
3580
|
+
attrs: (B) => {
|
|
3581
|
+
const q = { d: J(B.arc) ?? "", fill: B.color };
|
|
3582
|
+
return ct.size > 0 ? { ...q, opacity: fe(ct, B.label) } : q;
|
|
3582
3583
|
}
|
|
3583
3584
|
});
|
|
3584
3585
|
const dt = new ii(Z);
|
|
3585
3586
|
if (e.tooltips && dt.use(Ue()), dt.draw(vt), (yt = e.annotations) != null && yt.length) {
|
|
3586
|
-
const
|
|
3587
|
-
|
|
3587
|
+
const B = e.annotations.filter((q) => q.kind === "free");
|
|
3588
|
+
B.length && va(B, {
|
|
3588
3589
|
scaleX: h.scaleBand().domain([]).range([0, F]),
|
|
3589
3590
|
scaleY: h.scaleLinear().domain([0, 1]).range([V, 0]),
|
|
3590
3591
|
data: [],
|
|
@@ -3596,26 +3597,26 @@ function Tl(t, a, e, r, n = !1) {
|
|
|
3596
3597
|
}).postDraw({ base: h.select(W) }, void 0);
|
|
3597
3598
|
}
|
|
3598
3599
|
if (b) {
|
|
3599
|
-
const
|
|
3600
|
+
const B = ut.map((ft, At) => ({
|
|
3600
3601
|
label: o[At],
|
|
3601
3602
|
value: ft.data,
|
|
3602
3603
|
startAngle: ft.startAngle,
|
|
3603
3604
|
endAngle: ft.endAngle,
|
|
3604
|
-
color:
|
|
3605
|
+
color: z(o[At]),
|
|
3605
3606
|
percentage: g[At],
|
|
3606
3607
|
displayAsPercentage: e.displayAsPercentage,
|
|
3607
3608
|
showLabel: e.showLabels ?? !0,
|
|
3608
3609
|
showValue: e.showValues ?? !0
|
|
3609
3610
|
})), q = Z, st = ie(t), gt = { outerRadius: et, innerRadius: R, bgColor: st };
|
|
3610
|
-
v === qt.Inside ? Ol(q,
|
|
3611
|
+
v === qt.Inside ? Ol(q, B, gt) : v === qt.Auto ? ti(q, B, gt) : kl(q, B, gt);
|
|
3611
3612
|
}
|
|
3612
3613
|
if (e.showTotal && r > 0 && !e.displayAsPercentage) {
|
|
3613
|
-
const
|
|
3614
|
-
Z.append("text").attr("class", "bc-arc-total-label").attr("text-anchor", "middle").attr("dy", "-0.3em").attr("font-size", "11px").attr("fill", "var(--bc-text-color, #555)").attr("opacity", 0.7).text("Total"), Z.append("text").attr("class", "bc-arc-total-value").attr("text-anchor", "middle").attr("dy", "1em").attr("font-size", "18px").attr("font-weight", "bold").attr("fill", "var(--bc-text-color, #555)").text(
|
|
3614
|
+
const B = String(d);
|
|
3615
|
+
Z.append("text").attr("class", "bc-arc-total-label").attr("text-anchor", "middle").attr("dy", "-0.3em").attr("font-size", "11px").attr("fill", "var(--bc-text-color, #555)").attr("opacity", 0.7).text("Total"), Z.append("text").attr("class", "bc-arc-total-value").attr("text-anchor", "middle").attr("dy", "1em").attr("font-size", "18px").attr("font-weight", "bold").attr("fill", "var(--bc-text-color, #555)").text(B);
|
|
3615
3616
|
}
|
|
3616
3617
|
if (A) {
|
|
3617
|
-
let
|
|
3618
|
-
$ === "top" ? q = -(_.height + 10) : $ === "bottom" ? q = V + 25 : $ === "left" ?
|
|
3618
|
+
let B = 0, q = 0;
|
|
3619
|
+
$ === "top" ? q = -(_.height + 10) : $ === "bottom" ? q = V + 25 : $ === "left" ? B = -(_.width + 10) : $ === "right" && (B = F + 10), je(W, o, u, q, $, G, F, V, B, S, { left: ht.left, right: ht.right });
|
|
3619
3620
|
}
|
|
3620
3621
|
Me(t, { chartType: r > 0 ? "donut" : "pie" }), l && (me(Z.node()), pe(t, l));
|
|
3621
3622
|
}
|
|
@@ -3632,8 +3633,8 @@ function ui(t, a, e = {}, r = !1) {
|
|
|
3632
3633
|
const x = ke(t);
|
|
3633
3634
|
c = x == null ? void 0 : x.margin, d = x == null ? void 0 : x.plotRect, g.detach(), (x == null ? void 0 : x.chartType) === "area" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), l = Array.from(t.querySelectorAll(".bc-frame .bc-line")), i = t.querySelector(".bc-frame .bc-symbols")) : x && (s = ge(t)), o = /* @__PURE__ */ new Map();
|
|
3634
3635
|
for (const y of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3635
|
-
for (const [
|
|
3636
|
-
o.set(
|
|
3636
|
+
for (const [D, K] of de(y))
|
|
3637
|
+
o.set(D, K);
|
|
3637
3638
|
t.replaceChildren();
|
|
3638
3639
|
}
|
|
3639
3640
|
const { body: f } = we(t, e.frame), u = ce(f).width, v = ra(a.values, (st = e.verticalAxis) == null ? void 0 : st.range, (gt = e.verticalAxis) == null ? void 0 : gt.numberFormat, (ft = e.verticalAxis) == null ? void 0 : ft.scaleType), b = Ne(u, (At = e.verticalAxis) == null ? void 0 : At.labelPosition, (Tt = e.horizontalAxis) == null ? void 0 : Tt.labelPosition, (kt = e.verticalAxis) == null ? void 0 : kt.direction, v), { chartArea: m, width: S, height: A, margin: w } = Se(f, b), k = Pe(c, w), C = er(a.labels, (Lt = e.horizontalAxis) == null ? void 0 : Lt.range), $ = C.map((x) => a.labels[x]), G = C.map((x) => a.values[x]), E = $.map((x, y) => ({
|
|
@@ -3644,7 +3645,7 @@ function ui(t, a, e = {}, r = !1) {
|
|
|
3644
3645
|
vertical: { scale: V, height: A, options: { ...e.verticalAxis, gridWidth: S, topPadding: w.top } },
|
|
3645
3646
|
horizontal: { scale: _, height: A, options: { ...e.horizontalAxis, width: S, zeroY: et } }
|
|
3646
3647
|
});
|
|
3647
|
-
const R = m.ownerSVGElement,
|
|
3648
|
+
const R = m.ownerSVGElement, z = Ee(R, t, "plot", { x: 0, y: 0, width: S, height: A }), H = h.select(m).append("g").attr("clip-path", `url(#${z})`), J = H.node(), Z = ((nt = e.colors) == null ? void 0 : nt[0]) ?? fi, at = ta(e.interpolation ?? "monotoneX"), ut = e.areaFillOpacity ?? 0.25, vt = h.area().curve(at).x((x) => P(x)).y0(A).y1((x) => V(x.value)), it = h.line().curve(at).x((x) => P(x)).y((x) => V(x.value)), ct = h.select(J).append("g").node(), bt = h.select(J).append("g").node();
|
|
3648
3649
|
if (r) {
|
|
3649
3650
|
for (const x of n)
|
|
3650
3651
|
ct.appendChild(x);
|
|
@@ -3681,7 +3682,7 @@ function ui(t, a, e = {}, r = !1) {
|
|
|
3681
3682
|
const q = { left: w.left, top: w.top, width: S, height: A };
|
|
3682
3683
|
if (Fe(dt, {
|
|
3683
3684
|
svg: R,
|
|
3684
|
-
clipId:
|
|
3685
|
+
clipId: z,
|
|
3685
3686
|
group: m,
|
|
3686
3687
|
from: d,
|
|
3687
3688
|
to: q,
|
|
@@ -3708,9 +3709,9 @@ function ui(t, a, e = {}, r = !1) {
|
|
|
3708
3709
|
});
|
|
3709
3710
|
}
|
|
3710
3711
|
if (e.valueLabels && h.select(J).append("g").selectAll(".bc-value-label").data(E, (y) => y.label).enter().append("text").attr("class", "bc-value-label").attr("x", (y) => P(y)).attr("y", (y) => V(y.value) - 8).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text((y) => String(y.value)), e.lineSymbols) {
|
|
3711
|
-
const x = E.map((
|
|
3712
|
-
cx: P(
|
|
3713
|
-
cy: V(
|
|
3712
|
+
const x = E.map((D, K) => ({
|
|
3713
|
+
cx: P(D),
|
|
3714
|
+
cy: V(D.value),
|
|
3714
3715
|
color: Z,
|
|
3715
3716
|
index: K
|
|
3716
3717
|
}));
|
|
@@ -3760,7 +3761,7 @@ const hi = [
|
|
|
3760
3761
|
"#ff9da7"
|
|
3761
3762
|
];
|
|
3762
3763
|
function bi(t, a, e = {}, r = !1) {
|
|
3763
|
-
var It, re, xe, ne, $e, Ut,
|
|
3764
|
+
var It, re, xe, ne, $e, Ut, Yt, Ie, Y;
|
|
3764
3765
|
Le(r), lr(t);
|
|
3765
3766
|
let n = a, l = [], i = [], s = null, o, c, d;
|
|
3766
3767
|
const g = ye.for(t);
|
|
@@ -3785,10 +3786,10 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3785
3786
|
return V === Kt.Ascending ? rt : -rt;
|
|
3786
3787
|
});
|
|
3787
3788
|
}
|
|
3788
|
-
const R = { labels: n.labels, values: n.values, series: et },
|
|
3789
|
+
const R = { labels: n.labels, values: n.values, series: et }, z = F ? Ur(R) : Xr(R);
|
|
3789
3790
|
let H = 0;
|
|
3790
3791
|
if (W)
|
|
3791
|
-
for (const O of
|
|
3792
|
+
for (const O of z)
|
|
3792
3793
|
for (const j of O)
|
|
3793
3794
|
j[1] > H && (H = j[1]);
|
|
3794
3795
|
else
|
|
@@ -3796,14 +3797,14 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3796
3797
|
for (const j of O.values)
|
|
3797
3798
|
j > H && (H = j);
|
|
3798
3799
|
F && (H = 100);
|
|
3799
|
-
const J = [0, H], Z = ((re = e.verticalAxis) == null ? void 0 : re.numberFormat) ?? (F ? "|d|%" : void 0), at = ra(J, (xe = e.verticalAxis) == null ? void 0 : xe.range, Z, (ne = e.verticalAxis) == null ? void 0 : ne.scaleType), ut = Ne(E, ($e = e.verticalAxis) == null ? void 0 : $e.labelPosition, (Ut = e.horizontalAxis) == null ? void 0 : Ut.labelPosition, (
|
|
3800
|
+
const J = [0, H], Z = ((re = e.verticalAxis) == null ? void 0 : re.numberFormat) ?? (F ? "|d|%" : void 0), at = ra(J, (xe = e.verticalAxis) == null ? void 0 : xe.range, Z, (ne = e.verticalAxis) == null ? void 0 : ne.scaleType), ut = Ne(E, ($e = e.verticalAxis) == null ? void 0 : $e.labelPosition, (Ut = e.horizontalAxis) == null ? void 0 : Ut.labelPosition, (Yt = e.verticalAxis) == null ? void 0 : Yt.direction, at), vt = $.length > 0 ? vl($) : 0, it = ut.top != null, ct = Math.max(0, E - (ut.left ?? 50) - (ut.right ?? 20) - vt), bt = G ? Ze(S, P, ct) : { width: 0, height: 0 }, dt = G ? bt.height + 15 : 0, yt = { ...ut };
|
|
3800
3801
|
if (G && P === "top") {
|
|
3801
3802
|
const O = it ? 15 : 0;
|
|
3802
3803
|
yt.top = dt + O;
|
|
3803
3804
|
}
|
|
3804
3805
|
G && P === "bottom" && (yt.bottom = (yt.bottom ?? 24) + dt), G && P === "left" && (yt.left = (yt.left ?? 50) + bt.width + 10), G && P === "right" && (yt.right = (yt.right ?? 20) + bt.width + 10), vt > 0 && (yt.right = (yt.right ?? 20) + vt);
|
|
3805
|
-
const { chartArea:
|
|
3806
|
-
g.attach(
|
|
3806
|
+
const { chartArea: B, width: q, height: st, margin: gt } = Se(f, yt), ft = Pe(c, gt), At = h.scalePoint().domain(n.labels).range([0, q]).padding(e.edgePadding ? 0.6 : 0), Tt = At, kt = (O) => At(n.labels[O]) ?? 0, Lt = h.scaleLinear().domain([0, H]).nice().range([st, 0]);
|
|
3807
|
+
g.attach(B, ft), g.update({
|
|
3807
3808
|
vertical: {
|
|
3808
3809
|
scale: Lt,
|
|
3809
3810
|
height: st,
|
|
@@ -3811,21 +3812,21 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3811
3812
|
},
|
|
3812
3813
|
horizontal: { scale: Tt, height: st, options: { ...e.horizontalAxis, width: q } }
|
|
3813
3814
|
});
|
|
3814
|
-
const Ct =
|
|
3815
|
+
const Ct = B.ownerSVGElement, Mt = Ee(Ct, t, "plot", { x: 0, y: 0, width: q, height: st }), U = h.select(B).append("g").attr("clip-path", `url(#${Mt})`), nt = U.node(), L = ta(e.interpolation ?? "monotoneX"), p = z.map((O) => {
|
|
3815
3816
|
const j = v.findIndex((rt) => rt.name === O.key);
|
|
3816
3817
|
let lt;
|
|
3817
3818
|
if (W)
|
|
3818
3819
|
lt = Array.from(O).map((rt) => [Lt(rt[0]), Lt(rt[1])]);
|
|
3819
3820
|
else {
|
|
3820
|
-
const rt = et.find((
|
|
3821
|
-
lt = ((rt == null ? void 0 : rt.values) ?? []).map((
|
|
3821
|
+
const rt = et.find((zt) => zt.name === O.key);
|
|
3822
|
+
lt = ((rt == null ? void 0 : rt.values) ?? []).map((zt) => [Lt(0), Lt(zt)]);
|
|
3822
3823
|
}
|
|
3823
3824
|
return {
|
|
3824
3825
|
name: O.key,
|
|
3825
3826
|
points: lt,
|
|
3826
3827
|
colorIndex: j >= 0 ? j : 0
|
|
3827
3828
|
};
|
|
3828
|
-
}), x = new Set((e.highlights ?? []).map((O) => O.target)), y = x.size > 0,
|
|
3829
|
+
}), x = new Set((e.highlights ?? []).map((O) => O.target)), y = x.size > 0, D = e.areaFillOpacity != null ? e.areaFillOpacity : 0.85, K = (O) => w.get(O.name) ?? $t(O.name, O.colorIndex, m, A), ot = h.area().curve(L).x((O, j) => kt(j)).y0((O) => O[0]).y1((O) => O[1]), N = h.select(nt).append("g").node(), mt = h.select(nt).append("g").node();
|
|
3829
3830
|
if (r) {
|
|
3830
3831
|
for (const O of l)
|
|
3831
3832
|
N.appendChild(O);
|
|
@@ -3844,7 +3845,7 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3844
3845
|
"data-series": O.colorIndex,
|
|
3845
3846
|
d: ot(O.points) ?? "",
|
|
3846
3847
|
fill: K(O),
|
|
3847
|
-
opacity: y ? fe(x, O.name,
|
|
3848
|
+
opacity: y ? fe(x, O.name, D) : D
|
|
3848
3849
|
})
|
|
3849
3850
|
}), Ht(pt, {
|
|
3850
3851
|
role: "series-line",
|
|
@@ -3854,7 +3855,7 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3854
3855
|
key: (O) => O.name,
|
|
3855
3856
|
insert: (O) => O.append("path").attr("class", "bc-line"),
|
|
3856
3857
|
attrs: (O) => {
|
|
3857
|
-
const j = Al(O.name, e.interpolation ?? "monotoneX", A), lt = h.line().curve(ta(j)).x((rt,
|
|
3858
|
+
const j = Al(O.name, e.interpolation ?? "monotoneX", A), lt = h.line().curve(ta(j)).x((rt, zt) => kt(zt)).y((rt) => rt[1]);
|
|
3858
3859
|
return {
|
|
3859
3860
|
"data-series": O.colorIndex,
|
|
3860
3861
|
d: lt(O.points) ?? "",
|
|
@@ -3869,7 +3870,7 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3869
3870
|
if (Fe(pt, {
|
|
3870
3871
|
svg: Ct,
|
|
3871
3872
|
clipId: Mt,
|
|
3872
|
-
group:
|
|
3873
|
+
group: B,
|
|
3873
3874
|
from: d,
|
|
3874
3875
|
to: M,
|
|
3875
3876
|
active: r && (l.length > 0 || i.length > 0)
|
|
@@ -3881,24 +3882,24 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3881
3882
|
value: ((rt = b[0]) == null ? void 0 : rt.values[lt]) ?? 0
|
|
3882
3883
|
};
|
|
3883
3884
|
});
|
|
3884
|
-
nr(
|
|
3885
|
+
nr(B, e.annotations, { scaleX: Tt, scaleY: Lt, data: O, width: q, height: st, backgroundColor: ie(t), transition: r, priorAnnotations: o });
|
|
3885
3886
|
}
|
|
3886
3887
|
if (e.tooltips || e.crosshair) {
|
|
3887
3888
|
const O = [];
|
|
3888
|
-
|
|
3889
|
+
z.forEach((j) => {
|
|
3889
3890
|
const lt = v.findIndex((rt) => rt.name === j.key);
|
|
3890
|
-
Array.from(j).forEach((rt,
|
|
3891
|
+
Array.from(j).forEach((rt, zt) => {
|
|
3891
3892
|
const ue = rt[1] - rt[0];
|
|
3892
3893
|
O.push({
|
|
3893
|
-
cx: kt(
|
|
3894
|
+
cx: kt(zt),
|
|
3894
3895
|
cy: Lt(rt[1]),
|
|
3895
|
-
label: n.labels[
|
|
3896
|
+
label: n.labels[zt],
|
|
3896
3897
|
value: Math.round(ue * 100) / 100,
|
|
3897
3898
|
series: j.key,
|
|
3898
3899
|
color: $t(j.key, lt, m, A)
|
|
3899
3900
|
});
|
|
3900
3901
|
});
|
|
3901
|
-
}), sr(
|
|
3902
|
+
}), sr(B, {
|
|
3902
3903
|
width: q,
|
|
3903
3904
|
height: st,
|
|
3904
3905
|
points: O,
|
|
@@ -3907,7 +3908,7 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3907
3908
|
crosshairDirection: e.crosshairDirection,
|
|
3908
3909
|
crosshairStyle: e.crosshairStyle,
|
|
3909
3910
|
crosshairColor: e.crosshairColor,
|
|
3910
|
-
numberFormat: (
|
|
3911
|
+
numberFormat: (Y = e.verticalAxis) == null ? void 0 : Y.numberFormat,
|
|
3911
3912
|
container: t
|
|
3912
3913
|
});
|
|
3913
3914
|
}
|
|
@@ -3916,30 +3917,30 @@ function bi(t, a, e = {}, r = !1) {
|
|
|
3916
3917
|
var le;
|
|
3917
3918
|
if (We(O.name, C, A) !== "direct")
|
|
3918
3919
|
return;
|
|
3919
|
-
const rt =
|
|
3920
|
+
const rt = z.find((se) => se.key === O.name);
|
|
3920
3921
|
if (!rt)
|
|
3921
3922
|
return;
|
|
3922
|
-
const
|
|
3923
|
+
const zt = rt[tt], ue = Lt((zt[0] + zt[1]) / 2), Oe = ((le = A == null ? void 0 : A.find((se) => se.name === O.name)) == null ? void 0 : le.labelText) || O.name;
|
|
3923
3924
|
wt.push({ name: O.name, index: j, naturalY: ue, text: Oe });
|
|
3924
3925
|
}), wt.length > 0) {
|
|
3925
|
-
wt.sort((rt,
|
|
3926
|
+
wt.sort((rt, zt) => rt.naturalY - zt.naturalY);
|
|
3926
3927
|
const O = wt.map((rt) => rt.naturalY), lt = qr(O, 0, st, 14);
|
|
3927
|
-
wt.forEach((rt,
|
|
3928
|
-
h.select(
|
|
3928
|
+
wt.forEach((rt, zt) => {
|
|
3929
|
+
h.select(B).append("text").attr("class", "bc-direct-label").attr("data-series", rt.index).attr("x", xt).attr("y", lt[zt]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", $t(rt.name, rt.index, m, A)).text(rt.text);
|
|
3929
3930
|
});
|
|
3930
3931
|
}
|
|
3931
|
-
const
|
|
3932
|
-
if (G &&
|
|
3933
|
-
const O =
|
|
3934
|
-
const
|
|
3935
|
-
return $t(rt,
|
|
3932
|
+
const Dt = S.filter((O) => We(O, C, A) === "legend");
|
|
3933
|
+
if (G && Dt.length > 0) {
|
|
3934
|
+
const O = Dt.map((rt) => {
|
|
3935
|
+
const zt = v.findIndex((ue) => ue.name === rt);
|
|
3936
|
+
return $t(rt, zt, m, A);
|
|
3936
3937
|
});
|
|
3937
3938
|
let j = 0, lt = 0;
|
|
3938
3939
|
if (P === "top") {
|
|
3939
3940
|
const rt = it ? 15 : 0;
|
|
3940
3941
|
lt = -(bt.height + 10 + rt);
|
|
3941
3942
|
} else P === "bottom" ? lt = st + 25 : P === "left" ? j = -(bt.width + 10) : P === "right" && (j = q + 10);
|
|
3942
|
-
je(
|
|
3943
|
+
je(B, Dt, O, lt, P, I, q, st, j, [], { left: gt.left, right: gt.right });
|
|
3943
3944
|
}
|
|
3944
3945
|
Me(t, { chartType: "area-stacked", margin: gt, plotRect: M }), s && (me(U.node()), pe(t, s));
|
|
3945
3946
|
}
|
|
@@ -3972,7 +3973,7 @@ function gi(t, a, e) {
|
|
|
3972
3973
|
return r;
|
|
3973
3974
|
}
|
|
3974
3975
|
function pi(t, a, e = {}, r = !1) {
|
|
3975
|
-
var nt, L, p, x, y,
|
|
3976
|
+
var nt, L, p, x, y, D, K, ot;
|
|
3976
3977
|
Le(r);
|
|
3977
3978
|
let n = [], l = null, i, s, o;
|
|
3978
3979
|
const c = ye.for(t);
|
|
@@ -3984,14 +3985,14 @@ function pi(t, a, e = {}, r = !1) {
|
|
|
3984
3985
|
i.set(pt, M);
|
|
3985
3986
|
t.replaceChildren();
|
|
3986
3987
|
}
|
|
3987
|
-
const { body: d } = we(t, e.frame), g = a.series ?? [], f = g.filter((N) => !ia(N.name, e.seriesOverrides)), u = f.map((N) => N.name), v = e.colors ?? mi, b = e.seriesOverrides, m = e.legend !== !1, S = ce(d).width, A = 350, w = e.legendPosition ?? "top", k = S > 0 && S < A && (w === "left" || w === "right") ? "top" : w, C = e.legendAnchor ?? "start", $ = { labels: a.labels, values: a.values, series: f }, G = e.stackMode === Qe.Percent, E = G ? Ur($) : Xr($), X = gi(E, a.labels, g), _ = G ? 100 : h.max(X, (N) => N.y1) ?? 0, I = ra([0, _], (nt = e.verticalAxis) == null ? void 0 : nt.range, (L = e.verticalAxis) == null ? void 0 : L.numberFormat, (p = e.verticalAxis) == null ? void 0 : p.scaleType), W = Ne(S, (x = e.verticalAxis) == null ? void 0 : x.labelPosition, (y = e.horizontalAxis) == null ? void 0 : y.labelPosition, (
|
|
3988
|
+
const { body: d } = we(t, e.frame), g = a.series ?? [], f = g.filter((N) => !ia(N.name, e.seriesOverrides)), u = f.map((N) => N.name), v = e.colors ?? mi, b = e.seriesOverrides, m = e.legend !== !1, S = ce(d).width, A = 350, w = e.legendPosition ?? "top", k = S > 0 && S < A && (w === "left" || w === "right") ? "top" : w, C = e.legendAnchor ?? "start", $ = { labels: a.labels, values: a.values, series: f }, G = e.stackMode === Qe.Percent, E = G ? Ur($) : Xr($), X = gi(E, a.labels, g), _ = G ? 100 : h.max(X, (N) => N.y1) ?? 0, I = ra([0, _], (nt = e.verticalAxis) == null ? void 0 : nt.range, (L = e.verticalAxis) == null ? void 0 : L.numberFormat, (p = e.verticalAxis) == null ? void 0 : p.scaleType), W = Ne(S, (x = e.verticalAxis) == null ? void 0 : x.labelPosition, (y = e.horizontalAxis) == null ? void 0 : y.labelPosition, (D = e.verticalAxis) == null ? void 0 : D.direction, I), F = Math.max(0, S - (W.left ?? 50) - (W.right ?? 20)), V = Rr(a.labels, F, e.horizontalAxis);
|
|
3988
3989
|
V !== void 0 && (W.bottom = V);
|
|
3989
|
-
const ht = W.top != null, et = Math.max(0, S - (W.left ?? 50) - (W.right ?? 20)), R = m ? Ze(u, k, et) : { width: 0, height: 0 },
|
|
3990
|
+
const ht = W.top != null, et = Math.max(0, S - (W.left ?? 50) - (W.right ?? 20)), R = m ? Ze(u, k, et) : { width: 0, height: 0 }, z = m ? R.height + 15 : 0, H = { ...W };
|
|
3990
3991
|
if (m && k === "top") {
|
|
3991
3992
|
const N = ht ? 15 : 0;
|
|
3992
|
-
H.top =
|
|
3993
|
+
H.top = z + N;
|
|
3993
3994
|
}
|
|
3994
|
-
m && k === "bottom" && (H.bottom = (H.bottom ?? 24) +
|
|
3995
|
+
m && k === "bottom" && (H.bottom = (H.bottom ?? 24) + z), m && k === "left" && (H.left = (H.left ?? 50) + R.width + 10), m && k === "right" && (H.right = (H.right ?? 20) + R.width + 10);
|
|
3995
3996
|
const { chartArea: J, width: Z, height: at, margin: ut } = Se(d, H), vt = Pe(s, ut);
|
|
3996
3997
|
let it = a.labels;
|
|
3997
3998
|
if (e.sortMode === "total") {
|
|
@@ -4007,7 +4008,7 @@ function pi(t, a, e = {}, r = !1) {
|
|
|
4007
4008
|
vertical: { scale: bt, height: at, options: { ...e.verticalAxis, gridWidth: Z, topPadding: ut.top } },
|
|
4008
4009
|
horizontal: { scale: ct, height: at, options: { ...e.horizontalAxis, width: Z } }
|
|
4009
4010
|
});
|
|
4010
|
-
const dt = J.ownerSVGElement, yt = Ee(dt, t, "bars", { x: 0, y: 0, width: Z, height: at }),
|
|
4011
|
+
const dt = J.ownerSVGElement, yt = Ee(dt, t, "bars", { x: 0, y: 0, width: Z, height: at }), B = h.select(J).append("g").attr("clip-path", `url(#${yt})`), q = it === a.labels ? X : it.flatMap((N) => X.filter((mt) => mt.label === N)), st = Re(e.colorizes), gt = Aa(e.highlights), ft = Gt(t), At = B.append("g").node();
|
|
4011
4012
|
if (r)
|
|
4012
4013
|
for (const N of n)
|
|
4013
4014
|
N.removeAttribute("opacity"), N.removeAttribute("fill-opacity"), At.appendChild(N);
|
|
@@ -4039,7 +4040,7 @@ function pi(t, a, e = {}, r = !1) {
|
|
|
4039
4040
|
to: Tt,
|
|
4040
4041
|
active: r && n.length > 0
|
|
4041
4042
|
});
|
|
4042
|
-
const kt = sa(
|
|
4043
|
+
const kt = sa(B);
|
|
4043
4044
|
if (e.tooltips && kt.use(Ue({ numberFormat: (K = e.verticalAxis) == null ? void 0 : K.numberFormat })), e.crosshair && kt.use(la({
|
|
4044
4045
|
width: Z,
|
|
4045
4046
|
height: at,
|
|
@@ -4054,7 +4055,7 @@ function pi(t, a, e = {}, r = !1) {
|
|
|
4054
4055
|
kt.use(va(e.annotations, { scaleX: ct, scaleY: bt, data: N, width: Z, height: at, backgroundColor: ie(t), transition: r, priorAnnotations: i }));
|
|
4055
4056
|
}
|
|
4056
4057
|
const Lt = () => kt.draw(q);
|
|
4057
|
-
ft.state === "committing" ? ft.register(Lt) : Lt(), Me(t, { chartType: "column-stacked", margin: ut, plotRect: Tt }), l && (me(
|
|
4058
|
+
ft.state === "committing" ? ft.register(Lt) : Lt(), Me(t, { chartType: "column-stacked", margin: ut, plotRect: Tt }), l && (me(B.node()), pe(t, l));
|
|
4058
4059
|
const Ct = e.valueLabels ?? !1, Mt = h.rollup(q, (N) => h.max(N, (mt) => mt.y1) ?? 0, (N) => N.label), U = h.select(J).append("g").attr("class", "bc-value-labels");
|
|
4059
4060
|
if (q.forEach((N) => {
|
|
4060
4061
|
if (!wa(N.seriesName, Ct, b))
|
|
@@ -4109,7 +4110,7 @@ function xi(t, a, e) {
|
|
|
4109
4110
|
return r;
|
|
4110
4111
|
}
|
|
4111
4112
|
function vi(t, a, e = {}, r = !1) {
|
|
4112
|
-
var y,
|
|
4113
|
+
var y, D, K, ot, N, mt, pt;
|
|
4113
4114
|
Le(r);
|
|
4114
4115
|
let n = [], l = null, i, s, o;
|
|
4115
4116
|
const c = ye.for(t);
|
|
@@ -4121,19 +4122,19 @@ function vi(t, a, e = {}, r = !1) {
|
|
|
4121
4122
|
i.set(xt, wt);
|
|
4122
4123
|
t.replaceChildren();
|
|
4123
4124
|
}
|
|
4124
|
-
const { body: d } = we(t, e.frame), g = a.series ?? [], f = g.filter((M) => !ia(M.name, e.seriesOverrides)), u = f.map((M) => M.name), v = e.colors ?? yi, b = e.seriesOverrides, m = e.legend !== !1, S = ce(d).width, A = 350, w = e.legendPosition ?? "top", k = S > 0 && S < A && (w === "left" || w === "right") ? "top" : w, C = e.legendAnchor ?? "start", $ = { labels: a.labels, values: a.values, series: f }, G = e.stackMode === Qe.Percent, E = G ? Ur($) : Xr($), X = xi(E, a.labels, g), _ = G ? 100 : h.max(X, (M) => M.y1) ?? 0, P = e.categoryLabelLine === !0, I = rr(a.labels), W = P ? Pt.Off : (y = e.verticalAxis) == null ? void 0 : y.labelPosition, F = Ne(S, W, (
|
|
4125
|
+
const { body: d } = we(t, e.frame), g = a.series ?? [], f = g.filter((M) => !ia(M.name, e.seriesOverrides)), u = f.map((M) => M.name), v = e.colors ?? yi, b = e.seriesOverrides, m = e.legend !== !1, S = ce(d).width, A = 350, w = e.legendPosition ?? "top", k = S > 0 && S < A && (w === "left" || w === "right") ? "top" : w, C = e.legendAnchor ?? "start", $ = { labels: a.labels, values: a.values, series: f }, G = e.stackMode === Qe.Percent, E = G ? Ur($) : Xr($), X = xi(E, a.labels, g), _ = G ? 100 : h.max(X, (M) => M.y1) ?? 0, P = e.categoryLabelLine === !0, I = rr(a.labels), W = P ? Pt.Off : (y = e.verticalAxis) == null ? void 0 : y.labelPosition, F = Ne(S, W, (D = e.horizontalAxis) == null ? void 0 : D.labelPosition, (K = e.verticalAxis) == null ? void 0 : K.direction, I, (ot = e.horizontalAxis) == null ? void 0 : ot.showAxis), V = F.top != null, ht = Math.max(0, S - (F.left ?? 50) - (F.right ?? 20)), et = m ? Ze(u, k, ht) : { width: 0, height: 0 }, R = m ? et.height + 15 : 0, z = { ...F };
|
|
4125
4126
|
if (m && k === "top") {
|
|
4126
4127
|
const M = V ? 15 : 0;
|
|
4127
|
-
|
|
4128
|
+
z.top = R + M;
|
|
4128
4129
|
}
|
|
4129
|
-
m && k === "bottom" && (
|
|
4130
|
-
const { chartArea: H, width: J, height: Z, margin: at } = Se(d,
|
|
4130
|
+
m && k === "bottom" && (z.bottom = (z.bottom ?? 24) + R), m && k === "left" && (z.left = (z.left ?? 50) + et.width + 10), m && k === "right" && (z.right = (z.right ?? 20) + et.width + 10);
|
|
4131
|
+
const { chartArea: H, width: J, height: Z, margin: at } = Se(d, z), ut = Pe(s, at);
|
|
4131
4132
|
let vt = a.labels;
|
|
4132
4133
|
if (e.sortMode === "total") {
|
|
4133
4134
|
const M = a.labels.map((tt, xt) => ({
|
|
4134
4135
|
label: tt,
|
|
4135
4136
|
index: xt,
|
|
4136
|
-
total: f.reduce((wt,
|
|
4137
|
+
total: f.reduce((wt, Dt) => wt + (Dt.values[xt] ?? 0), 0)
|
|
4137
4138
|
}));
|
|
4138
4139
|
M.sort((tt, xt) => xt.total - tt.total), vt = M.map((tt) => tt.label);
|
|
4139
4140
|
}
|
|
@@ -4151,7 +4152,7 @@ function vi(t, a, e = {}, r = !1) {
|
|
|
4151
4152
|
},
|
|
4152
4153
|
order: "horizontal-first"
|
|
4153
4154
|
});
|
|
4154
|
-
const bt = H.ownerSVGElement, dt = Ee(bt, t, "bars", { x: 0, y: 0, width: J, height: Z }), yt = h.select(H).append("g").attr("clip-path", `url(#${dt})`),
|
|
4155
|
+
const bt = H.ownerSVGElement, dt = Ee(bt, t, "bars", { x: 0, y: 0, width: J, height: Z }), yt = h.select(H).append("g").attr("clip-path", `url(#${dt})`), B = vt === a.labels ? X : vt.flatMap((M) => X.filter((tt) => tt.label === M)), q = P ? Sn : 0, st = Re(e.colorizes), gt = Aa(e.highlights), ft = Gt(t), At = yt.append("g").node();
|
|
4155
4156
|
if (r)
|
|
4156
4157
|
for (const M of n)
|
|
4157
4158
|
M.removeAttribute("opacity"), M.removeAttribute("fill-opacity"), At.appendChild(M);
|
|
@@ -4159,7 +4160,7 @@ function vi(t, a, e = {}, r = !1) {
|
|
|
4159
4160
|
role: "mark-per-cell",
|
|
4160
4161
|
parent: At,
|
|
4161
4162
|
selector: ".bc-bar-stacked",
|
|
4162
|
-
data:
|
|
4163
|
+
data: B,
|
|
4163
4164
|
key: (M) => M.label + "\0" + M.seriesName,
|
|
4164
4165
|
insert: (M) => M.append("rect").attr("class", "bc-bar bc-bar-stacked"),
|
|
4165
4166
|
attrs: (M) => {
|
|
@@ -4194,11 +4195,11 @@ function vi(t, a, e = {}, r = !1) {
|
|
|
4194
4195
|
})), (pt = e.annotations) != null && pt.length) {
|
|
4195
4196
|
const M = a.labels.map((tt, xt) => ({
|
|
4196
4197
|
label: tt,
|
|
4197
|
-
value: f.reduce((wt,
|
|
4198
|
+
value: f.reduce((wt, Dt) => wt + (Dt.values[xt] ?? 0), 0)
|
|
4198
4199
|
}));
|
|
4199
4200
|
kt.use(va(e.annotations, { scaleX: ct, scaleY: it, data: M, width: J, height: Z, backgroundColor: ie(t), orientation: oe.Horizontal, transition: r, priorAnnotations: i }));
|
|
4200
4201
|
}
|
|
4201
|
-
const Lt = () => kt.draw(
|
|
4202
|
+
const Lt = () => kt.draw(B);
|
|
4202
4203
|
if (ft.state === "committing" ? ft.register(Lt) : Lt(), Me(t, { chartType: "bar-stacked", margin: at, plotRect: Tt }), l && (me(yt.node()), pe(t, l)), P) {
|
|
4203
4204
|
const M = h.select(H).append("g").attr("class", "bc-category-labels");
|
|
4204
4205
|
for (const tt of vt) {
|
|
@@ -4208,47 +4209,47 @@ function vi(t, a, e = {}, r = !1) {
|
|
|
4208
4209
|
}
|
|
4209
4210
|
const Ct = e.valueLabels ?? !1, Mt = e.valueLabelPosition ?? St.Auto, U = /* @__PURE__ */ new Set(), nt = /* @__PURE__ */ new Map();
|
|
4210
4211
|
for (const M of vt) {
|
|
4211
|
-
const tt =
|
|
4212
|
+
const tt = B.filter((xt) => xt.label === M).sort((xt, wt) => xt.y1 - wt.y1);
|
|
4212
4213
|
if (tt.length > 0) {
|
|
4213
4214
|
const xt = tt[tt.length - 1];
|
|
4214
4215
|
U.add(xt.label + "\0" + xt.seriesName);
|
|
4215
4216
|
for (let wt = 0; wt < tt.length - 1; wt++) {
|
|
4216
|
-
const
|
|
4217
|
-
nt.set(
|
|
4217
|
+
const Dt = tt[wt].label + "\0" + tt[wt].seriesName;
|
|
4218
|
+
nt.set(Dt, it(tt[wt + 1].y1) - it(tt[wt].y1));
|
|
4218
4219
|
}
|
|
4219
4220
|
}
|
|
4220
4221
|
}
|
|
4221
|
-
const L = /* @__PURE__ */ new Map(), p = h.rollup(
|
|
4222
|
-
if (
|
|
4222
|
+
const L = /* @__PURE__ */ new Map(), p = h.rollup(B, (M) => h.max(M, (tt) => tt.y1) ?? 0, (M) => M.label), x = h.select(H).append("g").attr("class", "bc-value-labels");
|
|
4223
|
+
if (B.forEach((M) => {
|
|
4223
4224
|
if (!wa(M.seriesName, Ct, b))
|
|
4224
4225
|
return;
|
|
4225
|
-
const tt = G ? `${Math.round(M.value)}%` : e.valueLabels === "percent" ? ar(M.value, p.get(M.label) ?? 0) : String(Math.round(M.value * 100) / 100), xt = it(M.y1) - it(M.y0), wt = tt.length * 6.5 + 8,
|
|
4226
|
+
const tt = G ? `${Math.round(M.value)}%` : e.valueLabels === "percent" ? ar(M.value, p.get(M.label) ?? 0) : String(Math.round(M.value * 100) / 100), xt = it(M.y1) - it(M.y0), wt = tt.length * 6.5 + 8, Dt = xt >= wt, It = (ct(M.label) ?? 0) + q + (ct.bandwidth() - q) / 2, re = $t(M.seriesName, M.seriesIndex, v, b), xe = U.has(M.label + "\0" + M.seriesName), ne = Mt === St.Outside || Mt === St.Auto && !Dt && xe, $e = oa({
|
|
4226
4227
|
text: tt,
|
|
4227
4228
|
placement: ne ? "outside" : "inside",
|
|
4228
4229
|
orientation: "horizontal",
|
|
4229
4230
|
barWidth: xt,
|
|
4230
4231
|
barHeight: ct.bandwidth()
|
|
4231
4232
|
}), Ut = () => {
|
|
4232
|
-
const
|
|
4233
|
-
x.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("opacity", 0).attr("x",
|
|
4233
|
+
const Yt = it(M.y0) + xt / 2;
|
|
4234
|
+
x.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("opacity", 0).attr("x", Yt).attr("y", It).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Ae(re)).text(tt);
|
|
4234
4235
|
};
|
|
4235
4236
|
if (ne)
|
|
4236
4237
|
if (Mt === St.Inside)
|
|
4237
4238
|
Ut();
|
|
4238
4239
|
else {
|
|
4239
|
-
const
|
|
4240
|
-
O || j || rt || !$e ? Ut() : (L.set(M.label,
|
|
4240
|
+
const Yt = it(M.y1) + 4, Ie = L.get(M.label) ?? 0, Y = nt.get(M.label + "\0" + M.seriesName), O = Yt < Ie, j = Y !== void 0 && wt + 4 > Y, lt = J + at.right - 2, rt = Yt + wt > lt;
|
|
4241
|
+
O || j || rt || !$e ? Ut() : (L.set(M.label, Yt + wt), x.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("x", Yt).attr("y", It).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", "currentColor").text(tt));
|
|
4241
4242
|
}
|
|
4242
|
-
else if (!
|
|
4243
|
+
else if (!Dt || !$e)
|
|
4243
4244
|
Ut();
|
|
4244
4245
|
else {
|
|
4245
|
-
const
|
|
4246
|
-
x.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("x",
|
|
4246
|
+
const Yt = it(M.y0) + xt / 2;
|
|
4247
|
+
x.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("x", Yt).attr("y", It).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Ae(re)).text(tt);
|
|
4247
4248
|
}
|
|
4248
4249
|
}), m && u.length > 0) {
|
|
4249
4250
|
const M = u.map((wt) => {
|
|
4250
|
-
const
|
|
4251
|
-
return $t(wt,
|
|
4251
|
+
const Dt = g.findIndex((It) => It.name === wt);
|
|
4252
|
+
return $t(wt, Dt, v, b);
|
|
4252
4253
|
});
|
|
4253
4254
|
let tt = 0, xt = 0;
|
|
4254
4255
|
if (k === "top") {
|
|
@@ -4328,14 +4329,14 @@ function Li(t, a, e = {}, r = !1) {
|
|
|
4328
4329
|
if (e.sortMode === "total") {
|
|
4329
4330
|
const L = a.labels.map((p, x) => ({
|
|
4330
4331
|
label: p,
|
|
4331
|
-
total: g.reduce((y,
|
|
4332
|
+
total: g.reduce((y, D) => y + (D.values[x] ?? 0), 0)
|
|
4332
4333
|
}));
|
|
4333
4334
|
L.sort((p, x) => x.total - p.total), R = L.map((p) => p.label);
|
|
4334
4335
|
}
|
|
4335
|
-
const
|
|
4336
|
+
const z = h.scaleBand().domain(R).range([0, V]).padding(aa(e.barGap)), H = C ? kn : 0;
|
|
4336
4337
|
o.attach(W, et), o.update({
|
|
4337
4338
|
vertical: {
|
|
4338
|
-
scale:
|
|
4339
|
+
scale: z,
|
|
4339
4340
|
height: V,
|
|
4340
4341
|
options: {
|
|
4341
4342
|
...e.verticalAxis,
|
|
@@ -4348,13 +4349,13 @@ function Li(t, a, e = {}, r = !1) {
|
|
|
4348
4349
|
const J = e.sharedScale === !0, Z = wi(g, d, F, J), at = W.ownerSVGElement, ut = Ee(at, t, "bars", { x: 0, y: 0, width: F, height: V }), vt = h.select(W).append("g").attr("clip-path", `url(#${ut})`), it = h.select(W).append("g").attr("class", "bc-split-headers");
|
|
4349
4350
|
for (const L of Z)
|
|
4350
4351
|
it.append("text").attr("class", "bc-split-header").attr("x", L.xOffset + L.panelWidth / 2).attr("y", -Wa / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("font-weight", "600").attr("fill", "currentColor").text(L.seriesName);
|
|
4351
|
-
const ct = Si(Z, R, a.labels, d), bt = Aa(e.highlights), dt = Re(e.colorizes), yt = Gt(t),
|
|
4352
|
+
const ct = Si(Z, R, a.labels, d), bt = Aa(e.highlights), dt = Re(e.colorizes), yt = Gt(t), B = vt.append("g").node();
|
|
4352
4353
|
if (r)
|
|
4353
4354
|
for (const L of n)
|
|
4354
|
-
L.removeAttribute("opacity"), L.removeAttribute("fill-opacity"),
|
|
4355
|
+
L.removeAttribute("opacity"), L.removeAttribute("fill-opacity"), B.appendChild(L);
|
|
4355
4356
|
Ht(yt, {
|
|
4356
4357
|
role: "mark-per-cell",
|
|
4357
|
-
parent:
|
|
4358
|
+
parent: B,
|
|
4358
4359
|
selector: ".bc-bar-split",
|
|
4359
4360
|
data: ct,
|
|
4360
4361
|
key: (L) => L.label + "\0" + L.seriesName,
|
|
@@ -4363,9 +4364,9 @@ function Li(t, a, e = {}, r = !1) {
|
|
|
4363
4364
|
const p = dt.get(L.seriesName) ?? $t(L.seriesName, L.seriesIndex, u, v), x = Ea(L.seriesName, v), y = {
|
|
4364
4365
|
"data-series": L.seriesName,
|
|
4365
4366
|
x: L.xPos,
|
|
4366
|
-
y: (
|
|
4367
|
+
y: (z(L.label) ?? 0) + H,
|
|
4367
4368
|
width: L.barWidth,
|
|
4368
|
-
height: Math.max(0,
|
|
4369
|
+
height: Math.max(0, z.bandwidth() - H),
|
|
4369
4370
|
fill: p
|
|
4370
4371
|
};
|
|
4371
4372
|
return x < 1 && (y["fill-opacity"] = x), bt.size > 0 && (y.opacity = fe(bt, L.seriesName)), y;
|
|
@@ -4393,7 +4394,7 @@ function Li(t, a, e = {}, r = !1) {
|
|
|
4393
4394
|
if (yt.state === "committing" ? yt.register(gt) : gt(), Me(t, { chartType: "bar-split", margin: ht, plotRect: q }), l && (me(vt.node()), pe(t, l)), C) {
|
|
4394
4395
|
const L = h.select(W).append("g").attr("class", "bc-category-labels");
|
|
4395
4396
|
for (const p of R) {
|
|
4396
|
-
const x =
|
|
4397
|
+
const x = z(p) ?? 0;
|
|
4397
4398
|
L.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", x + kn / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(p);
|
|
4398
4399
|
}
|
|
4399
4400
|
}
|
|
@@ -4404,13 +4405,13 @@ function Li(t, a, e = {}, r = !1) {
|
|
|
4404
4405
|
const p = Z.find((M) => M.seriesName === L.seriesName);
|
|
4405
4406
|
if (!p)
|
|
4406
4407
|
return;
|
|
4407
|
-
const x = $t(L.seriesName, L.seriesIndex, u, v), y = L.xPos + L.barWidth,
|
|
4408
|
+
const x = $t(L.seriesName, L.seriesIndex, u, v), y = L.xPos + L.barWidth, D = Math.max(0, z.bandwidth() - H), K = (z(L.label) ?? 0) + H + D / 2, ot = At === St.Inside || At === St.Auto && L.barWidth > 30;
|
|
4408
4409
|
if (!oa({
|
|
4409
4410
|
text: String(L.value),
|
|
4410
4411
|
placement: ot ? "inside" : "outside",
|
|
4411
4412
|
orientation: "horizontal",
|
|
4412
4413
|
barWidth: L.barWidth,
|
|
4413
|
-
barHeight:
|
|
4414
|
+
barHeight: D
|
|
4414
4415
|
}))
|
|
4415
4416
|
return;
|
|
4416
4417
|
let N, mt, pt;
|
|
@@ -4423,8 +4424,8 @@ function Li(t, a, e = {}, r = !1) {
|
|
|
4423
4424
|
Tt.append("text").attr("class", "bc-value-label").attr("data-series", L.seriesName).attr("x", N).attr("y", K).attr("text-anchor", mt).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", pt).text(String(L.value));
|
|
4424
4425
|
}), b && f.length > 0) {
|
|
4425
4426
|
const L = f.map((y) => {
|
|
4426
|
-
const
|
|
4427
|
-
return $t(y,
|
|
4427
|
+
const D = d.findIndex((K) => K.name === y);
|
|
4428
|
+
return $t(y, D, u, v);
|
|
4428
4429
|
});
|
|
4429
4430
|
let p = 0, x = 0;
|
|
4430
4431
|
w === "top" ? x = -(_.height + 10 + Wa) : w === "bottom" ? x = V + 25 : w === "left" ? p = -(_.width + 10) : w === "right" && (p = F + 10), je(W, f, L, x, w, k, F, V, p, [], { left: ht.left, right: ht.right });
|
|
@@ -4463,14 +4464,14 @@ function ki(t, a, e = {}, r = !1) {
|
|
|
4463
4464
|
if (e.sortMode === "total") {
|
|
4464
4465
|
const p = a.labels.map((x, y) => ({
|
|
4465
4466
|
label: x,
|
|
4466
|
-
total: g.reduce((
|
|
4467
|
+
total: g.reduce((D, K) => D + (K.values[y] ?? 0), 0)
|
|
4467
4468
|
}));
|
|
4468
4469
|
p.sort((x, y) => y.total - x.total), R = p.map((x) => x.label);
|
|
4469
4470
|
}
|
|
4470
|
-
const
|
|
4471
|
+
const z = h.scaleBand().domain(R).range([0, V]).paddingInner(aa(e.barGap)).paddingOuter(0.05), H = C ? On : 0, J = Math.max(0, z.bandwidth() - H), Z = h.scaleBand().domain(f).range([0, J]).padding(0.05), at = h.max(g.flatMap((p) => p.values)) ?? 0, ut = h.scaleLinear().domain([0, at]).nice().range([0, F]);
|
|
4471
4472
|
o.attach(W, et), o.update({
|
|
4472
4473
|
vertical: {
|
|
4473
|
-
scale:
|
|
4474
|
+
scale: z,
|
|
4474
4475
|
height: V,
|
|
4475
4476
|
options: {
|
|
4476
4477
|
...e.verticalAxis,
|
|
@@ -4484,12 +4485,12 @@ function ki(t, a, e = {}, r = !1) {
|
|
|
4484
4485
|
const vt = W.ownerSVGElement, it = Ee(vt, t, "bars", { x: 0, y: 0, width: F, height: V }), ct = h.select(W).append("g").attr("clip-path", `url(#${it})`);
|
|
4485
4486
|
if (e.barBackground) {
|
|
4486
4487
|
const p = (e.colors ?? Mn)[0];
|
|
4487
|
-
ct.selectAll(".bc-bar-bg").data(R, (x) => x).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (x) => (
|
|
4488
|
+
ct.selectAll(".bc-bar-bg").data(R, (x) => x).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (x) => (z(x) ?? 0) + H).attr("width", F).attr("height", z.bandwidth() - H).attr("fill", p).attr("opacity", 0.18);
|
|
4488
4489
|
}
|
|
4489
4490
|
if (e.barSeparators && R.length > 1) {
|
|
4490
|
-
const p =
|
|
4491
|
+
const p = z.step();
|
|
4491
4492
|
for (let x = 1; x < R.length; x++) {
|
|
4492
|
-
const y = (
|
|
4493
|
+
const y = (z(R[x - 1]) ?? 0) + z.bandwidth() + (p - z.bandwidth()) / 2;
|
|
4493
4494
|
ct.append("line").attr("class", "bc-bar-separator").attr("x1", 0).attr("x2", F).attr("y1", y).attr("y2", y).attr("stroke", "currentColor").attr("opacity", 0.15);
|
|
4494
4495
|
}
|
|
4495
4496
|
}
|
|
@@ -4497,20 +4498,20 @@ function ki(t, a, e = {}, r = !1) {
|
|
|
4497
4498
|
for (const p of R) {
|
|
4498
4499
|
const x = a.labels.indexOf(p);
|
|
4499
4500
|
for (const y of g) {
|
|
4500
|
-
const
|
|
4501
|
+
const D = d.findIndex((K) => K.name === y.name);
|
|
4501
4502
|
bt.push({
|
|
4502
4503
|
label: p,
|
|
4503
4504
|
seriesName: y.name,
|
|
4504
|
-
seriesIndex:
|
|
4505
|
+
seriesIndex: D,
|
|
4505
4506
|
value: x >= 0 ? y.values[x] ?? 0 : 0
|
|
4506
4507
|
});
|
|
4507
4508
|
}
|
|
4508
4509
|
}
|
|
4509
|
-
const dt = Aa(e.highlights), yt = Re(e.colorizes),
|
|
4510
|
+
const dt = Aa(e.highlights), yt = Re(e.colorizes), B = Gt(t), q = ct.append("g").node();
|
|
4510
4511
|
if (r)
|
|
4511
4512
|
for (const p of n)
|
|
4512
4513
|
p.removeAttribute("opacity"), p.removeAttribute("fill-opacity"), q.appendChild(p);
|
|
4513
|
-
Ht(
|
|
4514
|
+
Ht(B, {
|
|
4514
4515
|
role: "mark-per-cell",
|
|
4515
4516
|
parent: q,
|
|
4516
4517
|
selector: ".bc-bar-grouped",
|
|
@@ -4518,19 +4519,19 @@ function ki(t, a, e = {}, r = !1) {
|
|
|
4518
4519
|
key: (p) => p.label + "\0" + p.seriesName,
|
|
4519
4520
|
insert: (p) => p.append("rect").attr("class", "bc-bar bc-bar-grouped"),
|
|
4520
4521
|
attrs: (p) => {
|
|
4521
|
-
const x = yt.get(p.seriesName) ?? $t(p.seriesName, p.seriesIndex, u, v), y = Ea(p.seriesName, v),
|
|
4522
|
+
const x = yt.get(p.seriesName) ?? $t(p.seriesName, p.seriesIndex, u, v), y = Ea(p.seriesName, v), D = {
|
|
4522
4523
|
"data-series": p.seriesName,
|
|
4523
4524
|
x: ut(0),
|
|
4524
|
-
y: (
|
|
4525
|
+
y: (z(p.label) ?? 0) + H + (Z(p.seriesName) ?? 0),
|
|
4525
4526
|
width: Math.max(0, ut(p.value) - ut(0)),
|
|
4526
4527
|
height: Z.bandwidth(),
|
|
4527
4528
|
fill: x
|
|
4528
4529
|
};
|
|
4529
|
-
return y < 1 && (
|
|
4530
|
+
return y < 1 && (D["fill-opacity"] = y), dt.size > 0 && (D.opacity = fe(dt, p.seriesName)), D;
|
|
4530
4531
|
}
|
|
4531
4532
|
});
|
|
4532
4533
|
const st = { left: ht.left, top: ht.top, width: F, height: V };
|
|
4533
|
-
Fe(
|
|
4534
|
+
Fe(B, {
|
|
4534
4535
|
svg: vt,
|
|
4535
4536
|
clipId: it,
|
|
4536
4537
|
group: W,
|
|
@@ -4548,10 +4549,10 @@ function ki(t, a, e = {}, r = !1) {
|
|
|
4548
4549
|
orientation: oe.Horizontal
|
|
4549
4550
|
}));
|
|
4550
4551
|
const ft = () => gt.draw(bt);
|
|
4551
|
-
if (
|
|
4552
|
+
if (B.state === "committing" ? B.register(ft) : ft(), Me(t, { chartType: "bar-grouped", margin: ht, plotRect: st }), l && (me(ct.node()), pe(t, l)), C) {
|
|
4552
4553
|
const p = h.select(W).append("g").attr("class", "bc-category-labels");
|
|
4553
4554
|
for (const x of R) {
|
|
4554
|
-
const y =
|
|
4555
|
+
const y = z(x) ?? 0;
|
|
4555
4556
|
p.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", y + On / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(x);
|
|
4556
4557
|
}
|
|
4557
4558
|
}
|
|
@@ -4559,7 +4560,7 @@ function ki(t, a, e = {}, r = !1) {
|
|
|
4559
4560
|
if (bt.forEach((p) => {
|
|
4560
4561
|
if (!wa(p.seriesName, At, v))
|
|
4561
4562
|
return;
|
|
4562
|
-
const x = $t(p.seriesName, p.seriesIndex, u, v), y = Math.max(0, ut(p.value) - ut(0)),
|
|
4563
|
+
const x = $t(p.seriesName, p.seriesIndex, u, v), y = Math.max(0, ut(p.value) - ut(0)), D = ut(0) + y, K = (z(p.label) ?? 0) + H + (Z(p.seriesName) ?? 0) + Z.bandwidth() / 2, ot = Tt === St.Inside || Tt === St.Auto && y > 30;
|
|
4563
4564
|
if (!oa({
|
|
4564
4565
|
text: String(p.value),
|
|
4565
4566
|
placement: ot ? "inside" : "outside",
|
|
@@ -4569,11 +4570,11 @@ function ki(t, a, e = {}, r = !1) {
|
|
|
4569
4570
|
}))
|
|
4570
4571
|
return;
|
|
4571
4572
|
let N, mt, pt;
|
|
4572
|
-
ot ? (N =
|
|
4573
|
+
ot ? (N = D - 4, mt = "end", pt = Ae(x)) : (N = D + 4, mt = "start", pt = "currentColor"), kt.append("text").attr("class", "bc-value-label").attr("data-series", p.seriesName).attr("x", N).attr("y", K).attr("text-anchor", mt).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", pt).text(String(p.value));
|
|
4573
4574
|
}), b && f.length > 0) {
|
|
4574
|
-
const p = f.map((
|
|
4575
|
-
const K = d.findIndex((ot) => ot.name ===
|
|
4576
|
-
return $t(
|
|
4575
|
+
const p = f.map((D) => {
|
|
4576
|
+
const K = d.findIndex((ot) => ot.name === D);
|
|
4577
|
+
return $t(D, K, u, v);
|
|
4577
4578
|
});
|
|
4578
4579
|
let x = 0, y = 0;
|
|
4579
4580
|
w === "top" ? y = -(_.height + 10) : w === "bottom" ? y = V + 25 : w === "left" ? x = -(_.width + 10) : w === "right" && (x = F + 10), je(W, f, p, y, w, k, F, V, x, [], { left: ht.left, right: ht.right });
|
|
@@ -4592,10 +4593,10 @@ function Cl(t) {
|
|
|
4592
4593
|
return ((a = jr.get(t)) == null ? void 0 : a.options) ?? [];
|
|
4593
4594
|
}
|
|
4594
4595
|
const Tn = [
|
|
4595
|
-
{ value:
|
|
4596
|
-
{ value:
|
|
4597
|
-
{ value:
|
|
4598
|
-
{ value:
|
|
4596
|
+
{ value: Bt.Solid, text: "Solid" },
|
|
4597
|
+
{ value: Bt.Dashed, text: "Dashed" },
|
|
4598
|
+
{ value: Bt.Dotted, text: "Dotted" },
|
|
4599
|
+
{ value: Bt.None, text: "None" }
|
|
4599
4600
|
], Qt = { key: "colors", type: Q.Colors, label: "Colors" }, te = {
|
|
4600
4601
|
key: "colorPalette",
|
|
4601
4602
|
type: Q.Select,
|
|
@@ -4620,11 +4621,11 @@ const Tn = [
|
|
|
4620
4621
|
key: "legendAnchor",
|
|
4621
4622
|
type: Q.Select,
|
|
4622
4623
|
label: "Legend anchor",
|
|
4623
|
-
default:
|
|
4624
|
+
default: Be.Start,
|
|
4624
4625
|
choices: [
|
|
4625
|
-
{ value:
|
|
4626
|
-
{ value:
|
|
4627
|
-
{ value:
|
|
4626
|
+
{ value: Be.Start, text: "Start" },
|
|
4627
|
+
{ value: Be.Middle, text: "Middle" },
|
|
4628
|
+
{ value: Be.End, text: "End" }
|
|
4628
4629
|
]
|
|
4629
4630
|
}, or = {
|
|
4630
4631
|
key: "directLabelling",
|
|
@@ -4641,11 +4642,11 @@ const Tn = [
|
|
|
4641
4642
|
key: "directLabelAnchor",
|
|
4642
4643
|
type: Q.Select,
|
|
4643
4644
|
label: "Label anchor",
|
|
4644
|
-
default:
|
|
4645
|
+
default: Be.Middle,
|
|
4645
4646
|
choices: [
|
|
4646
|
-
{ value:
|
|
4647
|
-
{ value:
|
|
4648
|
-
{ value:
|
|
4647
|
+
{ value: Be.Start, text: "Start" },
|
|
4648
|
+
{ value: Be.Middle, text: "Middle" },
|
|
4649
|
+
{ value: Be.End, text: "End" }
|
|
4649
4650
|
]
|
|
4650
4651
|
}, ir = { key: "valueLabels", type: Q.Boolean, label: "Value labels", default: !1 }, cr = {
|
|
4651
4652
|
key: "valueLabelPosition",
|
|
@@ -4657,7 +4658,7 @@ const Tn = [
|
|
|
4657
4658
|
{ value: St.Outside, text: "Outside" },
|
|
4658
4659
|
{ value: St.Inside, text: "Inside" }
|
|
4659
4660
|
]
|
|
4660
|
-
}, _e = { key: "tooltips", type: Q.Boolean, label: "Tooltips", default: !1 },
|
|
4661
|
+
}, _e = { key: "tooltips", type: Q.Boolean, label: "Tooltips", default: !1 }, Dl = { key: "crosshair", type: Q.Boolean, label: "Crosshair", default: !1 }, zl = {
|
|
4661
4662
|
key: "crosshairDirection",
|
|
4662
4663
|
type: Q.Select,
|
|
4663
4664
|
label: "Crosshair direction",
|
|
@@ -4671,11 +4672,11 @@ const Tn = [
|
|
|
4671
4672
|
key: "crosshairStyle",
|
|
4672
4673
|
type: Q.Select,
|
|
4673
4674
|
label: "Crosshair style",
|
|
4674
|
-
default:
|
|
4675
|
+
default: ze.Dashed,
|
|
4675
4676
|
choices: [
|
|
4676
|
-
{ value:
|
|
4677
|
-
{ value:
|
|
4678
|
-
{ value:
|
|
4677
|
+
{ value: ze.Solid, text: "Solid" },
|
|
4678
|
+
{ value: ze.Dashed, text: "Dashed" },
|
|
4679
|
+
{ value: ze.Dotted, text: "Dotted" }
|
|
4679
4680
|
]
|
|
4680
4681
|
}, Nl = { key: "crosshairColor", type: Q.Text, label: "Crosshair color", default: "#999", placeholder: "#999" }, El = { key: "lineSymbols", type: Q.Boolean, label: "Show line symbols", default: !1 }, Fl = {
|
|
4681
4682
|
key: "lineSymbolShape",
|
|
@@ -4711,7 +4712,7 @@ const Tn = [
|
|
|
4711
4712
|
{ value: Zt.Filled, text: "Filled" },
|
|
4712
4713
|
{ value: Zt.Hollow, text: "Hollow" }
|
|
4713
4714
|
]
|
|
4714
|
-
}, Rl = { key: "lineSymbolSize", type: Q.Text, label: "Size", default: "3.5", placeholder: "3.5" },
|
|
4715
|
+
}, Rl = { key: "lineSymbolSize", type: Q.Text, label: "Size", default: "3.5", placeholder: "3.5" }, Bl = { key: "lineSymbolOpacity", type: Q.Text, label: "Opacity", default: "1", placeholder: "1" }, Fa = {
|
|
4715
4716
|
key: "sortMode",
|
|
4716
4717
|
type: Q.Select,
|
|
4717
4718
|
label: "Sort mode",
|
|
@@ -4721,7 +4722,7 @@ const Tn = [
|
|
|
4721
4722
|
{ value: Je.Total, text: "By total" },
|
|
4722
4723
|
{ value: Je.WithinGroups, text: "Within groups" }
|
|
4723
4724
|
]
|
|
4724
|
-
}, dr = { key: "edgePadding", type: Q.Boolean, label: "Edge padding", default: !1 }, fr = { key: "waterfall", type: Q.Boolean, label: "Waterfall", default: !1 }, ur = { key: "waterfallTotal", type: Q.Boolean, label: "Waterfall total", default: !1 }, $a = { key: "barBackground", type: Q.Boolean, label: "Bar background", default: !1 }, hr = { key: "barGap", type: Q.Text, label: "Bar gap", default: String(Pr), placeholder: String(Pr) }, Ia = { key: "barSeparators", type: Q.Boolean, label: "Bar separators", default: !1 }, br = { key: "connectedColumns", type: Q.Boolean, label: "Connected columns", default: !1 }, mr = { key: "connectionsOpacity", type: Q.Text, label: "Opacity", default: "0.15", placeholder: "0.15" }, gr = { key: "swapLabelValue", type: Q.Boolean, label: "Swap labels and values", default: !1 },
|
|
4725
|
+
}, dr = { key: "edgePadding", type: Q.Boolean, label: "Edge padding", default: !1 }, fr = { key: "waterfall", type: Q.Boolean, label: "Waterfall", default: !1 }, ur = { key: "waterfallTotal", type: Q.Boolean, label: "Waterfall total", default: !1 }, $a = { key: "barBackground", type: Q.Boolean, label: "Bar background", default: !1 }, hr = { key: "barGap", type: Q.Text, label: "Bar gap", default: String(Pr), placeholder: String(Pr) }, Ia = { key: "barSeparators", type: Q.Boolean, label: "Bar separators", default: !1 }, br = { key: "connectedColumns", type: Q.Boolean, label: "Connected columns", default: !1 }, mr = { key: "connectionsOpacity", type: Q.Text, label: "Opacity", default: "0.15", placeholder: "0.15" }, gr = { key: "swapLabelValue", type: Q.Boolean, label: "Swap labels and values", default: !1 }, Yl = {
|
|
4725
4726
|
key: "stackMode",
|
|
4726
4727
|
type: Q.Select,
|
|
4727
4728
|
label: "Stack mode",
|
|
@@ -4730,7 +4731,7 @@ const Tn = [
|
|
|
4730
4731
|
{ value: Qe.Normal, text: "Normal" },
|
|
4731
4732
|
{ value: Qe.Percent, text: "Percentage (100%)" }
|
|
4732
4733
|
]
|
|
4733
|
-
}, Oi = { key: "sharedScale", type: Q.Boolean, label: "Shared scale", default: !1 }, ca = { key: "categoryLabelLine", type: Q.Boolean, label: "Labels on separate line", default: !1 }, Hl = { key: "displayAsPercentage", type: Q.Boolean, label: "Display as percentage", default: !1 }, Gl = { key: "showTotal", type: Q.Boolean, label: "Show total", default: !1 }, _l = { key: "showLabels", type: Q.Boolean, label: "Show labels", default: !0 }, Vl = { key: "showValues", type: Q.Boolean, label: "Show values", default: !0 }, Wl = { key: "sliceMax", type: Q.Text, label: "Max slices", default: "6" }, ql = { key: "sliceGroupLabel", type: Q.Text, label: "Group label", default: "Others", placeholder: "Others" }, Ti = { key: "areaFillOpacity", type: Q.Text, label: "Opacity", default: "0.85", placeholder: "0.85" }, Ci = { key: "stacked", type: Q.Boolean, label: "Stack areas", default: !0 },
|
|
4734
|
+
}, Oi = { key: "sharedScale", type: Q.Boolean, label: "Shared scale", default: !1 }, ca = { key: "categoryLabelLine", type: Q.Boolean, label: "Labels on separate line", default: !1 }, Hl = { key: "displayAsPercentage", type: Q.Boolean, label: "Display as percentage", default: !1 }, Gl = { key: "showTotal", type: Q.Boolean, label: "Show total", default: !1 }, _l = { key: "showLabels", type: Q.Boolean, label: "Show labels", default: !0 }, Vl = { key: "showValues", type: Q.Boolean, label: "Show values", default: !0 }, Wl = { key: "sliceMax", type: Q.Text, label: "Max slices", default: "6" }, ql = { key: "sliceGroupLabel", type: Q.Text, label: "Group label", default: "Others", placeholder: "Others" }, Ti = { key: "areaFillOpacity", type: Q.Text, label: "Opacity", default: "0.85", placeholder: "0.85" }, Ci = { key: "stacked", type: Q.Boolean, label: "Stack areas", default: !0 }, Di = { key: "stackPercent", type: Q.Boolean, label: "Stack to 100%", default: !1 }, zi = { key: "areaLines", type: Q.Boolean, label: "Separate areas with lines", default: !0 }, Pi = {
|
|
4734
4735
|
key: "areaSortMode",
|
|
4735
4736
|
type: Q.Select,
|
|
4736
4737
|
label: "Sort areas",
|
|
@@ -4758,7 +4759,7 @@ const Tn = [
|
|
|
4758
4759
|
}, Cn = [
|
|
4759
4760
|
{ value: pa.Linear, text: "Linear" },
|
|
4760
4761
|
{ value: pa.Log, text: "Logarithmic" }
|
|
4761
|
-
],
|
|
4762
|
+
], Dn = [
|
|
4762
4763
|
{ value: Pt.Auto, text: "Auto" },
|
|
4763
4764
|
{ value: Pt.Inside, text: "Inside" },
|
|
4764
4765
|
{ value: Pt.Outside, text: "Outside" },
|
|
@@ -4771,9 +4772,9 @@ const Tn = [
|
|
|
4771
4772
|
function Ra(t) {
|
|
4772
4773
|
return [
|
|
4773
4774
|
{ key: "showVerticalAxis", type: Q.Boolean, label: "Show vertical axis", default: t.showVerticalAxis ?? !0 },
|
|
4774
|
-
{ key: "verticalAxisDirection", type: Q.Select, label: "Vertical axis side", default:
|
|
4775
|
+
{ key: "verticalAxisDirection", type: Q.Select, label: "Vertical axis side", default: De.Left, choices: [{ value: De.Left, text: "Left" }, { value: De.Right, text: "Right" }] },
|
|
4775
4776
|
{ key: "showVerticalTicks", type: Q.Boolean, label: "Show vertical ticks", default: t.showVerticalTicks },
|
|
4776
|
-
{ key: "verticalLabelPosition", type: Q.Select, label: "Vertical labels", default: t.valueAxisLabelsOff && t.valueAxis === "vertical" ? Pt.Off : Pt.Auto, choices:
|
|
4777
|
+
{ key: "verticalLabelPosition", type: Q.Select, label: "Vertical labels", default: t.valueAxisLabelsOff && t.valueAxis === "vertical" ? Pt.Off : Pt.Auto, choices: Dn },
|
|
4777
4778
|
{ key: "verticalGridStyle", type: Q.Select, label: "Vertical grid style", default: t.verticalGrid, choices: Tn },
|
|
4778
4779
|
{ key: "verticalNumberFormat", type: Q.NumberFormat, label: "Vertical number format" },
|
|
4779
4780
|
...t.valueAxis === "vertical" ? [
|
|
@@ -4783,7 +4784,7 @@ function Ra(t) {
|
|
|
4783
4784
|
] : [],
|
|
4784
4785
|
{ key: "showHorizontalAxis", type: Q.Boolean, label: "Show horizontal axis", default: t.showHorizontalAxis ?? !0 },
|
|
4785
4786
|
{ key: "showHorizontalTicks", type: Q.Boolean, label: "Show horizontal ticks", default: t.showHorizontalTicks },
|
|
4786
|
-
{ key: "horizontalLabelPosition", type: Q.Select, label: "Horizontal labels", default: t.valueAxisLabelsOff && t.valueAxis === "horizontal" ? Pt.Off : Pt.Auto, choices:
|
|
4787
|
+
{ key: "horizontalLabelPosition", type: Q.Select, label: "Horizontal labels", default: t.valueAxisLabelsOff && t.valueAxis === "horizontal" ? Pt.Off : Pt.Auto, choices: Dn },
|
|
4787
4788
|
{ key: "horizontalLabelRotation", type: Q.Select, label: "Horizontal label rotation", default: Ta.Horizontal, choices: Ei },
|
|
4788
4789
|
{ key: "horizontalGridStyle", type: Q.Select, label: "Horizontal grid style", default: t.horizontalGrid, choices: Tn },
|
|
4789
4790
|
{ key: "horizontalNumberFormat", type: Q.NumberFormat, label: "Horizontal number format" },
|
|
@@ -4798,23 +4799,23 @@ function Ra(t) {
|
|
|
4798
4799
|
] : []
|
|
4799
4800
|
];
|
|
4800
4801
|
}
|
|
4801
|
-
const pr = Ra({ verticalGrid:
|
|
4802
|
+
const pr = Ra({ verticalGrid: Bt.None, horizontalGrid: Bt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", valueAxisZeroBaseline: !0, valueAxisLabelsOff: !0 }), Ba = Ra({ verticalGrid: Bt.None, horizontalGrid: Bt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showHorizontalAxis: !1, valueAxis: "horizontal", valueAxisZeroBaseline: !0, valueAxisLabelsOff: !0 }), Xl = Ra({ verticalGrid: Bt.Dashed, horizontalGrid: Bt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0 }), Fi = Ra({ verticalGrid: Bt.Dashed, horizontalGrid: Bt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0, valueAxisZeroBaseline: !0 }), yr = { ...Ni, default: Ce.MonotoneX }, $i = { ...zl, default: Wt.Vertical }, Ii = { ...Dl, default: !0 }, Ri = { ...El, default: !0 }, Ul = { ...Fa, default: Je.Total }, Kr = { ...ir, default: !0 }, Bi = { ...ir, default: !0 }, Yi = { ...Hl, default: !0 }, Hi = { ...Wl, default: "5" }, Gi = { ...Gl, default: !0 }, xr = { ...or, default: qt.Auto }, vr = { ...Sa, default: !1 }, Ar = [Dl, zl, Pl, Nl], Jr = [Ii, $i, Pl, Nl], wr = [Bi, cr, _e, ...Ar], Qr = [Kr, cr, _e, ...Ar], _i = [El, Fl, $l, Il, Rl, Bl], Vi = [Ri, Fl, $l, Il, Rl, Bl], jl = [ir, _e, ...Jr, ..._i], Wi = [ir, _e, ...Jr, ...Vi], qi = [Yi, Gl, _l, Vl, Hi, ql], Xi = [Hl, Gi, _l, Vl, Wl, ql];
|
|
4802
4803
|
Jt(Xt.BarVertical, pl, [Qt, te, ee, ae, gr, $a, Ia, hr, br, mr, fr, ur, ca, ...pr, ...wr]);
|
|
4803
|
-
Jt(Xt.BarHorizontal, yl, [Qt, te, ee, ae, gr, $a, Ia, hr, br, mr, fr, ur, ca, ...
|
|
4804
|
+
Jt(Xt.BarHorizontal, yl, [Qt, te, ee, ae, gr, $a, Ia, hr, br, mr, fr, ur, ca, ...Ba, ...Qr]);
|
|
4804
4805
|
Jt(Xt.BarMulti, Wo, [Qt, te, ee, ae, Ul, vr, Ge, He, xr, Zr, ...pr, ...wr]);
|
|
4805
4806
|
Jt(Xt.Line, Qo, [Qt, te, ee, ae, yr, dr, ...Xl, ...jl]);
|
|
4806
4807
|
Jt(Xt.LineMulti, ri, [Qt, te, ee, ae, yr, dr, Fa, vr, Ge, He, xr, ...Xl, ...Wi]);
|
|
4807
4808
|
Jt(Xt.Donut, ci, [Qt, te, ee, ae, vr, Ge, He, xr, _e, ...Xi]);
|
|
4808
4809
|
Jt(Xt.Pie, di, [Qt, te, ee, ae, vr, Ge, He, xr, _e, ...qi]);
|
|
4809
4810
|
Jt(Xt.Area, ui, [Qt, te, ee, ae, yr, dr, ...Fi, ...jl]);
|
|
4810
|
-
const Ui = Ra({ verticalGrid:
|
|
4811
|
-
Jt(Xt.AreaStacked, bi, [Qt, te, ee, ae, Ti, yr, dr, Pi, Ci,
|
|
4812
|
-
Jt(Xt.ColumnStacked, pi, [Qt, te, ee, ae,
|
|
4813
|
-
Jt(Xt.BarStacked, vi, [Qt, te, ee, ae,
|
|
4814
|
-
Jt(Xt.BarSplit, Li, [Qt, te, ee, ae, Oi, Fa, Sa, Ge, He, ca, ...
|
|
4815
|
-
Jt(Xt.BarGrouped, ki, [Qt, te, ee, ae, Ul, Sa, Ge, He, $a, Ia, ca, ...
|
|
4811
|
+
const Ui = Ra({ verticalGrid: Bt.Dashed, horizontalGrid: Bt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0, valueAxisZeroBaseline: !0 });
|
|
4812
|
+
Jt(Xt.AreaStacked, bi, [Qt, te, ee, ae, Ti, yr, dr, Pi, Ci, Di, zi, Sa, Ge, He, or, ...Ui, _e, ...Jr]);
|
|
4813
|
+
Jt(Xt.ColumnStacked, pi, [Qt, te, ee, ae, Yl, Fa, Sa, Ge, He, or, Zr, ...pr, ...wr]);
|
|
4814
|
+
Jt(Xt.BarStacked, vi, [Qt, te, ee, ae, Yl, Fa, Sa, Ge, He, or, Zr, ca, ...Ba, ...Qr]);
|
|
4815
|
+
Jt(Xt.BarSplit, Li, [Qt, te, ee, ae, Oi, Fa, Sa, Ge, He, ca, ...Ba, Kr, cr, _e, ...Ar]);
|
|
4816
|
+
Jt(Xt.BarGrouped, ki, [Qt, te, ee, ae, Ul, Sa, Ge, He, $a, Ia, ca, ...Ba, Kr, cr, _e, ...Ar]);
|
|
4816
4817
|
Jt(Xt.VerticalBar, pl, [Qt, te, ee, ae, gr, $a, Ia, hr, br, mr, fr, ur, ca, ...pr, ...wr]);
|
|
4817
|
-
Jt(Xt.HorizontalBar, yl, [Qt, te, ee, ae, gr, $a, Ia, hr, br, mr, fr, ur, ca, ...
|
|
4818
|
+
Jt(Xt.HorizontalBar, yl, [Qt, te, ee, ae, gr, $a, Ia, hr, br, mr, fr, ur, ca, ...Ba, ...Qr]);
|
|
4818
4819
|
function La(t) {
|
|
4819
4820
|
return new Map(t.map((a) => [a.key, a.value]));
|
|
4820
4821
|
}
|
|
@@ -4842,7 +4843,7 @@ function Zi(t) {
|
|
|
4842
4843
|
}).join(`
|
|
4843
4844
|
`);
|
|
4844
4845
|
}
|
|
4845
|
-
function
|
|
4846
|
+
function zn(t, a) {
|
|
4846
4847
|
const e = t.find((r) => r.key === a);
|
|
4847
4848
|
return e ? String(e.value) : void 0;
|
|
4848
4849
|
}
|
|
@@ -4860,8 +4861,8 @@ const Ve = (t) => t === "true" || t === !0;
|
|
|
4860
4861
|
function Ki(t) {
|
|
4861
4862
|
return t.map((a) => ({
|
|
4862
4863
|
target: a.target,
|
|
4863
|
-
color:
|
|
4864
|
-
label:
|
|
4864
|
+
color: zn(a.properties, "color") ?? "#e15759",
|
|
4865
|
+
label: zn(a.properties, "label")
|
|
4865
4866
|
}));
|
|
4866
4867
|
}
|
|
4867
4868
|
function Ji(t) {
|
|
@@ -4995,7 +4996,7 @@ function sc(t) {
|
|
|
4995
4996
|
return {};
|
|
4996
4997
|
const e = {};
|
|
4997
4998
|
t.showVerticalTicks !== void 0 && (e.showTicks = t.showVerticalTicks), t.verticalAxisDirection !== void 0 && (e.direction = t.verticalAxisDirection), t.verticalGridStyle !== void 0 && (e.gridStyle = t.verticalGridStyle), t.verticalNumberFormat !== void 0 && (e.numberFormat = t.verticalNumberFormat), t.showVerticalAxis !== void 0 && (e.showAxis = t.showVerticalAxis), t.verticalScaleType !== void 0 && (e.scaleType = t.verticalScaleType), t.verticalLabelPosition !== void 0 && (e.labelPosition = t.verticalLabelPosition);
|
|
4998
|
-
const r =
|
|
4999
|
+
const r = Da(t.verticalRangeMin ?? ""), n = Da(t.verticalRangeMax ?? "");
|
|
4999
5000
|
return (r !== void 0 || n !== void 0) && (e.range = {}, r !== void 0 && (e.range.min = r), n !== void 0 && (e.range.max = n)), { verticalAxis: e };
|
|
5000
5001
|
}
|
|
5001
5002
|
function oc(t) {
|
|
@@ -5003,7 +5004,7 @@ function oc(t) {
|
|
|
5003
5004
|
return {};
|
|
5004
5005
|
const e = {};
|
|
5005
5006
|
t.showHorizontalTicks !== void 0 && (e.showTicks = t.showHorizontalTicks), t.horizontalGridStyle !== void 0 && (e.gridStyle = t.horizontalGridStyle), t.horizontalNumberFormat !== void 0 && (e.numberFormat = t.horizontalNumberFormat), t.showHorizontalAxis !== void 0 && (e.showAxis = t.showHorizontalAxis), t.horizontalScaleType !== void 0 && (e.scaleType = t.horizontalScaleType), t.horizontalLabelPosition !== void 0 && (e.labelPosition = t.horizontalLabelPosition), t.horizontalLabelRotation !== void 0 && (e.labelRotation = t.horizontalLabelRotation);
|
|
5006
|
-
const r =
|
|
5007
|
+
const r = Da(t.horizontalRangeMin ?? ""), n = Da(t.horizontalRangeMax ?? "");
|
|
5007
5008
|
return (r !== void 0 || n !== void 0) && (e.range = {}, r !== void 0 && (e.range.min = r), n !== void 0 && (e.range.max = n)), { horizontalAxis: e };
|
|
5008
5009
|
}
|
|
5009
5010
|
function ic(t) {
|
|
@@ -5253,24 +5254,24 @@ const Jl = Qa(Xn(qn(import.meta.url)), "fonts");
|
|
|
5253
5254
|
Wn.registerFromPath(Qa(Jl, "DejaVuSans.ttf"), "sans-serif");
|
|
5254
5255
|
Wn.registerFromPath(Qa(Jl, "DejaVuSans-Bold.ttf"), "sans-serif");
|
|
5255
5256
|
const Sc = rs(1, 1), Rn = Sc.getContext("2d");
|
|
5256
|
-
function
|
|
5257
|
+
function Dr(t, a, e, r) {
|
|
5257
5258
|
return Rn.font = `${r} ${a}px ${e}`, Rn.measureText(t);
|
|
5258
5259
|
}
|
|
5259
|
-
function
|
|
5260
|
+
function zr(t) {
|
|
5260
5261
|
const a = parseFloat(t.getAttribute("font-size") ?? "12") || 12, e = t.getAttribute("font-family") ?? "sans-serif", r = t.getAttribute("font-weight") ?? "normal";
|
|
5261
5262
|
return { fontSize: a, fontFamily: e, fontWeight: r };
|
|
5262
5263
|
}
|
|
5263
5264
|
function Lc(t) {
|
|
5264
5265
|
var s, o, c;
|
|
5265
5266
|
const a = (s = t.SVGElement) == null ? void 0 : s.prototype, e = function() {
|
|
5266
|
-
const { fontSize: d, fontFamily: g, fontWeight: f } =
|
|
5267
|
-
return
|
|
5267
|
+
const { fontSize: d, fontFamily: g, fontWeight: f } = zr(this);
|
|
5268
|
+
return Dr(this.textContent ?? "", d, g, f).width;
|
|
5268
5269
|
}, r = function(d, g) {
|
|
5269
|
-
const f = (this.textContent ?? "").substring(d, d + g), { fontSize: u, fontFamily: v, fontWeight: b } =
|
|
5270
|
-
return
|
|
5270
|
+
const f = (this.textContent ?? "").substring(d, d + g), { fontSize: u, fontFamily: v, fontWeight: b } = zr(this);
|
|
5271
|
+
return Dr(f, u, v, b).width;
|
|
5271
5272
|
}, n = function() {
|
|
5272
5273
|
if (this.tagName === "text") {
|
|
5273
|
-
const { fontSize: v, fontFamily: b, fontWeight: m } =
|
|
5274
|
+
const { fontSize: v, fontFamily: b, fontWeight: m } = zr(this), S = Dr(this.textContent ?? "", v, b, m);
|
|
5274
5275
|
return { x: 0, y: -v, width: S.width, height: v };
|
|
5275
5276
|
}
|
|
5276
5277
|
const d = parseFloat(this.getAttribute("x") ?? "0") || 0, g = parseFloat(this.getAttribute("y") ?? "0") || 0, f = parseFloat(this.getAttribute("width") ?? "0") || 0, u = parseFloat(this.getAttribute("height") ?? "0") || 0;
|
|
@@ -5294,11 +5295,11 @@ async function Mc(t, a = {}) {
|
|
|
5294
5295
|
}).render();
|
|
5295
5296
|
return Buffer.from(n.asPng());
|
|
5296
5297
|
}
|
|
5297
|
-
const
|
|
5298
|
-
function
|
|
5298
|
+
const Bn = ["window", "document", "Element", "getComputedStyle", "requestAnimationFrame"], Ma = /* @__PURE__ */ new WeakMap();
|
|
5299
|
+
function Yn(t) {
|
|
5299
5300
|
return t.includes('xmlns="http://www.w3.org/2000/svg"') ? t : t.replace(/^<svg(?=\s|>)/, '<svg xmlns="http://www.w3.org/2000/svg"');
|
|
5300
5301
|
}
|
|
5301
|
-
function
|
|
5302
|
+
function Bc() {
|
|
5302
5303
|
return {
|
|
5303
5304
|
kind: "node",
|
|
5304
5305
|
createContainer(t, a) {
|
|
@@ -5324,7 +5325,7 @@ function Yc() {
|
|
|
5324
5325
|
throw new Error("node-backend: container was not created by this backend");
|
|
5325
5326
|
Lc(r.window);
|
|
5326
5327
|
const n = r.window, l = globalThis, i = {};
|
|
5327
|
-
for (const s of
|
|
5328
|
+
for (const s of Bn)
|
|
5328
5329
|
i[s] = l[s], l[s] = n[s];
|
|
5329
5330
|
try {
|
|
5330
5331
|
vc(t, a, {
|
|
@@ -5334,7 +5335,7 @@ function Yc() {
|
|
|
5334
5335
|
theme: e.theme
|
|
5335
5336
|
});
|
|
5336
5337
|
} finally {
|
|
5337
|
-
for (const s of
|
|
5338
|
+
for (const s of Bn)
|
|
5338
5339
|
l[s] = i[s];
|
|
5339
5340
|
}
|
|
5340
5341
|
},
|
|
@@ -5343,7 +5344,7 @@ function Yc() {
|
|
|
5343
5344
|
const a = Ma.get(t), e = a ? a.serializeSvg() : ((r = t.querySelector("svg")) == null ? void 0 : r.outerHTML) ?? "";
|
|
5344
5345
|
if (!e)
|
|
5345
5346
|
throw new Error("node-backend: renderToContainer produced no SVG");
|
|
5346
|
-
return
|
|
5347
|
+
return Yn(e);
|
|
5347
5348
|
},
|
|
5348
5349
|
serializeFrame(t) {
|
|
5349
5350
|
var n, l;
|
|
@@ -5362,7 +5363,7 @@ function Yc() {
|
|
|
5362
5363
|
},
|
|
5363
5364
|
async rasterizePng(t, a) {
|
|
5364
5365
|
try {
|
|
5365
|
-
const e = await Mc(
|
|
5366
|
+
const e = await Mc(Yn(t), a);
|
|
5366
5367
|
return new Uint8Array(e);
|
|
5367
5368
|
} catch (e) {
|
|
5368
5369
|
throw new rn(
|
|
@@ -5373,5 +5374,5 @@ function Yc() {
|
|
|
5373
5374
|
};
|
|
5374
5375
|
}
|
|
5375
5376
|
export {
|
|
5376
|
-
|
|
5377
|
+
Bc as createNodeBackend
|
|
5377
5378
|
};
|