chartformers 1.0.53 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chartformers.es.js +1129 -1119
- package/dist/chartformers.umd.js +13 -13
- package/dist/src/charts/sankey.d.ts +2 -2
- package/dist/src/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/chartformers.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import aa, { useRef as Pt, useEffect as
|
|
1
|
+
import aa, { useRef as Pt, useEffect as _t, useState as ut } from "react";
|
|
2
2
|
import { createPortal as kn } from "react-dom";
|
|
3
3
|
var Xe = { exports: {} }, Se = {};
|
|
4
4
|
/**
|
|
@@ -48,41 +48,41 @@ function oa() {
|
|
|
48
48
|
function t(m) {
|
|
49
49
|
if (m == null) return null;
|
|
50
50
|
if (typeof m == "function")
|
|
51
|
-
return m.$$typeof ===
|
|
51
|
+
return m.$$typeof === $ ? null : m.displayName || m.name || null;
|
|
52
52
|
if (typeof m == "string") return m;
|
|
53
53
|
switch (m) {
|
|
54
|
-
case
|
|
54
|
+
case J:
|
|
55
55
|
return "Fragment";
|
|
56
|
-
case
|
|
56
|
+
case z:
|
|
57
57
|
return "Profiler";
|
|
58
|
-
case
|
|
58
|
+
case j:
|
|
59
59
|
return "StrictMode";
|
|
60
|
-
case
|
|
60
|
+
case W:
|
|
61
61
|
return "Suspense";
|
|
62
|
-
case
|
|
62
|
+
case Y:
|
|
63
63
|
return "SuspenseList";
|
|
64
|
-
case
|
|
64
|
+
case et:
|
|
65
65
|
return "Activity";
|
|
66
66
|
}
|
|
67
67
|
if (typeof m == "object")
|
|
68
68
|
switch (typeof m.tag == "number" && console.error(
|
|
69
69
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
70
|
), m.$$typeof) {
|
|
71
|
-
case
|
|
71
|
+
case D:
|
|
72
72
|
return "Portal";
|
|
73
|
-
case
|
|
73
|
+
case k:
|
|
74
74
|
return m.displayName || "Context";
|
|
75
|
-
case
|
|
75
|
+
case M:
|
|
76
76
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
77
|
-
case
|
|
78
|
-
var
|
|
79
|
-
return m = m.displayName, m || (m =
|
|
80
|
-
case
|
|
81
|
-
return
|
|
82
|
-
case
|
|
83
|
-
|
|
77
|
+
case R:
|
|
78
|
+
var E = m.render;
|
|
79
|
+
return m = m.displayName, m || (m = E.displayName || E.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
80
|
+
case K:
|
|
81
|
+
return E = m.displayName || null, E !== null ? E : t(m.type) || "Memo";
|
|
82
|
+
case q:
|
|
83
|
+
E = m._payload, m = m._init;
|
|
84
84
|
try {
|
|
85
|
-
return t(m(
|
|
85
|
+
return t(m(E));
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -94,72 +94,72 @@ function oa() {
|
|
|
94
94
|
function n(m) {
|
|
95
95
|
try {
|
|
96
96
|
e(m);
|
|
97
|
-
var
|
|
97
|
+
var E = !1;
|
|
98
98
|
} catch {
|
|
99
|
-
|
|
99
|
+
E = !0;
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
var
|
|
104
|
-
return
|
|
105
|
-
|
|
101
|
+
if (E) {
|
|
102
|
+
E = console;
|
|
103
|
+
var L = E.error, B = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
104
|
+
return L.call(
|
|
105
|
+
E,
|
|
106
106
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
-
|
|
107
|
+
B
|
|
108
108
|
), e(m);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
function r(m) {
|
|
112
|
-
if (m ===
|
|
113
|
-
if (typeof m == "object" && m !== null && m.$$typeof ===
|
|
112
|
+
if (m === J) return "<>";
|
|
113
|
+
if (typeof m == "object" && m !== null && m.$$typeof === q)
|
|
114
114
|
return "<...>";
|
|
115
115
|
try {
|
|
116
|
-
var
|
|
117
|
-
return
|
|
116
|
+
var E = t(m);
|
|
117
|
+
return E ? "<" + E + ">" : "<...>";
|
|
118
118
|
} catch {
|
|
119
119
|
return "<...>";
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
function i() {
|
|
123
|
-
var m =
|
|
123
|
+
var m = C.A;
|
|
124
124
|
return m === null ? null : m.getOwner();
|
|
125
125
|
}
|
|
126
126
|
function a() {
|
|
127
127
|
return Error("react-stack-top-frame");
|
|
128
128
|
}
|
|
129
129
|
function s(m) {
|
|
130
|
-
if (
|
|
131
|
-
var
|
|
132
|
-
if (
|
|
130
|
+
if (b.call(m, "key")) {
|
|
131
|
+
var E = Object.getOwnPropertyDescriptor(m, "key").get;
|
|
132
|
+
if (E && E.isReactWarning) return !1;
|
|
133
133
|
}
|
|
134
134
|
return m.key !== void 0;
|
|
135
135
|
}
|
|
136
|
-
function o(m,
|
|
137
|
-
function
|
|
138
|
-
|
|
136
|
+
function o(m, E) {
|
|
137
|
+
function L() {
|
|
138
|
+
A || (A = !0, console.error(
|
|
139
139
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
|
-
|
|
140
|
+
E
|
|
141
141
|
));
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
get:
|
|
143
|
+
L.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
144
|
+
get: L,
|
|
145
145
|
configurable: !0
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
function c() {
|
|
149
149
|
var m = t(this.type);
|
|
150
|
-
return
|
|
150
|
+
return S[m] || (S[m] = !0, console.error(
|
|
151
151
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
152
|
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
153
153
|
}
|
|
154
|
-
function l(m,
|
|
155
|
-
var
|
|
154
|
+
function l(m, E, L, B, tt, G) {
|
|
155
|
+
var O = L.ref;
|
|
156
156
|
return m = {
|
|
157
|
-
$$typeof:
|
|
157
|
+
$$typeof: _,
|
|
158
158
|
type: m,
|
|
159
|
-
key:
|
|
160
|
-
props:
|
|
161
|
-
_owner:
|
|
162
|
-
}, (
|
|
159
|
+
key: E,
|
|
160
|
+
props: L,
|
|
161
|
+
_owner: B
|
|
162
|
+
}, (O !== void 0 ? O : null) !== null ? Object.defineProperty(m, "ref", {
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
get: c
|
|
165
165
|
}) : Object.defineProperty(m, "ref", { enumerable: !1, value: null }), m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
@@ -176,99 +176,99 @@ function oa() {
|
|
|
176
176
|
configurable: !1,
|
|
177
177
|
enumerable: !1,
|
|
178
178
|
writable: !0,
|
|
179
|
-
value:
|
|
179
|
+
value: tt
|
|
180
180
|
}), Object.defineProperty(m, "_debugTask", {
|
|
181
181
|
configurable: !1,
|
|
182
182
|
enumerable: !1,
|
|
183
183
|
writable: !0,
|
|
184
|
-
value:
|
|
184
|
+
value: G
|
|
185
185
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
186
186
|
}
|
|
187
|
-
function u(m,
|
|
188
|
-
var
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
for (
|
|
193
|
-
h(
|
|
194
|
-
Object.freeze && Object.freeze(
|
|
187
|
+
function u(m, E, L, B, tt, G) {
|
|
188
|
+
var O = E.children;
|
|
189
|
+
if (O !== void 0)
|
|
190
|
+
if (B)
|
|
191
|
+
if (P(O)) {
|
|
192
|
+
for (B = 0; B < O.length; B++)
|
|
193
|
+
h(O[B]);
|
|
194
|
+
Object.freeze && Object.freeze(O);
|
|
195
195
|
} else
|
|
196
196
|
console.error(
|
|
197
197
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
198
|
);
|
|
199
|
-
else h(
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
var
|
|
203
|
-
return
|
|
199
|
+
else h(O);
|
|
200
|
+
if (b.call(E, "key")) {
|
|
201
|
+
O = t(m);
|
|
202
|
+
var X = Object.keys(E).filter(function(p) {
|
|
203
|
+
return p !== "key";
|
|
204
204
|
});
|
|
205
|
-
|
|
205
|
+
B = 0 < X.length ? "{key: someKey, " + X.join(": ..., ") + ": ...}" : "{key: someKey}", T[O + B] || (X = 0 < X.length ? "{" + X.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
207
|
let props = %s;
|
|
208
208
|
<%s {...props} />
|
|
209
209
|
React keys must be passed directly to JSX without using spread:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s key={someKey} {...props} />`,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
),
|
|
212
|
+
B,
|
|
213
|
+
O,
|
|
214
|
+
X,
|
|
215
|
+
O
|
|
216
|
+
), T[O + B] = !0);
|
|
217
217
|
}
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
for (var
|
|
221
|
-
|
|
222
|
-
} else
|
|
223
|
-
return
|
|
224
|
-
|
|
218
|
+
if (O = null, L !== void 0 && (n(L), O = "" + L), s(E) && (n(E.key), O = "" + E.key), "key" in E) {
|
|
219
|
+
L = {};
|
|
220
|
+
for (var d in E)
|
|
221
|
+
d !== "key" && (L[d] = E[d]);
|
|
222
|
+
} else L = E;
|
|
223
|
+
return O && o(
|
|
224
|
+
L,
|
|
225
225
|
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
226
226
|
), l(
|
|
227
227
|
m,
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
O,
|
|
229
|
+
L,
|
|
230
230
|
i(),
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
tt,
|
|
232
|
+
G
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
function h(m) {
|
|
236
|
-
f(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof ===
|
|
236
|
+
f(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === q && (m._payload.status === "fulfilled" ? f(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
|
|
237
237
|
}
|
|
238
238
|
function f(m) {
|
|
239
|
-
return typeof m == "object" && m !== null && m.$$typeof ===
|
|
239
|
+
return typeof m == "object" && m !== null && m.$$typeof === _;
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var y = aa, _ = Symbol.for("react.transitional.element"), D = Symbol.for("react.portal"), J = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), z = Symbol.for("react.profiler"), M = Symbol.for("react.consumer"), k = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), et = Symbol.for("react.activity"), $ = Symbol.for("react.client.reference"), C = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, b = Object.prototype.hasOwnProperty, P = Array.isArray, g = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
y = {
|
|
245
245
|
react_stack_bottom_frame: function(m) {
|
|
246
246
|
return m();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
249
|
+
var A, S = {}, N = y.react_stack_bottom_frame.bind(
|
|
250
|
+
y,
|
|
251
251
|
a
|
|
252
|
-
)(), x =
|
|
253
|
-
Me.Fragment =
|
|
254
|
-
var
|
|
252
|
+
)(), x = g(r(a)), T = {};
|
|
253
|
+
Me.Fragment = J, Me.jsx = function(m, E, L) {
|
|
254
|
+
var B = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return u(
|
|
256
256
|
m,
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
E,
|
|
258
|
+
L,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
B ? Error("react-stack-top-frame") : N,
|
|
261
|
+
B ? g(r(m)) : x
|
|
262
262
|
);
|
|
263
|
-
}, Me.jsxs = function(m,
|
|
264
|
-
var
|
|
263
|
+
}, Me.jsxs = function(m, E, L) {
|
|
264
|
+
var B = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
265
265
|
return u(
|
|
266
266
|
m,
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
E,
|
|
268
|
+
L,
|
|
269
269
|
!0,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
B ? Error("react-stack-top-frame") : N,
|
|
271
|
+
B ? g(r(m)) : x
|
|
272
272
|
);
|
|
273
273
|
};
|
|
274
274
|
})()), Me;
|
|
@@ -430,39 +430,39 @@ function Ra() {
|
|
|
430
430
|
}
|
|
431
431
|
function fi(t, e) {
|
|
432
432
|
var n = [], r = null, i = null, a = 6, s = 6, o = 3, c = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, l = t === En || t === Re ? -1 : 1, u = t === Re || t === Cn ? "x" : "y", h = t === En || t === Yn ? Na : Sa;
|
|
433
|
-
function f(
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
return isFinite(
|
|
437
|
-
}),
|
|
438
|
-
var
|
|
439
|
-
return h((
|
|
440
|
-
})),
|
|
441
|
-
return h(
|
|
442
|
-
}),
|
|
443
|
-
this.__axis =
|
|
433
|
+
function f(y) {
|
|
434
|
+
var _ = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), D = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : Aa), J = Math.max(a, 0) + o, j = e.range(), z = +j[0] + c, M = +j[j.length - 1] + c, k = (e.bandwidth ? Ta : Ma)(e.copy(), c), R = y.selection ? y.selection() : y, W = R.selectAll(".domain").data([null]), Y = R.selectAll(".tick").data(_, e).order(), K = Y.exit(), q = Y.enter().append("g").attr("class", "tick"), et = Y.select("line"), $ = Y.select("text");
|
|
435
|
+
W = W.merge(W.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), Y = Y.merge(q), et = et.merge(q.append("line").attr("stroke", "currentColor").attr(u + "2", l * a)), $ = $.merge(q.append("text").attr("fill", "currentColor").attr(u, l * J).attr("dy", t === En ? "0em" : t === Yn ? "0.71em" : "0.32em")), y !== R && (W = W.transition(y), Y = Y.transition(y), et = et.transition(y), $ = $.transition(y), K = K.transition(y).attr("opacity", br).attr("transform", function(C) {
|
|
436
|
+
return isFinite(C = k(C)) ? h(C + c) : this.getAttribute("transform");
|
|
437
|
+
}), q.attr("opacity", br).attr("transform", function(C) {
|
|
438
|
+
var b = this.parentNode.__axis;
|
|
439
|
+
return h((b && isFinite(b = b(C)) ? b : k(C)) + c);
|
|
440
|
+
})), K.remove(), W.attr("d", t === Re || t === Cn ? s ? "M" + l * s + "," + z + "H" + c + "V" + M + "H" + l * s : "M" + c + "," + z + "V" + M : s ? "M" + z + "," + l * s + "V" + c + "H" + M + "V" + l * s : "M" + z + "," + c + "H" + M), Y.attr("opacity", 1).attr("transform", function(C) {
|
|
441
|
+
return h(k(C) + c);
|
|
442
|
+
}), et.attr(u + "2", l * a), $.attr(u, l * J).text(D), R.filter(Ra).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === Cn ? "start" : t === Re ? "end" : "middle"), R.each(function() {
|
|
443
|
+
this.__axis = k;
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
|
-
return f.scale = function(
|
|
447
|
-
return arguments.length ? (e =
|
|
446
|
+
return f.scale = function(y) {
|
|
447
|
+
return arguments.length ? (e = y, f) : e;
|
|
448
448
|
}, f.ticks = function() {
|
|
449
449
|
return n = Array.from(arguments), f;
|
|
450
|
-
}, f.tickArguments = function(
|
|
451
|
-
return arguments.length ? (n =
|
|
452
|
-
}, f.tickValues = function(
|
|
453
|
-
return arguments.length ? (r =
|
|
454
|
-
}, f.tickFormat = function(
|
|
455
|
-
return arguments.length ? (i =
|
|
456
|
-
}, f.tickSize = function(
|
|
457
|
-
return arguments.length ? (a = s = +
|
|
458
|
-
}, f.tickSizeInner = function(
|
|
459
|
-
return arguments.length ? (a = +
|
|
460
|
-
}, f.tickSizeOuter = function(
|
|
461
|
-
return arguments.length ? (s = +
|
|
462
|
-
}, f.tickPadding = function(
|
|
463
|
-
return arguments.length ? (o = +
|
|
464
|
-
}, f.offset = function(
|
|
465
|
-
return arguments.length ? (c = +
|
|
450
|
+
}, f.tickArguments = function(y) {
|
|
451
|
+
return arguments.length ? (n = y == null ? [] : Array.from(y), f) : n.slice();
|
|
452
|
+
}, f.tickValues = function(y) {
|
|
453
|
+
return arguments.length ? (r = y == null ? null : Array.from(y), f) : r && r.slice();
|
|
454
|
+
}, f.tickFormat = function(y) {
|
|
455
|
+
return arguments.length ? (i = y, f) : i;
|
|
456
|
+
}, f.tickSize = function(y) {
|
|
457
|
+
return arguments.length ? (a = s = +y, f) : a;
|
|
458
|
+
}, f.tickSizeInner = function(y) {
|
|
459
|
+
return arguments.length ? (a = +y, f) : a;
|
|
460
|
+
}, f.tickSizeOuter = function(y) {
|
|
461
|
+
return arguments.length ? (s = +y, f) : s;
|
|
462
|
+
}, f.tickPadding = function(y) {
|
|
463
|
+
return arguments.length ? (o = +y, f) : o;
|
|
464
|
+
}, f.offset = function(y) {
|
|
465
|
+
return arguments.length ? (c = +y, f) : c;
|
|
466
466
|
}, f;
|
|
467
467
|
}
|
|
468
468
|
function Zt(t) {
|
|
@@ -673,11 +673,11 @@ function Qa(t, e, n, r, i, a) {
|
|
|
673
673
|
(o = e[s]) && (i[s] = o);
|
|
674
674
|
}
|
|
675
675
|
function ts(t, e, n, r, i, a, s) {
|
|
676
|
-
var o, c, l = /* @__PURE__ */ new Map(), u = e.length, h = a.length, f = new Array(u),
|
|
676
|
+
var o, c, l = /* @__PURE__ */ new Map(), u = e.length, h = a.length, f = new Array(u), y;
|
|
677
677
|
for (o = 0; o < u; ++o)
|
|
678
|
-
(c = e[o]) && (f[o] =
|
|
678
|
+
(c = e[o]) && (f[o] = y = s.call(c, c.__data__, o, e) + "", l.has(y) ? i[o] = c : l.set(y, c));
|
|
679
679
|
for (o = 0; o < h; ++o)
|
|
680
|
-
|
|
680
|
+
y = s.call(t, a[o], o, a) + "", (c = l.get(y)) ? (r[o] = c, c.__data__ = a[o], l.delete(y)) : n[o] = new cn(t, a[o]);
|
|
681
681
|
for (o = 0; o < u; ++o)
|
|
682
682
|
(c = e[o]) && l.get(f[o]) === c && (i[o] = c);
|
|
683
683
|
}
|
|
@@ -689,12 +689,12 @@ function ns(t, e) {
|
|
|
689
689
|
var n = e ? ts : Qa, r = this._parents, i = this._groups;
|
|
690
690
|
typeof t != "function" && (t = Za(t));
|
|
691
691
|
for (var a = i.length, s = new Array(a), o = new Array(a), c = new Array(a), l = 0; l < a; ++l) {
|
|
692
|
-
var u = r[l], h = i[l], f = h.length,
|
|
693
|
-
n(u, h,
|
|
694
|
-
for (var
|
|
695
|
-
if (
|
|
696
|
-
for (
|
|
697
|
-
|
|
692
|
+
var u = r[l], h = i[l], f = h.length, y = rs(t.call(u, u && u.__data__, l, r)), _ = y.length, D = o[l] = new Array(_), J = s[l] = new Array(_), j = c[l] = new Array(f);
|
|
693
|
+
n(u, h, D, J, j, y, e);
|
|
694
|
+
for (var z = 0, M = 0, k, R; z < _; ++z)
|
|
695
|
+
if (k = D[z]) {
|
|
696
|
+
for (z >= M && (M = z + 1); !(R = J[M]) && ++M < _; ) ;
|
|
697
|
+
k._next = R || null;
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
return s = new At(s, r), s._enter = o, s._exit = c, s;
|
|
@@ -711,8 +711,8 @@ function as(t, e, n) {
|
|
|
711
711
|
}
|
|
712
712
|
function ss(t) {
|
|
713
713
|
for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, s = Math.min(i, a), o = new Array(i), c = 0; c < s; ++c)
|
|
714
|
-
for (var l = n[c], u = r[c], h = l.length, f = o[c] = new Array(h),
|
|
715
|
-
(
|
|
714
|
+
for (var l = n[c], u = r[c], h = l.length, f = o[c] = new Array(h), y, _ = 0; _ < h; ++_)
|
|
715
|
+
(y = l[_] || u[_]) && (f[_] = y);
|
|
716
716
|
for (; c < i; ++c)
|
|
717
717
|
o[c] = n[c];
|
|
718
718
|
return new At(o, this._parents);
|
|
@@ -1295,35 +1295,35 @@ function Nr() {
|
|
|
1295
1295
|
}
|
|
1296
1296
|
function oe(t) {
|
|
1297
1297
|
var e, n;
|
|
1298
|
-
return t = (t + "").trim().toLowerCase(), (e = ho.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Sr(e) : n === 3 ? new
|
|
1298
|
+
return t = (t + "").trim().toLowerCase(), (e = ho.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Sr(e) : n === 3 ? new xt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Ke(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Ke(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = po.exec(t)) ? new xt(e[1], e[2], e[3], 1) : (e = go.exec(t)) ? new xt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = yo.exec(t)) ? Ke(e[1], e[2], e[3], e[4]) : (e = mo.exec(t)) ? Ke(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = xo.exec(t)) ? Rr(e[1], e[2] / 100, e[3] / 100, 1) : (e = vo.exec(t)) ? Rr(e[1], e[2] / 100, e[3] / 100, e[4]) : $r.hasOwnProperty(t) ? Sr($r[t]) : t === "transparent" ? new xt(NaN, NaN, NaN, 0) : null;
|
|
1299
1299
|
}
|
|
1300
1300
|
function Sr(t) {
|
|
1301
|
-
return new
|
|
1301
|
+
return new xt(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
|
|
1302
1302
|
}
|
|
1303
1303
|
function Ke(t, e, n, r) {
|
|
1304
|
-
return r <= 0 && (t = e = n = NaN), new
|
|
1304
|
+
return r <= 0 && (t = e = n = NaN), new xt(t, e, n, r);
|
|
1305
1305
|
}
|
|
1306
1306
|
function Ai(t) {
|
|
1307
|
-
return t instanceof fe || (t = oe(t)), t ? (t = t.rgb(), new
|
|
1307
|
+
return t instanceof fe || (t = oe(t)), t ? (t = t.rgb(), new xt(t.r, t.g, t.b, t.opacity)) : new xt();
|
|
1308
1308
|
}
|
|
1309
1309
|
function Xn(t, e, n, r) {
|
|
1310
|
-
return arguments.length === 1 ? Ai(t) : new
|
|
1310
|
+
return arguments.length === 1 ? Ai(t) : new xt(t, e, n, r ?? 1);
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function xt(t, e, n, r) {
|
|
1313
1313
|
this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
|
|
1314
1314
|
}
|
|
1315
|
-
Fe(
|
|
1315
|
+
Fe(xt, Xn, An(fe, {
|
|
1316
1316
|
brighter(t) {
|
|
1317
|
-
return t = t == null ? un : Math.pow(un, t), new
|
|
1317
|
+
return t = t == null ? un : Math.pow(un, t), new xt(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
1318
1318
|
},
|
|
1319
1319
|
darker(t) {
|
|
1320
|
-
return t = t == null ? Ie : Math.pow(Ie, t), new
|
|
1320
|
+
return t = t == null ? Ie : Math.pow(Ie, t), new xt(this.r * t, this.g * t, this.b * t, this.opacity);
|
|
1321
1321
|
},
|
|
1322
1322
|
rgb() {
|
|
1323
1323
|
return this;
|
|
1324
1324
|
},
|
|
1325
1325
|
clamp() {
|
|
1326
|
-
return new
|
|
1326
|
+
return new xt(se(this.r), se(this.g), se(this.b), fn(this.opacity));
|
|
1327
1327
|
},
|
|
1328
1328
|
displayable() {
|
|
1329
1329
|
return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
|
@@ -1380,7 +1380,7 @@ Fe(Rt, ko, An(fe, {
|
|
|
1380
1380
|
},
|
|
1381
1381
|
rgb() {
|
|
1382
1382
|
var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
|
|
1383
|
-
return new
|
|
1383
|
+
return new xt(
|
|
1384
1384
|
Ln(t >= 240 ? t - 240 : t + 120, i, r),
|
|
1385
1385
|
Ln(t, i, r),
|
|
1386
1386
|
Ln(t < 120 ? t + 240 : t - 120, i, r),
|
|
@@ -1411,7 +1411,7 @@ const $o = Math.PI / 180, Ao = 180 / Math.PI, hn = 18, Si = 0.96422, Mi = 1, Ti
|
|
|
1411
1411
|
function Ci(t) {
|
|
1412
1412
|
if (t instanceof zt) return new zt(t.l, t.a, t.b, t.opacity);
|
|
1413
1413
|
if (t instanceof Wt) return Li(t);
|
|
1414
|
-
t instanceof
|
|
1414
|
+
t instanceof xt || (t = Ai(t));
|
|
1415
1415
|
var e = In(t.r), n = In(t.g), r = In(t.b), i = Dn((0.2225045 * e + 0.7168786 * n + 0.0606169 * r) / Mi), a, s;
|
|
1416
1416
|
return e === n && n === r ? a = s = i : (a = Dn((0.4360747 * e + 0.3850649 * n + 0.1430804 * r) / Si), s = Dn((0.0139322 * e + 0.0971045 * n + 0.7141733 * r) / Ti)), new zt(116 * i - 16, 500 * (a - i), 200 * (i - s), t.opacity);
|
|
1417
1417
|
}
|
|
@@ -1430,7 +1430,7 @@ Fe(zt, So, An(fe, {
|
|
|
1430
1430
|
},
|
|
1431
1431
|
rgb() {
|
|
1432
1432
|
var t = (this.l + 16) / 116, e = isNaN(this.a) ? t : t + this.a / 500, n = isNaN(this.b) ? t : t - this.b / 200;
|
|
1433
|
-
return e = Si * jn(e), t = Mi * jn(t), n = Ti * jn(n), new
|
|
1433
|
+
return e = Si * jn(e), t = Mi * jn(t), n = Ti * jn(n), new xt(
|
|
1434
1434
|
Pn(3.1338561 * e - 1.6168667 * t - 0.4906146 * n),
|
|
1435
1435
|
Pn(-0.9787684 * e + 1.9161415 * t + 0.033454 * n),
|
|
1436
1436
|
Pn(0.0719453 * e - 0.2289914 * t + 1.4052427 * n),
|
|
@@ -1613,11 +1613,11 @@ function Ii(t, e, n, r) {
|
|
|
1613
1613
|
function i(l) {
|
|
1614
1614
|
return l.length ? l.pop() + " " : "";
|
|
1615
1615
|
}
|
|
1616
|
-
function a(l, u, h, f,
|
|
1616
|
+
function a(l, u, h, f, y, _) {
|
|
1617
1617
|
if (l !== h || u !== f) {
|
|
1618
|
-
var
|
|
1619
|
-
|
|
1620
|
-
} else (h || f) &&
|
|
1618
|
+
var D = y.push("translate(", null, e, null, n);
|
|
1619
|
+
_.push({ i: D - 4, x: Nt(l, h) }, { i: D - 2, x: Nt(u, f) });
|
|
1620
|
+
} else (h || f) && y.push("translate(" + h + e + f + n);
|
|
1621
1621
|
}
|
|
1622
1622
|
function s(l, u, h, f) {
|
|
1623
1623
|
l !== u ? (l - u > 180 ? u += 360 : u - l > 180 && (l += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Nt(l, u) })) : u && h.push(i(h) + "rotate(" + u + r);
|
|
@@ -1625,16 +1625,16 @@ function Ii(t, e, n, r) {
|
|
|
1625
1625
|
function o(l, u, h, f) {
|
|
1626
1626
|
l !== u ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Nt(l, u) }) : u && h.push(i(h) + "skewX(" + u + r);
|
|
1627
1627
|
}
|
|
1628
|
-
function c(l, u, h, f,
|
|
1628
|
+
function c(l, u, h, f, y, _) {
|
|
1629
1629
|
if (l !== h || u !== f) {
|
|
1630
|
-
var
|
|
1631
|
-
|
|
1632
|
-
} else (h !== 1 || f !== 1) &&
|
|
1630
|
+
var D = y.push(i(y) + "scale(", null, ",", null, ")");
|
|
1631
|
+
_.push({ i: D - 4, x: Nt(l, h) }, { i: D - 2, x: Nt(u, f) });
|
|
1632
|
+
} else (h !== 1 || f !== 1) && y.push(i(y) + "scale(" + h + "," + f + ")");
|
|
1633
1633
|
}
|
|
1634
1634
|
return function(l, u) {
|
|
1635
1635
|
var h = [], f = [];
|
|
1636
|
-
return l = t(l), u = t(u), a(l.translateX, l.translateY, u.translateX, u.translateY, h, f), s(l.rotate, u.rotate, h, f), o(l.skewX, u.skewX, h, f), c(l.scaleX, l.scaleY, u.scaleX, u.scaleY, h, f), l = u = null, function(
|
|
1637
|
-
for (var
|
|
1636
|
+
return l = t(l), u = t(u), a(l.translateX, l.translateY, u.translateX, u.translateY, h, f), s(l.rotate, u.rotate, h, f), o(l.skewX, u.skewX, h, f), c(l.scaleX, l.scaleY, u.scaleX, u.scaleY, h, f), l = u = null, function(y) {
|
|
1637
|
+
for (var _ = -1, D = f.length, J; ++_ < D; ) h[(J = f[_]).i] = J.x(y);
|
|
1638
1638
|
return h.join("");
|
|
1639
1639
|
};
|
|
1640
1640
|
};
|
|
@@ -1754,18 +1754,18 @@ function Zo(t, e, n) {
|
|
|
1754
1754
|
n.state = jr, n.timer.restart(s, n.delay, n.time), n.delay <= l && s(l - n.delay);
|
|
1755
1755
|
}
|
|
1756
1756
|
function s(l) {
|
|
1757
|
-
var u, h, f,
|
|
1757
|
+
var u, h, f, y;
|
|
1758
1758
|
if (n.state !== jr) return c();
|
|
1759
1759
|
for (u in r)
|
|
1760
|
-
if (
|
|
1761
|
-
if (
|
|
1762
|
-
|
|
1760
|
+
if (y = r[u], y.name === n.name) {
|
|
1761
|
+
if (y.state === an) return Dr(s);
|
|
1762
|
+
y.state === Pr ? (y.state = sn, y.timer.stop(), y.on.call("interrupt", t, t.__data__, y.index, y.group), delete r[u]) : +u < e && (y.state = sn, y.timer.stop(), y.on.call("cancel", t, t.__data__, y.index, y.group), delete r[u]);
|
|
1763
1763
|
}
|
|
1764
1764
|
if (Dr(function() {
|
|
1765
1765
|
n.state === an && (n.state = Pr, n.timer.restart(o, n.delay, n.time), o(l));
|
|
1766
1766
|
}), n.state = Zn, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Zn) {
|
|
1767
1767
|
for (n.state = an, i = new Array(f = n.tween.length), u = 0, h = -1; u < f; ++u)
|
|
1768
|
-
(
|
|
1768
|
+
(y = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = y);
|
|
1769
1769
|
i.length = h + 1;
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
@@ -1989,8 +1989,8 @@ function Nl(t) {
|
|
|
1989
1989
|
function Sl(t) {
|
|
1990
1990
|
if (t._id !== this._id) throw new Error();
|
|
1991
1991
|
for (var e = this._groups, n = t._groups, r = e.length, i = n.length, a = Math.min(r, i), s = new Array(r), o = 0; o < a; ++o)
|
|
1992
|
-
for (var c = e[o], l = n[o], u = c.length, h = s[o] = new Array(u), f,
|
|
1993
|
-
(f = c[
|
|
1992
|
+
for (var c = e[o], l = n[o], u = c.length, h = s[o] = new Array(u), f, y = 0; y < u; ++y)
|
|
1993
|
+
(f = c[y] || l[y]) && (h[y] = f);
|
|
1994
1994
|
for (; o < r; ++o)
|
|
1995
1995
|
s[o] = e[o];
|
|
1996
1996
|
return new Bt(s, this._parents, this._name, this._id);
|
|
@@ -2036,8 +2036,8 @@ function Dl(t) {
|
|
|
2036
2036
|
for (var r = this._groups, i = r.length, a = [], s = [], o = 0; o < i; ++o)
|
|
2037
2037
|
for (var c = r[o], l = c.length, u, h = 0; h < l; ++h)
|
|
2038
2038
|
if (u = c[h]) {
|
|
2039
|
-
for (var f = t.call(u, u.__data__, h, c),
|
|
2040
|
-
(
|
|
2039
|
+
for (var f = t.call(u, u.__data__, h, c), y, _ = Ct(u, n), D = 0, J = f.length; D < J; ++D)
|
|
2040
|
+
(y = f[D]) && Mn(y, e, n, D, f, _);
|
|
2041
2041
|
a.push(f), s.push(u);
|
|
2042
2042
|
}
|
|
2043
2043
|
return new Bt(a, s, e, n);
|
|
@@ -2277,8 +2277,8 @@ let oc = class {
|
|
|
2277
2277
|
else if (f > re) if (!(Math.abs(h * c - l * u) > re) || !a)
|
|
2278
2278
|
this._append`L${this._x1 = e},${this._y1 = n}`;
|
|
2279
2279
|
else {
|
|
2280
|
-
let
|
|
2281
|
-
Math.abs(
|
|
2280
|
+
let y = r - s, _ = i - o, D = c * c + l * l, J = y * y + _ * _, j = Math.sqrt(D), z = Math.sqrt(f), M = a * Math.tan((tr - Math.acos((D + f - J) / (2 * j * z))) / 2), k = M / z, R = M / j;
|
|
2281
|
+
Math.abs(k - 1) > re && this._append`L${e + k * u},${n + k * h}`, this._append`A${a},${a},0,0,${+(h * y > u * _)},${this._x1 = e + R * c},${this._y1 = n + R * l}`;
|
|
2282
2282
|
}
|
|
2283
2283
|
}
|
|
2284
2284
|
arc(e, n, r, i, a, s) {
|
|
@@ -2397,51 +2397,51 @@ function pc(t) {
|
|
|
2397
2397
|
var e = t.grouping === void 0 || t.thousands === void 0 ? Hr : cc(Or.call(t.grouping, Number), t.thousands + ""), n = t.currency === void 0 ? "" : t.currency[0] + "", r = t.currency === void 0 ? "" : t.currency[1] + "", i = t.decimal === void 0 ? "." : t.decimal + "", a = t.numerals === void 0 ? Hr : uc(Or.call(t.numerals, String)), s = t.percent === void 0 ? "%" : t.percent + "", o = t.minus === void 0 ? "−" : t.minus + "", c = t.nan === void 0 ? "NaN" : t.nan + "";
|
|
2398
2398
|
function l(h) {
|
|
2399
2399
|
h = xn(h);
|
|
2400
|
-
var f = h.fill,
|
|
2401
|
-
|
|
2402
|
-
var
|
|
2403
|
-
|
|
2404
|
-
function
|
|
2405
|
-
var
|
|
2406
|
-
if (
|
|
2407
|
-
|
|
2400
|
+
var f = h.fill, y = h.align, _ = h.sign, D = h.symbol, J = h.zero, j = h.width, z = h.comma, M = h.precision, k = h.trim, R = h.type;
|
|
2401
|
+
R === "n" ? (z = !0, R = "g") : zr[R] || (M === void 0 && (M = 12), k = !0, R = "g"), (J || f === "0" && y === "=") && (J = !0, f = "0", y = "=");
|
|
2402
|
+
var W = D === "$" ? n : D === "#" && /[boxX]/.test(R) ? "0" + R.toLowerCase() : "", Y = D === "$" ? r : /[%p]/.test(R) ? s : "", K = zr[R], q = /[defgprs%]/.test(R);
|
|
2403
|
+
M = M === void 0 ? 6 : /[gprs]/.test(R) ? Math.max(1, Math.min(21, M)) : Math.max(0, Math.min(20, M));
|
|
2404
|
+
function et($) {
|
|
2405
|
+
var C = W, b = Y, P, g, A;
|
|
2406
|
+
if (R === "c")
|
|
2407
|
+
b = K($) + b, $ = "";
|
|
2408
2408
|
else {
|
|
2409
|
-
|
|
2410
|
-
var
|
|
2411
|
-
if (
|
|
2412
|
-
for (
|
|
2413
|
-
if (
|
|
2414
|
-
|
|
2409
|
+
$ = +$;
|
|
2410
|
+
var S = $ < 0 || 1 / $ < 0;
|
|
2411
|
+
if ($ = isNaN($) ? c : K(Math.abs($), M), k && ($ = hc($)), S && +$ == 0 && _ !== "+" && (S = !1), C = (S ? _ === "(" ? _ : o : _ === "-" || _ === "(" ? "" : _) + C, b = (R === "s" ? qr[8 + Bi / 3] : "") + b + (S && _ === "(" ? ")" : ""), q) {
|
|
2412
|
+
for (P = -1, g = $.length; ++P < g; )
|
|
2413
|
+
if (A = $.charCodeAt(P), 48 > A || A > 57) {
|
|
2414
|
+
b = (A === 46 ? i + $.slice(P + 1) : $.slice(P)) + b, $ = $.slice(0, P);
|
|
2415
2415
|
break;
|
|
2416
2416
|
}
|
|
2417
2417
|
}
|
|
2418
2418
|
}
|
|
2419
|
-
|
|
2420
|
-
var N =
|
|
2421
|
-
switch (
|
|
2419
|
+
z && !J && ($ = e($, 1 / 0));
|
|
2420
|
+
var N = C.length + $.length + b.length, x = N < j ? new Array(j - N + 1).join(f) : "";
|
|
2421
|
+
switch (z && J && ($ = e(x + $, x.length ? j - b.length : 1 / 0), x = ""), y) {
|
|
2422
2422
|
case "<":
|
|
2423
|
-
|
|
2423
|
+
$ = C + $ + b + x;
|
|
2424
2424
|
break;
|
|
2425
2425
|
case "=":
|
|
2426
|
-
|
|
2426
|
+
$ = C + x + $ + b;
|
|
2427
2427
|
break;
|
|
2428
2428
|
case "^":
|
|
2429
|
-
|
|
2429
|
+
$ = x.slice(0, N = x.length >> 1) + C + $ + b + x.slice(N);
|
|
2430
2430
|
break;
|
|
2431
2431
|
default:
|
|
2432
|
-
|
|
2432
|
+
$ = x + C + $ + b;
|
|
2433
2433
|
break;
|
|
2434
2434
|
}
|
|
2435
|
-
return a(
|
|
2435
|
+
return a($);
|
|
2436
2436
|
}
|
|
2437
|
-
return
|
|
2437
|
+
return et.toString = function() {
|
|
2438
2438
|
return h + "";
|
|
2439
|
-
},
|
|
2439
|
+
}, et;
|
|
2440
2440
|
}
|
|
2441
2441
|
function u(h, f) {
|
|
2442
|
-
var
|
|
2443
|
-
return function(
|
|
2444
|
-
return
|
|
2442
|
+
var y = l((h = xn(h), h.type = "f", h)), _ = Math.max(-8, Math.min(8, Math.floor($e(f) / 3))) * 3, D = Math.pow(10, -_), J = qr[8 + _ / 3];
|
|
2443
|
+
return function(j) {
|
|
2444
|
+
return y(D * j) + J;
|
|
2445
2445
|
};
|
|
2446
2446
|
}
|
|
2447
2447
|
return {
|
|
@@ -2690,11 +2690,11 @@ function Le(t, e) {
|
|
|
2690
2690
|
};
|
|
2691
2691
|
}
|
|
2692
2692
|
function Ui(t, e, n) {
|
|
2693
|
-
var r = t.x, i = t.y, a = t.r, s = e.x, o = e.y, c = e.r, l = n.x, u = n.y, h = n.r, f = r - s,
|
|
2693
|
+
var r = t.x, i = t.y, a = t.r, s = e.x, o = e.y, c = e.r, l = n.x, u = n.y, h = n.r, f = r - s, y = r - l, _ = i - o, D = i - u, J = c - a, j = h - a, z = r * r + i * i - a * a, M = z - s * s - o * o + c * c, k = z - l * l - u * u + h * h, R = y * _ - f * D, W = (_ * k - D * M) / (R * 2) - r, Y = (D * J - _ * j) / R, K = (y * M - f * k) / (R * 2) - i, q = (f * j - y * J) / R, et = Y * Y + q * q - 1, $ = 2 * (a + W * Y + K * q), C = W * W + K * K - a * a, b = -(Math.abs(et) > 1e-6 ? ($ + Math.sqrt($ * $ - 4 * et * C)) / (2 * et) : C / $);
|
|
2694
2694
|
return {
|
|
2695
|
-
x: r +
|
|
2696
|
-
y: i +
|
|
2697
|
-
r:
|
|
2695
|
+
x: r + W + Y * b,
|
|
2696
|
+
y: i + K + q * b,
|
|
2697
|
+
r: b
|
|
2698
2698
|
};
|
|
2699
2699
|
}
|
|
2700
2700
|
function Wr(t, e, n) {
|
|
@@ -2823,12 +2823,12 @@ function Ae() {
|
|
|
2823
2823
|
var t = Ji().unknown(void 0), e = t.domain, n = t.range, r = 0, i = 1, a, s, o = !1, c = 0, l = 0, u = 0.5;
|
|
2824
2824
|
delete t.unknown;
|
|
2825
2825
|
function h() {
|
|
2826
|
-
var f = e().length,
|
|
2827
|
-
a = (
|
|
2828
|
-
var
|
|
2829
|
-
return
|
|
2826
|
+
var f = e().length, y = i < r, _ = y ? i : r, D = y ? r : i;
|
|
2827
|
+
a = (D - _) / Math.max(1, f - c + l * 2), o && (a = Math.floor(a)), _ += (D - _ - a * (f - c)) * u, s = a * (1 - c), o && (_ = Math.round(_), s = Math.round(s));
|
|
2828
|
+
var J = wa(f).map(function(j) {
|
|
2829
|
+
return _ + a * j;
|
|
2830
2830
|
});
|
|
2831
|
-
return n(
|
|
2831
|
+
return n(y ? J.reverse() : J);
|
|
2832
2832
|
}
|
|
2833
2833
|
return t.domain = function(f) {
|
|
2834
2834
|
return arguments.length ? (e(f), h()) : e();
|
|
@@ -2918,8 +2918,8 @@ function su() {
|
|
|
2918
2918
|
return arguments.length ? (n = f, u()) : n;
|
|
2919
2919
|
}, h.unknown = function(f) {
|
|
2920
2920
|
return arguments.length ? (a = f, h) : a;
|
|
2921
|
-
}, function(f,
|
|
2922
|
-
return r = f, i =
|
|
2921
|
+
}, function(f, y) {
|
|
2922
|
+
return r = f, i = y, u();
|
|
2923
2923
|
};
|
|
2924
2924
|
}
|
|
2925
2925
|
function ou() {
|
|
@@ -2989,7 +2989,7 @@ function pt(t) {
|
|
|
2989
2989
|
return t;
|
|
2990
2990
|
};
|
|
2991
2991
|
}
|
|
2992
|
-
const Gr = Math.abs,
|
|
2992
|
+
const Gr = Math.abs, mt = Math.atan2, ee = Math.cos, uu = Math.max, qn = Math.min, Dt = Math.sin, me = Math.sqrt, wt = 1e-12, Oe = Math.PI, _n = Oe / 2, on = 2 * Oe;
|
|
2993
2993
|
function fu(t) {
|
|
2994
2994
|
return t > 1 ? 0 : t < -1 ? Oe : Math.acos(t);
|
|
2995
2995
|
}
|
|
@@ -3031,40 +3031,40 @@ function xu(t, e, n, r, i, a, s, o) {
|
|
|
3031
3031
|
return f = (u * (e - a) - h * (t - i)) / f, [t + f * c, e + f * l];
|
|
3032
3032
|
}
|
|
3033
3033
|
function tn(t, e, n, r, i, a, s) {
|
|
3034
|
-
var o = t - n, c = e - r, l = (s ? a : -a) / me(o * o + c * c), u = l * c, h = -l * o, f = t + u,
|
|
3035
|
-
return
|
|
3036
|
-
cx:
|
|
3037
|
-
cy:
|
|
3034
|
+
var o = t - n, c = e - r, l = (s ? a : -a) / me(o * o + c * c), u = l * c, h = -l * o, f = t + u, y = e + h, _ = n + u, D = r + h, J = (f + _) / 2, j = (y + D) / 2, z = _ - f, M = D - y, k = z * z + M * M, R = i - a, W = f * D - _ * y, Y = (M < 0 ? -1 : 1) * me(uu(0, R * R * k - W * W)), K = (W * M - z * Y) / k, q = (-W * z - M * Y) / k, et = (W * M + z * Y) / k, $ = (-W * z + M * Y) / k, C = K - J, b = q - j, P = et - J, g = $ - j;
|
|
3035
|
+
return C * C + b * b > P * P + g * g && (K = et, q = $), {
|
|
3036
|
+
cx: K,
|
|
3037
|
+
cy: q,
|
|
3038
3038
|
x01: -u,
|
|
3039
3039
|
y01: -h,
|
|
3040
|
-
x11:
|
|
3041
|
-
y11:
|
|
3040
|
+
x11: K * (i / R - 1),
|
|
3041
|
+
y11: q * (i / R - 1)
|
|
3042
3042
|
};
|
|
3043
3043
|
}
|
|
3044
3044
|
function Qr() {
|
|
3045
3045
|
var t = du, e = pu, n = pt(0), r = null, i = gu, a = yu, s = mu, o = null, c = hu(l);
|
|
3046
3046
|
function l() {
|
|
3047
|
-
var u, h, f = +t.apply(this, arguments),
|
|
3048
|
-
if (o || (o = u = c()),
|
|
3049
|
-
else if (
|
|
3050
|
-
o.moveTo(
|
|
3047
|
+
var u, h, f = +t.apply(this, arguments), y = +e.apply(this, arguments), _ = i.apply(this, arguments) - _n, D = a.apply(this, arguments) - _n, J = Gr(D - _), j = D > _;
|
|
3048
|
+
if (o || (o = u = c()), y < f && (h = y, y = f, f = h), !(y > wt)) o.moveTo(0, 0);
|
|
3049
|
+
else if (J > on - wt)
|
|
3050
|
+
o.moveTo(y * ee(_), y * Dt(_)), o.arc(0, 0, y, _, D, !j), f > wt && (o.moveTo(f * ee(D), f * Dt(D)), o.arc(0, 0, f, D, _, j));
|
|
3051
3051
|
else {
|
|
3052
|
-
var
|
|
3053
|
-
if (
|
|
3054
|
-
var
|
|
3055
|
-
(
|
|
3052
|
+
var z = _, M = D, k = _, R = D, W = J, Y = J, K = s.apply(this, arguments) / 2, q = K > wt && (r ? +r.apply(this, arguments) : me(f * f + y * y)), et = qn(Gr(y - f) / 2, +n.apply(this, arguments)), $ = et, C = et, b, P;
|
|
3053
|
+
if (q > wt) {
|
|
3054
|
+
var g = Zr(q / f * Dt(K)), A = Zr(q / y * Dt(K));
|
|
3055
|
+
(W -= g * 2) > wt ? (g *= j ? 1 : -1, k += g, R -= g) : (W = 0, k = R = (_ + D) / 2), (Y -= A * 2) > wt ? (A *= j ? 1 : -1, z += A, M -= A) : (Y = 0, z = M = (_ + D) / 2);
|
|
3056
3056
|
}
|
|
3057
|
-
var
|
|
3058
|
-
if (
|
|
3059
|
-
var m =
|
|
3060
|
-
if (
|
|
3061
|
-
if (
|
|
3062
|
-
var
|
|
3063
|
-
|
|
3057
|
+
var S = y * ee(z), N = y * Dt(z), x = f * ee(R), T = f * Dt(R);
|
|
3058
|
+
if (et > wt) {
|
|
3059
|
+
var m = y * ee(M), E = y * Dt(M), L = f * ee(k), B = f * Dt(k), tt;
|
|
3060
|
+
if (J < Oe)
|
|
3061
|
+
if (tt = xu(S, N, L, B, m, E, x, T)) {
|
|
3062
|
+
var G = S - tt[0], O = N - tt[1], X = m - tt[0], d = E - tt[1], p = 1 / Dt(fu((G * X + O * d) / (me(G * G + O * O) * me(X * X + d * d))) / 2), v = me(tt[0] * tt[0] + tt[1] * tt[1]);
|
|
3063
|
+
$ = qn(et, (f - v) / (p - 1)), C = qn(et, (y - v) / (p + 1));
|
|
3064
3064
|
} else
|
|
3065
|
-
|
|
3065
|
+
$ = C = 0;
|
|
3066
3066
|
}
|
|
3067
|
-
|
|
3067
|
+
Y > wt ? C > wt ? (b = tn(L, B, S, N, y, C, j), P = tn(m, E, x, T, y, C, j), o.moveTo(b.cx + b.x01, b.cy + b.y01), C < et ? o.arc(b.cx, b.cy, C, mt(b.y01, b.x01), mt(P.y01, P.x01), !j) : (o.arc(b.cx, b.cy, C, mt(b.y01, b.x01), mt(b.y11, b.x11), !j), o.arc(0, 0, y, mt(b.cy + b.y11, b.cx + b.x11), mt(P.cy + P.y11, P.cx + P.x11), !j), o.arc(P.cx, P.cy, C, mt(P.y11, P.x11), mt(P.y01, P.x01), !j))) : (o.moveTo(S, N), o.arc(0, 0, y, z, M, !j)) : o.moveTo(S, N), !(f > wt) || !(W > wt) ? o.lineTo(x, T) : $ > wt ? (b = tn(x, T, m, E, f, -$, j), P = tn(S, N, L, B, f, -$, j), o.lineTo(b.cx + b.x01, b.cy + b.y01), $ < et ? o.arc(b.cx, b.cy, $, mt(b.y01, b.x01), mt(P.y01, P.x01), !j) : (o.arc(b.cx, b.cy, $, mt(b.y01, b.x01), mt(b.y11, b.x11), !j), o.arc(0, 0, f, mt(b.cy + b.y11, b.cx + b.x11), mt(P.cy + P.y11, P.cx + P.x11), j), o.arc(P.cx, P.cy, $, mt(P.y11, P.x11), mt(P.y01, P.x01), !j))) : o.arc(0, 0, f, R, k, j);
|
|
3068
3068
|
}
|
|
3069
3069
|
if (o.closePath(), u) return o = null, u + "" || null;
|
|
3070
3070
|
}
|
|
@@ -3101,23 +3101,23 @@ function _u(t) {
|
|
|
3101
3101
|
function bu() {
|
|
3102
3102
|
var t = _u, e = vu, n = null, r = pt(0), i = pt(on), a = pt(0);
|
|
3103
3103
|
function s(o) {
|
|
3104
|
-
var c, l = (o = na(o)).length, u, h, f = 0,
|
|
3104
|
+
var c, l = (o = na(o)).length, u, h, f = 0, y = new Array(l), _ = new Array(l), D = +r.apply(this, arguments), J = Math.min(on, Math.max(-on, i.apply(this, arguments) - D)), j, z = Math.min(Math.abs(J) / l, a.apply(this, arguments)), M = z * (J < 0 ? -1 : 1), k;
|
|
3105
3105
|
for (c = 0; c < l; ++c)
|
|
3106
|
-
(
|
|
3107
|
-
for (e != null ?
|
|
3108
|
-
return e(
|
|
3109
|
-
}) : n != null &&
|
|
3110
|
-
return n(o[
|
|
3111
|
-
}), c = 0, h = f ? (
|
|
3112
|
-
u =
|
|
3106
|
+
(k = _[y[c] = c] = +t(o[c], c, o)) > 0 && (f += k);
|
|
3107
|
+
for (e != null ? y.sort(function(R, W) {
|
|
3108
|
+
return e(_[R], _[W]);
|
|
3109
|
+
}) : n != null && y.sort(function(R, W) {
|
|
3110
|
+
return n(o[R], o[W]);
|
|
3111
|
+
}), c = 0, h = f ? (J - l * M) / f : 0; c < l; ++c, D = j)
|
|
3112
|
+
u = y[c], k = _[u], j = D + (k > 0 ? k * h : 0) + M, _[u] = {
|
|
3113
3113
|
data: o[u],
|
|
3114
3114
|
index: c,
|
|
3115
|
-
value:
|
|
3116
|
-
startAngle:
|
|
3117
|
-
endAngle:
|
|
3118
|
-
padAngle:
|
|
3115
|
+
value: k,
|
|
3116
|
+
startAngle: D,
|
|
3117
|
+
endAngle: j,
|
|
3118
|
+
padAngle: z
|
|
3119
3119
|
};
|
|
3120
|
-
return
|
|
3120
|
+
return _;
|
|
3121
3121
|
}
|
|
3122
3122
|
return s.value = function(o) {
|
|
3123
3123
|
return arguments.length ? (t = typeof o == "function" ? o : pt(+o), s) : t;
|
|
@@ -3222,13 +3222,13 @@ De.prototype = {
|
|
|
3222
3222
|
De.prototype;
|
|
3223
3223
|
const Et = (t, e) => {
|
|
3224
3224
|
const n = Pt(null);
|
|
3225
|
-
return
|
|
3225
|
+
return _t(() => {
|
|
3226
3226
|
e !== void 0 && n.current && t(dt(n.current));
|
|
3227
3227
|
}, e === null ? void 0 : e), n;
|
|
3228
3228
|
};
|
|
3229
3229
|
function de() {
|
|
3230
|
-
const t = Pt(null), [e, n] =
|
|
3231
|
-
return
|
|
3230
|
+
const t = Pt(null), [e, n] = ut({ width: 0, height: 0 });
|
|
3231
|
+
return _t(() => {
|
|
3232
3232
|
const r = t.current;
|
|
3233
3233
|
if (!r || !r.parentElement) return;
|
|
3234
3234
|
const i = r.parentElement, a = () => {
|
|
@@ -3241,8 +3241,8 @@ function de() {
|
|
|
3241
3241
|
}, []), [t, e];
|
|
3242
3242
|
}
|
|
3243
3243
|
function Tn() {
|
|
3244
|
-
const [t, e] =
|
|
3245
|
-
return
|
|
3244
|
+
const [t, e] = ut(null);
|
|
3245
|
+
return _t(() => {
|
|
3246
3246
|
const n = typeof document < "u" ? document.getElementById("UI-controls") : null;
|
|
3247
3247
|
e(n);
|
|
3248
3248
|
}, []), t;
|
|
@@ -3318,7 +3318,7 @@ const ti = [
|
|
|
3318
3318
|
...ta,
|
|
3319
3319
|
...ea,
|
|
3320
3320
|
...Gi
|
|
3321
|
-
],
|
|
3321
|
+
], vt = (t, e = !0) => {
|
|
3322
3322
|
const n = e ? [...xe, ...ti] : [...ti, ...xe];
|
|
3323
3323
|
return t < n.length ? n[t] : n[t % n.length];
|
|
3324
3324
|
}, ve = (t) => t < xe.length ? xe[t] : xe[t % xe.length], St = (t, {
|
|
@@ -3359,8 +3359,8 @@ function Rn(t, e) {
|
|
|
3359
3359
|
if (u < 0)
|
|
3360
3360
|
h = 0;
|
|
3361
3361
|
else if (u + o > l) {
|
|
3362
|
-
const
|
|
3363
|
-
h = u -
|
|
3362
|
+
const y = u + o - l;
|
|
3363
|
+
h = u - y;
|
|
3364
3364
|
} else
|
|
3365
3365
|
h = u;
|
|
3366
3366
|
const f = s === "top" ? kt["tooltip--arrow-down"] : kt["tooltip--arrow-up"];
|
|
@@ -3395,7 +3395,7 @@ const Vt = "#d1d5db", Mu = "_disabled_6kkmf_99", nt = {
|
|
|
3395
3395
|
"value-axis": "_value-axis_1tba7_21"
|
|
3396
3396
|
}, Ne = (t) => {
|
|
3397
3397
|
const e = Pt([]);
|
|
3398
|
-
return
|
|
3398
|
+
return _t(() => {
|
|
3399
3399
|
const n = e.current;
|
|
3400
3400
|
if (t.length === 0) {
|
|
3401
3401
|
e.current = [];
|
|
@@ -3427,11 +3427,11 @@ function $f({
|
|
|
3427
3427
|
formatType: s = "long"
|
|
3428
3428
|
} = { prefix: "", suffix: "", formatType: "long" }
|
|
3429
3429
|
}) {
|
|
3430
|
-
const [o, c] = de(), { width: l, height: u } = c, [h, f] =
|
|
3430
|
+
const [o, c] = de(), { width: l, height: u } = c, [h, f] = ut(!1), y = Ne(t.map((k) => k.label)), _ = Tn(), D = l > 576, J = /* @__PURE__ */ H.jsx(
|
|
3431
3431
|
"div",
|
|
3432
3432
|
{
|
|
3433
3433
|
id: "controls",
|
|
3434
|
-
className: `${nt[
|
|
3434
|
+
className: `${nt[D ? "controls-container" : "controls-container-sm"]} ${_ ? nt["fill-container"] : ""}`,
|
|
3435
3435
|
children: /* @__PURE__ */ H.jsxs("label", { className: nt["controls-label"], children: [
|
|
3436
3436
|
/* @__PURE__ */ H.jsx(
|
|
3437
3437
|
"input",
|
|
@@ -3439,81 +3439,81 @@ function $f({
|
|
|
3439
3439
|
type: "checkbox",
|
|
3440
3440
|
className: nt["controls-checkbox"],
|
|
3441
3441
|
checked: h,
|
|
3442
|
-
onChange: (
|
|
3442
|
+
onChange: (k) => f(k.target.checked)
|
|
3443
3443
|
}
|
|
3444
3444
|
),
|
|
3445
3445
|
"Sort"
|
|
3446
3446
|
] })
|
|
3447
3447
|
}
|
|
3448
|
-
),
|
|
3448
|
+
), j = { idx: e, type: n }, z = 750, M = Et((k) => {
|
|
3449
3449
|
if (l === 0 || u === 0) return;
|
|
3450
|
-
const
|
|
3450
|
+
const R = {
|
|
3451
3451
|
top: 20,
|
|
3452
3452
|
right: 30,
|
|
3453
3453
|
bottom: r === "vertical" ? 50 : 30,
|
|
3454
3454
|
left: r === "vertical" ? 25 : 50
|
|
3455
|
-
},
|
|
3456
|
-
|
|
3457
|
-
const
|
|
3458
|
-
|
|
3455
|
+
}, W = h ? Mt(t).sort((x, T) => T.value - x.value) : Mt(t), Y = k.select("svg"), K = Y.node(), q = Y.select(".plot-area").attr("transform", "translate(" + R.left + "," + R.top + ")"), et = Ye(k).style("opacity", 0), $ = D ? en.axisText : en.rotatedAxisText, C = l - R.left - R.right, b = u - R.top - R.bottom, P = Ae().domain(W.map((x) => x.label)).rangeRound(r === "vertical" ? [0, C] : [b, 0]).paddingInner(D ? 0.4 : 0.25).paddingOuter(0.1), g = ce().domain([0, Yt(W, (x) => x.value) ?? 0]).rangeRound(r === "vertical" ? [b, 0] : [0, C]), A = r === "vertical" ? Zt(P).tickValues(P.domain()).scale(P).tickSizeOuter(0) : Zt(g).ticks(5, "s").tickSizeOuter(0).tickSize(-b);
|
|
3456
|
+
q.select(".x-axis").attr("transform", `translate(0, ${b})`).transition().duration(z).call(A).selectAll("text").attr("class", $);
|
|
3457
|
+
const S = r === "vertical" ? Qt(g).ticks(5, "s").tickSize(-C) : Qt(P).tickSizeOuter(0);
|
|
3458
|
+
q.select(".y-axis").attr("transform", "translate(0, 0)").transition().duration(z).call(S);
|
|
3459
3459
|
const N = (x) => {
|
|
3460
|
-
const { idx:
|
|
3461
|
-
return ve(m === "fixed" ?
|
|
3460
|
+
const { idx: T, type: m } = j, E = y.current.findIndex((L) => L === x.label);
|
|
3461
|
+
return ve(m === "fixed" ? T : T + E);
|
|
3462
3462
|
};
|
|
3463
|
-
|
|
3464
|
-
(x) => x.append("rect").attr("class", "bar").attr("x", function(
|
|
3465
|
-
return r === "vertical" ?
|
|
3466
|
-
}).attr("width", function(
|
|
3467
|
-
return r === "vertical" ?
|
|
3468
|
-
}).attr("y", function(
|
|
3469
|
-
return r === "vertical" ?
|
|
3463
|
+
q.selectAll(".bar").data(W, (x) => x.label).join(
|
|
3464
|
+
(x) => x.append("rect").attr("class", "bar").attr("x", function(T) {
|
|
3465
|
+
return r === "vertical" ? P(T.label) ?? 0 : g(0);
|
|
3466
|
+
}).attr("width", function(T) {
|
|
3467
|
+
return r === "vertical" ? P.bandwidth() : 0;
|
|
3468
|
+
}).attr("y", function(T) {
|
|
3469
|
+
return r === "vertical" ? g(0) : P(T.label) ?? 0;
|
|
3470
3470
|
}).attr("height", function() {
|
|
3471
|
-
return r === "vertical" ? 0 :
|
|
3472
|
-
}).attr("fill", N).transition().duration(
|
|
3473
|
-
return r === "vertical" ?
|
|
3474
|
-
}).attr("width", function(
|
|
3475
|
-
return r === "vertical" ?
|
|
3476
|
-
}).attr("height", function(
|
|
3477
|
-
return r === "vertical" ?
|
|
3471
|
+
return r === "vertical" ? 0 : P.bandwidth();
|
|
3472
|
+
}).attr("fill", N).transition().duration(z).attr("y", function(T) {
|
|
3473
|
+
return r === "vertical" ? g(T.value) : P(T.label) ?? 0;
|
|
3474
|
+
}).attr("width", function(T) {
|
|
3475
|
+
return r === "vertical" ? P.bandwidth() : g(T.value);
|
|
3476
|
+
}).attr("height", function(T) {
|
|
3477
|
+
return r === "vertical" ? g(0) - g(T.value) : P.bandwidth();
|
|
3478
3478
|
}),
|
|
3479
3479
|
void 0,
|
|
3480
|
-
(x) => x.transition().duration(
|
|
3480
|
+
(x) => x.transition().duration(z).attr("fill", Vt).attr("height", 0).attr("y", u).style("opacity", 0).remove()
|
|
3481
3481
|
).on(
|
|
3482
3482
|
"mouseover",
|
|
3483
|
-
(x,
|
|
3484
|
-
|
|
3483
|
+
(x, T) => {
|
|
3484
|
+
q.selectAll("rect.bar").filter((m) => m.label === T.label).style("stroke", "#71717a").style("stroke-width", 1), et.style("opacity", 1).select("p").text(T.label + ` :
|
|
3485
3485
|
${i}
|
|
3486
|
-
${he(s === "long" ? "," : "~s")(
|
|
3487
|
-
${a}`), dt(".x-axis").selectAll("text").filter((m) => m ===
|
|
3486
|
+
${he(s === "long" ? "," : "~s")(T.value)}
|
|
3487
|
+
${a}`), dt(".x-axis").selectAll("text").filter((m) => m === T.label).style("font-weight", "bold");
|
|
3488
3488
|
}
|
|
3489
|
-
).on("mousemove", (x,
|
|
3490
|
-
Rn(
|
|
3489
|
+
).on("mousemove", (x, T) => {
|
|
3490
|
+
Rn(et, { e: x, svg: K, yScale: g });
|
|
3491
3491
|
}).on(
|
|
3492
3492
|
"mouseout",
|
|
3493
|
-
(x,
|
|
3494
|
-
|
|
3493
|
+
(x, T) => {
|
|
3494
|
+
q.selectAll("rect.bar").filter((m) => m.label === T.label).style("stroke", "none").style("stroke-width", 0), et.style("opacity", 0), dt(".x-axis").selectAll("text").filter((m) => m === T.label).style("font-weight", "normal");
|
|
3495
3495
|
}
|
|
3496
|
-
).transition().duration(
|
|
3497
|
-
return r === "vertical" ?
|
|
3496
|
+
).transition().duration(z).attr("fill", N).attr("x", function(x) {
|
|
3497
|
+
return r === "vertical" ? P(x.label) ?? 0 : g(0);
|
|
3498
3498
|
}).attr("width", function(x) {
|
|
3499
|
-
return r === "vertical" ?
|
|
3499
|
+
return r === "vertical" ? P.bandwidth() : g(x.value);
|
|
3500
3500
|
}).attr("y", function(x) {
|
|
3501
|
-
return r === "vertical" ?
|
|
3501
|
+
return r === "vertical" ? g(x.value) : P(x.label) ?? 0;
|
|
3502
3502
|
}).attr("height", function(x) {
|
|
3503
|
-
return r === "vertical" ?
|
|
3503
|
+
return r === "vertical" ? g(0) - g(x.value) : P.bandwidth();
|
|
3504
3504
|
});
|
|
3505
|
-
}, [t,
|
|
3505
|
+
}, [t, j, l, u, h, r, { prefix: i, suffix: a, formatType: s }]);
|
|
3506
3506
|
return /* @__PURE__ */ H.jsxs(
|
|
3507
3507
|
"div",
|
|
3508
3508
|
{
|
|
3509
3509
|
ref: o,
|
|
3510
3510
|
style: { width: l, height: u, display: "flex", flexDirection: "column" },
|
|
3511
3511
|
children: [
|
|
3512
|
-
|
|
3512
|
+
_ && kn(J, _),
|
|
3513
3513
|
/* @__PURE__ */ H.jsxs(
|
|
3514
3514
|
"div",
|
|
3515
3515
|
{
|
|
3516
|
-
ref:
|
|
3516
|
+
ref: M,
|
|
3517
3517
|
className: `${nt["fill-container"]}`,
|
|
3518
3518
|
style: { display: "flex", flexDirection: "column", position: "relative" },
|
|
3519
3519
|
children: [
|
|
@@ -3529,7 +3529,7 @@ function $f({
|
|
|
3529
3529
|
] })
|
|
3530
3530
|
}
|
|
3531
3531
|
),
|
|
3532
|
-
!
|
|
3532
|
+
!_ && /* @__PURE__ */ H.jsxs(
|
|
3533
3533
|
"label",
|
|
3534
3534
|
{
|
|
3535
3535
|
className: nt["controls-label"],
|
|
@@ -3541,7 +3541,7 @@ function $f({
|
|
|
3541
3541
|
type: "checkbox",
|
|
3542
3542
|
className: nt["controls-checkbox"],
|
|
3543
3543
|
checked: h,
|
|
3544
|
-
onChange: (
|
|
3544
|
+
onChange: (k) => f(k.target.checked)
|
|
3545
3545
|
}
|
|
3546
3546
|
),
|
|
3547
3547
|
"Sort"
|
|
@@ -3557,8 +3557,8 @@ function $f({
|
|
|
3557
3557
|
);
|
|
3558
3558
|
}
|
|
3559
3559
|
function ue() {
|
|
3560
|
-
const t = Pt(null), [e, n] =
|
|
3561
|
-
return
|
|
3560
|
+
const t = Pt(null), [e, n] = ut({ width: 0, height: 0 });
|
|
3561
|
+
return _t(() => {
|
|
3562
3562
|
const r = t.current;
|
|
3563
3563
|
if (!r) return;
|
|
3564
3564
|
const i = new ResizeObserver(([a]) => {
|
|
@@ -3592,108 +3592,108 @@ const Eu = "_legend_7ftsg_1", Cu = "_pieSlice_7ftsg_77", Lu = "_pieSliceNotHover
|
|
|
3592
3592
|
pieLabelExit: qu
|
|
3593
3593
|
};
|
|
3594
3594
|
function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r = 0 }) {
|
|
3595
|
-
const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { width: u, height: h } = l, f = Ne(t.map((
|
|
3596
|
-
const
|
|
3597
|
-
|
|
3598
|
-
(
|
|
3599
|
-
const
|
|
3600
|
-
return `${jt[
|
|
3601
|
-
}).style("left", "-10px").style("top", function(
|
|
3602
|
-
return `${
|
|
3595
|
+
const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { width: u, height: h } = l, f = Ne(t.map((Y) => Y.label)), [y, _] = ut([]), [D, J] = ut(!1), [j, z] = ut(""), M = 750, k = Et((Y) => {
|
|
3596
|
+
const q = (n && D ? Mt(t).sort(($, C) => $.value - C.value) : t).map(($) => $.label);
|
|
3597
|
+
Y.selectAll(".legend-item").data([...q], ($) => $).join(
|
|
3598
|
+
($) => {
|
|
3599
|
+
const C = $.append("div").attr("class", function(b) {
|
|
3600
|
+
return `${jt[b === j ? "legend-active" : "legend"]} legend-item`;
|
|
3601
|
+
}).style("left", "-10px").style("top", function(b, P) {
|
|
3602
|
+
return `${P * 20 + 10}px`;
|
|
3603
3603
|
}).style("opacity", 0);
|
|
3604
|
-
return
|
|
3604
|
+
return C.append("div").attr("class", `rect ${jt["legend-rect"]}`).style("background-color", (b) => ve(f.current.findIndex((P) => P === b) + r)), C.append("span").attr("class", jt["legend-label"]).style("color", (b) => "#333").text((b) => b), C.transition().duration(M).style("left", "6px").style("opacity", 1), C;
|
|
3605
3605
|
},
|
|
3606
|
-
(
|
|
3607
|
-
${jt[
|
|
3608
|
-
return `${
|
|
3609
|
-
}).style("left", "6px").style("opacity", 1).select("div.rect").attr("class", `rect ${jt["legend-rect"]}`).style("background-color", (
|
|
3610
|
-
(
|
|
3611
|
-
).on("mouseover", (C
|
|
3612
|
-
|
|
3606
|
+
($) => ($.attr("class", (C) => `
|
|
3607
|
+
${jt[C === j ? "legend-active" : "legend"]} legend-item`).transition().duration(M).style("top", function(C, b) {
|
|
3608
|
+
return `${b * 20 + 10}px`;
|
|
3609
|
+
}).style("left", "6px").style("opacity", 1).select("div.rect").attr("class", `rect ${jt["legend-rect"]}`).style("background-color", (C) => ve(f.current.findIndex((b) => b === C) + r)), $.select("span").style("color", (C) => "#333").text((C) => C), $),
|
|
3610
|
+
($) => $.transition().duration(M).style("opacity", 0).style("left", "30px").remove()
|
|
3611
|
+
).on("mouseover", ($, C) => {
|
|
3612
|
+
z(C);
|
|
3613
3613
|
}).on("mouseout", () => {
|
|
3614
|
-
|
|
3614
|
+
z("");
|
|
3615
3615
|
});
|
|
3616
|
-
}, [t, r, u, h,
|
|
3616
|
+
}, [t, r, u, h, j, D, n]), R = Et((Y) => {
|
|
3617
3617
|
if (u === 0 || h === 0) return;
|
|
3618
|
-
const
|
|
3619
|
-
return
|
|
3620
|
-
}).sort(function(
|
|
3621
|
-
return
|
|
3622
|
-
}),
|
|
3623
|
-
|
|
3624
|
-
let
|
|
3625
|
-
const m =
|
|
3626
|
-
m.every((
|
|
3627
|
-
const
|
|
3628
|
-
const
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
),
|
|
3618
|
+
const K = { x: u / 2, y: h / 2 }, q = { top: 10, right: 20, bottom: 10, left: 20 }, et = t, $ = u - (q.left + q.right), C = h - (q.top + q.bottom), b = Math.min($, C) / 2, P = et.reduce((v, F) => v + F.value, 0), g = Y.select(".plot-area").attr("transform", "translate(" + K.x + "," + K.y + ")"), A = bu().value(function(v) {
|
|
3619
|
+
return v.value;
|
|
3620
|
+
}).sort(function(v, F) {
|
|
3621
|
+
return D ? je(v.value, F.value) : 0;
|
|
3622
|
+
}), S = Mt(et), N = A(S), x = Mt(S);
|
|
3623
|
+
_(A(x));
|
|
3624
|
+
let T = x.length > S.length;
|
|
3625
|
+
const m = y.map((v) => v.data.label), E = N.map((v) => v.data.label);
|
|
3626
|
+
m.every((v) => T ? !1 : E.includes(v) ? !0 : (T = !0, !1));
|
|
3627
|
+
const L = y.length === 0, tt = Qr().innerRadius(e * b).outerRadius(b - 12), G = Qr().innerRadius(e * b).outerRadius(b), O = (v, F) => {
|
|
3628
|
+
const Z = Gt(
|
|
3629
|
+
F === "exit" ? v.endAngle : v.startAngle,
|
|
3630
|
+
F === "exit" ? v.startAngle : v.endAngle
|
|
3631
|
+
), st = v.data.label === j;
|
|
3632
3632
|
return function(ct) {
|
|
3633
|
-
return
|
|
3633
|
+
return v.endAngle = Z(ct), st ? G(v) || "" : tt(v) || "";
|
|
3634
3634
|
};
|
|
3635
3635
|
};
|
|
3636
|
-
|
|
3637
|
-
return
|
|
3636
|
+
g.selectAll("path").data(N, function(v) {
|
|
3637
|
+
return v.data.label;
|
|
3638
3638
|
}).join(
|
|
3639
|
-
(
|
|
3640
|
-
const
|
|
3641
|
-
const
|
|
3642
|
-
return ve(
|
|
3639
|
+
(v) => {
|
|
3640
|
+
const F = v.append("path").attr("class", jt.pieSlice).attr("fill", function(Z) {
|
|
3641
|
+
const st = f.current.findIndex((ct) => ct === Z.data.label) + r;
|
|
3642
|
+
return ve(st);
|
|
3643
3643
|
});
|
|
3644
|
-
return
|
|
3645
|
-
if (!
|
|
3646
|
-
return
|
|
3647
|
-
const
|
|
3648
|
-
return function(
|
|
3649
|
-
return
|
|
3644
|
+
return F.transition().duration(M).delay(L ? 0 : M).attr("d", tt).attrTween("d", function(Z) {
|
|
3645
|
+
if (!L)
|
|
3646
|
+
return O(Z, "not exit");
|
|
3647
|
+
const st = Gt(0, Z.startAngle), ct = Gt(0, Z.endAngle), ht = Z.data.label === j;
|
|
3648
|
+
return function(ft) {
|
|
3649
|
+
return Z.startAngle = st(ft), Z.endAngle = ct(ft), ht ? G(Z) : tt(Z);
|
|
3650
3650
|
};
|
|
3651
|
-
}),
|
|
3651
|
+
}), F;
|
|
3652
3652
|
},
|
|
3653
|
-
(
|
|
3654
|
-
const
|
|
3655
|
-
return
|
|
3656
|
-
const ct = f.current.findIndex((ht) => ht ===
|
|
3653
|
+
(v) => {
|
|
3654
|
+
const F = v;
|
|
3655
|
+
return v.transition().duration(M).attr("fill", function(Z, st) {
|
|
3656
|
+
const ct = f.current.findIndex((ht) => ht === Z.data.label) + r;
|
|
3657
3657
|
return ve(ct);
|
|
3658
|
-
}).attrTween("d", function(
|
|
3659
|
-
const
|
|
3658
|
+
}).attrTween("d", function(Z) {
|
|
3659
|
+
const st = y.find((Ot) => Ot.data.label === Z.data.label), ct = st && st.startAngle ? st.startAngle : 0, ht = Gt(ct, Z.startAngle), ft = st && st.endAngle ? st.endAngle : 0, lt = Gt(ft, Z.endAngle), gt = Z.data.label === j;
|
|
3660
3660
|
return function(Ot) {
|
|
3661
|
-
return
|
|
3661
|
+
return Z.startAngle = ht(Ot), Z.endAngle = lt(Ot), gt ? G(Z) || "" : tt(Z) || "";
|
|
3662
3662
|
};
|
|
3663
|
-
}),
|
|
3663
|
+
}), F;
|
|
3664
3664
|
},
|
|
3665
|
-
(
|
|
3666
|
-
return
|
|
3665
|
+
(v) => v.attr("class", jt.pieSliceExit).transition().duration(M).attr("fill", Vt).attrTween("d", function(F) {
|
|
3666
|
+
return O(F, "exit");
|
|
3667
3667
|
}).remove()
|
|
3668
|
-
).on("mouseover", function(
|
|
3669
|
-
|
|
3668
|
+
).on("mouseover", function(v, F) {
|
|
3669
|
+
z(F.data.label);
|
|
3670
3670
|
}).on("mouseout", () => {
|
|
3671
|
-
|
|
3671
|
+
z("");
|
|
3672
3672
|
});
|
|
3673
|
-
const
|
|
3674
|
-
const
|
|
3675
|
-
return he(".1%")(
|
|
3673
|
+
const d = (v) => et.length === 1 ? "translate(0, 0)" : `translate(${tt.centroid(v)})`, p = (v) => {
|
|
3674
|
+
const F = v.value / P;
|
|
3675
|
+
return he(".1%")(F);
|
|
3676
3676
|
};
|
|
3677
|
-
|
|
3678
|
-
return
|
|
3677
|
+
g.selectAll("text").data(N, function(v) {
|
|
3678
|
+
return v.data.label;
|
|
3679
3679
|
}).join(
|
|
3680
|
-
(
|
|
3681
|
-
const
|
|
3682
|
-
return
|
|
3683
|
-
|
|
3680
|
+
(v) => {
|
|
3681
|
+
const F = v.append("text").text(p).attr("class", jt.pieLabelEnter);
|
|
3682
|
+
return F.merge(F).transition().duration(M).delay(
|
|
3683
|
+
M
|
|
3684
3684
|
/* + exitDelay*/
|
|
3685
|
-
).attr("transform",
|
|
3685
|
+
).attr("transform", d), F;
|
|
3686
3686
|
},
|
|
3687
|
-
(
|
|
3688
|
-
const
|
|
3689
|
-
return
|
|
3690
|
-
const
|
|
3691
|
-
return
|
|
3692
|
-
}).attr("transform",
|
|
3687
|
+
(v) => {
|
|
3688
|
+
const F = v.text(p);
|
|
3689
|
+
return v.merge(F).attr("class", jt.pieLabelUpdate).transition().duration(j !== "" ? 250 : M).style("opacity", function(Z) {
|
|
3690
|
+
const st = j === Z.data.label;
|
|
3691
|
+
return j === "" || st ? 1 : 0;
|
|
3692
|
+
}).attr("transform", d), F;
|
|
3693
3693
|
},
|
|
3694
|
-
(
|
|
3694
|
+
(v) => v.transition().duration(M / 2).attr("class", jt.pieLabelExit).remove()
|
|
3695
3695
|
);
|
|
3696
|
-
}, [t, r, e, u, h,
|
|
3696
|
+
}, [t, r, e, u, h, D, j]), W = s > o;
|
|
3697
3697
|
return /* @__PURE__ */ H.jsxs(
|
|
3698
3698
|
"div",
|
|
3699
3699
|
{
|
|
@@ -3703,7 +3703,7 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
|
|
|
3703
3703
|
height: o,
|
|
3704
3704
|
position: "relative",
|
|
3705
3705
|
display: "flex",
|
|
3706
|
-
flexDirection:
|
|
3706
|
+
flexDirection: W ? "row" : "column",
|
|
3707
3707
|
overflow: "hidden"
|
|
3708
3708
|
},
|
|
3709
3709
|
children: [
|
|
@@ -3719,7 +3719,7 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
|
|
|
3719
3719
|
children: /* @__PURE__ */ H.jsx(
|
|
3720
3720
|
"svg",
|
|
3721
3721
|
{
|
|
3722
|
-
ref:
|
|
3722
|
+
ref: R,
|
|
3723
3723
|
className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
|
|
3724
3724
|
viewBox: `0 0 ${u} ${h}`,
|
|
3725
3725
|
children: /* @__PURE__ */ H.jsx("g", { className: "plot-area" })
|
|
@@ -3731,19 +3731,19 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
|
|
|
3731
3731
|
"div",
|
|
3732
3732
|
{
|
|
3733
3733
|
style: {
|
|
3734
|
-
width:
|
|
3735
|
-
height:
|
|
3734
|
+
width: W ? s > 480 ? "180px" : "100px" : "100%",
|
|
3735
|
+
height: W ? "100%" : o > 400 ? "180px" : "100px",
|
|
3736
3736
|
flexShrink: 0,
|
|
3737
3737
|
overflowY: "auto",
|
|
3738
3738
|
background: "rgba(255, 255, 255)",
|
|
3739
|
-
borderLeft:
|
|
3740
|
-
borderTop:
|
|
3739
|
+
borderLeft: W ? "1px solid #ddd" : "none",
|
|
3740
|
+
borderTop: W ? "none" : "1px solid #ddd",
|
|
3741
3741
|
padding: "0px"
|
|
3742
3742
|
},
|
|
3743
3743
|
children: /* @__PURE__ */ H.jsx(
|
|
3744
3744
|
"div",
|
|
3745
3745
|
{
|
|
3746
|
-
ref:
|
|
3746
|
+
ref: k,
|
|
3747
3747
|
className: "legends-content",
|
|
3748
3748
|
style: {
|
|
3749
3749
|
display: "flex",
|
|
@@ -3768,8 +3768,8 @@ function Af({ data: t, innerRadius: e = 0, sortWithLegends: n = !1, colorIdx: r
|
|
|
3768
3768
|
{
|
|
3769
3769
|
type: "checkbox",
|
|
3770
3770
|
className: nt["controls-checkbox"],
|
|
3771
|
-
checked:
|
|
3772
|
-
onChange: (
|
|
3771
|
+
checked: D,
|
|
3772
|
+
onChange: (Y) => J(Y.target.checked)
|
|
3773
3773
|
}
|
|
3774
3774
|
),
|
|
3775
3775
|
"Sort"
|
|
@@ -3804,63 +3804,63 @@ const Fu = "_rect_aemvq_277", Vu = "_rectCard_aemvq_277", Wu = "_rectLegendNotHo
|
|
|
3804
3804
|
"value-axis": "_value-axis_aemvq_421"
|
|
3805
3805
|
};
|
|
3806
3806
|
function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "vertical", tooltipFormat: i }) {
|
|
3807
|
-
const [a, s] = de(), { width: o, height: c } = s, [l, u] = ue(), { height: h } = u, [f,
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
}, [
|
|
3811
|
-
|
|
3807
|
+
const [a, s] = de(), { width: o, height: c } = s, [l, u] = ue(), { height: h } = u, [f, y] = ue(), { width: _, height: D } = y, [J, j] = ut(null), [z, M] = ut(!1), [k, R] = ut(["all"]), [W, Y] = ut(!1), [K, q] = ut(""), [et, $] = ut(!1), C = Tn(), b = t;
|
|
3808
|
+
_t(() => {
|
|
3809
|
+
R(["all"]), M(!0);
|
|
3810
|
+
}, [b]), _t(() => {
|
|
3811
|
+
R(["all"]);
|
|
3812
3812
|
}, [e]);
|
|
3813
|
-
const
|
|
3814
|
-
|
|
3815
|
-
let
|
|
3816
|
-
return
|
|
3817
|
-
|
|
3818
|
-
},
|
|
3819
|
-
clearTimeout(
|
|
3813
|
+
const P = 750;
|
|
3814
|
+
_t(() => {
|
|
3815
|
+
let L;
|
|
3816
|
+
return z && (L = setTimeout(() => {
|
|
3817
|
+
M(!1);
|
|
3818
|
+
}, P + 500)), () => {
|
|
3819
|
+
clearTimeout(L);
|
|
3820
3820
|
};
|
|
3821
|
-
}, [
|
|
3822
|
-
const
|
|
3823
|
-
if (
|
|
3821
|
+
}, [z]);
|
|
3822
|
+
const g = [_, D, k, n, e], A = Mt(b), S = A.length === 0 ? [] : Object.keys(A[0]).filter((L) => L !== "label" && L !== "total"), N = Ne(S), x = _ > 576, T = Et((L) => {
|
|
3823
|
+
if (z)
|
|
3824
3824
|
return;
|
|
3825
|
-
const
|
|
3826
|
-
const
|
|
3825
|
+
const B = x ? 80 : 50, tt = function(O) {
|
|
3826
|
+
const X = rt[x ? "legend-container" : "legend-container-sm"], d = rt[x ? "legend-container-active" : "legend-container-active-sm"], p = rt[x ? "legend-container-inactive" : "legend-container-inactive-sm"];
|
|
3827
3827
|
return `
|
|
3828
|
-
${
|
|
3828
|
+
${k.includes(O) ? e ? d : p : X}
|
|
3829
3829
|
legend-item
|
|
3830
3830
|
`;
|
|
3831
3831
|
};
|
|
3832
|
-
|
|
3833
|
-
(
|
|
3834
|
-
const
|
|
3835
|
-
return
|
|
3836
|
-
if (!e &&
|
|
3832
|
+
L.selectAll(".legend-item").data([...S], (O) => O).join(
|
|
3833
|
+
(O) => {
|
|
3834
|
+
const X = O.append("div").attr("class", tt).style("left", (d, p) => `${p * B}px`).style("top", "-53px").style("opacity", 0);
|
|
3835
|
+
return X.append("div").attr("class", rt["legend-rect"]).style("background", (d) => {
|
|
3836
|
+
if (!e && k.includes(d))
|
|
3837
3837
|
return Vt;
|
|
3838
|
-
const
|
|
3839
|
-
return
|
|
3840
|
-
}),
|
|
3838
|
+
const p = N.current.findIndex((v) => v === d) + n;
|
|
3839
|
+
return vt(p);
|
|
3840
|
+
}), X.append("span").attr("class", rt["legend-label"]).style("color", (d) => !e && k.includes(d) ? "#d1d5db" : "#333").text((d) => d), X.transition().duration(P).style("top", "0px").style("opacity", 1), X;
|
|
3841
3841
|
},
|
|
3842
|
-
(
|
|
3843
|
-
if (!e &&
|
|
3842
|
+
(O) => (O.attr("class", tt).transition().duration(P).style("top", "0px").style("left", (X, d) => `${d * B}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (X) => {
|
|
3843
|
+
if (!e && k.includes(X))
|
|
3844
3844
|
return Vt;
|
|
3845
|
-
const
|
|
3846
|
-
return
|
|
3847
|
-
}),
|
|
3848
|
-
(
|
|
3849
|
-
).on("mouseover", function(
|
|
3850
|
-
|
|
3851
|
-
}).on("mouseout", function(
|
|
3852
|
-
|
|
3853
|
-
}).on("click", (
|
|
3854
|
-
|
|
3855
|
-
let
|
|
3856
|
-
return e ?
|
|
3857
|
-
}),
|
|
3845
|
+
const d = N.current.findIndex((p) => p === X) + n;
|
|
3846
|
+
return vt(d);
|
|
3847
|
+
}), O.select(`.${rt["legend-label"]}`).style("color", (X) => !e && k.includes(X) ? Vt : "#333").text((X) => X), O),
|
|
3848
|
+
(O) => O.style("color", Vt).transition().duration(P).style("opacity", 0).style("top", "53px").remove()
|
|
3849
|
+
).on("mouseover", function(O, X) {
|
|
3850
|
+
z || q(X);
|
|
3851
|
+
}).on("mouseout", function(O, X) {
|
|
3852
|
+
z || (q(""), W && Y(!1));
|
|
3853
|
+
}).on("click", (O, X) => {
|
|
3854
|
+
R((d) => {
|
|
3855
|
+
let p = [];
|
|
3856
|
+
return e ? d[0] === X ? p = ["all"] : p = [X] : d.includes(X) ? p = d.filter((v) => v !== X) : p = [...d, X], p;
|
|
3857
|
+
}), Y(!0);
|
|
3858
3858
|
});
|
|
3859
|
-
}, [...
|
|
3859
|
+
}, [...g, S, z]), m = /* @__PURE__ */ H.jsxs(
|
|
3860
3860
|
"div",
|
|
3861
3861
|
{
|
|
3862
3862
|
ref: l,
|
|
3863
|
-
className: `${nt[x ? "controls-container" : "controls-container-sm"]} ${
|
|
3863
|
+
className: `${nt[x ? "controls-container" : "controls-container-sm"]} ${C ? nt["fill-container"] : ""}`,
|
|
3864
3864
|
children: [
|
|
3865
3865
|
/* @__PURE__ */ H.jsxs("label", { className: nt["controls-label"], style: { paddingRight: "12px" }, children: [
|
|
3866
3866
|
/* @__PURE__ */ H.jsx(
|
|
@@ -3868,8 +3868,8 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
|
|
|
3868
3868
|
{
|
|
3869
3869
|
type: "checkbox",
|
|
3870
3870
|
className: nt["controls-checkbox"],
|
|
3871
|
-
checked:
|
|
3872
|
-
onChange: (
|
|
3871
|
+
checked: et,
|
|
3872
|
+
onChange: (L) => $(L.target.checked)
|
|
3873
3873
|
}
|
|
3874
3874
|
),
|
|
3875
3875
|
"Sort"
|
|
@@ -3877,134 +3877,134 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
|
|
|
3877
3877
|
/* @__PURE__ */ H.jsx(
|
|
3878
3878
|
"div",
|
|
3879
3879
|
{
|
|
3880
|
-
ref:
|
|
3880
|
+
ref: T,
|
|
3881
3881
|
id: "stacked-barchart-legends",
|
|
3882
3882
|
className: `${rt["legends-container"]}`
|
|
3883
3883
|
}
|
|
3884
3884
|
)
|
|
3885
3885
|
]
|
|
3886
3886
|
}
|
|
3887
|
-
),
|
|
3888
|
-
if (
|
|
3889
|
-
const
|
|
3890
|
-
|
|
3891
|
-
const
|
|
3892
|
-
bt in
|
|
3893
|
-
const Jt =
|
|
3894
|
-
return
|
|
3887
|
+
), E = Et((L) => {
|
|
3888
|
+
if (_ === 0 || D === 0 || K !== "" && z) return;
|
|
3889
|
+
const B = { top: 20, right: 20, bottom: 30, left: 40 }, tt = e ? S : S.filter((w) => !k.includes(w));
|
|
3890
|
+
A.forEach((w, Q) => {
|
|
3891
|
+
const U = tt.reduce((yt, bt) => {
|
|
3892
|
+
bt in w || (w[bt] = 0);
|
|
3893
|
+
const Jt = w[bt];
|
|
3894
|
+
return yt + (typeof Jt == "number" ? Jt : 0);
|
|
3895
3895
|
}, 0);
|
|
3896
|
-
|
|
3896
|
+
w.total = U;
|
|
3897
3897
|
});
|
|
3898
|
-
const
|
|
3899
|
-
return e ?
|
|
3900
|
-
}) :
|
|
3901
|
-
let
|
|
3902
|
-
|
|
3903
|
-
const ct =
|
|
3904
|
-
return
|
|
3905
|
-
}), ht = Ae().domain(ct).rangeRound(r === "vertical" ? [0,
|
|
3906
|
-
|
|
3907
|
-
const pe = r === "vertical" ? Qt(
|
|
3908
|
-
|
|
3909
|
-
const te = bn().keys(
|
|
3910
|
-
const
|
|
3911
|
-
const bt =
|
|
3898
|
+
const G = A, O = et ? Mt(G).sort(function(w, Q) {
|
|
3899
|
+
return e ? k[0] === "all" ? w.total - Q.total : Number(w[k[0]]) - Number(Q[k[0]]) : w.total - Q.total;
|
|
3900
|
+
}) : G, X = _ - B.left - B.right, d = D - B.top - B.bottom, p = L.select("svg"), v = p.node(), F = p.select(".plot-area").attr("transform", "translate(" + B.left + "," + B.top + ")"), Z = Ye(L).style("opacity", 0);
|
|
3901
|
+
let st = !1;
|
|
3902
|
+
J === null && (st = !0, j(Mt(A)));
|
|
3903
|
+
const ct = O.map(function(w) {
|
|
3904
|
+
return w.label;
|
|
3905
|
+
}), ht = Ae().domain(ct).rangeRound(r === "vertical" ? [0, X] : [d, 0]).paddingInner(x ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), ft = e ? k[0] === "all" ? Yt(A, (w) => w.total) : Yt(A, (w) => w[k[0]]) : Yt(A, (w) => w.total), lt = ce().domain([0, ft ?? 0]).range(r === "vertical" ? [d, 0] : [0, X]), gt = !x && r === "vertical" ? rt.rotatedAxisText : rt.axisText, Ot = [], Be = r === "vertical" ? Zt(ht).tickValues(ht.domain()).tickSizeOuter(0) : Zt(lt).ticks(4, "s").tickSizeOuter(0).tickSize(-d);
|
|
3906
|
+
F.select(".x-axis").attr("transform", `translate(0,${d})`).transition().duration(P).call(Be).selectAll("text").style("cursor", "pointer").attr("dy", x ? "1em" : ".20em").attr("dx", x ? "0em" : "-.8em").attr("class", gt).selectAll(".tick").filter((w) => w === 0).select("line").remove();
|
|
3907
|
+
const pe = r === "vertical" ? Qt(lt).ticks(4, "s").tickSize(-X) : Qt(ht).tickSizeOuter(0);
|
|
3908
|
+
F.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(st ? 0 : P).call(pe).selectAll(".tick").filter((w) => w === 0).select("line").remove();
|
|
3909
|
+
const te = bn().keys(tt)(O).map((w) => {
|
|
3910
|
+
const Q = w.key, U = w.map((yt) => {
|
|
3911
|
+
const bt = yt.data.label;
|
|
3912
3912
|
return {
|
|
3913
|
-
...
|
|
3914
|
-
key: `${
|
|
3915
|
-
barKey:
|
|
3913
|
+
...yt,
|
|
3914
|
+
key: `${Q} - ${bt}`,
|
|
3915
|
+
barKey: Q
|
|
3916
3916
|
};
|
|
3917
3917
|
});
|
|
3918
|
-
return
|
|
3919
|
-
}), Xt =
|
|
3920
|
-
(
|
|
3921
|
-
const
|
|
3922
|
-
return
|
|
3923
|
-
}).style("opacity", (
|
|
3924
|
-
if (
|
|
3918
|
+
return U.key = Q, U;
|
|
3919
|
+
}), Xt = F.selectAll(".serie").data(te, (w) => w.key).join(
|
|
3920
|
+
(w) => w.append("g").attr("class", "serie").attr("fill", (U) => {
|
|
3921
|
+
const yt = N.current.findIndex((Jt) => Jt === U.key) + n;
|
|
3922
|
+
return vt(yt);
|
|
3923
|
+
}).style("opacity", (U) => {
|
|
3924
|
+
if (K !== "")
|
|
3925
3925
|
if (e) {
|
|
3926
|
-
if (
|
|
3927
|
-
return
|
|
3926
|
+
if (k[0] === "all")
|
|
3927
|
+
return U.key === K || W ? 1 : 0.25;
|
|
3928
3928
|
} else
|
|
3929
|
-
return
|
|
3930
|
-
return e ?
|
|
3931
|
-
}).style("pointer-events", (
|
|
3932
|
-
(
|
|
3933
|
-
const
|
|
3934
|
-
return
|
|
3935
|
-
}).style("opacity", (
|
|
3936
|
-
if (
|
|
3929
|
+
return W ? 1 : U.key === K ? 0.25 : 1;
|
|
3930
|
+
return e ? k[0] === "all" || U.key === k[0] ? 1 : 0 : 1;
|
|
3931
|
+
}).style("pointer-events", (U) => e ? k[0] === "all" || U.key === k[0] ? "auto" : "none" : "auto"),
|
|
3932
|
+
(w) => w.transition().duration(P).attr("fill", (U) => {
|
|
3933
|
+
const yt = N.current.findIndex((Jt) => Jt === U.key) + n;
|
|
3934
|
+
return vt(yt);
|
|
3935
|
+
}).style("opacity", (U) => {
|
|
3936
|
+
if (K !== "")
|
|
3937
3937
|
if (e) {
|
|
3938
|
-
if (
|
|
3939
|
-
return
|
|
3938
|
+
if (k[0] === "all")
|
|
3939
|
+
return U.key === K || W ? 1 : 0.25;
|
|
3940
3940
|
} else
|
|
3941
|
-
return
|
|
3942
|
-
return e ?
|
|
3943
|
-
}).style("pointer-events", (
|
|
3944
|
-
(
|
|
3945
|
-
), Kt = (
|
|
3946
|
-
const
|
|
3947
|
-
return
|
|
3941
|
+
return W ? 1 : U.key === K ? 0.25 : 1;
|
|
3942
|
+
return e ? k[0] === "all" || U.key === k[0] ? 1 : 0 : 1;
|
|
3943
|
+
}).style("pointer-events", (U) => e ? k[0] === "all" || U.key === k[0] ? "auto" : "none" : "auto"),
|
|
3944
|
+
(w) => w.transition().duration(P).attr("fill", Vt).style("opacity", 0).selectAll("rect").attr("y", d).attr("height", 0).remove()
|
|
3945
|
+
), Kt = (w) => ht(w.data.label + "") ?? 0, Ut = ht.bandwidth(), qt = (w) => {
|
|
3946
|
+
const Q = r === "vertical" ? d : X;
|
|
3947
|
+
return st ? 0 : k[0] === "all" ? lt(r === "vertical" ? w[1] : w[0]) : (
|
|
3948
3948
|
/*d.key.startsWith(plotted)
|
|
3949
3949
|
?*/
|
|
3950
|
-
e && r !== "vertical" ?
|
|
3950
|
+
e && r !== "vertical" ? lt(0) : Q - (lt(w[0]) - lt(w[1]))
|
|
3951
3951
|
);
|
|
3952
|
-
}, Lt = (
|
|
3953
|
-
const
|
|
3954
|
-
return isNaN(
|
|
3955
|
-
}, Tt = (
|
|
3956
|
-
if (
|
|
3952
|
+
}, Lt = (w) => {
|
|
3953
|
+
const Q = r === "vertical" ? lt(w[0]) - lt(w[1]) : lt(w[1]) - lt(w[0]);
|
|
3954
|
+
return isNaN(Q) || Q < 0 ? 0 : Q;
|
|
3955
|
+
}, Tt = (w) => r === "vertical" ? Kt(w) : qt(w), $t = (w) => r === "vertical" ? Ut : Lt(w), V = (w) => r === "vertical" ? qt(w) : Kt(w), it = (w) => r === "vertical" ? Lt(w) : Ut, ot = (w) => {
|
|
3956
|
+
if (w.barKey === K)
|
|
3957
3957
|
return "none";
|
|
3958
|
-
const
|
|
3959
|
-
return
|
|
3960
|
-
}, I = (
|
|
3961
|
-
const
|
|
3962
|
-
return r === "vertical" ?
|
|
3963
|
-
}, at = (
|
|
3958
|
+
const Q = $t(w), U = it(w);
|
|
3959
|
+
return tt.indexOf(w.barKey) === tt.length - 1 || w.barKey === k[0] ? r === "vertical" ? `${Q + U} ${Q} ${U}` : `${Q + U + Q}` : r === "vertical" ? `${U} ${Q}` : `${Q} ${U}`;
|
|
3960
|
+
}, I = (w) => {
|
|
3961
|
+
const Q = $t(w), U = tt.indexOf(w.barKey) === tt.length - 1 || w.barKey === k[0];
|
|
3962
|
+
return r === "vertical" ? U ? 0 : Q * -1 : 0;
|
|
3963
|
+
}, at = (w) => K !== "" && K === w.barKey && e ? `rect ${rt.rectLegendHovered}` : `rect ${rt.rect}`;
|
|
3964
3964
|
Xt.selectAll("rect").data(
|
|
3965
|
-
(
|
|
3965
|
+
(w) => w,
|
|
3966
3966
|
// each group binds its stacked points
|
|
3967
|
-
(
|
|
3967
|
+
(w) => w.data.label
|
|
3968
3968
|
// unique key per bar
|
|
3969
3969
|
).join(
|
|
3970
|
-
(
|
|
3971
|
-
return r === "vertical" ? Tt(
|
|
3972
|
-
}).attr("width", function(
|
|
3973
|
-
return r === "vertical" ? $t(
|
|
3974
|
-
}).attr("y", (
|
|
3970
|
+
(w) => w.append("rect").attr("class", `rect ${nt.rect}`).attr("x", function(U) {
|
|
3971
|
+
return r === "vertical" ? Tt(U) : lt(0);
|
|
3972
|
+
}).attr("width", function(U) {
|
|
3973
|
+
return r === "vertical" ? $t(U) : 0;
|
|
3974
|
+
}).attr("y", (U) => {
|
|
3975
3975
|
if (r === "vertical") {
|
|
3976
|
-
if (!Ot.includes(
|
|
3977
|
-
const
|
|
3978
|
-
return
|
|
3976
|
+
if (!Ot.includes(U.data.label)) return d;
|
|
3977
|
+
const yt = k[0] === "all" ? lt(U[1]) : U.key.startsWith(k[0]) ? d - (lt(U[0]) - lt(U[1])) : lt(U[1]), bt = lt(U[0]) - lt(U[1]), Jt = isNaN(bt) || bt < 0 ? 0 : bt, ia = yt + Jt;
|
|
3978
|
+
return st ? d - (B.bottom + B.top) : ia;
|
|
3979
3979
|
} else
|
|
3980
|
-
return V(
|
|
3981
|
-
}).attr("height", function(
|
|
3982
|
-
return r === "vertical" ? 0 : it(
|
|
3983
|
-
}).attr("stroke-dasharray",
|
|
3980
|
+
return V(U);
|
|
3981
|
+
}).attr("height", function(U) {
|
|
3982
|
+
return r === "vertical" ? 0 : it(U);
|
|
3983
|
+
}).attr("stroke-dasharray", ot).attr("stroke-dashoffset", I).transition().duration(P).attr("x", Tt).attr("width", $t).attr("height", it).attr("y", V),
|
|
3984
3984
|
void 0,
|
|
3985
3985
|
// no custom update handler
|
|
3986
|
-
(
|
|
3987
|
-
).attr("class", at).attr("stroke-dasharray",
|
|
3986
|
+
(w) => w.transition().duration(P).attr("opacity", 0).attr("y", d).attr("height", 0).remove()
|
|
3987
|
+
).attr("class", at).attr("stroke-dasharray", ot).attr("stroke-dashoffset", I).transition().duration(P).attr("x", Tt).attr("width", $t).attr("height", it).attr("y", V).on("start", function() {
|
|
3988
3988
|
}).on("end", function() {
|
|
3989
|
-
}), Xt.selectAll("rect").on("mouseover", function(
|
|
3990
|
-
dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((bt) => bt ===
|
|
3991
|
-
const
|
|
3992
|
-
|
|
3993
|
-
}).on("touch", function(
|
|
3994
|
-
dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((
|
|
3995
|
-
}).on("mousemove", (
|
|
3996
|
-
Rn(
|
|
3997
|
-
}).on("mouseout", function(
|
|
3998
|
-
dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((
|
|
3989
|
+
}), Xt.selectAll("rect").on("mouseover", function(w, Q) {
|
|
3990
|
+
dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((bt) => bt === Q.data.label).attr("class", (r === "vertical" ? gt : "") + " " + rt.hoveredAxisText), Z.style("opacity", 1).select("p.title").text(Q.data.label);
|
|
3991
|
+
const U = Q.data[Q.barKey], { total: yt } = Q.data;
|
|
3992
|
+
Z.select("p.top-label").text(Q.barKey + " : " + St(U, i)), Z.select("p.bottom-label").text(k[0] === "all" ? `Total : ${St(yt, i)}` : "~");
|
|
3993
|
+
}).on("touch", function(w, Q) {
|
|
3994
|
+
dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((U) => U === Q.data.label);
|
|
3995
|
+
}).on("mousemove", (w, Q) => {
|
|
3996
|
+
Rn(Z, { e: w, svg: v, yScale: lt });
|
|
3997
|
+
}).on("mouseout", function(w, Q) {
|
|
3998
|
+
dt(r === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((U) => U === Q.data.label).attr("class", r === "vertical" ? gt : ""), Z.style("opacity", 0);
|
|
3999
3999
|
});
|
|
4000
|
-
}, [...
|
|
4000
|
+
}, [...g, et, A, S, K, W, z, r, i]);
|
|
4001
4001
|
return /* @__PURE__ */ H.jsxs(
|
|
4002
4002
|
"div",
|
|
4003
4003
|
{
|
|
4004
4004
|
ref: a,
|
|
4005
4005
|
style: { width: `${o}px`, height: `${c}px`, display: "flex", flexDirection: "column" },
|
|
4006
4006
|
children: [
|
|
4007
|
-
|
|
4007
|
+
C ? kn(m, C) : m,
|
|
4008
4008
|
/* @__PURE__ */ H.jsx(
|
|
4009
4009
|
"div",
|
|
4010
4010
|
{
|
|
@@ -4014,7 +4014,7 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
|
|
|
4014
4014
|
children: /* @__PURE__ */ H.jsxs(
|
|
4015
4015
|
"div",
|
|
4016
4016
|
{
|
|
4017
|
-
ref:
|
|
4017
|
+
ref: E,
|
|
4018
4018
|
className: `${nt["fill-container"]}`,
|
|
4019
4019
|
style: { display: "flex", flexDirection: "column" },
|
|
4020
4020
|
children: [
|
|
@@ -4022,8 +4022,8 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
|
|
|
4022
4022
|
"svg",
|
|
4023
4023
|
{
|
|
4024
4024
|
className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
|
|
4025
|
-
viewBox: `0 0 ${
|
|
4026
|
-
children:
|
|
4025
|
+
viewBox: `0 0 ${_} ${D}`,
|
|
4026
|
+
children: _ > 0 && /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
|
|
4027
4027
|
/* @__PURE__ */ H.jsx("g", { className: "plot-rects" }),
|
|
4028
4028
|
/* @__PURE__ */ H.jsx("g", { className: `${r === "vertical" ? rt["value-axis"] : ""} y-axis` }),
|
|
4029
4029
|
/* @__PURE__ */ H.jsx("g", { className: `${r === "horizontal" ? rt["value-axis"] : ""} x-axis` })
|
|
@@ -4041,63 +4041,63 @@ function Nf({ data: t, focusOnPlot: e = !1, colorIdx: n = 0, orientation: r = "v
|
|
|
4041
4041
|
);
|
|
4042
4042
|
}
|
|
4043
4043
|
function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipFormat: r }) {
|
|
4044
|
-
const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width:
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
}, [
|
|
4048
|
-
const
|
|
4049
|
-
|
|
4050
|
-
let
|
|
4051
|
-
return
|
|
4052
|
-
|
|
4053
|
-
},
|
|
4054
|
-
clearTimeout(
|
|
4044
|
+
const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width: y, height: _ } = f, [D, J] = ut(null), [j, z] = ut(!1), [M, k] = ut("all"), [R, W] = ut(!1), [Y, K] = ut(""), [q, et] = ut(!1), $ = Tn(), C = t;
|
|
4045
|
+
_t(() => {
|
|
4046
|
+
k("all"), z(!0), et(!1);
|
|
4047
|
+
}, [C]);
|
|
4048
|
+
const b = 750;
|
|
4049
|
+
_t(() => {
|
|
4050
|
+
let E;
|
|
4051
|
+
return j && (E = setTimeout(() => {
|
|
4052
|
+
z(!1);
|
|
4053
|
+
}, b + 500)), () => {
|
|
4054
|
+
clearTimeout(E);
|
|
4055
4055
|
};
|
|
4056
|
-
}, [
|
|
4057
|
-
const
|
|
4058
|
-
if (
|
|
4059
|
-
const
|
|
4060
|
-
const
|
|
4056
|
+
}, [j]);
|
|
4057
|
+
const P = [y, _, M, e], g = Mt(C), A = g.length === 0 ? [] : Object.keys(g[0]).filter((E) => E !== "label" && E !== "total"), S = Ne(A), N = y > 576, x = Et((E) => {
|
|
4058
|
+
if (j) return;
|
|
4059
|
+
const L = N ? 80 : 50, B = function(G) {
|
|
4060
|
+
const O = rt[N ? "legend-container" : "legend-container-sm"], X = rt[N ? "legend-container-active" : "legend-container-active-sm"], d = rt[N ? "legend-container-inactive" : "legend-container-inactive-sm"];
|
|
4061
4061
|
return `
|
|
4062
|
-
${
|
|
4062
|
+
${M.includes(G) ? M === G ? X : d : O}
|
|
4063
4063
|
legend-item
|
|
4064
4064
|
`;
|
|
4065
4065
|
};
|
|
4066
|
-
|
|
4067
|
-
(
|
|
4068
|
-
const
|
|
4069
|
-
return
|
|
4070
|
-
const
|
|
4071
|
-
return
|
|
4072
|
-
}),
|
|
4066
|
+
E.selectAll(".legend-item").data([...A], (G) => G).join(
|
|
4067
|
+
(G) => {
|
|
4068
|
+
const O = G.append("div").attr("class", B).style("left", (X, d) => `${d * L}px`).style("top", "-53px").style("opacity", 0);
|
|
4069
|
+
return O.append("div").attr("class", rt["legend-rect"]).style("background", (X) => {
|
|
4070
|
+
const d = S.current.findIndex((p) => p === X) + e;
|
|
4071
|
+
return vt(d);
|
|
4072
|
+
}), O.append("span").attr("class", rt["legend-label"]).text((X) => X), O.transition().duration(b).style("top", "0px").style("opacity", 1), O;
|
|
4073
4073
|
},
|
|
4074
|
-
(
|
|
4075
|
-
const
|
|
4076
|
-
return
|
|
4077
|
-
}),
|
|
4078
|
-
(
|
|
4079
|
-
).on("click", (
|
|
4080
|
-
|
|
4081
|
-
}).on("mouseover", (
|
|
4082
|
-
|
|
4083
|
-
}).on("mouseout", (
|
|
4084
|
-
|
|
4074
|
+
(G) => (G.attr("class", B).transition().duration(b).style("top", "0px").style("left", (O, X) => `${X * L}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (O) => {
|
|
4075
|
+
const X = S.current.findIndex((d) => d === O) + e;
|
|
4076
|
+
return vt(X);
|
|
4077
|
+
}), G.select(`.${rt["legend-label"]}`).text((O) => O), G),
|
|
4078
|
+
(G) => G.transition().duration(b).style("opacity", 0).style("top", "53px").remove().remove()
|
|
4079
|
+
).on("click", (G, O) => {
|
|
4080
|
+
k((X) => X === O ? (et(!1), "all") : O);
|
|
4081
|
+
}).on("mouseover", (G, O) => {
|
|
4082
|
+
K(O);
|
|
4083
|
+
}).on("mouseout", (G, O) => {
|
|
4084
|
+
K("");
|
|
4085
4085
|
});
|
|
4086
|
-
}, [...
|
|
4086
|
+
}, [...P, A, j]), T = /* @__PURE__ */ H.jsxs(
|
|
4087
4087
|
"div",
|
|
4088
4088
|
{
|
|
4089
4089
|
ref: c,
|
|
4090
|
-
className: `${nt[N ? "controls-container" : "controls-container-sm"]} ${
|
|
4090
|
+
className: `${nt[N ? "controls-container" : "controls-container-sm"]} ${$ ? nt["fill-container"] : ""}`,
|
|
4091
4091
|
children: [
|
|
4092
|
-
/* @__PURE__ */ H.jsxs("label", { className: `${nt["controls-label"]} ${
|
|
4092
|
+
/* @__PURE__ */ H.jsxs("label", { className: `${nt["controls-label"]} ${M === "all" ? nt.disabled : ""}`, style: { paddingRight: "12px" }, children: [
|
|
4093
4093
|
/* @__PURE__ */ H.jsx(
|
|
4094
4094
|
"input",
|
|
4095
4095
|
{
|
|
4096
4096
|
type: "checkbox",
|
|
4097
4097
|
className: `${nt["controls-checkbox"]}`,
|
|
4098
|
-
checked:
|
|
4099
|
-
onChange: (
|
|
4100
|
-
disabled:
|
|
4098
|
+
checked: q,
|
|
4099
|
+
onChange: (E) => et(E.target.checked),
|
|
4100
|
+
disabled: M === "all"
|
|
4101
4101
|
}
|
|
4102
4102
|
),
|
|
4103
4103
|
"Sort"
|
|
@@ -4112,65 +4112,65 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4112
4112
|
)
|
|
4113
4113
|
]
|
|
4114
4114
|
}
|
|
4115
|
-
), m = Et((
|
|
4116
|
-
if (
|
|
4117
|
-
const
|
|
4118
|
-
|
|
4119
|
-
V.total =
|
|
4120
|
-
|
|
4121
|
-
const I = V[
|
|
4115
|
+
), m = Et((E) => {
|
|
4116
|
+
if (y === 0 || _ === 0 || Y !== "" && j) return;
|
|
4117
|
+
const L = { top: 20, right: 30, bottom: 30, left: 40 };
|
|
4118
|
+
g.forEach(function(V) {
|
|
4119
|
+
V.total = A.reduce((it, ot) => {
|
|
4120
|
+
ot in V || (V[ot] = 0);
|
|
4121
|
+
const I = V[ot];
|
|
4122
4122
|
return it + (typeof I == "number" ? I : Number(I));
|
|
4123
4123
|
}, 0);
|
|
4124
4124
|
});
|
|
4125
|
-
const
|
|
4126
|
-
return Number(V[
|
|
4127
|
-
}) :
|
|
4128
|
-
|
|
4129
|
-
const
|
|
4125
|
+
const B = g, tt = q ? Mt(B).sort(function(V, it) {
|
|
4126
|
+
return Number(V[M]) - Number(it[M]);
|
|
4127
|
+
}) : B, G = y - L.left - L.right, O = _ - L.top - L.bottom, X = E.select("svg"), d = X.node(), p = X.select(".plot-area").attr("transform", "translate(" + L.left + "," + L.top + ")"), v = Ye(E).style("opacity", 0);
|
|
4128
|
+
D === null && J(Mt(g));
|
|
4129
|
+
const F = M === "all", Z = !N && n === "vertical" ? rt.rotatedAxisText : rt.axisText, st = tt.map(function(V) {
|
|
4130
4130
|
return V.label;
|
|
4131
|
-
}), ct = Ae().domain(
|
|
4132
|
-
|
|
4131
|
+
}), ct = Ae().domain(st).rangeRound(n === "vertical" ? [0, G] : [O, 0]).paddingInner(F ? 0.15 : N ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), ht = M === "all" ? Yt(
|
|
4132
|
+
g,
|
|
4133
4133
|
(V) => Yt(
|
|
4134
4134
|
Object.entries(V).filter(([it]) => it !== "total" && it !== "label").map(([, it]) => it)
|
|
4135
4135
|
// value is number | string | undefined
|
|
4136
4136
|
)
|
|
4137
|
-
) : Yt(
|
|
4138
|
-
|
|
4139
|
-
const
|
|
4140
|
-
|
|
4141
|
-
const Be = bn().keys(
|
|
4137
|
+
) : Yt(g, (V) => V[M]), ft = ce().domain([0, ht ?? 0]).range(n === "vertical" ? [O, 0] : [0, G]), lt = n === "vertical" ? Zt(ct).tickValues(ct.domain()).tickSizeOuter(0) : Zt(ft).ticks(4, "s").tickSizeOuter(0).tickSize(-O);
|
|
4138
|
+
p.select(".x-axis").attr("transform", `translate(0,${O})`).transition().duration(b).call(lt).selectAll("text").style("cursor", "pointer").attr("dy", N ? "1em" : ".20em").attr("dx", N ? "0em" : "-.8em").attr("class", Z).selectAll(".tick").filter((V) => V === 0).select("line").remove();
|
|
4139
|
+
const gt = n === "vertical" ? Qt(ft).ticks(4, "s").tickSize(-G) : Qt(ct).tickSizeOuter(0);
|
|
4140
|
+
p.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(b).call(gt).selectAll(".tick").filter((V) => V === 0).select("line").remove();
|
|
4141
|
+
const Be = bn().keys(A)(tt).map(
|
|
4142
4142
|
(V) => {
|
|
4143
|
-
const it = V.key,
|
|
4143
|
+
const it = V.key, ot = V.map((I) => ({
|
|
4144
4144
|
...I,
|
|
4145
4145
|
key: `${it} - ${I.data.label}`,
|
|
4146
4146
|
barKey: it
|
|
4147
4147
|
}));
|
|
4148
|
-
return
|
|
4148
|
+
return ot.key = it, ot;
|
|
4149
4149
|
}
|
|
4150
|
-
), pe = (V) =>
|
|
4151
|
-
${
|
|
4152
|
-
let ge =
|
|
4150
|
+
), pe = (V) => Y !== "" ? `rect
|
|
4151
|
+
${Y === V.barKey ? rt.rectLegendHovered : rt.rectLegendNotHovered}` : `rect ${rt.rect}`;
|
|
4152
|
+
let ge = p.selectAll(".serie").data(Be, function(V) {
|
|
4153
4153
|
return V.key;
|
|
4154
4154
|
}).join(
|
|
4155
|
-
(V) => V.append("g").attr("class", "serie").attr("fill", function(
|
|
4156
|
-
const I =
|
|
4157
|
-
return
|
|
4158
|
-
}).style("opacity", (
|
|
4159
|
-
(V) => V.transition().duration(
|
|
4160
|
-
const I =
|
|
4161
|
-
return
|
|
4162
|
-
}).style("opacity", (
|
|
4163
|
-
(V) => V.transition().duration(
|
|
4155
|
+
(V) => V.append("g").attr("class", "serie").attr("fill", function(ot) {
|
|
4156
|
+
const I = S.current.findIndex((at) => at === ot.key) + e;
|
|
4157
|
+
return vt(I);
|
|
4158
|
+
}).style("opacity", (ot) => M === "all" || ot.key === M ? 1 : 0).style("pointer-events", (ot) => M === "all" || ot.key === M ? "auto" : "none"),
|
|
4159
|
+
(V) => V.transition().duration(b).attr("fill", function(ot) {
|
|
4160
|
+
const I = S.current.findIndex((at) => at === ot.key) + e;
|
|
4161
|
+
return vt(I);
|
|
4162
|
+
}).style("opacity", (ot) => M === "all" || ot.key === M ? 1 : 0).style("pointer-events", (ot) => M === "all" || ot.key === M ? "auto" : "none"),
|
|
4163
|
+
(V) => V.transition().duration(b).style("opacity", 0).attr("fill", "grey").selectAll("rect").attr("y", O).attr("height", 0).remove()
|
|
4164
4164
|
);
|
|
4165
4165
|
const te = (V) => {
|
|
4166
4166
|
const it = ct(V.data.label + "") ?? 0;
|
|
4167
|
-
if (
|
|
4168
|
-
const
|
|
4169
|
-
return it +
|
|
4167
|
+
if (M === "all") {
|
|
4168
|
+
const ot = A.indexOf(V.barKey) || 0;
|
|
4169
|
+
return it + ot * (ct.bandwidth() / A.length);
|
|
4170
4170
|
}
|
|
4171
4171
|
return it;
|
|
4172
|
-
}, Xt = () =>
|
|
4173
|
-
const it = n === "vertical" ?
|
|
4172
|
+
}, Xt = () => M === "all" ? ct.bandwidth() / A.length : ct.bandwidth(), Kt = (V) => n === "vertical" ? O - (ft(V[0]) - ft(V[1])) : ft(0), Ut = (V) => {
|
|
4173
|
+
const it = n === "vertical" ? ft(V[0]) - ft(V[1]) : ft(V[1]) - ft(V[0]);
|
|
4174
4174
|
return isNaN(it) || it < 0 ? 0 : it;
|
|
4175
4175
|
}, qt = (V) => n === "vertical" ? te(V) : Kt(V), Lt = (V) => n === "vertical" ? Xt() : Ut(V), Tt = (V) => n === "vertical" ? Kt(V) : te(V), $t = (V) => n === "vertical" ? Ut(V) : Xt();
|
|
4176
4176
|
ge.selectAll("rect").data(
|
|
@@ -4179,39 +4179,39 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4179
4179
|
).join(
|
|
4180
4180
|
(V) => {
|
|
4181
4181
|
let it;
|
|
4182
|
-
return it = V.append("rect").attr("class", pe).attr("x", function(
|
|
4183
|
-
return n === "vertical" ? qt(
|
|
4184
|
-
}).attr("width", function(
|
|
4185
|
-
return n === "vertical" ?
|
|
4186
|
-
}).attr("y", function(
|
|
4187
|
-
return n === "vertical" ?
|
|
4188
|
-
}).attr("height", function(
|
|
4189
|
-
return n === "vertical" ? 0 :
|
|
4190
|
-
}).transition().duration(
|
|
4182
|
+
return it = V.append("rect").attr("class", pe).attr("x", function(ot) {
|
|
4183
|
+
return n === "vertical" ? qt(ot) : 0;
|
|
4184
|
+
}).attr("width", function(ot) {
|
|
4185
|
+
return n === "vertical" ? M === "all" ? ct.bandwidth() / A.length : ct.bandwidth() : 0;
|
|
4186
|
+
}).attr("y", function(ot) {
|
|
4187
|
+
return n === "vertical" ? O : Tt(ot);
|
|
4188
|
+
}).attr("height", function(ot) {
|
|
4189
|
+
return n === "vertical" ? 0 : M === "all" ? ct.bandwidth() / A.length : ct.bandwidth();
|
|
4190
|
+
}).transition().duration(b).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), it;
|
|
4191
4191
|
},
|
|
4192
4192
|
void 0,
|
|
4193
|
-
(V) => V.attr("fill", Vt).transition().duration(
|
|
4194
|
-
).attr("class", pe).transition().duration(
|
|
4195
|
-
dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((
|
|
4196
|
-
const
|
|
4197
|
-
he(".1f")(at) + "",
|
|
4198
|
-
|
|
4193
|
+
(V) => V.attr("fill", Vt).transition().duration(b).attr("opacity", 0).attr("height", 0).attr("y", O + L.bottom).remove()
|
|
4194
|
+
).attr("class", pe).transition().duration(b).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), ge.selectAll("rect").on("mouseover", function(V, it) {
|
|
4195
|
+
dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((w) => w === it.data.label).attr("class", (n === "vertical" ? Z : "") + " " + rt.hoveredAxisText), v.style("opacity", 1).select("p.title").text(it.data.label);
|
|
4196
|
+
const ot = it.data[it.barKey], { total: I } = it.data, at = ot / I * 100;
|
|
4197
|
+
he(".1f")(at) + "", v.select("p.top-label").text(it.barKey + " : " + St(ot, r)), v.select("p.bottom-label").text(
|
|
4198
|
+
M === "all" ? `Total : ${St(I, r)}` : "~"
|
|
4199
4199
|
);
|
|
4200
4200
|
}).on("touch", function(V, it) {
|
|
4201
|
-
dt(".x-axis").selectAll("text").filter((
|
|
4201
|
+
dt(".x-axis").selectAll("text").filter((ot) => ot === it.data.label).attr("class", Z);
|
|
4202
4202
|
}).on("mousemove", (V, it) => {
|
|
4203
|
-
Rn(
|
|
4203
|
+
Rn(v, { e: V, svg: d, yScale: ft });
|
|
4204
4204
|
}).on("mouseout", function(V, it) {
|
|
4205
|
-
dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((
|
|
4205
|
+
dt(n === "vertical" ? ".x-axis" : ".y-axis").selectAll("text").filter((ot) => ot === it.data.label).attr("class", n === "vertical" ? Z : ""), v.style("opacity", 0);
|
|
4206
4206
|
});
|
|
4207
|
-
}, [...
|
|
4207
|
+
}, [...P, q, g, A, Y, R, n, j, r]);
|
|
4208
4208
|
return /* @__PURE__ */ H.jsxs(
|
|
4209
4209
|
"div",
|
|
4210
4210
|
{
|
|
4211
4211
|
ref: i,
|
|
4212
4212
|
style: { width: s, height: o, display: "flex", flexDirection: "column" },
|
|
4213
4213
|
children: [
|
|
4214
|
-
|
|
4214
|
+
$ ? kn(T, $) : T,
|
|
4215
4215
|
/* @__PURE__ */ H.jsx(
|
|
4216
4216
|
"div",
|
|
4217
4217
|
{
|
|
@@ -4229,8 +4229,8 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4229
4229
|
"svg",
|
|
4230
4230
|
{
|
|
4231
4231
|
className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
|
|
4232
|
-
viewBox: `0 0 ${
|
|
4233
|
-
children:
|
|
4232
|
+
viewBox: `0 0 ${y} ${_}`,
|
|
4233
|
+
children: y > 0 && /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
|
|
4234
4234
|
/* @__PURE__ */ H.jsx("g", { className: "plot-rects" }),
|
|
4235
4235
|
/* @__PURE__ */ H.jsx("g", { className: `${n === "vertical" ? rt["value-axis"] : ""} y-axis` }),
|
|
4236
4236
|
/* @__PURE__ */ H.jsx("g", { className: `${n === "horizontal" ? rt["value-axis"] : ""} x-axis` })
|
|
@@ -4248,51 +4248,51 @@ function Sf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4248
4248
|
);
|
|
4249
4249
|
}
|
|
4250
4250
|
function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipFormat: r }) {
|
|
4251
|
-
const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width:
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
}, [
|
|
4255
|
-
const
|
|
4256
|
-
|
|
4251
|
+
const [i, a] = de(), { width: s, height: o } = a, [c, l] = ue(), { height: u } = l, [h, f] = ue(), { width: y, height: _ } = f, [D, J] = ut(""), [j, z] = ut(!0), [M, k] = ut(!1), [R, W] = ut("all"), Y = Tn(), K = t;
|
|
4252
|
+
_t(() => {
|
|
4253
|
+
W("all"), z(!0), k(!0);
|
|
4254
|
+
}, [K]);
|
|
4255
|
+
const q = 750;
|
|
4256
|
+
_t(() => {
|
|
4257
4257
|
let N;
|
|
4258
|
-
return
|
|
4259
|
-
|
|
4260
|
-
},
|
|
4258
|
+
return M && (N = setTimeout(() => {
|
|
4259
|
+
k(!1);
|
|
4260
|
+
}, q + 500)), () => {
|
|
4261
4261
|
clearTimeout(N);
|
|
4262
4262
|
};
|
|
4263
|
-
}, [
|
|
4264
|
-
const
|
|
4265
|
-
if (
|
|
4266
|
-
const x =
|
|
4267
|
-
const
|
|
4263
|
+
}, [M]);
|
|
4264
|
+
const et = [y, _, R, e], $ = Mt(K), C = $.length === 0 ? [] : Object.keys($[0]).filter((N) => N !== "label" && N !== "total"), b = Ne(C), P = y > 576, g = Et((N) => {
|
|
4265
|
+
if (M) return;
|
|
4266
|
+
const x = P ? 80 : 50, T = function(E) {
|
|
4267
|
+
const L = rt[P ? "legend-container" : "legend-container-sm"], B = rt[P ? "legend-container-active" : "legend-container-active-sm"], tt = rt[P ? "legend-container-inactive" : "legend-container-inactive-sm"];
|
|
4268
4268
|
return `
|
|
4269
|
-
${
|
|
4269
|
+
${R.includes(E) ? R === E ? B : tt : L}
|
|
4270
4270
|
legend-item
|
|
4271
4271
|
`;
|
|
4272
4272
|
};
|
|
4273
|
-
N.selectAll(".legend-item").data([...
|
|
4274
|
-
(
|
|
4275
|
-
const
|
|
4276
|
-
return
|
|
4277
|
-
const
|
|
4278
|
-
return
|
|
4279
|
-
}),
|
|
4273
|
+
N.selectAll(".legend-item").data([...C], (E) => E).join(
|
|
4274
|
+
(E) => {
|
|
4275
|
+
const L = E.append("div").attr("class", T).style("left", (B, tt) => `${tt * x}px`).style("top", "-53px").style("opacity", 0);
|
|
4276
|
+
return L.append("div").attr("class", rt["legend-rect"]).style("background", (B) => {
|
|
4277
|
+
const tt = b.current.findIndex((G) => G === B) + e;
|
|
4278
|
+
return vt(tt);
|
|
4279
|
+
}), L.append("span").attr("class", rt["legend-label"]).text((B) => B), L.transition().duration(q).style("top", "0px").style("opacity", 1), L;
|
|
4280
4280
|
},
|
|
4281
|
-
(
|
|
4282
|
-
const
|
|
4283
|
-
return
|
|
4284
|
-
}),
|
|
4285
|
-
(
|
|
4286
|
-
).on("mouseover", (
|
|
4287
|
-
|
|
4288
|
-
}).on("mouseout", function(
|
|
4289
|
-
|
|
4281
|
+
(E) => (E.attr("class", T).transition().duration(q).style("top", "0px").style("left", (L, B) => `${B * x}px`).style("opacity", 1).select(`.${rt["legend-rect"]}`).style("background", (L) => {
|
|
4282
|
+
const B = b.current.findIndex((tt) => tt === L) + e;
|
|
4283
|
+
return vt(B);
|
|
4284
|
+
}), E.select(`.${rt["legend-label"]}`).text((L) => L), E),
|
|
4285
|
+
(E) => E.transition().duration(q).style("opacity", 0).style("top", "53px").remove().remove().remove()
|
|
4286
|
+
).on("mouseover", (E, L) => {
|
|
4287
|
+
J(L);
|
|
4288
|
+
}).on("mouseout", function(E) {
|
|
4289
|
+
J("");
|
|
4290
4290
|
});
|
|
4291
|
-
}, [...
|
|
4291
|
+
}, [...et, C, M]), A = /* @__PURE__ */ H.jsxs(
|
|
4292
4292
|
"div",
|
|
4293
4293
|
{
|
|
4294
4294
|
ref: c,
|
|
4295
|
-
className: `${nt["controls-container"]} ${
|
|
4295
|
+
className: `${nt["controls-container"]} ${Y ? nt["fill-container"] : ""}`,
|
|
4296
4296
|
children: [
|
|
4297
4297
|
/* @__PURE__ */ H.jsxs("label", { className: nt["controls-label"], style: { paddingRight: "12px" }, children: [
|
|
4298
4298
|
/* @__PURE__ */ H.jsx(
|
|
@@ -4300,8 +4300,8 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4300
4300
|
{
|
|
4301
4301
|
type: "checkbox",
|
|
4302
4302
|
className: nt["controls-checkbox"],
|
|
4303
|
-
checked:
|
|
4304
|
-
onChange: (N) =>
|
|
4303
|
+
checked: j,
|
|
4304
|
+
onChange: (N) => z(N.target.checked)
|
|
4305
4305
|
}
|
|
4306
4306
|
),
|
|
4307
4307
|
"Percentage"
|
|
@@ -4309,117 +4309,117 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4309
4309
|
/* @__PURE__ */ H.jsx(
|
|
4310
4310
|
"div",
|
|
4311
4311
|
{
|
|
4312
|
-
ref:
|
|
4312
|
+
ref: g,
|
|
4313
4313
|
id: "stacked-barchart-legends",
|
|
4314
4314
|
className: `${rt["legends-container"]}`
|
|
4315
4315
|
}
|
|
4316
4316
|
)
|
|
4317
4317
|
]
|
|
4318
4318
|
}
|
|
4319
|
-
),
|
|
4320
|
-
if (
|
|
4319
|
+
), S = Et((N) => {
|
|
4320
|
+
if (y === 0 || _ === 0 || D !== "" && M) return;
|
|
4321
4321
|
const x = { top: 20, right: 30, bottom: 30, left: 40 };
|
|
4322
|
-
|
|
4323
|
-
I.total =
|
|
4324
|
-
|
|
4325
|
-
const
|
|
4326
|
-
return at + (typeof
|
|
4322
|
+
$.forEach(function(I) {
|
|
4323
|
+
I.total = C.reduce((at, w) => {
|
|
4324
|
+
w in I || (I[w] = 0);
|
|
4325
|
+
const Q = I[w];
|
|
4326
|
+
return at + (typeof Q == "number" ? Q : Number(Q));
|
|
4327
4327
|
}, 0);
|
|
4328
4328
|
});
|
|
4329
|
-
const m =
|
|
4329
|
+
const m = $.filter((I) => I?.total && I.total > 0), E = y - x.left - x.right, L = _ - x.top - x.bottom, B = N.select("svg"), tt = B.node(), G = B.select(".plot-area").attr("transform", "translate(" + x.left + "," + x.top + ")"), O = Ye(N).style("opacity", 0), X = !P && n === "vertical" ? rt.rotatedAxisText : rt.axisText, d = m.map(function(I) {
|
|
4330
4330
|
return I.label;
|
|
4331
|
-
}),
|
|
4331
|
+
}), p = Ae().domain(d).rangeRound(n === "vertical" ? [0, E] : [L, 0]).paddingInner(P ? 0.4 : 0.25).paddingOuter(0.2).align(0.2), v = Yt($, (I) => I.total), F = ce().domain([0, j ? 1 : v || 0]).nice().range(n === "vertical" ? [L, 0] : [0, E]), Z = Ae().rangeRound([0, E]).paddingInner(0.1).align(0.2), st = m.map(function(I) {
|
|
4332
4332
|
return I.label;
|
|
4333
4333
|
});
|
|
4334
|
-
|
|
4335
|
-
const ct = [], ht = n === "vertical" ? Zt(
|
|
4336
|
-
|
|
4337
|
-
const
|
|
4338
|
-
|
|
4339
|
-
const Ot = bn().order(ir).offset($u), pe = (
|
|
4340
|
-
const at = I.key,
|
|
4341
|
-
const
|
|
4334
|
+
Z.domain(st);
|
|
4335
|
+
const ct = [], ht = n === "vertical" ? Zt(p).tickValues(p.domain()).tickSizeOuter(0) : Zt(F).ticks(4, j ? ".0%" : "s").tickSizeOuter(0).tickSize(-L);
|
|
4336
|
+
G.select(".x-axis").attr("transform", `translate(0,${L})`).transition().duration(q).call(ht).selectAll("text").style("cursor", "pointer").attr("dy", P ? "1em" : ".20em").attr("dx", P ? "0em" : "-.8em").attr("class", X).selectAll(".tick").filter((I) => I === 0).select("line").remove();
|
|
4337
|
+
const ft = Yt($, (I) => I.total), lt = ce().domain([0, j ? 1 : ft || 0]).nice().range([L, 0]), gt = n === "vertical" ? Qt(F).ticks(4, j ? ".0%" : "s").tickSize(-E) : Qt(p).tickSizeOuter(0);
|
|
4338
|
+
G.select(".y-axis").attr("transform", "translate(0,0)").transition().duration(q).call(gt).selectAll(".tick").filter((I) => I === 0).select("line").remove();
|
|
4339
|
+
const Ot = bn().order(ir).offset($u), pe = (j ? Ot.keys(C)(m) : bn().keys(C)(m)).map((I) => {
|
|
4340
|
+
const at = I.key, w = I.map((Q) => {
|
|
4341
|
+
const U = Q.data.label;
|
|
4342
4342
|
return {
|
|
4343
|
-
...
|
|
4344
|
-
key: `${at} - ${
|
|
4343
|
+
...Q,
|
|
4344
|
+
key: `${at} - ${U}`,
|
|
4345
4345
|
barKey: at
|
|
4346
4346
|
};
|
|
4347
4347
|
});
|
|
4348
|
-
return
|
|
4348
|
+
return w.key = at, w;
|
|
4349
4349
|
});
|
|
4350
|
-
let ge =
|
|
4350
|
+
let ge = G.selectAll(".serie").data(pe, function(I) {
|
|
4351
4351
|
return I.key;
|
|
4352
4352
|
}).join(
|
|
4353
|
-
(I) => I.append("g").attr("class", "serie").attr("fill", function(
|
|
4354
|
-
const
|
|
4355
|
-
return
|
|
4353
|
+
(I) => I.append("g").attr("class", "serie").attr("fill", function(w) {
|
|
4354
|
+
const Q = b.current.findIndex((U) => U === w.key) + e;
|
|
4355
|
+
return vt(Q);
|
|
4356
4356
|
}).style("opacity", 1).style("pointer-events", "auto"),
|
|
4357
|
-
(I) => I.transition().duration(
|
|
4358
|
-
const
|
|
4359
|
-
return
|
|
4357
|
+
(I) => I.transition().duration(q).attr("fill", function(w) {
|
|
4358
|
+
const Q = b.current.findIndex((U) => U === w.key) + e;
|
|
4359
|
+
return vt(Q);
|
|
4360
4360
|
}).style("opacity", 1).style("pointer-events", "auto"),
|
|
4361
|
-
(I) => I.transition().duration(
|
|
4361
|
+
(I) => I.transition().duration(q).style("opacity", 0).attr("fill", Vt).selectAll("rect").attr("y", L).attr("height", 0).remove()
|
|
4362
4362
|
);
|
|
4363
|
-
const te = (I) =>
|
|
4364
|
-
const at = n === "vertical" ?
|
|
4363
|
+
const te = (I) => p(I.data.label + "") ?? 0, Xt = p.bandwidth(), Kt = (I) => F(n === "vertical" ? I[1] : I[0]), Ut = (I) => {
|
|
4364
|
+
const at = n === "vertical" ? F(I[0]) - F(I[1]) : F(I[1]) - F(I[0]);
|
|
4365
4365
|
return isNaN(at) || at < 0 ? 0 : at;
|
|
4366
4366
|
}, qt = (I) => n === "vertical" ? te(I) : Kt(I), Lt = (I) => n === "vertical" ? Xt : Ut(I), Tt = (I) => n === "vertical" ? Kt(I) : te(I), $t = (I) => n === "vertical" ? Ut(I) : Xt;
|
|
4367
4367
|
function V(I) {
|
|
4368
|
-
if (I.barKey ===
|
|
4368
|
+
if (I.barKey === D)
|
|
4369
4369
|
return "none";
|
|
4370
|
-
const at = Lt(I),
|
|
4371
|
-
return
|
|
4370
|
+
const at = Lt(I), w = $t(I);
|
|
4371
|
+
return C.indexOf(I.barKey) === C.length - 1 || I.barKey === R[0] ? n === "vertical" ? `${at + w} ${at} ${w}` : `${at + w + at}` : n === "vertical" ? `${w} ${at}` : `${at} ${w}`;
|
|
4372
4372
|
}
|
|
4373
4373
|
function it(I) {
|
|
4374
|
-
const at = Lt(I),
|
|
4375
|
-
return n === "vertical" ?
|
|
4374
|
+
const at = Lt(I), w = C.indexOf(I.barKey) === C.length - 1;
|
|
4375
|
+
return n === "vertical" ? w ? 0 : at * -1 : 0;
|
|
4376
4376
|
}
|
|
4377
|
-
const
|
|
4377
|
+
const ot = (I) => D !== "" && D === I.barKey ? `rect ${rt.rectLegendHovered}` : `rect ${rt.rect}`;
|
|
4378
4378
|
ge.selectAll("rect").data(
|
|
4379
4379
|
(I) => I,
|
|
4380
4380
|
(I) => I.data.label
|
|
4381
4381
|
).join(
|
|
4382
4382
|
(I) => {
|
|
4383
4383
|
let at;
|
|
4384
|
-
return at = I.append("rect").attr("class",
|
|
4385
|
-
return n === "vertical" ?
|
|
4386
|
-
}).attr("width", function(
|
|
4387
|
-
return n === "vertical" ?
|
|
4388
|
-
}).attr("y", function(
|
|
4384
|
+
return at = I.append("rect").attr("class", ot).attr("x", function(w) {
|
|
4385
|
+
return n === "vertical" ? Z(w.data.label + "") ?? 0 : F(0);
|
|
4386
|
+
}).attr("width", function(w) {
|
|
4387
|
+
return n === "vertical" ? p.bandwidth() : 0;
|
|
4388
|
+
}).attr("y", function(w) {
|
|
4389
4389
|
if (n === "vertical") {
|
|
4390
|
-
if (!ct.includes(
|
|
4391
|
-
return
|
|
4392
|
-
const
|
|
4393
|
-
return
|
|
4390
|
+
if (!ct.includes(w.data.label + ""))
|
|
4391
|
+
return L;
|
|
4392
|
+
const Q = F(w[1]), U = F(w[0]) - F(w[1]), yt = isNaN(U) || U < 0 ? 0 : U;
|
|
4393
|
+
return Q + yt;
|
|
4394
4394
|
} else
|
|
4395
|
-
return Tt(
|
|
4396
|
-
}).attr("height", function(
|
|
4397
|
-
return n === "vertical" ? 0 : $t(
|
|
4398
|
-
}).attr("stroke-dasharray", V).attr("stroke-dashoffset", it).transition().duration(
|
|
4395
|
+
return Tt(w);
|
|
4396
|
+
}).attr("height", function(w) {
|
|
4397
|
+
return n === "vertical" ? 0 : $t(w);
|
|
4398
|
+
}).attr("stroke-dasharray", V).attr("stroke-dashoffset", it).transition().duration(q).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), at;
|
|
4399
4399
|
},
|
|
4400
4400
|
void 0,
|
|
4401
|
-
(I) => I.transition().duration(
|
|
4402
|
-
).attr("class",
|
|
4403
|
-
dt(".x-axis").selectAll("text").filter((bt) => bt === at.data.name).attr("class",
|
|
4404
|
-
const
|
|
4405
|
-
|
|
4406
|
-
|
|
4401
|
+
(I) => I.transition().duration(q).attr("opacity", 0).attr("height", 0).attr("y", L).remove()
|
|
4402
|
+
).attr("class", ot).attr("stroke-dasharray", V).attr("stroke-dashoffset", it).transition().duration(q).attr("x", qt).attr("width", Lt).attr("height", $t).attr("y", Tt), ge.selectAll("rect").on("mouseover", function(I, at) {
|
|
4403
|
+
dt(".x-axis").selectAll("text").filter((bt) => bt === at.data.name).attr("class", X + " " + nt.hoveredAxisText), O.style("opacity", 1).select("p.title").text(at.data.label);
|
|
4404
|
+
const w = at.data[at.barKey] || 0, Q = at.data.total || 0, U = w / Q * 100, yt = he(".1f")(U) + "%";
|
|
4405
|
+
O.select("p.top-label").text(at.barKey + " : " + (j ? yt : St(w, r))), O.select("p.bottom-label").text(
|
|
4406
|
+
j ? `(${St(w, r)} of ${St(Q, r)})` : `Total : ${St(Q, r)}`
|
|
4407
4407
|
);
|
|
4408
4408
|
}).on("touch", function(I, at) {
|
|
4409
|
-
dt(".x-axis").selectAll("text").filter((
|
|
4409
|
+
dt(".x-axis").selectAll("text").filter((w) => w === at.data.label).attr("class", X);
|
|
4410
4410
|
}).on("mousemove", (I, at) => {
|
|
4411
|
-
Rn(
|
|
4411
|
+
Rn(O, { e: I, svg: tt, yScale: lt });
|
|
4412
4412
|
}).on("mouseout", function(I, at) {
|
|
4413
|
-
dt(".x-axis").selectAll("text").filter((
|
|
4413
|
+
dt(".x-axis").selectAll("text").filter((w) => w === at.data.name).attr("class", X), O.style("opacity", 0);
|
|
4414
4414
|
});
|
|
4415
|
-
}, [...
|
|
4415
|
+
}, [...et, $, C, j, D, n, M, r]);
|
|
4416
4416
|
return /* @__PURE__ */ H.jsxs(
|
|
4417
4417
|
"div",
|
|
4418
4418
|
{
|
|
4419
4419
|
ref: i,
|
|
4420
4420
|
style: { width: s, height: o, display: "flex", flexDirection: "column" },
|
|
4421
4421
|
children: [
|
|
4422
|
-
|
|
4422
|
+
Y ? kn(A, Y) : A,
|
|
4423
4423
|
/* @__PURE__ */ H.jsx(
|
|
4424
4424
|
"div",
|
|
4425
4425
|
{
|
|
@@ -4429,7 +4429,7 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4429
4429
|
children: /* @__PURE__ */ H.jsxs(
|
|
4430
4430
|
"div",
|
|
4431
4431
|
{
|
|
4432
|
-
ref:
|
|
4432
|
+
ref: S,
|
|
4433
4433
|
className: `${nt["fill-container"]}`,
|
|
4434
4434
|
style: { display: "flex", flexDirection: "column" },
|
|
4435
4435
|
children: [
|
|
@@ -4437,7 +4437,7 @@ function Mf({ data: t, colorIdx: e = 0, orientation: n = "vertical", tooltipForm
|
|
|
4437
4437
|
"svg",
|
|
4438
4438
|
{
|
|
4439
4439
|
className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
|
|
4440
|
-
viewBox: `0 0 ${
|
|
4440
|
+
viewBox: `0 0 ${y} ${_}`,
|
|
4441
4441
|
children: /* @__PURE__ */ H.jsxs("g", { className: "plot-area", children: [
|
|
4442
4442
|
/* @__PURE__ */ H.jsx("g", { className: "plot-rects" }),
|
|
4443
4443
|
/* @__PURE__ */ H.jsx("g", { className: `${n === "vertical" ? rt["value-axis"] : ""} y-axis` }),
|
|
@@ -4535,200 +4535,200 @@ function si({ nodes: t }) {
|
|
|
4535
4535
|
}
|
|
4536
4536
|
}
|
|
4537
4537
|
function af() {
|
|
4538
|
-
let t = 0, e = 0, n = 1, r = 1, i = 24, a = 8, s, o = ef, c = tf, l, u, h = nf, f = rf,
|
|
4539
|
-
function
|
|
4540
|
-
const
|
|
4541
|
-
return
|
|
4538
|
+
let t = 0, e = 0, n = 1, r = 1, i = 24, a = 8, s, o = ef, c = tf, l, u, h = nf, f = rf, y = 6;
|
|
4539
|
+
function _() {
|
|
4540
|
+
const g = { nodes: h.apply(null, arguments), links: f.apply(null, arguments) };
|
|
4541
|
+
return D(g), J(g), j(g), z(g), R(g), si(g), g;
|
|
4542
4542
|
}
|
|
4543
|
-
|
|
4544
|
-
return si(
|
|
4545
|
-
},
|
|
4546
|
-
return arguments.length ? (o = typeof
|
|
4547
|
-
},
|
|
4548
|
-
return arguments.length ? (c = typeof
|
|
4549
|
-
},
|
|
4550
|
-
return arguments.length ? (l =
|
|
4551
|
-
},
|
|
4552
|
-
return arguments.length ? (i = +
|
|
4553
|
-
},
|
|
4554
|
-
return arguments.length ? (a = s = +
|
|
4555
|
-
},
|
|
4556
|
-
return arguments.length ? (h = typeof
|
|
4557
|
-
},
|
|
4558
|
-
return arguments.length ? (f = typeof
|
|
4559
|
-
},
|
|
4560
|
-
return arguments.length ? (u =
|
|
4561
|
-
},
|
|
4562
|
-
return arguments.length ? (t = e = 0, n = +
|
|
4563
|
-
},
|
|
4564
|
-
return arguments.length ? (t = +
|
|
4565
|
-
},
|
|
4566
|
-
return arguments.length ? (
|
|
4543
|
+
_.update = function(g) {
|
|
4544
|
+
return si(g), g;
|
|
4545
|
+
}, _.nodeId = function(g) {
|
|
4546
|
+
return arguments.length ? (o = typeof g == "function" ? g : nn(g), _) : o;
|
|
4547
|
+
}, _.nodeAlign = function(g) {
|
|
4548
|
+
return arguments.length ? (c = typeof g == "function" ? g : nn(g), _) : c;
|
|
4549
|
+
}, _.nodeSort = function(g) {
|
|
4550
|
+
return arguments.length ? (l = g, _) : l;
|
|
4551
|
+
}, _.nodeWidth = function(g) {
|
|
4552
|
+
return arguments.length ? (i = +g, _) : i;
|
|
4553
|
+
}, _.nodePadding = function(g) {
|
|
4554
|
+
return arguments.length ? (a = s = +g, _) : a;
|
|
4555
|
+
}, _.nodes = function(g) {
|
|
4556
|
+
return arguments.length ? (h = typeof g == "function" ? g : nn(g), _) : h;
|
|
4557
|
+
}, _.links = function(g) {
|
|
4558
|
+
return arguments.length ? (f = typeof g == "function" ? g : nn(g), _) : f;
|
|
4559
|
+
}, _.linkSort = function(g) {
|
|
4560
|
+
return arguments.length ? (u = g, _) : u;
|
|
4561
|
+
}, _.size = function(g) {
|
|
4562
|
+
return arguments.length ? (t = e = 0, n = +g[0], r = +g[1], _) : [n - t, r - e];
|
|
4563
|
+
}, _.extent = function(g) {
|
|
4564
|
+
return arguments.length ? (t = +g[0][0], n = +g[1][0], e = +g[0][1], r = +g[1][1], _) : [[t, e], [n, r]];
|
|
4565
|
+
}, _.iterations = function(g) {
|
|
4566
|
+
return arguments.length ? (y = +g, _) : y;
|
|
4567
4567
|
};
|
|
4568
|
-
function
|
|
4569
|
-
for (const [N, x] of
|
|
4568
|
+
function D({ nodes: g, links: A }) {
|
|
4569
|
+
for (const [N, x] of g.entries())
|
|
4570
4570
|
x.index = N, x.sourceLinks = [], x.targetLinks = [];
|
|
4571
|
-
const
|
|
4572
|
-
for (const [N, x] of
|
|
4571
|
+
const S = new Map(g.map((N, x) => [o(N, x, g), N]));
|
|
4572
|
+
for (const [N, x] of A.entries()) {
|
|
4573
4573
|
x.index = N;
|
|
4574
|
-
let { source:
|
|
4575
|
-
typeof
|
|
4574
|
+
let { source: T, target: m } = x;
|
|
4575
|
+
typeof T != "object" && (T = x.source = ai(S, T)), typeof m != "object" && (m = x.target = ai(S, m)), T.sourceLinks.push(x), m.targetLinks.push(x);
|
|
4576
4576
|
}
|
|
4577
4577
|
if (u != null)
|
|
4578
|
-
for (const { sourceLinks: N, targetLinks: x } of
|
|
4578
|
+
for (const { sourceLinks: N, targetLinks: x } of g)
|
|
4579
4579
|
N.sort(u), x.sort(u);
|
|
4580
4580
|
}
|
|
4581
|
-
function
|
|
4582
|
-
for (const
|
|
4583
|
-
|
|
4581
|
+
function J({ nodes: g }) {
|
|
4582
|
+
for (const A of g)
|
|
4583
|
+
A.value = A.fixedValue === void 0 ? Math.max(Fn(A.sourceLinks, Vn), Fn(A.targetLinks, Vn)) : A.fixedValue;
|
|
4584
4584
|
}
|
|
4585
|
-
function
|
|
4586
|
-
const
|
|
4587
|
-
let
|
|
4588
|
-
for (;
|
|
4589
|
-
for (const
|
|
4590
|
-
|
|
4591
|
-
for (const { target: m } of
|
|
4585
|
+
function j({ nodes: g }) {
|
|
4586
|
+
const A = g.length;
|
|
4587
|
+
let S = new Set(g), N = /* @__PURE__ */ new Set(), x = 0;
|
|
4588
|
+
for (; S.size; ) {
|
|
4589
|
+
for (const T of S) {
|
|
4590
|
+
T.depth = x;
|
|
4591
|
+
for (const { target: m } of T.sourceLinks)
|
|
4592
4592
|
N.add(m);
|
|
4593
4593
|
}
|
|
4594
|
-
if (++x >
|
|
4595
|
-
|
|
4594
|
+
if (++x > A) throw new Error("circular link");
|
|
4595
|
+
S = N, N = /* @__PURE__ */ new Set();
|
|
4596
4596
|
}
|
|
4597
4597
|
}
|
|
4598
|
-
function
|
|
4599
|
-
const
|
|
4600
|
-
let
|
|
4601
|
-
for (;
|
|
4602
|
-
for (const
|
|
4603
|
-
|
|
4604
|
-
for (const { source: m } of
|
|
4598
|
+
function z({ nodes: g }) {
|
|
4599
|
+
const A = g.length;
|
|
4600
|
+
let S = new Set(g), N = /* @__PURE__ */ new Set(), x = 0;
|
|
4601
|
+
for (; S.size; ) {
|
|
4602
|
+
for (const T of S) {
|
|
4603
|
+
T.height = x;
|
|
4604
|
+
for (const { source: m } of T.targetLinks)
|
|
4605
4605
|
N.add(m);
|
|
4606
4606
|
}
|
|
4607
|
-
if (++x >
|
|
4608
|
-
|
|
4607
|
+
if (++x > A) throw new Error("circular link");
|
|
4608
|
+
S = N, N = /* @__PURE__ */ new Set();
|
|
4609
4609
|
}
|
|
4610
4610
|
}
|
|
4611
|
-
function
|
|
4612
|
-
const
|
|
4613
|
-
for (const x of
|
|
4614
|
-
const
|
|
4615
|
-
x.layer =
|
|
4611
|
+
function M({ nodes: g }) {
|
|
4612
|
+
const A = ni(g, (x) => x.depth) + 1, S = (n - t - i) / (A - 1), N = new Array(A);
|
|
4613
|
+
for (const x of g) {
|
|
4614
|
+
const T = Math.max(0, Math.min(A - 1, Math.floor(c.call(null, x, A))));
|
|
4615
|
+
x.layer = T, x.x0 = t + T * S, x.x1 = x.x0 + i, N[T] ? N[T].push(x) : N[T] = [x];
|
|
4616
4616
|
}
|
|
4617
4617
|
if (l) for (const x of N)
|
|
4618
4618
|
x.sort(l);
|
|
4619
4619
|
return N;
|
|
4620
4620
|
}
|
|
4621
|
-
function
|
|
4622
|
-
const
|
|
4623
|
-
for (const
|
|
4621
|
+
function k(g) {
|
|
4622
|
+
const A = Qu(g, (S) => (r - e - (S.length - 1) * s) / Fn(S, Vn));
|
|
4623
|
+
for (const S of g) {
|
|
4624
4624
|
let N = e;
|
|
4625
|
-
for (const x of
|
|
4626
|
-
x.y0 = N, x.y1 = N + x.value *
|
|
4627
|
-
for (const
|
|
4628
|
-
|
|
4625
|
+
for (const x of S) {
|
|
4626
|
+
x.y0 = N, x.y1 = N + x.value * A, N = x.y1 + s;
|
|
4627
|
+
for (const T of x.sourceLinks)
|
|
4628
|
+
T.width = T.value * A;
|
|
4629
4629
|
}
|
|
4630
|
-
N = (r - N + s) / (
|
|
4631
|
-
for (let x = 0; x <
|
|
4632
|
-
const
|
|
4633
|
-
|
|
4630
|
+
N = (r - N + s) / (S.length + 1);
|
|
4631
|
+
for (let x = 0; x < S.length; ++x) {
|
|
4632
|
+
const T = S[x];
|
|
4633
|
+
T.y0 += N * (x + 1), T.y1 += N * (x + 1);
|
|
4634
4634
|
}
|
|
4635
|
-
|
|
4635
|
+
C(S);
|
|
4636
4636
|
}
|
|
4637
4637
|
}
|
|
4638
|
-
function
|
|
4639
|
-
const
|
|
4640
|
-
s = Math.min(a, (r - e) / (ni(
|
|
4641
|
-
for (let
|
|
4642
|
-
const N = Math.pow(0.99,
|
|
4643
|
-
|
|
4638
|
+
function R(g) {
|
|
4639
|
+
const A = M(g);
|
|
4640
|
+
s = Math.min(a, (r - e) / (ni(A, (S) => S.length) - 1)), k(A);
|
|
4641
|
+
for (let S = 0; S < y; ++S) {
|
|
4642
|
+
const N = Math.pow(0.99, S), x = Math.max(1 - N, (S + 1) / y);
|
|
4643
|
+
Y(A, N, x), W(A, N, x);
|
|
4644
4644
|
}
|
|
4645
4645
|
}
|
|
4646
|
-
function
|
|
4647
|
-
for (let N = 1, x =
|
|
4648
|
-
const
|
|
4649
|
-
for (const m of
|
|
4650
|
-
let
|
|
4651
|
-
for (const { source:
|
|
4652
|
-
let
|
|
4653
|
-
|
|
4646
|
+
function W(g, A, S) {
|
|
4647
|
+
for (let N = 1, x = g.length; N < x; ++N) {
|
|
4648
|
+
const T = g[N];
|
|
4649
|
+
for (const m of T) {
|
|
4650
|
+
let E = 0, L = 0;
|
|
4651
|
+
for (const { source: tt, value: G } of m.targetLinks) {
|
|
4652
|
+
let O = G * (m.layer - tt.layer);
|
|
4653
|
+
E += b(tt, m) * O, L += O;
|
|
4654
4654
|
}
|
|
4655
|
-
if (!(
|
|
4656
|
-
let
|
|
4657
|
-
m.y0 +=
|
|
4655
|
+
if (!(L > 0)) continue;
|
|
4656
|
+
let B = (E / L - m.y0) * A;
|
|
4657
|
+
m.y0 += B, m.y1 += B, $(m);
|
|
4658
4658
|
}
|
|
4659
|
-
l === void 0 &&
|
|
4659
|
+
l === void 0 && T.sort(wn), K(T, S);
|
|
4660
4660
|
}
|
|
4661
4661
|
}
|
|
4662
|
-
function
|
|
4663
|
-
for (let N =
|
|
4664
|
-
const
|
|
4665
|
-
for (const m of
|
|
4666
|
-
let
|
|
4667
|
-
for (const { target:
|
|
4668
|
-
let
|
|
4669
|
-
|
|
4662
|
+
function Y(g, A, S) {
|
|
4663
|
+
for (let N = g.length, x = N - 2; x >= 0; --x) {
|
|
4664
|
+
const T = g[x];
|
|
4665
|
+
for (const m of T) {
|
|
4666
|
+
let E = 0, L = 0;
|
|
4667
|
+
for (const { target: tt, value: G } of m.sourceLinks) {
|
|
4668
|
+
let O = G * (tt.layer - m.layer);
|
|
4669
|
+
E += P(m, tt) * O, L += O;
|
|
4670
4670
|
}
|
|
4671
|
-
if (!(
|
|
4672
|
-
let
|
|
4673
|
-
m.y0 +=
|
|
4671
|
+
if (!(L > 0)) continue;
|
|
4672
|
+
let B = (E / L - m.y0) * A;
|
|
4673
|
+
m.y0 += B, m.y1 += B, $(m);
|
|
4674
4674
|
}
|
|
4675
|
-
l === void 0 &&
|
|
4675
|
+
l === void 0 && T.sort(wn), K(T, S);
|
|
4676
4676
|
}
|
|
4677
4677
|
}
|
|
4678
|
-
function
|
|
4679
|
-
const
|
|
4680
|
-
|
|
4678
|
+
function K(g, A) {
|
|
4679
|
+
const S = g.length >> 1, N = g[S];
|
|
4680
|
+
et(g, N.y0 - s, S - 1, A), q(g, N.y1 + s, S + 1, A), et(g, r, g.length - 1, A), q(g, e, 0, A);
|
|
4681
4681
|
}
|
|
4682
|
-
function
|
|
4683
|
-
for (;
|
|
4684
|
-
const x =
|
|
4685
|
-
|
|
4682
|
+
function q(g, A, S, N) {
|
|
4683
|
+
for (; S < g.length; ++S) {
|
|
4684
|
+
const x = g[S], T = (A - x.y0) * N;
|
|
4685
|
+
T > 1e-6 && (x.y0 += T, x.y1 += T), A = x.y1 + s;
|
|
4686
4686
|
}
|
|
4687
4687
|
}
|
|
4688
|
-
function
|
|
4689
|
-
for (;
|
|
4690
|
-
const x =
|
|
4691
|
-
|
|
4688
|
+
function et(g, A, S, N) {
|
|
4689
|
+
for (; S >= 0; --S) {
|
|
4690
|
+
const x = g[S], T = (x.y1 - A) * N;
|
|
4691
|
+
T > 1e-6 && (x.y0 -= T, x.y1 -= T), A = x.y0 - s;
|
|
4692
4692
|
}
|
|
4693
4693
|
}
|
|
4694
|
-
function
|
|
4694
|
+
function $({ sourceLinks: g, targetLinks: A }) {
|
|
4695
4695
|
if (u === void 0) {
|
|
4696
|
-
for (const { source: { sourceLinks:
|
|
4697
|
-
|
|
4698
|
-
for (const { target: { targetLinks:
|
|
4699
|
-
|
|
4696
|
+
for (const { source: { sourceLinks: S } } of A)
|
|
4697
|
+
S.sort(ii);
|
|
4698
|
+
for (const { target: { targetLinks: S } } of g)
|
|
4699
|
+
S.sort(ri);
|
|
4700
4700
|
}
|
|
4701
4701
|
}
|
|
4702
|
-
function
|
|
4702
|
+
function C(g) {
|
|
4703
4703
|
if (u === void 0)
|
|
4704
|
-
for (const { sourceLinks:
|
|
4705
|
-
|
|
4704
|
+
for (const { sourceLinks: A, targetLinks: S } of g)
|
|
4705
|
+
A.sort(ii), S.sort(ri);
|
|
4706
4706
|
}
|
|
4707
|
-
function
|
|
4708
|
-
let
|
|
4709
|
-
for (const { target: N, width: x } of
|
|
4710
|
-
if (N ===
|
|
4711
|
-
|
|
4707
|
+
function b(g, A) {
|
|
4708
|
+
let S = g.y0 - (g.sourceLinks.length - 1) * s / 2;
|
|
4709
|
+
for (const { target: N, width: x } of g.sourceLinks) {
|
|
4710
|
+
if (N === A) break;
|
|
4711
|
+
S += x + s;
|
|
4712
4712
|
}
|
|
4713
|
-
for (const { source: N, width: x } of
|
|
4714
|
-
if (N ===
|
|
4715
|
-
|
|
4713
|
+
for (const { source: N, width: x } of A.targetLinks) {
|
|
4714
|
+
if (N === g) break;
|
|
4715
|
+
S -= x;
|
|
4716
4716
|
}
|
|
4717
|
-
return
|
|
4717
|
+
return S;
|
|
4718
4718
|
}
|
|
4719
|
-
function
|
|
4720
|
-
let
|
|
4721
|
-
for (const { source: N, width: x } of
|
|
4722
|
-
if (N ===
|
|
4723
|
-
|
|
4719
|
+
function P(g, A) {
|
|
4720
|
+
let S = A.y0 - (A.targetLinks.length - 1) * s / 2;
|
|
4721
|
+
for (const { source: N, width: x } of A.targetLinks) {
|
|
4722
|
+
if (N === g) break;
|
|
4723
|
+
S += x + s;
|
|
4724
4724
|
}
|
|
4725
|
-
for (const { target: N, width: x } of
|
|
4726
|
-
if (N ===
|
|
4727
|
-
|
|
4725
|
+
for (const { target: N, width: x } of g.sourceLinks) {
|
|
4726
|
+
if (N === A) break;
|
|
4727
|
+
S -= x;
|
|
4728
4728
|
}
|
|
4729
|
-
return
|
|
4729
|
+
return S;
|
|
4730
4730
|
}
|
|
4731
|
-
return
|
|
4731
|
+
return _;
|
|
4732
4732
|
}
|
|
4733
4733
|
var ar = Math.PI, sr = 2 * ar, ie = 1e-6, sf = sr - ie;
|
|
4734
4734
|
function or() {
|
|
@@ -4764,8 +4764,8 @@ or.prototype = ra.prototype = {
|
|
|
4764
4764
|
else if (h > ie) if (!(Math.abs(u * o - c * l) > ie) || !i)
|
|
4765
4765
|
this._ += "L" + (this._x1 = t) + "," + (this._y1 = e);
|
|
4766
4766
|
else {
|
|
4767
|
-
var f = n - a,
|
|
4768
|
-
Math.abs(
|
|
4767
|
+
var f = n - a, y = r - s, _ = o * o + c * c, D = f * f + y * y, J = Math.sqrt(_), j = Math.sqrt(h), z = i * Math.tan((ar - Math.acos((_ + h - D) / (2 * J * j))) / 2), M = z / j, k = z / J;
|
|
4768
|
+
Math.abs(M - 1) > ie && (this._ += "L" + (t + M * l) + "," + (e + M * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * y) + "," + (this._x1 = t + k * o) + "," + (this._y1 = e + k * c);
|
|
4769
4769
|
}
|
|
4770
4770
|
},
|
|
4771
4771
|
arc: function(t, e, n, r, i, a) {
|
|
@@ -4837,138 +4837,148 @@ const mf = "_sankeyEnergyLink_10fud_285", xf = "_sankeyLabel_10fud_323", ci = {
|
|
|
4837
4837
|
sankeyLabel: xf
|
|
4838
4838
|
};
|
|
4839
4839
|
function Tf({ data: t, tooltipFormat: e }) {
|
|
4840
|
-
const [n, r] =
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4840
|
+
const [n, r] = ut(null), [i, a] = ut(!1), [s, o] = ut(!1), c = Pt(!0), l = Pt(!0), u = Pt("data"), [h, f] = de(), { width: y, height: _ } = f, D = Ne(n ? n.nodes.map((k) => k.name) : []);
|
|
4841
|
+
function J(k) {
|
|
4842
|
+
const R = /* @__PURE__ */ new Map(), W = [], Y = [], K = (q) => (R.has(q) || (R.set(q, W.length), W.push({ name: q })), R.get(q));
|
|
4843
|
+
for (const { source: q, target: et, value: $ } of k)
|
|
4844
|
+
Y.push({
|
|
4845
|
+
source: K(q),
|
|
4846
|
+
target: K(et),
|
|
4847
|
+
value: $
|
|
4848
|
+
});
|
|
4849
|
+
return { nodes: W, links: Y };
|
|
4850
|
+
}
|
|
4851
|
+
_t(() => {
|
|
4852
|
+
r((k) => {
|
|
4853
|
+
const R = J(t), W = k === null ? [] : k.nodes.map((K) => K.name), Y = R.nodes.map((K) => K.name);
|
|
4854
|
+
return c.current = Y.every((K) => !W.includes(K)), k !== null && (l.current = !1), u.current = "data", R;
|
|
4845
4855
|
}), s && o(!1), i && a(!1);
|
|
4846
|
-
}, [t]),
|
|
4847
|
-
|
|
4848
|
-
}, [
|
|
4849
|
-
const
|
|
4850
|
-
(
|
|
4856
|
+
}, [t]), _t(() => {
|
|
4857
|
+
y !== 0 && _ !== 0 && (u.current = "dimension");
|
|
4858
|
+
}, [y, _]);
|
|
4859
|
+
const j = y <= 768, z = 1e3, M = Et(
|
|
4860
|
+
(k) => {
|
|
4851
4861
|
if (!n)
|
|
4852
4862
|
return;
|
|
4853
|
-
const
|
|
4854
|
-
if (
|
|
4863
|
+
const R = y, W = _;
|
|
4864
|
+
if (R === 0 || W === 0)
|
|
4855
4865
|
return;
|
|
4856
|
-
const
|
|
4857
|
-
C.forEach(function(
|
|
4858
|
-
const
|
|
4859
|
-
|
|
4866
|
+
const Y = { top: 30, right: 20, bottom: 20, left: 20 }, K = W - (Y.top + Y.bottom), q = R - (Y.left + Y.right), et = K, $ = q, C = n.links.map((d) => ({ ...d })), b = n.nodes.map((d) => ({ ...d }));
|
|
4867
|
+
C.forEach(function(d) {
|
|
4868
|
+
const p = n.nodes[d.source].name, v = n.nodes[d.target].name, F = p + " → " + v;
|
|
4869
|
+
d.sourceName = p, d.targetName = v, d.id = F;
|
|
4860
4870
|
});
|
|
4861
|
-
const
|
|
4862
|
-
|
|
4863
|
-
const
|
|
4864
|
-
const
|
|
4865
|
-
return { enteringValue:
|
|
4866
|
-
},
|
|
4867
|
-
s ? (
|
|
4868
|
-
const { enteringValue:
|
|
4869
|
-
return Math.max(
|
|
4871
|
+
const P = k.select("svg");
|
|
4872
|
+
P.node();
|
|
4873
|
+
const g = P.select(".plot-area").attr("transform", "translate(" + Y.left + "," + Y.top + ")"), A = Ye(k).style("opacity", 0), S = (d) => {
|
|
4874
|
+
const p = d.targetLinks?.reduce((F, Z) => F + Z.value, 0) ?? 0, v = d.sourceLinks?.reduce((F, Z) => F + Z.value, 0) ?? 0;
|
|
4875
|
+
return { enteringValue: p, exitingValue: v };
|
|
4876
|
+
}, x = af().nodeSort(
|
|
4877
|
+
s ? (d, p) => {
|
|
4878
|
+
const { enteringValue: v, exitingValue: F } = S(d), { enteringValue: Z, exitingValue: st } = S(p);
|
|
4879
|
+
return Math.max(v, F) - Math.max(Z, st);
|
|
4870
4880
|
} : null
|
|
4871
4881
|
).linkSort(
|
|
4872
|
-
i ? (
|
|
4873
|
-
).nodeWidth(
|
|
4874
|
-
nodes:
|
|
4875
|
-
links: C.map((
|
|
4876
|
-
}), { nodes:
|
|
4877
|
-
|
|
4878
|
-
const
|
|
4879
|
-
|
|
4880
|
-
const
|
|
4881
|
-
return
|
|
4882
|
-
}),
|
|
4883
|
-
const
|
|
4884
|
-
return
|
|
4882
|
+
i ? (d, p) => d.value - p.value : null
|
|
4883
|
+
).nodeWidth($ <= 540 ? 8 : $ > 540 && $ <= 768 ? 12 : 15).nodePadding($ <= 540 ? 5 : 8).extent([[0, 0], [$, et]])({
|
|
4884
|
+
nodes: b.map((d) => Object.assign({}, d)),
|
|
4885
|
+
links: C.map((d) => Object.assign({}, d))
|
|
4886
|
+
}), { nodes: T, links: m } = x;
|
|
4887
|
+
g.selectAll("linearGradient").remove();
|
|
4888
|
+
const E = g.selectAll("linearGradient").data(m).join("linearGradient").attr("id", (d, p) => p.toString()).attr("gradientUnits", "userSpaceOnUse").attr("x1", (d) => d.source.x0).attr("x2", (d) => d.target.x0);
|
|
4889
|
+
E.append("stop").attr("offset", "0%").attr("stop-color", (d) => {
|
|
4890
|
+
const p = D.current.findIndex((v) => v === d.sourceName);
|
|
4891
|
+
return vt(p, !1);
|
|
4892
|
+
}), E.append("stop").attr("offset", "100%").attr("stop-color", (d) => {
|
|
4893
|
+
const p = D.current.findIndex((v) => v === d.targetName);
|
|
4894
|
+
return vt(p, !1);
|
|
4885
4895
|
});
|
|
4886
|
-
const
|
|
4887
|
-
const
|
|
4888
|
-
return
|
|
4889
|
-
},
|
|
4890
|
-
|
|
4891
|
-
(
|
|
4892
|
-
return `url(#${
|
|
4893
|
-
}).attr("stroke-dasharray",
|
|
4894
|
-
return c.current ?
|
|
4896
|
+
const L = (d) => {
|
|
4897
|
+
const p = d.source, v = d.target, F = Math.abs(v.depth - p.depth);
|
|
4898
|
+
return $ * 1.5 * F;
|
|
4899
|
+
}, B = (d) => L(d) + " " + L(d), tt = (d) => !c.current || u.current === "sort node" || u.current === "sort link" || u.current !== "data" && !l.current ? 0 : d.target.depth * z;
|
|
4900
|
+
g.selectAll(".link").data(m, (d) => d.id).join(
|
|
4901
|
+
(d) => d.append("path").attr("class", `link ${ci.sankeyEnergyLink}`).attr("d", li()).style("stroke", function(p) {
|
|
4902
|
+
return `url(#${E.filter((Z) => Z.sourceName === p.sourceName && Z.targetName === p.targetName).node()?.id})`;
|
|
4903
|
+
}).attr("stroke-dasharray", B).attr("stroke-dashoffset", L).attr("stroke-width", (p) => Math.max(1, p.width)).transition().duration(z).delay(function(p) {
|
|
4904
|
+
return c.current ? tt(p) : z;
|
|
4895
4905
|
}).attr("stroke-dashoffset", 0).on("end", function() {
|
|
4896
4906
|
dt(this).attr("stroke-dasharray", "none");
|
|
4897
4907
|
}),
|
|
4898
|
-
(
|
|
4908
|
+
(d) => (d.attr("stroke-width", (p) => Math.max(1, p.width || 0)).transition().duration(z).delay(tt).attr("d", li()).attr("stroke-dashoffset", 0).on("end", function() {
|
|
4899
4909
|
dt(this).attr("stroke-dasharray", "none");
|
|
4900
|
-
}),
|
|
4901
|
-
(
|
|
4902
|
-
).on("mouseover", (
|
|
4903
|
-
|
|
4904
|
-
const
|
|
4905
|
-
return
|
|
4906
|
-
}).style("opacity", 0),
|
|
4907
|
-
}).on("mousemove", (
|
|
4908
|
-
ei(
|
|
4909
|
-
}).on("mouseout", (
|
|
4910
|
-
|
|
4911
|
-
const
|
|
4912
|
-
return `url(#${
|
|
4913
|
-
}).style("stroke-opacity", 0.5).style("fill", "none").attr("class", `link ${nt.sankeyEnergyLink}`),
|
|
4910
|
+
}), d),
|
|
4911
|
+
(d) => c.current ? d.remove() : d.transition().duration(z / 4).style("opacity", 0).remove()
|
|
4912
|
+
).on("mouseover", (d, p) => {
|
|
4913
|
+
g.selectAll("path.link").filter((v) => v.id !== p.id).style("stroke", "#1f2937").style("stroke-opacity", 0.05), g.selectAll("text.label").filter((v) => {
|
|
4914
|
+
const F = v;
|
|
4915
|
+
return F.name !== p.sourceName && F.name !== p.targetName;
|
|
4916
|
+
}).style("opacity", 0), A.style("opacity", 1), A.select("p.title").text(p.id + St(p.value, e)), A.select("p.top-label").style("display", "none"), A.select("p.bottom-label").style("display", "none");
|
|
4917
|
+
}).on("mousemove", (d, p) => {
|
|
4918
|
+
ei(d, A);
|
|
4919
|
+
}).on("mouseout", (d, p) => {
|
|
4920
|
+
A.style("opacity", 0), g.selectAll("path.link").style("stroke", function(v) {
|
|
4921
|
+
const F = v;
|
|
4922
|
+
return `url(#${E.filter((ct) => ct.sourceName === F.sourceName && ct.targetName === F.targetName).node()?.id})`;
|
|
4923
|
+
}).style("stroke-opacity", 0.5).style("fill", "none").attr("class", `link ${nt.sankeyEnergyLink}`), g.selectAll("text.label").style("opacity", 1);
|
|
4914
4924
|
});
|
|
4915
|
-
const
|
|
4916
|
-
const { enteringValue:
|
|
4917
|
-
return { nodeState:
|
|
4918
|
-
},
|
|
4919
|
-
const { nodeState:
|
|
4920
|
-
return { enteringValue:
|
|
4925
|
+
const G = (d) => !c.current || d.depth === 0 || u.current === "sort node" || u.current === "sort link" || u.current !== "data" && !l.current ? 0 : d.depth * z + z / 4, O = (d) => {
|
|
4926
|
+
const { enteringValue: p, exitingValue: v } = S(d);
|
|
4927
|
+
return { nodeState: d.sourceLinks?.length === 0 && d.targetLinks?.length === 0 ? "stray node" : d.sourceLinks?.length === 0 ? "leaf node" : d.targetLinks?.length === 0 ? "source node" : p > v ? "surplus" : p < v ? "minus" : "balanced", enteringValue: p, exitingValue: v };
|
|
4928
|
+
}, X = (d) => {
|
|
4929
|
+
const { nodeState: p, enteringValue: v, exitingValue: F } = O(d);
|
|
4930
|
+
return { enteringValue: v, exitingValue: F, nodeState: p, stateColor: p === "surplus" ? "#4ade80" : p === "minus" ? "#f87171" : "#e7e7e7" };
|
|
4921
4931
|
};
|
|
4922
|
-
|
|
4923
|
-
(
|
|
4924
|
-
const
|
|
4925
|
-
return
|
|
4926
|
-
}).attr("opacity", 1).attr("width", function(
|
|
4927
|
-
return
|
|
4932
|
+
g.selectAll("rect.node").data(T, ((d) => d.name)).join(
|
|
4933
|
+
(d) => d.append("rect").attr("class", `node ${nt.baseNode}`).attr("x", (p) => p.x0).attr("y", (p) => p.y0).attr("height", (p) => c.current ? Math.abs(p.y1 - p.y0) : 0).attr("width", (p) => c.current ? 0 : p.x1 - p.x0).attr("opacity", 0).attr("stroke-width", 2.5).transition().duration(z).delay(G).attr("fill", (p) => {
|
|
4934
|
+
const v = D.current.findIndex((F) => F === p.name);
|
|
4935
|
+
return vt(v, !1);
|
|
4936
|
+
}).attr("opacity", 1).attr("width", function(p) {
|
|
4937
|
+
return p.x1 - p.x0;
|
|
4928
4938
|
}),
|
|
4929
4939
|
void 0,
|
|
4930
|
-
(
|
|
4931
|
-
).on("mouseover", (
|
|
4932
|
-
|
|
4933
|
-
const
|
|
4934
|
-
return !(
|
|
4940
|
+
(d) => c.current ? d.remove() : d.transition().duration(z / 4).style("opacity", 0).remove()
|
|
4941
|
+
).on("mouseover", (d, p) => {
|
|
4942
|
+
g.selectAll("path.link").filter((lt) => {
|
|
4943
|
+
const gt = lt;
|
|
4944
|
+
return !(gt.sourceName === p.name || gt.targetName === p.name);
|
|
4935
4945
|
}).style("stroke", "#1f2937").style("stroke-opacity", 0.05);
|
|
4936
|
-
const
|
|
4937
|
-
|
|
4938
|
-
const { enteringValue:
|
|
4939
|
-
|
|
4940
|
-
}).on("mousemove", (
|
|
4941
|
-
ei(
|
|
4942
|
-
}).on("mouseout", (
|
|
4943
|
-
|
|
4944
|
-
const
|
|
4945
|
-
return `url(#${
|
|
4946
|
+
const v = p.sourceLinks?.map((lt) => lt.targetName) ?? [], Z = [...p.targetLinks?.map((lt) => lt.sourceName) ?? [], ...v, p.name];
|
|
4947
|
+
g.selectAll("text.label").filter((lt) => !Z.includes(lt.name)).style("opacity", 0.0625);
|
|
4948
|
+
const { enteringValue: st, exitingValue: ct, nodeState: ht, stateColor: ft } = X(p);
|
|
4949
|
+
A.style("opacity", 1), A.select("p.title").text(p.name + " :"), A.select("p.top-label").style("display", "block").text("in " + St(st, e)), A.select("p.bottom-label").style("display", "block").text("out " + St(ct, e)), A.select("p.small-text").style("display", "block").text(`${ht}`).style("color", `${ft}`);
|
|
4950
|
+
}).on("mousemove", (d, p) => {
|
|
4951
|
+
ei(d, A);
|
|
4952
|
+
}).on("mouseout", (d, p) => {
|
|
4953
|
+
A.style("opacity", 0), A.select("p.small-text").style("display", "none"), g.selectAll("path.link").style("stroke", function(st) {
|
|
4954
|
+
const ct = st;
|
|
4955
|
+
return `url(#${E.filter((lt) => lt.sourceName === ct.sourceName && lt.targetName === ct.targetName).node()?.id})`;
|
|
4946
4956
|
}).style("stroke-opacity", 0.5).style("fill", "none").attr("class", `link ${nt.sankeyEnergyLink}`);
|
|
4947
|
-
const
|
|
4948
|
-
|
|
4949
|
-
}).transition().duration(
|
|
4950
|
-
const { stateColor:
|
|
4951
|
-
return
|
|
4952
|
-
}).attr("opacity", 1).attr("x", (
|
|
4953
|
-
const
|
|
4954
|
-
return
|
|
4955
|
-
}),
|
|
4956
|
-
(
|
|
4957
|
+
const v = p.sourceLinks?.map((st) => st.targetName) ?? [], Z = [...p.targetLinks?.map((st) => st.sourceName) ?? [], ...v, p.name];
|
|
4958
|
+
g.selectAll("text.label").filter((st) => !Z.includes(st.name)).style("opacity", 1);
|
|
4959
|
+
}).transition().duration(z).delay(G).attr("stroke-width", j ? 2 : 2.5).style("stroke", function(d) {
|
|
4960
|
+
const { stateColor: p, nodeState: v } = X(d);
|
|
4961
|
+
return v === "surplus" || v === "minus" ? p : "#52525b";
|
|
4962
|
+
}).attr("opacity", 1).attr("x", (d) => d.x0).attr("y", (d) => d.y0).attr("height", (d) => Math.abs(d.y1 - d.y0)).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => {
|
|
4963
|
+
const p = D.current.findIndex((v) => v === d.name);
|
|
4964
|
+
return vt(p, !1);
|
|
4965
|
+
}), g.selectAll("text.label").data(T, (d) => d.name).join(
|
|
4966
|
+
(d) => d.append("text").attr("class", `label ${ci.sankeyLabel}`).attr("x", (p) => p.x0 < $ / 2 ? p.x1 + 6 : p.x0 - 6).attr("y", (p) => (p.y1 + p.y0) / 2).attr("dy", "0.35em").attr("text-anchor", (p) => p.x0 < $ / 2 ? "start" : "end").style("font-size", $ < 648 ? "12px" : "16px").style("font-weight", $ < 648 ? "normal" : "bold").style("stroke-width", $ < 648 ? "0px" : "0.25px").style("stroke", "#eff1f4").text((p) => p.name).attr("opacity", 0),
|
|
4957
4967
|
void 0,
|
|
4958
|
-
(
|
|
4959
|
-
).style("font-size",
|
|
4968
|
+
(d) => d.remove()
|
|
4969
|
+
).style("font-size", $ < 648 ? "12px" : "16px").style("font-weight", $ < 648 ? "normal" : "bold").style("stroke-width", $ < 648 ? "0px" : "0.25px").transition().duration(z).delay(G).attr("x", (d) => d.x0 < $ / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", "0.35em").attr("text-anchor", (d) => d.x0 < $ / 2 ? "start" : "end").attr("opacity", 1);
|
|
4960
4970
|
},
|
|
4961
|
-
[n, i, s,
|
|
4971
|
+
[n, i, s, y, _, e]
|
|
4962
4972
|
);
|
|
4963
4973
|
return /* @__PURE__ */ H.jsx(
|
|
4964
4974
|
"div",
|
|
4965
4975
|
{
|
|
4966
4976
|
ref: h,
|
|
4967
|
-
style: { width:
|
|
4977
|
+
style: { width: y, height: _, display: "flex", flexDirection: "column" },
|
|
4968
4978
|
children: /* @__PURE__ */ H.jsxs(
|
|
4969
4979
|
"div",
|
|
4970
4980
|
{
|
|
4971
|
-
ref:
|
|
4981
|
+
ref: M,
|
|
4972
4982
|
className: `${nt["fill-container"]}`,
|
|
4973
4983
|
style: { display: "flex", flexDirection: "column", position: "relative" },
|
|
4974
4984
|
children: [
|
|
@@ -4976,7 +4986,7 @@ function Tf({ data: t, tooltipFormat: e }) {
|
|
|
4976
4986
|
"svg",
|
|
4977
4987
|
{
|
|
4978
4988
|
className: `${nt["chart-svg"]} ${nt["fill-container"]}`,
|
|
4979
|
-
viewBox: `0 0 ${
|
|
4989
|
+
viewBox: `0 0 ${y} ${_}`,
|
|
4980
4990
|
children: /* @__PURE__ */ H.jsx("g", { className: "plot-area" })
|
|
4981
4991
|
}
|
|
4982
4992
|
),
|
|
@@ -5002,9 +5012,9 @@ function Tf({ data: t, tooltipFormat: e }) {
|
|
|
5002
5012
|
type: "checkbox",
|
|
5003
5013
|
className: nt["controls-checkbox"],
|
|
5004
5014
|
checked: i,
|
|
5005
|
-
onChange: (
|
|
5006
|
-
const
|
|
5007
|
-
|
|
5015
|
+
onChange: (k) => {
|
|
5016
|
+
const R = k.target.checked;
|
|
5017
|
+
R && (u.current = "sort link"), a(R);
|
|
5008
5018
|
}
|
|
5009
5019
|
}
|
|
5010
5020
|
),
|
|
@@ -5023,9 +5033,9 @@ function Tf({ data: t, tooltipFormat: e }) {
|
|
|
5023
5033
|
type: "checkbox",
|
|
5024
5034
|
className: nt["controls-checkbox"],
|
|
5025
5035
|
checked: s,
|
|
5026
|
-
onChange: (
|
|
5027
|
-
const
|
|
5028
|
-
|
|
5036
|
+
onChange: (k) => {
|
|
5037
|
+
const R = k.target.checked;
|
|
5038
|
+
R && (u.current = "sort node"), o(R);
|
|
5029
5039
|
}
|
|
5030
5040
|
}
|
|
5031
5041
|
),
|
|
@@ -5050,163 +5060,163 @@ const vf = "_node_dqcsq_1", _f = "_circle_pack_label_dqcsq_27", ne = {
|
|
|
5050
5060
|
"node--root": "_node--root_dqcsq_73"
|
|
5051
5061
|
};
|
|
5052
5062
|
function Rf({ data: t, tooltipFormat: e }) {
|
|
5053
|
-
const [n, r] =
|
|
5054
|
-
|
|
5055
|
-
if (!
|
|
5056
|
-
const
|
|
5057
|
-
function
|
|
5058
|
-
const
|
|
5059
|
-
return function(
|
|
5060
|
-
let
|
|
5061
|
-
for (let
|
|
5062
|
-
|
|
5063
|
-
return
|
|
5063
|
+
const [n, r] = ut(null), [i, a] = ut({ name: "", value: 0 }), [s, o] = ut({ name: "", value: 0 }), c = Pt(!0), [l, u] = de(), { width: h, height: f } = u, y = Pt(null), _ = Pt(null);
|
|
5064
|
+
_t(() => {
|
|
5065
|
+
if (!_.current || !y.current) return;
|
|
5066
|
+
const j = y.current;
|
|
5067
|
+
function z(k, R) {
|
|
5068
|
+
const W = Math.max(k.length, R.length);
|
|
5069
|
+
return function(Y) {
|
|
5070
|
+
let K = "";
|
|
5071
|
+
for (let q = 0; q < W; q++)
|
|
5072
|
+
K += Y < 0.5 ? k[q] ?? "" : R[q] ?? "";
|
|
5073
|
+
return K;
|
|
5064
5074
|
};
|
|
5065
5075
|
}
|
|
5066
|
-
dt(
|
|
5067
|
-
const
|
|
5068
|
-
return function(
|
|
5069
|
-
|
|
5076
|
+
dt(j).transition().duration(250).tween("text", function() {
|
|
5077
|
+
const k = z(s.name, i.name);
|
|
5078
|
+
return function(R) {
|
|
5079
|
+
j.textContent = k(R);
|
|
5070
5080
|
};
|
|
5071
5081
|
});
|
|
5072
|
-
const
|
|
5073
|
-
dt(
|
|
5074
|
-
const
|
|
5075
|
-
return function(
|
|
5076
|
-
|
|
5082
|
+
const M = _.current;
|
|
5083
|
+
dt(M).transition().duration(250).ease(tc).tween("text", function() {
|
|
5084
|
+
const k = Nt(s.value, i.value);
|
|
5085
|
+
return function(R) {
|
|
5086
|
+
M.textContent = St(Math.round(k(R)), e).toLocaleString();
|
|
5077
5087
|
};
|
|
5078
5088
|
});
|
|
5079
|
-
}, [i, s]),
|
|
5080
|
-
r((
|
|
5089
|
+
}, [i, s]), _t(() => {
|
|
5090
|
+
r((j) => (j !== null && (c.current = !1), t));
|
|
5081
5091
|
}, [t]);
|
|
5082
|
-
const
|
|
5083
|
-
(
|
|
5092
|
+
const D = 1e3, J = Et(
|
|
5093
|
+
(j) => {
|
|
5084
5094
|
if (!n)
|
|
5085
5095
|
return;
|
|
5086
|
-
const
|
|
5087
|
-
if (
|
|
5096
|
+
const z = h, M = f, k = 12, R = 1.5;
|
|
5097
|
+
if (z === 0 || M === 0)
|
|
5088
5098
|
return;
|
|
5089
|
-
const
|
|
5090
|
-
return
|
|
5091
|
-
}).sort(function(
|
|
5092
|
-
return
|
|
5093
|
-
}),
|
|
5094
|
-
let
|
|
5095
|
-
const N =
|
|
5096
|
-
|
|
5097
|
-
const
|
|
5098
|
-
(
|
|
5099
|
-
return
|
|
5100
|
-
}).style("fill", function(
|
|
5101
|
-
return
|
|
5102
|
-
}).style("cursor", "pointer").transition().duration(
|
|
5103
|
-
const
|
|
5104
|
-
return
|
|
5105
|
-
}).attr("cx", function(
|
|
5106
|
-
const
|
|
5107
|
-
return (
|
|
5108
|
-
}).attr("cy", function(
|
|
5109
|
-
const
|
|
5110
|
-
return (
|
|
5111
|
-
}).style("stroke", "#737373").style("stroke-width",
|
|
5112
|
-
return
|
|
5099
|
+
const W = 25, Y = M - W * 2, K = z - W * 2, q = Y, et = K, $ = { name: "branches", children: n }, C = Math.min(et, q), b = pr($).sum(function(d) {
|
|
5100
|
+
return d.value;
|
|
5101
|
+
}).sort(function(d, p) {
|
|
5102
|
+
return d.value - p.value;
|
|
5103
|
+
}), P = Qc().size([C - 20, C - 20]).padding(2);
|
|
5104
|
+
let g = b, A = 1, S = 1;
|
|
5105
|
+
const N = P(b), x = N.descendants(), T = [N.x, N.y, N.r * 2 + W], m = dt("#tooltip").style("opacity", 0), E = j.select("svg");
|
|
5106
|
+
E.node();
|
|
5107
|
+
const L = E.select(".plot-area").attr("transform", "translate(" + z / 2 + "," + M / 2 + ")"), B = ce().domain([-1, 2]).range(["hsl(152,80%,80%)", "hsl(228,30%,40%)"]).interpolate(Yo), tt = L.selectAll("circle").data(x, (d) => d.data.name).join(
|
|
5108
|
+
(d) => d.append("circle").attr("class", function(p) {
|
|
5109
|
+
return p.parent ? p.children ? ne.node : `${ne.node} ${ne["node--leaf"]}` : `${ne.node} ${ne["node--root"]}`;
|
|
5110
|
+
}).style("fill", function(p) {
|
|
5111
|
+
return p.children ? B(p.depth) : "#f0fdfa";
|
|
5112
|
+
}).style("cursor", "pointer").transition().duration(D).attr("r", function(p) {
|
|
5113
|
+
const v = C / T[2];
|
|
5114
|
+
return p.r * v;
|
|
5115
|
+
}).attr("cx", function(p) {
|
|
5116
|
+
const v = C / T[2];
|
|
5117
|
+
return (p.x - T[0]) * v;
|
|
5118
|
+
}).attr("cy", function(p) {
|
|
5119
|
+
const v = C / T[2];
|
|
5120
|
+
return (p.y - T[1]) * v;
|
|
5121
|
+
}).style("stroke", "#737373").style("stroke-width", R * S).style("fill", function(p) {
|
|
5122
|
+
return p.children ? B(p.depth) : "#f0fdfa";
|
|
5113
5123
|
}),
|
|
5114
|
-
(
|
|
5115
|
-
const
|
|
5116
|
-
return (
|
|
5117
|
-
}).attr("cy", function(
|
|
5118
|
-
const
|
|
5119
|
-
return (
|
|
5120
|
-
}).attr("r", function(
|
|
5121
|
-
const
|
|
5122
|
-
return
|
|
5123
|
-
}).style("stroke", function(
|
|
5124
|
+
(d) => d.transition().duration(D).attr("cx", function(p) {
|
|
5125
|
+
const v = C / T[2];
|
|
5126
|
+
return (p.x - T[0]) * v;
|
|
5127
|
+
}).attr("cy", function(p) {
|
|
5128
|
+
const v = C / T[2];
|
|
5129
|
+
return (p.y - T[1]) * v;
|
|
5130
|
+
}).attr("r", function(p) {
|
|
5131
|
+
const v = C / T[2];
|
|
5132
|
+
return p.r * v;
|
|
5133
|
+
}).style("stroke", function(p) {
|
|
5124
5134
|
return "#737373";
|
|
5125
|
-
}).style("stroke-width",
|
|
5126
|
-
return
|
|
5135
|
+
}).style("stroke-width", R * S).style("fill", function(p) {
|
|
5136
|
+
return p.children ? B(p.depth) : "#f0fdfa";
|
|
5127
5137
|
}),
|
|
5128
|
-
(
|
|
5129
|
-
).on("mouseover", function(
|
|
5130
|
-
|
|
5131
|
-
return
|
|
5132
|
-
}).style("font-size",
|
|
5133
|
-
return
|
|
5134
|
-
}).style("display", function(
|
|
5135
|
-
return
|
|
5136
|
-
}) :
|
|
5137
|
-
return
|
|
5138
|
-
}).style("font-size",
|
|
5139
|
-
return
|
|
5140
|
-
}).style("display", function(
|
|
5141
|
-
return
|
|
5142
|
-
}) : (
|
|
5143
|
-
return
|
|
5144
|
-
}).style("fill-opacity", 0).style("display", "none"),
|
|
5145
|
-
return
|
|
5146
|
-
}).style("fill-opacity", 1).style("display", "inline")), dt(this).style("stroke"),
|
|
5147
|
-
}).on("mouseout", function(
|
|
5148
|
-
|
|
5149
|
-
return
|
|
5150
|
-
}).style("fill-opacity", function(
|
|
5151
|
-
return
|
|
5152
|
-
}).style("display", function(
|
|
5153
|
-
return
|
|
5154
|
-
}), dt(this).style("stroke-width",
|
|
5138
|
+
(d) => d.transition().duration(D).style("opacity", 0).remove()
|
|
5139
|
+
).on("mouseover", function(d, p) {
|
|
5140
|
+
g.parent === p ? G.filter(function(v) {
|
|
5141
|
+
return v.parent === g || this.style.display === "inline";
|
|
5142
|
+
}).style("font-size", k * S).style("fill-opacity", function(v) {
|
|
5143
|
+
return v.parent === g ? 1 : 0;
|
|
5144
|
+
}).style("display", function(v) {
|
|
5145
|
+
return v.parent === g ? "inline" : "none";
|
|
5146
|
+
}) : p === g ? G.filter(function(v) {
|
|
5147
|
+
return v.parent === g || this.style.display === "inline";
|
|
5148
|
+
}).style("font-size", k * S).style("fill-opacity", function(v) {
|
|
5149
|
+
return v.parent === g ? 1 : 0;
|
|
5150
|
+
}).style("display", function(v) {
|
|
5151
|
+
return v.parent === g ? "inline" : "none";
|
|
5152
|
+
}) : (G.filter(function(v) {
|
|
5153
|
+
return v.data.name != p.data.name;
|
|
5154
|
+
}).style("fill-opacity", 0).style("display", "none"), G.filter(function(v) {
|
|
5155
|
+
return v.data.name === p.data.name;
|
|
5156
|
+
}).style("fill-opacity", 1).style("display", "inline")), dt(this).style("stroke"), p != b && dt(this).style("stroke-width", R * S * 2.5).style("stroke", "#e4e4e7"), m.transition().duration(250).style("opacity", 1), a((v) => (o(v), { name: p.data.name === "branches" ? "Total" : p.data.name, value: p.value ? p.value : 0 }));
|
|
5157
|
+
}).on("mouseout", function(d, p) {
|
|
5158
|
+
G.filter(function(v) {
|
|
5159
|
+
return v.parent === g || this.style.display === "inline";
|
|
5160
|
+
}).style("fill-opacity", function(v) {
|
|
5161
|
+
return v.parent === g ? 1 : 0;
|
|
5162
|
+
}).style("display", function(v) {
|
|
5163
|
+
return v.parent === g ? "inline" : "none";
|
|
5164
|
+
}), dt(this).style("stroke-width", R * S).style("stroke", function(v) {
|
|
5155
5165
|
return "#737373";
|
|
5156
5166
|
}), m.transition().duration(250).style("opacity", 0);
|
|
5157
|
-
}).on("click", function(
|
|
5158
|
-
if (
|
|
5159
|
-
|
|
5167
|
+
}).on("click", function(d, p) {
|
|
5168
|
+
if (p === b) {
|
|
5169
|
+
X();
|
|
5160
5170
|
return;
|
|
5161
5171
|
}
|
|
5162
|
-
|
|
5163
|
-
}),
|
|
5164
|
-
return
|
|
5172
|
+
g != p ? O(p) : X(), tt.style("stroke-width", R * S), d.stopPropagation();
|
|
5173
|
+
}), G = L.selectAll("text").data(x, function(d) {
|
|
5174
|
+
return d.data.name;
|
|
5165
5175
|
}).join(
|
|
5166
|
-
(
|
|
5167
|
-
return
|
|
5168
|
-
}).style("font-size", 12).style("text-anchor", "middle").style("fill-opacity", 0).style("stroke-opacity", 0).style("display", "none").style("pointer-events", "none").style("text-shadow", "0 1px 0 lightblue, 1px 0 0 lightblue, -1px 0 0 lightblue, 0 -1px 0 lightblue").transition().duration(
|
|
5169
|
-
const
|
|
5170
|
-
return "translate(" + (
|
|
5171
|
-
}).style("fill-opacity", function(
|
|
5172
|
-
return
|
|
5173
|
-
}).style("display", function(
|
|
5174
|
-
return
|
|
5176
|
+
(d) => d.append("text").attr("class", ne.circle_pack_label).text(function(p) {
|
|
5177
|
+
return p.data.name;
|
|
5178
|
+
}).style("font-size", 12).style("text-anchor", "middle").style("fill-opacity", 0).style("stroke-opacity", 0).style("display", "none").style("pointer-events", "none").style("text-shadow", "0 1px 0 lightblue, 1px 0 0 lightblue, -1px 0 0 lightblue, 0 -1px 0 lightblue").transition().duration(D).attr("transform", function(p) {
|
|
5179
|
+
const v = C / T[2];
|
|
5180
|
+
return "translate(" + (p.x - T[0]) * v + "," + (p.y - T[1]) * v + ")";
|
|
5181
|
+
}).style("fill-opacity", function(p) {
|
|
5182
|
+
return p.parent === b ? 1 : 0;
|
|
5183
|
+
}).style("display", function(p) {
|
|
5184
|
+
return p.parent === b ? "inline" : "none";
|
|
5175
5185
|
}),
|
|
5176
|
-
(
|
|
5177
|
-
const
|
|
5178
|
-
return "translate(" + (
|
|
5179
|
-
}).style("fill-opacity", function(
|
|
5180
|
-
return
|
|
5181
|
-
}).style("display", function(
|
|
5182
|
-
return
|
|
5186
|
+
(d) => d.attr("class", ne.circle_pack_label).transition().duration(D).attr("transform", function(p) {
|
|
5187
|
+
const v = C / T[2];
|
|
5188
|
+
return "translate(" + (p.x - T[0]) * v + "," + (p.y - T[1]) * v + ")";
|
|
5189
|
+
}).style("fill-opacity", function(p) {
|
|
5190
|
+
return p.parent === b ? 1 : 0;
|
|
5191
|
+
}).style("display", function(p) {
|
|
5192
|
+
return p.parent === b ? "inline" : "none";
|
|
5183
5193
|
}),
|
|
5184
|
-
(
|
|
5194
|
+
(d) => d.transition().duration(D).style("opacity", 0).remove()
|
|
5185
5195
|
);
|
|
5186
|
-
|
|
5187
|
-
function
|
|
5188
|
-
|
|
5189
|
-
const
|
|
5196
|
+
G.raise();
|
|
5197
|
+
function O(d) {
|
|
5198
|
+
g = d;
|
|
5199
|
+
const p = C / 2 - W, v = z / 2, F = M / 2, Z = C / T[2], st = (
|
|
5190
5200
|
/*currentData==="---"?Math.max((d.r * k),0.25):*/
|
|
5191
|
-
|
|
5201
|
+
d.r * Z
|
|
5192
5202
|
);
|
|
5193
|
-
|
|
5194
|
-
const ct = (
|
|
5195
|
-
|
|
5196
|
-
return
|
|
5197
|
-
}).style("fill-opacity", function(
|
|
5198
|
-
return
|
|
5199
|
-
}).style("display", function(
|
|
5200
|
-
return
|
|
5203
|
+
S = st / p, A = p / st;
|
|
5204
|
+
const ct = (d.x - T[0]) * Z, ht = v - ct * A, ft = (d.y - T[0]) * Z, lt = F - ft * A;
|
|
5205
|
+
L.transition().duration(1e3).attr("transform", "translate(" + ht + "," + lt + ")scale(" + A + ")"), G.style("font-size", k * S + "px").filter(function(gt) {
|
|
5206
|
+
return gt.parent === g || this.style.display === "inline";
|
|
5207
|
+
}).style("fill-opacity", function(gt) {
|
|
5208
|
+
return gt.parent === g ? 1 : 0;
|
|
5209
|
+
}).style("display", function(gt) {
|
|
5210
|
+
return gt.parent === g ? "inline" : "none";
|
|
5201
5211
|
});
|
|
5202
5212
|
}
|
|
5203
|
-
function
|
|
5204
|
-
|
|
5205
|
-
return
|
|
5206
|
-
}).style("fill-opacity", function(
|
|
5207
|
-
return
|
|
5208
|
-
}).style("display", function(
|
|
5209
|
-
return
|
|
5213
|
+
function X() {
|
|
5214
|
+
L.transition().duration(1e3).attr("transform", "translate(" + z / 2 + ", " + M / 2 + ")scale(1)"), g = b, A = 1, S = 1, G.style("font-size", k * S + "px").filter(function(d) {
|
|
5215
|
+
return d.parent === g || this.style.display === "inline";
|
|
5216
|
+
}).style("fill-opacity", function(d) {
|
|
5217
|
+
return d.parent === g ? 1 : 0;
|
|
5218
|
+
}).style("display", function(d) {
|
|
5219
|
+
return d.parent === g ? "inline" : "none";
|
|
5210
5220
|
});
|
|
5211
5221
|
}
|
|
5212
5222
|
},
|
|
@@ -5220,7 +5230,7 @@ function Rf({ data: t, tooltipFormat: e }) {
|
|
|
5220
5230
|
children: /* @__PURE__ */ H.jsxs(
|
|
5221
5231
|
"div",
|
|
5222
5232
|
{
|
|
5223
|
-
ref:
|
|
5233
|
+
ref: J,
|
|
5224
5234
|
className: `${nt["fill-container"]}`,
|
|
5225
5235
|
style: { display: "flex", flexDirection: "column", position: "relative" },
|
|
5226
5236
|
children: [
|
|
@@ -5247,8 +5257,8 @@ function Rf({ data: t, tooltipFormat: e }) {
|
|
|
5247
5257
|
gap: 2
|
|
5248
5258
|
},
|
|
5249
5259
|
children: [
|
|
5250
|
-
/* @__PURE__ */ H.jsx("p", { ref:
|
|
5251
|
-
/* @__PURE__ */ H.jsx("p", { ref:
|
|
5260
|
+
/* @__PURE__ */ H.jsx("p", { ref: y, id: "name", children: "Test tooltip" }),
|
|
5261
|
+
/* @__PURE__ */ H.jsx("p", { ref: _, id: "value", children: "Test tooltip" })
|
|
5252
5262
|
]
|
|
5253
5263
|
}
|
|
5254
5264
|
)
|