@blueprint-chart/lib 0.1.16 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +878 -862
- package/dist/recommendations/recommend.d.ts +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ var il = (t, a, e) => a in t ? sl(t, a, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var Ut = (t, a, e) => il(t, typeof a != "symbol" ? a + "" : a, e);
|
|
4
4
|
import * as p from "d3";
|
|
5
5
|
import "d3-transition";
|
|
6
|
-
import { D3Blueprint as
|
|
6
|
+
import { D3Blueprint as ct } from "d3-blueprint";
|
|
7
7
|
import Na from "dayjs";
|
|
8
|
-
import { computePosition as Ns, offset as
|
|
9
|
-
import
|
|
10
|
-
var
|
|
11
|
-
class dl extends
|
|
8
|
+
import { computePosition as Ns, offset as Bs, flip as Is, shift as Vs } from "@floating-ui/dom";
|
|
9
|
+
import Ge from "chroma-js";
|
|
10
|
+
var _e = /* @__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))(_e || {}), zt = /* @__PURE__ */ ((t) => (t.Left = "left", t.Right = "right", t))(zt || {}), Ba = /* @__PURE__ */ ((t) => (t.Linear = "linear", t.Log = "log", t))(Ba || {}), tt = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t.None = "none", t))(tt || {}), He = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Inside = "inside", t.Outside = "outside", t.Off = "off", t))(He || {}), Ua = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(Ua || {}), ol = /* @__PURE__ */ ((t) => (t.Above = "above", t.Below = "below", t))(ol || {}), ll = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Standard = "standard", t.AspectRatio = "aspect-ratio", t))(ll || {}), et = /* @__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))(et || {}), gt = /* @__PURE__ */ ((t) => (t.Direct = "direct", t.CurveLeft = "curve-left", t.CurveRight = "curve-right", t.Elbow = "elbow", t))(gt || {}), yr = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dotted = "dotted", t.Dashed = "dashed", t))(yr || {}), Ze = /* @__PURE__ */ ((t) => (t.Point = "point", t.Range = "range", t.Free = "free", t))(Ze || {}), _s = /* @__PURE__ */ ((t) => (t.Hide = "hide", t.Show = "show", t))(_s || {}), Gs = /* @__PURE__ */ ((t) => (t.Start = "start", t.Center = "center", t.End = "end", t))(Gs || {}), st = /* @__PURE__ */ ((t) => (t.Vertical = "vertical", t.Horizontal = "horizontal", t))(st || {}), Tt = /* @__PURE__ */ ((t) => (t.Circle = "circle", t.Square = "square", t.Diamond = "diamond", t.Triangle = "triangle", t.TriangleDown = "triangleDown", t.Cross = "cross", t.Star = "star", t))(Tt || {}), Dt = /* @__PURE__ */ ((t) => (t.All = "all", t.First = "first", t.Last = "last", t.FirstLast = "firstLast", t))(Dt || {}), yt = /* @__PURE__ */ ((t) => (t.Filled = "filled", t.Hollow = "hollow", t))(yt || {}), lt = /* @__PURE__ */ ((t) => (t.Ascending = "ascending", t.Descending = "descending", t.None = "none", t))(lt || {}), Zt = /* @__PURE__ */ ((t) => (t.Total = "total", t.WithinGroups = "within-groups", t.None = "none", t))(Zt || {}), Ea = /* @__PURE__ */ ((t) => (t.Top = "top", t.Bottom = "bottom", t.Left = "left", t.Right = "right", t))(Ea || {}), sa = /* @__PURE__ */ ((t) => (t.Start = "start", t.Middle = "middle", t.End = "end", t))(sa || {}), ze = /* @__PURE__ */ ((t) => (t.Inside = "inside", t.Outside = "outside", t.Auto = "auto", t))(ze || {}), pt = /* @__PURE__ */ ((t) => (t.Both = "both", t.Vertical = "vertical", t.Horizontal = "horizontal", t))(pt || {}), Qt = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t))(Qt || {}), va = /* @__PURE__ */ ((t) => (t.Normal = "normal", t.Percent = "percent", t))(va || {}), cl = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t.None = "none", t))(cl || {}), de = /* @__PURE__ */ ((t) => (t.Colors = "colors", t.Boolean = "boolean", t.Select = "select", t.Text = "text", t.NumberFormat = "numberFormat", t.DateFormat = "dateFormat", t))(de || {}), bt = /* @__PURE__ */ ((t) => (t.Off = "", t.Auto = "auto", t.Outside = "outside", t.Inside = "inside", t))(bt || {}), jt = /* @__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))(jt || {}), fl = /* @__PURE__ */ ((t) => (t.Property = "property", t.Data = "data", t.Colorize = "colorize", t.Highlight = "highlight", t.AreaFill = "areafill", t.Annotation = "annotation", t.Series = "series", t.AnnotationVisibility = "annotation-visibility", t.Scene = "scene", t.Transform = "transform", t.Chart = "chart", t))(fl || {});
|
|
11
|
+
class dl extends ct {
|
|
12
12
|
initialize() {
|
|
13
13
|
const a = this.base.append("div").attr("class", "bc-frame"), e = a.append("div").attr("class", "bc-frame-header");
|
|
14
14
|
a.append("div").attr("class", "bc-frame-body"), a.append("p").attr("class", "bc-frame-note");
|
|
@@ -187,10 +187,10 @@ const ml = {
|
|
|
187
187
|
right: 20,
|
|
188
188
|
bottom: 24,
|
|
189
189
|
left: 50
|
|
190
|
-
},
|
|
191
|
-
class yl extends
|
|
190
|
+
}, Hs = 600, Ys = 400;
|
|
191
|
+
class yl extends ct {
|
|
192
192
|
initialize() {
|
|
193
|
-
this.configDefine("totalWidth", { defaultValue:
|
|
193
|
+
this.configDefine("totalWidth", { defaultValue: Hs }), this.configDefine("totalHeight", { defaultValue: Ys }), this.layer("svg", this.base, {
|
|
194
194
|
dataBind: (a, e) => a.selectAll("svg").data(e),
|
|
195
195
|
insert: (a) => a.append("svg"),
|
|
196
196
|
events: {
|
|
@@ -258,7 +258,7 @@ function Gt(t, a) {
|
|
|
258
258
|
const b = parseFloat(t.dataset.headerH || "0"), m = parseFloat(t.dataset.footerH || "0"), v = e.top;
|
|
259
259
|
e.top = b + v, e.bottom += m, e.stableTop = v;
|
|
260
260
|
}
|
|
261
|
-
const n = $t(t), s = n.width > 0 ? n.width :
|
|
261
|
+
const n = $t(t), s = n.width > 0 ? n.width : Hs, o = n.height > 0 ? n.height : Ys, i = s - e.left - e.right, c = o - e.top - e.bottom, f = new yl(p.select(t));
|
|
262
262
|
f.config({ totalWidth: s, totalHeight: o }), f.draw([e]);
|
|
263
263
|
const d = t.querySelector("svg"), g = d.querySelector("g");
|
|
264
264
|
return r && (d.setAttribute("viewBox", `0 0 ${s} ${o}`), d.setAttribute("preserveAspectRatio", "none"), d.removeAttribute("width"), d.removeAttribute("height"), d.style.width = "100%", d.style.height = "100%", d.style.display = "block"), { svg: d, chartArea: g, width: i, height: c, margin: e };
|
|
@@ -266,13 +266,13 @@ function Gt(t, a) {
|
|
|
266
266
|
function Sa(t) {
|
|
267
267
|
return typeof window > "u" || typeof window.matchMedia != "function" ? t : window.matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : t;
|
|
268
268
|
}
|
|
269
|
-
const
|
|
270
|
-
let
|
|
271
|
-
function
|
|
272
|
-
|
|
269
|
+
const Ia = 500;
|
|
270
|
+
let Rs = 0;
|
|
271
|
+
function Ht(t) {
|
|
272
|
+
Rs = t ? Ia : 0;
|
|
273
273
|
}
|
|
274
274
|
function Ee() {
|
|
275
|
-
return Sa(
|
|
275
|
+
return Sa(Rs);
|
|
276
276
|
}
|
|
277
277
|
function vt(t, a, e, r) {
|
|
278
278
|
if (a.length === 0)
|
|
@@ -300,11 +300,11 @@ function vt(t, a, e, r) {
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
function Nt(t, a) {
|
|
303
|
-
const e = Sa(a ??
|
|
303
|
+
const e = Sa(a ?? Ia);
|
|
304
304
|
e <= 0 || typeof t.animate != "function" || t.animate([{ opacity: 0 }, { opacity: 1 }], { duration: e, easing: "ease-in-out" });
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
const e = Sa(a ??
|
|
306
|
+
function Bt(t, a) {
|
|
307
|
+
const e = Sa(a ?? Ia);
|
|
308
308
|
if (t.querySelectorAll("[data-bc-fade-overlay]").forEach((n) => {
|
|
309
309
|
typeof n.getAnimations == "function" && n.getAnimations().forEach((s) => s.cancel()), n.remove();
|
|
310
310
|
}), e <= 0 || t.children.length === 0)
|
|
@@ -322,8 +322,8 @@ function It(t, a) {
|
|
|
322
322
|
n.classList.remove("bc-frame"), n.classList.add("bc-frame--fade-snapshot");
|
|
323
323
|
}), r;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
const r = Sa(e ??
|
|
325
|
+
function It(t, a, e) {
|
|
326
|
+
const r = Sa(e ?? Ia);
|
|
327
327
|
if (getComputedStyle(t).position === "static" && (t.style.position = "relative"), t.appendChild(a), r > 0 && typeof a.animate == "function") {
|
|
328
328
|
const s = a.animate(
|
|
329
329
|
[{ opacity: 1 }, { opacity: 0 }],
|
|
@@ -334,9 +334,9 @@ function Bt(t, a, e) {
|
|
|
334
334
|
a.remove();
|
|
335
335
|
}
|
|
336
336
|
const is = 30;
|
|
337
|
-
class Ws extends
|
|
337
|
+
class Ws extends ct {
|
|
338
338
|
initialize() {
|
|
339
|
-
this.configDefine("scale", { defaultValue: p.scaleLinear() }), this.configDefine("direction", { defaultValue: zt.Left }), this.configDefine("showAxis", { defaultValue: !0 }), this.configDefine("showTicks", { defaultValue: !1 }), this.configDefine("gridStyle", { defaultValue:
|
|
339
|
+
this.configDefine("scale", { defaultValue: p.scaleLinear() }), this.configDefine("direction", { defaultValue: zt.Left }), this.configDefine("showAxis", { defaultValue: !0 }), this.configDefine("showTicks", { defaultValue: !1 }), this.configDefine("gridStyle", { defaultValue: tt.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: He.Auto }), this.configDefine("topPadding", { defaultValue: 0 }), this.configDefine("tickFormat", { defaultValue: null });
|
|
340
340
|
const a = this.base.append("g");
|
|
341
341
|
this.layer("axis", a, {
|
|
342
342
|
dataBind: (e, r) => e.selectAll(".bc-axis-vertical").data(r),
|
|
@@ -363,11 +363,11 @@ class Ws extends lt {
|
|
|
363
363
|
const m = Ee(), v = e.node();
|
|
364
364
|
if (v) {
|
|
365
365
|
m > 0 ? e.duration(m).call(d) : p.select(v).call(d), s || p.select(v).select(".domain").remove(), o || p.select(v).selectAll(".tick line").attr("opacity", 0);
|
|
366
|
-
const x = i ===
|
|
367
|
-
if (x ===
|
|
366
|
+
const x = i === He.Auto ? c > 0 && c < 400 ? He.Inside : He.Outside : i;
|
|
367
|
+
if (x === He.Inside) {
|
|
368
368
|
const A = s ? 4 : 0, w = m > 0 ? e.selectAll(".tick text") : p.select(v).selectAll(".tick text");
|
|
369
369
|
n === zt.Right ? w.attr("x", -A).attr("dy", "-0.4em").attr("text-anchor", "end") : w.attr("x", A).attr("dy", "-0.4em").attr("text-anchor", "start");
|
|
370
|
-
} else x ===
|
|
370
|
+
} else x === He.Off && p.select(v).selectAll(".tick text").attr("opacity", 0);
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
373
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -395,8 +395,8 @@ class Ws extends lt {
|
|
|
395
395
|
e.call(f);
|
|
396
396
|
const b = this.config("showAxis"), m = this.config("showTicks");
|
|
397
397
|
b || e.select(".domain").remove();
|
|
398
|
-
const y = s ===
|
|
399
|
-
if (y ===
|
|
398
|
+
const y = s === He.Auto ? o > 0 && o < 400 ? He.Inside : He.Outside : s;
|
|
399
|
+
if (y === He.Inside) {
|
|
400
400
|
const x = b ? 4 : 0;
|
|
401
401
|
if (n === zt.Right ? e.selectAll(".tick text").attr("x", -x).attr("dy", "-0.4em").attr("text-anchor", "end") : e.selectAll(".tick text").attr("x", x).attr("dy", "-0.4em").attr("text-anchor", "start"), m ? e.selectAll(".tick line").attr("x2", n === zt.Right ? -6 : 6) : e.selectAll(".tick line").remove(), c > 0 && b) {
|
|
402
402
|
const A = e.select(".domain");
|
|
@@ -406,14 +406,14 @@ class Ws extends lt {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
} else
|
|
409
|
-
m || e.selectAll(".tick line").remove(), y ===
|
|
409
|
+
m || e.selectAll(".tick line").remove(), y === He.Off && e.selectAll(".tick text").remove();
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
414
|
postDraw() {
|
|
415
415
|
const a = this.config("gridStyle"), e = this.config("gridWidth"), r = this.config("direction"), n = this.base.select(".bc-axis-vertical").node();
|
|
416
|
-
if (n && a !==
|
|
416
|
+
if (n && a !== tt.None && e > 0) {
|
|
417
417
|
const s = r === zt.Right ? -e : e;
|
|
418
418
|
xl(n, a, s);
|
|
419
419
|
}
|
|
@@ -424,10 +424,10 @@ function xl(t, a, e) {
|
|
|
424
424
|
const r = ((i = t.ownerSVGElement) == null ? void 0 : i.parentElement) ?? document.documentElement, s = getComputedStyle(r).getPropertyValue("--bc-grid-color").trim() || "#ccc";
|
|
425
425
|
p.select(t).selectAll(".tick").each(function() {
|
|
426
426
|
const f = p.select(this).append("line").attr("class", "bc-grid-line").attr("x1", 0).attr("x2", e).attr("y1", 0).attr("y2", 0).attr("stroke", s).attr("stroke-width", 1);
|
|
427
|
-
a ===
|
|
427
|
+
a === tt.Dashed ? f.attr("stroke-dasharray", "4,4") : a === tt.Dotted && f.attr("stroke-dasharray", "1,3");
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function Xd(t, a, e, r = {}, n) {
|
|
431
431
|
const s = r.direction ?? zt.Left, o = new Ws(p.select(t));
|
|
432
432
|
if (n) {
|
|
433
433
|
n.querySelectorAll(".bc-grid-line").forEach((f) => f.remove());
|
|
@@ -439,12 +439,12 @@ function qd(t, a, e, r = {}, n) {
|
|
|
439
439
|
direction: s,
|
|
440
440
|
showAxis: r.showAxis ?? !0,
|
|
441
441
|
showTicks: r.showTicks ?? !1,
|
|
442
|
-
gridStyle: r.gridStyle ??
|
|
442
|
+
gridStyle: r.gridStyle ?? tt.Dashed,
|
|
443
443
|
gridWidth: r.gridWidth ?? 0,
|
|
444
444
|
height: e,
|
|
445
445
|
ticks: r.ticks ?? null,
|
|
446
446
|
numberFormat: r.numberFormat ?? null,
|
|
447
|
-
labelPosition: r.labelPosition ??
|
|
447
|
+
labelPosition: r.labelPosition ?? He.Auto,
|
|
448
448
|
topPadding: r.topPadding ?? 0,
|
|
449
449
|
tickFormat: r.tickFormat ?? null
|
|
450
450
|
}), o.draw([{ placeholder: !0 }]);
|
|
@@ -517,20 +517,20 @@ function Sl() {
|
|
|
517
517
|
A = x, w = c && c.formats;
|
|
518
518
|
for (var $ = (x = A.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(K, X, te) {
|
|
519
519
|
var fe = te && te.toUpperCase();
|
|
520
|
-
return X || w[te] || e[te] || w[fe].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(se, F,
|
|
521
|
-
return F ||
|
|
520
|
+
return X || w[te] || e[te] || w[fe].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(se, F, Y) {
|
|
521
|
+
return F || Y.slice(1);
|
|
522
522
|
}));
|
|
523
523
|
}))).match(r), P = $.length, D = 0; D < P; D += 1) {
|
|
524
|
-
var
|
|
525
|
-
$[D] =
|
|
524
|
+
var H = $[D], j = v[H], _ = j && j[0], B = j && j[1];
|
|
525
|
+
$[D] = B ? { regex: _, parser: B } : H.replace(/^\[|\]$/g, "");
|
|
526
526
|
}
|
|
527
527
|
return function(K) {
|
|
528
528
|
for (var X = {}, te = 0, fe = 0; te < P; te += 1) {
|
|
529
529
|
var se = $[te];
|
|
530
530
|
if (typeof se == "string") fe += se.length;
|
|
531
531
|
else {
|
|
532
|
-
var F = se.regex,
|
|
533
|
-
|
|
532
|
+
var F = se.regex, Y = se.parser, R = K.slice(fe), ie = F.exec(R)[0];
|
|
533
|
+
Y.call(X, ie), K = K.replace(ie, "");
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
return (function(he) {
|
|
@@ -546,27 +546,27 @@ function Sl() {
|
|
|
546
546
|
w.p.customParseFormat = !0, x && x.parseTwoDigitYear && (f = x.parseTwoDigitYear);
|
|
547
547
|
var $ = A.prototype, P = $.parse;
|
|
548
548
|
$.parse = function(D) {
|
|
549
|
-
var
|
|
549
|
+
var H = D.date, j = D.utc, _ = D.args;
|
|
550
550
|
this.$u = j;
|
|
551
|
-
var
|
|
552
|
-
if (typeof
|
|
551
|
+
var B = _[1];
|
|
552
|
+
if (typeof B == "string") {
|
|
553
553
|
var K = _[2] === !0, X = _[3] === !0, te = K || X, fe = _[2];
|
|
554
|
-
X && (fe = _[2]), c = this.$locale(), !K && fe && (c = w.Ls[fe]), this.$d = (function(
|
|
554
|
+
X && (fe = _[2]), c = this.$locale(), !K && fe && (c = w.Ls[fe]), this.$d = (function(R, ie, he, ve) {
|
|
555
555
|
try {
|
|
556
|
-
if (["x", "X"].indexOf(ie) > -1) return new Date((ie === "X" ? 1e3 : 1) *
|
|
557
|
-
var ce = y(ie)(
|
|
556
|
+
if (["x", "X"].indexOf(ie) > -1) return new Date((ie === "X" ? 1e3 : 1) * R);
|
|
557
|
+
var ce = y(ie)(R), ue = ce.year, Se = ce.month, ye = ce.day, ge = ce.hours, xe = ce.minutes, pe = ce.seconds, Me = ce.milliseconds, J = ce.zone, ae = ce.week, ke = /* @__PURE__ */ new Date(), me = ye || (ue || Se ? 1 : ke.getDate()), Ce = ue || ke.getFullYear(), we = 0;
|
|
558
558
|
ue && !Se || (we = Se > 0 ? Se - 1 : ke.getMonth());
|
|
559
559
|
var Ne, Oe = ge || 0, Q = xe || 0, Z = pe || 0, S = Me || 0;
|
|
560
560
|
return J ? new Date(Date.UTC(Ce, we, me, Oe, Q, Z, S + 60 * J.offset * 1e3)) : he ? new Date(Date.UTC(Ce, we, me, Oe, Q, Z, S)) : (Ne = new Date(Ce, we, me, Oe, Q, Z, S), ae && (Ne = ve(Ne).week(ae).toDate()), Ne);
|
|
561
561
|
} catch {
|
|
562
562
|
return /* @__PURE__ */ new Date("");
|
|
563
563
|
}
|
|
564
|
-
})(
|
|
565
|
-
} else if (
|
|
566
|
-
_[1] =
|
|
567
|
-
var
|
|
568
|
-
if (
|
|
569
|
-
this.$d =
|
|
564
|
+
})(H, B, j, w), this.init(), fe && fe !== !0 && (this.$L = this.locale(fe).$L), te && H != this.format(B) && (this.$d = /* @__PURE__ */ new Date("")), c = {};
|
|
565
|
+
} else if (B instanceof Array) for (var se = B.length, F = 1; F <= se; F += 1) {
|
|
566
|
+
_[1] = B[F - 1];
|
|
567
|
+
var Y = w.apply(this, _);
|
|
568
|
+
if (Y.isValid()) {
|
|
569
|
+
this.$d = Y.$d, this.$L = Y.$L, this.init();
|
|
570
570
|
break;
|
|
571
571
|
}
|
|
572
572
|
F === se && (this.$d = /* @__PURE__ */ new Date(""));
|
|
@@ -768,13 +768,13 @@ function Nl(t, a, e, r) {
|
|
|
768
768
|
const n = Ja(t, r ?? null), s = a / t.length;
|
|
769
769
|
return n > s * nn;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Bl(t, a) {
|
|
772
772
|
if (t.length === 0)
|
|
773
773
|
return 0;
|
|
774
774
|
const e = Ja(t, a ?? null);
|
|
775
775
|
return Math.ceil(e) + Ol;
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Il(t) {
|
|
778
778
|
let a = 1;
|
|
779
779
|
for (const e of t)
|
|
780
780
|
e.length > a && (a = e.length);
|
|
@@ -789,14 +789,14 @@ function sn(t, a, e = {}, r = 24) {
|
|
|
789
789
|
if (s !== "vertical" && b) {
|
|
790
790
|
const m = js(t, d, n);
|
|
791
791
|
if (m) {
|
|
792
|
-
const v =
|
|
792
|
+
const v = Il(Array.from(m.values()));
|
|
793
793
|
return v > r ? v : void 0;
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
797
|
if (!Nl(t, a, s, n))
|
|
798
798
|
return;
|
|
799
|
-
const c =
|
|
799
|
+
const c = Bl(t, n);
|
|
800
800
|
return c > r ? c : void 0;
|
|
801
801
|
}
|
|
802
802
|
function js(t, a, e) {
|
|
@@ -821,7 +821,7 @@ function Vl(t, a) {
|
|
|
821
821
|
}));
|
|
822
822
|
});
|
|
823
823
|
}
|
|
824
|
-
class Zs extends
|
|
824
|
+
class Zs extends ct {
|
|
825
825
|
initialize() {
|
|
826
826
|
this.configDefine("scale", { defaultValue: p.scaleBand() }), this.configDefine("height", { defaultValue: 0 }), this.configDefine("tickPosition", { defaultValue: "below" }), this.configDefine("showAxis", { defaultValue: !0 }), this.configDefine("showTicks", { defaultValue: !1 }), this.configDefine("gridStyle", { defaultValue: "dashed" }), this.configDefine("ticks", { defaultValue: null }), this.configDefine("numberFormat", { defaultValue: null }), this.configDefine("width", { defaultValue: 0 }), this.configDefine("labels", { defaultValue: [] }), this.configDefine("labelPosition", { defaultValue: "auto" }), this.configDefine("labelRotation", { defaultValue: "auto" }), this.configDefine("zeroY", { defaultValue: null }), this.configDefine("tickFormat", { defaultValue: null });
|
|
827
827
|
const a = this.base.append("g");
|
|
@@ -868,14 +868,14 @@ class Zs extends lt {
|
|
|
868
868
|
m.ticks(K);
|
|
869
869
|
}
|
|
870
870
|
P && m.tickValues(P);
|
|
871
|
-
const D = s === "above" ? 0 : o,
|
|
871
|
+
const D = s === "above" ? 0 : o, H = a.node(), j = e === "merge" ? Ee() : 0;
|
|
872
872
|
if (e === "merge") {
|
|
873
|
-
if (!
|
|
873
|
+
if (!H)
|
|
874
874
|
return;
|
|
875
|
-
j > 0 ? (a.attr("transform", `translate(0,${D})`), a.duration(j).call(m)) : p.select(
|
|
875
|
+
j > 0 ? (a.attr("transform", `translate(0,${D})`), a.duration(j).call(m)) : p.select(H).attr("transform", `translate(0,${D})`).call(m);
|
|
876
876
|
} else
|
|
877
877
|
a.attr("transform", `translate(0,${D})`), a.call(m);
|
|
878
|
-
const _ = j > 0 ? a :
|
|
878
|
+
const _ = j > 0 ? a : H ? p.select(H) : a;
|
|
879
879
|
if (!this.config("showAxis"))
|
|
880
880
|
_.select(".domain").remove();
|
|
881
881
|
else if (e === "enter") {
|
|
@@ -886,8 +886,8 @@ class Zs extends lt {
|
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
this.config("showTicks") || _.selectAll(".tick line").remove();
|
|
889
|
-
const
|
|
890
|
-
|
|
889
|
+
const B = i === "auto" ? "outside" : i;
|
|
890
|
+
B === "off" ? _.selectAll(".tick text").remove() : B === "inside" && _.selectAll(".tick text").attr("y", 0).attr("dy", "-0.6em"), $ && B !== "off" ? _.selectAll(".tick text").attr("transform", "rotate(-90)").attr("text-anchor", "end").attr("x", s === "above" ? 9 : -9).attr("y", 0).attr("dy", "0.32em") : _.selectAll(".tick text").attr("transform", null), w && B !== "off" && Vl(_, w);
|
|
891
891
|
}
|
|
892
892
|
postDraw() {
|
|
893
893
|
const a = this.config("gridStyle"), e = this.config("height"), r = this.base.select(".bc-axis-horizontal").node();
|
|
@@ -902,7 +902,7 @@ function _l(t, a, e) {
|
|
|
902
902
|
a === "dashed" ? f.attr("stroke-dasharray", "4,4") : a === "dotted" && f.attr("stroke-dasharray", "1,3");
|
|
903
903
|
});
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function Ud(t, a, e, r = {}, n) {
|
|
906
906
|
const s = new Zs(p.select(t));
|
|
907
907
|
if (n) {
|
|
908
908
|
n.querySelectorAll(".bc-grid-line").forEach((c) => c.remove());
|
|
@@ -937,7 +937,7 @@ const Qs = [
|
|
|
937
937
|
"#b07aa1",
|
|
938
938
|
"#ff9da7"
|
|
939
939
|
], Gl = 200, ls = 0.2;
|
|
940
|
-
class
|
|
940
|
+
class Hl extends ct {
|
|
941
941
|
initialize() {
|
|
942
942
|
this.configDefine("colors", { defaultValue: Qs }), this.configDefine("yOffset", { defaultValue: -10 }), this.configDefine("layout", { defaultValue: "horizontal" }), this.configDefine("valueSuffixes", { defaultValue: [] }), this.configDefine("maxWidth", { defaultValue: 0 });
|
|
943
943
|
const a = this.base.append("g").attr("class", "bc-legend"), e = (r) => {
|
|
@@ -970,7 +970,7 @@ class Yl extends lt {
|
|
|
970
970
|
this.base.select(".bc-legend").attr("transform", `translate(0,${a})`);
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function Yl(t) {
|
|
974
974
|
const a = p.select(t).selectAll(".bc-legend-item");
|
|
975
975
|
if (a.empty())
|
|
976
976
|
return;
|
|
@@ -999,28 +999,28 @@ function Rl(t) {
|
|
|
999
999
|
});
|
|
1000
1000
|
}
|
|
1001
1001
|
function ba(t, a, e = Qs, r = -10, n = "top", s = "start", o = 0, i = 0, c = 0, f = [], d = {}) {
|
|
1002
|
-
const g = n === "left" || n === "right" ? "vertical" : "horizontal", b = new
|
|
1002
|
+
const g = n === "left" || n === "right" ? "vertical" : "horizontal", b = new Hl(p.select(t));
|
|
1003
1003
|
b.config({ colors: e, yOffset: r, layout: g, valueSuffixes: f, maxWidth: o }), b.draw(a);
|
|
1004
1004
|
const m = t.querySelector(".bc-legend");
|
|
1005
1005
|
if (m) {
|
|
1006
1006
|
let v = 0, y = 0;
|
|
1007
|
-
const x = a.map((D,
|
|
1008
|
-
const j = f[
|
|
1007
|
+
const x = a.map((D, H) => {
|
|
1008
|
+
const j = f[H];
|
|
1009
1009
|
return j ? D.length + 1 + j.length : D.length;
|
|
1010
1010
|
});
|
|
1011
1011
|
if (g === "horizontal") {
|
|
1012
|
-
const D = x.map((
|
|
1013
|
-
let
|
|
1014
|
-
for (const
|
|
1015
|
-
o > 0 && j > 0 && j +
|
|
1016
|
-
_ = Math.max(_, j), v = _, y =
|
|
1012
|
+
const D = x.map((B) => 16 + B * 7 + 12);
|
|
1013
|
+
let H = 1, j = 0, _ = 0;
|
|
1014
|
+
for (const B of D)
|
|
1015
|
+
o > 0 && j > 0 && j + B > o ? (_ = Math.max(_, j), H++, j = B) : j += B;
|
|
1016
|
+
_ = Math.max(_, j), v = _, y = H * 20;
|
|
1017
1017
|
} else
|
|
1018
1018
|
v = Math.max(...x) * 7 + 16 + 8, y = a.length * 20;
|
|
1019
1019
|
const A = d.left ?? 0, w = d.right ?? 0;
|
|
1020
1020
|
let $ = c, P = r;
|
|
1021
1021
|
g === "horizontal" ? s === "middle" ? $ += -A + (o + A + w - v) / 2 : s === "end" ? $ += o + w - v : $ += -A : s === "middle" ? P += (i - y) / 2 : s === "end" && (P += i - y), m.setAttribute("transform", `translate(${$},${P})`);
|
|
1022
1022
|
}
|
|
1023
|
-
return
|
|
1023
|
+
return Yl(t), m;
|
|
1024
1024
|
}
|
|
1025
1025
|
const Js = [
|
|
1026
1026
|
{ name: "Blueprint", label: "Blueprint", colors: ["#2563A0", "#D4A63A", "#C94044", "#2D8659", "#4B90CF", "#163A65"] },
|
|
@@ -1074,13 +1074,13 @@ const Js = [
|
|
|
1074
1074
|
{ name: "Wizards", label: "Wizards", colors: ["#c8102e", "#0c2340", "#8d9093", "#c8c9c7"] },
|
|
1075
1075
|
{ name: "FrancescoXanto", label: "Xanto", colors: ["#2c6aa5", "#d9ae2c", "#ddc655", "#d88c27", "#64894d"] },
|
|
1076
1076
|
{ name: "Zeppelin", label: "Zeppelin", colors: ["#efdb15", "#739c9c", "#0d484c", "#c71a08"] }
|
|
1077
|
-
],
|
|
1077
|
+
], Rl = Object.fromEntries(
|
|
1078
1078
|
Js.map((t) => [t.name, t.colors])
|
|
1079
1079
|
);
|
|
1080
1080
|
function Wl(t) {
|
|
1081
1081
|
if (!t)
|
|
1082
1082
|
return;
|
|
1083
|
-
const a =
|
|
1083
|
+
const a = Rl[t];
|
|
1084
1084
|
return a ? [...a] : void 0;
|
|
1085
1085
|
}
|
|
1086
1086
|
function ql() {
|
|
@@ -1109,7 +1109,7 @@ function Va(t, a, e) {
|
|
|
1109
1109
|
let r = 0, n = 0, s = 1 / 0, o = !0, i = !1;
|
|
1110
1110
|
for (const d of t)
|
|
1111
1111
|
Number.isFinite(d) && (i = !0, d < r && (r = d), d > n && (n = d), d <= 0 ? o = !1 : d < s && (s = d));
|
|
1112
|
-
e ===
|
|
1112
|
+
e === Ba.Log && i && o && (r = s);
|
|
1113
1113
|
let c = (a == null ? void 0 : a.min) ?? r, f = (a == null ? void 0 : a.max) ?? n;
|
|
1114
1114
|
if (c > f && ([c, f] = [f, c]), c === f)
|
|
1115
1115
|
if (c === 0)
|
|
@@ -1305,7 +1305,7 @@ function ma(t) {
|
|
|
1305
1305
|
const d = p.select(i).datum();
|
|
1306
1306
|
e.textContent = a(d), e.style.display = "block", Ns(i, e, {
|
|
1307
1307
|
placement: "top",
|
|
1308
|
-
middleware: [
|
|
1308
|
+
middleware: [Bs(8), Is(), Vs()]
|
|
1309
1309
|
}).then(({ x: g, y: b }) => {
|
|
1310
1310
|
e && (e.style.left = `${g}px`, e.style.top = `${b}px`);
|
|
1311
1311
|
});
|
|
@@ -1336,13 +1336,13 @@ function Zl(t) {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
1338
|
function La(t) {
|
|
1339
|
-
const a = (t == null ? void 0 : t.color) ?? "#999", e = (t == null ? void 0 : t.dashArray) ?? Zl(t == null ? void 0 : t.style), r = (t == null ? void 0 : t.direction) ??
|
|
1339
|
+
const a = (t == null ? void 0 : t.color) ?? "#999", e = (t == null ? void 0 : t.dashArray) ?? Zl(t == null ? void 0 : t.style), r = (t == null ? void 0 : t.direction) ?? pt.Both, n = (t == null ? void 0 : t.orientation) ?? st.Vertical, s = [];
|
|
1340
1340
|
return {
|
|
1341
1341
|
name: "crosshair",
|
|
1342
1342
|
install() {
|
|
1343
1343
|
},
|
|
1344
1344
|
postDraw(o) {
|
|
1345
|
-
const i = o.base, c = (t == null ? void 0 : t.width) ?? 0, f = (t == null ? void 0 : t.height) ?? 0, d = r ===
|
|
1345
|
+
const i = o.base, c = (t == null ? void 0 : t.width) ?? 0, f = (t == null ? void 0 : t.height) ?? 0, d = r === pt.Both || r === pt.Vertical, g = r === pt.Both || r === pt.Horizontal, b = d ? i.append("line").attr("class", "bc-crosshair bc-crosshair-v").attr("y1", 0).attr("y2", f).attr("stroke", a).attr("stroke-width", 1).style("stroke-dasharray", e).attr("pointer-events", "none").style("display", "none") : null, m = g ? i.append("line").attr("class", "bc-crosshair bc-crosshair-h").attr("x1", 0).attr("x2", c).attr("stroke", a).attr("stroke-width", 1).style("stroke-dasharray", e).attr("pointer-events", "none").style("display", "none") : null;
|
|
1346
1346
|
i.selectAll(".bc-dot, .bc-bar").each(function() {
|
|
1347
1347
|
const y = this, x = () => {
|
|
1348
1348
|
const w = p.select(y);
|
|
@@ -1350,8 +1350,8 @@ function La(t) {
|
|
|
1350
1350
|
if (y.tagName === "circle")
|
|
1351
1351
|
$ = parseFloat(w.attr("cx")), P = parseFloat(w.attr("cy"));
|
|
1352
1352
|
else {
|
|
1353
|
-
const D = parseFloat(w.attr("x")),
|
|
1354
|
-
n ===
|
|
1353
|
+
const D = parseFloat(w.attr("x")), H = parseFloat(w.attr("width")), j = parseFloat(w.attr("y")), _ = parseFloat(w.attr("height"));
|
|
1354
|
+
n === st.Horizontal ? ($ = D + H, P = j + _ / 2) : ($ = D + H / 2, P = j);
|
|
1355
1355
|
}
|
|
1356
1356
|
b && b.attr("x1", $).attr("x2", $).style("display", null), m && m.attr("y1", P).attr("y2", P).style("display", null);
|
|
1357
1357
|
}, A = () => {
|
|
@@ -1415,7 +1415,7 @@ const pa = {
|
|
|
1415
1415
|
NW: { nx: -1, ny: -1 },
|
|
1416
1416
|
center: { nx: 0, ny: 0 }
|
|
1417
1417
|
};
|
|
1418
|
-
|
|
1418
|
+
et.N + "", et.W, et.NE + "", et.NW, et.E + "", et.N, et.SE + "", et.NE, et.S + "", et.E, et.SW + "", et.SE, et.W + "", et.S, et.NW + "", et.SW, et.Center + "", et.Center;
|
|
1419
1419
|
function Ql(t, a) {
|
|
1420
1420
|
const e = pa[t] ?? pa.NW;
|
|
1421
1421
|
return { dx: e.dx * a, dy: e.dy * a };
|
|
@@ -1507,17 +1507,17 @@ function rc(t, a, e) {
|
|
|
1507
1507
|
const r = ac(t, a, e);
|
|
1508
1508
|
return `M ${t.x} ${t.y} L ${r.x} ${r.y} L ${a.x} ${a.y}`;
|
|
1509
1509
|
}
|
|
1510
|
-
function nc(t, a, e, r =
|
|
1510
|
+
function nc(t, a, e, r = gt.Direct, n = {}) {
|
|
1511
1511
|
var c;
|
|
1512
1512
|
let s;
|
|
1513
1513
|
switch (r) {
|
|
1514
|
-
case
|
|
1515
|
-
case
|
|
1516
|
-
const f = e.x - a.x, d = e.y - a.y, b = Math.sqrt(f * f + d * d) * 0.8, m = r ===
|
|
1514
|
+
case gt.CurveLeft:
|
|
1515
|
+
case gt.CurveRight: {
|
|
1516
|
+
const f = e.x - a.x, d = e.y - a.y, b = Math.sqrt(f * f + d * d) * 0.8, m = r === gt.CurveRight ? 1 : 0;
|
|
1517
1517
|
s = `M ${a.x} ${a.y} A ${b} ${b} 0 0 ${m} ${e.x} ${e.y}`;
|
|
1518
1518
|
break;
|
|
1519
1519
|
}
|
|
1520
|
-
case
|
|
1520
|
+
case gt.Elbow: {
|
|
1521
1521
|
s = rc(a, e, n.departVertical ?? !1);
|
|
1522
1522
|
break;
|
|
1523
1523
|
}
|
|
@@ -1600,7 +1600,7 @@ function ai(t, a, e, r) {
|
|
|
1600
1600
|
return;
|
|
1601
1601
|
const o = t.append("g").attr("data-annotation-index", String(r));
|
|
1602
1602
|
a.id && o.attr("data-annotation-id", a.id);
|
|
1603
|
-
const i = a, c = i.anchorDirection ??
|
|
1603
|
+
const i = a, c = i.anchorDirection ?? et.N, f = Jl(s, e.scaleX, e.scaleY, c, e.orientation);
|
|
1604
1604
|
let d, g;
|
|
1605
1605
|
const b = a;
|
|
1606
1606
|
if (b.dx != null || b.dy != null) {
|
|
@@ -1640,15 +1640,15 @@ function ai(t, a, e, r) {
|
|
|
1640
1640
|
} catch {
|
|
1641
1641
|
}
|
|
1642
1642
|
const P = i.showCircle ? (i.circleSize ?? 4) + (i.lineTargetDistance ?? 5) : i.lineTargetDistance ?? 0;
|
|
1643
|
-
let D = f.x,
|
|
1643
|
+
let D = f.x, H = f.y;
|
|
1644
1644
|
if (P > 0) {
|
|
1645
|
-
const j = f.x - A.x, _ = f.y - A.y,
|
|
1646
|
-
if (
|
|
1647
|
-
const K = f.x - j /
|
|
1648
|
-
D = Math.abs(te.dx) > 0.01 ? K : f.x,
|
|
1645
|
+
const j = f.x - A.x, _ = f.y - A.y, B = Math.sqrt(j * j + _ * _);
|
|
1646
|
+
if (B > 0) {
|
|
1647
|
+
const K = f.x - j / B * P, X = f.y - _ / B * P, te = pa[c] ?? pa.N;
|
|
1648
|
+
D = Math.abs(te.dx) > 0.01 ? K : f.x, H = Math.abs(te.dy) > 0.01 ? X : f.y;
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
1651
|
-
nc(o, A, { x: D, y:
|
|
1651
|
+
nc(o, A, { x: D, y: H }, i.lineStyle ?? gt.Direct, {
|
|
1652
1652
|
showArrow: i.showArrow,
|
|
1653
1653
|
lineWeight: i.lineWeight,
|
|
1654
1654
|
color: m,
|
|
@@ -1657,21 +1657,21 @@ function ai(t, a, e, r) {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
1659
1659
|
function ri(t, a, e, r, n) {
|
|
1660
|
-
if (a.kind !==
|
|
1660
|
+
if (a.kind !== Ze.Range)
|
|
1661
1661
|
return;
|
|
1662
1662
|
const s = t.append("g").attr("data-annotation-index", String(r));
|
|
1663
1663
|
a.id && s.attr("data-annotation-id", a.id);
|
|
1664
|
-
const o = a.orientation ??
|
|
1664
|
+
const o = a.orientation ?? st.Vertical;
|
|
1665
1665
|
let i, c, f, d;
|
|
1666
|
-
if (e.orientation ===
|
|
1667
|
-
if (o ===
|
|
1666
|
+
if (e.orientation === st.Horizontal)
|
|
1667
|
+
if (o === st.Vertical) {
|
|
1668
1668
|
const g = dr(a.start, e.scaleX, a.startAnchor), b = dr(a.end, e.scaleX, a.endAnchor);
|
|
1669
1669
|
c = Math.min(g, b), d = Math.abs(b - g), i = 0, f = e.width;
|
|
1670
1670
|
} else {
|
|
1671
1671
|
const g = ur(a.start, e.scaleY), b = ur(a.end, e.scaleY);
|
|
1672
1672
|
i = Math.min(g, b), f = Math.abs(b - g), c = 0, d = e.height;
|
|
1673
1673
|
}
|
|
1674
|
-
else if (o ===
|
|
1674
|
+
else if (o === st.Vertical) {
|
|
1675
1675
|
const g = dr(a.start, e.scaleX, a.startAnchor), b = dr(a.end, e.scaleX, a.endAnchor);
|
|
1676
1676
|
i = Math.min(g, b), f = Math.abs(b - g), c = 0, d = e.height;
|
|
1677
1677
|
} else {
|
|
@@ -1679,23 +1679,23 @@ function ri(t, a, e, r, n) {
|
|
|
1679
1679
|
c = Math.min(g, b), d = Math.abs(b - g), i = 0, f = e.width;
|
|
1680
1680
|
}
|
|
1681
1681
|
if (s.append("rect").attr("class", "bc-annotation-range").attr("x", i).attr("y", c).attr("width", f).attr("height", d).attr("fill", a.bgColor ?? "#ccc").attr("opacity", (a.bgOpacity ?? 20) / 100), a.text) {
|
|
1682
|
-
const g = o ===
|
|
1682
|
+
const g = o === st.Vertical ? f : d, b = dn(a.maxWidth, e.width) ?? Math.max(g, 50), m = a.direction ?? "center", v = 4, y = pa[m] ?? pa.center, x = 0.5 + y.dx * 0.5, A = 0.5 + y.dy * 0.5, w = Math.max(v, Math.min(i + f * x, e.width - v));
|
|
1683
1683
|
let $ = "middle";
|
|
1684
1684
|
x < 0.25 ? $ = "start" : x > 0.75 && ($ = "end");
|
|
1685
|
-
const D = c + v + 12,
|
|
1686
|
-
if (fn(
|
|
1685
|
+
const D = c + v + 12, H = n ? n.append("g").attr("data-annotation-index", String(r)) : s;
|
|
1686
|
+
if (fn(H, a.text, w, D, {
|
|
1687
1687
|
textColor: a.textColor,
|
|
1688
1688
|
maxWidth: b,
|
|
1689
1689
|
textAnchor: $,
|
|
1690
1690
|
backgroundColor: e.backgroundColor,
|
|
1691
1691
|
textOutline: a.textOutline
|
|
1692
1692
|
}), A > 0.25) {
|
|
1693
|
-
const j =
|
|
1693
|
+
const j = H.select(".bc-annotation-text").node();
|
|
1694
1694
|
if (j)
|
|
1695
1695
|
try {
|
|
1696
1696
|
const _ = j.getBBox();
|
|
1697
|
-
let
|
|
1698
|
-
A > 0.75 ?
|
|
1697
|
+
let B = 0;
|
|
1698
|
+
A > 0.75 ? B = c + d - v - (_.y + _.height) : B = c + d / 2 - (_.y + _.height / 2), Math.abs(B) > 0.5 && j.setAttribute("transform", `translate(0, ${B})`);
|
|
1699
1699
|
} catch {
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
@@ -1732,7 +1732,7 @@ function oc(t, a) {
|
|
|
1732
1732
|
const e = t.hasAttribute("marker-end"), r = on(t.parentElement);
|
|
1733
1733
|
if (e && r) {
|
|
1734
1734
|
const n = p.select(t), s = t.getAttribute("d"), o = `M ${r.fromX} ${r.fromY} L ${r.fromX} ${r.fromY}`;
|
|
1735
|
-
if (n.attr("d", o), r.style ===
|
|
1735
|
+
if (n.attr("d", o), r.style === gt.Elbow) {
|
|
1736
1736
|
const i = { tipX: r.toX, tipY: r.toY, calloutX: r.fromX, calloutY: r.fromY }, c = { tipX: r.fromX, tipY: r.fromY, calloutX: r.fromX, calloutY: r.fromY };
|
|
1737
1737
|
n.transition().duration(a).ease(p.easeCubicOut).attrTween("d", () => {
|
|
1738
1738
|
const f = p.interpolateObject(c, i);
|
|
@@ -1741,13 +1741,13 @@ function oc(t, a) {
|
|
|
1741
1741
|
return en(g.calloutX, g.calloutY, g.tipX, g.tipY);
|
|
1742
1742
|
};
|
|
1743
1743
|
});
|
|
1744
|
-
} else if (r.style ===
|
|
1745
|
-
const i = { x: r.fromX, y: r.fromY }, c = { x: r.toX, y: r.toY }, f = c.x - i.x, d = c.y - i.y, g = Math.sqrt(f * f + d * d), b = g * 0.8, m = r.style ===
|
|
1746
|
-
let
|
|
1747
|
-
m === 1 &&
|
|
1744
|
+
} else if (r.style === gt.CurveLeft || r.style === gt.CurveRight) {
|
|
1745
|
+
const i = { x: r.fromX, y: r.fromY }, c = { x: r.toX, y: r.toY }, f = c.x - i.x, d = c.y - i.y, g = Math.sqrt(f * f + d * d), b = g * 0.8, m = r.style === gt.CurveRight ? 1 : 0, v = g / 2, y = v < b ? Math.sqrt(b * b - v * v) : 0, x = (i.x + c.x) / 2, A = (i.y + c.y) / 2, w = g > 0 ? -d / g : 0, $ = g > 0 ? f / g : 0, P = m === 1 ? 1 : -1, D = x + P * y * w, H = A + P * y * $, j = Math.atan2(i.y - H, i.x - D);
|
|
1746
|
+
let B = Math.atan2(c.y - H, c.x - D) - j;
|
|
1747
|
+
m === 1 && B <= 0 && (B += 2 * Math.PI), m === 0 && B >= 0 && (B -= 2 * Math.PI), n.transition().duration(a).ease(p.easeCubicOut).attrTween("d", () => (K) => {
|
|
1748
1748
|
if (K >= 0.98)
|
|
1749
1749
|
return s;
|
|
1750
|
-
const X = j + K *
|
|
1750
|
+
const X = j + K * B, te = D + b * Math.cos(X), fe = H + b * Math.sin(X);
|
|
1751
1751
|
return `M ${i.x} ${i.y} A ${b} ${b} 0 0 ${m} ${te} ${fe}`;
|
|
1752
1752
|
});
|
|
1753
1753
|
} else
|
|
@@ -1769,7 +1769,7 @@ function cc(t, a, e) {
|
|
|
1769
1769
|
if (!r || lc(a, r))
|
|
1770
1770
|
return;
|
|
1771
1771
|
const n = p.select(t);
|
|
1772
|
-
if (a.style ===
|
|
1772
|
+
if (a.style === gt.Elbow && r.style === gt.Elbow) {
|
|
1773
1773
|
const s = { tipX: a.toX, tipY: a.toY, calloutX: a.fromX, calloutY: a.fromY }, o = { tipX: r.toX, tipY: r.toY, calloutX: r.fromX, calloutY: r.fromY };
|
|
1774
1774
|
n.attr("d", en(s.calloutX, s.calloutY, s.tipX, s.tipY)), n.transition().duration(e).ease(p.easeCubicInOut).attrTween("d", () => {
|
|
1775
1775
|
const i = p.interpolateObject(s, o);
|
|
@@ -1786,9 +1786,9 @@ function cc(t, a, e) {
|
|
|
1786
1786
|
if (m >= 0.98)
|
|
1787
1787
|
return f;
|
|
1788
1788
|
const v = g(m), y = b(m);
|
|
1789
|
-
if (r.style ===
|
|
1789
|
+
if (r.style === gt.Direct || a.style === gt.Direct)
|
|
1790
1790
|
return `M ${v.x} ${v.y} L ${y.x} ${y.y}`;
|
|
1791
|
-
const x = y.x - v.x, A = y.y - v.y, $ = Math.sqrt(x * x + A * A) * 0.8, P = r.style ===
|
|
1791
|
+
const x = y.x - v.x, A = y.y - v.y, $ = Math.sqrt(x * x + A * A) * 0.8, P = r.style === gt.CurveRight ? 1 : 0;
|
|
1792
1792
|
return `M ${v.x} ${v.y} A ${$} ${$} 0 0 ${P} ${y.x} ${y.y}`;
|
|
1793
1793
|
};
|
|
1794
1794
|
});
|
|
@@ -1870,20 +1870,20 @@ function $r(t, a, e) {
|
|
|
1870
1870
|
const o = n.insert("g", ":first-child").attr("class", "bc-annotations-range"), i = n.append("g").attr("class", "bc-annotations").attr("data-ctx-width", String(e.width)).attr("data-ctx-height", String(e.height));
|
|
1871
1871
|
for (let c = 0; c < a.length; c++) {
|
|
1872
1872
|
const f = a[c];
|
|
1873
|
-
switch (f.kind ??
|
|
1874
|
-
case
|
|
1873
|
+
switch (f.kind ?? Ze.Point) {
|
|
1874
|
+
case Ze.Point:
|
|
1875
1875
|
ai(i, f, e, c);
|
|
1876
1876
|
break;
|
|
1877
|
-
case
|
|
1877
|
+
case Ze.Range:
|
|
1878
1878
|
ri(o, f, e, c, i);
|
|
1879
1879
|
break;
|
|
1880
|
-
case
|
|
1880
|
+
case Ze.Free:
|
|
1881
1881
|
ni(i, f, e, c);
|
|
1882
1882
|
break;
|
|
1883
1883
|
}
|
|
1884
1884
|
}
|
|
1885
1885
|
if (e.transition) {
|
|
1886
|
-
const c = Sa(
|
|
1886
|
+
const c = Sa(Ia);
|
|
1887
1887
|
si(i.node(), o.node(), s ?? /* @__PURE__ */ new Map(), c);
|
|
1888
1888
|
}
|
|
1889
1889
|
ii(r);
|
|
@@ -1918,20 +1918,20 @@ function _a(t, a) {
|
|
|
1918
1918
|
const d = i.insert("g", ":first-child").attr("class", "bc-annotations-range"), g = i.append("g").attr("class", "bc-annotations").attr("data-ctx-width", String(a.width)).attr("data-ctx-height", String(a.height));
|
|
1919
1919
|
for (let m = 0; m < t.length; m++) {
|
|
1920
1920
|
const v = t[m];
|
|
1921
|
-
switch (v.kind ??
|
|
1922
|
-
case
|
|
1921
|
+
switch (v.kind ?? Ze.Point) {
|
|
1922
|
+
case Ze.Point:
|
|
1923
1923
|
ai(g, v, a, m);
|
|
1924
1924
|
break;
|
|
1925
|
-
case
|
|
1925
|
+
case Ze.Range:
|
|
1926
1926
|
ri(d, v, a, m, g);
|
|
1927
1927
|
break;
|
|
1928
|
-
case
|
|
1928
|
+
case Ze.Free:
|
|
1929
1929
|
ni(g, v, a, m);
|
|
1930
1930
|
break;
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
1933
|
if (a.transition) {
|
|
1934
|
-
const m = Sa(
|
|
1934
|
+
const m = Sa(Ia);
|
|
1935
1935
|
si(g.node(), d.node(), f ?? /* @__PURE__ */ new Map(), m);
|
|
1936
1936
|
}
|
|
1937
1937
|
ii(n);
|
|
@@ -1939,21 +1939,21 @@ function _a(t, a) {
|
|
|
1939
1939
|
};
|
|
1940
1940
|
}
|
|
1941
1941
|
function oi(t, a) {
|
|
1942
|
-
if (!
|
|
1942
|
+
if (!Ge.valid(t))
|
|
1943
1943
|
return a;
|
|
1944
1944
|
try {
|
|
1945
|
-
return
|
|
1945
|
+
return Ge(t);
|
|
1946
1946
|
} catch {
|
|
1947
1947
|
return a;
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
1950
|
function Et(t) {
|
|
1951
|
-
return
|
|
1951
|
+
return Ge.valid(t) && Ge.contrast(t, "#fff") >= Ge.contrast(t, "#333") ? "#fff" : "#333";
|
|
1952
1952
|
}
|
|
1953
|
-
function
|
|
1954
|
-
return !
|
|
1953
|
+
function jd(t, a) {
|
|
1954
|
+
return !Ge.valid(t) || !Ge.valid(a) ? 1 : Ge.contrast(t, a);
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1956
|
+
function Zd(t) {
|
|
1957
1957
|
return t >= 7 ? "AAA" : t >= 4.5 ? "AA" : "Fail";
|
|
1958
1958
|
}
|
|
1959
1959
|
const Qa = 4.5;
|
|
@@ -1968,14 +1968,14 @@ function Ft(t) {
|
|
|
1968
1968
|
return "#fff";
|
|
1969
1969
|
}
|
|
1970
1970
|
function li(t, a = "#fff") {
|
|
1971
|
-
if (!
|
|
1972
|
-
return
|
|
1973
|
-
let e =
|
|
1974
|
-
const r = oi(a,
|
|
1975
|
-
if (
|
|
1971
|
+
if (!Ge.valid(t))
|
|
1972
|
+
return Ge.valid(a) ? Et(a) : "#333";
|
|
1973
|
+
let e = Ge(t);
|
|
1974
|
+
const r = oi(a, Ge("#fff"));
|
|
1975
|
+
if (Ge.contrast(e, r) >= Qa)
|
|
1976
1976
|
return e.hex();
|
|
1977
1977
|
const n = r.luminance() > 0.5;
|
|
1978
|
-
for (let s = 0; s < 20 && (e = n ? e.darken(0.3) : e.brighten(0.3), !(
|
|
1978
|
+
for (let s = 0; s < 20 && (e = n ? e.darken(0.3) : e.brighten(0.3), !(Ge.contrast(e, r) >= Qa)); s++)
|
|
1979
1979
|
;
|
|
1980
1980
|
return e.hex();
|
|
1981
1981
|
}
|
|
@@ -1983,14 +1983,14 @@ const un = 12, wr = 0.25, ci = 20;
|
|
|
1983
1983
|
function fc(t, a) {
|
|
1984
1984
|
if (t.length === 0)
|
|
1985
1985
|
return [];
|
|
1986
|
-
const e = oi(a,
|
|
1986
|
+
const e = oi(a, Ge("#fff")), r = Ge.valid(a) ? a : "#fff", n = e.luminance() > 0.5, s = t.map((o) => Ge.valid(o) ? dc(Ge(o), r, n) : Ge("#000"));
|
|
1987
1987
|
for (let o = 1; o < s.length; o++)
|
|
1988
|
-
|
|
1988
|
+
Ge.deltaE(s[o], s[o - 1]) >= un || (s[o] = uc(s[o], s[o - 1], r, n));
|
|
1989
1989
|
return s.map((o) => o.hex());
|
|
1990
1990
|
}
|
|
1991
1991
|
function dc(t, a, e) {
|
|
1992
1992
|
for (let r = 0; r < ci; r++) {
|
|
1993
|
-
if (
|
|
1993
|
+
if (Ge.contrast(t, a) >= Qa)
|
|
1994
1994
|
return t;
|
|
1995
1995
|
t = e ? t.darken(wr) : t.brighten(wr);
|
|
1996
1996
|
}
|
|
@@ -1998,26 +1998,26 @@ function dc(t, a, e) {
|
|
|
1998
1998
|
}
|
|
1999
1999
|
function uc(t, a, e, r) {
|
|
2000
2000
|
const n = gs(t, a, e, r);
|
|
2001
|
-
if (
|
|
2001
|
+
if (Ge.deltaE(n, a) >= un)
|
|
2002
2002
|
return n;
|
|
2003
2003
|
const s = gs(t, a, e, !r);
|
|
2004
|
-
return
|
|
2004
|
+
return Ge.deltaE(s, a) > Ge.deltaE(n, a) && Ge.contrast(s, e) >= Qa ? s : n;
|
|
2005
2005
|
}
|
|
2006
2006
|
function gs(t, a, e, r) {
|
|
2007
|
-
let n = t, s =
|
|
2007
|
+
let n = t, s = Ge.deltaE(t, a), o = t;
|
|
2008
2008
|
for (let i = 0; i < ci; i++) {
|
|
2009
2009
|
o = r ? o.darken(wr) : o.brighten(wr);
|
|
2010
|
-
const c =
|
|
2011
|
-
if (c > s &&
|
|
2010
|
+
const c = Ge.deltaE(o, a);
|
|
2011
|
+
if (c > s && Ge.contrast(o, e) >= Qa && (n = o, s = c), s >= un)
|
|
2012
2012
|
break;
|
|
2013
2013
|
}
|
|
2014
2014
|
return n;
|
|
2015
2015
|
}
|
|
2016
2016
|
const fi = /* @__PURE__ */ new WeakMap();
|
|
2017
|
-
function
|
|
2017
|
+
function Yt(t) {
|
|
2018
2018
|
return fi.get(t);
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2020
|
+
function Rt(t, a) {
|
|
2021
2021
|
fi.set(t, a);
|
|
2022
2022
|
}
|
|
2023
2023
|
let hc = 0;
|
|
@@ -2247,141 +2247,141 @@ function gr(t, a, e) {
|
|
|
2247
2247
|
return r;
|
|
2248
2248
|
}
|
|
2249
2249
|
const Ta = ["#4e79a7"], ys = 13;
|
|
2250
|
-
class Sc extends
|
|
2250
|
+
class Sc extends ct {
|
|
2251
2251
|
initialize() {
|
|
2252
2252
|
}
|
|
2253
2253
|
}
|
|
2254
2254
|
function ui(t, a, e = {}, r = !1) {
|
|
2255
2255
|
var Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z, S, T, O;
|
|
2256
|
-
|
|
2256
|
+
Ht(r);
|
|
2257
2257
|
let n = null, s, o;
|
|
2258
2258
|
const i = Vt.for(t);
|
|
2259
2259
|
if (r) {
|
|
2260
|
-
const z =
|
|
2261
|
-
o = z == null ? void 0 : z.margin, i.detach(), z && z.chartType !== "bar-vertical" && (n =
|
|
2262
|
-
for (const
|
|
2263
|
-
for (const [C, U] of Mt(
|
|
2260
|
+
const z = Yt(t);
|
|
2261
|
+
o = z == null ? void 0 : z.margin, i.detach(), z && z.chartType !== "bar-vertical" && (n = Bt(t)), s = /* @__PURE__ */ new Map();
|
|
2262
|
+
for (const I of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2263
|
+
for (const [C, U] of Mt(I))
|
|
2264
2264
|
s.set(C, U);
|
|
2265
2265
|
t.replaceChildren();
|
|
2266
2266
|
}
|
|
2267
|
-
const { body: c } = _t(t, e.frame), f = $t(c).width, d = e.categoryLabelLine === !0, g = wa(a.values, (Me = e.verticalAxis) == null ? void 0 : Me.range, (J = e.verticalAxis) == null ? void 0 : J.numberFormat, (ae = e.verticalAxis) == null ? void 0 : ae.scaleType), b = d ?
|
|
2267
|
+
const { body: c } = _t(t, e.frame), f = $t(c).width, d = e.categoryLabelLine === !0, g = wa(a.values, (Me = e.verticalAxis) == null ? void 0 : Me.range, (J = e.verticalAxis) == null ? void 0 : J.numberFormat, (ae = e.verticalAxis) == null ? void 0 : ae.scaleType), b = d ? He.Off : (ke = e.horizontalAxis) == null ? void 0 : ke.labelPosition, m = ea(f, (me = e.verticalAxis) == null ? void 0 : me.labelPosition, b, (Ce = e.verticalAxis) == null ? void 0 : Ce.direction, g);
|
|
2268
2268
|
if (!d) {
|
|
2269
|
-
const z = Math.max(0, f - (m.left ?? 50) - (m.right ?? 20)),
|
|
2270
|
-
|
|
2269
|
+
const z = Math.max(0, f - (m.left ?? 50) - (m.right ?? 20)), I = sn(a.labels, z, e.horizontalAxis);
|
|
2270
|
+
I !== void 0 && (m.bottom = I);
|
|
2271
2271
|
}
|
|
2272
|
-
const { chartArea: v, width: y, height: x, margin: A } = Gt(c, m), $ = x - (d ? ys : 0), P = Kt(o, A), D = $c(a, e),
|
|
2272
|
+
const { chartArea: v, width: y, height: x, margin: A } = Gt(c, m), $ = x - (d ? ys : 0), P = Kt(o, A), D = $c(a, e), H = D.map((z) => ({
|
|
2273
2273
|
label: z,
|
|
2274
2274
|
value: a.values[a.labels.indexOf(z)]
|
|
2275
|
-
})), j = e.swapLabelValue === !0, _ = e.waterfall === !0,
|
|
2275
|
+
})), j = e.swapLabelValue === !0, _ = e.waterfall === !0, B = [];
|
|
2276
2276
|
if (_) {
|
|
2277
2277
|
let z = 0;
|
|
2278
|
-
for (const
|
|
2278
|
+
for (const I of H) {
|
|
2279
2279
|
const C = z;
|
|
2280
|
-
z +=
|
|
2280
|
+
z += I.value, B.push({ label: I.label, value: I.value, y0: C, y1: z, isTotal: !1 });
|
|
2281
2281
|
}
|
|
2282
|
-
e.waterfallTotal &&
|
|
2282
|
+
e.waterfallTotal && B.push({ label: "Total", value: z, y0: 0, y1: z, isTotal: !0 });
|
|
2283
2283
|
}
|
|
2284
|
-
const K = _ ?
|
|
2284
|
+
const K = _ ? B.map((z) => z.label) : D, X = p.scaleBand().domain(K).range([0, y]).padding(ka(e.barGap)), te = ((we = e.verticalAxis) == null ? void 0 : we.scaleType) === "log", fe = _ ? B.flatMap((z) => [z.y0, z.y1]) : H.map((z) => z.value);
|
|
2285
2285
|
let [se, F] = Va(fe, (Ne = e.verticalAxis) == null ? void 0 : Ne.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.scaleType);
|
|
2286
2286
|
if (e.valueLabels && se < 0 && ((Z = (Q = e.verticalAxis) == null ? void 0 : Q.range) == null ? void 0 : Z.min) == null) {
|
|
2287
2287
|
const z = F - se;
|
|
2288
2288
|
se -= z * 0.1;
|
|
2289
2289
|
}
|
|
2290
|
-
const
|
|
2290
|
+
const Y = te ? p.scaleSymlog().domain([se, F]).nice().range([$, 0]) : p.scaleLinear().domain([se, F]).nice().range([$, 0]);
|
|
2291
2291
|
i.attach(v, P);
|
|
2292
|
-
const
|
|
2293
|
-
const z = new Map(
|
|
2292
|
+
const R = j && e.valueLabels && !_ ? (() => {
|
|
2293
|
+
const z = new Map(H.map((I) => [I.label, I.value]));
|
|
2294
2294
|
return {
|
|
2295
2295
|
...e.horizontalAxis,
|
|
2296
2296
|
width: y,
|
|
2297
|
-
tickFormat: (
|
|
2297
|
+
tickFormat: (I) => String(z.get(I) ?? I)
|
|
2298
2298
|
};
|
|
2299
|
-
})() : { ...e.horizontalAxis, width: y }, ie = d ? { ...
|
|
2299
|
+
})() : { ...e.horizontalAxis, width: y }, ie = d ? { ...R, labelPosition: He.Off } : R;
|
|
2300
2300
|
i.update({
|
|
2301
|
-
vertical: { scale:
|
|
2301
|
+
vertical: { scale: Y, height: x, options: { ...e.verticalAxis, gridWidth: y, topPadding: A.top } },
|
|
2302
2302
|
horizontal: { scale: X, height: x, options: ie }
|
|
2303
|
-
}), !te && se < 0 && F > 0 && p.select(v).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", y).attr("y1",
|
|
2303
|
+
}), !te && se < 0 && F > 0 && p.select(v).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", y).attr("y1", Y(0)).attr("y2", Y(0)).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2304
2304
|
const he = new Map(
|
|
2305
2305
|
(e.colorizes ?? []).map((z) => [z.target, z.color])
|
|
2306
2306
|
), ve = new Set((e.highlights ?? []).map((z) => z.target)), ce = v.ownerSVGElement, ue = ta(ce, t, "bars", { x: 0, y: 0, width: y, height: $ }), Se = p.select(ce).select("defs"), ye = ue.replace(/^bc-clip-/, ""), ge = p.select(v).append("g").attr("clip-path", `url(#${ue})`);
|
|
2307
2307
|
if (e.barBackground) {
|
|
2308
|
-
const z = (e.colors ?? Ta)[0],
|
|
2309
|
-
ge.selectAll(".bc-bar-bg").data(
|
|
2308
|
+
const z = (e.colors ?? Ta)[0], I = _ ? K : H.map((C) => C.label);
|
|
2309
|
+
ge.selectAll(".bc-bar-bg").data(I, (C) => C).enter().append("rect").attr("class", "bc-bar-bg").attr("x", (C) => X(C) ?? 0).attr("y", 0).attr("width", X.bandwidth()).attr("height", $).attr("fill", z).attr("opacity", 0.18);
|
|
2310
2310
|
}
|
|
2311
|
-
const xe = _ ? K :
|
|
2311
|
+
const xe = _ ? K : H.map((z) => z.label);
|
|
2312
2312
|
if (e.barSeparators && xe.length > 1) {
|
|
2313
2313
|
const z = X.step();
|
|
2314
|
-
for (let
|
|
2315
|
-
const C = (X(xe[
|
|
2314
|
+
for (let I = 1; I < xe.length; I++) {
|
|
2315
|
+
const C = (X(xe[I - 1]) ?? 0) + X.bandwidth() + (z - X.bandwidth()) / 2;
|
|
2316
2316
|
ge.append("line").attr("class", "bc-bar-separator").attr("x1", C).attr("x2", C).attr("y1", 0).attr("y2", $).attr("stroke", "currentColor").attr("opacity", 0.15);
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
|
-
if (!_ && e.connectedColumns &&
|
|
2320
|
-
const z = e.colors ?? Ta,
|
|
2321
|
-
for (let C = 0; C <
|
|
2322
|
-
const U =
|
|
2319
|
+
if (!_ && e.connectedColumns && H.length > 1) {
|
|
2320
|
+
const z = e.colors ?? Ta, I = e.connectionsOpacity ?? 0.15;
|
|
2321
|
+
for (let C = 0; C < H.length - 1; C++) {
|
|
2322
|
+
const U = H[C], E = H[C + 1];
|
|
2323
2323
|
if (U.value == null || E.value == null || Number.isNaN(U.value) || Number.isNaN(E.value) || U.value === 0 || E.value === 0)
|
|
2324
2324
|
continue;
|
|
2325
|
-
const W = (X(U.label) ?? 0) + X.bandwidth(), Ae = X(E.label) ?? 0, Pe = Math.min(
|
|
2326
|
-
let
|
|
2327
|
-
if (
|
|
2328
|
-
|
|
2325
|
+
const W = (X(U.label) ?? 0) + X.bandwidth(), Ae = X(E.label) ?? 0, Pe = Math.min(Y(0), Y(U.value)), Be = Math.min(Y(0), Y(E.value)), Ye = Y(0), We = he.get(U.label) ?? z[0], Xe = he.get(E.label) ?? z[0];
|
|
2326
|
+
let Qe;
|
|
2327
|
+
if (We === Xe)
|
|
2328
|
+
Qe = We;
|
|
2329
2329
|
else {
|
|
2330
|
-
const
|
|
2331
|
-
Re.append("stop").attr("offset", "0%").attr("stop-color",
|
|
2330
|
+
const Ue = `bc-conn-grad-${ye}-${C}`, Re = Se.append("linearGradient").attr("id", Ue).attr("x1", "0%").attr("x2", "100%").attr("y1", "0%").attr("y2", "0%");
|
|
2331
|
+
Re.append("stop").attr("offset", "0%").attr("stop-color", We), Re.append("stop").attr("offset", "100%").attr("stop-color", Xe), Qe = `url(#${Ue})`;
|
|
2332
2332
|
}
|
|
2333
|
-
ge.append("polygon").attr("class", "bc-bar-connection").attr("points", `${W},${Pe} ${Ae},${
|
|
2333
|
+
ge.append("polygon").attr("class", "bc-bar-connection").attr("points", `${W},${Pe} ${Ae},${Be} ${Ae},${Ye} ${W},${Ye}`).attr("fill", Qe).attr("opacity", I).attr("pointer-events", "none");
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
2336
|
const pe = p.select(v).append("g");
|
|
2337
2337
|
if (_) {
|
|
2338
|
-
const z = e.colors ?? Ta,
|
|
2339
|
-
if (e.connectedColumns &&
|
|
2338
|
+
const z = e.colors ?? Ta, I = "#333";
|
|
2339
|
+
if (e.connectedColumns && B.length > 1) {
|
|
2340
2340
|
const C = e.colors ?? Ta, U = e.connectionsOpacity ?? 0.15;
|
|
2341
|
-
for (let E = 0; E <
|
|
2342
|
-
const W =
|
|
2341
|
+
for (let E = 0; E < B.length - 1; E++) {
|
|
2342
|
+
const W = B[E], Ae = B[E + 1];
|
|
2343
2343
|
if (Ae.isTotal || W.value == null || Ae.value == null || Number.isNaN(W.value) || Number.isNaN(Ae.value) || W.value === 0 || Ae.value === 0)
|
|
2344
2344
|
continue;
|
|
2345
|
-
const Pe = (X(W.label) ?? 0) + X.bandwidth(),
|
|
2346
|
-
let
|
|
2347
|
-
if (
|
|
2348
|
-
|
|
2345
|
+
const Pe = (X(W.label) ?? 0) + X.bandwidth(), Be = X(Ae.label) ?? 0, Ye = Y(W.y1), We = Y(Ae.y1), Xe = Y(W.y0), Qe = Y(Ae.y0), Ue = he.get(W.label) ?? C[0], Re = he.get(Ae.label) ?? C[0];
|
|
2346
|
+
let ft;
|
|
2347
|
+
if (Ue === Re)
|
|
2348
|
+
ft = Ue;
|
|
2349
2349
|
else {
|
|
2350
|
-
const mt = `bc-conn-grad-${ye}-${E}`,
|
|
2351
|
-
|
|
2350
|
+
const mt = `bc-conn-grad-${ye}-${E}`, at = Se.append("linearGradient").attr("id", mt).attr("x1", "0%").attr("x2", "100%").attr("y1", "0%").attr("y2", "0%");
|
|
2351
|
+
at.append("stop").attr("offset", "0%").attr("stop-color", Ue), at.append("stop").attr("offset", "100%").attr("stop-color", Re), ft = `url(#${mt})`;
|
|
2352
2352
|
}
|
|
2353
|
-
ge.append("polygon").attr("class", "bc-bar-connection").attr("points", `${Pe},${Ye} ${
|
|
2353
|
+
ge.append("polygon").attr("class", "bc-bar-connection").attr("points", `${Pe},${Ye} ${Be},${We} ${Be},${Qe} ${Pe},${Xe}`).attr("fill", ft).attr("opacity", U).attr("pointer-events", "none");
|
|
2354
2354
|
}
|
|
2355
2355
|
}
|
|
2356
|
-
for (let C = 0; C <
|
|
2357
|
-
const U =
|
|
2356
|
+
for (let C = 0; C < B.length - 1; C++) {
|
|
2357
|
+
const U = B[C], E = B[C + 1];
|
|
2358
2358
|
if (E.isTotal)
|
|
2359
2359
|
break;
|
|
2360
|
-
ge.append("line").attr("class", "bc-waterfall-connector").attr("x1", (X(U.label) ?? 0) + X.bandwidth()).attr("x2", X(E.label) ?? 0).attr("y1",
|
|
2360
|
+
ge.append("line").attr("class", "bc-waterfall-connector").attr("x1", (X(U.label) ?? 0) + X.bandwidth()).attr("x2", X(E.label) ?? 0).attr("y1", Y(U.y1)).attr("y2", Y(U.y1)).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
|
|
2361
2361
|
}
|
|
2362
|
-
if (ge.selectAll(".bc-bar").data(
|
|
2362
|
+
if (ge.selectAll(".bc-bar").data(B, (C) => C.label).enter().append("rect").attr("class", "bc-bar").attr("x", (C) => X(C.label) ?? 0).attr("y", (C) => Math.min(Y(C.y0), Y(C.y1))).attr("width", X.bandwidth()).attr("height", (C) => Math.abs(Y(C.y0) - Y(C.y1))).attr("fill", (C) => C.isTotal ? I : he.get(C.label) ?? z[0]).attr("opacity", (C) => ve.size > 0 ? ve.has(C.label) ? 1 : 0.2 : null), e.valueLabels) {
|
|
2363
2363
|
const C = e.valueLabelPosition ?? ze.Auto, U = ga(((S = e.verticalAxis) == null ? void 0 : S.numberFormat) ?? ""), E = (W) => U ? U(W) : String(W);
|
|
2364
|
-
pe.selectAll(".bc-value-label").data(
|
|
2365
|
-
const Ae = Math.min(
|
|
2364
|
+
pe.selectAll(".bc-value-label").data(B, (W) => W.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("x", (W) => (X(W.label) ?? 0) + X.bandwidth() / 2).attr("y", (W) => {
|
|
2365
|
+
const Ae = Math.min(Y(W.y0), Y(W.y1)), Pe = Math.abs(Y(W.y0) - Y(W.y1));
|
|
2366
2366
|
return C === ze.Inside ? Ae + Pe / 2 : Ae - 4;
|
|
2367
|
-
}).attr("text-anchor", "middle").attr("dominant-baseline", C === ze.Inside ? "central" : "auto").attr("fill", (W) => C === ze.Inside ? Et(W.isTotal ?
|
|
2367
|
+
}).attr("text-anchor", "middle").attr("dominant-baseline", C === ze.Inside ? "central" : "auto").attr("fill", (W) => C === ze.Inside ? Et(W.isTotal ? I : he.get(W.label) ?? z[0]) : "currentColor").text((W) => j ? W.label : E(W.isTotal ? W.y1 : W.value));
|
|
2368
2368
|
}
|
|
2369
2369
|
} else {
|
|
2370
|
-
const z = $a(t),
|
|
2370
|
+
const z = $a(t), I = ge.append("g").node();
|
|
2371
2371
|
Ga(z, {
|
|
2372
2372
|
role: "mark-per-category",
|
|
2373
|
-
parent:
|
|
2373
|
+
parent: I,
|
|
2374
2374
|
selector: ".bc-bar",
|
|
2375
|
-
data:
|
|
2375
|
+
data: H,
|
|
2376
2376
|
key: (U) => U.label,
|
|
2377
2377
|
insert: (U) => U.append("rect").attr("class", "bc-bar"),
|
|
2378
2378
|
attrs: (U) => {
|
|
2379
2379
|
const E = ve.size > 0;
|
|
2380
2380
|
return {
|
|
2381
2381
|
x: X(U.label) ?? 0,
|
|
2382
|
-
y: Math.min(
|
|
2382
|
+
y: Math.min(Y(0), Y(U.value)),
|
|
2383
2383
|
width: X.bandwidth(),
|
|
2384
|
-
height: Math.abs(
|
|
2384
|
+
height: Math.abs(Y(U.value) - Y(0)),
|
|
2385
2385
|
fill: he.get(U.label) ?? (e.colors ?? Ta)[0],
|
|
2386
2386
|
opacity: E ? ve.has(U.label) ? 1 : 0.35 : 1
|
|
2387
2387
|
};
|
|
@@ -2396,14 +2396,14 @@ function ui(t, a, e = {}, r = !1) {
|
|
|
2396
2396
|
color: e.crosshairColor
|
|
2397
2397
|
})), (O = e.annotations) != null && O.length && C.use(_a(e.annotations, {
|
|
2398
2398
|
scaleX: X,
|
|
2399
|
-
scaleY:
|
|
2400
|
-
data:
|
|
2399
|
+
scaleY: Y,
|
|
2400
|
+
data: H,
|
|
2401
2401
|
width: y,
|
|
2402
2402
|
height: $,
|
|
2403
2403
|
backgroundColor: Ft(t),
|
|
2404
2404
|
transition: r,
|
|
2405
2405
|
priorAnnotations: s
|
|
2406
|
-
})), C.draw(
|
|
2406
|
+
})), C.draw(H), e.valueLabels && Lc(pe, H, X, Y, {
|
|
2407
2407
|
position: e.valueLabelPosition,
|
|
2408
2408
|
colorOverrides: he,
|
|
2409
2409
|
colors: e.colors ?? Ta,
|
|
@@ -2412,10 +2412,10 @@ function ui(t, a, e = {}, r = !1) {
|
|
|
2412
2412
|
}
|
|
2413
2413
|
if (d) {
|
|
2414
2414
|
const z = p.select(v).append("g").attr("class", "bc-category-labels");
|
|
2415
|
-
for (const
|
|
2416
|
-
z.append("text").attr("class", "bc-category-label").attr("x", (X(
|
|
2415
|
+
for (const I of K)
|
|
2416
|
+
z.append("text").attr("class", "bc-category-label").attr("x", (X(I) ?? 0) + X.bandwidth() / 2).attr("y", $ + ys / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(I);
|
|
2417
2417
|
}
|
|
2418
|
-
|
|
2418
|
+
Rt(t, { chartType: "bar-vertical", margin: A }), n && (Nt(ge.node()), It(t, n));
|
|
2419
2419
|
}
|
|
2420
2420
|
function kc(t, a, e, r) {
|
|
2421
2421
|
const n = Math.abs(e(t.value) - e(0)), s = r === ze.Inside, o = (a(t.label) ?? 0) + a.bandwidth() / 2, i = "middle";
|
|
@@ -2448,10 +2448,10 @@ function Lc(t, a, e, r, n) {
|
|
|
2448
2448
|
}
|
|
2449
2449
|
function $c(t, a) {
|
|
2450
2450
|
const e = t.labels.map((r, n) => ({ label: r, value: t.values[n] }));
|
|
2451
|
-
return a.sort ===
|
|
2451
|
+
return a.sort === lt.Ascending ? e.sort((r, n) => r.value - n.value) : a.sort === lt.Descending && e.sort((r, n) => n.value - r.value), e.map((r) => r.label);
|
|
2452
2452
|
}
|
|
2453
2453
|
const za = ["#4e79a7"], vs = 13, Mc = "11px sans-serif", Ur = 4;
|
|
2454
|
-
class Cc extends
|
|
2454
|
+
class Cc extends ct {
|
|
2455
2455
|
initialize() {
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
@@ -2466,18 +2466,18 @@ function jr(t) {
|
|
|
2466
2466
|
}
|
|
2467
2467
|
function hi(t, a, e = {}, r = !1) {
|
|
2468
2468
|
var Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z;
|
|
2469
|
-
|
|
2469
|
+
Ht(r);
|
|
2470
2470
|
let n = null, s, o;
|
|
2471
2471
|
const i = Vt.for(t);
|
|
2472
2472
|
if (r) {
|
|
2473
|
-
const S =
|
|
2474
|
-
o = S == null ? void 0 : S.margin, i.detach(), S && S.chartType !== "bar-horizontal" && (n =
|
|
2473
|
+
const S = Yt(t);
|
|
2474
|
+
o = S == null ? void 0 : S.margin, i.detach(), S && S.chartType !== "bar-horizontal" && (n = Bt(t)), s = /* @__PURE__ */ new Map();
|
|
2475
2475
|
for (const T of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2476
2476
|
for (const [O, z] of Mt(T))
|
|
2477
2477
|
s.set(O, z);
|
|
2478
2478
|
t.replaceChildren();
|
|
2479
2479
|
}
|
|
2480
|
-
const { body: c } = _t(t, e.frame), f = $t(c).width, d = f > 0 && f < 400 && ((Me = e.verticalAxis) == null ? void 0 : Me.labelPosition) !== "outside", g = e.categoryLabelLine === !0 || d, b = Sr(a.labels), m = g ?
|
|
2480
|
+
const { body: c } = _t(t, e.frame), f = $t(c).width, d = f > 0 && f < 400 && ((Me = e.verticalAxis) == null ? void 0 : Me.labelPosition) !== "outside", g = e.categoryLabelLine === !0 || d, b = Sr(a.labels), m = g ? He.Off : (J = e.verticalAxis) == null ? void 0 : J.labelPosition, v = ea(f, m, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, b, (me = e.horizontalAxis) == null ? void 0 : me.showAxis), y = e.valueLabelPosition ?? ze.Auto, x = e.swapLabelValue === !0;
|
|
2481
2481
|
if (e.valueLabels && y !== ze.Inside)
|
|
2482
2482
|
if (x) {
|
|
2483
2483
|
const S = a.labels.reduce((O, z) => O.length > z.length ? O : z, ""), T = jr(S) + Ur;
|
|
@@ -2486,11 +2486,11 @@ function hi(t, a, e = {}, r = !1) {
|
|
|
2486
2486
|
const S = Math.max(...a.values), T = Math.min(...a.values), O = S > 0 ? jr(String(S)) + Ur : 0, z = T < 0 ? jr(String(T)) + Ur : 0;
|
|
2487
2487
|
v.right = Math.max(v.right ?? 15, O), z > 0 && (v.left = (v.left ?? 50) + z);
|
|
2488
2488
|
}
|
|
2489
|
-
const { chartArea: A, width: w, height: $, margin: P } = Gt(c, v), D = g ? vs : 0,
|
|
2489
|
+
const { chartArea: A, width: w, height: $, margin: P } = Gt(c, v), D = g ? vs : 0, H = Kt(o, P), j = Tc(a, e), _ = j.map((S) => ({
|
|
2490
2490
|
label: S,
|
|
2491
2491
|
value: a.values[a.labels.indexOf(S)]
|
|
2492
|
-
})),
|
|
2493
|
-
if (
|
|
2492
|
+
})), B = e.waterfall === !0, K = [];
|
|
2493
|
+
if (B) {
|
|
2494
2494
|
let S = 0;
|
|
2495
2495
|
for (const T of _) {
|
|
2496
2496
|
const O = S;
|
|
@@ -2498,82 +2498,82 @@ function hi(t, a, e = {}, r = !1) {
|
|
|
2498
2498
|
}
|
|
2499
2499
|
e.waterfallTotal && K.push({ label: "Total", value: S, x0: 0, x1: S, isTotal: !0 });
|
|
2500
2500
|
}
|
|
2501
|
-
const X = ((Ce = e.horizontalAxis) == null ? void 0 : Ce.scaleType) === "log", te =
|
|
2501
|
+
const X = ((Ce = e.horizontalAxis) == null ? void 0 : Ce.scaleType) === "log", te = B ? K.flatMap((S) => [S.x0, S.x1]) : _.map((S) => S.value), [fe, se] = Va(te, (we = e.horizontalAxis) == null ? void 0 : we.range, (Ne = e.horizontalAxis) == null ? void 0 : Ne.scaleType), F = X ? p.scaleSymlog().domain([fe, se]).nice().range([0, w]) : p.scaleLinear().domain([fe, se]).nice().range([0, w]), Y = B ? K.map((S) => S.label) : j, R = p.scaleBand().domain(Y).range([0, $]).padding(ka(e.barGap)), ie = x && e.valueLabels && !B ? (() => {
|
|
2502
2502
|
const S = new Map(_.map((T) => [T.label, T.value]));
|
|
2503
2503
|
return {
|
|
2504
2504
|
...e.verticalAxis,
|
|
2505
2505
|
topPadding: P.top,
|
|
2506
2506
|
tickFormat: (T) => String(S.get(T) ?? T)
|
|
2507
2507
|
};
|
|
2508
|
-
})() : { ...e.verticalAxis, topPadding: P.top }, he = g ? { ...ie, labelPosition:
|
|
2509
|
-
i.attach(A,
|
|
2508
|
+
})() : { ...e.verticalAxis, topPadding: P.top }, he = g ? { ...ie, labelPosition: He.Off, ...d ? { showAxis: !1 } : {} } : ie;
|
|
2509
|
+
i.attach(A, H), i.update({
|
|
2510
2510
|
horizontal: { scale: F, height: $, options: { ...e.horizontalAxis, width: w } },
|
|
2511
|
-
vertical: { scale:
|
|
2511
|
+
vertical: { scale: R, height: $, options: he },
|
|
2512
2512
|
order: "horizontal-first"
|
|
2513
2513
|
}), !X && fe < 0 && se > 0 && p.select(A).append("line").attr("class", "bc-zero-baseline").attr("x1", F(0)).attr("x2", F(0)).attr("y1", 0).attr("y2", $).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2514
2514
|
const ve = new Map(
|
|
2515
2515
|
(e.colorizes ?? []).map((S) => [S.target, S.color])
|
|
2516
2516
|
), ce = new Set((e.highlights ?? []).map((S) => S.target)), ue = A.ownerSVGElement, Se = ta(ue, t, "bars", { x: 0, y: 0, width: w, height: $ }), ye = p.select(ue).select("defs"), ge = Se.replace(/^bc-clip-/, ""), xe = p.select(A).append("g").attr("clip-path", `url(#${Se})`);
|
|
2517
2517
|
if (e.barBackground) {
|
|
2518
|
-
const S = (e.colors ?? za)[0], T =
|
|
2519
|
-
xe.selectAll(".bc-bar-bg").data(T, (O) => O).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (O) => (
|
|
2518
|
+
const S = (e.colors ?? za)[0], T = B ? Y : _.map((O) => O.label);
|
|
2519
|
+
xe.selectAll(".bc-bar-bg").data(T, (O) => O).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (O) => (R(O) ?? 0) + D).attr("width", w).attr("height", R.bandwidth() - D).attr("fill", S).attr("opacity", 0.18);
|
|
2520
2520
|
}
|
|
2521
|
-
const pe =
|
|
2521
|
+
const pe = B ? Y : _.map((S) => S.label);
|
|
2522
2522
|
if (e.barSeparators && pe.length > 1) {
|
|
2523
|
-
const S =
|
|
2523
|
+
const S = R.step();
|
|
2524
2524
|
for (let T = 1; T < pe.length; T++) {
|
|
2525
|
-
const O = (
|
|
2525
|
+
const O = (R(pe[T - 1]) ?? 0) + R.bandwidth() + (S - R.bandwidth()) / 2;
|
|
2526
2526
|
xe.append("line").attr("class", "bc-bar-separator").attr("x1", 0).attr("x2", w).attr("y1", O).attr("y2", O).attr("stroke", "currentColor").attr("opacity", 0.15);
|
|
2527
2527
|
}
|
|
2528
2528
|
}
|
|
2529
|
-
if (!
|
|
2529
|
+
if (!B && e.connectedColumns && _.length > 1) {
|
|
2530
2530
|
const S = e.colors ?? za, T = e.connectionsOpacity ?? 0.15;
|
|
2531
2531
|
for (let O = 0; O < _.length - 1; O++) {
|
|
2532
|
-
const z = _[O],
|
|
2533
|
-
if (z.value == null ||
|
|
2532
|
+
const z = _[O], I = _[O + 1];
|
|
2533
|
+
if (z.value == null || I.value == null || Number.isNaN(z.value) || Number.isNaN(I.value) || z.value === 0 || I.value === 0)
|
|
2534
2534
|
continue;
|
|
2535
|
-
const C = (
|
|
2535
|
+
const C = (R(z.label) ?? 0) + R.bandwidth(), U = (R(I.label) ?? 0) + D, E = Math.max(F(0), F(z.value)), W = Math.max(F(0), F(I.value)), Ae = F(0), Pe = ve.get(z.label) ?? S[0], Be = ve.get(I.label) ?? S[0];
|
|
2536
2536
|
let Ye;
|
|
2537
|
-
if (Pe ===
|
|
2537
|
+
if (Pe === Be)
|
|
2538
2538
|
Ye = Pe;
|
|
2539
2539
|
else {
|
|
2540
|
-
const
|
|
2541
|
-
|
|
2540
|
+
const We = `bc-conn-grad-${ge}-${O}`, Xe = ye.append("linearGradient").attr("id", We).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
|
|
2541
|
+
Xe.append("stop").attr("offset", "0%").attr("stop-color", Pe), Xe.append("stop").attr("offset", "100%").attr("stop-color", Be), Ye = `url(#${We})`;
|
|
2542
2542
|
}
|
|
2543
2543
|
xe.append("polygon").attr("class", "bc-bar-connection").attr("points", `${E},${C} ${W},${U} ${Ae},${U} ${Ae},${C}`).attr("fill", Ye).attr("opacity", T).attr("pointer-events", "none");
|
|
2544
2544
|
}
|
|
2545
2545
|
}
|
|
2546
|
-
if (
|
|
2546
|
+
if (B) {
|
|
2547
2547
|
const S = e.colors ?? za, T = "#333";
|
|
2548
2548
|
if (e.connectedColumns && K.length > 1) {
|
|
2549
2549
|
const O = e.colors ?? za, z = e.connectionsOpacity ?? 0.15;
|
|
2550
|
-
for (let
|
|
2551
|
-
const C = K[
|
|
2550
|
+
for (let I = 0; I < K.length - 1; I++) {
|
|
2551
|
+
const C = K[I], U = K[I + 1];
|
|
2552
2552
|
if (U.isTotal || C.value == null || U.value == null || Number.isNaN(C.value) || Number.isNaN(U.value) || C.value === 0 || U.value === 0)
|
|
2553
2553
|
continue;
|
|
2554
|
-
const E = (
|
|
2555
|
-
let
|
|
2556
|
-
if (
|
|
2557
|
-
|
|
2554
|
+
const E = (R(C.label) ?? 0) + R.bandwidth(), W = (R(U.label) ?? 0) + D, Ae = F(C.x1), Pe = F(U.x1), Be = F(C.x0), Ye = F(U.x0), We = ve.get(C.label) ?? O[0], Xe = ve.get(U.label) ?? O[0];
|
|
2555
|
+
let Qe;
|
|
2556
|
+
if (We === Xe)
|
|
2557
|
+
Qe = We;
|
|
2558
2558
|
else {
|
|
2559
|
-
const
|
|
2560
|
-
Re.append("stop").attr("offset", "0%").attr("stop-color",
|
|
2559
|
+
const Ue = `bc-conn-grad-${ge}-${I}`, Re = ye.append("linearGradient").attr("id", Ue).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
|
|
2560
|
+
Re.append("stop").attr("offset", "0%").attr("stop-color", We), Re.append("stop").attr("offset", "100%").attr("stop-color", Xe), Qe = `url(#${Ue})`;
|
|
2561
2561
|
}
|
|
2562
|
-
xe.append("polygon").attr("class", "bc-bar-connection").attr("points", `${Ae},${E} ${Pe},${W} ${Ye},${W} ${
|
|
2562
|
+
xe.append("polygon").attr("class", "bc-bar-connection").attr("points", `${Ae},${E} ${Pe},${W} ${Ye},${W} ${Be},${E}`).attr("fill", Qe).attr("opacity", z).attr("pointer-events", "none");
|
|
2563
2563
|
}
|
|
2564
2564
|
}
|
|
2565
2565
|
for (let O = 0; O < K.length - 1; O++) {
|
|
2566
|
-
const z = K[O],
|
|
2567
|
-
if (
|
|
2566
|
+
const z = K[O], I = K[O + 1];
|
|
2567
|
+
if (I.isTotal)
|
|
2568
2568
|
break;
|
|
2569
|
-
xe.append("line").attr("class", "bc-waterfall-connector").attr("x1", F(z.x1)).attr("x2", F(z.x1)).attr("y1", (
|
|
2569
|
+
xe.append("line").attr("class", "bc-waterfall-connector").attr("x1", F(z.x1)).attr("x2", F(z.x1)).attr("y1", (R(z.label) ?? 0) + R.bandwidth()).attr("y2", (R(I.label) ?? 0) + D).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
|
|
2570
2570
|
}
|
|
2571
|
-
if (xe.selectAll(".bc-bar").data(K, (O) => O.label).enter().append("rect").attr("class", "bc-bar").attr("x", (O) => Math.min(F(O.x0), F(O.x1))).attr("y", (O) => (
|
|
2572
|
-
const O = y, z = ga(((Oe = e.horizontalAxis) == null ? void 0 : Oe.numberFormat) ?? ""),
|
|
2573
|
-
p.select(A).append("g").selectAll(".bc-value-label").data(K, (U) => U.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("dominant-baseline", "central").attr("y", (U) => (
|
|
2571
|
+
if (xe.selectAll(".bc-bar").data(K, (O) => O.label).enter().append("rect").attr("class", "bc-bar").attr("x", (O) => Math.min(F(O.x0), F(O.x1))).attr("y", (O) => (R(O.label) ?? 0) + D).attr("width", (O) => Math.abs(F(O.x1) - F(O.x0))).attr("height", R.bandwidth() - D).attr("fill", (O) => O.isTotal ? T : ve.get(O.label) ?? S[0]).attr("opacity", (O) => ce.size > 0 ? ce.has(O.label) ? 1 : 0.35 : null), e.valueLabels) {
|
|
2572
|
+
const O = y, z = ga(((Oe = e.horizontalAxis) == null ? void 0 : Oe.numberFormat) ?? ""), I = (U) => z ? z(U) : String(U);
|
|
2573
|
+
p.select(A).append("g").selectAll(".bc-value-label").data(K, (U) => U.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("dominant-baseline", "central").attr("y", (U) => (R(U.label) ?? 0) + D + (R.bandwidth() - D) / 2).attr("x", (U) => {
|
|
2574
2574
|
const E = Math.max(F(U.x0), F(U.x1));
|
|
2575
2575
|
return O === ze.Inside ? E - 4 : E + 4;
|
|
2576
|
-
}).attr("text-anchor", O === ze.Inside ? "end" : "start").attr("fill", (U) => O === ze.Inside ? Et(U.isTotal ? T : ve.get(U.label) ?? S[0]) : "currentColor").text((U) => x ? U.label :
|
|
2576
|
+
}).attr("text-anchor", O === ze.Inside ? "end" : "start").attr("fill", (U) => O === ze.Inside ? Et(U.isTotal ? T : ve.get(U.label) ?? S[0]) : "currentColor").text((U) => x ? U.label : I(U.isTotal ? U.x1 : U.value));
|
|
2577
2577
|
}
|
|
2578
2578
|
} else {
|
|
2579
2579
|
const S = $a(t), T = xe.append("g").node();
|
|
@@ -2585,14 +2585,14 @@ function hi(t, a, e = {}, r = !1) {
|
|
|
2585
2585
|
key: (z) => z.label,
|
|
2586
2586
|
insert: (z) => z.append("rect").attr("class", "bc-bar"),
|
|
2587
2587
|
attrs: (z) => {
|
|
2588
|
-
const
|
|
2588
|
+
const I = ce.size > 0;
|
|
2589
2589
|
return {
|
|
2590
2590
|
x: Math.min(F(0), F(z.value)),
|
|
2591
|
-
y: (
|
|
2591
|
+
y: (R(z.label) ?? 0) + D,
|
|
2592
2592
|
width: Math.abs(F(z.value) - F(0)),
|
|
2593
|
-
height:
|
|
2593
|
+
height: R.bandwidth() - D,
|
|
2594
2594
|
fill: ve.get(z.label) ?? (e.colors ?? za)[0],
|
|
2595
|
-
opacity:
|
|
2595
|
+
opacity: I ? ce.has(z.label) ? 1 : 0.35 : 1
|
|
2596
2596
|
};
|
|
2597
2597
|
}
|
|
2598
2598
|
});
|
|
@@ -2603,20 +2603,20 @@ function hi(t, a, e = {}, r = !1) {
|
|
|
2603
2603
|
direction: e.crosshairDirection,
|
|
2604
2604
|
style: e.crosshairStyle,
|
|
2605
2605
|
color: e.crosshairColor,
|
|
2606
|
-
orientation:
|
|
2606
|
+
orientation: st.Horizontal
|
|
2607
2607
|
})), (Z = e.annotations) != null && Z.length && O.use(_a(e.annotations, {
|
|
2608
|
-
scaleX:
|
|
2608
|
+
scaleX: R,
|
|
2609
2609
|
scaleY: F,
|
|
2610
2610
|
data: _,
|
|
2611
2611
|
width: w,
|
|
2612
2612
|
height: $,
|
|
2613
2613
|
backgroundColor: Ft(t),
|
|
2614
|
-
orientation:
|
|
2614
|
+
orientation: st.Horizontal,
|
|
2615
2615
|
transition: r,
|
|
2616
2616
|
priorAnnotations: s
|
|
2617
2617
|
})), O.draw(_), e.valueLabels) {
|
|
2618
2618
|
const z = p.select(A).append("g");
|
|
2619
|
-
Pc(z, _, F,
|
|
2619
|
+
Pc(z, _, F, R, {
|
|
2620
2620
|
position: y,
|
|
2621
2621
|
colorOverrides: ve,
|
|
2622
2622
|
colors: e.colors ?? za,
|
|
@@ -2627,12 +2627,12 @@ function hi(t, a, e = {}, r = !1) {
|
|
|
2627
2627
|
}
|
|
2628
2628
|
if (g) {
|
|
2629
2629
|
const S = p.select(A).append("g").attr("class", "bc-category-labels");
|
|
2630
|
-
for (const T of
|
|
2631
|
-
const O =
|
|
2630
|
+
for (const T of Y) {
|
|
2631
|
+
const O = R(T) ?? 0;
|
|
2632
2632
|
S.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", O + vs / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(T);
|
|
2633
2633
|
}
|
|
2634
2634
|
}
|
|
2635
|
-
|
|
2635
|
+
Rt(t, { chartType: "bar-horizontal", margin: P }), n && (Nt(xe.node()), It(t, n));
|
|
2636
2636
|
}
|
|
2637
2637
|
function Oc(t, a, e, r, n = 0) {
|
|
2638
2638
|
const s = r === ze.Inside, o = (e(t.label) ?? 0) + n + (e.bandwidth() - n) / 2;
|
|
@@ -2671,7 +2671,7 @@ function Pc(t, a, e, r, n) {
|
|
|
2671
2671
|
}
|
|
2672
2672
|
function Tc(t, a) {
|
|
2673
2673
|
const e = t.labels.map((r, n) => ({ label: r, value: t.values[n] }));
|
|
2674
|
-
return a.sort ===
|
|
2674
|
+
return a.sort === lt.Ascending ? e.sort((r, n) => r.value - n.value) : a.sort === lt.Descending && e.sort((r, n) => n.value - r.value), e.map((r) => r.label);
|
|
2675
2675
|
}
|
|
2676
2676
|
function ya(t, a, e) {
|
|
2677
2677
|
if (t.length === 0)
|
|
@@ -2694,7 +2694,7 @@ function gi(t) {
|
|
|
2694
2694
|
function ia(t, a) {
|
|
2695
2695
|
return a == null ? void 0 : a.find((e) => e.name === t);
|
|
2696
2696
|
}
|
|
2697
|
-
function
|
|
2697
|
+
function qe(t, a, e, r) {
|
|
2698
2698
|
const n = ia(t, r);
|
|
2699
2699
|
return (n == null ? void 0 : n.color) ?? e[a % e.length];
|
|
2700
2700
|
}
|
|
@@ -2718,7 +2718,7 @@ function ha(t, a, e) {
|
|
|
2718
2718
|
const r = ia(t, e);
|
|
2719
2719
|
return !(r != null && r.labelMode) || r.labelMode === "global" ? a : r.labelMode;
|
|
2720
2720
|
}
|
|
2721
|
-
function
|
|
2721
|
+
function Ha(t, a, e) {
|
|
2722
2722
|
const r = ia(t, e);
|
|
2723
2723
|
return (r == null ? void 0 : r.valueLabels) !== void 0 ? r.valueLabels : a;
|
|
2724
2724
|
}
|
|
@@ -2749,24 +2749,24 @@ const Fc = [
|
|
|
2749
2749
|
"#b07aa1",
|
|
2750
2750
|
"#ff9da7"
|
|
2751
2751
|
];
|
|
2752
|
-
class Nc extends
|
|
2752
|
+
class Nc extends ct {
|
|
2753
2753
|
initialize() {
|
|
2754
2754
|
}
|
|
2755
2755
|
}
|
|
2756
|
-
function
|
|
2757
|
-
var Ae, Pe,
|
|
2758
|
-
|
|
2756
|
+
function Bc(t, a, e = {}, r = !1) {
|
|
2757
|
+
var Ae, Pe, Be, Ye, We, Xe, Qe, Ue, Re, ft, mt, at, Ct;
|
|
2758
|
+
Ht(r);
|
|
2759
2759
|
let n = null, s, o;
|
|
2760
2760
|
const i = Vt.for(t);
|
|
2761
2761
|
if (r) {
|
|
2762
|
-
const M =
|
|
2763
|
-
o = M == null ? void 0 : M.margin, i.detach(), M && M.chartType !== "bar-multi" && (n =
|
|
2762
|
+
const M = Yt(t);
|
|
2763
|
+
o = M == null ? void 0 : M.margin, i.detach(), M && M.chartType !== "bar-multi" && (n = Bt(t)), s = /* @__PURE__ */ new Map();
|
|
2764
2764
|
for (const oe of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2765
2765
|
for (const [le, re] of Mt(oe))
|
|
2766
2766
|
s.set(le, re);
|
|
2767
2767
|
t.replaceChildren();
|
|
2768
2768
|
}
|
|
2769
|
-
const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((M) => !Ma(M.name, e.seriesOverrides)), g = d.map((M) => M.name), b = e.colors ?? Fc, m = e.seriesOverrides, v = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", y = v ? "direct" : e.legend !== !1 ? "legend" : "none", x = e.legend !== !1 && !v, A = $t(c).width, w = 350, $ = e.legendPosition ?? "top", P = A > 0 && A < w && ($ === "left" || $ === "right") ? "top" : $, D = e.legendAnchor ?? "start",
|
|
2769
|
+
const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((M) => !Ma(M.name, e.seriesOverrides)), g = d.map((M) => M.name), b = e.colors ?? Fc, m = e.seriesOverrides, v = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", y = v ? "direct" : e.legend !== !1 ? "legend" : "none", x = e.legend !== !1 && !v, A = $t(c).width, w = 350, $ = e.legendPosition ?? "top", P = A > 0 && A < w && ($ === "left" || $ === "right") ? "top" : $, D = e.legendAnchor ?? "start", H = d.flatMap((M) => M.values), j = wa(H, (Ae = e.verticalAxis) == null ? void 0 : Ae.range, (Pe = e.verticalAxis) == null ? void 0 : Pe.numberFormat, (Be = e.verticalAxis) == null ? void 0 : Be.scaleType), _ = ea(A, (Ye = e.verticalAxis) == null ? void 0 : Ye.labelPosition, (We = e.horizontalAxis) == null ? void 0 : We.labelPosition, (Xe = e.verticalAxis) == null ? void 0 : Xe.direction, j), B = Math.max(0, A - (_.left ?? 50) - (_.right ?? 20)), K = sn(a.labels, B, e.horizontalAxis);
|
|
2770
2770
|
K !== void 0 && (_.bottom = K);
|
|
2771
2771
|
const X = _.top != null, te = Math.max(0, A - (_.left ?? 50) - (_.right ?? 20)), fe = x ? ya(g, P, te) : { width: 0, height: 0 }, se = x ? fe.height + 15 : 0, F = { ..._ };
|
|
2772
2772
|
if (x && P === "top") {
|
|
@@ -2774,9 +2774,9 @@ function Ic(t, a, e = {}, r = !1) {
|
|
|
2774
2774
|
F.top = se + M;
|
|
2775
2775
|
}
|
|
2776
2776
|
x && P === "bottom" && (F.bottom = (F.bottom ?? 24) + se), x && P === "left" && (F.left = (F.left ?? 50) + fe.width + 10), x && P === "right" && (F.right = (F.right ?? 20) + fe.width + 10);
|
|
2777
|
-
const { chartArea:
|
|
2778
|
-
let [ce, ue] = Va(
|
|
2779
|
-
if (e.valueLabels && ce < 0 && ((
|
|
2777
|
+
const { chartArea: Y, width: R, height: ie, margin: he } = Gt(c, F), ve = Kt(o, he);
|
|
2778
|
+
let [ce, ue] = Va(H, (Qe = e.verticalAxis) == null ? void 0 : Qe.range, (Ue = e.verticalAxis) == null ? void 0 : Ue.scaleType);
|
|
2779
|
+
if (e.valueLabels && ce < 0 && ((ft = (Re = e.verticalAxis) == null ? void 0 : Re.range) == null ? void 0 : ft.min) == null) {
|
|
2780
2780
|
const M = ue - ce;
|
|
2781
2781
|
ce -= M * 0.1;
|
|
2782
2782
|
}
|
|
@@ -2789,11 +2789,11 @@ function Ic(t, a, e = {}, r = !1) {
|
|
|
2789
2789
|
}));
|
|
2790
2790
|
M.sort((oe, le) => le.total - oe.total), Se = M.map((oe) => oe.label);
|
|
2791
2791
|
}
|
|
2792
|
-
const ye = p.scaleBand().domain(Se).range([0,
|
|
2793
|
-
i.attach(
|
|
2794
|
-
vertical: { scale: pe, height: ie, options: { ...e.verticalAxis, gridWidth:
|
|
2795
|
-
horizontal: { scale: ye, height: ie, options: { ...e.horizontalAxis, width:
|
|
2796
|
-
}), !xe && ce < 0 && ue > 0 && p.select(
|
|
2792
|
+
const ye = p.scaleBand().domain(Se).range([0, R]).padding(ka(e.barGap)), ge = p.scaleBand().domain(g).range([0, ye.bandwidth()]).padding(0.05), xe = ((mt = e.verticalAxis) == null ? void 0 : mt.scaleType) === "log", pe = xe ? p.scaleSymlog().domain([ce, ue]).nice().range([ie, 0]) : p.scaleLinear().domain([ce, ue]).nice().range([ie, 0]);
|
|
2793
|
+
i.attach(Y, ve), i.update({
|
|
2794
|
+
vertical: { scale: pe, height: ie, options: { ...e.verticalAxis, gridWidth: R, topPadding: he.top } },
|
|
2795
|
+
horizontal: { scale: ye, height: ie, options: { ...e.horizontalAxis, width: R } }
|
|
2796
|
+
}), !xe && ce < 0 && ue > 0 && p.select(Y).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", R).attr("y1", pe(0)).attr("y2", pe(0)).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2797
2797
|
const Me = /* @__PURE__ */ new Map();
|
|
2798
2798
|
e.sortMode === "within-groups" && a.labels.forEach((M, oe) => {
|
|
2799
2799
|
const le = d.map((re) => ({ name: re.name, value: re.values[oe] }));
|
|
@@ -2804,11 +2804,11 @@ function Ic(t, a, e = {}, r = !1) {
|
|
|
2804
2804
|
const J = [];
|
|
2805
2805
|
a.labels.forEach((M, oe) => {
|
|
2806
2806
|
d.forEach((le) => {
|
|
2807
|
-
const re = f.findIndex((
|
|
2807
|
+
const re = f.findIndex((je) => je.name === le.name), Te = e.sortMode === "within-groups" ? Me.get(`${M}\0${le.name}`) ?? le.name : le.name;
|
|
2808
2808
|
J.push({ label: M, series: Te, seriesName: le.name, value: le.values[oe], seriesIndex: re });
|
|
2809
2809
|
});
|
|
2810
2810
|
});
|
|
2811
|
-
const ae = e.valueLabels ?? !1, ke =
|
|
2811
|
+
const ae = e.valueLabels ?? !1, ke = Y.ownerSVGElement, me = ta(ke, t, "bars", { x: 0, y: 0, width: R, height: ie }), Ce = p.select(Y).append("g").attr("clip-path", `url(#${me})`), we = $a(t), Ne = Ce.append("g").node();
|
|
2812
2812
|
Ga(we, {
|
|
2813
2813
|
role: "mark-per-cell",
|
|
2814
2814
|
parent: Ne,
|
|
@@ -2817,7 +2817,7 @@ function Ic(t, a, e = {}, r = !1) {
|
|
|
2817
2817
|
key: (M) => `${M.label}\0${M.seriesName}`,
|
|
2818
2818
|
insert: (M) => M.append("rect").attr("class", "bc-bar bc-bar-multi"),
|
|
2819
2819
|
attrs: (M) => {
|
|
2820
|
-
const oe =
|
|
2820
|
+
const oe = qe(M.seriesName, M.seriesIndex, b, m), le = Ka(M.seriesName, m), re = {
|
|
2821
2821
|
"data-series": M.seriesName,
|
|
2822
2822
|
x: (ye(M.label) ?? 0) + (ge(M.series) ?? 0),
|
|
2823
2823
|
y: Math.min(pe(0), pe(M.value)),
|
|
@@ -2829,8 +2829,8 @@ function Ic(t, a, e = {}, r = !1) {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
});
|
|
2831
2831
|
const Oe = new Nc(Ce);
|
|
2832
|
-
if (e.tooltips && Oe.use(ma({ numberFormat: (
|
|
2833
|
-
width:
|
|
2832
|
+
if (e.tooltips && Oe.use(ma({ numberFormat: (at = e.verticalAxis) == null ? void 0 : at.numberFormat })), e.crosshair && Oe.use(La({
|
|
2833
|
+
width: R,
|
|
2834
2834
|
height: ie,
|
|
2835
2835
|
direction: e.crosshairDirection,
|
|
2836
2836
|
style: e.crosshairStyle,
|
|
@@ -2840,61 +2840,61 @@ function Ic(t, a, e = {}, r = !1) {
|
|
|
2840
2840
|
label: oe,
|
|
2841
2841
|
value: Math.max(...d.map((re) => re.values[le] ?? 0))
|
|
2842
2842
|
}));
|
|
2843
|
-
Oe.use(_a(e.annotations, { scaleX: ye, scaleY: pe, data: M, width:
|
|
2843
|
+
Oe.use(_a(e.annotations, { scaleX: ye, scaleY: pe, data: M, width: R, height: ie, backgroundColor: Ft(t), transition: r, priorAnnotations: s }));
|
|
2844
2844
|
}
|
|
2845
|
-
Oe.draw(J),
|
|
2845
|
+
Oe.draw(J), Rt(t, { chartType: "bar-multi", margin: he }), n && (Nt(Ce.node()), It(t, n));
|
|
2846
2846
|
const Q = /* @__PURE__ */ new Set();
|
|
2847
2847
|
d.forEach((M) => {
|
|
2848
2848
|
ha(M.name, y, m) === "direct" && Q.add(M.name);
|
|
2849
2849
|
});
|
|
2850
|
-
const Z = Q.size > 0, S = Ft(t), T = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ?
|
|
2851
|
-
function
|
|
2850
|
+
const Z = Q.size > 0, S = Ft(t), T = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? bt.Auto : bt.Off, O = e.directLabelAnchor ?? "middle", z = e.valueLabelPosition ?? ze.Auto;
|
|
2851
|
+
function I() {
|
|
2852
2852
|
return z === ze.Inside ? ze.Inside : (z === ze.Outside, ze.Outside);
|
|
2853
2853
|
}
|
|
2854
2854
|
function C(M) {
|
|
2855
|
-
return T ===
|
|
2855
|
+
return T === bt.Inside ? ze.Inside : T === bt.Outside ? ze.Outside : ae ? I() : ze.Outside;
|
|
2856
2856
|
}
|
|
2857
2857
|
function U(M, oe, le) {
|
|
2858
2858
|
return le === "start" ? M + 12 : le === "end" ? M + oe - 4 : M + oe / 2;
|
|
2859
2859
|
}
|
|
2860
|
-
const E = p.select(
|
|
2860
|
+
const E = p.select(Y).append("g").attr("class", "bc-value-labels");
|
|
2861
2861
|
J.forEach((M) => {
|
|
2862
|
-
if (!
|
|
2862
|
+
if (!Ha(M.seriesName, ae, m))
|
|
2863
2863
|
return;
|
|
2864
|
-
const oe = (ye(M.label) ?? 0) + (ge(M.series) ?? 0) + ge.bandwidth() / 2, le = Math.min(pe(0), pe(M.value)), re = Math.abs(pe(M.value) - pe(0)), Te =
|
|
2865
|
-
let
|
|
2864
|
+
const oe = (ye(M.label) ?? 0) + (ge(M.series) ?? 0) + ge.bandwidth() / 2, le = Math.min(pe(0), pe(M.value)), re = Math.abs(pe(M.value) - pe(0)), Te = I(), je = Z && Q.has(M.seriesName), Ot = M.value < 0, it = le + re;
|
|
2865
|
+
let Je, Pt, na;
|
|
2866
2866
|
if (Te === ze.Inside) {
|
|
2867
|
-
const fa =
|
|
2868
|
-
Pt = Et(fa), na = "central",
|
|
2867
|
+
const fa = qe(M.seriesName, M.seriesIndex, b, m);
|
|
2868
|
+
Pt = Et(fa), na = "central", je && C() === ze.Inside ? Je = U(le, re, O) + 14 : Je = le + re / 2;
|
|
2869
2869
|
} else
|
|
2870
|
-
Pt = "currentColor", Ot ? (
|
|
2871
|
-
E.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("x", oe).attr("y",
|
|
2870
|
+
Pt = "currentColor", Ot ? (Je = je && C() === ze.Outside ? it + 16 : it + 4, na = "hanging") : (Je = je && C() === ze.Outside ? le - 16 : le - 4, na = "auto");
|
|
2871
|
+
E.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("x", oe).attr("y", Je).attr("text-anchor", "middle").attr("dominant-baseline", na).attr("font-size", "11px").attr("fill", Pt).text(String(M.value));
|
|
2872
2872
|
}), J.forEach((M) => {
|
|
2873
|
-
var
|
|
2873
|
+
var Je;
|
|
2874
2874
|
if (!Q.has(M.seriesName))
|
|
2875
2875
|
return;
|
|
2876
|
-
const oe = (ye(M.label) ?? 0) + (ge(M.series) ?? 0) + ge.bandwidth() / 2, le = Math.min(pe(0), pe(M.value)), re = Math.abs(pe(M.value) - pe(0)), Te = ((
|
|
2877
|
-
if (
|
|
2876
|
+
const oe = (ye(M.label) ?? 0) + (ge(M.series) ?? 0) + ge.bandwidth() / 2, le = Math.min(pe(0), pe(M.value)), re = Math.abs(pe(M.value) - pe(0)), Te = ((Je = m == null ? void 0 : m.find((Pt) => Pt.name === M.seriesName)) == null ? void 0 : Je.labelText) || M.seriesName, je = C(), Ot = qe(M.seriesName, M.seriesIndex, b, m), it = p.select(Y).append("text").attr("class", "bc-direct-label").attr("data-series", M.seriesName).attr("x", oe).attr("text-anchor", "middle").attr("font-size", "10px").text(Te);
|
|
2877
|
+
if (je === ze.Inside) {
|
|
2878
2878
|
const Pt = U(le, re, O);
|
|
2879
|
-
|
|
2879
|
+
it.attr("y", Pt).attr("fill", Et(Ot)), O === "middle" && it.attr("dominant-baseline", "central");
|
|
2880
2880
|
} else
|
|
2881
|
-
|
|
2881
|
+
it.attr("y", le - 4).attr("fill", li(Ot, S));
|
|
2882
2882
|
});
|
|
2883
2883
|
const W = g.filter((M) => ha(M, y, m) === "legend");
|
|
2884
2884
|
if (x && W.length > 0) {
|
|
2885
2885
|
const M = W.map((re) => {
|
|
2886
|
-
const Te = f.findIndex((
|
|
2887
|
-
return
|
|
2886
|
+
const Te = f.findIndex((je) => je.name === re);
|
|
2887
|
+
return qe(re, Te, b, m);
|
|
2888
2888
|
});
|
|
2889
2889
|
let oe = 0, le = 0;
|
|
2890
2890
|
if (P === "top") {
|
|
2891
2891
|
const re = X ? 15 : 0;
|
|
2892
2892
|
le = -(fe.height + 10 + re);
|
|
2893
|
-
} else P === "bottom" ? le = ie + 25 : P === "left" ? oe = -(fe.width + 10) : P === "right" && (oe =
|
|
2894
|
-
ba(
|
|
2893
|
+
} else P === "bottom" ? le = ie + 25 : P === "left" ? oe = -(fe.width + 10) : P === "right" && (oe = R + 10);
|
|
2894
|
+
ba(Y, W, M, le, P, D, R, ie, oe, [], { left: he.left, right: he.right });
|
|
2895
2895
|
}
|
|
2896
2896
|
}
|
|
2897
|
-
const
|
|
2897
|
+
const Ic = {
|
|
2898
2898
|
linear: p.curveLinear,
|
|
2899
2899
|
monotoneX: p.curveMonotoneX,
|
|
2900
2900
|
step: p.curveStep,
|
|
@@ -2905,10 +2905,10 @@ const Bc = {
|
|
|
2905
2905
|
catmullRom: p.curveCatmullRom
|
|
2906
2906
|
};
|
|
2907
2907
|
function Aa(t) {
|
|
2908
|
-
return t &&
|
|
2908
|
+
return t && Ic[t] || p.curveLinear;
|
|
2909
2909
|
}
|
|
2910
2910
|
function bi(t) {
|
|
2911
|
-
const a = (t == null ? void 0 : t.position) ?? ze.Auto, e = (t == null ? void 0 : t.orientation) ??
|
|
2911
|
+
const a = (t == null ? void 0 : t.position) ?? ze.Auto, e = (t == null ? void 0 : t.orientation) ?? st.Vertical, r = t != null && t.format ? p.format(t.format) : (n) => String(n);
|
|
2912
2912
|
return {
|
|
2913
2913
|
name: "value-labels",
|
|
2914
2914
|
install() {
|
|
@@ -2918,7 +2918,7 @@ function bi(t) {
|
|
|
2918
2918
|
s.selectAll(".bc-bar").each(function(o) {
|
|
2919
2919
|
const i = p.select(this), c = parseFloat(i.attr("x")), f = parseFloat(i.attr("y")), d = parseFloat(i.attr("width")), g = parseFloat(i.attr("height")), b = o.value < 0;
|
|
2920
2920
|
let m, v, y, x, A;
|
|
2921
|
-
if (e ===
|
|
2921
|
+
if (e === st.Horizontal)
|
|
2922
2922
|
if (A = a === ze.Inside, v = f + g / 2, x = "central", b)
|
|
2923
2923
|
A ? (m = c + 4, y = "start") : (m = c - 4, y = "end");
|
|
2924
2924
|
else {
|
|
@@ -2972,7 +2972,7 @@ function Cr(t, a) {
|
|
|
2972
2972
|
points: n,
|
|
2973
2973
|
tooltip: s = !0,
|
|
2974
2974
|
crosshair: o = !1,
|
|
2975
|
-
crosshairDirection: i =
|
|
2975
|
+
crosshairDirection: i = pt.Both,
|
|
2976
2976
|
crosshairStyle: c = Qt.Dashed,
|
|
2977
2977
|
crosshairColor: f = "#999",
|
|
2978
2978
|
format: d = _c(a.numberFormat),
|
|
@@ -2986,14 +2986,14 @@ function Cr(t, a) {
|
|
|
2986
2986
|
const b = c === Qt.Solid ? "none" : c === Qt.Dotted ? "2,2" : "4,3", m = [...new Set(n.map((se) => se.cx))].sort((se, F) => se - F), v = p.select(t);
|
|
2987
2987
|
let y = null;
|
|
2988
2988
|
s && (Vc(), y = document.createElement("div"), y.className = mi, document.body.appendChild(y));
|
|
2989
|
-
const x = ".bc-annotations", A = !v.select(x).empty(), w = (se) => A ? v.insert(se, x) : v.append(se), $ = o && (i ===
|
|
2990
|
-
let D = null,
|
|
2991
|
-
$ && (D = w("line").attr("class", "bc-crosshair bc-crosshair-v").attr("y1", 0).attr("y2", r).attr("stroke", f).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none")), P && (
|
|
2989
|
+
const x = ".bc-annotations", A = !v.select(x).empty(), w = (se) => A ? v.insert(se, x) : v.append(se), $ = o && (i === pt.Both || i === pt.Vertical), P = o && (i === pt.Both || i === pt.Horizontal);
|
|
2990
|
+
let D = null, H = null;
|
|
2991
|
+
$ && (D = w("line").attr("class", "bc-crosshair bc-crosshair-v").attr("y1", 0).attr("y2", r).attr("stroke", f).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none")), P && (H = w("line").attr("class", "bc-crosshair bc-crosshair-h").attr("x1", 0).attr("x2", e).attr("stroke", f).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none"));
|
|
2992
2992
|
const j = w("circle").attr("class", "bc-proximity-dot").attr("r", 6).attr("fill", "none").attr("stroke", "#333").attr("stroke-width", 1).attr("opacity", 0.45).attr("pointer-events", "none").style("display", "none"), _ = w("rect").attr("class", "bc-proximity-overlay").attr("width", e).attr("height", r).attr("fill", "none").attr("pointer-events", "all");
|
|
2993
|
-
function
|
|
2993
|
+
function B(se, F) {
|
|
2994
2994
|
if (m.length === 0)
|
|
2995
2995
|
return null;
|
|
2996
|
-
const
|
|
2996
|
+
const Y = p.bisectCenter(m, se), R = m[Y], ie = n.filter((ce) => ce.cx === R);
|
|
2997
2997
|
if (ie.length === 0)
|
|
2998
2998
|
return null;
|
|
2999
2999
|
let he = ie[0], ve = Math.abs(ie[0].cy - F);
|
|
@@ -3004,23 +3004,23 @@ function Cr(t, a) {
|
|
|
3004
3004
|
return he;
|
|
3005
3005
|
}
|
|
3006
3006
|
const K = (se) => {
|
|
3007
|
-
const [F,
|
|
3008
|
-
|
|
3007
|
+
const [F, Y] = p.pointer(se, t), R = B(F, Y);
|
|
3008
|
+
R && (j.attr("cx", R.cx).attr("cy", R.cy).attr("stroke", R.color).style("display", null), y && (y.textContent = d(R), y.style.display = "block", Ns(j.node(), y, {
|
|
3009
3009
|
placement: "top",
|
|
3010
|
-
middleware: [
|
|
3010
|
+
middleware: [Bs(8), Is(), Vs()]
|
|
3011
3011
|
}).then(({ x: ie, y: he }) => {
|
|
3012
3012
|
y && (y.style.left = `${ie}px`, y.style.top = `${he}px`);
|
|
3013
|
-
})), D && D.attr("x1",
|
|
3013
|
+
})), D && D.attr("x1", R.cx).attr("x2", R.cx).style("display", null), H && H.attr("y1", R.cy).attr("y2", R.cy).style("display", null));
|
|
3014
3014
|
}, X = () => {
|
|
3015
|
-
j.style("display", "none"), y && (y.style.display = "none"), D && D.style("display", "none"),
|
|
3015
|
+
j.style("display", "none"), y && (y.style.display = "none"), D && D.style("display", "none"), H && H.style("display", "none");
|
|
3016
3016
|
}, te = _.node();
|
|
3017
3017
|
te.addEventListener("mousemove", K), te.addEventListener("mouseleave", X);
|
|
3018
3018
|
const fe = () => {
|
|
3019
|
-
te.removeEventListener("mousemove", K), te.removeEventListener("mouseleave", X), _.remove(), j.remove(), y && (y.remove(), y = null), D && D.remove(),
|
|
3019
|
+
te.removeEventListener("mousemove", K), te.removeEventListener("mouseleave", X), _.remove(), j.remove(), y && (y.remove(), y = null), D && D.remove(), H && H.remove(), g && Fa.get(g) === fe && Fa.delete(g);
|
|
3020
3020
|
};
|
|
3021
3021
|
return g && Fa.set(g, fe), fe;
|
|
3022
3022
|
}
|
|
3023
|
-
const Gc = p.symbolTriangle2 ?? p.symbolTriangle,
|
|
3023
|
+
const Gc = p.symbolTriangle2 ?? p.symbolTriangle, Hc = {
|
|
3024
3024
|
circle: p.symbolCircle,
|
|
3025
3025
|
square: p.symbolSquare,
|
|
3026
3026
|
diamond: p.symbolDiamond,
|
|
@@ -3029,7 +3029,7 @@ const Gc = p.symbolTriangle2 ?? p.symbolTriangle, Yc = {
|
|
|
3029
3029
|
cross: p.symbolCross,
|
|
3030
3030
|
star: p.symbolStar
|
|
3031
3031
|
};
|
|
3032
|
-
function
|
|
3032
|
+
function Yc(t, a, e) {
|
|
3033
3033
|
switch (e) {
|
|
3034
3034
|
case Dt.First:
|
|
3035
3035
|
return t === 0;
|
|
@@ -3043,7 +3043,7 @@ function Rc(t, a, e) {
|
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
3045
3045
|
function hn(t, a, e, r, n = !1) {
|
|
3046
|
-
const s = r.symbol ?? Tt.Circle, o = r.showOn ?? Dt.FirstLast, i = r.style ?? yt.Filled, c = r.size ?? 3.5, f = r.opacity ?? 1, d = "var(--bs-body-bg, #fff)", g = a.filter((m) =>
|
|
3046
|
+
const s = r.symbol ?? Tt.Circle, o = r.showOn ?? Dt.FirstLast, i = r.style ?? yt.Filled, c = r.size ?? 3.5, f = r.opacity ?? 1, d = "var(--bs-body-bg, #fff)", g = a.filter((m) => Yc(m.index, e, o)), b = n ? Ee() : 0;
|
|
3047
3047
|
if (s === Tt.Circle) {
|
|
3048
3048
|
t.selectAll("path.bc-symbol").remove();
|
|
3049
3049
|
const m = t.selectAll("circle.bc-symbol").data(g).join(
|
|
@@ -3053,7 +3053,7 @@ function hn(t, a, e, r, n = !1) {
|
|
|
3053
3053
|
);
|
|
3054
3054
|
(n ? m.transition().duration(b) : m).attr("cx", (y) => y.cx).attr("cy", (y) => y.cy).attr("r", c).attr("fill", (y) => i === yt.Filled ? y.color : d).attr("stroke", (y) => y.color).attr("stroke-width", i === yt.Hollow ? 1.5 : 0).attr("opacity", f);
|
|
3055
3055
|
} else {
|
|
3056
|
-
const m =
|
|
3056
|
+
const m = Hc[s] ?? p.symbolCircle, v = Math.PI * c * c, y = p.symbol().type(m).size(v);
|
|
3057
3057
|
t.selectAll("circle.bc-symbol").remove();
|
|
3058
3058
|
const x = t.selectAll("path.bc-symbol").data(g).join(
|
|
3059
3059
|
(w) => w.append("path").attr("class", "bc-symbol").attr("transform", ($) => `translate(${$.cx},${$.cy})`).attr("d", y).attr("fill", ($) => i === yt.Filled ? $.color : d).attr("stroke", ($) => $.color).attr("stroke-width", i === yt.Hollow ? 1.5 : 0).attr("opacity", f),
|
|
@@ -3064,7 +3064,7 @@ function hn(t, a, e, r, n = !1) {
|
|
|
3064
3064
|
}
|
|
3065
3065
|
}
|
|
3066
3066
|
const yi = "#4e79a7";
|
|
3067
|
-
class
|
|
3067
|
+
class Rc extends ct {
|
|
3068
3068
|
initialize() {
|
|
3069
3069
|
this.configDefine("xPos", { defaultValue: (n, s) => 0 }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("color", { defaultValue: yi }), this.configDefine("curve", { defaultValue: p.curveLinear }), this.configDefine("areaFill", { defaultValue: !1 }), this.configDefine("areaFillOpacity", { defaultValue: 0.2 }), this.configDefine("height", { defaultValue: 0 });
|
|
3070
3070
|
const a = this.base.append("g"), e = this.base.append("g"), r = this.base.append("g");
|
|
@@ -3130,31 +3130,31 @@ class Hc extends lt {
|
|
|
3130
3130
|
}
|
|
3131
3131
|
function Wc(t, a, e = {}, r = !1) {
|
|
3132
3132
|
var xe, pe, Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z;
|
|
3133
|
-
|
|
3133
|
+
Ht(r), Mr(t);
|
|
3134
3134
|
let n = [], s = [], o = [], i = null, c = null, f, d;
|
|
3135
3135
|
const g = Vt.for(t);
|
|
3136
3136
|
if (r) {
|
|
3137
|
-
const S =
|
|
3138
|
-
d = S == null ? void 0 : S.margin, g.detach(), (S == null ? void 0 : S.chartType) === "line" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), i = t.querySelector(".bc-frame .bc-symbols")) : S && (c =
|
|
3137
|
+
const S = Yt(t);
|
|
3138
|
+
d = S == null ? void 0 : S.margin, g.detach(), (S == null ? void 0 : S.chartType) === "line" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), i = t.querySelector(".bc-frame .bc-symbols")) : S && (c = Bt(t)), f = /* @__PURE__ */ new Map();
|
|
3139
3139
|
for (const T of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3140
3140
|
for (const [O, z] of Mt(T))
|
|
3141
3141
|
f.set(O, z);
|
|
3142
3142
|
t.replaceChildren();
|
|
3143
3143
|
}
|
|
3144
|
-
const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (J = e.verticalAxis) == null ? void 0 : J.labelPosition, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: $ } = Gt(b, y), P = Kt(d, $), D = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range),
|
|
3144
|
+
const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (J = e.verticalAxis) == null ? void 0 : J.labelPosition, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: $ } = Gt(b, y), P = Kt(d, $), D = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range), H = D.map((S) => a.labels[S]), j = D.map((S) => a.values[S]), _ = H.map((S, T) => ({
|
|
3145
3145
|
label: S,
|
|
3146
3146
|
value: j[T]
|
|
3147
|
-
})),
|
|
3147
|
+
})), B = p.scalePoint().domain(H).range([0, A]).padding(e.edgePadding ? 0.6 : 0), K = B, X = (S) => B(S.label) ?? 0, te = ((Ce = e.verticalAxis) == null ? void 0 : Ce.scaleType) === "log", [fe, se] = Va(j, (we = e.verticalAxis) == null ? void 0 : we.range, (Ne = e.verticalAxis) == null ? void 0 : Ne.scaleType), F = te ? p.scaleSymlog().domain([fe, se]).nice().range([w, 0]) : p.scaleLinear().domain([fe, se]).nice().range([w, 0]), Y = F.domain(), R = Y[0] < 0 && Y[1] > 0 ? F(0) : void 0;
|
|
3148
3148
|
g.attach(x, P), g.update({
|
|
3149
3149
|
vertical: { scale: F, height: w, options: { ...e.verticalAxis, gridWidth: A, topPadding: $.top } },
|
|
3150
|
-
horizontal: { scale: K, height: w, options: { ...e.horizontalAxis, width: A, zeroY:
|
|
3150
|
+
horizontal: { scale: K, height: w, options: { ...e.horizontalAxis, width: A, zeroY: R } }
|
|
3151
3151
|
});
|
|
3152
|
-
const ie = x.ownerSVGElement, he = ta(ie, t, "plot", { x: -1, y: -1, width: A + 2, height: w + 2 }), ve = p.select(x).append("g").attr("clip-path", `url(#${he})`), ce = ve.node(), ue = ((Oe = e.colors) == null ? void 0 : Oe[0]) ?? yi, Se = Aa(e.interpolation), ye = e.lineSymbols, ge = new
|
|
3152
|
+
const ie = x.ownerSVGElement, he = ta(ie, t, "plot", { x: -1, y: -1, width: A + 2, height: w + 2 }), ve = p.select(x).append("g").attr("clip-path", `url(#${he})`), ce = ve.node(), ue = ((Oe = e.colors) == null ? void 0 : Oe[0]) ?? yi, Se = Aa(e.interpolation), ye = e.lineSymbols, ge = new Rc(p.select(ce));
|
|
3153
3153
|
if (ge.config({ xPos: X, y: F, color: ue, curve: Se, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: w }), s.length > 0 || n.length > 0 || o.length > 0) {
|
|
3154
3154
|
const S = (P == null ? void 0 : P.dx) ?? 0, T = (P == null ? void 0 : P.dy) ?? 0, O = ce.querySelectorAll(":scope > g");
|
|
3155
3155
|
O[0] && vt(O[0], n, S, T), O[1] && vt(O[1], s, S, T), O[2] && vt(O[2], o, S, T);
|
|
3156
3156
|
}
|
|
3157
|
-
if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation:
|
|
3157
|
+
if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation: st.Vertical })), ge.draw(_), (Q = e.annotations) != null && Q.length && $r(x, e.annotations, { scaleX: K, scaleY: F, data: _, width: A, height: w, backgroundColor: Ft(t), transition: r, priorAnnotations: f }), p.select(ce).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
|
|
3158
3158
|
const S = _.map((T) => ({
|
|
3159
3159
|
cx: X(T),
|
|
3160
3160
|
cy: F(T.value),
|
|
@@ -3185,7 +3185,7 @@ function Wc(t, a, e = {}, r = !1) {
|
|
|
3185
3185
|
let T;
|
|
3186
3186
|
i ? (x.appendChild(i), T = p.select(i)) : T = p.select(x).append("g").attr("class", "bc-symbols"), hn(T, S, _.length, ye, r);
|
|
3187
3187
|
}
|
|
3188
|
-
|
|
3188
|
+
Rt(t, { chartType: "line", margin: $ }), c && (Nt(ve.node()), It(t, c));
|
|
3189
3189
|
}
|
|
3190
3190
|
const gn = 28, vi = 18, xi = 20;
|
|
3191
3191
|
function pn(t, a, e, r = gn) {
|
|
@@ -3216,15 +3216,15 @@ function Ai(t, a, e) {
|
|
|
3216
3216
|
b.sort((P, D) => P.midAngle - D.midAngle);
|
|
3217
3217
|
const v = m ? 0.05 : Math.PI + 0.05, y = m ? Math.PI - 0.05 : 2 * Math.PI - 0.05, x = b.map((P) => P.midAngle), A = pn(x, v, y, c), w = m ? 1 : -1, $ = t.append("g").attr("class", "bc-arc-labels");
|
|
3218
3218
|
b.forEach((P, D) => {
|
|
3219
|
-
const
|
|
3220
|
-
if (!
|
|
3219
|
+
const H = P.showLabel !== !1, j = P.showValue !== !1;
|
|
3220
|
+
if (!H && !j)
|
|
3221
3221
|
return;
|
|
3222
|
-
const
|
|
3222
|
+
const B = A[D] - Math.PI / 2, K = Math.cos(B) * o, X = Math.sin(B) * o, te = Math.cos(B) * i, fe = Math.sin(B) * i, se = te + w * xi;
|
|
3223
3223
|
$.append("polyline").attr("class", "bc-arc-label-line").attr("points", `${K},${X} ${te},${fe} ${se},${fe}`).attr("fill", "none").attr("stroke", "var(--bc-text-color, #999)").attr("stroke-width", 1).attr("opacity", 0.5);
|
|
3224
|
-
const F = se + w * 4,
|
|
3225
|
-
if (
|
|
3226
|
-
const
|
|
3227
|
-
|
|
3224
|
+
const F = se + w * 4, Y = $.append("text").attr("class", "bc-arc-direct-label").attr("x", F).attr("y", fe).attr("text-anchor", m ? "start" : "end").attr("font-size", `${n}px`);
|
|
3225
|
+
if (H && Y.append("tspan").attr("x", F).attr("dy", j ? "-0.1em" : "0.35em").attr("font-weight", "bold").attr("fill", li(P.color, s)).text(P.label), j) {
|
|
3226
|
+
const R = P.displayAsPercentage && P.percentage != null ? `${Math.round(P.percentage)}%` : String(P.value);
|
|
3227
|
+
Y.append("tspan").attr("x", F).attr("dy", H ? "1.2em" : "0.35em").attr("fill", "var(--bc-text-color, #666)").text(R);
|
|
3228
3228
|
}
|
|
3229
3229
|
});
|
|
3230
3230
|
}
|
|
@@ -3270,7 +3270,7 @@ const ki = [
|
|
|
3270
3270
|
"#b07aa1",
|
|
3271
3271
|
"#ff9da7"
|
|
3272
3272
|
];
|
|
3273
|
-
class Uc extends
|
|
3273
|
+
class Uc extends ct {
|
|
3274
3274
|
initialize() {
|
|
3275
3275
|
this.configDefine("xPos", { defaultValue: (n) => 0 }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("colors", { defaultValue: ki }), this.configDefine("labels", { defaultValue: [] }), this.configDefine("curve", { defaultValue: p.curveLinear }), this.configDefine("areaFill", { defaultValue: !1 }), this.configDefine("areaFillOpacity", { defaultValue: 0.2 }), this.configDefine("height", { defaultValue: 0 }), this.configDefine("dots", { defaultValue: [] }), this.configDefine("highlightTargets", { defaultValue: /* @__PURE__ */ new Set() });
|
|
3276
3276
|
const a = this.base.append("g"), e = this.base.append("g"), r = this.base.append("g");
|
|
@@ -3341,13 +3341,13 @@ class Uc extends lt {
|
|
|
3341
3341
|
}
|
|
3342
3342
|
}
|
|
3343
3343
|
function jc(t, a, e = {}, r = !1) {
|
|
3344
|
-
var M, oe, le, re, Te,
|
|
3345
|
-
|
|
3344
|
+
var M, oe, le, re, Te, je, Ot, it, Je, Pt, na, fa, Ra;
|
|
3345
|
+
Ht(r), Mr(t);
|
|
3346
3346
|
let n = a, s = [], o = [], i = [], c = [], f = null, d, g;
|
|
3347
3347
|
const b = Vt.for(t);
|
|
3348
3348
|
if (r) {
|
|
3349
|
-
const ne =
|
|
3350
|
-
g = ne == null ? void 0 : ne.margin, b.detach(), (ne == null ? void 0 : ne.chartType) === "line-multi" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), o = Array.from(t.querySelectorAll(".bc-frame .bc-line")), i = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), c = Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))) : ne && (f =
|
|
3349
|
+
const ne = Yt(t);
|
|
3350
|
+
g = ne == null ? void 0 : ne.margin, b.detach(), (ne == null ? void 0 : ne.chartType) === "line-multi" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), o = Array.from(t.querySelectorAll(".bc-frame .bc-line")), i = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), c = Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))) : ne && (f = Bt(t)), d = /* @__PURE__ */ new Map();
|
|
3351
3351
|
for (const Le of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3352
3352
|
for (const [Fe, Ve] of Mt(Le))
|
|
3353
3353
|
d.set(Fe, Ve);
|
|
@@ -3356,18 +3356,18 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3356
3356
|
const { body: m } = _t(t, e.frame), v = n.series ?? [];
|
|
3357
3357
|
let y = v.filter((ne) => !Ma(ne.name, e.seriesOverrides));
|
|
3358
3358
|
(e.sortMode === "total" || e.sortMode === "within-groups") && (y = [...y].sort((ne, Le) => {
|
|
3359
|
-
const Fe = ne.values.reduce((
|
|
3360
|
-
return Le.values.reduce((
|
|
3359
|
+
const Fe = ne.values.reduce((rt, nt) => rt + nt, 0);
|
|
3360
|
+
return Le.values.reduce((rt, nt) => rt + nt, 0) - Fe;
|
|
3361
3361
|
}));
|
|
3362
|
-
const x = e.colors ?? ki, A = y.map((ne) => ne.name), w = e.seriesOverrides, $ = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", P = $ ? "direct" : e.legend !== !1 ? "legend" : "none", D = A.filter((ne) => ha(ne, P, w) === "direct"),
|
|
3362
|
+
const x = e.colors ?? ki, A = y.map((ne) => ne.name), w = e.seriesOverrides, $ = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", P = $ ? "direct" : e.legend !== !1 ? "legend" : "none", D = A.filter((ne) => ha(ne, P, w) === "direct"), H = e.legend !== !1 && !$, j = $t(m).width, _ = 350, B = e.legendPosition ?? "top", K = j > 0 && j < _ && (B === "left" || B === "right") ? "top" : B, X = e.legendAnchor ?? "start", te = Lr(n.labels, (M = e.horizontalAxis) == null ? void 0 : M.range), fe = te.map((ne) => n.labels[ne]);
|
|
3363
3363
|
y = y.map((ne) => ({ ...ne, values: te.map((Le) => ne.values[Le]) })), n = { ...n, labels: fe, series: y };
|
|
3364
|
-
const se = y.flatMap((ne) => ne.values), F = wa(se, (oe = e.verticalAxis) == null ? void 0 : oe.range, (le = e.verticalAxis) == null ? void 0 : le.numberFormat, (re = e.verticalAxis) == null ? void 0 : re.scaleType),
|
|
3365
|
-
if (
|
|
3364
|
+
const se = y.flatMap((ne) => ne.values), F = wa(se, (oe = e.verticalAxis) == null ? void 0 : oe.range, (le = e.verticalAxis) == null ? void 0 : le.numberFormat, (re = e.verticalAxis) == null ? void 0 : re.scaleType), Y = ea(j, (Te = e.verticalAxis) == null ? void 0 : Te.labelPosition, (je = e.horizontalAxis) == null ? void 0 : je.labelPosition, (Ot = e.verticalAxis) == null ? void 0 : Ot.direction, F), R = D.length > 0 ? gi(D) : 0, ie = Y.top != null, he = Math.max(0, j - (Y.left ?? 50) - (Y.right ?? 20) - R), ve = H ? ya(A, K, he) : { width: 0, height: 0 }, ce = H ? ve.height + 15 : 0, ue = { ...Y };
|
|
3365
|
+
if (H && K === "top") {
|
|
3366
3366
|
const ne = ie ? 15 : 0;
|
|
3367
3367
|
ue.top = ce + ne;
|
|
3368
3368
|
}
|
|
3369
|
-
|
|
3370
|
-
const { chartArea: Se, width: ye, height: ge, margin: xe } = Gt(m, ue), pe = Kt(g, xe), [Me, J] = Va(se, (
|
|
3369
|
+
H && K === "bottom" && (ue.bottom = (ue.bottom ?? 24) + ce), H && K === "left" && (ue.left = (ue.left ?? 50) + ve.width + 10), H && K === "right" && (ue.right = (ue.right ?? 20) + ve.width + 10), R > 0 && (ue.right = (ue.right ?? 20) + R);
|
|
3370
|
+
const { chartArea: Se, width: ye, height: ge, margin: xe } = Gt(m, ue), pe = Kt(g, xe), [Me, J] = Va(se, (it = e.verticalAxis) == null ? void 0 : it.range, (Je = e.verticalAxis) == null ? void 0 : Je.scaleType), ae = p.scalePoint().domain(n.labels).range([0, ye]).padding(e.edgePadding ? 0.6 : 0), ke = ae, me = (ne) => ae(n.labels[ne]) ?? 0, we = ((Pt = e.verticalAxis) == null ? void 0 : Pt.scaleType) === "log" ? p.scaleSymlog().domain([Me, J]).nice().range([ge, 0]) : p.scaleLinear().domain([Me, J]).nice().range([ge, 0]), Ne = we.domain(), Oe = Ne[0] < 0 && Ne[1] > 0 ? we(0) : void 0;
|
|
3371
3371
|
b.attach(Se, pe), b.update({
|
|
3372
3372
|
vertical: { scale: we, height: ge, options: { ...e.verticalAxis, gridWidth: ye, topPadding: xe.top } },
|
|
3373
3373
|
horizontal: { scale: ke, height: ge, options: { ...e.horizontalAxis, width: ye, zeroY: Oe } }
|
|
@@ -3378,10 +3378,10 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3378
3378
|
colorIndex: v.findIndex((Le) => Le.name === ne.name)
|
|
3379
3379
|
})), z = Aa(e.interpolation);
|
|
3380
3380
|
(na = e.areaFills) != null && na.length && Zc(T, e.areaFills, y, me, n.labels.length, we, z);
|
|
3381
|
-
const
|
|
3381
|
+
const I = [];
|
|
3382
3382
|
y.forEach((ne, Le) => {
|
|
3383
3383
|
n.labels.forEach((Fe, Ve) => {
|
|
3384
|
-
|
|
3384
|
+
I.push({ label: Fe, value: ne.values[Ve], series: ne.name, colorIndex: Le });
|
|
3385
3385
|
});
|
|
3386
3386
|
});
|
|
3387
3387
|
const C = e.lineSymbols, U = {
|
|
@@ -3390,20 +3390,20 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3390
3390
|
dashed: "8,4",
|
|
3391
3391
|
"dash-dot": "8,4,2,4"
|
|
3392
3392
|
}, E = e.valueLabels ?? !1, W = new Set((e.highlights ?? []).map((ne) => ne.target)), Ae = W.size > 0, Pe = new Uc(p.select(T));
|
|
3393
|
-
Pe.config({ xPos: me, y: we, colors: x, labels: n.labels, curve: z, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: ge, dots:
|
|
3394
|
-
const
|
|
3393
|
+
Pe.config({ xPos: me, y: we, colors: x, labels: n.labels, curve: z, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: ge, dots: I, highlightTargets: W });
|
|
3394
|
+
const Be = new Set(O.map((ne) => ne.name)), Ye = s.filter((ne) => {
|
|
3395
3395
|
var Le;
|
|
3396
|
-
return
|
|
3397
|
-
}),
|
|
3396
|
+
return Be.has(((Le = ne.__data__) == null ? void 0 : Le.name) ?? "");
|
|
3397
|
+
}), We = o.filter((ne) => {
|
|
3398
3398
|
var Le;
|
|
3399
|
-
return
|
|
3400
|
-
}),
|
|
3399
|
+
return Be.has(((Le = ne.__data__) == null ? void 0 : Le.name) ?? "");
|
|
3400
|
+
}), Xe = i.filter((ne) => {
|
|
3401
3401
|
var Le;
|
|
3402
|
-
return
|
|
3402
|
+
return Be.has(((Le = ne.__data__) == null ? void 0 : Le.series) ?? "");
|
|
3403
3403
|
});
|
|
3404
|
-
if (
|
|
3404
|
+
if (We.length > 0 || Ye.length > 0 || Xe.length > 0) {
|
|
3405
3405
|
const ne = (pe == null ? void 0 : pe.dx) ?? 0, Le = (pe == null ? void 0 : pe.dy) ?? 0, Fe = T.querySelectorAll(":scope > g");
|
|
3406
|
-
Fe[0] && vt(Fe[0], Ye, ne, Le), Fe[1] && vt(Fe[1],
|
|
3406
|
+
Fe[0] && vt(Fe[0], Ye, ne, Le), Fe[1] && vt(Fe[1], We, ne, Le), Fe[2] && vt(Fe[2], Xe, ne, Le);
|
|
3407
3407
|
}
|
|
3408
3408
|
if (Pe.draw(O), (fa = e.annotations) != null && fa.length) {
|
|
3409
3409
|
const ne = n.labels.map((Le, Fe) => {
|
|
@@ -3415,29 +3415,29 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3415
3415
|
});
|
|
3416
3416
|
$r(Se, e.annotations, { scaleX: ke, scaleY: we, data: ne, width: ye, height: ge, backgroundColor: Ft(t), transition: r, priorAnnotations: d });
|
|
3417
3417
|
}
|
|
3418
|
-
const
|
|
3419
|
-
if (
|
|
3420
|
-
if (!
|
|
3418
|
+
const Qe = p.select(T).append("g").attr("class", "bc-value-labels");
|
|
3419
|
+
if (I.forEach((ne) => {
|
|
3420
|
+
if (!Ha(ne.series, E, w))
|
|
3421
3421
|
return;
|
|
3422
3422
|
const Le = me(n.labels.indexOf(ne.label)), Fe = we(ne.value);
|
|
3423
|
-
|
|
3423
|
+
Qe.append("text").attr("class", "bc-value-label").attr("data-series", ne.colorIndex).attr("x", Le).attr("y", Fe - 8).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text(String(ne.value));
|
|
3424
3424
|
}), p.select(T).selectAll(".bc-line").each(function(ne) {
|
|
3425
|
-
const Le = ne, Fe =
|
|
3426
|
-
if (Wt.attr("stroke", Fe).attr("stroke-width", Ve), Ae && Wt.attr("opacity", W.has(Le.name) ? 1 : 0.3),
|
|
3427
|
-
const da = Aa(
|
|
3425
|
+
const Le = ne, Fe = qe(Le.name, Le.colorIndex, x, w), Ve = Dc(Le.name, w), rt = zc(Le.name, w), nt = pi(Le.name, e.interpolation ?? "linear", w), Wt = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
3426
|
+
if (Wt.attr("stroke", Fe).attr("stroke-width", Ve), Ae && Wt.attr("opacity", W.has(Le.name) ? 1 : 0.3), rt !== "solid" && p.select(this).attr("stroke-dasharray", U[rt] ?? ""), nt !== (e.interpolation ?? "linear")) {
|
|
3427
|
+
const da = Aa(nt), Oa = p.line().curve(da).x((qt, qr) => me(qr)).y((qt) => we(qt));
|
|
3428
3428
|
Wt.attr("d", Oa(Le.values));
|
|
3429
3429
|
}
|
|
3430
3430
|
}), p.select(T).selectAll(".bc-area").each(function(ne) {
|
|
3431
|
-
const Le = ne, Fe =
|
|
3431
|
+
const Le = ne, Fe = qe(Le.name, Le.colorIndex, x, w), Ve = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
3432
3432
|
Ve.attr("fill", Fe), Ae && Ve.attr("opacity", W.has(Le.name) ? e.areaFillOpacity ?? 0.2 : 0.1);
|
|
3433
3433
|
}), p.select(T).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
|
|
3434
|
-
const ne =
|
|
3434
|
+
const ne = I.map((Le) => ({
|
|
3435
3435
|
cx: me(n.labels.indexOf(Le.label)),
|
|
3436
3436
|
cy: we(Le.value),
|
|
3437
3437
|
label: Le.label,
|
|
3438
3438
|
value: Le.value,
|
|
3439
3439
|
series: Le.series,
|
|
3440
|
-
color:
|
|
3440
|
+
color: qe(Le.series, Le.colorIndex, x, w)
|
|
3441
3441
|
}));
|
|
3442
3442
|
Cr(Se, {
|
|
3443
3443
|
width: ye,
|
|
@@ -3448,11 +3448,11 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3448
3448
|
crosshairDirection: e.crosshairDirection,
|
|
3449
3449
|
crosshairStyle: e.crosshairStyle,
|
|
3450
3450
|
crosshairColor: e.crosshairColor,
|
|
3451
|
-
numberFormat: (
|
|
3451
|
+
numberFormat: (Ra = e.verticalAxis) == null ? void 0 : Ra.numberFormat,
|
|
3452
3452
|
container: t
|
|
3453
3453
|
});
|
|
3454
3454
|
}
|
|
3455
|
-
const
|
|
3455
|
+
const Ue = C ? {
|
|
3456
3456
|
symbolShape: C.symbol,
|
|
3457
3457
|
symbolShowOn: C.showOn,
|
|
3458
3458
|
symbolStyle: C.style,
|
|
@@ -3460,7 +3460,7 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3460
3460
|
symbolOpacity: C.opacity
|
|
3461
3461
|
} : void 0, Re = n.labels.length;
|
|
3462
3462
|
y.forEach((ne, Le) => {
|
|
3463
|
-
const Fe = Ec(ne.name,
|
|
3463
|
+
const Fe = Ec(ne.name, Ue, w);
|
|
3464
3464
|
if (!Fe)
|
|
3465
3465
|
return;
|
|
3466
3466
|
const Ve = {
|
|
@@ -3469,34 +3469,34 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3469
3469
|
style: Fe.symbolStyle ?? (C == null ? void 0 : C.style) ?? yt.Filled,
|
|
3470
3470
|
size: Fe.symbolSize ?? (C == null ? void 0 : C.size) ?? 3.5,
|
|
3471
3471
|
opacity: Fe.symbolOpacity ?? (C == null ? void 0 : C.opacity) ?? 1
|
|
3472
|
-
},
|
|
3472
|
+
}, rt = n.labels.map((Oa, qt) => ({
|
|
3473
3473
|
cx: me(qt),
|
|
3474
3474
|
cy: we(ne.values[qt]),
|
|
3475
|
-
color:
|
|
3475
|
+
color: qe(ne.name, Le, x, w),
|
|
3476
3476
|
index: qt
|
|
3477
|
-
})),
|
|
3477
|
+
})), nt = c.find((Oa) => Oa.getAttribute("data-series-name") === ne.name);
|
|
3478
3478
|
let Wt, da = !1;
|
|
3479
|
-
|
|
3479
|
+
nt ? (Se.appendChild(nt), Wt = p.select(nt), da = !0) : Wt = p.select(Se).append("g").attr("class", "bc-symbols").attr("data-series", Le).attr("data-series-name", ne.name), hn(Wt, rt, Re, Ve, r && da);
|
|
3480
3480
|
});
|
|
3481
|
-
const
|
|
3481
|
+
const ft = n.labels.length - 1, mt = me(ft) + 6, at = [];
|
|
3482
3482
|
if (y.forEach((ne, Le) => {
|
|
3483
|
-
var
|
|
3483
|
+
var nt;
|
|
3484
3484
|
if (ha(ne.name, P, w) !== "direct")
|
|
3485
3485
|
return;
|
|
3486
|
-
const Ve = ne.values[
|
|
3487
|
-
|
|
3488
|
-
}),
|
|
3489
|
-
|
|
3490
|
-
const ne =
|
|
3491
|
-
|
|
3492
|
-
p.select(Se).append("text").attr("class", "bc-direct-label").attr("data-series", Ve.index).attr("x", mt).attr("y", Fe[
|
|
3486
|
+
const Ve = ne.values[ft], rt = ((nt = w == null ? void 0 : w.find((Wt) => Wt.name === ne.name)) == null ? void 0 : nt.labelText) || ne.name;
|
|
3487
|
+
at.push({ name: ne.name, index: Le, naturalY: we(Ve), text: rt });
|
|
3488
|
+
}), at.length > 0) {
|
|
3489
|
+
at.sort((Ve, rt) => Ve.naturalY - rt.naturalY);
|
|
3490
|
+
const ne = at.map((Ve) => Ve.naturalY), Fe = pn(ne, 0, ge, 14);
|
|
3491
|
+
at.forEach((Ve, rt) => {
|
|
3492
|
+
p.select(Se).append("text").attr("class", "bc-direct-label").attr("data-series", Ve.index).attr("x", mt).attr("y", Fe[rt]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", qe(Ve.name, Ve.index, x, w)).text(Ve.text);
|
|
3493
3493
|
});
|
|
3494
3494
|
}
|
|
3495
3495
|
const Ct = A.filter((ne) => ha(ne, P, w) === "legend");
|
|
3496
|
-
if (
|
|
3496
|
+
if (H && Ct.length > 0) {
|
|
3497
3497
|
const ne = Ct.map((Ve) => {
|
|
3498
|
-
const
|
|
3499
|
-
return
|
|
3498
|
+
const rt = v.findIndex((nt) => nt.name === Ve);
|
|
3499
|
+
return qe(Ve, rt, x, w);
|
|
3500
3500
|
});
|
|
3501
3501
|
let Le = 0, Fe = 0;
|
|
3502
3502
|
if (K === "top") {
|
|
@@ -3505,7 +3505,7 @@ function jc(t, a, e = {}, r = !1) {
|
|
|
3505
3505
|
} else K === "bottom" ? Fe = ge + 25 : K === "left" ? Le = -(ve.width + 10) : K === "right" && (Le = ye + 10);
|
|
3506
3506
|
ba(Se, Ct, ne, Fe, K, X, ye, ge, Le, [], { left: xe.left, right: xe.right });
|
|
3507
3507
|
}
|
|
3508
|
-
|
|
3508
|
+
Rt(t, { chartType: "line-multi", margin: xe }), f && (Nt(S.node()), It(t, f));
|
|
3509
3509
|
}
|
|
3510
3510
|
function Zc(t, a, e, r, n, s, o) {
|
|
3511
3511
|
const i = p.select(t).append("g").attr("class", "bc-area-fills");
|
|
@@ -3542,8 +3542,8 @@ function Jc(t, a, e, r, n, s, o, i, c) {
|
|
|
3542
3542
|
if (d.push({ x: y, fromY: x, toY: A }), v < f - 1) {
|
|
3543
3543
|
const w = n(a[v + 1]), $ = n(e[v + 1]), P = Qc(x, w, A, $);
|
|
3544
3544
|
if (P !== null && P > 0 && P < 1) {
|
|
3545
|
-
const D = y + P * (r(v + 1) - y),
|
|
3546
|
-
d.push({ x: D, fromY:
|
|
3545
|
+
const D = y + P * (r(v + 1) - y), H = x + P * (w - x), j = A + P * ($ - A);
|
|
3546
|
+
d.push({ x: D, fromY: H, toY: j });
|
|
3547
3547
|
}
|
|
3548
3548
|
}
|
|
3549
3549
|
}
|
|
@@ -3574,7 +3574,7 @@ const Kc = [
|
|
|
3574
3574
|
"#b07aa1",
|
|
3575
3575
|
"#ff9da7"
|
|
3576
3576
|
];
|
|
3577
|
-
class ef extends
|
|
3577
|
+
class ef extends ct {
|
|
3578
3578
|
initialize() {
|
|
3579
3579
|
}
|
|
3580
3580
|
}
|
|
@@ -3583,11 +3583,11 @@ function tf(t, a, e = {}, r = !1) {
|
|
|
3583
3583
|
}
|
|
3584
3584
|
function Li(t, a, e, r, n = !1) {
|
|
3585
3585
|
var Me;
|
|
3586
|
-
|
|
3586
|
+
Ht(n);
|
|
3587
3587
|
let s = null, o;
|
|
3588
3588
|
if (n) {
|
|
3589
|
-
const J =
|
|
3590
|
-
J && J.chartType !== ae && (s =
|
|
3589
|
+
const J = Yt(t), ae = r > 0 ? "donut" : "pie";
|
|
3590
|
+
J && J.chartType !== ae && (s = Bt(t)), o = /* @__PURE__ */ new Map();
|
|
3591
3591
|
for (const ke of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3592
3592
|
for (const [me, Ce] of Mt(ke))
|
|
3593
3593
|
o.set(me, Ce);
|
|
@@ -3595,20 +3595,20 @@ function Li(t, a, e, r, n = !1) {
|
|
|
3595
3595
|
}
|
|
3596
3596
|
const { body: i } = _t(t, e.frame);
|
|
3597
3597
|
let c = [...a.labels], f = [...a.values];
|
|
3598
|
-
if (e.sort ===
|
|
3598
|
+
if (e.sort === lt.Ascending || e.sort === lt.Descending) {
|
|
3599
3599
|
const J = c.map((ae, ke) => ({ label: ae, value: f[ke] }));
|
|
3600
|
-
J.sort((ae, ke) => e.sort ===
|
|
3600
|
+
J.sort((ae, ke) => e.sort === lt.Ascending ? ae.value - ke.value : ke.value - ae.value), c = J.map((ae) => ae.label), f = J.map((ae) => ae.value);
|
|
3601
3601
|
}
|
|
3602
3602
|
if (e.sliceMax && e.sliceMax > 0 && c.length > e.sliceMax) {
|
|
3603
3603
|
const J = e.sliceMax - 1, ae = c.slice(0, J), ke = f.slice(0, J), me = f.slice(J).reduce((Ce, we) => Ce + we, 0);
|
|
3604
3604
|
ae.push(e.sliceGroupLabel ?? "Others"), ke.push(me), c = ae, f = ke;
|
|
3605
3605
|
}
|
|
3606
|
-
const d = f.reduce((J, ae) => J + ae, 0), g = f.map((J) => d > 0 ? J / d * 100 : 0), b = e.colors ?? Kc, m = b.length < c.length && b.length >= 2 ?
|
|
3607
|
-
if (w &&
|
|
3606
|
+
const d = f.reduce((J, ae) => J + ae, 0), g = f.map((J) => d > 0 ? J / d * 100 : 0), b = e.colors ?? Kc, m = b.length < c.length && b.length >= 2 ? Ge.scale(b).mode("lch").colors(c.length) : b, v = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? bt.Auto : bt.Off, y = !!v && !(v === bt.Auto && e.legend === !0), A = (e.showValues ?? !0) && !y ? f.map((J, ae) => `(${e.displayAsPercentage ? `${Math.round(g[ae])}%` : String(J)})`) : [], w = e.legend !== !1 && !y, $ = $t(i).width, P = 350, D = e.legendPosition ?? "top", H = $ > 0 && $ < P && (D === "left" || D === "right") ? "top" : D, j = e.legendAnchor ?? "start", _ = A.length > 0 ? c.map((J, ae) => `${J} ${A[ae]}`) : c, B = Math.max(0, $ - 50 - 20), K = w ? ya(_, H, B) : { width: 0, height: 0 }, X = w ? K.height + 15 : 0, te = {};
|
|
3607
|
+
if (w && H === "top" && (te.top = X), w && H === "bottom" && (te.bottom = 24 + X), w && H === "left" && (te.left = 50 + K.width + 10), w && H === "right" && (te.right = 20 + K.width + 10), y) {
|
|
3608
3608
|
const J = $t(i), ae = 20, ke = J.width - 2 * ae, me = (J.height > 0 ? J.height : 400) - 2 * ae, Ce = Math.min(ke, me) / 2, we = Xc(c, Ce);
|
|
3609
3609
|
te.left = (te.left ?? ae) + we.left, te.right = (te.right ?? ae) + we.right, te.top = (te.top ?? ae) + we.top, te.bottom = (te.bottom ?? ae) + we.bottom;
|
|
3610
3610
|
}
|
|
3611
|
-
const { chartArea: fe, width: se, height: F, margin:
|
|
3611
|
+
const { chartArea: fe, width: se, height: F, margin: Y } = Gt(i, te), R = Math.min(se, F) / 2, ie = R * r, he = p.scaleOrdinal().domain(c).range(m), ve = p.pie().sort(null), ce = p.arc().innerRadius(ie).outerRadius(R), ue = p.select(fe).append("g").attr("transform", `translate(${se / 2},${F / 2})`), Se = ve(f), ye = Se.map((J, ae) => ({
|
|
3612
3612
|
label: c[ae],
|
|
3613
3613
|
arc: J,
|
|
3614
3614
|
color: he(c[ae])
|
|
@@ -3650,8 +3650,8 @@ function Li(t, a, e, r, n = !1) {
|
|
|
3650
3650
|
displayAsPercentage: e.displayAsPercentage,
|
|
3651
3651
|
showLabel: e.showLabels ?? !0,
|
|
3652
3652
|
showValue: e.showValues ?? !0
|
|
3653
|
-
})), ae = ue, ke = Ft(t), me = { outerRadius:
|
|
3654
|
-
v ===
|
|
3653
|
+
})), ae = ue, ke = Ft(t), me = { outerRadius: R, innerRadius: ie, bgColor: ke };
|
|
3654
|
+
v === bt.Inside ? Si(ae, J, me) : v === bt.Auto ? qc(ae, J, me) : Ai(ae, J, me);
|
|
3655
3655
|
}
|
|
3656
3656
|
if (e.showTotal && r > 0 && !e.displayAsPercentage) {
|
|
3657
3657
|
const J = String(d);
|
|
@@ -3659,15 +3659,15 @@ function Li(t, a, e, r, n = !1) {
|
|
|
3659
3659
|
}
|
|
3660
3660
|
if (w) {
|
|
3661
3661
|
let J = 0, ae = 0;
|
|
3662
|
-
|
|
3662
|
+
H === "top" ? ae = -(K.height + 10) : H === "bottom" ? ae = F + 25 : H === "left" ? J = -(K.width + 10) : H === "right" && (J = se + 10), ba(fe, c, m, ae, H, j, se, F, J, A, { left: Y.left, right: Y.right });
|
|
3663
3663
|
}
|
|
3664
|
-
|
|
3664
|
+
Rt(t, { chartType: r > 0 ? "donut" : "pie" }), s && (Nt(ue.node()), It(t, s));
|
|
3665
3665
|
}
|
|
3666
3666
|
function af(t, a, e = {}, r = !1) {
|
|
3667
3667
|
Li(t, a, e, 0, r);
|
|
3668
3668
|
}
|
|
3669
3669
|
const $i = "#4e79a7";
|
|
3670
|
-
class rf extends
|
|
3670
|
+
class rf extends ct {
|
|
3671
3671
|
initialize() {
|
|
3672
3672
|
this.configDefine("xPos", { defaultValue: (n, s) => 0 }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("color", { defaultValue: $i }), this.configDefine("curve", { defaultValue: p.curveMonotoneX }), this.configDefine("areaFillOpacity", { defaultValue: 0.25 }), this.configDefine("height", { defaultValue: 0 });
|
|
3673
3673
|
const a = this.base.append("g"), e = this.base.append("g"), r = this.base.append("g");
|
|
@@ -3733,31 +3733,31 @@ class rf extends lt {
|
|
|
3733
3733
|
}
|
|
3734
3734
|
function nf(t, a, e = {}, r = !1) {
|
|
3735
3735
|
var xe, pe, Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z;
|
|
3736
|
-
|
|
3736
|
+
Ht(r), Mr(t);
|
|
3737
3737
|
let n = [], s = [], o = [], i = null, c = null, f, d;
|
|
3738
3738
|
const g = Vt.for(t);
|
|
3739
3739
|
if (r) {
|
|
3740
|
-
const S =
|
|
3741
|
-
d = S == null ? void 0 : S.margin, g.detach(), (S == null ? void 0 : S.chartType) === "area" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), i = t.querySelector(".bc-frame .bc-symbols")) : S && (c =
|
|
3740
|
+
const S = Yt(t);
|
|
3741
|
+
d = S == null ? void 0 : S.margin, g.detach(), (S == null ? void 0 : S.chartType) === "area" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), i = t.querySelector(".bc-frame .bc-symbols")) : S && (c = Bt(t)), f = /* @__PURE__ */ new Map();
|
|
3742
3742
|
for (const T of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3743
3743
|
for (const [O, z] of Mt(T))
|
|
3744
3744
|
f.set(O, z);
|
|
3745
3745
|
t.replaceChildren();
|
|
3746
3746
|
}
|
|
3747
|
-
const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (J = e.verticalAxis) == null ? void 0 : J.labelPosition, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: $ } = Gt(b, y), P = Kt(d, $), D = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range),
|
|
3747
|
+
const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (J = e.verticalAxis) == null ? void 0 : J.labelPosition, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: $ } = Gt(b, y), P = Kt(d, $), D = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range), H = D.map((S) => a.labels[S]), j = D.map((S) => a.values[S]), _ = H.map((S, T) => ({
|
|
3748
3748
|
label: S,
|
|
3749
3749
|
value: j[T]
|
|
3750
|
-
})),
|
|
3750
|
+
})), B = p.scalePoint().domain(H).range([0, A]).padding(e.edgePadding ? 0.6 : 0), K = B, X = (S) => B(S.label) ?? 0, te = ((Ce = e.verticalAxis) == null ? void 0 : Ce.scaleType) === "log", [fe, se] = Va(j, (we = e.verticalAxis) == null ? void 0 : we.range, (Ne = e.verticalAxis) == null ? void 0 : Ne.scaleType), F = te ? p.scaleSymlog().domain([fe, se]).nice().range([w, 0]) : p.scaleLinear().domain([fe, se]).nice().range([w, 0]), Y = F.domain(), R = Y[0] < 0 && Y[1] > 0 ? F(0) : void 0;
|
|
3751
3751
|
g.attach(x, P), g.update({
|
|
3752
3752
|
vertical: { scale: F, height: w, options: { ...e.verticalAxis, gridWidth: A, topPadding: $.top } },
|
|
3753
|
-
horizontal: { scale: K, height: w, options: { ...e.horizontalAxis, width: A, zeroY:
|
|
3753
|
+
horizontal: { scale: K, height: w, options: { ...e.horizontalAxis, width: A, zeroY: R } }
|
|
3754
3754
|
});
|
|
3755
3755
|
const ie = x.ownerSVGElement, he = ta(ie, t, "plot", { x: 0, y: 0, width: A, height: w }), ve = p.select(x).append("g").attr("clip-path", `url(#${he})`), ce = ve.node(), ue = ((Oe = e.colors) == null ? void 0 : Oe[0]) ?? $i, Se = Aa(e.interpolation ?? "monotoneX"), ye = e.lineSymbols, ge = new rf(p.select(ce));
|
|
3756
3756
|
if (ge.config({ xPos: X, y: F, color: ue, curve: Se, areaFillOpacity: e.areaFillOpacity ?? 0.25, height: w }), s.length > 0 || n.length > 0 || o.length > 0) {
|
|
3757
3757
|
const S = (P == null ? void 0 : P.dx) ?? 0, T = (P == null ? void 0 : P.dy) ?? 0, O = ce.querySelectorAll(":scope > g");
|
|
3758
3758
|
O[0] && vt(O[0], n, S, T), O[1] && vt(O[1], s, S, T), O[2] && vt(O[2], o, S, T);
|
|
3759
3759
|
}
|
|
3760
|
-
if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation:
|
|
3760
|
+
if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation: st.Vertical })), ge.draw(_), (Q = e.annotations) != null && Q.length && $r(x, e.annotations, { scaleX: K, scaleY: F, data: _, width: A, height: w, backgroundColor: Ft(t), transition: r, priorAnnotations: f }), p.select(ce).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
|
|
3761
3761
|
const S = _.map((T) => ({
|
|
3762
3762
|
cx: X(T),
|
|
3763
3763
|
cy: F(T.value),
|
|
@@ -3788,7 +3788,7 @@ function nf(t, a, e = {}, r = !1) {
|
|
|
3788
3788
|
let T;
|
|
3789
3789
|
i ? (x.appendChild(i), T = p.select(i)) : T = p.select(x).append("g").attr("class", "bc-symbols"), hn(T, S, _.length, ye, r);
|
|
3790
3790
|
}
|
|
3791
|
-
|
|
3791
|
+
Rt(t, { chartType: "area", margin: $ }), c && (Nt(ve.node()), It(t, c));
|
|
3792
3792
|
}
|
|
3793
3793
|
function bn(t) {
|
|
3794
3794
|
const a = t.series ?? [];
|
|
@@ -3830,7 +3830,7 @@ const Mi = [
|
|
|
3830
3830
|
"#b07aa1",
|
|
3831
3831
|
"#ff9da7"
|
|
3832
3832
|
];
|
|
3833
|
-
class sf extends
|
|
3833
|
+
class sf extends ct {
|
|
3834
3834
|
initialize() {
|
|
3835
3835
|
this.configDefine("xPos", { defaultValue: (r) => 0 }), this.configDefine("colors", { defaultValue: Mi }), this.configDefine("curve", { defaultValue: p.curveMonotoneX }), this.configDefine("areaFillOpacity", { defaultValue: 0.85 }), this.configDefine("highlightTargets", { defaultValue: /* @__PURE__ */ new Set() });
|
|
3836
3836
|
const a = this.base.append("g"), e = this.base.append("g");
|
|
@@ -3876,35 +3876,35 @@ class sf extends lt {
|
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
3878
|
function of(t, a, e = {}, r = !1) {
|
|
3879
|
-
var
|
|
3880
|
-
|
|
3879
|
+
var We, Xe, Qe, Ue, Re, ft, mt, at, Ct;
|
|
3880
|
+
Ht(r), Mr(t);
|
|
3881
3881
|
let n = a, s = [], o = [], i = null, c, f;
|
|
3882
3882
|
const d = Vt.for(t);
|
|
3883
3883
|
if (r) {
|
|
3884
|
-
const M =
|
|
3885
|
-
f = M == null ? void 0 : M.margin, d.detach(), (M == null ? void 0 : M.chartType) === "area-stacked" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), o = Array.from(t.querySelectorAll(".bc-frame .bc-line"))) : M && (i =
|
|
3884
|
+
const M = Yt(t);
|
|
3885
|
+
f = M == null ? void 0 : M.margin, d.detach(), (M == null ? void 0 : M.chartType) === "area-stacked" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), o = Array.from(t.querySelectorAll(".bc-frame .bc-line"))) : M && (i = Bt(t)), c = /* @__PURE__ */ new Map();
|
|
3886
3886
|
for (const oe of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3887
3887
|
for (const [le, re] of Mt(oe))
|
|
3888
3888
|
c.set(le, re);
|
|
3889
3889
|
t.replaceChildren();
|
|
3890
3890
|
}
|
|
3891
|
-
const { body: g } = _t(t, e.frame), b = Lr(n.labels, (
|
|
3891
|
+
const { body: g } = _t(t, e.frame), b = Lr(n.labels, (We = e.horizontalAxis) == null ? void 0 : We.range);
|
|
3892
3892
|
if (b.length < n.labels.length) {
|
|
3893
3893
|
const M = b.map((le) => n.labels[le]), oe = (n.series ?? []).map((le) => ({ ...le, values: b.map((re) => le.values[re]) }));
|
|
3894
3894
|
n = { labels: M, values: b.map((le) => n.values[le]), series: oe };
|
|
3895
3895
|
}
|
|
3896
|
-
const m = n.series ?? [], v = m.filter((M) => !Ma(M.name, e.seriesOverrides)), y = e.colors ?? Mi, x = v.map((M) => M.name), A = e.seriesOverrides, w = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", $ = w ? "direct" : e.legend !== !1 ? "legend" : "none", P = x.filter((M) => ha(M, $, A) === "direct"), D = e.legend !== !1 && !w,
|
|
3897
|
-
if (fe !==
|
|
3896
|
+
const m = n.series ?? [], v = m.filter((M) => !Ma(M.name, e.seriesOverrides)), y = e.colors ?? Mi, x = v.map((M) => M.name), A = e.seriesOverrides, w = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", $ = w ? "direct" : e.legend !== !1 ? "legend" : "none", P = x.filter((M) => ha(M, $, A) === "direct"), D = e.legend !== !1 && !w, H = $t(g).width, j = 350, _ = e.legendPosition ?? "top", B = H > 0 && H < j && (_ === "left" || _ === "right") ? "top" : _, K = e.legendAnchor ?? "start", X = e.stacked !== !1, te = e.stackPercent === !0 || e.stackMode === va.Percent, fe = e.areaSortMode ?? lt.None, se = e.areaLines !== !1, F = [...v];
|
|
3897
|
+
if (fe !== lt.None) {
|
|
3898
3898
|
const M = new Map(F.map((oe) => [oe.name, oe.values.reduce((le, re) => le + re, 0)]));
|
|
3899
3899
|
F.sort((oe, le) => {
|
|
3900
3900
|
const re = (M.get(oe.name) ?? 0) - (M.get(le.name) ?? 0);
|
|
3901
|
-
return fe ===
|
|
3901
|
+
return fe === lt.Ascending ? re : -re;
|
|
3902
3902
|
});
|
|
3903
3903
|
}
|
|
3904
|
-
const
|
|
3904
|
+
const Y = { labels: n.labels, values: n.values, series: F }, R = te ? mn(Y) : bn(Y);
|
|
3905
3905
|
let ie = 0;
|
|
3906
3906
|
if (X)
|
|
3907
|
-
for (const M of
|
|
3907
|
+
for (const M of R)
|
|
3908
3908
|
for (const oe of M)
|
|
3909
3909
|
oe[1] > ie && (ie = oe[1]);
|
|
3910
3910
|
else
|
|
@@ -3912,12 +3912,12 @@ function of(t, a, e = {}, r = !1) {
|
|
|
3912
3912
|
for (const oe of M.values)
|
|
3913
3913
|
oe > ie && (ie = oe);
|
|
3914
3914
|
te && (ie = 100);
|
|
3915
|
-
const he = [0, ie], ve = ((
|
|
3916
|
-
if (D &&
|
|
3915
|
+
const he = [0, ie], ve = ((Xe = e.verticalAxis) == null ? void 0 : Xe.numberFormat) ?? (te ? "|d|%" : void 0), ce = wa(he, (Qe = e.verticalAxis) == null ? void 0 : Qe.range, ve, (Ue = e.verticalAxis) == null ? void 0 : Ue.scaleType), ue = ea(H, (Re = e.verticalAxis) == null ? void 0 : Re.labelPosition, (ft = e.horizontalAxis) == null ? void 0 : ft.labelPosition, (mt = e.verticalAxis) == null ? void 0 : mt.direction, ce), Se = P.length > 0 ? gi(P) : 0, ye = ue.top != null, ge = Math.max(0, H - (ue.left ?? 50) - (ue.right ?? 20) - Se), xe = D ? ya(x, B, ge) : { width: 0, height: 0 }, pe = D ? xe.height + 15 : 0, Me = { ...ue };
|
|
3916
|
+
if (D && B === "top") {
|
|
3917
3917
|
const M = ye ? 15 : 0;
|
|
3918
3918
|
Me.top = pe + M;
|
|
3919
3919
|
}
|
|
3920
|
-
D &&
|
|
3920
|
+
D && B === "bottom" && (Me.bottom = (Me.bottom ?? 24) + pe), D && B === "left" && (Me.left = (Me.left ?? 50) + xe.width + 10), D && B === "right" && (Me.right = (Me.right ?? 20) + xe.width + 10), Se > 0 && (Me.right = (Me.right ?? 20) + Se);
|
|
3921
3921
|
const { chartArea: J, width: ae, height: ke, margin: me } = Gt(g, Me), Ce = Kt(f, me), we = p.scalePoint().domain(n.labels).range([0, ae]).padding(e.edgePadding ? 0.6 : 0), Ne = we, Oe = (M) => we(n.labels[M]) ?? 0, Q = p.scaleLinear().domain([0, ie]).nice().range([ke, 0]);
|
|
3922
3922
|
d.attach(J, Ce), d.update({
|
|
3923
3923
|
vertical: {
|
|
@@ -3927,7 +3927,7 @@ function of(t, a, e = {}, r = !1) {
|
|
|
3927
3927
|
},
|
|
3928
3928
|
horizontal: { scale: Ne, height: ke, options: { ...e.horizontalAxis, width: ae } }
|
|
3929
3929
|
});
|
|
3930
|
-
const Z = J.ownerSVGElement, S = ta(Z, t, "plot", { x: 0, y: 0, width: ae, height: ke }), T = p.select(J).append("g").attr("clip-path", `url(#${S})`), O = T.node(), z = Aa(e.interpolation ?? "monotoneX"),
|
|
3930
|
+
const Z = J.ownerSVGElement, S = ta(Z, t, "plot", { x: 0, y: 0, width: ae, height: ke }), T = p.select(J).append("g").attr("clip-path", `url(#${S})`), O = T.node(), z = Aa(e.interpolation ?? "monotoneX"), I = R.map((M) => {
|
|
3931
3931
|
const oe = m.findIndex((re) => re.name === M.key);
|
|
3932
3932
|
let le;
|
|
3933
3933
|
if (X)
|
|
@@ -3946,16 +3946,16 @@ function of(t, a, e = {}, r = !1) {
|
|
|
3946
3946
|
const M = (Ce == null ? void 0 : Ce.dx) ?? 0, oe = (Ce == null ? void 0 : Ce.dy) ?? 0, le = O.querySelectorAll(":scope > g");
|
|
3947
3947
|
le[0] && vt(le[0], s, M, oe), le[1] && vt(le[1], o, M, oe);
|
|
3948
3948
|
}
|
|
3949
|
-
if (W.draw(
|
|
3950
|
-
const oe = M, le =
|
|
3949
|
+
if (W.draw(I), p.select(O).selectAll(".bc-area").each(function(M) {
|
|
3950
|
+
const oe = M, le = qe(oe.name, oe.colorIndex, y, A), re = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
3951
3951
|
re.attr("fill", le), U && re.attr("opacity", C.has(oe.name) ? E : 0.3);
|
|
3952
3952
|
}), se || p.select(O).selectAll(".bc-line").attr("display", "none"), p.select(O).selectAll(".bc-line").each(function(M) {
|
|
3953
|
-
const oe = M, le =
|
|
3953
|
+
const oe = M, le = qe(oe.name, oe.colorIndex, y, A), re = pi(oe.name, e.interpolation ?? "monotoneX", A), Te = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
3954
3954
|
if (Te.attr("stroke", le), U && Te.attr("opacity", C.has(oe.name) ? 1 : 0.3), re !== (e.interpolation ?? "monotoneX")) {
|
|
3955
|
-
const
|
|
3955
|
+
const je = Aa(re), Ot = p.line().curve(je).x((it, Je) => Oe(Je)).y((it) => it[1]);
|
|
3956
3956
|
Te.attr("d", Ot(oe.points));
|
|
3957
3957
|
}
|
|
3958
|
-
}), (
|
|
3958
|
+
}), (at = e.annotations) != null && at.length) {
|
|
3959
3959
|
const M = n.labels.map((oe, le) => {
|
|
3960
3960
|
var re;
|
|
3961
3961
|
return {
|
|
@@ -3967,17 +3967,17 @@ function of(t, a, e = {}, r = !1) {
|
|
|
3967
3967
|
}
|
|
3968
3968
|
if (e.tooltips || e.crosshair) {
|
|
3969
3969
|
const M = [];
|
|
3970
|
-
|
|
3970
|
+
R.forEach((oe) => {
|
|
3971
3971
|
const le = m.findIndex((re) => re.name === oe.key);
|
|
3972
3972
|
Array.from(oe).forEach((re, Te) => {
|
|
3973
|
-
const
|
|
3973
|
+
const je = re[1] - re[0];
|
|
3974
3974
|
M.push({
|
|
3975
3975
|
cx: Oe(Te),
|
|
3976
3976
|
cy: Q(re[1]),
|
|
3977
3977
|
label: n.labels[Te],
|
|
3978
|
-
value: Math.round(
|
|
3978
|
+
value: Math.round(je * 100) / 100,
|
|
3979
3979
|
series: oe.key,
|
|
3980
|
-
color:
|
|
3980
|
+
color: qe(oe.key, le, y, A)
|
|
3981
3981
|
});
|
|
3982
3982
|
});
|
|
3983
3983
|
}), Cr(J, {
|
|
@@ -3993,37 +3993,37 @@ function of(t, a, e = {}, r = !1) {
|
|
|
3993
3993
|
container: t
|
|
3994
3994
|
});
|
|
3995
3995
|
}
|
|
3996
|
-
const Ae = n.labels.length - 1, Pe = Oe(Ae) + 6,
|
|
3996
|
+
const Ae = n.labels.length - 1, Pe = Oe(Ae) + 6, Be = [];
|
|
3997
3997
|
if (v.forEach((M, oe) => {
|
|
3998
|
-
var
|
|
3998
|
+
var it;
|
|
3999
3999
|
if (ha(M.name, $, A) !== "direct")
|
|
4000
4000
|
return;
|
|
4001
|
-
const re =
|
|
4001
|
+
const re = R.find((Je) => Je.key === M.name);
|
|
4002
4002
|
if (!re)
|
|
4003
4003
|
return;
|
|
4004
|
-
const Te = re[Ae],
|
|
4005
|
-
|
|
4006
|
-
}),
|
|
4007
|
-
|
|
4008
|
-
const M =
|
|
4009
|
-
|
|
4010
|
-
p.select(J).append("text").attr("class", "bc-direct-label").attr("data-series", re.index).attr("x", Pe).attr("y", le[Te]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill",
|
|
4004
|
+
const Te = re[Ae], je = Q((Te[0] + Te[1]) / 2), Ot = ((it = A == null ? void 0 : A.find((Je) => Je.name === M.name)) == null ? void 0 : it.labelText) || M.name;
|
|
4005
|
+
Be.push({ name: M.name, index: oe, naturalY: je, text: Ot });
|
|
4006
|
+
}), Be.length > 0) {
|
|
4007
|
+
Be.sort((re, Te) => re.naturalY - Te.naturalY);
|
|
4008
|
+
const M = Be.map((re) => re.naturalY), le = pn(M, 0, ke, 14);
|
|
4009
|
+
Be.forEach((re, Te) => {
|
|
4010
|
+
p.select(J).append("text").attr("class", "bc-direct-label").attr("data-series", re.index).attr("x", Pe).attr("y", le[Te]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", qe(re.name, re.index, y, A)).text(re.text);
|
|
4011
4011
|
});
|
|
4012
4012
|
}
|
|
4013
4013
|
const Ye = x.filter((M) => ha(M, $, A) === "legend");
|
|
4014
4014
|
if (D && Ye.length > 0) {
|
|
4015
4015
|
const M = Ye.map((re) => {
|
|
4016
|
-
const Te = m.findIndex((
|
|
4017
|
-
return
|
|
4016
|
+
const Te = m.findIndex((je) => je.name === re);
|
|
4017
|
+
return qe(re, Te, y, A);
|
|
4018
4018
|
});
|
|
4019
4019
|
let oe = 0, le = 0;
|
|
4020
|
-
if (
|
|
4020
|
+
if (B === "top") {
|
|
4021
4021
|
const re = ye ? 15 : 0;
|
|
4022
4022
|
le = -(xe.height + 10 + re);
|
|
4023
|
-
} else
|
|
4024
|
-
ba(J, Ye, M, le,
|
|
4023
|
+
} else B === "bottom" ? le = ke + 25 : B === "left" ? oe = -(xe.width + 10) : B === "right" && (oe = ae + 10);
|
|
4024
|
+
ba(J, Ye, M, le, B, K, ae, ke, oe, [], { left: me.left, right: me.right });
|
|
4025
4025
|
}
|
|
4026
|
-
|
|
4026
|
+
Rt(t, { chartType: "area-stacked", margin: me }), i && (Nt(T.node()), It(t, i));
|
|
4027
4027
|
}
|
|
4028
4028
|
const Ci = [
|
|
4029
4029
|
"#4e79a7",
|
|
@@ -4035,7 +4035,7 @@ const Ci = [
|
|
|
4035
4035
|
"#b07aa1",
|
|
4036
4036
|
"#ff9da7"
|
|
4037
4037
|
];
|
|
4038
|
-
class lf extends
|
|
4038
|
+
class lf extends ct {
|
|
4039
4039
|
initialize() {
|
|
4040
4040
|
this.configDefine("x", { defaultValue: p.scaleBand() }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("colors", { defaultValue: Ci });
|
|
4041
4041
|
const a = this.base.append("g");
|
|
@@ -4081,44 +4081,44 @@ function cf(t, a, e) {
|
|
|
4081
4081
|
}
|
|
4082
4082
|
function ff(t, a, e = {}, r = !1) {
|
|
4083
4083
|
var Ne, Oe, Q, Z, S, T, O, z;
|
|
4084
|
-
|
|
4084
|
+
Ht(r);
|
|
4085
4085
|
let n = [], s = null, o, i;
|
|
4086
4086
|
const c = Vt.for(t);
|
|
4087
4087
|
if (r) {
|
|
4088
|
-
const
|
|
4089
|
-
i =
|
|
4088
|
+
const I = Yt(t);
|
|
4089
|
+
i = I == null ? void 0 : I.margin, c.detach(), (I == null ? void 0 : I.chartType) === "column-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : I && (s = Bt(t)), o = /* @__PURE__ */ new Map();
|
|
4090
4090
|
for (const C of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
4091
4091
|
for (const [U, E] of Mt(C))
|
|
4092
4092
|
o.set(U, E);
|
|
4093
4093
|
t.replaceChildren();
|
|
4094
4094
|
}
|
|
4095
|
-
const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((
|
|
4095
|
+
const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((I) => !Ma(I.name, e.seriesOverrides)), b = g.map((I) => I.name), m = e.colors ?? Ci, v = e.seriesOverrides, y = e.legend !== !1, x = $t(f).width, A = 350, w = e.legendPosition ?? "top", $ = x > 0 && x < A && (w === "left" || w === "right") ? "top" : w, P = e.legendAnchor ?? "start", D = { labels: a.labels, values: a.values, series: g }, H = e.stackMode === va.Percent, j = H ? mn(D) : bn(D), _ = cf(j, a.labels, d), B = H ? 100 : p.max(_, (I) => I.y1) ?? 0, X = wa([0, B], (Ne = e.verticalAxis) == null ? void 0 : Ne.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.numberFormat, (Q = e.verticalAxis) == null ? void 0 : Q.scaleType), te = ea(x, (Z = e.verticalAxis) == null ? void 0 : Z.labelPosition, (S = e.horizontalAxis) == null ? void 0 : S.labelPosition, (T = e.verticalAxis) == null ? void 0 : T.direction, X), fe = Math.max(0, x - (te.left ?? 50) - (te.right ?? 20)), se = sn(a.labels, fe, e.horizontalAxis);
|
|
4096
4096
|
se !== void 0 && (te.bottom = se);
|
|
4097
|
-
const F = te.top != null,
|
|
4097
|
+
const F = te.top != null, Y = Math.max(0, x - (te.left ?? 50) - (te.right ?? 20)), R = y ? ya(b, $, Y) : { width: 0, height: 0 }, ie = y ? R.height + 15 : 0, he = { ...te };
|
|
4098
4098
|
if (y && $ === "top") {
|
|
4099
|
-
const
|
|
4100
|
-
he.top = ie +
|
|
4099
|
+
const I = F ? 15 : 0;
|
|
4100
|
+
he.top = ie + I;
|
|
4101
4101
|
}
|
|
4102
|
-
y && $ === "bottom" && (he.bottom = (he.bottom ?? 24) + ie), y && $ === "left" && (he.left = (he.left ?? 50) +
|
|
4102
|
+
y && $ === "bottom" && (he.bottom = (he.bottom ?? 24) + ie), y && $ === "left" && (he.left = (he.left ?? 50) + R.width + 10), y && $ === "right" && (he.right = (he.right ?? 20) + R.width + 10);
|
|
4103
4103
|
const { chartArea: ve, width: ce, height: ue, margin: Se } = Gt(f, he), ye = Kt(i, Se);
|
|
4104
4104
|
let ge = a.labels;
|
|
4105
4105
|
if (e.sortMode === "total") {
|
|
4106
|
-
const
|
|
4106
|
+
const I = a.labels.map((C, U) => ({
|
|
4107
4107
|
label: C,
|
|
4108
4108
|
index: U,
|
|
4109
4109
|
total: g.reduce((E, W) => E + (W.values[U] ?? 0), 0)
|
|
4110
4110
|
}));
|
|
4111
|
-
|
|
4111
|
+
I.sort((C, U) => U.total - C.total), ge = I.map((C) => C.label);
|
|
4112
4112
|
}
|
|
4113
|
-
const xe = p.scaleBand().domain(ge).range([0, ce]).padding(ka(e.barGap)), pe = p.scaleLinear().domain([0,
|
|
4113
|
+
const xe = p.scaleBand().domain(ge).range([0, ce]).padding(ka(e.barGap)), pe = p.scaleLinear().domain([0, B]).nice().range([ue, 0]);
|
|
4114
4114
|
c.attach(ve, ye), c.update({
|
|
4115
4115
|
vertical: { scale: pe, height: ue, options: { ...e.verticalAxis, gridWidth: ce, topPadding: Se.top } },
|
|
4116
4116
|
horizontal: { scale: xe, height: ue, options: { ...e.horizontalAxis, width: ce } }
|
|
4117
4117
|
});
|
|
4118
|
-
const Me = ve.ownerSVGElement, J = ta(Me, t, "bars", { x: 0, y: 0, width: ce, height: ue }), ae = p.select(ve).append("g").attr("clip-path", `url(#${J})`), ke = ge === a.labels ? _ : ge.flatMap((
|
|
4118
|
+
const Me = ve.ownerSVGElement, J = ta(Me, t, "bars", { x: 0, y: 0, width: ce, height: ue }), ae = p.select(ve).append("g").attr("clip-path", `url(#${J})`), ke = ge === a.labels ? _ : ge.flatMap((I) => _.filter((C) => C.label === I)), me = new lf(ae);
|
|
4119
4119
|
if (me.config({ x: xe, y: pe, colors: m }), n.length > 0) {
|
|
4120
|
-
const
|
|
4121
|
-
vt(
|
|
4120
|
+
const I = ae.node().querySelector("g");
|
|
4121
|
+
vt(I, n, (ye == null ? void 0 : ye.dx) ?? 0, (ye == null ? void 0 : ye.dy) ?? 0);
|
|
4122
4122
|
}
|
|
4123
4123
|
if (e.tooltips && me.use(ma({ numberFormat: (O = e.verticalAxis) == null ? void 0 : O.numberFormat })), e.crosshair && me.use(La({
|
|
4124
4124
|
width: ce,
|
|
@@ -4127,33 +4127,33 @@ function ff(t, a, e = {}, r = !1) {
|
|
|
4127
4127
|
style: e.crosshairStyle,
|
|
4128
4128
|
color: e.crosshairColor
|
|
4129
4129
|
})), (z = e.annotations) != null && z.length) {
|
|
4130
|
-
const
|
|
4130
|
+
const I = a.labels.map((C, U) => ({
|
|
4131
4131
|
label: C,
|
|
4132
4132
|
value: g.reduce((E, W) => E + (W.values[U] ?? 0), 0)
|
|
4133
4133
|
}));
|
|
4134
|
-
me.use(_a(e.annotations, { scaleX: xe, scaleY: pe, data:
|
|
4134
|
+
me.use(_a(e.annotations, { scaleX: xe, scaleY: pe, data: I, width: ce, height: ue, backgroundColor: Ft(t), transition: r, priorAnnotations: o }));
|
|
4135
4135
|
}
|
|
4136
|
-
me.draw(ke),
|
|
4137
|
-
const C =
|
|
4136
|
+
me.draw(ke), Rt(t, { chartType: "column-stacked", margin: Se }), s && (Nt(ae.node()), It(t, s)), p.select(ve).selectAll(".bc-bar-stacked").each(function(I) {
|
|
4137
|
+
const C = I, U = qe(C.seriesName, C.seriesIndex, m, v), E = Ka(C.seriesName, v), W = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
4138
4138
|
W.attr("fill", U), E < 1 && W.attr("fill-opacity", E);
|
|
4139
4139
|
});
|
|
4140
4140
|
const Ce = e.valueLabels ?? !1, we = p.select(ve).append("g").attr("class", "bc-value-labels");
|
|
4141
|
-
if (ke.forEach((
|
|
4142
|
-
if (!
|
|
4141
|
+
if (ke.forEach((I) => {
|
|
4142
|
+
if (!Ha(I.seriesName, Ce, v))
|
|
4143
4143
|
return;
|
|
4144
|
-
const C = (xe(
|
|
4145
|
-
we.append("text").attr("class", "bc-value-label").attr("data-series",
|
|
4144
|
+
const C = (xe(I.label) ?? 0) + xe.bandwidth() / 2, U = pe(I.y0) - (pe(I.y0) - pe(I.y1)) / 2;
|
|
4145
|
+
we.append("text").attr("class", "bc-value-label").attr("data-series", I.seriesName).attr("x", C).attr("y", U).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", "currentColor").text(H ? `${Math.round(I.value)}%` : String(Math.round(I.value * 100) / 100));
|
|
4146
4146
|
}), y && b.length > 0) {
|
|
4147
|
-
const
|
|
4147
|
+
const I = b.map((E) => {
|
|
4148
4148
|
const W = d.findIndex((Ae) => Ae.name === E);
|
|
4149
|
-
return
|
|
4149
|
+
return qe(E, W, m, v);
|
|
4150
4150
|
});
|
|
4151
4151
|
let C = 0, U = 0;
|
|
4152
4152
|
if ($ === "top") {
|
|
4153
4153
|
const E = F ? 15 : 0;
|
|
4154
|
-
U = -(
|
|
4155
|
-
} else $ === "bottom" ? U = ue + 25 : $ === "left" ? C = -(
|
|
4156
|
-
ba(ve, b,
|
|
4154
|
+
U = -(R.height + 10 + E);
|
|
4155
|
+
} else $ === "bottom" ? U = ue + 25 : $ === "left" ? C = -(R.width + 10) : $ === "right" && (C = ce + 10);
|
|
4156
|
+
ba(ve, b, I, U, $, P, ce, ue, C, [], { left: Se.left, right: Se.right });
|
|
4157
4157
|
}
|
|
4158
4158
|
}
|
|
4159
4159
|
const Oi = [
|
|
@@ -4166,7 +4166,7 @@ const Oi = [
|
|
|
4166
4166
|
"#b07aa1",
|
|
4167
4167
|
"#ff9da7"
|
|
4168
4168
|
], xs = 13;
|
|
4169
|
-
class df extends
|
|
4169
|
+
class df extends ct {
|
|
4170
4170
|
initialize() {
|
|
4171
4171
|
this.configDefine("x", { defaultValue: p.scaleLinear() }), this.configDefine("y", { defaultValue: p.scaleBand() }), this.configDefine("colors", { defaultValue: Oi }), this.configDefine("categoryLabelOffset", { defaultValue: 0 });
|
|
4172
4172
|
const a = this.base.append("g");
|
|
@@ -4211,35 +4211,35 @@ function uf(t, a, e) {
|
|
|
4211
4211
|
return r;
|
|
4212
4212
|
}
|
|
4213
4213
|
function hf(t, a, e = {}, r = !1) {
|
|
4214
|
-
var S, T, O, z,
|
|
4215
|
-
|
|
4214
|
+
var S, T, O, z, I, C, U;
|
|
4215
|
+
Ht(r);
|
|
4216
4216
|
let n = [], s = null, o, i;
|
|
4217
4217
|
const c = Vt.for(t);
|
|
4218
4218
|
if (r) {
|
|
4219
|
-
const E =
|
|
4220
|
-
i = E == null ? void 0 : E.margin, c.detach(), (E == null ? void 0 : E.chartType) === "bar-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : E && (s =
|
|
4219
|
+
const E = Yt(t);
|
|
4220
|
+
i = E == null ? void 0 : E.margin, c.detach(), (E == null ? void 0 : E.chartType) === "bar-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : E && (s = Bt(t)), o = /* @__PURE__ */ new Map();
|
|
4221
4221
|
for (const W of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
4222
4222
|
for (const [Ae, Pe] of Mt(W))
|
|
4223
4223
|
o.set(Ae, Pe);
|
|
4224
4224
|
t.replaceChildren();
|
|
4225
4225
|
}
|
|
4226
|
-
const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((E) => !Ma(E.name, e.seriesOverrides)), b = g.map((E) => E.name), m = e.colors ?? Oi, v = e.seriesOverrides, y = e.legend !== !1, x = $t(f).width, A = 350, w = e.legendPosition ?? "top", $ = x > 0 && x < A && (w === "left" || w === "right") ? "top" : w, P = e.legendAnchor ?? "start", D = { labels: a.labels, values: a.values, series: g },
|
|
4226
|
+
const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((E) => !Ma(E.name, e.seriesOverrides)), b = g.map((E) => E.name), m = e.colors ?? Oi, v = e.seriesOverrides, y = e.legend !== !1, x = $t(f).width, A = 350, w = e.legendPosition ?? "top", $ = x > 0 && x < A && (w === "left" || w === "right") ? "top" : w, P = e.legendAnchor ?? "start", D = { labels: a.labels, values: a.values, series: g }, H = e.stackMode === va.Percent, j = H ? mn(D) : bn(D), _ = uf(j, a.labels, d), B = H ? 100 : p.max(_, (E) => E.y1) ?? 0, K = e.categoryLabelLine === !0, X = Sr(a.labels), te = K ? He.Off : (S = e.verticalAxis) == null ? void 0 : S.labelPosition, fe = ea(x, te, (T = e.horizontalAxis) == null ? void 0 : T.labelPosition, (O = e.verticalAxis) == null ? void 0 : O.direction, X, (z = e.horizontalAxis) == null ? void 0 : z.showAxis), se = fe.top != null, F = Math.max(0, x - (fe.left ?? 50) - (fe.right ?? 20)), Y = y ? ya(b, $, F) : { width: 0, height: 0 }, R = y ? Y.height + 15 : 0, ie = { ...fe };
|
|
4227
4227
|
if (y && $ === "top") {
|
|
4228
4228
|
const E = se ? 15 : 0;
|
|
4229
|
-
ie.top =
|
|
4229
|
+
ie.top = R + E;
|
|
4230
4230
|
}
|
|
4231
|
-
y && $ === "bottom" && (ie.bottom = (ie.bottom ?? 24) +
|
|
4231
|
+
y && $ === "bottom" && (ie.bottom = (ie.bottom ?? 24) + R), y && $ === "left" && (ie.left = (ie.left ?? 50) + Y.width + 10), y && $ === "right" && (ie.right = (ie.right ?? 20) + Y.width + 10);
|
|
4232
4232
|
const { chartArea: he, width: ve, height: ce, margin: ue } = Gt(f, ie), Se = Kt(i, ue);
|
|
4233
4233
|
let ye = a.labels;
|
|
4234
4234
|
if (e.sortMode === "total") {
|
|
4235
4235
|
const E = a.labels.map((W, Ae) => ({
|
|
4236
4236
|
label: W,
|
|
4237
4237
|
index: Ae,
|
|
4238
|
-
total: g.reduce((Pe,
|
|
4238
|
+
total: g.reduce((Pe, Be) => Pe + (Be.values[Ae] ?? 0), 0)
|
|
4239
4239
|
}));
|
|
4240
4240
|
E.sort((W, Ae) => Ae.total - W.total), ye = E.map((W) => W.label);
|
|
4241
4241
|
}
|
|
4242
|
-
const ge = p.scaleLinear().domain([0,
|
|
4242
|
+
const ge = p.scaleLinear().domain([0, B]).nice().range([0, ve]), xe = p.scaleBand().domain(ye).range([0, ce]).padding(ka(e.barGap));
|
|
4243
4243
|
c.attach(he, Se), c.update({
|
|
4244
4244
|
horizontal: { scale: ge, height: ce, options: { ...e.horizontalAxis, width: ve } },
|
|
4245
4245
|
vertical: {
|
|
@@ -4247,7 +4247,7 @@ function hf(t, a, e = {}, r = !1) {
|
|
|
4247
4247
|
height: ce,
|
|
4248
4248
|
options: {
|
|
4249
4249
|
...e.verticalAxis,
|
|
4250
|
-
labelPosition: K ?
|
|
4250
|
+
labelPosition: K ? He.Off : (I = e.verticalAxis) == null ? void 0 : I.labelPosition,
|
|
4251
4251
|
topPadding: ue.top
|
|
4252
4252
|
}
|
|
4253
4253
|
},
|
|
@@ -4264,17 +4264,17 @@ function hf(t, a, e = {}, r = !1) {
|
|
|
4264
4264
|
direction: e.crosshairDirection,
|
|
4265
4265
|
style: e.crosshairStyle,
|
|
4266
4266
|
color: e.crosshairColor,
|
|
4267
|
-
orientation:
|
|
4267
|
+
orientation: st.Horizontal
|
|
4268
4268
|
})), (U = e.annotations) != null && U.length) {
|
|
4269
4269
|
const E = a.labels.map((W, Ae) => ({
|
|
4270
4270
|
label: W,
|
|
4271
|
-
value: g.reduce((Pe,
|
|
4271
|
+
value: g.reduce((Pe, Be) => Pe + (Be.values[Ae] ?? 0), 0)
|
|
4272
4272
|
}));
|
|
4273
|
-
me.use(_a(e.annotations, { scaleX: xe, scaleY: ge, data: E, width: ve, height: ce, backgroundColor: Ft(t), orientation:
|
|
4273
|
+
me.use(_a(e.annotations, { scaleX: xe, scaleY: ge, data: E, width: ve, height: ce, backgroundColor: Ft(t), orientation: st.Horizontal, transition: r, priorAnnotations: o }));
|
|
4274
4274
|
}
|
|
4275
|
-
if (me.draw(ae),
|
|
4276
|
-
const W = E, Ae =
|
|
4277
|
-
|
|
4275
|
+
if (me.draw(ae), Rt(t, { chartType: "bar-stacked", margin: ue }), s && (Nt(J.node()), It(t, s)), p.select(he).selectAll(".bc-bar-stacked").each(function(E) {
|
|
4276
|
+
const W = E, Ae = qe(W.seriesName, W.seriesIndex, m, v), Pe = Ka(W.seriesName, v), Be = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
4277
|
+
Be.attr("fill", Ae), Pe < 1 && Be.attr("fill-opacity", Pe);
|
|
4278
4278
|
}), K) {
|
|
4279
4279
|
const E = p.select(he).append("g").attr("class", "bc-category-labels");
|
|
4280
4280
|
for (const W of ye) {
|
|
@@ -4289,42 +4289,42 @@ function hf(t, a, e = {}, r = !1) {
|
|
|
4289
4289
|
const Ae = W[W.length - 1];
|
|
4290
4290
|
Ne.add(Ae.label + "\0" + Ae.seriesName);
|
|
4291
4291
|
for (let Pe = 0; Pe < W.length - 1; Pe++) {
|
|
4292
|
-
const
|
|
4293
|
-
Oe.set(
|
|
4292
|
+
const Be = W[Pe].label + "\0" + W[Pe].seriesName;
|
|
4293
|
+
Oe.set(Be, ge(W[Pe + 1].y1) - ge(W[Pe].y1));
|
|
4294
4294
|
}
|
|
4295
4295
|
}
|
|
4296
4296
|
}
|
|
4297
4297
|
const Q = /* @__PURE__ */ new Map(), Z = p.select(he).append("g").attr("class", "bc-value-labels");
|
|
4298
4298
|
if (ae.forEach((E) => {
|
|
4299
|
-
if (!
|
|
4299
|
+
if (!Ha(E.seriesName, Ce, v))
|
|
4300
4300
|
return;
|
|
4301
|
-
const W =
|
|
4301
|
+
const W = H ? `${Math.round(E.value)}%` : String(Math.round(E.value * 100) / 100), Ae = ge(E.y1) - ge(E.y0), Pe = W.length * 6.5 + 8, Be = Ae >= Pe, Ye = (xe(E.label) ?? 0) + ke + (xe.bandwidth() - ke) / 2, We = qe(E.seriesName, E.seriesIndex, m, v), Xe = Ne.has(E.label + "\0" + E.seriesName), Qe = we === ze.Outside || we === ze.Auto && !Be && Xe, Ue = () => {
|
|
4302
4302
|
const Re = ge(E.y0) + Ae / 2;
|
|
4303
|
-
Z.append("text").attr("class", "bc-value-label").attr("data-series", E.seriesName).attr("opacity", 0).attr("x", Re).attr("y", Ye).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Et(
|
|
4303
|
+
Z.append("text").attr("class", "bc-value-label").attr("data-series", E.seriesName).attr("opacity", 0).attr("x", Re).attr("y", Ye).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Et(We)).text(W);
|
|
4304
4304
|
};
|
|
4305
|
-
if (
|
|
4305
|
+
if (Qe)
|
|
4306
4306
|
if (we === ze.Inside)
|
|
4307
|
-
|
|
4307
|
+
Ue();
|
|
4308
4308
|
else {
|
|
4309
|
-
const Re = ge(E.y1) + 4,
|
|
4310
|
-
|
|
4309
|
+
const Re = ge(E.y1) + 4, ft = Q.get(E.label) ?? 0, mt = Oe.get(E.label + "\0" + E.seriesName), at = Re < ft, Ct = mt !== void 0 && Pe + 4 > mt, M = ve + ue.right - 2, oe = Re + Pe > M;
|
|
4310
|
+
at || Ct || oe ? Ue() : (Q.set(E.label, Re + Pe), Z.append("text").attr("class", "bc-value-label").attr("data-series", E.seriesName).attr("x", Re).attr("y", Ye).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", "currentColor").text(W));
|
|
4311
4311
|
}
|
|
4312
|
-
else if (!
|
|
4313
|
-
|
|
4312
|
+
else if (!Be)
|
|
4313
|
+
Ue();
|
|
4314
4314
|
else {
|
|
4315
4315
|
const Re = ge(E.y0) + Ae / 2;
|
|
4316
|
-
Z.append("text").attr("class", "bc-value-label").attr("data-series", E.seriesName).attr("x", Re).attr("y", Ye).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Et(
|
|
4316
|
+
Z.append("text").attr("class", "bc-value-label").attr("data-series", E.seriesName).attr("x", Re).attr("y", Ye).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Et(We)).text(W);
|
|
4317
4317
|
}
|
|
4318
4318
|
}), y && b.length > 0) {
|
|
4319
4319
|
const E = b.map((Pe) => {
|
|
4320
|
-
const
|
|
4321
|
-
return
|
|
4320
|
+
const Be = d.findIndex((Ye) => Ye.name === Pe);
|
|
4321
|
+
return qe(Pe, Be, m, v);
|
|
4322
4322
|
});
|
|
4323
4323
|
let W = 0, Ae = 0;
|
|
4324
4324
|
if ($ === "top") {
|
|
4325
4325
|
const Pe = se ? 15 : 0;
|
|
4326
|
-
Ae = -(
|
|
4327
|
-
} else $ === "bottom" ? Ae = ce + 25 : $ === "left" ? W = -(
|
|
4326
|
+
Ae = -(Y.height + 10 + Pe);
|
|
4327
|
+
} else $ === "bottom" ? Ae = ce + 25 : $ === "left" ? W = -(Y.width + 10) : $ === "right" && (W = ve + 10);
|
|
4328
4328
|
ba(he, b, E, Ae, $, P, ve, ce, W, [], { left: ue.left, right: ue.right });
|
|
4329
4329
|
}
|
|
4330
4330
|
}
|
|
@@ -4338,7 +4338,7 @@ const Pi = [
|
|
|
4338
4338
|
"#b07aa1",
|
|
4339
4339
|
"#ff9da7"
|
|
4340
4340
|
], As = 16, pr = 20, ws = 13;
|
|
4341
|
-
class gf extends
|
|
4341
|
+
class gf extends ct {
|
|
4342
4342
|
initialize() {
|
|
4343
4343
|
this.configDefine("y", { defaultValue: p.scaleBand() }), this.configDefine("colors", { defaultValue: Pi }), this.configDefine("categoryLabelOffset", { defaultValue: 0 });
|
|
4344
4344
|
const a = this.base.append("g");
|
|
@@ -4401,41 +4401,41 @@ function bf(t, a, e, r) {
|
|
|
4401
4401
|
}
|
|
4402
4402
|
function mf(t, a, e = {}, r = !1) {
|
|
4403
4403
|
var ke, me, Ce, we, Ne, Oe;
|
|
4404
|
-
|
|
4404
|
+
Ht(r);
|
|
4405
4405
|
let n = [], s = null, o;
|
|
4406
4406
|
const i = Vt.for(t);
|
|
4407
4407
|
if (r) {
|
|
4408
|
-
const Q =
|
|
4409
|
-
o = Q == null ? void 0 : Q.margin, i.detach(), (Q == null ? void 0 : Q.chartType) === "bar-split" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")) : Q && (s =
|
|
4408
|
+
const Q = Yt(t);
|
|
4409
|
+
o = Q == null ? void 0 : Q.margin, i.detach(), (Q == null ? void 0 : Q.chartType) === "bar-split" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")) : Q && (s = Bt(t)), t.replaceChildren();
|
|
4410
4410
|
}
|
|
4411
|
-
const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Q) => !Ma(Q.name, e.seriesOverrides)), g = d.map((Q) => Q.name), b = e.colors ?? Pi, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, $ = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, D = Sr(a.labels),
|
|
4411
|
+
const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Q) => !Ma(Q.name, e.seriesOverrides)), g = d.map((Q) => Q.name), b = e.colors ?? Pi, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, $ = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, D = Sr(a.labels), H = P ? He.Off : (ke = e.verticalAxis) == null ? void 0 : ke.labelPosition, j = ea(
|
|
4412
4412
|
y,
|
|
4413
|
-
|
|
4413
|
+
H,
|
|
4414
4414
|
(me = e.horizontalAxis) == null ? void 0 : me.labelPosition,
|
|
4415
4415
|
(Ce = e.verticalAxis) == null ? void 0 : Ce.direction,
|
|
4416
4416
|
D,
|
|
4417
4417
|
(we = e.horizontalAxis) == null ? void 0 : we.showAxis
|
|
4418
4418
|
);
|
|
4419
4419
|
j.top = (j.top ?? 12) + pr;
|
|
4420
|
-
const _ = Math.max(0, y - (j.left ?? 50) - (j.right ?? 20)),
|
|
4421
|
-
v && w === "top" && (X.top = K + pr), v && w === "bottom" && (X.bottom = (X.bottom ?? 24) + K), v && w === "left" && (X.left = (X.left ?? 50) +
|
|
4422
|
-
const { chartArea: te, width: fe, height: se, margin: F } = Gt(c, X),
|
|
4423
|
-
let
|
|
4420
|
+
const _ = Math.max(0, y - (j.left ?? 50) - (j.right ?? 20)), B = v ? ya(g, w, _) : { width: 0, height: 0 }, K = v ? B.height + 15 : 0, X = { ...j };
|
|
4421
|
+
v && w === "top" && (X.top = K + pr), v && w === "bottom" && (X.bottom = (X.bottom ?? 24) + K), v && w === "left" && (X.left = (X.left ?? 50) + B.width + 10), v && w === "right" && (X.right = (X.right ?? 20) + B.width + 10);
|
|
4422
|
+
const { chartArea: te, width: fe, height: se, margin: F } = Gt(c, X), Y = Kt(o, F);
|
|
4423
|
+
let R = a.labels;
|
|
4424
4424
|
if (e.sortMode === "total") {
|
|
4425
4425
|
const Q = a.labels.map((Z, S) => ({
|
|
4426
4426
|
label: Z,
|
|
4427
4427
|
total: d.reduce((T, O) => T + (O.values[S] ?? 0), 0)
|
|
4428
4428
|
}));
|
|
4429
|
-
Q.sort((Z, S) => S.total - Z.total),
|
|
4429
|
+
Q.sort((Z, S) => S.total - Z.total), R = Q.map((Z) => Z.label);
|
|
4430
4430
|
}
|
|
4431
|
-
const ie = p.scaleBand().domain(
|
|
4432
|
-
i.attach(te,
|
|
4431
|
+
const ie = p.scaleBand().domain(R).range([0, se]).padding(ka(e.barGap)), he = P ? ws : 0;
|
|
4432
|
+
i.attach(te, Y), i.update({
|
|
4433
4433
|
vertical: {
|
|
4434
4434
|
scale: ie,
|
|
4435
4435
|
height: se,
|
|
4436
4436
|
options: {
|
|
4437
4437
|
...e.verticalAxis,
|
|
4438
|
-
labelPosition: P ?
|
|
4438
|
+
labelPosition: P ? He.Off : (Ne = e.verticalAxis) == null ? void 0 : Ne.labelPosition,
|
|
4439
4439
|
topPadding: F.top
|
|
4440
4440
|
}
|
|
4441
4441
|
},
|
|
@@ -4444,10 +4444,10 @@ function mf(t, a, e = {}, r = !1) {
|
|
|
4444
4444
|
const ve = e.sharedScale === !0, ce = pf(d, f, fe, ve), ue = te.ownerSVGElement, Se = ta(ue, t, "bars", { x: 0, y: 0, width: fe, height: se }), ye = p.select(te).append("g").attr("clip-path", `url(#${Se})`), ge = p.select(te).append("g").attr("class", "bc-split-headers");
|
|
4445
4445
|
for (const Q of ce)
|
|
4446
4446
|
ge.append("text").attr("class", "bc-split-header").attr("x", Q.xOffset + Q.panelWidth / 2).attr("y", -pr / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("font-weight", "600").attr("fill", "currentColor").text(Q.seriesName);
|
|
4447
|
-
const xe = bf(ce,
|
|
4447
|
+
const xe = bf(ce, R, a.labels, f), pe = new gf(ye);
|
|
4448
4448
|
if (pe.config({ y: ie, colors: b, categoryLabelOffset: he }), n.length > 0) {
|
|
4449
4449
|
const Q = ye.node().querySelector("g");
|
|
4450
|
-
vt(Q, n, (
|
|
4450
|
+
vt(Q, n, (Y == null ? void 0 : Y.dx) ?? 0, (Y == null ? void 0 : Y.dy) ?? 0);
|
|
4451
4451
|
}
|
|
4452
4452
|
if (e.tooltips && pe.use(ma({ numberFormat: (Oe = e.verticalAxis) == null ? void 0 : Oe.numberFormat })), e.crosshair && pe.use(La({
|
|
4453
4453
|
width: fe,
|
|
@@ -4455,27 +4455,27 @@ function mf(t, a, e = {}, r = !1) {
|
|
|
4455
4455
|
direction: e.crosshairDirection,
|
|
4456
4456
|
style: e.crosshairStyle,
|
|
4457
4457
|
color: e.crosshairColor,
|
|
4458
|
-
orientation:
|
|
4459
|
-
})), pe.draw(xe),
|
|
4460
|
-
const Z = Q, S =
|
|
4458
|
+
orientation: st.Horizontal
|
|
4459
|
+
})), pe.draw(xe), Rt(t, { chartType: "bar-split", margin: F }), s && (Nt(ye.node()), It(t, s)), p.select(te).selectAll(".bc-bar-split").each(function(Q) {
|
|
4460
|
+
const Z = Q, S = qe(Z.seriesName, Z.seriesIndex, b, m), T = Ka(Z.seriesName, m), O = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
4461
4461
|
O.attr("fill", S), T < 1 && O.attr("fill-opacity", T);
|
|
4462
4462
|
}), P) {
|
|
4463
4463
|
const Q = p.select(te).append("g").attr("class", "bc-category-labels");
|
|
4464
|
-
for (const Z of
|
|
4464
|
+
for (const Z of R) {
|
|
4465
4465
|
const S = ie(Z) ?? 0;
|
|
4466
4466
|
Q.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", S + ws / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(Z);
|
|
4467
4467
|
}
|
|
4468
4468
|
}
|
|
4469
4469
|
const Me = e.valueLabels ?? !0, J = e.valueLabelPosition ?? ze.Auto, ae = p.select(te).append("g").attr("class", "bc-value-labels");
|
|
4470
4470
|
if (xe.forEach((Q) => {
|
|
4471
|
-
if (!
|
|
4471
|
+
if (!Ha(Q.seriesName, Me, m))
|
|
4472
4472
|
return;
|
|
4473
4473
|
const Z = ce.find((W) => W.seriesName === Q.seriesName);
|
|
4474
4474
|
if (!Z)
|
|
4475
4475
|
return;
|
|
4476
|
-
const S =
|
|
4476
|
+
const S = qe(Q.seriesName, Q.seriesIndex, b, m), T = Q.xPos + Q.barWidth, O = Math.max(0, ie.bandwidth() - he), z = (ie(Q.label) ?? 0) + he + O / 2, I = J === ze.Inside || J === ze.Auto && Q.barWidth > 30;
|
|
4477
4477
|
let C, U, E;
|
|
4478
|
-
if (
|
|
4478
|
+
if (I)
|
|
4479
4479
|
C = T - 4, U = "end", E = Et(S);
|
|
4480
4480
|
else {
|
|
4481
4481
|
const W = T + 4, Ae = Z.xOffset + Z.panelWidth;
|
|
@@ -4485,10 +4485,10 @@ function mf(t, a, e = {}, r = !1) {
|
|
|
4485
4485
|
}), v && g.length > 0) {
|
|
4486
4486
|
const Q = g.map((T) => {
|
|
4487
4487
|
const O = f.findIndex((z) => z.name === T);
|
|
4488
|
-
return
|
|
4488
|
+
return qe(T, O, b, m);
|
|
4489
4489
|
});
|
|
4490
4490
|
let Z = 0, S = 0;
|
|
4491
|
-
w === "top" ? S = -(
|
|
4491
|
+
w === "top" ? S = -(B.height + 10 + pr) : w === "bottom" ? S = se + 25 : w === "left" ? Z = -(B.width + 10) : w === "right" && (Z = fe + 10), ba(te, g, Q, S, w, $, fe, se, Z, [], { left: F.left, right: F.right });
|
|
4492
4492
|
}
|
|
4493
4493
|
}
|
|
4494
4494
|
const an = [
|
|
@@ -4501,7 +4501,7 @@ const an = [
|
|
|
4501
4501
|
"#b07aa1",
|
|
4502
4502
|
"#ff9da7"
|
|
4503
4503
|
], Ss = 13;
|
|
4504
|
-
class yf extends
|
|
4504
|
+
class yf extends ct {
|
|
4505
4505
|
initialize() {
|
|
4506
4506
|
this.configDefine("x", { defaultValue: p.scaleLinear() }), this.configDefine("y0", { defaultValue: p.scaleBand() }), this.configDefine("y1", { defaultValue: p.scaleBand() }), this.configDefine("colors", { defaultValue: an }), this.configDefine("categoryLabelOffset", { defaultValue: 0 });
|
|
4507
4507
|
const a = this.base.append("g");
|
|
@@ -4529,39 +4529,39 @@ class yf extends lt {
|
|
|
4529
4529
|
}
|
|
4530
4530
|
function vf(t, a, e = {}, r = !1) {
|
|
4531
4531
|
var me, Ce, we, Ne, Oe, Q;
|
|
4532
|
-
|
|
4532
|
+
Ht(r);
|
|
4533
4533
|
let n = [], s = null, o;
|
|
4534
4534
|
const i = Vt.for(t);
|
|
4535
4535
|
if (r) {
|
|
4536
|
-
const Z =
|
|
4537
|
-
o = Z == null ? void 0 : Z.margin, i.detach(), (Z == null ? void 0 : Z.chartType) === "bar-grouped" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")) : Z && (s =
|
|
4536
|
+
const Z = Yt(t);
|
|
4537
|
+
o = Z == null ? void 0 : Z.margin, i.detach(), (Z == null ? void 0 : Z.chartType) === "bar-grouped" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")) : Z && (s = Bt(t)), t.replaceChildren();
|
|
4538
4538
|
}
|
|
4539
|
-
const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Z) => !Ma(Z.name, e.seriesOverrides)), g = d.map((Z) => Z.name), b = e.colors ?? an, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, $ = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, D = Sr(a.labels),
|
|
4539
|
+
const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Z) => !Ma(Z.name, e.seriesOverrides)), g = d.map((Z) => Z.name), b = e.colors ?? an, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, $ = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, D = Sr(a.labels), H = P ? He.Off : (me = e.verticalAxis) == null ? void 0 : me.labelPosition, j = ea(
|
|
4540
4540
|
y,
|
|
4541
|
-
|
|
4541
|
+
H,
|
|
4542
4542
|
(Ce = e.horizontalAxis) == null ? void 0 : Ce.labelPosition,
|
|
4543
4543
|
(we = e.verticalAxis) == null ? void 0 : we.direction,
|
|
4544
4544
|
D,
|
|
4545
4545
|
(Ne = e.horizontalAxis) == null ? void 0 : Ne.showAxis
|
|
4546
|
-
), _ = Math.max(0, y - (j.left ?? 50) - (j.right ?? 20)),
|
|
4547
|
-
v && w === "top" && (X.top = K), v && w === "bottom" && (X.bottom = (X.bottom ?? 24) + K), v && w === "left" && (X.left = (X.left ?? 50) +
|
|
4548
|
-
const { chartArea: te, width: fe, height: se, margin: F } = Gt(c, X),
|
|
4549
|
-
let
|
|
4546
|
+
), _ = Math.max(0, y - (j.left ?? 50) - (j.right ?? 20)), B = v ? ya(g, w, _) : { width: 0, height: 0 }, K = v ? B.height + 15 : 0, X = { ...j };
|
|
4547
|
+
v && w === "top" && (X.top = K), v && w === "bottom" && (X.bottom = (X.bottom ?? 24) + K), v && w === "left" && (X.left = (X.left ?? 50) + B.width + 10), v && w === "right" && (X.right = (X.right ?? 20) + B.width + 10);
|
|
4548
|
+
const { chartArea: te, width: fe, height: se, margin: F } = Gt(c, X), Y = Kt(o, F);
|
|
4549
|
+
let R = a.labels;
|
|
4550
4550
|
if (e.sortMode === "total") {
|
|
4551
4551
|
const Z = a.labels.map((S, T) => ({
|
|
4552
4552
|
label: S,
|
|
4553
4553
|
total: d.reduce((O, z) => O + (z.values[T] ?? 0), 0)
|
|
4554
4554
|
}));
|
|
4555
|
-
Z.sort((S, T) => T.total - S.total),
|
|
4555
|
+
Z.sort((S, T) => T.total - S.total), R = Z.map((S) => S.label);
|
|
4556
4556
|
}
|
|
4557
|
-
const ie = p.scaleBand().domain(
|
|
4558
|
-
i.attach(te,
|
|
4557
|
+
const ie = p.scaleBand().domain(R).range([0, se]).paddingInner(ka(e.barGap)).paddingOuter(0.05), he = P ? Ss : 0, ve = Math.max(0, ie.bandwidth() - he), ce = p.scaleBand().domain(g).range([0, ve]).padding(0.05), ue = p.max(d.flatMap((Z) => Z.values)) ?? 0, Se = p.scaleLinear().domain([0, ue]).nice().range([0, fe]);
|
|
4558
|
+
i.attach(te, Y), i.update({
|
|
4559
4559
|
vertical: {
|
|
4560
4560
|
scale: ie,
|
|
4561
4561
|
height: se,
|
|
4562
4562
|
options: {
|
|
4563
4563
|
...e.verticalAxis,
|
|
4564
|
-
labelPosition: P ?
|
|
4564
|
+
labelPosition: P ? He.Off : (Oe = e.verticalAxis) == null ? void 0 : Oe.labelPosition,
|
|
4565
4565
|
topPadding: F.top
|
|
4566
4566
|
}
|
|
4567
4567
|
},
|
|
@@ -4571,17 +4571,17 @@ function vf(t, a, e = {}, r = !1) {
|
|
|
4571
4571
|
const ye = te.ownerSVGElement, ge = ta(ye, t, "bars", { x: 0, y: 0, width: fe, height: se }), xe = p.select(te).append("g").attr("clip-path", `url(#${ge})`);
|
|
4572
4572
|
if (e.barBackground) {
|
|
4573
4573
|
const Z = (e.colors ?? an)[0];
|
|
4574
|
-
xe.selectAll(".bc-bar-bg").data(
|
|
4574
|
+
xe.selectAll(".bc-bar-bg").data(R, (S) => S).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (S) => (ie(S) ?? 0) + he).attr("width", fe).attr("height", ie.bandwidth() - he).attr("fill", Z).attr("opacity", 0.18);
|
|
4575
4575
|
}
|
|
4576
|
-
if (e.barSeparators &&
|
|
4576
|
+
if (e.barSeparators && R.length > 1) {
|
|
4577
4577
|
const Z = ie.step();
|
|
4578
|
-
for (let S = 1; S <
|
|
4579
|
-
const T = (ie(
|
|
4578
|
+
for (let S = 1; S < R.length; S++) {
|
|
4579
|
+
const T = (ie(R[S - 1]) ?? 0) + ie.bandwidth() + (Z - ie.bandwidth()) / 2;
|
|
4580
4580
|
xe.append("line").attr("class", "bc-bar-separator").attr("x1", 0).attr("x2", fe).attr("y1", T).attr("y2", T).attr("stroke", "currentColor").attr("opacity", 0.15);
|
|
4581
4581
|
}
|
|
4582
4582
|
}
|
|
4583
4583
|
const pe = [];
|
|
4584
|
-
for (const Z of
|
|
4584
|
+
for (const Z of R) {
|
|
4585
4585
|
const S = a.labels.indexOf(Z);
|
|
4586
4586
|
for (const T of d) {
|
|
4587
4587
|
const O = f.findIndex((z) => z.name === T.name);
|
|
@@ -4596,7 +4596,7 @@ function vf(t, a, e = {}, r = !1) {
|
|
|
4596
4596
|
const Me = new yf(xe);
|
|
4597
4597
|
if (Me.config({ x: Se, y0: ie, y1: ce, colors: b, categoryLabelOffset: he }), n.length > 0) {
|
|
4598
4598
|
const Z = xe.node().querySelector("g");
|
|
4599
|
-
vt(Z, n, (
|
|
4599
|
+
vt(Z, n, (Y == null ? void 0 : Y.dx) ?? 0, (Y == null ? void 0 : Y.dy) ?? 0);
|
|
4600
4600
|
}
|
|
4601
4601
|
if (e.tooltips && Me.use(ma({ numberFormat: (Q = e.verticalAxis) == null ? void 0 : Q.numberFormat })), e.crosshair && Me.use(La({
|
|
4602
4602
|
width: fe,
|
|
@@ -4604,31 +4604,31 @@ function vf(t, a, e = {}, r = !1) {
|
|
|
4604
4604
|
direction: e.crosshairDirection,
|
|
4605
4605
|
style: e.crosshairStyle,
|
|
4606
4606
|
color: e.crosshairColor,
|
|
4607
|
-
orientation:
|
|
4608
|
-
})), Me.draw(pe),
|
|
4609
|
-
const S = Z, T =
|
|
4607
|
+
orientation: st.Horizontal
|
|
4608
|
+
})), Me.draw(pe), Rt(t, { chartType: "bar-grouped", margin: F }), s && (Nt(xe.node()), It(t, s)), p.select(te).selectAll(".bc-bar-grouped").each(function(Z) {
|
|
4609
|
+
const S = Z, T = qe(S.seriesName, S.seriesIndex, b, m), O = Ka(S.seriesName, m), z = r ? p.select(this).transition().duration(Ee()) : p.select(this);
|
|
4610
4610
|
z.attr("fill", T), O < 1 && z.attr("fill-opacity", O);
|
|
4611
4611
|
}), P) {
|
|
4612
4612
|
const Z = p.select(te).append("g").attr("class", "bc-category-labels");
|
|
4613
|
-
for (const S of
|
|
4613
|
+
for (const S of R) {
|
|
4614
4614
|
const T = ie(S) ?? 0;
|
|
4615
4615
|
Z.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", T + Ss / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(S);
|
|
4616
4616
|
}
|
|
4617
4617
|
}
|
|
4618
4618
|
const J = e.valueLabels ?? !0, ae = e.valueLabelPosition ?? ze.Auto, ke = p.select(te).append("g").attr("class", "bc-value-labels");
|
|
4619
4619
|
if (pe.forEach((Z) => {
|
|
4620
|
-
if (!
|
|
4620
|
+
if (!Ha(Z.seriesName, J, m))
|
|
4621
4621
|
return;
|
|
4622
|
-
const S =
|
|
4622
|
+
const S = qe(Z.seriesName, Z.seriesIndex, b, m), T = Math.max(0, Se(Z.value) - Se(0)), O = Se(0) + T, z = (ie(Z.label) ?? 0) + he + (ce(Z.seriesName) ?? 0) + ce.bandwidth() / 2, I = ae === ze.Inside || ae === ze.Auto && T > 30;
|
|
4623
4623
|
let C, U, E;
|
|
4624
|
-
|
|
4624
|
+
I ? (C = O - 4, U = "end", E = Et(S)) : (C = O + 4, U = "start", E = "currentColor"), ke.append("text").attr("class", "bc-value-label").attr("data-series", Z.seriesName).attr("x", C).attr("y", z).attr("text-anchor", U).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", E).text(String(Z.value));
|
|
4625
4625
|
}), v && g.length > 0) {
|
|
4626
4626
|
const Z = g.map((O) => {
|
|
4627
|
-
const z = f.findIndex((
|
|
4628
|
-
return
|
|
4627
|
+
const z = f.findIndex((I) => I.name === O);
|
|
4628
|
+
return qe(O, z, b, m);
|
|
4629
4629
|
});
|
|
4630
4630
|
let S = 0, T = 0;
|
|
4631
|
-
w === "top" ? T = -(
|
|
4631
|
+
w === "top" ? T = -(B.height + 10) : w === "bottom" ? T = se + 25 : w === "left" ? S = -(B.width + 10) : w === "right" && (S = fe + 10), ba(te, g, Z, T, w, $, fe, se, S, [], { left: F.left, right: F.right });
|
|
4632
4632
|
}
|
|
4633
4633
|
}
|
|
4634
4634
|
const Or = /* @__PURE__ */ new Map();
|
|
@@ -4643,14 +4643,14 @@ function yn(t) {
|
|
|
4643
4643
|
var a;
|
|
4644
4644
|
return ((a = Or.get(t)) == null ? void 0 : a.options) ?? [];
|
|
4645
4645
|
}
|
|
4646
|
-
function
|
|
4646
|
+
function Qd() {
|
|
4647
4647
|
return Array.from(Or.keys());
|
|
4648
4648
|
}
|
|
4649
4649
|
const ks = [
|
|
4650
|
-
{ value:
|
|
4651
|
-
{ value:
|
|
4652
|
-
{ value:
|
|
4653
|
-
{ value:
|
|
4650
|
+
{ value: tt.Solid, text: "Solid" },
|
|
4651
|
+
{ value: tt.Dashed, text: "Dashed" },
|
|
4652
|
+
{ value: tt.Dotted, text: "Dotted" },
|
|
4653
|
+
{ value: tt.None, text: "None" }
|
|
4654
4654
|
], At = { key: "colors", type: de.Colors, label: "Colors" }, wt = {
|
|
4655
4655
|
key: "colorPalette",
|
|
4656
4656
|
type: de.Select,
|
|
@@ -4660,7 +4660,7 @@ const ks = [
|
|
|
4660
4660
|
{ value: "", text: "Custom" },
|
|
4661
4661
|
...ql().map((t) => ({ value: t.name, text: t.label }))
|
|
4662
4662
|
]
|
|
4663
|
-
}, St = { key: "autoContrast", type: de.Boolean, label: "Auto-adjust contrast", default: !1 }, kt = { key: "allowDarkMode", type: de.Boolean, label: "Allow dark mode", default: !0 },
|
|
4663
|
+
}, St = { key: "autoContrast", type: de.Boolean, label: "Auto-adjust contrast", default: !1 }, kt = { key: "allowDarkMode", type: de.Boolean, label: "Allow dark mode", default: !0 }, Ya = { key: "legend", type: de.Boolean, label: "Show legend", default: !0 }, oa = {
|
|
4664
4664
|
key: "legendPosition",
|
|
4665
4665
|
type: de.Select,
|
|
4666
4666
|
label: "Legend position",
|
|
@@ -4685,12 +4685,12 @@ const ks = [
|
|
|
4685
4685
|
key: "directLabelling",
|
|
4686
4686
|
type: de.Select,
|
|
4687
4687
|
label: "Direct labelling",
|
|
4688
|
-
default:
|
|
4688
|
+
default: bt.Off,
|
|
4689
4689
|
choices: [
|
|
4690
|
-
{ value:
|
|
4691
|
-
{ value:
|
|
4692
|
-
{ value:
|
|
4693
|
-
{ value:
|
|
4690
|
+
{ value: bt.Off, text: "Off" },
|
|
4691
|
+
{ value: bt.Auto, text: "Auto" },
|
|
4692
|
+
{ value: bt.Outside, text: "Outside" },
|
|
4693
|
+
{ value: bt.Inside, text: "Inside" }
|
|
4694
4694
|
]
|
|
4695
4695
|
}, vn = {
|
|
4696
4696
|
key: "directLabelAnchor",
|
|
@@ -4716,11 +4716,11 @@ const ks = [
|
|
|
4716
4716
|
key: "crosshairDirection",
|
|
4717
4717
|
type: de.Select,
|
|
4718
4718
|
label: "Crosshair direction",
|
|
4719
|
-
default:
|
|
4719
|
+
default: pt.Both,
|
|
4720
4720
|
choices: [
|
|
4721
|
-
{ value:
|
|
4722
|
-
{ value:
|
|
4723
|
-
{ value:
|
|
4721
|
+
{ value: pt.Both, text: "Both" },
|
|
4722
|
+
{ value: pt.Vertical, text: "Vertical" },
|
|
4723
|
+
{ value: pt.Horizontal, text: "Horizontal" }
|
|
4724
4724
|
]
|
|
4725
4725
|
}, Di = {
|
|
4726
4726
|
key: "crosshairStyle",
|
|
@@ -4746,7 +4746,7 @@ const ks = [
|
|
|
4746
4746
|
{ value: Tt.Cross, text: "Cross" },
|
|
4747
4747
|
{ value: Tt.Star, text: "Star" }
|
|
4748
4748
|
]
|
|
4749
|
-
},
|
|
4749
|
+
}, Bi = {
|
|
4750
4750
|
key: "lineSymbolShowOn",
|
|
4751
4751
|
type: de.Select,
|
|
4752
4752
|
label: "Show on",
|
|
@@ -4757,7 +4757,7 @@ const ks = [
|
|
|
4757
4757
|
{ value: Dt.Last, text: "Last" },
|
|
4758
4758
|
{ value: Dt.All, text: "All" }
|
|
4759
4759
|
]
|
|
4760
|
-
},
|
|
4760
|
+
}, Ii = {
|
|
4761
4761
|
key: "lineSymbolStyle",
|
|
4762
4762
|
type: de.Select,
|
|
4763
4763
|
label: "Style",
|
|
@@ -4776,7 +4776,7 @@ const ks = [
|
|
|
4776
4776
|
{ value: Zt.Total, text: "By total" },
|
|
4777
4777
|
{ value: Zt.WithinGroups, text: "Within groups" }
|
|
4778
4778
|
]
|
|
4779
|
-
}, Dr = { key: "edgePadding", type: de.Boolean, label: "Edge padding", default: !1 }, Er = { key: "waterfall", type: de.Boolean, label: "Waterfall", default: !1 }, Fr = { key: "waterfallTotal", type: de.Boolean, label: "Waterfall total", default: !1 }, tr = { key: "barBackground", type: de.Boolean, label: "Bar background", default: !1 }, Nr = { key: "barGap", type: de.Text, label: "Bar gap", default: String(Kr), placeholder: String(Kr) }, ar = { key: "barSeparators", type: de.Boolean, label: "Bar separators", default: !1 },
|
|
4779
|
+
}, Dr = { key: "edgePadding", type: de.Boolean, label: "Edge padding", default: !1 }, Er = { key: "waterfall", type: de.Boolean, label: "Waterfall", default: !1 }, Fr = { key: "waterfallTotal", type: de.Boolean, label: "Waterfall total", default: !1 }, tr = { key: "barBackground", type: de.Boolean, label: "Bar background", default: !1 }, Nr = { key: "barGap", type: de.Text, label: "Bar gap", default: String(Kr), placeholder: String(Kr) }, ar = { key: "barSeparators", type: de.Boolean, label: "Bar separators", default: !1 }, Br = { key: "connectedColumns", type: de.Boolean, label: "Connected columns", default: !1 }, Ir = { key: "connectionsOpacity", type: de.Text, label: "Opacity", default: "0.15", placeholder: "0.15" }, Vr = { key: "swapLabelValue", type: de.Boolean, label: "Swap labels and values", default: !1 }, Gi = {
|
|
4780
4780
|
key: "stackMode",
|
|
4781
4781
|
type: de.Select,
|
|
4782
4782
|
label: "Stack mode",
|
|
@@ -4785,15 +4785,15 @@ const ks = [
|
|
|
4785
4785
|
{ value: va.Normal, text: "Normal" },
|
|
4786
4786
|
{ value: va.Percent, text: "Percentage (100%)" }
|
|
4787
4787
|
]
|
|
4788
|
-
}, Af = { key: "sharedScale", type: de.Boolean, label: "Shared scale", default: !1 }, Ca = { key: "categoryLabelLine", type: de.Boolean, label: "Labels on separate line", default: !1 },
|
|
4788
|
+
}, Af = { key: "sharedScale", type: de.Boolean, label: "Shared scale", default: !1 }, Ca = { key: "categoryLabelLine", type: de.Boolean, label: "Labels on separate line", default: !1 }, Hi = { key: "displayAsPercentage", type: de.Boolean, label: "Display as percentage", default: !1 }, Yi = { key: "showTotal", type: de.Boolean, label: "Show total", default: !1 }, Ri = { key: "showLabels", type: de.Boolean, label: "Show labels", default: !0 }, Wi = { key: "showValues", type: de.Boolean, label: "Show values", default: !0 }, qi = { key: "sliceMax", type: de.Text, label: "Max slices", default: "6" }, Xi = { key: "sliceGroupLabel", type: de.Text, label: "Group label", default: "Others", placeholder: "Others" }, wf = { key: "areaFillOpacity", type: de.Text, label: "Opacity", default: "0.85", placeholder: "0.85" }, Sf = { key: "stacked", type: de.Boolean, label: "Stack areas", default: !0 }, kf = { key: "stackPercent", type: de.Boolean, label: "Stack to 100%", default: !1 }, Lf = { key: "areaLines", type: de.Boolean, label: "Separate areas with lines", default: !0 }, $f = {
|
|
4789
4789
|
key: "areaSortMode",
|
|
4790
4790
|
type: de.Select,
|
|
4791
4791
|
label: "Sort areas",
|
|
4792
|
-
default:
|
|
4792
|
+
default: lt.None,
|
|
4793
4793
|
choices: [
|
|
4794
|
-
{ value:
|
|
4795
|
-
{ value:
|
|
4796
|
-
{ value:
|
|
4794
|
+
{ value: lt.None, text: "Keep order" },
|
|
4795
|
+
{ value: lt.Ascending, text: "Smallest first" },
|
|
4796
|
+
{ value: lt.Descending, text: "Largest first" }
|
|
4797
4797
|
]
|
|
4798
4798
|
}, Mf = {
|
|
4799
4799
|
key: "interpolation",
|
|
@@ -4811,13 +4811,13 @@ const ks = [
|
|
|
4811
4811
|
{ value: jt.CatmullRom, text: "Catmull-Rom" }
|
|
4812
4812
|
]
|
|
4813
4813
|
}, Ls = [
|
|
4814
|
-
{ value:
|
|
4815
|
-
{ value:
|
|
4814
|
+
{ value: Ba.Linear, text: "Linear" },
|
|
4815
|
+
{ value: Ba.Log, text: "Logarithmic" }
|
|
4816
4816
|
], $s = [
|
|
4817
|
-
{ value:
|
|
4818
|
-
{ value:
|
|
4819
|
-
{ value:
|
|
4820
|
-
{ value:
|
|
4817
|
+
{ value: He.Auto, text: "Auto" },
|
|
4818
|
+
{ value: He.Inside, text: "Inside" },
|
|
4819
|
+
{ value: He.Outside, text: "Outside" },
|
|
4820
|
+
{ value: He.Off, text: "Off" }
|
|
4821
4821
|
], Cf = [
|
|
4822
4822
|
{ value: Ua.Auto, text: "Auto" },
|
|
4823
4823
|
{ value: Ua.Horizontal, text: "Horizontal" },
|
|
@@ -4828,22 +4828,22 @@ function rr(t) {
|
|
|
4828
4828
|
{ key: "showVerticalAxis", type: de.Boolean, label: "Show vertical axis", default: t.showVerticalAxis ?? !0 },
|
|
4829
4829
|
{ key: "verticalAxisDirection", type: de.Select, label: "Vertical axis side", default: zt.Left, choices: [{ value: zt.Left, text: "Left" }, { value: zt.Right, text: "Right" }] },
|
|
4830
4830
|
{ key: "showVerticalTicks", type: de.Boolean, label: "Show vertical ticks", default: t.showVerticalTicks },
|
|
4831
|
-
{ key: "verticalLabelPosition", type: de.Select, label: "Vertical labels", default:
|
|
4831
|
+
{ key: "verticalLabelPosition", type: de.Select, label: "Vertical labels", default: He.Auto, choices: $s },
|
|
4832
4832
|
{ key: "verticalGridStyle", type: de.Select, label: "Vertical grid style", default: t.verticalGrid, choices: ks },
|
|
4833
4833
|
{ key: "verticalNumberFormat", type: de.NumberFormat, label: "Vertical number format" },
|
|
4834
4834
|
...t.valueAxis === "vertical" ? [
|
|
4835
|
-
{ key: "verticalScaleType", type: de.Select, label: "Vertical scale", default:
|
|
4835
|
+
{ key: "verticalScaleType", type: de.Select, label: "Vertical scale", default: Ba.Linear, choices: Ls },
|
|
4836
4836
|
t.valueAxisZeroBaseline ? { key: "verticalRangeMin", type: de.Text, label: "Vertical min", default: "0", placeholder: "auto" } : { key: "verticalRangeMin", type: de.Text, label: "Vertical min", placeholder: "auto" },
|
|
4837
4837
|
{ key: "verticalRangeMax", type: de.Text, label: "Vertical max", placeholder: "auto" }
|
|
4838
4838
|
] : [],
|
|
4839
4839
|
{ key: "showHorizontalAxis", type: de.Boolean, label: "Show horizontal axis", default: !0 },
|
|
4840
4840
|
{ key: "showHorizontalTicks", type: de.Boolean, label: "Show horizontal ticks", default: t.showHorizontalTicks },
|
|
4841
|
-
{ key: "horizontalLabelPosition", type: de.Select, label: "Horizontal labels", default:
|
|
4841
|
+
{ key: "horizontalLabelPosition", type: de.Select, label: "Horizontal labels", default: He.Auto, choices: $s },
|
|
4842
4842
|
{ key: "horizontalLabelRotation", type: de.Select, label: "Horizontal label rotation", default: Ua.Horizontal, choices: Cf },
|
|
4843
4843
|
{ key: "horizontalGridStyle", type: de.Select, label: "Horizontal grid style", default: t.horizontalGrid, choices: ks },
|
|
4844
4844
|
{ key: "horizontalNumberFormat", type: de.NumberFormat, label: "Horizontal number format" },
|
|
4845
4845
|
...t.valueAxis === "horizontal" ? [
|
|
4846
|
-
{ key: "horizontalScaleType", type: de.Select, label: "Horizontal scale", default:
|
|
4846
|
+
{ key: "horizontalScaleType", type: de.Select, label: "Horizontal scale", default: Ba.Linear, choices: Ls },
|
|
4847
4847
|
t.valueAxisZeroBaseline ? { key: "horizontalRangeMin", type: de.Text, label: "Horizontal min", default: "0", placeholder: "auto" } : { key: "horizontalRangeMin", type: de.Text, label: "Horizontal min", placeholder: "auto" },
|
|
4848
4848
|
{ key: "horizontalRangeMax", type: de.Text, label: "Horizontal max", placeholder: "auto" }
|
|
4849
4849
|
] : [],
|
|
@@ -4853,23 +4853,23 @@ function rr(t) {
|
|
|
4853
4853
|
] : []
|
|
4854
4854
|
];
|
|
4855
4855
|
}
|
|
4856
|
-
const _r = rr({ verticalGrid:
|
|
4857
|
-
xt(
|
|
4858
|
-
xt(
|
|
4859
|
-
xt(
|
|
4860
|
-
xt(
|
|
4861
|
-
xt(
|
|
4862
|
-
xt(
|
|
4863
|
-
xt(
|
|
4864
|
-
xt(
|
|
4865
|
-
const Gf = rr({ verticalGrid:
|
|
4866
|
-
xt(
|
|
4867
|
-
xt(
|
|
4868
|
-
xt(
|
|
4869
|
-
xt(
|
|
4870
|
-
xt(
|
|
4871
|
-
xt(
|
|
4872
|
-
xt(
|
|
4856
|
+
const _r = rr({ verticalGrid: tt.Dashed, horizontalGrid: tt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", valueAxisZeroBaseline: !0 }), nr = rr({ verticalGrid: tt.None, horizontalGrid: tt.Dashed, showVerticalTicks: !1, showHorizontalTicks: !1, valueAxis: "horizontal", valueAxisZeroBaseline: !0 }), Ui = rr({ verticalGrid: tt.Dashed, horizontalGrid: tt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0 }), Of = rr({ verticalGrid: tt.Dashed, horizontalGrid: tt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0, valueAxisZeroBaseline: !0 }), Gr = { ...Mf, default: jt.MonotoneX }, Pf = { ...zi, default: pt.Vertical }, Tf = { ...Ti, default: !0 }, zf = { ...Fi, default: !0 }, ji = { ...er, default: Zt.Total }, xn = { ...Tr, default: !0 }, Df = { ...Hi, default: !0 }, Ef = { ...qi, default: "5" }, Ff = { ...Yi, default: !0 }, Hr = { ...Pr, default: bt.Auto }, Yr = { ...Ya, default: !1 }, Rr = [Ti, zi, Di, Ei], An = [Tf, Pf, Di, Ei], Wr = [Tr, zr, ca, ...Rr], wn = [xn, zr, ca, ...Rr], Nf = [Fi, Ni, Bi, Ii, Vi, _i], Bf = [zf, Ni, Bi, Ii, Vi, _i], Zi = [Tr, ca, ...An, ...Nf], If = [Tr, ca, ...An, ...Bf], Vf = [Df, Yi, Ri, Wi, Ef, Xi], _f = [Hi, Ff, Ri, Wi, qi, Xi];
|
|
4857
|
+
xt(_e.BarVertical, ui, [At, wt, St, kt, Vr, tr, ar, Nr, Br, Ir, Er, Fr, Ca, ..._r, ...Wr]);
|
|
4858
|
+
xt(_e.BarHorizontal, hi, [At, wt, St, kt, Vr, tr, ar, Nr, Br, Ir, Er, Fr, Ca, ...nr, ...wn]);
|
|
4859
|
+
xt(_e.BarMulti, Bc, [At, wt, St, kt, ji, Yr, la, oa, Hr, vn, ..._r, ...Wr]);
|
|
4860
|
+
xt(_e.Line, Wc, [At, wt, St, kt, Gr, Dr, ...Ui, ...Zi]);
|
|
4861
|
+
xt(_e.LineMulti, jc, [At, wt, St, kt, Gr, Dr, er, Yr, la, oa, Hr, ...Ui, ...If]);
|
|
4862
|
+
xt(_e.Donut, tf, [At, wt, St, kt, Yr, la, oa, Hr, ca, ..._f]);
|
|
4863
|
+
xt(_e.Pie, af, [At, wt, St, kt, Yr, la, oa, Hr, ca, ...Vf]);
|
|
4864
|
+
xt(_e.Area, nf, [At, wt, St, kt, Gr, Dr, ...Of, ...Zi]);
|
|
4865
|
+
const Gf = rr({ verticalGrid: tt.Dashed, horizontalGrid: tt.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0, valueAxisZeroBaseline: !0 });
|
|
4866
|
+
xt(_e.AreaStacked, of, [At, wt, St, kt, wf, Gr, Dr, $f, Sf, kf, Lf, Ya, la, oa, Pr, ...Gf, ca, ...An]);
|
|
4867
|
+
xt(_e.ColumnStacked, ff, [At, wt, St, kt, Gi, er, Ya, la, oa, Pr, vn, ..._r, ...Wr]);
|
|
4868
|
+
xt(_e.BarStacked, hf, [At, wt, St, kt, Gi, er, Ya, la, oa, Pr, vn, Ca, ...nr, ...wn]);
|
|
4869
|
+
xt(_e.BarSplit, mf, [At, wt, St, kt, Af, er, Ya, la, oa, Ca, ...nr, xn, zr, ca, ...Rr]);
|
|
4870
|
+
xt(_e.BarGrouped, vf, [At, wt, St, kt, ji, Ya, la, oa, tr, ar, Ca, ...nr, xn, zr, ca, ...Rr]);
|
|
4871
|
+
xt(_e.VerticalBar, ui, [At, wt, St, kt, Vr, tr, ar, Nr, Br, Ir, Er, Fr, Ca, ..._r, ...Wr]);
|
|
4872
|
+
xt(_e.HorizontalBar, hi, [At, wt, St, kt, Vr, tr, ar, Nr, Br, Ir, Er, Fr, Ca, ...nr, ...wn]);
|
|
4873
4873
|
function Ms(t) {
|
|
4874
4874
|
const a = t == null ? void 0 : t.trim();
|
|
4875
4875
|
if (!a)
|
|
@@ -4906,15 +4906,15 @@ function Qi(t) {
|
|
|
4906
4906
|
}
|
|
4907
4907
|
return { labels: e, values: r };
|
|
4908
4908
|
}
|
|
4909
|
-
function
|
|
4909
|
+
function Hf(t, a) {
|
|
4910
4910
|
const e = {}, r = Wl(t.colorPalette);
|
|
4911
4911
|
return r ? e.colors = r : t.colors && t.colors.length > 0 && (e.colors = t.colors), t.autoContrast && a && e.colors && (e.colors = fc(e.colors, a)), t.allowDarkMode !== void 0 && (e.allowDarkMode = t.allowDarkMode), e;
|
|
4912
4912
|
}
|
|
4913
|
-
function
|
|
4913
|
+
function Yf(t) {
|
|
4914
4914
|
const a = {};
|
|
4915
4915
|
return t.legend !== void 0 && (a.legend = t.legend), t.legendPosition !== void 0 && (a.legendPosition = t.legendPosition), t.legendAnchor !== void 0 && (a.legendAnchor = t.legendAnchor), t.directLabelling !== void 0 && (a.directLabelling = t.directLabelling), t.directLabelAnchor !== void 0 && (a.directLabelAnchor = t.directLabelAnchor), a;
|
|
4916
4916
|
}
|
|
4917
|
-
function
|
|
4917
|
+
function Rf(t) {
|
|
4918
4918
|
if (!(t.showVerticalTicks !== void 0 || t.verticalGridStyle !== void 0 || t.verticalNumberFormat !== void 0 || t.showVerticalAxis !== void 0 || t.verticalAxisDirection !== void 0 || t.verticalScaleType !== void 0 || t.verticalLabelPosition !== void 0 || t.verticalRangeMin || t.verticalRangeMax))
|
|
4919
4919
|
return {};
|
|
4920
4920
|
const e = {};
|
|
@@ -4943,9 +4943,9 @@ function qf(t) {
|
|
|
4943
4943
|
}
|
|
4944
4944
|
function Xf(t, a) {
|
|
4945
4945
|
const e = {
|
|
4946
|
-
...
|
|
4946
|
+
...Hf(t, a),
|
|
4947
|
+
...Yf(t),
|
|
4947
4948
|
...Rf(t),
|
|
4948
|
-
...Hf(t),
|
|
4949
4949
|
...Wf(t),
|
|
4950
4950
|
...qf(t)
|
|
4951
4951
|
};
|
|
@@ -4959,8 +4959,23 @@ function Xf(t, a) {
|
|
|
4959
4959
|
const o = parseFloat(t.areaFillOpacity ?? "");
|
|
4960
4960
|
return isNaN(o) || (e.areaFillOpacity = o), t.edgePadding !== void 0 && (e.edgePadding = t.edgePadding), t.waterfall !== void 0 && (e.waterfall = t.waterfall), t.waterfallTotal !== void 0 && (e.waterfallTotal = t.waterfallTotal), t.categoryLabelLine !== void 0 && (e.categoryLabelLine = t.categoryLabelLine), e;
|
|
4961
4961
|
}
|
|
4962
|
+
const Uf = {
|
|
4963
|
+
[_e.BarVertical]: "Vertical Bar Chart",
|
|
4964
|
+
[_e.BarHorizontal]: "Horizontal Bar Chart",
|
|
4965
|
+
[_e.BarMulti]: "Grouped Bar Chart",
|
|
4966
|
+
[_e.Line]: "Line Chart",
|
|
4967
|
+
[_e.LineMulti]: "Multi-Line Chart",
|
|
4968
|
+
[_e.Pie]: "Pie Chart",
|
|
4969
|
+
[_e.Donut]: "Donut Chart"
|
|
4970
|
+
};
|
|
4971
|
+
function Jd(t, a) {
|
|
4972
|
+
if (t.length === 0)
|
|
4973
|
+
return [];
|
|
4974
|
+
const e = t.filter((i) => i === "string").length, r = t.filter((i) => i === "number").length, n = t.filter((i) => i === "date").length, s = [], o = (i, c, f) => s.push({ chartType: i, label: Uf[i] ?? i, fitness: c, reason: f });
|
|
4975
|
+
return n === 1 && r >= 1 ? r === 1 ? (o(_e.Line, "best", "1 date + 1 numeric column — ideal for trend"), o(_e.BarVertical, "alternative", "Can also show as bars")) : (o(_e.LineMulti, "best", `1 date + ${r} numeric columns — compare trends`), o(_e.BarMulti, "alternative", "Can also show as grouped bars")) : e === 1 && r === 1 ? (o(_e.BarVertical, "best", "1 categorical + 1 numeric — classic bar chart"), o(_e.BarHorizontal, "good", "Horizontal bars work well for long labels"), a <= 8 && (o(_e.Donut, "good", `${a} items — suitable for part-of-whole`), o(_e.Pie, "alternative", "Pie chart for part-of-whole"))) : e === 1 && r > 1 ? (o(_e.BarMulti, "best", `1 categorical + ${r} numeric columns — compare groups`), o(_e.LineMulti, "good", "Can also show as multi-line chart")) : r >= 1 && (e >= 1 || n >= 1) && o(_e.BarVertical, "good", "Default bar chart recommendation"), s;
|
|
4976
|
+
}
|
|
4962
4977
|
const Zr = /* @__PURE__ */ Object.create(null);
|
|
4963
|
-
function
|
|
4978
|
+
function jf(t) {
|
|
4964
4979
|
if (!Zr[t]) {
|
|
4965
4980
|
const a = {};
|
|
4966
4981
|
for (const e of yn(t))
|
|
@@ -4971,10 +4986,10 @@ function Uf(t) {
|
|
|
4971
4986
|
}
|
|
4972
4987
|
function Cs(t, a) {
|
|
4973
4988
|
var n;
|
|
4974
|
-
const e =
|
|
4989
|
+
const e = jf(t);
|
|
4975
4990
|
return ((n = a.colors) == null ? void 0 : n.length) ? { ...e, colorPalette: void 0, ...a } : { ...e, ...a };
|
|
4976
4991
|
}
|
|
4977
|
-
const
|
|
4992
|
+
const Zf = {
|
|
4978
4993
|
protanopia: "Protanopia (no red)",
|
|
4979
4994
|
deuteranopia: "Deuteranopia (no green)",
|
|
4980
4995
|
tritanopia: "Tritanopia (no blue)"
|
|
@@ -5046,42 +5061,42 @@ const jf = {
|
|
|
5046
5061
|
0
|
|
5047
5062
|
]
|
|
5048
5063
|
};
|
|
5049
|
-
function
|
|
5064
|
+
function Qf(t) {
|
|
5050
5065
|
return `bc-cvd-${t}`;
|
|
5051
5066
|
}
|
|
5052
|
-
function
|
|
5067
|
+
function Kd(t) {
|
|
5053
5068
|
const a = "http://www.w3.org/2000/svg", e = document.createElementNS(a, "filter");
|
|
5054
|
-
e.setAttribute("id",
|
|
5069
|
+
e.setAttribute("id", Qf(t)), e.setAttribute("color-interpolation-filters", "linearRGB");
|
|
5055
5070
|
const r = document.createElementNS(a, "feColorMatrix");
|
|
5056
5071
|
return r.setAttribute("type", "matrix"), r.setAttribute("values", Ji[t].join(" ")), e.appendChild(r), e;
|
|
5057
5072
|
}
|
|
5058
|
-
function
|
|
5073
|
+
function Jf(t) {
|
|
5059
5074
|
return t <= 0.04045 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
|
|
5060
5075
|
}
|
|
5061
5076
|
function Qr(t) {
|
|
5062
5077
|
return t <= 31308e-7 ? 12.92 * t : 1.055 * t ** (1 / 2.4) - 0.055;
|
|
5063
5078
|
}
|
|
5064
|
-
function
|
|
5065
|
-
const [e, r, n] =
|
|
5066
|
-
return
|
|
5079
|
+
function Kf(t, a) {
|
|
5080
|
+
const [e, r, n] = Ge(t).rgb().map((d) => Jf(d / 255)), s = Ji[a], o = Qr(s[0] * e + s[1] * r + s[2] * n), i = Qr(s[5] * e + s[6] * r + s[7] * n), c = Qr(s[10] * e + s[11] * r + s[12] * n), f = (d) => Math.min(255, Math.max(0, Math.round(d * 255)));
|
|
5081
|
+
return Ge(f(o), f(i), f(c)).hex();
|
|
5067
5082
|
}
|
|
5068
|
-
const
|
|
5069
|
-
function
|
|
5083
|
+
const ed = 10;
|
|
5084
|
+
function eu(t) {
|
|
5070
5085
|
if (t.length < 2)
|
|
5071
5086
|
return [];
|
|
5072
5087
|
const a = ["protanopia", "deuteranopia", "tritanopia"], e = [];
|
|
5073
5088
|
for (const r of a) {
|
|
5074
|
-
const n = t.map((o) =>
|
|
5089
|
+
const n = t.map((o) => Kf(o, r)), s = [];
|
|
5075
5090
|
for (let o = 0; o < n.length; o++)
|
|
5076
5091
|
for (let i = o + 1; i < n.length; i++) {
|
|
5077
|
-
const c =
|
|
5078
|
-
c <
|
|
5092
|
+
const c = Ge.deltaE(n[o], n[i]);
|
|
5093
|
+
c < ed && s.push({ a: t[o], b: t[i], deltaE: c });
|
|
5079
5094
|
}
|
|
5080
|
-
s.length > 0 && e.push({ type: r, label:
|
|
5095
|
+
s.length > 0 && e.push({ type: r, label: Zf[r], pairs: s });
|
|
5081
5096
|
}
|
|
5082
5097
|
return e;
|
|
5083
5098
|
}
|
|
5084
|
-
function
|
|
5099
|
+
function td(t) {
|
|
5085
5100
|
const a = {
|
|
5086
5101
|
properties: [],
|
|
5087
5102
|
data: null,
|
|
@@ -5131,7 +5146,7 @@ function ed(t) {
|
|
|
5131
5146
|
}
|
|
5132
5147
|
return a;
|
|
5133
5148
|
}
|
|
5134
|
-
function
|
|
5149
|
+
function ad(t) {
|
|
5135
5150
|
const a = {
|
|
5136
5151
|
properties: [],
|
|
5137
5152
|
data: null,
|
|
@@ -5177,7 +5192,7 @@ function td(t) {
|
|
|
5177
5192
|
}
|
|
5178
5193
|
return a;
|
|
5179
5194
|
}
|
|
5180
|
-
function
|
|
5195
|
+
function rd(t, a) {
|
|
5181
5196
|
function e() {
|
|
5182
5197
|
this.constructor = t;
|
|
5183
5198
|
}
|
|
@@ -5187,7 +5202,7 @@ function xa(t, a, e, r) {
|
|
|
5187
5202
|
var n = Error.call(this, t);
|
|
5188
5203
|
return Object.setPrototypeOf && Object.setPrototypeOf(n, xa.prototype), n.expected = a, n.found = e, n.location = r, n.name = "SyntaxError", n;
|
|
5189
5204
|
}
|
|
5190
|
-
|
|
5205
|
+
rd(xa, Error);
|
|
5191
5206
|
function Jr(t, a, e) {
|
|
5192
5207
|
return e = e || " ", t.length > a ? t : (a -= t.length, e += e.repeat(a), t + e.slice(0, a));
|
|
5193
5208
|
}
|
|
@@ -5276,13 +5291,13 @@ xa.buildMessage = function(t, a) {
|
|
|
5276
5291
|
}
|
|
5277
5292
|
return "Expected " + i(t) + " but " + c(a) + " found.";
|
|
5278
5293
|
};
|
|
5279
|
-
function
|
|
5294
|
+
function nd(t, a) {
|
|
5280
5295
|
a = a !== void 0 ? a : {};
|
|
5281
|
-
var e = {}, r = a.grammarSource, n = { Chart: Fn }, s = Fn, o = "chart", i = "{", c = "}", f = "data", d = "=", g = ",", b = " ", m = "colorize", v = "highlight", y = "areafill", x = "annotation", A = "range", w = "note", $ = "series", P = "scene", D = "step",
|
|
5282
|
-
`, "\r", "{", "}", "="], !0, !1),
|
|
5283
|
-
`], !0, !1), Wt =
|
|
5296
|
+
var e = {}, r = a.grammarSource, n = { Chart: Fn }, s = Fn, o = "chart", i = "{", c = "}", f = "data", d = "=", g = ",", b = " ", m = "colorize", v = "highlight", y = "areafill", x = "annotation", A = "range", w = "note", $ = "series", P = "scene", D = "step", H = "transform", j = "hide_annotation", _ = "hide_range", B = "hide_note", K = "show_annotation", X = "show_range", te = "show_note", fe = "%", se = "-", F = ".", Y = '"', R = "\\", ie = "n", he = "r", ve = "t", ce = "u", ue = "//", Se = "/*", ye = "*/", ge = /^[^\t\n\r{}=]/, xe = /^[a-zA-Z_#]/, pe = /^[a-zA-Z0-9_#\-]/, Me = /^[0-9]/, J = /^[eE]/, ae = /^[+\-]/, ke = /^[^"\\]/, me = /^[0-9a-fA-F]/, Ce = /^[^\n]/, we = /^[ \t\n\r]/, Ne = Ie("chart", !1), Oe = Ie("{", !1), Q = Ie("}", !1), Z = Ie("data", !1), S = Ie("=", !1), T = Ie(",", !1), O = Ie(" ", !1), z = aa([" ", `
|
|
5297
|
+
`, "\r", "{", "}", "="], !0, !1), I = Ie("colorize", !1), C = Ie("highlight", !1), U = Ie("areafill", !1), E = Ie("annotation", !1), W = Ie("range", !1), Ae = Ie("note", !1), Pe = Ie("series", !1), Be = Ie("scene", !1), Ye = Ie("step", !1), We = Ie("transform", !1), Xe = Ie("hide_annotation", !1), Qe = Ie("hide_range", !1), Ue = Ie("hide_note", !1), Re = Ie("show_annotation", !1), ft = Ie("show_range", !1), mt = Ie("show_note", !1), at = Ie("%", !1), Ct = ir("identifier"), M = aa([["a", "z"], ["A", "Z"], "_", "#"], !1, !1), oe = aa([["a", "z"], ["A", "Z"], ["0", "9"], "_", "#", "-"], !1, !1), le = Ie("-", !1), re = Ie(".", !1), Te = aa([["0", "9"]], !1, !1), je = aa(["e", "E"], !1, !1), Ot = aa(["+", "-"], !1, !1), it = ir("string"), Je = Ie('"', !1), Pt = Ie("\\", !1), na = aa(['"', "\\"], !0, !1), fa = Ie("n", !1), Ra = Ie("r", !1), ne = Ie("t", !1), Le = Ie("u", !1), Fe = aa([["0", "9"], ["a", "f"], ["A", "F"]], !1, !1), Ve = Zo(), rt = Ie("//", !1), nt = aa([`
|
|
5298
|
+
`], !0, !1), Wt = Ie("/*", !1), da = Ie("*/", !1), Oa = ir("whitespace"), qt = aa([" ", " ", `
|
|
5284
5299
|
`, "\r"], !1, !1), qr = ir("optional whitespace"), lo = function(l, h) {
|
|
5285
|
-
const L =
|
|
5300
|
+
const L = td(h);
|
|
5286
5301
|
return {
|
|
5287
5302
|
type: "chart",
|
|
5288
5303
|
chartType: l,
|
|
@@ -5329,7 +5344,7 @@ function rd(t, a) {
|
|
|
5329
5344
|
}, So = function(l, h) {
|
|
5330
5345
|
return { type: "series", name: l, properties: h };
|
|
5331
5346
|
}, ko = function(l, h) {
|
|
5332
|
-
const L =
|
|
5347
|
+
const L = ad(h);
|
|
5333
5348
|
return {
|
|
5334
5349
|
type: "scene",
|
|
5335
5350
|
name: l ?? null,
|
|
@@ -5367,21 +5382,21 @@ function rd(t, a) {
|
|
|
5367
5382
|
return { value: l, isPercentage: !0 };
|
|
5368
5383
|
}, No = function(l) {
|
|
5369
5384
|
return { value: l, isPercentage: !1 };
|
|
5370
|
-
}, Io = function(l) {
|
|
5371
|
-
return { value: l, isPercentage: !1 };
|
|
5372
5385
|
}, Bo = function(l) {
|
|
5373
5386
|
return { value: l, isPercentage: !1 };
|
|
5387
|
+
}, Io = function(l) {
|
|
5388
|
+
return { value: l, isPercentage: !1 };
|
|
5374
5389
|
}, Vo = function(l) {
|
|
5375
5390
|
return parseFloat(l);
|
|
5376
5391
|
}, _o = function(l) {
|
|
5377
5392
|
return l.join("");
|
|
5378
5393
|
}, Go = function(l) {
|
|
5379
5394
|
return l;
|
|
5380
|
-
},
|
|
5395
|
+
}, Ho = function() {
|
|
5381
5396
|
return '"';
|
|
5382
|
-
},
|
|
5397
|
+
}, Yo = function() {
|
|
5383
5398
|
return "\\";
|
|
5384
|
-
},
|
|
5399
|
+
}, Ro = function() {
|
|
5385
5400
|
return `
|
|
5386
5401
|
`;
|
|
5387
5402
|
}, Wo = function() {
|
|
@@ -5401,7 +5416,7 @@ function rd(t, a) {
|
|
|
5401
5416
|
function jo(l, h) {
|
|
5402
5417
|
throw h = h !== void 0 ? h : Xr(De, u), Jo(l, h);
|
|
5403
5418
|
}
|
|
5404
|
-
function
|
|
5419
|
+
function Ie(l, h) {
|
|
5405
5420
|
return { type: "literal", text: l, ignoreCase: h };
|
|
5406
5421
|
}
|
|
5407
5422
|
function aa(l, h, L) {
|
|
@@ -5465,7 +5480,7 @@ function rd(t, a) {
|
|
|
5465
5480
|
function Fn() {
|
|
5466
5481
|
var l, h, L, k, N, G, ee, be;
|
|
5467
5482
|
if (l = u, $e(), t.substr(u, 5) === o ? (h = o, u += 5) : (h = e, V === 0 && q(Ne)), h !== e)
|
|
5468
|
-
if (L =
|
|
5483
|
+
if (L = ht(), L !== e)
|
|
5469
5484
|
if (k = lr(), k !== e)
|
|
5470
5485
|
if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
|
|
5471
5486
|
for ($e(), G = [], ee = Nn(); ee !== e; )
|
|
@@ -5483,14 +5498,14 @@ function rd(t, a) {
|
|
|
5483
5498
|
}
|
|
5484
5499
|
function Nn() {
|
|
5485
5500
|
var l, h;
|
|
5486
|
-
return l = u, $e(), h =
|
|
5501
|
+
return l = u, $e(), h = Bn(), h === e && (h = _n(), h === e && (h = Gn(), h === e && (h = Hn(), h === e && (h = Rn(), h === e && (h = Wn(), h === e && (h = Yn(), h === e && (h = Un(), h === e && (h = jn(), h === e && (h = Zn(), h === e && (h = Qn(), h === e && (h = Jn(), h === e && (h = Kn(), h === e && (h = qn(), h === e && (h = tl(), h === e && (h = Xn(), h === e && (h = or())))))))))))))))), h !== e ? ($e(), De = l, l = co(h)) : (u = l, l = e), l;
|
|
5487
5502
|
}
|
|
5488
|
-
function
|
|
5503
|
+
function Bn() {
|
|
5489
5504
|
var l, h, L, k, N, G;
|
|
5490
5505
|
if (l = u, t.substr(u, 4) === f ? (h = f, u += 4) : (h = e, V === 0 && q(Z)), h !== e)
|
|
5491
5506
|
if ($e(), t.charCodeAt(u) === 123 ? (L = i, u++) : (L = e, V === 0 && q(Oe)), L !== e) {
|
|
5492
|
-
for ($e(), k = [], N = Vn(), N === e && (N =
|
|
5493
|
-
k.push(N), N = Vn(), N === e && (N =
|
|
5507
|
+
for ($e(), k = [], N = Vn(), N === e && (N = In()); N !== e; )
|
|
5508
|
+
k.push(N), N = Vn(), N === e && (N = In());
|
|
5494
5509
|
N = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, V === 0 && q(Q)), G !== e ? (De = l, l = fo(k)) : (u = l, l = e);
|
|
5495
5510
|
} else
|
|
5496
5511
|
u = l, l = e;
|
|
@@ -5498,7 +5513,7 @@ function rd(t, a) {
|
|
|
5498
5513
|
u = l, l = e;
|
|
5499
5514
|
return l;
|
|
5500
5515
|
}
|
|
5501
|
-
function
|
|
5516
|
+
function In() {
|
|
5502
5517
|
var l, h, L, k, N, G, ee, be;
|
|
5503
5518
|
if (l = u, $e(), h = ts(), h !== e)
|
|
5504
5519
|
if ($e(), t.charCodeAt(u) === 61 ? (L = d, u++) : (L = e, V === 0 && q(S)), L !== e)
|
|
@@ -5532,12 +5547,12 @@ function rd(t, a) {
|
|
|
5532
5547
|
}
|
|
5533
5548
|
function _n() {
|
|
5534
5549
|
var l, h, L, k, N, G, ee, be;
|
|
5535
|
-
if (l = u, t.substr(u, 8) === m ? (h = m, u += 8) : (h = e, V === 0 && q(
|
|
5536
|
-
if (L =
|
|
5537
|
-
if (k =
|
|
5550
|
+
if (l = u, t.substr(u, 8) === m ? (h = m, u += 8) : (h = e, V === 0 && q(I)), h !== e)
|
|
5551
|
+
if (L = ht(), L !== e)
|
|
5552
|
+
if (k = ut(), k !== e)
|
|
5538
5553
|
if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
|
|
5539
|
-
for ($e(), G = [], ee =
|
|
5540
|
-
G.push(ee), ee =
|
|
5554
|
+
for ($e(), G = [], ee = dt(); ee !== e; )
|
|
5555
|
+
G.push(ee), ee = dt();
|
|
5541
5556
|
ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = bo(k, G)) : (u = l, l = e);
|
|
5542
5557
|
} else
|
|
5543
5558
|
u = l, l = e;
|
|
@@ -5552,11 +5567,11 @@ function rd(t, a) {
|
|
|
5552
5567
|
function Gn() {
|
|
5553
5568
|
var l, h, L, k, N, G, ee, be;
|
|
5554
5569
|
if (l = u, t.substr(u, 9) === v ? (h = v, u += 9) : (h = e, V === 0 && q(C)), h !== e)
|
|
5555
|
-
if (L =
|
|
5556
|
-
if (k =
|
|
5570
|
+
if (L = ht(), L !== e)
|
|
5571
|
+
if (k = ut(), k !== e)
|
|
5557
5572
|
if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
|
|
5558
|
-
for ($e(), G = [], ee =
|
|
5559
|
-
G.push(ee), ee =
|
|
5573
|
+
for ($e(), G = [], ee = dt(); ee !== e; )
|
|
5574
|
+
G.push(ee), ee = dt();
|
|
5560
5575
|
ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = mo(k, G)) : (u = l, l = e);
|
|
5561
5576
|
} else
|
|
5562
5577
|
u = l, l = e;
|
|
@@ -5566,19 +5581,19 @@ function rd(t, a) {
|
|
|
5566
5581
|
u = l, l = e;
|
|
5567
5582
|
else
|
|
5568
5583
|
u = l, l = e;
|
|
5569
|
-
return l === e && (l = u, t.substr(u, 9) === v ? (h = v, u += 9) : (h = e, V === 0 && q(C)), h !== e ? (L =
|
|
5584
|
+
return l === e && (l = u, t.substr(u, 9) === v ? (h = v, u += 9) : (h = e, V === 0 && q(C)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = yo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e)), l;
|
|
5570
5585
|
}
|
|
5571
|
-
function
|
|
5572
|
-
var l, h, L, k, N, G, ee, be, Lt,
|
|
5586
|
+
function Hn() {
|
|
5587
|
+
var l, h, L, k, N, G, ee, be, Lt, Ke;
|
|
5573
5588
|
if (l = u, t.substr(u, 8) === y ? (h = y, u += 8) : (h = e, V === 0 && q(U)), h !== e)
|
|
5574
|
-
if (L =
|
|
5575
|
-
if (k =
|
|
5576
|
-
if (N =
|
|
5577
|
-
if (G =
|
|
5589
|
+
if (L = ht(), L !== e)
|
|
5590
|
+
if (k = ut(), k !== e)
|
|
5591
|
+
if (N = ht(), N !== e)
|
|
5592
|
+
if (G = ut(), G !== e)
|
|
5578
5593
|
if ($e(), t.charCodeAt(u) === 123 ? (ee = i, u++) : (ee = e, V === 0 && q(Oe)), ee !== e) {
|
|
5579
|
-
for ($e(), be = [], Lt =
|
|
5580
|
-
be.push(Lt), Lt =
|
|
5581
|
-
Lt = $e(), t.charCodeAt(u) === 125 ? (
|
|
5594
|
+
for ($e(), be = [], Lt = dt(); Lt !== e; )
|
|
5595
|
+
be.push(Lt), Lt = dt();
|
|
5596
|
+
Lt = $e(), t.charCodeAt(u) === 125 ? (Ke = c, u++) : (Ke = e, V === 0 && q(Q)), Ke !== e ? (De = l, l = vo(k, G, be)) : (u = l, l = e);
|
|
5582
5597
|
} else
|
|
5583
5598
|
u = l, l = e;
|
|
5584
5599
|
else
|
|
@@ -5593,14 +5608,14 @@ function rd(t, a) {
|
|
|
5593
5608
|
u = l, l = e;
|
|
5594
5609
|
return l;
|
|
5595
5610
|
}
|
|
5596
|
-
function
|
|
5611
|
+
function Yn() {
|
|
5597
5612
|
var l, h, L, k, N, G, ee, be;
|
|
5598
5613
|
if (l = u, t.substr(u, 10) === x ? (h = x, u += 10) : (h = e, V === 0 && q(E)), h !== e)
|
|
5599
|
-
if (L =
|
|
5600
|
-
if (k =
|
|
5614
|
+
if (L = ht(), L !== e)
|
|
5615
|
+
if (k = ut(), k !== e)
|
|
5601
5616
|
if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
|
|
5602
|
-
for ($e(), G = [], ee =
|
|
5603
|
-
G.push(ee), ee =
|
|
5617
|
+
for ($e(), G = [], ee = dt(); ee !== e; )
|
|
5618
|
+
G.push(ee), ee = dt();
|
|
5604
5619
|
ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = xo(k, G)) : (u = l, l = e);
|
|
5605
5620
|
} else
|
|
5606
5621
|
u = l, l = e;
|
|
@@ -5612,12 +5627,12 @@ function rd(t, a) {
|
|
|
5612
5627
|
u = l, l = e;
|
|
5613
5628
|
return l;
|
|
5614
5629
|
}
|
|
5615
|
-
function
|
|
5630
|
+
function Rn() {
|
|
5616
5631
|
var l, h, L, k, N, G;
|
|
5617
5632
|
if (l = u, t.substr(u, 5) === A ? (h = A, u += 5) : (h = e, V === 0 && q(W)), h !== e)
|
|
5618
5633
|
if ($e(), t.charCodeAt(u) === 123 ? (L = i, u++) : (L = e, V === 0 && q(Oe)), L !== e) {
|
|
5619
|
-
for ($e(), k = [], N =
|
|
5620
|
-
k.push(N), N =
|
|
5634
|
+
for ($e(), k = [], N = dt(); N !== e; )
|
|
5635
|
+
k.push(N), N = dt();
|
|
5621
5636
|
N = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, V === 0 && q(Q)), G !== e ? (De = l, l = Ao(k)) : (u = l, l = e);
|
|
5622
5637
|
} else
|
|
5623
5638
|
u = l, l = e;
|
|
@@ -5629,8 +5644,8 @@ function rd(t, a) {
|
|
|
5629
5644
|
var l, h, L, k, N, G;
|
|
5630
5645
|
if (l = u, t.substr(u, 4) === w ? (h = w, u += 4) : (h = e, V === 0 && q(Ae)), h !== e)
|
|
5631
5646
|
if ($e(), t.charCodeAt(u) === 123 ? (L = i, u++) : (L = e, V === 0 && q(Oe)), L !== e) {
|
|
5632
|
-
for ($e(), k = [], N =
|
|
5633
|
-
k.push(N), N =
|
|
5647
|
+
for ($e(), k = [], N = dt(); N !== e; )
|
|
5648
|
+
k.push(N), N = dt();
|
|
5634
5649
|
N = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, V === 0 && q(Q)), G !== e ? (De = l, l = wo(k)) : (u = l, l = e);
|
|
5635
5650
|
} else
|
|
5636
5651
|
u = l, l = e;
|
|
@@ -5641,11 +5656,11 @@ function rd(t, a) {
|
|
|
5641
5656
|
function qn() {
|
|
5642
5657
|
var l, h, L, k, N, G, ee, be;
|
|
5643
5658
|
if (l = u, t.substr(u, 6) === $ ? (h = $, u += 6) : (h = e, V === 0 && q(Pe)), h !== e)
|
|
5644
|
-
if (L =
|
|
5645
|
-
if (k =
|
|
5659
|
+
if (L = ht(), L !== e)
|
|
5660
|
+
if (k = ut(), k !== e)
|
|
5646
5661
|
if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
|
|
5647
|
-
for ($e(), G = [], ee =
|
|
5648
|
-
G.push(ee), ee =
|
|
5662
|
+
for ($e(), G = [], ee = dt(); ee !== e; )
|
|
5663
|
+
G.push(ee), ee = dt();
|
|
5649
5664
|
ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = So(k, G)) : (u = l, l = e);
|
|
5650
5665
|
} else
|
|
5651
5666
|
u = l, l = e;
|
|
@@ -5659,9 +5674,9 @@ function rd(t, a) {
|
|
|
5659
5674
|
}
|
|
5660
5675
|
function tl() {
|
|
5661
5676
|
var l, h, L, k, N, G, ee, be;
|
|
5662
|
-
if (l = u, t.substr(u, 5) === P ? (h = P, u += 5) : (h = e, V === 0 && q(
|
|
5663
|
-
if (L =
|
|
5664
|
-
if (k =
|
|
5677
|
+
if (l = u, t.substr(u, 5) === P ? (h = P, u += 5) : (h = e, V === 0 && q(Be)), h === e && (t.substr(u, 4) === D ? (h = D, u += 4) : (h = e, V === 0 && q(Ye))), h !== e)
|
|
5678
|
+
if (L = ht(), L !== e)
|
|
5679
|
+
if (k = ut(), k === e && (k = null), $e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
|
|
5665
5680
|
for ($e(), G = [], ee = es(); ee !== e; )
|
|
5666
5681
|
G.push(ee), ee = es();
|
|
5667
5682
|
ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = ko(k, G)) : (u = l, l = e);
|
|
@@ -5675,12 +5690,12 @@ function rd(t, a) {
|
|
|
5675
5690
|
}
|
|
5676
5691
|
function Xn() {
|
|
5677
5692
|
var l, h, L, k, N, G, ee, be;
|
|
5678
|
-
if (l = u, t.substr(u, 9) ===
|
|
5679
|
-
if (L =
|
|
5693
|
+
if (l = u, t.substr(u, 9) === H ? (h = H, u += 9) : (h = e, V === 0 && q(We)), h !== e)
|
|
5694
|
+
if (L = ht(), L !== e)
|
|
5680
5695
|
if (k = lr(), k !== e)
|
|
5681
5696
|
if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
|
|
5682
|
-
for ($e(), G = [], ee =
|
|
5683
|
-
G.push(ee), ee =
|
|
5697
|
+
for ($e(), G = [], ee = dt(); ee !== e; )
|
|
5698
|
+
G.push(ee), ee = dt();
|
|
5684
5699
|
ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = Lo(k, G)) : (u = l, l = e);
|
|
5685
5700
|
} else
|
|
5686
5701
|
u = l, l = e;
|
|
@@ -5694,33 +5709,33 @@ function rd(t, a) {
|
|
|
5694
5709
|
}
|
|
5695
5710
|
function Un() {
|
|
5696
5711
|
var l, h, L, k;
|
|
5697
|
-
return l = u, t.substr(u, 15) === j ? (h = j, u += 15) : (h = e, V === 0 && q(
|
|
5712
|
+
return l = u, t.substr(u, 15) === j ? (h = j, u += 15) : (h = e, V === 0 && q(Xe)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = $o(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
|
|
5698
5713
|
}
|
|
5699
5714
|
function jn() {
|
|
5700
5715
|
var l, h, L, k;
|
|
5701
|
-
return l = u, t.substr(u, 10) === _ ? (h = _, u += 10) : (h = e, V === 0 && q(
|
|
5716
|
+
return l = u, t.substr(u, 10) === _ ? (h = _, u += 10) : (h = e, V === 0 && q(Qe)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Mo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
|
|
5702
5717
|
}
|
|
5703
5718
|
function Zn() {
|
|
5704
5719
|
var l, h, L, k;
|
|
5705
|
-
return l = u, t.substr(u, 9) ===
|
|
5720
|
+
return l = u, t.substr(u, 9) === B ? (h = B, u += 9) : (h = e, V === 0 && q(Ue)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Co(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
|
|
5706
5721
|
}
|
|
5707
5722
|
function Qn() {
|
|
5708
5723
|
var l, h, L, k;
|
|
5709
|
-
return l = u, t.substr(u, 15) === K ? (h = K, u += 15) : (h = e, V === 0 && q(Re)), h !== e ? (L =
|
|
5724
|
+
return l = u, t.substr(u, 15) === K ? (h = K, u += 15) : (h = e, V === 0 && q(Re)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Oo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
|
|
5710
5725
|
}
|
|
5711
5726
|
function Jn() {
|
|
5712
5727
|
var l, h, L, k;
|
|
5713
|
-
return l = u, t.substr(u, 10) === X ? (h = X, u += 10) : (h = e, V === 0 && q(
|
|
5728
|
+
return l = u, t.substr(u, 10) === X ? (h = X, u += 10) : (h = e, V === 0 && q(ft)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Po(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
|
|
5714
5729
|
}
|
|
5715
5730
|
function Kn() {
|
|
5716
5731
|
var l, h, L, k;
|
|
5717
|
-
return l = u, t.substr(u, 9) === te ? (h = te, u += 9) : (h = e, V === 0 && q(mt)), h !== e ? (L =
|
|
5732
|
+
return l = u, t.substr(u, 9) === te ? (h = te, u += 9) : (h = e, V === 0 && q(mt)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = To(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
|
|
5718
5733
|
}
|
|
5719
5734
|
function es() {
|
|
5720
5735
|
var l, h;
|
|
5721
|
-
return l = u, $e(), h =
|
|
5736
|
+
return l = u, $e(), h = Bn(), h === e && (h = _n(), h === e && (h = Gn(), h === e && (h = Hn(), h === e && (h = Rn(), h === e && (h = Wn(), h === e && (h = Yn(), h === e && (h = Un(), h === e && (h = jn(), h === e && (h = Zn(), h === e && (h = Qn(), h === e && (h = Jn(), h === e && (h = Kn(), h === e && (h = qn(), h === e && (h = Xn(), h === e && (h = or()))))))))))))))), h !== e ? ($e(), De = l, l = zo(h)) : (u = l, l = e), l;
|
|
5722
5737
|
}
|
|
5723
|
-
function
|
|
5738
|
+
function dt() {
|
|
5724
5739
|
var l, h;
|
|
5725
5740
|
return l = u, $e(), h = or(), h !== e ? ($e(), De = l, l = Do(h)) : (u = l, l = e), l;
|
|
5726
5741
|
}
|
|
@@ -5730,11 +5745,11 @@ function rd(t, a) {
|
|
|
5730
5745
|
}
|
|
5731
5746
|
function ts() {
|
|
5732
5747
|
var l;
|
|
5733
|
-
return l =
|
|
5748
|
+
return l = ut(), l === e && (l = lr()), l;
|
|
5734
5749
|
}
|
|
5735
5750
|
function qa() {
|
|
5736
5751
|
var l, h, L;
|
|
5737
|
-
return l = u, h = as(), h !== e ? (t.charCodeAt(u) === 37 ? (L = fe, u++) : (L = e, V === 0 && q(
|
|
5752
|
+
return l = u, h = as(), h !== e ? (t.charCodeAt(u) === 37 ? (L = fe, u++) : (L = e, V === 0 && q(at)), L !== e ? (De = l, l = Fo(h)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = u, h = as(), h !== e && (De = l, h = No(h)), l = h, l === e && (l = u, h = ut(), h !== e && (De = l, h = Bo(h)), l = h, l === e && (l = u, h = lr(), h !== e && (De = l, h = Io(h)), l = h))), l;
|
|
5738
5753
|
}
|
|
5739
5754
|
function lr() {
|
|
5740
5755
|
var l, h, L, k, N;
|
|
@@ -5747,7 +5762,7 @@ function rd(t, a) {
|
|
|
5747
5762
|
return h !== e ? l = t.substring(l, u) : l = h, V--, l === e && (h = e, V === 0 && q(Ct)), l;
|
|
5748
5763
|
}
|
|
5749
5764
|
function as() {
|
|
5750
|
-
var l, h, L, k, N, G, ee, be, Lt,
|
|
5765
|
+
var l, h, L, k, N, G, ee, be, Lt, Ke;
|
|
5751
5766
|
if (l = u, h = u, L = u, t.charCodeAt(u) === 45 ? (k = se, u++) : (k = e, V === 0 && q(le)), k === e && (k = null), N = u, t.charCodeAt(u) === 46 ? (G = F, u++) : (G = e, V === 0 && q(re)), G !== e) {
|
|
5752
5767
|
if (ee = [], be = t.charAt(u), Me.test(be) ? u++ : (be = e, V === 0 && q(Te)), be !== e)
|
|
5753
5768
|
for (; be !== e; )
|
|
@@ -5765,8 +5780,8 @@ function rd(t, a) {
|
|
|
5765
5780
|
G = e;
|
|
5766
5781
|
if (G !== e) {
|
|
5767
5782
|
if (ee = u, t.charCodeAt(u) === 46 ? (be = F, u++) : (be = e, V === 0 && q(re)), be !== e) {
|
|
5768
|
-
for (Lt = [],
|
|
5769
|
-
Lt.push(
|
|
5783
|
+
for (Lt = [], Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te)); Ke !== e; )
|
|
5784
|
+
Lt.push(Ke), Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te));
|
|
5770
5785
|
be = [be, Lt], ee = be;
|
|
5771
5786
|
} else
|
|
5772
5787
|
u = ee, ee = e;
|
|
@@ -5775,10 +5790,10 @@ function rd(t, a) {
|
|
|
5775
5790
|
u = N, N = e;
|
|
5776
5791
|
}
|
|
5777
5792
|
if (N !== e) {
|
|
5778
|
-
if (G = u, ee = t.charAt(u), J.test(ee) ? u++ : (ee = e, V === 0 && q(
|
|
5779
|
-
if (be = t.charAt(u), ae.test(be) ? u++ : (be = e, V === 0 && q(Ot)), be === e && (be = null), Lt = [],
|
|
5780
|
-
for (;
|
|
5781
|
-
Lt.push(
|
|
5793
|
+
if (G = u, ee = t.charAt(u), J.test(ee) ? u++ : (ee = e, V === 0 && q(je)), ee !== e) {
|
|
5794
|
+
if (be = t.charAt(u), ae.test(be) ? u++ : (be = e, V === 0 && q(Ot)), be === e && (be = null), Lt = [], Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te)), Ke !== e)
|
|
5795
|
+
for (; Ke !== e; )
|
|
5796
|
+
Lt.push(Ke), Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te));
|
|
5782
5797
|
else
|
|
5783
5798
|
Lt = e;
|
|
5784
5799
|
Lt !== e ? (ee = [ee, be, Lt], G = ee) : (u = G, G = e);
|
|
@@ -5789,23 +5804,23 @@ function rd(t, a) {
|
|
|
5789
5804
|
u = L, L = e;
|
|
5790
5805
|
return L !== e ? h = t.substring(h, u) : h = L, h !== e && (De = l, h = Vo(h)), l = h, l;
|
|
5791
5806
|
}
|
|
5792
|
-
function
|
|
5807
|
+
function ut() {
|
|
5793
5808
|
var l, h, L, k;
|
|
5794
|
-
if (V++, l = u, t.charCodeAt(u) === 34 ? (h =
|
|
5809
|
+
if (V++, l = u, t.charCodeAt(u) === 34 ? (h = Y, u++) : (h = e, V === 0 && q(Je)), h !== e) {
|
|
5795
5810
|
for (L = [], k = rs(); k !== e; )
|
|
5796
5811
|
L.push(k), k = rs();
|
|
5797
|
-
t.charCodeAt(u) === 34 ? (k =
|
|
5812
|
+
t.charCodeAt(u) === 34 ? (k = Y, u++) : (k = e, V === 0 && q(Je)), k !== e ? (De = l, l = _o(L)) : (u = l, l = e);
|
|
5798
5813
|
} else
|
|
5799
5814
|
u = l, l = e;
|
|
5800
|
-
return V--, l === e && (h = e, V === 0 && q(
|
|
5815
|
+
return V--, l === e && (h = e, V === 0 && q(it)), l;
|
|
5801
5816
|
}
|
|
5802
5817
|
function rs() {
|
|
5803
5818
|
var l, h, L;
|
|
5804
|
-
return l = u, t.charCodeAt(u) === 92 ? (h =
|
|
5819
|
+
return l = u, t.charCodeAt(u) === 92 ? (h = R, u++) : (h = e, V === 0 && q(Pt)), h !== e ? (L = al(), L !== e ? (De = l, l = Go(L)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = t.charAt(u), ke.test(l) ? u++ : (l = e, V === 0 && q(na))), l;
|
|
5805
5820
|
}
|
|
5806
5821
|
function al() {
|
|
5807
5822
|
var l, h, L, k, N, G, ee, be;
|
|
5808
|
-
return l = u, t.charCodeAt(u) === 34 ? (h =
|
|
5823
|
+
return l = u, t.charCodeAt(u) === 34 ? (h = Y, u++) : (h = e, V === 0 && q(Je)), h !== e && (De = l, h = Ho()), l = h, l === e && (l = u, t.charCodeAt(u) === 92 ? (h = R, u++) : (h = e, V === 0 && q(Pt)), h !== e && (De = l, h = Yo()), l = h, l === e && (l = u, t.charCodeAt(u) === 110 ? (h = ie, u++) : (h = e, V === 0 && q(fa)), h !== e && (De = l, h = Ro()), l = h, l === e && (l = u, t.charCodeAt(u) === 114 ? (h = he, u++) : (h = e, V === 0 && q(Ra)), h !== e && (De = l, h = Wo()), l = h, l === e && (l = u, t.charCodeAt(u) === 116 ? (h = ve, u++) : (h = e, V === 0 && q(ne)), h !== e && (De = l, h = qo()), l = h, l === e && (l = u, t.charCodeAt(u) === 117 ? (h = ce, u++) : (h = e, V === 0 && q(Le)), h !== e ? (L = u, k = u, N = t.charAt(u), me.test(N) ? u++ : (N = e, V === 0 && q(Fe)), N !== e ? (G = t.charAt(u), me.test(G) ? u++ : (G = e, V === 0 && q(Fe)), G !== e ? (ee = t.charAt(u), me.test(ee) ? u++ : (ee = e, V === 0 && q(Fe)), ee !== e ? (be = t.charAt(u), me.test(be) ? u++ : (be = e, V === 0 && q(Fe)), be !== e ? (N = [N, G, ee, be], k = N) : (u = k, k = e)) : (u = k, k = e)) : (u = k, k = e)) : (u = k, k = e), k !== e ? L = t.substring(L, u) : L = k, L !== e ? (De = l, l = Xo(L)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = u, t.length > u ? (h = t.charAt(u), u++) : (h = e, V === 0 && q(Ve)), h !== e && (De = l, h = Uo(h)), l = h)))))), l;
|
|
5809
5824
|
}
|
|
5810
5825
|
function cr() {
|
|
5811
5826
|
var l;
|
|
@@ -5813,9 +5828,9 @@ function rd(t, a) {
|
|
|
5813
5828
|
}
|
|
5814
5829
|
function rl() {
|
|
5815
5830
|
var l, h, L, k;
|
|
5816
|
-
if (l = u, t.substr(u, 2) === ue ? (h = ue, u += 2) : (h = e, V === 0 && q(
|
|
5817
|
-
for (L = [], k = t.charAt(u), Ce.test(k) ? u++ : (k = e, V === 0 && q(
|
|
5818
|
-
L.push(k), k = t.charAt(u), Ce.test(k) ? u++ : (k = e, V === 0 && q(
|
|
5831
|
+
if (l = u, t.substr(u, 2) === ue ? (h = ue, u += 2) : (h = e, V === 0 && q(rt)), h !== e) {
|
|
5832
|
+
for (L = [], k = t.charAt(u), Ce.test(k) ? u++ : (k = e, V === 0 && q(nt)); k !== e; )
|
|
5833
|
+
L.push(k), k = t.charAt(u), Ce.test(k) ? u++ : (k = e, V === 0 && q(nt));
|
|
5819
5834
|
h = [h, L], l = h;
|
|
5820
5835
|
} else
|
|
5821
5836
|
u = l, l = e;
|
|
@@ -5831,7 +5846,7 @@ function rd(t, a) {
|
|
|
5831
5846
|
u = l, l = e;
|
|
5832
5847
|
return l;
|
|
5833
5848
|
}
|
|
5834
|
-
function
|
|
5849
|
+
function ht() {
|
|
5835
5850
|
var l, h;
|
|
5836
5851
|
if (V++, l = [], h = t.charAt(u), we.test(h) ? u++ : (h = e, V === 0 && q(qt)), h === e && (h = cr()), h !== e)
|
|
5837
5852
|
for (; h !== e; )
|
|
@@ -5867,7 +5882,7 @@ function rd(t, a) {
|
|
|
5867
5882
|
}
|
|
5868
5883
|
function Ki(t) {
|
|
5869
5884
|
try {
|
|
5870
|
-
return
|
|
5885
|
+
return nd(t);
|
|
5871
5886
|
} catch (a) {
|
|
5872
5887
|
if (a instanceof Error && "location" in a) {
|
|
5873
5888
|
const e = a.location;
|
|
@@ -5876,14 +5891,14 @@ function Ki(t) {
|
|
|
5876
5891
|
throw a;
|
|
5877
5892
|
}
|
|
5878
5893
|
}
|
|
5879
|
-
function
|
|
5894
|
+
function sd(t) {
|
|
5880
5895
|
return typeof t.value == "number" ? t.isPercentage ? `${t.value}%` : `${t.value}` : typeof t.value == "string" && t.value.startsWith("#") ? `"${t.value}"` : typeof t.value == "string" && /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t.value) ? t.value : `"${String(t.value).replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
5881
5896
|
}
|
|
5882
5897
|
function Jt(t, a) {
|
|
5883
5898
|
const e = /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t.key) ? t.key : `"${t.key}"`;
|
|
5884
|
-
return `${a}${e} = ${
|
|
5899
|
+
return `${a}${e} = ${sd(t)}`;
|
|
5885
5900
|
}
|
|
5886
|
-
function
|
|
5901
|
+
function id(t, a) {
|
|
5887
5902
|
if (t.values && t.values.length > 1) {
|
|
5888
5903
|
const e = t.key.startsWith("_") ? t.key : `"${t.key}"`, r = t.values.map((n) => typeof n == "number" ? `${n}` : `"${String(n).replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`);
|
|
5889
5904
|
return `${a}${e} = ${r.join(",")}`;
|
|
@@ -5893,7 +5908,7 @@ function sd(t, a) {
|
|
|
5893
5908
|
function Sn(t, a) {
|
|
5894
5909
|
const e = [`${a}data {`];
|
|
5895
5910
|
for (const r of t.entries)
|
|
5896
|
-
e.push(
|
|
5911
|
+
e.push(id(r, `${a} `));
|
|
5897
5912
|
return e.push(`${a}}`), e.join(`
|
|
5898
5913
|
`);
|
|
5899
5914
|
}
|
|
@@ -5915,15 +5930,15 @@ function $n(t, a) {
|
|
|
5915
5930
|
`);
|
|
5916
5931
|
}
|
|
5917
5932
|
function Mn(t, a) {
|
|
5918
|
-
const e = t.kind ??
|
|
5919
|
-
if (e ===
|
|
5933
|
+
const e = t.kind ?? Ze.Point;
|
|
5934
|
+
if (e === Ze.Range) {
|
|
5920
5935
|
const s = [`${a}range {`];
|
|
5921
5936
|
for (const o of t.properties)
|
|
5922
5937
|
s.push(Jt(o, `${a} `));
|
|
5923
5938
|
return s.push(`${a}}`), s.join(`
|
|
5924
5939
|
`);
|
|
5925
5940
|
}
|
|
5926
|
-
if (e ===
|
|
5941
|
+
if (e === Ze.Free) {
|
|
5927
5942
|
const s = [`${a}note {`];
|
|
5928
5943
|
for (const o of t.properties)
|
|
5929
5944
|
s.push(Jt(o, `${a} `));
|
|
@@ -5937,7 +5952,7 @@ function Mn(t, a) {
|
|
|
5937
5952
|
`);
|
|
5938
5953
|
}
|
|
5939
5954
|
function Cn(t, a) {
|
|
5940
|
-
const e = { [
|
|
5955
|
+
const e = { [Ze.Point]: "annotation", [Ze.Range]: "range", [Ze.Free]: "note" }, r = `${t.action}_${e[t.kind]}`;
|
|
5941
5956
|
return `${a}${r} "${t.id}"`;
|
|
5942
5957
|
}
|
|
5943
5958
|
function On(t, a) {
|
|
@@ -5976,11 +5991,11 @@ function Pn(t, a) {
|
|
|
5976
5991
|
return e.push(`${a}}`), e.join(`
|
|
5977
5992
|
`);
|
|
5978
5993
|
}
|
|
5979
|
-
function
|
|
5994
|
+
function od(t, a, e) {
|
|
5980
5995
|
const n = yn(e).find((s) => s.key === t);
|
|
5981
5996
|
return !n || n.default === void 0 ? !1 : String(n.default) === String(a);
|
|
5982
5997
|
}
|
|
5983
|
-
function
|
|
5998
|
+
function tu(t) {
|
|
5984
5999
|
const a = [`chart ${t.chartType} {`];
|
|
5985
6000
|
for (const e of t.properties)
|
|
5986
6001
|
a.push(Jt(e, " "));
|
|
@@ -6004,10 +6019,10 @@ function Kd(t) {
|
|
|
6004
6019
|
return a.push("}"), a.join(`
|
|
6005
6020
|
`);
|
|
6006
6021
|
}
|
|
6007
|
-
function
|
|
6022
|
+
function au(t) {
|
|
6008
6023
|
const a = [`chart ${t.chartType} {`];
|
|
6009
6024
|
for (const e of t.properties)
|
|
6010
|
-
|
|
6025
|
+
od(e.key, e.value, t.chartType) || a.push(Jt(e, " "));
|
|
6011
6026
|
t.data && a.push(Sn(t.data, " "));
|
|
6012
6027
|
for (const e of t.colorizes)
|
|
6013
6028
|
a.push(kn(e, " "));
|
|
@@ -6039,7 +6054,7 @@ function Tn(t, a) {
|
|
|
6039
6054
|
}
|
|
6040
6055
|
return s;
|
|
6041
6056
|
}
|
|
6042
|
-
function
|
|
6057
|
+
function ld(t) {
|
|
6043
6058
|
return !(/^-?\d+(\.\d+)?$/.test(t) || /^-?\d+(\.\d+)?%$/.test(t) || /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t));
|
|
6044
6059
|
}
|
|
6045
6060
|
function to(t) {
|
|
@@ -6051,11 +6066,11 @@ function to(t) {
|
|
|
6051
6066
|
return `"${a.key}" = ${r}`;
|
|
6052
6067
|
}
|
|
6053
6068
|
const e = a.isPercentage ? `${a.value}%` : String(a.value);
|
|
6054
|
-
return a.key === "_series" ? `_series = "${e}"` : typeof a.value == "string" &&
|
|
6069
|
+
return a.key === "_series" ? `_series = "${e}"` : typeof a.value == "string" && ld(e) ? `"${a.key}" = "${e}"` : `"${a.key}" = ${e}`;
|
|
6055
6070
|
}).join(`
|
|
6056
6071
|
`);
|
|
6057
6072
|
}
|
|
6058
|
-
function
|
|
6073
|
+
function ru(t, a) {
|
|
6059
6074
|
const e = ra(t.properties), r = e.get("type"), n = r ?? a;
|
|
6060
6075
|
return {
|
|
6061
6076
|
name: t.name,
|
|
@@ -6112,18 +6127,18 @@ function no(t) {
|
|
|
6112
6127
|
}
|
|
6113
6128
|
function so(t) {
|
|
6114
6129
|
return t.map((a) => {
|
|
6115
|
-
const e = ra(a.properties), r = a.kind ??
|
|
6116
|
-
if (r ===
|
|
6130
|
+
const e = ra(a.properties), r = a.kind ?? Ze.Point;
|
|
6131
|
+
if (r === Ze.Range) {
|
|
6117
6132
|
const i = {
|
|
6118
|
-
kind:
|
|
6133
|
+
kind: Ze.Range,
|
|
6119
6134
|
start: e.has("start") ? isNaN(Number(e.get("start"))) ? String(e.get("start")) : Number(e.get("start")) : 0,
|
|
6120
6135
|
end: e.has("end") ? isNaN(Number(e.get("end"))) ? String(e.get("end")) : Number(e.get("end")) : 0
|
|
6121
6136
|
};
|
|
6122
6137
|
return e.has("id") && (i.id = String(e.get("id"))), e.has("orientation") && (i.orientation = String(e.get("orientation"))), e.has("startAnchor") && (i.startAnchor = String(e.get("startAnchor"))), e.has("endAnchor") && (i.endAnchor = String(e.get("endAnchor"))), e.has("bgColor") && (i.bgColor = String(e.get("bgColor"))), e.has("bgOpacity") && (i.bgOpacity = Number(e.get("bgOpacity"))), e.has("direction") && (i.direction = String(e.get("direction"))), e.has("text") && (i.text = String(e.get("text"))), e.has("textColor") && (i.textColor = String(e.get("textColor"))), i;
|
|
6123
6138
|
}
|
|
6124
|
-
if (r ===
|
|
6139
|
+
if (r === Ze.Free) {
|
|
6125
6140
|
const i = {
|
|
6126
|
-
kind:
|
|
6141
|
+
kind: Ze.Free,
|
|
6127
6142
|
text: String(e.get("text") ?? ""),
|
|
6128
6143
|
x: Ps(a.properties, "x") ?? 0,
|
|
6129
6144
|
y: Ps(a.properties, "y") ?? 0
|
|
@@ -6133,7 +6148,7 @@ function so(t) {
|
|
|
6133
6148
|
return c !== void 0 && (i.maxWidth = c), e.has("textOutline") && (i.textOutline = ua(e.get("textOutline"))), i;
|
|
6134
6149
|
}
|
|
6135
6150
|
const n = "target" in a ? a.target : "", s = {
|
|
6136
|
-
kind:
|
|
6151
|
+
kind: Ze.Point,
|
|
6137
6152
|
target: n,
|
|
6138
6153
|
text: String(e.get("text") ?? "")
|
|
6139
6154
|
};
|
|
@@ -6148,7 +6163,7 @@ function io(t) {
|
|
|
6148
6163
|
return e.has("color") && (r.color = String(e.get("color"))), e.has("lineWidth") && (r.lineWidth = Number(e.get("lineWidth"))), e.has("dash") && (r.dash = String(e.get("dash"))), e.has("interpolation") && (r.interpolation = String(e.get("interpolation"))), e.has("labelMode") && (r.labelMode = String(e.get("labelMode"))), e.has("labelText") && (r.labelText = String(e.get("labelText"))), e.has("valueLabels") && (r.valueLabels = ua(e.get("valueLabels"))), e.has("lineSymbols") && (r.lineSymbols = ua(e.get("lineSymbols"))), e.has("hidden") && (r.hidden = ua(e.get("hidden"))), e.has("symbolShape") && (r.symbolShape = String(e.get("symbolShape"))), e.has("symbolShowOn") && (r.symbolShowOn = String(e.get("symbolShowOn"))), e.has("symbolStyle") && (r.symbolStyle = String(e.get("symbolStyle"))), e.has("symbolSize") && (r.symbolSize = Number(e.get("symbolSize"))), e.has("symbolOpacity") && (r.symbolOpacity = Number(e.get("symbolOpacity"))), r;
|
|
6149
6164
|
});
|
|
6150
6165
|
}
|
|
6151
|
-
const
|
|
6166
|
+
const cd = `chart bar-vertical {
|
|
6152
6167
|
title = "E is the most frequent letter in English"
|
|
6153
6168
|
description = "How often each letter appears in typical English text"
|
|
6154
6169
|
byline = "Pierre Romera"
|
|
@@ -6176,7 +6191,7 @@ const ld = `chart bar-vertical {
|
|
|
6176
6191
|
"D" = 4.25
|
|
6177
6192
|
}
|
|
6178
6193
|
}
|
|
6179
|
-
`,
|
|
6194
|
+
`, fd = `chart bar-vertical {
|
|
6180
6195
|
title = "China emits more CO₂ than the US and India combined"
|
|
6181
6196
|
description = "Annual emissions in billion tonnes, 2023"
|
|
6182
6197
|
source = "Global Carbon Project"
|
|
@@ -6208,7 +6223,7 @@ const ld = `chart bar-vertical {
|
|
|
6208
6223
|
showCircle = false
|
|
6209
6224
|
}
|
|
6210
6225
|
}
|
|
6211
|
-
`,
|
|
6226
|
+
`, dd = `chart bar-horizontal {
|
|
6212
6227
|
title = "Mandarin has nearly twice as many native speakers as Spanish"
|
|
6213
6228
|
description = "Number of native speakers worldwide, in millions"
|
|
6214
6229
|
source = "Ethnologue"
|
|
@@ -6231,7 +6246,7 @@ const ld = `chart bar-vertical {
|
|
|
6231
6246
|
"Japanese" = 125
|
|
6232
6247
|
}
|
|
6233
6248
|
}
|
|
6234
|
-
`,
|
|
6249
|
+
`, ud = `chart bar-multi {
|
|
6235
6250
|
title = "Software overtakes hardware as the top revenue driver"
|
|
6236
6251
|
description = "USD billions"
|
|
6237
6252
|
byline = "Pierre Romera"
|
|
@@ -6250,7 +6265,7 @@ const ld = `chart bar-vertical {
|
|
|
6250
6265
|
"Q2 2025" = 16.2,15.5,10.8
|
|
6251
6266
|
}
|
|
6252
6267
|
}
|
|
6253
|
-
`,
|
|
6268
|
+
`, hd = `chart bar-multi {
|
|
6254
6269
|
title = "USA tops Paris 2024 with 126 medals across all categories"
|
|
6255
6270
|
description = "2024 Paris Summer Games — top six nations"
|
|
6256
6271
|
source = "Olympics.com"
|
|
@@ -6271,7 +6286,7 @@ const ld = `chart bar-vertical {
|
|
|
6271
6286
|
"France" = 16,20,23
|
|
6272
6287
|
}
|
|
6273
6288
|
}
|
|
6274
|
-
`,
|
|
6289
|
+
`, gd = `chart line {
|
|
6275
6290
|
title = "2024 was the hottest year on record"
|
|
6276
6291
|
description = "Deviation from the 1951–1980 average, in °C"
|
|
6277
6292
|
source = "NASA GISS"
|
|
@@ -6303,7 +6318,7 @@ const ld = `chart bar-vertical {
|
|
|
6303
6318
|
showCircle = true
|
|
6304
6319
|
}
|
|
6305
6320
|
}
|
|
6306
|
-
`,
|
|
6321
|
+
`, pd = `chart line-multi {
|
|
6307
6322
|
title = "Detroit's unemployment hit 16% during the Great Recession"
|
|
6308
6323
|
description = "Percent of labour force, 2000–2014"
|
|
6309
6324
|
source = "Bureau of Labor Statistics"
|
|
@@ -6331,7 +6346,7 @@ const ld = `chart bar-vertical {
|
|
|
6331
6346
|
"2014" = 6.5,8.0,7.1,8.2
|
|
6332
6347
|
}
|
|
6333
6348
|
}
|
|
6334
|
-
`,
|
|
6349
|
+
`, bd = `chart pie {
|
|
6335
6350
|
title = "Asia is home to nearly 60% of the world's population"
|
|
6336
6351
|
description = "Estimated share, 2024"
|
|
6337
6352
|
source = "United Nations"
|
|
@@ -6348,7 +6363,7 @@ const ld = `chart bar-vertical {
|
|
|
6348
6363
|
"North America" = 4.8
|
|
6349
6364
|
}
|
|
6350
6365
|
}
|
|
6351
|
-
`,
|
|
6366
|
+
`, md = `chart bar-vertical {
|
|
6352
6367
|
title = "Brazil produces more coffee than the next three countries combined"
|
|
6353
6368
|
description = "Million 60-kg bags, 2023/24 crop year"
|
|
6354
6369
|
source = "International Coffee Organization"
|
|
@@ -6374,7 +6389,7 @@ const ld = `chart bar-vertical {
|
|
|
6374
6389
|
direction = descending
|
|
6375
6390
|
}
|
|
6376
6391
|
}
|
|
6377
|
-
`,
|
|
6392
|
+
`, yd = `chart donut {
|
|
6378
6393
|
title = "Chrome dominates with two-thirds of the desktop browser market"
|
|
6379
6394
|
description = "Worldwide, January 2025"
|
|
6380
6395
|
source = "StatCounter"
|
|
@@ -6393,7 +6408,7 @@ const ld = `chart bar-vertical {
|
|
|
6393
6408
|
"Others" = 2.9
|
|
6394
6409
|
}
|
|
6395
6410
|
}
|
|
6396
|
-
`,
|
|
6411
|
+
`, vd = `chart area {
|
|
6397
6412
|
title = "Apple stock climbed 36 % through 2024"
|
|
6398
6413
|
description = "Monthly closing price in USD"
|
|
6399
6414
|
source = "Yahoo Finance"
|
|
@@ -6415,7 +6430,7 @@ const ld = `chart bar-vertical {
|
|
|
6415
6430
|
"Dec" = 249
|
|
6416
6431
|
}
|
|
6417
6432
|
}
|
|
6418
|
-
`,
|
|
6433
|
+
`, xd = `chart area-stacked {
|
|
6419
6434
|
title = "Renewables rose from 18 % to 23 % of global energy since 2000"
|
|
6420
6435
|
description = "Share of primary energy by source, 2000–2023"
|
|
6421
6436
|
source = "Our World in Data"
|
|
@@ -6433,7 +6448,7 @@ const ld = `chart bar-vertical {
|
|
|
6433
6448
|
"2023" = 24,29,24,23
|
|
6434
6449
|
}
|
|
6435
6450
|
}
|
|
6436
|
-
`,
|
|
6451
|
+
`, Ad = `chart column-stacked {
|
|
6437
6452
|
title = "Software revenue grew steadily while hardware spiked in Q4"
|
|
6438
6453
|
description = "Quarterly revenue in millions, 2024"
|
|
6439
6454
|
source = "Annual report"
|
|
@@ -6446,7 +6461,7 @@ const ld = `chart bar-vertical {
|
|
|
6446
6461
|
"Q4" = 155,105,58
|
|
6447
6462
|
}
|
|
6448
6463
|
}
|
|
6449
|
-
`,
|
|
6464
|
+
`, wd = `chart bar-stacked {
|
|
6450
6465
|
title = "India's working-age population now surpasses China's"
|
|
6451
6466
|
description = "Millions of people, 2023"
|
|
6452
6467
|
source = "UN Population Division"
|
|
@@ -6463,7 +6478,7 @@ const ld = `chart bar-vertical {
|
|
|
6463
6478
|
"Brazil" = 42,150,22
|
|
6464
6479
|
}
|
|
6465
6480
|
}
|
|
6466
|
-
`,
|
|
6481
|
+
`, Sd = `chart area-stacked {
|
|
6467
6482
|
title = "EU subsidies to new members surged after enlargement"
|
|
6468
6483
|
description = "Agricultural subsidies to post-socialist EU members, million euros"
|
|
6469
6484
|
source = "Eurostat"
|
|
@@ -6662,7 +6677,7 @@ const ld = `chart bar-vertical {
|
|
|
6662
6677
|
highlight "Non-salaried workers"
|
|
6663
6678
|
}
|
|
6664
6679
|
}
|
|
6665
|
-
`,
|
|
6680
|
+
`, kd = `chart bar-split {
|
|
6666
6681
|
title = "CDU/CSU led German polls at 29 % ahead of the 2021 election"
|
|
6667
6682
|
description = "How Germany would vote in the September 2021 federal election, according to polling in the previous June"
|
|
6668
6683
|
source = "FG Wahlen"
|
|
@@ -6679,7 +6694,7 @@ const ld = `chart bar-vertical {
|
|
|
6679
6694
|
"Left" = 7,9,5
|
|
6680
6695
|
}
|
|
6681
6696
|
}
|
|
6682
|
-
`,
|
|
6697
|
+
`, Ld = `chart bar-grouped {
|
|
6683
6698
|
title = "Asia Pacific holds more renewable capacity than all other regions combined"
|
|
6684
6699
|
description = "Installed capacity in gigawatts (GW)"
|
|
6685
6700
|
source = "IRENA"
|
|
@@ -6699,7 +6714,7 @@ function zs(t, a) {
|
|
|
6699
6714
|
const e = t.properties.find((r) => r.key === a);
|
|
6700
6715
|
return e ? String(e.value) : "";
|
|
6701
6716
|
}
|
|
6702
|
-
function
|
|
6717
|
+
function $d(t) {
|
|
6703
6718
|
if (!t.data)
|
|
6704
6719
|
return "";
|
|
6705
6720
|
const a = t.data.entries, e = a.find((s) => s.key === "_series");
|
|
@@ -6715,7 +6730,7 @@ function Ld(t) {
|
|
|
6715
6730
|
return [r, ...n].join(`
|
|
6716
6731
|
`);
|
|
6717
6732
|
}
|
|
6718
|
-
function
|
|
6733
|
+
function Md(t) {
|
|
6719
6734
|
if (!t.data)
|
|
6720
6735
|
return "";
|
|
6721
6736
|
const a = t.data.entries, e = a.find((r) => r.key === "_series");
|
|
@@ -6727,58 +6742,58 @@ function $d(t) {
|
|
|
6727
6742
|
return a.map((r) => `"${r.key}" = ${String(r.value)}`).join(`
|
|
6728
6743
|
`);
|
|
6729
6744
|
}
|
|
6730
|
-
function
|
|
6745
|
+
function ot(t, a) {
|
|
6731
6746
|
const e = Ki(a);
|
|
6732
6747
|
return {
|
|
6733
6748
|
id: t,
|
|
6734
6749
|
title: zs(e, "title"),
|
|
6735
6750
|
description: zs(e, "description"),
|
|
6736
6751
|
chartType: e.chartType,
|
|
6737
|
-
tsvData:
|
|
6738
|
-
serializedData:
|
|
6752
|
+
tsvData: $d(e),
|
|
6753
|
+
serializedData: Md(e),
|
|
6739
6754
|
dsl: a
|
|
6740
6755
|
};
|
|
6741
6756
|
}
|
|
6742
|
-
const
|
|
6757
|
+
const nu = [
|
|
6743
6758
|
// Bar Vertical
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6759
|
+
ot("letter-frequency", cd),
|
|
6760
|
+
ot("co2-emissions", fd),
|
|
6761
|
+
ot("coffee-production", md),
|
|
6747
6762
|
// Bar Horizontal
|
|
6748
|
-
|
|
6763
|
+
ot("spoken-languages", dd),
|
|
6749
6764
|
// Bar Multi
|
|
6750
|
-
|
|
6751
|
-
|
|
6765
|
+
ot("quarterly-revenue", ud),
|
|
6766
|
+
ot("medal-count", hd),
|
|
6752
6767
|
// Line
|
|
6753
|
-
|
|
6768
|
+
ot("temperature-anomaly", gd),
|
|
6754
6769
|
// Line Multi
|
|
6755
|
-
|
|
6770
|
+
ot("unemployment-rates", pd),
|
|
6756
6771
|
// Donut
|
|
6757
|
-
|
|
6772
|
+
ot("browser-market", yd),
|
|
6758
6773
|
// Pie
|
|
6759
|
-
|
|
6774
|
+
ot("world-population", bd),
|
|
6760
6775
|
// Area
|
|
6761
|
-
|
|
6776
|
+
ot("stock-price-area", vd),
|
|
6762
6777
|
// Area Stacked
|
|
6763
|
-
|
|
6778
|
+
ot("energy-mix-stacked-area", xd),
|
|
6764
6779
|
// Column Stacked
|
|
6765
|
-
|
|
6780
|
+
ot("quarterly-stacked-columns", Ad),
|
|
6766
6781
|
// Bar Stacked
|
|
6767
|
-
|
|
6782
|
+
ot("population-stacked-bar", wd),
|
|
6768
6783
|
// Bar Split
|
|
6769
|
-
|
|
6784
|
+
ot("election-polls", kd),
|
|
6770
6785
|
// Bar Grouped
|
|
6771
|
-
|
|
6786
|
+
ot("renewable-capacity", Ld),
|
|
6772
6787
|
// Story (multi-scene)
|
|
6773
|
-
|
|
6788
|
+
ot("farm-compass", Sd)
|
|
6774
6789
|
], Ds = /* @__PURE__ */ new Set();
|
|
6775
|
-
function
|
|
6790
|
+
function Cd(t, a, e) {
|
|
6776
6791
|
let r = a;
|
|
6777
6792
|
for (const n of t)
|
|
6778
6793
|
n.transformType === "sort" ? r = Zt.Total : Ds.has(n.transformType) || (Ds.add(n.transformType), console.warn(`[blueprint-chart] Unknown transform "${n.transformType}" in ${e}; ignored.`));
|
|
6779
6794
|
return r;
|
|
6780
6795
|
}
|
|
6781
|
-
function
|
|
6796
|
+
function Od(t) {
|
|
6782
6797
|
const a = (s) => {
|
|
6783
6798
|
const o = t.get(s);
|
|
6784
6799
|
return o == null ? void 0 : String(o) || void 0;
|
|
@@ -6794,14 +6809,14 @@ function Cd(t) {
|
|
|
6794
6809
|
};
|
|
6795
6810
|
return Object.values(r).some((s) => s !== void 0) ? r : void 0;
|
|
6796
6811
|
}
|
|
6797
|
-
function
|
|
6798
|
-
const a = ra(t.properties), e = t.data ? to(t.data) : "", r = Qi(e), n = a.get("sort"), s = n == null ? void 0 : String(n), o = s ===
|
|
6812
|
+
function Pd(t) {
|
|
6813
|
+
const a = ra(t.properties), e = t.data ? to(t.data) : "", r = Qi(e), n = a.get("sort"), s = n == null ? void 0 : String(n), o = s === lt.Ascending || s === lt.Descending ? s : void 0, i = a.get("theme"), c = a.get("sortMode");
|
|
6799
6814
|
let f;
|
|
6800
|
-
return (c === Zt.Total || c === Zt.WithinGroups || c === Zt.None) && (f = c), f =
|
|
6815
|
+
return (c === Zt.Total || c === Zt.WithinGroups || c === Zt.None) && (f = c), f = Cd(t.transforms, f, "chart"), {
|
|
6801
6816
|
chartType: t.chartType,
|
|
6802
6817
|
data: r,
|
|
6803
6818
|
properties: t.properties,
|
|
6804
|
-
frame:
|
|
6819
|
+
frame: Od(a),
|
|
6805
6820
|
colorizes: ao(t.colorizes),
|
|
6806
6821
|
highlights: ro(t.highlights),
|
|
6807
6822
|
areaFills: no(t.areaFills),
|
|
@@ -6814,13 +6829,13 @@ function Od(t) {
|
|
|
6814
6829
|
};
|
|
6815
6830
|
}
|
|
6816
6831
|
const Es = /* @__PURE__ */ new Set();
|
|
6817
|
-
function
|
|
6832
|
+
function Td(t, a, e) {
|
|
6818
6833
|
let r = a;
|
|
6819
6834
|
for (const n of t)
|
|
6820
6835
|
n.transformType === "sort" ? r = Zt.Total : Es.has(n.transformType) || (Es.add(n.transformType), console.warn(`[blueprint-chart] Unknown transform "${n.transformType}" in ${e}; ignored.`));
|
|
6821
6836
|
return r;
|
|
6822
6837
|
}
|
|
6823
|
-
function
|
|
6838
|
+
function zd() {
|
|
6824
6839
|
return {
|
|
6825
6840
|
properties: /* @__PURE__ */ new Map(),
|
|
6826
6841
|
chartTypeOptions: {},
|
|
@@ -6833,8 +6848,8 @@ function Td() {
|
|
|
6833
6848
|
transforms: []
|
|
6834
6849
|
};
|
|
6835
6850
|
}
|
|
6836
|
-
function
|
|
6837
|
-
const r =
|
|
6851
|
+
function Dd(t, a, e) {
|
|
6852
|
+
const r = zd();
|
|
6838
6853
|
for (let n = 0; n <= a; n++) {
|
|
6839
6854
|
const s = t[n], o = ra(s.properties), i = o.get("type");
|
|
6840
6855
|
i && (r.chartType = i);
|
|
@@ -6864,7 +6879,7 @@ function zd(t, a, e) {
|
|
|
6864
6879
|
}
|
|
6865
6880
|
return r;
|
|
6866
6881
|
}
|
|
6867
|
-
function
|
|
6882
|
+
function Ed(t, a) {
|
|
6868
6883
|
const e = t.options ?? (t.properties ? Cs(t.chartType, Tn(t.chartType, t.properties)) : {}), r = {
|
|
6869
6884
|
chartType: t.chartType,
|
|
6870
6885
|
data: t.data,
|
|
@@ -6881,7 +6896,7 @@ function Dd(t, a) {
|
|
|
6881
6896
|
};
|
|
6882
6897
|
if (a == null || !t.scenes || a < 0 || a >= t.scenes.length)
|
|
6883
6898
|
return r;
|
|
6884
|
-
const n =
|
|
6899
|
+
const n = Dd(t.scenes, a, t.chartType), s = n.chartType ?? t.chartType, o = n.data ? Qi(to(n.data)) : r.data, i = Object.keys(n.chartTypeOptions).length > 0 ? Cs(s, { ...e, ...n.chartTypeOptions }) : e, c = n.colorizes.length > 0 ? ao(n.colorizes) : n.data ? [] : r.colorizes, f = a != null ? ro(n.highlights) : r.highlights, d = n.areaFills.length > 0 ? no(n.areaFills) : r.areaFills, g = n.annotations.length > 0 ? so(n.annotations) : [], b = [...r.annotations, ...g], m = n.hiddenAnnotationIds.size > 0 ? b.filter(($) => !$.id || !n.hiddenAnnotationIds.has($.id)) : b, v = n.seriesOverrides.length > 0 ? io(n.seriesOverrides) : r.seriesOverrides, y = Td(n.transforms, r.sortMode, `scene ${a}`), x = ["title", "description", "source", "sourceUrl", "byline", "note"], A = {};
|
|
6885
6900
|
for (const $ of x) {
|
|
6886
6901
|
const P = n.properties.get($);
|
|
6887
6902
|
typeof P == "string" && (A[$] = P);
|
|
@@ -6902,7 +6917,7 @@ function Dd(t, a) {
|
|
|
6902
6917
|
};
|
|
6903
6918
|
}
|
|
6904
6919
|
const rn = /* @__PURE__ */ new WeakMap();
|
|
6905
|
-
function
|
|
6920
|
+
function Fd(t) {
|
|
6906
6921
|
const a = rn.get(t);
|
|
6907
6922
|
if (!(!a || a.size === 0)) {
|
|
6908
6923
|
for (const e of a)
|
|
@@ -6914,8 +6929,8 @@ function Da(t, a) {
|
|
|
6914
6929
|
let e = rn.get(t);
|
|
6915
6930
|
e || (e = /* @__PURE__ */ new Set(), rn.set(t, e)), e.add(a);
|
|
6916
6931
|
}
|
|
6917
|
-
function
|
|
6918
|
-
if (
|
|
6932
|
+
function Nd(t, a, e) {
|
|
6933
|
+
if (Fd(t), e.ignoreLayout || !a)
|
|
6919
6934
|
return { constrained: !1 };
|
|
6920
6935
|
const r = ra(a), n = r.get("heightMode"), s = r.get("aspectRatio"), o = r.get("fixedHeight");
|
|
6921
6936
|
let i = !1;
|
|
@@ -6931,22 +6946,22 @@ function oo(t) {
|
|
|
6931
6946
|
typeof a.getAnimations == "function" && a.getAnimations().forEach((e) => e.cancel()), a.remove();
|
|
6932
6947
|
});
|
|
6933
6948
|
}
|
|
6934
|
-
function
|
|
6949
|
+
function Bd(t, a, e) {
|
|
6935
6950
|
if (!e)
|
|
6936
6951
|
return null;
|
|
6937
6952
|
const r = zn.get(t);
|
|
6938
|
-
return !r || r === a ? null : (oo(t),
|
|
6953
|
+
return !r || r === a ? null : (oo(t), Bt(t));
|
|
6939
6954
|
}
|
|
6940
6955
|
function Id(t, a, e) {
|
|
6941
6956
|
if (zn.set(t, a), e) {
|
|
6942
6957
|
const r = t.querySelector(".bc-frame .bc-frame-body");
|
|
6943
|
-
r && Nt(r),
|
|
6958
|
+
r && Nt(r), It(t, e);
|
|
6944
6959
|
}
|
|
6945
6960
|
}
|
|
6946
6961
|
function Fs(t) {
|
|
6947
6962
|
zn.delete(t), oo(t);
|
|
6948
6963
|
}
|
|
6949
|
-
function
|
|
6964
|
+
function Vd(t, a, e) {
|
|
6950
6965
|
const r = t.querySelector(".bc-frame");
|
|
6951
6966
|
if (!r)
|
|
6952
6967
|
return;
|
|
@@ -6958,7 +6973,7 @@ function Bd(t, a, e) {
|
|
|
6958
6973
|
r.classList.remove(s);
|
|
6959
6974
|
a.theme && r.classList.add(`bc-theme-${a.theme}`), e.constrained && r.classList.add("bc-frame--constrained");
|
|
6960
6975
|
}
|
|
6961
|
-
function
|
|
6976
|
+
function _d(t, a, e = {}) {
|
|
6962
6977
|
var m;
|
|
6963
6978
|
if (e.transition || (t.replaceChildren(), Fs(t)), a.data.labels.length === 0) {
|
|
6964
6979
|
e.transition && (t.replaceChildren(), Fs(t));
|
|
@@ -6973,10 +6988,10 @@ function Vd(t, a, e = {}) {
|
|
|
6973
6988
|
}
|
|
6974
6989
|
r = v;
|
|
6975
6990
|
}
|
|
6976
|
-
const n =
|
|
6991
|
+
const n = Nd(t, r.properties, e), s = Ed(r, e.sceneIndex), o = xf(s.chartType);
|
|
6977
6992
|
if (!o)
|
|
6978
6993
|
return;
|
|
6979
|
-
const i =
|
|
6994
|
+
const i = Bd(t, s.chartType, !!e.transition);
|
|
6980
6995
|
i && t.replaceChildren();
|
|
6981
6996
|
const c = Ft(t), f = Xf(s.options, c);
|
|
6982
6997
|
let d;
|
|
@@ -6999,43 +7014,43 @@ function Vd(t, a, e = {}) {
|
|
|
6999
7014
|
seriesOverrides: s.seriesOverrides.length > 0 ? s.seriesOverrides : void 0
|
|
7000
7015
|
}, !!e.transition), e.transition && g.commit({ mode: e.transitionMode });
|
|
7001
7016
|
const b = e.theme ?? s.theme;
|
|
7002
|
-
|
|
7017
|
+
Vd(t, { theme: b }, n), Id(t, s.chartType, i);
|
|
7003
7018
|
}
|
|
7004
|
-
function
|
|
7019
|
+
function su(t, a, e) {
|
|
7005
7020
|
if (!a) {
|
|
7006
7021
|
e != null && e.transition || t.replaceChildren();
|
|
7007
7022
|
return;
|
|
7008
7023
|
}
|
|
7009
|
-
const r = Ki(a), n =
|
|
7010
|
-
|
|
7024
|
+
const r = Ki(a), n = Pd(r);
|
|
7025
|
+
_d(t, n, e);
|
|
7011
7026
|
}
|
|
7012
7027
|
export {
|
|
7013
7028
|
sa as Anchor,
|
|
7014
7029
|
_s as AnnotationAction,
|
|
7015
|
-
|
|
7016
|
-
|
|
7030
|
+
Ze as AnnotationKind,
|
|
7031
|
+
gt as AnnotationLineStyle,
|
|
7017
7032
|
zt as AxisDirection,
|
|
7018
7033
|
mr as BC_TRANSITION_NAME,
|
|
7019
7034
|
de as ChartOptionType,
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7035
|
+
_e as ChartType,
|
|
7036
|
+
et as CompassDirection,
|
|
7037
|
+
pt as CrosshairDirection,
|
|
7023
7038
|
Qt as CrosshairStyle,
|
|
7024
7039
|
Kr as DEFAULT_BAR_GAP,
|
|
7025
|
-
|
|
7040
|
+
bt as DirectLabelMode,
|
|
7026
7041
|
fl as DslNodeType,
|
|
7027
7042
|
ll as FrameSizing,
|
|
7028
|
-
|
|
7043
|
+
tt as GridStyle,
|
|
7029
7044
|
jt as Interpolation,
|
|
7030
|
-
|
|
7045
|
+
He as LabelPosition,
|
|
7031
7046
|
Ua as LabelRotation,
|
|
7032
7047
|
Ea as LegendPosition,
|
|
7033
7048
|
cl as LineStyle,
|
|
7034
|
-
|
|
7049
|
+
st as Orientation,
|
|
7035
7050
|
Gs as RangeAnchor,
|
|
7036
|
-
|
|
7051
|
+
Ba as ScaleType,
|
|
7037
7052
|
bc as SceneTransition,
|
|
7038
|
-
|
|
7053
|
+
lt as SortDirection,
|
|
7039
7054
|
Zt as SortMode,
|
|
7040
7055
|
va as StackMode,
|
|
7041
7056
|
yr as StrokeStyle,
|
|
@@ -7045,55 +7060,56 @@ export {
|
|
|
7045
7060
|
ol as TickPosition,
|
|
7046
7061
|
ze as ValueLabelPosition,
|
|
7047
7062
|
fc as adjustColorsForBackground,
|
|
7048
|
-
|
|
7063
|
+
Pd as astToDefinition,
|
|
7049
7064
|
Xf as buildChartOptions,
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7065
|
+
eu as checkCvdColors,
|
|
7066
|
+
It as commitFadeOut,
|
|
7067
|
+
au as compactSerialize,
|
|
7053
7068
|
so as convertAnnotations,
|
|
7054
7069
|
no as convertAreaFills,
|
|
7055
7070
|
ao as convertColorizes,
|
|
7056
7071
|
ro as convertHighlights,
|
|
7057
7072
|
io as convertSeriesOverrides,
|
|
7058
7073
|
Gt as createCanvas,
|
|
7059
|
-
|
|
7074
|
+
Kd as createCvdSvgFilter,
|
|
7060
7075
|
_t as createFrame,
|
|
7061
7076
|
to as dataEntriesToString,
|
|
7062
7077
|
Tn as extractChartTypeOptions,
|
|
7063
|
-
|
|
7078
|
+
ru as extractSceneOverrides,
|
|
7064
7079
|
Nt as fadeIn,
|
|
7065
7080
|
Ga as featureJoin,
|
|
7066
|
-
|
|
7081
|
+
Yt as getCachedChart,
|
|
7067
7082
|
xf as getChart,
|
|
7068
7083
|
yn as getChartOptions,
|
|
7069
|
-
|
|
7070
|
-
|
|
7084
|
+
jf as getChartTypeDefaults,
|
|
7085
|
+
Qf as getCvdFilterId,
|
|
7071
7086
|
$a as getSceneTransition,
|
|
7072
7087
|
Sa as getTransitionDuration,
|
|
7073
7088
|
Ma as isSeriesHidden,
|
|
7074
|
-
|
|
7089
|
+
Qd as listCharts,
|
|
7075
7090
|
ql as listPalettes,
|
|
7076
7091
|
Ki as parse,
|
|
7077
7092
|
Qi as parseData,
|
|
7078
7093
|
ra as propertyMap,
|
|
7094
|
+
Jd as recommendCharts,
|
|
7079
7095
|
xt as registerChart,
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7096
|
+
su as renderBpc,
|
|
7097
|
+
_d as renderChart,
|
|
7098
|
+
Ud as renderHorizontalAxis,
|
|
7083
7099
|
ba as renderLegend,
|
|
7084
|
-
|
|
7100
|
+
Xd as renderVerticalAxis,
|
|
7085
7101
|
Ft as resolveBackgroundColor,
|
|
7086
7102
|
ka as resolveBarGapPadding,
|
|
7087
7103
|
Cs as resolveChartTypeOptions,
|
|
7088
7104
|
Wl as resolvePalette,
|
|
7089
|
-
|
|
7090
|
-
|
|
7105
|
+
Ed as resolveScene,
|
|
7106
|
+
qe as resolveSeriesColor,
|
|
7091
7107
|
pi as resolveSeriesInterpolation,
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7108
|
+
nu as samples,
|
|
7109
|
+
tu as serialize,
|
|
7110
|
+
Kf as simulateCvdColor,
|
|
7111
|
+
Bt as snapshotForFadeOut,
|
|
7096
7112
|
ms as snapshotLiveAttrs,
|
|
7097
|
-
|
|
7098
|
-
|
|
7113
|
+
jd as wcagContrastRatio,
|
|
7114
|
+
Zd as wcagLevel
|
|
7099
7115
|
};
|