@dpuse/dpuse-tool-d3 0.0.2
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 +261 -0
- package/dist/dpuse-tool-d3.es.js +1150 -0
- package/dist/dpuse-tool-d3.es.js.map +1 -0
- package/dist/types/eslint.config.d.ts +3 -0
- package/dist/types/src/index.d.ts +9 -0
- package/dist/types/src/palette.d.ts +15 -0
- package/dist/types/src/sankeyDiagram.d.ts +24 -0
- package/dist/types/tests/importIndex.test.d.ts +1 -0
- package/dist/types/tests/sankeyDiagram.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 +78 -0
|
@@ -0,0 +1,1150 @@
|
|
|
1
|
+
var e = {
|
|
2
|
+
svg: "http://www.w3.org/2000/svg",
|
|
3
|
+
xhtml: "http://www.w3.org/1999/xhtml",
|
|
4
|
+
xlink: "http://www.w3.org/1999/xlink",
|
|
5
|
+
xml: "http://www.w3.org/XML/1998/namespace",
|
|
6
|
+
xmlns: "http://www.w3.org/2000/xmlns/"
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region node_modules/d3-selection/src/namespace.js
|
|
10
|
+
function t(t) {
|
|
11
|
+
var n = t += "", r = n.indexOf(":");
|
|
12
|
+
return r >= 0 && (n = t.slice(0, r)) !== "xmlns" && (t = t.slice(r + 1)), e.hasOwnProperty(n) ? {
|
|
13
|
+
space: e[n],
|
|
14
|
+
local: t
|
|
15
|
+
} : t;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region node_modules/d3-selection/src/creator.js
|
|
19
|
+
function n(e) {
|
|
20
|
+
return function() {
|
|
21
|
+
var t = this.ownerDocument, n = this.namespaceURI;
|
|
22
|
+
return n === "http://www.w3.org/1999/xhtml" && t.documentElement.namespaceURI === "http://www.w3.org/1999/xhtml" ? t.createElement(e) : t.createElementNS(n, e);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function r(e) {
|
|
26
|
+
return function() {
|
|
27
|
+
return this.ownerDocument.createElementNS(e.space, e.local);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function i(e) {
|
|
31
|
+
var i = t(e);
|
|
32
|
+
return (i.local ? r : n)(i);
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region node_modules/d3-selection/src/selector.js
|
|
36
|
+
function a() {}
|
|
37
|
+
function o(e) {
|
|
38
|
+
return e == null ? a : function() {
|
|
39
|
+
return this.querySelector(e);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region node_modules/d3-selection/src/selection/select.js
|
|
44
|
+
function s(e) {
|
|
45
|
+
typeof e != "function" && (e = o(e));
|
|
46
|
+
for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], s = a.length, c = r[i] = Array(s), l, u, d = 0; d < s; ++d) (l = a[d]) && (u = e.call(l, l.__data__, d, a)) && ("__data__" in l && (u.__data__ = l.__data__), c[d] = u);
|
|
47
|
+
return new L(r, this._parents);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region node_modules/d3-selection/src/array.js
|
|
51
|
+
function c(e) {
|
|
52
|
+
return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region node_modules/d3-selection/src/selectorAll.js
|
|
56
|
+
function l() {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
function u(e) {
|
|
60
|
+
return e == null ? l : function() {
|
|
61
|
+
return this.querySelectorAll(e);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region node_modules/d3-selection/src/selection/selectAll.js
|
|
66
|
+
function d(e) {
|
|
67
|
+
return function() {
|
|
68
|
+
return c(e.apply(this, arguments));
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function f(e) {
|
|
72
|
+
e = typeof e == "function" ? d(e) : u(e);
|
|
73
|
+
for (var t = this._groups, n = t.length, r = [], i = [], a = 0; a < n; ++a) for (var o = t[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && (r.push(e.call(c, c.__data__, l, o)), i.push(c));
|
|
74
|
+
return new L(r, i);
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region node_modules/d3-selection/src/matcher.js
|
|
78
|
+
function p(e) {
|
|
79
|
+
return function() {
|
|
80
|
+
return this.matches(e);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function m(e) {
|
|
84
|
+
return function(t) {
|
|
85
|
+
return t.matches(e);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region node_modules/d3-selection/src/selection/selectChild.js
|
|
90
|
+
var h = Array.prototype.find;
|
|
91
|
+
function g(e) {
|
|
92
|
+
return function() {
|
|
93
|
+
return h.call(this.children, e);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function _() {
|
|
97
|
+
return this.firstElementChild;
|
|
98
|
+
}
|
|
99
|
+
function v(e) {
|
|
100
|
+
return this.select(e == null ? _ : g(typeof e == "function" ? e : m(e)));
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region node_modules/d3-selection/src/selection/selectChildren.js
|
|
104
|
+
var y = Array.prototype.filter;
|
|
105
|
+
function b() {
|
|
106
|
+
return Array.from(this.children);
|
|
107
|
+
}
|
|
108
|
+
function x(e) {
|
|
109
|
+
return function() {
|
|
110
|
+
return y.call(this.children, e);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function S(e) {
|
|
114
|
+
return this.selectAll(e == null ? b : x(typeof e == "function" ? e : m(e)));
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region node_modules/d3-selection/src/selection/filter.js
|
|
118
|
+
function C(e) {
|
|
119
|
+
typeof e != "function" && (e = p(e));
|
|
120
|
+
for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = [], c, l = 0; l < o; ++l) (c = a[l]) && e.call(c, c.__data__, l, a) && s.push(c);
|
|
121
|
+
return new L(r, this._parents);
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region node_modules/d3-selection/src/selection/sparse.js
|
|
125
|
+
function w(e) {
|
|
126
|
+
return Array(e.length);
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region node_modules/d3-selection/src/selection/enter.js
|
|
130
|
+
function T() {
|
|
131
|
+
return new L(this._enter || this._groups.map(w), this._parents);
|
|
132
|
+
}
|
|
133
|
+
function E(e, t) {
|
|
134
|
+
this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
|
|
135
|
+
}
|
|
136
|
+
E.prototype = {
|
|
137
|
+
constructor: E,
|
|
138
|
+
appendChild: function(e) {
|
|
139
|
+
return this._parent.insertBefore(e, this._next);
|
|
140
|
+
},
|
|
141
|
+
insertBefore: function(e, t) {
|
|
142
|
+
return this._parent.insertBefore(e, t);
|
|
143
|
+
},
|
|
144
|
+
querySelector: function(e) {
|
|
145
|
+
return this._parent.querySelector(e);
|
|
146
|
+
},
|
|
147
|
+
querySelectorAll: function(e) {
|
|
148
|
+
return this._parent.querySelectorAll(e);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region node_modules/d3-selection/src/constant.js
|
|
153
|
+
function D(e) {
|
|
154
|
+
return function() {
|
|
155
|
+
return e;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region node_modules/d3-selection/src/selection/data.js
|
|
160
|
+
function O(e, t, n, r, i, a) {
|
|
161
|
+
for (var o = 0, s, c = t.length, l = a.length; o < l; ++o) (s = t[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new E(e, a[o]);
|
|
162
|
+
for (; o < c; ++o) (s = t[o]) && (i[o] = s);
|
|
163
|
+
}
|
|
164
|
+
function ee(e, t, n, r, i, a, o) {
|
|
165
|
+
var s, c, l = /* @__PURE__ */ new Map(), u = t.length, d = a.length, f = Array(u), p;
|
|
166
|
+
for (s = 0; s < u; ++s) (c = t[s]) && (f[s] = p = o.call(c, c.__data__, s, t) + "", l.has(p) ? i[s] = c : l.set(p, c));
|
|
167
|
+
for (s = 0; s < d; ++s) p = o.call(e, a[s], s, a) + "", (c = l.get(p)) ? (r[s] = c, c.__data__ = a[s], l.delete(p)) : n[s] = new E(e, a[s]);
|
|
168
|
+
for (s = 0; s < u; ++s) (c = t[s]) && l.get(f[s]) === c && (i[s] = c);
|
|
169
|
+
}
|
|
170
|
+
function te(e) {
|
|
171
|
+
return e.__data__;
|
|
172
|
+
}
|
|
173
|
+
function ne(e, t) {
|
|
174
|
+
if (!arguments.length) return Array.from(this, te);
|
|
175
|
+
var n = t ? ee : O, r = this._parents, i = this._groups;
|
|
176
|
+
typeof e != "function" && (e = D(e));
|
|
177
|
+
for (var a = i.length, o = Array(a), s = Array(a), c = Array(a), l = 0; l < a; ++l) {
|
|
178
|
+
var u = r[l], d = i[l], f = d.length, p = re(e.call(u, u && u.__data__, l, r)), m = p.length, h = s[l] = Array(m), g = o[l] = Array(m);
|
|
179
|
+
n(u, d, h, g, c[l] = Array(f), p, t);
|
|
180
|
+
for (var _ = 0, v = 0, y, b; _ < m; ++_) if (y = h[_]) {
|
|
181
|
+
for (_ >= v && (v = _ + 1); !(b = g[v]) && ++v < m;);
|
|
182
|
+
y._next = b || null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return o = new L(o, r), o._enter = s, o._exit = c, o;
|
|
186
|
+
}
|
|
187
|
+
function re(e) {
|
|
188
|
+
return typeof e == "object" && "length" in e ? e : Array.from(e);
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region node_modules/d3-selection/src/selection/exit.js
|
|
192
|
+
function ie() {
|
|
193
|
+
return new L(this._exit || this._groups.map(w), this._parents);
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region node_modules/d3-selection/src/selection/join.js
|
|
197
|
+
function ae(e, t, n) {
|
|
198
|
+
var r = this.enter(), i = this, a = this.exit();
|
|
199
|
+
return typeof e == "function" ? (r = e(r), r &&= r.selection()) : r = r.append(e + ""), t != null && (i = t(i), i &&= i.selection()), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region node_modules/d3-selection/src/selection/merge.js
|
|
203
|
+
function oe(e) {
|
|
204
|
+
for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, a = r.length, o = Math.min(i, a), s = Array(i), c = 0; c < o; ++c) for (var l = n[c], u = r[c], d = l.length, f = s[c] = Array(d), p, m = 0; m < d; ++m) (p = l[m] || u[m]) && (f[m] = p);
|
|
205
|
+
for (; c < i; ++c) s[c] = n[c];
|
|
206
|
+
return new L(s, this._parents);
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region node_modules/d3-selection/src/selection/order.js
|
|
210
|
+
function se() {
|
|
211
|
+
for (var e = this._groups, t = -1, n = e.length; ++t < n;) for (var r = e[t], i = r.length - 1, a = r[i], o; --i >= 0;) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o);
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region node_modules/d3-selection/src/selection/sort.js
|
|
216
|
+
function ce(e) {
|
|
217
|
+
e ||= le;
|
|
218
|
+
function t(t, n) {
|
|
219
|
+
return t && n ? e(t.__data__, n.__data__) : !t - !n;
|
|
220
|
+
}
|
|
221
|
+
for (var n = this._groups, r = n.length, i = Array(r), a = 0; a < r; ++a) {
|
|
222
|
+
for (var o = n[a], s = o.length, c = i[a] = Array(s), l, u = 0; u < s; ++u) (l = o[u]) && (c[u] = l);
|
|
223
|
+
c.sort(t);
|
|
224
|
+
}
|
|
225
|
+
return new L(i, this._parents).order();
|
|
226
|
+
}
|
|
227
|
+
function le(e, t) {
|
|
228
|
+
return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region node_modules/d3-selection/src/selection/call.js
|
|
232
|
+
function ue() {
|
|
233
|
+
var e = arguments[0];
|
|
234
|
+
return arguments[0] = this, e.apply(null, arguments), this;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region node_modules/d3-selection/src/selection/nodes.js
|
|
238
|
+
function de() {
|
|
239
|
+
return Array.from(this);
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region node_modules/d3-selection/src/selection/node.js
|
|
243
|
+
function fe() {
|
|
244
|
+
for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length; i < a; ++i) {
|
|
245
|
+
var o = r[i];
|
|
246
|
+
if (o) return o;
|
|
247
|
+
}
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region node_modules/d3-selection/src/selection/size.js
|
|
252
|
+
function pe() {
|
|
253
|
+
let e = 0;
|
|
254
|
+
for (let t of this) ++e;
|
|
255
|
+
return e;
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region node_modules/d3-selection/src/selection/empty.js
|
|
259
|
+
function me() {
|
|
260
|
+
return !this.node();
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region node_modules/d3-selection/src/selection/each.js
|
|
264
|
+
function he(e) {
|
|
265
|
+
for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var i = t[n], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && e.call(s, s.__data__, a, i);
|
|
266
|
+
return this;
|
|
267
|
+
}
|
|
268
|
+
//#endregion
|
|
269
|
+
//#region node_modules/d3-selection/src/selection/attr.js
|
|
270
|
+
function ge(e) {
|
|
271
|
+
return function() {
|
|
272
|
+
this.removeAttribute(e);
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function _e(e) {
|
|
276
|
+
return function() {
|
|
277
|
+
this.removeAttributeNS(e.space, e.local);
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
function ve(e, t) {
|
|
281
|
+
return function() {
|
|
282
|
+
this.setAttribute(e, t);
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function ye(e, t) {
|
|
286
|
+
return function() {
|
|
287
|
+
this.setAttributeNS(e.space, e.local, t);
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function be(e, t) {
|
|
291
|
+
return function() {
|
|
292
|
+
var n = t.apply(this, arguments);
|
|
293
|
+
n == null ? this.removeAttribute(e) : this.setAttribute(e, n);
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
function xe(e, t) {
|
|
297
|
+
return function() {
|
|
298
|
+
var n = t.apply(this, arguments);
|
|
299
|
+
n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n);
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
function Se(e, n) {
|
|
303
|
+
var r = t(e);
|
|
304
|
+
if (arguments.length < 2) {
|
|
305
|
+
var i = this.node();
|
|
306
|
+
return r.local ? i.getAttributeNS(r.space, r.local) : i.getAttribute(r);
|
|
307
|
+
}
|
|
308
|
+
return this.each((n == null ? r.local ? _e : ge : typeof n == "function" ? r.local ? xe : be : r.local ? ye : ve)(r, n));
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region node_modules/d3-selection/src/window.js
|
|
312
|
+
function k(e) {
|
|
313
|
+
return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region node_modules/d3-selection/src/selection/style.js
|
|
317
|
+
function Ce(e) {
|
|
318
|
+
return function() {
|
|
319
|
+
this.style.removeProperty(e);
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function we(e, t, n) {
|
|
323
|
+
return function() {
|
|
324
|
+
this.style.setProperty(e, t, n);
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function Te(e, t, n) {
|
|
328
|
+
return function() {
|
|
329
|
+
var r = t.apply(this, arguments);
|
|
330
|
+
r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n);
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function Ee(e, t, n) {
|
|
334
|
+
return arguments.length > 1 ? this.each((t == null ? Ce : typeof t == "function" ? Te : we)(e, t, n ?? "")) : De(this.node(), e);
|
|
335
|
+
}
|
|
336
|
+
function De(e, t) {
|
|
337
|
+
return e.style.getPropertyValue(t) || k(e).getComputedStyle(e, null).getPropertyValue(t);
|
|
338
|
+
}
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region node_modules/d3-selection/src/selection/property.js
|
|
341
|
+
function Oe(e) {
|
|
342
|
+
return function() {
|
|
343
|
+
delete this[e];
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function ke(e, t) {
|
|
347
|
+
return function() {
|
|
348
|
+
this[e] = t;
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function Ae(e, t) {
|
|
352
|
+
return function() {
|
|
353
|
+
var n = t.apply(this, arguments);
|
|
354
|
+
n == null ? delete this[e] : this[e] = n;
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function je(e, t) {
|
|
358
|
+
return arguments.length > 1 ? this.each((t == null ? Oe : typeof t == "function" ? Ae : ke)(e, t)) : this.node()[e];
|
|
359
|
+
}
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region node_modules/d3-selection/src/selection/classed.js
|
|
362
|
+
function A(e) {
|
|
363
|
+
return e.trim().split(/^|\s+/);
|
|
364
|
+
}
|
|
365
|
+
function j(e) {
|
|
366
|
+
return e.classList || new M(e);
|
|
367
|
+
}
|
|
368
|
+
function M(e) {
|
|
369
|
+
this._node = e, this._names = A(e.getAttribute("class") || "");
|
|
370
|
+
}
|
|
371
|
+
M.prototype = {
|
|
372
|
+
add: function(e) {
|
|
373
|
+
this._names.indexOf(e) < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" ")));
|
|
374
|
+
},
|
|
375
|
+
remove: function(e) {
|
|
376
|
+
var t = this._names.indexOf(e);
|
|
377
|
+
t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" ")));
|
|
378
|
+
},
|
|
379
|
+
contains: function(e) {
|
|
380
|
+
return this._names.indexOf(e) >= 0;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
function N(e, t) {
|
|
384
|
+
for (var n = j(e), r = -1, i = t.length; ++r < i;) n.add(t[r]);
|
|
385
|
+
}
|
|
386
|
+
function P(e, t) {
|
|
387
|
+
for (var n = j(e), r = -1, i = t.length; ++r < i;) n.remove(t[r]);
|
|
388
|
+
}
|
|
389
|
+
function Me(e) {
|
|
390
|
+
return function() {
|
|
391
|
+
N(this, e);
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function Ne(e) {
|
|
395
|
+
return function() {
|
|
396
|
+
P(this, e);
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function Pe(e, t) {
|
|
400
|
+
return function() {
|
|
401
|
+
(t.apply(this, arguments) ? N : P)(this, e);
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function Fe(e, t) {
|
|
405
|
+
var n = A(e + "");
|
|
406
|
+
if (arguments.length < 2) {
|
|
407
|
+
for (var r = j(this.node()), i = -1, a = n.length; ++i < a;) if (!r.contains(n[i])) return !1;
|
|
408
|
+
return !0;
|
|
409
|
+
}
|
|
410
|
+
return this.each((typeof t == "function" ? Pe : t ? Me : Ne)(n, t));
|
|
411
|
+
}
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region node_modules/d3-selection/src/selection/text.js
|
|
414
|
+
function Ie() {
|
|
415
|
+
this.textContent = "";
|
|
416
|
+
}
|
|
417
|
+
function Le(e) {
|
|
418
|
+
return function() {
|
|
419
|
+
this.textContent = e;
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
function Re(e) {
|
|
423
|
+
return function() {
|
|
424
|
+
var t = e.apply(this, arguments);
|
|
425
|
+
this.textContent = t ?? "";
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
function ze(e) {
|
|
429
|
+
return arguments.length ? this.each(e == null ? Ie : (typeof e == "function" ? Re : Le)(e)) : this.node().textContent;
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region node_modules/d3-selection/src/selection/html.js
|
|
433
|
+
function Be() {
|
|
434
|
+
this.innerHTML = "";
|
|
435
|
+
}
|
|
436
|
+
function Ve(e) {
|
|
437
|
+
return function() {
|
|
438
|
+
this.innerHTML = e;
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
function He(e) {
|
|
442
|
+
return function() {
|
|
443
|
+
var t = e.apply(this, arguments);
|
|
444
|
+
this.innerHTML = t ?? "";
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
function Ue(e) {
|
|
448
|
+
return arguments.length ? this.each(e == null ? Be : (typeof e == "function" ? He : Ve)(e)) : this.node().innerHTML;
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region node_modules/d3-selection/src/selection/raise.js
|
|
452
|
+
function We() {
|
|
453
|
+
this.nextSibling && this.parentNode.appendChild(this);
|
|
454
|
+
}
|
|
455
|
+
function Ge() {
|
|
456
|
+
return this.each(We);
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region node_modules/d3-selection/src/selection/lower.js
|
|
460
|
+
function Ke() {
|
|
461
|
+
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
|
462
|
+
}
|
|
463
|
+
function qe() {
|
|
464
|
+
return this.each(Ke);
|
|
465
|
+
}
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region node_modules/d3-selection/src/selection/append.js
|
|
468
|
+
function Je(e) {
|
|
469
|
+
var t = typeof e == "function" ? e : i(e);
|
|
470
|
+
return this.select(function() {
|
|
471
|
+
return this.appendChild(t.apply(this, arguments));
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region node_modules/d3-selection/src/selection/insert.js
|
|
476
|
+
function Ye() {
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
function Xe(e, t) {
|
|
480
|
+
var n = typeof e == "function" ? e : i(e), r = t == null ? Ye : typeof t == "function" ? t : o(t);
|
|
481
|
+
return this.select(function() {
|
|
482
|
+
return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region node_modules/d3-selection/src/selection/remove.js
|
|
487
|
+
function Ze() {
|
|
488
|
+
var e = this.parentNode;
|
|
489
|
+
e && e.removeChild(this);
|
|
490
|
+
}
|
|
491
|
+
function Qe() {
|
|
492
|
+
return this.each(Ze);
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region node_modules/d3-selection/src/selection/clone.js
|
|
496
|
+
function $e() {
|
|
497
|
+
var e = this.cloneNode(!1), t = this.parentNode;
|
|
498
|
+
return t ? t.insertBefore(e, this.nextSibling) : e;
|
|
499
|
+
}
|
|
500
|
+
function et() {
|
|
501
|
+
var e = this.cloneNode(!0), t = this.parentNode;
|
|
502
|
+
return t ? t.insertBefore(e, this.nextSibling) : e;
|
|
503
|
+
}
|
|
504
|
+
function tt(e) {
|
|
505
|
+
return this.select(e ? et : $e);
|
|
506
|
+
}
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region node_modules/d3-selection/src/selection/datum.js
|
|
509
|
+
function nt(e) {
|
|
510
|
+
return arguments.length ? this.property("__data__", e) : this.node().__data__;
|
|
511
|
+
}
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region node_modules/d3-selection/src/selection/on.js
|
|
514
|
+
function rt(e) {
|
|
515
|
+
return function(t) {
|
|
516
|
+
e.call(this, t, this.__data__);
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
function it(e) {
|
|
520
|
+
return e.trim().split(/^|\s+/).map(function(e) {
|
|
521
|
+
var t = "", n = e.indexOf(".");
|
|
522
|
+
return n >= 0 && (t = e.slice(n + 1), e = e.slice(0, n)), {
|
|
523
|
+
type: e,
|
|
524
|
+
name: t
|
|
525
|
+
};
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
function at(e) {
|
|
529
|
+
return function() {
|
|
530
|
+
var t = this.__on;
|
|
531
|
+
if (t) {
|
|
532
|
+
for (var n = 0, r = -1, i = t.length, a; n < i; ++n) a = t[n], (!e.type || a.type === e.type) && a.name === e.name ? this.removeEventListener(a.type, a.listener, a.options) : t[++r] = a;
|
|
533
|
+
++r ? t.length = r : delete this.__on;
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function ot(e, t, n) {
|
|
538
|
+
return function() {
|
|
539
|
+
var r = this.__on, i, a = rt(t);
|
|
540
|
+
if (r) {
|
|
541
|
+
for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === e.type && i.name === e.name) {
|
|
542
|
+
this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = t;
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
this.addEventListener(e.type, a, n), i = {
|
|
547
|
+
type: e.type,
|
|
548
|
+
name: e.name,
|
|
549
|
+
value: t,
|
|
550
|
+
listener: a,
|
|
551
|
+
options: n
|
|
552
|
+
}, r ? r.push(i) : this.__on = [i];
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
function st(e, t, n) {
|
|
556
|
+
var r = it(e + ""), i, a = r.length, o;
|
|
557
|
+
if (arguments.length < 2) {
|
|
558
|
+
var s = this.node().__on;
|
|
559
|
+
if (s) {
|
|
560
|
+
for (var c = 0, l = s.length, u; c < l; ++c) for (i = 0, u = s[c]; i < a; ++i) if ((o = r[i]).type === u.type && o.name === u.name) return u.value;
|
|
561
|
+
}
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
for (s = t ? ot : at, i = 0; i < a; ++i) this.each(s(r[i], t, n));
|
|
565
|
+
return this;
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region node_modules/d3-selection/src/selection/dispatch.js
|
|
569
|
+
function F(e, t, n) {
|
|
570
|
+
var r = k(e), i = r.CustomEvent;
|
|
571
|
+
typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i);
|
|
572
|
+
}
|
|
573
|
+
function ct(e, t) {
|
|
574
|
+
return function() {
|
|
575
|
+
return F(this, e, t);
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
function lt(e, t) {
|
|
579
|
+
return function() {
|
|
580
|
+
return F(this, e, t.apply(this, arguments));
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
function ut(e, t) {
|
|
584
|
+
return this.each((typeof t == "function" ? lt : ct)(e, t));
|
|
585
|
+
}
|
|
586
|
+
//#endregion
|
|
587
|
+
//#region node_modules/d3-selection/src/selection/iterator.js
|
|
588
|
+
function* dt() {
|
|
589
|
+
for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o);
|
|
590
|
+
}
|
|
591
|
+
//#endregion
|
|
592
|
+
//#region node_modules/d3-selection/src/selection/index.js
|
|
593
|
+
var I = [null];
|
|
594
|
+
function L(e, t) {
|
|
595
|
+
this._groups = e, this._parents = t;
|
|
596
|
+
}
|
|
597
|
+
function ft() {
|
|
598
|
+
return new L([[document.documentElement]], I);
|
|
599
|
+
}
|
|
600
|
+
function pt() {
|
|
601
|
+
return this;
|
|
602
|
+
}
|
|
603
|
+
L.prototype = ft.prototype = {
|
|
604
|
+
constructor: L,
|
|
605
|
+
select: s,
|
|
606
|
+
selectAll: f,
|
|
607
|
+
selectChild: v,
|
|
608
|
+
selectChildren: S,
|
|
609
|
+
filter: C,
|
|
610
|
+
data: ne,
|
|
611
|
+
enter: T,
|
|
612
|
+
exit: ie,
|
|
613
|
+
join: ae,
|
|
614
|
+
merge: oe,
|
|
615
|
+
selection: pt,
|
|
616
|
+
order: se,
|
|
617
|
+
sort: ce,
|
|
618
|
+
call: ue,
|
|
619
|
+
nodes: de,
|
|
620
|
+
node: fe,
|
|
621
|
+
size: pe,
|
|
622
|
+
empty: me,
|
|
623
|
+
each: he,
|
|
624
|
+
attr: Se,
|
|
625
|
+
style: Ee,
|
|
626
|
+
property: je,
|
|
627
|
+
classed: Fe,
|
|
628
|
+
text: ze,
|
|
629
|
+
html: Ue,
|
|
630
|
+
raise: Ge,
|
|
631
|
+
lower: qe,
|
|
632
|
+
append: Je,
|
|
633
|
+
insert: Xe,
|
|
634
|
+
remove: Qe,
|
|
635
|
+
clone: tt,
|
|
636
|
+
datum: nt,
|
|
637
|
+
on: st,
|
|
638
|
+
dispatch: ut,
|
|
639
|
+
[Symbol.iterator]: dt
|
|
640
|
+
};
|
|
641
|
+
//#endregion
|
|
642
|
+
//#region node_modules/d3-selection/src/select.js
|
|
643
|
+
function R(e) {
|
|
644
|
+
return typeof e == "string" ? new L([[document.querySelector(e)]], [document.documentElement]) : new L([[e]], I);
|
|
645
|
+
}
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region node_modules/d3-array/src/max.js
|
|
648
|
+
function z(e, t) {
|
|
649
|
+
let n;
|
|
650
|
+
if (t === void 0) for (let t of e) t != null && (n < t || n === void 0 && t >= t) && (n = t);
|
|
651
|
+
else {
|
|
652
|
+
let r = -1;
|
|
653
|
+
for (let i of e) (i = t(i, ++r, e)) != null && (n < i || n === void 0 && i >= i) && (n = i);
|
|
654
|
+
}
|
|
655
|
+
return n;
|
|
656
|
+
}
|
|
657
|
+
//#endregion
|
|
658
|
+
//#region node_modules/d3-array/src/min.js
|
|
659
|
+
function mt(e, t) {
|
|
660
|
+
let n;
|
|
661
|
+
if (t === void 0) for (let t of e) t != null && (n > t || n === void 0 && t >= t) && (n = t);
|
|
662
|
+
else {
|
|
663
|
+
let r = -1;
|
|
664
|
+
for (let i of e) (i = t(i, ++r, e)) != null && (n > i || n === void 0 && i >= i) && (n = i);
|
|
665
|
+
}
|
|
666
|
+
return n;
|
|
667
|
+
}
|
|
668
|
+
//#endregion
|
|
669
|
+
//#region node_modules/d3-array/src/sum.js
|
|
670
|
+
function B(e, t) {
|
|
671
|
+
let n = 0;
|
|
672
|
+
if (t === void 0) for (let t of e) (t = +t) && (n += t);
|
|
673
|
+
else {
|
|
674
|
+
let r = -1;
|
|
675
|
+
for (let i of e) (i = +t(i, ++r, e)) && (n += i);
|
|
676
|
+
}
|
|
677
|
+
return n;
|
|
678
|
+
}
|
|
679
|
+
//#endregion
|
|
680
|
+
//#region node_modules/d3-sankey/src/align.js
|
|
681
|
+
function ht(e, t) {
|
|
682
|
+
return e.sourceLinks.length ? e.depth : t - 1;
|
|
683
|
+
}
|
|
684
|
+
//#endregion
|
|
685
|
+
//#region node_modules/d3-sankey/src/constant.js
|
|
686
|
+
function V(e) {
|
|
687
|
+
return function() {
|
|
688
|
+
return e;
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region node_modules/d3-sankey/src/sankey.js
|
|
693
|
+
function H(e, t) {
|
|
694
|
+
return W(e.source, t.source) || e.index - t.index;
|
|
695
|
+
}
|
|
696
|
+
function U(e, t) {
|
|
697
|
+
return W(e.target, t.target) || e.index - t.index;
|
|
698
|
+
}
|
|
699
|
+
function W(e, t) {
|
|
700
|
+
return e.y0 - t.y0;
|
|
701
|
+
}
|
|
702
|
+
function G(e) {
|
|
703
|
+
return e.value;
|
|
704
|
+
}
|
|
705
|
+
function gt(e) {
|
|
706
|
+
return e.index;
|
|
707
|
+
}
|
|
708
|
+
function _t(e) {
|
|
709
|
+
return e.nodes;
|
|
710
|
+
}
|
|
711
|
+
function vt(e) {
|
|
712
|
+
return e.links;
|
|
713
|
+
}
|
|
714
|
+
function K(e, t) {
|
|
715
|
+
let n = e.get(t);
|
|
716
|
+
if (!n) throw Error("missing: " + t);
|
|
717
|
+
return n;
|
|
718
|
+
}
|
|
719
|
+
function q({ nodes: e }) {
|
|
720
|
+
for (let t of e) {
|
|
721
|
+
let e = t.y0, n = e;
|
|
722
|
+
for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;
|
|
723
|
+
for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
function yt() {
|
|
727
|
+
let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = gt, c = ht, l, u, d = _t, f = vt, p = 6;
|
|
728
|
+
function m() {
|
|
729
|
+
let e = {
|
|
730
|
+
nodes: d.apply(null, arguments),
|
|
731
|
+
links: f.apply(null, arguments)
|
|
732
|
+
};
|
|
733
|
+
return h(e), g(e), _(e), v(e), x(e), q(e), e;
|
|
734
|
+
}
|
|
735
|
+
m.update = function(e) {
|
|
736
|
+
return q(e), e;
|
|
737
|
+
}, m.nodeId = function(e) {
|
|
738
|
+
return arguments.length ? (s = typeof e == "function" ? e : V(e), m) : s;
|
|
739
|
+
}, m.nodeAlign = function(e) {
|
|
740
|
+
return arguments.length ? (c = typeof e == "function" ? e : V(e), m) : c;
|
|
741
|
+
}, m.nodeSort = function(e) {
|
|
742
|
+
return arguments.length ? (l = e, m) : l;
|
|
743
|
+
}, m.nodeWidth = function(e) {
|
|
744
|
+
return arguments.length ? (i = +e, m) : i;
|
|
745
|
+
}, m.nodePadding = function(e) {
|
|
746
|
+
return arguments.length ? (a = o = +e, m) : a;
|
|
747
|
+
}, m.nodes = function(e) {
|
|
748
|
+
return arguments.length ? (d = typeof e == "function" ? e : V(e), m) : d;
|
|
749
|
+
}, m.links = function(e) {
|
|
750
|
+
return arguments.length ? (f = typeof e == "function" ? e : V(e), m) : f;
|
|
751
|
+
}, m.linkSort = function(e) {
|
|
752
|
+
return arguments.length ? (u = e, m) : u;
|
|
753
|
+
}, m.size = function(i) {
|
|
754
|
+
return arguments.length ? (e = t = 0, n = +i[0], r = +i[1], m) : [n - e, r - t];
|
|
755
|
+
}, m.extent = function(i) {
|
|
756
|
+
return arguments.length ? (e = +i[0][0], n = +i[1][0], t = +i[0][1], r = +i[1][1], m) : [[e, t], [n, r]];
|
|
757
|
+
}, m.iterations = function(e) {
|
|
758
|
+
return arguments.length ? (p = +e, m) : p;
|
|
759
|
+
};
|
|
760
|
+
function h({ nodes: e, links: t }) {
|
|
761
|
+
for (let [t, n] of e.entries()) n.index = t, n.sourceLinks = [], n.targetLinks = [];
|
|
762
|
+
let n = new Map(e.map((t, n) => [s(t, n, e), t]));
|
|
763
|
+
for (let [e, r] of t.entries()) {
|
|
764
|
+
r.index = e;
|
|
765
|
+
let { source: t, target: i } = r;
|
|
766
|
+
typeof t != "object" && (t = r.source = K(n, t)), typeof i != "object" && (i = r.target = K(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
|
|
767
|
+
}
|
|
768
|
+
if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);
|
|
769
|
+
}
|
|
770
|
+
function g({ nodes: e }) {
|
|
771
|
+
for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(B(t.sourceLinks, G), B(t.targetLinks, G)) : t.fixedValue;
|
|
772
|
+
}
|
|
773
|
+
function _({ nodes: e }) {
|
|
774
|
+
let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
|
|
775
|
+
for (; n.size;) {
|
|
776
|
+
for (let e of n) {
|
|
777
|
+
e.depth = i;
|
|
778
|
+
for (let { target: t } of e.sourceLinks) r.add(t);
|
|
779
|
+
}
|
|
780
|
+
if (++i > t) throw Error("circular link");
|
|
781
|
+
n = r, r = /* @__PURE__ */ new Set();
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
function v({ nodes: e }) {
|
|
785
|
+
let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
|
|
786
|
+
for (; n.size;) {
|
|
787
|
+
for (let e of n) {
|
|
788
|
+
e.height = i;
|
|
789
|
+
for (let { source: t } of e.targetLinks) r.add(t);
|
|
790
|
+
}
|
|
791
|
+
if (++i > t) throw Error("circular link");
|
|
792
|
+
n = r, r = /* @__PURE__ */ new Set();
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
function y({ nodes: t }) {
|
|
796
|
+
let r = z(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
|
|
797
|
+
for (let n of t) {
|
|
798
|
+
let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));
|
|
799
|
+
n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];
|
|
800
|
+
}
|
|
801
|
+
if (l) for (let e of o) e.sort(l);
|
|
802
|
+
return o;
|
|
803
|
+
}
|
|
804
|
+
function b(e) {
|
|
805
|
+
let n = mt(e, (e) => (r - t - (e.length - 1) * o) / B(e, G));
|
|
806
|
+
for (let i of e) {
|
|
807
|
+
let e = t;
|
|
808
|
+
for (let t of i) {
|
|
809
|
+
t.y0 = e, t.y1 = e + t.value * n, e = t.y1 + o;
|
|
810
|
+
for (let e of t.sourceLinks) e.width = e.value * n;
|
|
811
|
+
}
|
|
812
|
+
e = (r - e + o) / (i.length + 1);
|
|
813
|
+
for (let t = 0; t < i.length; ++t) {
|
|
814
|
+
let n = i[t];
|
|
815
|
+
n.y0 += e * (t + 1), n.y1 += e * (t + 1);
|
|
816
|
+
}
|
|
817
|
+
O(i);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
function x(e) {
|
|
821
|
+
let n = y(e);
|
|
822
|
+
o = Math.min(a, (r - t) / (z(n, (e) => e.length) - 1)), b(n);
|
|
823
|
+
for (let e = 0; e < p; ++e) {
|
|
824
|
+
let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);
|
|
825
|
+
C(n, t, r), S(n, t, r);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
function S(e, t, n) {
|
|
829
|
+
for (let r = 1, i = e.length; r < i; ++r) {
|
|
830
|
+
let i = e[r];
|
|
831
|
+
for (let e of i) {
|
|
832
|
+
let n = 0, r = 0;
|
|
833
|
+
for (let { source: t, value: i } of e.targetLinks) {
|
|
834
|
+
let a = i * (e.layer - t.layer);
|
|
835
|
+
n += ee(t, e) * a, r += a;
|
|
836
|
+
}
|
|
837
|
+
if (!(r > 0)) continue;
|
|
838
|
+
let i = (n / r - e.y0) * t;
|
|
839
|
+
e.y0 += i, e.y1 += i, D(e);
|
|
840
|
+
}
|
|
841
|
+
l === void 0 && i.sort(W), w(i, n);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
function C(e, t, n) {
|
|
845
|
+
for (let r = e.length - 2; r >= 0; --r) {
|
|
846
|
+
let i = e[r];
|
|
847
|
+
for (let e of i) {
|
|
848
|
+
let n = 0, r = 0;
|
|
849
|
+
for (let { target: t, value: i } of e.sourceLinks) {
|
|
850
|
+
let a = i * (t.layer - e.layer);
|
|
851
|
+
n += te(e, t) * a, r += a;
|
|
852
|
+
}
|
|
853
|
+
if (!(r > 0)) continue;
|
|
854
|
+
let i = (n / r - e.y0) * t;
|
|
855
|
+
e.y0 += i, e.y1 += i, D(e);
|
|
856
|
+
}
|
|
857
|
+
l === void 0 && i.sort(W), w(i, n);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
function w(e, n) {
|
|
861
|
+
let i = e.length >> 1, a = e[i];
|
|
862
|
+
E(e, a.y0 - o, i - 1, n), T(e, a.y1 + o, i + 1, n), E(e, r, e.length - 1, n), T(e, t, 0, n);
|
|
863
|
+
}
|
|
864
|
+
function T(e, t, n, r) {
|
|
865
|
+
for (; n < e.length; ++n) {
|
|
866
|
+
let i = e[n], a = (t - i.y0) * r;
|
|
867
|
+
a > 1e-6 && (i.y0 += a, i.y1 += a), t = i.y1 + o;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
function E(e, t, n, r) {
|
|
871
|
+
for (; n >= 0; --n) {
|
|
872
|
+
let i = e[n], a = (i.y1 - t) * r;
|
|
873
|
+
a > 1e-6 && (i.y0 -= a, i.y1 -= a), t = i.y0 - o;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
function D({ sourceLinks: e, targetLinks: t }) {
|
|
877
|
+
if (u === void 0) {
|
|
878
|
+
for (let { source: { sourceLinks: e } } of t) e.sort(U);
|
|
879
|
+
for (let { target: { targetLinks: t } } of e) t.sort(H);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
function O(e) {
|
|
883
|
+
if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(U), n.sort(H);
|
|
884
|
+
}
|
|
885
|
+
function ee(e, t) {
|
|
886
|
+
let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;
|
|
887
|
+
for (let { target: r, width: i } of e.sourceLinks) {
|
|
888
|
+
if (r === t) break;
|
|
889
|
+
n += i + o;
|
|
890
|
+
}
|
|
891
|
+
for (let { source: r, width: i } of t.targetLinks) {
|
|
892
|
+
if (r === e) break;
|
|
893
|
+
n -= i;
|
|
894
|
+
}
|
|
895
|
+
return n;
|
|
896
|
+
}
|
|
897
|
+
function te(e, t) {
|
|
898
|
+
let n = t.y0 - (t.targetLinks.length - 1) * o / 2;
|
|
899
|
+
for (let { source: r, width: i } of t.targetLinks) {
|
|
900
|
+
if (r === e) break;
|
|
901
|
+
n += i + o;
|
|
902
|
+
}
|
|
903
|
+
for (let { target: r, width: i } of e.sourceLinks) {
|
|
904
|
+
if (r === t) break;
|
|
905
|
+
n -= i;
|
|
906
|
+
}
|
|
907
|
+
return n;
|
|
908
|
+
}
|
|
909
|
+
return m;
|
|
910
|
+
}
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region node_modules/d3-path/src/path.js
|
|
913
|
+
var J = Math.PI, Y = 2 * J, X = 1e-6, bt = Y - X;
|
|
914
|
+
function Z() {
|
|
915
|
+
this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";
|
|
916
|
+
}
|
|
917
|
+
function Q() {
|
|
918
|
+
return new Z();
|
|
919
|
+
}
|
|
920
|
+
Z.prototype = Q.prototype = {
|
|
921
|
+
constructor: Z,
|
|
922
|
+
moveTo: function(e, t) {
|
|
923
|
+
this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t);
|
|
924
|
+
},
|
|
925
|
+
closePath: function() {
|
|
926
|
+
this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
|
|
927
|
+
},
|
|
928
|
+
lineTo: function(e, t) {
|
|
929
|
+
this._ += "L" + (this._x1 = +e) + "," + (this._y1 = +t);
|
|
930
|
+
},
|
|
931
|
+
quadraticCurveTo: function(e, t, n, r) {
|
|
932
|
+
this._ += "Q" + +e + "," + +t + "," + (this._x1 = +n) + "," + (this._y1 = +r);
|
|
933
|
+
},
|
|
934
|
+
bezierCurveTo: function(e, t, n, r, i, a) {
|
|
935
|
+
this._ += "C" + +e + "," + +t + "," + +n + "," + +r + "," + (this._x1 = +i) + "," + (this._y1 = +a);
|
|
936
|
+
},
|
|
937
|
+
arcTo: function(e, t, n, r, i) {
|
|
938
|
+
e = +e, t = +t, n = +n, r = +r, i = +i;
|
|
939
|
+
var a = this._x1, o = this._y1, s = n - e, c = r - t, l = a - e, u = o - t, d = l * l + u * u;
|
|
940
|
+
if (i < 0) throw Error("negative radius: " + i);
|
|
941
|
+
if (this._x1 === null) this._ += "M" + (this._x1 = e) + "," + (this._y1 = t);
|
|
942
|
+
else if (d > X) if (!(Math.abs(u * s - c * l) > X) || !i) this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);
|
|
943
|
+
else {
|
|
944
|
+
var f = n - a, p = r - o, m = s * s + c * c, h = f * f + p * p, g = Math.sqrt(m), _ = Math.sqrt(d), v = i * Math.tan((J - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;
|
|
945
|
+
Math.abs(y - 1) > X && (this._ += "L" + (e + y * l) + "," + (t + y * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * p) + "," + (this._x1 = e + b * s) + "," + (this._y1 = t + b * c);
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
arc: function(e, t, n, r, i, a) {
|
|
949
|
+
e = +e, t = +t, n = +n, a = !!a;
|
|
950
|
+
var o = n * Math.cos(r), s = n * Math.sin(r), c = e + o, l = t + s, u = 1 ^ a, d = a ? r - i : i - r;
|
|
951
|
+
if (n < 0) throw Error("negative radius: " + n);
|
|
952
|
+
this._x1 === null ? this._ += "M" + c + "," + l : (Math.abs(this._x1 - c) > X || Math.abs(this._y1 - l) > X) && (this._ += "L" + c + "," + l), n && (d < 0 && (d = d % Y + Y), d > bt ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (e - o) + "," + (t - s) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = c) + "," + (this._y1 = l) : d > X && (this._ += "A" + n + "," + n + ",0," + +(d >= J) + "," + u + "," + (this._x1 = e + n * Math.cos(i)) + "," + (this._y1 = t + n * Math.sin(i))));
|
|
953
|
+
},
|
|
954
|
+
rect: function(e, t, n, r) {
|
|
955
|
+
this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t) + "h" + +n + "v" + +r + "h" + -n + "Z";
|
|
956
|
+
},
|
|
957
|
+
toString: function() {
|
|
958
|
+
return this._;
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
//#endregion
|
|
962
|
+
//#region node_modules/d3-shape/src/constant.js
|
|
963
|
+
function xt(e) {
|
|
964
|
+
return function() {
|
|
965
|
+
return e;
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
//#endregion
|
|
969
|
+
//#region node_modules/d3-shape/src/point.js
|
|
970
|
+
function St(e) {
|
|
971
|
+
return e[0];
|
|
972
|
+
}
|
|
973
|
+
function Ct(e) {
|
|
974
|
+
return e[1];
|
|
975
|
+
}
|
|
976
|
+
//#endregion
|
|
977
|
+
//#region node_modules/d3-shape/src/array.js
|
|
978
|
+
var wt = Array.prototype.slice;
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region node_modules/d3-shape/src/link/index.js
|
|
981
|
+
function Tt(e) {
|
|
982
|
+
return e.source;
|
|
983
|
+
}
|
|
984
|
+
function Et(e) {
|
|
985
|
+
return e.target;
|
|
986
|
+
}
|
|
987
|
+
function Dt(e) {
|
|
988
|
+
var t = Tt, n = Et, r = St, i = Ct, a = null;
|
|
989
|
+
function o() {
|
|
990
|
+
var o, s = wt.call(arguments), c = t.apply(this, s), l = n.apply(this, s);
|
|
991
|
+
if (a ||= o = Q(), e(a, +r.apply(this, (s[0] = c, s)), +i.apply(this, s), +r.apply(this, (s[0] = l, s)), +i.apply(this, s)), o) return a = null, o + "" || null;
|
|
992
|
+
}
|
|
993
|
+
return o.source = function(e) {
|
|
994
|
+
return arguments.length ? (t = e, o) : t;
|
|
995
|
+
}, o.target = function(e) {
|
|
996
|
+
return arguments.length ? (n = e, o) : n;
|
|
997
|
+
}, o.x = function(e) {
|
|
998
|
+
return arguments.length ? (r = typeof e == "function" ? e : xt(+e), o) : r;
|
|
999
|
+
}, o.y = function(e) {
|
|
1000
|
+
return arguments.length ? (i = typeof e == "function" ? e : xt(+e), o) : i;
|
|
1001
|
+
}, o.context = function(e) {
|
|
1002
|
+
return arguments.length ? (a = e ?? null, o) : a;
|
|
1003
|
+
}, o;
|
|
1004
|
+
}
|
|
1005
|
+
function Ot(e, t, n, r, i) {
|
|
1006
|
+
e.moveTo(t, n), e.bezierCurveTo(t = (t + r) / 2, n, t, i, r, i);
|
|
1007
|
+
}
|
|
1008
|
+
function kt() {
|
|
1009
|
+
return Dt(Ot);
|
|
1010
|
+
}
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region node_modules/d3-sankey/src/sankeyLinkHorizontal.js
|
|
1013
|
+
function At(e) {
|
|
1014
|
+
return [e.source.x1, e.y0];
|
|
1015
|
+
}
|
|
1016
|
+
function jt(e) {
|
|
1017
|
+
return [e.target.x0, e.y1];
|
|
1018
|
+
}
|
|
1019
|
+
function Mt() {
|
|
1020
|
+
return kt().source(At).target(jt);
|
|
1021
|
+
}
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region src/palette.ts
|
|
1024
|
+
var $ = [
|
|
1025
|
+
{
|
|
1026
|
+
dark: "#3987e5",
|
|
1027
|
+
light: "#2a78d6"
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
dark: "#d95926",
|
|
1031
|
+
light: "#eb6834"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
dark: "#199e70",
|
|
1035
|
+
light: "#1baf7a"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
dark: "#c98500",
|
|
1039
|
+
light: "#eda100"
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
dark: "#d55181",
|
|
1043
|
+
light: "#e87ba4"
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
dark: "#008300",
|
|
1047
|
+
light: "#008300"
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
dark: "#9085e9",
|
|
1051
|
+
light: "#4a3aa7"
|
|
1052
|
+
},
|
|
1053
|
+
{
|
|
1054
|
+
dark: "#e66767",
|
|
1055
|
+
light: "#e34948"
|
|
1056
|
+
}
|
|
1057
|
+
], Nt = {
|
|
1058
|
+
dark: {
|
|
1059
|
+
muted: "#898781",
|
|
1060
|
+
primary: "#ffffff",
|
|
1061
|
+
secondary: "#c3c2b7"
|
|
1062
|
+
},
|
|
1063
|
+
light: {
|
|
1064
|
+
muted: "#898781",
|
|
1065
|
+
primary: "#0b0b0b",
|
|
1066
|
+
secondary: "#52514e"
|
|
1067
|
+
}
|
|
1068
|
+
}, Pt = {
|
|
1069
|
+
dark: {
|
|
1070
|
+
border: "rgba(255,255,255,0.10)",
|
|
1071
|
+
chart: "#1a1a19"
|
|
1072
|
+
},
|
|
1073
|
+
light: {
|
|
1074
|
+
border: "rgba(11,11,11,0.10)",
|
|
1075
|
+
chart: "#fcfcfb"
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
function Ft(e, t) {
|
|
1079
|
+
let n = $[(e % $.length + $.length) % $.length];
|
|
1080
|
+
if (n == null) throw Error("Categorical palette is empty.");
|
|
1081
|
+
return t === "dark" ? n.dark : n.light;
|
|
1082
|
+
}
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region src/sankeyDiagram.ts
|
|
1085
|
+
var It = 16, Lt = 12, Rt = 480, zt = 640, Bt = 6;
|
|
1086
|
+
function Vt(e, t, n = {}) {
|
|
1087
|
+
let r = n.colorModeId ?? "light", i = Nt[r], a = Pt[r];
|
|
1088
|
+
getComputedStyle(t).position === "static" && (t.style.position = "relative");
|
|
1089
|
+
let o = R(t).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", a.chart).style("color", i.primary).style("border", `1px solid ${a.border}`).style("box-shadow", "0 2px 8px rgba(0,0,0,0.15)");
|
|
1090
|
+
function s(e, n) {
|
|
1091
|
+
let r = t.getBoundingClientRect();
|
|
1092
|
+
o.html(n).style("left", `${String(e.clientX - r.left + 12)}px`).style("top", `${String(e.clientY - r.top + 12)}px`).style("opacity", "1");
|
|
1093
|
+
}
|
|
1094
|
+
function c() {
|
|
1095
|
+
o.style("opacity", "0");
|
|
1096
|
+
}
|
|
1097
|
+
function l() {
|
|
1098
|
+
R(t).selectAll("svg").remove();
|
|
1099
|
+
let a = t.clientWidth || zt, o = t.clientHeight || Rt, l = {
|
|
1100
|
+
links: e.links.map((e) => ({ ...e })),
|
|
1101
|
+
nodes: e.nodes.map((e) => ({ ...e }))
|
|
1102
|
+
}, { links: u, nodes: d } = yt().nodeId((e) => e.id).nodeWidth(n.nodeWidth ?? It).nodePadding(n.nodePadding ?? Lt).extent([[1, 1], [a - 1, o - 1]])(l), f = R(t).insert("svg", "div").attr("viewBox", `0 0 ${String(a)} ${String(o)}`).attr("width", "100%").attr("height", "100%").attr("font-family", "system-ui, -apple-system, \"Segoe UI\", sans-serif").attr("font-size", 12), p = Mt();
|
|
1103
|
+
f.append("g").attr("fill", "none").selectAll("path").data(u).join("path").attr("d", p).attr("stroke", (e) => Ft(d.indexOf(e.source), r)).attr("stroke-opacity", .35).attr("stroke-width", (e) => Math.max(1, e.width ?? 1)).on("mouseenter", (e, t) => {
|
|
1104
|
+
R(e.currentTarget).attr("stroke-opacity", .6);
|
|
1105
|
+
let n = t.source, r = t.target;
|
|
1106
|
+
s(e, `${n.name} → ${r.name}<br>${t.value.toLocaleString()}`);
|
|
1107
|
+
}).on("mousemove", (e, t) => {
|
|
1108
|
+
let n = t.source, r = t.target;
|
|
1109
|
+
s(e, `${n.name} → ${r.name}<br>${t.value.toLocaleString()}`);
|
|
1110
|
+
}).on("mouseleave", (e) => {
|
|
1111
|
+
R(e.currentTarget).attr("stroke-opacity", .35), c();
|
|
1112
|
+
});
|
|
1113
|
+
let m = f.append("g").selectAll("g").data(d).join("g");
|
|
1114
|
+
m.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) => Ft(t, r)).on("mouseenter", (e, t) => {
|
|
1115
|
+
s(e, `${t.name}<br>${(t.value ?? 0).toLocaleString()}`);
|
|
1116
|
+
}).on("mousemove", (e, t) => {
|
|
1117
|
+
s(e, `${t.name}<br>${(t.value ?? 0).toLocaleString()}`);
|
|
1118
|
+
}).on("mouseleave", c), m.append("text").attr("x", (e) => (e.x0 ?? 0) < a / 2 ? (e.x1 ?? 0) + Bt : (e.x0 ?? 0) - Bt).attr("y", (e) => ((e.y0 ?? 0) + (e.y1 ?? 0)) / 2).attr("dy", "0.35em").attr("text-anchor", (e) => (e.x0 ?? 0) < a / 2 ? "start" : "end").attr("fill", i.primary).text((e) => e.name);
|
|
1119
|
+
let h = f.node();
|
|
1120
|
+
if (h == null) throw Error("Failed to create Sankey diagram SVG element.");
|
|
1121
|
+
return h;
|
|
1122
|
+
}
|
|
1123
|
+
let u = l();
|
|
1124
|
+
return {
|
|
1125
|
+
resize: () => {
|
|
1126
|
+
u = l();
|
|
1127
|
+
},
|
|
1128
|
+
get svg() {
|
|
1129
|
+
return u;
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
//#endregion
|
|
1134
|
+
//#region src/index.ts
|
|
1135
|
+
var Ht = "d3", Ut = class {
|
|
1136
|
+
renderSankeyDiagram(e, t, n, r) {
|
|
1137
|
+
let i = Vt(e, t, n);
|
|
1138
|
+
return r?.(), {
|
|
1139
|
+
resize: i.resize,
|
|
1140
|
+
get svg() {
|
|
1141
|
+
return i.svg;
|
|
1142
|
+
},
|
|
1143
|
+
vendorId: Ht
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
//#endregion
|
|
1148
|
+
export { Ut as D3Tool };
|
|
1149
|
+
|
|
1150
|
+
//# sourceMappingURL=dpuse-tool-d3.es.js.map
|