@blueprint-chart/lib 0.1.31 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +877 -868
- package/dist/lib/lib.iife.js +11 -2
- package/dist/runtime/chart-css.d.ts +1 -1
- package/package.json +1 -1
- package/src/charts/chart.scss +8 -0
package/dist/index.js
CHANGED
|
@@ -4,16 +4,16 @@ var Zt = (t, a, e) => Pl(t, typeof a != "symbol" ? a + "" : a, e);
|
|
|
4
4
|
import * as p from "d3";
|
|
5
5
|
import "d3-transition";
|
|
6
6
|
import { D3Blueprint as ht } from "d3-blueprint";
|
|
7
|
+
import He from "chroma-js";
|
|
7
8
|
import Ya from "dayjs";
|
|
8
9
|
import { computePosition as js, offset as Ks, flip as Zs, shift as Js } from "@floating-ui/dom";
|
|
9
|
-
|
|
10
|
-
var xt = /* @__PURE__ */ ((t) => (t.BarVertical = "bar-vertical", t.BarHorizontal = "bar-horizontal", t.BarMulti = "bar-multi", t.ColumnStacked = "column-stacked", t.BarStacked = "bar-stacked", t.BarSplit = "bar-split", t.BarGrouped = "bar-grouped", t.Line = "line", t.LineMulti = "line-multi", t.Area = "area", t.AreaStacked = "area-stacked", t.Donut = "donut", t.Pie = "pie", t.VerticalBar = "vertical-bar", t.HorizontalBar = "horizontal-bar", t))(xt || {}), Nt = /* @__PURE__ */ ((t) => (t.Left = "left", t.Right = "right", t))(Nt || {}), Ha = /* @__PURE__ */ ((t) => (t.Linear = "linear", t.Log = "log", t))(Ha || {}), at = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t.None = "none", t))(at || {}), We = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Inside = "inside", t.Outside = "outside", t.Off = "off", t))(We || {}), ar = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(ar || {}), zl = /* @__PURE__ */ ((t) => (t.Above = "above", t.Below = "below", t))(zl || {}), Dl = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Standard = "standard", t.AspectRatio = "aspect-ratio", t))(Dl || {}), tt = /* @__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))(tt || {}), mt = /* @__PURE__ */ ((t) => (t.Direct = "direct", t.CurveLeft = "curve-left", t.CurveRight = "curve-right", t.Elbow = "elbow", t))(mt || {}), kr = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dotted = "dotted", t.Dashed = "dashed", t))(kr || {}), Je = /* @__PURE__ */ ((t) => (t.Point = "point", t.Range = "range", t.Free = "free", t))(Je || {});
|
|
10
|
+
var xt = /* @__PURE__ */ ((t) => (t.BarVertical = "bar-vertical", t.BarHorizontal = "bar-horizontal", t.BarMulti = "bar-multi", t.ColumnStacked = "column-stacked", t.BarStacked = "bar-stacked", t.BarSplit = "bar-split", t.BarGrouped = "bar-grouped", t.Line = "line", t.LineMulti = "line-multi", t.Area = "area", t.AreaStacked = "area-stacked", t.Donut = "donut", t.Pie = "pie", t.VerticalBar = "vertical-bar", t.HorizontalBar = "horizontal-bar", t))(xt || {}), Ft = /* @__PURE__ */ ((t) => (t.Left = "left", t.Right = "right", t))(Ft || {}), Ha = /* @__PURE__ */ ((t) => (t.Linear = "linear", t.Log = "log", t))(Ha || {}), at = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t.None = "none", t))(at || {}), We = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Inside = "inside", t.Outside = "outside", t.Off = "off", t))(We || {}), ar = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(ar || {}), zl = /* @__PURE__ */ ((t) => (t.Above = "above", t.Below = "below", t))(zl || {}), Dl = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Standard = "standard", t.AspectRatio = "aspect-ratio", t))(Dl || {}), tt = /* @__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))(tt || {}), mt = /* @__PURE__ */ ((t) => (t.Direct = "direct", t.CurveLeft = "curve-left", t.CurveRight = "curve-right", t.Elbow = "elbow", t))(mt || {}), kr = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dotted = "dotted", t.Dashed = "dashed", t))(kr || {}), Je = /* @__PURE__ */ ((t) => (t.Point = "point", t.Range = "range", t.Free = "free", t))(Je || {});
|
|
11
11
|
const Qs = {
|
|
12
12
|
point: "annotation",
|
|
13
13
|
range: "range",
|
|
14
14
|
free: "note"
|
|
15
15
|
};
|
|
16
|
-
var ei = /* @__PURE__ */ ((t) => (t.Hide = "hide", t.Show = "show", t))(ei || {}), ti = /* @__PURE__ */ ((t) => (t.Start = "start", t.Center = "center", t.End = "end", t))(ti || {}), ct = /* @__PURE__ */ ((t) => (t.Vertical = "vertical", t.Horizontal = "horizontal", t))(ct || {}),
|
|
16
|
+
var ei = /* @__PURE__ */ ((t) => (t.Hide = "hide", t.Show = "show", t))(ei || {}), ti = /* @__PURE__ */ ((t) => (t.Start = "start", t.Center = "center", t.End = "end", t))(ti || {}), ct = /* @__PURE__ */ ((t) => (t.Vertical = "vertical", t.Horizontal = "horizontal", t))(ct || {}), Nt = /* @__PURE__ */ ((t) => (t.Circle = "circle", t.Square = "square", t.Diamond = "diamond", t.Triangle = "triangle", t.TriangleDown = "triangleDown", t.Cross = "cross", t.Star = "star", t))(Nt || {}), It = /* @__PURE__ */ ((t) => (t.All = "all", t.First = "first", t.Last = "last", t.FirstLast = "firstLast", t))(It || {}), wt = /* @__PURE__ */ ((t) => (t.Filled = "filled", t.Hollow = "hollow", t))(wt || {}), ut = /* @__PURE__ */ ((t) => (t.Ascending = "ascending", t.Descending = "descending", t.None = "none", t))(ut || {}), Qt = /* @__PURE__ */ ((t) => (t.Total = "total", t.WithinGroups = "within-groups", t.None = "none", t))(Qt || {}), _a = /* @__PURE__ */ ((t) => (t.Top = "top", t.Bottom = "bottom", t.Left = "left", t.Right = "right", t))(_a || {}), da = /* @__PURE__ */ ((t) => (t.Start = "start", t.Middle = "middle", t.End = "end", t))(da || {}), Fe = /* @__PURE__ */ ((t) => (t.Inside = "inside", t.Outside = "outside", t.Auto = "auto", t))(Fe || {}), yt = /* @__PURE__ */ ((t) => (t.Both = "both", t.Vertical = "vertical", t.Horizontal = "horizontal", t))(yt || {}), ea = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t))(ea || {}), La = /* @__PURE__ */ ((t) => (t.Normal = "normal", t.Percent = "percent", t))(La || {}), El = /* @__PURE__ */ ((t) => (t.Solid = "solid", t.Dashed = "dashed", t.Dotted = "dotted", t.None = "none", t))(El || {}), ue = /* @__PURE__ */ ((t) => (t.Colors = "colors", t.Boolean = "boolean", t.Select = "select", t.Text = "text", t.NumberFormat = "numberFormat", t.DateFormat = "dateFormat", t))(ue || {}), vt = /* @__PURE__ */ ((t) => (t.Off = "", t.Auto = "auto", t.Outside = "outside", t.Inside = "inside", t))(vt || {}), 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 || {}), Nl = /* @__PURE__ */ ((t) => (t.Property = "property", t.Data = "data", t.Colorize = "colorize", t.Highlight = "highlight", t.AreaFill = "area-fill", t.Annotation = "annotation", t.Series = "series", t.AnnotationVisibility = "annotation-visibility", t.Scene = "scene", t.Transform = "transform", t.Chart = "chart", t))(Nl || {});
|
|
17
17
|
class Fl extends ht {
|
|
18
18
|
initialize() {
|
|
19
19
|
const a = this.base.append("div").attr("class", "bc-frame"), e = a.append("div").attr("class", "bc-frame-header");
|
|
@@ -119,13 +119,13 @@ function Bl(t) {
|
|
|
119
119
|
href: t.sourceUrl || void 0
|
|
120
120
|
}), a;
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
function
|
|
122
|
+
const Vl = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48.042969 90.607422" width="10" height="18" style="vertical-align:-3px;margin-right:3px"><path fill="currentColor" opacity="0.55" d="M 20.042969 34.607422 A 28 28 0 0 1 23.072266 34.779297 A 28 28 0 0 0 20.042969 34.607422 z M 23.34375 34.810547 A 28 28 0 0 1 26.171875 35.292969 A 28 28 0 0 0 23.34375 34.810547 z M 16.570312 34.84375 A 28 28 0 0 0 15.474609 35.033203 A 28 28 0 0 1 16.570312 34.84375 z M 26.390625 35.341797 A 28 28 0 0 1 29.316406 36.189453 A 28 28 0 0 0 26.390625 35.341797 z M 13.128906 35.511719 A 28 28 0 0 0 11.904297 35.873047 A 28 28 0 0 1 13.128906 35.511719 z M 29.373047 36.210938 A 28 28 0 0 1 32.103516 37.347656 A 28 28 0 0 0 29.373047 36.210938 z M 9.7832031 36.609375 A 28 28 0 0 0 8.5820312 37.117188 A 28 28 0 0 1 9.7832031 36.609375 z M 32.392578 37.486328 A 28 28 0 0 1 34.939453 38.90625 A 28 28 0 0 0 32.392578 37.486328 z M 6.5742188 38.128906 A 28 28 0 0 0 5.4511719 38.765625 A 28 28 0 0 1 6.5742188 38.128906 z M 35.041016 38.966797 A 28 28 0 0 1 37.523438 40.738281 A 28 28 0 0 0 35.041016 38.966797 z M 3.5273438 40.080078 A 28 28 0 0 0 2.5761719 40.771484 A 28 28 0 0 1 3.5273438 40.080078 z M 37.658203 40.851562 A 28 28 0 0 1 39.804688 42.783203 A 28 28 0 0 0 37.658203 40.851562 z M 40.011719 42.990234 A 28 28 0 0 1 42.013672 45.251953 A 28 28 0 0 0 40.011719 42.990234 z M 42.013672 45.251953 A 28 28 0 0 1 20.042969 56 A 28 28 0 0 1 14.232422 55.3125 A 16 16 0 0 1 16 62.607422 A 16 16 0 0 1 0 78.607422 L 0 82.121094 A 28 28 0 0 0 20.042969 90.607422 A 28 28 0 0 0 48.042969 62.607422 A 28 28 0 0 0 42.013672 45.251953 z M 1.3007812 46.667969 A 16 16 0 0 1 1.6191406 46.697266 A 16 16 0 0 0 1.3007812 46.667969 z M 4.2558594 47.189453 A 16 16 0 0 1 4.4355469 47.242188 A 16 16 0 0 0 4.2558594 47.189453 z "/><path fill="currentColor" opacity="0.85" d="M 6.0637516 38.376047 A 28 28 0 0 1 20.042969 34.615234 A 28 28 0 0 1 42.013672 45.259765 A 28 28 0 0 0 48.042969 28.007812 A 28 28 0 0 0 20.042969 0.0078125 A 28 28 0 0 0 0 8.4941407 L 0 16.007812 A 12 12 0 0 1 12 28.007812 A 12 12 0 0 1 6.0613693 38.364443 "/><path fill="currentColor" d="M 20.042969 34.607422 A 28 28 0 0 0 5.0878906 38.970703 A 28 28 0 0 1 6.0644531 38.376953 L 6.0605469 38.365234 A 12 12 0 0 1 0 40.007812 L 0 43.09375 L 0 43.101562 L 0 46.607422 A 16 16 0 0 1 2.8847656 46.873047 A 16 16 0 0 1 2.9199219 46.878906 A 16 16 0 0 1 5.7011719 47.662109 A 16 16 0 0 1 5.7324219 47.673828 A 16 16 0 0 1 8.3300781 48.955078 A 16 16 0 0 1 8.3398438 48.958984 A 16 16 0 0 1 8.3457031 48.962891 A 16 16 0 0 1 10.662109 50.6875 A 16 16 0 0 1 10.697266 50.71875 A 16 16 0 0 1 12.660156 52.837891 A 16 16 0 0 1 12.667969 52.845703 A 16 16 0 0 1 12.673828 52.855469 A 16 16 0 0 1 14.228516 55.306641 A 16 16 0 0 1 14.232422 55.3125 A 28 28 0 0 0 20.042969 56 A 28 28 0 0 0 42.013672 45.251953 A 28 28 0 0 0 20.042969 34.607422 z M 4.7695312 39.177734 A 28 28 0 0 0 2.5390625 40.798828 A 28 28 0 0 1 4.7695312 39.177734 z M 2.1816406 41.091797 A 28 28 0 0 0 0.11914062 42.984375 A 28 28 0 0 1 2.1816406 41.091797 z "/></svg>';
|
|
123
|
+
function Gl() {
|
|
124
124
|
return [{
|
|
125
125
|
tag: "a",
|
|
126
126
|
className: "bc-frame-credit",
|
|
127
127
|
text: "Blueprint Chart",
|
|
128
|
-
html:
|
|
128
|
+
html: Vl + "Blueprint Chart",
|
|
129
129
|
href: "/",
|
|
130
130
|
target: "_blank",
|
|
131
131
|
rel: "noopener noreferrer"
|
|
@@ -138,7 +138,7 @@ function Ht(t, a) {
|
|
|
138
138
|
new Fl(p.select(t)).draw({
|
|
139
139
|
headerItems: Il(e),
|
|
140
140
|
footerLeftItems: Bl(e),
|
|
141
|
-
footerRightItems:
|
|
141
|
+
footerRightItems: Gl()
|
|
142
142
|
});
|
|
143
143
|
const n = t.querySelector(".bc-frame"), s = n.querySelector(".bc-frame-header"), l = n.querySelector(".bc-frame-body"), o = n.querySelector(".bc-frame-note"), c = n.querySelector(".bc-frame-footer");
|
|
144
144
|
if (e.padding && n.style.setProperty("--bc-frame-padding", e.padding), e.transparentBackground && n.style.setProperty("--bc-frame-bg", "transparent"), e.note ? o.textContent = e.note : o.style.display = "none", t.isConnected) {
|
|
@@ -182,6 +182,81 @@ function va(t) {
|
|
|
182
182
|
function Or(t, a) {
|
|
183
183
|
return !Number.isFinite(a) || a <= 0 ? "0%" : `${Math.round(t / a * 100)}%`;
|
|
184
184
|
}
|
|
185
|
+
function ai(t, a) {
|
|
186
|
+
if (!He.valid(t))
|
|
187
|
+
return a;
|
|
188
|
+
try {
|
|
189
|
+
return He(t);
|
|
190
|
+
} catch {
|
|
191
|
+
return a;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function Bt(t) {
|
|
195
|
+
return He.valid(t) && He.contrast(t, "#fff") >= He.contrast(t, "#333") ? "#fff" : "#333";
|
|
196
|
+
}
|
|
197
|
+
function Nu(t, a) {
|
|
198
|
+
return !He.valid(t) || !He.valid(a) ? 1 : He.contrast(t, a);
|
|
199
|
+
}
|
|
200
|
+
function Fu(t) {
|
|
201
|
+
return t >= 7 ? "AAA" : t >= 4.5 ? "AA" : "Fail";
|
|
202
|
+
}
|
|
203
|
+
const nr = 4.5;
|
|
204
|
+
function Tt(t) {
|
|
205
|
+
let a = t;
|
|
206
|
+
for (; a && a instanceof Element; ) {
|
|
207
|
+
const e = getComputedStyle(a).backgroundColor;
|
|
208
|
+
if (e && e !== "rgba(0, 0, 0, 0)" && e !== "transparent")
|
|
209
|
+
return e;
|
|
210
|
+
a = a.parentElement;
|
|
211
|
+
}
|
|
212
|
+
return "#fff";
|
|
213
|
+
}
|
|
214
|
+
function ri(t, a = "#fff") {
|
|
215
|
+
if (!He.valid(t))
|
|
216
|
+
return He.valid(a) ? Bt(a) : "#333";
|
|
217
|
+
let e = He(t);
|
|
218
|
+
const r = ai(a, He("#fff"));
|
|
219
|
+
if (He.contrast(e, r) >= nr)
|
|
220
|
+
return e.hex();
|
|
221
|
+
const n = r.luminance() > 0.5;
|
|
222
|
+
for (let s = 0; s < 20 && (e = n ? e.darken(0.3) : e.brighten(0.3), !(He.contrast(e, r) >= nr)); s++)
|
|
223
|
+
;
|
|
224
|
+
return e.hex();
|
|
225
|
+
}
|
|
226
|
+
const bn = 12, Lr = 0.25, ni = 20;
|
|
227
|
+
function Rl(t, a) {
|
|
228
|
+
if (t.length === 0)
|
|
229
|
+
return [];
|
|
230
|
+
const e = ai(a, He("#fff")), r = He.valid(a) ? a : "#fff", n = e.luminance() > 0.5, s = t.map((l) => He.valid(l) ? Yl(He(l), r, n) : He("#000"));
|
|
231
|
+
for (let l = 1; l < s.length; l++)
|
|
232
|
+
He.deltaE(s[l], s[l - 1]) >= bn || (s[l] = Hl(s[l], s[l - 1], r, n));
|
|
233
|
+
return s.map((l) => l.hex());
|
|
234
|
+
}
|
|
235
|
+
function Yl(t, a, e) {
|
|
236
|
+
for (let r = 0; r < ni; r++) {
|
|
237
|
+
if (He.contrast(t, a) >= nr)
|
|
238
|
+
return t;
|
|
239
|
+
t = e ? t.darken(Lr) : t.brighten(Lr);
|
|
240
|
+
}
|
|
241
|
+
return t;
|
|
242
|
+
}
|
|
243
|
+
function Hl(t, a, e, r) {
|
|
244
|
+
const n = ps(t, a, e, r);
|
|
245
|
+
if (He.deltaE(n, a) >= bn)
|
|
246
|
+
return n;
|
|
247
|
+
const s = ps(t, a, e, !r);
|
|
248
|
+
return He.deltaE(s, a) > He.deltaE(n, a) && He.contrast(s, e) >= nr ? s : n;
|
|
249
|
+
}
|
|
250
|
+
function ps(t, a, e, r) {
|
|
251
|
+
let n = t, s = He.deltaE(t, a), l = t;
|
|
252
|
+
for (let o = 0; o < ni; o++) {
|
|
253
|
+
l = r ? l.darken(Lr) : l.brighten(Lr);
|
|
254
|
+
const c = He.deltaE(l, a);
|
|
255
|
+
if (c > s && He.contrast(l, e) >= nr && (n = l, s = c), s >= bn)
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
return n;
|
|
259
|
+
}
|
|
185
260
|
function aa(t, a) {
|
|
186
261
|
if (!t)
|
|
187
262
|
return;
|
|
@@ -191,15 +266,15 @@ function aa(t, a) {
|
|
|
191
266
|
dy: e - r
|
|
192
267
|
};
|
|
193
268
|
}
|
|
194
|
-
const
|
|
269
|
+
const Wl = {
|
|
195
270
|
top: 12,
|
|
196
271
|
right: 20,
|
|
197
272
|
bottom: 24,
|
|
198
273
|
left: 50
|
|
199
|
-
},
|
|
200
|
-
class
|
|
274
|
+
}, si = 600, ii = 400;
|
|
275
|
+
class ql extends ht {
|
|
201
276
|
initialize() {
|
|
202
|
-
this.configDefine("totalWidth", { defaultValue:
|
|
277
|
+
this.configDefine("totalWidth", { defaultValue: si }), this.configDefine("totalHeight", { defaultValue: ii }), this.layer("svg", this.base, {
|
|
203
278
|
dataBind: (a, e) => a.selectAll("svg").data(e),
|
|
204
279
|
insert: (a) => a.append("svg"),
|
|
205
280
|
events: {
|
|
@@ -212,7 +287,7 @@ class Yl extends ht {
|
|
|
212
287
|
});
|
|
213
288
|
}
|
|
214
289
|
}
|
|
215
|
-
const
|
|
290
|
+
const Xl = 400, bs = 2, $r = 2, Cr = 9;
|
|
216
291
|
function Ma(t, a, e, r) {
|
|
217
292
|
const n = Math.min(0, ...t), s = Math.max(0, ...t), l = (a == null ? void 0 : a.min) ?? n, o = (a == null ? void 0 : a.max) ?? s, c = r === "log" ? p.scaleSymlog().domain([l, o]).nice() : p.scaleLinear().domain([l, o]).nice(), d = c.ticks(), u = e ? va(e) ?? c.tickFormat() : c.tickFormat(), g = d.map((m) => u(m));
|
|
218
293
|
if (g.length === 0)
|
|
@@ -226,11 +301,11 @@ function Ma(t, a, e, r) {
|
|
|
226
301
|
const w = v.measureText(x).width;
|
|
227
302
|
w > y && (y = w);
|
|
228
303
|
}
|
|
229
|
-
return Math.ceil(y) +
|
|
304
|
+
return Math.ceil(y) + $r + Cr;
|
|
230
305
|
}
|
|
231
306
|
} catch {
|
|
232
307
|
}
|
|
233
|
-
return Math.max(...g.map((m) => m.length)) * 6 +
|
|
308
|
+
return Math.max(...g.map((m) => m.length)) * 6 + $r + Cr;
|
|
234
309
|
}
|
|
235
310
|
function Tr(t) {
|
|
236
311
|
if (t.length === 0)
|
|
@@ -244,44 +319,53 @@ function Tr(t) {
|
|
|
244
319
|
const l = r.measureText(s).width;
|
|
245
320
|
l > n && (n = l);
|
|
246
321
|
}
|
|
247
|
-
return Math.ceil(n) +
|
|
322
|
+
return Math.ceil(n) + $r + Cr;
|
|
248
323
|
}
|
|
249
324
|
} catch {
|
|
250
325
|
}
|
|
251
|
-
return Math.max(...t.map((e) => e.length)) * 6 +
|
|
326
|
+
return Math.max(...t.map((e) => e.length)) * 6 + $r + Cr;
|
|
252
327
|
}
|
|
253
328
|
function ra(t, a, e, r, n, s) {
|
|
254
|
-
const l = {}, o = n ?? 50, c = r ?? "left", d = a ?? "auto", u = d === "auto" ? t > 0 && t <
|
|
255
|
-
return c === "right" ? (l.left = 0, g ? l.right =
|
|
329
|
+
const l = {}, o = n ?? 50, c = r ?? "left", d = a ?? "auto", u = d === "auto" ? t > 0 && t < Xl ? "inside" : "outside" : d, g = u === "inside", b = u === "off";
|
|
330
|
+
return c === "right" ? (l.left = 0, g ? l.right = bs : b ? l.right = 0 : l.right = o) : (l.right = s !== !1 ? 15 : 0, g ? l.left = bs : b ? l.left = 0 : l.left = o), g && (l.top = 35), (s === !1 || e === "inside" || e === "off") && (l.bottom = 5), l;
|
|
256
331
|
}
|
|
257
|
-
function
|
|
332
|
+
function Pt(t) {
|
|
258
333
|
const a = t.getBoundingClientRect(), e = getComputedStyle(t);
|
|
259
334
|
return {
|
|
260
335
|
width: a.width - (parseFloat(e.paddingLeft) || 0) - (parseFloat(e.paddingRight) || 0),
|
|
261
336
|
height: a.height - (parseFloat(e.paddingTop) || 0) - (parseFloat(e.paddingBottom) || 0)
|
|
262
337
|
};
|
|
263
338
|
}
|
|
339
|
+
function Ul(t, a) {
|
|
340
|
+
var n;
|
|
341
|
+
const e = a.closest(".bc-frame");
|
|
342
|
+
if (!e || e.style.getPropertyValue("--bc-frame-bg").trim() === "transparent")
|
|
343
|
+
return;
|
|
344
|
+
(n = t.querySelector(".bc-canvas-bg")) == null || n.remove();
|
|
345
|
+
const r = t.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
346
|
+
r.setAttribute("class", "bc-canvas-bg"), r.setAttribute("width", "100%"), r.setAttribute("height", "100%"), r.setAttribute("fill", Tt(e)), t.insertBefore(r, t.firstChild);
|
|
347
|
+
}
|
|
264
348
|
function Wt(t, a) {
|
|
265
|
-
const e = { ...
|
|
349
|
+
const e = { ...Wl, ...a }, r = t.closest(".bc-frame--constrained") != null;
|
|
266
350
|
if (r) {
|
|
267
351
|
const b = parseFloat(t.dataset.headerH || "0"), m = parseFloat(t.dataset.footerH || "0"), v = e.top;
|
|
268
352
|
e.top = b + v, e.bottom += m, e.stableTop = v;
|
|
269
353
|
}
|
|
270
|
-
const n =
|
|
354
|
+
const n = Pt(t), s = n.width > 0 ? n.width : si, l = n.height > 0 ? n.height : ii, o = s - e.left - e.right, c = l - e.top - e.bottom, d = new ql(p.select(t));
|
|
271
355
|
d.config({ totalWidth: s, totalHeight: l }), d.draw([e]);
|
|
272
356
|
const u = t.querySelector("svg"), g = u.querySelector("g");
|
|
273
|
-
return r && (u.setAttribute("viewBox", `0 0 ${s} ${l}`), u.setAttribute("preserveAspectRatio", "none"), u.removeAttribute("width"), u.removeAttribute("height"), u.style.width = "100%", u.style.height = "100%", u.style.display = "block"), { svg: u, chartArea: g, width: o, height: c, margin: e };
|
|
357
|
+
return Ul(u, t), r && (u.setAttribute("viewBox", `0 0 ${s} ${l}`), u.setAttribute("preserveAspectRatio", "none"), u.removeAttribute("width"), u.removeAttribute("height"), u.style.width = "100%", u.style.height = "100%", u.style.display = "block"), { svg: u, chartArea: g, width: o, height: c, margin: e };
|
|
274
358
|
}
|
|
275
359
|
function Oa(t) {
|
|
276
360
|
return typeof window > "u" || typeof window.matchMedia != "function" ? t : window.matchMedia("(prefers-reduced-motion: reduce)").matches ? 0 : t;
|
|
277
361
|
}
|
|
278
362
|
const Wa = 500;
|
|
279
|
-
let
|
|
363
|
+
let oi = 0;
|
|
280
364
|
function qt(t) {
|
|
281
|
-
|
|
365
|
+
oi = t ? Wa : 0;
|
|
282
366
|
}
|
|
283
367
|
function Be() {
|
|
284
|
-
return Oa(
|
|
368
|
+
return Oa(oi);
|
|
285
369
|
}
|
|
286
370
|
function St(t, a, e, r) {
|
|
287
371
|
if (a.length === 0)
|
|
@@ -308,11 +392,11 @@ function St(t, a, e, r) {
|
|
|
308
392
|
n.remove();
|
|
309
393
|
}
|
|
310
394
|
}
|
|
311
|
-
function
|
|
395
|
+
function Vt(t, a) {
|
|
312
396
|
const e = Oa(a ?? Wa);
|
|
313
397
|
e <= 0 || typeof t.animate != "function" || t.animate([{ opacity: 0 }, { opacity: 1 }], { duration: e, easing: "ease-in-out" });
|
|
314
398
|
}
|
|
315
|
-
function
|
|
399
|
+
function Gt(t, a) {
|
|
316
400
|
const e = Oa(a ?? Wa);
|
|
317
401
|
if (t.querySelectorAll("[data-bc-fade-overlay]").forEach((n) => {
|
|
318
402
|
typeof n.getAnimations == "function" && n.getAnimations().forEach((s) => s.cancel()), n.remove();
|
|
@@ -342,10 +426,10 @@ function _t(t, a, e) {
|
|
|
342
426
|
} else
|
|
343
427
|
a.remove();
|
|
344
428
|
}
|
|
345
|
-
const
|
|
346
|
-
class
|
|
429
|
+
const ms = 30;
|
|
430
|
+
class li extends ht {
|
|
347
431
|
initialize() {
|
|
348
|
-
this.configDefine("scale", { defaultValue: p.scaleLinear() }), this.configDefine("direction", { defaultValue:
|
|
432
|
+
this.configDefine("scale", { defaultValue: p.scaleLinear() }), this.configDefine("direction", { defaultValue: Ft.Left }), this.configDefine("showAxis", { defaultValue: !0 }), this.configDefine("showTicks", { defaultValue: !1 }), this.configDefine("gridStyle", { defaultValue: at.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: We.Auto }), this.configDefine("topPadding", { defaultValue: 0 }), this.configDefine("tickFormat", { defaultValue: null });
|
|
349
433
|
const a = this.base.append("g");
|
|
350
434
|
this.layer("axis", a, {
|
|
351
435
|
dataBind: (e, r) => e.selectAll(".bc-axis-vertical").data(r),
|
|
@@ -353,13 +437,13 @@ class si extends ht {
|
|
|
353
437
|
events: {
|
|
354
438
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
355
439
|
"merge:transition": (e) => {
|
|
356
|
-
const r = this.config("scale"), n = this.config("direction"), s = this.config("showAxis"), l = this.config("showTicks"), o = this.config("labelPosition"), c = this.config("gridWidth"), d = this.config("height"), u = n ===
|
|
440
|
+
const r = this.config("scale"), n = this.config("direction"), s = this.config("showAxis"), l = this.config("showTicks"), o = this.config("labelPosition"), c = this.config("gridWidth"), d = this.config("height"), u = n === Ft.Right ? p.axisRight(r) : p.axisLeft(r);
|
|
357
441
|
l || u.tickSizeOuter(0);
|
|
358
442
|
const g = this.config("ticks");
|
|
359
443
|
if (g)
|
|
360
444
|
u.tickValues(g);
|
|
361
445
|
else if (d > 0) {
|
|
362
|
-
const y = Math.max(2, Math.floor(d /
|
|
446
|
+
const y = Math.max(2, Math.floor(d / ms));
|
|
363
447
|
u.ticks(y);
|
|
364
448
|
}
|
|
365
449
|
const b = this.config("tickFormat");
|
|
@@ -375,7 +459,7 @@ class si extends ht {
|
|
|
375
459
|
const x = o === We.Auto ? c > 0 && c < 400 ? We.Inside : We.Outside : o;
|
|
376
460
|
if (x === We.Inside) {
|
|
377
461
|
const w = s ? 4 : 0, $ = m > 0 ? e.selectAll(".tick text") : p.select(v).selectAll(".tick text");
|
|
378
|
-
n ===
|
|
462
|
+
n === Ft.Right ? $.attr("x", -w).attr("dy", "-0.4em").attr("text-anchor", "end") : $.attr("x", w).attr("dy", "-0.4em").attr("text-anchor", "start");
|
|
379
463
|
} else x === We.Off && p.select(v).selectAll(".tick text").attr("opacity", 0);
|
|
380
464
|
}
|
|
381
465
|
},
|
|
@@ -385,13 +469,13 @@ class si extends ht {
|
|
|
385
469
|
},
|
|
386
470
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
387
471
|
enter: (e) => {
|
|
388
|
-
const r = this.config("scale"), n = this.config("direction"), s = this.config("labelPosition"), l = this.config("gridWidth"), o = this.config("height"), c = this.config("topPadding"), d = n ===
|
|
472
|
+
const r = this.config("scale"), n = this.config("direction"), s = this.config("labelPosition"), l = this.config("gridWidth"), o = this.config("height"), c = this.config("topPadding"), d = n === Ft.Right ? p.axisRight(r) : p.axisLeft(r);
|
|
389
473
|
this.config("showTicks") || d.tickSizeOuter(0);
|
|
390
474
|
const u = this.config("ticks");
|
|
391
475
|
if (u)
|
|
392
476
|
d.tickValues(u);
|
|
393
477
|
else if (o > 0) {
|
|
394
|
-
const x = Math.max(2, Math.floor(o /
|
|
478
|
+
const x = Math.max(2, Math.floor(o / ms));
|
|
395
479
|
d.ticks(x);
|
|
396
480
|
}
|
|
397
481
|
const g = this.config("tickFormat");
|
|
@@ -407,7 +491,7 @@ class si extends ht {
|
|
|
407
491
|
const y = s === We.Auto ? l > 0 && l < 400 ? We.Inside : We.Outside : s;
|
|
408
492
|
if (y === We.Inside) {
|
|
409
493
|
const x = b ? 4 : 0;
|
|
410
|
-
if (n ===
|
|
494
|
+
if (n === Ft.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 === Ft.Right ? -6 : 6) : e.selectAll(".tick line").remove(), c > 0 && b) {
|
|
411
495
|
const w = e.select(".domain");
|
|
412
496
|
if (!w.empty()) {
|
|
413
497
|
const $ = w.attr("d"), S = $.replace(/V[\d.]+/, `V${-c}`);
|
|
@@ -423,12 +507,12 @@ class si extends ht {
|
|
|
423
507
|
postDraw() {
|
|
424
508
|
const a = this.config("gridStyle"), e = this.config("gridWidth"), r = this.config("direction"), n = this.base.select(".bc-axis-vertical").node();
|
|
425
509
|
if (n && a !== at.None && e > 0) {
|
|
426
|
-
const s = r ===
|
|
427
|
-
|
|
510
|
+
const s = r === Ft.Right ? -e : e;
|
|
511
|
+
jl(n, a, s);
|
|
428
512
|
}
|
|
429
513
|
}
|
|
430
514
|
}
|
|
431
|
-
function
|
|
515
|
+
function jl(t, a, e) {
|
|
432
516
|
var o;
|
|
433
517
|
const r = ((o = t.ownerSVGElement) == null ? void 0 : o.parentElement) ?? document.documentElement, s = getComputedStyle(r).getPropertyValue("--bc-grid-color").trim() || "#ccc";
|
|
434
518
|
p.select(t).selectAll(".tick").each(function() {
|
|
@@ -436,8 +520,8 @@ function Wl(t, a, e) {
|
|
|
436
520
|
a === at.Dashed ? d.attr("stroke-dasharray", "4,4") : a === at.Dotted && d.attr("stroke-dasharray", "1,3");
|
|
437
521
|
});
|
|
438
522
|
}
|
|
439
|
-
function
|
|
440
|
-
const s = r.direction ??
|
|
523
|
+
function Iu(t, a, e, r = {}, n) {
|
|
524
|
+
const s = r.direction ?? Ft.Left, l = new li(p.select(t));
|
|
441
525
|
if (n) {
|
|
442
526
|
n.querySelectorAll(".bc-grid-line").forEach((d) => d.remove());
|
|
443
527
|
const c = t.lastElementChild;
|
|
@@ -458,17 +542,17 @@ function Eu(t, a, e, r = {}, n) {
|
|
|
458
542
|
tickFormat: r.tickFormat ?? null
|
|
459
543
|
}), l.draw([{ placeholder: !0 }]);
|
|
460
544
|
const o = t.querySelector(".bc-axis-vertical");
|
|
461
|
-
return o && s ===
|
|
545
|
+
return o && s === Ft.Right && o.setAttribute("transform", `translate(${r.gridWidth ?? 0},0)`), o;
|
|
462
546
|
}
|
|
463
|
-
function
|
|
547
|
+
function Kl(t) {
|
|
464
548
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
465
549
|
}
|
|
466
|
-
var wr = { exports: {} },
|
|
467
|
-
function
|
|
468
|
-
return
|
|
550
|
+
var wr = { exports: {} }, Zl = wr.exports, ys;
|
|
551
|
+
function Jl() {
|
|
552
|
+
return ys || (ys = 1, (function(t, a) {
|
|
469
553
|
(function(e, r) {
|
|
470
554
|
t.exports = r();
|
|
471
|
-
})(
|
|
555
|
+
})(Zl, (function() {
|
|
472
556
|
var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, s = /\d\d/, l = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, c = {}, d = function(x) {
|
|
473
557
|
return (x = +x) + (x > 68 ? 1900 : 2e3);
|
|
474
558
|
}, u = function(x) {
|
|
@@ -530,8 +614,8 @@ function Ul() {
|
|
|
530
614
|
return F || H.slice(1);
|
|
531
615
|
}));
|
|
532
616
|
}))).match(r), P = S.length, B = 0; B < P; B += 1) {
|
|
533
|
-
var I = S[B], X = v[I],
|
|
534
|
-
S[B] =
|
|
617
|
+
var I = S[B], X = v[I], V = X && X[0], G = X && X[1];
|
|
618
|
+
S[B] = G ? { regex: V, parser: G } : I.replace(/^\[|\]$/g, "");
|
|
535
619
|
}
|
|
536
620
|
return function(j) {
|
|
537
621
|
for (var _ = {}, ne = 0, ie = 0; ne < P; ne += 1) {
|
|
@@ -555,25 +639,25 @@ function Ul() {
|
|
|
555
639
|
$.p.customParseFormat = !0, x && x.parseTwoDigitYear && (d = x.parseTwoDigitYear);
|
|
556
640
|
var S = w.prototype, P = S.parse;
|
|
557
641
|
S.parse = function(B) {
|
|
558
|
-
var I = B.date, X = B.utc,
|
|
642
|
+
var I = B.date, X = B.utc, V = B.args;
|
|
559
643
|
this.$u = X;
|
|
560
|
-
var
|
|
561
|
-
if (typeof
|
|
562
|
-
var j =
|
|
563
|
-
_ && (ie =
|
|
644
|
+
var G = V[1];
|
|
645
|
+
if (typeof G == "string") {
|
|
646
|
+
var j = V[2] === !0, _ = V[3] === !0, ne = j || _, ie = V[2];
|
|
647
|
+
_ && (ie = V[2]), c = this.$locale(), !j && ie && (c = $.Ls[ie]), this.$d = (function(W, oe, le, $e) {
|
|
564
648
|
try {
|
|
565
649
|
if (["x", "X"].indexOf(oe) > -1) return new Date((oe === "X" ? 1e3 : 1) * W);
|
|
566
650
|
var se = y(oe)(W), Se = se.year, ye = se.month, we = se.day, be = se.hours, me = se.minutes, ce = se.seconds, Ie = se.milliseconds, ze = se.zone, Ne = se.week, Z = /* @__PURE__ */ new Date(), U = we || (Se || ye ? 1 : Z.getDate()), Ae = Se || Z.getFullYear(), Te = 0;
|
|
567
651
|
Se && !ye || (Te = ye > 0 ? ye - 1 : Z.getMonth());
|
|
568
|
-
var fe, Le = be || 0,
|
|
569
|
-
return ze ? new Date(Date.UTC(Ae, Te, U, Le,
|
|
652
|
+
var fe, Le = be || 0, Ve = me || 0, Ee = ce || 0, L = Ie || 0;
|
|
653
|
+
return ze ? new Date(Date.UTC(Ae, Te, U, Le, Ve, Ee, L + 60 * ze.offset * 1e3)) : le ? new Date(Date.UTC(Ae, Te, U, Le, Ve, Ee, L)) : (fe = new Date(Ae, Te, U, Le, Ve, Ee, L), Ne && (fe = $e(fe).week(Ne).toDate()), fe);
|
|
570
654
|
} catch {
|
|
571
655
|
return /* @__PURE__ */ new Date("");
|
|
572
656
|
}
|
|
573
|
-
})(I,
|
|
574
|
-
} else if (
|
|
575
|
-
|
|
576
|
-
var H = $.apply(this,
|
|
657
|
+
})(I, G, X, $), this.init(), ie && ie !== !0 && (this.$L = this.locale(ie).$L), ne && I != this.format(G) && (this.$d = /* @__PURE__ */ new Date("")), c = {};
|
|
658
|
+
} else if (G instanceof Array) for (var ae = G.length, F = 1; F <= ae; F += 1) {
|
|
659
|
+
V[1] = G[F - 1];
|
|
660
|
+
var H = $.apply(this, V);
|
|
577
661
|
if (H.isValid()) {
|
|
578
662
|
this.$d = H.$d, this.$L = H.$L, this.init();
|
|
579
663
|
break;
|
|
@@ -586,10 +670,10 @@ function Ul() {
|
|
|
586
670
|
}));
|
|
587
671
|
})(wr)), wr.exports;
|
|
588
672
|
}
|
|
589
|
-
var
|
|
590
|
-
const
|
|
591
|
-
Ya.extend(
|
|
592
|
-
const
|
|
673
|
+
var Ql = Jl();
|
|
674
|
+
const ec = /* @__PURE__ */ Kl(Ql);
|
|
675
|
+
Ya.extend(ec);
|
|
676
|
+
const ci = [
|
|
593
677
|
"YYYY-MM-DDTHH:mm:ss",
|
|
594
678
|
"YYYY-MM-DD HH:mm",
|
|
595
679
|
"YYYY-MM-DD",
|
|
@@ -607,10 +691,10 @@ const ii = [
|
|
|
607
691
|
"YYYY/MM",
|
|
608
692
|
"YYYY"
|
|
609
693
|
];
|
|
610
|
-
function
|
|
694
|
+
function tc(t) {
|
|
611
695
|
return t.includes("HH") || t.includes("mm") || t.includes("ss") ? "datetime" : t.includes("DD") || new RegExp("(?<![MA-Z])D(?!D)").test(t) ? "day" : t === "YYYY" ? "year" : t.includes("MM") || t.includes("MMM") || t.includes("MMMM") || t.includes("M/") ? "month" : "day";
|
|
612
696
|
}
|
|
613
|
-
function
|
|
697
|
+
function Mr(t) {
|
|
614
698
|
return new Date(Date.UTC(
|
|
615
699
|
t.year(),
|
|
616
700
|
t.month(),
|
|
@@ -621,28 +705,28 @@ function Cr(t) {
|
|
|
621
705
|
t.millisecond()
|
|
622
706
|
));
|
|
623
707
|
}
|
|
624
|
-
function
|
|
708
|
+
function ac(t) {
|
|
625
709
|
const a = t.trim();
|
|
626
710
|
if (!a)
|
|
627
711
|
return null;
|
|
628
712
|
if (/^\d{4}$/.test(a)) {
|
|
629
713
|
const e = Ya(a, "YYYY", !0);
|
|
630
|
-
return e.isValid() ?
|
|
714
|
+
return e.isValid() ? Mr(e) : null;
|
|
631
715
|
}
|
|
632
|
-
for (const e of
|
|
716
|
+
for (const e of ci) {
|
|
633
717
|
if (e === "YYYY")
|
|
634
718
|
continue;
|
|
635
719
|
const r = Ya(a, e, !0);
|
|
636
720
|
if (r.isValid())
|
|
637
|
-
return
|
|
721
|
+
return Mr(r);
|
|
638
722
|
}
|
|
639
723
|
return null;
|
|
640
724
|
}
|
|
641
|
-
function
|
|
725
|
+
function sr(t) {
|
|
642
726
|
const a = t.trim();
|
|
643
727
|
if (!a)
|
|
644
728
|
return;
|
|
645
|
-
const e =
|
|
729
|
+
const e = ac(a);
|
|
646
730
|
if (e)
|
|
647
731
|
return e.getTime();
|
|
648
732
|
const r = parseFloat(a);
|
|
@@ -665,12 +749,12 @@ function Pr(t) {
|
|
|
665
749
|
const o = Ya(l, "YYYY", !0);
|
|
666
750
|
if (!o.isValid())
|
|
667
751
|
return null;
|
|
668
|
-
a.push(
|
|
752
|
+
a.push(Mr(o));
|
|
669
753
|
}
|
|
670
754
|
return { dates: a, granularity: "year" };
|
|
671
755
|
}
|
|
672
756
|
const n = [];
|
|
673
|
-
for (const s of
|
|
757
|
+
for (const s of ci)
|
|
674
758
|
s !== "YYYY" && Ya(r, s, !0).isValid() && n.push(s);
|
|
675
759
|
if (n.length === 0)
|
|
676
760
|
return null;
|
|
@@ -683,17 +767,17 @@ function Pr(t) {
|
|
|
683
767
|
o = !1;
|
|
684
768
|
break;
|
|
685
769
|
}
|
|
686
|
-
l.push(
|
|
770
|
+
l.push(Mr(d));
|
|
687
771
|
}
|
|
688
772
|
if (o) {
|
|
689
773
|
e = s, a.push(...l);
|
|
690
774
|
break;
|
|
691
775
|
}
|
|
692
776
|
}
|
|
693
|
-
return e ? { dates: a, granularity:
|
|
777
|
+
return e ? { dates: a, granularity: tc(e) } : null;
|
|
694
778
|
}
|
|
695
|
-
const
|
|
696
|
-
function
|
|
779
|
+
const rc = 60, rr = 10, mn = 1.3, nc = 12, sc = 3, ic = 14, oc = 10;
|
|
780
|
+
function lc(t, a, e = sc) {
|
|
697
781
|
if (t === "")
|
|
698
782
|
return [""];
|
|
699
783
|
if (t.length * rr <= a)
|
|
@@ -714,16 +798,16 @@ function nc(t, a, e = tc) {
|
|
|
714
798
|
}
|
|
715
799
|
return s && n.push(s), n.length > e ? null : n;
|
|
716
800
|
}
|
|
717
|
-
const
|
|
801
|
+
const cc = {
|
|
718
802
|
year: "%Y",
|
|
719
803
|
month: "%b %Y",
|
|
720
804
|
day: "%b %-d, %Y",
|
|
721
805
|
datetime: "%b %-d, %Y %H:%M"
|
|
722
806
|
};
|
|
723
|
-
function
|
|
807
|
+
function fi(t) {
|
|
724
808
|
return typeof t.step == "function";
|
|
725
809
|
}
|
|
726
|
-
function
|
|
810
|
+
function di(t, a) {
|
|
727
811
|
const e = Pr(a);
|
|
728
812
|
if (t && t.includes("%")) {
|
|
729
813
|
if (e) {
|
|
@@ -740,7 +824,7 @@ function li(t, a) {
|
|
|
740
824
|
if (t)
|
|
741
825
|
return va(t) ?? p.format(t);
|
|
742
826
|
if (e) {
|
|
743
|
-
const r = p.timeFormat(
|
|
827
|
+
const r = p.timeFormat(cc[e.granularity] ?? "%Y-%m-%d"), n = /* @__PURE__ */ new Map();
|
|
744
828
|
return a.forEach((s, l) => n.set(s, e.dates[l])), (s) => {
|
|
745
829
|
if (s instanceof Date)
|
|
746
830
|
return r(s);
|
|
@@ -758,7 +842,7 @@ function ir(t, a) {
|
|
|
758
842
|
}
|
|
759
843
|
return e;
|
|
760
844
|
}
|
|
761
|
-
function
|
|
845
|
+
function fc(t, a, e) {
|
|
762
846
|
if (t.length <= 1)
|
|
763
847
|
return t;
|
|
764
848
|
const r = e ? ir(t, e) : t.reduce((d, u) => Math.max(d, u.length), 0) * rr, n = Math.max(16, Math.ceil(r) + 8), s = Math.max(2, Math.floor(a / n));
|
|
@@ -767,7 +851,7 @@ function ic(t, a, e) {
|
|
|
767
851
|
const l = Math.ceil(t.length / s), o = t.filter((d, u) => u % l === 0), c = t[t.length - 1];
|
|
768
852
|
return o[o.length - 1] !== c && o.push(c), o;
|
|
769
853
|
}
|
|
770
|
-
function
|
|
854
|
+
function dc(t, a, e, r) {
|
|
771
855
|
if (t.length <= 1 || a <= 0 || e === "horizontal")
|
|
772
856
|
return !1;
|
|
773
857
|
if (e === "vertical")
|
|
@@ -775,51 +859,51 @@ function oc(t, a, e, r) {
|
|
|
775
859
|
if (Pr(t))
|
|
776
860
|
return !1;
|
|
777
861
|
const n = ir(t, r ?? null), s = a / t.length;
|
|
778
|
-
return n > s *
|
|
862
|
+
return n > s * mn;
|
|
779
863
|
}
|
|
780
|
-
function
|
|
864
|
+
function uc(t, a) {
|
|
781
865
|
if (t.length === 0)
|
|
782
866
|
return 0;
|
|
783
867
|
const e = ir(t, a ?? null);
|
|
784
|
-
return Math.ceil(e) +
|
|
868
|
+
return Math.ceil(e) + nc;
|
|
785
869
|
}
|
|
786
|
-
function
|
|
870
|
+
function hc(t) {
|
|
787
871
|
let a = 1;
|
|
788
872
|
for (const e of t)
|
|
789
873
|
e.length > a && (a = e.length);
|
|
790
|
-
return a <= 1 ? 0 : a *
|
|
874
|
+
return a <= 1 ? 0 : a * ic + oc;
|
|
791
875
|
}
|
|
792
|
-
function
|
|
876
|
+
function yn(t, a, e = {}, r = 24) {
|
|
793
877
|
if (t.length === 0 || a <= 0 || e.labelPosition === "off" || e.labelPosition === "inside")
|
|
794
878
|
return;
|
|
795
|
-
const n = e.tickFormat ? e.tickFormat :
|
|
879
|
+
const n = e.tickFormat ? e.tickFormat : di(e.numberFormat ?? null, t), s = e.labelRotation ?? "auto";
|
|
796
880
|
if (!(s !== "vertical" && Pr(t) !== null) && t.length > 1) {
|
|
797
|
-
const u = a / t.length *
|
|
881
|
+
const u = a / t.length * mn, b = ir(t, n) > u;
|
|
798
882
|
if (s !== "vertical" && b) {
|
|
799
|
-
const m =
|
|
883
|
+
const m = ui(t, u, n);
|
|
800
884
|
if (m) {
|
|
801
|
-
const v =
|
|
885
|
+
const v = hc(Array.from(m.values()));
|
|
802
886
|
return v > r ? v : void 0;
|
|
803
887
|
}
|
|
804
888
|
}
|
|
805
889
|
}
|
|
806
|
-
if (!
|
|
890
|
+
if (!dc(t, a, s, n))
|
|
807
891
|
return;
|
|
808
|
-
const c =
|
|
892
|
+
const c = uc(t, n);
|
|
809
893
|
return c > r ? c : void 0;
|
|
810
894
|
}
|
|
811
|
-
function
|
|
895
|
+
function ui(t, a, e) {
|
|
812
896
|
const r = /* @__PURE__ */ new Map();
|
|
813
897
|
let n = !1;
|
|
814
898
|
for (const s of t) {
|
|
815
|
-
const l = e ? e(s) : s, o =
|
|
899
|
+
const l = e ? e(s) : s, o = lc(l, a);
|
|
816
900
|
if (o === null)
|
|
817
901
|
return null;
|
|
818
902
|
r.set(s, o), o.length > 1 && (n = !0);
|
|
819
903
|
}
|
|
820
904
|
return n ? r : null;
|
|
821
905
|
}
|
|
822
|
-
function
|
|
906
|
+
function gc(t, a) {
|
|
823
907
|
t.selectAll(".tick").each(function() {
|
|
824
908
|
const e = p.select(this), r = e.datum(), n = r instanceof Date ? r.toISOString() : String(r), s = a.get(n);
|
|
825
909
|
if (!s || s.length <= 1)
|
|
@@ -830,7 +914,7 @@ function fc(t, a) {
|
|
|
830
914
|
}));
|
|
831
915
|
});
|
|
832
916
|
}
|
|
833
|
-
class
|
|
917
|
+
class hi extends ht {
|
|
834
918
|
initialize() {
|
|
835
919
|
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 });
|
|
836
920
|
const a = this.base.append("g");
|
|
@@ -857,23 +941,23 @@ class fi extends ht {
|
|
|
857
941
|
applyAxis(a, e) {
|
|
858
942
|
const r = this.config("scale"), n = this.config("scale"), s = this.config("tickPosition"), l = this.config("height"), o = this.config("labelPosition"), c = this.config("labelRotation"), d = this.config("width"), u = this.config("numberFormat"), g = this.config("labels"), b = this.config("tickFormat"), m = s === "above" ? p.axisTop(r) : p.axisBottom(r);
|
|
859
943
|
this.config("showTicks") || m.tickSizeOuter(0);
|
|
860
|
-
const v = b ||
|
|
944
|
+
const v = b || di(u, g);
|
|
861
945
|
v && m.tickFormat(v);
|
|
862
|
-
const y =
|
|
946
|
+
const y = fi(n), x = y ? n.domain() : [], w = y && c !== "vertical" && Pr(x) !== null;
|
|
863
947
|
let $ = null, S = !1;
|
|
864
948
|
if (y && !w && x.length > 1 && d > 0) {
|
|
865
|
-
const _ = d / x.length *
|
|
866
|
-
c === "vertical" ? S = !0 : ie && ($ =
|
|
949
|
+
const _ = d / x.length * mn, ie = ir(x, v) > _;
|
|
950
|
+
c === "vertical" ? S = !0 : ie && ($ = ui(x, _, v), !$ && c === "auto" && (S = !0));
|
|
867
951
|
}
|
|
868
952
|
let P = this.config("ticks");
|
|
869
953
|
if (!P && d > 0)
|
|
870
954
|
if (y) {
|
|
871
955
|
if (w) {
|
|
872
|
-
const j =
|
|
956
|
+
const j = fc(x, d, v);
|
|
873
957
|
j.length < x.length && (P = j);
|
|
874
958
|
}
|
|
875
959
|
} else {
|
|
876
|
-
const j = Math.max(2, Math.floor(d /
|
|
960
|
+
const j = Math.max(2, Math.floor(d / rc));
|
|
877
961
|
m.ticks(j);
|
|
878
962
|
}
|
|
879
963
|
P && m.tickValues(P);
|
|
@@ -884,26 +968,26 @@ class fi extends ht {
|
|
|
884
968
|
X > 0 ? (a.attr("transform", `translate(0,${B})`), a.duration(X).call(m)) : p.select(I).attr("transform", `translate(0,${B})`).call(m);
|
|
885
969
|
} else
|
|
886
970
|
a.attr("transform", `translate(0,${B})`), a.call(m);
|
|
887
|
-
const
|
|
971
|
+
const V = X > 0 ? a : I ? p.select(I) : a;
|
|
888
972
|
if (!this.config("showAxis"))
|
|
889
|
-
|
|
973
|
+
V.select(".domain").remove();
|
|
890
974
|
else if (e === "enter") {
|
|
891
975
|
const j = this.config("zeroY");
|
|
892
976
|
if (j != null) {
|
|
893
977
|
const _ = j - (s === "above" ? 0 : l);
|
|
894
|
-
|
|
978
|
+
V.select(".domain").attr("transform", `translate(0,${_})`);
|
|
895
979
|
}
|
|
896
980
|
}
|
|
897
|
-
this.config("showTicks") ||
|
|
898
|
-
const
|
|
899
|
-
|
|
981
|
+
this.config("showTicks") || V.selectAll(".tick line").remove();
|
|
982
|
+
const G = o === "auto" ? "outside" : o;
|
|
983
|
+
G === "off" ? V.selectAll(".tick text").remove() : G === "inside" && V.selectAll(".tick text").attr("y", 0).attr("dy", "-0.6em"), S && G !== "off" ? V.selectAll(".tick text").attr("transform", "rotate(-90)").attr("text-anchor", "end").attr("x", s === "above" ? 9 : -9).attr("y", 0).attr("dy", "0.32em") : V.selectAll(".tick text").attr("transform", null), $ && G !== "off" && gc(V, $);
|
|
900
984
|
}
|
|
901
985
|
postDraw() {
|
|
902
986
|
const a = this.config("gridStyle"), e = this.config("height"), r = this.base.select(".bc-axis-horizontal").node();
|
|
903
|
-
r && a !== "none" && e > 0 &&
|
|
987
|
+
r && a !== "none" && e > 0 && pc(r, a, e);
|
|
904
988
|
}
|
|
905
989
|
}
|
|
906
|
-
function
|
|
990
|
+
function pc(t, a, e) {
|
|
907
991
|
var o;
|
|
908
992
|
const r = ((o = t.ownerSVGElement) == null ? void 0 : o.parentElement) ?? document.documentElement, s = getComputedStyle(r).getPropertyValue("--bc-grid-color").trim() || "#ccc";
|
|
909
993
|
p.select(t).selectAll(".tick").each(function() {
|
|
@@ -911,14 +995,14 @@ function dc(t, a, e) {
|
|
|
911
995
|
a === "dashed" ? d.attr("stroke-dasharray", "4,4") : a === "dotted" && d.attr("stroke-dasharray", "1,3");
|
|
912
996
|
});
|
|
913
997
|
}
|
|
914
|
-
function
|
|
915
|
-
const s = new
|
|
998
|
+
function Bu(t, a, e, r = {}, n) {
|
|
999
|
+
const s = new hi(p.select(t));
|
|
916
1000
|
if (n) {
|
|
917
1001
|
n.querySelectorAll(".bc-grid-line").forEach((c) => c.remove());
|
|
918
1002
|
const o = t.lastElementChild;
|
|
919
1003
|
o && o.appendChild(n);
|
|
920
1004
|
}
|
|
921
|
-
const l =
|
|
1005
|
+
const l = fi(a) ? a.domain() : [];
|
|
922
1006
|
return s.config({
|
|
923
1007
|
scale: a,
|
|
924
1008
|
height: e,
|
|
@@ -936,7 +1020,7 @@ function Nu(t, a, e, r = {}, n) {
|
|
|
936
1020
|
tickFormat: r.tickFormat ?? null
|
|
937
1021
|
}), s.draw([{ placeholder: !0 }]), t.querySelector(".bc-axis-horizontal");
|
|
938
1022
|
}
|
|
939
|
-
const
|
|
1023
|
+
const gi = [
|
|
940
1024
|
"#4e79a7",
|
|
941
1025
|
"#f28e2b",
|
|
942
1026
|
"#e15759",
|
|
@@ -945,10 +1029,10 @@ const di = [
|
|
|
945
1029
|
"#edc948",
|
|
946
1030
|
"#b07aa1",
|
|
947
1031
|
"#ff9da7"
|
|
948
|
-
],
|
|
949
|
-
class
|
|
1032
|
+
], bc = 200, vs = 0.2;
|
|
1033
|
+
class mc extends ht {
|
|
950
1034
|
initialize() {
|
|
951
|
-
this.configDefine("colors", { defaultValue:
|
|
1035
|
+
this.configDefine("colors", { defaultValue: gi }), this.configDefine("yOffset", { defaultValue: -10 }), this.configDefine("layout", { defaultValue: "horizontal" }), this.configDefine("valueSuffixes", { defaultValue: [] }), this.configDefine("maxWidth", { defaultValue: 0 });
|
|
952
1036
|
const a = this.base.append("g").attr("class", "bc-legend"), e = (r) => {
|
|
953
1037
|
var b, m;
|
|
954
1038
|
const n = this.config("colors"), s = this.config("layout"), l = this.config("valueSuffixes"), o = ((m = (b = this.base.node()) == null ? void 0 : b.ownerSVGElement) == null ? void 0 : m.parentElement) ?? document.documentElement, c = getComputedStyle(o).getPropertyValue("--bc-text-color").trim() || "#555", d = this.config("maxWidth");
|
|
@@ -979,7 +1063,7 @@ class hc extends ht {
|
|
|
979
1063
|
this.base.select(".bc-legend").attr("transform", `translate(0,${a})`);
|
|
980
1064
|
}
|
|
981
1065
|
}
|
|
982
|
-
function
|
|
1066
|
+
function yc(t) {
|
|
983
1067
|
const a = p.select(t).selectAll(".bc-legend-item");
|
|
984
1068
|
if (a.empty())
|
|
985
1069
|
return;
|
|
@@ -987,12 +1071,12 @@ function gc(t) {
|
|
|
987
1071
|
function n(l) {
|
|
988
1072
|
r = l, a.each(function() {
|
|
989
1073
|
const c = p.select(this), d = c.attr("data-series") === l;
|
|
990
|
-
c.transition().duration(150).style("opacity", d ? 1 :
|
|
1074
|
+
c.transition().duration(150).style("opacity", d ? 1 : vs);
|
|
991
1075
|
}), p.select(t).selectAll("[data-series]").filter(function() {
|
|
992
1076
|
return !this.closest(".bc-legend");
|
|
993
1077
|
}).each(function() {
|
|
994
1078
|
const c = p.select(this), d = c.attr("data-series") === l, u = this.classList.contains("bc-direct-label") || this.classList.contains("bc-value-label");
|
|
995
|
-
c.transition().duration(150).style("opacity", d ? 1 : u ? 0 :
|
|
1079
|
+
c.transition().duration(150).style("opacity", d ? 1 : u ? 0 : vs);
|
|
996
1080
|
});
|
|
997
1081
|
}
|
|
998
1082
|
function s() {
|
|
@@ -1002,13 +1086,13 @@ function gc(t) {
|
|
|
1002
1086
|
}
|
|
1003
1087
|
a.on("mouseenter.bcHighlight", null).on("mouseleave.bcHighlight", null).on("mouseenter.bcHighlight", function() {
|
|
1004
1088
|
const l = p.select(this).attr("data-series") ?? "";
|
|
1005
|
-
e && clearTimeout(e), e = setTimeout(() => n(l), Oa(
|
|
1089
|
+
e && clearTimeout(e), e = setTimeout(() => n(l), Oa(bc));
|
|
1006
1090
|
}).on("mouseleave.bcHighlight", () => {
|
|
1007
1091
|
e && (clearTimeout(e), e = null), r !== null && s();
|
|
1008
1092
|
});
|
|
1009
1093
|
}
|
|
1010
|
-
function Aa(t, a, e =
|
|
1011
|
-
const g = n === "left" || n === "right" ? "vertical" : "horizontal", b = new
|
|
1094
|
+
function Aa(t, a, e = gi, r = -10, n = "top", s = "start", l = 0, o = 0, c = 0, d = [], u = {}) {
|
|
1095
|
+
const g = n === "left" || n === "right" ? "vertical" : "horizontal", b = new mc(p.select(t));
|
|
1012
1096
|
b.config({ colors: e, yOffset: r, layout: g, valueSuffixes: d, maxWidth: l }), b.draw(a);
|
|
1013
1097
|
const m = t.querySelector(".bc-legend");
|
|
1014
1098
|
if (m) {
|
|
@@ -1018,20 +1102,20 @@ function Aa(t, a, e = di, r = -10, n = "top", s = "start", l = 0, o = 0, c = 0,
|
|
|
1018
1102
|
return X ? B.length + 1 + X.length : B.length;
|
|
1019
1103
|
});
|
|
1020
1104
|
if (g === "horizontal") {
|
|
1021
|
-
const B = x.map((
|
|
1022
|
-
let I = 1, X = 0,
|
|
1023
|
-
for (const
|
|
1024
|
-
l > 0 && X > 0 && X +
|
|
1025
|
-
|
|
1105
|
+
const B = x.map((G) => 16 + G * 7 + 12);
|
|
1106
|
+
let I = 1, X = 0, V = 0;
|
|
1107
|
+
for (const G of B)
|
|
1108
|
+
l > 0 && X > 0 && X + G > l ? (V = Math.max(V, X), I++, X = G) : X += G;
|
|
1109
|
+
V = Math.max(V, X), v = V, y = I * 20;
|
|
1026
1110
|
} else
|
|
1027
1111
|
v = Math.max(...x) * 7 + 16 + 8, y = a.length * 20;
|
|
1028
1112
|
const w = u.left ?? 0, $ = u.right ?? 0;
|
|
1029
1113
|
let S = c, P = r;
|
|
1030
1114
|
g === "horizontal" ? s === "middle" ? S += -w + (l + w + $ - v) / 2 : s === "end" ? S += l + $ - v : S += -w : s === "middle" ? P += (o - y) / 2 : s === "end" && (P += o - y), m.setAttribute("transform", `translate(${S},${P})`);
|
|
1031
1115
|
}
|
|
1032
|
-
return
|
|
1116
|
+
return yc(t), m;
|
|
1033
1117
|
}
|
|
1034
|
-
const
|
|
1118
|
+
const pi = [
|
|
1035
1119
|
{ name: "Blueprint", label: "Blueprint", colors: ["#2563A0", "#D4A63A", "#C94044", "#2D8659", "#4B90CF", "#163A65"] },
|
|
1036
1120
|
{ name: "JosefAlbers", label: "Albers", colors: ["#c00559", "#de1f6c", "#f3a20d", "#f07a13", "#de6716"] },
|
|
1037
1121
|
{ name: "Durorthod", label: "Amber", colors: ["#2c0c00", "#803c15", "#c6782c", "#ffa91d", "#fff3ad"] },
|
|
@@ -1083,24 +1167,24 @@ const ui = [
|
|
|
1083
1167
|
{ name: "Wizards", label: "Wizards", colors: ["#c8102e", "#0c2340", "#8d9093", "#c8c9c7"] },
|
|
1084
1168
|
{ name: "FrancescoXanto", label: "Xanto", colors: ["#2c6aa5", "#d9ae2c", "#ddc655", "#d88c27", "#64894d"] },
|
|
1085
1169
|
{ name: "Zeppelin", label: "Zeppelin", colors: ["#efdb15", "#739c9c", "#0d484c", "#c71a08"] }
|
|
1086
|
-
],
|
|
1087
|
-
|
|
1170
|
+
], vc = Object.fromEntries(
|
|
1171
|
+
pi.map((t) => [t.name, t.colors])
|
|
1088
1172
|
);
|
|
1089
|
-
function
|
|
1173
|
+
function xc(t) {
|
|
1090
1174
|
if (!t)
|
|
1091
1175
|
return;
|
|
1092
|
-
const a =
|
|
1176
|
+
const a = vc[t];
|
|
1093
1177
|
return a ? [...a] : void 0;
|
|
1094
1178
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return
|
|
1179
|
+
function Ac() {
|
|
1180
|
+
return pi;
|
|
1097
1181
|
}
|
|
1098
1182
|
function zr(t, a) {
|
|
1099
1183
|
if (!a || a.min === void 0 && a.max === void 0)
|
|
1100
1184
|
return t.map((r, n) => n);
|
|
1101
1185
|
const e = [];
|
|
1102
1186
|
for (let r = 0; r < t.length; r++) {
|
|
1103
|
-
const n =
|
|
1187
|
+
const n = sr(t[r]);
|
|
1104
1188
|
if (n === void 0) {
|
|
1105
1189
|
e.push(r);
|
|
1106
1190
|
continue;
|
|
@@ -1129,7 +1213,7 @@ function qa(t, a, e) {
|
|
|
1129
1213
|
}
|
|
1130
1214
|
return [c, d];
|
|
1131
1215
|
}
|
|
1132
|
-
function
|
|
1216
|
+
function wc(t) {
|
|
1133
1217
|
return typeof t.step == "function";
|
|
1134
1218
|
}
|
|
1135
1219
|
const br = /* @__PURE__ */ new WeakMap();
|
|
@@ -1174,7 +1258,7 @@ class Rt {
|
|
|
1174
1258
|
*/
|
|
1175
1259
|
attach(a, e) {
|
|
1176
1260
|
if (!this.initialized)
|
|
1177
|
-
this.vGroup = document.createElementNS("http://www.w3.org/2000/svg", "g"), this.vGroup.setAttribute("class", "bc-axis-service-v"), this.hGroup = document.createElementNS("http://www.w3.org/2000/svg", "g"), this.hGroup.setAttribute("class", "bc-axis-service-h"), a.appendChild(this.vGroup), a.appendChild(this.hGroup), this.vChart = new
|
|
1261
|
+
this.vGroup = document.createElementNS("http://www.w3.org/2000/svg", "g"), this.vGroup.setAttribute("class", "bc-axis-service-v"), this.hGroup = document.createElementNS("http://www.w3.org/2000/svg", "g"), this.hGroup.setAttribute("class", "bc-axis-service-h"), a.appendChild(this.vGroup), a.appendChild(this.hGroup), this.vChart = new li(p.select(this.vGroup)), this.hChart = new hi(p.select(this.hGroup)), this.initialized = !0;
|
|
1178
1262
|
else {
|
|
1179
1263
|
for (const n of [this.vGroup, this.hGroup])
|
|
1180
1264
|
p.select(n).selectAll(".tick").interrupt();
|
|
@@ -1234,7 +1318,7 @@ class Rt {
|
|
|
1234
1318
|
return;
|
|
1235
1319
|
}
|
|
1236
1320
|
this.hGroup.style.display = "";
|
|
1237
|
-
const e = a.options, r = a.scale, n =
|
|
1321
|
+
const e = a.options, r = a.scale, n = wc(r) ? r.domain() : [];
|
|
1238
1322
|
this.hChart.config({
|
|
1239
1323
|
scale: r,
|
|
1240
1324
|
height: a.height,
|
|
@@ -1259,13 +1343,13 @@ class Rt {
|
|
|
1259
1343
|
this.detach(), this.vChart = null, this.hChart = null, this.vGroup = null, this.hGroup = null, this.initialized = !1, br.delete(this.container);
|
|
1260
1344
|
}
|
|
1261
1345
|
}
|
|
1262
|
-
const
|
|
1263
|
-
function
|
|
1346
|
+
const bi = "bc-tooltip";
|
|
1347
|
+
function Sc() {
|
|
1264
1348
|
if (document.getElementById("bc-tooltip-styles"))
|
|
1265
1349
|
return;
|
|
1266
1350
|
const t = document.createElement("style");
|
|
1267
1351
|
t.id = "bc-tooltip-styles", t.textContent = `
|
|
1268
|
-
.${
|
|
1352
|
+
.${bi} {
|
|
1269
1353
|
position: absolute;
|
|
1270
1354
|
pointer-events: none;
|
|
1271
1355
|
background: var(--bs-body-bg, #fff);
|
|
@@ -1280,7 +1364,7 @@ function vc() {
|
|
|
1280
1364
|
}
|
|
1281
1365
|
`, document.head.appendChild(t);
|
|
1282
1366
|
}
|
|
1283
|
-
function
|
|
1367
|
+
function kc(t) {
|
|
1284
1368
|
const a = t ? va(t) : null, e = (r) => typeof r == "number" && a ? a(r) : String(r);
|
|
1285
1369
|
return (r) => {
|
|
1286
1370
|
if (r && typeof r == "object") {
|
|
@@ -1298,13 +1382,13 @@ function xc(t) {
|
|
|
1298
1382
|
};
|
|
1299
1383
|
}
|
|
1300
1384
|
function wa(t) {
|
|
1301
|
-
const a = (t == null ? void 0 : t.format) ??
|
|
1385
|
+
const a = (t == null ? void 0 : t.format) ?? kc(t == null ? void 0 : t.numberFormat);
|
|
1302
1386
|
let e = null;
|
|
1303
1387
|
const r = [];
|
|
1304
1388
|
return {
|
|
1305
1389
|
name: "tooltip",
|
|
1306
1390
|
install() {
|
|
1307
|
-
|
|
1391
|
+
Sc(), e = document.createElement("div"), e.className = bi, document.body.appendChild(e);
|
|
1308
1392
|
},
|
|
1309
1393
|
postDraw(n) {
|
|
1310
1394
|
n.base.selectAll(".bc-bar, .bc-dot, .bc-arc").each(function() {
|
|
@@ -1333,7 +1417,7 @@ function wa(t) {
|
|
|
1333
1417
|
}
|
|
1334
1418
|
};
|
|
1335
1419
|
}
|
|
1336
|
-
function
|
|
1420
|
+
function Lc(t) {
|
|
1337
1421
|
switch (t) {
|
|
1338
1422
|
case ea.Solid:
|
|
1339
1423
|
return "none";
|
|
@@ -1345,7 +1429,7 @@ function Ac(t) {
|
|
|
1345
1429
|
}
|
|
1346
1430
|
}
|
|
1347
1431
|
function Pa(t) {
|
|
1348
|
-
const a = (t == null ? void 0 : t.color) ?? "#999", e = (t == null ? void 0 : t.dashArray) ??
|
|
1432
|
+
const a = (t == null ? void 0 : t.color) ?? "#999", e = (t == null ? void 0 : t.dashArray) ?? Lc(t == null ? void 0 : t.style), r = (t == null ? void 0 : t.direction) ?? yt.Both, n = (t == null ? void 0 : t.orientation) ?? ct.Vertical, s = [];
|
|
1349
1433
|
return {
|
|
1350
1434
|
name: "crosshair",
|
|
1351
1435
|
install() {
|
|
@@ -1359,8 +1443,8 @@ function Pa(t) {
|
|
|
1359
1443
|
if (y.tagName === "circle")
|
|
1360
1444
|
S = parseFloat($.attr("cx")), P = parseFloat($.attr("cy"));
|
|
1361
1445
|
else {
|
|
1362
|
-
const B = parseFloat($.attr("x")), I = parseFloat($.attr("width")), X = parseFloat($.attr("y")),
|
|
1363
|
-
n === ct.Horizontal ? (S = B + I, P = X +
|
|
1446
|
+
const B = parseFloat($.attr("x")), I = parseFloat($.attr("width")), X = parseFloat($.attr("y")), V = parseFloat($.attr("height"));
|
|
1447
|
+
n === ct.Horizontal ? (S = B + I, P = X + V / 2) : (S = B + I / 2, P = X);
|
|
1364
1448
|
}
|
|
1365
1449
|
b && b.attr("x1", S).attr("x2", S).style("display", null), m && m.attr("y1", P).attr("y2", P).style("display", null);
|
|
1366
1450
|
}, w = () => {
|
|
@@ -1378,7 +1462,7 @@ function Pa(t) {
|
|
|
1378
1462
|
}
|
|
1379
1463
|
};
|
|
1380
1464
|
}
|
|
1381
|
-
function
|
|
1465
|
+
function vn(t) {
|
|
1382
1466
|
const a = t.querySelector(".bc-annotation-line");
|
|
1383
1467
|
if (!(!a || !a.hasAttribute("data-line-style")))
|
|
1384
1468
|
return {
|
|
@@ -1390,10 +1474,10 @@ function yn(t) {
|
|
|
1390
1474
|
departVertical: a.getAttribute("data-line-depart-vertical") === "true"
|
|
1391
1475
|
};
|
|
1392
1476
|
}
|
|
1393
|
-
function
|
|
1477
|
+
function zt(t) {
|
|
1394
1478
|
const a = /* @__PURE__ */ new Map(), e = t.querySelectorAll("g[data-annotation-id]");
|
|
1395
1479
|
for (const r of e) {
|
|
1396
|
-
const n = r.getAttribute("data-annotation-id"), s =
|
|
1480
|
+
const n = r.getAttribute("data-annotation-id"), s = vn(r);
|
|
1397
1481
|
try {
|
|
1398
1482
|
const l = r.getBBox();
|
|
1399
1483
|
a.set(n, { id: n, element: r, rect: { x: l.x, y: l.y, width: l.width, height: l.height }, line: s });
|
|
@@ -1413,7 +1497,7 @@ const xa = {
|
|
|
1413
1497
|
W: { dx: -1, dy: 0 },
|
|
1414
1498
|
NW: { dx: -0.707, dy: -0.707 },
|
|
1415
1499
|
center: { dx: 0, dy: 0 }
|
|
1416
|
-
},
|
|
1500
|
+
}, xs = {
|
|
1417
1501
|
N: { nx: 0, ny: -1 },
|
|
1418
1502
|
NE: { nx: 1, ny: -1 },
|
|
1419
1503
|
E: { nx: 1, ny: 0 },
|
|
@@ -1425,42 +1509,42 @@ const xa = {
|
|
|
1425
1509
|
center: { nx: 0, ny: 0 }
|
|
1426
1510
|
};
|
|
1427
1511
|
tt.N + "", tt.W, tt.NE + "", tt.NW, tt.E + "", tt.N, tt.SE + "", tt.NE, tt.S + "", tt.E, tt.SW + "", tt.SE, tt.W + "", tt.S, tt.NW + "", tt.SW, tt.Center + "", tt.Center;
|
|
1428
|
-
function
|
|
1512
|
+
function $c(t, a) {
|
|
1429
1513
|
const e = xa[t] ?? xa.NW;
|
|
1430
1514
|
return { dx: e.dx * a, dy: e.dy * a };
|
|
1431
1515
|
}
|
|
1432
|
-
function
|
|
1516
|
+
function xn(t) {
|
|
1433
1517
|
return "step" in t && !("bandwidth" in t);
|
|
1434
1518
|
}
|
|
1435
|
-
function
|
|
1436
|
-
if ("bandwidth" in t ||
|
|
1519
|
+
function mi(t) {
|
|
1520
|
+
if ("bandwidth" in t || xn(t))
|
|
1437
1521
|
return !1;
|
|
1438
1522
|
const a = t.domain();
|
|
1439
1523
|
return a.length > 0 && a[0] instanceof Date;
|
|
1440
1524
|
}
|
|
1441
|
-
function
|
|
1525
|
+
function yi(t, a) {
|
|
1442
1526
|
if ("bandwidth" in t) {
|
|
1443
1527
|
const e = t;
|
|
1444
1528
|
return (e(a) ?? 0) + e.bandwidth() / 2;
|
|
1445
1529
|
}
|
|
1446
|
-
return
|
|
1530
|
+
return xn(t) ? t(a) ?? 0 : mi(t) ? t(new Date(a)) : t(Number(a));
|
|
1447
1531
|
}
|
|
1448
|
-
function
|
|
1449
|
-
const e = (a.left + a.right) / 2, r = (a.top + a.bottom) / 2, n =
|
|
1532
|
+
function As(t, a) {
|
|
1533
|
+
const e = (a.left + a.right) / 2, r = (a.top + a.bottom) / 2, n = xs[t] ?? xs.N;
|
|
1450
1534
|
return {
|
|
1451
1535
|
x: e + n.nx * (a.right - a.left) / 2,
|
|
1452
1536
|
y: r + n.ny * (a.bottom - a.top) / 2
|
|
1453
1537
|
};
|
|
1454
1538
|
}
|
|
1455
|
-
function
|
|
1539
|
+
function Cc(t, a, e, r, n) {
|
|
1456
1540
|
if ("bandwidth" in a) {
|
|
1457
1541
|
const d = a, u = d(t.label) ?? 0, g = d.bandwidth(), b = e(t.value), m = e(0);
|
|
1458
|
-
return n === "horizontal" ?
|
|
1542
|
+
return n === "horizontal" ? As(r, { left: m, right: b, top: u, bottom: u + g }) : As(r, { left: u, right: u + g, top: b, bottom: m });
|
|
1459
1543
|
}
|
|
1460
|
-
const s =
|
|
1544
|
+
const s = yi(a, t.label), l = e(t.value), o = 2, c = xa[r] ?? xa.N;
|
|
1461
1545
|
return { x: s + c.dx * o, y: l + c.dy * o };
|
|
1462
1546
|
}
|
|
1463
|
-
function
|
|
1547
|
+
function Mc(t, a, e, r = 4) {
|
|
1464
1548
|
const n = t.x + t.width / 2, s = t.y + t.height / 2;
|
|
1465
1549
|
if (a === n && e === s)
|
|
1466
1550
|
return { x: n, y: s };
|
|
@@ -1483,13 +1567,13 @@ function kc(t, a, e, r = 4) {
|
|
|
1483
1567
|
}
|
|
1484
1568
|
return u;
|
|
1485
1569
|
}
|
|
1486
|
-
function
|
|
1570
|
+
function An(t, a) {
|
|
1487
1571
|
if (!t)
|
|
1488
1572
|
return "bc-arrow";
|
|
1489
1573
|
const e = a ?? "#666", r = `bc-arrow-${e.replace(/[^a-zA-Z0-9]/g, "")}`;
|
|
1490
1574
|
return t.querySelector(`#${r}`) || (p.select(t).select("defs").empty() ? p.select(t).append("defs") : p.select(t).select("defs")).append("marker").attr("id", r).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerWidth", 8).attr("markerHeight", 8).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 1 1 L 9 5 L 1 9").attr("fill", "none").attr("stroke", e).attr("stroke-width", 1.5).attr("stroke-linecap", "round").attr("stroke-linejoin", "round"), r;
|
|
1491
1575
|
}
|
|
1492
|
-
function
|
|
1576
|
+
function Oc(t) {
|
|
1493
1577
|
switch (t) {
|
|
1494
1578
|
case kr.Dotted:
|
|
1495
1579
|
return "2,3";
|
|
@@ -1499,24 +1583,24 @@ function Lc(t) {
|
|
|
1499
1583
|
return "";
|
|
1500
1584
|
}
|
|
1501
1585
|
}
|
|
1502
|
-
function
|
|
1503
|
-
const n = t.append("circle").attr("class", "bc-annotation-circle").attr("cx", a).attr("cy", e).attr("r", r.size ?? 4).attr("fill", "none").attr("stroke", r.color ?? "#666").attr("stroke-width", 1.5), s =
|
|
1586
|
+
function Tc(t, a, e, r = {}) {
|
|
1587
|
+
const n = t.append("circle").attr("class", "bc-annotation-circle").attr("cx", a).attr("cy", e).attr("r", r.size ?? 4).attr("fill", "none").attr("stroke", r.color ?? "#666").attr("stroke-width", 1.5), s = Oc(r.style ?? kr.Solid);
|
|
1504
1588
|
s && n.attr("stroke-dasharray", s);
|
|
1505
1589
|
}
|
|
1506
|
-
const
|
|
1507
|
-
function
|
|
1590
|
+
const ws = 1 / Math.tan(40 * Math.PI / 180);
|
|
1591
|
+
function Pc(t, a, e) {
|
|
1508
1592
|
if (e) {
|
|
1509
|
-
const s = a.y >= t.y ? 1 : -1, l = Math.max(Math.abs(a.y - t.y) - Math.abs(a.x - t.x) *
|
|
1593
|
+
const s = a.y >= t.y ? 1 : -1, l = Math.max(Math.abs(a.y - t.y) - Math.abs(a.x - t.x) * ws, 12);
|
|
1510
1594
|
return { x: t.x, y: t.y + s * l };
|
|
1511
1595
|
}
|
|
1512
|
-
const r = a.x >= t.x ? 1 : -1, n = Math.max(Math.abs(a.x - t.x) - Math.abs(a.y - t.y) *
|
|
1596
|
+
const r = a.x >= t.x ? 1 : -1, n = Math.max(Math.abs(a.x - t.x) - Math.abs(a.y - t.y) * ws, 12);
|
|
1513
1597
|
return { x: t.x + r * n, y: t.y };
|
|
1514
1598
|
}
|
|
1515
|
-
function
|
|
1516
|
-
const r =
|
|
1599
|
+
function zc(t, a, e) {
|
|
1600
|
+
const r = Pc(t, a, e);
|
|
1517
1601
|
return `M ${t.x} ${t.y} L ${r.x} ${r.y} L ${a.x} ${a.y}`;
|
|
1518
1602
|
}
|
|
1519
|
-
function
|
|
1603
|
+
function Dc(t, a, e, r = mt.Direct, n = {}) {
|
|
1520
1604
|
var c;
|
|
1521
1605
|
let s;
|
|
1522
1606
|
switch (r) {
|
|
@@ -1527,7 +1611,7 @@ function Oc(t, a, e, r = mt.Direct, n = {}) {
|
|
|
1527
1611
|
break;
|
|
1528
1612
|
}
|
|
1529
1613
|
case mt.Elbow: {
|
|
1530
|
-
s =
|
|
1614
|
+
s = zc(a, e, n.departVertical ?? !1);
|
|
1531
1615
|
break;
|
|
1532
1616
|
}
|
|
1533
1617
|
default:
|
|
@@ -1535,25 +1619,25 @@ function Oc(t, a, e, r = mt.Direct, n = {}) {
|
|
|
1535
1619
|
}
|
|
1536
1620
|
const l = n.color ?? "#666", o = t.append("path").attr("class", "bc-annotation-line").attr("d", s).attr("fill", "none").attr("stroke", l).attr("stroke-width", n.lineWeight ?? 1).attr("pathLength", "1").attr("data-line-style", r).attr("data-line-from-x", String(a.x)).attr("data-line-from-y", String(a.y)).attr("data-line-to-x", String(e.x)).attr("data-line-to-y", String(e.y)).attr("data-line-depart-vertical", String(n.departVertical ?? !1));
|
|
1537
1621
|
if (n.showArrow === !0) {
|
|
1538
|
-
const d = ((c = t.node()) == null ? void 0 : c.ownerSVGElement) ?? null, u =
|
|
1622
|
+
const d = ((c = t.node()) == null ? void 0 : c.ownerSVGElement) ?? null, u = An(d, l);
|
|
1539
1623
|
o.attr("marker-end", `url(#${u})`);
|
|
1540
1624
|
}
|
|
1541
1625
|
}
|
|
1542
|
-
function
|
|
1626
|
+
function wn(t, a, e, r, n = {}) {
|
|
1543
1627
|
const s = n.textAnchor ?? "middle", l = n.textOutline !== !1, o = t.append("text").attr("class", "bc-annotation-text").attr("x", e).attr("y", r).attr("text-anchor", s).attr("font-size", "12px").attr("fill", n.textColor ?? "currentColor");
|
|
1544
1628
|
l && o.attr("stroke", n.backgroundColor ?? "#fff").attr("stroke-width", 3).attr("paint-order", "stroke");
|
|
1545
1629
|
const c = a.split(`
|
|
1546
1630
|
`);
|
|
1547
1631
|
if (c.length > 1 || n.maxWidth && n.maxWidth > 0)
|
|
1548
1632
|
if (n.maxWidth && n.maxWidth > 0)
|
|
1549
|
-
|
|
1633
|
+
Ec(o, a, n.maxWidth);
|
|
1550
1634
|
else
|
|
1551
1635
|
for (let d = 0; d < c.length; d++)
|
|
1552
1636
|
o.append("tspan").attr("x", o.attr("x")).attr("dy", d === 0 ? "0" : "1.2em").text(c[d]);
|
|
1553
1637
|
else
|
|
1554
1638
|
o.text(a);
|
|
1555
1639
|
}
|
|
1556
|
-
function
|
|
1640
|
+
function Ec(t, a, e) {
|
|
1557
1641
|
const r = a.split(/\s+/);
|
|
1558
1642
|
let n = "", s = 0;
|
|
1559
1643
|
for (const l of r) {
|
|
@@ -1567,22 +1651,22 @@ function mr(t, a, e = ti.Center) {
|
|
|
1567
1651
|
const r = a, n = r(String(t)) ?? 0, s = r.bandwidth(), l = r.step() - s;
|
|
1568
1652
|
return e === "start" ? n - l / 2 : e === "end" ? n + s + l / 2 : n + s / 2;
|
|
1569
1653
|
}
|
|
1570
|
-
if (
|
|
1654
|
+
if (xn(a)) {
|
|
1571
1655
|
const r = a(String(t)) ?? 0, n = a.step() / 2;
|
|
1572
1656
|
return e === "start" ? r - n : e === "end" ? r + n : r;
|
|
1573
1657
|
}
|
|
1574
|
-
return
|
|
1658
|
+
return mi(a) ? a(new Date(String(t))) : a(Number(t));
|
|
1575
1659
|
}
|
|
1576
1660
|
function yr(t, a) {
|
|
1577
1661
|
return a(Number(t));
|
|
1578
1662
|
}
|
|
1579
|
-
function
|
|
1663
|
+
function Ss(t, a) {
|
|
1580
1664
|
if (typeof t == "number")
|
|
1581
1665
|
return a / 2 + t / 100 * a;
|
|
1582
1666
|
const e = String(t);
|
|
1583
1667
|
return e.endsWith("%") ? a / 2 + parseFloat(e) / 100 * a : parseFloat(e) || 0;
|
|
1584
1668
|
}
|
|
1585
|
-
function
|
|
1669
|
+
function Sn(t, a) {
|
|
1586
1670
|
if (t == null)
|
|
1587
1671
|
return;
|
|
1588
1672
|
if (typeof t == "number")
|
|
@@ -1590,17 +1674,17 @@ function wn(t, a) {
|
|
|
1590
1674
|
const e = String(t);
|
|
1591
1675
|
return e.endsWith("%") ? parseFloat(e) / 100 * a : parseFloat(e) || void 0;
|
|
1592
1676
|
}
|
|
1593
|
-
function
|
|
1677
|
+
function Nc(t) {
|
|
1594
1678
|
return t < -4 ? "end" : t > 4 ? "start" : "middle";
|
|
1595
1679
|
}
|
|
1596
|
-
function
|
|
1680
|
+
function ks(t, a, e) {
|
|
1597
1681
|
if ("bandwidth" in a) {
|
|
1598
1682
|
const r = a;
|
|
1599
1683
|
return { x: (r(t.label) ?? 0) + r.bandwidth() / 2, y: e(t.value) };
|
|
1600
1684
|
}
|
|
1601
|
-
return { x:
|
|
1685
|
+
return { x: yi(a, t.label), y: e(t.value) };
|
|
1602
1686
|
}
|
|
1603
|
-
function
|
|
1687
|
+
function vi(t, a, e, r) {
|
|
1604
1688
|
const n = "target" in a ? a.target : void 0;
|
|
1605
1689
|
if (!n)
|
|
1606
1690
|
return;
|
|
@@ -1609,29 +1693,29 @@ function bi(t, a, e, r) {
|
|
|
1609
1693
|
return;
|
|
1610
1694
|
const l = t.append("g").attr("data-annotation-index", String(r));
|
|
1611
1695
|
a.id && l.attr("data-annotation-id", a.id);
|
|
1612
|
-
const o = a, c = o.anchorDirection ?? tt.N, d =
|
|
1696
|
+
const o = a, c = o.anchorDirection ?? tt.N, d = Cc(s, e.scaleX, e.scaleY, c, e.orientation);
|
|
1613
1697
|
let u, g;
|
|
1614
1698
|
const b = a;
|
|
1615
1699
|
if (b.dx != null || b.dy != null) {
|
|
1616
|
-
const { x: S, y: P } =
|
|
1700
|
+
const { x: S, y: P } = ks(s, e.scaleX, e.scaleY);
|
|
1617
1701
|
u = S + (Number(b.dx) || 40), g = P + (Number(b.dy) || -40);
|
|
1618
1702
|
} else if (b.direction != null && b.textOffsetX == null) {
|
|
1619
|
-
const { x: S, y: P } =
|
|
1703
|
+
const { x: S, y: P } = ks(s, e.scaleX, e.scaleY), B = b.direction, I = b.anchorDistance ?? 60, X = $c(B, I);
|
|
1620
1704
|
u = S + X.dx, g = P + X.dy;
|
|
1621
1705
|
} else
|
|
1622
1706
|
u = d.x + (o.textOffsetX ?? -42), g = d.y + (o.textOffsetY ?? -42);
|
|
1623
1707
|
const m = a.circleColor ?? "#666", v = a;
|
|
1624
|
-
v.showCircle &&
|
|
1708
|
+
v.showCircle && Tc(l, d.x, d.y, {
|
|
1625
1709
|
size: v.circleSize,
|
|
1626
1710
|
style: v.circleStyle,
|
|
1627
1711
|
color: m
|
|
1628
1712
|
});
|
|
1629
1713
|
const y = Math.max(4, Math.min(u, e.width - 4)), x = Math.max(4, Math.min(g, e.height - 4));
|
|
1630
1714
|
if (a.text) {
|
|
1631
|
-
const S =
|
|
1632
|
-
|
|
1715
|
+
const S = Nc(u - d.x);
|
|
1716
|
+
wn(l, a.text, y, x - 4, {
|
|
1633
1717
|
textColor: a.textColor,
|
|
1634
|
-
maxWidth:
|
|
1718
|
+
maxWidth: Sn(a.maxWidth, e.width),
|
|
1635
1719
|
textAnchor: S,
|
|
1636
1720
|
backgroundColor: e.backgroundColor,
|
|
1637
1721
|
textOutline: a.textOutline
|
|
@@ -1642,24 +1726,24 @@ function bi(t, a, e, r) {
|
|
|
1642
1726
|
const B = l.select(".bc-annotation-text").node();
|
|
1643
1727
|
if (B)
|
|
1644
1728
|
try {
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1647
|
-
S =
|
|
1648
|
-
const j =
|
|
1729
|
+
const G = B.getBBox();
|
|
1730
|
+
if (G.width > 0 && G.height > 0) {
|
|
1731
|
+
S = Mc(G, d.x, d.y);
|
|
1732
|
+
const j = G.x + G.width / 2;
|
|
1649
1733
|
P = Math.abs(S.x - j) < 1;
|
|
1650
1734
|
}
|
|
1651
1735
|
} catch {
|
|
1652
1736
|
}
|
|
1653
1737
|
const I = o.showCircle ? (o.circleSize ?? 4) + (o.lineTargetDistance ?? 5) : o.lineTargetDistance ?? 0;
|
|
1654
|
-
let X = d.x,
|
|
1738
|
+
let X = d.x, V = d.y;
|
|
1655
1739
|
if (I > 0) {
|
|
1656
|
-
const
|
|
1740
|
+
const G = d.x - S.x, j = d.y - S.y, _ = Math.sqrt(G * G + j * j);
|
|
1657
1741
|
if (_ > 0) {
|
|
1658
|
-
const ne = d.x -
|
|
1659
|
-
X = Math.abs(ae.dx) > 0.01 ? ne : d.x,
|
|
1742
|
+
const ne = d.x - G / _ * I, ie = d.y - j / _ * I, ae = xa[c] ?? xa.N;
|
|
1743
|
+
X = Math.abs(ae.dx) > 0.01 ? ne : d.x, V = Math.abs(ae.dy) > 0.01 ? ie : d.y;
|
|
1660
1744
|
}
|
|
1661
1745
|
}
|
|
1662
|
-
|
|
1746
|
+
Dc(l, S, { x: X, y: V }, o.lineStyle ?? mt.Direct, {
|
|
1663
1747
|
showArrow: o.showArrow,
|
|
1664
1748
|
lineWeight: o.lineWeight,
|
|
1665
1749
|
color: m,
|
|
@@ -1667,7 +1751,7 @@ function bi(t, a, e, r) {
|
|
|
1667
1751
|
});
|
|
1668
1752
|
}
|
|
1669
1753
|
}
|
|
1670
|
-
function
|
|
1754
|
+
function xi(t, a, e, r, n) {
|
|
1671
1755
|
if (a.kind !== Je.Range)
|
|
1672
1756
|
return;
|
|
1673
1757
|
const s = t.append("g").attr("data-annotation-index", String(r));
|
|
@@ -1690,11 +1774,11 @@ function mi(t, a, e, r, n) {
|
|
|
1690
1774
|
c = Math.min(g, b), u = Math.abs(b - g), o = 0, d = e.width;
|
|
1691
1775
|
}
|
|
1692
1776
|
if (s.append("rect").attr("class", "bc-annotation-range").attr("x", o).attr("y", c).attr("width", d).attr("height", u).attr("fill", a.bgColor ?? "#ccc").attr("opacity", (a.bgOpacity ?? 20) / 100), a.text) {
|
|
1693
|
-
const g = l === ct.Vertical ? d : u, b =
|
|
1777
|
+
const g = l === ct.Vertical ? d : u, b = Sn(a.maxWidth, e.width) ?? Math.max(g, 50), m = a.direction ?? "center", v = 4, y = xa[m] ?? xa.center, x = 0.5 + y.dx * 0.5, w = 0.5 + y.dy * 0.5, $ = Math.max(v, Math.min(o + d * x, e.width - v));
|
|
1694
1778
|
let S = "middle";
|
|
1695
1779
|
x < 0.25 ? S = "start" : x > 0.75 && (S = "end");
|
|
1696
1780
|
const B = c + v + 12, I = n ? n.append("g").attr("data-annotation-index", String(r)) : s;
|
|
1697
|
-
if (
|
|
1781
|
+
if (wn(I, a.text, $, B, {
|
|
1698
1782
|
textColor: a.textColor,
|
|
1699
1783
|
maxWidth: b,
|
|
1700
1784
|
textAnchor: S,
|
|
@@ -1704,24 +1788,24 @@ function mi(t, a, e, r, n) {
|
|
|
1704
1788
|
const X = I.select(".bc-annotation-text").node();
|
|
1705
1789
|
if (X)
|
|
1706
1790
|
try {
|
|
1707
|
-
const
|
|
1708
|
-
let
|
|
1709
|
-
w > 0.75 ?
|
|
1791
|
+
const V = X.getBBox();
|
|
1792
|
+
let G = 0;
|
|
1793
|
+
w > 0.75 ? G = c + u - v - (V.y + V.height) : G = c + u / 2 - (V.y + V.height / 2), Math.abs(G) > 0.5 && X.setAttribute("transform", `translate(0, ${G})`);
|
|
1710
1794
|
} catch {
|
|
1711
1795
|
}
|
|
1712
1796
|
}
|
|
1713
1797
|
}
|
|
1714
1798
|
}
|
|
1715
|
-
function
|
|
1799
|
+
function Ai(t, a, e, r) {
|
|
1716
1800
|
if (a.kind !== "free")
|
|
1717
1801
|
return;
|
|
1718
1802
|
const n = t.append("g").attr("data-annotation-index", String(r));
|
|
1719
1803
|
a.id && n.attr("data-annotation-id", a.id);
|
|
1720
|
-
const s =
|
|
1804
|
+
const s = Ss(a.x, e.width), l = Ss(a.y, e.height);
|
|
1721
1805
|
if (a.text) {
|
|
1722
|
-
|
|
1806
|
+
wn(n, a.text, s, l, {
|
|
1723
1807
|
textColor: a.textColor,
|
|
1724
|
-
maxWidth:
|
|
1808
|
+
maxWidth: Sn(a.maxWidth, e.width),
|
|
1725
1809
|
textAnchor: "middle",
|
|
1726
1810
|
backgroundColor: e.backgroundColor,
|
|
1727
1811
|
textOutline: a.textOutline
|
|
@@ -1739,8 +1823,8 @@ function dn(t, a, e, r) {
|
|
|
1739
1823
|
const n = e + 0.45 * (t - e);
|
|
1740
1824
|
return `M ${t} ${a} L ${n} ${a} L ${e} ${r}`;
|
|
1741
1825
|
}
|
|
1742
|
-
function
|
|
1743
|
-
const e = t.hasAttribute("marker-end"), r =
|
|
1826
|
+
function Fc(t, a) {
|
|
1827
|
+
const e = t.hasAttribute("marker-end"), r = vn(t.parentElement);
|
|
1744
1828
|
if (e && r) {
|
|
1745
1829
|
const n = p.select(t), s = t.getAttribute("d"), l = `M ${r.fromX} ${r.fromY} L ${r.fromX} ${r.fromY}`;
|
|
1746
1830
|
if (n.attr("d", l), r.style === mt.Elbow) {
|
|
@@ -1754,11 +1838,11 @@ function zc(t, a) {
|
|
|
1754
1838
|
});
|
|
1755
1839
|
} else if (r.style === mt.CurveLeft || r.style === mt.CurveRight) {
|
|
1756
1840
|
const o = { x: r.fromX, y: r.fromY }, c = { x: r.toX, y: r.toY }, d = c.x - o.x, u = c.y - o.y, g = Math.sqrt(d * d + u * u), b = g * 0.8, m = r.style === mt.CurveRight ? 1 : 0, v = g / 2, y = v < b ? Math.sqrt(b * b - v * v) : 0, x = (o.x + c.x) / 2, w = (o.y + c.y) / 2, $ = g > 0 ? -u / g : 0, S = g > 0 ? d / g : 0, P = m === 1 ? 1 : -1, B = x + P * y * $, I = w + P * y * S, X = Math.atan2(o.y - I, o.x - B);
|
|
1757
|
-
let
|
|
1758
|
-
m === 1 &&
|
|
1841
|
+
let G = Math.atan2(c.y - I, c.x - B) - X;
|
|
1842
|
+
m === 1 && G <= 0 && (G += 2 * Math.PI), m === 0 && G >= 0 && (G -= 2 * Math.PI), n.transition().duration(a).ease(p.easeCubicOut).attrTween("d", () => (j) => {
|
|
1759
1843
|
if (j >= 0.98)
|
|
1760
1844
|
return s;
|
|
1761
|
-
const _ = X + j *
|
|
1845
|
+
const _ = X + j * G, ne = B + b * Math.cos(_), ie = I + b * Math.sin(_);
|
|
1762
1846
|
return `M ${o.x} ${o.y} A ${b} ${b} 0 0 ${m} ${ne} ${ie}`;
|
|
1763
1847
|
});
|
|
1764
1848
|
} else
|
|
@@ -1772,12 +1856,12 @@ function zc(t, a) {
|
|
|
1772
1856
|
});
|
|
1773
1857
|
}
|
|
1774
1858
|
const vr = 1;
|
|
1775
|
-
function
|
|
1859
|
+
function Ic(t, a) {
|
|
1776
1860
|
return t.style !== a.style || t.departVertical !== a.departVertical ? !1 : Math.abs(t.fromX - a.fromX) <= vr && Math.abs(t.fromY - a.fromY) <= vr && Math.abs(t.toX - a.toX) <= vr && Math.abs(t.toY - a.toY) <= vr;
|
|
1777
1861
|
}
|
|
1778
|
-
function
|
|
1779
|
-
const r =
|
|
1780
|
-
if (!r ||
|
|
1862
|
+
function Bc(t, a, e) {
|
|
1863
|
+
const r = vn(t.parentElement);
|
|
1864
|
+
if (!r || Ic(a, r))
|
|
1781
1865
|
return;
|
|
1782
1866
|
const n = p.select(t);
|
|
1783
1867
|
if (a.style === mt.Elbow && r.style === mt.Elbow) {
|
|
@@ -1805,7 +1889,7 @@ function Ec(t, a, e) {
|
|
|
1805
1889
|
});
|
|
1806
1890
|
}
|
|
1807
1891
|
}
|
|
1808
|
-
function
|
|
1892
|
+
function wi(t, a, e, r) {
|
|
1809
1893
|
if (r <= 0)
|
|
1810
1894
|
return;
|
|
1811
1895
|
const n = [
|
|
@@ -1818,7 +1902,7 @@ function vi(t, a, e, r) {
|
|
|
1818
1902
|
const c = e.get(o);
|
|
1819
1903
|
if (c) {
|
|
1820
1904
|
const d = l.querySelector(".bc-annotation-line");
|
|
1821
|
-
d && c.line &&
|
|
1905
|
+
d && c.line && Bc(d, c.line, r);
|
|
1822
1906
|
try {
|
|
1823
1907
|
const u = l.getBBox(), g = c.rect.x - u.x, b = c.rect.y - u.y;
|
|
1824
1908
|
if (Math.abs(g) > 0.5 || Math.abs(b) > 0.5) {
|
|
@@ -1832,7 +1916,7 @@ function vi(t, a, e, r) {
|
|
|
1832
1916
|
}
|
|
1833
1917
|
} else {
|
|
1834
1918
|
const d = l.querySelector(".bc-annotation-line");
|
|
1835
|
-
d &&
|
|
1919
|
+
d && Fc(d, r);
|
|
1836
1920
|
const u = l.querySelectorAll(".bc-annotation-text, .bc-annotation-circle");
|
|
1837
1921
|
for (const g of u) {
|
|
1838
1922
|
const b = g;
|
|
@@ -1846,7 +1930,7 @@ function vi(t, a, e, r) {
|
|
|
1846
1930
|
t.appendChild(c), c.style.opacity = "1", c.getBoundingClientRect(), c.style.transition = `opacity ${r}ms ease`, c.style.opacity = "0", setTimeout(() => c.remove(), r);
|
|
1847
1931
|
}
|
|
1848
1932
|
}
|
|
1849
|
-
function
|
|
1933
|
+
function Si(t) {
|
|
1850
1934
|
if (!t)
|
|
1851
1935
|
return;
|
|
1852
1936
|
const a = parseFloat(t.getAttribute("width") || "0"), e = parseFloat(t.getAttribute("height") || "0");
|
|
@@ -1860,7 +1944,7 @@ function xi(t) {
|
|
|
1860
1944
|
}
|
|
1861
1945
|
function Dr(t, a, e) {
|
|
1862
1946
|
const r = t.ownerSVGElement ?? t;
|
|
1863
|
-
p.select(r).style("overflow", "visible"),
|
|
1947
|
+
p.select(r).style("overflow", "visible"), An(r);
|
|
1864
1948
|
const n = p.select(t);
|
|
1865
1949
|
let s;
|
|
1866
1950
|
if (e.transition)
|
|
@@ -1870,10 +1954,10 @@ function Dr(t, a, e) {
|
|
|
1870
1954
|
const c = t.querySelector(".bc-annotations"), d = t.querySelector(".bc-annotations-range");
|
|
1871
1955
|
if (c || d) {
|
|
1872
1956
|
if (s = /* @__PURE__ */ new Map(), c)
|
|
1873
|
-
for (const [u, g] of
|
|
1957
|
+
for (const [u, g] of zt(c))
|
|
1874
1958
|
s.set(u, g);
|
|
1875
1959
|
if (d)
|
|
1876
|
-
for (const [u, g] of
|
|
1960
|
+
for (const [u, g] of zt(d))
|
|
1877
1961
|
s.set(u, g);
|
|
1878
1962
|
}
|
|
1879
1963
|
}
|
|
@@ -1883,21 +1967,21 @@ function Dr(t, a, e) {
|
|
|
1883
1967
|
const d = a[c];
|
|
1884
1968
|
switch (d.kind ?? Je.Point) {
|
|
1885
1969
|
case Je.Point:
|
|
1886
|
-
|
|
1970
|
+
vi(o, d, e, c);
|
|
1887
1971
|
break;
|
|
1888
1972
|
case Je.Range:
|
|
1889
|
-
|
|
1973
|
+
xi(l, d, e, c, o);
|
|
1890
1974
|
break;
|
|
1891
1975
|
case Je.Free:
|
|
1892
|
-
|
|
1976
|
+
Ai(o, d, e, c);
|
|
1893
1977
|
break;
|
|
1894
1978
|
}
|
|
1895
1979
|
}
|
|
1896
1980
|
if (e.transition) {
|
|
1897
1981
|
const c = Oa(Wa);
|
|
1898
|
-
|
|
1982
|
+
wi(o.node(), l.node(), s ?? /* @__PURE__ */ new Map(), c);
|
|
1899
1983
|
}
|
|
1900
|
-
|
|
1984
|
+
Si(r);
|
|
1901
1985
|
}
|
|
1902
1986
|
function Xa(t, a) {
|
|
1903
1987
|
return {
|
|
@@ -1907,7 +1991,7 @@ function Xa(t, a) {
|
|
|
1907
1991
|
postDraw(e) {
|
|
1908
1992
|
var b;
|
|
1909
1993
|
const r = e.base, n = ((b = r.node()) == null ? void 0 : b.ownerSVGElement) ?? r.node();
|
|
1910
|
-
n && p.select(n).style("overflow", "visible"),
|
|
1994
|
+
n && p.select(n).style("overflow", "visible"), An(n);
|
|
1911
1995
|
const s = r.node(), l = s == null ? void 0 : s.parentNode, o = l && l !== n ? p.select(l) : r, c = o.node();
|
|
1912
1996
|
let d;
|
|
1913
1997
|
if (a.transition) {
|
|
@@ -1917,10 +2001,10 @@ function Xa(t, a) {
|
|
|
1917
2001
|
const m = c.querySelector(".bc-annotations"), v = c.querySelector(".bc-annotations-range");
|
|
1918
2002
|
if (m || v) {
|
|
1919
2003
|
if (d = /* @__PURE__ */ new Map(), m)
|
|
1920
|
-
for (const [y, x] of
|
|
2004
|
+
for (const [y, x] of zt(m))
|
|
1921
2005
|
d.set(y, x);
|
|
1922
2006
|
if (v)
|
|
1923
|
-
for (const [y, x] of
|
|
2007
|
+
for (const [y, x] of zt(v))
|
|
1924
2008
|
d.set(y, x);
|
|
1925
2009
|
}
|
|
1926
2010
|
}
|
|
@@ -1931,99 +2015,24 @@ function Xa(t, a) {
|
|
|
1931
2015
|
const v = t[m];
|
|
1932
2016
|
switch (v.kind ?? Je.Point) {
|
|
1933
2017
|
case Je.Point:
|
|
1934
|
-
|
|
2018
|
+
vi(g, v, a, m);
|
|
1935
2019
|
break;
|
|
1936
2020
|
case Je.Range:
|
|
1937
|
-
|
|
2021
|
+
xi(u, v, a, m, g);
|
|
1938
2022
|
break;
|
|
1939
2023
|
case Je.Free:
|
|
1940
|
-
|
|
2024
|
+
Ai(g, v, a, m);
|
|
1941
2025
|
break;
|
|
1942
2026
|
}
|
|
1943
2027
|
}
|
|
1944
2028
|
if (a.transition) {
|
|
1945
2029
|
const m = Oa(Wa);
|
|
1946
|
-
|
|
2030
|
+
wi(g.node(), u.node(), d ?? /* @__PURE__ */ new Map(), m);
|
|
1947
2031
|
}
|
|
1948
|
-
|
|
2032
|
+
Si(n);
|
|
1949
2033
|
}
|
|
1950
2034
|
};
|
|
1951
2035
|
}
|
|
1952
|
-
function Ai(t, a) {
|
|
1953
|
-
if (!He.valid(t))
|
|
1954
|
-
return a;
|
|
1955
|
-
try {
|
|
1956
|
-
return He(t);
|
|
1957
|
-
} catch {
|
|
1958
|
-
return a;
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
function It(t) {
|
|
1962
|
-
return He.valid(t) && He.contrast(t, "#fff") >= He.contrast(t, "#333") ? "#fff" : "#333";
|
|
1963
|
-
}
|
|
1964
|
-
function Fu(t, a) {
|
|
1965
|
-
return !He.valid(t) || !He.valid(a) ? 1 : He.contrast(t, a);
|
|
1966
|
-
}
|
|
1967
|
-
function Iu(t) {
|
|
1968
|
-
return t >= 7 ? "AAA" : t >= 4.5 ? "AA" : "Fail";
|
|
1969
|
-
}
|
|
1970
|
-
const sr = 4.5;
|
|
1971
|
-
function Bt(t) {
|
|
1972
|
-
let a = t;
|
|
1973
|
-
for (; a && a instanceof Element; ) {
|
|
1974
|
-
const e = getComputedStyle(a).backgroundColor;
|
|
1975
|
-
if (e && e !== "rgba(0, 0, 0, 0)" && e !== "transparent")
|
|
1976
|
-
return e;
|
|
1977
|
-
a = a.parentElement;
|
|
1978
|
-
}
|
|
1979
|
-
return "#fff";
|
|
1980
|
-
}
|
|
1981
|
-
function wi(t, a = "#fff") {
|
|
1982
|
-
if (!He.valid(t))
|
|
1983
|
-
return He.valid(a) ? It(a) : "#333";
|
|
1984
|
-
let e = He(t);
|
|
1985
|
-
const r = Ai(a, He("#fff"));
|
|
1986
|
-
if (He.contrast(e, r) >= sr)
|
|
1987
|
-
return e.hex();
|
|
1988
|
-
const n = r.luminance() > 0.5;
|
|
1989
|
-
for (let s = 0; s < 20 && (e = n ? e.darken(0.3) : e.brighten(0.3), !(He.contrast(e, r) >= sr)); s++)
|
|
1990
|
-
;
|
|
1991
|
-
return e.hex();
|
|
1992
|
-
}
|
|
1993
|
-
const Sn = 12, Mr = 0.25, Si = 20;
|
|
1994
|
-
function Nc(t, a) {
|
|
1995
|
-
if (t.length === 0)
|
|
1996
|
-
return [];
|
|
1997
|
-
const e = Ai(a, He("#fff")), r = He.valid(a) ? a : "#fff", n = e.luminance() > 0.5, s = t.map((l) => He.valid(l) ? Fc(He(l), r, n) : He("#000"));
|
|
1998
|
-
for (let l = 1; l < s.length; l++)
|
|
1999
|
-
He.deltaE(s[l], s[l - 1]) >= Sn || (s[l] = Ic(s[l], s[l - 1], r, n));
|
|
2000
|
-
return s.map((l) => l.hex());
|
|
2001
|
-
}
|
|
2002
|
-
function Fc(t, a, e) {
|
|
2003
|
-
for (let r = 0; r < Si; r++) {
|
|
2004
|
-
if (He.contrast(t, a) >= sr)
|
|
2005
|
-
return t;
|
|
2006
|
-
t = e ? t.darken(Mr) : t.brighten(Mr);
|
|
2007
|
-
}
|
|
2008
|
-
return t;
|
|
2009
|
-
}
|
|
2010
|
-
function Ic(t, a, e, r) {
|
|
2011
|
-
const n = ks(t, a, e, r);
|
|
2012
|
-
if (He.deltaE(n, a) >= Sn)
|
|
2013
|
-
return n;
|
|
2014
|
-
const s = ks(t, a, e, !r);
|
|
2015
|
-
return He.deltaE(s, a) > He.deltaE(n, a) && He.contrast(s, e) >= sr ? s : n;
|
|
2016
|
-
}
|
|
2017
|
-
function ks(t, a, e, r) {
|
|
2018
|
-
let n = t, s = He.deltaE(t, a), l = t;
|
|
2019
|
-
for (let o = 0; o < Si; o++) {
|
|
2020
|
-
l = r ? l.darken(Mr) : l.brighten(Mr);
|
|
2021
|
-
const c = He.deltaE(l, a);
|
|
2022
|
-
if (c > s && He.contrast(l, e) >= sr && (n = l, s = c), s >= Sn)
|
|
2023
|
-
break;
|
|
2024
|
-
}
|
|
2025
|
-
return n;
|
|
2026
|
-
}
|
|
2027
2036
|
function oa(t) {
|
|
2028
2037
|
return new Map((t ?? []).map((a) => [a.target, a.color]));
|
|
2029
2038
|
}
|
|
@@ -2034,25 +2043,25 @@ function Xt(t) {
|
|
|
2034
2043
|
function Ut(t, a) {
|
|
2035
2044
|
ki.set(t, a);
|
|
2036
2045
|
}
|
|
2037
|
-
let
|
|
2046
|
+
let Vc = 0;
|
|
2038
2047
|
const Ls = /* @__PURE__ */ new WeakMap();
|
|
2039
2048
|
function na(t, a, e, r) {
|
|
2040
2049
|
let n = Ls.get(a);
|
|
2041
2050
|
n || (n = /* @__PURE__ */ new Map(), Ls.set(a, n));
|
|
2042
2051
|
let s = n.get(e);
|
|
2043
|
-
s || (s = `bc-clip-${++
|
|
2052
|
+
s || (s = `bc-clip-${++Vc}`, n.set(e, s));
|
|
2044
2053
|
const l = p.select(t).select("defs").empty() ? p.select(t).append("defs") : p.select(t).select("defs"), o = l.select(`#${s}`);
|
|
2045
2054
|
return o.empty() ? l.append("clipPath").attr("id", s).append("rect").attr("x", r.x).attr("y", r.y).attr("width", r.width).attr("height", r.height) : o.select("rect").attr("x", r.x).attr("y", r.y).attr("width", r.width).attr("height", r.height), s;
|
|
2046
2055
|
}
|
|
2047
2056
|
const Sr = "bc-scene", Gc = 500, $s = /* @__PURE__ */ new Set(), un = /* @__PURE__ */ new WeakMap();
|
|
2048
2057
|
function za(t) {
|
|
2049
2058
|
let a = un.get(t);
|
|
2050
|
-
return a || (a = new
|
|
2059
|
+
return a || (a = new Rc(t), un.set(t, a)), a;
|
|
2051
2060
|
}
|
|
2052
|
-
function
|
|
2061
|
+
function _c(t) {
|
|
2053
2062
|
un.delete(t);
|
|
2054
2063
|
}
|
|
2055
|
-
class
|
|
2064
|
+
class Rc {
|
|
2056
2065
|
constructor(a) {
|
|
2057
2066
|
Zt(this, "container");
|
|
2058
2067
|
Zt(this, "_state", "idle");
|
|
@@ -2178,17 +2187,17 @@ class _c {
|
|
|
2178
2187
|
* returns a new instance. Idempotent.
|
|
2179
2188
|
*/
|
|
2180
2189
|
destroy() {
|
|
2181
|
-
this.interrupt(),
|
|
2190
|
+
this.interrupt(), _c(this.container);
|
|
2182
2191
|
}
|
|
2183
2192
|
}
|
|
2184
|
-
function
|
|
2193
|
+
function Yc(t, a) {
|
|
2185
2194
|
const e = /* @__PURE__ */ new Map();
|
|
2186
2195
|
return t.querySelectorAll(`[data-bc-role="${a}"]`).forEach((n) => {
|
|
2187
2196
|
const s = n.getAttribute("data-bc-key");
|
|
2188
2197
|
s != null && e.set(s, n);
|
|
2189
2198
|
}), e;
|
|
2190
2199
|
}
|
|
2191
|
-
function
|
|
2200
|
+
function Hc(t, a) {
|
|
2192
2201
|
return t.tagName === a.tagName;
|
|
2193
2202
|
}
|
|
2194
2203
|
function Cs(t, a) {
|
|
@@ -2200,15 +2209,15 @@ function Cs(t, a) {
|
|
|
2200
2209
|
}
|
|
2201
2210
|
return e;
|
|
2202
2211
|
}
|
|
2203
|
-
const
|
|
2212
|
+
const Wc = { opacity: 0 };
|
|
2204
2213
|
function Ua(t, a) {
|
|
2205
2214
|
if (t.state === "idle" || t.state === "animating") {
|
|
2206
|
-
|
|
2215
|
+
qc(a);
|
|
2207
2216
|
return;
|
|
2208
2217
|
}
|
|
2209
|
-
t.register(() =>
|
|
2218
|
+
t.register(() => Xc(t, a));
|
|
2210
2219
|
}
|
|
2211
|
-
function
|
|
2220
|
+
function qc(t) {
|
|
2212
2221
|
const e = p.select(t.parent).selectAll(t.selector).data(t.data, (s) => t.key(s));
|
|
2213
2222
|
e.exit().remove();
|
|
2214
2223
|
const r = t.insert(e.enter());
|
|
@@ -2216,21 +2225,21 @@ function Wc(t) {
|
|
|
2216
2225
|
tr(this, t.attrs(s));
|
|
2217
2226
|
});
|
|
2218
2227
|
}
|
|
2219
|
-
function
|
|
2220
|
-
const e = t.activeTransition, n = p.select(a.parent).selectAll(a.selector).data(a.data, (d) => a.key(d)), s =
|
|
2228
|
+
function Xc(t, a) {
|
|
2229
|
+
const e = t.activeTransition, n = p.select(a.parent).selectAll(a.selector).data(a.data, (d) => a.key(d)), s = Uc(a), l = n.exit();
|
|
2221
2230
|
e ? l.each(function() {
|
|
2222
|
-
const d = this, u = p.select(d).datum(), g = a.exitTo ? a.exitTo(u) :
|
|
2231
|
+
const d = this, u = p.select(d).datum(), g = a.exitTo ? a.exitTo(u) : Wc;
|
|
2223
2232
|
xr(d, g, e).on("end.featureJoin-exit", () => {
|
|
2224
2233
|
var b;
|
|
2225
2234
|
return (b = d.parentNode) == null ? void 0 : b.removeChild(d);
|
|
2226
2235
|
});
|
|
2227
2236
|
}) : l.remove();
|
|
2228
|
-
const o =
|
|
2237
|
+
const o = Yc(t.container, a.role), c = a.insert(n.enter());
|
|
2229
2238
|
Li(c, a), c.each(function(d) {
|
|
2230
2239
|
const u = this, g = a.attrs(d);
|
|
2231
2240
|
if (e) {
|
|
2232
2241
|
const b = o.get($i(a.key(d)));
|
|
2233
|
-
if (b &&
|
|
2242
|
+
if (b && Hc(b, u)) {
|
|
2234
2243
|
const v = Cs(b, s);
|
|
2235
2244
|
tr(u, v), xr(u, g, e);
|
|
2236
2245
|
return;
|
|
@@ -2250,7 +2259,7 @@ function Li(t, a) {
|
|
|
2250
2259
|
function $i(t) {
|
|
2251
2260
|
return t.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "␟");
|
|
2252
2261
|
}
|
|
2253
|
-
function
|
|
2262
|
+
function Uc(t) {
|
|
2254
2263
|
return t.data.length === 0 ? [] : Object.keys(t.attrs(t.data[0]));
|
|
2255
2264
|
}
|
|
2256
2265
|
function tr(t, a) {
|
|
@@ -2263,57 +2272,57 @@ function xr(t, a, e) {
|
|
|
2263
2272
|
r.attr(n, String(s));
|
|
2264
2273
|
return r;
|
|
2265
2274
|
}
|
|
2266
|
-
const
|
|
2275
|
+
const jc = 0.35;
|
|
2267
2276
|
function ja(t) {
|
|
2268
2277
|
return new Set((t ?? []).map((a) => a.target));
|
|
2269
2278
|
}
|
|
2270
2279
|
function rt(t, a, e = 1) {
|
|
2271
|
-
return t.size === 0 || t.has(a) ? e :
|
|
2280
|
+
return t.size === 0 || t.has(a) ? e : jc;
|
|
2272
2281
|
}
|
|
2273
2282
|
const Ba = ["#4e79a7"], Ms = 13;
|
|
2274
|
-
class
|
|
2283
|
+
class Kc extends ht {
|
|
2275
2284
|
initialize() {
|
|
2276
2285
|
}
|
|
2277
2286
|
}
|
|
2278
2287
|
function Ci(t, a, e = {}, r = !1) {
|
|
2279
|
-
var Ie, ze, Ne, Z, U, Ae, Te, fe, Le,
|
|
2288
|
+
var Ie, ze, Ne, Z, U, Ae, Te, fe, Le, Ve, Ee, L, M, C;
|
|
2280
2289
|
qt(r);
|
|
2281
2290
|
let n = null, s, l;
|
|
2282
2291
|
const o = Rt.for(t);
|
|
2283
2292
|
if (r) {
|
|
2284
2293
|
const O = Xt(t);
|
|
2285
|
-
l = O == null ? void 0 : O.margin, o.detach(), O && O.chartType !== "bar-vertical" && (n =
|
|
2294
|
+
l = O == null ? void 0 : O.margin, o.detach(), O && O.chartType !== "bar-vertical" && (n = Gt(t)), s = /* @__PURE__ */ new Map();
|
|
2286
2295
|
for (const Q of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2287
|
-
for (const [q, R] of
|
|
2296
|
+
for (const [q, R] of zt(Q))
|
|
2288
2297
|
s.set(q, R);
|
|
2289
2298
|
t.replaceChildren();
|
|
2290
2299
|
}
|
|
2291
|
-
const { body: c } = Ht(t, e.frame), d =
|
|
2300
|
+
const { body: c } = Ht(t, e.frame), d = Pt(c).width, u = e.categoryLabelLine === !0, g = Ma(a.values, (Ie = e.verticalAxis) == null ? void 0 : Ie.range, (ze = e.verticalAxis) == null ? void 0 : ze.numberFormat, (Ne = e.verticalAxis) == null ? void 0 : Ne.scaleType), b = u ? We.Off : (Z = e.horizontalAxis) == null ? void 0 : Z.labelPosition, m = ra(d, (U = e.verticalAxis) == null ? void 0 : U.labelPosition, b, (Ae = e.verticalAxis) == null ? void 0 : Ae.direction, g);
|
|
2292
2301
|
if (!u) {
|
|
2293
|
-
const O = Math.max(0, d - (m.left ?? 50) - (m.right ?? 20)), Q =
|
|
2302
|
+
const O = Math.max(0, d - (m.left ?? 50) - (m.right ?? 20)), Q = yn(a.labels, O, e.horizontalAxis);
|
|
2294
2303
|
Q !== void 0 && (m.bottom = Q);
|
|
2295
2304
|
}
|
|
2296
|
-
const { chartArea: v, width: y, height: x, margin: w } = Wt(c, m), S = x - (u ? Ms : 0), P = aa(l, w), B =
|
|
2305
|
+
const { chartArea: v, width: y, height: x, margin: w } = Wt(c, m), S = x - (u ? Ms : 0), P = aa(l, w), B = Qc(a, e), I = B.map((O) => ({
|
|
2297
2306
|
label: O,
|
|
2298
2307
|
value: a.values[a.labels.indexOf(O)]
|
|
2299
|
-
})), X = e.swapLabelValue === !0,
|
|
2300
|
-
if (
|
|
2308
|
+
})), X = e.swapLabelValue === !0, V = e.waterfall === !0, G = [];
|
|
2309
|
+
if (V) {
|
|
2301
2310
|
let O = 0;
|
|
2302
2311
|
for (const Q of I) {
|
|
2303
2312
|
const q = O;
|
|
2304
|
-
O += Q.value,
|
|
2313
|
+
O += Q.value, G.push({ label: Q.label, value: Q.value, y0: q, y1: O, isTotal: !1 });
|
|
2305
2314
|
}
|
|
2306
|
-
e.waterfallTotal &&
|
|
2315
|
+
e.waterfallTotal && G.push({ label: "Total", value: O, y0: 0, y1: O, isTotal: !0 });
|
|
2307
2316
|
}
|
|
2308
|
-
const j =
|
|
2317
|
+
const j = V ? G.map((O) => O.label) : B, _ = p.scaleBand().domain(j).range([0, y]).padding(Ta(e.barGap)), ne = ((Te = e.verticalAxis) == null ? void 0 : Te.scaleType) === "log", ie = V ? G.flatMap((O) => [O.y0, O.y1]) : I.map((O) => O.value);
|
|
2309
2318
|
let [ae, F] = qa(ie, (fe = e.verticalAxis) == null ? void 0 : fe.range, (Le = e.verticalAxis) == null ? void 0 : Le.scaleType);
|
|
2310
|
-
if (e.valueLabels && ae < 0 && ((Ee = (
|
|
2319
|
+
if (e.valueLabels && ae < 0 && ((Ee = (Ve = e.verticalAxis) == null ? void 0 : Ve.range) == null ? void 0 : Ee.min) == null) {
|
|
2311
2320
|
const O = F - ae;
|
|
2312
2321
|
ae -= O * 0.1;
|
|
2313
2322
|
}
|
|
2314
2323
|
const H = ne ? p.scaleSymlog().domain([ae, F]).nice().range([S, 0]) : p.scaleLinear().domain([ae, F]).nice().range([S, 0]);
|
|
2315
2324
|
o.attach(v, P);
|
|
2316
|
-
const W = X && e.valueLabels && !
|
|
2325
|
+
const W = X && e.valueLabels && !V ? (() => {
|
|
2317
2326
|
const O = new Map(I.map((Q) => [Q.label, Q.value]));
|
|
2318
2327
|
return {
|
|
2319
2328
|
...e.horizontalAxis,
|
|
@@ -2327,10 +2336,10 @@ function Ci(t, a, e = {}, r = !1) {
|
|
|
2327
2336
|
}), !ne && ae < 0 && F > 0 && p.select(v).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", y).attr("y1", H(0)).attr("y2", H(0)).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2328
2337
|
const le = oa(e.colorizes), $e = new Set((e.highlights ?? []).map((O) => O.target)), se = v.ownerSVGElement, Se = na(se, t, "bars", { x: 0, y: 0, width: y, height: S }), ye = p.select(se).select("defs"), we = Se.replace(/^bc-clip-/, ""), be = p.select(v).append("g").attr("clip-path", `url(#${Se})`);
|
|
2329
2338
|
if (e.barBackground) {
|
|
2330
|
-
const O = (e.colors ?? Ba)[0], Q =
|
|
2339
|
+
const O = (e.colors ?? Ba)[0], Q = V ? j : I.map((q) => q.label);
|
|
2331
2340
|
be.selectAll(".bc-bar-bg").data(Q, (q) => q).enter().append("rect").attr("class", "bc-bar-bg").attr("x", (q) => _(q) ?? 0).attr("y", 0).attr("width", _.bandwidth()).attr("height", S).attr("fill", O).attr("opacity", 0.18);
|
|
2332
2341
|
}
|
|
2333
|
-
const me =
|
|
2342
|
+
const me = V ? j : I.map((O) => O.label);
|
|
2334
2343
|
if (e.barSeparators && me.length > 1) {
|
|
2335
2344
|
const O = _.step();
|
|
2336
2345
|
for (let Q = 1; Q < me.length; Q++) {
|
|
@@ -2338,7 +2347,7 @@ function Ci(t, a, e = {}, r = !1) {
|
|
|
2338
2347
|
be.append("line").attr("class", "bc-bar-separator").attr("x1", q).attr("x2", q).attr("y1", 0).attr("y2", S).attr("stroke", "currentColor").attr("opacity", 0.15);
|
|
2339
2348
|
}
|
|
2340
2349
|
}
|
|
2341
|
-
if (!
|
|
2350
|
+
if (!V && e.connectedColumns && I.length > 1) {
|
|
2342
2351
|
const O = e.colors ?? Ba, Q = e.connectionsOpacity ?? 0.15;
|
|
2343
2352
|
for (let q = 0; q < I.length - 1; q++) {
|
|
2344
2353
|
const R = I[q], J = I[q + 1];
|
|
@@ -2356,12 +2365,12 @@ function Ci(t, a, e = {}, r = !1) {
|
|
|
2356
2365
|
}
|
|
2357
2366
|
}
|
|
2358
2367
|
const ce = p.select(v).append("g");
|
|
2359
|
-
if (
|
|
2368
|
+
if (V) {
|
|
2360
2369
|
const O = e.colors ?? Ba, Q = "#333";
|
|
2361
|
-
if (e.connectedColumns &&
|
|
2370
|
+
if (e.connectedColumns && G.length > 1) {
|
|
2362
2371
|
const q = e.colors ?? Ba, R = e.connectionsOpacity ?? 0.15;
|
|
2363
|
-
for (let J = 0; J <
|
|
2364
|
-
const re =
|
|
2372
|
+
for (let J = 0; J < G.length - 1; J++) {
|
|
2373
|
+
const re = G[J], ke = G[J + 1];
|
|
2365
2374
|
if (ke.isTotal || re.value == null || ke.value == null || Number.isNaN(re.value) || Number.isNaN(ke.value) || re.value === 0 || ke.value === 0)
|
|
2366
2375
|
continue;
|
|
2367
2376
|
const Y = (_(re.label) ?? 0) + _.bandwidth(), de = _(ke.label) ?? 0, Ce = H(re.y1), Oe = H(ke.y1), _e = H(re.y0), Ue = H(ke.y0), Ze = le.get(re.label) ?? q[0], Qe = le.get(ke.label) ?? q[0];
|
|
@@ -2375,18 +2384,18 @@ function Ci(t, a, e = {}, r = !1) {
|
|
|
2375
2384
|
be.append("polygon").attr("class", "bc-bar-connection").attr("points", `${Y},${Ce} ${de},${Oe} ${de},${Ue} ${Y},${_e}`).attr("fill", gt).attr("opacity", R).attr("pointer-events", "none");
|
|
2376
2385
|
}
|
|
2377
2386
|
}
|
|
2378
|
-
for (let q = 0; q <
|
|
2379
|
-
const R =
|
|
2387
|
+
for (let q = 0; q < G.length - 1; q++) {
|
|
2388
|
+
const R = G[q], J = G[q + 1];
|
|
2380
2389
|
if (J.isTotal)
|
|
2381
2390
|
break;
|
|
2382
2391
|
be.append("line").attr("class", "bc-waterfall-connector").attr("x1", (_(R.label) ?? 0) + _.bandwidth()).attr("x2", _(J.label) ?? 0).attr("y1", H(R.y1)).attr("y2", H(R.y1)).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
|
|
2383
2392
|
}
|
|
2384
|
-
if (be.selectAll(".bc-bar").data(
|
|
2393
|
+
if (be.selectAll(".bc-bar").data(G, (q) => q.label).enter().append("rect").attr("class", "bc-bar").attr("x", (q) => _(q.label) ?? 0).attr("y", (q) => Math.min(H(q.y0), H(q.y1))).attr("width", _.bandwidth()).attr("height", (q) => Math.abs(H(q.y0) - H(q.y1))).attr("fill", (q) => q.isTotal ? Q : le.get(q.label) ?? O[0]).attr("opacity", (q) => $e.size > 0 ? rt($e, q.label) : null), e.valueLabels) {
|
|
2385
2394
|
const q = e.valueLabelPosition ?? Fe.Auto, R = va(((L = e.verticalAxis) == null ? void 0 : L.numberFormat) ?? ""), J = (re) => R ? R(re) : String(re);
|
|
2386
|
-
ce.selectAll(".bc-value-label").data(
|
|
2395
|
+
ce.selectAll(".bc-value-label").data(G, (re) => re.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("x", (re) => (_(re.label) ?? 0) + _.bandwidth() / 2).attr("y", (re) => {
|
|
2387
2396
|
const ke = Math.min(H(re.y0), H(re.y1)), Y = Math.abs(H(re.y0) - H(re.y1));
|
|
2388
2397
|
return q === Fe.Inside ? ke + Y / 2 : ke - 4;
|
|
2389
|
-
}).attr("text-anchor", "middle").attr("dominant-baseline", q === Fe.Inside ? "central" : "auto").attr("fill", (re) => q === Fe.Inside ?
|
|
2398
|
+
}).attr("text-anchor", "middle").attr("dominant-baseline", q === Fe.Inside ? "central" : "auto").attr("fill", (re) => q === Fe.Inside ? Bt(re.isTotal ? Q : le.get(re.label) ?? O[0]) : "currentColor").text((re) => X ? re.label : J(re.isTotal ? re.y1 : re.value));
|
|
2390
2399
|
}
|
|
2391
2400
|
} else {
|
|
2392
2401
|
const O = za(t), Q = be.append("g").node();
|
|
@@ -2406,7 +2415,7 @@ function Ci(t, a, e = {}, r = !1) {
|
|
|
2406
2415
|
opacity: rt($e, R.label)
|
|
2407
2416
|
})
|
|
2408
2417
|
});
|
|
2409
|
-
const q = new
|
|
2418
|
+
const q = new Kc(be);
|
|
2410
2419
|
e.tooltips && q.use(wa({ numberFormat: (M = e.verticalAxis) == null ? void 0 : M.numberFormat })), e.crosshair && q.use(Pa({
|
|
2411
2420
|
width: y,
|
|
2412
2421
|
height: S,
|
|
@@ -2419,10 +2428,10 @@ function Ci(t, a, e = {}, r = !1) {
|
|
|
2419
2428
|
data: I,
|
|
2420
2429
|
width: y,
|
|
2421
2430
|
height: S,
|
|
2422
|
-
backgroundColor:
|
|
2431
|
+
backgroundColor: Tt(t),
|
|
2423
2432
|
transition: r,
|
|
2424
2433
|
priorAnnotations: s
|
|
2425
|
-
})), q.draw(I), e.valueLabels &&
|
|
2434
|
+
})), q.draw(I), e.valueLabels && Jc(ce, I, _, H, {
|
|
2426
2435
|
position: e.valueLabelPosition,
|
|
2427
2436
|
colorOverrides: le,
|
|
2428
2437
|
colors: e.colors ?? Ba,
|
|
@@ -2436,14 +2445,14 @@ function Ci(t, a, e = {}, r = !1) {
|
|
|
2436
2445
|
for (const Q of j)
|
|
2437
2446
|
O.append("text").attr("class", "bc-category-label").attr("x", (_(Q) ?? 0) + _.bandwidth() / 2).attr("y", S + Ms / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(Q);
|
|
2438
2447
|
}
|
|
2439
|
-
Ut(t, { chartType: "bar-vertical", margin: w }), n && (
|
|
2448
|
+
Ut(t, { chartType: "bar-vertical", margin: w }), n && (Vt(be.node()), _t(t, n));
|
|
2440
2449
|
}
|
|
2441
|
-
function
|
|
2450
|
+
function Zc(t, a, e, r) {
|
|
2442
2451
|
const n = Math.abs(e(t.value) - e(0)), s = r === Fe.Inside, l = (a(t.label) ?? 0) + a.bandwidth() / 2, o = "middle";
|
|
2443
2452
|
let c, d;
|
|
2444
2453
|
return t.value < 0 ? s ? (c = e(t.value) - n / 2, d = "central") : (c = e(t.value) + 4, d = "hanging") : s ? (c = e(t.value) + n / 2, d = "central") : (c = e(t.value) - 4, d = "auto"), { tx: l, ty: c, anchor: o, baseline: d, isInside: s };
|
|
2445
2454
|
}
|
|
2446
|
-
function
|
|
2455
|
+
function Jc(t, a, e, r, n) {
|
|
2447
2456
|
const s = n.position ?? Fe.Auto, l = (g) => n.swapLabelValue ? g.label : n.percent && n.total !== void 0 ? Or(g.value, n.total) : String(g.value);
|
|
2448
2457
|
let o = t.select(".bc-value-label-group");
|
|
2449
2458
|
o.empty() && (o = t.append("g").attr("class", "bc-value-label-group"));
|
|
@@ -2456,23 +2465,23 @@ function Zc(t, a, e, r, n) {
|
|
|
2456
2465
|
key: (g) => g.label,
|
|
2457
2466
|
insert: (g) => g.append("text").attr("class", "bc-value-label").attr("font-size", "11px"),
|
|
2458
2467
|
attrs: (g) => {
|
|
2459
|
-
const b =
|
|
2468
|
+
const b = Zc(g, e, r, s);
|
|
2460
2469
|
return {
|
|
2461
2470
|
x: b.tx,
|
|
2462
2471
|
y: b.ty,
|
|
2463
2472
|
"text-anchor": b.anchor,
|
|
2464
2473
|
"dominant-baseline": b.baseline,
|
|
2465
|
-
fill: b.isInside ?
|
|
2474
|
+
fill: b.isInside ? Bt(n.colorOverrides.get(g.label) ?? n.colors[0]) : "currentColor"
|
|
2466
2475
|
};
|
|
2467
2476
|
}
|
|
2468
2477
|
}), o.selectAll(".bc-value-label").data(a, (g) => g.label).text(l);
|
|
2469
2478
|
}
|
|
2470
|
-
function
|
|
2479
|
+
function Qc(t, a) {
|
|
2471
2480
|
const e = t.labels.map((r, n) => ({ label: r, value: t.values[n] }));
|
|
2472
2481
|
return a.sort === ut.Ascending ? e.sort((r, n) => r.value - n.value) : a.sort === ut.Descending && e.sort((r, n) => n.value - r.value), e.map((r) => r.label);
|
|
2473
2482
|
}
|
|
2474
|
-
const
|
|
2475
|
-
class
|
|
2483
|
+
const Va = ["#4e79a7"], Os = 13, ef = "11px sans-serif", rn = 4;
|
|
2484
|
+
class tf extends ht {
|
|
2476
2485
|
initialize() {
|
|
2477
2486
|
}
|
|
2478
2487
|
}
|
|
@@ -2480,25 +2489,25 @@ function nn(t) {
|
|
|
2480
2489
|
try {
|
|
2481
2490
|
const e = document.createElement("canvas").getContext("2d");
|
|
2482
2491
|
if (e)
|
|
2483
|
-
return e.font =
|
|
2492
|
+
return e.font = ef, Math.ceil(e.measureText(t).width);
|
|
2484
2493
|
} catch {
|
|
2485
2494
|
}
|
|
2486
2495
|
return t.length * 6.5;
|
|
2487
2496
|
}
|
|
2488
2497
|
function Mi(t, a, e = {}, r = !1) {
|
|
2489
|
-
var Ie, ze, Ne, Z, U, Ae, Te, fe, Le,
|
|
2498
|
+
var Ie, ze, Ne, Z, U, Ae, Te, fe, Le, Ve, Ee;
|
|
2490
2499
|
qt(r);
|
|
2491
2500
|
let n = null, s, l;
|
|
2492
2501
|
const o = Rt.for(t);
|
|
2493
2502
|
if (r) {
|
|
2494
2503
|
const L = Xt(t);
|
|
2495
|
-
l = L == null ? void 0 : L.margin, o.detach(), L && L.chartType !== "bar-horizontal" && (n =
|
|
2504
|
+
l = L == null ? void 0 : L.margin, o.detach(), L && L.chartType !== "bar-horizontal" && (n = Gt(t)), s = /* @__PURE__ */ new Map();
|
|
2496
2505
|
for (const M of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2497
|
-
for (const [C, O] of
|
|
2506
|
+
for (const [C, O] of zt(M))
|
|
2498
2507
|
s.set(C, O);
|
|
2499
2508
|
t.replaceChildren();
|
|
2500
2509
|
}
|
|
2501
|
-
const { body: c } = Ht(t, e.frame), d =
|
|
2510
|
+
const { body: c } = Ht(t, e.frame), d = Pt(c).width, u = d > 0 && d < 400 && ((Ie = e.verticalAxis) == null ? void 0 : Ie.labelPosition) !== "outside", g = e.categoryLabelLine === !0 || u, b = Tr(a.labels), m = g ? We.Off : (ze = e.verticalAxis) == null ? void 0 : ze.labelPosition, v = ra(d, m, (Ne = e.horizontalAxis) == null ? void 0 : Ne.labelPosition, (Z = e.verticalAxis) == null ? void 0 : Z.direction, b, (U = e.horizontalAxis) == null ? void 0 : U.showAxis), y = e.valueLabelPosition ?? Fe.Auto, x = e.swapLabelValue === !0;
|
|
2502
2511
|
if (e.valueLabels && y !== Fe.Inside)
|
|
2503
2512
|
if (x) {
|
|
2504
2513
|
const L = a.labels.reduce((C, O) => C.length > O.length ? C : O, ""), M = nn(L) + rn;
|
|
@@ -2507,20 +2516,20 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2507
2516
|
const L = Math.max(...a.values), M = Math.min(...a.values), C = L > 0 ? nn(String(L)) + rn : 0, O = M < 0 ? nn(String(M)) + rn : 0;
|
|
2508
2517
|
v.right = Math.max(v.right ?? 15, C), O > 0 && (v.left = (v.left ?? 50) + O);
|
|
2509
2518
|
}
|
|
2510
|
-
const { chartArea: w, width: $, height: S, margin: P } = Wt(c, v), B = g ? Os : 0, I = aa(l, P), X =
|
|
2519
|
+
const { chartArea: w, width: $, height: S, margin: P } = Wt(c, v), B = g ? Os : 0, I = aa(l, P), X = nf(a, e), V = X.map((L) => ({
|
|
2511
2520
|
label: L,
|
|
2512
2521
|
value: a.values[a.labels.indexOf(L)]
|
|
2513
|
-
})),
|
|
2514
|
-
if (
|
|
2522
|
+
})), G = e.waterfall === !0, j = [];
|
|
2523
|
+
if (G) {
|
|
2515
2524
|
let L = 0;
|
|
2516
|
-
for (const M of
|
|
2525
|
+
for (const M of V) {
|
|
2517
2526
|
const C = L;
|
|
2518
2527
|
L += M.value, j.push({ label: M.label, value: M.value, x0: C, x1: L, isTotal: !1 });
|
|
2519
2528
|
}
|
|
2520
2529
|
e.waterfallTotal && j.push({ label: "Total", value: L, x0: 0, x1: L, isTotal: !0 });
|
|
2521
2530
|
}
|
|
2522
|
-
const _ = ((Ae = e.horizontalAxis) == null ? void 0 : Ae.scaleType) === "log", ne =
|
|
2523
|
-
const L = new Map(
|
|
2531
|
+
const _ = ((Ae = e.horizontalAxis) == null ? void 0 : Ae.scaleType) === "log", ne = G ? j.flatMap((L) => [L.x0, L.x1]) : V.map((L) => L.value), [ie, ae] = qa(ne, (Te = e.horizontalAxis) == null ? void 0 : Te.range, (fe = e.horizontalAxis) == null ? void 0 : fe.scaleType), F = _ ? p.scaleSymlog().domain([ie, ae]).nice().range([0, $]) : p.scaleLinear().domain([ie, ae]).nice().range([0, $]), H = G ? j.map((L) => L.label) : X, W = p.scaleBand().domain(H).range([0, S]).padding(Ta(e.barGap)), oe = x && e.valueLabels && !G ? (() => {
|
|
2532
|
+
const L = new Map(V.map((M) => [M.label, M.value]));
|
|
2524
2533
|
return {
|
|
2525
2534
|
...e.verticalAxis,
|
|
2526
2535
|
topPadding: P.top,
|
|
@@ -2534,10 +2543,10 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2534
2543
|
}), !_ && ie < 0 && ae > 0 && p.select(w).append("line").attr("class", "bc-zero-baseline").attr("x1", F(0)).attr("x2", F(0)).attr("y1", 0).attr("y2", S).attr("stroke", "#666").attr("stroke-width", 1);
|
|
2535
2544
|
const $e = oa(e.colorizes), se = new Set((e.highlights ?? []).map((L) => L.target)), Se = w.ownerSVGElement, ye = na(Se, t, "bars", { x: 0, y: 0, width: $, height: S }), we = p.select(Se).select("defs"), be = ye.replace(/^bc-clip-/, ""), me = p.select(w).append("g").attr("clip-path", `url(#${ye})`);
|
|
2536
2545
|
if (e.barBackground) {
|
|
2537
|
-
const L = (e.colors ??
|
|
2546
|
+
const L = (e.colors ?? Va)[0], M = G ? H : V.map((C) => C.label);
|
|
2538
2547
|
me.selectAll(".bc-bar-bg").data(M, (C) => C).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (C) => (W(C) ?? 0) + B).attr("width", $).attr("height", W.bandwidth() - B).attr("fill", L).attr("opacity", 0.18);
|
|
2539
2548
|
}
|
|
2540
|
-
const ce =
|
|
2549
|
+
const ce = G ? H : V.map((L) => L.label);
|
|
2541
2550
|
if (e.barSeparators && ce.length > 1) {
|
|
2542
2551
|
const L = W.step();
|
|
2543
2552
|
for (let M = 1; M < ce.length; M++) {
|
|
@@ -2545,10 +2554,10 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2545
2554
|
me.append("line").attr("class", "bc-bar-separator").attr("x1", 0).attr("x2", $).attr("y1", C).attr("y2", C).attr("stroke", "currentColor").attr("opacity", 0.15);
|
|
2546
2555
|
}
|
|
2547
2556
|
}
|
|
2548
|
-
if (!
|
|
2549
|
-
const L = e.colors ??
|
|
2550
|
-
for (let C = 0; C <
|
|
2551
|
-
const O =
|
|
2557
|
+
if (!G && e.connectedColumns && V.length > 1) {
|
|
2558
|
+
const L = e.colors ?? Va, M = e.connectionsOpacity ?? 0.15;
|
|
2559
|
+
for (let C = 0; C < V.length - 1; C++) {
|
|
2560
|
+
const O = V[C], Q = V[C + 1];
|
|
2552
2561
|
if (O.value == null || Q.value == null || Number.isNaN(O.value) || Number.isNaN(Q.value) || O.value === 0 || Q.value === 0)
|
|
2553
2562
|
continue;
|
|
2554
2563
|
const q = (W(O.label) ?? 0) + W.bandwidth(), R = (W(Q.label) ?? 0) + B, J = Math.max(F(0), F(O.value)), re = Math.max(F(0), F(Q.value)), ke = F(0), Y = $e.get(O.label) ?? L[0], de = $e.get(Q.label) ?? L[0];
|
|
@@ -2562,10 +2571,10 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2562
2571
|
me.append("polygon").attr("class", "bc-bar-connection").attr("points", `${J},${q} ${re},${R} ${ke},${R} ${ke},${q}`).attr("fill", Ce).attr("opacity", M).attr("pointer-events", "none");
|
|
2563
2572
|
}
|
|
2564
2573
|
}
|
|
2565
|
-
if (
|
|
2566
|
-
const L = e.colors ??
|
|
2574
|
+
if (G) {
|
|
2575
|
+
const L = e.colors ?? Va, M = "#333";
|
|
2567
2576
|
if (e.connectedColumns && j.length > 1) {
|
|
2568
|
-
const C = e.colors ??
|
|
2577
|
+
const C = e.colors ?? Va, O = e.connectionsOpacity ?? 0.15;
|
|
2569
2578
|
for (let Q = 0; Q < j.length - 1; Q++) {
|
|
2570
2579
|
const q = j[Q], R = j[Q + 1];
|
|
2571
2580
|
if (R.isTotal || q.value == null || R.value == null || Number.isNaN(q.value) || Number.isNaN(R.value) || q.value === 0 || R.value === 0)
|
|
@@ -2592,7 +2601,7 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2592
2601
|
p.select(w).append("g").selectAll(".bc-value-label").data(j, (R) => R.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("dominant-baseline", "central").attr("y", (R) => (W(R.label) ?? 0) + B + (W.bandwidth() - B) / 2).attr("x", (R) => {
|
|
2593
2602
|
const J = Math.max(F(R.x0), F(R.x1));
|
|
2594
2603
|
return C === Fe.Inside ? J - 4 : J + 4;
|
|
2595
|
-
}).attr("text-anchor", C === Fe.Inside ? "end" : "start").attr("fill", (R) => C === Fe.Inside ?
|
|
2604
|
+
}).attr("text-anchor", C === Fe.Inside ? "end" : "start").attr("fill", (R) => C === Fe.Inside ? Bt(R.isTotal ? M : $e.get(R.label) ?? L[0]) : "currentColor").text((R) => x ? R.label : Q(R.isTotal ? R.x1 : R.value));
|
|
2596
2605
|
}
|
|
2597
2606
|
} else {
|
|
2598
2607
|
const L = za(t), M = me.append("g").node();
|
|
@@ -2600,7 +2609,7 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2600
2609
|
role: "mark-per-category",
|
|
2601
2610
|
parent: M,
|
|
2602
2611
|
selector: ".bc-bar",
|
|
2603
|
-
data:
|
|
2612
|
+
data: V,
|
|
2604
2613
|
key: (O) => O.label,
|
|
2605
2614
|
insert: (O) => O.append("rect").attr("class", "bc-bar"),
|
|
2606
2615
|
attrs: (O) => ({
|
|
@@ -2608,12 +2617,12 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2608
2617
|
y: (W(O.label) ?? 0) + B,
|
|
2609
2618
|
width: Math.abs(F(O.value) - F(0)),
|
|
2610
2619
|
height: W.bandwidth() - B,
|
|
2611
|
-
fill: $e.get(O.label) ?? (e.colors ??
|
|
2620
|
+
fill: $e.get(O.label) ?? (e.colors ?? Va)[0],
|
|
2612
2621
|
opacity: rt(se, O.label)
|
|
2613
2622
|
})
|
|
2614
2623
|
});
|
|
2615
|
-
const C = new
|
|
2616
|
-
if (e.tooltips && C.use(wa({ numberFormat: (
|
|
2624
|
+
const C = new tf(me);
|
|
2625
|
+
if (e.tooltips && C.use(wa({ numberFormat: (Ve = e.horizontalAxis) == null ? void 0 : Ve.numberFormat })), e.crosshair && C.use(Pa({
|
|
2617
2626
|
width: $,
|
|
2618
2627
|
height: S,
|
|
2619
2628
|
direction: e.crosshairDirection,
|
|
@@ -2623,23 +2632,23 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2623
2632
|
})), (Ee = e.annotations) != null && Ee.length && C.use(Xa(e.annotations, {
|
|
2624
2633
|
scaleX: W,
|
|
2625
2634
|
scaleY: F,
|
|
2626
|
-
data:
|
|
2635
|
+
data: V,
|
|
2627
2636
|
width: $,
|
|
2628
2637
|
height: S,
|
|
2629
|
-
backgroundColor:
|
|
2638
|
+
backgroundColor: Tt(t),
|
|
2630
2639
|
orientation: ct.Horizontal,
|
|
2631
2640
|
transition: r,
|
|
2632
2641
|
priorAnnotations: s
|
|
2633
|
-
})), C.draw(
|
|
2642
|
+
})), C.draw(V), e.valueLabels) {
|
|
2634
2643
|
const O = p.select(w).append("g");
|
|
2635
|
-
|
|
2644
|
+
rf(O, V, F, W, {
|
|
2636
2645
|
position: y,
|
|
2637
2646
|
colorOverrides: $e,
|
|
2638
|
-
colors: e.colors ??
|
|
2647
|
+
colors: e.colors ?? Va,
|
|
2639
2648
|
swapLabelValue: x,
|
|
2640
2649
|
categoryLabelOffset: B,
|
|
2641
2650
|
percent: e.valueLabels === "percent",
|
|
2642
|
-
total: p.sum(
|
|
2651
|
+
total: p.sum(V, (Q) => Q.value)
|
|
2643
2652
|
});
|
|
2644
2653
|
}
|
|
2645
2654
|
}
|
|
@@ -2650,9 +2659,9 @@ function Mi(t, a, e = {}, r = !1) {
|
|
|
2650
2659
|
L.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", C + Os / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(M);
|
|
2651
2660
|
}
|
|
2652
2661
|
}
|
|
2653
|
-
Ut(t, { chartType: "bar-horizontal", margin: P }), n && (
|
|
2662
|
+
Ut(t, { chartType: "bar-horizontal", margin: P }), n && (Vt(me.node()), _t(t, n));
|
|
2654
2663
|
}
|
|
2655
|
-
function
|
|
2664
|
+
function af(t, a, e, r, n = 0) {
|
|
2656
2665
|
const s = r === Fe.Inside, l = (e(t.label) ?? 0) + n + (e.bandwidth() - n) / 2;
|
|
2657
2666
|
let o, c;
|
|
2658
2667
|
if (t.value < 0) {
|
|
@@ -2664,7 +2673,7 @@ function tf(t, a, e, r, n = 0) {
|
|
|
2664
2673
|
}
|
|
2665
2674
|
return { tx: o, ty: l, anchor: c, isInside: s };
|
|
2666
2675
|
}
|
|
2667
|
-
function
|
|
2676
|
+
function rf(t, a, e, r, n) {
|
|
2668
2677
|
const s = n.position ?? Fe.Auto, l = n.categoryLabelOffset ?? 0, o = (b) => n.swapLabelValue ? b.label : n.percent && n.total !== void 0 ? Or(b.value, n.total) : String(b.value);
|
|
2669
2678
|
let c = t.select(".bc-value-label-group");
|
|
2670
2679
|
c.empty() && (c = t.append("g").attr("class", "bc-value-label-group"));
|
|
@@ -2677,17 +2686,17 @@ function af(t, a, e, r, n) {
|
|
|
2677
2686
|
key: (b) => b.label,
|
|
2678
2687
|
insert: (b) => b.append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("dominant-baseline", "central"),
|
|
2679
2688
|
attrs: (b) => {
|
|
2680
|
-
const m =
|
|
2689
|
+
const m = af(b, e, r, s, l);
|
|
2681
2690
|
return {
|
|
2682
2691
|
x: m.tx,
|
|
2683
2692
|
y: m.ty,
|
|
2684
2693
|
"text-anchor": m.anchor,
|
|
2685
|
-
fill: m.isInside ?
|
|
2694
|
+
fill: m.isInside ? Bt(n.colorOverrides.get(b.label) ?? n.colors[0]) : "currentColor"
|
|
2686
2695
|
};
|
|
2687
2696
|
}
|
|
2688
2697
|
}), c.selectAll(".bc-value-label").data(a, (b) => b.label).text(o);
|
|
2689
2698
|
}
|
|
2690
|
-
function
|
|
2699
|
+
function nf(t, a) {
|
|
2691
2700
|
const e = t.labels.map((r, n) => ({ label: r, value: t.values[n] }));
|
|
2692
2701
|
return a.sort === ut.Ascending ? e.sort((r, n) => r.value - n.value) : a.sort === ut.Descending && e.sort((r, n) => n.value - r.value), e.map((r) => r.label);
|
|
2693
2702
|
}
|
|
@@ -2716,11 +2725,11 @@ function Xe(t, a, e, r) {
|
|
|
2716
2725
|
const n = ua(t, r);
|
|
2717
2726
|
return (n == null ? void 0 : n.color) ?? e[a % e.length];
|
|
2718
2727
|
}
|
|
2719
|
-
function
|
|
2728
|
+
function sf(t, a) {
|
|
2720
2729
|
const e = ua(t, a);
|
|
2721
2730
|
return (e == null ? void 0 : e.dash) ?? "solid";
|
|
2722
2731
|
}
|
|
2723
|
-
function
|
|
2732
|
+
function of(t, a) {
|
|
2724
2733
|
const e = ua(t, a);
|
|
2725
2734
|
return (e == null ? void 0 : e.lineWidth) ?? 2;
|
|
2726
2735
|
}
|
|
@@ -2744,7 +2753,7 @@ function or(t, a) {
|
|
|
2744
2753
|
const e = ua(t, a);
|
|
2745
2754
|
return (e == null ? void 0 : e.opacity) ?? 1;
|
|
2746
2755
|
}
|
|
2747
|
-
function
|
|
2756
|
+
function lf(t, a, e) {
|
|
2748
2757
|
const r = ua(t, e);
|
|
2749
2758
|
if ((r == null ? void 0 : r.lineSymbols) !== !1 && ((r == null ? void 0 : r.lineSymbols) === !0 || a))
|
|
2750
2759
|
return {
|
|
@@ -2757,7 +2766,7 @@ function of(t, a, e) {
|
|
|
2757
2766
|
lineSymbols: !0
|
|
2758
2767
|
};
|
|
2759
2768
|
}
|
|
2760
|
-
const
|
|
2769
|
+
const cf = [
|
|
2761
2770
|
"#4e79a7",
|
|
2762
2771
|
"#f28e2b",
|
|
2763
2772
|
"#e15759",
|
|
@@ -2767,26 +2776,26 @@ const lf = [
|
|
|
2767
2776
|
"#b07aa1",
|
|
2768
2777
|
"#ff9da7"
|
|
2769
2778
|
];
|
|
2770
|
-
class
|
|
2779
|
+
class ff extends ht {
|
|
2771
2780
|
initialize() {
|
|
2772
2781
|
}
|
|
2773
2782
|
}
|
|
2774
|
-
function
|
|
2775
|
-
var de, Ce, Oe, _e, Ue, Ze, Qe, gt, pt, je, Ot,
|
|
2783
|
+
function df(t, a, e = {}, r = !1) {
|
|
2784
|
+
var de, Ce, Oe, _e, Ue, Ze, Qe, gt, pt, je, Ot, Dt, pe;
|
|
2776
2785
|
qt(r);
|
|
2777
2786
|
let n = null, s, l;
|
|
2778
2787
|
const o = Rt.for(t);
|
|
2779
2788
|
if (r) {
|
|
2780
2789
|
const T = Xt(t);
|
|
2781
|
-
l = T == null ? void 0 : T.margin, o.detach(), T && T.chartType !== "bar-multi" && (n =
|
|
2790
|
+
l = T == null ? void 0 : T.margin, o.detach(), T && T.chartType !== "bar-multi" && (n = Gt(t)), s = /* @__PURE__ */ new Map();
|
|
2782
2791
|
for (const he of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
2783
|
-
for (const [K, Me] of
|
|
2792
|
+
for (const [K, Me] of zt(he))
|
|
2784
2793
|
s.set(K, Me);
|
|
2785
2794
|
t.replaceChildren();
|
|
2786
2795
|
}
|
|
2787
|
-
const { body: c } = Ht(t, e.frame), d = a.series ?? [], u = d.filter((T) => !Da(T.name, e.seriesOverrides)), g = u.map((T) => T.name), b = e.colors ??
|
|
2788
|
-
j !== void 0 && (
|
|
2789
|
-
const _ =
|
|
2796
|
+
const { body: c } = Ht(t, e.frame), d = a.series ?? [], u = d.filter((T) => !Da(T.name, e.seriesOverrides)), g = u.map((T) => T.name), b = e.colors ?? cf, 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, w = Pt(c).width, $ = 350, S = e.legendPosition ?? "top", P = w > 0 && w < $ && (S === "left" || S === "right") ? "top" : S, B = e.legendAnchor ?? "start", I = u.flatMap((T) => T.values), X = Ma(I, (de = e.verticalAxis) == null ? void 0 : de.range, (Ce = e.verticalAxis) == null ? void 0 : Ce.numberFormat, (Oe = e.verticalAxis) == null ? void 0 : Oe.scaleType), V = ra(w, (_e = e.verticalAxis) == null ? void 0 : _e.labelPosition, (Ue = e.horizontalAxis) == null ? void 0 : Ue.labelPosition, (Ze = e.verticalAxis) == null ? void 0 : Ze.direction, X), G = Math.max(0, w - (V.left ?? 50) - (V.right ?? 20)), j = yn(a.labels, G, e.horizontalAxis);
|
|
2797
|
+
j !== void 0 && (V.bottom = j);
|
|
2798
|
+
const _ = V.top != null, ne = Math.max(0, w - (V.left ?? 50) - (V.right ?? 20)), ie = x ? Sa(g, P, ne) : { width: 0, height: 0 }, ae = x ? ie.height + 15 : 0, F = { ...V };
|
|
2790
2799
|
if (x && P === "top") {
|
|
2791
2800
|
const T = _ ? 15 : 0;
|
|
2792
2801
|
F.top = ae + T;
|
|
@@ -2826,10 +2835,10 @@ function ff(t, a, e = {}, r = !1) {
|
|
|
2826
2835
|
ze.push({ label: T, series: qe, seriesName: K.name, value: K.values[he], seriesIndex: Me });
|
|
2827
2836
|
});
|
|
2828
2837
|
});
|
|
2829
|
-
const Ne = e.valueLabels ?? !1, Z = H.ownerSVGElement, U = na(Z, t, "bars", { x: 0, y: 0, width: W, height: oe }), Ae = p.select(H).append("g").attr("clip-path", `url(#${U})`), Te = za(t), fe = ja(e.highlights), Le = oa(e.colorizes),
|
|
2838
|
+
const Ne = e.valueLabels ?? !1, Z = H.ownerSVGElement, U = na(Z, t, "bars", { x: 0, y: 0, width: W, height: oe }), Ae = p.select(H).append("g").attr("clip-path", `url(#${U})`), Te = za(t), fe = ja(e.highlights), Le = oa(e.colorizes), Ve = Ae.append("g").node();
|
|
2830
2839
|
Ua(Te, {
|
|
2831
2840
|
role: "mark-per-cell",
|
|
2832
|
-
parent:
|
|
2841
|
+
parent: Ve,
|
|
2833
2842
|
selector: ".bc-bar-multi",
|
|
2834
2843
|
data: ze,
|
|
2835
2844
|
key: (T) => `${T.label}\0${T.seriesName}`,
|
|
@@ -2846,8 +2855,8 @@ function ff(t, a, e = {}, r = !1) {
|
|
|
2846
2855
|
return K < 1 && (Me["fill-opacity"] = K), fe.size > 0 ? { ...Me, opacity: rt(fe, T.seriesName) } : Me;
|
|
2847
2856
|
}
|
|
2848
2857
|
});
|
|
2849
|
-
const Ee = new
|
|
2850
|
-
if (e.tooltips && Ee.use(wa({ numberFormat: (
|
|
2858
|
+
const Ee = new ff(Ae);
|
|
2859
|
+
if (e.tooltips && Ee.use(wa({ numberFormat: (Dt = e.verticalAxis) == null ? void 0 : Dt.numberFormat })), e.crosshair && Ee.use(Pa({
|
|
2851
2860
|
width: W,
|
|
2852
2861
|
height: oe,
|
|
2853
2862
|
direction: e.crosshairDirection,
|
|
@@ -2858,14 +2867,14 @@ function ff(t, a, e = {}, r = !1) {
|
|
|
2858
2867
|
label: he,
|
|
2859
2868
|
value: Math.max(...u.map((Me) => Me.values[K] ?? 0))
|
|
2860
2869
|
}));
|
|
2861
|
-
Ee.use(Xa(e.annotations, { scaleX: we, scaleY: ce, data: T, width: W, height: oe, backgroundColor:
|
|
2870
|
+
Ee.use(Xa(e.annotations, { scaleX: we, scaleY: ce, data: T, width: W, height: oe, backgroundColor: Tt(t), transition: r, priorAnnotations: s }));
|
|
2862
2871
|
}
|
|
2863
|
-
Ee.draw(ze), Ut(t, { chartType: "bar-multi", margin: le }), n && (
|
|
2872
|
+
Ee.draw(ze), Ut(t, { chartType: "bar-multi", margin: le }), n && (Vt(Ae.node()), _t(t, n));
|
|
2864
2873
|
const L = /* @__PURE__ */ new Set();
|
|
2865
2874
|
u.forEach((T) => {
|
|
2866
2875
|
ya(T.name, y, m) === "direct" && L.add(T.name);
|
|
2867
2876
|
});
|
|
2868
|
-
const M = L.size > 0, C =
|
|
2877
|
+
const M = L.size > 0, C = Tt(t), O = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? vt.Auto : vt.Off, Q = e.directLabelAnchor ?? "middle", q = e.valueLabelPosition ?? Fe.Auto;
|
|
2869
2878
|
function R() {
|
|
2870
2879
|
return q === Fe.Inside ? Fe.Inside : (q === Fe.Outside, Fe.Outside);
|
|
2871
2880
|
}
|
|
@@ -2880,23 +2889,23 @@ function ff(t, a, e = {}, r = !1) {
|
|
|
2880
2889
|
if (!Ka(T.seriesName, Ne, m))
|
|
2881
2890
|
return;
|
|
2882
2891
|
const he = (we(T.label) ?? 0) + (be(T.series) ?? 0) + be.bandwidth() / 2, K = Math.min(ce(0), ce(T.value)), Me = Math.abs(ce(T.value) - ce(0)), qe = R(), nt = M && L.has(T.seriesName), At = T.value < 0, ft = K + Me;
|
|
2883
|
-
let
|
|
2892
|
+
let Et, Yt, la;
|
|
2884
2893
|
if (qe === Fe.Inside) {
|
|
2885
2894
|
const ee = Xe(T.seriesName, T.seriesIndex, b, m);
|
|
2886
|
-
Yt =
|
|
2895
|
+
Yt = Bt(ee), la = "central", nt && J() === Fe.Inside ? Et = re(K, Me, Q) + 14 : Et = K + Me / 2;
|
|
2887
2896
|
} else
|
|
2888
|
-
Yt = "currentColor", At ? (
|
|
2889
|
-
ke.append("text").attr("class", "bc-value-label").attr("data-series", T.seriesName).attr("x", he).attr("y",
|
|
2897
|
+
Yt = "currentColor", At ? (Et = nt && J() === Fe.Outside ? ft + 16 : ft + 4, la = "hanging") : (Et = nt && J() === Fe.Outside ? K - 16 : K - 4, la = "auto");
|
|
2898
|
+
ke.append("text").attr("class", "bc-value-label").attr("data-series", T.seriesName).attr("x", he).attr("y", Et).attr("text-anchor", "middle").attr("dominant-baseline", la).attr("font-size", "11px").attr("fill", Yt).text(String(T.value));
|
|
2890
2899
|
}), ze.forEach((T) => {
|
|
2891
|
-
var
|
|
2900
|
+
var Et;
|
|
2892
2901
|
if (!L.has(T.seriesName))
|
|
2893
2902
|
return;
|
|
2894
|
-
const he = (we(T.label) ?? 0) + (be(T.series) ?? 0) + be.bandwidth() / 2, K = Math.min(ce(0), ce(T.value)), Me = Math.abs(ce(T.value) - ce(0)), qe = ((
|
|
2903
|
+
const he = (we(T.label) ?? 0) + (be(T.series) ?? 0) + be.bandwidth() / 2, K = Math.min(ce(0), ce(T.value)), Me = Math.abs(ce(T.value) - ce(0)), qe = ((Et = m == null ? void 0 : m.find((Yt) => Yt.name === T.seriesName)) == null ? void 0 : Et.labelText) || T.seriesName, nt = J(), At = Xe(T.seriesName, T.seriesIndex, b, m), ft = p.select(H).append("text").attr("class", "bc-direct-label").attr("data-series", T.seriesName).attr("x", he).attr("text-anchor", "middle").attr("font-size", "10px").text(qe);
|
|
2895
2904
|
if (nt === Fe.Inside) {
|
|
2896
2905
|
const Yt = re(K, Me, Q);
|
|
2897
|
-
ft.attr("y", Yt).attr("fill",
|
|
2906
|
+
ft.attr("y", Yt).attr("fill", Bt(At)), Q === "middle" && ft.attr("dominant-baseline", "central");
|
|
2898
2907
|
} else
|
|
2899
|
-
ft.attr("y", K - 4).attr("fill",
|
|
2908
|
+
ft.attr("y", K - 4).attr("fill", ri(At, C));
|
|
2900
2909
|
});
|
|
2901
2910
|
const Y = g.filter((T) => ya(T, y, m) === "legend");
|
|
2902
2911
|
if (x && Y.length > 0) {
|
|
@@ -2912,7 +2921,7 @@ function ff(t, a, e = {}, r = !1) {
|
|
|
2912
2921
|
Aa(H, Y, T, K, P, B, W, oe, he, [], { left: le.left, right: le.right });
|
|
2913
2922
|
}
|
|
2914
2923
|
}
|
|
2915
|
-
const
|
|
2924
|
+
const uf = {
|
|
2916
2925
|
linear: p.curveLinear,
|
|
2917
2926
|
monotoneX: p.curveMonotoneX,
|
|
2918
2927
|
step: p.curveStep,
|
|
@@ -2923,7 +2932,7 @@ const df = {
|
|
|
2923
2932
|
catmullRom: p.curveCatmullRom
|
|
2924
2933
|
};
|
|
2925
2934
|
function Ca(t) {
|
|
2926
|
-
return t &&
|
|
2935
|
+
return t && uf[t] || p.curveLinear;
|
|
2927
2936
|
}
|
|
2928
2937
|
function Pi(t) {
|
|
2929
2938
|
const a = (t == null ? void 0 : t.position) ?? Fe.Auto, e = (t == null ? void 0 : t.orientation) ?? ct.Vertical, r = t != null && t.format ? p.format(t.format) : (n) => String(n);
|
|
@@ -2945,7 +2954,7 @@ function Pi(t) {
|
|
|
2945
2954
|
}
|
|
2946
2955
|
else
|
|
2947
2956
|
w = a === Fe.Inside, m = c + u / 2, y = "middle", b ? w ? (v = d + g / 2, x = "central") : (v = d + g + 4, x = "hanging") : w ? (v = d + g / 2, x = "central") : (v = d - 4, x = "auto");
|
|
2948
|
-
const $ = o.attr("fill") || "#ccc", S = w ?
|
|
2957
|
+
const $ = o.attr("fill") || "#ccc", S = w ? Bt($) : "currentColor";
|
|
2949
2958
|
p.select(this.parentNode).append("text").attr("class", "bc-value-label").attr("x", m).attr("y", v).attr("text-anchor", y).attr("dominant-baseline", x).attr("font-size", "11px").attr("fill", S).text(r(l.value));
|
|
2950
2959
|
}), s.selectAll(".bc-dot").each(function(l) {
|
|
2951
2960
|
const o = p.select(this), c = parseFloat(o.attr("cx")), d = parseFloat(o.attr("cy"));
|
|
@@ -2959,7 +2968,7 @@ function Er(t) {
|
|
|
2959
2968
|
const a = Ra.get(t);
|
|
2960
2969
|
a && (Ra.delete(t), a());
|
|
2961
2970
|
}
|
|
2962
|
-
function
|
|
2971
|
+
function hf() {
|
|
2963
2972
|
if (document.getElementById("bc-tooltip-styles"))
|
|
2964
2973
|
return;
|
|
2965
2974
|
const t = document.createElement("style");
|
|
@@ -2979,7 +2988,7 @@ function uf() {
|
|
|
2979
2988
|
}
|
|
2980
2989
|
`, document.head.appendChild(t);
|
|
2981
2990
|
}
|
|
2982
|
-
function
|
|
2991
|
+
function gf(t) {
|
|
2983
2992
|
const a = t ? va(t) : null, e = (r) => a ? a(r) : String(r);
|
|
2984
2993
|
return (r) => r.series ? `${r.series} – ${r.label}: ${e(r.value)}` : `${r.label}: ${e(r.value)}`;
|
|
2985
2994
|
}
|
|
@@ -2993,7 +3002,7 @@ function Nr(t, a) {
|
|
|
2993
3002
|
crosshairDirection: o = yt.Both,
|
|
2994
3003
|
crosshairStyle: c = ea.Dashed,
|
|
2995
3004
|
crosshairColor: d = "#999",
|
|
2996
|
-
format: u =
|
|
3005
|
+
format: u = gf(a.numberFormat),
|
|
2997
3006
|
container: g
|
|
2998
3007
|
} = a;
|
|
2999
3008
|
if (n.length === 0) {
|
|
@@ -3003,12 +3012,12 @@ function Nr(t, a) {
|
|
|
3003
3012
|
}
|
|
3004
3013
|
const b = c === ea.Solid ? "none" : c === ea.Dotted ? "2,2" : "4,3", m = [...new Set(n.map((ae) => ae.cx))].sort((ae, F) => ae - F), v = p.select(t);
|
|
3005
3014
|
let y = null;
|
|
3006
|
-
s && (
|
|
3015
|
+
s && (hf(), y = document.createElement("div"), y.className = zi, document.body.appendChild(y));
|
|
3007
3016
|
const x = ".bc-annotations", w = !v.select(x).empty(), $ = (ae) => w ? v.insert(ae, x) : v.append(ae), S = l && (o === yt.Both || o === yt.Vertical), P = l && (o === yt.Both || o === yt.Horizontal);
|
|
3008
3017
|
let B = null, I = null;
|
|
3009
3018
|
S && (B = $("line").attr("class", "bc-crosshair bc-crosshair-v").attr("y1", 0).attr("y2", r).attr("stroke", d).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none")), P && (I = $("line").attr("class", "bc-crosshair bc-crosshair-h").attr("x1", 0).attr("x2", e).attr("stroke", d).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none"));
|
|
3010
|
-
const X = $("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"),
|
|
3011
|
-
function
|
|
3019
|
+
const X = $("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"), V = $("rect").attr("class", "bc-proximity-overlay").attr("width", e).attr("height", r).attr("fill", "none").attr("pointer-events", "all");
|
|
3020
|
+
function G(ae, F) {
|
|
3012
3021
|
if (m.length === 0)
|
|
3013
3022
|
return null;
|
|
3014
3023
|
const H = p.bisectCenter(m, ae), W = m[H], oe = n.filter((se) => se.cx === W);
|
|
@@ -3022,7 +3031,7 @@ function Nr(t, a) {
|
|
|
3022
3031
|
return le;
|
|
3023
3032
|
}
|
|
3024
3033
|
const j = (ae) => {
|
|
3025
|
-
const [F, H] = p.pointer(ae, t), W =
|
|
3034
|
+
const [F, H] = p.pointer(ae, t), W = G(F, H);
|
|
3026
3035
|
W && (X.attr("cx", W.cx).attr("cy", W.cy).attr("stroke", W.color).style("display", null), y && (y.textContent = u(W), y.style.display = "block", js(X.node(), y, {
|
|
3027
3036
|
placement: "top",
|
|
3028
3037
|
middleware: [Ks(8), Zs(), Js()]
|
|
@@ -3031,38 +3040,38 @@ function Nr(t, a) {
|
|
|
3031
3040
|
})), B && B.attr("x1", W.cx).attr("x2", W.cx).style("display", null), I && I.attr("y1", W.cy).attr("y2", W.cy).style("display", null));
|
|
3032
3041
|
}, _ = () => {
|
|
3033
3042
|
X.style("display", "none"), y && (y.style.display = "none"), B && B.style("display", "none"), I && I.style("display", "none");
|
|
3034
|
-
}, ne =
|
|
3043
|
+
}, ne = V.node();
|
|
3035
3044
|
ne.addEventListener("mousemove", j), ne.addEventListener("mouseleave", _);
|
|
3036
3045
|
const ie = () => {
|
|
3037
|
-
ne.removeEventListener("mousemove", j), ne.removeEventListener("mouseleave", _),
|
|
3046
|
+
ne.removeEventListener("mousemove", j), ne.removeEventListener("mouseleave", _), V.remove(), X.remove(), y && (y.remove(), y = null), B && B.remove(), I && I.remove(), g && Ra.get(g) === ie && Ra.delete(g);
|
|
3038
3047
|
};
|
|
3039
3048
|
return g && Ra.set(g, ie), ie;
|
|
3040
3049
|
}
|
|
3041
|
-
const
|
|
3050
|
+
const pf = p.symbolTriangle2 ?? p.symbolTriangle, bf = {
|
|
3042
3051
|
circle: p.symbolCircle,
|
|
3043
3052
|
square: p.symbolSquare,
|
|
3044
3053
|
diamond: p.symbolDiamond,
|
|
3045
3054
|
triangle: p.symbolTriangle,
|
|
3046
|
-
triangleDown:
|
|
3055
|
+
triangleDown: pf,
|
|
3047
3056
|
cross: p.symbolCross,
|
|
3048
3057
|
star: p.symbolStar
|
|
3049
3058
|
};
|
|
3050
|
-
function
|
|
3059
|
+
function mf(t, a, e) {
|
|
3051
3060
|
switch (e) {
|
|
3052
|
-
case
|
|
3061
|
+
case It.First:
|
|
3053
3062
|
return t === 0;
|
|
3054
|
-
case
|
|
3063
|
+
case It.Last:
|
|
3055
3064
|
return t === a - 1;
|
|
3056
|
-
case
|
|
3065
|
+
case It.FirstLast:
|
|
3057
3066
|
return t === 0 || t === a - 1;
|
|
3058
|
-
case
|
|
3067
|
+
case It.All:
|
|
3059
3068
|
default:
|
|
3060
3069
|
return !0;
|
|
3061
3070
|
}
|
|
3062
3071
|
}
|
|
3063
3072
|
function kn(t, a, e, r, n = !1) {
|
|
3064
|
-
const s = r.symbol ??
|
|
3065
|
-
if (s ===
|
|
3073
|
+
const s = r.symbol ?? Nt.Circle, l = r.showOn ?? It.FirstLast, o = r.style ?? wt.Filled, c = r.size ?? 3.5, d = r.opacity ?? 1, u = "var(--bs-body-bg, #fff)", g = a.filter((m) => mf(m.index, e, l)), b = n ? Be() : 0;
|
|
3074
|
+
if (s === Nt.Circle) {
|
|
3066
3075
|
t.selectAll("path.bc-symbol").remove();
|
|
3067
3076
|
const m = t.selectAll("circle.bc-symbol").data(g).join(
|
|
3068
3077
|
(y) => y.append("circle").attr("class", "bc-symbol").attr("cx", (x) => x.cx).attr("cy", (x) => x.cy).attr("r", c).attr("fill", (x) => o === wt.Filled ? x.color : u).attr("stroke", (x) => x.color).attr("stroke-width", o === wt.Hollow ? 1.5 : 0).attr("opacity", d),
|
|
@@ -3071,7 +3080,7 @@ function kn(t, a, e, r, n = !1) {
|
|
|
3071
3080
|
);
|
|
3072
3081
|
(n ? m.transition().duration(b) : m).attr("cx", (y) => y.cx).attr("cy", (y) => y.cy).attr("r", c).attr("fill", (y) => o === wt.Filled ? y.color : u).attr("stroke", (y) => y.color).attr("stroke-width", o === wt.Hollow ? 1.5 : 0).attr("opacity", d);
|
|
3073
3082
|
} else {
|
|
3074
|
-
const m =
|
|
3083
|
+
const m = bf[s] ?? p.symbolCircle, v = Math.PI * c * c, y = p.symbol().type(m).size(v);
|
|
3075
3084
|
t.selectAll("circle.bc-symbol").remove();
|
|
3076
3085
|
const x = t.selectAll("path.bc-symbol").data(g).join(
|
|
3077
3086
|
($) => $.append("path").attr("class", "bc-symbol").attr("transform", (S) => `translate(${S.cx},${S.cy})`).attr("d", y).attr("fill", (S) => o === wt.Filled ? S.color : u).attr("stroke", (S) => S.color).attr("stroke-width", o === wt.Hollow ? 1.5 : 0).attr("opacity", d),
|
|
@@ -3082,7 +3091,7 @@ function kn(t, a, e, r, n = !1) {
|
|
|
3082
3091
|
}
|
|
3083
3092
|
}
|
|
3084
3093
|
const Di = "#4e79a7";
|
|
3085
|
-
class
|
|
3094
|
+
class yf extends ht {
|
|
3086
3095
|
initialize() {
|
|
3087
3096
|
this.configDefine("xPos", { defaultValue: (n, s) => 0 }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("color", { defaultValue: Di }), this.configDefine("curve", { defaultValue: p.curveLinear }), this.configDefine("areaFill", { defaultValue: !1 }), this.configDefine("areaFillOpacity", { defaultValue: 0.2 }), this.configDefine("height", { defaultValue: 0 });
|
|
3088
3097
|
const a = this.base.append("g"), e = this.base.append("g"), r = this.base.append("g");
|
|
@@ -3146,34 +3155,34 @@ class mf extends ht {
|
|
|
3146
3155
|
});
|
|
3147
3156
|
}
|
|
3148
3157
|
}
|
|
3149
|
-
function
|
|
3150
|
-
var me, ce, Ie, ze, Ne, Z, U, Ae, Te, fe, Le,
|
|
3158
|
+
function vf(t, a, e = {}, r = !1) {
|
|
3159
|
+
var me, ce, Ie, ze, Ne, Z, U, Ae, Te, fe, Le, Ve, Ee;
|
|
3151
3160
|
qt(r), Er(t);
|
|
3152
3161
|
let n = [], s = [], l = [], o = null, c = null, d, u;
|
|
3153
3162
|
const g = Rt.for(t);
|
|
3154
3163
|
if (r) {
|
|
3155
3164
|
const L = Xt(t);
|
|
3156
|
-
u = L == null ? void 0 : L.margin, g.detach(), (L == null ? void 0 : L.chartType) === "line" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), l = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), o = t.querySelector(".bc-frame .bc-symbols")) : L && (c =
|
|
3165
|
+
u = L == null ? void 0 : L.margin, g.detach(), (L == null ? void 0 : L.chartType) === "line" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), l = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), o = t.querySelector(".bc-frame .bc-symbols")) : L && (c = Gt(t)), d = /* @__PURE__ */ new Map();
|
|
3157
3166
|
for (const M of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3158
|
-
for (const [C, O] of
|
|
3167
|
+
for (const [C, O] of zt(M))
|
|
3159
3168
|
d.set(C, O);
|
|
3160
3169
|
t.replaceChildren();
|
|
3161
3170
|
}
|
|
3162
|
-
const { body: b } = Ht(t, e.frame), m =
|
|
3171
|
+
const { body: b } = Ht(t, e.frame), m = Pt(b).width, v = Ma(a.values, (me = e.verticalAxis) == null ? void 0 : me.range, (ce = e.verticalAxis) == null ? void 0 : ce.numberFormat, (Ie = e.verticalAxis) == null ? void 0 : Ie.scaleType), y = ra(m, (ze = e.verticalAxis) == null ? void 0 : ze.labelPosition, (Ne = e.horizontalAxis) == null ? void 0 : Ne.labelPosition, (Z = e.verticalAxis) == null ? void 0 : Z.direction, v), { chartArea: x, width: w, height: $, margin: S } = Wt(b, y), P = aa(u, S), B = zr(a.labels, (U = e.horizontalAxis) == null ? void 0 : U.range), I = B.map((L) => a.labels[L]), X = B.map((L) => a.values[L]), V = I.map((L, M) => ({
|
|
3163
3172
|
label: L,
|
|
3164
3173
|
value: X[M]
|
|
3165
|
-
})),
|
|
3174
|
+
})), G = p.scalePoint().domain(I).range([0, w]).padding(e.edgePadding ? 0.6 : 0), j = G, _ = (L) => G(L.label) ?? 0, ne = ((Ae = e.verticalAxis) == null ? void 0 : Ae.scaleType) === "log", [ie, ae] = qa(X, (Te = e.verticalAxis) == null ? void 0 : Te.range, (fe = e.verticalAxis) == null ? void 0 : fe.scaleType), F = ne ? p.scaleSymlog().domain([ie, ae]).nice().range([$, 0]) : p.scaleLinear().domain([ie, ae]).nice().range([$, 0]), H = F.domain(), W = H[0] < 0 && H[1] > 0 ? F(0) : void 0;
|
|
3166
3175
|
g.attach(x, P), g.update({
|
|
3167
3176
|
vertical: { scale: F, height: $, options: { ...e.verticalAxis, gridWidth: w, topPadding: S.top } },
|
|
3168
3177
|
horizontal: { scale: j, height: $, options: { ...e.horizontalAxis, width: w, zeroY: W } }
|
|
3169
3178
|
});
|
|
3170
|
-
const oe = x.ownerSVGElement, le = na(oe, t, "plot", { x: -1, y: -1, width: w + 2, height: $ + 2 }), $e = p.select(x).append("g").attr("clip-path", `url(#${le})`), se = $e.node(), Se = ((Le = e.colors) == null ? void 0 : Le[0]) ?? Di, ye = Ca(e.interpolation), we = e.lineSymbols, be = new
|
|
3179
|
+
const oe = x.ownerSVGElement, le = na(oe, t, "plot", { x: -1, y: -1, width: w + 2, height: $ + 2 }), $e = p.select(x).append("g").attr("clip-path", `url(#${le})`), se = $e.node(), Se = ((Le = e.colors) == null ? void 0 : Le[0]) ?? Di, ye = Ca(e.interpolation), we = e.lineSymbols, be = new yf(p.select(se));
|
|
3171
3180
|
if (be.config({ xPos: _, y: F, color: Se, curve: ye, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: $ }), s.length > 0 || n.length > 0 || l.length > 0) {
|
|
3172
3181
|
const L = (P == null ? void 0 : P.dx) ?? 0, M = (P == null ? void 0 : P.dy) ?? 0, C = se.querySelectorAll(":scope > g");
|
|
3173
3182
|
C[0] && St(C[0], n, L, M), C[1] && St(C[1], s, L, M), C[2] && St(C[2], l, L, M);
|
|
3174
3183
|
}
|
|
3175
|
-
if (e.valueLabels && be.use(Pi({ position: e.valueLabelPosition, orientation: ct.Vertical })), be.draw(
|
|
3176
|
-
const L =
|
|
3184
|
+
if (e.valueLabels && be.use(Pi({ position: e.valueLabelPosition, orientation: ct.Vertical })), be.draw(V), (Ve = e.annotations) != null && Ve.length && Dr(x, e.annotations, { scaleX: j, scaleY: F, data: V, width: w, height: $, backgroundColor: Tt(t), transition: r, priorAnnotations: d }), p.select(se).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
|
|
3185
|
+
const L = V.map((M) => ({
|
|
3177
3186
|
cx: _(M),
|
|
3178
3187
|
cy: F(M.value),
|
|
3179
3188
|
label: M.label,
|
|
@@ -3194,16 +3203,16 @@ function yf(t, a, e = {}, r = !1) {
|
|
|
3194
3203
|
});
|
|
3195
3204
|
}
|
|
3196
3205
|
if (we) {
|
|
3197
|
-
const L =
|
|
3206
|
+
const L = V.map((C, O) => ({
|
|
3198
3207
|
cx: _(C),
|
|
3199
3208
|
cy: F(C.value),
|
|
3200
3209
|
color: Se,
|
|
3201
3210
|
index: O
|
|
3202
3211
|
}));
|
|
3203
3212
|
let M;
|
|
3204
|
-
o ? (x.appendChild(o), M = p.select(o)) : M = p.select(x).append("g").attr("class", "bc-symbols"), kn(M, L,
|
|
3213
|
+
o ? (x.appendChild(o), M = p.select(o)) : M = p.select(x).append("g").attr("class", "bc-symbols"), kn(M, L, V.length, we, r);
|
|
3205
3214
|
}
|
|
3206
|
-
Ut(t, { chartType: "line", margin: S }), c && (
|
|
3215
|
+
Ut(t, { chartType: "line", margin: S }), c && (Vt($e.node()), _t(t, c));
|
|
3207
3216
|
}
|
|
3208
3217
|
const Ln = 28, Ei = 18, Ni = 20;
|
|
3209
3218
|
function $n(t, a, e, r = Ln) {
|
|
@@ -3237,10 +3246,10 @@ function Fi(t, a, e) {
|
|
|
3237
3246
|
const I = P.showLabel !== !1, X = P.showValue !== !1;
|
|
3238
3247
|
if (!I && !X)
|
|
3239
3248
|
return;
|
|
3240
|
-
const
|
|
3249
|
+
const G = w[B] - Math.PI / 2, j = Math.cos(G) * l, _ = Math.sin(G) * l, ne = Math.cos(G) * o, ie = Math.sin(G) * o, ae = ne + $ * Ni;
|
|
3241
3250
|
S.append("polyline").attr("class", "bc-arc-label-line").attr("points", `${j},${_} ${ne},${ie} ${ae},${ie}`).attr("fill", "none").attr("stroke", "var(--bc-text-color, #999)").attr("stroke-width", 1).attr("opacity", 0.5);
|
|
3242
3251
|
const F = ae + $ * 4, H = S.append("text").attr("class", "bc-arc-direct-label").attr("x", F).attr("y", ie).attr("text-anchor", m ? "start" : "end").attr("font-size", `${n}px`);
|
|
3243
|
-
if (I && H.append("tspan").attr("x", F).attr("dy", X ? "-0.1em" : "0.35em").attr("font-weight", "bold").attr("fill",
|
|
3252
|
+
if (I && H.append("tspan").attr("x", F).attr("dy", X ? "-0.1em" : "0.35em").attr("font-weight", "bold").attr("fill", ri(P.color, s)).text(P.label), X) {
|
|
3244
3253
|
const W = P.displayAsPercentage && P.percentage != null ? `${Math.round(P.percentage)}%` : String(P.value);
|
|
3245
3254
|
H.append("tspan").attr("x", F).attr("dy", I ? "1.2em" : "0.35em").attr("fill", "var(--bc-text-color, #666)").text(W);
|
|
3246
3255
|
}
|
|
@@ -3257,14 +3266,14 @@ function Bi(t, a, e) {
|
|
|
3257
3266
|
const u = c.showLabel !== !1, g = c.showValue !== !1;
|
|
3258
3267
|
if (!u && !g)
|
|
3259
3268
|
continue;
|
|
3260
|
-
const b = (c.startAngle + c.endAngle) / 2 - Math.PI / 2, m = Math.cos(b) * l, v = Math.sin(b) * l, y = o.append("text").attr("class", "bc-arc-inside-label").attr("x", m).attr("y", v).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", `${s}px`), x =
|
|
3269
|
+
const b = (c.startAngle + c.endAngle) / 2 - Math.PI / 2, m = Math.cos(b) * l, v = Math.sin(b) * l, y = o.append("text").attr("class", "bc-arc-inside-label").attr("x", m).attr("y", v).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", `${s}px`), x = Bt(c.color);
|
|
3261
3270
|
if (u && y.append("tspan").attr("x", m).attr("dy", g ? "-0.5em" : "0em").attr("font-weight", "bold").attr("fill", x).text(c.label), g) {
|
|
3262
3271
|
const w = c.displayAsPercentage && c.percentage != null ? `${Math.round(c.percentage)}%` : String(c.value);
|
|
3263
3272
|
y.append("tspan").attr("x", m).attr("dy", u ? "1.2em" : "0em").attr("fill", x).attr("opacity", 0.85).text(w);
|
|
3264
3273
|
}
|
|
3265
3274
|
}
|
|
3266
3275
|
}
|
|
3267
|
-
function
|
|
3276
|
+
function xf(t, a, e) {
|
|
3268
3277
|
const { outerRadius: r, innerRadius: n = 0, fontSize: s = 12, bgColor: l } = e, o = (n + r) / 2, c = [], d = [];
|
|
3269
3278
|
for (const u of a) {
|
|
3270
3279
|
const g = u.endAngle - u.startAngle, b = g * o, m = u.label.length * 7;
|
|
@@ -3272,13 +3281,13 @@ function vf(t, a, e) {
|
|
|
3272
3281
|
}
|
|
3273
3282
|
c.length > 0 && Bi(t, c, { outerRadius: r, innerRadius: n, fontSize: s }), d.length > 0 && Fi(t, d, { outerRadius: r, fontSize: s, bgColor: l });
|
|
3274
3283
|
}
|
|
3275
|
-
function
|
|
3284
|
+
function Af(t, a) {
|
|
3276
3285
|
if (t.length === 0)
|
|
3277
3286
|
return { left: 0, right: 0, top: 0, bottom: 0 };
|
|
3278
3287
|
const e = Math.max(...t.map((o) => o.length)), r = Ei + Ni + 6 + 4 + e * 7 + 6, s = t.length * Ln / 2, l = Math.max(10, s - a + 20);
|
|
3279
3288
|
return { left: r, right: r, top: l, bottom: l };
|
|
3280
3289
|
}
|
|
3281
|
-
const
|
|
3290
|
+
const Vi = [
|
|
3282
3291
|
"#4e79a7",
|
|
3283
3292
|
"#f28e2b",
|
|
3284
3293
|
"#e15759",
|
|
@@ -3288,9 +3297,9 @@ const Gi = [
|
|
|
3288
3297
|
"#b07aa1",
|
|
3289
3298
|
"#ff9da7"
|
|
3290
3299
|
];
|
|
3291
|
-
class
|
|
3300
|
+
class wf extends ht {
|
|
3292
3301
|
initialize() {
|
|
3293
|
-
this.configDefine("xPos", { defaultValue: (n) => 0 }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("colors", { defaultValue:
|
|
3302
|
+
this.configDefine("xPos", { defaultValue: (n) => 0 }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("colors", { defaultValue: Vi }), 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() });
|
|
3294
3303
|
const a = this.base.append("g"), e = this.base.append("g"), r = this.base.append("g");
|
|
3295
3304
|
this.layer("areas", a, {
|
|
3296
3305
|
dataBind: (n, s) => n.selectAll(".bc-area").data(this.config("areaFill") ? s : [], (l) => l.name),
|
|
@@ -3358,48 +3367,48 @@ class Af extends ht {
|
|
|
3358
3367
|
});
|
|
3359
3368
|
}
|
|
3360
3369
|
}
|
|
3361
|
-
function
|
|
3362
|
-
var
|
|
3370
|
+
function Sf(t, a, e = {}, r = !1) {
|
|
3371
|
+
var Dt, pe, T, he, K, Me, qe, nt, At, ft, Et, Yt, la;
|
|
3363
3372
|
qt(r), Er(t);
|
|
3364
3373
|
let n = a, s = [], l = [], o = [], c = [], d = null, u, g;
|
|
3365
3374
|
const b = Rt.for(t);
|
|
3366
3375
|
if (r) {
|
|
3367
3376
|
const ee = Xt(t);
|
|
3368
|
-
g = ee == null ? void 0 : ee.margin, b.detach(), (ee == null ? void 0 : ee.chartType) === "line-multi" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), l = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), c = Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))) : ee && (d =
|
|
3377
|
+
g = ee == null ? void 0 : ee.margin, b.detach(), (ee == null ? void 0 : ee.chartType) === "line-multi" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), l = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), c = Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))) : ee && (d = Gt(t)), u = /* @__PURE__ */ new Map();
|
|
3369
3378
|
for (const ve of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3370
|
-
for (const [
|
|
3371
|
-
u.set(
|
|
3379
|
+
for (const [Ge, Ye] of zt(ve))
|
|
3380
|
+
u.set(Ge, Ye);
|
|
3372
3381
|
t.replaceChildren();
|
|
3373
3382
|
}
|
|
3374
3383
|
const { body: m } = Ht(t, e.frame), v = n.series ?? [];
|
|
3375
3384
|
let y = v.filter((ee) => !Da(ee.name, e.seriesOverrides));
|
|
3376
3385
|
(e.sortMode === "total" || e.sortMode === "within-groups") && (y = [...y].sort((ee, ve) => {
|
|
3377
|
-
const
|
|
3378
|
-
return ve.values.reduce((ot, st) => ot + st, 0) -
|
|
3386
|
+
const Ge = ee.values.reduce((ot, st) => ot + st, 0);
|
|
3387
|
+
return ve.values.reduce((ot, st) => ot + st, 0) - Ge;
|
|
3379
3388
|
}));
|
|
3380
|
-
const x = e.colors ??
|
|
3389
|
+
const x = e.colors ?? Vi, w = y.map((ee) => ee.name), $ = oa(e.colorizes), S = e.seriesOverrides, P = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", B = P ? "direct" : e.legend !== !1 ? "legend" : "none", I = w.filter((ee) => ya(ee, B, S) === "direct"), X = e.legend !== !1 && !P, V = Pt(m).width, G = 350, j = e.legendPosition ?? "top", _ = V > 0 && V < G && (j === "left" || j === "right") ? "top" : j, ne = e.legendAnchor ?? "start", ie = zr(n.labels, (Dt = e.horizontalAxis) == null ? void 0 : Dt.range), ae = ie.map((ee) => n.labels[ee]);
|
|
3381
3390
|
y = y.map((ee) => ({ ...ee, values: ie.map((ve) => ee.values[ve]) })), n = { ...n, labels: ae, series: y };
|
|
3382
|
-
const F = y.flatMap((ee) => ee.values), H = Ma(F, (pe = e.verticalAxis) == null ? void 0 : pe.range, (T = e.verticalAxis) == null ? void 0 : T.numberFormat, (he = e.verticalAxis) == null ? void 0 : he.scaleType), W = ra(
|
|
3391
|
+
const F = y.flatMap((ee) => ee.values), H = Ma(F, (pe = e.verticalAxis) == null ? void 0 : pe.range, (T = e.verticalAxis) == null ? void 0 : T.numberFormat, (he = e.verticalAxis) == null ? void 0 : he.scaleType), W = ra(V, (K = e.verticalAxis) == null ? void 0 : K.labelPosition, (Me = e.horizontalAxis) == null ? void 0 : Me.labelPosition, (qe = e.verticalAxis) == null ? void 0 : qe.direction, H), oe = I.length > 0 ? Oi(I) : 0, le = W.top != null, $e = Math.max(0, V - (W.left ?? 50) - (W.right ?? 20) - oe), se = X ? Sa(w, _, $e) : { width: 0, height: 0 }, Se = X ? se.height + 15 : 0, ye = { ...W };
|
|
3383
3392
|
if (X && _ === "top") {
|
|
3384
3393
|
const ee = le ? 15 : 0;
|
|
3385
3394
|
ye.top = Se + ee;
|
|
3386
3395
|
}
|
|
3387
3396
|
X && _ === "bottom" && (ye.bottom = (ye.bottom ?? 24) + Se), X && _ === "left" && (ye.left = (ye.left ?? 50) + se.width + 10), X && _ === "right" && (ye.right = (ye.right ?? 20) + se.width + 10), oe > 0 && (ye.right = (ye.right ?? 20) + oe);
|
|
3388
|
-
const { chartArea: we, width: be, height: me, margin: ce } = Wt(m, ye), Ie = aa(g, ce), [ze, Ne] = qa(F, (nt = e.verticalAxis) == null ? void 0 : nt.range, (At = e.verticalAxis) == null ? void 0 : At.scaleType), Z = p.scalePoint().domain(n.labels).range([0, be]).padding(e.edgePadding ? 0.6 : 0), U = Z, Ae = (ee) => Z(n.labels[ee]) ?? 0, fe = ((ft = e.verticalAxis) == null ? void 0 : ft.scaleType) === "log" ? p.scaleSymlog().domain([ze, Ne]).nice().range([me, 0]) : p.scaleLinear().domain([ze, Ne]).nice().range([me, 0]), Le = fe.domain(),
|
|
3397
|
+
const { chartArea: we, width: be, height: me, margin: ce } = Wt(m, ye), Ie = aa(g, ce), [ze, Ne] = qa(F, (nt = e.verticalAxis) == null ? void 0 : nt.range, (At = e.verticalAxis) == null ? void 0 : At.scaleType), Z = p.scalePoint().domain(n.labels).range([0, be]).padding(e.edgePadding ? 0.6 : 0), U = Z, Ae = (ee) => Z(n.labels[ee]) ?? 0, fe = ((ft = e.verticalAxis) == null ? void 0 : ft.scaleType) === "log" ? p.scaleSymlog().domain([ze, Ne]).nice().range([me, 0]) : p.scaleLinear().domain([ze, Ne]).nice().range([me, 0]), Le = fe.domain(), Ve = Le[0] < 0 && Le[1] > 0 ? fe(0) : void 0;
|
|
3389
3398
|
b.attach(we, Ie), b.update({
|
|
3390
3399
|
vertical: { scale: fe, height: me, options: { ...e.verticalAxis, gridWidth: be, topPadding: ce.top } },
|
|
3391
|
-
horizontal: { scale: U, height: me, options: { ...e.horizontalAxis, width: be, zeroY:
|
|
3400
|
+
horizontal: { scale: U, height: me, options: { ...e.horizontalAxis, width: be, zeroY: Ve } }
|
|
3392
3401
|
});
|
|
3393
3402
|
const Ee = we.ownerSVGElement, L = na(Ee, t, "plot", { x: 0, y: 0, width: be, height: me }), M = p.select(we).append("g").attr("clip-path", `url(#${L})`), C = M.node(), O = y.map((ee) => ({
|
|
3394
3403
|
name: ee.name,
|
|
3395
3404
|
values: ee.values,
|
|
3396
3405
|
colorIndex: v.findIndex((ve) => ve.name === ee.name)
|
|
3397
3406
|
})), Q = Ca(e.interpolation);
|
|
3398
|
-
(
|
|
3407
|
+
(Et = e.areaFills) != null && Et.length && kf(C, e.areaFills, y, Ae, n.labels.length, fe, Q);
|
|
3399
3408
|
const q = [];
|
|
3400
3409
|
y.forEach((ee, ve) => {
|
|
3401
|
-
n.labels.forEach((
|
|
3402
|
-
q.push({ label:
|
|
3410
|
+
n.labels.forEach((Ge, Ye) => {
|
|
3411
|
+
q.push({ label: Ge, value: ee.values[Ye], series: ee.name, colorIndex: ve });
|
|
3403
3412
|
});
|
|
3404
3413
|
});
|
|
3405
3414
|
const R = e.lineSymbols, J = {
|
|
@@ -3407,7 +3416,7 @@ function wf(t, a, e = {}, r = !1) {
|
|
|
3407
3416
|
dotted: "2,4",
|
|
3408
3417
|
dashed: "8,4",
|
|
3409
3418
|
"dash-dot": "8,4,2,4"
|
|
3410
|
-
}, re = e.valueLabels ?? !1, ke = new Set((e.highlights ?? []).map((ee) => ee.target)), Y = new
|
|
3419
|
+
}, re = e.valueLabels ?? !1, ke = new Set((e.highlights ?? []).map((ee) => ee.target)), Y = new wf(p.select(C));
|
|
3411
3420
|
Y.config({ xPos: Ae, y: fe, colors: x, labels: n.labels, curve: Q, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: me, dots: q, highlightTargets: ke });
|
|
3412
3421
|
const de = new Set(O.map((ee) => ee.name)), Ce = s.filter((ee) => {
|
|
3413
3422
|
var ve;
|
|
@@ -3420,34 +3429,34 @@ function wf(t, a, e = {}, r = !1) {
|
|
|
3420
3429
|
return de.has(((ve = ee.__data__) == null ? void 0 : ve.series) ?? "");
|
|
3421
3430
|
});
|
|
3422
3431
|
if (Oe.length > 0 || Ce.length > 0 || _e.length > 0) {
|
|
3423
|
-
const ee = (Ie == null ? void 0 : Ie.dx) ?? 0, ve = (Ie == null ? void 0 : Ie.dy) ?? 0,
|
|
3424
|
-
|
|
3432
|
+
const ee = (Ie == null ? void 0 : Ie.dx) ?? 0, ve = (Ie == null ? void 0 : Ie.dy) ?? 0, Ge = C.querySelectorAll(":scope > g");
|
|
3433
|
+
Ge[0] && St(Ge[0], Ce, ee, ve), Ge[1] && St(Ge[1], Oe, ee, ve), Ge[2] && St(Ge[2], _e, ee, ve);
|
|
3425
3434
|
}
|
|
3426
3435
|
if (Y.draw(O), (Yt = e.annotations) != null && Yt.length) {
|
|
3427
|
-
const ee = n.labels.map((ve,
|
|
3436
|
+
const ee = n.labels.map((ve, Ge) => {
|
|
3428
3437
|
var Ye;
|
|
3429
3438
|
return {
|
|
3430
3439
|
label: ve,
|
|
3431
|
-
value: ((Ye = y[0]) == null ? void 0 : Ye.values[
|
|
3440
|
+
value: ((Ye = y[0]) == null ? void 0 : Ye.values[Ge]) ?? 0
|
|
3432
3441
|
};
|
|
3433
3442
|
});
|
|
3434
|
-
Dr(we, e.annotations, { scaleX: U, scaleY: fe, data: ee, width: be, height: me, backgroundColor:
|
|
3443
|
+
Dr(we, e.annotations, { scaleX: U, scaleY: fe, data: ee, width: be, height: me, backgroundColor: Tt(t), transition: r, priorAnnotations: u });
|
|
3435
3444
|
}
|
|
3436
3445
|
const Ue = p.select(C).append("g").attr("class", "bc-value-labels");
|
|
3437
3446
|
if (q.forEach((ee) => {
|
|
3438
3447
|
if (!Ka(ee.series, re, S))
|
|
3439
3448
|
return;
|
|
3440
|
-
const ve = Ae(n.labels.indexOf(ee.label)),
|
|
3441
|
-
Ue.append("text").attr("class", "bc-value-label").attr("data-series", ee.colorIndex).attr("x", ve).attr("y",
|
|
3449
|
+
const ve = Ae(n.labels.indexOf(ee.label)), Ge = fe(ee.value);
|
|
3450
|
+
Ue.append("text").attr("class", "bc-value-label").attr("data-series", ee.colorIndex).attr("x", ve).attr("y", Ge - 8).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text(String(ee.value));
|
|
3442
3451
|
}), p.select(C).selectAll(".bc-line").each(function(ee) {
|
|
3443
|
-
const ve = ee,
|
|
3444
|
-
if (jt.attr("stroke", $.get(ve.name) ??
|
|
3452
|
+
const ve = ee, Ge = Xe(ve.name, ve.colorIndex, x, S), Ye = of(ve.name, S), ot = sf(ve.name, S), st = Ti(ve.name, e.interpolation ?? "linear", S), jt = r ? p.select(this).transition().duration(Be()) : p.select(this);
|
|
3453
|
+
if (jt.attr("stroke", $.get(ve.name) ?? Ge).attr("stroke-width", Ye), jt.attr("opacity", rt(ke, ve.name, 1)), ot !== "solid" && p.select(this).attr("stroke-dasharray", J[ot] ?? ""), st !== (e.interpolation ?? "linear")) {
|
|
3445
3454
|
const ca = Ca(st), Na = p.line().curve(ca).x((ba, en) => Ae(en)).y((ba) => fe(ba));
|
|
3446
3455
|
jt.attr("d", Na(ve.values));
|
|
3447
3456
|
}
|
|
3448
3457
|
}), p.select(C).selectAll(".bc-area").each(function(ee) {
|
|
3449
|
-
const ve = ee,
|
|
3450
|
-
Ye.attr("fill", $.get(ve.name) ??
|
|
3458
|
+
const ve = ee, Ge = Xe(ve.name, ve.colorIndex, x, S), Ye = r ? p.select(this).transition().duration(Be()) : p.select(this);
|
|
3459
|
+
Ye.attr("fill", $.get(ve.name) ?? Ge), Ye.attr("opacity", rt(ke, ve.name, e.areaFillOpacity ?? 0.2));
|
|
3451
3460
|
}), p.select(C).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
|
|
3452
3461
|
const ee = q.map((ve) => ({
|
|
3453
3462
|
cx: Ae(n.labels.indexOf(ve.label)),
|
|
@@ -3478,15 +3487,15 @@ function wf(t, a, e = {}, r = !1) {
|
|
|
3478
3487
|
symbolOpacity: R.opacity
|
|
3479
3488
|
} : void 0, Qe = n.labels.length;
|
|
3480
3489
|
y.forEach((ee, ve) => {
|
|
3481
|
-
const
|
|
3482
|
-
if (!
|
|
3490
|
+
const Ge = lf(ee.name, Ze, S);
|
|
3491
|
+
if (!Ge)
|
|
3483
3492
|
return;
|
|
3484
3493
|
const Ye = {
|
|
3485
|
-
symbol:
|
|
3486
|
-
showOn:
|
|
3487
|
-
style:
|
|
3488
|
-
size:
|
|
3489
|
-
opacity:
|
|
3494
|
+
symbol: Ge.symbolShape ?? (R == null ? void 0 : R.symbol) ?? Nt.Circle,
|
|
3495
|
+
showOn: Ge.symbolShowOn ?? (R == null ? void 0 : R.showOn) ?? It.FirstLast,
|
|
3496
|
+
style: Ge.symbolStyle ?? (R == null ? void 0 : R.style) ?? wt.Filled,
|
|
3497
|
+
size: Ge.symbolSize ?? (R == null ? void 0 : R.size) ?? 3.5,
|
|
3498
|
+
opacity: Ge.symbolOpacity ?? (R == null ? void 0 : R.opacity) ?? 1
|
|
3490
3499
|
}, ot = n.labels.map((Na, ba) => ({
|
|
3491
3500
|
cx: Ae(ba),
|
|
3492
3501
|
cy: fe(ee.values[ba]),
|
|
@@ -3505,9 +3514,9 @@ function wf(t, a, e = {}, r = !1) {
|
|
|
3505
3514
|
je.push({ name: ee.name, index: ve, naturalY: fe(Ye), text: ot });
|
|
3506
3515
|
}), je.length > 0) {
|
|
3507
3516
|
je.sort((Ye, ot) => Ye.naturalY - ot.naturalY);
|
|
3508
|
-
const ee = je.map((Ye) => Ye.naturalY),
|
|
3517
|
+
const ee = je.map((Ye) => Ye.naturalY), Ge = $n(ee, 0, me, 14);
|
|
3509
3518
|
je.forEach((Ye, ot) => {
|
|
3510
|
-
p.select(we).append("text").attr("class", "bc-direct-label").attr("data-series", Ye.index).attr("x", pt).attr("y",
|
|
3519
|
+
p.select(we).append("text").attr("class", "bc-direct-label").attr("data-series", Ye.index).attr("x", pt).attr("y", Ge[ot]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", Xe(Ye.name, Ye.index, x, S)).text(Ye.text);
|
|
3511
3520
|
});
|
|
3512
3521
|
}
|
|
3513
3522
|
const Ot = w.filter((ee) => ya(ee, B, S) === "legend");
|
|
@@ -3516,16 +3525,16 @@ function wf(t, a, e = {}, r = !1) {
|
|
|
3516
3525
|
const ot = v.findIndex((st) => st.name === Ye);
|
|
3517
3526
|
return Xe(Ye, ot, x, S);
|
|
3518
3527
|
});
|
|
3519
|
-
let ve = 0,
|
|
3528
|
+
let ve = 0, Ge = 0;
|
|
3520
3529
|
if (_ === "top") {
|
|
3521
3530
|
const Ye = le ? 15 : 0;
|
|
3522
|
-
|
|
3523
|
-
} else _ === "bottom" ?
|
|
3524
|
-
Aa(we, Ot, ee,
|
|
3531
|
+
Ge = -(se.height + 10 + Ye);
|
|
3532
|
+
} else _ === "bottom" ? Ge = me + 25 : _ === "left" ? ve = -(se.width + 10) : _ === "right" && (ve = be + 10);
|
|
3533
|
+
Aa(we, Ot, ee, Ge, _, ne, be, me, ve, [], { left: ce.left, right: ce.right });
|
|
3525
3534
|
}
|
|
3526
|
-
Ut(t, { chartType: "line-multi", margin: ce }), d && (
|
|
3535
|
+
Ut(t, { chartType: "line-multi", margin: ce }), d && (Vt(M.node()), _t(t, d));
|
|
3527
3536
|
}
|
|
3528
|
-
function
|
|
3537
|
+
function kf(t, a, e, r, n, s, l) {
|
|
3529
3538
|
const o = p.select(t).append("g").attr("class", "bc-area-fills");
|
|
3530
3539
|
for (const c of a) {
|
|
3531
3540
|
const d = e.find((y) => y.name === c.from), u = e.find((y) => y.name === c.to);
|
|
@@ -3533,14 +3542,14 @@ function Sf(t, a, e, r, n, s, l) {
|
|
|
3533
3542
|
continue;
|
|
3534
3543
|
const g = c.interpolation ? Ca(c.interpolation) : l, b = (c.opacity ?? 30) / 100, m = c.color ?? "#ccc", v = c.negativeColor;
|
|
3535
3544
|
if (v)
|
|
3536
|
-
|
|
3545
|
+
$f(o, d.values, u.values, r, s, g, m, v, b);
|
|
3537
3546
|
else {
|
|
3538
3547
|
const y = p.area().curve(g).x((x, w) => r(w)).y0((x, w) => s(u.values[w])).y1((x) => s(x));
|
|
3539
3548
|
o.append("path").attr("class", "bc-area-fill").attr("d", y(d.values) ?? "").attr("fill", m).attr("opacity", b);
|
|
3540
3549
|
}
|
|
3541
3550
|
}
|
|
3542
3551
|
}
|
|
3543
|
-
function
|
|
3552
|
+
function Lf(t, a, e, r) {
|
|
3544
3553
|
const n = t - e, s = a - r;
|
|
3545
3554
|
if (n === 0 && s === 0 || n > 0 && s > 0 || n < 0 && s < 0)
|
|
3546
3555
|
return null;
|
|
@@ -3550,7 +3559,7 @@ function kf(t, a, e, r) {
|
|
|
3550
3559
|
const o = -n / l;
|
|
3551
3560
|
return o < 0 || o > 1 ? null : o;
|
|
3552
3561
|
}
|
|
3553
|
-
function
|
|
3562
|
+
function $f(t, a, e, r, n, s, l, o, c) {
|
|
3554
3563
|
const d = a.length;
|
|
3555
3564
|
if (d === 0)
|
|
3556
3565
|
return;
|
|
@@ -3558,7 +3567,7 @@ function Lf(t, a, e, r, n, s, l, o, c) {
|
|
|
3558
3567
|
for (let v = 0; v < d; v++) {
|
|
3559
3568
|
const y = r(v), x = n(a[v]), w = n(e[v]);
|
|
3560
3569
|
if (u.push({ x: y, fromY: x, toY: w }), v < d - 1) {
|
|
3561
|
-
const $ = n(a[v + 1]), S = n(e[v + 1]), P =
|
|
3570
|
+
const $ = n(a[v + 1]), S = n(e[v + 1]), P = Lf(x, $, w, S);
|
|
3562
3571
|
if (P !== null && P > 0 && P < 1) {
|
|
3563
3572
|
const B = y + P * (r(v + 1) - y), I = x + P * ($ - x), X = w + P * (S - w);
|
|
3564
3573
|
u.push({ x: B, fromY: I, toY: X });
|
|
@@ -3582,7 +3591,7 @@ function Lf(t, a, e, r, n, s, l, o, c) {
|
|
|
3582
3591
|
x += "Z", t.append("path").attr("class", `bc-area-fill ${v.positive ? "bc-area-fill-pos" : "bc-area-fill-neg"}`).attr("d", x).attr("fill", v.positive ? l : o).attr("opacity", c);
|
|
3583
3592
|
}
|
|
3584
3593
|
}
|
|
3585
|
-
const
|
|
3594
|
+
const Cf = [
|
|
3586
3595
|
"#4e79a7",
|
|
3587
3596
|
"#f28e2b",
|
|
3588
3597
|
"#e15759",
|
|
@@ -3592,22 +3601,22 @@ const $f = [
|
|
|
3592
3601
|
"#b07aa1",
|
|
3593
3602
|
"#ff9da7"
|
|
3594
3603
|
];
|
|
3595
|
-
class
|
|
3604
|
+
class Mf extends ht {
|
|
3596
3605
|
initialize() {
|
|
3597
3606
|
}
|
|
3598
3607
|
}
|
|
3599
|
-
function
|
|
3600
|
-
|
|
3608
|
+
function Of(t, a, e = {}, r = !1) {
|
|
3609
|
+
Gi(t, a, e, 0.6, r);
|
|
3601
3610
|
}
|
|
3602
|
-
function
|
|
3611
|
+
function Gi(t, a, e, r, n = !1) {
|
|
3603
3612
|
var Ne;
|
|
3604
3613
|
qt(n);
|
|
3605
3614
|
let s = null, l;
|
|
3606
3615
|
if (n) {
|
|
3607
3616
|
const Z = Xt(t), U = r > 0 ? "donut" : "pie";
|
|
3608
|
-
Z && Z.chartType !== U && (s =
|
|
3617
|
+
Z && Z.chartType !== U && (s = Gt(t)), l = /* @__PURE__ */ new Map();
|
|
3609
3618
|
for (const Ae of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3610
|
-
for (const [Te, fe] of
|
|
3619
|
+
for (const [Te, fe] of zt(Ae))
|
|
3611
3620
|
l.set(Te, fe);
|
|
3612
3621
|
t.replaceChildren();
|
|
3613
3622
|
}
|
|
@@ -3621,9 +3630,9 @@ function Vi(t, a, e, r, n = !1) {
|
|
|
3621
3630
|
const Z = e.sliceMax - 1, U = c.slice(0, Z), Ae = d.slice(0, Z), Te = d.slice(Z).reduce((fe, Le) => fe + Le, 0);
|
|
3622
3631
|
U.push(e.sliceGroupLabel ?? "Others"), Ae.push(Te), c = U, d = Ae;
|
|
3623
3632
|
}
|
|
3624
|
-
const u = d.reduce((Z, U) => Z + U, 0), g = d.map((Z) => u > 0 ? Z / u * 100 : 0), b = e.colors ??
|
|
3633
|
+
const u = d.reduce((Z, U) => Z + U, 0), g = d.map((Z) => u > 0 ? Z / u * 100 : 0), b = e.colors ?? Cf, m = b.length < c.length && b.length >= 2 ? He.scale(b).mode("lch").colors(c.length) : b, v = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? vt.Auto : vt.Off, y = !!v && !(v === vt.Auto && e.legend === !0), w = (e.showValues ?? !0) && !y ? d.map((Z, U) => `(${e.displayAsPercentage ? `${Math.round(g[U])}%` : String(Z)})`) : [], $ = e.legend !== !1 && !y, S = Pt(o).width, P = 350, B = e.legendPosition ?? "top", I = S > 0 && S < P && (B === "left" || B === "right") ? "top" : B, X = e.legendAnchor ?? "start", V = w.length > 0 ? c.map((Z, U) => `${Z} ${w[U]}`) : c, G = Math.max(0, S - 50 - 20), j = $ ? Sa(V, I, G) : { width: 0, height: 0 }, _ = $ ? j.height + 15 : 0, ne = {};
|
|
3625
3634
|
if ($ && I === "top" && (ne.top = _), $ && I === "bottom" && (ne.bottom = 24 + _), $ && I === "left" && (ne.left = 50 + j.width + 10), $ && I === "right" && (ne.right = 20 + j.width + 10), y) {
|
|
3626
|
-
const Z =
|
|
3635
|
+
const Z = Pt(o), U = 20, Ae = Z.width - 2 * U, Te = (Z.height > 0 ? Z.height : 400) - 2 * U, fe = Math.min(Ae, Te) / 2, Le = Af(c, fe);
|
|
3627
3636
|
ne.left = (ne.left ?? U) + Le.left, ne.right = (ne.right ?? U) + Le.right, ne.top = (ne.top ?? U) + Le.top, ne.bottom = (ne.bottom ?? U) + Le.bottom;
|
|
3628
3637
|
}
|
|
3629
3638
|
const { chartArea: ie, width: ae, height: F, margin: H } = Wt(o, ne), W = Math.min(ae, F) / 2, oe = W * r, le = p.scaleOrdinal().domain(c).range(m), $e = p.pie().sort(null), se = p.arc().innerRadius(oe).outerRadius(W), Se = p.select(ie).append("g").attr("transform", `translate(${ae / 2},${F / 2})`), ye = oa(e.colorizes), we = $e(d), be = we.map((Z, U) => ({
|
|
@@ -3643,7 +3652,7 @@ function Vi(t, a, e, r, n = !1) {
|
|
|
3643
3652
|
return ce.size > 0 ? { ...U, opacity: rt(ce, Z.label) } : U;
|
|
3644
3653
|
}
|
|
3645
3654
|
});
|
|
3646
|
-
const ze = new
|
|
3655
|
+
const ze = new Mf(Se);
|
|
3647
3656
|
if (e.tooltips && ze.use(wa()), ze.draw(be), (Ne = e.annotations) != null && Ne.length) {
|
|
3648
3657
|
const Z = e.annotations.filter((U) => U.kind === "free");
|
|
3649
3658
|
Z.length && Xa(Z, {
|
|
@@ -3652,7 +3661,7 @@ function Vi(t, a, e, r, n = !1) {
|
|
|
3652
3661
|
data: [],
|
|
3653
3662
|
width: ae,
|
|
3654
3663
|
height: F,
|
|
3655
|
-
backgroundColor:
|
|
3664
|
+
backgroundColor: Tt(t),
|
|
3656
3665
|
transition: n,
|
|
3657
3666
|
priorAnnotations: l
|
|
3658
3667
|
}).postDraw({ base: p.select(ie) }, void 0);
|
|
@@ -3668,8 +3677,8 @@ function Vi(t, a, e, r, n = !1) {
|
|
|
3668
3677
|
displayAsPercentage: e.displayAsPercentage,
|
|
3669
3678
|
showLabel: e.showLabels ?? !0,
|
|
3670
3679
|
showValue: e.showValues ?? !0
|
|
3671
|
-
})), U = Se, Ae =
|
|
3672
|
-
v === vt.Inside ? Bi(U, Z, Te) : v === vt.Auto ?
|
|
3680
|
+
})), U = Se, Ae = Tt(t), Te = { outerRadius: W, innerRadius: oe, bgColor: Ae };
|
|
3681
|
+
v === vt.Inside ? Bi(U, Z, Te) : v === vt.Auto ? xf(U, Z, Te) : Fi(U, Z, Te);
|
|
3673
3682
|
}
|
|
3674
3683
|
if (e.showTotal && r > 0 && !e.displayAsPercentage) {
|
|
3675
3684
|
const Z = String(u);
|
|
@@ -3679,13 +3688,13 @@ function Vi(t, a, e, r, n = !1) {
|
|
|
3679
3688
|
let Z = 0, U = 0;
|
|
3680
3689
|
I === "top" ? U = -(j.height + 10) : I === "bottom" ? U = F + 25 : I === "left" ? Z = -(j.width + 10) : I === "right" && (Z = ae + 10), Aa(ie, c, m, U, I, X, ae, F, Z, w, { left: H.left, right: H.right });
|
|
3681
3690
|
}
|
|
3682
|
-
Ut(t, { chartType: r > 0 ? "donut" : "pie" }), s && (
|
|
3691
|
+
Ut(t, { chartType: r > 0 ? "donut" : "pie" }), s && (Vt(Se.node()), _t(t, s));
|
|
3683
3692
|
}
|
|
3684
|
-
function
|
|
3685
|
-
|
|
3693
|
+
function Tf(t, a, e = {}, r = !1) {
|
|
3694
|
+
Gi(t, a, e, 0, r);
|
|
3686
3695
|
}
|
|
3687
3696
|
const _i = "#4e79a7";
|
|
3688
|
-
class
|
|
3697
|
+
class Pf extends ht {
|
|
3689
3698
|
initialize() {
|
|
3690
3699
|
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 });
|
|
3691
3700
|
const a = this.base.append("g"), e = this.base.append("g"), r = this.base.append("g");
|
|
@@ -3749,34 +3758,34 @@ class Tf extends ht {
|
|
|
3749
3758
|
});
|
|
3750
3759
|
}
|
|
3751
3760
|
}
|
|
3752
|
-
function
|
|
3753
|
-
var me, ce, Ie, ze, Ne, Z, U, Ae, Te, fe, Le,
|
|
3761
|
+
function zf(t, a, e = {}, r = !1) {
|
|
3762
|
+
var me, ce, Ie, ze, Ne, Z, U, Ae, Te, fe, Le, Ve, Ee;
|
|
3754
3763
|
qt(r), Er(t);
|
|
3755
3764
|
let n = [], s = [], l = [], o = null, c = null, d, u;
|
|
3756
3765
|
const g = Rt.for(t);
|
|
3757
3766
|
if (r) {
|
|
3758
3767
|
const L = Xt(t);
|
|
3759
|
-
u = L == null ? void 0 : L.margin, g.detach(), (L == null ? void 0 : L.chartType) === "area" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), l = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), o = t.querySelector(".bc-frame .bc-symbols")) : L && (c =
|
|
3768
|
+
u = L == null ? void 0 : L.margin, g.detach(), (L == null ? void 0 : L.chartType) === "area" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), l = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), o = t.querySelector(".bc-frame .bc-symbols")) : L && (c = Gt(t)), d = /* @__PURE__ */ new Map();
|
|
3760
3769
|
for (const M of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3761
|
-
for (const [C, O] of
|
|
3770
|
+
for (const [C, O] of zt(M))
|
|
3762
3771
|
d.set(C, O);
|
|
3763
3772
|
t.replaceChildren();
|
|
3764
3773
|
}
|
|
3765
|
-
const { body: b } = Ht(t, e.frame), m =
|
|
3774
|
+
const { body: b } = Ht(t, e.frame), m = Pt(b).width, v = Ma(a.values, (me = e.verticalAxis) == null ? void 0 : me.range, (ce = e.verticalAxis) == null ? void 0 : ce.numberFormat, (Ie = e.verticalAxis) == null ? void 0 : Ie.scaleType), y = ra(m, (ze = e.verticalAxis) == null ? void 0 : ze.labelPosition, (Ne = e.horizontalAxis) == null ? void 0 : Ne.labelPosition, (Z = e.verticalAxis) == null ? void 0 : Z.direction, v), { chartArea: x, width: w, height: $, margin: S } = Wt(b, y), P = aa(u, S), B = zr(a.labels, (U = e.horizontalAxis) == null ? void 0 : U.range), I = B.map((L) => a.labels[L]), X = B.map((L) => a.values[L]), V = I.map((L, M) => ({
|
|
3766
3775
|
label: L,
|
|
3767
3776
|
value: X[M]
|
|
3768
|
-
})),
|
|
3777
|
+
})), G = p.scalePoint().domain(I).range([0, w]).padding(e.edgePadding ? 0.6 : 0), j = G, _ = (L) => G(L.label) ?? 0, ne = ((Ae = e.verticalAxis) == null ? void 0 : Ae.scaleType) === "log", [ie, ae] = qa(X, (Te = e.verticalAxis) == null ? void 0 : Te.range, (fe = e.verticalAxis) == null ? void 0 : fe.scaleType), F = ne ? p.scaleSymlog().domain([ie, ae]).nice().range([$, 0]) : p.scaleLinear().domain([ie, ae]).nice().range([$, 0]), H = F.domain(), W = H[0] < 0 && H[1] > 0 ? F(0) : void 0;
|
|
3769
3778
|
g.attach(x, P), g.update({
|
|
3770
3779
|
vertical: { scale: F, height: $, options: { ...e.verticalAxis, gridWidth: w, topPadding: S.top } },
|
|
3771
3780
|
horizontal: { scale: j, height: $, options: { ...e.horizontalAxis, width: w, zeroY: W } }
|
|
3772
3781
|
});
|
|
3773
|
-
const oe = x.ownerSVGElement, le = na(oe, t, "plot", { x: 0, y: 0, width: w, height: $ }), $e = p.select(x).append("g").attr("clip-path", `url(#${le})`), se = $e.node(), Se = ((Le = e.colors) == null ? void 0 : Le[0]) ?? _i, ye = Ca(e.interpolation ?? "monotoneX"), we = e.lineSymbols, be = new
|
|
3782
|
+
const oe = x.ownerSVGElement, le = na(oe, t, "plot", { x: 0, y: 0, width: w, height: $ }), $e = p.select(x).append("g").attr("clip-path", `url(#${le})`), se = $e.node(), Se = ((Le = e.colors) == null ? void 0 : Le[0]) ?? _i, ye = Ca(e.interpolation ?? "monotoneX"), we = e.lineSymbols, be = new Pf(p.select(se));
|
|
3774
3783
|
if (be.config({ xPos: _, y: F, color: Se, curve: ye, areaFillOpacity: e.areaFillOpacity ?? 0.25, height: $ }), s.length > 0 || n.length > 0 || l.length > 0) {
|
|
3775
3784
|
const L = (P == null ? void 0 : P.dx) ?? 0, M = (P == null ? void 0 : P.dy) ?? 0, C = se.querySelectorAll(":scope > g");
|
|
3776
3785
|
C[0] && St(C[0], n, L, M), C[1] && St(C[1], s, L, M), C[2] && St(C[2], l, L, M);
|
|
3777
3786
|
}
|
|
3778
|
-
if (e.valueLabels && be.use(Pi({ position: e.valueLabelPosition, orientation: ct.Vertical })), be.draw(
|
|
3779
|
-
const L =
|
|
3787
|
+
if (e.valueLabels && be.use(Pi({ position: e.valueLabelPosition, orientation: ct.Vertical })), be.draw(V), (Ve = e.annotations) != null && Ve.length && Dr(x, e.annotations, { scaleX: j, scaleY: F, data: V, width: w, height: $, backgroundColor: Tt(t), transition: r, priorAnnotations: d }), p.select(se).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
|
|
3788
|
+
const L = V.map((M) => ({
|
|
3780
3789
|
cx: _(M),
|
|
3781
3790
|
cy: F(M.value),
|
|
3782
3791
|
label: M.label,
|
|
@@ -3797,16 +3806,16 @@ function Pf(t, a, e = {}, r = !1) {
|
|
|
3797
3806
|
});
|
|
3798
3807
|
}
|
|
3799
3808
|
if (we) {
|
|
3800
|
-
const L =
|
|
3809
|
+
const L = V.map((C, O) => ({
|
|
3801
3810
|
cx: _(C),
|
|
3802
3811
|
cy: F(C.value),
|
|
3803
3812
|
color: Se,
|
|
3804
3813
|
index: O
|
|
3805
3814
|
}));
|
|
3806
3815
|
let M;
|
|
3807
|
-
o ? (x.appendChild(o), M = p.select(o)) : M = p.select(x).append("g").attr("class", "bc-symbols"), kn(M, L,
|
|
3816
|
+
o ? (x.appendChild(o), M = p.select(o)) : M = p.select(x).append("g").attr("class", "bc-symbols"), kn(M, L, V.length, we, r);
|
|
3808
3817
|
}
|
|
3809
|
-
Ut(t, { chartType: "area", margin: S }), c && (
|
|
3818
|
+
Ut(t, { chartType: "area", margin: S }), c && (Vt($e.node()), _t(t, c));
|
|
3810
3819
|
}
|
|
3811
3820
|
function Cn(t) {
|
|
3812
3821
|
const a = t.series ?? [];
|
|
@@ -3848,7 +3857,7 @@ const Ri = [
|
|
|
3848
3857
|
"#b07aa1",
|
|
3849
3858
|
"#ff9da7"
|
|
3850
3859
|
];
|
|
3851
|
-
class
|
|
3860
|
+
class Df extends ht {
|
|
3852
3861
|
initialize() {
|
|
3853
3862
|
this.configDefine("xPos", { defaultValue: (r) => 0 }), this.configDefine("colors", { defaultValue: Ri }), this.configDefine("curve", { defaultValue: p.curveMonotoneX }), this.configDefine("areaFillOpacity", { defaultValue: 0.85 }), this.configDefine("highlightTargets", { defaultValue: /* @__PURE__ */ new Set() });
|
|
3854
3863
|
const a = this.base.append("g"), e = this.base.append("g");
|
|
@@ -3893,16 +3902,16 @@ class zf extends ht {
|
|
|
3893
3902
|
});
|
|
3894
3903
|
}
|
|
3895
3904
|
}
|
|
3896
|
-
function
|
|
3897
|
-
var _e, Ue, Ze, Qe, gt, pt, je, Ot,
|
|
3905
|
+
function Ef(t, a, e = {}, r = !1) {
|
|
3906
|
+
var _e, Ue, Ze, Qe, gt, pt, je, Ot, Dt;
|
|
3898
3907
|
qt(r), Er(t);
|
|
3899
3908
|
let n = a, s = [], l = [], o = null, c, d;
|
|
3900
3909
|
const u = Rt.for(t);
|
|
3901
3910
|
if (r) {
|
|
3902
3911
|
const pe = Xt(t);
|
|
3903
|
-
d = pe == null ? void 0 : pe.margin, u.detach(), (pe == null ? void 0 : pe.chartType) === "area-stacked" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), l = Array.from(t.querySelectorAll(".bc-frame .bc-line"))) : pe && (o =
|
|
3912
|
+
d = pe == null ? void 0 : pe.margin, u.detach(), (pe == null ? void 0 : pe.chartType) === "area-stacked" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), l = Array.from(t.querySelectorAll(".bc-frame .bc-line"))) : pe && (o = Gt(t)), c = /* @__PURE__ */ new Map();
|
|
3904
3913
|
for (const T of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
3905
|
-
for (const [he, K] of
|
|
3914
|
+
for (const [he, K] of zt(T))
|
|
3906
3915
|
c.set(he, K);
|
|
3907
3916
|
t.replaceChildren();
|
|
3908
3917
|
}
|
|
@@ -3911,7 +3920,7 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
3911
3920
|
const pe = b.map((he) => n.labels[he]), T = (n.series ?? []).map((he) => ({ ...he, values: b.map((K) => he.values[K]) }));
|
|
3912
3921
|
n = { labels: pe, values: b.map((he) => n.values[he]), series: T };
|
|
3913
3922
|
}
|
|
3914
|
-
const m = n.series ?? [], v = m.filter((pe) => !Da(pe.name, e.seriesOverrides)), y = e.colors ?? Ri, x = v.map((pe) => pe.name), w = e.seriesOverrides, $ = oa(e.colorizes), S = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", P = S ? "direct" : e.legend !== !1 ? "legend" : "none", B = x.filter((pe) => ya(pe, P, w) === "direct"), I = e.legend !== !1 && !S, X =
|
|
3923
|
+
const m = n.series ?? [], v = m.filter((pe) => !Da(pe.name, e.seriesOverrides)), y = e.colors ?? Ri, x = v.map((pe) => pe.name), w = e.seriesOverrides, $ = oa(e.colorizes), S = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", P = S ? "direct" : e.legend !== !1 ? "legend" : "none", B = x.filter((pe) => ya(pe, P, w) === "direct"), I = e.legend !== !1 && !S, X = Pt(g).width, V = 350, G = e.legendPosition ?? "top", j = X > 0 && X < V && (G === "left" || G === "right") ? "top" : G, _ = e.legendAnchor ?? "start", ne = e.stacked !== !1, ie = e.stackPercent === !0 || e.stackMode === La.Percent, ae = e.areaSortMode ?? ut.None, F = e.areaLines !== !1, H = [...v];
|
|
3915
3924
|
if (ae !== ut.None) {
|
|
3916
3925
|
const pe = new Map(H.map((T) => [T.name, T.values.reduce((he, K) => he + K, 0)]));
|
|
3917
3926
|
H.sort((T, he) => {
|
|
@@ -3936,7 +3945,7 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
3936
3945
|
ze.top = Ie + pe;
|
|
3937
3946
|
}
|
|
3938
3947
|
I && j === "bottom" && (ze.bottom = (ze.bottom ?? 24) + Ie), I && j === "left" && (ze.left = (ze.left ?? 50) + ce.width + 10), I && j === "right" && (ze.right = (ze.right ?? 20) + ce.width + 10), we > 0 && (ze.right = (ze.right ?? 20) + we);
|
|
3939
|
-
const { chartArea: Ne, width: Z, height: U, margin: Ae } = Wt(g, ze), Te = aa(d, Ae), fe = p.scalePoint().domain(n.labels).range([0, Z]).padding(e.edgePadding ? 0.6 : 0), Le = fe,
|
|
3948
|
+
const { chartArea: Ne, width: Z, height: U, margin: Ae } = Wt(g, ze), Te = aa(d, Ae), fe = p.scalePoint().domain(n.labels).range([0, Z]).padding(e.edgePadding ? 0.6 : 0), Le = fe, Ve = (pe) => fe(n.labels[pe]) ?? 0, Ee = p.scaleLinear().domain([0, le]).nice().range([U, 0]);
|
|
3940
3949
|
u.attach(Ne, Te), u.update({
|
|
3941
3950
|
vertical: {
|
|
3942
3951
|
scale: Ee,
|
|
@@ -3959,8 +3968,8 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
3959
3968
|
points: he,
|
|
3960
3969
|
colorIndex: T >= 0 ? T : 0
|
|
3961
3970
|
};
|
|
3962
|
-
}), R = new Set((e.highlights ?? []).map((pe) => pe.target)), J = R.size > 0, re = e.areaFillOpacity != null ? e.areaFillOpacity : 0.85, ke = new
|
|
3963
|
-
if (ke.config({ xPos:
|
|
3971
|
+
}), R = new Set((e.highlights ?? []).map((pe) => pe.target)), J = R.size > 0, re = e.areaFillOpacity != null ? e.areaFillOpacity : 0.85, ke = new Df(p.select(O));
|
|
3972
|
+
if (ke.config({ xPos: Ve, colors: y, curve: Q, areaFillOpacity: re, highlightTargets: R }), s.length > 0 || l.length > 0) {
|
|
3964
3973
|
const pe = (Te == null ? void 0 : Te.dx) ?? 0, T = (Te == null ? void 0 : Te.dy) ?? 0, he = O.querySelectorAll(":scope > g");
|
|
3965
3974
|
he[0] && St(he[0], s, pe, T), he[1] && St(he[1], l, pe, T);
|
|
3966
3975
|
}
|
|
@@ -3970,7 +3979,7 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
3970
3979
|
}), F || p.select(O).selectAll(".bc-line").attr("display", "none"), p.select(O).selectAll(".bc-line").each(function(pe) {
|
|
3971
3980
|
const T = pe, he = $.get(T.name) ?? Xe(T.name, T.colorIndex, y, w), K = Ti(T.name, e.interpolation ?? "monotoneX", w), Me = r ? p.select(this).transition().duration(Be()) : p.select(this);
|
|
3972
3981
|
if (Me.attr("stroke", he), J && Me.attr("opacity", rt(R, T.name, 1)), K !== (e.interpolation ?? "monotoneX")) {
|
|
3973
|
-
const qe = Ca(K), nt = p.line().curve(qe).x((At, ft) =>
|
|
3982
|
+
const qe = Ca(K), nt = p.line().curve(qe).x((At, ft) => Ve(ft)).y((At) => At[1]);
|
|
3974
3983
|
Me.attr("d", nt(T.points));
|
|
3975
3984
|
}
|
|
3976
3985
|
}), (Ot = e.annotations) != null && Ot.length) {
|
|
@@ -3981,7 +3990,7 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
3981
3990
|
value: ((K = v[0]) == null ? void 0 : K.values[he]) ?? 0
|
|
3982
3991
|
};
|
|
3983
3992
|
});
|
|
3984
|
-
Dr(Ne, e.annotations, { scaleX: Le, scaleY: Ee, data: pe, width: Z, height: U, backgroundColor:
|
|
3993
|
+
Dr(Ne, e.annotations, { scaleX: Le, scaleY: Ee, data: pe, width: Z, height: U, backgroundColor: Tt(t), transition: r, priorAnnotations: c });
|
|
3985
3994
|
}
|
|
3986
3995
|
if (e.tooltips || e.crosshair) {
|
|
3987
3996
|
const pe = [];
|
|
@@ -3990,7 +3999,7 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
3990
3999
|
Array.from(T).forEach((K, Me) => {
|
|
3991
4000
|
const qe = K[1] - K[0];
|
|
3992
4001
|
pe.push({
|
|
3993
|
-
cx:
|
|
4002
|
+
cx: Ve(Me),
|
|
3994
4003
|
cy: Ee(K[1]),
|
|
3995
4004
|
label: n.labels[Me],
|
|
3996
4005
|
value: Math.round(qe * 100) / 100,
|
|
@@ -4007,11 +4016,11 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
4007
4016
|
crosshairDirection: e.crosshairDirection,
|
|
4008
4017
|
crosshairStyle: e.crosshairStyle,
|
|
4009
4018
|
crosshairColor: e.crosshairColor,
|
|
4010
|
-
numberFormat: (
|
|
4019
|
+
numberFormat: (Dt = e.verticalAxis) == null ? void 0 : Dt.numberFormat,
|
|
4011
4020
|
container: t
|
|
4012
4021
|
});
|
|
4013
4022
|
}
|
|
4014
|
-
const Y = n.labels.length - 1, de =
|
|
4023
|
+
const Y = n.labels.length - 1, de = Ve(Y) + 6, Ce = [];
|
|
4015
4024
|
if (v.forEach((pe, T) => {
|
|
4016
4025
|
var At;
|
|
4017
4026
|
if (ya(pe.name, P, w) !== "direct")
|
|
@@ -4041,7 +4050,7 @@ function Df(t, a, e = {}, r = !1) {
|
|
|
4041
4050
|
} else j === "bottom" ? he = U + 25 : j === "left" ? T = -(ce.width + 10) : j === "right" && (T = Z + 10);
|
|
4042
4051
|
Aa(Ne, Oe, pe, he, j, _, Z, U, T, [], { left: Ae.left, right: Ae.right });
|
|
4043
4052
|
}
|
|
4044
|
-
Ut(t, { chartType: "area-stacked", margin: Ae }), o && (
|
|
4053
|
+
Ut(t, { chartType: "area-stacked", margin: Ae }), o && (Vt(C.node()), _t(t, o));
|
|
4045
4054
|
}
|
|
4046
4055
|
const Yi = [
|
|
4047
4056
|
"#4e79a7",
|
|
@@ -4053,7 +4062,7 @@ const Yi = [
|
|
|
4053
4062
|
"#b07aa1",
|
|
4054
4063
|
"#ff9da7"
|
|
4055
4064
|
];
|
|
4056
|
-
class
|
|
4065
|
+
class Nf extends ht {
|
|
4057
4066
|
initialize() {
|
|
4058
4067
|
this.configDefine("x", { defaultValue: p.scaleBand() }), this.configDefine("y", { defaultValue: p.scaleLinear() }), this.configDefine("colors", { defaultValue: Yi });
|
|
4059
4068
|
const a = this.base.append("g");
|
|
@@ -4079,7 +4088,7 @@ class Ef extends ht {
|
|
|
4079
4088
|
});
|
|
4080
4089
|
}
|
|
4081
4090
|
}
|
|
4082
|
-
function
|
|
4091
|
+
function Ff(t, a, e) {
|
|
4083
4092
|
const r = [];
|
|
4084
4093
|
for (const n of t) {
|
|
4085
4094
|
const s = n.key, l = e.findIndex((o) => o.name === s);
|
|
@@ -4097,20 +4106,20 @@ function Nf(t, a, e) {
|
|
|
4097
4106
|
}
|
|
4098
4107
|
return r;
|
|
4099
4108
|
}
|
|
4100
|
-
function
|
|
4109
|
+
function If(t, a, e = {}, r = !1) {
|
|
4101
4110
|
var Ee, L, M, C, O, Q, q, R;
|
|
4102
4111
|
qt(r);
|
|
4103
4112
|
let n = [], s = null, l, o;
|
|
4104
4113
|
const c = Rt.for(t);
|
|
4105
4114
|
if (r) {
|
|
4106
4115
|
const J = Xt(t);
|
|
4107
|
-
o = J == null ? void 0 : J.margin, c.detach(), (J == null ? void 0 : J.chartType) === "column-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : J && (s =
|
|
4116
|
+
o = J == null ? void 0 : J.margin, c.detach(), (J == null ? void 0 : J.chartType) === "column-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : J && (s = Gt(t)), l = /* @__PURE__ */ new Map();
|
|
4108
4117
|
for (const re of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
4109
|
-
for (const [ke, Y] of
|
|
4118
|
+
for (const [ke, Y] of zt(re))
|
|
4110
4119
|
l.set(ke, Y);
|
|
4111
4120
|
t.replaceChildren();
|
|
4112
4121
|
}
|
|
4113
|
-
const { body: d } = Ht(t, e.frame), u = a.series ?? [], g = u.filter((J) => !Da(J.name, e.seriesOverrides)), b = g.map((J) => J.name), m = e.colors ?? Yi, v = e.seriesOverrides, y = e.legend !== !1, x =
|
|
4122
|
+
const { body: d } = Ht(t, e.frame), u = a.series ?? [], g = u.filter((J) => !Da(J.name, e.seriesOverrides)), b = g.map((J) => J.name), m = e.colors ?? Yi, v = e.seriesOverrides, y = e.legend !== !1, x = Pt(d).width, w = 350, $ = e.legendPosition ?? "top", S = x > 0 && x < w && ($ === "left" || $ === "right") ? "top" : $, P = e.legendAnchor ?? "start", B = { labels: a.labels, values: a.values, series: g }, I = e.stackMode === La.Percent, X = I ? Mn(B) : Cn(B), V = Ff(X, a.labels, u), G = I ? 100 : p.max(V, (J) => J.y1) ?? 0, _ = Ma([0, G], (Ee = e.verticalAxis) == null ? void 0 : Ee.range, (L = e.verticalAxis) == null ? void 0 : L.numberFormat, (M = e.verticalAxis) == null ? void 0 : M.scaleType), ne = ra(x, (C = e.verticalAxis) == null ? void 0 : C.labelPosition, (O = e.horizontalAxis) == null ? void 0 : O.labelPosition, (Q = e.verticalAxis) == null ? void 0 : Q.direction, _), ie = Math.max(0, x - (ne.left ?? 50) - (ne.right ?? 20)), ae = yn(a.labels, ie, e.horizontalAxis);
|
|
4114
4123
|
ae !== void 0 && (ne.bottom = ae);
|
|
4115
4124
|
const F = ne.top != null, H = Math.max(0, x - (ne.left ?? 50) - (ne.right ?? 20)), W = y ? Sa(b, S, H) : { width: 0, height: 0 }, oe = y ? W.height + 15 : 0, le = { ...ne };
|
|
4116
4125
|
if (y && S === "top") {
|
|
@@ -4128,12 +4137,12 @@ function Ff(t, a, e = {}, r = !1) {
|
|
|
4128
4137
|
}));
|
|
4129
4138
|
J.sort((re, ke) => ke.total - re.total), be = J.map((re) => re.label);
|
|
4130
4139
|
}
|
|
4131
|
-
const me = p.scaleBand().domain(be).range([0, se]).padding(Ta(e.barGap)), ce = p.scaleLinear().domain([0,
|
|
4140
|
+
const me = p.scaleBand().domain(be).range([0, se]).padding(Ta(e.barGap)), ce = p.scaleLinear().domain([0, G]).nice().range([Se, 0]);
|
|
4132
4141
|
c.attach($e, we), c.update({
|
|
4133
4142
|
vertical: { scale: ce, height: Se, options: { ...e.verticalAxis, gridWidth: se, topPadding: ye.top } },
|
|
4134
4143
|
horizontal: { scale: me, height: Se, options: { ...e.horizontalAxis, width: se } }
|
|
4135
4144
|
});
|
|
4136
|
-
const Ie = $e.ownerSVGElement, ze = na(Ie, t, "bars", { x: 0, y: 0, width: se, height: Se }), Ne = p.select($e).append("g").attr("clip-path", `url(#${ze})`), Z = be === a.labels ?
|
|
4145
|
+
const Ie = $e.ownerSVGElement, ze = na(Ie, t, "bars", { x: 0, y: 0, width: se, height: Se }), Ne = p.select($e).append("g").attr("clip-path", `url(#${ze})`), Z = be === a.labels ? V : be.flatMap((J) => V.filter((re) => re.label === J)), U = new Nf(Ne);
|
|
4137
4146
|
if (U.config({ x: me, y: ce, colors: m }), n.length > 0) {
|
|
4138
4147
|
const J = Ne.node().querySelector("g");
|
|
4139
4148
|
St(J, n, (we == null ? void 0 : we.dx) ?? 0, (we == null ? void 0 : we.dy) ?? 0);
|
|
@@ -4149,20 +4158,20 @@ function Ff(t, a, e = {}, r = !1) {
|
|
|
4149
4158
|
label: re,
|
|
4150
4159
|
value: g.reduce((Y, de) => Y + (de.values[ke] ?? 0), 0)
|
|
4151
4160
|
}));
|
|
4152
|
-
U.use(Xa(e.annotations, { scaleX: me, scaleY: ce, data: J, width: se, height: Se, backgroundColor:
|
|
4161
|
+
U.use(Xa(e.annotations, { scaleX: me, scaleY: ce, data: J, width: se, height: Se, backgroundColor: Tt(t), transition: r, priorAnnotations: l }));
|
|
4153
4162
|
}
|
|
4154
|
-
U.draw(Z), Ut(t, { chartType: "column-stacked", margin: ye }), s && (
|
|
4163
|
+
U.draw(Z), Ut(t, { chartType: "column-stacked", margin: ye }), s && (Vt(Ne.node()), _t(t, s));
|
|
4155
4164
|
const Ae = oa(e.colorizes), Te = ja(e.highlights);
|
|
4156
4165
|
p.select($e).selectAll(".bc-bar-stacked").each(function(J) {
|
|
4157
4166
|
const re = J, ke = Ae.get(re.seriesName) ?? Xe(re.seriesName, re.seriesIndex, m, v), Y = or(re.seriesName, v), de = r ? p.select(this).transition().duration(Be()) : p.select(this);
|
|
4158
4167
|
de.attr("fill", ke), Y < 1 && de.attr("fill-opacity", Y), Te.size > 0 && de.attr("opacity", rt(Te, re.seriesName));
|
|
4159
4168
|
});
|
|
4160
|
-
const fe = e.valueLabels ?? !1, Le = p.rollup(Z, (J) => p.max(J, (re) => re.y1) ?? 0, (J) => J.label),
|
|
4169
|
+
const fe = e.valueLabels ?? !1, Le = p.rollup(Z, (J) => p.max(J, (re) => re.y1) ?? 0, (J) => J.label), Ve = p.select($e).append("g").attr("class", "bc-value-labels");
|
|
4161
4170
|
if (Z.forEach((J) => {
|
|
4162
4171
|
if (!Ka(J.seriesName, fe, v))
|
|
4163
4172
|
return;
|
|
4164
4173
|
const re = (me(J.label) ?? 0) + me.bandwidth() / 2, ke = ce(J.y0) - (ce(J.y0) - ce(J.y1)) / 2;
|
|
4165
|
-
|
|
4174
|
+
Ve.append("text").attr("class", "bc-value-label").attr("data-series", J.seriesName).attr("x", re).attr("y", ke).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", "currentColor").text(I ? `${Math.round(J.value)}%` : e.valueLabels === "percent" ? Or(J.value, Le.get(J.label) ?? 0) : String(Math.round(J.value * 100) / 100));
|
|
4166
4175
|
}), y && b.length > 0) {
|
|
4167
4176
|
const J = b.map((Y) => {
|
|
4168
4177
|
const de = u.findIndex((Ce) => Ce.name === Y);
|
|
@@ -4186,7 +4195,7 @@ const Hi = [
|
|
|
4186
4195
|
"#b07aa1",
|
|
4187
4196
|
"#ff9da7"
|
|
4188
4197
|
], Ts = 13;
|
|
4189
|
-
class
|
|
4198
|
+
class Bf extends ht {
|
|
4190
4199
|
initialize() {
|
|
4191
4200
|
this.configDefine("x", { defaultValue: p.scaleLinear() }), this.configDefine("y", { defaultValue: p.scaleBand() }), this.configDefine("colors", { defaultValue: Hi }), this.configDefine("categoryLabelOffset", { defaultValue: 0 });
|
|
4192
4201
|
const a = this.base.append("g");
|
|
@@ -4212,7 +4221,7 @@ class If extends ht {
|
|
|
4212
4221
|
});
|
|
4213
4222
|
}
|
|
4214
4223
|
}
|
|
4215
|
-
function
|
|
4224
|
+
function Vf(t, a, e) {
|
|
4216
4225
|
const r = [];
|
|
4217
4226
|
for (const n of t) {
|
|
4218
4227
|
const s = n.key, l = e.findIndex((o) => o.name === s);
|
|
@@ -4237,13 +4246,13 @@ function Gf(t, a, e = {}, r = !1) {
|
|
|
4237
4246
|
const c = Rt.for(t);
|
|
4238
4247
|
if (r) {
|
|
4239
4248
|
const Y = Xt(t);
|
|
4240
|
-
o = Y == null ? void 0 : Y.margin, c.detach(), (Y == null ? void 0 : Y.chartType) === "bar-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : Y && (s =
|
|
4249
|
+
o = Y == null ? void 0 : Y.margin, c.detach(), (Y == null ? void 0 : Y.chartType) === "bar-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : Y && (s = Gt(t)), l = /* @__PURE__ */ new Map();
|
|
4241
4250
|
for (const de of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
|
|
4242
|
-
for (const [Ce, Oe] of
|
|
4251
|
+
for (const [Ce, Oe] of zt(de))
|
|
4243
4252
|
l.set(Ce, Oe);
|
|
4244
4253
|
t.replaceChildren();
|
|
4245
4254
|
}
|
|
4246
|
-
const { body: d } = Ht(t, e.frame), u = a.series ?? [], g = u.filter((Y) => !Da(Y.name, e.seriesOverrides)), b = g.map((Y) => Y.name), m = e.colors ?? Hi, v = e.seriesOverrides, y = e.legend !== !1, x =
|
|
4255
|
+
const { body: d } = Ht(t, e.frame), u = a.series ?? [], g = u.filter((Y) => !Da(Y.name, e.seriesOverrides)), b = g.map((Y) => Y.name), m = e.colors ?? Hi, v = e.seriesOverrides, y = e.legend !== !1, x = Pt(d).width, w = 350, $ = e.legendPosition ?? "top", S = x > 0 && x < w && ($ === "left" || $ === "right") ? "top" : $, P = e.legendAnchor ?? "start", B = { labels: a.labels, values: a.values, series: g }, I = e.stackMode === La.Percent, X = I ? Mn(B) : Cn(B), V = Vf(X, a.labels, u), G = I ? 100 : p.max(V, (Y) => Y.y1) ?? 0, j = e.categoryLabelLine === !0, _ = Tr(a.labels), ne = j ? We.Off : (O = e.verticalAxis) == null ? void 0 : O.labelPosition, ie = ra(x, ne, (Q = e.horizontalAxis) == null ? void 0 : Q.labelPosition, (q = e.verticalAxis) == null ? void 0 : q.direction, _, (R = e.horizontalAxis) == null ? void 0 : R.showAxis), ae = ie.top != null, F = Math.max(0, x - (ie.left ?? 50) - (ie.right ?? 20)), H = y ? Sa(b, S, F) : { width: 0, height: 0 }, W = y ? H.height + 15 : 0, oe = { ...ie };
|
|
4247
4256
|
if (y && S === "top") {
|
|
4248
4257
|
const Y = ae ? 15 : 0;
|
|
4249
4258
|
oe.top = W + Y;
|
|
@@ -4259,7 +4268,7 @@ function Gf(t, a, e = {}, r = !1) {
|
|
|
4259
4268
|
}));
|
|
4260
4269
|
Y.sort((de, Ce) => Ce.total - de.total), we = Y.map((de) => de.label);
|
|
4261
4270
|
}
|
|
4262
|
-
const be = p.scaleLinear().domain([0,
|
|
4271
|
+
const be = p.scaleLinear().domain([0, G]).nice().range([0, $e]), me = p.scaleBand().domain(we).range([0, se]).padding(Ta(e.barGap));
|
|
4263
4272
|
c.attach(le, ye), c.update({
|
|
4264
4273
|
horizontal: { scale: be, height: se, options: { ...e.horizontalAxis, width: $e } },
|
|
4265
4274
|
vertical: {
|
|
@@ -4273,7 +4282,7 @@ function Gf(t, a, e = {}, r = !1) {
|
|
|
4273
4282
|
},
|
|
4274
4283
|
order: "horizontal-first"
|
|
4275
4284
|
});
|
|
4276
|
-
const ce = le.ownerSVGElement, Ie = na(ce, t, "bars", { x: 0, y: 0, width: $e, height: se }), ze = p.select(le).append("g").attr("clip-path", `url(#${Ie})`), Ne = we === a.labels ?
|
|
4285
|
+
const ce = le.ownerSVGElement, Ie = na(ce, t, "bars", { x: 0, y: 0, width: $e, height: se }), ze = p.select(le).append("g").attr("clip-path", `url(#${Ie})`), Ne = we === a.labels ? V : we.flatMap((Y) => V.filter((de) => de.label === Y)), Z = j ? Ts : 0, U = new Bf(ze);
|
|
4277
4286
|
if (U.config({ x: be, y: me, colors: m, categoryLabelOffset: Z }), n.length > 0) {
|
|
4278
4287
|
const Y = ze.node().querySelector("g");
|
|
4279
4288
|
St(Y, n, (ye == null ? void 0 : ye.dx) ?? 0, (ye == null ? void 0 : ye.dy) ?? 0);
|
|
@@ -4290,9 +4299,9 @@ function Gf(t, a, e = {}, r = !1) {
|
|
|
4290
4299
|
label: de,
|
|
4291
4300
|
value: g.reduce((Oe, _e) => Oe + (_e.values[Ce] ?? 0), 0)
|
|
4292
4301
|
}));
|
|
4293
|
-
U.use(Xa(e.annotations, { scaleX: me, scaleY: be, data: Y, width: $e, height: se, backgroundColor:
|
|
4302
|
+
U.use(Xa(e.annotations, { scaleX: me, scaleY: be, data: Y, width: $e, height: se, backgroundColor: Tt(t), orientation: ct.Horizontal, transition: r, priorAnnotations: l }));
|
|
4294
4303
|
}
|
|
4295
|
-
U.draw(Ne), Ut(t, { chartType: "bar-stacked", margin: Se }), s && (
|
|
4304
|
+
U.draw(Ne), Ut(t, { chartType: "bar-stacked", margin: Se }), s && (Vt(ze.node()), _t(t, s));
|
|
4296
4305
|
const Ae = oa(e.colorizes), Te = ja(e.highlights);
|
|
4297
4306
|
if (p.select(le).selectAll(".bc-bar-stacked").each(function(Y) {
|
|
4298
4307
|
const de = Y, Ce = Ae.get(de.seriesName) ?? Xe(de.seriesName, de.seriesIndex, m, v), Oe = or(de.seriesName, v), _e = r ? p.select(this).transition().duration(Be()) : p.select(this);
|
|
@@ -4304,12 +4313,12 @@ function Gf(t, a, e = {}, r = !1) {
|
|
|
4304
4313
|
Y.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", Ce + Ts / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(de);
|
|
4305
4314
|
}
|
|
4306
4315
|
}
|
|
4307
|
-
const fe = e.valueLabels ?? !1, Le = e.valueLabelPosition ?? Fe.Auto,
|
|
4316
|
+
const fe = e.valueLabels ?? !1, Le = e.valueLabelPosition ?? Fe.Auto, Ve = /* @__PURE__ */ new Set(), Ee = /* @__PURE__ */ new Map();
|
|
4308
4317
|
for (const Y of we) {
|
|
4309
4318
|
const de = Ne.filter((Ce) => Ce.label === Y).sort((Ce, Oe) => Ce.y1 - Oe.y1);
|
|
4310
4319
|
if (de.length > 0) {
|
|
4311
4320
|
const Ce = de[de.length - 1];
|
|
4312
|
-
|
|
4321
|
+
Ve.add(Ce.label + "\0" + Ce.seriesName);
|
|
4313
4322
|
for (let Oe = 0; Oe < de.length - 1; Oe++) {
|
|
4314
4323
|
const _e = de[Oe].label + "\0" + de[Oe].seriesName;
|
|
4315
4324
|
Ee.set(_e, be(de[Oe + 1].y1) - be(de[Oe].y1));
|
|
@@ -4320,22 +4329,22 @@ function Gf(t, a, e = {}, r = !1) {
|
|
|
4320
4329
|
if (Ne.forEach((Y) => {
|
|
4321
4330
|
if (!Ka(Y.seriesName, fe, v))
|
|
4322
4331
|
return;
|
|
4323
|
-
const de = I ? `${Math.round(Y.value)}%` : e.valueLabels === "percent" ? Or(Y.value, M.get(Y.label) ?? 0) : String(Math.round(Y.value * 100) / 100), Ce = be(Y.y1) - be(Y.y0), Oe = de.length * 6.5 + 8, _e = Ce >= Oe, Ue = (me(Y.label) ?? 0) + Z + (me.bandwidth() - Z) / 2, Ze = Xe(Y.seriesName, Y.seriesIndex, m, v), Qe =
|
|
4332
|
+
const de = I ? `${Math.round(Y.value)}%` : e.valueLabels === "percent" ? Or(Y.value, M.get(Y.label) ?? 0) : String(Math.round(Y.value * 100) / 100), Ce = be(Y.y1) - be(Y.y0), Oe = de.length * 6.5 + 8, _e = Ce >= Oe, Ue = (me(Y.label) ?? 0) + Z + (me.bandwidth() - Z) / 2, Ze = Xe(Y.seriesName, Y.seriesIndex, m, v), Qe = Ve.has(Y.label + "\0" + Y.seriesName), gt = Le === Fe.Outside || Le === Fe.Auto && !_e && Qe, pt = () => {
|
|
4324
4333
|
const je = be(Y.y0) + Ce / 2;
|
|
4325
|
-
C.append("text").attr("class", "bc-value-label").attr("data-series", Y.seriesName).attr("opacity", 0).attr("x", je).attr("y", Ue).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill",
|
|
4334
|
+
C.append("text").attr("class", "bc-value-label").attr("data-series", Y.seriesName).attr("opacity", 0).attr("x", je).attr("y", Ue).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Bt(Ze)).text(de);
|
|
4326
4335
|
};
|
|
4327
4336
|
if (gt)
|
|
4328
4337
|
if (Le === Fe.Inside)
|
|
4329
4338
|
pt();
|
|
4330
4339
|
else {
|
|
4331
|
-
const je = be(Y.y1) + 4, Ot = L.get(Y.label) ?? 0,
|
|
4340
|
+
const je = be(Y.y1) + 4, Ot = L.get(Y.label) ?? 0, Dt = Ee.get(Y.label + "\0" + Y.seriesName), pe = je < Ot, T = Dt !== void 0 && Oe + 4 > Dt, he = $e + Se.right - 2, K = je + Oe > he;
|
|
4332
4341
|
pe || T || K ? pt() : (L.set(Y.label, je + Oe), C.append("text").attr("class", "bc-value-label").attr("data-series", Y.seriesName).attr("x", je).attr("y", Ue).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", "currentColor").text(de));
|
|
4333
4342
|
}
|
|
4334
4343
|
else if (!_e)
|
|
4335
4344
|
pt();
|
|
4336
4345
|
else {
|
|
4337
4346
|
const je = be(Y.y0) + Ce / 2;
|
|
4338
|
-
C.append("text").attr("class", "bc-value-label").attr("data-series", Y.seriesName).attr("x", je).attr("y", Ue).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill",
|
|
4347
|
+
C.append("text").attr("class", "bc-value-label").attr("data-series", Y.seriesName).attr("x", je).attr("y", Ue).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Bt(Ze)).text(de);
|
|
4339
4348
|
}
|
|
4340
4349
|
}), y && b.length > 0) {
|
|
4341
4350
|
const Y = b.map((Oe) => {
|
|
@@ -4360,7 +4369,7 @@ const Wi = [
|
|
|
4360
4369
|
"#b07aa1",
|
|
4361
4370
|
"#ff9da7"
|
|
4362
4371
|
], Ps = 16, Ar = 20, zs = 13;
|
|
4363
|
-
class
|
|
4372
|
+
class _f extends ht {
|
|
4364
4373
|
initialize() {
|
|
4365
4374
|
this.configDefine("y", { defaultValue: p.scaleBand() }), this.configDefine("colors", { defaultValue: Wi }), this.configDefine("categoryLabelOffset", { defaultValue: 0 });
|
|
4366
4375
|
const a = this.base.append("g");
|
|
@@ -4386,7 +4395,7 @@ class Vf extends ht {
|
|
|
4386
4395
|
});
|
|
4387
4396
|
}
|
|
4388
4397
|
}
|
|
4389
|
-
function
|
|
4398
|
+
function Rf(t, a, e, r) {
|
|
4390
4399
|
const n = t.length;
|
|
4391
4400
|
if (n === 0)
|
|
4392
4401
|
return [];
|
|
@@ -4402,7 +4411,7 @@ function _f(t, a, e, r) {
|
|
|
4402
4411
|
};
|
|
4403
4412
|
});
|
|
4404
4413
|
}
|
|
4405
|
-
function
|
|
4414
|
+
function Yf(t, a, e, r) {
|
|
4406
4415
|
const n = [];
|
|
4407
4416
|
for (const s of t) {
|
|
4408
4417
|
const l = r.find((o) => o.name === s.seriesName);
|
|
@@ -4421,16 +4430,16 @@ function Rf(t, a, e, r) {
|
|
|
4421
4430
|
}
|
|
4422
4431
|
return n;
|
|
4423
4432
|
}
|
|
4424
|
-
function
|
|
4425
|
-
var Ae, Te, fe, Le,
|
|
4433
|
+
function Hf(t, a, e = {}, r = !1) {
|
|
4434
|
+
var Ae, Te, fe, Le, Ve, Ee;
|
|
4426
4435
|
qt(r);
|
|
4427
4436
|
let n = [], s = null, l;
|
|
4428
4437
|
const o = Rt.for(t);
|
|
4429
4438
|
if (r) {
|
|
4430
4439
|
const L = Xt(t);
|
|
4431
|
-
l = L == null ? void 0 : L.margin, o.detach(), (L == null ? void 0 : L.chartType) === "bar-split" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")) : L && (s =
|
|
4440
|
+
l = L == null ? void 0 : L.margin, o.detach(), (L == null ? void 0 : L.chartType) === "bar-split" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")) : L && (s = Gt(t)), t.replaceChildren();
|
|
4432
4441
|
}
|
|
4433
|
-
const { body: c } = Ht(t, e.frame), d = a.series ?? [], u = d.filter((L) => !Da(L.name, e.seriesOverrides)), g = u.map((L) => L.name), b = e.colors ?? Wi, m = e.seriesOverrides, v = e.legend !== !1, y =
|
|
4442
|
+
const { body: c } = Ht(t, e.frame), d = a.series ?? [], u = d.filter((L) => !Da(L.name, e.seriesOverrides)), g = u.map((L) => L.name), b = e.colors ?? Wi, m = e.seriesOverrides, v = e.legend !== !1, y = Pt(c).width, x = 350, w = e.legendPosition ?? "top", $ = y > 0 && y < x && (w === "left" || w === "right") ? "top" : w, S = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, B = Tr(a.labels), I = P ? We.Off : (Ae = e.verticalAxis) == null ? void 0 : Ae.labelPosition, X = ra(
|
|
4434
4443
|
y,
|
|
4435
4444
|
I,
|
|
4436
4445
|
(Te = e.horizontalAxis) == null ? void 0 : Te.labelPosition,
|
|
@@ -4439,8 +4448,8 @@ function Yf(t, a, e = {}, r = !1) {
|
|
|
4439
4448
|
(Le = e.horizontalAxis) == null ? void 0 : Le.showAxis
|
|
4440
4449
|
);
|
|
4441
4450
|
X.top = (X.top ?? 12) + Ar;
|
|
4442
|
-
const
|
|
4443
|
-
v && $ === "top" && (_.top = j + Ar), v && $ === "bottom" && (_.bottom = (_.bottom ?? 24) + j), v && $ === "left" && (_.left = (_.left ?? 50) +
|
|
4451
|
+
const V = Math.max(0, y - (X.left ?? 50) - (X.right ?? 20)), G = v ? Sa(g, $, V) : { width: 0, height: 0 }, j = v ? G.height + 15 : 0, _ = { ...X };
|
|
4452
|
+
v && $ === "top" && (_.top = j + Ar), v && $ === "bottom" && (_.bottom = (_.bottom ?? 24) + j), v && $ === "left" && (_.left = (_.left ?? 50) + G.width + 10), v && $ === "right" && (_.right = (_.right ?? 20) + G.width + 10);
|
|
4444
4453
|
const { chartArea: ne, width: ie, height: ae, margin: F } = Wt(c, _), H = aa(l, F);
|
|
4445
4454
|
let W = a.labels;
|
|
4446
4455
|
if (e.sortMode === "total") {
|
|
@@ -4457,16 +4466,16 @@ function Yf(t, a, e = {}, r = !1) {
|
|
|
4457
4466
|
height: ae,
|
|
4458
4467
|
options: {
|
|
4459
4468
|
...e.verticalAxis,
|
|
4460
|
-
labelPosition: P ? We.Off : (
|
|
4469
|
+
labelPosition: P ? We.Off : (Ve = e.verticalAxis) == null ? void 0 : Ve.labelPosition,
|
|
4461
4470
|
topPadding: F.top
|
|
4462
4471
|
}
|
|
4463
4472
|
},
|
|
4464
4473
|
order: "horizontal-first"
|
|
4465
4474
|
});
|
|
4466
|
-
const $e = e.sharedScale === !0, se =
|
|
4475
|
+
const $e = e.sharedScale === !0, se = Rf(u, d, ie, $e), Se = ne.ownerSVGElement, ye = na(Se, t, "bars", { x: 0, y: 0, width: ie, height: ae }), we = p.select(ne).append("g").attr("clip-path", `url(#${ye})`), be = p.select(ne).append("g").attr("class", "bc-split-headers");
|
|
4467
4476
|
for (const L of se)
|
|
4468
4477
|
be.append("text").attr("class", "bc-split-header").attr("x", L.xOffset + L.panelWidth / 2).attr("y", -Ar / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("font-weight", "600").attr("fill", "currentColor").text(L.seriesName);
|
|
4469
|
-
const me =
|
|
4478
|
+
const me = Yf(se, W, a.labels, d), ce = new _f(we);
|
|
4470
4479
|
if (ce.config({ y: oe, colors: b, categoryLabelOffset: le }), n.length > 0) {
|
|
4471
4480
|
const L = we.node().querySelector("g");
|
|
4472
4481
|
St(L, n, (H == null ? void 0 : H.dx) ?? 0, (H == null ? void 0 : H.dy) ?? 0);
|
|
@@ -4480,7 +4489,7 @@ function Yf(t, a, e = {}, r = !1) {
|
|
|
4480
4489
|
orientation: ct.Horizontal
|
|
4481
4490
|
})), ce.draw(me);
|
|
4482
4491
|
const Ie = ja(e.highlights);
|
|
4483
|
-
Ut(t, { chartType: "bar-split", margin: F }), s && (
|
|
4492
|
+
Ut(t, { chartType: "bar-split", margin: F }), s && (Vt(we.node()), _t(t, s));
|
|
4484
4493
|
const ze = oa(e.colorizes);
|
|
4485
4494
|
if (p.select(ne).selectAll(".bc-bar-split").each(function(L) {
|
|
4486
4495
|
const M = L, C = ze.get(M.seriesName) ?? Xe(M.seriesName, M.seriesIndex, b, m), O = or(M.seriesName, m), Q = r ? p.select(this).transition().duration(Be()) : p.select(this);
|
|
@@ -4502,7 +4511,7 @@ function Yf(t, a, e = {}, r = !1) {
|
|
|
4502
4511
|
const C = Xe(L.seriesName, L.seriesIndex, b, m), O = L.xPos + L.barWidth, Q = Math.max(0, oe.bandwidth() - le), q = (oe(L.label) ?? 0) + le + Q / 2, R = Z === Fe.Inside || Z === Fe.Auto && L.barWidth > 30;
|
|
4503
4512
|
let J, re, ke;
|
|
4504
4513
|
if (R)
|
|
4505
|
-
J = O - 4, re = "end", ke =
|
|
4514
|
+
J = O - 4, re = "end", ke = Bt(C);
|
|
4506
4515
|
else {
|
|
4507
4516
|
const Y = O + 4, de = M.xOffset + M.panelWidth;
|
|
4508
4517
|
Y + 20 > de ? (J = L.xPos - 4, re = "end") : (J = Y, re = "start"), ke = "currentColor";
|
|
@@ -4514,7 +4523,7 @@ function Yf(t, a, e = {}, r = !1) {
|
|
|
4514
4523
|
return Xe(O, Q, b, m);
|
|
4515
4524
|
});
|
|
4516
4525
|
let M = 0, C = 0;
|
|
4517
|
-
$ === "top" ? C = -(
|
|
4526
|
+
$ === "top" ? C = -(G.height + 10 + Ar) : $ === "bottom" ? C = ae + 25 : $ === "left" ? M = -(G.width + 10) : $ === "right" && (M = ie + 10), Aa(ne, g, L, C, $, S, ie, ae, M, [], { left: F.left, right: F.right });
|
|
4518
4527
|
}
|
|
4519
4528
|
}
|
|
4520
4529
|
const hn = [
|
|
@@ -4527,7 +4536,7 @@ const hn = [
|
|
|
4527
4536
|
"#b07aa1",
|
|
4528
4537
|
"#ff9da7"
|
|
4529
4538
|
], Ds = 13;
|
|
4530
|
-
class
|
|
4539
|
+
class Wf extends ht {
|
|
4531
4540
|
initialize() {
|
|
4532
4541
|
this.configDefine("x", { defaultValue: p.scaleLinear() }), this.configDefine("y0", { defaultValue: p.scaleBand() }), this.configDefine("y1", { defaultValue: p.scaleBand() }), this.configDefine("colors", { defaultValue: hn }), this.configDefine("categoryLabelOffset", { defaultValue: 0 });
|
|
4533
4542
|
const a = this.base.append("g");
|
|
@@ -4553,24 +4562,24 @@ class Hf extends ht {
|
|
|
4553
4562
|
});
|
|
4554
4563
|
}
|
|
4555
4564
|
}
|
|
4556
|
-
function
|
|
4557
|
-
var Te, fe, Le,
|
|
4565
|
+
function qf(t, a, e = {}, r = !1) {
|
|
4566
|
+
var Te, fe, Le, Ve, Ee, L;
|
|
4558
4567
|
qt(r);
|
|
4559
4568
|
let n = [], s = null, l;
|
|
4560
4569
|
const o = Rt.for(t);
|
|
4561
4570
|
if (r) {
|
|
4562
4571
|
const M = Xt(t);
|
|
4563
|
-
l = M == null ? void 0 : M.margin, o.detach(), (M == null ? void 0 : M.chartType) === "bar-grouped" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")) : M && (s =
|
|
4572
|
+
l = M == null ? void 0 : M.margin, o.detach(), (M == null ? void 0 : M.chartType) === "bar-grouped" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")) : M && (s = Gt(t)), t.replaceChildren();
|
|
4564
4573
|
}
|
|
4565
|
-
const { body: c } = Ht(t, e.frame), d = a.series ?? [], u = d.filter((M) => !Da(M.name, e.seriesOverrides)), g = u.map((M) => M.name), b = e.colors ?? hn, m = e.seriesOverrides, v = e.legend !== !1, y =
|
|
4574
|
+
const { body: c } = Ht(t, e.frame), d = a.series ?? [], u = d.filter((M) => !Da(M.name, e.seriesOverrides)), g = u.map((M) => M.name), b = e.colors ?? hn, m = e.seriesOverrides, v = e.legend !== !1, y = Pt(c).width, x = 350, w = e.legendPosition ?? "top", $ = y > 0 && y < x && (w === "left" || w === "right") ? "top" : w, S = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, B = Tr(a.labels), I = P ? We.Off : (Te = e.verticalAxis) == null ? void 0 : Te.labelPosition, X = ra(
|
|
4566
4575
|
y,
|
|
4567
4576
|
I,
|
|
4568
4577
|
(fe = e.horizontalAxis) == null ? void 0 : fe.labelPosition,
|
|
4569
4578
|
(Le = e.verticalAxis) == null ? void 0 : Le.direction,
|
|
4570
4579
|
B,
|
|
4571
|
-
(
|
|
4572
|
-
),
|
|
4573
|
-
v && $ === "top" && (_.top = j), v && $ === "bottom" && (_.bottom = (_.bottom ?? 24) + j), v && $ === "left" && (_.left = (_.left ?? 50) +
|
|
4580
|
+
(Ve = e.horizontalAxis) == null ? void 0 : Ve.showAxis
|
|
4581
|
+
), V = Math.max(0, y - (X.left ?? 50) - (X.right ?? 20)), G = v ? Sa(g, $, V) : { width: 0, height: 0 }, j = v ? G.height + 15 : 0, _ = { ...X };
|
|
4582
|
+
v && $ === "top" && (_.top = j), v && $ === "bottom" && (_.bottom = (_.bottom ?? 24) + j), v && $ === "left" && (_.left = (_.left ?? 50) + G.width + 10), v && $ === "right" && (_.right = (_.right ?? 20) + G.width + 10);
|
|
4574
4583
|
const { chartArea: ne, width: ie, height: ae, margin: F } = Wt(c, _), H = aa(l, F);
|
|
4575
4584
|
let W = a.labels;
|
|
4576
4585
|
if (e.sortMode === "total") {
|
|
@@ -4619,7 +4628,7 @@ function Wf(t, a, e = {}, r = !1) {
|
|
|
4619
4628
|
});
|
|
4620
4629
|
}
|
|
4621
4630
|
}
|
|
4622
|
-
const Ie = new
|
|
4631
|
+
const Ie = new Wf(me);
|
|
4623
4632
|
Ie.config({ x: ye, y0: oe, y1: se, colors: b, categoryLabelOffset: le });
|
|
4624
4633
|
const ze = ja(e.highlights);
|
|
4625
4634
|
if (n.length > 0) {
|
|
@@ -4633,7 +4642,7 @@ function Wf(t, a, e = {}, r = !1) {
|
|
|
4633
4642
|
style: e.crosshairStyle,
|
|
4634
4643
|
color: e.crosshairColor,
|
|
4635
4644
|
orientation: ct.Horizontal
|
|
4636
|
-
})), Ie.draw(ce), Ut(t, { chartType: "bar-grouped", margin: F }), s && (
|
|
4645
|
+
})), Ie.draw(ce), Ut(t, { chartType: "bar-grouped", margin: F }), s && (Vt(me.node()), _t(t, s));
|
|
4637
4646
|
const Ne = oa(e.colorizes);
|
|
4638
4647
|
if (p.select(ne).selectAll(".bc-bar-grouped").each(function(M) {
|
|
4639
4648
|
const C = M, O = Ne.get(C.seriesName) ?? Xe(C.seriesName, C.seriesIndex, b, m), Q = or(C.seriesName, m), q = r ? p.select(this).transition().duration(Be()) : p.select(this);
|
|
@@ -4651,21 +4660,21 @@ function Wf(t, a, e = {}, r = !1) {
|
|
|
4651
4660
|
return;
|
|
4652
4661
|
const C = Xe(M.seriesName, M.seriesIndex, b, m), O = Math.max(0, ye(M.value) - ye(0)), Q = ye(0) + O, q = (oe(M.label) ?? 0) + le + (se(M.seriesName) ?? 0) + se.bandwidth() / 2, R = U === Fe.Inside || U === Fe.Auto && O > 30;
|
|
4653
4662
|
let J, re, ke;
|
|
4654
|
-
R ? (J = Q - 4, re = "end", ke =
|
|
4663
|
+
R ? (J = Q - 4, re = "end", ke = Bt(C)) : (J = Q + 4, re = "start", ke = "currentColor"), Ae.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("x", J).attr("y", q).attr("text-anchor", re).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", ke).text(String(M.value));
|
|
4655
4664
|
}), v && g.length > 0) {
|
|
4656
4665
|
const M = g.map((Q) => {
|
|
4657
4666
|
const q = d.findIndex((R) => R.name === Q);
|
|
4658
4667
|
return Xe(Q, q, b, m);
|
|
4659
4668
|
});
|
|
4660
4669
|
let C = 0, O = 0;
|
|
4661
|
-
$ === "top" ? O = -(
|
|
4670
|
+
$ === "top" ? O = -(G.height + 10) : $ === "bottom" ? O = ae + 25 : $ === "left" ? C = -(G.width + 10) : $ === "right" && (C = ie + 10), Aa(ne, g, M, O, $, S, ie, ae, C, [], { left: F.left, right: F.right });
|
|
4662
4671
|
}
|
|
4663
4672
|
}
|
|
4664
4673
|
const Fr = /* @__PURE__ */ new Map();
|
|
4665
4674
|
function kt(t, a, e) {
|
|
4666
4675
|
Fr.set(t, { renderer: a, options: e });
|
|
4667
4676
|
}
|
|
4668
|
-
function
|
|
4677
|
+
function Xf(t) {
|
|
4669
4678
|
var a;
|
|
4670
4679
|
return (a = Fr.get(t)) == null ? void 0 : a.renderer;
|
|
4671
4680
|
}
|
|
@@ -4688,7 +4697,7 @@ const Es = [
|
|
|
4688
4697
|
default: "Blueprint",
|
|
4689
4698
|
choices: [
|
|
4690
4699
|
{ value: "", text: "Custom" },
|
|
4691
|
-
...
|
|
4700
|
+
...Ac().map((t) => ({ value: t.name, text: t.label }))
|
|
4692
4701
|
]
|
|
4693
4702
|
}, Ct = { key: "autoContrast", type: ue.Boolean, label: "Auto-adjust contrast", default: !1 }, Mt = { key: "allowDarkMode", type: ue.Boolean, label: "Allow dark mode", default: !0 }, Za = { key: "legend", type: ue.Boolean, label: "Show legend", default: !0 }, ha = {
|
|
4694
4703
|
key: "legendPosition",
|
|
@@ -4732,7 +4741,7 @@ const Es = [
|
|
|
4732
4741
|
{ value: da.Middle, text: "Middle" },
|
|
4733
4742
|
{ value: da.End, text: "End" }
|
|
4734
4743
|
]
|
|
4735
|
-
},
|
|
4744
|
+
}, Vr = { key: "valueLabels", type: ue.Boolean, label: "Value labels", default: !1 }, Gr = {
|
|
4736
4745
|
key: "valueLabelPosition",
|
|
4737
4746
|
type: ue.Select,
|
|
4738
4747
|
label: "Label position",
|
|
@@ -4766,26 +4775,26 @@ const Es = [
|
|
|
4766
4775
|
key: "lineSymbolShape",
|
|
4767
4776
|
type: ue.Select,
|
|
4768
4777
|
label: "Symbol",
|
|
4769
|
-
default:
|
|
4778
|
+
default: Nt.Circle,
|
|
4770
4779
|
choices: [
|
|
4771
|
-
{ value:
|
|
4772
|
-
{ value:
|
|
4773
|
-
{ value:
|
|
4774
|
-
{ value:
|
|
4775
|
-
{ value:
|
|
4776
|
-
{ value:
|
|
4777
|
-
{ value:
|
|
4780
|
+
{ value: Nt.Circle, text: "Circle" },
|
|
4781
|
+
{ value: Nt.Square, text: "Square" },
|
|
4782
|
+
{ value: Nt.Diamond, text: "Diamond" },
|
|
4783
|
+
{ value: Nt.Triangle, text: "Triangle Up" },
|
|
4784
|
+
{ value: Nt.TriangleDown, text: "Triangle Down" },
|
|
4785
|
+
{ value: Nt.Cross, text: "Cross" },
|
|
4786
|
+
{ value: Nt.Star, text: "Star" }
|
|
4778
4787
|
]
|
|
4779
4788
|
}, Ji = {
|
|
4780
4789
|
key: "lineSymbolShowOn",
|
|
4781
4790
|
type: ue.Select,
|
|
4782
4791
|
label: "Show on",
|
|
4783
|
-
default:
|
|
4792
|
+
default: It.FirstLast,
|
|
4784
4793
|
choices: [
|
|
4785
|
-
{ value:
|
|
4786
|
-
{ value:
|
|
4787
|
-
{ value:
|
|
4788
|
-
{ value:
|
|
4794
|
+
{ value: It.FirstLast, text: "First & Last" },
|
|
4795
|
+
{ value: It.First, text: "First" },
|
|
4796
|
+
{ value: It.Last, text: "Last" },
|
|
4797
|
+
{ value: It.All, text: "All" }
|
|
4789
4798
|
]
|
|
4790
4799
|
}, Qi = {
|
|
4791
4800
|
key: "lineSymbolStyle",
|
|
@@ -4815,7 +4824,7 @@ const Es = [
|
|
|
4815
4824
|
{ value: La.Normal, text: "Normal" },
|
|
4816
4825
|
{ value: La.Percent, text: "Percentage (100%)" }
|
|
4817
4826
|
]
|
|
4818
|
-
},
|
|
4827
|
+
}, Uf = { key: "sharedScale", type: ue.Boolean, label: "Shared scale", default: !1 }, Ea = { key: "categoryLabelLine", type: ue.Boolean, label: "Labels on separate line", default: !1 }, ro = { key: "displayAsPercentage", type: ue.Boolean, label: "Display as percentage", default: !1 }, no = { key: "showTotal", type: ue.Boolean, label: "Show total", default: !1 }, so = { key: "showLabels", type: ue.Boolean, label: "Show labels", default: !0 }, io = { key: "showValues", type: ue.Boolean, label: "Show values", default: !0 }, oo = { key: "sliceMax", type: ue.Text, label: "Max slices", default: "6" }, lo = { key: "sliceGroupLabel", type: ue.Text, label: "Group label", default: "Others", placeholder: "Others" }, jf = { key: "areaFillOpacity", type: ue.Text, label: "Opacity", default: "0.85", placeholder: "0.85" }, Kf = { key: "stacked", type: ue.Boolean, label: "Stack areas", default: !0 }, Zf = { key: "stackPercent", type: ue.Boolean, label: "Stack to 100%", default: !1 }, Jf = { key: "areaLines", type: ue.Boolean, label: "Separate areas with lines", default: !0 }, Qf = {
|
|
4819
4828
|
key: "areaSortMode",
|
|
4820
4829
|
type: ue.Select,
|
|
4821
4830
|
label: "Sort areas",
|
|
@@ -4825,7 +4834,7 @@ const Es = [
|
|
|
4825
4834
|
{ value: ut.Ascending, text: "Smallest first" },
|
|
4826
4835
|
{ value: ut.Descending, text: "Largest first" }
|
|
4827
4836
|
]
|
|
4828
|
-
},
|
|
4837
|
+
}, ed = {
|
|
4829
4838
|
key: "interpolation",
|
|
4830
4839
|
type: ue.Select,
|
|
4831
4840
|
label: "Line interpolation",
|
|
@@ -4848,7 +4857,7 @@ const Es = [
|
|
|
4848
4857
|
{ value: We.Inside, text: "Inside" },
|
|
4849
4858
|
{ value: We.Outside, text: "Outside" },
|
|
4850
4859
|
{ value: We.Off, text: "Off" }
|
|
4851
|
-
],
|
|
4860
|
+
], td = [
|
|
4852
4861
|
{ value: ar.Auto, text: "Auto" },
|
|
4853
4862
|
{ value: ar.Horizontal, text: "Horizontal" },
|
|
4854
4863
|
{ value: ar.Vertical, text: "Vertical" }
|
|
@@ -4856,7 +4865,7 @@ const Es = [
|
|
|
4856
4865
|
function dr(t) {
|
|
4857
4866
|
return [
|
|
4858
4867
|
{ key: "showVerticalAxis", type: ue.Boolean, label: "Show vertical axis", default: t.showVerticalAxis ?? !0 },
|
|
4859
|
-
{ key: "verticalAxisDirection", type: ue.Select, label: "Vertical axis side", default:
|
|
4868
|
+
{ key: "verticalAxisDirection", type: ue.Select, label: "Vertical axis side", default: Ft.Left, choices: [{ value: Ft.Left, text: "Left" }, { value: Ft.Right, text: "Right" }] },
|
|
4860
4869
|
{ key: "showVerticalTicks", type: ue.Boolean, label: "Show vertical ticks", default: t.showVerticalTicks },
|
|
4861
4870
|
{ key: "verticalLabelPosition", type: ue.Select, label: "Vertical labels", default: We.Auto, choices: Fs },
|
|
4862
4871
|
{ key: "verticalGridStyle", type: ue.Select, label: "Vertical grid style", default: t.verticalGrid, choices: Es },
|
|
@@ -4869,7 +4878,7 @@ function dr(t) {
|
|
|
4869
4878
|
{ key: "showHorizontalAxis", type: ue.Boolean, label: "Show horizontal axis", default: !0 },
|
|
4870
4879
|
{ key: "showHorizontalTicks", type: ue.Boolean, label: "Show horizontal ticks", default: t.showHorizontalTicks },
|
|
4871
4880
|
{ key: "horizontalLabelPosition", type: ue.Select, label: "Horizontal labels", default: We.Auto, choices: Fs },
|
|
4872
|
-
{ key: "horizontalLabelRotation", type: ue.Select, label: "Horizontal label rotation", default: ar.Horizontal, choices:
|
|
4881
|
+
{ key: "horizontalLabelRotation", type: ue.Select, label: "Horizontal label rotation", default: ar.Horizontal, choices: td },
|
|
4873
4882
|
{ key: "horizontalGridStyle", type: ue.Select, label: "Horizontal grid style", default: t.horizontalGrid, choices: Es },
|
|
4874
4883
|
{ key: "horizontalNumberFormat", type: ue.NumberFormat, label: "Horizontal number format" },
|
|
4875
4884
|
...t.valueAxis === "horizontal" ? [
|
|
@@ -4883,21 +4892,21 @@ function dr(t) {
|
|
|
4883
4892
|
] : []
|
|
4884
4893
|
];
|
|
4885
4894
|
}
|
|
4886
|
-
const Ur = dr({ verticalGrid: at.Dashed, horizontalGrid: at.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", valueAxisZeroBaseline: !0 }), ur = dr({ verticalGrid: at.None, horizontalGrid: at.Dashed, showVerticalTicks: !1, showHorizontalTicks: !1, valueAxis: "horizontal", valueAxisZeroBaseline: !0 }), co = dr({ verticalGrid: at.Dashed, horizontalGrid: at.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0 }),
|
|
4895
|
+
const Ur = dr({ verticalGrid: at.Dashed, horizontalGrid: at.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", valueAxisZeroBaseline: !0 }), ur = dr({ verticalGrid: at.None, horizontalGrid: at.Dashed, showVerticalTicks: !1, showHorizontalTicks: !1, valueAxis: "horizontal", valueAxisZeroBaseline: !0 }), co = dr({ verticalGrid: at.Dashed, horizontalGrid: at.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0 }), ad = dr({ verticalGrid: at.Dashed, horizontalGrid: at.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0, valueAxisZeroBaseline: !0 }), jr = { ...ed, default: Jt.MonotoneX }, rd = { ...Xi, default: yt.Vertical }, nd = { ...qi, default: !0 }, sd = { ...Ki, default: !0 }, fo = { ...lr, default: Qt.Total }, Tn = { ...Vr, default: !0 }, id = { ...ro, default: !0 }, od = { ...oo, default: "5" }, ld = { ...no, default: !0 }, Kr = { ...Br, default: vt.Auto }, Zr = { ...Za, default: !1 }, Jr = [qi, Xi, Ui, ji], Pn = [nd, rd, Ui, ji], Qr = [Vr, Gr, pa, ...Jr], zn = [Tn, Gr, pa, ...Jr], cd = [Ki, Zi, Ji, Qi, eo, to], fd = [sd, Zi, Ji, Qi, eo, to], uo = [Vr, pa, ...Pn, ...cd], dd = [Vr, pa, ...Pn, ...fd], ud = [id, no, so, io, od, lo], hd = [ro, ld, so, io, oo, lo];
|
|
4887
4896
|
kt(xt.BarVertical, Ci, [Lt, $t, Ct, Mt, Xr, cr, fr, Hr, Wr, qr, Rr, Yr, Ea, ...Ur, ...Qr]);
|
|
4888
4897
|
kt(xt.BarHorizontal, Mi, [Lt, $t, Ct, Mt, Xr, cr, fr, Hr, Wr, qr, Rr, Yr, Ea, ...ur, ...zn]);
|
|
4889
|
-
kt(xt.BarMulti,
|
|
4890
|
-
kt(xt.Line,
|
|
4891
|
-
kt(xt.LineMulti,
|
|
4892
|
-
kt(xt.Donut,
|
|
4893
|
-
kt(xt.Pie,
|
|
4894
|
-
kt(xt.Area,
|
|
4895
|
-
const
|
|
4896
|
-
kt(xt.AreaStacked,
|
|
4897
|
-
kt(xt.ColumnStacked,
|
|
4898
|
+
kt(xt.BarMulti, df, [Lt, $t, Ct, Mt, fo, Zr, ga, ha, Kr, On, ...Ur, ...Qr]);
|
|
4899
|
+
kt(xt.Line, vf, [Lt, $t, Ct, Mt, jr, _r, ...co, ...uo]);
|
|
4900
|
+
kt(xt.LineMulti, Sf, [Lt, $t, Ct, Mt, jr, _r, lr, Zr, ga, ha, Kr, ...co, ...dd]);
|
|
4901
|
+
kt(xt.Donut, Of, [Lt, $t, Ct, Mt, Zr, ga, ha, Kr, pa, ...hd]);
|
|
4902
|
+
kt(xt.Pie, Tf, [Lt, $t, Ct, Mt, Zr, ga, ha, Kr, pa, ...ud]);
|
|
4903
|
+
kt(xt.Area, zf, [Lt, $t, Ct, Mt, jr, _r, ...ad, ...uo]);
|
|
4904
|
+
const gd = dr({ verticalGrid: at.Dashed, horizontalGrid: at.None, showVerticalTicks: !1, showHorizontalTicks: !1, showVerticalAxis: !1, valueAxis: "vertical", horizontalRange: !0, valueAxisZeroBaseline: !0 });
|
|
4905
|
+
kt(xt.AreaStacked, Ef, [Lt, $t, Ct, Mt, jf, jr, _r, Qf, Kf, Zf, Jf, Za, ga, ha, Br, ...gd, pa, ...Pn]);
|
|
4906
|
+
kt(xt.ColumnStacked, If, [Lt, $t, Ct, Mt, ao, lr, Za, ga, ha, Br, On, ...Ur, ...Qr]);
|
|
4898
4907
|
kt(xt.BarStacked, Gf, [Lt, $t, Ct, Mt, ao, lr, Za, ga, ha, Br, On, Ea, ...ur, ...zn]);
|
|
4899
|
-
kt(xt.BarSplit,
|
|
4900
|
-
kt(xt.BarGrouped,
|
|
4908
|
+
kt(xt.BarSplit, Hf, [Lt, $t, Ct, Mt, Uf, lr, Za, ga, ha, Ea, ...ur, Tn, Gr, pa, ...Jr]);
|
|
4909
|
+
kt(xt.BarGrouped, qf, [Lt, $t, Ct, Mt, fo, Za, ga, ha, cr, fr, Ea, ...ur, Tn, Gr, pa, ...Jr]);
|
|
4901
4910
|
kt(xt.VerticalBar, Ci, [Lt, $t, Ct, Mt, Xr, cr, fr, Hr, Wr, qr, Rr, Yr, Ea, ...Ur, ...Qr]);
|
|
4902
4911
|
kt(xt.HorizontalBar, Mi, [Lt, $t, Ct, Mt, Xr, cr, fr, Hr, Wr, qr, Rr, Yr, Ea, ...ur, ...zn]);
|
|
4903
4912
|
function Is(t) {
|
|
@@ -4936,48 +4945,48 @@ function ho(t) {
|
|
|
4936
4945
|
}
|
|
4937
4946
|
return { labels: e, values: r };
|
|
4938
4947
|
}
|
|
4939
|
-
function
|
|
4940
|
-
const e = {}, r =
|
|
4941
|
-
return r ? e.colors = r : t.colors && t.colors.length > 0 && (e.colors = t.colors), t.autoContrast && a && e.colors && (e.colors =
|
|
4948
|
+
function pd(t, a) {
|
|
4949
|
+
const e = {}, r = xc(t.colorPalette);
|
|
4950
|
+
return r ? e.colors = r : t.colors && t.colors.length > 0 && (e.colors = t.colors), t.autoContrast && a && e.colors && (e.colors = Rl(e.colors, a)), t.allowDarkMode !== void 0 && (e.allowDarkMode = t.allowDarkMode), e;
|
|
4942
4951
|
}
|
|
4943
|
-
function
|
|
4952
|
+
function bd(t) {
|
|
4944
4953
|
const a = {};
|
|
4945
4954
|
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;
|
|
4946
4955
|
}
|
|
4947
|
-
function
|
|
4956
|
+
function md(t) {
|
|
4948
4957
|
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))
|
|
4949
4958
|
return {};
|
|
4950
4959
|
const e = {};
|
|
4951
4960
|
t.showVerticalTicks !== void 0 && (e.showTicks = t.showVerticalTicks), t.verticalAxisDirection !== void 0 && (e.direction = t.verticalAxisDirection), t.verticalGridStyle !== void 0 && (e.gridStyle = t.verticalGridStyle), t.verticalNumberFormat !== void 0 && (e.numberFormat = t.verticalNumberFormat), t.showVerticalAxis !== void 0 && (e.showAxis = t.showVerticalAxis), t.verticalScaleType !== void 0 && (e.scaleType = t.verticalScaleType), t.verticalLabelPosition !== void 0 && (e.labelPosition = t.verticalLabelPosition);
|
|
4952
|
-
const r =
|
|
4961
|
+
const r = sr(t.verticalRangeMin ?? ""), n = sr(t.verticalRangeMax ?? "");
|
|
4953
4962
|
return (r !== void 0 || n !== void 0) && (e.range = {}, r !== void 0 && (e.range.min = r), n !== void 0 && (e.range.max = n)), { verticalAxis: e };
|
|
4954
4963
|
}
|
|
4955
|
-
function
|
|
4964
|
+
function yd(t) {
|
|
4956
4965
|
if (!(t.showHorizontalTicks !== void 0 || t.horizontalGridStyle !== void 0 || t.horizontalNumberFormat !== void 0 || t.showHorizontalAxis !== void 0 || t.horizontalScaleType !== void 0 || t.horizontalLabelPosition !== void 0 || t.horizontalLabelRotation !== void 0 || t.horizontalRangeMin || t.horizontalRangeMax))
|
|
4957
4966
|
return {};
|
|
4958
4967
|
const e = {};
|
|
4959
4968
|
t.showHorizontalTicks !== void 0 && (e.showTicks = t.showHorizontalTicks), t.horizontalGridStyle !== void 0 && (e.gridStyle = t.horizontalGridStyle), t.horizontalNumberFormat !== void 0 && (e.numberFormat = t.horizontalNumberFormat), t.showHorizontalAxis !== void 0 && (e.showAxis = t.showHorizontalAxis), t.horizontalScaleType !== void 0 && (e.scaleType = t.horizontalScaleType), t.horizontalLabelPosition !== void 0 && (e.labelPosition = t.horizontalLabelPosition), t.horizontalLabelRotation !== void 0 && (e.labelRotation = t.horizontalLabelRotation);
|
|
4960
|
-
const r =
|
|
4969
|
+
const r = sr(t.horizontalRangeMin ?? ""), n = sr(t.horizontalRangeMax ?? "");
|
|
4961
4970
|
return (r !== void 0 || n !== void 0) && (e.range = {}, r !== void 0 && (e.range.min = r), n !== void 0 && (e.range.max = n)), { horizontalAxis: e };
|
|
4962
4971
|
}
|
|
4963
|
-
function
|
|
4972
|
+
function vd(t) {
|
|
4964
4973
|
return t.lineSymbols ? {
|
|
4965
4974
|
lineSymbols: {
|
|
4966
|
-
symbol: t.lineSymbolShape ??
|
|
4967
|
-
showOn: t.lineSymbolShowOn ??
|
|
4975
|
+
symbol: t.lineSymbolShape ?? Nt.Circle,
|
|
4976
|
+
showOn: t.lineSymbolShowOn ?? It.FirstLast,
|
|
4968
4977
|
style: t.lineSymbolStyle ?? wt.Filled,
|
|
4969
4978
|
size: parseFloat(t.lineSymbolSize ?? "3.5") || 3.5,
|
|
4970
4979
|
opacity: parseFloat(t.lineSymbolOpacity ?? "1") || 1
|
|
4971
4980
|
}
|
|
4972
4981
|
} : {};
|
|
4973
4982
|
}
|
|
4974
|
-
function
|
|
4983
|
+
function xd(t, a) {
|
|
4975
4984
|
const e = {
|
|
4976
|
-
...
|
|
4977
|
-
...pd(t),
|
|
4985
|
+
...pd(t, a),
|
|
4978
4986
|
...bd(t),
|
|
4979
4987
|
...md(t),
|
|
4980
|
-
...yd(t)
|
|
4988
|
+
...yd(t),
|
|
4989
|
+
...vd(t)
|
|
4981
4990
|
};
|
|
4982
4991
|
t.interpolation !== void 0 && (e.interpolation = t.interpolation), t.valueLabels !== void 0 && (e.valueLabels = t.valueLabels), t.valueLabelPosition !== void 0 && (e.valueLabelPosition = t.valueLabelPosition), t.tooltips !== void 0 && (e.tooltips = t.tooltips), t.crosshair !== void 0 && (e.crosshair = t.crosshair), t.crosshairDirection && (e.crosshairDirection = t.crosshairDirection), t.crosshairStyle && (e.crosshairStyle = t.crosshairStyle), t.crosshairColor && (e.crosshairColor = t.crosshairColor), t.displayAsPercentage !== void 0 && (e.displayAsPercentage = t.displayAsPercentage), t.showTotal !== void 0 && (e.showTotal = t.showTotal), t.showLabels !== void 0 && (e.showLabels = t.showLabels), t.showValues !== void 0 && (e.showValues = t.showValues), t.swapLabelValue !== void 0 && (e.swapLabelValue = t.swapLabelValue);
|
|
4983
4992
|
const r = parseInt(t.sliceMax ?? "", 10);
|
|
@@ -4989,7 +4998,7 @@ function vd(t, a) {
|
|
|
4989
4998
|
const l = parseFloat(t.areaFillOpacity ?? "");
|
|
4990
4999
|
return isNaN(l) || (e.areaFillOpacity = l), 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;
|
|
4991
5000
|
}
|
|
4992
|
-
const
|
|
5001
|
+
const Ad = [
|
|
4993
5002
|
{ intent: "range", pattern: /\b(range|high and low|high\/low|margin of error|confidence interval|confidence|interval|plus or minus|spread between)\b/i },
|
|
4994
5003
|
{ intent: "composition-over-time", pattern: /(composition|mix|stacked|breakdown)[^.]*\b(over time|by year|by quarter|by month|by decade)\b|\b(over time|by year|by quarter|by month)\b[^.]*(composition|mix|breakdown)/i },
|
|
4995
5004
|
{ intent: "part-to-whole", pattern: /\b(share|part[- ]to[- ]whole|proportion|percentage of (?:the )?total|% of (?:the )?total|makes? up|out of (?:the )?total|composition)\b/i },
|
|
@@ -4997,10 +5006,10 @@ const xd = [
|
|
|
4997
5006
|
{ intent: "trend", pattern: /\b(over time|trend|grew|rose|fell|climbed|declined|increased?|decreased?|change over|year[- ]over[- ]year|overtak\w*|overtook|surpass\w*|crossover|diverg\w*)\b/i },
|
|
4998
5007
|
{ intent: "comparison", pattern: /\b(compares?|compared|comparison|versus|vs\.?|more than|difference between|across|than)\b/i }
|
|
4999
5008
|
];
|
|
5000
|
-
function
|
|
5009
|
+
function wd(t) {
|
|
5001
5010
|
if (t === void 0 || t.trim() === "")
|
|
5002
5011
|
return "none";
|
|
5003
|
-
for (const a of
|
|
5012
|
+
for (const a of Ad)
|
|
5004
5013
|
if (a.pattern.test(t))
|
|
5005
5014
|
return a.intent;
|
|
5006
5015
|
return "none";
|
|
@@ -5114,15 +5123,15 @@ const De = (t, a, e) => ({ type: t, fitness: a, reason: e }), ka = {
|
|
|
5114
5123
|
]
|
|
5115
5124
|
}
|
|
5116
5125
|
};
|
|
5117
|
-
function
|
|
5126
|
+
function Sd(t, a, e) {
|
|
5118
5127
|
const r = ka[t], n = r[a] ?? r.none;
|
|
5119
5128
|
return n ? n(e) : [De("bar-vertical", "good", "Default bar chart recommendation")];
|
|
5120
5129
|
}
|
|
5121
|
-
function
|
|
5130
|
+
function kd(t, a) {
|
|
5122
5131
|
const e = t.filter((s) => s === "string").length, r = t.filter((s) => s === "number").length, n = t.filter((s) => s === "date").length;
|
|
5123
5132
|
return n === 1 && e === 0 && r >= 1 ? r === 1 ? "1date+1num" : "1date+Nnum" : e === 1 && n === 0 && r >= 1 ? r === 1 ? "1cat+1num" : "1cat+Nnum" : "other";
|
|
5124
5133
|
}
|
|
5125
|
-
const
|
|
5134
|
+
const Ld = {
|
|
5126
5135
|
"bar-vertical": "Vertical Bar Chart",
|
|
5127
5136
|
"bar-horizontal": "Horizontal Bar Chart",
|
|
5128
5137
|
"bar-multi": "Grouped Bar Chart",
|
|
@@ -5137,19 +5146,19 @@ const kd = {
|
|
|
5137
5146
|
pie: "Pie Chart",
|
|
5138
5147
|
donut: "Donut Chart"
|
|
5139
5148
|
};
|
|
5140
|
-
function
|
|
5149
|
+
function Vu(t, a, e) {
|
|
5141
5150
|
if (t.length === 0)
|
|
5142
5151
|
return [];
|
|
5143
|
-
const r =
|
|
5144
|
-
return
|
|
5152
|
+
const r = kd(t), n = wd(e);
|
|
5153
|
+
return Sd(r, n, a).map((s) => ({
|
|
5145
5154
|
chartType: s.type,
|
|
5146
|
-
label:
|
|
5155
|
+
label: Ld[s.type] ?? s.type,
|
|
5147
5156
|
fitness: s.fitness,
|
|
5148
5157
|
reason: s.reason
|
|
5149
5158
|
}));
|
|
5150
5159
|
}
|
|
5151
5160
|
const sn = /* @__PURE__ */ Object.create(null);
|
|
5152
|
-
function
|
|
5161
|
+
function $d(t) {
|
|
5153
5162
|
if (!sn[t]) {
|
|
5154
5163
|
const a = {};
|
|
5155
5164
|
for (const e of Ir(t))
|
|
@@ -5160,10 +5169,10 @@ function Ld(t) {
|
|
|
5160
5169
|
}
|
|
5161
5170
|
function Bs(t, a) {
|
|
5162
5171
|
var n;
|
|
5163
|
-
const e =
|
|
5172
|
+
const e = $d(t);
|
|
5164
5173
|
return ((n = a.colors) == null ? void 0 : n.length) ? { ...e, colorPalette: void 0, ...a } : { ...e, ...a };
|
|
5165
5174
|
}
|
|
5166
|
-
const
|
|
5175
|
+
const Cd = {
|
|
5167
5176
|
protanopia: "Protanopia (no red)",
|
|
5168
5177
|
deuteranopia: "Deuteranopia (no green)",
|
|
5169
5178
|
tritanopia: "Tritanopia (no blue)"
|
|
@@ -5235,48 +5244,48 @@ const $d = {
|
|
|
5235
5244
|
0
|
|
5236
5245
|
]
|
|
5237
5246
|
};
|
|
5238
|
-
function
|
|
5247
|
+
function Md(t) {
|
|
5239
5248
|
return `bc-cvd-${t}`;
|
|
5240
5249
|
}
|
|
5241
5250
|
function Gu(t) {
|
|
5242
5251
|
const a = "http://www.w3.org/2000/svg", e = document.createElementNS(a, "filter");
|
|
5243
|
-
e.setAttribute("id",
|
|
5252
|
+
e.setAttribute("id", Md(t)), e.setAttribute("color-interpolation-filters", "linearRGB");
|
|
5244
5253
|
const r = document.createElementNS(a, "feColorMatrix");
|
|
5245
5254
|
return r.setAttribute("type", "matrix"), r.setAttribute("values", go[t].join(" ")), e.appendChild(r), e;
|
|
5246
5255
|
}
|
|
5247
|
-
function
|
|
5256
|
+
function Od(t) {
|
|
5248
5257
|
return t <= 0.04045 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
|
|
5249
5258
|
}
|
|
5250
5259
|
function on(t) {
|
|
5251
5260
|
return t <= 31308e-7 ? 12.92 * t : 1.055 * t ** (1 / 2.4) - 0.055;
|
|
5252
5261
|
}
|
|
5253
|
-
function
|
|
5254
|
-
const [e, r, n] = He(t).rgb().map((u) =>
|
|
5262
|
+
function Td(t, a) {
|
|
5263
|
+
const [e, r, n] = He(t).rgb().map((u) => Od(u / 255)), s = go[a], l = on(s[0] * e + s[1] * r + s[2] * n), o = on(s[5] * e + s[6] * r + s[7] * n), c = on(s[10] * e + s[11] * r + s[12] * n), d = (u) => Math.min(255, Math.max(0, Math.round(u * 255)));
|
|
5255
5264
|
return He(d(l), d(o), d(c)).hex();
|
|
5256
5265
|
}
|
|
5257
|
-
const
|
|
5258
|
-
function
|
|
5266
|
+
const Pd = 10;
|
|
5267
|
+
function _u(t) {
|
|
5259
5268
|
if (t.length < 2)
|
|
5260
5269
|
return [];
|
|
5261
5270
|
const a = ["protanopia", "deuteranopia", "tritanopia"], e = [];
|
|
5262
5271
|
for (const r of a) {
|
|
5263
|
-
const n = t.map((l) =>
|
|
5272
|
+
const n = t.map((l) => Td(l, r)), s = [];
|
|
5264
5273
|
for (let l = 0; l < n.length; l++)
|
|
5265
5274
|
for (let o = l + 1; o < n.length; o++) {
|
|
5266
5275
|
const c = He.deltaE(n[l], n[o]);
|
|
5267
|
-
c <
|
|
5276
|
+
c < Pd && s.push({ a: t[l], b: t[o], deltaE: c });
|
|
5268
5277
|
}
|
|
5269
|
-
s.length > 0 && e.push({ type: r, label:
|
|
5278
|
+
s.length > 0 && e.push({ type: r, label: Cd[r], pairs: s });
|
|
5270
5279
|
}
|
|
5271
5280
|
return e;
|
|
5272
5281
|
}
|
|
5273
|
-
function
|
|
5282
|
+
function Vs(t) {
|
|
5274
5283
|
let a = 0;
|
|
5275
5284
|
for (const e of t)
|
|
5276
5285
|
e.type === "data" && a++;
|
|
5277
5286
|
return a;
|
|
5278
5287
|
}
|
|
5279
|
-
function
|
|
5288
|
+
function zd(t) {
|
|
5280
5289
|
const a = {
|
|
5281
5290
|
properties: [],
|
|
5282
5291
|
data: null,
|
|
@@ -5324,7 +5333,7 @@ function Pd(t) {
|
|
|
5324
5333
|
}
|
|
5325
5334
|
return a;
|
|
5326
5335
|
}
|
|
5327
|
-
function
|
|
5336
|
+
function Dd(t) {
|
|
5328
5337
|
const a = {
|
|
5329
5338
|
properties: [],
|
|
5330
5339
|
data: null,
|
|
@@ -5368,7 +5377,7 @@ function zd(t) {
|
|
|
5368
5377
|
}
|
|
5369
5378
|
return a;
|
|
5370
5379
|
}
|
|
5371
|
-
function
|
|
5380
|
+
function Ed(t, a) {
|
|
5372
5381
|
function e() {
|
|
5373
5382
|
this.constructor = t;
|
|
5374
5383
|
}
|
|
@@ -5378,7 +5387,7 @@ function $a(t, a, e, r) {
|
|
|
5378
5387
|
var n = Error.call(this, t);
|
|
5379
5388
|
return Object.setPrototypeOf && Object.setPrototypeOf(n, $a.prototype), n.expected = a, n.found = e, n.location = r, n.name = "SyntaxError", n;
|
|
5380
5389
|
}
|
|
5381
|
-
|
|
5390
|
+
Ed($a, Error);
|
|
5382
5391
|
function ln(t, a, e) {
|
|
5383
5392
|
return e = e || " ", t.length > a ? t : (a -= t.length, e += e.repeat(a), t + e.slice(0, a));
|
|
5384
5393
|
}
|
|
@@ -5467,14 +5476,14 @@ $a.buildMessage = function(t, a) {
|
|
|
5467
5476
|
}
|
|
5468
5477
|
return "Expected " + o(t) + " but " + c(a) + " found.";
|
|
5469
5478
|
};
|
|
5470
|
-
function
|
|
5479
|
+
function Nd(t, a) {
|
|
5471
5480
|
a = a !== void 0 ? a : {};
|
|
5472
|
-
var e = {}, r = a.grammarSource, n = { Chart: Wn }, s = Wn, l = "chart", o = "{", c = "}", d = "data", u = "=", g = ",", b = " ", m = "colorize", v = "highlight", y = "area-fill", x = "annotation", w = "range", $ = "note", S = "series", P = "scene", B = "transform", I = "hide-annotation", X = "hide-range",
|
|
5473
|
-
`, "\r", "{", "}", "="], !0, !1), O = Re("colorize", !1), Q = Re("highlight", !1), q = Re("area-fill", !1), R = Re("annotation", !1), J = Re("range", !1), re = Re("note", !1), ke = Re("series", !1), Y = Re("scene", !1), de = Re("transform", !1), Ce = Re("hide-annotation", !1), Oe = Re("hide-range", !1), _e = Re("hide-note", !1), Ue = Re("show-annotation", !1), Ze = Re("show-range", !1), Qe = Re("show-note", !1), gt = Re("%", !1), pt = gr("identifier"), je = sa([["a", "z"], ["A", "Z"], "_", "#"], !1, !1), Ot = sa([["a", "z"], ["A", "Z"], ["0", "9"], "_", "#", "-"], !1, !1),
|
|
5481
|
+
var e = {}, r = a.grammarSource, n = { Chart: Wn }, s = Wn, l = "chart", o = "{", c = "}", d = "data", u = "=", g = ",", b = " ", m = "colorize", v = "highlight", y = "area-fill", x = "annotation", w = "range", $ = "note", S = "series", P = "scene", B = "transform", I = "hide-annotation", X = "hide-range", V = "hide-note", G = "show-annotation", j = "show-range", _ = "show-note", ne = "%", ie = "-", ae = ".", F = '"', H = "\\", W = "n", oe = "r", le = "t", $e = "u", se = "//", Se = "/*", ye = "*/", we = /^[^\t\n\r{}=]/, be = /^[a-zA-Z_#]/, me = /^[a-zA-Z0-9_#\-]/, ce = /^[0-9]/, Ie = /^[eE]/, ze = /^[+\-]/, Ne = /^[^"\\]/, Z = /^[0-9a-fA-F]/, U = /^[^\n]/, Ae = /^[ \t\n\r]/, Te = Re("chart", !1), fe = Re("{", !1), Le = Re("}", !1), Ve = Re("data", !1), Ee = Re("=", !1), L = Re(",", !1), M = Re(" ", !1), C = sa([" ", `
|
|
5482
|
+
`, "\r", "{", "}", "="], !0, !1), O = Re("colorize", !1), Q = Re("highlight", !1), q = Re("area-fill", !1), R = Re("annotation", !1), J = Re("range", !1), re = Re("note", !1), ke = Re("series", !1), Y = Re("scene", !1), de = Re("transform", !1), Ce = Re("hide-annotation", !1), Oe = Re("hide-range", !1), _e = Re("hide-note", !1), Ue = Re("show-annotation", !1), Ze = Re("show-range", !1), Qe = Re("show-note", !1), gt = Re("%", !1), pt = gr("identifier"), je = sa([["a", "z"], ["A", "Z"], "_", "#"], !1, !1), Ot = sa([["a", "z"], ["A", "Z"], ["0", "9"], "_", "#", "-"], !1, !1), Dt = Re("-", !1), pe = Re(".", !1), T = sa([["0", "9"]], !1, !1), he = sa(["e", "E"], !1, !1), K = sa(["+", "-"], !1, !1), Me = gr("string"), qe = Re('"', !1), nt = Re("\\", !1), At = sa(['"', "\\"], !0, !1), ft = Re("n", !1), Et = Re("r", !1), Yt = Re("t", !1), la = Re("u", !1), ee = sa([["0", "9"], ["a", "f"], ["A", "F"]], !1, !1), ve = xl(), Ge = Re("//", !1), Ye = sa([`
|
|
5474
5483
|
`], !0, !1), ot = Re("/*", !1), st = Re("*/", !1), jt = gr("whitespace"), ca = sa([" ", " ", `
|
|
5475
5484
|
`, "\r"], !1, !1), Na = gr("optional whitespace"), ba = function(i, h) {
|
|
5476
|
-
|
|
5477
|
-
const k =
|
|
5485
|
+
Vs(h) > 1 && fa("duplicate data block — a chart or scene may define at most one data { } block");
|
|
5486
|
+
const k = zd(h);
|
|
5478
5487
|
return {
|
|
5479
5488
|
type: "chart",
|
|
5480
5489
|
chartType: i,
|
|
@@ -5516,9 +5525,9 @@ function Ed(t, a) {
|
|
|
5516
5525
|
return { type: "colorize", target: i, properties: h, fromHighlight: !0 };
|
|
5517
5526
|
}, Bo = function(i) {
|
|
5518
5527
|
return { type: "highlight", target: i, properties: [] };
|
|
5519
|
-
},
|
|
5528
|
+
}, Vo = function() {
|
|
5520
5529
|
fa('highlight needs a quoted target, e.g. highlight "2021" { ... } or highlight "2021"');
|
|
5521
|
-
},
|
|
5530
|
+
}, Go = function(i, h, k) {
|
|
5522
5531
|
return { type: "area-fill", from: i, to: h, properties: k };
|
|
5523
5532
|
}, _o = function() {
|
|
5524
5533
|
fa('area-fill needs two quoted targets, e.g. area-fill "Revenue" "Cost" { ... }');
|
|
@@ -5537,8 +5546,8 @@ function Ed(t, a) {
|
|
|
5537
5546
|
}, Uo = function() {
|
|
5538
5547
|
fa('series needs a quoted name, e.g. series "Revenue" { ... }');
|
|
5539
5548
|
}, jo = function(i, h) {
|
|
5540
|
-
|
|
5541
|
-
const k =
|
|
5549
|
+
Vs(h) > 1 && fa("duplicate data block — a chart or scene may define at most one data { } block");
|
|
5550
|
+
const k = Dd(h);
|
|
5542
5551
|
return {
|
|
5543
5552
|
type: "scene",
|
|
5544
5553
|
name: i ?? null,
|
|
@@ -5696,7 +5705,7 @@ function Ed(t, a) {
|
|
|
5696
5705
|
}
|
|
5697
5706
|
function Xn() {
|
|
5698
5707
|
var i, h, k, A, D, E;
|
|
5699
|
-
if (i = f, t.substr(f, 4) === d ? (h = d, f += 4) : (h = e, z === 0 && N(
|
|
5708
|
+
if (i = f, t.substr(f, 4) === d ? (h = d, f += 4) : (h = e, z === 0 && N(Ve)), h !== e)
|
|
5700
5709
|
if (xe(), t.charCodeAt(f) === 123 ? (k = o, f++) : (k = e, z === 0 && N(fe)), k !== e) {
|
|
5701
5710
|
for (xe(), A = [], D = Kn(), D === e && (D = Un()); D !== e; )
|
|
5702
5711
|
A.push(D), D = Kn(), D === e && (D = Un());
|
|
@@ -5779,7 +5788,7 @@ function Ed(t, a) {
|
|
|
5779
5788
|
f = i, i = e;
|
|
5780
5789
|
else
|
|
5781
5790
|
f = i, i = e;
|
|
5782
|
-
return i === e && (i = f, t.substr(f, 9) === v ? (h = v, f += 9) : (h = e, z === 0 && N(Q)), h !== e ? (k = dt(), k !== e ? (A = lt(), A !== e ? (D = f, z++, E = f, te = xe(), t.charCodeAt(f) === 123 ? (ge = o, f++) : (ge = e, z === 0 && N(fe)), ge !== e ? (te = [te, ge], E = te) : (f = E, E = e), z--, E === e ? D = void 0 : (f = D, D = e), D !== e ? (Pe = i, i = Bo(A)) : (f = i, i = e)) : (f = i, i = e)) : (f = i, i = e)) : (f = i, i = e), i === e && (i = f, t.substr(f, 9) === v ? (h = v, f += 9) : (h = e, z === 0 && N(Q)), h !== e ? (k = xe(), t.charCodeAt(f) === 123 ? (A = o, f++) : (A = e, z === 0 && N(fe)), A !== e ? (Pe = i, i =
|
|
5791
|
+
return i === e && (i = f, t.substr(f, 9) === v ? (h = v, f += 9) : (h = e, z === 0 && N(Q)), h !== e ? (k = dt(), k !== e ? (A = lt(), A !== e ? (D = f, z++, E = f, te = xe(), t.charCodeAt(f) === 123 ? (ge = o, f++) : (ge = e, z === 0 && N(fe)), ge !== e ? (te = [te, ge], E = te) : (f = E, E = e), z--, E === e ? D = void 0 : (f = D, D = e), D !== e ? (Pe = i, i = Bo(A)) : (f = i, i = e)) : (f = i, i = e)) : (f = i, i = e)) : (f = i, i = e), i === e && (i = f, t.substr(f, 9) === v ? (h = v, f += 9) : (h = e, z === 0 && N(Q)), h !== e ? (k = xe(), t.charCodeAt(f) === 123 ? (A = o, f++) : (A = e, z === 0 && N(fe)), A !== e ? (Pe = i, i = Vo()) : (f = i, i = e)) : (f = i, i = e))), i;
|
|
5783
5792
|
}
|
|
5784
5793
|
function Qn() {
|
|
5785
5794
|
var i, h, k, A, D, E, te, ge, et, Ke;
|
|
@@ -5791,7 +5800,7 @@ function Ed(t, a) {
|
|
|
5791
5800
|
if (xe(), t.charCodeAt(f) === 123 ? (te = o, f++) : (te = e, z === 0 && N(fe)), te !== e) {
|
|
5792
5801
|
for (xe(), ge = [], et = bt(); et !== e; )
|
|
5793
5802
|
ge.push(et), et = bt();
|
|
5794
|
-
et = xe(), t.charCodeAt(f) === 125 ? (Ke = c, f++) : (Ke = e, z === 0 && N(Le)), Ke !== e ? (Pe = i, i =
|
|
5803
|
+
et = xe(), t.charCodeAt(f) === 125 ? (Ke = c, f++) : (Ke = e, z === 0 && N(Le)), Ke !== e ? (Pe = i, i = Go(A, E, ge)) : (f = i, i = e);
|
|
5795
5804
|
} else
|
|
5796
5805
|
f = i, i = e;
|
|
5797
5806
|
else
|
|
@@ -5915,11 +5924,11 @@ function Ed(t, a) {
|
|
|
5915
5924
|
}
|
|
5916
5925
|
function os() {
|
|
5917
5926
|
var i, h, k, A;
|
|
5918
|
-
return i = f, t.substr(f, 9) ===
|
|
5927
|
+
return i = f, t.substr(f, 9) === V ? (h = V, f += 9) : (h = e, z === 0 && N(_e)), h !== e ? (k = dt(), k !== e ? (A = lt(), A !== e ? (Pe = i, i = Qo(A)) : (f = i, i = e)) : (f = i, i = e)) : (f = i, i = e), i;
|
|
5919
5928
|
}
|
|
5920
5929
|
function ls() {
|
|
5921
5930
|
var i, h, k, A;
|
|
5922
|
-
return i = f, t.substr(f, 15) ===
|
|
5931
|
+
return i = f, t.substr(f, 15) === G ? (h = G, f += 15) : (h = e, z === 0 && N(Ue)), h !== e ? (k = dt(), k !== e ? (A = lt(), A !== e ? (Pe = i, i = el(A)) : (f = i, i = e)) : (f = i, i = e)) : (f = i, i = e), i;
|
|
5923
5932
|
}
|
|
5924
5933
|
function cs() {
|
|
5925
5934
|
var i, h, k, A;
|
|
@@ -5961,7 +5970,7 @@ function Ed(t, a) {
|
|
|
5961
5970
|
}
|
|
5962
5971
|
function us() {
|
|
5963
5972
|
var i, h, k, A, D, E, te, ge, et, Ke;
|
|
5964
|
-
if (i = f, h = f, k = f, t.charCodeAt(f) === 45 ? (A = ie, f++) : (A = e, z === 0 && N(
|
|
5973
|
+
if (i = f, h = f, k = f, t.charCodeAt(f) === 45 ? (A = ie, f++) : (A = e, z === 0 && N(Dt)), A === e && (A = null), D = f, t.charCodeAt(f) === 46 ? (E = ae, f++) : (E = e, z === 0 && N(pe)), E !== e) {
|
|
5965
5974
|
if (te = [], ge = t.charAt(f), ce.test(ge) ? f++ : (ge = e, z === 0 && N(T)), ge !== e)
|
|
5966
5975
|
for (; ge !== e; )
|
|
5967
5976
|
te.push(ge), ge = t.charAt(f), ce.test(ge) ? f++ : (ge = e, z === 0 && N(T));
|
|
@@ -6018,7 +6027,7 @@ function Ed(t, a) {
|
|
|
6018
6027
|
}
|
|
6019
6028
|
function Cl() {
|
|
6020
6029
|
var i, h, k, A, D, E, te, ge;
|
|
6021
|
-
return i = f, t.charCodeAt(f) === 34 ? (h = F, f++) : (h = e, z === 0 && N(qe)), h !== e && (Pe = i, h = hl()), i = h, i === e && (i = f, t.charCodeAt(f) === 92 ? (h = H, f++) : (h = e, z === 0 && N(nt)), h !== e && (Pe = i, h = gl()), i = h, i === e && (i = f, t.charCodeAt(f) === 110 ? (h = W, f++) : (h = e, z === 0 && N(ft)), h !== e && (Pe = i, h = pl()), i = h, i === e && (i = f, t.charCodeAt(f) === 114 ? (h = oe, f++) : (h = e, z === 0 && N(
|
|
6030
|
+
return i = f, t.charCodeAt(f) === 34 ? (h = F, f++) : (h = e, z === 0 && N(qe)), h !== e && (Pe = i, h = hl()), i = h, i === e && (i = f, t.charCodeAt(f) === 92 ? (h = H, f++) : (h = e, z === 0 && N(nt)), h !== e && (Pe = i, h = gl()), i = h, i === e && (i = f, t.charCodeAt(f) === 110 ? (h = W, f++) : (h = e, z === 0 && N(ft)), h !== e && (Pe = i, h = pl()), i = h, i === e && (i = f, t.charCodeAt(f) === 114 ? (h = oe, f++) : (h = e, z === 0 && N(Et)), h !== e && (Pe = i, h = bl()), i = h, i === e && (i = f, t.charCodeAt(f) === 116 ? (h = le, f++) : (h = e, z === 0 && N(Yt)), h !== e && (Pe = i, h = ml()), i = h, i === e && (i = f, t.charCodeAt(f) === 117 ? (h = $e, f++) : (h = e, z === 0 && N(la)), h !== e ? (k = f, A = f, D = t.charAt(f), Z.test(D) ? f++ : (D = e, z === 0 && N(ee)), D !== e ? (E = t.charAt(f), Z.test(E) ? f++ : (E = e, z === 0 && N(ee)), E !== e ? (te = t.charAt(f), Z.test(te) ? f++ : (te = e, z === 0 && N(ee)), te !== e ? (ge = t.charAt(f), Z.test(ge) ? f++ : (ge = e, z === 0 && N(ee)), ge !== e ? (D = [D, E, te, ge], A = D) : (f = A, A = e)) : (f = A, A = e)) : (f = A, A = e)) : (f = A, A = e), A !== e ? k = t.substring(k, f) : k = A, k !== e ? (Pe = i, i = yl(k)) : (f = i, i = e)) : (f = i, i = e), i === e && (i = f, t.length > f ? (h = t.charAt(f), f++) : (h = e, z === 0 && N(ve)), h !== e && (Pe = i, h = vl(h)), i = h)))))), i;
|
|
6022
6031
|
}
|
|
6023
6032
|
function pr() {
|
|
6024
6033
|
var i;
|
|
@@ -6026,7 +6035,7 @@ function Ed(t, a) {
|
|
|
6026
6035
|
}
|
|
6027
6036
|
function Ml() {
|
|
6028
6037
|
var i, h, k, A;
|
|
6029
|
-
if (i = f, t.substr(f, 2) === se ? (h = se, f += 2) : (h = e, z === 0 && N(
|
|
6038
|
+
if (i = f, t.substr(f, 2) === se ? (h = se, f += 2) : (h = e, z === 0 && N(Ge)), h !== e) {
|
|
6030
6039
|
for (k = [], A = t.charAt(f), U.test(A) ? f++ : (A = e, z === 0 && N(Ye)); A !== e; )
|
|
6031
6040
|
k.push(A), A = t.charAt(f), U.test(A) ? f++ : (A = e, z === 0 && N(Ye));
|
|
6032
6041
|
h = [h, k], i = h;
|
|
@@ -6080,7 +6089,7 @@ function Ed(t, a) {
|
|
|
6080
6089
|
}
|
|
6081
6090
|
function po(t) {
|
|
6082
6091
|
try {
|
|
6083
|
-
return
|
|
6092
|
+
return Nd(t);
|
|
6084
6093
|
} catch (a) {
|
|
6085
6094
|
if (a instanceof Error && "location" in a) {
|
|
6086
6095
|
const e = a.location;
|
|
@@ -6096,7 +6105,7 @@ function ta(t, a) {
|
|
|
6096
6105
|
const e = /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t.key) ? t.key : `"${t.key}"`;
|
|
6097
6106
|
return `${a}${e} = ${bo(t)}`;
|
|
6098
6107
|
}
|
|
6099
|
-
function
|
|
6108
|
+
function Fd(t, a) {
|
|
6100
6109
|
if (t.key === "series" && t.quotedKey && !(t.values && t.values.length > 1))
|
|
6101
6110
|
return `${a}"series" = ${bo(t)}`;
|
|
6102
6111
|
if (t.values && t.values.length > 1) {
|
|
@@ -6108,7 +6117,7 @@ function Nd(t, a) {
|
|
|
6108
6117
|
function Dn(t, a) {
|
|
6109
6118
|
const e = [`${a}data {`];
|
|
6110
6119
|
for (const r of t.entries)
|
|
6111
|
-
e.push(
|
|
6120
|
+
e.push(Fd(r, `${a} `));
|
|
6112
6121
|
return e.push(`${a}}`), e.join(`
|
|
6113
6122
|
`);
|
|
6114
6123
|
}
|
|
@@ -6155,7 +6164,7 @@ function Bn(t, a) {
|
|
|
6155
6164
|
const e = `${t.action}-${Qs[t.kind]}`;
|
|
6156
6165
|
return `${a}${e} "${t.id}"`;
|
|
6157
6166
|
}
|
|
6158
|
-
function
|
|
6167
|
+
function Vn(t, a) {
|
|
6159
6168
|
const e = [`${a}series "${t.name}" {`];
|
|
6160
6169
|
for (const r of t.properties)
|
|
6161
6170
|
e.push(ta(r, `${a} `));
|
|
@@ -6178,24 +6187,24 @@ function mo(t, a) {
|
|
|
6178
6187
|
for (const n of t.annotationVisibility)
|
|
6179
6188
|
r.push(Bn(n, `${a} `));
|
|
6180
6189
|
for (const n of t.series)
|
|
6181
|
-
r.push(Gn(n, `${a} `));
|
|
6182
|
-
for (const n of t.transforms)
|
|
6183
6190
|
r.push(Vn(n, `${a} `));
|
|
6191
|
+
for (const n of t.transforms)
|
|
6192
|
+
r.push(Gn(n, `${a} `));
|
|
6184
6193
|
return r.push(`${a}}`), r.join(`
|
|
6185
6194
|
`);
|
|
6186
6195
|
}
|
|
6187
|
-
function
|
|
6196
|
+
function Gn(t, a) {
|
|
6188
6197
|
const e = [`${a}transform ${t.transformType} {`];
|
|
6189
6198
|
for (const r of t.properties)
|
|
6190
6199
|
e.push(ta(r, `${a} `));
|
|
6191
6200
|
return e.push(`${a}}`), e.join(`
|
|
6192
6201
|
`);
|
|
6193
6202
|
}
|
|
6194
|
-
function
|
|
6203
|
+
function Id(t, a, e) {
|
|
6195
6204
|
const n = Ir(e).find((s) => s.key === t);
|
|
6196
6205
|
return !n || n.default === void 0 ? !1 : String(n.default) === String(a);
|
|
6197
6206
|
}
|
|
6198
|
-
function
|
|
6207
|
+
function Ru(t) {
|
|
6199
6208
|
const a = [`chart ${t.chartType} {`];
|
|
6200
6209
|
for (const e of t.properties)
|
|
6201
6210
|
a.push(ta(e, " "));
|
|
@@ -6211,18 +6220,18 @@ function _u(t) {
|
|
|
6211
6220
|
for (const e of t.annotationVisibility)
|
|
6212
6221
|
a.push(Bn(e, " "));
|
|
6213
6222
|
for (const e of t.series)
|
|
6214
|
-
a.push(
|
|
6223
|
+
a.push(Vn(e, " "));
|
|
6215
6224
|
for (const e of t.scenes)
|
|
6216
6225
|
a.push(mo(e, " "));
|
|
6217
6226
|
for (const e of t.transforms)
|
|
6218
|
-
a.push(
|
|
6227
|
+
a.push(Gn(e, " "));
|
|
6219
6228
|
return a.push("}"), a.join(`
|
|
6220
6229
|
`);
|
|
6221
6230
|
}
|
|
6222
|
-
function
|
|
6231
|
+
function Yu(t) {
|
|
6223
6232
|
const a = [`chart ${t.chartType} {`];
|
|
6224
6233
|
for (const e of t.properties)
|
|
6225
|
-
|
|
6234
|
+
Id(e.key, e.value, t.chartType) || a.push(ta(e, " "));
|
|
6226
6235
|
t.data && a.push(Dn(t.data, " "));
|
|
6227
6236
|
for (const e of t.colorizes)
|
|
6228
6237
|
a.push(En(e, " "));
|
|
@@ -6235,11 +6244,11 @@ function Ru(t) {
|
|
|
6235
6244
|
for (const e of t.annotationVisibility)
|
|
6236
6245
|
a.push(Bn(e, " "));
|
|
6237
6246
|
for (const e of t.series)
|
|
6238
|
-
a.push(
|
|
6247
|
+
a.push(Vn(e, " "));
|
|
6239
6248
|
for (const e of t.scenes)
|
|
6240
6249
|
a.push(mo(e, " "));
|
|
6241
6250
|
for (const e of t.transforms)
|
|
6242
|
-
a.push(
|
|
6251
|
+
a.push(Gn(e, " "));
|
|
6243
6252
|
return a.push("}"), a.join(`
|
|
6244
6253
|
`);
|
|
6245
6254
|
}
|
|
@@ -6254,7 +6263,7 @@ function _n(t, a) {
|
|
|
6254
6263
|
}
|
|
6255
6264
|
return s;
|
|
6256
6265
|
}
|
|
6257
|
-
function
|
|
6266
|
+
function Bd(t) {
|
|
6258
6267
|
return !(/^-?\d+(\.\d+)?$/.test(t) || /^-?\d+(\.\d+)?%$/.test(t) || /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t));
|
|
6259
6268
|
}
|
|
6260
6269
|
function yo(t) {
|
|
@@ -6266,11 +6275,11 @@ function yo(t) {
|
|
|
6266
6275
|
return `"${a.key}" = ${r}`;
|
|
6267
6276
|
}
|
|
6268
6277
|
const e = a.isPercentage ? `${a.value}%` : String(a.value);
|
|
6269
|
-
return a.key === "series" && !a.quotedKey ? `series = "${e}"` : typeof a.value == "string" &&
|
|
6278
|
+
return a.key === "series" && !a.quotedKey ? `series = "${e}"` : typeof a.value == "string" && Bd(e) ? `"${a.key}" = "${e}"` : `"${a.key}" = ${e}`;
|
|
6270
6279
|
}).join(`
|
|
6271
6280
|
`);
|
|
6272
6281
|
}
|
|
6273
|
-
function
|
|
6282
|
+
function Hu(t, a) {
|
|
6274
6283
|
const e = ia(t.properties), r = e.get("type"), n = r ?? a;
|
|
6275
6284
|
return {
|
|
6276
6285
|
name: t.name,
|
|
@@ -6287,7 +6296,7 @@ function Yu(t, a) {
|
|
|
6287
6296
|
transforms: t.transforms
|
|
6288
6297
|
};
|
|
6289
6298
|
}
|
|
6290
|
-
function
|
|
6299
|
+
function Gs(t, a) {
|
|
6291
6300
|
const e = t.find((r) => r.key === a);
|
|
6292
6301
|
return e ? String(e.value) : void 0;
|
|
6293
6302
|
}
|
|
@@ -6305,8 +6314,8 @@ const ma = (t) => t === "true" || t === !0;
|
|
|
6305
6314
|
function vo(t) {
|
|
6306
6315
|
return t.map((a) => ({
|
|
6307
6316
|
target: a.target,
|
|
6308
|
-
color:
|
|
6309
|
-
label:
|
|
6317
|
+
color: Gs(a.properties, "color") ?? "#e15759",
|
|
6318
|
+
label: Gs(a.properties, "label")
|
|
6310
6319
|
}));
|
|
6311
6320
|
}
|
|
6312
6321
|
function xo(t) {
|
|
@@ -6383,7 +6392,7 @@ const Ys = /* @__PURE__ */ new Set([
|
|
|
6383
6392
|
"heightMode",
|
|
6384
6393
|
"aspectRatio",
|
|
6385
6394
|
"fixedHeight"
|
|
6386
|
-
]), cn = /* @__PURE__ */ new Set(["sort"]),
|
|
6395
|
+
]), cn = /* @__PURE__ */ new Set(["sort"]), Vd = /* @__PURE__ */ new Set([
|
|
6387
6396
|
"text",
|
|
6388
6397
|
"id",
|
|
6389
6398
|
"textColor",
|
|
@@ -6413,7 +6422,7 @@ const Ys = /* @__PURE__ */ new Set([
|
|
|
6413
6422
|
"direction",
|
|
6414
6423
|
"text",
|
|
6415
6424
|
"textColor"
|
|
6416
|
-
]),
|
|
6425
|
+
]), _d = /* @__PURE__ */ new Set([
|
|
6417
6426
|
"text",
|
|
6418
6427
|
"x",
|
|
6419
6428
|
"y",
|
|
@@ -6422,7 +6431,7 @@ const Ys = /* @__PURE__ */ new Set([
|
|
|
6422
6431
|
"maxWidth",
|
|
6423
6432
|
"textOutline"
|
|
6424
6433
|
]);
|
|
6425
|
-
function
|
|
6434
|
+
function Rd(t, a) {
|
|
6426
6435
|
const e = t.length, r = a.length;
|
|
6427
6436
|
if (e === 0)
|
|
6428
6437
|
return r;
|
|
@@ -6442,7 +6451,7 @@ function _d(t, a) {
|
|
|
6442
6451
|
function Ja(t, a) {
|
|
6443
6452
|
let e, r = 1 / 0;
|
|
6444
6453
|
for (const s of a) {
|
|
6445
|
-
const l =
|
|
6454
|
+
const l = Rd(t.toLowerCase(), s.toLowerCase());
|
|
6446
6455
|
l < r && (r = l, e = s);
|
|
6447
6456
|
}
|
|
6448
6457
|
if (e === void 0)
|
|
@@ -6450,10 +6459,10 @@ function Ja(t, a) {
|
|
|
6450
6459
|
const n = Math.max(1, Math.min(3, Math.floor(t.length / 2)));
|
|
6451
6460
|
return r <= n ? e : void 0;
|
|
6452
6461
|
}
|
|
6453
|
-
function
|
|
6462
|
+
function Yd(t, a) {
|
|
6454
6463
|
return t.find((e) => e.key === a);
|
|
6455
6464
|
}
|
|
6456
|
-
function
|
|
6465
|
+
function Hd(t, a, e, r) {
|
|
6457
6466
|
const n = a.value, s = String(n).toLowerCase();
|
|
6458
6467
|
if (t.type === ue.Boolean) {
|
|
6459
6468
|
if (t.key === "valueLabels" && s === "percent" || n === !0 || n === !1 || s === "true" || s === "false")
|
|
@@ -6485,7 +6494,7 @@ function ko(t, a, e, r) {
|
|
|
6485
6494
|
const o = `${e}.${l.key}`;
|
|
6486
6495
|
if (Ys.has(l.key))
|
|
6487
6496
|
continue;
|
|
6488
|
-
const c =
|
|
6497
|
+
const c = Yd(n, l.key);
|
|
6489
6498
|
if (!c) {
|
|
6490
6499
|
r.push({
|
|
6491
6500
|
code: "unknown-property",
|
|
@@ -6495,18 +6504,18 @@ function ko(t, a, e, r) {
|
|
|
6495
6504
|
});
|
|
6496
6505
|
continue;
|
|
6497
6506
|
}
|
|
6498
|
-
|
|
6507
|
+
Hd(c, l, o, r);
|
|
6499
6508
|
}
|
|
6500
6509
|
}
|
|
6501
|
-
function Hd(t) {
|
|
6502
|
-
return t === Je.Range ? Gd : t === Je.Free ? Vd : Bd;
|
|
6503
|
-
}
|
|
6504
6510
|
function Wd(t) {
|
|
6511
|
+
return t === Je.Range ? Gd : t === Je.Free ? _d : Vd;
|
|
6512
|
+
}
|
|
6513
|
+
function qd(t) {
|
|
6505
6514
|
return Qs[t];
|
|
6506
6515
|
}
|
|
6507
6516
|
function Lo(t, a, e) {
|
|
6508
6517
|
t.forEach((r, n) => {
|
|
6509
|
-
const s = r.kind ?? Je.Point, l =
|
|
6518
|
+
const s = r.kind ?? Je.Point, l = Wd(s), o = qd(s);
|
|
6510
6519
|
for (const c of r.properties)
|
|
6511
6520
|
l.has(c.key) || e.push({
|
|
6512
6521
|
code: "unknown-annotation-property",
|
|
@@ -6526,7 +6535,7 @@ function $o(t, a, e) {
|
|
|
6526
6535
|
});
|
|
6527
6536
|
});
|
|
6528
6537
|
}
|
|
6529
|
-
function
|
|
6538
|
+
function Wu(t) {
|
|
6530
6539
|
const a = [], e = [], r = gn(), n = r.includes(t.chartType);
|
|
6531
6540
|
n || a.push({
|
|
6532
6541
|
code: "unknown-chart-type",
|
|
@@ -6539,11 +6548,11 @@ function Hu(t) {
|
|
|
6539
6548
|
code: "missing-data",
|
|
6540
6549
|
path: "data",
|
|
6541
6550
|
message: t.data && t.data.entries.length === 0 ? "Data block is empty." : "Chart has no data."
|
|
6542
|
-
}), t.data &&
|
|
6543
|
-
|
|
6551
|
+
}), t.data && Xd(t.data.entries, e), t.scenes.forEach((o, c) => {
|
|
6552
|
+
Ud(o, t.chartType, c, a);
|
|
6544
6553
|
}), { valid: a.length === 0, errors: a, warnings: e };
|
|
6545
6554
|
}
|
|
6546
|
-
function
|
|
6555
|
+
function Xd(t, a) {
|
|
6547
6556
|
const e = t.findIndex((s) => s.key === "series" && !s.quotedKey);
|
|
6548
6557
|
if (e === -1)
|
|
6549
6558
|
return;
|
|
@@ -6560,7 +6569,7 @@ function qd(t, a) {
|
|
|
6560
6569
|
suggestion: "Move the series row to the top of the data block."
|
|
6561
6570
|
});
|
|
6562
6571
|
}
|
|
6563
|
-
function
|
|
6572
|
+
function Ud(t, a, e, r) {
|
|
6564
6573
|
var o;
|
|
6565
6574
|
const n = `scene[${e}]`, s = (o = t.properties.find((c) => c.key === "type")) == null ? void 0 : o.value, l = s != null ? String(s) : a;
|
|
6566
6575
|
s != null && !gn().includes(l) ? r.push({
|
|
@@ -6570,7 +6579,7 @@ function Xd(t, a, e, r) {
|
|
|
6570
6579
|
suggestion: Ja(l, gn())
|
|
6571
6580
|
}) : ko(l, t.properties, n, r), $o(t.transforms, n, r), Lo(t.annotations, n, r);
|
|
6572
6581
|
}
|
|
6573
|
-
const
|
|
6582
|
+
const jd = `chart bar-vertical {
|
|
6574
6583
|
title = "E is the most frequent letter in English"
|
|
6575
6584
|
description = "How often each letter appears in typical English text"
|
|
6576
6585
|
byline = "Pierre Romera"
|
|
@@ -6598,7 +6607,7 @@ const Ud = `chart bar-vertical {
|
|
|
6598
6607
|
"D" = 4.25
|
|
6599
6608
|
}
|
|
6600
6609
|
}
|
|
6601
|
-
`,
|
|
6610
|
+
`, Kd = `chart bar-vertical {
|
|
6602
6611
|
title = "China emits more CO₂ than the US and India combined"
|
|
6603
6612
|
description = "Annual emissions in billion tonnes, 2023"
|
|
6604
6613
|
source = "Global Carbon Project"
|
|
@@ -6630,7 +6639,7 @@ const Ud = `chart bar-vertical {
|
|
|
6630
6639
|
showCircle = false
|
|
6631
6640
|
}
|
|
6632
6641
|
}
|
|
6633
|
-
`,
|
|
6642
|
+
`, Zd = `chart bar-horizontal {
|
|
6634
6643
|
title = "Mandarin has nearly twice as many native speakers as Spanish"
|
|
6635
6644
|
description = "Number of native speakers worldwide, in millions"
|
|
6636
6645
|
source = "Ethnologue"
|
|
@@ -6653,7 +6662,7 @@ const Ud = `chart bar-vertical {
|
|
|
6653
6662
|
"Japanese" = 125
|
|
6654
6663
|
}
|
|
6655
6664
|
}
|
|
6656
|
-
`,
|
|
6665
|
+
`, Jd = `chart line-multi {
|
|
6657
6666
|
title = "Software overtakes hardware as the top revenue driver"
|
|
6658
6667
|
description = "USD billions"
|
|
6659
6668
|
byline = "Pierre Romera"
|
|
@@ -6672,7 +6681,7 @@ const Ud = `chart bar-vertical {
|
|
|
6672
6681
|
"Q2 2025" = 16.2,15.5,10.8
|
|
6673
6682
|
}
|
|
6674
6683
|
}
|
|
6675
|
-
`,
|
|
6684
|
+
`, Qd = `chart bar-multi {
|
|
6676
6685
|
title = "USA tops Paris 2024 with 126 medals across all categories"
|
|
6677
6686
|
description = "2024 Paris Summer Games — top six nations"
|
|
6678
6687
|
source = "Olympics.com"
|
|
@@ -6693,7 +6702,7 @@ const Ud = `chart bar-vertical {
|
|
|
6693
6702
|
"France" = 16,20,23
|
|
6694
6703
|
}
|
|
6695
6704
|
}
|
|
6696
|
-
`,
|
|
6705
|
+
`, eu = `chart line {
|
|
6697
6706
|
title = "2024 was the hottest year on record"
|
|
6698
6707
|
description = "Deviation from the 1951–1980 average, in °C"
|
|
6699
6708
|
source = "NASA GISS"
|
|
@@ -6725,7 +6734,7 @@ const Ud = `chart bar-vertical {
|
|
|
6725
6734
|
showCircle = true
|
|
6726
6735
|
}
|
|
6727
6736
|
}
|
|
6728
|
-
`,
|
|
6737
|
+
`, tu = `chart line {
|
|
6729
6738
|
title = "Bitcoin surged past $90,000 in 2024"
|
|
6730
6739
|
description = "USD, year-end closing price"
|
|
6731
6740
|
source = "CoinGecko"
|
|
@@ -6755,7 +6764,7 @@ const Ud = `chart bar-vertical {
|
|
|
6755
6764
|
"2024" = 93429
|
|
6756
6765
|
}
|
|
6757
6766
|
}
|
|
6758
|
-
`,
|
|
6767
|
+
`, au = `chart line-multi {
|
|
6759
6768
|
title = "Detroit's unemployment hit 16% during the Great Recession"
|
|
6760
6769
|
description = "Percent of labour force, 2000–2014"
|
|
6761
6770
|
source = "Bureau of Labor Statistics"
|
|
@@ -6783,7 +6792,7 @@ const Ud = `chart bar-vertical {
|
|
|
6783
6792
|
"2014" = 6.5,8.0,7.1,8.2
|
|
6784
6793
|
}
|
|
6785
6794
|
}
|
|
6786
|
-
`,
|
|
6795
|
+
`, ru = `chart pie {
|
|
6787
6796
|
title = "Asia is home to nearly 60% of the world's population"
|
|
6788
6797
|
description = "Estimated share, 2024"
|
|
6789
6798
|
source = "United Nations"
|
|
@@ -6800,7 +6809,7 @@ const Ud = `chart bar-vertical {
|
|
|
6800
6809
|
"North America" = 4.8
|
|
6801
6810
|
}
|
|
6802
6811
|
}
|
|
6803
|
-
`,
|
|
6812
|
+
`, nu = `chart bar-vertical {
|
|
6804
6813
|
title = "Brazil produces more coffee than the next three countries combined"
|
|
6805
6814
|
description = "Million 60-kg bags, 2023/24 crop year"
|
|
6806
6815
|
source = "International Coffee Organization"
|
|
@@ -6826,7 +6835,7 @@ const Ud = `chart bar-vertical {
|
|
|
6826
6835
|
direction = descending
|
|
6827
6836
|
}
|
|
6828
6837
|
}
|
|
6829
|
-
`,
|
|
6838
|
+
`, su = `chart donut {
|
|
6830
6839
|
title = "Chrome dominates with two-thirds of the desktop browser market"
|
|
6831
6840
|
description = "Worldwide, January 2025"
|
|
6832
6841
|
source = "StatCounter"
|
|
@@ -6845,7 +6854,7 @@ const Ud = `chart bar-vertical {
|
|
|
6845
6854
|
"Others" = 2.9
|
|
6846
6855
|
}
|
|
6847
6856
|
}
|
|
6848
|
-
`,
|
|
6857
|
+
`, iu = `chart area {
|
|
6849
6858
|
title = "Apple stock climbed 36 % through 2024"
|
|
6850
6859
|
description = "Monthly closing price in USD"
|
|
6851
6860
|
source = "Yahoo Finance"
|
|
@@ -6867,7 +6876,7 @@ const Ud = `chart bar-vertical {
|
|
|
6867
6876
|
"Dec" = 249
|
|
6868
6877
|
}
|
|
6869
6878
|
}
|
|
6870
|
-
`,
|
|
6879
|
+
`, ou = `chart area-stacked {
|
|
6871
6880
|
title = "Renewables rose from 18 % to 23 % of global energy since 2000"
|
|
6872
6881
|
description = "Share of primary energy by source, 2000–2023"
|
|
6873
6882
|
source = "Our World in Data"
|
|
@@ -6885,7 +6894,7 @@ const Ud = `chart bar-vertical {
|
|
|
6885
6894
|
"2023" = 24,29,24,23
|
|
6886
6895
|
}
|
|
6887
6896
|
}
|
|
6888
|
-
`,
|
|
6897
|
+
`, lu = `chart column-stacked {
|
|
6889
6898
|
title = "Revenue climbed every quarter as the product mix held steady"
|
|
6890
6899
|
description = "Quarterly revenue in millions, 2024"
|
|
6891
6900
|
source = "Annual report"
|
|
@@ -6898,7 +6907,7 @@ const Ud = `chart bar-vertical {
|
|
|
6898
6907
|
"Q4" = 155,105,58
|
|
6899
6908
|
}
|
|
6900
6909
|
}
|
|
6901
|
-
`,
|
|
6910
|
+
`, cu = `chart bar-stacked {
|
|
6902
6911
|
title = "India's working-age population now surpasses China's"
|
|
6903
6912
|
description = "Millions of people, 2023"
|
|
6904
6913
|
source = "UN Population Division"
|
|
@@ -6915,7 +6924,7 @@ const Ud = `chart bar-vertical {
|
|
|
6915
6924
|
"Brazil" = 42,150,22
|
|
6916
6925
|
}
|
|
6917
6926
|
}
|
|
6918
|
-
`,
|
|
6927
|
+
`, fu = `chart area-stacked {
|
|
6919
6928
|
title = "EU subsidies to new members surged after enlargement"
|
|
6920
6929
|
description = "Agricultural subsidies to post-socialist EU members, million euros"
|
|
6921
6930
|
source = "Eurostat"
|
|
@@ -7114,7 +7123,7 @@ const Ud = `chart bar-vertical {
|
|
|
7114
7123
|
highlight "Non-salaried workers"
|
|
7115
7124
|
}
|
|
7116
7125
|
}
|
|
7117
|
-
`,
|
|
7126
|
+
`, du = `chart bar-horizontal {
|
|
7118
7127
|
title = "China emits more CO₂ than the US and India combined"
|
|
7119
7128
|
description = "Annual emissions in billion tonnes, 2023"
|
|
7120
7129
|
source = "Global Carbon Project"
|
|
@@ -7151,7 +7160,7 @@ const Ud = `chart bar-vertical {
|
|
|
7151
7160
|
highlight "Japan"
|
|
7152
7161
|
}
|
|
7153
7162
|
}
|
|
7154
|
-
`,
|
|
7163
|
+
`, uu = `chart bar-split {
|
|
7155
7164
|
title = "CDU/CSU led German polls at 29 % ahead of the 2021 election"
|
|
7156
7165
|
description = "How Germany would vote in the September 2021 federal election, according to polling in the previous June"
|
|
7157
7166
|
source = "FG Wahlen"
|
|
@@ -7168,7 +7177,7 @@ const Ud = `chart bar-vertical {
|
|
|
7168
7177
|
"Left" = 7,9,5
|
|
7169
7178
|
}
|
|
7170
7179
|
}
|
|
7171
|
-
`,
|
|
7180
|
+
`, hu = `chart bar-grouped {
|
|
7172
7181
|
title = "Asia Pacific holds more renewable capacity than all other regions combined"
|
|
7173
7182
|
description = "Installed capacity in gigawatts (GW)"
|
|
7174
7183
|
source = "IRENA"
|
|
@@ -7188,7 +7197,7 @@ function Hs(t, a) {
|
|
|
7188
7197
|
const e = t.properties.find((r) => r.key === a);
|
|
7189
7198
|
return e ? String(e.value) : "";
|
|
7190
7199
|
}
|
|
7191
|
-
function
|
|
7200
|
+
function gu(t) {
|
|
7192
7201
|
if (!t.data)
|
|
7193
7202
|
return "";
|
|
7194
7203
|
const a = t.data.entries, e = a.find((s) => s.key === "series" && !s.quotedKey);
|
|
@@ -7204,7 +7213,7 @@ function hu(t) {
|
|
|
7204
7213
|
return [r, ...n].join(`
|
|
7205
7214
|
`);
|
|
7206
7215
|
}
|
|
7207
|
-
function
|
|
7216
|
+
function pu(t) {
|
|
7208
7217
|
if (!t.data)
|
|
7209
7218
|
return "";
|
|
7210
7219
|
const a = t.data.entries, e = a.find((r) => r.key === "series" && !r.quotedKey);
|
|
@@ -7223,53 +7232,53 @@ function it(t, a) {
|
|
|
7223
7232
|
title: Hs(e, "title"),
|
|
7224
7233
|
description: Hs(e, "description"),
|
|
7225
7234
|
chartType: e.chartType,
|
|
7226
|
-
tsvData:
|
|
7227
|
-
serializedData:
|
|
7235
|
+
tsvData: gu(e),
|
|
7236
|
+
serializedData: pu(e),
|
|
7228
7237
|
dsl: a
|
|
7229
7238
|
};
|
|
7230
7239
|
}
|
|
7231
|
-
const
|
|
7240
|
+
const qu = [
|
|
7232
7241
|
// Bar Vertical
|
|
7233
|
-
it("letter-frequency",
|
|
7234
|
-
it("co2-emissions",
|
|
7235
|
-
it("coffee-production",
|
|
7242
|
+
it("letter-frequency", jd),
|
|
7243
|
+
it("co2-emissions", Kd),
|
|
7244
|
+
it("coffee-production", nu),
|
|
7236
7245
|
// Bar Horizontal
|
|
7237
|
-
it("spoken-languages",
|
|
7246
|
+
it("spoken-languages", Zd),
|
|
7238
7247
|
// Bar Multi
|
|
7239
|
-
it("quarterly-revenue",
|
|
7240
|
-
it("medal-count",
|
|
7248
|
+
it("quarterly-revenue", Jd),
|
|
7249
|
+
it("medal-count", Qd),
|
|
7241
7250
|
// Line
|
|
7242
|
-
it("temperature-anomaly",
|
|
7243
|
-
it("bitcoin-price",
|
|
7251
|
+
it("temperature-anomaly", eu),
|
|
7252
|
+
it("bitcoin-price", tu),
|
|
7244
7253
|
// Line Multi
|
|
7245
|
-
it("unemployment-rates",
|
|
7254
|
+
it("unemployment-rates", au),
|
|
7246
7255
|
// Donut
|
|
7247
|
-
it("browser-market",
|
|
7256
|
+
it("browser-market", su),
|
|
7248
7257
|
// Pie
|
|
7249
|
-
it("world-population",
|
|
7258
|
+
it("world-population", ru),
|
|
7250
7259
|
// Area
|
|
7251
|
-
it("stock-price-area",
|
|
7260
|
+
it("stock-price-area", iu),
|
|
7252
7261
|
// Area Stacked
|
|
7253
|
-
it("energy-mix-stacked-area",
|
|
7262
|
+
it("energy-mix-stacked-area", ou),
|
|
7254
7263
|
// Column Stacked
|
|
7255
|
-
it("quarterly-stacked-columns",
|
|
7264
|
+
it("quarterly-stacked-columns", lu),
|
|
7256
7265
|
// Bar Stacked
|
|
7257
|
-
it("population-stacked-bar",
|
|
7266
|
+
it("population-stacked-bar", cu),
|
|
7258
7267
|
// Bar Split
|
|
7259
|
-
it("election-polls",
|
|
7268
|
+
it("election-polls", uu),
|
|
7260
7269
|
// Bar Grouped
|
|
7261
|
-
it("renewable-capacity",
|
|
7270
|
+
it("renewable-capacity", hu),
|
|
7262
7271
|
// Story (multi-scene)
|
|
7263
|
-
it("farm-compass",
|
|
7264
|
-
it("co2-emissions-story",
|
|
7272
|
+
it("farm-compass", fu),
|
|
7273
|
+
it("co2-emissions-story", du)
|
|
7265
7274
|
], Ws = /* @__PURE__ */ new Set();
|
|
7266
|
-
function
|
|
7275
|
+
function bu(t, a, e) {
|
|
7267
7276
|
let r = a;
|
|
7268
7277
|
for (const n of t)
|
|
7269
7278
|
n.transformType === "sort" ? r = Qt.Total : Ws.has(n.transformType) || (Ws.add(n.transformType), console.warn(`[blueprint-chart] Unknown transform "${n.transformType}" in ${e}; ignored.`));
|
|
7270
7279
|
return r;
|
|
7271
7280
|
}
|
|
7272
|
-
function
|
|
7281
|
+
function mu(t) {
|
|
7273
7282
|
const a = (s) => {
|
|
7274
7283
|
const l = t.get(s);
|
|
7275
7284
|
return l == null ? void 0 : String(l) || void 0;
|
|
@@ -7285,14 +7294,14 @@ function bu(t) {
|
|
|
7285
7294
|
};
|
|
7286
7295
|
return Object.values(r).some((s) => s !== void 0) ? r : void 0;
|
|
7287
7296
|
}
|
|
7288
|
-
function
|
|
7297
|
+
function yu(t) {
|
|
7289
7298
|
const a = ia(t.properties), e = t.data ? yo(t.data) : "", r = ho(e), n = a.get("sort"), s = n == null ? void 0 : String(n), l = s === ut.Ascending || s === ut.Descending ? s : void 0, o = a.get("theme"), c = a.get("sortMode");
|
|
7290
7299
|
let d;
|
|
7291
|
-
return (c === Qt.Total || c === Qt.WithinGroups || c === Qt.None) && (d = c), d =
|
|
7300
|
+
return (c === Qt.Total || c === Qt.WithinGroups || c === Qt.None) && (d = c), d = bu(t.transforms, d, "chart"), {
|
|
7292
7301
|
chartType: t.chartType,
|
|
7293
7302
|
data: r,
|
|
7294
7303
|
properties: t.properties,
|
|
7295
|
-
frame:
|
|
7304
|
+
frame: mu(a),
|
|
7296
7305
|
colorizes: vo(t.colorizes),
|
|
7297
7306
|
highlights: xo(t.highlights),
|
|
7298
7307
|
areaFills: Ao(t.areaFills),
|
|
@@ -7305,13 +7314,13 @@ function mu(t) {
|
|
|
7305
7314
|
};
|
|
7306
7315
|
}
|
|
7307
7316
|
const qs = /* @__PURE__ */ new Set();
|
|
7308
|
-
function
|
|
7317
|
+
function vu(t, a, e) {
|
|
7309
7318
|
let r = a;
|
|
7310
7319
|
for (const n of t)
|
|
7311
7320
|
n.transformType === "sort" ? r = Qt.Total : qs.has(n.transformType) || (qs.add(n.transformType), console.warn(`[blueprint-chart] Unknown transform "${n.transformType}" in ${e}; ignored.`));
|
|
7312
7321
|
return r;
|
|
7313
7322
|
}
|
|
7314
|
-
function
|
|
7323
|
+
function xu() {
|
|
7315
7324
|
return {
|
|
7316
7325
|
properties: /* @__PURE__ */ new Map(),
|
|
7317
7326
|
chartTypeOptions: {},
|
|
@@ -7324,8 +7333,8 @@ function vu() {
|
|
|
7324
7333
|
transforms: []
|
|
7325
7334
|
};
|
|
7326
7335
|
}
|
|
7327
|
-
function
|
|
7328
|
-
const r =
|
|
7336
|
+
function Au(t, a, e) {
|
|
7337
|
+
const r = xu();
|
|
7329
7338
|
for (let n = 0; n <= a; n++) {
|
|
7330
7339
|
const s = t[n], l = ia(s.properties), o = l.get("type");
|
|
7331
7340
|
o && (r.chartType = o);
|
|
@@ -7355,7 +7364,7 @@ function xu(t, a, e) {
|
|
|
7355
7364
|
}
|
|
7356
7365
|
return r;
|
|
7357
7366
|
}
|
|
7358
|
-
function
|
|
7367
|
+
function wu(t, a) {
|
|
7359
7368
|
const e = t.options ?? (t.properties ? Bs(t.chartType, _n(t.chartType, t.properties)) : {}), r = {
|
|
7360
7369
|
chartType: t.chartType,
|
|
7361
7370
|
data: t.data,
|
|
@@ -7372,7 +7381,7 @@ function Au(t, a) {
|
|
|
7372
7381
|
};
|
|
7373
7382
|
if (a == null || !t.scenes || a < 0 || a >= t.scenes.length)
|
|
7374
7383
|
return r;
|
|
7375
|
-
const n =
|
|
7384
|
+
const n = Au(t.scenes, a, t.chartType), s = n.chartType ?? t.chartType, l = n.data ? ho(yo(n.data)) : r.data, o = Object.keys(n.chartTypeOptions).length > 0 ? Bs(s, { ...e, ...n.chartTypeOptions }) : e, c = n.colorizes.length > 0 ? vo(n.colorizes) : n.data ? [] : r.colorizes, d = a != null ? xo(n.highlights) : r.highlights, u = n.areaFills.length > 0 ? Ao(n.areaFills) : r.areaFills, g = n.annotations.length > 0 ? wo(n.annotations) : [], b = [...r.annotations, ...g], m = n.hiddenAnnotationIds.size > 0 ? b.filter((S) => !S.id || !n.hiddenAnnotationIds.has(S.id)) : b, v = n.seriesOverrides.length > 0 ? So(n.seriesOverrides) : r.seriesOverrides, y = vu(n.transforms, r.sortMode, `scene ${a}`), x = ["title", "description", "source", "sourceUrl", "byline", "note"], w = {};
|
|
7376
7385
|
for (const S of x) {
|
|
7377
7386
|
const P = n.properties.get(S);
|
|
7378
7387
|
typeof P == "string" && (w[S] = P);
|
|
@@ -7393,7 +7402,7 @@ function Au(t, a) {
|
|
|
7393
7402
|
};
|
|
7394
7403
|
}
|
|
7395
7404
|
const pn = /* @__PURE__ */ new WeakMap();
|
|
7396
|
-
function
|
|
7405
|
+
function Su(t) {
|
|
7397
7406
|
const a = pn.get(t);
|
|
7398
7407
|
if (!(!a || a.size === 0)) {
|
|
7399
7408
|
for (const e of a)
|
|
@@ -7401,20 +7410,20 @@ function wu(t) {
|
|
|
7401
7410
|
a.clear();
|
|
7402
7411
|
}
|
|
7403
7412
|
}
|
|
7404
|
-
function
|
|
7413
|
+
function Ga(t, a) {
|
|
7405
7414
|
let e = pn.get(t);
|
|
7406
7415
|
e || (e = /* @__PURE__ */ new Set(), pn.set(t, e)), e.add(a);
|
|
7407
7416
|
}
|
|
7408
|
-
function
|
|
7409
|
-
if (
|
|
7417
|
+
function ku(t, a, e) {
|
|
7418
|
+
if (Su(t), e.ignoreLayout || !a)
|
|
7410
7419
|
return { constrained: !1 };
|
|
7411
7420
|
const r = ia(a), n = r.get("heightMode"), s = r.get("aspectRatio"), l = r.get("fixedHeight");
|
|
7412
7421
|
let o = !1;
|
|
7413
7422
|
if (n === "aspect-ratio" && s) {
|
|
7414
7423
|
const c = String(s).split(":").map(Number);
|
|
7415
|
-
c.length === 2 && c[0] > 0 && c[1] > 0 && (t.style.aspectRatio = `${c[0]} / ${c[1]}`, t.style.height = "auto",
|
|
7416
|
-
} else n === "fixed" && l && (t.style.height = `${l}px`,
|
|
7417
|
-
return o && (t.style.display = "flex", t.style.flexDirection = "column", t.style.overflow = "hidden",
|
|
7424
|
+
c.length === 2 && c[0] > 0 && c[1] > 0 && (t.style.aspectRatio = `${c[0]} / ${c[1]}`, t.style.height = "auto", Ga(t, "aspectRatio"), Ga(t, "height"), o = !0);
|
|
7425
|
+
} else n === "fixed" && l && (t.style.height = `${l}px`, Ga(t, "height"), o = !0);
|
|
7426
|
+
return o && (t.style.display = "flex", t.style.flexDirection = "column", t.style.overflow = "hidden", Ga(t, "display"), Ga(t, "flexDirection"), Ga(t, "overflow")), { constrained: o };
|
|
7418
7427
|
}
|
|
7419
7428
|
const Rn = /* @__PURE__ */ new WeakMap();
|
|
7420
7429
|
function Co(t) {
|
|
@@ -7422,22 +7431,22 @@ function Co(t) {
|
|
|
7422
7431
|
typeof a.getAnimations == "function" && a.getAnimations().forEach((e) => e.cancel()), a.remove();
|
|
7423
7432
|
});
|
|
7424
7433
|
}
|
|
7425
|
-
function
|
|
7434
|
+
function Lu(t, a, e) {
|
|
7426
7435
|
if (!e)
|
|
7427
7436
|
return null;
|
|
7428
7437
|
const r = Rn.get(t);
|
|
7429
|
-
return !r || r === a ? null : (Co(t),
|
|
7438
|
+
return !r || r === a ? null : (Co(t), Gt(t));
|
|
7430
7439
|
}
|
|
7431
|
-
function
|
|
7440
|
+
function $u(t, a, e) {
|
|
7432
7441
|
if (Rn.set(t, a), e) {
|
|
7433
7442
|
const r = t.querySelector(".bc-frame .bc-frame-body");
|
|
7434
|
-
r &&
|
|
7443
|
+
r && Vt(r), _t(t, e);
|
|
7435
7444
|
}
|
|
7436
7445
|
}
|
|
7437
7446
|
function Xs(t) {
|
|
7438
7447
|
Rn.delete(t), Co(t);
|
|
7439
7448
|
}
|
|
7440
|
-
function
|
|
7449
|
+
function Cu(t, a, e) {
|
|
7441
7450
|
const r = t.querySelector(".bc-frame");
|
|
7442
7451
|
if (!r)
|
|
7443
7452
|
return;
|
|
@@ -7449,7 +7458,7 @@ function $u(t, a, e) {
|
|
|
7449
7458
|
r.classList.remove(s);
|
|
7450
7459
|
a.theme && r.classList.add(`bc-theme-${a.theme}`), e.constrained && r.classList.add("bc-frame--constrained");
|
|
7451
7460
|
}
|
|
7452
|
-
function
|
|
7461
|
+
function Mu(t, a, e = {}) {
|
|
7453
7462
|
var m;
|
|
7454
7463
|
if (e.transition || (t.replaceChildren(), Xs(t)), a.data.labels.length === 0) {
|
|
7455
7464
|
e.transition && (t.replaceChildren(), Xs(t));
|
|
@@ -7464,12 +7473,12 @@ function Cu(t, a, e = {}) {
|
|
|
7464
7473
|
}
|
|
7465
7474
|
r = v;
|
|
7466
7475
|
}
|
|
7467
|
-
const n =
|
|
7476
|
+
const n = ku(t, r.properties, e), s = wu(r, e.sceneIndex), l = Xf(s.chartType);
|
|
7468
7477
|
if (!l)
|
|
7469
7478
|
return;
|
|
7470
|
-
const o =
|
|
7479
|
+
const o = Lu(t, s.chartType, !!e.transition);
|
|
7471
7480
|
o && t.replaceChildren();
|
|
7472
|
-
const c =
|
|
7481
|
+
const c = Tt(t), d = xd(s.options, c);
|
|
7473
7482
|
let u;
|
|
7474
7483
|
if (e.thumbnail)
|
|
7475
7484
|
u = null;
|
|
@@ -7490,14 +7499,14 @@ function Cu(t, a, e = {}) {
|
|
|
7490
7499
|
seriesOverrides: s.seriesOverrides.length > 0 ? s.seriesOverrides : void 0
|
|
7491
7500
|
}, !!e.transition), e.transition && g.commit({ mode: e.transitionMode });
|
|
7492
7501
|
const b = e.theme ?? s.theme;
|
|
7493
|
-
|
|
7502
|
+
Cu(t, { theme: b }, n), $u(t, s.chartType, o);
|
|
7494
7503
|
}
|
|
7495
7504
|
function Us(t, a, e) {
|
|
7496
7505
|
const r = document.createElement("div");
|
|
7497
7506
|
r.style.cssText = "color: #888; font-family: monospace; padding: 0.75rem; white-space: pre-wrap;", r.textContent = `Blueprint Chart: ${a}
|
|
7498
7507
|
${e}`, t.replaceChildren(r);
|
|
7499
7508
|
}
|
|
7500
|
-
function
|
|
7509
|
+
function Xu(t, a, e) {
|
|
7501
7510
|
if (!a) {
|
|
7502
7511
|
e != null && e.transition || t.replaceChildren();
|
|
7503
7512
|
return;
|
|
@@ -7511,8 +7520,8 @@ function qu(t, a, e) {
|
|
|
7511
7520
|
return;
|
|
7512
7521
|
}
|
|
7513
7522
|
try {
|
|
7514
|
-
const n =
|
|
7515
|
-
|
|
7523
|
+
const n = yu(r);
|
|
7524
|
+
Mu(t, n, e);
|
|
7516
7525
|
} catch (n) {
|
|
7517
7526
|
const s = n instanceof Error ? n.message : String(n);
|
|
7518
7527
|
Us(t, "could not render chart", s);
|
|
@@ -7524,7 +7533,7 @@ export {
|
|
|
7524
7533
|
ei as AnnotationAction,
|
|
7525
7534
|
Je as AnnotationKind,
|
|
7526
7535
|
mt as AnnotationLineStyle,
|
|
7527
|
-
|
|
7536
|
+
Ft as AxisDirection,
|
|
7528
7537
|
Sr as BC_TRANSITION_NAME,
|
|
7529
7538
|
ue as ChartOptionType,
|
|
7530
7539
|
xt as ChartType,
|
|
@@ -7544,23 +7553,23 @@ export {
|
|
|
7544
7553
|
ct as Orientation,
|
|
7545
7554
|
ti as RangeAnchor,
|
|
7546
7555
|
Ha as ScaleType,
|
|
7547
|
-
|
|
7556
|
+
Rc as SceneTransition,
|
|
7548
7557
|
ut as SortDirection,
|
|
7549
7558
|
Qt as SortMode,
|
|
7550
7559
|
La as StackMode,
|
|
7551
7560
|
kr as StrokeStyle,
|
|
7552
|
-
|
|
7553
|
-
|
|
7561
|
+
Nt as SymbolShape,
|
|
7562
|
+
It as SymbolShowOn,
|
|
7554
7563
|
wt as SymbolStyle,
|
|
7555
7564
|
zl as TickPosition,
|
|
7556
7565
|
Fe as ValueLabelPosition,
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7566
|
+
Rl as adjustColorsForBackground,
|
|
7567
|
+
yu as astToDefinition,
|
|
7568
|
+
xd as buildChartOptions,
|
|
7569
|
+
_u as checkCvdColors,
|
|
7570
|
+
wd as classifyIntent,
|
|
7562
7571
|
_t as commitFadeOut,
|
|
7563
|
-
|
|
7572
|
+
Yu as compactSerialize,
|
|
7564
7573
|
wo as convertAnnotations,
|
|
7565
7574
|
Ao as convertAreaFills,
|
|
7566
7575
|
vo as convertColorizes,
|
|
@@ -7571,43 +7580,43 @@ export {
|
|
|
7571
7580
|
Ht as createFrame,
|
|
7572
7581
|
yo as dataEntriesToString,
|
|
7573
7582
|
_n as extractChartTypeOptions,
|
|
7574
|
-
|
|
7575
|
-
|
|
7583
|
+
Hu as extractSceneOverrides,
|
|
7584
|
+
Vt as fadeIn,
|
|
7576
7585
|
Ua as featureJoin,
|
|
7577
7586
|
Xt as getCachedChart,
|
|
7578
|
-
|
|
7587
|
+
Xf as getChart,
|
|
7579
7588
|
Ir as getChartOptions,
|
|
7580
|
-
|
|
7581
|
-
|
|
7589
|
+
$d as getChartTypeDefaults,
|
|
7590
|
+
Md as getCvdFilterId,
|
|
7582
7591
|
za as getSceneTransition,
|
|
7583
7592
|
Oa as getTransitionDuration,
|
|
7584
7593
|
Da as isSeriesHidden,
|
|
7585
7594
|
gn as listCharts,
|
|
7586
|
-
|
|
7595
|
+
Ac as listPalettes,
|
|
7587
7596
|
po as parse,
|
|
7588
7597
|
ho as parseData,
|
|
7589
7598
|
ia as propertyMap,
|
|
7590
|
-
|
|
7599
|
+
Vu as recommendCharts,
|
|
7591
7600
|
kt as registerChart,
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7601
|
+
Xu as renderBpc,
|
|
7602
|
+
Mu as renderChart,
|
|
7603
|
+
Bu as renderHorizontalAxis,
|
|
7595
7604
|
Aa as renderLegend,
|
|
7596
|
-
|
|
7597
|
-
|
|
7605
|
+
Iu as renderVerticalAxis,
|
|
7606
|
+
Tt as resolveBackgroundColor,
|
|
7598
7607
|
Ta as resolveBarGapPadding,
|
|
7599
7608
|
Bs as resolveChartTypeOptions,
|
|
7600
|
-
|
|
7601
|
-
|
|
7609
|
+
xc as resolvePalette,
|
|
7610
|
+
wu as resolveScene,
|
|
7602
7611
|
Xe as resolveSeriesColor,
|
|
7603
7612
|
Ti as resolveSeriesInterpolation,
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7613
|
+
qu as samples,
|
|
7614
|
+
Ru as serialize,
|
|
7615
|
+
kd as shapeOf,
|
|
7616
|
+
Td as simulateCvdColor,
|
|
7617
|
+
Gt as snapshotForFadeOut,
|
|
7609
7618
|
Cs as snapshotLiveAttrs,
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7619
|
+
Wu as validateChart,
|
|
7620
|
+
Nu as wcagContrastRatio,
|
|
7621
|
+
Fu as wcagLevel
|
|
7613
7622
|
};
|