chartformers 1.0.58 → 1.0.59
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/chartformers.es.js +485 -485
- package/dist/chartformers.umd.js +29 -29
- package/package.json +1 -1
package/dist/chartformers.es.js
CHANGED
|
@@ -6315,14 +6315,14 @@ function i1({
|
|
|
6315
6315
|
(k) => F(U ? new Date(k[n]) : k[n])
|
|
6316
6316
|
).y0($).y1((k) => pt(Number(k[r])));
|
|
6317
6317
|
e === "area" && (t.map((j) => j.title).forEach((j, nt) => {
|
|
6318
|
-
const
|
|
6318
|
+
const St = ts(j), W = z.append("linearGradient").attr("id", St).attr("x1", "0%").attr("y1", "0%").attr("x2", "0%").attr("y2", "100%"), q = de(nt, !1, !0);
|
|
6319
6319
|
W.append("stop").attr("offset", "0%").attr("stop-color", q).attr("stop-opacity", 0.7), W.append("stop").attr("offset", "100%").attr("stop-color", q).attr("stop-opacity", 0);
|
|
6320
6320
|
}), O.selectAll("path.chartarea").data(function(j) {
|
|
6321
6321
|
return [j.datum];
|
|
6322
6322
|
}).join(
|
|
6323
6323
|
(j) => j.append("path").attr("class", "chartarea").attr("stroke", "none").attr("fill", function() {
|
|
6324
|
-
const nt = ne(this.parentNode).datum(), { title:
|
|
6325
|
-
return `url(#${ts(
|
|
6324
|
+
const nt = ne(this.parentNode).datum(), { title: St } = nt;
|
|
6325
|
+
return `url(#${ts(St)})`;
|
|
6326
6326
|
}).attr("d", (nt) => K(nt)).attr("clip-path", "url(#clip)").style("pointer-events", "none"),
|
|
6327
6327
|
void 0,
|
|
6328
6328
|
(j) => j.remove()
|
|
@@ -6330,7 +6330,7 @@ function i1({
|
|
|
6330
6330
|
return [k.datum];
|
|
6331
6331
|
}).join(
|
|
6332
6332
|
(k) => k.append("path").attr("class", "chartline").attr("fill", "none").attr("stroke", function() {
|
|
6333
|
-
const j = ne(this.parentNode).datum(), nt = d.current.findIndex((
|
|
6333
|
+
const j = ne(this.parentNode).datum(), nt = d.current.findIndex((St) => St === j.title) + i;
|
|
6334
6334
|
return de(nt, !1, !0);
|
|
6335
6335
|
}).attr("stroke-width", 2).attr("d", (j) => K(j)).attr("clip-path", "url(#clip)").style("pointer-events", "none"),
|
|
6336
6336
|
void 0,
|
|
@@ -6340,7 +6340,7 @@ function i1({
|
|
|
6340
6340
|
return [k.datum];
|
|
6341
6341
|
}).join(
|
|
6342
6342
|
(k) => k.append("circle").attr("class", "tooltipCircle").attr("cx", 20).attr("cy", 30).attr("r", X).attr("fill", function() {
|
|
6343
|
-
const j = ne(this.parentNode).datum(), nt = d.current.findIndex((
|
|
6343
|
+
const j = ne(this.parentNode).datum(), nt = d.current.findIndex((St) => St === j.title) + i;
|
|
6344
6344
|
return de(nt, !1, !0);
|
|
6345
6345
|
}).style("opacity", 0),
|
|
6346
6346
|
void 0,
|
|
@@ -6353,7 +6353,7 @@ function i1({
|
|
|
6353
6353
|
function L(k) {
|
|
6354
6354
|
const j = ta(
|
|
6355
6355
|
(ut) => U ? new Date(ut[n]) : ut[n]
|
|
6356
|
-
).center, nt = j(t[0].datum, F.invert(xr(k)[0])),
|
|
6356
|
+
).center, nt = j(t[0].datum, F.invert(xr(k)[0])), St = t[0].datum[nt], W = ue(t, function(ut) {
|
|
6357
6357
|
return Number(ut.datum[nt][r]);
|
|
6358
6358
|
}), q = [];
|
|
6359
6359
|
for (let ut = 0; ut < t.length; ut++) {
|
|
@@ -6372,7 +6372,7 @@ function i1({
|
|
|
6372
6372
|
);
|
|
6373
6373
|
E.style("opacity", 1).attr("x1", Dt).attr("x2", Dt), ft(q);
|
|
6374
6374
|
const Rt = 5, Q = F(
|
|
6375
|
-
U ? new Date(
|
|
6375
|
+
U ? new Date(St[n]) : St[n]
|
|
6376
6376
|
), Nt = pt(W ?? 0) + X + Rt;
|
|
6377
6377
|
tt.transition().duration(100).style("display", null).attr("transform", `translate(${Q},${Nt})`);
|
|
6378
6378
|
}
|
|
@@ -6383,12 +6383,12 @@ function i1({
|
|
|
6383
6383
|
const j = tt.selectAll("path").data([null]).join("path").attr("fill", "white").attr("stroke", "black"), nt = k.reduce((W, q) => {
|
|
6384
6384
|
const Dt = q.title, Rt = q.label + ": " + (et ?? "") + q.value + (D ?? "");
|
|
6385
6385
|
return W.push(Dt), W.push(Rt), W;
|
|
6386
|
-
}, []),
|
|
6387
|
-
st(
|
|
6386
|
+
}, []), St = tt.selectAll("text").data([null]).join("text").call((W) => W.selectAll("tspan").data(nt).join("tspan").attr("x", 0).attr("y", (q, Dt) => `${Dt * 1.1}em`).style("align", "right").text((q) => q));
|
|
6387
|
+
st(St, j), a && it.transition().duration(h / 4).style("opacity", 0);
|
|
6388
6388
|
}
|
|
6389
6389
|
function st(k, j) {
|
|
6390
|
-
const { x: nt, y:
|
|
6391
|
-
k.attr("transform", `translate(${-W / 2},${15 -
|
|
6390
|
+
const { x: nt, y: St, width: W, height: q } = k.node().getBBox();
|
|
6391
|
+
k.attr("transform", `translate(${-W / 2},${15 - St})`), j.attr("d", `M${-W / 2 - 10},5H-5l5,-5l5,5H${W / 2 + 10}v${q + 20}h-${W + 20}z`);
|
|
6392
6392
|
}
|
|
6393
6393
|
const it = _.select(".brush-area").attr("transform", "translate(" + g.left + "," + ($ + g.top + g.bottom) + ")");
|
|
6394
6394
|
if (it.selectAll("path.line").remove(), it.selectAll("path.area").remove(), it.selectAll("g.brush").remove(), a) {
|
|
@@ -6404,7 +6404,7 @@ function i1({
|
|
|
6404
6404
|
};
|
|
6405
6405
|
const j = U ? ni().domain(C) : me().domain(C);
|
|
6406
6406
|
j.range([0, S]);
|
|
6407
|
-
const nt = me().domain([dt, bt]).range([w, 0]),
|
|
6407
|
+
const nt = me().domain([dt, bt]).range([w, 0]), St = Gn().x(
|
|
6408
6408
|
(Dt) => F(U ? new Date(Dt[n]) : Dt[n])
|
|
6409
6409
|
).y((Dt) => nt(Number(Dt[r])));
|
|
6410
6410
|
for (let Dt = 0; Dt < t.length; Dt++) {
|
|
@@ -6417,7 +6417,7 @@ function i1({
|
|
|
6417
6417
|
return `url(#${ts(Q)})`;
|
|
6418
6418
|
}).attr("stroke", "none").attr("d", Rt).attr("clip-path", "url(#clip)");
|
|
6419
6419
|
}
|
|
6420
|
-
it.append("path").datum(t[Dt].datum).attr("class", "line").attr("fill", "none").attr("stroke", ot(Dt)).attr("stroke-width", 2).attr("d",
|
|
6420
|
+
it.append("path").datum(t[Dt].datum).attr("class", "line").attr("fill", "none").attr("stroke", ot(Dt)).attr("stroke-width", 2).attr("d", St).attr("clip-path", "url(#clip)");
|
|
6421
6421
|
}
|
|
6422
6422
|
it.select(".x-axis").attr("transform", "translate(0," + w + ")").call(he(j)).selectAll("text").attr("class", V);
|
|
6423
6423
|
const W = Yc().extent([[0, 0], [c, w]]).on("brush", k);
|
|
@@ -6841,19 +6841,19 @@ function o1({
|
|
|
6841
6841
|
if (d === 0 || x === 0) return;
|
|
6842
6842
|
const et = { top: 20, right: 30, bottom: 30, left: 30 }, D = M.length === 0 ? [] : Object.keys(M[0]).filter((Y) => Y !== "label" && Y !== "total"), dt = e ? D : D.filter((Y) => !p.includes(Y));
|
|
6843
6843
|
M.forEach((Y, mt) => {
|
|
6844
|
-
const
|
|
6844
|
+
const At = dt.reduce((jt, ee) => {
|
|
6845
6845
|
ee in Y || (Y[ee] = 0);
|
|
6846
|
-
const re = Y[ee], lt = typeof re == "number" ? re : 0,
|
|
6847
|
-
return { total:
|
|
6846
|
+
const re = Y[ee], lt = typeof re == "number" ? re : 0, yt = jt.total + lt, kt = jt.totalPos + (lt >= 0 ? lt : 0), It = jt.totalMin + (lt < 0 ? lt : 0);
|
|
6847
|
+
return { total: yt, totalPos: kt, totalMin: It };
|
|
6848
6848
|
}, { total: 0, totalPos: 0, totalMin: 0 });
|
|
6849
|
-
Y.total =
|
|
6849
|
+
Y.total = At.total, Y.totalPos = At.totalPos, Y.totalMin = At.totalMin;
|
|
6850
6850
|
});
|
|
6851
6851
|
const bt = M, pt = E ? $e(bt).sort(function(Y, mt) {
|
|
6852
6852
|
return e ? p[0] === "all" ? Y.total - mt.total : Number(Y[p[0]]) - Number(mt[p[0]]) : Y.total - mt.total;
|
|
6853
6853
|
}) : bt, wt = d - et.left - et.right, K = x - et.top - et.bottom, ot = V.select("svg"), O = ot.node(), Z = ot.select(".plot-area").attr("transform", "translate(" + et.left + "," + et.top + ")"), T = V.select(".controls").select(".legends-container"), tt = F ? 80 : 50, L = function(Y) {
|
|
6854
|
-
const mt = zt[F ? "legend-container" : "legend-container-sm"],
|
|
6854
|
+
const mt = zt[F ? "legend-container" : "legend-container-sm"], At = zt[F ? "legend-container-active" : "legend-container-active-sm"], jt = zt[F ? "legend-container-inactive" : "legend-container-inactive-sm"];
|
|
6855
6855
|
return `
|
|
6856
|
-
${p.includes(Y) ? e ?
|
|
6856
|
+
${p.includes(Y) ? e ? At : jt : mt}
|
|
6857
6857
|
legend-item
|
|
6858
6858
|
`;
|
|
6859
6859
|
}, G = (Y) => {
|
|
@@ -6865,40 +6865,40 @@ function o1({
|
|
|
6865
6865
|
}
|
|
6866
6866
|
T.selectAll(".legend-item").data([...D], (Y) => Y).join(
|
|
6867
6867
|
(Y) => {
|
|
6868
|
-
const mt = Y.append("div").attr("class", L).style("left", (
|
|
6869
|
-
return mt.append("div").attr("class", zt["legend-rect"]).style("background", (
|
|
6870
|
-
if (!e && p.includes(
|
|
6868
|
+
const mt = Y.append("div").attr("class", L).style("left", (At, jt) => `${jt * tt}px`).style("top", "-53px").style("opacity", 0);
|
|
6869
|
+
return mt.append("div").attr("class", zt["legend-rect"]).style("background", (At) => {
|
|
6870
|
+
if (!e && p.includes(At))
|
|
6871
6871
|
return ze;
|
|
6872
|
-
const jt = C.current.findIndex((ee) => ee ===
|
|
6872
|
+
const jt = C.current.findIndex((ee) => ee === At) + n;
|
|
6873
6873
|
return de(jt);
|
|
6874
|
-
}), mt.append("span").attr("class", zt["legend-label"]).style("color", (
|
|
6874
|
+
}), mt.append("span").attr("class", zt["legend-label"]).style("color", (At) => !e && p.includes(At) ? "#d1d5db" : "#333").text((At) => At), mt.transition().duration(N).style("top", "0px").style("opacity", 1), mt;
|
|
6875
6875
|
},
|
|
6876
|
-
(Y) => (Y.attr("class", L).transition().duration(N).style("top", "0px").style("left", (mt,
|
|
6876
|
+
(Y) => (Y.attr("class", L).transition().duration(N).style("top", "0px").style("left", (mt, At) => `${At * tt}px`).style("opacity", 1).select(`.${zt["legend-rect"]}`).style("background", (mt) => {
|
|
6877
6877
|
if (!e && p.includes(mt))
|
|
6878
6878
|
return ze;
|
|
6879
|
-
const
|
|
6880
|
-
return de(
|
|
6879
|
+
const At = C.current.findIndex((jt) => jt === mt) + n;
|
|
6880
|
+
return de(At);
|
|
6881
6881
|
}), Y.select(`.${zt["legend-label"]}`).style("color", (mt) => !e && p.includes(mt) ? ze : "#333").text((mt) => mt), Y),
|
|
6882
6882
|
(Y) => Y.style("color", ze).transition().duration(N).style("opacity", 0).style("top", "53px").remove()
|
|
6883
6883
|
).on("pointerenter", function(Y, mt) {
|
|
6884
6884
|
if (p[0] === "all") {
|
|
6885
|
-
const
|
|
6886
|
-
e ? (
|
|
6885
|
+
const At = Z.selectAll(".serie");
|
|
6886
|
+
e ? (At.attr("fill", ft).filter((jt) => jt.key !== mt).style("opacity", 0.25), At.selectAll("rect").filter((jt) => jt.barKey === mt).attr("stroke-dasharray", "none")) : At.attr("fill", ft).filter((jt) => jt.key === mt).style("opacity", 0.25);
|
|
6887
6887
|
}
|
|
6888
6888
|
}).on("pointerleave", function(Y, mt) {
|
|
6889
|
-
const
|
|
6890
|
-
p[0] === "all" &&
|
|
6889
|
+
const At = Z.selectAll(".serie");
|
|
6890
|
+
p[0] === "all" && At.attr("fill", ft).style("opacity", 1), At.selectAll("rect").attr("stroke-dasharray", _t), _ && R(!1);
|
|
6891
6891
|
}).on("click", (Y, mt) => {
|
|
6892
|
-
$((
|
|
6892
|
+
$((At) => {
|
|
6893
6893
|
let jt = [];
|
|
6894
|
-
return e ?
|
|
6894
|
+
return e ? At[0] === mt ? jt = ["all"] : jt = [mt] : At.includes(mt) ? jt = At.filter((ee) => ee !== mt) : jt = [...At, mt], jt;
|
|
6895
6895
|
}), R(!0);
|
|
6896
6896
|
});
|
|
6897
6897
|
const st = V.select("div#tooltip").style("opacity", 0);
|
|
6898
6898
|
A === null && w($e(M));
|
|
6899
6899
|
const it = pt.map(function(Y) {
|
|
6900
6900
|
return Y.label;
|
|
6901
|
-
}), k = Ze().domain(it).rangeRound(r === "vertical" ? [0, wt] : [K, 0]).paddingInner(F ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), j = e ? p[0] === "all" ? Qt(M, (Y) => Y.totalPos) : Qt(M, (Y) => Y[p[0]]) : Qt(M, (Y) => Y.totalPos), nt = Math.max(0, j ?? 0),
|
|
6901
|
+
}), k = Ze().domain(it).rangeRound(r === "vertical" ? [0, wt] : [K, 0]).paddingInner(F ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), j = e ? p[0] === "all" ? Qt(M, (Y) => Y.totalPos) : Qt(M, (Y) => Y[p[0]]) : Qt(M, (Y) => Y.totalPos), nt = Math.max(0, j ?? 0), St = e ? p[0] === "all" ? ue(M, (Y) => Y.totalMin) : ue(M, (Y) => Y[p[0]]) : ue(M, (Y) => Y.totalMin), W = Math.min(0, St ?? 0), q = me().domain([W, nt]).range(r === "vertical" ? [K, 0] : [0, wt]).nice(), Dt = !F && r === "vertical" ? zt.rotatedAxisText : zt.axisText, Rt = r === "vertical" ? he(k).tickValues(k.domain()).tickSizeOuter(0) : he(q).ticks(10, "s").tickSizeOuter(0).tickSize(-K);
|
|
6902
6902
|
Z.select(".x-axis").attr("transform", `translate(0,${K})`).transition().duration(N).call(Rt).selectAll("text").style("cursor", "pointer").attr("dy", F ? "1em" : ".20em").attr("dx", F ? "0em" : "-.8em").attr("class", Dt).selectAll(".tick").filter((Y) => Y === 0).select("line").remove(), Z.select(".x-axis").selectAll("path").style("display", "none");
|
|
6903
6903
|
const Q = r === "vertical" ? _e(q).ticks(10, "s").tickSize(-wt) : _e(k).tickSizeOuter(0);
|
|
6904
6904
|
Z.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(N).call(Q).selectAll(".tick").filter((Y) => Y === 0).select("line").remove(), Z.select(".y-axis").selectAll("path").style("display", "none"), Z.select("line.zero-line").attr("x1", 0).attr("y1", 0).attr("x2", r === "vertical" ? wt : 0).attr("y2", r === "vertical" ? 0 : K).attr(
|
|
@@ -6906,7 +6906,7 @@ function o1({
|
|
|
6906
6906
|
r === "vertical" ? `translate(0, ${q(0) || 0})` : `translate(${q(0) || 0}, 0)`
|
|
6907
6907
|
);
|
|
6908
6908
|
const ut = ca().keys(dt).offset(Js)($e(pt)).map((Y) => {
|
|
6909
|
-
const mt = Y.key,
|
|
6909
|
+
const mt = Y.key, At = Y.map((jt) => {
|
|
6910
6910
|
const ee = jt.data.label;
|
|
6911
6911
|
return {
|
|
6912
6912
|
...jt,
|
|
@@ -6914,13 +6914,13 @@ function o1({
|
|
|
6914
6914
|
barKey: mt
|
|
6915
6915
|
};
|
|
6916
6916
|
});
|
|
6917
|
-
return
|
|
6917
|
+
return At.key = mt, At;
|
|
6918
6918
|
}), vt = Z.selectAll(".serie").data(ut, (Y) => Y.key).join(
|
|
6919
|
-
(Y) => Y.append("g").attr("class", "serie").attr("fill", ft).style("opacity", (
|
|
6920
|
-
(Y) => Y.transition().duration(N).attr("fill", (
|
|
6921
|
-
const jt = C.current.findIndex((re) => re ===
|
|
6919
|
+
(Y) => Y.append("g").attr("class", "serie").attr("fill", ft).style("opacity", (At) => e ? p[0] === "all" || At.key === p[0] ? 1 : 0 : 1).style("pointer-events", (At) => e ? p[0] === "all" || At.key === p[0] ? "auto" : "none" : "auto"),
|
|
6920
|
+
(Y) => Y.transition().duration(N).attr("fill", (At) => {
|
|
6921
|
+
const jt = C.current.findIndex((re) => re === At.key) + n;
|
|
6922
6922
|
return de(jt);
|
|
6923
|
-
}).style("opacity", (
|
|
6923
|
+
}).style("opacity", (At) => e ? p[0] === "all" || At.key === p[0] ? 1 : 0 : 1).style("pointer-events", (At) => e ? p[0] === "all" || At.key === p[0] ? "auto" : "none" : "auto"),
|
|
6924
6924
|
(Y) => Y.transition().duration(N).attr("fill", ze).style("opacity", 0).selectAll("rect").attr("y", K).attr("height", 0).remove()
|
|
6925
6925
|
), $t = (Y) => k(Y.data.label + "") ?? 0, Lt = k.bandwidth(), qt = e && p[0] !== "all" || dt.length === 1, ie = (Y) => {
|
|
6926
6926
|
if (qt) {
|
|
@@ -6932,31 +6932,31 @@ function o1({
|
|
|
6932
6932
|
}
|
|
6933
6933
|
}, Gt = (Y) => {
|
|
6934
6934
|
if (qt) {
|
|
6935
|
-
const mt = Number(Y.data[Y.barKey]),
|
|
6936
|
-
return isNaN(
|
|
6935
|
+
const mt = Number(Y.data[Y.barKey]), At = Math.abs(q(mt) - q(0));
|
|
6936
|
+
return isNaN(At) || At < 0 ? 0 : At;
|
|
6937
6937
|
} else {
|
|
6938
6938
|
const mt = r === "vertical" ? q(Y[0]) - q(Y[1]) : q(Y[1]) - q(Y[0]);
|
|
6939
6939
|
return isNaN(mt) || mt < 0 ? 0 : mt;
|
|
6940
6940
|
}
|
|
6941
|
-
},
|
|
6942
|
-
const
|
|
6941
|
+
}, Ft = (Y) => r === "vertical" ? $t(Y) : ie(Y), te = (Y) => r === "vertical" ? Lt : Gt(Y), se = (Y) => r === "vertical" ? ie(Y) : $t(Y), rt = (Y) => r === "vertical" ? Gt(Y) : Lt, gt = pt.map((Y, mt) => {
|
|
6942
|
+
const At = ut.map((re) => ({
|
|
6943
6943
|
key: re.key,
|
|
6944
6944
|
start: re[mt][0],
|
|
6945
6945
|
end: re[mt][1],
|
|
6946
6946
|
value: Y[re.key]
|
|
6947
|
-
})), jt =
|
|
6947
|
+
})), jt = At.filter((re) => re.value ?? !1).sort((re, lt) => lt.end - re.end), ee = At.filter((re) => re.value ?? !1).sort((re, lt) => re.start - lt.start);
|
|
6948
6948
|
return {
|
|
6949
6949
|
label: Y.label,
|
|
6950
6950
|
top: jt.length > 0 ? jt[0]?.key : ee[ee.length - 1]?.key,
|
|
6951
6951
|
bottom: ee.length > 0 ? ee[0]?.key : jt[jt.length - 1]?.key
|
|
6952
6952
|
};
|
|
6953
6953
|
}), _t = (Y, mt) => {
|
|
6954
|
-
const
|
|
6955
|
-
return lt ? r === "vertical" ? `${
|
|
6956
|
-
},
|
|
6957
|
-
const mt = te(Y),
|
|
6958
|
-
return
|
|
6959
|
-
},
|
|
6954
|
+
const At = te(Y), jt = rt(Y), ee = gt.find((kt) => kt.label === Y.data.label), re = Y.data[Y.barKey], lt = ee?.top === Y.barKey && Number(re) >= 0, yt = ee?.bottom === Y.barKey && Number(re) < 0;
|
|
6955
|
+
return lt ? r === "vertical" ? `${At + jt} ${At} ${jt}` : `${At + jt + At}` : yt ? r === "vertical" ? `${jt + At + jt} ${At}` : `${At} ${jt} ${At + jt}` : r === "vertical" ? `${jt} ${At}` : `${At} ${jt}`;
|
|
6956
|
+
}, Ht = (Y) => {
|
|
6957
|
+
const mt = te(Y), At = gt.find((lt) => lt.label === Y.data.label), jt = Y.data[Y.barKey], ee = At?.top === Y.barKey && Number(jt) >= 0;
|
|
6958
|
+
return At?.bottom === Y.barKey && Number(jt) < 0 ? r === "vertical" ? mt * -1 : 0 : r === "vertical" ? ee ? 0 : mt * -1 : 0;
|
|
6959
|
+
}, xt = (Y) => `rect ${zt.rect}`;
|
|
6960
6960
|
vt.selectAll("rect").data(
|
|
6961
6961
|
(Y) => Y,
|
|
6962
6962
|
// each group binds its stacked points
|
|
@@ -6964,30 +6964,30 @@ function o1({
|
|
|
6964
6964
|
// unique key per bar
|
|
6965
6965
|
).join(
|
|
6966
6966
|
(Y) => {
|
|
6967
|
-
const mt = Y.append("rect").attr("class", `rect ${J.rect}`).attr("x", function(
|
|
6968
|
-
return r === "vertical" ?
|
|
6969
|
-
}).attr("width", function(
|
|
6970
|
-
return r === "vertical" ? te(
|
|
6971
|
-
}).attr("y", (
|
|
6972
|
-
return r === "vertical" ? 0 : rt(
|
|
6973
|
-
}).attr("stroke-dasharray", _t).attr("stroke-dashoffset",
|
|
6974
|
-
return mt.transition().duration(N).attr("x",
|
|
6967
|
+
const mt = Y.append("rect").attr("class", `rect ${J.rect}`).attr("x", function(At) {
|
|
6968
|
+
return r === "vertical" ? Ft(At) : q(0);
|
|
6969
|
+
}).attr("width", function(At) {
|
|
6970
|
+
return r === "vertical" ? te(At) : 0;
|
|
6971
|
+
}).attr("y", (At) => r === "vertical" ? q(0) : se(At)).attr("height", function(At) {
|
|
6972
|
+
return r === "vertical" ? 0 : rt(At);
|
|
6973
|
+
}).attr("stroke-dasharray", _t).attr("stroke-dashoffset", Ht);
|
|
6974
|
+
return mt.transition().duration(N).attr("x", Ft).attr("width", te).attr("height", rt).attr("y", se), mt;
|
|
6975
6975
|
},
|
|
6976
6976
|
void 0,
|
|
6977
6977
|
// no custom update handler
|
|
6978
6978
|
(Y) => Y.transition().duration(N).attr("opacity", 0).attr("y", K).attr("height", 0).remove()
|
|
6979
|
-
).attr("class",
|
|
6980
|
-
const
|
|
6979
|
+
).attr("class", xt).attr("stroke-dasharray", _t).attr("stroke-dashoffset", Ht).transition().duration(N).attr("x", Ft).attr("width", te).attr("height", rt).attr("y", se);
|
|
6980
|
+
const Mt = { prefix: a, suffix: i, formatType: s };
|
|
6981
6981
|
vt.selectAll("rect").on("pointerenter", function(Y, mt) {
|
|
6982
6982
|
Z.select(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((ee) => ee === mt.data.label).attr("class", (r === "vertical" ? Dt : "") + " " + zt.hoveredAxisText), st.style("opacity", 1);
|
|
6983
|
-
const
|
|
6984
|
-
st.select("p.label").text(mt.data.label), st.select("p.layer span.label span.chev").style("background", G(mt.barKey)), st.select("p.layer span.label span.label").text(mt.barKey), st.select("p.layer span.value").text(ke(
|
|
6983
|
+
const At = mt.data[mt.barKey], { total: jt } = mt.data;
|
|
6984
|
+
st.select("p.label").text(mt.data.label), st.select("p.layer span.label span.chev").style("background", G(mt.barKey)), st.select("p.layer span.label span.label").text(mt.barKey), st.select("p.layer span.value").text(ke(At, Mt)), st.select("p.total span.value").text(ke(jt ?? 0, Mt)), fe(st, { e: Y, svg: O, yScale: q });
|
|
6985
6985
|
}).on("touch", function(Y, mt) {
|
|
6986
|
-
ne(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((
|
|
6986
|
+
ne(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((At) => At === mt.data.label);
|
|
6987
6987
|
}).on("pointermove", (Y, mt) => {
|
|
6988
6988
|
fe(st, { e: Y, svg: O, yScale: q });
|
|
6989
6989
|
}).on("pointerleave", function(Y, mt) {
|
|
6990
|
-
Z.select(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((
|
|
6990
|
+
Z.select(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((At) => At === mt.data.label).attr("class", r === "vertical" ? Dt : ""), st.style("opacity", 0);
|
|
6991
6991
|
});
|
|
6992
6992
|
}, [
|
|
6993
6993
|
...U,
|
|
@@ -7103,126 +7103,126 @@ function l1({
|
|
|
7103
7103
|
}, [y]);
|
|
7104
7104
|
const U = [d, x, p, e], M = $e(I), B = M.length === 0 ? [] : Object.keys(M[0]).filter((et) => et !== "label" && et !== "total"), C = sn(B), F = d > 576, H = { prefix: a, suffix: i, formatType: s }, V = Me((et) => {
|
|
7105
7105
|
if (d === 0 || x === 0) return;
|
|
7106
|
-
const D = { top: 20, right: 30, bottom: 30, left: 30 }, dt = M.length === 0 ? [] : Object.keys(M[0]).filter((
|
|
7107
|
-
M.forEach(function(
|
|
7108
|
-
|
|
7109
|
-
Y in
|
|
7110
|
-
const mt =
|
|
7111
|
-
return
|
|
7106
|
+
const D = { top: 20, right: 30, bottom: 30, left: 30 }, dt = M.length === 0 ? [] : Object.keys(M[0]).filter((xt) => xt !== "label" && xt !== "total"), bt = r ? dt : dt.filter((xt) => !p.includes(xt));
|
|
7107
|
+
M.forEach(function(xt) {
|
|
7108
|
+
xt.total = bt.reduce((Mt, Y) => {
|
|
7109
|
+
Y in xt || (xt[Y] = 0);
|
|
7110
|
+
const mt = xt[Y];
|
|
7111
|
+
return Mt + (typeof mt == "number" ? mt : Number(mt));
|
|
7112
7112
|
}, 0);
|
|
7113
7113
|
});
|
|
7114
|
-
const pt = M, wt = E && (r && p[0] !== "all" || !r && bt.length === 1) ? $e(pt).sort(function(
|
|
7115
|
-
return r ? p[0] === "all" ?
|
|
7116
|
-
}) : pt, K = d - D.left - D.right, ot = x - D.top - D.bottom, O = et.select("svg"), Z = O.node(), X = O.select(".plot-area").attr("transform", "translate(" + D.left + "," + D.top + ")"), tt = et.select(".controls").select(".legends-container"), L = F ? 80 : 50, G = function(
|
|
7117
|
-
const
|
|
7114
|
+
const pt = M, wt = E && (r && p[0] !== "all" || !r && bt.length === 1) ? $e(pt).sort(function(xt, Mt) {
|
|
7115
|
+
return r ? p[0] === "all" ? xt.total - Mt.total : Number(xt[p[0]]) - Number(Mt[p[0]]) : xt.total - Mt.total;
|
|
7116
|
+
}) : pt, K = d - D.left - D.right, ot = x - D.top - D.bottom, O = et.select("svg"), Z = O.node(), X = O.select(".plot-area").attr("transform", "translate(" + D.left + "," + D.top + ")"), tt = et.select(".controls").select(".legends-container"), L = F ? 80 : 50, G = function(xt) {
|
|
7117
|
+
const Mt = zt[F ? "legend-container" : "legend-container-sm"], Y = zt[F ? "legend-container-active" : "legend-container-active-sm"], mt = zt[F ? "legend-container-inactive" : "legend-container-inactive-sm"];
|
|
7118
7118
|
return `
|
|
7119
|
-
${p.includes(
|
|
7119
|
+
${p.includes(xt) ? r ? Y : mt : Mt}
|
|
7120
7120
|
legend-item
|
|
7121
7121
|
`;
|
|
7122
|
-
}, ft = (
|
|
7123
|
-
const
|
|
7124
|
-
return de(
|
|
7122
|
+
}, ft = (xt) => {
|
|
7123
|
+
const Mt = C.current.findIndex((mt) => mt === xt) + e;
|
|
7124
|
+
return de(Mt);
|
|
7125
7125
|
};
|
|
7126
|
-
function st(
|
|
7127
|
-
return ft(
|
|
7126
|
+
function st(xt) {
|
|
7127
|
+
return ft(xt.key);
|
|
7128
7128
|
}
|
|
7129
|
-
tt.selectAll(".legend-item").data([...dt], (
|
|
7130
|
-
(
|
|
7131
|
-
const
|
|
7132
|
-
return
|
|
7129
|
+
tt.selectAll(".legend-item").data([...dt], (xt) => xt).join(
|
|
7130
|
+
(xt) => {
|
|
7131
|
+
const Mt = xt.append("div").attr("class", G).style("left", (Y, mt) => `${mt * L}px`).style("top", "-53px").style("opacity", 0);
|
|
7132
|
+
return Mt.append("div").attr("class", zt["legend-rect"]).style("background", (Y) => {
|
|
7133
7133
|
if (!r && p.includes(Y))
|
|
7134
7134
|
return ze;
|
|
7135
|
-
const mt = C.current.findIndex((
|
|
7135
|
+
const mt = C.current.findIndex((At) => At === Y) + e;
|
|
7136
7136
|
return de(mt);
|
|
7137
|
-
}),
|
|
7137
|
+
}), Mt.append("span").attr("class", zt["legend-label"]).text((Y) => Y), Mt.transition().duration(N).style("top", "0px").style("opacity", 1), Mt;
|
|
7138
7138
|
},
|
|
7139
|
-
(
|
|
7140
|
-
if (!r && p.includes(
|
|
7139
|
+
(xt) => (xt.attr("class", G).transition().duration(N).style("top", "0px").style("left", (Mt, Y) => `${Y * L}px`).style("opacity", 1).select(`.${zt["legend-rect"]}`).style("background", (Mt) => {
|
|
7140
|
+
if (!r && p.includes(Mt))
|
|
7141
7141
|
return ze;
|
|
7142
|
-
const Y = C.current.findIndex((mt) => mt ===
|
|
7142
|
+
const Y = C.current.findIndex((mt) => mt === Mt) + e;
|
|
7143
7143
|
return de(Y);
|
|
7144
|
-
}),
|
|
7145
|
-
(
|
|
7146
|
-
).on("click", (
|
|
7144
|
+
}), xt.select(`.${zt["legend-label"]}`).text((Mt) => Mt), xt),
|
|
7145
|
+
(xt) => xt.transition().duration(N).style("opacity", 0).style("top", "53px").remove().remove()
|
|
7146
|
+
).on("click", (xt, Mt) => {
|
|
7147
7147
|
$((Y) => {
|
|
7148
7148
|
let mt = [];
|
|
7149
|
-
return r ? Y[0] ===
|
|
7149
|
+
return r ? Y[0] === Mt ? mt = ["all"] : mt = [Mt] : Y.includes(Mt) ? mt = Y.filter((At) => At !== Mt) : mt = [...Y, Mt], mt;
|
|
7150
7150
|
}), R(!0);
|
|
7151
|
-
}).on("pointerenter", (
|
|
7151
|
+
}).on("pointerenter", (xt, Mt) => {
|
|
7152
7152
|
const Y = X.selectAll(".serie");
|
|
7153
|
-
p[0] === "all" && (r ? Y.attr("fill", st).filter((mt) => mt.key !==
|
|
7154
|
-
}).on("pointerleave", (
|
|
7153
|
+
p[0] === "all" && (r ? Y.attr("fill", st).filter((mt) => mt.key !== Mt).transition().duration(250).style("opacity", 0.25) : Y.attr("fill", st).filter((mt) => mt.key === Mt).transition().duration(250).style("opacity", 0.25));
|
|
7154
|
+
}).on("pointerleave", (xt, Mt) => {
|
|
7155
7155
|
X.selectAll(".serie"), p[0] === "all" && X.selectAll(".serie").attr("fill", st).transition().duration(250).style("opacity", 1);
|
|
7156
7156
|
});
|
|
7157
7157
|
const k = et.select("div#tooltip").style("opacity", 0);
|
|
7158
7158
|
A === null && w($e(M));
|
|
7159
|
-
const j = p[0] === "all", nt = wt.map(function(
|
|
7160
|
-
return
|
|
7159
|
+
const j = p[0] === "all", nt = wt.map(function(xt) {
|
|
7160
|
+
return xt.label;
|
|
7161
7161
|
}), W = $i(d, nt) && n === "vertical" ? zt.rotatedAxisText : zt.axisText, q = Ze().domain(nt).rangeRound(n === "vertical" ? [0, K] : [ot, 0]).paddingInner(j ? 0.15 : F ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), Dt = p[0] === "all" ? Qt(
|
|
7162
7162
|
M,
|
|
7163
|
-
(
|
|
7164
|
-
Object.entries(
|
|
7163
|
+
(xt) => Qt(
|
|
7164
|
+
Object.entries(xt).filter(([Mt]) => Mt !== "total" && Mt !== "label").map(([, Mt]) => Mt)
|
|
7165
7165
|
// value is number | string | undefined
|
|
7166
7166
|
)
|
|
7167
|
-
) : Qt(M, (
|
|
7167
|
+
) : Qt(M, (xt) => xt[p[0]]), Rt = p[0] === "all" ? ue(
|
|
7168
7168
|
M,
|
|
7169
|
-
(
|
|
7170
|
-
Object.entries(
|
|
7169
|
+
(xt) => ue(
|
|
7170
|
+
Object.entries(xt).filter(([Mt]) => Mt !== "total" && Mt !== "label").map(([, Mt]) => Mt)
|
|
7171
7171
|
// value is number | string | undefined
|
|
7172
7172
|
)
|
|
7173
|
-
) : ue(M, (
|
|
7174
|
-
X.select(".x-axis").attr("transform", `translate(0,${ot})`).transition().duration(N).call(ut).selectAll("text").attr("dy", F ? "1em" : ".20em").attr("dx", F ? "0em" : "-.8em").attr("class", W).selectAll(".tick").filter((
|
|
7173
|
+
) : ue(M, (xt) => xt[p[0]]), Q = Math.min(0, Rt ?? 0), Nt = me().domain([Q, Dt ?? 0]).range(n === "vertical" ? [ot, 0] : [0, K]), ut = n === "vertical" ? he(q).tickValues(q.domain()).tickSizeOuter(0).tickSize(0) : he(Nt).ticks(4, "s").tickSizeOuter(0).tickSize(-ot);
|
|
7174
|
+
X.select(".x-axis").attr("transform", `translate(0,${ot})`).transition().duration(N).call(ut).selectAll("text").attr("dy", F ? "1em" : ".20em").attr("dx", F ? "0em" : "-.8em").attr("class", W).selectAll(".tick").filter((xt) => xt === 0).select("line").remove(), X.select(".x-axis").selectAll("path").style("display", "none");
|
|
7175
7175
|
const vt = n === "vertical" ? _e(Nt).ticks(4, "s").tickSize(-K) : _e(q).tickSizeOuter(0).tickSize(0);
|
|
7176
|
-
X.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(N).call(vt).selectAll(".tick").filter((
|
|
7176
|
+
X.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(N).call(vt).selectAll(".tick").filter((xt) => xt === 0).select("path").remove(), X.select(".y-axis").selectAll("path").style("display", "none"), X.select("line.zero-line").attr("x1", 0).attr("y1", 0).attr("x2", n === "vertical" ? K : 0).attr("y2", n === "vertical" ? 0 : ot).attr(
|
|
7177
7177
|
"transform",
|
|
7178
7178
|
n === "vertical" ? `translate(0, ${Nt(0) || 0})` : `translate(${Nt(0) || 0}, 0)`
|
|
7179
7179
|
);
|
|
7180
|
-
const Lt = ca().keys(bt).offset(Js)(wt).map((
|
|
7181
|
-
const
|
|
7182
|
-
const
|
|
7180
|
+
const Lt = ca().keys(bt).offset(Js)(wt).map((xt) => {
|
|
7181
|
+
const Mt = xt.key, Y = xt.map((mt) => {
|
|
7182
|
+
const At = Object.keys(mt.data).filter((jt) => jt !== "label" && jt !== "total" && (r ? !0 : !p.includes(jt))).map((jt) => ({
|
|
7183
7183
|
label: jt,
|
|
7184
7184
|
value: mt.data[jt]
|
|
7185
7185
|
})).sort((jt, ee) => Number(jt.value) - Number(ee.value));
|
|
7186
7186
|
return {
|
|
7187
7187
|
...mt,
|
|
7188
|
-
key: `${
|
|
7189
|
-
barKey:
|
|
7188
|
+
key: `${Mt} - ${mt.data.label}`,
|
|
7189
|
+
barKey: Mt,
|
|
7190
7190
|
data: {
|
|
7191
7191
|
...mt.data,
|
|
7192
|
-
sortedLayers:
|
|
7192
|
+
sortedLayers: At.map((jt) => jt.label)
|
|
7193
7193
|
}
|
|
7194
7194
|
};
|
|
7195
7195
|
});
|
|
7196
|
-
return Y.key =
|
|
7197
|
-
}), qt = (
|
|
7198
|
-
let ie = X.selectAll(".serie").data(Lt, function(
|
|
7199
|
-
return
|
|
7196
|
+
return Y.key = Mt, Y;
|
|
7197
|
+
}), qt = (xt) => `rect ${zt.rect}`;
|
|
7198
|
+
let ie = X.selectAll(".serie").data(Lt, function(xt) {
|
|
7199
|
+
return xt.key;
|
|
7200
7200
|
}).join(
|
|
7201
|
-
(
|
|
7202
|
-
(
|
|
7203
|
-
(
|
|
7201
|
+
(xt) => xt.append("g").attr("class", "serie").attr("fill", st).style("opacity", (Y) => p[0] === "all" || Y.key === p[0] ? 1 : 0).style("pointer-events", (Y) => p[0] === "all" || Y.key === p[0] ? "auto" : "none"),
|
|
7202
|
+
(xt) => xt.transition().duration(N).attr("fill", st).style("opacity", (Y) => p[0] === "all" || Y.key === p[0] ? 1 : 0).style("pointer-events", (Y) => p[0] === "all" || Y.key === p[0] ? "auto" : "none"),
|
|
7203
|
+
(xt) => xt.transition().duration(N).style("opacity", 0).attr("fill", "grey").selectAll("rect").attr("y", ot).attr("height", 0).remove()
|
|
7204
7204
|
);
|
|
7205
|
-
const Gt = (
|
|
7206
|
-
const
|
|
7205
|
+
const Gt = (xt) => {
|
|
7206
|
+
const Mt = q(xt.data.label) ?? 0;
|
|
7207
7207
|
if (!r || r && p[0] === "all") {
|
|
7208
|
-
const Y = E ?
|
|
7209
|
-
return
|
|
7208
|
+
const Y = E ? xt.data.sortedLayers : bt, mt = Array.isArray(Y) && Y.indexOf(xt.barKey) || 0;
|
|
7209
|
+
return Mt + mt * (q.bandwidth() / bt.length);
|
|
7210
7210
|
}
|
|
7211
|
-
return
|
|
7212
|
-
},
|
|
7213
|
-
const
|
|
7214
|
-
return n === "vertical" ?
|
|
7215
|
-
}, se = (
|
|
7216
|
-
const
|
|
7211
|
+
return Mt;
|
|
7212
|
+
}, Ft = () => !r || r && p[0] === "all" ? q.bandwidth() / bt.length : q.bandwidth(), te = (xt) => {
|
|
7213
|
+
const Mt = Number(xt.data[xt.barKey]);
|
|
7214
|
+
return n === "vertical" ? Mt >= 0 ? Nt(Mt) : Nt(0) : Mt >= 0 ? Nt(0) : Nt(Mt);
|
|
7215
|
+
}, se = (xt) => {
|
|
7216
|
+
const Mt = Number(xt.data[xt.barKey]), Y = Math.abs(Nt(Mt) - Nt(0));
|
|
7217
7217
|
return isNaN(Y) || Y < 0 ? 0 : Y;
|
|
7218
|
-
}, rt = (
|
|
7218
|
+
}, rt = (xt) => n === "vertical" ? Gt(xt) : te(xt), gt = (xt) => n === "vertical" ? Ft() : se(xt), _t = (xt) => n === "vertical" ? te(xt) : Gt(xt), Ht = (xt) => n === "vertical" ? se(xt) : Ft();
|
|
7219
7219
|
ie.selectAll("rect").data(
|
|
7220
|
-
(
|
|
7221
|
-
(
|
|
7220
|
+
(xt) => xt,
|
|
7221
|
+
(xt) => xt.data.label
|
|
7222
7222
|
).join(
|
|
7223
|
-
(
|
|
7224
|
-
let
|
|
7225
|
-
return
|
|
7223
|
+
(xt) => {
|
|
7224
|
+
let Mt;
|
|
7225
|
+
return Mt = xt.append("rect").attr("class", qt).attr("x", function(Y) {
|
|
7226
7226
|
return n === "vertical" ? rt(Y) : 0;
|
|
7227
7227
|
}).attr("width", function(Y) {
|
|
7228
7228
|
return n === "vertical" ? p[0] === "all" ? q.bandwidth() / bt.length : q.bandwidth() : 0;
|
|
@@ -7230,20 +7230,20 @@ function l1({
|
|
|
7230
7230
|
return n === "vertical" ? ot : _t(Y);
|
|
7231
7231
|
}).attr("height", function(Y) {
|
|
7232
7232
|
return n === "vertical" ? 0 : p[0] === "all" ? q.bandwidth() / bt.length : q.bandwidth();
|
|
7233
|
-
}).transition().duration(N).style("opacity", 1).attr("x", rt).attr("width",
|
|
7233
|
+
}).transition().duration(N).style("opacity", 1).attr("x", rt).attr("width", gt).attr("height", Ht).attr("y", _t), Mt;
|
|
7234
7234
|
},
|
|
7235
7235
|
void 0,
|
|
7236
|
-
(
|
|
7237
|
-
).attr("class", qt).transition().duration(N).style("opacity", 1).attr("x", rt).attr("width",
|
|
7238
|
-
E && ie.selectAll("rect").filter((jt) => jt.barKey !==
|
|
7239
|
-
const Y =
|
|
7240
|
-
ge(".1f")(
|
|
7241
|
-
}).on("touch", function(
|
|
7242
|
-
ne(".x-axis").selectAll("text").filter((Y) => Y ===
|
|
7243
|
-
}).on("pointermove", (
|
|
7244
|
-
fe(k, { e:
|
|
7245
|
-
}).on("pointerleave", function(
|
|
7246
|
-
E && ie.selectAll("rect").filter((Y) => Y.barKey !==
|
|
7236
|
+
(xt) => xt.attr("fill", ze).transition().duration(N).attr("opacity", 0).attr("height", 0).attr("y", ot + D.bottom).remove()
|
|
7237
|
+
).attr("class", qt).transition().duration(N).style("opacity", 1).attr("x", rt).attr("width", gt).attr("height", Ht).attr("y", _t), ie.selectAll("rect").on("pointerenter", function(xt, Mt) {
|
|
7238
|
+
E && ie.selectAll("rect").filter((jt) => jt.barKey !== Mt.barKey).style("opacity", 0.25), X.select(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((jt) => jt === Mt.data.label).attr("class", (n === "vertical" ? W : "") + " " + zt.hoveredAxisText), k.style("opacity", 1);
|
|
7239
|
+
const Y = Mt.data[Mt.barKey], { total: mt } = Mt.data, At = Y / mt * 100;
|
|
7240
|
+
ge(".1f")(At) + "", k.select("p.label").text(Mt.data.label), k.select("p.layer span.label span.chev").style("background", ft(Mt.barKey)), k.select("p.layer span.label span.label").text(Mt.barKey), k.select("p.layer span.value").text(ke(Y, H)), k.select("p.total span.value").text(ke(mt ?? 0, H)), fe(k, { e: xt, svg: Z, yScale: Nt });
|
|
7241
|
+
}).on("touch", function(xt, Mt) {
|
|
7242
|
+
ne(".x-axis").selectAll("text").filter((Y) => Y === Mt.data.label).attr("class", W);
|
|
7243
|
+
}).on("pointermove", (xt, Mt) => {
|
|
7244
|
+
fe(k, { e: xt, svg: Z, yScale: Nt });
|
|
7245
|
+
}).on("pointerleave", function(xt, Mt) {
|
|
7246
|
+
E && ie.selectAll("rect").filter((Y) => Y.barKey !== Mt.barKey).style("opacity", 1), X.select(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((Y) => Y === Mt.data.label).attr("class", n === "vertical" ? W : ""), k.style("opacity", 0);
|
|
7247
7247
|
});
|
|
7248
7248
|
}, [...U, E, M, _, n, y, H]);
|
|
7249
7249
|
return /* @__PURE__ */ b.jsx(
|
|
@@ -7344,69 +7344,69 @@ function c1({
|
|
|
7344
7344
|
if (v === 0 || d === 0) return;
|
|
7345
7345
|
const C = { top: 20, right: 30, bottom: 30, left: 30 }, F = E.length === 0 ? [] : Object.keys(E[0]).filter((rt) => rt !== "label" && rt !== "total"), H = F.filter((rt) => !S.includes(rt));
|
|
7346
7346
|
E.forEach(function(rt) {
|
|
7347
|
-
rt.total = H.reduce((
|
|
7347
|
+
rt.total = H.reduce((gt, _t) => {
|
|
7348
7348
|
_t in rt || (rt[_t] = 0);
|
|
7349
|
-
const
|
|
7350
|
-
return
|
|
7349
|
+
const Ht = rt[_t];
|
|
7350
|
+
return gt + (typeof Ht == "number" ? Ht : Number(Ht));
|
|
7351
7351
|
}, 0);
|
|
7352
7352
|
});
|
|
7353
7353
|
const et = E.filter((rt) => rt?.total && rt.total > 0), D = v - C.left - C.right, dt = d - C.top - C.bottom, bt = B.select("svg"), pt = bt.node(), wt = bt.select(".plot-area").attr("transform", "translate(" + C.left + "," + C.top + ")"), ot = B.select(".controls").select(".legends-container"), O = N ? 80 : 50, Z = (rt) => {
|
|
7354
|
-
const
|
|
7355
|
-
return de(
|
|
7354
|
+
const gt = I.current.findIndex((_t) => _t === rt) + e;
|
|
7355
|
+
return de(gt);
|
|
7356
7356
|
};
|
|
7357
7357
|
function X(rt) {
|
|
7358
7358
|
return Z(rt.key);
|
|
7359
7359
|
}
|
|
7360
7360
|
const T = function(rt) {
|
|
7361
|
-
const
|
|
7361
|
+
const gt = zt[N ? "legend-container" : "legend-container-sm"], _t = zt[N ? "legend-container-inactive" : "legend-container-inactive-sm"];
|
|
7362
7362
|
return `
|
|
7363
|
-
${S.includes(rt) ? _t :
|
|
7363
|
+
${S.includes(rt) ? _t : gt}
|
|
7364
7364
|
legend-item
|
|
7365
7365
|
`;
|
|
7366
7366
|
};
|
|
7367
7367
|
ot.selectAll(".legend-item").data([...F], (rt) => rt).join(
|
|
7368
7368
|
(rt) => {
|
|
7369
|
-
const
|
|
7370
|
-
return
|
|
7369
|
+
const gt = rt.append("div").attr("class", T).style("left", (_t, Ht) => `${Ht * O}px`).style("top", "-53px").style("opacity", 0);
|
|
7370
|
+
return gt.append("div").attr("class", zt["legend-rect"]).style("background", (_t) => {
|
|
7371
7371
|
if (S.includes(_t))
|
|
7372
7372
|
return ze;
|
|
7373
|
-
const
|
|
7374
|
-
return de(
|
|
7375
|
-
}),
|
|
7373
|
+
const Ht = I.current.findIndex((xt) => xt === _t) + e;
|
|
7374
|
+
return de(Ht);
|
|
7375
|
+
}), gt.append("span").attr("class", zt["legend-label"]).text((_t) => _t), gt.transition().duration(_).style("top", "0px").style("opacity", 1), gt;
|
|
7376
7376
|
},
|
|
7377
|
-
(rt) => (rt.attr("class", T).transition().duration(_).style("top", "0px").style("left", (
|
|
7378
|
-
if (S.includes(
|
|
7377
|
+
(rt) => (rt.attr("class", T).transition().duration(_).style("top", "0px").style("left", (gt, _t) => `${_t * O}px`).style("opacity", 1).select(`.${zt["legend-rect"]}`).style("background", (gt) => {
|
|
7378
|
+
if (S.includes(gt))
|
|
7379
7379
|
return ze;
|
|
7380
|
-
const _t = I.current.findIndex((
|
|
7380
|
+
const _t = I.current.findIndex((Ht) => Ht === gt) + e;
|
|
7381
7381
|
return de(_t);
|
|
7382
|
-
}), rt.select(`.${zt["legend-label"]}`).text((
|
|
7382
|
+
}), rt.select(`.${zt["legend-label"]}`).text((gt) => gt), rt),
|
|
7383
7383
|
(rt) => rt.transition().duration(_).style("opacity", 0).style("top", "53px").remove().remove().remove()
|
|
7384
|
-
).on("pointerenter", (rt,
|
|
7385
|
-
wt.selectAll(".serie").attr("fill", X).filter((_t) => _t.key ===
|
|
7386
|
-
}).on("pointerleave", function(rt,
|
|
7387
|
-
wt.selectAll(".serie").attr("fill", X).filter((_t) => _t.key ===
|
|
7388
|
-
}).on("click", function(rt,
|
|
7384
|
+
).on("pointerenter", (rt, gt) => {
|
|
7385
|
+
wt.selectAll(".serie").attr("fill", X).filter((_t) => _t.key === gt).style("opacity", 0.25);
|
|
7386
|
+
}).on("pointerleave", function(rt, gt) {
|
|
7387
|
+
wt.selectAll(".serie").attr("fill", X).filter((_t) => _t.key === gt).style("opacity", 1);
|
|
7388
|
+
}).on("click", function(rt, gt) {
|
|
7389
7389
|
p((_t) => {
|
|
7390
|
-
let
|
|
7391
|
-
return _t.includes(
|
|
7390
|
+
let Ht = [];
|
|
7391
|
+
return _t.includes(gt) ? Ht = _t.filter((xt) => xt !== gt) : Ht = [..._t, gt], Ht;
|
|
7392
7392
|
});
|
|
7393
7393
|
});
|
|
7394
7394
|
const L = B.select("div#tooltip").style("opacity", 0), G = !N && n === "vertical" ? zt.rotatedAxisText : zt.axisText, ft = et.map(function(rt) {
|
|
7395
7395
|
return rt.label;
|
|
7396
7396
|
}), st = Ze().domain(ft).rangeRound(n === "vertical" ? [0, D] : [dt, 0]).paddingInner(N ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), it = Qt(E, (rt) => rt.total), k = me().domain([0, x ? 1 : it || 0]).nice().range(n === "vertical" ? [dt, 0] : [0, D]), j = [], nt = n === "vertical" ? he(st).tickValues(st.domain()).tickSizeOuter(0) : he(k).ticks(10, x ? ".0%" : "s").tickSizeOuter(0).tickSize(-dt);
|
|
7397
7397
|
wt.select(".x-axis").attr("transform", `translate(0,${dt})`).transition().duration(_).call(nt).selectAll("text").style("cursor", "pointer").attr("dy", N ? "1em" : ".20em").attr("dx", N ? "0em" : "-.8em").attr("class", G).selectAll(".tick").filter((rt) => rt === 0).select("line").remove();
|
|
7398
|
-
const
|
|
7398
|
+
const St = Qt(E, (rt) => rt.total), W = me().domain([0, x ? 1 : St || 0]).nice().range([dt, 0]), q = n === "vertical" ? _e(k).ticks(10, x ? ".0%" : "s").tickSize(-D) : _e(st).tickSizeOuter(0);
|
|
7399
7399
|
wt.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(_).call(q).selectAll(".tick").filter((rt) => rt === 0).select("line").remove();
|
|
7400
7400
|
const Rt = ca().keys(H).order(ii).offset(x ? $u : Jr)(et).map((rt) => {
|
|
7401
|
-
const
|
|
7402
|
-
const
|
|
7401
|
+
const gt = rt.key, _t = rt.map((Ht) => {
|
|
7402
|
+
const xt = Ht.data.label;
|
|
7403
7403
|
return {
|
|
7404
|
-
...
|
|
7405
|
-
key: `${
|
|
7406
|
-
barKey:
|
|
7404
|
+
...Ht,
|
|
7405
|
+
key: `${gt} - ${xt}`,
|
|
7406
|
+
barKey: gt
|
|
7407
7407
|
};
|
|
7408
7408
|
});
|
|
7409
|
-
return _t.key =
|
|
7409
|
+
return _t.key = gt, _t;
|
|
7410
7410
|
});
|
|
7411
7411
|
let Q = wt.selectAll(".serie").data(Rt, function(rt) {
|
|
7412
7412
|
return rt.key;
|
|
@@ -7416,16 +7416,16 @@ function c1({
|
|
|
7416
7416
|
(rt) => rt.transition().duration(_).style("opacity", 0).attr("fill", ze).selectAll("rect").attr("y", dt).attr("height", 0).remove()
|
|
7417
7417
|
);
|
|
7418
7418
|
const Nt = (rt) => st(rt.data.label + "") ?? 0, ut = st.bandwidth(), vt = (rt) => k(n === "vertical" ? rt[1] : rt[0]), $t = (rt) => {
|
|
7419
|
-
const
|
|
7420
|
-
return isNaN(
|
|
7419
|
+
const gt = n === "vertical" ? k(rt[0]) - k(rt[1]) : k(rt[1]) - k(rt[0]);
|
|
7420
|
+
return isNaN(gt) || gt < 0 ? 0 : gt;
|
|
7421
7421
|
}, Lt = (rt) => n === "vertical" ? Nt(rt) : vt(rt), qt = (rt) => n === "vertical" ? ut : $t(rt), ie = (rt) => n === "vertical" ? vt(rt) : Nt(rt), Gt = (rt) => n === "vertical" ? $t(rt) : ut;
|
|
7422
|
-
function
|
|
7423
|
-
const
|
|
7424
|
-
return H.indexOf(rt.barKey) === H.length - 1 || rt.barKey === S[0] ? n === "vertical" ? `${
|
|
7422
|
+
function Ft(rt) {
|
|
7423
|
+
const gt = qt(rt), _t = Gt(rt);
|
|
7424
|
+
return H.indexOf(rt.barKey) === H.length - 1 || rt.barKey === S[0] ? n === "vertical" ? `${gt + _t} ${gt} ${_t}` : `${gt + _t + gt}` : n === "vertical" ? `${_t} ${gt}` : `${gt} ${_t}`;
|
|
7425
7425
|
}
|
|
7426
7426
|
function te(rt) {
|
|
7427
|
-
const
|
|
7428
|
-
return n === "vertical" ? _t ? 0 :
|
|
7427
|
+
const gt = qt(rt), _t = H.indexOf(rt.barKey) === H.length - 1;
|
|
7428
|
+
return n === "vertical" ? _t ? 0 : gt * -1 : 0;
|
|
7429
7429
|
}
|
|
7430
7430
|
const se = (rt) => `rect ${zt.rect}`;
|
|
7431
7431
|
Q.selectAll("rect").data(
|
|
@@ -7433,8 +7433,8 @@ function c1({
|
|
|
7433
7433
|
(rt) => rt.data.label
|
|
7434
7434
|
).join(
|
|
7435
7435
|
(rt) => {
|
|
7436
|
-
let
|
|
7437
|
-
return
|
|
7436
|
+
let gt;
|
|
7437
|
+
return gt = rt.append("rect").attr("class", se).attr("x", function(_t) {
|
|
7438
7438
|
return n === "vertical" ? st(_t.data.label) ?? 0 : k(0);
|
|
7439
7439
|
}).attr("width", function(_t) {
|
|
7440
7440
|
return n === "vertical" ? st.bandwidth() : 0;
|
|
@@ -7442,26 +7442,26 @@ function c1({
|
|
|
7442
7442
|
if (n === "vertical") {
|
|
7443
7443
|
if (!j.includes(_t.data.label + ""))
|
|
7444
7444
|
return dt;
|
|
7445
|
-
const
|
|
7446
|
-
return
|
|
7445
|
+
const Ht = k(_t[1]), xt = k(_t[0]) - k(_t[1]), Mt = isNaN(xt) || xt < 0 ? 0 : xt;
|
|
7446
|
+
return Ht + Mt;
|
|
7447
7447
|
} else
|
|
7448
7448
|
return ie(_t);
|
|
7449
7449
|
}).attr("height", function(_t) {
|
|
7450
7450
|
return n === "vertical" ? 0 : Gt(_t);
|
|
7451
|
-
}).attr("stroke-dasharray",
|
|
7451
|
+
}).attr("stroke-dasharray", Ft).attr("stroke-dashoffset", te).transition().duration(_).attr("x", Lt).attr("width", qt).attr("height", Gt).attr("y", ie), gt;
|
|
7452
7452
|
},
|
|
7453
7453
|
void 0,
|
|
7454
7454
|
(rt) => rt.transition().duration(_).attr("opacity", 0).attr("height", 0).attr("y", dt).remove()
|
|
7455
|
-
).attr("class", se).attr("stroke-dasharray",
|
|
7456
|
-
wt.select(".x-axis").selectAll("text").filter((Y) => Y ===
|
|
7457
|
-
const _t =
|
|
7458
|
-
L.select("p.label").text(
|
|
7459
|
-
}).on("touch", function(rt,
|
|
7460
|
-
ne(".x-axis").selectAll("text").filter((_t) => _t ===
|
|
7461
|
-
}).on("pointermove", (rt,
|
|
7455
|
+
).attr("class", se).attr("stroke-dasharray", Ft).attr("stroke-dashoffset", te).transition().duration(_).attr("x", Lt).attr("width", qt).attr("height", Gt).attr("y", ie), Q.selectAll("rect").on("pointerenter", function(rt, gt) {
|
|
7456
|
+
wt.select(".x-axis").selectAll("text").filter((Y) => Y === gt.data.name).attr("class", G + " " + J.hoveredAxisText), L.style("opacity", 1);
|
|
7457
|
+
const _t = gt.data[gt.barKey] || 0, Ht = gt.data.total || 0, xt = _t / Ht * 100, Mt = ge(".1f")(xt) + "%";
|
|
7458
|
+
L.select("p.label").text(gt.data.label), L.select("p.layer span.label span.chev").style("background", Z(gt.barKey)), L.select("p.layer span.label span.label").text(gt.barKey), L.select("p.layer span.value").text(Mt), L.select("p.total span.value").text(`(${Ee(_t, U)} of ${Ee(Ht, U)})`), fe(L, { e: rt, svg: pt, yScale: W });
|
|
7459
|
+
}).on("touch", function(rt, gt) {
|
|
7460
|
+
ne(".x-axis").selectAll("text").filter((_t) => _t === gt.data.label).attr("class", G);
|
|
7461
|
+
}).on("pointermove", (rt, gt) => {
|
|
7462
7462
|
fe(L, { e: rt, svg: pt, yScale: W });
|
|
7463
|
-
}).on("pointerleave", function(rt,
|
|
7464
|
-
wt.select(".x-axis").selectAll("text").filter((_t) => _t ===
|
|
7463
|
+
}).on("pointerleave", function(rt, gt) {
|
|
7464
|
+
wt.select(".x-axis").selectAll("text").filter((_t) => _t === gt.data.name).attr("class", G), L.style("opacity", 0);
|
|
7465
7465
|
});
|
|
7466
7466
|
}, [...R, E, x, n, w, U]);
|
|
7467
7467
|
return /* @__PURE__ */ b.jsx(
|
|
@@ -7564,24 +7564,24 @@ function u1({
|
|
|
7564
7564
|
if (d === 0 || x === 0) return;
|
|
7565
7565
|
const V = { top: 20, right: 30, bottom: 30, left: 30 }, et = u.current, D = N.length === 0 ? [] : Object.keys(N[0]).filter((lt) => lt !== "label" && lt !== "total"), dt = a ? D : D.filter((lt) => !y.includes(lt));
|
|
7566
7566
|
N.forEach(function(lt) {
|
|
7567
|
-
const
|
|
7568
|
-
|
|
7569
|
-
const le = lt[
|
|
7567
|
+
const yt = dt.reduce((kt, It) => {
|
|
7568
|
+
It in lt || (lt[It] = 0);
|
|
7569
|
+
const le = lt[It], Ut = typeof le == "number" ? le : Number(le) ?? 0, we = kt.totalPos + (Ut >= 0 ? Ut : 0), on = kt.totalMin + (Ut < 0 ? Ut : 0);
|
|
7570
7570
|
return kt.total += Ut, kt.totalPos = we, kt.totalMin = on, kt;
|
|
7571
7571
|
}, { total: 0, totalPos: 0, totalMin: 0 });
|
|
7572
|
-
lt.total =
|
|
7572
|
+
lt.total = yt.total, lt.totalPos = yt.totalPos, lt.totalMin = yt.totalMin;
|
|
7573
7573
|
});
|
|
7574
|
-
const bt = N, pt = _ && (n === "stacked" || n === "grouped" && (a && y[0] !== "all" || !a && dt.length === 1)) ? $e(bt).sort(function(lt,
|
|
7575
|
-
return a ? y[0] === "all" ? lt.total -
|
|
7574
|
+
const bt = N, pt = _ && (n === "stacked" || n === "grouped" && (a && y[0] !== "all" || !a && dt.length === 1)) ? $e(bt).sort(function(lt, yt) {
|
|
7575
|
+
return a ? y[0] === "all" ? lt.total - yt.total : Number(lt[y[0]]) - Number(yt[y[0]]) : lt.total - yt.total;
|
|
7576
7576
|
}) : bt, wt = d - V.left - V.right, K = x - V.top - V.bottom, ot = H.select("svg"), O = ot.node(), Z = ot.select(".plot-area").attr("transform", "translate(" + V.left + "," + V.top + ")"), T = H.select(".controls").select(".legends-container"), tt = function(lt) {
|
|
7577
|
-
const
|
|
7577
|
+
const yt = zt[C ? "legend-container" : "legend-container-sm"], kt = zt[C ? "legend-container-active" : "legend-container-active-sm"], It = zt[C ? "legend-container-inactive" : "legend-container-inactive-sm"];
|
|
7578
7578
|
return `
|
|
7579
|
-
${y.includes(lt) ? a ? kt :
|
|
7579
|
+
${y.includes(lt) ? a ? kt : It : yt}
|
|
7580
7580
|
legend-item
|
|
7581
7581
|
`;
|
|
7582
7582
|
}, L = (lt) => {
|
|
7583
|
-
const
|
|
7584
|
-
return de(
|
|
7583
|
+
const yt = B.current.findIndex((It) => It === lt) + e;
|
|
7584
|
+
return de(yt);
|
|
7585
7585
|
};
|
|
7586
7586
|
function G(lt) {
|
|
7587
7587
|
return L(lt.key);
|
|
@@ -7589,33 +7589,33 @@ function u1({
|
|
|
7589
7589
|
const ft = C ? 80 : 50;
|
|
7590
7590
|
T.selectAll(".legend-item").data([...D], (lt) => lt).join(
|
|
7591
7591
|
(lt) => {
|
|
7592
|
-
const
|
|
7593
|
-
return
|
|
7592
|
+
const yt = lt.append("div").attr("class", tt).style("left", (kt, It) => `${It * ft}px`).style("top", "-53px").style("opacity", 0);
|
|
7593
|
+
return yt.append("div").attr("class", zt["legend-rect"]).style("background", (kt) => {
|
|
7594
7594
|
if (!a && y.includes(kt))
|
|
7595
7595
|
return ze;
|
|
7596
|
-
const
|
|
7597
|
-
return de(
|
|
7598
|
-
}),
|
|
7596
|
+
const It = B.current.findIndex((le) => le === kt) + e;
|
|
7597
|
+
return de(It);
|
|
7598
|
+
}), yt.append("span").attr("class", zt["legend-label"]).text((kt) => kt), yt.transition().duration(z).style("top", "0px").style("opacity", 1), yt;
|
|
7599
7599
|
},
|
|
7600
|
-
(lt) => (lt.attr("class", tt).transition().duration(z).style("top", "0px").style("left", (
|
|
7601
|
-
if (!a && y.includes(
|
|
7600
|
+
(lt) => (lt.attr("class", tt).transition().duration(z).style("top", "0px").style("left", (yt, kt) => `${kt * ft}px`).style("opacity", 1).select(`.${zt["legend-rect"]}`).style("background", (yt) => {
|
|
7601
|
+
if (!a && y.includes(yt))
|
|
7602
7602
|
return ze;
|
|
7603
|
-
const kt = B.current.findIndex((
|
|
7603
|
+
const kt = B.current.findIndex((It) => It === yt) + e;
|
|
7604
7604
|
return de(kt);
|
|
7605
|
-
}), lt.select(`.${zt["legend-label"]}`).text((
|
|
7605
|
+
}), lt.select(`.${zt["legend-label"]}`).text((yt) => yt), lt),
|
|
7606
7606
|
(lt) => lt.transition().duration(z).style("opacity", 0).style("top", "53px").remove().remove()
|
|
7607
|
-
).on("pointerenter", function(lt,
|
|
7607
|
+
).on("pointerenter", function(lt, yt) {
|
|
7608
7608
|
if (n === "percentage" && a) return;
|
|
7609
7609
|
const kt = Z.selectAll(".serie");
|
|
7610
|
-
y[0] === "all" && (a ? (kt.attr("fill", G).filter((
|
|
7611
|
-
}).on("pointerleave", function(lt,
|
|
7610
|
+
y[0] === "all" && (a ? (kt.attr("fill", G).filter((It) => It.key !== yt).transition().duration(250).style("opacity", 0.25), kt.selectAll("rect").filter((It) => It.barKey === yt).attr("stroke-dasharray", "none")) : kt.attr("fill", G).filter((It) => It.key === yt).transition().duration(250).style("opacity", 0.25));
|
|
7611
|
+
}).on("pointerleave", function(lt, yt) {
|
|
7612
7612
|
if (n === "percentage" && a) return;
|
|
7613
7613
|
const kt = Z.selectAll(".serie");
|
|
7614
7614
|
y[0] === "all" && Z.selectAll(".serie").attr("fill", G).transition().duration(250).style("opacity", 1), kt.selectAll("rect").attr("stroke-dasharray", mt);
|
|
7615
|
-
}).on("click", (lt,
|
|
7615
|
+
}).on("click", (lt, yt) => {
|
|
7616
7616
|
n === "percentage" && a || (S((kt) => {
|
|
7617
|
-
let
|
|
7618
|
-
return a ? kt[0] ===
|
|
7617
|
+
let It = [];
|
|
7618
|
+
return a ? kt[0] === yt ? It = ["all"] : It = [yt] : kt.includes(yt) ? It = kt.filter((le) => le !== yt) : It = [...kt, yt], It;
|
|
7619
7619
|
}), $(!0));
|
|
7620
7620
|
});
|
|
7621
7621
|
const st = pt.map(function(lt) {
|
|
@@ -7625,15 +7625,15 @@ function u1({
|
|
|
7625
7625
|
A === null && (k = !0, w($e(N)));
|
|
7626
7626
|
const j = Ze().rangeRound(r === "vertical" ? [0, wt] : [K, 0]).domain(st).paddingInner(
|
|
7627
7627
|
n !== "grouped" || n === "grouped" && (a && y[0] !== "all" || !a && dt.length === 1) ? C ? 0.4 : 0.25 : 0.1
|
|
7628
|
-
).paddingOuter(0.2).align(0.2), nt = a && y[0] !== "all" || dt.length === 1,
|
|
7628
|
+
).paddingOuter(0.2).align(0.2), nt = a && y[0] !== "all" || dt.length === 1, St = n === "stacked" || n === "percentage", W = n === "stacked" ? a ? y[0] === "all" ? Qt(N, (lt) => lt.totalPos) : Qt(N, (lt) => lt[y[0]]) : Qt(N, (lt) => lt.totalPos) : n === "grouped" ? y[0] === "all" ? Qt(
|
|
7629
7629
|
N,
|
|
7630
7630
|
(lt) => Qt(
|
|
7631
|
-
Object.entries(lt).filter(([
|
|
7631
|
+
Object.entries(lt).filter(([yt]) => yt !== "total" && yt !== "label" && yt !== "totalPos" && yt !== "totalMin").map(([, yt]) => yt)
|
|
7632
7632
|
)
|
|
7633
7633
|
) : Qt(N, (lt) => lt[y[0]]) : 1, q = Math.max(0, W ?? 0), Dt = n === "stacked" ? a ? y[0] === "all" ? ue(N, (lt) => lt.totalMin) : ue(N, (lt) => lt[y[0]]) : ue(N, (lt) => lt.totalMin) : n === "grouped" ? y[0] === "all" ? ue(
|
|
7634
7634
|
N,
|
|
7635
7635
|
(lt) => ue(
|
|
7636
|
-
Object.entries(lt).filter(([
|
|
7636
|
+
Object.entries(lt).filter(([yt]) => yt !== "total" && yt !== "label" && yt !== "totalPos" && yt !== "totalMin").map(([, yt]) => yt)
|
|
7637
7637
|
)
|
|
7638
7638
|
) : ue(N, (lt) => lt[y[0]]) : 1, Rt = Math.min(0, Dt ?? 0), Q = me().domain([Rt, q]).range(r === "vertical" ? [K, 0] : [0, wt]).nice(), Nt = !C && r === "vertical" ? zt.rotatedAxisText : zt.axisText, ut = r === "vertical" ? he(j).tickValues(j.domain()).tickSizeOuter(0) : he(Q).ticks(4, n === "percentage" ? ".0%" : "s").tickSizeOuter(0).tickSize(-K);
|
|
7639
7639
|
Z.select(".x-axis").attr("transform", `translate(0,${K})`).transition().duration(z).call(ut).selectAll("text").style("cursor", "pointer").attr("dy", C ? "1em" : ".20em").attr("dx", C ? "0em" : "-.8em").attr("class", Nt).selectAll(".tick").filter((lt) => lt === 0).select("line").remove(), Z.select(".x-axis").selectAll("path").style("display", "none");
|
|
@@ -7643,128 +7643,128 @@ function u1({
|
|
|
7643
7643
|
r === "vertical" ? `translate(0, ${Q(0) || 0})` : `translate(${Q(0) || 0}, 0)`
|
|
7644
7644
|
);
|
|
7645
7645
|
const $t = H.select("div#tooltip").style("opacity", 0), qt = ca().keys(dt).offset(n !== "percentage" ? Js : $u)(pt).map((lt) => {
|
|
7646
|
-
const
|
|
7647
|
-
const le = Object.keys(
|
|
7646
|
+
const yt = lt.key, kt = lt.map((It) => {
|
|
7647
|
+
const le = Object.keys(It.data).filter((Ut) => Ut !== "label" && Ut !== "total" && Ut !== "totalPos" && Ut !== "totalMin" && (a ? !0 : !y.includes(Ut))).map((Ut) => ({
|
|
7648
7648
|
label: Ut,
|
|
7649
|
-
value:
|
|
7649
|
+
value: It.data[Ut]
|
|
7650
7650
|
})).sort((Ut, we) => Number(Ut.value) - Number(we.value));
|
|
7651
7651
|
return {
|
|
7652
|
-
...
|
|
7653
|
-
key: `${
|
|
7654
|
-
barKey:
|
|
7652
|
+
...It,
|
|
7653
|
+
key: `${yt} - ${It.data.label}`,
|
|
7654
|
+
barKey: yt,
|
|
7655
7655
|
data: {
|
|
7656
|
-
...
|
|
7656
|
+
...It.data,
|
|
7657
7657
|
sortedLayers: le.map((Ut) => Ut.label)
|
|
7658
7658
|
}
|
|
7659
7659
|
};
|
|
7660
7660
|
});
|
|
7661
|
-
return kt.key =
|
|
7661
|
+
return kt.key = yt, kt;
|
|
7662
7662
|
}), ie = Z.selectAll(".serie").data(qt, function(lt) {
|
|
7663
7663
|
return lt.key;
|
|
7664
7664
|
}).join(
|
|
7665
7665
|
(lt) => lt.append("g").attr("class", "serie").attr("fill", G).style("opacity", (kt) => y[0] === "all" || kt.key === y[0] ? 1 : 0).style("pointer-events", (kt) => y[0] === "all" || kt.key === y[0] ? "auto" : "none"),
|
|
7666
7666
|
(lt) => lt.transition().duration(z).attr("fill", G).style("opacity", (kt) => y[0] === "all" || kt.key === y[0] ? 1 : 0).style("pointer-events", (kt) => y[0] === "all" || kt.key === y[0] ? "auto" : "none"),
|
|
7667
7667
|
(lt) => lt.transition().duration(z).style("opacity", 0).attr("fill", "grey").selectAll("rect").attr("y", 0).attr("height", 0).remove()
|
|
7668
|
-
), Gt = (lt) => `rect ${zt.rect}`,
|
|
7668
|
+
), Gt = (lt) => `rect ${zt.rect}`, Ft = pt.map((lt, yt) => {
|
|
7669
7669
|
const kt = qt.map((Ut) => ({
|
|
7670
7670
|
key: Ut.key,
|
|
7671
|
-
start: Ut[
|
|
7672
|
-
end: Ut[
|
|
7671
|
+
start: Ut[yt][0],
|
|
7672
|
+
end: Ut[yt][1],
|
|
7673
7673
|
value: lt[Ut.key]
|
|
7674
|
-
})),
|
|
7674
|
+
})), It = kt.filter((Ut) => Ut.value ?? !1).sort((Ut, we) => we.end - Ut.end), le = kt.filter((Ut) => Ut.value ?? !1).sort((Ut, we) => Ut.start - we.start);
|
|
7675
7675
|
return {
|
|
7676
7676
|
label: lt.label,
|
|
7677
|
-
top:
|
|
7678
|
-
bottom: le.length > 0 ? le[0]?.key :
|
|
7677
|
+
top: It.length > 0 ? It[0]?.key : le[le.length - 1]?.key,
|
|
7678
|
+
bottom: le.length > 0 ? le[0]?.key : It[It.length - 1]?.key
|
|
7679
7679
|
};
|
|
7680
7680
|
});
|
|
7681
7681
|
function te(lt) {
|
|
7682
|
-
const
|
|
7682
|
+
const yt = j(lt.data.label) ?? 0;
|
|
7683
7683
|
if (n === "grouped" && (!a || a && y[0] === "all")) {
|
|
7684
|
-
const
|
|
7685
|
-
return
|
|
7684
|
+
const It = (_ ? lt.data.sortedLayers : dt).indexOf(lt.barKey);
|
|
7685
|
+
return yt + It * (j.bandwidth() / dt.length);
|
|
7686
7686
|
}
|
|
7687
|
-
return
|
|
7687
|
+
return yt;
|
|
7688
7688
|
}
|
|
7689
7689
|
function se(lt) {
|
|
7690
7690
|
return n === "grouped" && (!a || a && y[0] === "all") ? j.bandwidth() / dt.length : j.bandwidth();
|
|
7691
7691
|
}
|
|
7692
7692
|
function rt(lt) {
|
|
7693
|
-
if (
|
|
7693
|
+
if (St)
|
|
7694
7694
|
if (nt) {
|
|
7695
|
-
const
|
|
7696
|
-
return r === "vertical" ?
|
|
7695
|
+
const yt = Number(lt.data[lt.barKey]);
|
|
7696
|
+
return r === "vertical" ? yt >= 0 ? Q(yt) : Q(0) : yt >= 0 ? Q(0) : Q(yt);
|
|
7697
7697
|
} else {
|
|
7698
|
-
const
|
|
7699
|
-
return y[0] === "all" ? Q(r === "vertical" ? lt[1] : lt[0]) : a && r !== "vertical" ? Q(0) :
|
|
7698
|
+
const yt = r === "vertical" ? K : wt;
|
|
7699
|
+
return y[0] === "all" ? Q(r === "vertical" ? lt[1] : lt[0]) : a && r !== "vertical" ? Q(0) : yt - (Q(lt[0]) - Q(lt[1]));
|
|
7700
7700
|
}
|
|
7701
7701
|
else {
|
|
7702
|
-
const
|
|
7703
|
-
return r === "vertical" ?
|
|
7702
|
+
const yt = Number(lt.data[lt.barKey]);
|
|
7703
|
+
return r === "vertical" ? yt >= 0 ? Q(yt) : Q(0) : yt >= 0 ? Q(0) : Q(yt);
|
|
7704
7704
|
}
|
|
7705
7705
|
}
|
|
7706
|
-
function
|
|
7707
|
-
if (
|
|
7706
|
+
function gt(lt) {
|
|
7707
|
+
if (St)
|
|
7708
7708
|
if (nt) {
|
|
7709
|
-
const
|
|
7709
|
+
const yt = Number(lt.data[lt.barKey]), kt = Math.abs(Q(yt) - Q(0));
|
|
7710
7710
|
return isNaN(kt) || kt < 0 ? 0 : kt;
|
|
7711
7711
|
} else {
|
|
7712
|
-
const
|
|
7713
|
-
return isNaN(
|
|
7712
|
+
const yt = r === "vertical" ? Q(lt[0]) - Q(lt[1]) : Q(lt[1]) - Q(lt[0]);
|
|
7713
|
+
return isNaN(yt) || yt < 0 ? 0 : yt;
|
|
7714
7714
|
}
|
|
7715
7715
|
else {
|
|
7716
|
-
const
|
|
7716
|
+
const yt = Number(lt.data[lt.barKey]), kt = Math.abs(Q(yt) - Q(0));
|
|
7717
7717
|
return isNaN(kt) || kt < 0 ? 0 : kt;
|
|
7718
7718
|
}
|
|
7719
7719
|
}
|
|
7720
|
-
const _t = et === "stacked" || et === "percentage",
|
|
7720
|
+
const _t = et === "stacked" || et === "percentage", Ht = (lt) => r === "vertical" ? te(lt) : rt(lt), xt = (lt) => r === "vertical" ? se() : gt(lt), Mt = (lt) => r === "vertical" ? rt(lt) : te(lt), Y = (lt) => r === "vertical" ? gt(lt) : se();
|
|
7721
7721
|
function mt(lt) {
|
|
7722
7722
|
if (n === "grouped" || nt)
|
|
7723
7723
|
return "none";
|
|
7724
|
-
const
|
|
7725
|
-
return Ut ? r === "vertical" ? `${
|
|
7724
|
+
const yt = xt(lt), kt = Y(lt), It = Ft.find((on) => on.label === lt.data.label), le = lt.data[lt.barKey], Ut = It?.top === lt.barKey && Number(le) >= 0, we = It?.bottom === lt.barKey && Number(le) < 0;
|
|
7725
|
+
return Ut ? r === "vertical" ? `${yt + kt} ${yt} ${kt}` : `${yt + kt + yt}` : we ? r === "vertical" ? `${kt + yt + kt} ${yt}` : `${yt} ${kt} ${yt + kt}` : r === "vertical" ? `${kt} ${yt}` : `${yt} ${kt}`;
|
|
7726
7726
|
}
|
|
7727
|
-
function
|
|
7728
|
-
const
|
|
7729
|
-
return kt?.bottom === lt.barKey && Number(
|
|
7727
|
+
function At(lt) {
|
|
7728
|
+
const yt = xt(lt), kt = Ft.find((we) => we.label === lt.data.label), It = lt.data[lt.barKey], le = kt?.top === lt.barKey && Number(It) >= 0;
|
|
7729
|
+
return kt?.bottom === lt.barKey && Number(It) < 0 ? r === "vertical" ? yt * -1 : 0 : r === "vertical" ? le ? 0 : yt * -1 : 0;
|
|
7730
7730
|
}
|
|
7731
|
-
ie.selectAll("rect").data((lt) => lt, (lt) => lt.data.label).join(
|
|
7732
|
-
(lt) => _t && !
|
|
7731
|
+
console.log("width: ", d), console.log("height: ", x), console.log("isStacked: ", St), console.log("prevIsStacked: ", _t), ie.selectAll("rect").data((lt) => lt, (lt) => lt.data.label).join(
|
|
7732
|
+
(lt) => _t && !St ? lt.append("rect").attr("class", J.rect).attr("x", function(kt) {
|
|
7733
7733
|
return r === "vertical" ? j(kt.data.label) ?? 0 : Q(0);
|
|
7734
7734
|
}).attr("width", r === "vertical" ? j.bandwidth() : 0).attr("y", function(kt) {
|
|
7735
7735
|
return r === "vertical" ? Q(0) : j(kt.data.label) ?? 0;
|
|
7736
|
-
}).attr("height", r === "vertical" ? 0 : j.bandwidth()).attr("stroke-dasharray", mt).attr("stroke-dashoffset",
|
|
7736
|
+
}).attr("height", r === "vertical" ? 0 : j.bandwidth()).attr("stroke-dasharray", mt).attr("stroke-dashoffset", At) : !_t && St ? lt.append("rect").attr("class", J.rect).attr("x", function(kt) {
|
|
7737
7737
|
return r === "vertical" ? j(kt.data.label) ?? 0 : Q(0);
|
|
7738
7738
|
}).attr("width", r === "vertical" ? j.bandwidth() : 0).attr("y", function(kt) {
|
|
7739
7739
|
return r === "vertical" ? K : j(kt.data.label) ?? 0;
|
|
7740
|
-
}).attr("height", r === "vertical" ? 0 : j.bandwidth()).attr("stroke-dasharray", mt).attr("stroke-dashoffset",
|
|
7741
|
-
return r === "vertical" ? j(kt.data.label) ?? 0 : it.includes(kt.data.label) ? rt(kt) +
|
|
7740
|
+
}).attr("height", r === "vertical" ? 0 : j.bandwidth()).attr("stroke-dasharray", mt).attr("stroke-dashoffset", At) : lt.append("rect").attr("class", J.rect).attr("x", function(kt) {
|
|
7741
|
+
return r === "vertical" ? j(kt.data.label) ?? 0 : it.includes(kt.data.label) ? rt(kt) + gt(kt) : Q(0);
|
|
7742
7742
|
}).attr("width", r === "vertical" ? j.bandwidth() : 0).attr("y", function(kt) {
|
|
7743
|
-
return r === "vertical" ? it.includes(kt.data.label) ? rt(kt) +
|
|
7744
|
-
}).attr("height", r === "vertical" ? 0 : j.bandwidth()).attr("stroke-dasharray", mt).attr("stroke-dashoffset",
|
|
7743
|
+
return r === "vertical" ? it.includes(kt.data.label) ? rt(kt) + gt(kt) : Q(0) : j(kt.data.label) ?? 0;
|
|
7744
|
+
}).attr("height", r === "vertical" ? 0 : j.bandwidth()).attr("stroke-dasharray", mt).attr("stroke-dashoffset", At),
|
|
7745
7745
|
void 0,
|
|
7746
7746
|
(lt) => lt.attr("opacity", 0).style("fill", "grey").remove()
|
|
7747
|
-
).on("pointerenter", function(lt,
|
|
7748
|
-
n === "grouped" && _ && ie.selectAll("rect").filter((we) => we.barKey !==
|
|
7749
|
-
const kt =
|
|
7750
|
-
$t.select("p.label").text(
|
|
7751
|
-
n === "percentage" ? `(${Ee(kt, U)} of ${Ee(
|
|
7747
|
+
).on("pointerenter", function(lt, yt) {
|
|
7748
|
+
n === "grouped" && _ && ie.selectAll("rect").filter((we) => we.barKey !== yt.barKey).style("opacity", 0.25), Z.select(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((we) => we === yt.data.label).attr("class", (r === "vertical" ? Nt : "") + " " + zt.hoveredAxisText), $t.style("opacity", 1);
|
|
7749
|
+
const kt = yt.data[yt.barKey], It = yt.data.total ?? 0, le = kt / It * 100, Ut = ge(".1f")(le) + "%";
|
|
7750
|
+
$t.select("p.label").text(yt.data.label), $t.select("p.layer span.label span.chev").style("background", L(yt.barKey)), $t.select("p.layer span.label span.label").text(yt.barKey), $t.select("p.layer span.value").text(n === "percentage" ? Ut : ke(kt, U)), $t.select("p.total span.value").text(
|
|
7751
|
+
n === "percentage" ? `(${Ee(kt, U)} of ${Ee(It, U)})` : ke(It, U)
|
|
7752
7752
|
), fe($t, { e: lt, svg: O, yScale: Q });
|
|
7753
|
-
}).on("pointermove", (lt,
|
|
7753
|
+
}).on("pointermove", (lt, yt) => {
|
|
7754
7754
|
fe($t, { e: lt, svg: O, yScale: Q });
|
|
7755
|
-
}).on("pointerleave", function(lt,
|
|
7756
|
-
n === "grouped" && _ && ie.selectAll("rect").filter((kt) => kt.barKey !==
|
|
7755
|
+
}).on("pointerleave", function(lt, yt) {
|
|
7756
|
+
n === "grouped" && _ && ie.selectAll("rect").filter((kt) => kt.barKey !== yt.barKey).style("opacity", 1), Z.select(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((kt) => kt === yt.data.label).attr("class", r === "vertical" ? Nt : ""), $t.style("opacity", 0);
|
|
7757
7757
|
});
|
|
7758
7758
|
function jt() {
|
|
7759
|
-
ie.selectAll("rect").attr("class", Gt).transition().duration(z).attr("stroke-dasharray", mt).attr("stroke-dashoffset",
|
|
7759
|
+
ie.selectAll("rect").attr("class", Gt).transition().duration(z).attr("stroke-dasharray", mt).attr("stroke-dashoffset", At).attr("x", Ht).attr("width", xt).attr("height", Y).attr("y", Mt);
|
|
7760
7760
|
}
|
|
7761
7761
|
function ee() {
|
|
7762
|
-
ie.selectAll("rect").attr("class", Gt).transition().duration(z).attr("x",
|
|
7762
|
+
ie.selectAll("rect").attr("class", Gt).transition().duration(z).attr("x", Ht).attr("width", xt).transition().duration(z).attr("stroke-dasharray", mt).attr("stroke-dashoffset", At).attr("height", Y).attr("y", Mt);
|
|
7763
7763
|
}
|
|
7764
7764
|
function re() {
|
|
7765
|
-
ie.selectAll("rect").attr("class", Gt).transition().duration(z).attr("y",
|
|
7765
|
+
ie.selectAll("rect").attr("class", Gt).transition().duration(z).attr("y", Mt).attr("height", Y).transition().duration(z).attr("stroke-dasharray", mt).attr("stroke-dashoffset", At).attr("x", Ht).attr("width", xt);
|
|
7766
7766
|
}
|
|
7767
|
-
n === et ? jt() :
|
|
7767
|
+
n === et ? jt() : St ? _t ? jt() : r === "vertical" ? re() : ee() : _t ? r === "vertical" ? ee() : re() : jt();
|
|
7768
7768
|
}, [...I, _, N, n, r, U]);
|
|
7769
7769
|
return /* @__PURE__ */ b.jsx(
|
|
7770
7770
|
"div",
|
|
@@ -9249,8 +9249,8 @@ function f1({ data: t, tooltipFormat: e }) {
|
|
|
9249
9249
|
}).style("stroke", "#1f2937").style("stroke-opacity", 0.05);
|
|
9250
9250
|
const ft = G.sourceLinks?.map((W) => W.targetName) ?? [], it = [...G.targetLinks?.map((W) => W.sourceName) ?? [], ...ft, G.name];
|
|
9251
9251
|
F.selectAll("text.label").filter((W) => !it.includes(W.name)).style("opacity", 0.0625);
|
|
9252
|
-
const { enteringValue: k, exitingValue: j, nodeState: nt, stateColor:
|
|
9253
|
-
H.style("opacity", 1), H.select("p.title").text(G.name + " :"), H.select("p.top-label").style("display", "block").text("in " + Ee(k, e)), H.select("p.bottom-label").style("display", "block").text("out " + Ee(j, e)), H.select("p.small-text").style("display", "block").text(`${nt}`).style("color", `${
|
|
9252
|
+
const { enteringValue: k, exitingValue: j, nodeState: nt, stateColor: St } = tt(G);
|
|
9253
|
+
H.style("opacity", 1), H.select("p.title").text(G.name + " :"), H.select("p.top-label").style("display", "block").text("in " + Ee(k, e)), H.select("p.bottom-label").style("display", "block").text("out " + Ee(j, e)), H.select("p.small-text").style("display", "block").text(`${nt}`).style("color", `${St}`), Tn(L, H);
|
|
9254
9254
|
}).on("pointermove", (L, G) => {
|
|
9255
9255
|
Tn(L, H);
|
|
9256
9256
|
}).on("pointerleave", (L, G) => {
|
|
@@ -9591,8 +9591,8 @@ function h1({ data: t, tooltipFormat: e, colorScheme: n = "monochrome" }) {
|
|
|
9591
9591
|
const bt = x.select("#tooltip").style("opacity", 0), pt = x.select("svg"), wt = pt.node(), K = pt.select(".plot-area"), ot = me().domain([-1, 2]).range(["#34d399", "#6b21a8"]).interpolate(zd), O = (k) => {
|
|
9592
9592
|
let j = k;
|
|
9593
9593
|
for (; j.depth > 1; ) j = j.parent;
|
|
9594
|
-
const nt = j.data.name,
|
|
9595
|
-
if (!W) return
|
|
9594
|
+
const nt = j.data.name, St = m.current(nt), W = Ge(St);
|
|
9595
|
+
if (!W) return St;
|
|
9596
9596
|
const q = k.depth, Dt = 0.5;
|
|
9597
9597
|
return q === 1 ? W.formatHex() : W.darker(q * Dt).formatHex();
|
|
9598
9598
|
}, Z = (k) => n === "monochrome" ? k.children ? ot(k.depth) : "#f0fdfa" : O(k);
|
|
@@ -9644,8 +9644,8 @@ function h1({ data: t, tooltipFormat: e, colorScheme: n = "monochrome" }) {
|
|
|
9644
9644
|
}).style("fill-opacity", 1).style("display", "inline")), j != N && ne(this).style("stroke-width", S * H * 2.5).style("stroke", "#e4e4e7");
|
|
9645
9645
|
const nt = j.data.name === "branches" ? "Total" : j.data.name;
|
|
9646
9646
|
bt.select("p.name").text(nt);
|
|
9647
|
-
const
|
|
9648
|
-
bt.select("p.value").text(Ee(
|
|
9647
|
+
const St = j.value ?? 0;
|
|
9648
|
+
bt.select("p.value").text(Ee(St, e).toLocaleString()), bt.transition().duration(250).style("opacity", 1), fe(bt, { e: k, svg: wt });
|
|
9649
9649
|
}).on("mousemove", (k, j) => {
|
|
9650
9650
|
fe(bt, { e: k, svg: wt });
|
|
9651
9651
|
}).on("mouseout", function(k, j) {
|
|
@@ -9666,8 +9666,8 @@ function h1({ data: t, tooltipFormat: e, colorScheme: n = "monochrome" }) {
|
|
|
9666
9666
|
C != j ? st(j) : it(), L.style("stroke-width", S * H), k.stopPropagation();
|
|
9667
9667
|
});
|
|
9668
9668
|
function G(k) {
|
|
9669
|
-
const j = I / D[2], nt = i ? k.sortedX ?? 0 : k.x,
|
|
9670
|
-
return "translate(" + (nt - D[0]) * j + "," + (
|
|
9669
|
+
const j = I / D[2], nt = i ? k.sortedX ?? 0 : k.x, St = i ? k.sortedY ?? 0 : k.y;
|
|
9670
|
+
return "translate(" + (nt - D[0]) * j + "," + (St - D[1]) * j + ")";
|
|
9671
9671
|
}
|
|
9672
9672
|
const ft = K.selectAll("text").data(et, (k) => k.data.name).join(
|
|
9673
9673
|
(k) => k.append("text").attr("class", Fn.circle_pack_label).text((j) => j.data.name).style("font-size", y).style("text-anchor", "middle").style("fill-opacity", 0).style("stroke-opacity", 0).style("display", "none").style("pointer-events", "none").style("text-shadow", "0 1px 0 lightblue, 1px 0 0 lightblue, -1px 0 0 lightblue, 0 -1px 0 lightblue").transition().duration(v).attr("transform", G).style("fill-opacity", function(j) {
|
|
@@ -9685,12 +9685,12 @@ function h1({ data: t, tooltipFormat: e, colorScheme: n = "monochrome" }) {
|
|
|
9685
9685
|
ft.raise();
|
|
9686
9686
|
function st(k) {
|
|
9687
9687
|
C = k;
|
|
9688
|
-
const j = I / 2 - p, nt = A / 2,
|
|
9688
|
+
const j = I / 2 - p, nt = A / 2, St = w / 2, W = I / D[2], q = (
|
|
9689
9689
|
/*currentData==="---"?Math.max((d.r * k),0.25):*/
|
|
9690
9690
|
k.r * W
|
|
9691
9691
|
);
|
|
9692
9692
|
H = q / j, F = j / q;
|
|
9693
|
-
const Rt = ((i ? k.sortedX ?? 0 : k.x) - D[0]) * W, Q = nt - Rt * F, ut = ((i ? k.sortedY ?? 0 : k.y) - D[0]) * W, vt =
|
|
9693
|
+
const Rt = ((i ? k.sortedX ?? 0 : k.x) - D[0]) * W, Q = nt - Rt * F, ut = ((i ? k.sortedY ?? 0 : k.y) - D[0]) * W, vt = St - ut * F;
|
|
9694
9694
|
K.transition().duration(1e3).attr("transform", "translate(" + Q + "," + vt + ")scale(" + F + ")"), ft.style("font-size", y * H + "px").filter(function($t) {
|
|
9695
9695
|
return $t.parent === C || this.style.display === "inline";
|
|
9696
9696
|
}).style("fill-opacity", function($t) {
|
|
@@ -9999,7 +9999,7 @@ function d1({
|
|
|
9999
9999
|
return W.data.ageRange + "";
|
|
10000
10000
|
});
|
|
10001
10001
|
z.domain(nt);
|
|
10002
|
-
const
|
|
10002
|
+
const St = pt[0].sort(
|
|
10003
10003
|
i ? function(W, q) {
|
|
10004
10004
|
const Dt = o ? q.data.Total ?? 0 : q.data.female, Rt = o ? W.data.Total ?? 0 : W.data.female;
|
|
10005
10005
|
return Dt - Rt;
|
|
@@ -10009,12 +10009,12 @@ function d1({
|
|
|
10009
10009
|
).map(function(W) {
|
|
10010
10010
|
return W.data.ageRange + "";
|
|
10011
10011
|
});
|
|
10012
|
-
I.domain(
|
|
10013
|
-
}, T = (k, j, nt,
|
|
10012
|
+
I.domain(St), k.select(".yMale.axis").transition().duration(v).call(C), k.select(".yFemale.axis").transition().duration(v).attr("transform", "translate(" + R + ", 0)").call(F).style("opacity", wt ? 1 : 0);
|
|
10013
|
+
}, T = (k, j, nt, St, W, q) => {
|
|
10014
10014
|
const Dt = wt ? [q, 0] : [0, c ? 1 : q], Rt = wt ? R / 2 : R;
|
|
10015
10015
|
j.domain([...Dt]).rangeRound([0, Rt]).nice(), k.select(".xMale.axis").transition().duration(v).attr("transform", "translate(0," + E + ")").call(nt).selectAll("text").style("text-anchor", d ? "center" : "end").attr("dx", function(Q) {
|
|
10016
10016
|
return d ? 0 : -12.8;
|
|
10017
|
-
}),
|
|
10017
|
+
}), St.domain([0, q]).nice(), k.select(".xFemale.axis").transition().duration(v).attr("transform", `translate(0,${E})`).call(W).style("opacity", wt ? 1 : 0).selectAll("text").style("text-anchor", d ? "center" : "end").attr("dx", function(Q) {
|
|
10018
10018
|
return d ? 0 : -12.8;
|
|
10019
10019
|
});
|
|
10020
10020
|
};
|
|
@@ -10025,8 +10025,8 @@ function d1({
|
|
|
10025
10025
|
const L = o && !c ? Be.maleTotal : Be.male, G = (k) => {
|
|
10026
10026
|
if (!o)
|
|
10027
10027
|
return "none";
|
|
10028
|
-
const j = N(k[1]) - N(k[0]), nt = isNaN(j) ? 0 : j,
|
|
10029
|
-
return `${nt} ${
|
|
10028
|
+
const j = N(k[1]) - N(k[0]), nt = isNaN(j) ? 0 : j, St = z.bandwidth();
|
|
10029
|
+
return `${nt} ${St} ${nt + St}`;
|
|
10030
10030
|
};
|
|
10031
10031
|
V.selectAll(".maleBars").data(pt[0], function(k) {
|
|
10032
10032
|
return k.data.ageRange;
|
|
@@ -10036,7 +10036,7 @@ function d1({
|
|
|
10036
10036
|
}).attr("height", z.bandwidth()).attr("stroke-dasharray", G).call(
|
|
10037
10037
|
(j) => j.transition().duration(v).attr("x", function(nt) {
|
|
10038
10038
|
return N(wt ? nt[1] : 0);
|
|
10039
|
-
}).attr("width", function(nt,
|
|
10039
|
+
}).attr("width", function(nt, St) {
|
|
10040
10040
|
if (!wt) {
|
|
10041
10041
|
const q = c ? nt[0] / nt.data.Total : nt[0], Dt = c ? nt[1] / nt.data.Total : nt[1], Rt = N(Dt) - N(q);
|
|
10042
10042
|
return isNaN(Rt) ? 0 : Rt;
|
|
@@ -10063,7 +10063,7 @@ function d1({
|
|
|
10063
10063
|
return N(wt ? k[1] : 0);
|
|
10064
10064
|
}).attr("width", function(k, j) {
|
|
10065
10065
|
if (!wt) {
|
|
10066
|
-
const
|
|
10066
|
+
const St = c ? k[0] / k.data.Total : k[0], W = c ? k[1] / k.data.Total : k[1], q = N(W) - N(St);
|
|
10067
10067
|
return isNaN(q) ? 0 : q;
|
|
10068
10068
|
}
|
|
10069
10069
|
const nt = N(k[0]) - N(k[1]);
|
|
@@ -10072,22 +10072,22 @@ function d1({
|
|
|
10072
10072
|
const ft = o && !c ? Be.femaleTotal : Be.female, st = (k) => {
|
|
10073
10073
|
if (!o)
|
|
10074
10074
|
return "none";
|
|
10075
|
-
const j = N(k[1]) - N(k[0]), nt = isNaN(j) ? 0 : j,
|
|
10076
|
-
return `${nt +
|
|
10075
|
+
const j = N(k[1]) - N(k[0]), nt = isNaN(j) ? 0 : j, St = I.bandwidth();
|
|
10076
|
+
return `${nt + St + nt} ${St}`;
|
|
10077
10077
|
};
|
|
10078
10078
|
V.selectAll(".femaleBars").data(pt[1], function(k) {
|
|
10079
10079
|
return k.data.ageRange;
|
|
10080
10080
|
}).join(
|
|
10081
10081
|
(k) => k.append("rect").attr("class", "femaleBars " + ft).attr("stroke-dasharray", st).attr("fill", "#ff6699").attr("width", 0).attr("x", function(j, nt) {
|
|
10082
10082
|
if (!wt) {
|
|
10083
|
-
const
|
|
10084
|
-
return N(
|
|
10083
|
+
const St = c ? j[0] / j.data.Total : j[0];
|
|
10084
|
+
return N(St);
|
|
10085
10085
|
}
|
|
10086
10086
|
return R / 2;
|
|
10087
10087
|
}).attr("y", function(j, nt) {
|
|
10088
10088
|
return (wt ? I : z)(j.data.ageRange) ?? 0;
|
|
10089
10089
|
}).attr("height", I.bandwidth()).call(
|
|
10090
|
-
(j) => j.transition().duration(v).attr("width", function(nt,
|
|
10090
|
+
(j) => j.transition().duration(v).attr("width", function(nt, St) {
|
|
10091
10091
|
if (!wt) {
|
|
10092
10092
|
const q = c ? nt[0] / nt.data.Total : nt[0], Dt = c ? nt[1] / nt.data.Total : nt[1], Rt = N(Dt) - N(q);
|
|
10093
10093
|
return isNaN(Rt) ? 0 : Rt;
|
|
@@ -10118,7 +10118,7 @@ function d1({
|
|
|
10118
10118
|
return R / 2;
|
|
10119
10119
|
}).attr("width", function(k, j) {
|
|
10120
10120
|
if (!wt) {
|
|
10121
|
-
const
|
|
10121
|
+
const St = c ? k[0] / k.data.Total : k[0], W = c ? k[1] / k.data.Total : k[1], q = N(W) - N(St);
|
|
10122
10122
|
return isNaN(q) ? 0 : q;
|
|
10123
10123
|
}
|
|
10124
10124
|
const nt = U(k[1]) - U(k[0]);
|
|
@@ -10304,7 +10304,7 @@ function p1({ data: t, timeframe: e = "daily", mode: n = "linechart", tooltipFor
|
|
|
10304
10304
|
const bt = (W) => W.open >= W.close ? m.bullish : m.bearish;
|
|
10305
10305
|
n === "candlestick" && $.selectAll("path.candle").data(U).join(
|
|
10306
10306
|
(W) => W.insert("path", "g.tooltip").attr("class", "candle").attr("d", function(q) {
|
|
10307
|
-
return
|
|
10307
|
+
return St(q, et);
|
|
10308
10308
|
}).style("fill", bt).attr("clip-path", "url(#clip)"),
|
|
10309
10309
|
void 0,
|
|
10310
10310
|
(W) => W.remove()
|
|
@@ -10312,7 +10312,7 @@ function p1({ data: t, timeframe: e = "daily", mode: n = "linechart", tooltipFor
|
|
|
10312
10312
|
const { date: Dt, open: Rt, hi: Q, low: Nt, close: ut, volume: vt } = q, $t = ne(this).node()?.getBBox().width ?? 0;
|
|
10313
10313
|
Z({ date: Dt, open: Rt, hi: Q, low: Nt, close: ut, volume: vt }), O({ xPos: C(Dt) + $t / 2, low: Nt, volume: vt });
|
|
10314
10314
|
}).on("pointerleave", X).attr("d", function(W) {
|
|
10315
|
-
return
|
|
10315
|
+
return St(W, et);
|
|
10316
10316
|
}).style("fill", bt);
|
|
10317
10317
|
const pt = $.select("g.tooltip").style("pointer-events", "none"), wt = _.select("g.tooltip").style("pointer-events", "none");
|
|
10318
10318
|
$.select("rect.overlay").attr("width", w > 0 ? w : 0).attr("height", S > 0 ? S : 0).style("fill", "none").style("pointer-events", n === "linechart" ? "all" : "none").on("pointerenter pointermove", ot).on("pointerleave", X).on("touchstart", (W) => W.preventDefault());
|
|
@@ -10334,7 +10334,7 @@ function p1({ data: t, timeframe: e = "daily", mode: n = "linechart", tooltipFor
|
|
|
10334
10334
|
const { xPos: q, low: Dt, volume: Rt } = W;
|
|
10335
10335
|
pt.style("display", null), pt.attr("transform", `translate(${q},${et(Dt)})`), wt.style("display", null), wt.attr("transform", `translate(${q},${tt(Rt)})`);
|
|
10336
10336
|
}, Z = (W) => {
|
|
10337
|
-
const { prefix: q, suffix: Dt } = r, { date: Rt, open: Q, hi: Nt, low: ut, close: vt, volume: $t } = W, Lt = pt.selectAll("path").data([null]).join("path").attr("fill", "white").attr("stroke", "black"), qt = pt.selectAll("text").data([null]).join("text").call((
|
|
10337
|
+
const { prefix: q, suffix: Dt } = r, { date: Rt, open: Q, hi: Nt, low: ut, close: vt, volume: $t } = W, Lt = pt.selectAll("path").data([null]).join("path").attr("fill", "white").attr("stroke", "black"), qt = pt.selectAll("text").data([null]).join("text").call((Ft) => Ft.selectAll("tspan").data([
|
|
10338
10338
|
K(Rt),
|
|
10339
10339
|
`open: ${Ee(Q, { prefix: q, suffix: Dt })}`,
|
|
10340
10340
|
`hi: ${Ee(Nt, { prefix: q, suffix: Dt })}`,
|
|
@@ -10342,7 +10342,7 @@ function p1({ data: t, timeframe: e = "daily", mode: n = "linechart", tooltipFor
|
|
|
10342
10342
|
`close: ${Ee(vt, { prefix: q, suffix: Dt })}`
|
|
10343
10343
|
]).join("tspan").attr("x", 0).attr("y", (te, se) => `${se * 1.1}em`).attr("font-weight", (te, se) => se ? null : "bold").style("align", "right").text((te) => te));
|
|
10344
10344
|
T(qt, Lt);
|
|
10345
|
-
const ie = wt.selectAll("path").data([null]).join("path").attr("fill", "white").attr("stroke", "black"), Gt = wt.selectAll("text").data([null]).join("text").call((
|
|
10345
|
+
const ie = wt.selectAll("path").data([null]).join("path").attr("fill", "white").attr("stroke", "black"), Gt = wt.selectAll("text").data([null]).join("text").call((Ft) => Ft.selectAll("tspan").data(["Trading Volume", Ee($t)]).join("tspan").attr("x", 0).attr("y", (te, se) => `${se * 1.1}em`).attr("font-weight", (te, se) => se ? null : "bold").text((te) => te));
|
|
10346
10346
|
T(Gt, ie), R.transition().duration(l / 4).style("opacity", 0);
|
|
10347
10347
|
};
|
|
10348
10348
|
function X(W) {
|
|
@@ -10375,12 +10375,12 @@ function p1({ data: t, timeframe: e = "daily", mode: n = "linechart", tooltipFor
|
|
|
10375
10375
|
R.append("path").attr("class", "line").datum(W.values).attr("fill", "none").attr("stroke", u[q]).attr("stroke-width", 1).attr("d", st).attr("clip-path", "url(#clip)");
|
|
10376
10376
|
}), R.selectAll("path.candle").remove(), n === "candlestick" && R.selectAll("path.candle").data(U).join(
|
|
10377
10377
|
(W) => W.insert("path", "g.tooltip").attr("class", "candle").attr("d", function(q) {
|
|
10378
|
-
return
|
|
10378
|
+
return St(q, ft);
|
|
10379
10379
|
}).style("fill", bt).attr("clip-path", "url(#clip)"),
|
|
10380
10380
|
void 0,
|
|
10381
10381
|
(W) => W.remove()
|
|
10382
10382
|
).attr("d", function(W) {
|
|
10383
|
-
return
|
|
10383
|
+
return St(W, ft);
|
|
10384
10384
|
}).style("fill", bt), R.select(".x-axis").attr("transform", "translate(0," + x + ")").call(he(G)).selectAll("text").attr("class", F);
|
|
10385
10385
|
const it = Yc().extent([[0, 0], [s, x]]).on("brush", k);
|
|
10386
10386
|
R.append("g").attr("class", "brush").call(it);
|
|
@@ -10393,14 +10393,14 @@ function p1({ data: t, timeframe: e = "daily", mode: n = "linechart", tooltipFor
|
|
|
10393
10393
|
});
|
|
10394
10394
|
const j = () => {
|
|
10395
10395
|
$.select(".x-axis").call(he(C)).selectAll("text").attr("class", F), n === "candlestick" ? $.selectAll("path.candle").attr("d", function(W) {
|
|
10396
|
-
return
|
|
10396
|
+
return St(W, et);
|
|
10397
10397
|
}) : n === "linechart" && $.selectAll("path.chartline").attr("d", dt), _.select(".x-axis").call(he(C)).selectAll("text").attr("class", F), _.selectAll("path.area").attr("d", L);
|
|
10398
10398
|
};
|
|
10399
10399
|
function nt() {
|
|
10400
10400
|
const W = C(U[1].date) - C(U[0].date), q = (W - W * 0.2) / 2;
|
|
10401
10401
|
return { barWidth: W, shoulderWidth: q };
|
|
10402
10402
|
}
|
|
10403
|
-
function
|
|
10403
|
+
function St(W, q) {
|
|
10404
10404
|
let Dt, Rt;
|
|
10405
10405
|
W.open >= W.close ? (Dt = W.open, Rt = W.close) : (Dt = W.close, Rt = W.open);
|
|
10406
10406
|
const { barWidth: Q, shoulderWidth: Nt } = nt();
|
|
@@ -10875,10 +10875,10 @@ function y1({
|
|
|
10875
10875
|
}).on("pointerleave", function(ut, vt) {
|
|
10876
10876
|
et.style("opacity", 0);
|
|
10877
10877
|
});
|
|
10878
|
-
const
|
|
10878
|
+
const St = 12;
|
|
10879
10879
|
function W(ut, vt) {
|
|
10880
10880
|
const $t = ft(ut, vt), Lt = st(ut, vt);
|
|
10881
|
-
return $t + Lt / 2 +
|
|
10881
|
+
return $t + Lt / 2 + St / 2;
|
|
10882
10882
|
}
|
|
10883
10883
|
function q(ut, vt) {
|
|
10884
10884
|
const $t = G(ut), Lt = X.bandwidth();
|
|
@@ -10888,8 +10888,8 @@ function y1({
|
|
|
10888
10888
|
return st(ut, vt) < 20 ? 0 : 1;
|
|
10889
10889
|
}
|
|
10890
10890
|
const Rt = B.selectAll(".label").data(N, (ut) => ut.label).join(
|
|
10891
|
-
(ut) => ut.append("text").attr("class", `label ${xe.label}`).text((vt) => ge("~s")(d !== "waterfall" ? Math.abs(vt.value) : vt.value)).attr("text-anchor", "middle").style("font-size",
|
|
10892
|
-
(ut) => ut.attr("class", `label ${xe.label}`).text((vt) => ge("~s")(d !== "waterfall" ? Math.abs(vt.value) : vt.value)).attr("text-anchor", "middle").style("font-size",
|
|
10891
|
+
(ut) => ut.append("text").attr("class", `label ${xe.label}`).text((vt) => ge("~s")(d !== "waterfall" ? Math.abs(vt.value) : vt.value)).attr("text-anchor", "middle").style("font-size", St).style("font-weight", "bold").style("pointer-events", "none").style("opacity", 0).attr("x", q).attr("y", W).transition().duration(_).style("opacity", Dt).attr("x", q).attr("y", W),
|
|
10892
|
+
(ut) => ut.attr("class", `label ${xe.label}`).text((vt) => ge("~s")(d !== "waterfall" ? Math.abs(vt.value) : vt.value)).attr("text-anchor", "middle").style("font-size", St).style("font-weight", "bold").transition().duration(_).style("opacity", Dt).attr("x", q).attr("y", W),
|
|
10893
10893
|
(ut) => ut.transition().duration(_).style("opacity", 0).remove()
|
|
10894
10894
|
), Q = N.map((ut, vt) => ({
|
|
10895
10895
|
label: ut.label,
|
|
@@ -11067,11 +11067,11 @@ function x1({
|
|
|
11067
11067
|
}), k = st.map((ct, P) => {
|
|
11068
11068
|
const at = P === st.length - 1;
|
|
11069
11069
|
return Math.max(ct.start, at ? ct.value : ct.end);
|
|
11070
|
-
}), j = p === "inflows" || p === "outflows" ? p : "waterfall", nt = st.filter((ct) => ct.type !== "total"),
|
|
11070
|
+
}), j = p === "inflows" || p === "outflows" ? p : "waterfall", nt = st.filter((ct) => ct.type !== "total"), St = j === "waterfall" ? nt : nt.filter((ct) => j === "inflows" ? ct.start <= ct.end : ct.start > ct.end).sort((ct, P) => x ? Math.abs(P.value) - Math.abs(ct.value) : 0), W = j === "waterfall" ? Math.min(...it) : 0, q = Math.max(...j === "waterfall" ? k : St.map((ct) => Math.abs(ct.value))), Dt = Math.min(0, ue(G) ?? 0), Rt = Math.max(0, Qt(G) ?? 0), Q = me().domain(
|
|
11071
11071
|
R === -1 ? [Dt, Rt] : [W, q]
|
|
11072
11072
|
).range([T, 0]).nice(), Nt = _e(Q).ticks(5, "s").tickSize(-X);
|
|
11073
11073
|
bt.select(".y-axis").attr("transform", "translate(0, 0)").transition().duration(z).call(Nt);
|
|
11074
|
-
const ut = p === "open" && x ? F.map((ct) => ct.label) : p === "close" && x ? V.map((ct) => ct.label) : B.map((ct) => ct.label), vt = j === "waterfall" ? st.map((ct) => ct.label === "Opening" ? "open" : ct.label === "Closing" ? "close" : ct.label) :
|
|
11074
|
+
const ut = p === "open" && x ? F.map((ct) => ct.label) : p === "close" && x ? V.map((ct) => ct.label) : B.map((ct) => ct.label), vt = j === "waterfall" ? st.map((ct) => ct.label === "Opening" ? "open" : ct.label === "Closing" ? "close" : ct.label) : St.map((ct) => ct.label), $t = R === -1 ? ut : vt, Lt = Ze().domain($t).rangeRound([0, X]).padding(0.2), qt = he(Lt).tickValues(Lt.domain()).scale(Lt).tickSizeOuter(0), ie = Ze().domain(et).range([0, Lt.bandwidth()]).padding(0.05), te = `${$i(g, $t) ? `${J.rotatedAxisText} ${xe["axis-label-sm"]}` : `${J.axisText} ${xe["axis-label"]}`} ${xe["clickable-label"]}`;
|
|
11075
11075
|
bt.select(".x-axis").transition().duration(z).call(qt).attr("transform", `translate(0, ${T})`).selectAll("text").attr("class", `${te}`), bt.select(".x-axis").selectAll("path").style("display", "none"), bt.select(".x-axis").selectAll("text").on("click", function(ct, P) {
|
|
11076
11076
|
v === -1 && (d(ut.indexOf(P)), $(""), A(!1));
|
|
11077
11077
|
}), bt.select("line.zero-line").attr("x1", 0).attr("y1", 0).attr("x2", X).attr("y2", 0).transition().duration(z).attr("transform", `translate(0, ${Q(0) || 0})`);
|
|
@@ -11081,7 +11081,7 @@ function x1({
|
|
|
11081
11081
|
barWidth: at,
|
|
11082
11082
|
yPos: ht,
|
|
11083
11083
|
barHeight: Ct,
|
|
11084
|
-
labelFor:
|
|
11084
|
+
labelFor: Tt
|
|
11085
11085
|
}) => {
|
|
11086
11086
|
const Et = ct[0] && "data" in ct[0] ? "openClose" : "waterfall";
|
|
11087
11087
|
function Bt(Ot, Kt) {
|
|
@@ -11092,37 +11092,37 @@ function x1({
|
|
|
11092
11092
|
return Ve + Xe / 2 + se / 2;
|
|
11093
11093
|
}
|
|
11094
11094
|
function Zt(Ot, Kt) {
|
|
11095
|
-
return p === "open" &&
|
|
11095
|
+
return p === "open" && Tt === "close" || p === "close" && Tt === "open" ? 0 : Ct(Ot, Kt) >= 20 && at >= 20 ? 1 : 0;
|
|
11096
11096
|
}
|
|
11097
11097
|
const pe = (Ot) => {
|
|
11098
11098
|
const Kt = Et === "openClose" ? Ot.data.value : Ot.value;
|
|
11099
11099
|
return ge("~s")(j !== "waterfall" ? Math.abs(Kt) : Kt);
|
|
11100
|
-
}, Pt =
|
|
11100
|
+
}, Pt = Tt ? `${Tt}label` : "label";
|
|
11101
11101
|
return bt.selectAll(`.${Pt}`).data(
|
|
11102
11102
|
ct,
|
|
11103
|
-
(Ot) => Ot?.label + `${
|
|
11103
|
+
(Ot) => Ot?.label + `${Tt ? "-" + Tt : ""}`
|
|
11104
11104
|
).join(
|
|
11105
11105
|
(Ot) => Ot.append("text").attr("class", `${Pt} ${xe.label}`).text(pe).attr("text-anchor", "middle").style("font-size", se).style("font-weight", "bold").style("pointer-events", "none").style("opacity", 0).attr("x", Bt).attr("y", Q(0)).transition().duration(z).style("opacity", Zt).attr("x", Bt).attr("y", Wt),
|
|
11106
11106
|
(Ot) => Ot.attr("class", `${Pt} ${xe.label}`).text(pe).attr("text-anchor", "middle").style("font-size", se).style("font-weight", "bold").transition().duration(z).style("opacity", Zt).attr("x", Bt).attr("y", Wt),
|
|
11107
11107
|
(Ot) => Ot.remove()
|
|
11108
11108
|
);
|
|
11109
|
-
},
|
|
11109
|
+
}, gt = (ct, P) => R === -1 ? (Lt(ct.label) ?? 0) + (ie(P) ?? 0) : Lt(P) ?? 0, _t = R === -1 && p !== "open" && p !== "close" ? ie.bandwidth() : Lt.bandwidth(), Ht = (ct, P) => gt(ct, "open"), xt = (ct, P) => R === -1 ? ct.data.value >= 0 ? Q(ct.data.value) : Q(0) : Q(Math.max(ct.data.start, ct.data.end)), Mt = (ct, P) => Math.abs(R === -1 ? Q(ct.data.value) - Q(0) : Q(ct.data.start) - Q(ct.data.end)), Y = bt.selectAll("rect.open").data(
|
|
11110
11110
|
F,
|
|
11111
11111
|
(ct) => ct?.label || " - open"
|
|
11112
11112
|
).join(
|
|
11113
|
-
(ct) => ct.append("rect").attr("class", `open ${J.bar}`).attr("fill", be.open).attr("y", Q(0) ?? 0).attr("height", 0).attr("x",
|
|
11113
|
+
(ct) => ct.append("rect").attr("class", `open ${J.bar}`).attr("fill", be.open).attr("y", Q(0) ?? 0).attr("height", 0).attr("x", Ht).attr("width", _t),
|
|
11114
11114
|
void 0,
|
|
11115
11115
|
(ct) => ct.remove()
|
|
11116
11116
|
);
|
|
11117
|
-
Y.transition().duration(z).attr("x",
|
|
11117
|
+
Y.transition().duration(z).attr("x", Ht).attr("width", _t).attr("y", xt).attr("height", Mt).style("opacity", p !== "close" ? 1 : 0).style("pointer-events", p !== "close" ? "auto" : "none"), rt({
|
|
11118
11118
|
labelData: F,
|
|
11119
|
-
xPos:
|
|
11119
|
+
xPos: Ht,
|
|
11120
11120
|
barWidth: _t,
|
|
11121
|
-
yPos:
|
|
11122
|
-
barHeight:
|
|
11121
|
+
yPos: xt,
|
|
11122
|
+
barHeight: Mt,
|
|
11123
11123
|
labelFor: "open"
|
|
11124
11124
|
});
|
|
11125
|
-
const mt = (ct, P) =>
|
|
11125
|
+
const mt = (ct, P) => gt(ct, p === "close" ? "open" : "close"), At = (ct, P) => R === -1 ? ct.data.value >= 0 ? Q(ct.data.value) : Q(0) : ct.data.start <= ct.data.end ? Q(ct.data.value) : Q(0), jt = (ct, P) => {
|
|
11126
11126
|
if (R === -1)
|
|
11127
11127
|
return Math.abs(Q(ct.data.value) - Q(0));
|
|
11128
11128
|
{
|
|
@@ -11141,11 +11141,11 @@ function x1({
|
|
|
11141
11141
|
void 0,
|
|
11142
11142
|
(ct) => ct.remove()
|
|
11143
11143
|
);
|
|
11144
|
-
ee.transition().duration(z).attr("x", mt).attr("width", _t).attr("y",
|
|
11144
|
+
ee.transition().duration(z).attr("x", mt).attr("width", _t).attr("y", At).attr("height", jt).attr("fill", "orange").style("opacity", p !== "open" ? 1 : 0).style("pointer-events", p !== "open" ? "auto" : "none"), rt({
|
|
11145
11145
|
labelData: V,
|
|
11146
11146
|
xPos: mt,
|
|
11147
11147
|
barWidth: _t,
|
|
11148
|
-
yPos:
|
|
11148
|
+
yPos: At,
|
|
11149
11149
|
barHeight: jt,
|
|
11150
11150
|
labelFor: "close"
|
|
11151
11151
|
});
|
|
@@ -11155,7 +11155,7 @@ function x1({
|
|
|
11155
11155
|
function lt(ct, P) {
|
|
11156
11156
|
return j === "waterfall" ? ct.type === "total" && P > 0 ? ct.start <= ct.end ? Q(ct.value) : Q(0) : Q(Math.max(ct.start, ct.end)) : Q(Math.abs(ct.value));
|
|
11157
11157
|
}
|
|
11158
|
-
function
|
|
11158
|
+
function yt(ct, P) {
|
|
11159
11159
|
if (j === "waterfall") {
|
|
11160
11160
|
const at = Math.abs(Q(ct.start) - Q(ct.end));
|
|
11161
11161
|
if (ct.type === "total" && P > 0)
|
|
@@ -11171,22 +11171,22 @@ function x1({
|
|
|
11171
11171
|
function kt(ct) {
|
|
11172
11172
|
return ct.start <= ct.end ? be.inflows : be.outflows;
|
|
11173
11173
|
}
|
|
11174
|
-
const
|
|
11174
|
+
const It = bt.selectAll(".bar").data(St, (ct) => ct.label).join(
|
|
11175
11175
|
(ct) => ct.append("rect").attr("class", `bar ${J.bar}`).attr("x", re).attr("width", Lt.bandwidth()).attr(
|
|
11176
11176
|
"y",
|
|
11177
11177
|
(P, at) => w.current === "data" ? P.type === "total" ? Q(0) : Q(P.start) : Q(0)
|
|
11178
|
-
).attr("height", 0).attr("rx", 5).attr("ry", 5).style("fill", kt).transition().duration(z).attr("y", lt).attr("height",
|
|
11178
|
+
).attr("height", 0).attr("rx", 5).attr("ry", 5).style("fill", kt).transition().duration(z).attr("y", lt).attr("height", yt).on("end", function(P, at) {
|
|
11179
11179
|
w.current === "data" && j === "waterfall" ? at === B.length - 1 && (y.current = !0) : y.current = !0;
|
|
11180
11180
|
}),
|
|
11181
|
-
(ct) => (ct.transition().duration(z).style("fill", kt).attr("x", re).attr("width", Lt.bandwidth()).attr("y", lt).attr("height",
|
|
11181
|
+
(ct) => (ct.transition().duration(z).style("fill", kt).attr("x", re).attr("width", Lt.bandwidth()).attr("y", lt).attr("height", yt).attr("rx", 5).attr("ry", 5), ct),
|
|
11182
11182
|
(ct) => ct.transition().duration(z).style("opacity", 0).remove()
|
|
11183
11183
|
);
|
|
11184
11184
|
rt({
|
|
11185
|
-
labelData:
|
|
11185
|
+
labelData: St,
|
|
11186
11186
|
xPos: re,
|
|
11187
11187
|
barWidth: Lt.bandwidth(),
|
|
11188
11188
|
yPos: lt,
|
|
11189
|
-
barHeight:
|
|
11189
|
+
barHeight: yt
|
|
11190
11190
|
});
|
|
11191
11191
|
const le = (p === "" || p === "open") && R === -1 ? C.map((ct) => ({ label: ct.label, value: ct.data.value })) : [];
|
|
11192
11192
|
Yr(
|
|
@@ -11232,7 +11232,7 @@ function x1({
|
|
|
11232
11232
|
dotFill: be.close
|
|
11233
11233
|
}
|
|
11234
11234
|
);
|
|
11235
|
-
const on = (j === "waterfall" ? st :
|
|
11235
|
+
const on = (j === "waterfall" ? st : St).map((ct, P) => ({
|
|
11236
11236
|
label: ct.label === "Opening" ? "open" : ct.label === "Closing" ? "close" : ct.label,
|
|
11237
11237
|
value: j !== "waterfall" ? Math.abs(ct.value) : P !== st.length - 1 ? ct.end : ct.value
|
|
11238
11238
|
})), Ai = j === "waterfall" ? "#2b2b22" : be[j];
|
|
@@ -11272,7 +11272,7 @@ function x1({
|
|
|
11272
11272
|
}, Nr = () => {
|
|
11273
11273
|
oe.style("opacity", 0);
|
|
11274
11274
|
};
|
|
11275
|
-
Y.on("pointerenter", fa).on("pointermove", Mr).on("pointerleave", Nr), ee.on("pointerenter", fa).on("pointermove", Mr).on("pointerleave", Nr),
|
|
11275
|
+
Y.on("pointerenter", fa).on("pointermove", Mr).on("pointerleave", Nr), ee.on("pointerenter", fa).on("pointermove", Mr).on("pointerleave", Nr), It.on("pointerenter", function(ct, P) {
|
|
11276
11276
|
const { label: at, value: ht } = P;
|
|
11277
11277
|
jn(at, ht), j === "waterfall" ? (oe.select("p.from").style("display", "flex"), oe.select("p.from span.label").text("from: "), oe.select("p.from span.value").text(ke(P.start, An)), oe.select("p.to").style("display", "flex"), oe.select("p.to span.label").text("to: "), oe.select("p.to span.value").text(ke(P.end, An))) : (oe.select("p.from").style("display", "none"), oe.select("p.to").style("display", "none")), oe.style("opacity", 1);
|
|
11278
11278
|
}).on("pointermove", Mr).on("pointerleave", Nr);
|
|
@@ -11499,9 +11499,9 @@ function m1({
|
|
|
11499
11499
|
function G(it, k) {
|
|
11500
11500
|
const j = k[p[0]], nt = k[p[1]];
|
|
11501
11501
|
U.style("opacity", 1), U.select("p.label").text(k.label), U.select("p.change span.from span.value").text(ke(j, L)), U.select("p.change span.to span.value").text(ke(nt, L));
|
|
11502
|
-
const
|
|
11503
|
-
U.select("p.total span.label span.text").text(ke(
|
|
11504
|
-
|
|
11502
|
+
const St = nt - j;
|
|
11503
|
+
U.select("p.total span.label span.text").text(ke(St, L)), U.select("p.total span.label span.chev").style("color", St >= 0 ? "#22c55e" : "#ef4444").text(
|
|
11504
|
+
St > 0 ? "▲" : St < 0 ? "▼" : ""
|
|
11505
11505
|
), fe(U, { e: it, svg: _, yScale: D });
|
|
11506
11506
|
}
|
|
11507
11507
|
function ft(it, k) {
|
|
@@ -11848,10 +11848,10 @@ function v1({
|
|
|
11848
11848
|
const X = 0.3;
|
|
11849
11849
|
ot.on("pointerenter", function(T, tt) {
|
|
11850
11850
|
T.stopPropagation(), ot.filter((q) => q.index !== tt.index).style("opacity", X), pt.filter((q) => q.source.index !== tt.index && q.target.index !== tt.index).style("opacity", X);
|
|
11851
|
-
const L = pt.filter((q) => q.target.index === tt.index && q.source.index !== tt.index), G = pt.filter((q) => q.source.index === tt.index && q.target.index !== tt.index), ft = pt.filter((q) => q.source.index === tt.index && q.target.index === tt.index), st = L.data(), it = G.data(), k = ft.data(), j = st.reduce((q, Dt) => q + Dt.target.value, 0), nt = it.reduce((q, Dt) => q + Dt.source.value, 0),
|
|
11851
|
+
const L = pt.filter((q) => q.target.index === tt.index && q.source.index !== tt.index), G = pt.filter((q) => q.source.index === tt.index && q.target.index !== tt.index), ft = pt.filter((q) => q.source.index === tt.index && q.target.index === tt.index), st = L.data(), it = G.data(), k = ft.data(), j = st.reduce((q, Dt) => q + Dt.target.value, 0), nt = it.reduce((q, Dt) => q + Dt.source.value, 0), St = k.reduce((q, Dt) => q + Dt.source.value, 0);
|
|
11852
11852
|
$.style("opacity", 1);
|
|
11853
11853
|
const W = B[tt.index];
|
|
11854
|
-
$.select("p.name").style("display", "block").text(W), $.select("p.value1").style("display", "flex"), $.select("p.value1 span.label").text("inflows: "), $.select("p.value1 span.value").text(`${e}${Wn(j)}${n}`), $.select("p.value2").style("display", "flex"), $.select("p.value2 span.label").text("outflows: "), $.select("p.value2 span.value").text(`${e}${Wn(nt)}${n}`), $.select("p.selfValue").style("display", "flex"), $.select("p.selfValue span.label").text("internal: "), $.select("p.selfValue span.value").text(`${e}${Wn(
|
|
11854
|
+
$.select("p.name").style("display", "block").text(W), $.select("p.value1").style("display", "flex"), $.select("p.value1 span.label").text("inflows: "), $.select("p.value1 span.value").text(`${e}${Wn(j)}${n}`), $.select("p.value2").style("display", "flex"), $.select("p.value2 span.label").text("outflows: "), $.select("p.value2 span.value").text(`${e}${Wn(nt)}${n}`), $.select("p.selfValue").style("display", "flex"), $.select("p.selfValue span.label").text("internal: "), $.select("p.selfValue span.value").text(`${e}${Wn(St)}${n}`), fe($, { e: T, svg: S });
|
|
11855
11855
|
}).on("pointermove", (T, tt) => {
|
|
11856
11856
|
fe($, { e: T, svg: S });
|
|
11857
11857
|
}).on("pointerleave", function(T, tt) {
|
|
@@ -12081,23 +12081,23 @@ function b1({
|
|
|
12081
12081
|
//(rangeMax - rangeMin) / binCount
|
|
12082
12082
|
(vt - ut) / 15
|
|
12083
12083
|
);
|
|
12084
|
-
const { mode: Lt, value: qt, compareConsolidate: ie } = n, Gt = Q.valueKey || "",
|
|
12084
|
+
const { mode: Lt, value: qt, compareConsolidate: ie } = n, Gt = Q.valueKey || "", Ft = lf().value((rt) => rt[Gt]).domain(
|
|
12085
12085
|
ie ? [K, ot] : [ut, vt]
|
|
12086
12086
|
);
|
|
12087
|
-
function te(rt,
|
|
12087
|
+
function te(rt, gt, _t) {
|
|
12088
12088
|
if (_t <= 0)
|
|
12089
12089
|
throw new Error("interval must be greater than 0");
|
|
12090
|
-
let
|
|
12091
|
-
|
|
12092
|
-
const
|
|
12093
|
-
for (let Y =
|
|
12094
|
-
|
|
12095
|
-
return
|
|
12090
|
+
let Ht = Math.floor(rt / _t) * _t, xt = Math.ceil(gt / _t) * _t;
|
|
12091
|
+
Ht >= rt && (Ht -= _t), xt <= gt && (xt += _t);
|
|
12092
|
+
const Mt = [];
|
|
12093
|
+
for (let Y = Ht; Y <= xt; Y += _t)
|
|
12094
|
+
Mt.push(Y);
|
|
12095
|
+
return Mt;
|
|
12096
12096
|
}
|
|
12097
12097
|
if (Lt === "arbitrary")
|
|
12098
|
-
|
|
12098
|
+
Ft.thresholds(O.ticks(qt));
|
|
12099
12099
|
else if (Lt === "fixed")
|
|
12100
|
-
|
|
12100
|
+
Ft.thresholds(
|
|
12101
12101
|
Wa(
|
|
12102
12102
|
ut,
|
|
12103
12103
|
//rangeMin
|
|
@@ -12108,9 +12108,9 @@ function b1({
|
|
|
12108
12108
|
);
|
|
12109
12109
|
else if (Lt === "interval") {
|
|
12110
12110
|
const rt = te(ut, vt, qt);
|
|
12111
|
-
|
|
12112
|
-
} else Lt === "custom" ?
|
|
12113
|
-
return
|
|
12111
|
+
Ft.thresholds(rt);
|
|
12112
|
+
} else Lt === "custom" ? Ft.thresholds(qt) : Lt === "algorithm" && (qt === "Freedman-Diaconis" ? Ft.thresholds(cf) : qt === "Scott" ? Ft.thresholds(uf) : qt === "Sturges" && Ft.thresholds(nc));
|
|
12113
|
+
return Ft(Q.data);
|
|
12114
12114
|
}, X = N ? [
|
|
12115
12115
|
Z(pt),
|
|
12116
12116
|
[]
|
|
@@ -12176,7 +12176,7 @@ function b1({
|
|
|
12176
12176
|
},
|
|
12177
12177
|
(Q) => Q.style("color", ze).transition().duration(U).style("opacity", 0).style("top", "53px").remove()
|
|
12178
12178
|
);
|
|
12179
|
-
const j = Math.max(...X[0].map((Q) => Q?.length)), nt = Math.max(...X[1].map((Q) => Q?.length)),
|
|
12179
|
+
const j = Math.max(...X[0].map((Q) => Q?.length)), nt = Math.max(...X[1].map((Q) => Q?.length)), St = Math.max(j, nt), W = N ? Z(pt).filter((Q) => Q.length > 0).sort((Q, Nt) => Nt.length - Q.length).map((Q) => Q.x0 + "-" + Q.x1) : [], q = B.select("#tooltip").style("opacity", 0), Dt = { prefix: s, suffix: o, formatType: l };
|
|
12180
12180
|
function Rt(Q, Nt) {
|
|
12181
12181
|
const ut = !N && e === "compare", vt = N ? t.valueKey ?? 0 : t.data[Nt - 1].valueKey ?? 0, $t = Nt === 1 ? D.select(".layer-1") : D.select(".layer-2");
|
|
12182
12182
|
Nt === 1 ? $t.transition().duration(U).attr(
|
|
@@ -12187,21 +12187,21 @@ function b1({
|
|
|
12187
12187
|
`translate(
|
|
12188
12188
|
0,
|
|
12189
12189
|
${i === "vertical" && ut ? H / 2 : 0})`
|
|
12190
|
-
), E && (a && (Q = Q.filter((rt) => rt.length > 0)), Q.sort((rt,
|
|
12191
|
-
const Lt = me().domain([K, ot]).range(i === "vertical" ? [0, F] : [0, H]), qt = Q.map((rt) => rt.x0 + "-" + rt.x1), ie = Nt === 2 && qt.length === 0 ? W : qt, Gt = Ze().domain(ie).rangeRound(i === "vertical" ? [0, F] : [0, H]),
|
|
12190
|
+
), E && (a && (Q = Q.filter((rt) => rt.length > 0)), Q.sort((rt, gt) => gt.length - rt.length));
|
|
12191
|
+
const Lt = me().domain([K, ot]).range(i === "vertical" ? [0, F] : [0, H]), qt = Q.map((rt) => rt.x0 + "-" + rt.x1), ie = Nt === 2 && qt.length === 0 ? W : qt, Gt = Ze().domain(ie).rangeRound(i === "vertical" ? [0, F] : [0, H]), Ft = me().domain([0, St]).nice();
|
|
12192
12192
|
if (Nt === 1) {
|
|
12193
|
-
|
|
12193
|
+
Ft.range(
|
|
12194
12194
|
i === "vertical" ? [ut ? H / 2 : H, 0] : [0, ut ? F / 2 : F]
|
|
12195
12195
|
).nice();
|
|
12196
|
-
const rt = i === "vertical" && (!I || E) ? N ? J.rotatedAxisText : J.rotatedTopAxisText : J.axisText,
|
|
12197
|
-
i === "vertical" ?
|
|
12196
|
+
const rt = i === "vertical" && (!I || E) ? N ? J.rotatedAxisText : J.rotatedTopAxisText : J.axisText, gt = pa(i === "vertical" ? E ? Gt : Lt : Ft);
|
|
12197
|
+
i === "vertical" ? gt.tickSizeOuter(0).ticks(10) : gt.tickSizeOuter(0).ticks(5, "s").tickSize(-H), $t.select(".x-axis").transition().duration(U).call(gt).attr(
|
|
12198
12198
|
"transform",
|
|
12199
12199
|
"translate(0, 0)"
|
|
12200
12200
|
).style(
|
|
12201
12201
|
"opacity",
|
|
12202
12202
|
i === "horizontal" || !N && E ? 1 : 0
|
|
12203
12203
|
).selectAll("text").attr("class", rt);
|
|
12204
|
-
const _t = i === "vertical" ? _e(
|
|
12204
|
+
const _t = i === "vertical" ? _e(Ft) : hs(E ? Gt : Lt);
|
|
12205
12205
|
i === "vertical" ? _t.ticks(5, "s").tickSize(-F) : _t.tickSizeOuter(0), $t.select(".y-axis").transition().duration(U).attr(
|
|
12206
12206
|
"transform",
|
|
12207
12207
|
`translate(
|
|
@@ -12210,84 +12210,84 @@ function b1({
|
|
|
12210
12210
|
)`
|
|
12211
12211
|
).style("opacity", ut ? 1 : 0).call(_t);
|
|
12212
12212
|
} else {
|
|
12213
|
-
|
|
12213
|
+
Ft.range(
|
|
12214
12214
|
i === "vertical" ? ut ? [0, H / 2] : [H, 0] : ut ? [F / 2, 0] : [0, F]
|
|
12215
12215
|
).nice();
|
|
12216
|
-
const rt = i === "vertical" && (!I || E) ? J.rotatedAxisText : J.axisText,
|
|
12217
|
-
i === "vertical" ?
|
|
12216
|
+
const rt = i === "vertical" && (!I || E) ? J.rotatedAxisText : J.axisText, gt = i === "vertical" ? he(E ? Gt : Lt) : pa(Ft);
|
|
12217
|
+
i === "vertical" ? gt.tickSizeOuter(0).ticks(10) : gt.tickSizeOuter(0).ticks(5, "s").tickSize(H), $t.select(".x-axis").attr(
|
|
12218
12218
|
"transform",
|
|
12219
12219
|
`translate(0, ${i === "vertical" && ut ? H / 2 : H})`
|
|
12220
|
-
).transition().duration(U).call(
|
|
12221
|
-
const _t = _e(i === "vertical" ?
|
|
12220
|
+
).transition().duration(U).call(gt).selectAll("text").attr("class", rt);
|
|
12221
|
+
const _t = _e(i === "vertical" ? Ft : E ? Gt : Lt);
|
|
12222
12222
|
i === "vertical" ? _t.ticks(5, "s").tickSize(-F) : _t.tickSizeOuter(0), $t.select(".y-axis").transition().duration(U).call(_t);
|
|
12223
12223
|
}
|
|
12224
12224
|
const te = (rt) => (Lt(rt.x0) || 0) < Lt(0) ? Nt === 1 ? st.layer1.negative : st.layer2.negative : N ? st.base : Nt === 1 ? st.layer1.positive : st.layer2.positive;
|
|
12225
12225
|
$t.selectAll("rect.bar").data(Q, (rt) => rt.x0 + "-" + rt.x1).join(
|
|
12226
|
-
(rt) => rt.append("rect").attr("class", `bar ${J.bar}`).attr("x", function(
|
|
12227
|
-
return i === "vertical" ? (E ? Gt(
|
|
12228
|
-
}).attr("width", function(
|
|
12229
|
-
return i === "vertical" ? E ? Gt.bandwidth() : Lt(
|
|
12230
|
-
}).style("fill", "#4ade80").style("stroke", "#394447").attr("y", function(
|
|
12231
|
-
return i === "vertical" ?
|
|
12232
|
-
}).attr("height", function(
|
|
12233
|
-
return i === "vertical" ? 0 : E ? Gt.bandwidth() : Lt(
|
|
12226
|
+
(rt) => rt.append("rect").attr("class", `bar ${J.bar}`).attr("x", function(gt) {
|
|
12227
|
+
return i === "vertical" ? (E ? Gt(gt.x0 + "-" + gt.x1) : Lt(gt.x0) || 0) || 0 : Ft(0);
|
|
12228
|
+
}).attr("width", function(gt) {
|
|
12229
|
+
return i === "vertical" ? E ? Gt.bandwidth() : Lt(gt.x1) - Lt(gt.x0) || 0 : 0;
|
|
12230
|
+
}).style("fill", "#4ade80").style("stroke", "#394447").attr("y", function(gt) {
|
|
12231
|
+
return i === "vertical" ? Ft(0) : (E ? Gt(gt.x0 + "-" + gt.x1) : Lt(gt.x0) || 0) || 0;
|
|
12232
|
+
}).attr("height", function(gt) {
|
|
12233
|
+
return i === "vertical" ? 0 : E ? Gt.bandwidth() : Lt(gt.x1) - Lt(gt.x0) || 0;
|
|
12234
12234
|
}),
|
|
12235
12235
|
void 0,
|
|
12236
|
-
(rt) => rt.transition().duration(U).attr("y",
|
|
12237
|
-
).on("pointerenter", function(rt,
|
|
12238
|
-
q.select("p.range span.badge").style("background", te(
|
|
12239
|
-
${ke(
|
|
12236
|
+
(rt) => rt.transition().duration(U).attr("y", Ft(0)).attr("height", 0).style("fill", "#a1a1aa").style("opacity", 0).remove()
|
|
12237
|
+
).on("pointerenter", function(rt, gt) {
|
|
12238
|
+
q.select("p.range span.badge").style("background", te(gt)), q.select("p.range span.label").text(`
|
|
12239
|
+
${ke(gt.x0 ?? 0, Dt)}
|
|
12240
12240
|
<= ${vt} <
|
|
12241
|
-
${ke(
|
|
12241
|
+
${ke(gt.x1 ?? 0, Dt)}
|
|
12242
12242
|
`);
|
|
12243
|
-
const _t =
|
|
12243
|
+
const _t = gt.length;
|
|
12244
12244
|
q.select("p.amount").text(`
|
|
12245
12245
|
${_t}
|
|
12246
12246
|
member${_t > 1 ? "s" : ""}
|
|
12247
|
-
`), q.style("opacity", 1), fe(q, { e: rt, svg: et, yScale:
|
|
12248
|
-
}).on("pointermove", function(rt,
|
|
12249
|
-
fe(q, { e: rt, svg: et, yScale:
|
|
12250
|
-
}).on("pointerleave", function(rt,
|
|
12247
|
+
`), q.style("opacity", 1), fe(q, { e: rt, svg: et, yScale: Ft });
|
|
12248
|
+
}).on("pointermove", function(rt, gt) {
|
|
12249
|
+
fe(q, { e: rt, svg: et, yScale: Ft });
|
|
12250
|
+
}).on("pointerleave", function(rt, gt) {
|
|
12251
12251
|
q.style("opacity", 0);
|
|
12252
|
-
}).on("dblclick", function(rt,
|
|
12253
|
-
const _t = t,
|
|
12254
|
-
_({ valueKey:
|
|
12255
|
-
}).on("touchend", function(rt,
|
|
12252
|
+
}).on("dblclick", function(rt, gt) {
|
|
12253
|
+
const _t = t, Ht = N ? _t.valueKey ?? "" : _t.data[Nt - 1].valueKey ?? "";
|
|
12254
|
+
_({ valueKey: Ht, data: gt });
|
|
12255
|
+
}).on("touchend", function(rt, gt) {
|
|
12256
12256
|
const _t = Date.now();
|
|
12257
12257
|
if (_t - R.current <= 300) {
|
|
12258
|
-
const
|
|
12259
|
-
_({ valueKey:
|
|
12258
|
+
const xt = t, Mt = N ? xt.valueKey ?? "" : xt.data[Nt - 1].valueKey ?? "";
|
|
12259
|
+
_({ valueKey: Mt, data: gt });
|
|
12260
12260
|
}
|
|
12261
12261
|
R.current = _t;
|
|
12262
12262
|
}).transition().duration(U).style("fill", te).attr("x", function(rt) {
|
|
12263
|
-
return i === "vertical" ? (E ? Gt(rt.x0 + "-" + rt.x1) : Lt(rt.x0) || 0) || 0 :
|
|
12263
|
+
return i === "vertical" ? (E ? Gt(rt.x0 + "-" + rt.x1) : Lt(rt.x0) || 0) || 0 : Ft(Nt === 2 && ut ? rt.length : 0);
|
|
12264
12264
|
}).attr("width", function(rt) {
|
|
12265
12265
|
if (i === "vertical") {
|
|
12266
12266
|
if (E)
|
|
12267
12267
|
return Gt.bandwidth();
|
|
12268
12268
|
{
|
|
12269
|
-
const
|
|
12270
|
-
return Lt(
|
|
12269
|
+
const gt = rt.x0, _t = rt.x1, Ht = _t === gt ? gt + 1 : _t;
|
|
12270
|
+
return Lt(Ht) - Lt(gt) || 0;
|
|
12271
12271
|
}
|
|
12272
12272
|
} else
|
|
12273
|
-
return Nt === 2 && ut ? F / 2 -
|
|
12273
|
+
return Nt === 2 && ut ? F / 2 - Ft(rt.length) : Ft(rt.length);
|
|
12274
12274
|
}).attr("y", function(rt) {
|
|
12275
|
-
return i === "vertical" ? Nt === 2 && e === "compare" ?
|
|
12275
|
+
return i === "vertical" ? Nt === 2 && e === "compare" ? Ft(0) : Ft(rt.length) || 0 : (E ? Gt(rt.x0 + "-" + rt.x1) : Lt(rt.x0) || 0) || 0;
|
|
12276
12276
|
}).attr("height", function(rt) {
|
|
12277
12277
|
if (i === "vertical")
|
|
12278
|
-
return Nt === 2 && e === "compare" ?
|
|
12278
|
+
return Nt === 2 && e === "compare" ? Ft(rt.length) : (ut ? H / 2 : H) - Ft(rt.length) || 0;
|
|
12279
12279
|
if (E)
|
|
12280
12280
|
return Gt.bandwidth();
|
|
12281
12281
|
{
|
|
12282
|
-
const
|
|
12283
|
-
return Lt(
|
|
12282
|
+
const gt = rt.x0, _t = rt.x1, Ht = _t === gt ? gt + 1 : _t;
|
|
12283
|
+
return Lt(Ht) - Lt(gt) || 0;
|
|
12284
12284
|
}
|
|
12285
12285
|
});
|
|
12286
12286
|
const se = Nt === 1 ? N ? "#394447" : T ? st.layer1.positive : st.base : st.layer2.positive;
|
|
12287
12287
|
Kv(
|
|
12288
12288
|
$t,
|
|
12289
12289
|
{ binRanges: Lt, binSorted: Gt, isSorted: E },
|
|
12290
|
-
|
|
12290
|
+
Ft,
|
|
12291
12291
|
Q,
|
|
12292
12292
|
S,
|
|
12293
12293
|
i,
|
|
@@ -12633,9 +12633,9 @@ function w1({
|
|
|
12633
12633
|
S(y !== at ? at : "");
|
|
12634
12634
|
});
|
|
12635
12635
|
function T(P) {
|
|
12636
|
-
function at(ht, Ct,
|
|
12637
|
-
Ct === 0 ? ht.group = ht.name : (Ct === 1 && (
|
|
12638
|
-
(Et) => at(Et, Ct + 1,
|
|
12636
|
+
function at(ht, Ct, Tt) {
|
|
12637
|
+
Ct === 0 ? ht.group = ht.name : (Ct === 1 && (Tt = ht.name), ht.group = Tt), ht.children?.forEach(
|
|
12638
|
+
(Et) => at(Et, Ct + 1, Tt)
|
|
12639
12639
|
);
|
|
12640
12640
|
}
|
|
12641
12641
|
return at(P, 0, P.name), P;
|
|
@@ -12644,7 +12644,7 @@ function w1({
|
|
|
12644
12644
|
(M === "network" || M === "hierarchy") && T(tt);
|
|
12645
12645
|
const L = F.select("#tooltip").style("opacity", 0), G = M === "bubble" ? t.tooltipColumns ?? ["label"].concat(Object.keys(t.nodes[0]).map((P) => P)) : ["name", "value"], ft = L.selectAll("p.content").data(G, (P) => P).join("p").attr("class", (P) => `content ${P}`).style("font-weight", 300).style("margin", 1).style("font-size", 300).style("color", "wheat"), st = M === "hierarchy" ? Ar(tt) : tt;
|
|
12646
12646
|
let it = [], k = [], j = [], nt = Yp();
|
|
12647
|
-
function
|
|
12647
|
+
function St(P, at, ht) {
|
|
12648
12648
|
const Ct = t.valueProp, Et = { label: "bubble nodes", children: P.map((Kt) => {
|
|
12649
12649
|
const Ve = Kt[Ct];
|
|
12650
12650
|
return { ...Kt, value: Ve };
|
|
@@ -12665,23 +12665,23 @@ function w1({
|
|
|
12665
12665
|
const { curve: W, directed: q } = N;
|
|
12666
12666
|
if (_.current)
|
|
12667
12667
|
if (M === "hierarchy") {
|
|
12668
|
-
const at = () => (st.sum((
|
|
12668
|
+
const at = () => (st.sum((Tt) => Tt.value ?? 1), Zc().size([A, w]).padding(1)(st));
|
|
12669
12669
|
if (a !== "default") {
|
|
12670
12670
|
if (k = a === "nodes only" ? at().descendants() : at().leaves(), k.forEach((ht) => {
|
|
12671
12671
|
ht.x -= A / 2, ht.y -= w / 2;
|
|
12672
12672
|
}), a === "nodes only") {
|
|
12673
|
-
const ht = Qt(k, function(
|
|
12674
|
-
return
|
|
12673
|
+
const ht = Qt(k, function(Tt) {
|
|
12674
|
+
return Tt.value;
|
|
12675
12675
|
}), Ct = nu().exponent(0.5).range([2, 60]).domain([0, ht ?? 0]);
|
|
12676
|
-
k.forEach((
|
|
12677
|
-
|
|
12676
|
+
k.forEach((Tt) => {
|
|
12677
|
+
Tt.r = Ct(Tt.value);
|
|
12678
12678
|
});
|
|
12679
12679
|
}
|
|
12680
12680
|
} else {
|
|
12681
12681
|
at().descendants();
|
|
12682
|
-
const Ct = Jc().size([2 * Math.PI, H]).separation((
|
|
12683
|
-
Ct.each((
|
|
12684
|
-
|
|
12682
|
+
const Ct = Jc().size([2 * Math.PI, H]).separation((Tt, Et) => (Tt.parent == Et.parent ? 1 : 2) / Tt.depth)(st);
|
|
12683
|
+
Ct.each((Tt) => {
|
|
12684
|
+
Tt.baseX = Tt.x, Tt.baseY = Tt.y, Tt.finalX = Tt.y * Math.cos(Tt.x - Math.PI / 2), Tt.finalY = Tt.y * Math.sin(Tt.x - Math.PI / 2), delete Tt.x, delete Tt.y;
|
|
12685
12685
|
}), k = Ct.descendants(), it = Ct.links();
|
|
12686
12686
|
}
|
|
12687
12687
|
} else if (M === "network") {
|
|
@@ -12691,18 +12691,18 @@ function w1({
|
|
|
12691
12691
|
}
|
|
12692
12692
|
} else {
|
|
12693
12693
|
const P = st.nodes, at = Math.min(A, w);
|
|
12694
|
-
k =
|
|
12694
|
+
k = St(P, at, nt);
|
|
12695
12695
|
}
|
|
12696
12696
|
const Dt = (P) => a === "default" ? P.depth === 0 ? 8 : P.depth === 1 ? 5 : 3 : P.r, Rt = 4, Q = 0.03;
|
|
12697
12697
|
if (_.current) {
|
|
12698
|
-
let P = function(ht, Ct,
|
|
12698
|
+
let P = function(ht, Ct, Tt = 0.2) {
|
|
12699
12699
|
let Et = [];
|
|
12700
12700
|
function Bt(Wt) {
|
|
12701
12701
|
const Zt = Qu(
|
|
12702
12702
|
Et,
|
|
12703
12703
|
(Pt) => at(Pt, Ct),
|
|
12704
12704
|
ht
|
|
12705
|
-
), pe = Wt *
|
|
12705
|
+
), pe = Wt * Tt;
|
|
12706
12706
|
for (const Pt of Et) {
|
|
12707
12707
|
const Jt = ht(Pt), {
|
|
12708
12708
|
x: Ot,
|
|
@@ -12718,13 +12718,13 @@ function w1({
|
|
|
12718
12718
|
Et = Wt;
|
|
12719
12719
|
}, Bt;
|
|
12720
12720
|
}, at = function(ht, Ct) {
|
|
12721
|
-
let
|
|
12721
|
+
let Tt = 0, Et = 0, Bt = 0;
|
|
12722
12722
|
for (const Wt of ht) {
|
|
12723
12723
|
const pe = Ct(Wt) ** 2;
|
|
12724
|
-
|
|
12724
|
+
Tt += (Wt.x ?? 0) * pe, Et += (Wt.y ?? 0) * pe, Bt += pe;
|
|
12725
12725
|
}
|
|
12726
12726
|
return {
|
|
12727
|
-
x: Bt === 0 ? 0 :
|
|
12727
|
+
x: Bt === 0 ? 0 : Tt / Bt,
|
|
12728
12728
|
y: Bt === 0 ? 0 : Et / Bt
|
|
12729
12729
|
};
|
|
12730
12730
|
};
|
|
@@ -12755,14 +12755,14 @@ function w1({
|
|
|
12755
12755
|
};
|
|
12756
12756
|
if (a === "nodes only") {
|
|
12757
12757
|
let Ct = function(Et) {
|
|
12758
|
-
return -Math.pow(Et.r, 2) *
|
|
12758
|
+
return -Math.pow(Et.r, 2) * Tt;
|
|
12759
12759
|
};
|
|
12760
|
-
const
|
|
12760
|
+
const Tt = 0.03;
|
|
12761
12761
|
nt.velocityDecay(0.2).force("x", Mn().strength(0.03).x(0)).force("y", Nn().strength(0.03).y(0)).force("charge", Pr().strength((Et) => Ct(Et))).alpha(1).alphaTarget(0);
|
|
12762
12762
|
} else {
|
|
12763
12763
|
const Ct = P(
|
|
12764
|
-
(
|
|
12765
|
-
(
|
|
12764
|
+
(Tt) => Tt.data.group ?? "",
|
|
12765
|
+
(Tt) => Tt.r,
|
|
12766
12766
|
0.2
|
|
12767
12767
|
);
|
|
12768
12768
|
nt.force("x", Mn(0).strength(0.01)).force("y", Nn(0).strength(0.01)).force("cluster", Ct).force("collide", ht()).alpha(1).alphaTarget(0);
|
|
@@ -12797,20 +12797,20 @@ function w1({
|
|
|
12797
12797
|
//.x(0).y(0)
|
|
12798
12798
|
).alpha(1).alphaTarget(0);
|
|
12799
12799
|
else if (M === "bubble") {
|
|
12800
|
-
let ht = function(
|
|
12801
|
-
return -Math.pow(
|
|
12800
|
+
let ht = function(Tt) {
|
|
12801
|
+
return -Math.pow(Tt.r ?? 0, 2) * Q;
|
|
12802
12802
|
};
|
|
12803
12803
|
nt.velocityDecay(0.2).force("x", Mn().strength(Q).x(0)).force("y", Nn().strength(Q).y(0));
|
|
12804
12804
|
const { clusterByGroup: Ct } = t;
|
|
12805
12805
|
if (!Ct)
|
|
12806
12806
|
nt.force("charge", Pr().strength(ht));
|
|
12807
12807
|
else {
|
|
12808
|
-
const
|
|
12808
|
+
const Tt = P(
|
|
12809
12809
|
(Et) => String(Et[t.groupBy]),
|
|
12810
12810
|
(Et) => Et.r ?? 0,
|
|
12811
12811
|
0.2
|
|
12812
12812
|
);
|
|
12813
|
-
nt.force("cluster",
|
|
12813
|
+
nt.force("cluster", Tt).force("collide", jr().radius((Et) => Et.r ?? 2).iterations(3));
|
|
12814
12814
|
}
|
|
12815
12815
|
}
|
|
12816
12816
|
z.current = nt;
|
|
@@ -12826,7 +12826,7 @@ function w1({
|
|
|
12826
12826
|
if (!Et.length) return 0;
|
|
12827
12827
|
const Bt = Et.reduce((Pt, Jt) => Pt + Math.PI * Jt * Jt, 0), Wt = Math.PI / (3 + 2 * Math.SQRT2), Zt = Math.sqrt(Bt / Wt), pe = 2 * Math.max(...Et);
|
|
12828
12828
|
return Math.max(Zt, pe);
|
|
12829
|
-
},
|
|
12829
|
+
}, Tt = function(Et, Bt = 0) {
|
|
12830
12830
|
if (!Et || Et.length === 0) return 0;
|
|
12831
12831
|
const Wt = [...Et].sort((Xe, Ie) => Ie - Xe), Zt = Wt.reduce((Xe, Ie) => Xe + Math.PI * Math.pow(Ie + Bt / 2, 2), 0);
|
|
12832
12832
|
let pe = Math.max(
|
|
@@ -12842,19 +12842,19 @@ function w1({
|
|
|
12842
12842
|
};
|
|
12843
12843
|
if (y !== "") {
|
|
12844
12844
|
const Et = t.groupBy ?? "", Bt = k.filter((ve) => ve[Et] === y), Wt = Bt.map((ve) => ve.r), Zt = Ct(Wt) + 20;
|
|
12845
|
-
|
|
12845
|
+
Tt(Wt, 1) + 20;
|
|
12846
12846
|
const pe = Bt.map((ve) => {
|
|
12847
12847
|
const { value: ln, r: ha, x: Qn, y: Ye, sortedX: Pn, sortedY: Rn, vx: tr, vy: cn, ...Sr } = ve;
|
|
12848
12848
|
return { ...Sr };
|
|
12849
|
-
}), Pt =
|
|
12849
|
+
}), Pt = St(
|
|
12850
12850
|
pe,
|
|
12851
12851
|
Zt
|
|
12852
12852
|
), Jt = k.filter((ve) => ve[Et] !== y), Ot = Jt.map((ve) => ve.r), Kt = Ct(Ot) + 30;
|
|
12853
|
-
|
|
12853
|
+
Tt(Ot, 1) + 20;
|
|
12854
12854
|
const Ve = Jt.map((ve) => {
|
|
12855
12855
|
const { value: ln, r: ha, x: Qn, y: Ye, sortedX: Pn, sortedY: Rn, vx: tr, vy: cn, ...Sr } = ve;
|
|
12856
12856
|
return { ...Sr };
|
|
12857
|
-
}), Xe =
|
|
12857
|
+
}), Xe = St(
|
|
12858
12858
|
Ve,
|
|
12859
12859
|
Kt
|
|
12860
12860
|
), Ie = (ve) => {
|
|
@@ -12894,8 +12894,8 @@ function w1({
|
|
|
12894
12894
|
const Ct = P.nodes.filter((Pt) => M === "hierarchy" ? Pt.data.name === n : M === "network" ? Pt.id === n : void 0);
|
|
12895
12895
|
if (!Ct || Ct.length === 0)
|
|
12896
12896
|
return "no source node";
|
|
12897
|
-
const
|
|
12898
|
-
if (!
|
|
12897
|
+
const Tt = P.nodes.filter((Pt) => M === "hierarchy" ? Pt.data.name === r : M === "network" ? Pt.id === r : void 0);
|
|
12898
|
+
if (!Tt || Tt.length === 0)
|
|
12899
12899
|
return "no target node";
|
|
12900
12900
|
const Et = /* @__PURE__ */ new Map(), Bt = /* @__PURE__ */ new Map(), Wt = /* @__PURE__ */ new Set(), Zt = /* @__PURE__ */ new Map();
|
|
12901
12901
|
for (const Pt of P.nodes) {
|
|
@@ -12945,16 +12945,16 @@ function w1({
|
|
|
12945
12945
|
r
|
|
12946
12946
|
), $t = typeof vt == "string", Lt = wr(j, Gr), qt = "#999";
|
|
12947
12947
|
et.selectAll("marker").data(j, (P) => typeof P == "string" ? P : "").join("marker").attr("id", (P) => `arrow-${P}`).attr("viewBox", "0 -5 10 10").attr("refX", 15).attr("refY", -0.5).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("fill", (P) => P === "arrow" ? qt : Lt(P ?? "")).attr("d", "M0,-5L10,0L0,5");
|
|
12948
|
-
const { distances: ie, previous: Gt, path:
|
|
12949
|
-
if (Array.isArray(
|
|
12948
|
+
const { distances: ie, previous: Gt, path: Ft } = vt, te = (P) => {
|
|
12949
|
+
if (Array.isArray(Ft)) {
|
|
12950
12950
|
const at = M === "network" ? P.source.id : P.source.data.name, ht = M === "network" ? P.target.id : P.target.data.name;
|
|
12951
12951
|
let Ct = !1;
|
|
12952
|
-
for (let
|
|
12953
|
-
if (at ===
|
|
12952
|
+
for (let Tt = 0; Tt < Ft.length - 1; Tt++) {
|
|
12953
|
+
if (at === Ft[Tt] && ht === Ft[Tt + 1]) {
|
|
12954
12954
|
Ct = !0;
|
|
12955
12955
|
break;
|
|
12956
12956
|
}
|
|
12957
|
-
if (ht ===
|
|
12957
|
+
if (ht === Ft[Tt] && at === Ft[Tt + 1]) {
|
|
12958
12958
|
Ct = !0;
|
|
12959
12959
|
break;
|
|
12960
12960
|
}
|
|
@@ -12962,7 +12962,7 @@ function w1({
|
|
|
12962
12962
|
return Ct;
|
|
12963
12963
|
}
|
|
12964
12964
|
return !1;
|
|
12965
|
-
}, se = 0.25, rt = (P) => $t || te(P) ? 1 : se,
|
|
12965
|
+
}, se = 0.25, rt = (P) => $t || te(P) ? 1 : se, gt = (P) => $t || te(P) ? "auto" : "none", _t = (P) => ($t ? q : q && te(P)) ? P.type ? `url(#arrow-${P.type})` : "url(#arrow-arrow)" : "", Ht = dt.selectAll("path.link").data(
|
|
12966
12966
|
it,
|
|
12967
12967
|
function(P, at) {
|
|
12968
12968
|
if (M === "hierarchy") {
|
|
@@ -12978,24 +12978,24 @@ function w1({
|
|
|
12978
12978
|
(P) => P.append("path").attr("class", "link").attr("fill", "none").attr("stroke-width", 1.5).attr(
|
|
12979
12979
|
"stroke",
|
|
12980
12980
|
(at) => at.type ? Z(at.type) : qt
|
|
12981
|
-
).style("pointer-events",
|
|
12981
|
+
).style("pointer-events", gt).attr("marker-end", _t).attr("stroke-opacity", rt),
|
|
12982
12982
|
void 0,
|
|
12983
12983
|
(P) => P.remove()
|
|
12984
12984
|
).attr(
|
|
12985
12985
|
"stroke",
|
|
12986
12986
|
(P) => P.type ? Z(P.type) : qt
|
|
12987
|
-
).attr("marker-end", _t).attr("stroke-opacity", rt).style("pointer-events",
|
|
12988
|
-
function
|
|
12989
|
-
const at = An(P.source), ht = jn(P.source), Ct = An(P.target),
|
|
12987
|
+
).attr("marker-end", _t).attr("stroke-opacity", rt).style("pointer-events", gt);
|
|
12988
|
+
function xt(P) {
|
|
12989
|
+
const at = An(P.source), ht = jn(P.source), Ct = An(P.target), Tt = jn(P.target);
|
|
12990
12990
|
if (W === "straight")
|
|
12991
|
-
return `M${at},${ht} L${Ct},${
|
|
12992
|
-
const Et = Math.hypot(Ct - at,
|
|
12991
|
+
return `M${at},${ht} L${Ct},${Tt}`;
|
|
12992
|
+
const Et = Math.hypot(Ct - at, Tt - ht);
|
|
12993
12993
|
return `
|
|
12994
12994
|
M${at},${ht}
|
|
12995
|
-
A${Et},${Et} 0 0,1 ${Ct},${
|
|
12995
|
+
A${Et},${Et} 0 0,1 ${Ct},${Tt}
|
|
12996
12996
|
`;
|
|
12997
12997
|
}
|
|
12998
|
-
const
|
|
12998
|
+
const Mt = (P) => {
|
|
12999
12999
|
if (typeof vt == "string")
|
|
13000
13000
|
return "no path to highlight";
|
|
13001
13001
|
const { path: at } = vt;
|
|
@@ -13008,7 +13008,7 @@ function w1({
|
|
|
13008
13008
|
function mt(P, at) {
|
|
13009
13009
|
return M === "hierarchy" ? P.data?.name ?? "" : M === "network" ? P.id : at;
|
|
13010
13010
|
}
|
|
13011
|
-
const
|
|
13011
|
+
const At = (P) => {
|
|
13012
13012
|
if (M === "hierarchy") {
|
|
13013
13013
|
const at = P;
|
|
13014
13014
|
if (at.data.color)
|
|
@@ -13023,49 +13023,49 @@ function w1({
|
|
|
13023
13023
|
return Z(at);
|
|
13024
13024
|
}
|
|
13025
13025
|
return "steelblue";
|
|
13026
|
-
}, jt = (P) => M === "hierarchy" ? P.children ? "none" : "#fff" : Ya(
|
|
13027
|
-
const at =
|
|
13026
|
+
}, jt = (P) => M === "hierarchy" ? P.children ? "none" : "#fff" : Ya(At(P)).darker().toString(), ee = 0.5, re = (P) => {
|
|
13027
|
+
const at = Mt(P);
|
|
13028
13028
|
return at === "no path to highlight" ? 1 : at === "not path member" ? ee : 1;
|
|
13029
13029
|
}, lt = (P) => {
|
|
13030
|
-
const at =
|
|
13030
|
+
const at = Mt(P);
|
|
13031
13031
|
return at === "no path to highlight" ? "auto" : at === "not path member" ? "none" : "auto";
|
|
13032
|
-
},
|
|
13032
|
+
}, yt = dt.selectAll("circle.node").data(k, mt).join(
|
|
13033
13033
|
(P) => P.append("circle").attr("class", "node").attr(
|
|
13034
13034
|
"stroke",
|
|
13035
13035
|
(at) => M === "hierarchy" ? at.children ? null : "#fff" : "none"
|
|
13036
|
-
).attr("r", Y).attr("fill",
|
|
13036
|
+
).attr("r", Y).attr("fill", At).style("opacity", re).style("pointer-events", lt),
|
|
13037
13037
|
void 0,
|
|
13038
13038
|
(P) => P.remove()
|
|
13039
|
-
).attr("stroke", jt).attr("r", Y).attr("fill",
|
|
13040
|
-
M === "hierarchy" && a !== "default" &&
|
|
13039
|
+
).attr("stroke", jt).attr("r", Y).attr("fill", At).style("opacity", re).style("pointer-events", lt);
|
|
13040
|
+
M === "hierarchy" && a !== "default" && yt.transition().delay((P, at) => Math.random() * 500).duration(750).attrTween("r", (P) => {
|
|
13041
13041
|
const at = Ae(0, P.r);
|
|
13042
13042
|
return (Ct) => `${at(Ct)}`;
|
|
13043
13043
|
});
|
|
13044
|
-
const kt = 6,
|
|
13045
|
-
|
|
13044
|
+
const kt = 6, It = 12, le = 10, Ut = "black";
|
|
13045
|
+
yt.on("pointerenter", function(P, at) {
|
|
13046
13046
|
if (ne(this).style("stroke", Ut), (M === "hierarchy" || M === "bubble") && L.transition().duration(250).style("opacity", 1), M === "network" && $t) {
|
|
13047
|
-
const Ct =
|
|
13048
|
-
|
|
13047
|
+
const Ct = Ht.filter((Wt) => Wt.source.id === at.id).data().map((Wt) => Wt.target.id), Et = Ht.filter((Wt) => Wt.target.id === at.id).data().map((Wt) => Wt.source.id);
|
|
13048
|
+
Ht.filter(
|
|
13049
13049
|
(Wt) => Wt.source.id !== at.id && Wt.target.id !== at.id
|
|
13050
13050
|
).style("opacity", se);
|
|
13051
13051
|
const Bt = [...Et, ...Ct];
|
|
13052
|
-
oe.filter((Wt) => Wt.id !== at.id && !Bt.includes(Wt.id)).style("opacity", 0),
|
|
13052
|
+
oe.filter((Wt) => Wt.id !== at.id && !Bt.includes(Wt.id)).style("opacity", 0), yt.filter((Wt) => Wt.id !== at.id && !Bt.includes(Wt.id)).style("opacity", ee), oe.filter((Wt) => Wt.id === at.id).style("font-size", It), oe.filter((Wt) => Bt.includes(Wt.id)).style("font-size", le);
|
|
13053
13053
|
} else if (M === "hierarchy") {
|
|
13054
|
-
const ht = ft.filter((
|
|
13054
|
+
const ht = ft.filter((Tt) => Tt === "name").node();
|
|
13055
13055
|
ne(ht).text(`${at.data.name}`);
|
|
13056
|
-
const Ct = ft.filter((
|
|
13056
|
+
const Ct = ft.filter((Tt) => Tt === "value").node();
|
|
13057
13057
|
ne(Ct).text(`${Ee(at.value)}`);
|
|
13058
13058
|
} else if (M === "bubble")
|
|
13059
13059
|
for (const ht of G) {
|
|
13060
|
-
const Ct = ft.filter((Wt) => Wt === ht).node(),
|
|
13060
|
+
const Ct = ft.filter((Wt) => Wt === ht).node(), Tt = at[ht], Et = typeof Tt == "number" ? Tt.toLocaleString() : Tt, Bt = ht === "label" ? Et.toUpperCase() : `${ht}: ${Et}`;
|
|
13061
13061
|
ne(Ct).text(`${Bt}`);
|
|
13062
13062
|
}
|
|
13063
13063
|
}).on("pointermove", function(P, at) {
|
|
13064
13064
|
fe(L, { e: P, svg: D });
|
|
13065
13065
|
}).on("pointerleave", function(P, at) {
|
|
13066
13066
|
const ht = jt(at);
|
|
13067
|
-
ne(this).style("stroke", ht), L.transition().duration(250).style("opacity", 0), M === "network" && $t && (
|
|
13068
|
-
}),
|
|
13067
|
+
ne(this).style("stroke", ht), L.transition().duration(250).style("opacity", 0), M === "network" && $t && (Ht.style("opacity", rt), yt.style("opacity", re), oe.style("opacity", we).style("font-size", on));
|
|
13068
|
+
}), Ht.on("pointerenter", function(P, at) {
|
|
13069
13069
|
if (ne(this).style(
|
|
13070
13070
|
"stroke",
|
|
13071
13071
|
at.type ? Ge(Z(at.type))?.darker().toString() ?? Ut : Ut
|
|
@@ -13073,8 +13073,8 @@ function w1({
|
|
|
13073
13073
|
L.transition().duration(250).style("opacity", 1);
|
|
13074
13074
|
const ht = at.source.id, Ct = at.target.id;
|
|
13075
13075
|
$t && (oe.filter((Zt) => Zt.id !== ht && Zt.id !== Ct).style("opacity", 0), oe.filter((Zt) => Zt.id === ht || Zt.id === Ct).style("font-size", le)), L.transition().duration(250).style("opacity", 1);
|
|
13076
|
-
const
|
|
13077
|
-
ne(
|
|
13076
|
+
const Tt = ft.filter((Zt) => Zt === "name").node();
|
|
13077
|
+
ne(Tt).text(`${ht} ⟶ ${Ct}`);
|
|
13078
13078
|
const Et = ft.filter((Zt) => Zt === "value").node(), Bt = at.value, Wt = typeof Bt == "number" ? Ee(Bt) : "---";
|
|
13079
13079
|
ne(Et).text(`${Wt}`), fe(L, { e: P, svg: D });
|
|
13080
13080
|
}
|
|
@@ -13090,11 +13090,11 @@ function w1({
|
|
|
13090
13090
|
const at = Y(P);
|
|
13091
13091
|
if (Nt)
|
|
13092
13092
|
return at < 15 ? 0 : 1;
|
|
13093
|
-
const ht =
|
|
13093
|
+
const ht = Mt(P);
|
|
13094
13094
|
return ht === "no path to highlight" || ht === "source or destination" || ht === "path" ? 1 : 0.25;
|
|
13095
13095
|
}, on = (P) => {
|
|
13096
|
-
const at =
|
|
13097
|
-
return at === "no path to highlight" ? kt : at === "source or destination" ?
|
|
13096
|
+
const at = Mt(P);
|
|
13097
|
+
return at === "no path to highlight" ? kt : at === "source or destination" ? It : at === "path" ? le : kt;
|
|
13098
13098
|
}, Ai = e ? [] : k, oe = dt.selectAll("text.label").data(Ai, mt).join(
|
|
13099
13099
|
(P) => P.append("text").attr("class", "label").attr("stroke-linejoin", "round").attr("stroke-width", 3).attr("dy", "0.31em").attr("paint-order", "stroke").attr("stroke", "white").attr("fill", "currentColor").style("font-size", on).style("pointer-events", "none").text(
|
|
13100
13100
|
(at) => M === "hierarchy" ? at.data.name : M === "network" ? at.id : at.label
|
|
@@ -13104,17 +13104,17 @@ function w1({
|
|
|
13104
13104
|
).style("opacity", we).style("font-size", on).text(
|
|
13105
13105
|
(P) => M === "hierarchy" ? P.data.name : M === "network" ? P.id : P.label
|
|
13106
13106
|
);
|
|
13107
|
-
M === "hierarchy" ? oe.attr("text-anchor", (P) => P.baseX < Math.PI == !P.children ? "start" : "end") : (M === "network" || M === "bubble") && oe.attr("text-anchor", "middle"),
|
|
13108
|
-
|
|
13107
|
+
M === "hierarchy" ? oe.attr("text-anchor", (P) => P.baseX < Math.PI == !P.children ? "start" : "end") : (M === "network" || M === "bubble") && oe.attr("text-anchor", "middle"), yt.raise(), oe.raise(), nt.on("tick", () => {
|
|
13108
|
+
Ht.attr("d", (P) => xt(P)), yt.attr("cx", An).attr("cy", jn), oe.attr("transform", (P) => {
|
|
13109
13109
|
if (M !== "hierarchy" || a !== "default")
|
|
13110
13110
|
return "";
|
|
13111
13111
|
const at = P;
|
|
13112
13112
|
if (at.depth === 0)
|
|
13113
13113
|
return "";
|
|
13114
|
-
const ht = P.x ?? 0, Ct = P.y ?? 0,
|
|
13115
|
-
if (!zn(ht) || !zn(Ct) || !zn(
|
|
13114
|
+
const ht = P.x ?? 0, Ct = P.y ?? 0, Tt = at.baseX ?? 0;
|
|
13115
|
+
if (!zn(ht) || !zn(Ct) || !zn(Tt))
|
|
13116
13116
|
return "";
|
|
13117
|
-
const Et =
|
|
13117
|
+
const Et = Tt * 180 / Math.PI - 90, Bt = Tt >= Math.PI ? 180 : 0;
|
|
13118
13118
|
return `rotate(${Et + Bt}, ${ht}, ${Ct})`;
|
|
13119
13119
|
}).attr("x", (P) => {
|
|
13120
13120
|
const at = M === "hierarchy" && a === "default" ? P.baseX < Math.PI == !P.children ? 6 : -6 : 0, ht = An(P);
|
|
@@ -13125,13 +13125,13 @@ function w1({
|
|
|
13125
13125
|
});
|
|
13126
13126
|
});
|
|
13127
13127
|
const An = (P) => {
|
|
13128
|
-
const at = zn(P.x) ? P.x : 0, ht = Y(P), Ct = -A / 2 + ht,
|
|
13129
|
-
return Math.min(Math.max(at, Ct),
|
|
13128
|
+
const at = zn(P.x) ? P.x : 0, ht = Y(P), Ct = -A / 2 + ht, Tt = A / 2 - ht;
|
|
13129
|
+
return Math.min(Math.max(at, Ct), Tt);
|
|
13130
13130
|
}, jn = (P) => {
|
|
13131
|
-
const at = zn(P.y) ? P.y : 0, ht = Y(P), Ct = -w / 2 + ht,
|
|
13132
|
-
return Math.min(Math.max(at, Ct),
|
|
13131
|
+
const at = zn(P.y) ? P.y : 0, ht = Y(P), Ct = -w / 2 + ht, Tt = w / 2 - ht;
|
|
13132
|
+
return Math.min(Math.max(at, Ct), Tt);
|
|
13133
13133
|
}, fa = sd().on("start", Mr).on("drag", Nr).on("end", ct);
|
|
13134
|
-
|
|
13134
|
+
yt.call(fa);
|
|
13135
13135
|
function Mr(P, at) {
|
|
13136
13136
|
P.active || (M === "bubble" && p && nt.force(
|
|
13137
13137
|
"collide",
|