@carbon/charts 1.23.15 → 1.23.16
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/CHANGELOG.md +9 -0
- package/dist/a11y-ePqvrObQ.mjs.map +1 -1
- package/dist/{angle-utils-Re7uVv7K.mjs → angle-utils-BWFhuTnR.mjs} +49 -54
- package/dist/{angle-utils-Re7uVv7K.mjs.map → angle-utils-BWFhuTnR.mjs.map} +1 -1
- package/dist/{array-CLq6Q40W.mjs → array-4CiuhqlQ.mjs} +2 -2
- package/dist/{array-CLq6Q40W.mjs.map → array-4CiuhqlQ.mjs.map} +1 -1
- package/dist/axis-scales-CPuwbFQf.mjs.map +1 -1
- package/dist/{choropleth-DvuP75LI.mjs → choropleth-Bst0hbTL.mjs} +482 -505
- package/dist/{choropleth-DvuP75LI.mjs.map → choropleth-Bst0hbTL.mjs.map} +1 -1
- package/dist/{color-scale-utils-BPsvYA85.mjs → color-scale-utils-DCBFJmbg.mjs} +1152 -1161
- package/dist/{color-scale-utils-BPsvYA85.mjs.map → color-scale-utils-DCBFJmbg.mjs.map} +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/{index-Ciju2yyn.mjs → index-BILVb6NZ.mjs} +442 -447
- package/dist/{index-Ciju2yyn.mjs.map → index-BILVb6NZ.mjs.map} +1 -1
- package/dist/index.d.cts +21 -0
- package/dist/index.mjs +62 -63
- package/dist/index.mjs.map +1 -1
- package/dist/model/index.mjs +22 -22
- package/dist/model/index.mjs.map +1 -1
- package/dist/services/index.mjs +3 -3
- package/dist/styles.css +96 -0
- package/dist/styles.css.map +1 -1
- package/dist/styles.min.css +1 -1
- package/dist/styles.min.css.map +1 -1
- package/dist/umd/bundle.umd.cjs +14 -14
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +14 -14
- package/package.json +24 -25
- package/styles.css +96 -0
- package/styles.min.css +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a3 as Lt, aC as Nt, aD as Ct, aE as It, aF as ut, aG as Zt, aH as Ft, aI as zt, a0 as Vt, aJ as Ht, aK as Yt, aL as Xt, aM as Gt, _ as $t, W as Ut, ax as q, aN as Kt, aO as qt, n as j, g as c, F as W, aP as
|
|
2
|
-
import { z as ii, A
|
|
3
|
-
import { $ as w, e as _, i as C, S as
|
|
4
|
-
function
|
|
1
|
+
import { a3 as Lt, aC as Nt, aD as Ct, aE as It, aF as ut, aG as Zt, aH as Ft, aI as zt, a0 as Vt, aJ as Ht, aK as Yt, aL as Xt, aM as Gt, _ as $t, W as Ut, ax as q, aN as Kt, aO as qt, n as j, g as c, F as W, aP as v, aQ as M, aR as E, aS as jt, aT as ft, aU as pt, h as J, ar as Wt, ao as Jt, ad as mt, ai as Qt, H as ti } from "./color-scale-utils-DCBFJmbg.mjs";
|
|
2
|
+
import { z as ii, A, e as Q, S as O, D as ni, s as si, v as ei, x as oi, y as ai, u as ri } from "./angle-utils-BWFhuTnR.mjs";
|
|
3
|
+
import { $ as w, e as _, i as C, S as p } from "./axis-scales-CPuwbFQf.mjs";
|
|
4
|
+
function dt(i) {
|
|
5
5
|
var t = i == null ? 0 : i.length;
|
|
6
6
|
return t ? Lt(i, 1) : [];
|
|
7
7
|
}
|
|
8
8
|
function hi(i) {
|
|
9
|
-
return Nt(Ct(i, void 0,
|
|
9
|
+
return Nt(Ct(i, void 0, dt), i + "");
|
|
10
10
|
}
|
|
11
|
-
function ci(i, t,
|
|
12
|
-
var
|
|
13
|
-
t < 0 && (t = -t >
|
|
14
|
-
for (var o = Array(
|
|
15
|
-
o[
|
|
11
|
+
function ci(i, t, n) {
|
|
12
|
+
var s = -1, e = i.length;
|
|
13
|
+
t < 0 && (t = -t > e ? 0 : e + t), n = n > e ? e : n, n < 0 && (n += e), e = t > n ? 0 : n - t >>> 0, t >>>= 0;
|
|
14
|
+
for (var o = Array(e); ++s < e; )
|
|
15
|
+
o[s] = i[s + t];
|
|
16
16
|
return o;
|
|
17
17
|
}
|
|
18
18
|
function li(i, t) {
|
|
@@ -24,17 +24,17 @@ function _i(i, t) {
|
|
|
24
24
|
function ui(i) {
|
|
25
25
|
return zt(i) ? void 0 : i;
|
|
26
26
|
}
|
|
27
|
-
var fi = 1,
|
|
28
|
-
var
|
|
27
|
+
var fi = 1, pi = 2, mi = 4, di = hi(function(i, t) {
|
|
28
|
+
var n = {};
|
|
29
29
|
if (i == null)
|
|
30
|
-
return
|
|
31
|
-
var
|
|
30
|
+
return n;
|
|
31
|
+
var s = !1;
|
|
32
32
|
t = Vt(t, function(o) {
|
|
33
|
-
return o = ut(o, i),
|
|
34
|
-
}), Ht(i, Yt(i),
|
|
35
|
-
for (var
|
|
36
|
-
_i(
|
|
37
|
-
return
|
|
33
|
+
return o = ut(o, i), s || (s = o.length > 1), o;
|
|
34
|
+
}), Ht(i, Yt(i), n), s && (n = Xt(n, fi | pi | mi, ui));
|
|
35
|
+
for (var e = t.length; e--; )
|
|
36
|
+
_i(n, t[e]);
|
|
37
|
+
return n;
|
|
38
38
|
});
|
|
39
39
|
function tt(i) {
|
|
40
40
|
return Math.log(i);
|
|
@@ -57,69 +57,69 @@ function vi(i) {
|
|
|
57
57
|
function Ti(i) {
|
|
58
58
|
return i === Math.E ? Math.log : i === 10 && Math.log10 || i === 2 && Math.log2 || (i = Math.log(i), (t) => Math.log(t) / i);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return (t,
|
|
60
|
+
function nt(i) {
|
|
61
|
+
return (t, n) => -i(-t, n);
|
|
62
62
|
}
|
|
63
63
|
function Di(i) {
|
|
64
|
-
const t = i(tt, it),
|
|
65
|
-
let
|
|
64
|
+
const t = i(tt, it), n = t.domain;
|
|
65
|
+
let s = 10, e, o;
|
|
66
66
|
function a() {
|
|
67
|
-
return
|
|
67
|
+
return e = Ti(s), o = vi(s), n()[0] < 0 ? (e = nt(e), o = nt(o), i(xi, gi)) : i(tt, it), t;
|
|
68
68
|
}
|
|
69
69
|
return t.base = function(r) {
|
|
70
|
-
return arguments.length ? (
|
|
70
|
+
return arguments.length ? (s = +r, a()) : s;
|
|
71
71
|
}, t.domain = function(r) {
|
|
72
|
-
return arguments.length ? (
|
|
72
|
+
return arguments.length ? (n(r), a()) : n();
|
|
73
73
|
}, t.ticks = (r) => {
|
|
74
|
-
const h =
|
|
74
|
+
const h = n();
|
|
75
75
|
let l = h[0], f = h[h.length - 1];
|
|
76
76
|
const y = f < l;
|
|
77
77
|
y && ([l, f] = [f, l]);
|
|
78
|
-
let
|
|
78
|
+
let d = e(l), T = e(f), g, m;
|
|
79
79
|
const D = r == null ? 10 : +r;
|
|
80
80
|
let u = [];
|
|
81
|
-
if (!(
|
|
82
|
-
if (
|
|
83
|
-
for (;
|
|
84
|
-
for (g = 1; g <
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
u.push(
|
|
81
|
+
if (!(s % 1) && T - d < D) {
|
|
82
|
+
if (d = Math.floor(d), T = Math.ceil(T), l > 0) {
|
|
83
|
+
for (; d <= T; ++d)
|
|
84
|
+
for (g = 1; g < s; ++g)
|
|
85
|
+
if (m = d < 0 ? g / o(-d) : g * o(d), !(m < l)) {
|
|
86
|
+
if (m > f) break;
|
|
87
|
+
u.push(m);
|
|
88
88
|
}
|
|
89
|
-
} else for (;
|
|
90
|
-
for (g =
|
|
91
|
-
if (
|
|
92
|
-
if (
|
|
93
|
-
u.push(
|
|
89
|
+
} else for (; d <= T; ++d)
|
|
90
|
+
for (g = s - 1; g >= 1; --g)
|
|
91
|
+
if (m = d > 0 ? g / o(-d) : g * o(d), !(m < l)) {
|
|
92
|
+
if (m > f) break;
|
|
93
|
+
u.push(m);
|
|
94
94
|
}
|
|
95
95
|
u.length * 2 < D && (u = q(l, f, D));
|
|
96
96
|
} else
|
|
97
|
-
u = q(
|
|
97
|
+
u = q(d, T, Math.min(T - d, D)).map(o);
|
|
98
98
|
return y ? u.reverse() : u;
|
|
99
99
|
}, t.tickFormat = (r, h) => {
|
|
100
|
-
if (r == null && (r = 10), h == null && (h =
|
|
101
|
-
const l = Math.max(1,
|
|
100
|
+
if (r == null && (r = 10), h == null && (h = s === 10 ? "s" : ","), typeof h != "function" && (!(s % 1) && (h = Kt(h)).precision == null && (h.trim = !0), h = qt(h)), r === 1 / 0) return h;
|
|
101
|
+
const l = Math.max(1, s * r / t.ticks().length);
|
|
102
102
|
return (f) => {
|
|
103
|
-
let y = f / o(Math.round(
|
|
104
|
-
return y *
|
|
103
|
+
let y = f / o(Math.round(e(f)));
|
|
104
|
+
return y * s < s - 0.5 && (y *= s), y <= l ? h(f) : "";
|
|
105
105
|
};
|
|
106
|
-
}, t.nice = () =>
|
|
107
|
-
floor: (r) => o(Math.floor(
|
|
108
|
-
ceil: (r) => o(Math.ceil(
|
|
106
|
+
}, t.nice = () => n(ii(n(), {
|
|
107
|
+
floor: (r) => o(Math.floor(e(r))),
|
|
108
|
+
ceil: (r) => o(Math.ceil(e(r)))
|
|
109
109
|
})), t;
|
|
110
110
|
}
|
|
111
111
|
function xt() {
|
|
112
112
|
const i = Di(Gt()).domain([1, 10]);
|
|
113
113
|
return i.copy = () => $t(i, xt()).base(i.base()), Ut.apply(i, arguments), i;
|
|
114
114
|
}
|
|
115
|
-
function k(i, t,
|
|
115
|
+
function k(i, t, n) {
|
|
116
116
|
i._context.bezierCurveTo(
|
|
117
117
|
(2 * i._x0 + i._x1) / 3,
|
|
118
118
|
(2 * i._y0 + i._y1) / 3,
|
|
119
119
|
(i._x0 + 2 * i._x1) / 3,
|
|
120
120
|
(i._y0 + 2 * i._y1) / 3,
|
|
121
121
|
(i._x0 + 4 * i._x1 + t) / 6,
|
|
122
|
-
(i._y0 + 4 * i._y1 +
|
|
122
|
+
(i._y0 + 4 * i._y1 + n) / 6
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
function L(i) {
|
|
@@ -164,15 +164,15 @@ L.prototype = {
|
|
|
164
164
|
this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t;
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
|
-
function
|
|
167
|
+
function Oi(i) {
|
|
168
168
|
return new L(i);
|
|
169
169
|
}
|
|
170
170
|
function gt(i) {
|
|
171
171
|
this._context = i;
|
|
172
172
|
}
|
|
173
173
|
gt.prototype = {
|
|
174
|
-
areaStart:
|
|
175
|
-
areaEnd:
|
|
174
|
+
areaStart: A,
|
|
175
|
+
areaEnd: A,
|
|
176
176
|
lineStart: function() {
|
|
177
177
|
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0;
|
|
178
178
|
},
|
|
@@ -210,7 +210,7 @@ gt.prototype = {
|
|
|
210
210
|
this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t;
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
|
-
function
|
|
213
|
+
function Ai(i) {
|
|
214
214
|
return new gt(i);
|
|
215
215
|
}
|
|
216
216
|
function yt(i) {
|
|
@@ -239,8 +239,8 @@ yt.prototype = {
|
|
|
239
239
|
break;
|
|
240
240
|
case 2:
|
|
241
241
|
this._point = 3;
|
|
242
|
-
var
|
|
243
|
-
this._line ? this._context.lineTo(
|
|
242
|
+
var n = (this._x0 + 4 * this._x1 + i) / 6, s = (this._y0 + 4 * this._y1 + t) / 6;
|
|
243
|
+
this._line ? this._context.lineTo(n, s) : this._context.moveTo(n, s);
|
|
244
244
|
break;
|
|
245
245
|
case 3:
|
|
246
246
|
this._point = 4;
|
|
@@ -263,12 +263,12 @@ vt.prototype = {
|
|
|
263
263
|
this._x = [], this._y = [], this._basis.lineStart();
|
|
264
264
|
},
|
|
265
265
|
lineEnd: function() {
|
|
266
|
-
var i = this._x, t = this._y,
|
|
267
|
-
if (
|
|
268
|
-
for (var
|
|
269
|
-
h = r /
|
|
270
|
-
this._beta * i[r] + (1 - this._beta) * (
|
|
271
|
-
this._beta * t[r] + (1 - this._beta) * (
|
|
266
|
+
var i = this._x, t = this._y, n = i.length - 1;
|
|
267
|
+
if (n > 0)
|
|
268
|
+
for (var s = i[0], e = t[0], o = i[n] - s, a = t[n] - e, r = -1, h; ++r <= n; )
|
|
269
|
+
h = r / n, this._basis.point(
|
|
270
|
+
this._beta * i[r] + (1 - this._beta) * (s + h * o),
|
|
271
|
+
this._beta * t[r] + (1 - this._beta) * (e + h * a)
|
|
272
272
|
);
|
|
273
273
|
this._x = this._y = null, this._basis.lineEnd();
|
|
274
274
|
},
|
|
@@ -277,19 +277,19 @@ vt.prototype = {
|
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
279
|
const bi = function i(t) {
|
|
280
|
-
function
|
|
281
|
-
return t === 1 ? new L(
|
|
280
|
+
function n(s) {
|
|
281
|
+
return t === 1 ? new L(s) : new vt(s, t);
|
|
282
282
|
}
|
|
283
|
-
return
|
|
284
|
-
return i(+
|
|
285
|
-
},
|
|
283
|
+
return n.beta = function(s) {
|
|
284
|
+
return i(+s);
|
|
285
|
+
}, n;
|
|
286
286
|
}(0.85);
|
|
287
|
-
function R(i, t,
|
|
287
|
+
function R(i, t, n) {
|
|
288
288
|
i._context.bezierCurveTo(
|
|
289
289
|
i._x1 + i._k * (i._x2 - i._x0),
|
|
290
290
|
i._y1 + i._k * (i._y2 - i._y0),
|
|
291
291
|
i._x2 + i._k * (i._x1 - t),
|
|
292
|
-
i._y2 + i._k * (i._y1 -
|
|
292
|
+
i._y2 + i._k * (i._y1 - n),
|
|
293
293
|
i._x2,
|
|
294
294
|
i._y2
|
|
295
295
|
);
|
|
@@ -337,19 +337,19 @@ z.prototype = {
|
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
const Si = function i(t) {
|
|
340
|
-
function
|
|
341
|
-
return new z(
|
|
340
|
+
function n(s) {
|
|
341
|
+
return new z(s, t);
|
|
342
342
|
}
|
|
343
|
-
return
|
|
344
|
-
return i(+
|
|
345
|
-
},
|
|
343
|
+
return n.tension = function(s) {
|
|
344
|
+
return i(+s);
|
|
345
|
+
}, n;
|
|
346
346
|
}(0);
|
|
347
347
|
function V(i, t) {
|
|
348
348
|
this._context = i, this._k = (1 - t) / 6;
|
|
349
349
|
}
|
|
350
350
|
V.prototype = {
|
|
351
|
-
areaStart:
|
|
352
|
-
areaEnd:
|
|
351
|
+
areaStart: A,
|
|
352
|
+
areaEnd: A,
|
|
353
353
|
lineStart: function() {
|
|
354
354
|
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
|
|
355
355
|
},
|
|
@@ -388,12 +388,12 @@ V.prototype = {
|
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
390
|
const Pi = function i(t) {
|
|
391
|
-
function
|
|
392
|
-
return new V(
|
|
391
|
+
function n(s) {
|
|
392
|
+
return new V(s, t);
|
|
393
393
|
}
|
|
394
|
-
return
|
|
395
|
-
return i(+
|
|
396
|
-
},
|
|
394
|
+
return n.tension = function(s) {
|
|
395
|
+
return i(+s);
|
|
396
|
+
}, n;
|
|
397
397
|
}(0);
|
|
398
398
|
function H(i, t) {
|
|
399
399
|
this._context = i, this._k = (1 - t) / 6;
|
|
@@ -433,24 +433,24 @@ H.prototype = {
|
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
435
|
const Ei = function i(t) {
|
|
436
|
-
function
|
|
437
|
-
return new H(
|
|
436
|
+
function n(s) {
|
|
437
|
+
return new H(s, t);
|
|
438
438
|
}
|
|
439
|
-
return
|
|
440
|
-
return i(+
|
|
441
|
-
},
|
|
439
|
+
return n.tension = function(s) {
|
|
440
|
+
return i(+s);
|
|
441
|
+
}, n;
|
|
442
442
|
}(0);
|
|
443
|
-
function Y(i, t,
|
|
444
|
-
var
|
|
443
|
+
function Y(i, t, n) {
|
|
444
|
+
var s = i._x1, e = i._y1, o = i._x2, a = i._y2;
|
|
445
445
|
if (i._l01_a > Q) {
|
|
446
446
|
var r = 2 * i._l01_2a + 3 * i._l01_a * i._l12_a + i._l12_2a, h = 3 * i._l01_a * (i._l01_a + i._l12_a);
|
|
447
|
-
|
|
447
|
+
s = (s * r - i._x0 * i._l12_2a + i._x2 * i._l01_2a) / h, e = (e * r - i._y0 * i._l12_2a + i._y2 * i._l01_2a) / h;
|
|
448
448
|
}
|
|
449
449
|
if (i._l23_a > Q) {
|
|
450
450
|
var l = 2 * i._l23_2a + 3 * i._l23_a * i._l12_a + i._l12_2a, f = 3 * i._l23_a * (i._l23_a + i._l12_a);
|
|
451
|
-
o = (o * l + i._x1 * i._l23_2a - t * i._l12_2a) / f, a = (a * l + i._y1 * i._l23_2a -
|
|
451
|
+
o = (o * l + i._x1 * i._l23_2a - t * i._l12_2a) / f, a = (a * l + i._y1 * i._l23_2a - n * i._l12_2a) / f;
|
|
452
452
|
}
|
|
453
|
-
i._context.bezierCurveTo(
|
|
453
|
+
i._context.bezierCurveTo(s, e, o, a, i._x2, i._y2);
|
|
454
454
|
}
|
|
455
455
|
function Tt(i, t) {
|
|
456
456
|
this._context = i, this._alpha = t;
|
|
@@ -478,8 +478,8 @@ Tt.prototype = {
|
|
|
478
478
|
},
|
|
479
479
|
point: function(i, t) {
|
|
480
480
|
if (i = +i, t = +t, this._point) {
|
|
481
|
-
var
|
|
482
|
-
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(
|
|
481
|
+
var n = this._x2 - i, s = this._y2 - t;
|
|
482
|
+
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + s * s, this._alpha));
|
|
483
483
|
}
|
|
484
484
|
switch (this._point) {
|
|
485
485
|
case 0:
|
|
@@ -499,19 +499,19 @@ Tt.prototype = {
|
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
501
|
const wi = function i(t) {
|
|
502
|
-
function
|
|
503
|
-
return t ? new Tt(
|
|
502
|
+
function n(s) {
|
|
503
|
+
return t ? new Tt(s, t) : new z(s, 0);
|
|
504
504
|
}
|
|
505
|
-
return
|
|
506
|
-
return i(+
|
|
507
|
-
},
|
|
505
|
+
return n.alpha = function(s) {
|
|
506
|
+
return i(+s);
|
|
507
|
+
}, n;
|
|
508
508
|
}(0.5);
|
|
509
509
|
function Dt(i, t) {
|
|
510
510
|
this._context = i, this._alpha = t;
|
|
511
511
|
}
|
|
512
512
|
Dt.prototype = {
|
|
513
|
-
areaStart:
|
|
514
|
-
areaEnd:
|
|
513
|
+
areaStart: A,
|
|
514
|
+
areaEnd: A,
|
|
515
515
|
lineStart: function() {
|
|
516
516
|
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
|
517
517
|
},
|
|
@@ -533,8 +533,8 @@ Dt.prototype = {
|
|
|
533
533
|
},
|
|
534
534
|
point: function(i, t) {
|
|
535
535
|
if (i = +i, t = +t, this._point) {
|
|
536
|
-
var
|
|
537
|
-
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(
|
|
536
|
+
var n = this._x2 - i, s = this._y2 - t;
|
|
537
|
+
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + s * s, this._alpha));
|
|
538
538
|
}
|
|
539
539
|
switch (this._point) {
|
|
540
540
|
case 0:
|
|
@@ -554,17 +554,17 @@ Dt.prototype = {
|
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
556
|
const ki = function i(t) {
|
|
557
|
-
function
|
|
558
|
-
return t ? new Dt(
|
|
557
|
+
function n(s) {
|
|
558
|
+
return t ? new Dt(s, t) : new V(s, 0);
|
|
559
559
|
}
|
|
560
|
-
return
|
|
561
|
-
return i(+
|
|
562
|
-
},
|
|
560
|
+
return n.alpha = function(s) {
|
|
561
|
+
return i(+s);
|
|
562
|
+
}, n;
|
|
563
563
|
}(0.5);
|
|
564
|
-
function
|
|
564
|
+
function Ot(i, t) {
|
|
565
565
|
this._context = i, this._alpha = t;
|
|
566
566
|
}
|
|
567
|
-
|
|
567
|
+
Ot.prototype = {
|
|
568
568
|
areaStart: function() {
|
|
569
569
|
this._line = 0;
|
|
570
570
|
},
|
|
@@ -579,8 +579,8 @@ At.prototype = {
|
|
|
579
579
|
},
|
|
580
580
|
point: function(i, t) {
|
|
581
581
|
if (i = +i, t = +t, this._point) {
|
|
582
|
-
var
|
|
583
|
-
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(
|
|
582
|
+
var n = this._x2 - i, s = this._y2 - t;
|
|
583
|
+
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + s * s, this._alpha));
|
|
584
584
|
}
|
|
585
585
|
switch (this._point) {
|
|
586
586
|
case 0:
|
|
@@ -603,27 +603,27 @@ At.prototype = {
|
|
|
603
603
|
}
|
|
604
604
|
};
|
|
605
605
|
const Ri = function i(t) {
|
|
606
|
-
function
|
|
607
|
-
return t ? new
|
|
606
|
+
function n(s) {
|
|
607
|
+
return t ? new Ot(s, t) : new H(s, 0);
|
|
608
608
|
}
|
|
609
|
-
return
|
|
610
|
-
return i(+
|
|
611
|
-
},
|
|
609
|
+
return n.alpha = function(s) {
|
|
610
|
+
return i(+s);
|
|
611
|
+
}, n;
|
|
612
612
|
}(0.5);
|
|
613
|
-
function
|
|
613
|
+
function st(i) {
|
|
614
614
|
return i < 0 ? -1 : 1;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
var
|
|
618
|
-
return (
|
|
616
|
+
function et(i, t, n) {
|
|
617
|
+
var s = i._x1 - i._x0, e = t - i._x1, o = (i._y1 - i._y0) / (s || e < 0 && -0), a = (n - i._y1) / (e || s < 0 && -0), r = (o * e + a * s) / (s + e);
|
|
618
|
+
return (st(o) + st(a)) * Math.min(Math.abs(o), Math.abs(a), 0.5 * Math.abs(r)) || 0;
|
|
619
619
|
}
|
|
620
620
|
function ot(i, t) {
|
|
621
|
-
var
|
|
622
|
-
return
|
|
621
|
+
var n = i._x1 - i._x0;
|
|
622
|
+
return n ? (3 * (i._y1 - i._y0) / n - t) / 2 : t;
|
|
623
623
|
}
|
|
624
|
-
function I(i, t,
|
|
625
|
-
var
|
|
626
|
-
i._context.bezierCurveTo(
|
|
624
|
+
function I(i, t, n) {
|
|
625
|
+
var s = i._x0, e = i._y0, o = i._x1, a = i._y1, r = (o - s) / 3;
|
|
626
|
+
i._context.bezierCurveTo(s + r, e + r * t, o - r, a - r * n, o, a);
|
|
627
627
|
}
|
|
628
628
|
function B(i) {
|
|
629
629
|
this._context = i;
|
|
@@ -650,7 +650,7 @@ B.prototype = {
|
|
|
650
650
|
(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
|
|
651
651
|
},
|
|
652
652
|
point: function(i, t) {
|
|
653
|
-
var
|
|
653
|
+
var n = NaN;
|
|
654
654
|
if (i = +i, t = +t, !(i === this._x1 && t === this._y1)) {
|
|
655
655
|
switch (this._point) {
|
|
656
656
|
case 0:
|
|
@@ -660,20 +660,20 @@ B.prototype = {
|
|
|
660
660
|
this._point = 2;
|
|
661
661
|
break;
|
|
662
662
|
case 2:
|
|
663
|
-
this._point = 3, I(this, ot(this,
|
|
663
|
+
this._point = 3, I(this, ot(this, n = et(this, i, t)), n);
|
|
664
664
|
break;
|
|
665
665
|
default:
|
|
666
|
-
I(this, this._t0,
|
|
666
|
+
I(this, this._t0, n = et(this, i, t));
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
|
-
this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t, this._t0 =
|
|
669
|
+
this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t, this._t0 = n;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
};
|
|
673
|
-
function
|
|
673
|
+
function At(i) {
|
|
674
674
|
this._context = new Mt(i);
|
|
675
675
|
}
|
|
676
|
-
(
|
|
676
|
+
(At.prototype = Object.create(B.prototype)).point = function(i, t) {
|
|
677
677
|
B.prototype.point.call(this, t, i);
|
|
678
678
|
};
|
|
679
679
|
function Mt(i) {
|
|
@@ -689,15 +689,15 @@ Mt.prototype = {
|
|
|
689
689
|
lineTo: function(i, t) {
|
|
690
690
|
this._context.lineTo(t, i);
|
|
691
691
|
},
|
|
692
|
-
bezierCurveTo: function(i, t,
|
|
693
|
-
this._context.bezierCurveTo(t, i,
|
|
692
|
+
bezierCurveTo: function(i, t, n, s, e, o) {
|
|
693
|
+
this._context.bezierCurveTo(t, i, s, n, o, e);
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
function Bi(i) {
|
|
697
697
|
return new B(i);
|
|
698
698
|
}
|
|
699
699
|
function Li(i) {
|
|
700
|
-
return new
|
|
700
|
+
return new At(i);
|
|
701
701
|
}
|
|
702
702
|
function bt(i) {
|
|
703
703
|
this._context = i;
|
|
@@ -713,26 +713,26 @@ bt.prototype = {
|
|
|
713
713
|
this._x = [], this._y = [];
|
|
714
714
|
},
|
|
715
715
|
lineEnd: function() {
|
|
716
|
-
var i = this._x, t = this._y,
|
|
717
|
-
if (
|
|
718
|
-
if (this._line ? this._context.lineTo(i[0], t[0]) : this._context.moveTo(i[0], t[0]),
|
|
716
|
+
var i = this._x, t = this._y, n = i.length;
|
|
717
|
+
if (n)
|
|
718
|
+
if (this._line ? this._context.lineTo(i[0], t[0]) : this._context.moveTo(i[0], t[0]), n === 2)
|
|
719
719
|
this._context.lineTo(i[1], t[1]);
|
|
720
720
|
else
|
|
721
|
-
for (var
|
|
722
|
-
this._context.bezierCurveTo(
|
|
723
|
-
(this._line || this._line !== 0 &&
|
|
721
|
+
for (var s = at(i), e = at(t), o = 0, a = 1; a < n; ++o, ++a)
|
|
722
|
+
this._context.bezierCurveTo(s[0][o], e[0][o], s[1][o], e[1][o], i[a], t[a]);
|
|
723
|
+
(this._line || this._line !== 0 && n === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
|
|
724
724
|
},
|
|
725
725
|
point: function(i, t) {
|
|
726
726
|
this._x.push(+i), this._y.push(+t);
|
|
727
727
|
}
|
|
728
728
|
};
|
|
729
729
|
function at(i) {
|
|
730
|
-
var t,
|
|
731
|
-
for (
|
|
732
|
-
for (
|
|
733
|
-
for (
|
|
734
|
-
for (o[
|
|
735
|
-
return [
|
|
730
|
+
var t, n = i.length - 1, s, e = new Array(n), o = new Array(n), a = new Array(n);
|
|
731
|
+
for (e[0] = 0, o[0] = 2, a[0] = i[0] + 2 * i[1], t = 1; t < n - 1; ++t) e[t] = 1, o[t] = 4, a[t] = 4 * i[t] + 2 * i[t + 1];
|
|
732
|
+
for (e[n - 1] = 2, o[n - 1] = 7, a[n - 1] = 8 * i[n - 1] + i[n], t = 1; t < n; ++t) s = e[t] / o[t - 1], o[t] -= s, a[t] -= s * a[t - 1];
|
|
733
|
+
for (e[n - 1] = a[n - 1] / o[n - 1], t = n - 2; t >= 0; --t) e[t] = (a[t] - e[t + 1]) / o[t];
|
|
734
|
+
for (o[n - 1] = (i[n] + e[n - 1]) / 2, t = 0; t < n - 1; ++t) o[t] = 2 * i[t + 1] - e[t + 1];
|
|
735
|
+
return [e, o];
|
|
736
736
|
}
|
|
737
737
|
function Ni(i) {
|
|
738
738
|
return new bt(i);
|
|
@@ -765,8 +765,8 @@ N.prototype = {
|
|
|
765
765
|
if (this._t <= 0)
|
|
766
766
|
this._context.lineTo(this._x, t), this._context.lineTo(i, t);
|
|
767
767
|
else {
|
|
768
|
-
var
|
|
769
|
-
this._context.lineTo(
|
|
768
|
+
var n = this._x * (1 - this._t) + i * this._t;
|
|
769
|
+
this._context.lineTo(n, this._y), this._context.lineTo(n, t);
|
|
770
770
|
}
|
|
771
771
|
break;
|
|
772
772
|
}
|
|
@@ -783,91 +783,90 @@ function Ii(i) {
|
|
|
783
783
|
function Zi(i) {
|
|
784
784
|
return new N(i, 1);
|
|
785
785
|
}
|
|
786
|
-
class
|
|
786
|
+
class en extends O {
|
|
787
787
|
/**
|
|
788
788
|
* focal: object to zoom into
|
|
789
789
|
* canvasElements: all the elements to translate and zoom on the chart area
|
|
790
790
|
* zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours
|
|
791
791
|
* */
|
|
792
|
-
zoomIn(t,
|
|
793
|
-
let
|
|
794
|
-
const r =
|
|
795
|
-
t && (
|
|
796
|
-
const { width: h, height: l } =
|
|
792
|
+
zoomIn(t, n, s) {
|
|
793
|
+
let e, o, a;
|
|
794
|
+
const r = s || j;
|
|
795
|
+
t && (e = t.x, o = t.y, a = 2);
|
|
796
|
+
const { width: h, height: l } = ni.getSVGElementSize(this.services.domUtils.getHolder(), {
|
|
797
797
|
useClientDimensions: !0
|
|
798
798
|
});
|
|
799
|
-
|
|
799
|
+
n.transition().duration(r.duration).ease(r.ease).attr(
|
|
800
800
|
"transform",
|
|
801
|
-
`translate(${h / 2}, ${l / 2}) scale(${a}) translate(${-
|
|
801
|
+
`translate(${h / 2}, ${l / 2}) scale(${a}) translate(${-e},${-o})`
|
|
802
802
|
), this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_IN, {
|
|
803
|
-
element:
|
|
803
|
+
element: si(t)
|
|
804
804
|
});
|
|
805
805
|
}
|
|
806
|
-
zoomOut(t,
|
|
807
|
-
const
|
|
808
|
-
t.transition().duration(
|
|
806
|
+
zoomOut(t, n) {
|
|
807
|
+
const s = n || j;
|
|
808
|
+
t.transition().duration(s.duration).ease(s.ease).attr("transform", ""), this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_OUT);
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
|
-
class
|
|
811
|
+
class on extends O {
|
|
812
812
|
init() {
|
|
813
813
|
this.documentFragment = document.createDocumentFragment();
|
|
814
814
|
}
|
|
815
|
-
addEventListener(t,
|
|
816
|
-
this.documentFragment.addEventListener(t,
|
|
815
|
+
addEventListener(t, n) {
|
|
816
|
+
this.documentFragment.addEventListener(t, n);
|
|
817
817
|
}
|
|
818
|
-
removeEventListener(t,
|
|
819
|
-
this.documentFragment.removeEventListener(t,
|
|
818
|
+
removeEventListener(t, n) {
|
|
819
|
+
this.documentFragment.removeEventListener(t, n);
|
|
820
820
|
}
|
|
821
|
-
dispatchEvent(t,
|
|
822
|
-
let
|
|
823
|
-
|
|
824
|
-
detail:
|
|
825
|
-
}) : (
|
|
821
|
+
dispatchEvent(t, n) {
|
|
822
|
+
let s;
|
|
823
|
+
n ? s = new CustomEvent(t, {
|
|
824
|
+
detail: n
|
|
825
|
+
}) : (s = document.createEvent("Event"), s.initEvent(t, !1, !0)), this.documentFragment.dispatchEvent(s);
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
|
-
class
|
|
829
|
-
constructor(t,
|
|
830
|
-
super(t,
|
|
828
|
+
class an extends O {
|
|
829
|
+
constructor(t, n) {
|
|
830
|
+
super(t, n);
|
|
831
831
|
}
|
|
832
|
-
downloadCSV(t,
|
|
833
|
-
const
|
|
832
|
+
downloadCSV(t, n) {
|
|
833
|
+
const s = document.createElement("a"), e = "text/csv;encoding:utf-8";
|
|
834
834
|
if (navigator.msSaveBlob)
|
|
835
835
|
navigator.msSaveBlob(
|
|
836
836
|
new Blob([t], {
|
|
837
|
-
type:
|
|
837
|
+
type: e
|
|
838
838
|
}),
|
|
839
|
-
|
|
839
|
+
n
|
|
840
840
|
);
|
|
841
|
-
else if (URL && "download" in
|
|
841
|
+
else if (URL && "download" in s) {
|
|
842
842
|
const o = URL.createObjectURL(
|
|
843
843
|
new Blob([t], {
|
|
844
|
-
type:
|
|
844
|
+
type: e
|
|
845
845
|
})
|
|
846
846
|
);
|
|
847
|
-
|
|
847
|
+
s.href = o, s.setAttribute("download", n), document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
|
|
848
848
|
} else
|
|
849
849
|
location.href = `data:application/octet-stream,${encodeURIComponent(t)}`;
|
|
850
850
|
}
|
|
851
|
-
downloadImage(t,
|
|
852
|
-
const
|
|
853
|
-
|
|
851
|
+
downloadImage(t, n) {
|
|
852
|
+
const s = document.createElement("a");
|
|
853
|
+
s.download = n, s.href = t, document.body.appendChild(s), s.click(), document.body.removeChild(s);
|
|
854
854
|
}
|
|
855
855
|
}
|
|
856
|
-
class
|
|
856
|
+
class rn extends O {
|
|
857
857
|
constructor() {
|
|
858
858
|
super(...arguments), this.pendingTransitions = {};
|
|
859
859
|
}
|
|
860
860
|
init() {
|
|
861
|
-
|
|
862
|
-
(t = this.services.events) == null || t.addEventListener(w.Model.UPDATE, () => {
|
|
861
|
+
this.services.events?.addEventListener(w.Model.UPDATE, () => {
|
|
863
862
|
this.pendingTransitions = {};
|
|
864
863
|
});
|
|
865
864
|
}
|
|
866
|
-
setupTransition({ transition: t, name:
|
|
865
|
+
setupTransition({ transition: t, name: n, animate: s }) {
|
|
867
866
|
return this.pendingTransitions[t._id] = t, t.on("end interrupt cancel", () => {
|
|
868
867
|
delete this.pendingTransitions[t._id];
|
|
869
|
-
}), this.model.getOptions().animations === !1 ||
|
|
870
|
-
c(W,
|
|
868
|
+
}), this.model.getOptions().animations === !1 || s === !1 ? t.duration(0) : t.duration(
|
|
869
|
+
c(W, n, "duration") || W.default.duration
|
|
871
870
|
);
|
|
872
871
|
}
|
|
873
872
|
getPendingTransitions() {
|
|
@@ -875,157 +874,157 @@ class ae extends A {
|
|
|
875
874
|
}
|
|
876
875
|
}
|
|
877
876
|
function S(i, t) {
|
|
878
|
-
const
|
|
879
|
-
return
|
|
877
|
+
const n = +v(i) - +v(t);
|
|
878
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
880
879
|
}
|
|
881
|
-
function Fi(i, t,
|
|
882
|
-
const [
|
|
883
|
-
|
|
880
|
+
function Fi(i, t, n) {
|
|
881
|
+
const [s, e] = M(
|
|
882
|
+
n?.in,
|
|
884
883
|
i,
|
|
885
884
|
t
|
|
886
885
|
);
|
|
887
|
-
return
|
|
886
|
+
return s.getFullYear() - e.getFullYear();
|
|
888
887
|
}
|
|
889
|
-
function zi(i, t,
|
|
890
|
-
const [
|
|
891
|
-
|
|
888
|
+
function zi(i, t, n) {
|
|
889
|
+
const [s, e] = M(
|
|
890
|
+
n?.in,
|
|
892
891
|
i,
|
|
893
892
|
t
|
|
894
|
-
), o = S(
|
|
895
|
-
|
|
896
|
-
const r = S(
|
|
893
|
+
), o = S(s, e), a = Math.abs(Fi(s, e));
|
|
894
|
+
s.setFullYear(1584), e.setFullYear(1584);
|
|
895
|
+
const r = S(s, e) === -o, h = o * (a - +r);
|
|
897
896
|
return h === 0 ? 0 : h;
|
|
898
897
|
}
|
|
899
|
-
function X(i, t,
|
|
900
|
-
const
|
|
898
|
+
function X(i, t, n) {
|
|
899
|
+
const s = v(i, n?.in);
|
|
901
900
|
if (isNaN(t)) return E(i, NaN);
|
|
902
901
|
if (!t)
|
|
903
|
-
return
|
|
904
|
-
const
|
|
905
|
-
o.setMonth(
|
|
902
|
+
return s;
|
|
903
|
+
const e = s.getDate(), o = E(i, s.getTime());
|
|
904
|
+
o.setMonth(s.getMonth() + t + 1, 0);
|
|
906
905
|
const a = o.getDate();
|
|
907
|
-
return
|
|
906
|
+
return e >= a ? o : (s.setFullYear(
|
|
908
907
|
o.getFullYear(),
|
|
909
908
|
o.getMonth(),
|
|
910
|
-
|
|
911
|
-
),
|
|
909
|
+
e
|
|
910
|
+
), s);
|
|
912
911
|
}
|
|
913
|
-
function St(i, t,
|
|
914
|
-
return X(i, t * 12,
|
|
912
|
+
function St(i, t, n) {
|
|
913
|
+
return X(i, t * 12, n);
|
|
915
914
|
}
|
|
916
|
-
function Vi(i, t,
|
|
917
|
-
return St(i, -t,
|
|
915
|
+
function Vi(i, t, n) {
|
|
916
|
+
return St(i, -t, n);
|
|
918
917
|
}
|
|
919
|
-
function Hi(i, t,
|
|
920
|
-
const [
|
|
921
|
-
|
|
918
|
+
function Hi(i, t, n) {
|
|
919
|
+
const [s, e] = M(
|
|
920
|
+
n?.in,
|
|
922
921
|
i,
|
|
923
922
|
t
|
|
924
|
-
), o =
|
|
923
|
+
), o = s.getFullYear() - e.getFullYear(), a = s.getMonth() - e.getMonth();
|
|
925
924
|
return o * 12 + a;
|
|
926
925
|
}
|
|
927
926
|
function Yi(i, t) {
|
|
928
|
-
const
|
|
929
|
-
return
|
|
927
|
+
const n = v(i, t?.in);
|
|
928
|
+
return n.setHours(23, 59, 59, 999), n;
|
|
930
929
|
}
|
|
931
930
|
function Xi(i, t) {
|
|
932
|
-
const
|
|
933
|
-
return
|
|
931
|
+
const n = v(i, t?.in), s = n.getMonth();
|
|
932
|
+
return n.setFullYear(n.getFullYear(), s + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
934
933
|
}
|
|
935
934
|
function Gi(i, t) {
|
|
936
|
-
const
|
|
937
|
-
return +Yi(
|
|
935
|
+
const n = v(i, t?.in);
|
|
936
|
+
return +Yi(n, t) == +Xi(n, t);
|
|
938
937
|
}
|
|
939
|
-
function $i(i, t,
|
|
940
|
-
const [
|
|
941
|
-
|
|
938
|
+
function $i(i, t, n) {
|
|
939
|
+
const [s, e, o] = M(
|
|
940
|
+
n?.in,
|
|
942
941
|
i,
|
|
943
942
|
i,
|
|
944
943
|
t
|
|
945
|
-
), a = S(
|
|
946
|
-
Hi(
|
|
944
|
+
), a = S(e, o), r = Math.abs(
|
|
945
|
+
Hi(e, o)
|
|
947
946
|
);
|
|
948
947
|
if (r < 1) return 0;
|
|
949
|
-
|
|
950
|
-
let h = S(
|
|
951
|
-
Gi(
|
|
948
|
+
e.getMonth() === 1 && e.getDate() > 27 && e.setDate(30), e.setMonth(e.getMonth() - a * r);
|
|
949
|
+
let h = S(e, o) === -a;
|
|
950
|
+
Gi(s) && r === 1 && S(s, o) === 1 && (h = !1);
|
|
952
951
|
const l = a * (r - +h);
|
|
953
952
|
return l === 0 ? 0 : l;
|
|
954
953
|
}
|
|
955
|
-
function Ui(i, t,
|
|
956
|
-
return X(i, -t,
|
|
954
|
+
function Ui(i, t, n) {
|
|
955
|
+
return X(i, -t, n);
|
|
957
956
|
}
|
|
958
|
-
function Ki(i, t,
|
|
959
|
-
const [
|
|
960
|
-
|
|
957
|
+
function Ki(i, t, n) {
|
|
958
|
+
const [s, e] = M(
|
|
959
|
+
n?.in,
|
|
961
960
|
i,
|
|
962
961
|
t
|
|
963
|
-
), o = rt(
|
|
964
|
-
jt(
|
|
962
|
+
), o = rt(s, e), a = Math.abs(
|
|
963
|
+
jt(s, e)
|
|
965
964
|
);
|
|
966
|
-
|
|
967
|
-
const r = +(rt(
|
|
965
|
+
s.setDate(s.getDate() - o * a);
|
|
966
|
+
const r = +(rt(s, e) === -o), h = o * (a - r);
|
|
968
967
|
return h === 0 ? 0 : h;
|
|
969
968
|
}
|
|
970
969
|
function rt(i, t) {
|
|
971
|
-
const
|
|
972
|
-
return
|
|
970
|
+
const n = i.getFullYear() - t.getFullYear() || i.getMonth() - t.getMonth() || i.getDate() - t.getDate() || i.getHours() - t.getHours() || i.getMinutes() - t.getMinutes() || i.getSeconds() - t.getSeconds() || i.getMilliseconds() - t.getMilliseconds();
|
|
971
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
973
972
|
}
|
|
974
|
-
function Pt(i, t,
|
|
975
|
-
const
|
|
976
|
-
return isNaN(t) ? E(i, NaN) : (t &&
|
|
973
|
+
function Pt(i, t, n) {
|
|
974
|
+
const s = v(i, n?.in);
|
|
975
|
+
return isNaN(t) ? E(i, NaN) : (t && s.setDate(s.getDate() + t), s);
|
|
977
976
|
}
|
|
978
|
-
function qi(i, t,
|
|
979
|
-
return Pt(i, -t,
|
|
977
|
+
function qi(i, t, n) {
|
|
978
|
+
return Pt(i, -t, n);
|
|
980
979
|
}
|
|
981
980
|
function G(i) {
|
|
982
981
|
return (t) => {
|
|
983
|
-
const
|
|
984
|
-
return
|
|
982
|
+
const s = (i ? Math[i] : Math.trunc)(t);
|
|
983
|
+
return s === 0 ? 0 : s;
|
|
985
984
|
};
|
|
986
985
|
}
|
|
987
|
-
function ji(i, t,
|
|
988
|
-
const [
|
|
989
|
-
|
|
986
|
+
function ji(i, t, n) {
|
|
987
|
+
const [s, e] = M(
|
|
988
|
+
n?.in,
|
|
990
989
|
i,
|
|
991
990
|
t
|
|
992
|
-
), o = (+
|
|
993
|
-
return G(
|
|
991
|
+
), o = (+s - +e) / ft;
|
|
992
|
+
return G(n?.roundingMethod)(o);
|
|
994
993
|
}
|
|
995
|
-
function Et(i, t,
|
|
996
|
-
return E(i, +
|
|
994
|
+
function Et(i, t, n) {
|
|
995
|
+
return E(i, +v(i) + t);
|
|
997
996
|
}
|
|
998
|
-
function wt(i, t,
|
|
997
|
+
function wt(i, t, n) {
|
|
999
998
|
return Et(i, t * ft);
|
|
1000
999
|
}
|
|
1001
|
-
function Wi(i, t,
|
|
1000
|
+
function Wi(i, t, n) {
|
|
1002
1001
|
return wt(i, -t);
|
|
1003
1002
|
}
|
|
1004
1003
|
function kt(i, t) {
|
|
1005
|
-
return +
|
|
1004
|
+
return +v(i) - +v(t);
|
|
1006
1005
|
}
|
|
1007
|
-
function ht(i, t,
|
|
1008
|
-
const
|
|
1009
|
-
return G(
|
|
1006
|
+
function ht(i, t, n) {
|
|
1007
|
+
const s = kt(i, t) / pt;
|
|
1008
|
+
return G(n?.roundingMethod)(s);
|
|
1010
1009
|
}
|
|
1011
|
-
function Z(i, t,
|
|
1012
|
-
const
|
|
1013
|
-
return
|
|
1010
|
+
function Z(i, t, n) {
|
|
1011
|
+
const s = v(i, n?.in);
|
|
1012
|
+
return s.setTime(s.getTime() + t * pt), s;
|
|
1014
1013
|
}
|
|
1015
|
-
function ct(i, t,
|
|
1016
|
-
return Z(i, -t,
|
|
1014
|
+
function ct(i, t, n) {
|
|
1015
|
+
return Z(i, -t, n);
|
|
1017
1016
|
}
|
|
1018
|
-
function lt(i, t,
|
|
1019
|
-
const
|
|
1020
|
-
return G(
|
|
1017
|
+
function lt(i, t, n) {
|
|
1018
|
+
const s = kt(i, t) / 1e3;
|
|
1019
|
+
return G(n?.roundingMethod)(s);
|
|
1021
1020
|
}
|
|
1022
|
-
function F(i, t,
|
|
1021
|
+
function F(i, t, n) {
|
|
1023
1022
|
return Et(i, t * 1e3);
|
|
1024
1023
|
}
|
|
1025
|
-
function _t(i, t,
|
|
1024
|
+
function _t(i, t, n) {
|
|
1026
1025
|
return F(i, -t);
|
|
1027
1026
|
}
|
|
1028
|
-
class
|
|
1027
|
+
class hn extends O {
|
|
1029
1028
|
constructor() {
|
|
1030
1029
|
super(...arguments), this.scaleTypes = {
|
|
1031
1030
|
top: null,
|
|
@@ -1042,17 +1041,17 @@ class re extends A {
|
|
|
1042
1041
|
}
|
|
1043
1042
|
getDomainAxisPosition({ datum: t = null } = {}) {
|
|
1044
1043
|
if (this.dualAxes && t) {
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1044
|
+
const n = this.model.getOptions(), { groupMapsTo: s } = n.data, e = c(n, "axes", this.secondaryDomainAxisPosition), o = t[s];
|
|
1045
|
+
if (e?.correspondingDatasets && e.correspondingDatasets.includes(o))
|
|
1047
1046
|
return this.secondaryDomainAxisPosition;
|
|
1048
1047
|
}
|
|
1049
1048
|
return this.domainAxisPosition;
|
|
1050
1049
|
}
|
|
1051
|
-
getRangeAxisPosition({ datum: t = null, groups:
|
|
1050
|
+
getRangeAxisPosition({ datum: t = null, groups: n = null } = {}) {
|
|
1052
1051
|
if (this.dualAxes) {
|
|
1053
|
-
const
|
|
1052
|
+
const s = this.model.getOptions(), { groupMapsTo: e } = s.data, o = c(s, "axes", this.secondaryRangeAxisPosition);
|
|
1054
1053
|
let a;
|
|
1055
|
-
if (t !== null ? a = t[
|
|
1054
|
+
if (t !== null ? a = t[e] : n && n.length > 0 && (a = n[0]), o?.correspondingDatasets && o.correspondingDatasets.includes(a))
|
|
1056
1055
|
return this.secondaryRangeAxisPosition;
|
|
1057
1056
|
}
|
|
1058
1057
|
return this.rangeAxisPosition;
|
|
@@ -1069,8 +1068,8 @@ class re extends A {
|
|
|
1069
1068
|
return this.getAxisOptions(t);
|
|
1070
1069
|
}
|
|
1071
1070
|
getScaleLabel(t) {
|
|
1072
|
-
const
|
|
1073
|
-
return
|
|
1071
|
+
const s = this.getAxisOptions(t).title;
|
|
1072
|
+
return s || (t === _.BOTTOM || t === _.TOP ? "x-value" : "y-value");
|
|
1074
1073
|
}
|
|
1075
1074
|
getDomainLabel() {
|
|
1076
1075
|
return this.getScaleLabel(this.getDomainAxisPosition());
|
|
@@ -1080,17 +1079,17 @@ class re extends A {
|
|
|
1080
1079
|
}
|
|
1081
1080
|
update() {
|
|
1082
1081
|
this.determineAxisDuality(), this.findDomainAndRangeAxes(), this.determineOrientation(), Object.keys(_).map(
|
|
1083
|
-
(
|
|
1084
|
-
).forEach((
|
|
1085
|
-
this.scales[
|
|
1082
|
+
(n) => _[n]
|
|
1083
|
+
).forEach((n) => {
|
|
1084
|
+
this.scales[n] = this.createScale(n);
|
|
1086
1085
|
});
|
|
1087
1086
|
}
|
|
1088
1087
|
findDomainAndRangeAxes() {
|
|
1089
|
-
const t = this.findVerticalAxesPositions(),
|
|
1088
|
+
const t = this.findVerticalAxesPositions(), n = this.findHorizontalAxesPositions(), s = this.findDomainAndRangeAxesPositions(
|
|
1090
1089
|
t,
|
|
1091
|
-
|
|
1090
|
+
n
|
|
1092
1091
|
);
|
|
1093
|
-
this.domainAxisPosition =
|
|
1092
|
+
this.domainAxisPosition = s.primaryDomainAxisPosition, this.rangeAxisPosition = s.primaryRangeAxisPosition, this.isDualAxes() && (this.secondaryDomainAxisPosition = s.secondaryDomainAxisPosition, this.secondaryRangeAxisPosition = s.secondaryRangeAxisPosition);
|
|
1094
1093
|
}
|
|
1095
1094
|
determineOrientation() {
|
|
1096
1095
|
(this.rangeAxisPosition === _.LEFT || this.rangeAxisPosition === _.RIGHT) && (this.domainAxisPosition === _.BOTTOM || this.domainAxisPosition === _.TOP) ? this.orientation = C.VERTICAL : this.orientation = C.HORIZONTAL;
|
|
@@ -1101,19 +1100,18 @@ class re extends A {
|
|
|
1101
1100
|
// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes
|
|
1102
1101
|
// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset
|
|
1103
1102
|
determineAxisDuality() {
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
((n = e[_.LEFT]) != null && n.correspondingDatasets && e[_.RIGHT] || (s = e[_.RIGHT]) != null && s.correspondingDatasets && e[_.LEFT] || (o = e[_.TOP]) != null && o.correspondingDatasets && e[_.BOTTOM] || (a = e[_.BOTTOM]) != null && a.correspondingDatasets && e[_.TOP]) && (this.dualAxes = !0);
|
|
1103
|
+
const t = this.model.getOptions(), n = c(t, "axes");
|
|
1104
|
+
(n[_.LEFT]?.correspondingDatasets && n[_.RIGHT] || n[_.RIGHT]?.correspondingDatasets && n[_.LEFT] || n[_.TOP]?.correspondingDatasets && n[_.BOTTOM] || n[_.BOTTOM]?.correspondingDatasets && n[_.TOP]) && (this.dualAxes = !0);
|
|
1107
1105
|
}
|
|
1108
1106
|
getCustomDomainValuesByposition(t) {
|
|
1109
|
-
const
|
|
1110
|
-
if (
|
|
1107
|
+
const n = c(this.model.getOptions(), "axes", t, "domain");
|
|
1108
|
+
if (n && !Array.isArray(n))
|
|
1111
1109
|
throw new Error(`Domain in ${t} axis is not a valid array`);
|
|
1112
|
-
if (Array.isArray(
|
|
1110
|
+
if (Array.isArray(n) && (this.scaleTypes[t] === p.LINEAR || this.scaleTypes[t] === p.TIME) && n.length !== 2)
|
|
1113
1111
|
throw new Error(
|
|
1114
1112
|
`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`
|
|
1115
1113
|
);
|
|
1116
|
-
return
|
|
1114
|
+
return n;
|
|
1117
1115
|
}
|
|
1118
1116
|
getOrientation() {
|
|
1119
1117
|
return this.orientation;
|
|
@@ -1142,14 +1140,14 @@ class re extends A {
|
|
|
1142
1140
|
getMainXAxisPosition() {
|
|
1143
1141
|
const t = [_.BOTTOM, _.TOP];
|
|
1144
1142
|
return [this.domainAxisPosition, this.rangeAxisPosition].find(
|
|
1145
|
-
(
|
|
1143
|
+
(n) => t.indexOf(n) > -1
|
|
1146
1144
|
);
|
|
1147
1145
|
}
|
|
1148
1146
|
// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)
|
|
1149
1147
|
getMainYAxisPosition() {
|
|
1150
1148
|
const t = [_.LEFT, _.RIGHT];
|
|
1151
1149
|
return [this.domainAxisPosition, this.rangeAxisPosition].find(
|
|
1152
|
-
(
|
|
1150
|
+
(n) => t.indexOf(n) > -1
|
|
1153
1151
|
);
|
|
1154
1152
|
}
|
|
1155
1153
|
getMainXScale() {
|
|
@@ -1158,14 +1156,14 @@ class re extends A {
|
|
|
1158
1156
|
getMainYScale() {
|
|
1159
1157
|
return this.scales[this.getMainYAxisPosition()];
|
|
1160
1158
|
}
|
|
1161
|
-
getValueFromScale(t,
|
|
1162
|
-
const o = this.model.getOptions(), r = c(o, "axes")[
|
|
1159
|
+
getValueFromScale(t, n, s, e) {
|
|
1160
|
+
const o = this.model.getOptions(), r = c(o, "axes")[s], { mapsTo: h } = r, l = c(e, h) !== null ? e[h] : e;
|
|
1163
1161
|
let f;
|
|
1164
|
-
switch (
|
|
1165
|
-
case
|
|
1162
|
+
switch (n) {
|
|
1163
|
+
case p.LABELS:
|
|
1166
1164
|
f = t(l) + t.step() / 2;
|
|
1167
1165
|
break;
|
|
1168
|
-
case
|
|
1166
|
+
case p.TIME:
|
|
1169
1167
|
f = t(new Date(l));
|
|
1170
1168
|
break;
|
|
1171
1169
|
default:
|
|
@@ -1174,27 +1172,27 @@ class re extends A {
|
|
|
1174
1172
|
return f;
|
|
1175
1173
|
}
|
|
1176
1174
|
getBoundedScaledValues(t) {
|
|
1177
|
-
const { bounds:
|
|
1175
|
+
const { bounds: n } = this.model.getOptions(), s = this.getRangeAxisPosition({ datum: t }), e = this.scales[s], o = this.model.getOptions(), r = c(o, "axes")[s], { mapsTo: h } = r, l = t[h] !== void 0 ? t[h] : t;
|
|
1178
1176
|
return [
|
|
1179
|
-
|
|
1180
|
-
c(t,
|
|
1177
|
+
e(
|
|
1178
|
+
c(t, n.upperBoundMapsTo) !== null ? t[n.upperBoundMapsTo] : l
|
|
1181
1179
|
),
|
|
1182
|
-
|
|
1183
|
-
c(t,
|
|
1180
|
+
e(
|
|
1181
|
+
c(t, n.lowerBoundMapsTo) !== null ? t[n.lowerBoundMapsTo] : l
|
|
1184
1182
|
)
|
|
1185
1183
|
];
|
|
1186
1184
|
}
|
|
1187
|
-
getValueThroughAxisPosition(t,
|
|
1188
|
-
const
|
|
1189
|
-
return this.getValueFromScale(
|
|
1185
|
+
getValueThroughAxisPosition(t, n) {
|
|
1186
|
+
const s = this.scaleTypes[t], e = this.scales[t];
|
|
1187
|
+
return this.getValueFromScale(e, s, t, n);
|
|
1190
1188
|
}
|
|
1191
1189
|
getDomainValue(t) {
|
|
1192
|
-
const
|
|
1193
|
-
return this.getValueThroughAxisPosition(
|
|
1190
|
+
const n = this.getDomainAxisPosition({ datum: t });
|
|
1191
|
+
return this.getValueThroughAxisPosition(n, t);
|
|
1194
1192
|
}
|
|
1195
1193
|
getRangeValue(t) {
|
|
1196
|
-
const
|
|
1197
|
-
return this.getValueThroughAxisPosition(
|
|
1194
|
+
const n = this.getRangeAxisPosition({ datum: t });
|
|
1195
|
+
return this.getValueThroughAxisPosition(n, t);
|
|
1198
1196
|
}
|
|
1199
1197
|
getMainXScaleType() {
|
|
1200
1198
|
return this.getScaleTypeByPosition(this.getMainXAxisPosition());
|
|
@@ -1203,76 +1201,76 @@ class re extends A {
|
|
|
1203
1201
|
return this.getScaleTypeByPosition(this.getMainYAxisPosition());
|
|
1204
1202
|
}
|
|
1205
1203
|
getDomainIdentifier(t) {
|
|
1206
|
-
const
|
|
1207
|
-
return c(
|
|
1204
|
+
const n = this.model.getOptions();
|
|
1205
|
+
return c(n, "axes", this.getDomainAxisPosition({ datum: t }), "mapsTo");
|
|
1208
1206
|
}
|
|
1209
1207
|
getRangeIdentifier(t) {
|
|
1210
|
-
const
|
|
1211
|
-
return c(
|
|
1212
|
-
}
|
|
1213
|
-
extendsDomain(t,
|
|
1214
|
-
const
|
|
1215
|
-
if (
|
|
1216
|
-
const o = c(
|
|
1217
|
-
return Ji(
|
|
1208
|
+
const n = this.model.getOptions();
|
|
1209
|
+
return c(n, "axes", this.getRangeAxisPosition({ datum: t }), "mapsTo");
|
|
1210
|
+
}
|
|
1211
|
+
extendsDomain(t, n) {
|
|
1212
|
+
const s = this.model.getOptions(), e = c(s, "axes", t);
|
|
1213
|
+
if (e.scaleType === p.TIME) {
|
|
1214
|
+
const o = c(s, "timeScale", "addSpaceOnEdges");
|
|
1215
|
+
return Ji(n, o);
|
|
1218
1216
|
} else
|
|
1219
|
-
return Qi(
|
|
1217
|
+
return Qi(n, J.paddingRatio, e.scaleType);
|
|
1220
1218
|
}
|
|
1221
1219
|
findVerticalAxesPositions() {
|
|
1222
|
-
const t = this.model.getOptions(),
|
|
1223
|
-
return c(
|
|
1220
|
+
const t = this.model.getOptions(), n = c(t, "axes"), s = this.isDualAxes();
|
|
1221
|
+
return c(n, _.LEFT) === null && c(n, _.RIGHT) !== null || c(n, _.RIGHT, "main") === !0 || s && c(n, _.LEFT, "correspondingDatasets") ? {
|
|
1224
1222
|
primary: _.RIGHT,
|
|
1225
1223
|
secondary: _.LEFT
|
|
1226
1224
|
} : { primary: _.LEFT, secondary: _.RIGHT };
|
|
1227
1225
|
}
|
|
1228
1226
|
findHorizontalAxesPositions() {
|
|
1229
|
-
const t = this.model.getOptions(),
|
|
1230
|
-
return c(
|
|
1227
|
+
const t = this.model.getOptions(), n = c(t, "axes"), s = this.isDualAxes();
|
|
1228
|
+
return c(n, _.BOTTOM) === null && c(n, _.TOP) !== null || c(n, _.TOP, "main") === !0 || s && c(n, _.BOTTOM, "correspondingDatasets") ? {
|
|
1231
1229
|
primary: _.TOP,
|
|
1232
1230
|
secondary: _.BOTTOM
|
|
1233
1231
|
} : { primary: _.BOTTOM, secondary: _.TOP };
|
|
1234
1232
|
}
|
|
1235
|
-
findDomainAndRangeAxesPositions(t,
|
|
1236
|
-
const
|
|
1233
|
+
findDomainAndRangeAxesPositions(t, n) {
|
|
1234
|
+
const s = this.model.getOptions(), e = c(s, "axes", t.primary), o = c(s, "axes", n.primary), a = e.scaleType || p.LINEAR, r = o.scaleType || p.LINEAR, h = {
|
|
1237
1235
|
primaryDomainAxisPosition: null,
|
|
1238
1236
|
secondaryDomainAxisPosition: null,
|
|
1239
1237
|
primaryRangeAxisPosition: null,
|
|
1240
1238
|
secondaryRangeAxisPosition: null
|
|
1241
1239
|
};
|
|
1242
|
-
return h.primaryDomainAxisPosition =
|
|
1240
|
+
return h.primaryDomainAxisPosition = n.primary, h.primaryRangeAxisPosition = t.primary, h.secondaryDomainAxisPosition = n.secondary, h.secondaryRangeAxisPosition = t.secondary, (!(r === p.LABELS || r === p.TIME) && a === p.LABELS || a === p.TIME) && (h.primaryDomainAxisPosition = t.primary, h.primaryRangeAxisPosition = n.primary, h.secondaryDomainAxisPosition = t.secondary, h.secondaryRangeAxisPosition = n.secondary), h;
|
|
1243
1241
|
}
|
|
1244
1242
|
getScaleDomain(t) {
|
|
1245
|
-
const
|
|
1243
|
+
const n = this.model.getOptions(), s = c(n, "axes", t), e = c(n, "bounds"), { includeZero: o } = s, a = c(s, "scaleType") || p.LINEAR;
|
|
1246
1244
|
if (this.model.isDataEmpty())
|
|
1247
1245
|
return [];
|
|
1248
|
-
if (
|
|
1246
|
+
if (s.binned) {
|
|
1249
1247
|
const { bins: u } = this.model.getBinConfigurations();
|
|
1250
1248
|
return [0, Wt(u, (x) => x.length)];
|
|
1251
|
-
} else if (
|
|
1249
|
+
} else if (s.limitDomainToBins) {
|
|
1252
1250
|
const { bins: u } = this.model.getBinConfigurations(), x = this.model.getStackKeys({ bins: u });
|
|
1253
1251
|
return [x[0].split(":")[0], x[x.length - 1].split(":")[1]];
|
|
1254
1252
|
}
|
|
1255
|
-
const r = this.model.getDisplayData(), { extendLinearDomainBy: h, mapsTo: l, percentage: f, thresholds: y } =
|
|
1256
|
-
if (
|
|
1257
|
-
return a ===
|
|
1253
|
+
const r = this.model.getDisplayData(), { extendLinearDomainBy: h, mapsTo: l, percentage: f, thresholds: y } = s, { reference: d, compareTo: T } = J.ratio;
|
|
1254
|
+
if (s.domain)
|
|
1255
|
+
return a === p.LABELS ? s.domain : (a === p.TIME && (s.domain = s.domain.map(
|
|
1258
1256
|
(u) => u.getTime === void 0 ? new Date(u) : u
|
|
1259
|
-
)), this.extendsDomain(t,
|
|
1257
|
+
)), this.extendsDomain(t, s.domain));
|
|
1260
1258
|
if (f)
|
|
1261
1259
|
return [0, 100];
|
|
1262
|
-
if (
|
|
1260
|
+
if (s && a === p.LABELS)
|
|
1263
1261
|
return Jt(r.map((u) => u[l]));
|
|
1264
|
-
let g,
|
|
1262
|
+
let g, m;
|
|
1265
1263
|
const D = this.model.getDataGroupNames();
|
|
1266
|
-
if (a ===
|
|
1267
|
-
return r.map((u) => `${u[
|
|
1268
|
-
if (a ===
|
|
1269
|
-
|
|
1270
|
-
else if (
|
|
1271
|
-
|
|
1272
|
-
|
|
1264
|
+
if (a === p.LABELS_RATIO)
|
|
1265
|
+
return r.map((u) => `${u[d]}/${u[T]}`);
|
|
1266
|
+
if (a === p.TIME)
|
|
1267
|
+
m = r.map((u) => +new Date(u[l]));
|
|
1268
|
+
else if (e && n.axes)
|
|
1269
|
+
m = [], r.forEach((u) => {
|
|
1270
|
+
m.push(u[l]), u[e.upperBoundMapsTo] && m.push(u[e.upperBoundMapsTo]), u[e.lowerBoundMapsTo] && m.push(u[e.lowerBoundMapsTo]);
|
|
1273
1271
|
});
|
|
1274
|
-
else if (
|
|
1275
|
-
const { groupMapsTo: u } =
|
|
1272
|
+
else if (s.stacked === !0 && D && t === this.getRangeAxisPosition()) {
|
|
1273
|
+
const { groupMapsTo: u } = n.data, x = this.model.getDataValuesGroupedByKeys({
|
|
1276
1274
|
groups: D
|
|
1277
1275
|
}), Rt = r.filter(
|
|
1278
1276
|
(b) => !D.includes(b[u])
|
|
@@ -1280,84 +1278,84 @@ class re extends A {
|
|
|
1280
1278
|
x.forEach((b) => {
|
|
1281
1279
|
const { ...Bt } = b;
|
|
1282
1280
|
let U = 0, K = 0;
|
|
1283
|
-
Object.values(
|
|
1281
|
+
Object.values(di(Bt, "sharedStackKey")).forEach((P) => {
|
|
1284
1282
|
isNaN(P) || (P < 0 ? K += P : U += P);
|
|
1285
1283
|
}), $.push([K, U]);
|
|
1286
|
-
}),
|
|
1287
|
-
...
|
|
1284
|
+
}), m = [
|
|
1285
|
+
...dt($),
|
|
1288
1286
|
...Rt.map((b) => b[l])
|
|
1289
1287
|
];
|
|
1290
1288
|
} else
|
|
1291
|
-
|
|
1289
|
+
m = [], r.forEach((u) => {
|
|
1292
1290
|
const x = u[l];
|
|
1293
|
-
Array.isArray(x) && x.length === 2 ? (
|
|
1291
|
+
Array.isArray(x) && x.length === 2 ? (m.push(x[0]), m.push(x[1])) : (h && m.push(Math.max(u[l], u[h])), m.push(x));
|
|
1294
1292
|
});
|
|
1295
|
-
return a !==
|
|
1293
|
+
return a !== p.TIME && a !== p.LOG && o && m.push(0), y && y.length > 0 && y.forEach((u) => {
|
|
1296
1294
|
const x = c(u, "value");
|
|
1297
|
-
x !== null &&
|
|
1298
|
-
}), g =
|
|
1295
|
+
x !== null && m.push(x);
|
|
1296
|
+
}), g = mt(m), g = this.extendsDomain(t, g), g;
|
|
1299
1297
|
}
|
|
1300
1298
|
createScale(t) {
|
|
1301
|
-
const
|
|
1302
|
-
if (!
|
|
1299
|
+
const n = this.model.getOptions(), s = c(n, "axes", t);
|
|
1300
|
+
if (!s)
|
|
1303
1301
|
return null;
|
|
1304
|
-
const
|
|
1305
|
-
this.scaleTypes[t] =
|
|
1302
|
+
const e = c(s, "scaleType") || p.LINEAR;
|
|
1303
|
+
this.scaleTypes[t] = e;
|
|
1306
1304
|
let o;
|
|
1307
|
-
return
|
|
1305
|
+
return e === p.TIME ? o = ei() : e === p.LOG ? o = xt().base(s.base || 10) : e === p.LABELS || e === p.LABELS_RATIO ? o = oi() : o = Qt(), o.domain(this.getScaleDomain(t)), o;
|
|
1308
1306
|
}
|
|
1309
1307
|
getDomainLowerBound(t) {
|
|
1310
|
-
let
|
|
1311
|
-
return this.getOrientation() === C.VERTICAL ?
|
|
1308
|
+
let n, s = 0;
|
|
1309
|
+
return this.getOrientation() === C.VERTICAL ? n = this.getMainYScale().domain() : n = this.getMainXScale().domain(), c(this.model.getOptions(), "axes", t, "includeZero") === !1 && n[0] > 0 && n[1] > 0 && (s = n[0]), s;
|
|
1312
1310
|
}
|
|
1313
1311
|
getHighestDomainThreshold() {
|
|
1314
|
-
const t = c(this.model.getOptions(), "axes"),
|
|
1315
|
-
if (!Array.isArray(
|
|
1312
|
+
const t = c(this.model.getOptions(), "axes"), n = this.getDomainAxisPosition(), { thresholds: s } = t[n];
|
|
1313
|
+
if (!Array.isArray(s) || Array.isArray(s) && !s.length)
|
|
1316
1314
|
return null;
|
|
1317
|
-
const
|
|
1318
|
-
return this.getScaleTypeByPosition(
|
|
1315
|
+
const e = this.getDomainScale(), o = s.sort((r, h) => h.value - r.value)[0];
|
|
1316
|
+
return this.getScaleTypeByPosition(n) === p.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
|
|
1319
1317
|
threshold: o,
|
|
1320
|
-
scaleValue:
|
|
1318
|
+
scaleValue: e(o.value)
|
|
1321
1319
|
};
|
|
1322
1320
|
}
|
|
1323
1321
|
getHighestRangeThreshold() {
|
|
1324
|
-
const t = c(this.model.getOptions(), "axes"),
|
|
1325
|
-
if (!Array.isArray(
|
|
1322
|
+
const t = c(this.model.getOptions(), "axes"), n = this.getRangeAxisPosition(), { thresholds: s } = t[n];
|
|
1323
|
+
if (!Array.isArray(s) || Array.isArray(s) && !s.length)
|
|
1326
1324
|
return null;
|
|
1327
|
-
const
|
|
1325
|
+
const e = this.getRangeScale(), o = s.sort((a, r) => r.value - a.value)[0];
|
|
1328
1326
|
return {
|
|
1329
1327
|
threshold: o,
|
|
1330
|
-
scaleValue:
|
|
1328
|
+
scaleValue: e(o.value)
|
|
1331
1329
|
};
|
|
1332
1330
|
}
|
|
1333
1331
|
}
|
|
1334
1332
|
function Ji(i, t) {
|
|
1335
|
-
const
|
|
1336
|
-
return zi(
|
|
1337
|
-
ct(
|
|
1338
|
-
Z(
|
|
1339
|
-
] : ht(
|
|
1340
|
-
_t(
|
|
1341
|
-
F(
|
|
1342
|
-
] : lt(
|
|
1343
|
-
}
|
|
1344
|
-
function Qi([i, t],
|
|
1345
|
-
const o = (t - i) *
|
|
1333
|
+
const n = new Date(i[0]), s = new Date(i[1]);
|
|
1334
|
+
return zi(s, n) > 1 ? [Vi(n, t), St(s, t)] : $i(s, n) > 1 ? [Ui(n, t), X(s, t)] : Ki(s, n) > 1 ? [qi(n, t), Pt(s, t)] : ji(s, n) > 1 ? [Wi(n, t), wt(s, t)] : ht(s, n) > 30 ? [
|
|
1335
|
+
ct(n, t * 30),
|
|
1336
|
+
Z(s, t * 30)
|
|
1337
|
+
] : ht(s, n) > 1 ? [ct(n, t), Z(s, t)] : lt(s, n) > 15 ? [
|
|
1338
|
+
_t(n, t * 15),
|
|
1339
|
+
F(s, t * 15)
|
|
1340
|
+
] : lt(s, n) > 1 ? [_t(n, t), F(s, t)] : [n, s];
|
|
1341
|
+
}
|
|
1342
|
+
function Qi([i, t], n, s) {
|
|
1343
|
+
const o = (t - i) * n, a = t <= 0 && t + o > 0 ? 0 : t + o;
|
|
1346
1344
|
let r = i >= 0 && i - o < 0 ? 0 : i - o;
|
|
1347
|
-
if (
|
|
1345
|
+
if (s === p.LOG && r <= 0) {
|
|
1348
1346
|
if (i <= 0)
|
|
1349
1347
|
throw Error("Data must have values greater than 0 if log scale type is used.");
|
|
1350
1348
|
r = i;
|
|
1351
1349
|
}
|
|
1352
1350
|
return [r, a];
|
|
1353
1351
|
}
|
|
1354
|
-
class
|
|
1352
|
+
class cn extends O {
|
|
1355
1353
|
constructor() {
|
|
1356
1354
|
super(...arguments), this.curveTypes = {
|
|
1357
1355
|
curveLinear: ri,
|
|
1358
1356
|
curveLinearClosed: ai,
|
|
1359
|
-
curveBasis:
|
|
1360
|
-
curveBasisClosed:
|
|
1357
|
+
curveBasis: Oi,
|
|
1358
|
+
curveBasisClosed: Ai,
|
|
1361
1359
|
curveBasisOpen: Mi,
|
|
1362
1360
|
curveBundle: bi,
|
|
1363
1361
|
curveCardinal: Si,
|
|
@@ -1376,28 +1374,28 @@ class he extends A {
|
|
|
1376
1374
|
}
|
|
1377
1375
|
getD3Curve() {
|
|
1378
1376
|
let t = "curveLinear";
|
|
1379
|
-
const
|
|
1380
|
-
if (
|
|
1381
|
-
let
|
|
1382
|
-
return
|
|
1383
|
-
|
|
1384
|
-
}),
|
|
1377
|
+
const n = this.model.getOptions().curve;
|
|
1378
|
+
if (n && (typeof n == "string" ? t = n : t = n.name), this.curveTypes[t]) {
|
|
1379
|
+
let s = this.curveTypes[t];
|
|
1380
|
+
return n && Object.keys(n).forEach((e) => {
|
|
1381
|
+
s[e] && (s = s[e](n[e]));
|
|
1382
|
+
}), s;
|
|
1385
1383
|
}
|
|
1386
1384
|
return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`), this.curveTypes.curveLinear;
|
|
1387
1385
|
}
|
|
1388
1386
|
}
|
|
1389
|
-
class
|
|
1387
|
+
class ln extends O {
|
|
1390
1388
|
isZoomBarEnabled() {
|
|
1391
1389
|
if (!this.services.cartesianScales || !c(this.model.getOptions(), "zoomBar", "top", "enabled"))
|
|
1392
1390
|
return !1;
|
|
1393
1391
|
this.services.cartesianScales.findDomainAndRangeAxes();
|
|
1394
|
-
const t = this.services.cartesianScales.getMainXAxisPosition(),
|
|
1392
|
+
const t = this.services.cartesianScales.getMainXAxisPosition(), n = c(
|
|
1395
1393
|
this.model.getOptions(),
|
|
1396
1394
|
"axes",
|
|
1397
1395
|
t,
|
|
1398
1396
|
"scaleType"
|
|
1399
1397
|
);
|
|
1400
|
-
return t === _.BOTTOM &&
|
|
1398
|
+
return t === _.BOTTOM && n === p.TIME;
|
|
1401
1399
|
}
|
|
1402
1400
|
// get display data for zoom bar
|
|
1403
1401
|
// basically it's sum of value grouped by time
|
|
@@ -1407,83 +1405,80 @@ class ce extends A {
|
|
|
1407
1405
|
}
|
|
1408
1406
|
getDefaultZoomBarDomain(t) {
|
|
1409
1407
|
if (!this.services.zoom) throw new Error("Services zoom not defined");
|
|
1410
|
-
const
|
|
1411
|
-
if (!
|
|
1412
|
-
const
|
|
1408
|
+
const n = t || this.services.zoom.getZoomBarData(), { cartesianScales: s } = this.services;
|
|
1409
|
+
if (!s) throw new Error("Services cartesianScales undefined");
|
|
1410
|
+
const e = s.getMainXAxisPosition(), o = s.getDomainIdentifier(), a = c(this.model.getOptions(), "axes", e, "domain");
|
|
1413
1411
|
if (Array.isArray(a) && a.length === 2)
|
|
1414
1412
|
return a;
|
|
1415
|
-
if (!
|
|
1416
|
-
return
|
|
1417
|
-
|
|
1418
|
-
|
|
1413
|
+
if (!e) throw new Error("Not defined: mainXAxisPosition");
|
|
1414
|
+
return s.extendsDomain(
|
|
1415
|
+
e,
|
|
1416
|
+
mt(n, (r) => r[o])
|
|
1419
1417
|
);
|
|
1420
1418
|
}
|
|
1421
|
-
handleDomainChange(t,
|
|
1422
|
-
|
|
1423
|
-
this.model.set({ zoomDomain: t }, { animate: !1 }), e.dispatchEvent && ((n = this.services.events) == null || n.dispatchEvent(w.ZoomDomain.CHANGE, {
|
|
1419
|
+
handleDomainChange(t, n = { dispatchEvent: !0 }) {
|
|
1420
|
+
this.model.set({ zoomDomain: t }, { animate: !1 }), n.dispatchEvent && this.services.events?.dispatchEvent(w.ZoomDomain.CHANGE, {
|
|
1424
1421
|
newDomain: t
|
|
1425
|
-
})
|
|
1422
|
+
});
|
|
1426
1423
|
}
|
|
1427
1424
|
getZoomRatio() {
|
|
1428
1425
|
return c(this.model.getOptions(), "zoomBar", "zoomRatio");
|
|
1429
1426
|
}
|
|
1430
1427
|
// filter out data not inside zoom domain
|
|
1431
1428
|
// to get better range value for axis label
|
|
1432
|
-
filterDataForRangeAxis(t,
|
|
1433
|
-
|
|
1434
|
-
const n = this.model.get("zoomDomain"), s = Object.assign(
|
|
1429
|
+
filterDataForRangeAxis(t, n) {
|
|
1430
|
+
const s = this.model.get("zoomDomain"), e = Object.assign(
|
|
1435
1431
|
{ stacked: !1 },
|
|
1436
1432
|
// default configs
|
|
1437
|
-
|
|
1433
|
+
n
|
|
1438
1434
|
), o = c(this.model.getOptions(), "zoomBar", "updateRangeAxis");
|
|
1439
|
-
if (this.isZoomBarEnabled() && o &&
|
|
1440
|
-
const
|
|
1441
|
-
(
|
|
1435
|
+
if (this.isZoomBarEnabled() && o && s) {
|
|
1436
|
+
const a = e.stacked ? "sharedStackKey" : this.services.cartesianScales?.getDomainIdentifier(), r = t.filter(
|
|
1437
|
+
(h) => new Date(h[a]) >= s[0] && new Date(h[a]) <= s[1]
|
|
1442
1438
|
);
|
|
1443
|
-
if (
|
|
1444
|
-
return
|
|
1439
|
+
if (r.length > 0)
|
|
1440
|
+
return r;
|
|
1445
1441
|
}
|
|
1446
1442
|
return t;
|
|
1447
1443
|
}
|
|
1448
1444
|
zoomIn(t = this.getZoomRatio()) {
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
if (a - o < n + 1)
|
|
1445
|
+
const n = this.model.get("zoomDomain"), s = ti.handleWidth, e = this.services.cartesianScales?.getMainXScale().copy();
|
|
1446
|
+
e.domain(this.getDefaultZoomBarDomain());
|
|
1447
|
+
const o = e(n[0]), a = e(n[1]);
|
|
1448
|
+
if (a - o < s + 1)
|
|
1454
1449
|
return;
|
|
1455
|
-
const r =
|
|
1450
|
+
const r = e.range(), h = a - o, l = Math.min((r[1] - r[0]) / 2 * (t / 2), h / 2);
|
|
1456
1451
|
let f = o + l, y = a - l;
|
|
1457
|
-
f >= y && (f = o + h / 2 -
|
|
1458
|
-
const
|
|
1459
|
-
(
|
|
1452
|
+
f >= y && (f = o + h / 2 - s / 2, y = a - h / 2 + s / 2);
|
|
1453
|
+
const d = [e.invert(f), e.invert(y)];
|
|
1454
|
+
(n[0].valueOf() !== d[0].valueOf() || n[1].valueOf() !== d[1].valueOf()) && this.handleDomainChange(d);
|
|
1460
1455
|
}
|
|
1461
1456
|
zoomOut(t = this.getZoomRatio()) {
|
|
1462
|
-
const
|
|
1457
|
+
const n = this.model.get("zoomDomain");
|
|
1463
1458
|
if (!this.services.cartesianScales) throw new Error("Services cartesianScales undefined");
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
const
|
|
1467
|
-
(
|
|
1459
|
+
const s = this.services.cartesianScales.getMainXScale().copy();
|
|
1460
|
+
s.domain(this.getDefaultZoomBarDomain());
|
|
1461
|
+
const e = s(n[0]), o = s(n[1]), a = s.range(), r = (a[1] - a[0]) / 2 * (t / 2), h = Math.max(e - r, a[0]), l = Math.min(o + r, a[1]), f = [s.invert(h), s.invert(l)];
|
|
1462
|
+
(n[0].valueOf() !== f[0].valueOf() || n[1].valueOf() !== f[1].valueOf()) && this.handleDomainChange(f);
|
|
1468
1463
|
}
|
|
1469
1464
|
resetZoomDomain() {
|
|
1470
|
-
const t = this.model.get("zoomDomain"),
|
|
1471
|
-
(t[0].valueOf() !==
|
|
1465
|
+
const t = this.model.get("zoomDomain"), n = this.getDefaultZoomBarDomain();
|
|
1466
|
+
(t[0].valueOf() !== n[0].valueOf() || t[1].valueOf() !== n[1].valueOf()) && this.handleDomainChange(n);
|
|
1472
1467
|
}
|
|
1473
1468
|
// check if current zoom domain is already the min zoom domain
|
|
1474
1469
|
// when toolbar is rendered, we don't render chart yet
|
|
1475
1470
|
// don't depend on scale range
|
|
1476
1471
|
isMinZoomDomain() {
|
|
1477
|
-
const t = this.model.get("zoomDomain"),
|
|
1478
|
-
if (!t || !
|
|
1472
|
+
const t = this.model.get("zoomDomain"), n = this.getDefaultZoomBarDomain();
|
|
1473
|
+
if (!t || !n)
|
|
1479
1474
|
return !1;
|
|
1480
|
-
const
|
|
1481
|
-
return
|
|
1475
|
+
const s = t[1].valueOf() - t[0].valueOf(), e = n[1].valueOf() - n[0].valueOf(), o = c(this.model.getOptions(), "zoomBar", "minZoomRatio");
|
|
1476
|
+
return s / e < o;
|
|
1482
1477
|
}
|
|
1483
1478
|
// check if current zoom domain is already the max zoom domain
|
|
1484
1479
|
isMaxZoomDomain() {
|
|
1485
|
-
const t = this.model.get("zoomDomain"),
|
|
1486
|
-
return !!(t &&
|
|
1480
|
+
const t = this.model.get("zoomDomain"), n = this.getDefaultZoomBarDomain();
|
|
1481
|
+
return !!(t && n && t[0].valueOf() === n[0].valueOf() && t[1].valueOf() === n[1].valueOf());
|
|
1487
1482
|
}
|
|
1488
1483
|
isEmptyState() {
|
|
1489
1484
|
return this.getZoomBarData().length === 0;
|
|
@@ -1496,14 +1491,14 @@ class ce extends A {
|
|
|
1496
1491
|
}
|
|
1497
1492
|
}
|
|
1498
1493
|
export {
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1494
|
+
en as C,
|
|
1495
|
+
on as E,
|
|
1496
|
+
an as F,
|
|
1497
|
+
rn as T,
|
|
1498
|
+
ln as Z,
|
|
1499
|
+
cn as a,
|
|
1505
1500
|
ci as b,
|
|
1506
|
-
|
|
1507
|
-
|
|
1501
|
+
hn as c,
|
|
1502
|
+
dt as f
|
|
1508
1503
|
};
|
|
1509
|
-
//# sourceMappingURL=index-
|
|
1504
|
+
//# sourceMappingURL=index-BILVb6NZ.mjs.map
|