@dpuse/dpuse-tool-d3-visualiser 0.0.18
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/LICENSE +21 -0
- package/README.md +419 -0
- package/dist/axis-B7xlWKkC.js +1621 -0
- package/dist/axis-B7xlWKkC.js.map +1 -0
- package/dist/billboardJs-BTW-G9h0.js +7313 -0
- package/dist/billboardJs-BTW-G9h0.js.map +1 -0
- package/dist/bump-znhpCF6A.js +75 -0
- package/dist/bump-znhpCF6A.js.map +1 -0
- package/dist/dpuse-tool-d3-visualiser.css +11 -0
- package/dist/dpuse-tool-d3-visualiser.es.js +68 -0
- package/dist/dpuse-tool-d3-visualiser.es.js.map +1 -0
- package/dist/drag-B46QGUMq.js +173 -0
- package/dist/drag-B46QGUMq.js.map +1 -0
- package/dist/erdDiagram-b-qDkEhY.js +1934 -0
- package/dist/erdDiagram-b-qDkEhY.js.map +1 -0
- package/dist/linear-J4iYa1Bf.js +34 -0
- package/dist/linear-J4iYa1Bf.js.map +1 -0
- package/dist/link-Dti9fi9g.js +33 -0
- package/dist/link-Dti9fi9g.js.map +1 -0
- package/dist/networkDiagram-QWVy8iRy.js +493 -0
- package/dist/networkDiagram-QWVy8iRy.js.map +1 -0
- package/dist/observablePlot-D7o8-dnK.js +7008 -0
- package/dist/observablePlot-D7o8-dnK.js.map +1 -0
- package/dist/path-Bt1sPr2f.js +65 -0
- package/dist/path-Bt1sPr2f.js.map +1 -0
- package/dist/sankeyDiagram-Dgf87Zt4.js +360 -0
- package/dist/sankeyDiagram-Dgf87Zt4.js.map +1 -0
- package/dist/select-BIuoFcZG.js +649 -0
- package/dist/select-BIuoFcZG.js.map +1 -0
- package/dist/src-B7SGbtRQ.js +332 -0
- package/dist/src-B7SGbtRQ.js.map +1 -0
- package/dist/src-DnMaAyIP.js +1194 -0
- package/dist/src-DnMaAyIP.js.map +1 -0
- package/dist/sum-BAZU479z.js +36 -0
- package/dist/sum-BAZU479z.js.map +1 -0
- package/dist/treeDiagram-BJ_QF4os.js +277 -0
- package/dist/treeDiagram-BJ_QF4os.js.map +1 -0
- package/dist/types/eslint.config.d.ts +3 -0
- package/dist/types/src/billboardJs.d.ts +15 -0
- package/dist/types/src/erdDiagram.d.ts +29 -0
- package/dist/types/src/index.d.ts +33 -0
- package/dist/types/src/networkDiagram.d.ts +22 -0
- package/dist/types/src/observablePlot.d.ts +8 -0
- package/dist/types/src/palette.d.ts +15 -0
- package/dist/types/src/sankeyDiagram.d.ts +24 -0
- package/dist/types/src/treeDiagram.d.ts +22 -0
- package/dist/types/tests/billboardJs.test.d.ts +1 -0
- package/dist/types/tests/erdDiagram.test.d.ts +1 -0
- package/dist/types/tests/importIndex.test.d.ts +1 -0
- package/dist/types/tests/networkDiagram.test.d.ts +1 -0
- package/dist/types/tests/observablePlot.test.d.ts +1 -0
- package/dist/types/tests/sankeyDiagram.test.d.ts +1 -0
- package/dist/types/tests/treeDiagram.test.d.ts +1 -0
- package/dist/types/vite.config.d.ts +2 -0
- package/dist/types/vitest.config.d.ts +2 -0
- package/package.json +97 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region node_modules/d3-path/src/path.js
|
|
2
|
+
var e = Math.PI, t = 2 * e, n = 1e-6, r = t - n;
|
|
3
|
+
function i(e) {
|
|
4
|
+
this._ += e[0];
|
|
5
|
+
for (let t = 1, n = e.length; t < n; ++t) this._ += arguments[t] + e[t];
|
|
6
|
+
}
|
|
7
|
+
function a(e) {
|
|
8
|
+
let t = Math.floor(e);
|
|
9
|
+
if (!(t >= 0)) throw Error(`invalid digits: ${e}`);
|
|
10
|
+
if (t > 15) return i;
|
|
11
|
+
let n = 10 ** t;
|
|
12
|
+
return function(e) {
|
|
13
|
+
this._ += e[0];
|
|
14
|
+
for (let t = 1, r = e.length; t < r; ++t) this._ += Math.round(arguments[t] * n) / n + e[t];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
var o = class {
|
|
18
|
+
constructor(e) {
|
|
19
|
+
this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "", this._append = e == null ? i : a(e);
|
|
20
|
+
}
|
|
21
|
+
moveTo(e, t) {
|
|
22
|
+
this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}`;
|
|
23
|
+
}
|
|
24
|
+
closePath() {
|
|
25
|
+
this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
|
|
26
|
+
}
|
|
27
|
+
lineTo(e, t) {
|
|
28
|
+
this._append`L${this._x1 = +e},${this._y1 = +t}`;
|
|
29
|
+
}
|
|
30
|
+
quadraticCurveTo(e, t, n, r) {
|
|
31
|
+
this._append`Q${+e},${+t},${this._x1 = +n},${this._y1 = +r}`;
|
|
32
|
+
}
|
|
33
|
+
bezierCurveTo(e, t, n, r, i, a) {
|
|
34
|
+
this._append`C${+e},${+t},${+n},${+r},${this._x1 = +i},${this._y1 = +a}`;
|
|
35
|
+
}
|
|
36
|
+
arcTo(t, r, i, a, o) {
|
|
37
|
+
if (t = +t, r = +r, i = +i, a = +a, o = +o, o < 0) throw Error(`negative radius: ${o}`);
|
|
38
|
+
let s = this._x1, c = this._y1, l = i - t, u = a - r, d = s - t, f = c - r, p = d * d + f * f;
|
|
39
|
+
if (this._x1 === null) this._append`M${this._x1 = t},${this._y1 = r}`;
|
|
40
|
+
else if (p > n) if (!(Math.abs(f * l - u * d) > n) || !o) this._append`L${this._x1 = t},${this._y1 = r}`;
|
|
41
|
+
else {
|
|
42
|
+
let m = i - s, h = a - c, g = l * l + u * u, _ = m * m + h * h, v = Math.sqrt(g), y = Math.sqrt(p), b = o * Math.tan((e - Math.acos((g + p - _) / (2 * v * y))) / 2), x = b / y, S = b / v;
|
|
43
|
+
Math.abs(x - 1) > n && this._append`L${t + x * d},${r + x * f}`, this._append`A${o},${o},0,0,${+(f * m > d * h)},${this._x1 = t + S * l},${this._y1 = r + S * u}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
arc(i, a, o, s, c, l) {
|
|
47
|
+
if (i = +i, a = +a, o = +o, l = !!l, o < 0) throw Error(`negative radius: ${o}`);
|
|
48
|
+
let u = o * Math.cos(s), d = o * Math.sin(s), f = i + u, p = a + d, m = 1 ^ l, h = l ? s - c : c - s;
|
|
49
|
+
this._x1 === null ? this._append`M${f},${p}` : (Math.abs(this._x1 - f) > n || Math.abs(this._y1 - p) > n) && this._append`L${f},${p}`, o && (h < 0 && (h = h % t + t), h > r ? this._append`A${o},${o},0,1,${m},${i - u},${a - d}A${o},${o},0,1,${m},${this._x1 = f},${this._y1 = p}` : h > n && this._append`A${o},${o},0,${+(h >= e)},${m},${this._x1 = i + o * Math.cos(c)},${this._y1 = a + o * Math.sin(c)}`);
|
|
50
|
+
}
|
|
51
|
+
rect(e, t, n, r) {
|
|
52
|
+
this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${n = +n}v${+r}h${-n}Z`;
|
|
53
|
+
}
|
|
54
|
+
toString() {
|
|
55
|
+
return this._;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
o.prototype;
|
|
59
|
+
function s(e = 3) {
|
|
60
|
+
return new o(+e);
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { s as n, o as t };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=path-Bt1sPr2f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-Bt1sPr2f.js","names":[],"sources":["../node_modules/d3-path/src/path.js"],"sourcesContent":["const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAM,IAAK,KAAK,IACZ,IAAM,IAAI,GACV,IAAU,MACV,IAAa,IAAM;AAEvB,SAAS,EAAO,GAAS;CACvB,KAAK,KAAK,EAAQ;CAClB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,IAAI,GAAG,EAAE,GAC3C,KAAK,KAAK,UAAU,KAAK,EAAQ;AAErC;AAEA,SAAS,EAAY,GAAQ;CAC3B,IAAI,IAAI,KAAK,MAAM,CAAM;CACzB,IAAI,EAAE,KAAK,IAAI,MAAU,MAAM,mBAAmB,GAAQ;CAC1D,IAAI,IAAI,IAAI,OAAO;CACnB,IAAM,IAAI,MAAM;CAChB,OAAO,SAAS,GAAS;EACvB,KAAK,KAAK,EAAQ;EAClB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,IAAI,GAAG,EAAE,GAC3C,KAAK,KAAK,KAAK,MAAM,UAAU,KAAK,CAAC,IAAI,IAAI,EAAQ;CAEzD;AACF;AAEA,IAAa,IAAb,MAAkB;CAChB,YAAY,GAAQ;EAIlB,AAHA,KAAK,MAAM,KAAK,MAChB,KAAK,MAAM,KAAK,MAAM,MACtB,KAAK,IAAI,IACT,KAAK,UAAU,KAAU,OAAO,IAAS,EAAY,CAAM;CAC7D;CACA,OAAO,GAAG,GAAG;EACX,KAAK,OAAO,IAAI,KAAK,MAAM,KAAK,MAAM,CAAC,EAAE,GAAG,KAAK,MAAM,KAAK,MAAM,CAAC;CACrE;CACA,YAAY;EACV,AAAI,KAAK,QAAQ,SACf,KAAK,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,KACrC,KAAK,OAAO;CAEhB;CACA,OAAO,GAAG,GAAG;EACX,KAAK,OAAO,IAAI,KAAK,MAAM,CA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H;CACA,KAAK,GAAG,GAAG,GAAG,GAAG;EACf,KAAK,OAAO,IAAI,KAAK,MAAM,KAAK,MAAM,CAAC,EAAE,GAAG,KAAK,MAAM,KAAK,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE;CAC7F;CACA,WAAW;EACT,OAAO,KAAK;CACd;AACF;AAOiB,EAAK;AAEtB,SAAgB,EAAU,IAAS,GAAG;CACpC,OAAO,IAAI,EAAK,CAAC,CAAM;AACzB"}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { t as e } from "./select-BIuoFcZG.js";
|
|
2
|
+
import { n as t, r as n, t as r } from "./sum-BAZU479z.js";
|
|
3
|
+
import { t as i } from "./link-Dti9fi9g.js";
|
|
4
|
+
//#region node_modules/d3-sankey/src/align.js
|
|
5
|
+
function a(e, t) {
|
|
6
|
+
return e.sourceLinks.length ? e.depth : t - 1;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region node_modules/d3-sankey/src/constant.js
|
|
10
|
+
function o(e) {
|
|
11
|
+
return function() {
|
|
12
|
+
return e;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region node_modules/d3-sankey/src/sankey.js
|
|
17
|
+
function s(e, t) {
|
|
18
|
+
return l(e.source, t.source) || e.index - t.index;
|
|
19
|
+
}
|
|
20
|
+
function c(e, t) {
|
|
21
|
+
return l(e.target, t.target) || e.index - t.index;
|
|
22
|
+
}
|
|
23
|
+
function l(e, t) {
|
|
24
|
+
return e.y0 - t.y0;
|
|
25
|
+
}
|
|
26
|
+
function u(e) {
|
|
27
|
+
return e.value;
|
|
28
|
+
}
|
|
29
|
+
function d(e) {
|
|
30
|
+
return e.index;
|
|
31
|
+
}
|
|
32
|
+
function f(e) {
|
|
33
|
+
return e.nodes;
|
|
34
|
+
}
|
|
35
|
+
function p(e) {
|
|
36
|
+
return e.links;
|
|
37
|
+
}
|
|
38
|
+
function m(e, t) {
|
|
39
|
+
let n = e.get(t);
|
|
40
|
+
if (!n) throw Error("missing: " + t);
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
43
|
+
function h({ nodes: e }) {
|
|
44
|
+
for (let t of e) {
|
|
45
|
+
let e = t.y0, n = e;
|
|
46
|
+
for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;
|
|
47
|
+
for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function g() {
|
|
51
|
+
let e = 0, i = 0, g = 1, _ = 1, v = 24, y = 8, b, x = d, S = a, C, w, T = f, E = p, D = 6;
|
|
52
|
+
function O() {
|
|
53
|
+
let e = {
|
|
54
|
+
nodes: T.apply(null, arguments),
|
|
55
|
+
links: E.apply(null, arguments)
|
|
56
|
+
};
|
|
57
|
+
return k(e), A(e), j(e), M(e), F(e), h(e), e;
|
|
58
|
+
}
|
|
59
|
+
O.update = function(e) {
|
|
60
|
+
return h(e), e;
|
|
61
|
+
}, O.nodeId = function(e) {
|
|
62
|
+
return arguments.length ? (x = typeof e == "function" ? e : o(e), O) : x;
|
|
63
|
+
}, O.nodeAlign = function(e) {
|
|
64
|
+
return arguments.length ? (S = typeof e == "function" ? e : o(e), O) : S;
|
|
65
|
+
}, O.nodeSort = function(e) {
|
|
66
|
+
return arguments.length ? (C = e, O) : C;
|
|
67
|
+
}, O.nodeWidth = function(e) {
|
|
68
|
+
return arguments.length ? (v = +e, O) : v;
|
|
69
|
+
}, O.nodePadding = function(e) {
|
|
70
|
+
return arguments.length ? (y = b = +e, O) : y;
|
|
71
|
+
}, O.nodes = function(e) {
|
|
72
|
+
return arguments.length ? (T = typeof e == "function" ? e : o(e), O) : T;
|
|
73
|
+
}, O.links = function(e) {
|
|
74
|
+
return arguments.length ? (E = typeof e == "function" ? e : o(e), O) : E;
|
|
75
|
+
}, O.linkSort = function(e) {
|
|
76
|
+
return arguments.length ? (w = e, O) : w;
|
|
77
|
+
}, O.size = function(t) {
|
|
78
|
+
return arguments.length ? (e = i = 0, g = +t[0], _ = +t[1], O) : [g - e, _ - i];
|
|
79
|
+
}, O.extent = function(t) {
|
|
80
|
+
return arguments.length ? (e = +t[0][0], g = +t[1][0], i = +t[0][1], _ = +t[1][1], O) : [[e, i], [g, _]];
|
|
81
|
+
}, O.iterations = function(e) {
|
|
82
|
+
return arguments.length ? (D = +e, O) : D;
|
|
83
|
+
};
|
|
84
|
+
function k({ nodes: e, links: t }) {
|
|
85
|
+
for (let [t, n] of e.entries()) n.index = t, n.sourceLinks = [], n.targetLinks = [];
|
|
86
|
+
let n = new Map(e.map((t, n) => [x(t, n, e), t]));
|
|
87
|
+
for (let [e, r] of t.entries()) {
|
|
88
|
+
r.index = e;
|
|
89
|
+
let { source: t, target: i } = r;
|
|
90
|
+
typeof t != "object" && (t = r.source = m(n, t)), typeof i != "object" && (i = r.target = m(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
|
|
91
|
+
}
|
|
92
|
+
if (w != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(w), n.sort(w);
|
|
93
|
+
}
|
|
94
|
+
function A({ nodes: e }) {
|
|
95
|
+
for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(r(t.sourceLinks, u), r(t.targetLinks, u)) : t.fixedValue;
|
|
96
|
+
}
|
|
97
|
+
function j({ nodes: e }) {
|
|
98
|
+
let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
|
|
99
|
+
for (; n.size;) {
|
|
100
|
+
for (let e of n) {
|
|
101
|
+
e.depth = i;
|
|
102
|
+
for (let { target: t } of e.sourceLinks) r.add(t);
|
|
103
|
+
}
|
|
104
|
+
if (++i > t) throw Error("circular link");
|
|
105
|
+
n = r, r = /* @__PURE__ */ new Set();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function M({ nodes: e }) {
|
|
109
|
+
let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
|
|
110
|
+
for (; n.size;) {
|
|
111
|
+
for (let e of n) {
|
|
112
|
+
e.height = i;
|
|
113
|
+
for (let { source: t } of e.targetLinks) r.add(t);
|
|
114
|
+
}
|
|
115
|
+
if (++i > t) throw Error("circular link");
|
|
116
|
+
n = r, r = /* @__PURE__ */ new Set();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function N({ nodes: t }) {
|
|
120
|
+
let r = n(t, (e) => e.depth) + 1, i = (g - e - v) / (r - 1), a = Array(r);
|
|
121
|
+
for (let n of t) {
|
|
122
|
+
let t = Math.max(0, Math.min(r - 1, Math.floor(S.call(null, n, r))));
|
|
123
|
+
n.layer = t, n.x0 = e + t * i, n.x1 = n.x0 + v, a[t] ? a[t].push(n) : a[t] = [n];
|
|
124
|
+
}
|
|
125
|
+
if (C) for (let e of a) e.sort(C);
|
|
126
|
+
return a;
|
|
127
|
+
}
|
|
128
|
+
function P(e) {
|
|
129
|
+
let n = t(e, (e) => (_ - i - (e.length - 1) * b) / r(e, u));
|
|
130
|
+
for (let t of e) {
|
|
131
|
+
let e = i;
|
|
132
|
+
for (let r of t) {
|
|
133
|
+
r.y0 = e, r.y1 = e + r.value * n, e = r.y1 + b;
|
|
134
|
+
for (let e of r.sourceLinks) e.width = e.value * n;
|
|
135
|
+
}
|
|
136
|
+
e = (_ - e + b) / (t.length + 1);
|
|
137
|
+
for (let n = 0; n < t.length; ++n) {
|
|
138
|
+
let r = t[n];
|
|
139
|
+
r.y0 += e * (n + 1), r.y1 += e * (n + 1);
|
|
140
|
+
}
|
|
141
|
+
H(t);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function F(e) {
|
|
145
|
+
let t = N(e);
|
|
146
|
+
b = Math.min(y, (_ - i) / (n(t, (e) => e.length) - 1)), P(t);
|
|
147
|
+
for (let e = 0; e < D; ++e) {
|
|
148
|
+
let n = .99 ** e, r = Math.max(1 - n, (e + 1) / D);
|
|
149
|
+
L(t, n, r), I(t, n, r);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function I(e, t, n) {
|
|
153
|
+
for (let r = 1, i = e.length; r < i; ++r) {
|
|
154
|
+
let i = e[r];
|
|
155
|
+
for (let e of i) {
|
|
156
|
+
let n = 0, r = 0;
|
|
157
|
+
for (let { source: t, value: i } of e.targetLinks) {
|
|
158
|
+
let a = i * (e.layer - t.layer);
|
|
159
|
+
n += U(t, e) * a, r += a;
|
|
160
|
+
}
|
|
161
|
+
if (!(r > 0)) continue;
|
|
162
|
+
let i = (n / r - e.y0) * t;
|
|
163
|
+
e.y0 += i, e.y1 += i, V(e);
|
|
164
|
+
}
|
|
165
|
+
C === void 0 && i.sort(l), R(i, n);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function L(e, t, n) {
|
|
169
|
+
for (let r = e.length - 2; r >= 0; --r) {
|
|
170
|
+
let i = e[r];
|
|
171
|
+
for (let e of i) {
|
|
172
|
+
let n = 0, r = 0;
|
|
173
|
+
for (let { target: t, value: i } of e.sourceLinks) {
|
|
174
|
+
let a = i * (t.layer - e.layer);
|
|
175
|
+
n += W(e, t) * a, r += a;
|
|
176
|
+
}
|
|
177
|
+
if (!(r > 0)) continue;
|
|
178
|
+
let i = (n / r - e.y0) * t;
|
|
179
|
+
e.y0 += i, e.y1 += i, V(e);
|
|
180
|
+
}
|
|
181
|
+
C === void 0 && i.sort(l), R(i, n);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function R(e, t) {
|
|
185
|
+
let n = e.length >> 1, r = e[n];
|
|
186
|
+
B(e, r.y0 - b, n - 1, t), z(e, r.y1 + b, n + 1, t), B(e, _, e.length - 1, t), z(e, i, 0, t);
|
|
187
|
+
}
|
|
188
|
+
function z(e, t, n, r) {
|
|
189
|
+
for (; n < e.length; ++n) {
|
|
190
|
+
let i = e[n], a = (t - i.y0) * r;
|
|
191
|
+
a > 1e-6 && (i.y0 += a, i.y1 += a), t = i.y1 + b;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function B(e, t, n, r) {
|
|
195
|
+
for (; n >= 0; --n) {
|
|
196
|
+
let i = e[n], a = (i.y1 - t) * r;
|
|
197
|
+
a > 1e-6 && (i.y0 -= a, i.y1 -= a), t = i.y0 - b;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function V({ sourceLinks: e, targetLinks: t }) {
|
|
201
|
+
if (w === void 0) {
|
|
202
|
+
for (let { source: { sourceLinks: e } } of t) e.sort(c);
|
|
203
|
+
for (let { target: { targetLinks: t } } of e) t.sort(s);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function H(e) {
|
|
207
|
+
if (w === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(c), n.sort(s);
|
|
208
|
+
}
|
|
209
|
+
function U(e, t) {
|
|
210
|
+
let n = e.y0 - (e.sourceLinks.length - 1) * b / 2;
|
|
211
|
+
for (let { target: r, width: i } of e.sourceLinks) {
|
|
212
|
+
if (r === t) break;
|
|
213
|
+
n += i + b;
|
|
214
|
+
}
|
|
215
|
+
for (let { source: r, width: i } of t.targetLinks) {
|
|
216
|
+
if (r === e) break;
|
|
217
|
+
n -= i;
|
|
218
|
+
}
|
|
219
|
+
return n;
|
|
220
|
+
}
|
|
221
|
+
function W(e, t) {
|
|
222
|
+
let n = t.y0 - (t.targetLinks.length - 1) * b / 2;
|
|
223
|
+
for (let { source: r, width: i } of t.targetLinks) {
|
|
224
|
+
if (r === e) break;
|
|
225
|
+
n += i + b;
|
|
226
|
+
}
|
|
227
|
+
for (let { target: r, width: i } of e.sourceLinks) {
|
|
228
|
+
if (r === t) break;
|
|
229
|
+
n -= i;
|
|
230
|
+
}
|
|
231
|
+
return n;
|
|
232
|
+
}
|
|
233
|
+
return O;
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region node_modules/d3-sankey/src/sankeyLinkHorizontal.js
|
|
237
|
+
function _(e) {
|
|
238
|
+
return [e.source.x1, e.y0];
|
|
239
|
+
}
|
|
240
|
+
function v(e) {
|
|
241
|
+
return [e.target.x0, e.y1];
|
|
242
|
+
}
|
|
243
|
+
function y() {
|
|
244
|
+
return i().source(_).target(v);
|
|
245
|
+
}
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/palette.ts
|
|
248
|
+
var b = [
|
|
249
|
+
{
|
|
250
|
+
dark: "#3987e5",
|
|
251
|
+
light: "#2a78d6"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
dark: "#d95926",
|
|
255
|
+
light: "#eb6834"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
dark: "#199e70",
|
|
259
|
+
light: "#1baf7a"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
dark: "#c98500",
|
|
263
|
+
light: "#eda100"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
dark: "#d55181",
|
|
267
|
+
light: "#e87ba4"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
dark: "#008300",
|
|
271
|
+
light: "#008300"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
dark: "#9085e9",
|
|
275
|
+
light: "#4a3aa7"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
dark: "#e66767",
|
|
279
|
+
light: "#e34948"
|
|
280
|
+
}
|
|
281
|
+
], x = {
|
|
282
|
+
dark: {
|
|
283
|
+
muted: "#898781",
|
|
284
|
+
primary: "#ffffff",
|
|
285
|
+
secondary: "#c3c2b7"
|
|
286
|
+
},
|
|
287
|
+
light: {
|
|
288
|
+
muted: "#898781",
|
|
289
|
+
primary: "#0b0b0b",
|
|
290
|
+
secondary: "#52514e"
|
|
291
|
+
}
|
|
292
|
+
}, S = {
|
|
293
|
+
dark: {
|
|
294
|
+
border: "rgba(255,255,255,0.10)",
|
|
295
|
+
chart: "#1a1a19"
|
|
296
|
+
},
|
|
297
|
+
light: {
|
|
298
|
+
border: "rgba(11,11,11,0.10)",
|
|
299
|
+
chart: "#fcfcfb"
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
function C(e, t) {
|
|
303
|
+
let n = b[(e % b.length + b.length) % b.length];
|
|
304
|
+
if (n == null) throw Error("Categorical palette is empty.");
|
|
305
|
+
return t === "dark" ? n.dark : n.light;
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/sankeyDiagram.ts
|
|
309
|
+
var w = 16, T = 12, E = 480, D = 640, O = 6;
|
|
310
|
+
function k(t, n, r = {}) {
|
|
311
|
+
let i = r.colorModeId ?? "light", a = x[i], o = S[i];
|
|
312
|
+
getComputedStyle(n).position === "static" && (n.style.position = "relative");
|
|
313
|
+
let s = e(n).append("div").attr("role", "tooltip").style("position", "absolute").style("pointer-events", "none").style("z-index", "1").style("opacity", "0").style("transition", "opacity 120ms ease").style("padding", "4px 8px").style("border-radius", "4px").style("font", "12px system-ui, -apple-system, \"Segoe UI\", sans-serif").style("white-space", "nowrap").style("background", o.chart).style("color", a.primary).style("border", `1px solid ${o.border}`).style("box-shadow", "0 2px 8px rgba(0,0,0,0.15)");
|
|
314
|
+
function c(e, t) {
|
|
315
|
+
let r = n.getBoundingClientRect();
|
|
316
|
+
s.html(t).style("left", `${String(e.clientX - r.left + 12)}px`).style("top", `${String(e.clientY - r.top + 12)}px`).style("opacity", "1");
|
|
317
|
+
}
|
|
318
|
+
function l() {
|
|
319
|
+
s.style("opacity", "0");
|
|
320
|
+
}
|
|
321
|
+
function u() {
|
|
322
|
+
e(n).selectAll("svg").remove();
|
|
323
|
+
let o = n.clientWidth || D, s = n.clientHeight || E, u = {
|
|
324
|
+
links: t.links.map((e) => ({ ...e })),
|
|
325
|
+
nodes: t.nodes.map((e) => ({ ...e }))
|
|
326
|
+
}, { links: d, nodes: f } = g().nodeId((e) => e.id).nodeWidth(r.nodeWidth ?? w).nodePadding(r.nodePadding ?? T).extent([[1, 1], [o - 1, s - 1]])(u), p = e(n).insert("svg", "div").attr("viewBox", `0 0 ${String(o)} ${String(s)}`).attr("width", "100%").attr("height", "100%").attr("font-family", "system-ui, -apple-system, \"Segoe UI\", sans-serif").attr("font-size", 12), m = y();
|
|
327
|
+
p.append("g").attr("fill", "none").selectAll("path").data(d).join("path").attr("d", m).attr("stroke", (e) => C(f.indexOf(e.source), i)).attr("stroke-opacity", .35).attr("stroke-width", (e) => Math.max(1, e.width ?? 1)).on("mouseenter", (t, n) => {
|
|
328
|
+
e(t.currentTarget).attr("stroke-opacity", .6);
|
|
329
|
+
let r = n.source, i = n.target;
|
|
330
|
+
c(t, `${r.name} → ${i.name}<br>${n.value.toLocaleString()}`);
|
|
331
|
+
}).on("mousemove", (e, t) => {
|
|
332
|
+
let n = t.source, r = t.target;
|
|
333
|
+
c(e, `${n.name} → ${r.name}<br>${t.value.toLocaleString()}`);
|
|
334
|
+
}).on("mouseleave", (t) => {
|
|
335
|
+
e(t.currentTarget).attr("stroke-opacity", .35), l();
|
|
336
|
+
});
|
|
337
|
+
let h = p.append("g").selectAll("g").data(f).join("g");
|
|
338
|
+
h.append("rect").attr("x", (e) => e.x0 ?? 0).attr("y", (e) => e.y0 ?? 0).attr("width", (e) => (e.x1 ?? 0) - (e.x0 ?? 0)).attr("height", (e) => Math.max(1, (e.y1 ?? 0) - (e.y0 ?? 0))).attr("rx", 2).attr("fill", (e, t) => C(t, i)).on("mouseenter", (e, t) => {
|
|
339
|
+
c(e, `${t.name}<br>${(t.value ?? 0).toLocaleString()}`);
|
|
340
|
+
}).on("mousemove", (e, t) => {
|
|
341
|
+
c(e, `${t.name}<br>${(t.value ?? 0).toLocaleString()}`);
|
|
342
|
+
}).on("mouseleave", l), h.append("text").attr("x", (e) => (e.x0 ?? 0) < o / 2 ? (e.x1 ?? 0) + O : (e.x0 ?? 0) - O).attr("y", (e) => ((e.y0 ?? 0) + (e.y1 ?? 0)) / 2).attr("dy", "0.35em").attr("text-anchor", (e) => (e.x0 ?? 0) < o / 2 ? "start" : "end").attr("fill", a.primary).text((e) => e.name);
|
|
343
|
+
let _ = p.node();
|
|
344
|
+
if (_ == null) throw Error("Failed to create Sankey diagram SVG element.");
|
|
345
|
+
return _;
|
|
346
|
+
}
|
|
347
|
+
let d = u();
|
|
348
|
+
return {
|
|
349
|
+
resize: () => {
|
|
350
|
+
d = u();
|
|
351
|
+
},
|
|
352
|
+
get svg() {
|
|
353
|
+
return d;
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
358
|
+
export { k as renderSankeyDiagram };
|
|
359
|
+
|
|
360
|
+
//# sourceMappingURL=sankeyDiagram-Dgf87Zt4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sankeyDiagram-Dgf87Zt4.js","names":[],"sources":["../node_modules/d3-sankey/src/align.js","../node_modules/d3-sankey/src/constant.js","../node_modules/d3-sankey/src/sankey.js","../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","../src/palette.ts","../src/sankeyDiagram.ts"],"sourcesContent":["import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ColorModeId = 'dark' | 'light';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n// Fixed-order categorical palette validated for adjacent-pair CVD/normal-vision contrast in both modes. Every node in a\n// Sankey diagram carries a direct text label, so identity never relies on colour alone - slots may cycle past 8.\n\nexport const CATEGORICAL_PALETTE: readonly { readonly dark: string; readonly light: string }[] = [\n { dark: '#3987e5', light: '#2a78d6' }, // blue\n { dark: '#d95926', light: '#eb6834' }, // orange\n { dark: '#199e70', light: '#1baf7a' }, // aqua\n { dark: '#c98500', light: '#eda100' }, // yellow\n { dark: '#d55181', light: '#e87ba4' }, // magenta\n { dark: '#008300', light: '#008300' }, // green\n { dark: '#9085e9', light: '#4a3aa7' }, // violet\n { dark: '#e66767', light: '#e34948' } // red\n];\n\nexport const INK: Readonly<Record<ColorModeId, { readonly muted: string; readonly primary: string; readonly secondary: string }>> = {\n dark: { muted: '#898781', primary: '#ffffff', secondary: '#c3c2b7' },\n light: { muted: '#898781', primary: '#0b0b0b', secondary: '#52514e' }\n};\n\nexport const SURFACE: Readonly<Record<ColorModeId, { readonly border: string; readonly chart: string }>> = {\n dark: { border: 'rgba(255,255,255,0.10)', chart: '#1a1a19' },\n light: { border: 'rgba(11,11,11,0.10)', chart: '#fcfcfb' }\n};\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function categoricalColor(index: number, colorModeId: ColorModeId): string {\n const slot = CATEGORICAL_PALETTE[((index % CATEGORICAL_PALETTE.length) + CATEGORICAL_PALETTE.length) % CATEGORICAL_PALETTE.length];\n if (slot == null) throw new Error('Categorical palette is empty.');\n return colorModeId === 'dark' ? slot.dark : slot.light;\n}\n","// ── External Dependencies & Registrations\nimport { select } from 'd3-selection';\nimport { sankey, type SankeyGraph, type SankeyLink as SankeyLinkExtra, sankeyLinkHorizontal, type SankeyNode as SankeyNodeExtra } from 'd3-sankey';\n\n// ── Local\nimport { categoricalColor, type ColorModeId, INK, SURFACE } from '@/palette';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface SankeyDiagramNode {\n id: string;\n name: string;\n}\n\nexport interface SankeyDiagramLink {\n source: string;\n target: string;\n value: number;\n}\n\nexport interface SankeyDiagramData {\n links: SankeyDiagramLink[];\n nodes: SankeyDiagramNode[];\n}\n\nexport interface SankeyDiagramOptions {\n colorModeId?: ColorModeId;\n nodePadding?: number;\n nodeWidth?: number;\n}\n\nexport interface SankeyDiagramHandle {\n resize: () => void;\n svg: SVGSVGElement;\n}\n\ntype LaidOutNode = SankeyDiagramNode & SankeyNodeExtra<SankeyDiagramNode, SankeyDiagramLink>;\ntype LaidOutLink = SankeyLinkExtra<SankeyDiagramNode, SankeyDiagramLink>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_NODE_WIDTH = 16;\nconst DEFAULT_NODE_PADDING = 12;\nconst DEFAULT_HEIGHT = 480;\nconst DEFAULT_WIDTH = 640;\nconst LABEL_MARGIN = 6;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function renderSankeyDiagram(data: SankeyDiagramData, renderTo: HTMLElement, options: SankeyDiagramOptions = {}): SankeyDiagramHandle {\n const colorModeId = options.colorModeId ?? 'light';\n const ink = INK[colorModeId];\n const surface = SURFACE[colorModeId];\n\n if (getComputedStyle(renderTo).position === 'static') renderTo.style.position = 'relative';\n\n const tooltip = select(renderTo)\n .append('div')\n .attr('role', 'tooltip')\n .style('position', 'absolute')\n .style('pointer-events', 'none')\n .style('z-index', '1')\n .style('opacity', '0')\n .style('transition', 'opacity 120ms ease')\n .style('padding', '4px 8px')\n .style('border-radius', '4px')\n .style('font', '12px system-ui, -apple-system, \"Segoe UI\", sans-serif')\n .style('white-space', 'nowrap')\n .style('background', surface.chart)\n .style('color', ink.primary)\n .style('border', `1px solid ${surface.border}`)\n .style('box-shadow', '0 2px 8px rgba(0,0,0,0.15)');\n\n function showTooltip(event: MouseEvent, text: string): void {\n const bounds = renderTo.getBoundingClientRect();\n tooltip\n .html(text)\n .style('left', `${String(event.clientX - bounds.left + 12)}px`)\n .style('top', `${String(event.clientY - bounds.top + 12)}px`)\n .style('opacity', '1');\n }\n\n function hideTooltip(): void {\n tooltip.style('opacity', '0');\n }\n\n function draw(): SVGSVGElement {\n select(renderTo).selectAll('svg').remove();\n\n const width = renderTo.clientWidth || DEFAULT_WIDTH;\n const height = renderTo.clientHeight || DEFAULT_HEIGHT;\n\n const graph: SankeyGraph<SankeyDiagramNode, SankeyDiagramLink> = {\n links: data.links.map((link) => ({ ...link })),\n nodes: data.nodes.map((node) => ({ ...node }))\n };\n\n const layout = sankey<SankeyDiagramNode, SankeyDiagramLink>()\n .nodeId((node) => node.id)\n .nodeWidth(options.nodeWidth ?? DEFAULT_NODE_WIDTH)\n .nodePadding(options.nodePadding ?? DEFAULT_NODE_PADDING)\n .extent([\n [1, 1],\n [width - 1, height - 1]\n ]);\n\n const { links, nodes } = layout(graph) as { links: LaidOutLink[]; nodes: LaidOutNode[] };\n\n const svgSelection = select(renderTo)\n .insert('svg', 'div')\n .attr('viewBox', `0 0 ${String(width)} ${String(height)}`)\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('font-family', 'system-ui, -apple-system, \"Segoe UI\", sans-serif')\n .attr('font-size', 12);\n\n const linkPath = sankeyLinkHorizontal<SankeyDiagramNode, SankeyDiagramLink>();\n\n svgSelection\n .append('g')\n .attr('fill', 'none')\n .selectAll('path')\n .data(links)\n .join('path')\n .attr('d', linkPath)\n .attr('stroke', (link) => categoricalColor(nodes.indexOf(link.source as LaidOutNode), colorModeId))\n .attr('stroke-opacity', 0.35)\n .attr('stroke-width', (link) => Math.max(1, link.width ?? 1))\n .on('mouseenter', (event: MouseEvent, link) => {\n select(event.currentTarget as SVGPathElement).attr('stroke-opacity', 0.6);\n const source = link.source as LaidOutNode;\n const target = link.target as LaidOutNode;\n showTooltip(event, `${source.name} → ${target.name}<br>${link.value.toLocaleString()}`);\n })\n .on('mousemove', (event: MouseEvent, link) => {\n const source = link.source as LaidOutNode;\n const target = link.target as LaidOutNode;\n showTooltip(event, `${source.name} → ${target.name}<br>${link.value.toLocaleString()}`);\n })\n .on('mouseleave', (event: MouseEvent) => {\n select(event.currentTarget as SVGPathElement).attr('stroke-opacity', 0.35);\n hideTooltip();\n });\n\n const nodeGroup = svgSelection.append('g').selectAll('g').data(nodes).join('g');\n\n nodeGroup\n .append('rect')\n .attr('x', (node) => node.x0 ?? 0)\n .attr('y', (node) => node.y0 ?? 0)\n .attr('width', (node) => (node.x1 ?? 0) - (node.x0 ?? 0))\n .attr('height', (node) => Math.max(1, (node.y1 ?? 0) - (node.y0 ?? 0)))\n .attr('rx', 2)\n .attr('fill', (_node, index) => categoricalColor(index, colorModeId))\n .on('mouseenter', (event: MouseEvent, node) => {\n showTooltip(event, `${node.name}<br>${(node.value ?? 0).toLocaleString()}`);\n })\n .on('mousemove', (event: MouseEvent, node) => {\n showTooltip(event, `${node.name}<br>${(node.value ?? 0).toLocaleString()}`);\n })\n .on('mouseleave', hideTooltip);\n\n nodeGroup\n .append('text')\n .attr('x', (node) => ((node.x0 ?? 0) < width / 2 ? (node.x1 ?? 0) + LABEL_MARGIN : (node.x0 ?? 0) - LABEL_MARGIN))\n .attr('y', (node) => ((node.y0 ?? 0) + (node.y1 ?? 0)) / 2)\n .attr('dy', '0.35em')\n .attr('text-anchor', (node) => ((node.x0 ?? 0) < width / 2 ? 'start' : 'end'))\n .attr('fill', ink.primary)\n .text((node) => node.name);\n\n const svgNode = svgSelection.node();\n if (svgNode == null) throw new Error('Failed to create Sankey diagram SVG element.');\n return svgNode;\n }\n\n let svg = draw();\n\n return {\n resize: () => {\n svg = draw();\n },\n get svg() {\n return svg;\n }\n };\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;AAcA,SAAgB,EAAQ,GAAM,GAAG;CAC/B,OAAO,EAAK,YAAY,SAAS,EAAK,QAAQ,IAAI;AACpD;;;AChBA,SAAwB,EAAS,GAAG;CAClC,OAAO,WAAW;EAChB,OAAO;CACT;AACF;;;ACAA,SAAS,EAAuB,GAAG,GAAG;CACpC,OAAO,EAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,EAAE,QAAQ,EAAE;AAC7D;AAEA,SAAS,EAAuB,GAAG,GAAG;CACpC,OAAO,EAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,EAAE,QAAQ,EAAE;AAC7D;AAEA,SAAS,EAAiB,GAAG,GAAG;CAC9B,OAAO,EAAE,KAAK,EAAE;AAClB;AAEA,SAAS,EAAM,GAAG;CAChB,OAAO,EAAE;AACX;AAEA,SAAS,EAAU,GAAG;CACpB,OAAO,EAAE;AACX;AAEA,SAAS,EAAa,GAAO;CAC3B,OAAO,EAAM;AACf;AAEA,SAAS,EAAa,GAAO;CAC3B,OAAO,EAAM;AACf;AAEA,SAAS,EAAK,GAAU,GAAI;CAC1B,IAAM,IAAO,EAAS,IAAI,CAAE;CAC5B,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