@reside-ic/skadi-chart 1.1.6 → 1.1.7-alpha.0
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/skadi-chart.d.ts +2 -0
- package/dist/skadi-chart.js +436 -433
- package/dist/skadi-chart.umd.cjs +3 -3
- package/package.json +1 -1
package/dist/skadi-chart.js
CHANGED
|
@@ -155,11 +155,11 @@ function eB(A, t) {
|
|
|
155
155
|
var e = t ? AB : jo, r = this._parents, n = this._groups;
|
|
156
156
|
typeof A != "function" && (A = qo(A));
|
|
157
157
|
for (var i = n.length, s = new Array(i), o = new Array(i), a = new Array(i), B = 0; B < i; ++B) {
|
|
158
|
-
var c = r[B], u = n[B], l = u.length, f = rB(A.call(c, c && c.__data__, B, r)), g = f.length,
|
|
159
|
-
e(c, u,
|
|
160
|
-
for (var
|
|
161
|
-
if (p = Q
|
|
162
|
-
for (
|
|
158
|
+
var c = r[B], u = n[B], l = u.length, f = rB(A.call(c, c && c.__data__, B, r)), g = f.length, C = o[B] = new Array(g), h = s[B] = new Array(g), w = a[B] = new Array(l);
|
|
159
|
+
e(c, u, C, h, w, f, t);
|
|
160
|
+
for (var Q = 0, U = 0, p, F; Q < g; ++Q)
|
|
161
|
+
if (p = C[Q]) {
|
|
162
|
+
for (Q >= U && (U = Q + 1); !(F = h[U]) && ++U < g; ) ;
|
|
163
163
|
p._next = F || null;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -1239,8 +1239,8 @@ function ga(A, t, e, r) {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
function i(B, c, u, l, f, g) {
|
|
1241
1241
|
if (B !== u || c !== l) {
|
|
1242
|
-
var
|
|
1243
|
-
g.push({ i:
|
|
1242
|
+
var C = f.push("translate(", null, t, null, e);
|
|
1243
|
+
g.push({ i: C - 4, x: FA(B, u) }, { i: C - 2, x: FA(c, l) });
|
|
1244
1244
|
} else (u || l) && f.push("translate(" + u + t + l + e);
|
|
1245
1245
|
}
|
|
1246
1246
|
function s(B, c, u, l) {
|
|
@@ -1251,14 +1251,14 @@ function ga(A, t, e, r) {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
function a(B, c, u, l, f, g) {
|
|
1253
1253
|
if (B !== u || c !== l) {
|
|
1254
|
-
var
|
|
1255
|
-
g.push({ i:
|
|
1254
|
+
var C = f.push(n(f) + "scale(", null, ",", null, ")");
|
|
1255
|
+
g.push({ i: C - 4, x: FA(B, u) }, { i: C - 2, x: FA(c, l) });
|
|
1256
1256
|
} else (u !== 1 || l !== 1) && f.push(n(f) + "scale(" + u + "," + l + ")");
|
|
1257
1257
|
}
|
|
1258
1258
|
return function(B, c) {
|
|
1259
1259
|
var u = [], l = [];
|
|
1260
1260
|
return B = A(B), c = A(c), i(B.translateX, B.translateY, c.translateX, c.translateY, u, l), s(B.rotate, c.rotate, u, l), o(B.skewX, c.skewX, u, l), a(B.scaleX, B.scaleY, c.scaleX, c.scaleY, u, l), B = c = null, function(f) {
|
|
1261
|
-
for (var g = -1,
|
|
1261
|
+
for (var g = -1, C = l.length, h; ++g < C; ) u[(h = l[g]).i] = h.x(f);
|
|
1262
1262
|
return u.join("");
|
|
1263
1263
|
};
|
|
1264
1264
|
};
|
|
@@ -1501,8 +1501,8 @@ function Lu(A) {
|
|
|
1501
1501
|
for (var r = this._groups, n = r.length, i = [], s = [], o = 0; o < n; ++o)
|
|
1502
1502
|
for (var a = r[o], B = a.length, c, u = 0; u < B; ++u)
|
|
1503
1503
|
if (c = a[u]) {
|
|
1504
|
-
for (var l = A.call(c, c.__data__, u, a), f, g = vA(c, e),
|
|
1505
|
-
(f = l[
|
|
1504
|
+
for (var l = A.call(c, c.__data__, u, a), f, g = vA(c, e), C = 0, h = l.length; C < h; ++C)
|
|
1505
|
+
(f = l[C]) && or(f, t, e, C, l, g);
|
|
1506
1506
|
i.push(l), s.push(c);
|
|
1507
1507
|
}
|
|
1508
1508
|
return new MA(i, s, t, e);
|
|
@@ -1719,15 +1719,15 @@ function il() {
|
|
|
1719
1719
|
function da(A, t) {
|
|
1720
1720
|
var e = [], r = null, n = null, i = 6, s = 6, o = 3, a = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, B = A === vr || A === _t ? -1 : 1, c = A === _t || A === yr ? "x" : "y", u = A === vr || A === cn ? tl : el;
|
|
1721
1721
|
function l(f) {
|
|
1722
|
-
var g = r ?? (t.ticks ? t.ticks.apply(t, e) : t.domain()),
|
|
1723
|
-
d = d.merge(d.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), y = y.merge(E), L = L.merge(E.append("line").attr("stroke", "currentColor").attr(c + "2", B * i)), m = m.merge(E.append("text").attr("fill", "currentColor").attr(c, B * h).attr("dy", A === vr ? "0em" : A === cn ? "0.71em" : "0.32em")), f !== F && (d = d.transition(f), y = y.transition(f), L = L.transition(f), m = m.transition(f), v = v.transition(f).attr("opacity", Hi).attr("transform", function(
|
|
1724
|
-
return isFinite(
|
|
1725
|
-
}), E.attr("opacity", Hi).attr("transform", function(
|
|
1722
|
+
var g = r ?? (t.ticks ? t.ticks.apply(t, e) : t.domain()), C = n ?? (t.tickFormat ? t.tickFormat.apply(t, e) : Al), h = Math.max(i, 0) + o, w = t.range(), Q = +w[0] + a, U = +w[w.length - 1] + a, p = (t.bandwidth ? nl : rl)(t.copy(), a), F = f.selection ? f.selection() : f, d = F.selectAll(".domain").data([null]), y = F.selectAll(".tick").data(g, t).order(), v = y.exit(), E = y.enter().append("g").attr("class", "tick"), L = y.select("line"), m = y.select("text");
|
|
1723
|
+
d = d.merge(d.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), y = y.merge(E), L = L.merge(E.append("line").attr("stroke", "currentColor").attr(c + "2", B * i)), m = m.merge(E.append("text").attr("fill", "currentColor").attr(c, B * h).attr("dy", A === vr ? "0em" : A === cn ? "0.71em" : "0.32em")), f !== F && (d = d.transition(f), y = y.transition(f), L = L.transition(f), m = m.transition(f), v = v.transition(f).attr("opacity", Hi).attr("transform", function(K) {
|
|
1724
|
+
return isFinite(K = p(K)) ? u(K + a) : this.getAttribute("transform");
|
|
1725
|
+
}), E.attr("opacity", Hi).attr("transform", function(K) {
|
|
1726
1726
|
var I = this.parentNode.__axis;
|
|
1727
|
-
return u((I && isFinite(I = I(
|
|
1728
|
-
})), v.remove(), d.attr("d", A === _t || A === yr ? s ? "M" + B * s + "," +
|
|
1729
|
-
return u(p(
|
|
1730
|
-
}), L.attr(c + "2", B * i), m.attr(c, B * h).text(
|
|
1727
|
+
return u((I && isFinite(I = I(K)) ? I : p(K)) + a);
|
|
1728
|
+
})), v.remove(), d.attr("d", A === _t || A === yr ? s ? "M" + B * s + "," + Q + "H" + a + "V" + U + "H" + B * s : "M" + a + "," + Q + "V" + U : s ? "M" + Q + "," + B * s + "V" + a + "H" + U + "V" + B * s : "M" + Q + "," + a + "H" + U), y.attr("opacity", 1).attr("transform", function(K) {
|
|
1729
|
+
return u(p(K) + a);
|
|
1730
|
+
}), L.attr(c + "2", B * i), m.attr(c, B * h).text(C), F.filter(il).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", A === yr ? "start" : A === _t ? "end" : "middle"), F.each(function() {
|
|
1731
1731
|
this.__axis = p;
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
@@ -1887,21 +1887,21 @@ function dl() {
|
|
|
1887
1887
|
function Ul(A) {
|
|
1888
1888
|
var t = wl, e = hl, r = Ql, n = !0, i = Yn("start", "brush", "end"), s = 6, o;
|
|
1889
1889
|
function a(h) {
|
|
1890
|
-
var w = h.property("__brush",
|
|
1890
|
+
var w = h.property("__brush", C).selectAll(".overlay").data([gn("overlay")]);
|
|
1891
1891
|
w.enter().append("rect").attr("class", "overlay").attr("pointer-events", "all").attr("cursor", bA.overlay).merge(w).each(function() {
|
|
1892
1892
|
var U = Lr(this).extent;
|
|
1893
1893
|
DA(this).attr("x", U[0][0]).attr("y", U[0][1]).attr("width", U[1][0] - U[0][0]).attr("height", U[1][1] - U[0][1]);
|
|
1894
1894
|
}), h.selectAll(".selection").data([gn("selection")]).enter().append("rect").attr("class", "selection").attr("cursor", bA.selection).attr("fill", "#777").attr("fill-opacity", 0.3).attr("stroke", "#fff").attr("shape-rendering", "crispEdges");
|
|
1895
|
-
var
|
|
1895
|
+
var Q = h.selectAll(".handle").data(A.handles, function(U) {
|
|
1896
1896
|
return U.type;
|
|
1897
1897
|
});
|
|
1898
|
-
|
|
1898
|
+
Q.exit().remove(), Q.enter().append("rect").attr("class", function(U) {
|
|
1899
1899
|
return "handle handle--" + U.type;
|
|
1900
1900
|
}).attr("cursor", function(U) {
|
|
1901
1901
|
return bA[U.type];
|
|
1902
1902
|
}), h.each(B).attr("fill", "none").attr("pointer-events", "all").on("mousedown.brush", l).filter(r).on("touchstart.brush", l).on("touchmove.brush", f).on("touchend.brush touchcancel.brush", g).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
1903
1903
|
}
|
|
1904
|
-
a.move = function(h, w,
|
|
1904
|
+
a.move = function(h, w, Q) {
|
|
1905
1905
|
h.tween ? h.on("start.brush", function(U) {
|
|
1906
1906
|
c(this, arguments).beforestart().start(U);
|
|
1907
1907
|
}).on("interrupt.brush end.brush", function(U) {
|
|
@@ -1914,29 +1914,29 @@ function Ul(A) {
|
|
|
1914
1914
|
return d !== null && y !== null ? E : E(1);
|
|
1915
1915
|
}) : h.each(function() {
|
|
1916
1916
|
var U = this, p = arguments, F = U.__brush, d = A.input(typeof w == "function" ? w.apply(U, p) : w, F.extent), y = c(U, p).beforestart();
|
|
1917
|
-
sn(U), F.selection = d === null ? null : d, B.call(U), y.start(
|
|
1917
|
+
sn(U), F.selection = d === null ? null : d, B.call(U), y.start(Q).brush(Q).end(Q);
|
|
1918
1918
|
});
|
|
1919
1919
|
}, a.clear = function(h, w) {
|
|
1920
1920
|
a.move(h, null, w);
|
|
1921
1921
|
};
|
|
1922
1922
|
function B() {
|
|
1923
1923
|
var h = DA(this), w = Lr(this).selection;
|
|
1924
|
-
w ? (h.selectAll(".selection").style("display", null).attr("x", w[0][0]).attr("y", w[0][1]).attr("width", w[1][0] - w[0][0]).attr("height", w[1][1] - w[0][1]), h.selectAll(".handle").style("display", null).attr("x", function(
|
|
1925
|
-
return
|
|
1926
|
-
}).attr("y", function(
|
|
1927
|
-
return
|
|
1928
|
-
}).attr("width", function(
|
|
1929
|
-
return
|
|
1930
|
-
}).attr("height", function(
|
|
1931
|
-
return
|
|
1924
|
+
w ? (h.selectAll(".selection").style("display", null).attr("x", w[0][0]).attr("y", w[0][1]).attr("width", w[1][0] - w[0][0]).attr("height", w[1][1] - w[0][1]), h.selectAll(".handle").style("display", null).attr("x", function(Q) {
|
|
1925
|
+
return Q.type[Q.type.length - 1] === "e" ? w[1][0] - s / 2 : w[0][0] - s / 2;
|
|
1926
|
+
}).attr("y", function(Q) {
|
|
1927
|
+
return Q.type[0] === "s" ? w[1][1] - s / 2 : w[0][1] - s / 2;
|
|
1928
|
+
}).attr("width", function(Q) {
|
|
1929
|
+
return Q.type === "n" || Q.type === "s" ? w[1][0] - w[0][0] + s : s;
|
|
1930
|
+
}).attr("height", function(Q) {
|
|
1931
|
+
return Q.type === "e" || Q.type === "w" ? w[1][1] - w[0][1] + s : s;
|
|
1932
1932
|
})) : h.selectAll(".selection,.handle").style("display", "none").attr("x", null).attr("y", null).attr("width", null).attr("height", null);
|
|
1933
1933
|
}
|
|
1934
|
-
function c(h, w,
|
|
1934
|
+
function c(h, w, Q) {
|
|
1935
1935
|
var U = h.__brush.emitter;
|
|
1936
|
-
return U && (!
|
|
1936
|
+
return U && (!Q || !U.clean) ? U : new u(h, w, Q);
|
|
1937
1937
|
}
|
|
1938
|
-
function u(h, w,
|
|
1939
|
-
this.that = h, this.args = w, this.state = h.__brush, this.active = 0, this.clean =
|
|
1938
|
+
function u(h, w, Q) {
|
|
1939
|
+
this.that = h, this.args = w, this.state = h.__brush, this.active = 0, this.clean = Q;
|
|
1940
1940
|
}
|
|
1941
1941
|
u.prototype = {
|
|
1942
1942
|
beforestart: function() {
|
|
@@ -1951,7 +1951,7 @@ function Ul(A) {
|
|
|
1951
1951
|
end: function(h, w) {
|
|
1952
1952
|
return --this.active === 0 && (delete this.state.emitter, this.emit("end", h, w)), this;
|
|
1953
1953
|
},
|
|
1954
|
-
emit: function(h, w,
|
|
1954
|
+
emit: function(h, w, Q) {
|
|
1955
1955
|
var U = DA(this.that).datum();
|
|
1956
1956
|
i.call(
|
|
1957
1957
|
h,
|
|
@@ -1960,7 +1960,7 @@ function Ul(A) {
|
|
|
1960
1960
|
sourceEvent: w,
|
|
1961
1961
|
target: a,
|
|
1962
1962
|
selection: A.output(this.state.selection),
|
|
1963
|
-
mode:
|
|
1963
|
+
mode: Q,
|
|
1964
1964
|
dispatch: i
|
|
1965
1965
|
}),
|
|
1966
1966
|
U
|
|
@@ -1969,26 +1969,26 @@ function Ul(A) {
|
|
|
1969
1969
|
};
|
|
1970
1970
|
function l(h) {
|
|
1971
1971
|
if (o && !h.touches || !e.apply(this, arguments)) return;
|
|
1972
|
-
var w = this,
|
|
1973
|
-
const
|
|
1974
|
-
return
|
|
1972
|
+
var w = this, Q = h.target.__data__.type, U = (n && h.metaKey ? Q = "overlay" : Q) === "selection" ? Ii : n && h.altKey ? at : st, p = A === xr ? null : fl[Q], F = A === Ir ? null : gl[Q], d = Lr(w), y = d.extent, v = d.selection, E = y[0][0], L, m, K = y[0][1], I, b, Y = y[1][0], M, _, X = y[1][1], D, O, V = 0, N = 0, nA, tA = p && F && n && h.shiftKey, BA, dA, $ = Array.from(h.touches || [h], (T) => {
|
|
1973
|
+
const q = T.identifier;
|
|
1974
|
+
return T = tn(T, w), T.point0 = T.slice(), T.identifier = q, T;
|
|
1975
1975
|
});
|
|
1976
1976
|
sn(w);
|
|
1977
1977
|
var Ht = c(w, arguments, !0).beforestart();
|
|
1978
|
-
if (
|
|
1979
|
-
v && (
|
|
1980
|
-
const
|
|
1978
|
+
if (Q === "overlay") {
|
|
1979
|
+
v && (nA = !0);
|
|
1980
|
+
const T = [$[0], $[1] || $[0]];
|
|
1981
1981
|
d.selection = v = [[
|
|
1982
|
-
L = A === xr ? E : sA(
|
|
1983
|
-
I = A === Ir ?
|
|
1982
|
+
L = A === xr ? E : sA(T[0][0], T[1][0]),
|
|
1983
|
+
I = A === Ir ? K : sA(T[0][1], T[1][1])
|
|
1984
1984
|
], [
|
|
1985
|
-
|
|
1986
|
-
|
|
1985
|
+
M = A === xr ? Y : iA(T[0][0], T[1][0]),
|
|
1986
|
+
D = A === Ir ? X : iA(T[0][1], T[1][1])
|
|
1987
1987
|
]], $.length > 1 && ZA(h);
|
|
1988
1988
|
} else
|
|
1989
|
-
L = v[0][0], I = v[0][1],
|
|
1990
|
-
m = L, b = I,
|
|
1991
|
-
var oi = DA(w).attr("pointer-events", "none"), It = oi.selectAll(".overlay").attr("cursor", bA[
|
|
1989
|
+
L = v[0][0], I = v[0][1], M = v[1][0], D = v[1][1];
|
|
1990
|
+
m = L, b = I, _ = M, O = D;
|
|
1991
|
+
var oi = DA(w).attr("pointer-events", "none"), It = oi.selectAll(".overlay").attr("cursor", bA[Q]);
|
|
1992
1992
|
if (h.touches)
|
|
1993
1993
|
Ht.moved = ci, Ht.ended = ui;
|
|
1994
1994
|
else {
|
|
@@ -1996,85 +1996,85 @@ function Ul(A) {
|
|
|
1996
1996
|
n && Bi.on("keydown.brush", Ko, !0).on("keyup.brush", So, !0), ol(h.view);
|
|
1997
1997
|
}
|
|
1998
1998
|
B.call(w), Ht.start(h, U.name);
|
|
1999
|
-
function ci(
|
|
2000
|
-
for (const
|
|
1999
|
+
function ci(T) {
|
|
2000
|
+
for (const q of T.changedTouches || [T])
|
|
2001
2001
|
for (const xt of $)
|
|
2002
|
-
xt.identifier ===
|
|
2003
|
-
if (
|
|
2004
|
-
const
|
|
2005
|
-
xi(
|
|
2002
|
+
xt.identifier === q.identifier && (xt.cur = tn(q, w));
|
|
2003
|
+
if (tA && !BA && !dA && $.length === 1) {
|
|
2004
|
+
const q = $[0];
|
|
2005
|
+
xi(q.cur[0] - q[0]) > xi(q.cur[1] - q[1]) ? dA = !0 : BA = !0;
|
|
2006
2006
|
}
|
|
2007
|
-
for (const
|
|
2008
|
-
|
|
2009
|
-
|
|
2007
|
+
for (const q of $)
|
|
2008
|
+
q.cur && (q[0] = q.cur[0], q[1] = q.cur[1]);
|
|
2009
|
+
nA = !0, mr(T), ZA(T);
|
|
2010
2010
|
}
|
|
2011
|
-
function ZA(
|
|
2012
|
-
const
|
|
2011
|
+
function ZA(T) {
|
|
2012
|
+
const q = $[0], xt = q.point0;
|
|
2013
2013
|
var OA;
|
|
2014
|
-
switch (
|
|
2014
|
+
switch (V = q[0] - xt[0], N = q[1] - xt[1], U) {
|
|
2015
2015
|
case Hr:
|
|
2016
2016
|
case Ii: {
|
|
2017
|
-
p && (
|
|
2017
|
+
p && (V = iA(E - L, sA(Y - M, V)), m = L + V, _ = M + V), F && (N = iA(K - I, sA(X - D, N)), b = I + N, O = D + N);
|
|
2018
2018
|
break;
|
|
2019
2019
|
}
|
|
2020
2020
|
case st: {
|
|
2021
|
-
$[1] ? (p && (m = iA(E, sA(Y, $[0][0])),
|
|
2021
|
+
$[1] ? (p && (m = iA(E, sA(Y, $[0][0])), _ = iA(E, sA(Y, $[1][0])), p = 1), F && (b = iA(K, sA(X, $[0][1])), O = iA(K, sA(X, $[1][1])), F = 1)) : (p < 0 ? (V = iA(E - L, sA(Y - L, V)), m = L + V, _ = M) : p > 0 && (V = iA(E - M, sA(Y - M, V)), m = L, _ = M + V), F < 0 ? (N = iA(K - I, sA(X - I, N)), b = I + N, O = D) : F > 0 && (N = iA(K - D, sA(X - D, N)), b = I, O = D + N));
|
|
2022
2022
|
break;
|
|
2023
2023
|
}
|
|
2024
2024
|
case at: {
|
|
2025
|
-
p && (m = iA(E, sA(Y, L -
|
|
2025
|
+
p && (m = iA(E, sA(Y, L - V * p)), _ = iA(E, sA(Y, M + V * p))), F && (b = iA(K, sA(X, I - N * F)), O = iA(K, sA(X, D + N * F)));
|
|
2026
2026
|
break;
|
|
2027
2027
|
}
|
|
2028
2028
|
}
|
|
2029
|
-
|
|
2029
|
+
_ < m && (p *= -1, OA = L, L = M, M = OA, OA = m, m = _, _ = OA, Q in bi && It.attr("cursor", bA[Q = bi[Q]])), O < b && (F *= -1, OA = I, I = D, D = OA, OA = b, b = O, O = OA, Q in Ki && It.attr("cursor", bA[Q = Ki[Q]])), d.selection && (v = d.selection), BA && (m = v[0][0], _ = v[1][0]), dA && (b = v[0][1], O = v[1][1]), (v[0][0] !== m || v[0][1] !== b || v[1][0] !== _ || v[1][1] !== O) && (d.selection = [[m, b], [_, O]], B.call(w), Ht.brush(T, U.name));
|
|
2030
2030
|
}
|
|
2031
|
-
function ui(
|
|
2032
|
-
if (ul(
|
|
2033
|
-
if (
|
|
2031
|
+
function ui(T) {
|
|
2032
|
+
if (ul(T), T.touches) {
|
|
2033
|
+
if (T.touches.length) return;
|
|
2034
2034
|
o && clearTimeout(o), o = setTimeout(function() {
|
|
2035
2035
|
o = null;
|
|
2036
2036
|
}, 500);
|
|
2037
2037
|
} else
|
|
2038
|
-
Bl(
|
|
2039
|
-
oi.attr("pointer-events", "all"), It.attr("cursor", bA.overlay), d.selection && (v = d.selection), Cl(v) && (d.selection = null, B.call(w)), Ht.end(
|
|
2038
|
+
Bl(T.view, nA), Bi.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null);
|
|
2039
|
+
oi.attr("pointer-events", "all"), It.attr("cursor", bA.overlay), d.selection && (v = d.selection), Cl(v) && (d.selection = null, B.call(w)), Ht.end(T, U.name);
|
|
2040
2040
|
}
|
|
2041
|
-
function Ko(
|
|
2042
|
-
switch (
|
|
2041
|
+
function Ko(T) {
|
|
2042
|
+
switch (T.keyCode) {
|
|
2043
2043
|
case 16: {
|
|
2044
|
-
|
|
2044
|
+
tA = p && F;
|
|
2045
2045
|
break;
|
|
2046
2046
|
}
|
|
2047
2047
|
case 18: {
|
|
2048
|
-
U === st && (p && (
|
|
2048
|
+
U === st && (p && (M = _ - V * p, L = m + V * p), F && (D = O - N * F, I = b + N * F), U = at, ZA(T));
|
|
2049
2049
|
break;
|
|
2050
2050
|
}
|
|
2051
2051
|
case 32: {
|
|
2052
|
-
(U === st || U === at) && (p < 0 ?
|
|
2052
|
+
(U === st || U === at) && (p < 0 ? M = _ - V : p > 0 && (L = m - V), F < 0 ? D = O - N : F > 0 && (I = b - N), U = Hr, It.attr("cursor", bA.selection), ZA(T));
|
|
2053
2053
|
break;
|
|
2054
2054
|
}
|
|
2055
2055
|
default:
|
|
2056
2056
|
return;
|
|
2057
2057
|
}
|
|
2058
|
-
mr(
|
|
2058
|
+
mr(T);
|
|
2059
2059
|
}
|
|
2060
|
-
function So(
|
|
2061
|
-
switch (
|
|
2060
|
+
function So(T) {
|
|
2061
|
+
switch (T.keyCode) {
|
|
2062
2062
|
case 16: {
|
|
2063
|
-
|
|
2063
|
+
tA && (BA = dA = tA = !1, ZA(T));
|
|
2064
2064
|
break;
|
|
2065
2065
|
}
|
|
2066
2066
|
case 18: {
|
|
2067
|
-
U === at && (p < 0 ?
|
|
2067
|
+
U === at && (p < 0 ? M = _ : p > 0 && (L = m), F < 0 ? D = O : F > 0 && (I = b), U = st, ZA(T));
|
|
2068
2068
|
break;
|
|
2069
2069
|
}
|
|
2070
2070
|
case 32: {
|
|
2071
|
-
U === Hr && (
|
|
2071
|
+
U === Hr && (T.altKey ? (p && (M = _ - V * p, L = m + V * p), F && (D = O - N * F, I = b + N * F), U = at) : (p < 0 ? M = _ : p > 0 && (L = m), F < 0 ? D = O : F > 0 && (I = b), U = st), It.attr("cursor", bA[Q]), ZA(T));
|
|
2072
2072
|
break;
|
|
2073
2073
|
}
|
|
2074
2074
|
default:
|
|
2075
2075
|
return;
|
|
2076
2076
|
}
|
|
2077
|
-
mr(
|
|
2077
|
+
mr(T);
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
2080
|
function f(h) {
|
|
@@ -2083,7 +2083,7 @@ function Ul(A) {
|
|
|
2083
2083
|
function g(h) {
|
|
2084
2084
|
c(this, arguments).ended(h);
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2086
|
+
function C() {
|
|
2087
2087
|
var h = this.__brush || { selection: null };
|
|
2088
2088
|
return h.extent = fn(t.apply(this, arguments)), h.dim = A, h;
|
|
2089
2089
|
}
|
|
@@ -2252,8 +2252,8 @@ function pa() {
|
|
|
2252
2252
|
var A = Fa().unknown(void 0), t = A.domain, e = A.range, r = 0, n = 1, i, s, o = !1, a = 0, B = 0, c = 0.5;
|
|
2253
2253
|
delete A.unknown;
|
|
2254
2254
|
function u() {
|
|
2255
|
-
var l = t().length, f = n < r, g = f ? n : r,
|
|
2256
|
-
i = (
|
|
2255
|
+
var l = t().length, f = n < r, g = f ? n : r, C = f ? r : n;
|
|
2256
|
+
i = (C - g) / Math.max(1, l - a + B * 2), o && (i = Math.floor(i)), g += (C - g - i * (l - a)) * c, s = i * (1 - a), o && (g = Math.round(g), s = Math.round(s));
|
|
2257
2257
|
var h = Sl(l).map(function(w) {
|
|
2258
2258
|
return g + i * w;
|
|
2259
2259
|
});
|
|
@@ -2458,39 +2458,39 @@ function Jl(A) {
|
|
|
2458
2458
|
var t = A.grouping === void 0 || A.thousands === void 0 ? Ri : Gl(Ni.call(A.grouping, Number), A.thousands + ""), e = A.currency === void 0 ? "" : A.currency[0] + "", r = A.currency === void 0 ? "" : A.currency[1] + "", n = A.decimal === void 0 ? "." : A.decimal + "", i = A.numerals === void 0 ? Ri : Vl(Ni.call(A.numerals, String)), s = A.percent === void 0 ? "%" : A.percent + "", o = A.minus === void 0 ? "−" : A.minus + "", a = A.nan === void 0 ? "NaN" : A.nan + "";
|
|
2459
2459
|
function B(u) {
|
|
2460
2460
|
u = jt(u);
|
|
2461
|
-
var l = u.fill, f = u.align, g = u.sign,
|
|
2462
|
-
F === "n" ? (
|
|
2463
|
-
var d =
|
|
2461
|
+
var l = u.fill, f = u.align, g = u.sign, C = u.symbol, h = u.zero, w = u.width, Q = u.comma, U = u.precision, p = u.trim, F = u.type;
|
|
2462
|
+
F === "n" ? (Q = !0, F = "g") : Oi[F] || (U === void 0 && (U = 12), p = !0, F = "g"), (h || l === "0" && f === "=") && (h = !0, l = "0", f = "=");
|
|
2463
|
+
var d = C === "$" ? e : C === "#" && /[boxX]/.test(F) ? "0" + F.toLowerCase() : "", y = C === "$" ? r : /[%p]/.test(F) ? s : "", v = Oi[F], E = /[defgprs%]/.test(F);
|
|
2464
2464
|
U = U === void 0 ? 6 : /[gprs]/.test(F) ? Math.max(1, Math.min(21, U)) : Math.max(0, Math.min(20, U));
|
|
2465
2465
|
function L(m) {
|
|
2466
|
-
var
|
|
2466
|
+
var K = d, I = y, b, Y, M;
|
|
2467
2467
|
if (F === "c")
|
|
2468
2468
|
I = v(m) + I, m = "";
|
|
2469
2469
|
else {
|
|
2470
2470
|
m = +m;
|
|
2471
|
-
var
|
|
2472
|
-
if (m = isNaN(m) ? a : v(Math.abs(m), U), p && (m = Pl(m)),
|
|
2471
|
+
var _ = m < 0 || 1 / m < 0;
|
|
2472
|
+
if (m = isNaN(m) ? a : v(Math.abs(m), U), p && (m = Pl(m)), _ && +m == 0 && g !== "+" && (_ = !1), K = (_ ? g === "(" ? g : o : g === "-" || g === "(" ? "" : g) + K, I = (F === "s" ? Gi[8 + Ea / 3] : "") + I + (_ && g === "(" ? ")" : ""), E) {
|
|
2473
2473
|
for (b = -1, Y = m.length; ++b < Y; )
|
|
2474
|
-
if (
|
|
2475
|
-
I = (
|
|
2474
|
+
if (M = m.charCodeAt(b), 48 > M || M > 57) {
|
|
2475
|
+
I = (M === 46 ? n + m.slice(b + 1) : m.slice(b)) + I, m = m.slice(0, b);
|
|
2476
2476
|
break;
|
|
2477
2477
|
}
|
|
2478
2478
|
}
|
|
2479
2479
|
}
|
|
2480
|
-
|
|
2481
|
-
var X =
|
|
2482
|
-
switch (
|
|
2480
|
+
Q && !h && (m = t(m, 1 / 0));
|
|
2481
|
+
var X = K.length + m.length + I.length, D = X < w ? new Array(w - X + 1).join(l) : "";
|
|
2482
|
+
switch (Q && h && (m = t(D + m, D.length ? w - I.length : 1 / 0), D = ""), f) {
|
|
2483
2483
|
case "<":
|
|
2484
|
-
m =
|
|
2484
|
+
m = K + m + I + D;
|
|
2485
2485
|
break;
|
|
2486
2486
|
case "=":
|
|
2487
|
-
m =
|
|
2487
|
+
m = K + D + m + I;
|
|
2488
2488
|
break;
|
|
2489
2489
|
case "^":
|
|
2490
|
-
m =
|
|
2490
|
+
m = D.slice(0, X = D.length >> 1) + K + m + I + D.slice(X);
|
|
2491
2491
|
break;
|
|
2492
2492
|
default:
|
|
2493
|
-
m =
|
|
2493
|
+
m = D + K + m + I;
|
|
2494
2494
|
break;
|
|
2495
2495
|
}
|
|
2496
2496
|
return i(m);
|
|
@@ -2500,9 +2500,9 @@ function Jl(A) {
|
|
|
2500
2500
|
}, L;
|
|
2501
2501
|
}
|
|
2502
2502
|
function c(u, l) {
|
|
2503
|
-
var f = B((u = jt(u), u.type = "f", u)), g = Math.max(-8, Math.min(8, Math.floor(vt(l) / 3))) * 3,
|
|
2503
|
+
var f = B((u = jt(u), u.type = "f", u)), g = Math.max(-8, Math.min(8, Math.floor(vt(l) / 3))) * 3, C = Math.pow(10, -g), h = Gi[8 + g / 3];
|
|
2504
2504
|
return function(w) {
|
|
2505
|
-
return f(
|
|
2505
|
+
return f(C * w) + h;
|
|
2506
2506
|
};
|
|
2507
2507
|
}
|
|
2508
2508
|
return {
|
|
@@ -2626,22 +2626,22 @@ function sf(A) {
|
|
|
2626
2626
|
let B = a[0], c = a[a.length - 1];
|
|
2627
2627
|
const u = c < B;
|
|
2628
2628
|
u && ([B, c] = [c, B]);
|
|
2629
|
-
let l = n(B), f = n(c), g,
|
|
2629
|
+
let l = n(B), f = n(c), g, C;
|
|
2630
2630
|
const h = o == null ? 10 : +o;
|
|
2631
2631
|
let w = [];
|
|
2632
2632
|
if (!(r % 1) && f - l < h) {
|
|
2633
2633
|
if (l = Math.floor(l), f = Math.ceil(f), B > 0) {
|
|
2634
2634
|
for (; l <= f; ++l)
|
|
2635
2635
|
for (g = 1; g < r; ++g)
|
|
2636
|
-
if (
|
|
2637
|
-
if (
|
|
2638
|
-
w.push(
|
|
2636
|
+
if (C = l < 0 ? g / i(-l) : g * i(l), !(C < B)) {
|
|
2637
|
+
if (C > c) break;
|
|
2638
|
+
w.push(C);
|
|
2639
2639
|
}
|
|
2640
2640
|
} else for (; l <= f; ++l)
|
|
2641
2641
|
for (g = r - 1; g >= 1; --g)
|
|
2642
|
-
if (
|
|
2643
|
-
if (
|
|
2644
|
-
w.push(
|
|
2642
|
+
if (C = l > 0 ? g / i(-l) : g * i(l), !(C < B)) {
|
|
2643
|
+
if (C > c) break;
|
|
2644
|
+
w.push(C);
|
|
2645
2645
|
}
|
|
2646
2646
|
w.length * 2 < h && (w = hn(B, c, h));
|
|
2647
2647
|
} else
|
|
@@ -2664,7 +2664,7 @@ function dn() {
|
|
|
2664
2664
|
return A.copy = () => va(A, dn()).base(A.base()), cr.apply(A, arguments), A;
|
|
2665
2665
|
}
|
|
2666
2666
|
DA.prototype.transition = Qa;
|
|
2667
|
-
var
|
|
2667
|
+
var S = /* @__PURE__ */ ((A) => (A.Svg = "svg", A.ClipPath = "clipPath", A.BaseLayer = "baseLayer", A.Axes = "axes", A.Area = "area", A.Zoom = "zoom", A.Trace = "trace", A.Tooltip = "skadi-chart-tooltip", A.Grid = "grid", A.Scatter = "scatter", A.Custom = "custom", A))(S || {});
|
|
2668
2668
|
class WA {
|
|
2669
2669
|
constructor() {
|
|
2670
2670
|
this.properties = null;
|
|
@@ -2683,10 +2683,10 @@ class WA {
|
|
|
2683
2683
|
}
|
|
2684
2684
|
class af extends WA {
|
|
2685
2685
|
constructor(t, e) {
|
|
2686
|
-
super(), this.labels = t, this.labelPositions = e, this.type =
|
|
2686
|
+
super(), this.labels = t, this.labelPositions = e, this.type = S.Axes, this.drawAxis = (r, n) => {
|
|
2687
2687
|
const { width: i, height: s, margin: o } = n.bounds, { getHtmlId: a } = n, B = n.scaleConfig.numericalScales[r];
|
|
2688
2688
|
if (this.labels[r]) {
|
|
2689
|
-
const c = n.coreLayers[
|
|
2689
|
+
const c = n.coreLayers[S.Svg].append("text").attr("id", `${a(S.Axes)}-label${r}`).style("font-size", "1.2rem").attr("text-anchor", "middle").text(this.labels[r]);
|
|
2690
2690
|
if (r === "y") {
|
|
2691
2691
|
const u = s - o.top - o.bottom;
|
|
2692
2692
|
c.attr("x", -u / 2 - o.top).attr("y", o.left * this.labelPositions.y).attr("transform", "rotate(-90)");
|
|
@@ -2697,33 +2697,44 @@ class af extends WA {
|
|
|
2697
2697
|
}
|
|
2698
2698
|
return n.scaleConfig.categoricalScales[r] ? this.drawCategoricalAxis(r, n) : this.drawNumericalAxis(r, B, n, 12);
|
|
2699
2699
|
}, this.draw = (r) => {
|
|
2700
|
-
const { x: n, y: i } = r.scaleConfig.numericalScales, { animationDuration: s } = r.globals,
|
|
2700
|
+
const { x: n, y: i } = r.scaleConfig.numericalScales, { animationDuration: s } = r.globals, o = this.drawAxis("x", r), a = this.drawAxis("y", r);
|
|
2701
2701
|
this.zoom = async () => {
|
|
2702
|
-
const
|
|
2703
|
-
|
|
2702
|
+
const B = [o, a].flatMap(({ layer: c, line: u, axis: l, tickLabelRotateCallback: f }) => [
|
|
2703
|
+
c == null ? void 0 : c.transition().duration(s).call(l).end(),
|
|
2704
|
+
u == null ? void 0 : u.transition().duration(s).attr("x1", n(0)).attr("x2", n(0)).end(),
|
|
2705
|
+
new Promise((g) => {
|
|
2706
|
+
f == null || f(), g();
|
|
2707
|
+
})
|
|
2708
|
+
]);
|
|
2709
|
+
await Promise.all(B);
|
|
2704
2710
|
};
|
|
2711
|
+
}, this.rotateTickLabels = (r, n, i, s) => {
|
|
2712
|
+
i !== 0 && r.selectAll("text").attr("transform", `rotate(${i})`).attr("transform-origin", n === "x" ? `0 ${s}` : `${-s} 0`);
|
|
2705
2713
|
}, this.drawCategoricalAxis = (r, n) => {
|
|
2706
|
-
var
|
|
2707
|
-
const i = n.scaleConfig.categoricalScales[r].main, { margin: s } = n.bounds, o = n.coreLayers[
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2714
|
+
var d;
|
|
2715
|
+
const i = n.scaleConfig.categoricalScales[r].main, { margin: s } = n.bounds, o = n.coreLayers[S.Svg], { getHtmlId: a } = n, { padding: B, size: c, formatter: u, rotate: l } = n.globals.tickConfig.categorical[r], { translation: f, axisConstructor: g } = this.axisConfig(r, n), C = i.bandwidth(), w = (r === "x" ? s.bottom : s.left) * (1 - ((d = this.labelPositions) == null ? void 0 : d[r])) / 3, Q = B ?? w, U = g(i).tickSize(c ?? 0).tickPadding(Q);
|
|
2716
|
+
u && U.tickFormat(u);
|
|
2717
|
+
const p = o.append("g").attr("id", `${a(S.Axes)}-${r}`).style("font-size", "0.75rem").attr("transform", `translate(${f.x},${f.y})`).call(U);
|
|
2718
|
+
return this.rotateTickLabels(p, r, l ?? 0, Q), Object.entries(n.scaleConfig.categoricalScales[r].bands).forEach(([y, v]) => {
|
|
2719
|
+
const E = i(y);
|
|
2720
|
+
n.globals.tickConfig.numerical[r].count && this.drawNumericalAxis(r, v, n, 6), i.paddingInner() && this.drawLinePerpendicularToAxis(r, E, n), this.drawLinePerpendicularToAxis(r, E + C, n);
|
|
2721
|
+
}), { layer: null, axis: null, line: null, tickLabelRotateCallback: null };
|
|
2712
2722
|
}, this.drawNumericalAxis = (r, n, i, s) => {
|
|
2713
2723
|
const { getHtmlId: o } = i, {
|
|
2714
2724
|
count: a,
|
|
2715
2725
|
specifier: B,
|
|
2716
2726
|
padding: c,
|
|
2717
2727
|
size: u,
|
|
2718
|
-
formatter: l
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2728
|
+
formatter: l,
|
|
2729
|
+
rotate: f
|
|
2730
|
+
} = i.globals.tickConfig.numerical[r], { translation: g, axisConstructor: C } = this.axisConfig(r, i);
|
|
2731
|
+
let h = null;
|
|
2732
|
+
const w = c ?? s, Q = C(n).ticks(a ?? 0, B).tickSize(u ?? 0).tickPadding(w);
|
|
2733
|
+
l && Q.tickFormat((F, d) => l(F, d));
|
|
2734
|
+
const U = i.coreLayers[S.Svg].append("g").attr("id", `${o(S.Axes)}-${r}`).style("font-size", "0.75rem").attr("transform", `translate(${g.x},${g.y})`).call(Q), p = () => this.rotateTickLabels(U, r, f ?? 0, w);
|
|
2735
|
+
return p(), U.select(".domain").style("stroke-opacity", 0), i.chartOptions.logScale[r] || (h = this.drawLinePerpendicularToAxis(r, n(0), i, "darkgrey")), { layer: U, axis: Q, line: h, tickLabelRotateCallback: p };
|
|
2725
2736
|
}, this.drawLinePerpendicularToAxis = (r, n, i, s = "black") => {
|
|
2726
|
-
const o = i.coreLayers[
|
|
2737
|
+
const o = i.coreLayers[S.BaseLayer], { height: a, width: B, margin: c } = i.bounds, u = r === "x" ? "y" : "x";
|
|
2727
2738
|
return o.append("g").append("line").attr(`${r}1`, n).attr(`${r}2`, n).attr(`${u}1`, r === "x" ? c.top : c.left).attr(`${u}2`, r === "x" ? a - c.bottom : B - c.right).style("stroke", s).style("stroke-width", 0.5);
|
|
2728
2739
|
}, this.axisConfig = (r, n) => {
|
|
2729
2740
|
const { height: i, margin: s } = n.bounds, o = r === "x" ? "y" : "x", a = r === "x" ? i - s.bottom : s.left;
|
|
@@ -2789,8 +2800,8 @@ const Xi = (A) => Math.floor(A * 10) / 10, br = (A, t) => t + Xi(A.x) + "," + Xi
|
|
|
2789
2800
|
f > a && (a = f, B = l);
|
|
2790
2801
|
}
|
|
2791
2802
|
if (a / Math.sqrt(i * i + s * s) > e) {
|
|
2792
|
-
const l = [t[0], B], f = Un(A, l, e), g = [B, t[1]],
|
|
2793
|
-
return [...f.slice(0, -1), ...
|
|
2803
|
+
const l = [t[0], B], f = Un(A, l, e), g = [B, t[1]], C = Un(A, g, e);
|
|
2804
|
+
return [...f.slice(0, -1), ...C];
|
|
2794
2805
|
} else {
|
|
2795
2806
|
const l = Yi(A[t[0]]), f = Yi(A[t[1]]);
|
|
2796
2807
|
return [l, f];
|
|
@@ -2801,7 +2812,7 @@ const Xi = (A) => Math.floor(A * 10) / 10, br = (A, t) => t + Xi(A.x) + "," + Xi
|
|
|
2801
2812
|
});
|
|
2802
2813
|
class cf extends WA {
|
|
2803
2814
|
constructor(t, e) {
|
|
2804
|
-
super(), this.linesDC = t, this.options = e, this.type =
|
|
2815
|
+
super(), this.linesDC = t, this.options = e, this.type = S.Trace, this.traces = [], this.lowResLinesSC = [], this.getNewPoint = null, this.getNewPointInverse = null, this.customTween = (r, n) => {
|
|
2805
2816
|
const i = this.lowResLinesSC[r];
|
|
2806
2817
|
return (s) => {
|
|
2807
2818
|
const o = i.map(({ x: a, y: B }) => this.getNewPoint(a, B, s));
|
|
@@ -2816,14 +2827,14 @@ class cf extends WA {
|
|
|
2816
2827
|
}, this.draw = (r, n) => {
|
|
2817
2828
|
this.updateLowResLinesSC(r), this.traces = this.linesDC.map((i, s) => {
|
|
2818
2829
|
const o = dt(this.lowResLinesSC[s], r).join("");
|
|
2819
|
-
return r.coreLayers[
|
|
2830
|
+
return r.coreLayers[S.BaseLayer].append("path").attr("id", `${r.getHtmlId(S.Trace)}-${s}`).attr("pointer-events", "none").attr("fill", "none").attr("stroke", i.style.strokeColor || "black").attr("opacity", i.style.opacity || 1).attr("stroke-width", i.style.strokeWidth || 0.5).attr("stroke-dasharray", i.style.strokeDasharray || "").attr("d", o);
|
|
2820
2831
|
}), this.beforeZoom = (i) => {
|
|
2821
|
-
const { x: s, y: o } = r.scaleConfig.numericalScales, a = i.x, B = i.y, c = [s(a[0]), s(a[1])], u = [o(B[0]), o(B[1])], l = s.domain(), f = o.domain(), g = [s(l[0]), s(l[1])],
|
|
2832
|
+
const { x: s, y: o } = r.scaleConfig.numericalScales, a = i.x, B = i.y, c = [s(a[0]), s(a[1])], u = [o(B[0]), o(B[1])], l = s.domain(), f = o.domain(), g = [s(l[0]), s(l[1])], C = [o(f[0]), o(f[1])], h = (g[1] - g[0]) / (c[1] - c[0]), w = (C[1] - C[0]) / (u[1] - u[0]), Q = h * s(a[0]) - s(l[0]), U = w * o(B[0]) - o(f[0]), p = h - 1, F = w - 1;
|
|
2822
2833
|
this.getNewPoint = (d, y, v) => ({
|
|
2823
|
-
x: d * (v * p + 1) - v *
|
|
2834
|
+
x: d * (v * p + 1) - v * Q,
|
|
2824
2835
|
y: y * (v * F + 1) - v * U
|
|
2825
2836
|
}), this.getNewPointInverse = (d, y, v) => ({
|
|
2826
|
-
x: (d + v *
|
|
2837
|
+
x: (d + v * Q) / (v * p + 1),
|
|
2827
2838
|
y: (y + v * U) / (v * F + 1)
|
|
2828
2839
|
});
|
|
2829
2840
|
}, this.zoom = async (i) => {
|
|
@@ -2841,7 +2852,7 @@ class cf extends WA {
|
|
|
2841
2852
|
}
|
|
2842
2853
|
class uf extends WA {
|
|
2843
2854
|
constructor(t) {
|
|
2844
|
-
super(), this.options = t, this.type =
|
|
2855
|
+
super(), this.options = t, this.type = S.Zoom, this.zooming = !1, this.selectionMask = null, this.overlay = null, this.processSelection = (e, r) => {
|
|
2845
2856
|
const { width: n, height: i, margin: s } = r.bounds, [[o, a], [B, c]] = e.selection, u = 30, l = Math.abs(o - B), f = Math.abs(a - c);
|
|
2846
2857
|
return this.options.lockAxis === "y" ? [[o, s.top], [B, i - s.bottom]] : this.options.lockAxis === "x" ? [[s.left, a], [n - s.right, c]] : l > u && f <= u ? [[o, s.top], [B, i - s.bottom]] : l <= u && f > u ? [[s.left, a], [n - s.right, c]] : [[o, a], [B, c]];
|
|
2847
2858
|
}, this.handleZoom = async (e, r) => {
|
|
@@ -2857,8 +2868,8 @@ class uf extends WA {
|
|
|
2857
2868
|
return;
|
|
2858
2869
|
}
|
|
2859
2870
|
r.call(e.target.move, null);
|
|
2860
|
-
const [[i, s], [o, a]] = this.processSelection(e, n), B = n.scaleConfig.numericalScales.x, c = B.invert(i), u = B.invert(o), l = n.scaleConfig.numericalScales.y, f = l.invert(a), g = l.invert(s),
|
|
2861
|
-
if (Math.abs(i - o) <
|
|
2871
|
+
const [[i, s], [o, a]] = this.processSelection(e, n), B = n.scaleConfig.numericalScales.x, c = B.invert(i), u = B.invert(o), l = n.scaleConfig.numericalScales.y, f = l.invert(a), g = l.invert(s), C = 10;
|
|
2872
|
+
if (Math.abs(i - o) < C || Math.abs(s - a) < C) {
|
|
2862
2873
|
n.optionalLayers.forEach((w) => w.afterZoom(null));
|
|
2863
2874
|
return;
|
|
2864
2875
|
}
|
|
@@ -2879,19 +2890,19 @@ class uf extends WA {
|
|
|
2879
2890
|
console.warn("You have tried to use zoom with two categorical axes, but this is not supported.");
|
|
2880
2891
|
return;
|
|
2881
2892
|
}
|
|
2882
|
-
Object.entries(r).forEach(([w,
|
|
2883
|
-
|
|
2893
|
+
Object.entries(r).forEach(([w, Q]) => {
|
|
2894
|
+
Q && (this.options.lockAxis = w);
|
|
2884
2895
|
});
|
|
2885
|
-
const { width: n, height: i, margin: s } = e.bounds, o = e.coreLayers[
|
|
2896
|
+
const { width: n, height: i, margin: s } = e.bounds, o = e.coreLayers[S.Svg], a = dl().extent([[s.left, s.top], [n - s.right, i - s.bottom]]), B = e.coreLayers[S.BaseLayer].append("g").attr("id", `${e.getHtmlId(S.Zoom)}-brush`).style("opacity", 0).call(a), c = `${e.getHtmlId(S.Zoom)}-overlay`;
|
|
2886
2897
|
o.select("defs").append("svg:mask").attr("id", c).append("svg:rect").attr("width", n - s.right - s.left).attr("height", i - s.bottom - s.top).attr("x", s.left).attr("y", s.top).attr("fill", "white").attr("fill-opacity", 0.15).style("mask-type", "alpha");
|
|
2887
|
-
const u = `${e.getHtmlId(
|
|
2898
|
+
const u = `${e.getHtmlId(S.Zoom)}-selection`;
|
|
2888
2899
|
this.selectionMask = o.select("defs").append("svg:mask").attr("id", u).append("svg:rect").attr("width", 0).attr("height", 0).attr("x", 0).attr("y", 0).attr("fill", "white").style("mask-type", "alpha"), this.overlay = o.append("svg:rect").attr("width", n - s.right - s.left).attr("height", i - s.bottom - s.top).attr("x", s.left).attr("y", s.top).style("display", "none").style("mask-image", `url(#${c}), url(#${u})`).style("mask-composite", "subtract"), a.on("start", () => e.optionalLayers.forEach((w) => w.brushStart())), a.on("brush", (w) => this.handleBrushMove(w, e)), a.on("end", (w) => this.handleBrushEnd(w, B, e));
|
|
2889
|
-
const { x: l, y: f } = e.scaleConfig.scaleExtents, { x: g, y:
|
|
2900
|
+
const { x: l, y: f } = e.scaleConfig.scaleExtents, { x: g, y: C } = e.scaleConfig.numericalScales, h = {
|
|
2890
2901
|
x: [l.start, l.end],
|
|
2891
2902
|
y: [f.start, f.end],
|
|
2892
2903
|
eventType: "dblclick"
|
|
2893
2904
|
};
|
|
2894
|
-
this.options.lockAxis === "y" && (h.y =
|
|
2905
|
+
this.options.lockAxis === "y" && (h.y = C.domain()), this.options.lockAxis === "x" && (h.x = g.domain()), e.coreLayers[S.Svg].on("dblclick", () => this.handleZoom(h, e));
|
|
2895
2906
|
};
|
|
2896
2907
|
}
|
|
2897
2908
|
}
|
|
@@ -2901,14 +2912,14 @@ class lf extends WA {
|
|
|
2901
2912
|
// For example, in a histogram or a bar chart you may want to show the tooltip for
|
|
2902
2913
|
// the nearest x value regardless of y distance.
|
|
2903
2914
|
constructor(t, e = 25, r) {
|
|
2904
|
-
super(), this.tooltipHtmlCallback = t, this.radiusPx = e, this.distanceAxis = r, this.type =
|
|
2915
|
+
super(), this.tooltipHtmlCallback = t, this.radiusPx = e, this.distanceAxis = r, this.type = S.Tooltip, this.tooltipRadiusSq = 625, this.getDistanceSq = (n, i) => {
|
|
2905
2916
|
const s = n.x - i.x, o = n.y - i.y;
|
|
2906
2917
|
return s * s + o * o;
|
|
2907
2918
|
}, this.getDistanceSqSC = (n, i, s) => {
|
|
2908
2919
|
const o = { x: n.x * s.x, y: n.y * s.y }, a = { x: i.x * s.x, y: i.y * s.y };
|
|
2909
2920
|
return this.getDistanceSq(o, a);
|
|
2910
2921
|
}, this.convertSCPointToCC = (n, i) => {
|
|
2911
|
-
const s = i.coreLayers[
|
|
2922
|
+
const s = i.coreLayers[S.Svg].node().getScreenCTM(), {
|
|
2912
2923
|
a: o,
|
|
2913
2924
|
c: a,
|
|
2914
2925
|
b: B,
|
|
@@ -2926,7 +2937,7 @@ class lf extends WA {
|
|
|
2926
2937
|
const F = Math.abs(p.domain()[1] - p.domain()[0]) || 1;
|
|
2927
2938
|
return (Math.abs(p.range()[1] - p.range()[0]) || 1) / F;
|
|
2928
2939
|
});
|
|
2929
|
-
let
|
|
2940
|
+
let C = 1 / 0;
|
|
2930
2941
|
const h = o.reduce((p, F) => {
|
|
2931
2942
|
const d = F.bands || {}, y = {
|
|
2932
2943
|
x: d.x ? l.x[d.x] : u.x,
|
|
@@ -2936,31 +2947,31 @@ class lf extends WA {
|
|
|
2936
2947
|
y: d.y ? g.y[d.y] : f.y
|
|
2937
2948
|
};
|
|
2938
2949
|
if (c) {
|
|
2939
|
-
const [L, m] = [F, p].map((
|
|
2940
|
-
const I = y[c] * v[c], b =
|
|
2950
|
+
const [L, m] = [F, p].map((K) => {
|
|
2951
|
+
const I = y[c] * v[c], b = K[c] * v[c];
|
|
2941
2952
|
return (I - b) ** 2;
|
|
2942
2953
|
});
|
|
2943
2954
|
if (L > m) return p;
|
|
2944
2955
|
}
|
|
2945
2956
|
const E = this.getDistanceSqSC(y, F, v);
|
|
2946
|
-
return E >=
|
|
2947
|
-
}, { x: 0, y: 0 }), w = tt(h.bands, i),
|
|
2948
|
-
if (this.getDistanceSq(B,
|
|
2957
|
+
return E >= C ? p : (C = E, F);
|
|
2958
|
+
}, { x: 0, y: 0 }), w = tt(h.bands, i), Q = { x: w.x(h.x), y: w.y(h.y) };
|
|
2959
|
+
if (this.getDistanceSq(B, Q) > this.tooltipRadiusSq)
|
|
2949
2960
|
s.style("opacity", 0);
|
|
2950
2961
|
else {
|
|
2951
|
-
const p = this.convertSCPointToCC(
|
|
2962
|
+
const p = this.convertSCPointToCC(Q, i);
|
|
2952
2963
|
s.html(this.tooltipHtmlCallback(h)).style("left", `${p.x}px`).style("top", `${p.y}px`).style("opacity", 1);
|
|
2953
2964
|
}
|
|
2954
2965
|
}, this.draw = (n) => {
|
|
2955
|
-
const i = n.optionalLayers.filter((l) => l.type ===
|
|
2966
|
+
const i = n.optionalLayers.filter((l) => l.type === S.Trace), s = n.optionalLayers.filter((l) => l.type === S.Scatter);
|
|
2956
2967
|
if (i.length === 0 && s.length === 0) {
|
|
2957
2968
|
console.warn("Tooltip Layer was added without a Traces Layer or a Scatter Layer.");
|
|
2958
2969
|
return;
|
|
2959
2970
|
}
|
|
2960
2971
|
const o = na("div").attr("id", `${n.getHtmlId(this.type)}`).style("position", "fixed").style("pointer-events", "none");
|
|
2961
|
-
let a = i.reduce((l, f) => [...f.linesDC.flatMap(({ points:
|
|
2972
|
+
let a = i.reduce((l, f) => [...f.linesDC.flatMap(({ points: C, metadata: h, bands: w }) => C.map((Q) => ({ ...Q, metadata: h, bands: w }))), ...l], []);
|
|
2962
2973
|
a = s.reduce((l, f) => [...f.points, ...l], a);
|
|
2963
|
-
const B = n.coreLayers[
|
|
2974
|
+
const B = n.coreLayers[S.Svg];
|
|
2964
2975
|
let c, u = !1;
|
|
2965
2976
|
B.on("mousemove", (l) => {
|
|
2966
2977
|
var f;
|
|
@@ -2977,17 +2988,17 @@ class lf extends WA {
|
|
|
2977
2988
|
}
|
|
2978
2989
|
class ff extends WA {
|
|
2979
2990
|
constructor(t) {
|
|
2980
|
-
super(), this.directions = t, this.type =
|
|
2981
|
-
const { width: r, height: n, margin: i } = e.bounds, { x: s, y: o } = e.scaleConfig.numericalScales, a = e.coreLayers[
|
|
2982
|
-
w.selectAll("line").data(s.ticks(c.numerical.x.count)).join("line").style("stroke", "black").style("stroke-width", f).attr("pointer-events", "none").attr("x1", (
|
|
2991
|
+
super(), this.directions = t, this.type = S.Grid, this.draw = (e) => {
|
|
2992
|
+
const { width: r, height: n, margin: i } = e.bounds, { x: s, y: o } = e.scaleConfig.numericalScales, a = e.coreLayers[S.Svg], { animationDuration: B, tickConfig: c } = e.globals, { getHtmlId: u } = e, l = 0.15, f = 0.5, g = {}, C = (w) => {
|
|
2993
|
+
w.selectAll("line").data(s.ticks(c.numerical.x.count)).join("line").style("stroke", "black").style("stroke-width", f).attr("pointer-events", "none").attr("x1", (Q) => s(Q)).attr("x2", (Q) => s(Q)).attr("y1", i.top).attr("y2", n - i.bottom);
|
|
2983
2994
|
}, h = (w) => {
|
|
2984
|
-
w.selectAll("line").data(o.ticks(c.numerical.y.count)).join("line").style("stroke", "black").style("stroke-width", f).attr("pointer-events", "none").attr("x1", i.left).attr("x2", r - i.right).attr("y1", (
|
|
2995
|
+
w.selectAll("line").data(o.ticks(c.numerical.y.count)).join("line").style("stroke", "black").style("stroke-width", f).attr("pointer-events", "none").attr("x1", i.left).attr("x2", r - i.right).attr("y1", (Q) => o(Q)).attr("y2", (Q) => o(Q));
|
|
2985
2996
|
};
|
|
2986
|
-
this.directions.x && (g.x = a.append("g").call(
|
|
2997
|
+
this.directions.x && (g.x = a.append("g").call(C).attr("opacity", l).attr("id", `${u(this.type)}-x`)), this.directions.y && (g.y = a.append("g").call(h).attr("opacity", l).attr("id", `${u(this.type)}-y`)), this.zoom = async () => {
|
|
2987
2998
|
var F, d, y, v;
|
|
2988
|
-
const w = (F = g.x) == null ? void 0 : F.selectAll("line").transition().duration(B / 2).style("opacity", 0).remove().end(),
|
|
2989
|
-
await Promise.all([w,
|
|
2990
|
-
const U = (y = g.x) == null ? void 0 : y.call(
|
|
2999
|
+
const w = (F = g.x) == null ? void 0 : F.selectAll("line").transition().duration(B / 2).style("opacity", 0).remove().end(), Q = (d = g.y) == null ? void 0 : d.selectAll("line").transition().duration(B / 2).style("opacity", 0).remove().end();
|
|
3000
|
+
await Promise.all([w, Q]);
|
|
3001
|
+
const U = (y = g.x) == null ? void 0 : y.call(C).style("opacity", 0).transition().duration(B / 2).style("opacity", l).end(), p = (v = g.y) == null ? void 0 : v.call(h).style("opacity", 0).transition().duration(B / 2).style("opacity", l).end();
|
|
2991
3002
|
await Promise.all([U, p]);
|
|
2992
3003
|
};
|
|
2993
3004
|
};
|
|
@@ -3587,8 +3598,8 @@ var Sf = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
|
|
|
3587
3598
|
return Xg;
|
|
3588
3599
|
case Eg:
|
|
3589
3600
|
case Hg:
|
|
3590
|
-
var g = this.peekCodePoint(0),
|
|
3591
|
-
return g === jA && (ct(
|
|
3601
|
+
var g = this.peekCodePoint(0), C = this.peekCodePoint(1);
|
|
3602
|
+
return g === jA && (ct(C) || C === Fe) && (this.consumeCodePoint(), this.consumeUnicodeRangeToken()), this.reconsumeCodePoint(t), this.consumeIdentLikeToken();
|
|
3592
3603
|
case os:
|
|
3593
3604
|
if (this.peekCodePoint(0) === St)
|
|
3594
3605
|
return this.consumeCodePoint(), Vg;
|
|
@@ -3836,7 +3847,7 @@ var Sf = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
|
|
|
3836
3847
|
return A.type === 16 || YA(A);
|
|
3837
3848
|
}, Pa = function(A) {
|
|
3838
3849
|
return A.length > 1 ? [A[0], A[1]] : [A[0]];
|
|
3839
|
-
},
|
|
3850
|
+
}, rA = {
|
|
3840
3851
|
type: 17,
|
|
3841
3852
|
number: 0,
|
|
3842
3853
|
flags: ne
|
|
@@ -3892,18 +3903,18 @@ var Sf = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
|
|
|
3892
3903
|
case "to right bottom":
|
|
3893
3904
|
case "left top":
|
|
3894
3905
|
case "top left":
|
|
3895
|
-
return [
|
|
3906
|
+
return [rA, rA];
|
|
3896
3907
|
case "to top":
|
|
3897
3908
|
case "bottom":
|
|
3898
|
-
return
|
|
3909
|
+
return QA(0);
|
|
3899
3910
|
case "to bottom left":
|
|
3900
3911
|
case "to left bottom":
|
|
3901
3912
|
case "right top":
|
|
3902
3913
|
case "top right":
|
|
3903
|
-
return [
|
|
3914
|
+
return [rA, kA];
|
|
3904
3915
|
case "to right":
|
|
3905
3916
|
case "left":
|
|
3906
|
-
return
|
|
3917
|
+
return QA(90);
|
|
3907
3918
|
case "to top left":
|
|
3908
3919
|
case "to left top":
|
|
3909
3920
|
case "right bottom":
|
|
@@ -3911,18 +3922,18 @@ var Sf = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
|
|
|
3911
3922
|
return [kA, kA];
|
|
3912
3923
|
case "to bottom":
|
|
3913
3924
|
case "top":
|
|
3914
|
-
return
|
|
3925
|
+
return QA(180);
|
|
3915
3926
|
case "to top right":
|
|
3916
3927
|
case "to right top":
|
|
3917
3928
|
case "left bottom":
|
|
3918
3929
|
case "bottom left":
|
|
3919
|
-
return [kA,
|
|
3930
|
+
return [kA, rA];
|
|
3920
3931
|
case "to left":
|
|
3921
3932
|
case "right":
|
|
3922
|
-
return
|
|
3933
|
+
return QA(270);
|
|
3923
3934
|
}
|
|
3924
3935
|
return 0;
|
|
3925
|
-
},
|
|
3936
|
+
}, QA = function(A) {
|
|
3926
3937
|
return Math.PI * A / 180;
|
|
3927
3938
|
}, XA = {
|
|
3928
3939
|
name: "color",
|
|
@@ -3960,7 +3971,7 @@ var Sf = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
|
|
|
3960
3971
|
}
|
|
3961
3972
|
}, JA = function(A) {
|
|
3962
3973
|
return (255 & A) === 0;
|
|
3963
|
-
},
|
|
3974
|
+
}, AA = function(A) {
|
|
3964
3975
|
var t = 255 & A, e = 255 & A >> 8, r = 255 & A >> 16, n = 255 & A >> 24;
|
|
3965
3976
|
return t < 255 ? "rgba(" + n + "," + r + "," + e + "," + t / 255 + ")" : "rgb(" + n + "," + r + "," + e + ")";
|
|
3966
3977
|
}, PA = function(A, t, e, r) {
|
|
@@ -3989,11 +4000,11 @@ function Nr(A, t, e) {
|
|
|
3989
4000
|
return e < 0 && (e += 1), e >= 1 && (e -= 1), e < 1 / 6 ? (t - A) * e * 6 + A : e < 1 / 2 ? t : e < 2 / 3 ? (t - A) * 6 * (2 / 3 - e) + A : A;
|
|
3990
4001
|
}
|
|
3991
4002
|
var fs = function(A, t) {
|
|
3992
|
-
var e = t.filter(yt), r = e[0], n = e[1], i = e[2], s = e[3], o = (r.type === 17 ?
|
|
4003
|
+
var e = t.filter(yt), r = e[0], n = e[1], i = e[2], s = e[3], o = (r.type === 17 ? QA(r.number) : fr.parse(A, r)) / (Math.PI * 2), a = z(n) ? n.number / 100 : 0, B = z(i) ? i.number / 100 : 0, c = typeof s < "u" && z(s) ? P(s, 1) : 1;
|
|
3993
4004
|
if (a === 0)
|
|
3994
4005
|
return PA(B * 255, B * 255, B * 255, 1);
|
|
3995
|
-
var u = B <= 0.5 ? B * (a + 1) : B + a - B * a, l = B * 2 - u, f = Nr(l, u, o + 1 / 3), g = Nr(l, u, o),
|
|
3996
|
-
return PA(f * 255, g * 255,
|
|
4006
|
+
var u = B <= 0.5 ? B * (a + 1) : B + a - B * a, l = B * 2 - u, f = Nr(l, u, o + 1 / 3), g = Nr(l, u, o), C = Nr(l, u, o - 1 / 3);
|
|
4007
|
+
return PA(f * 255, g * 255, C * 255, c);
|
|
3997
4008
|
}, rh = {
|
|
3998
4009
|
hsl: fs,
|
|
3999
4010
|
hsla: fs,
|
|
@@ -4179,7 +4190,7 @@ var fs = function(A, t) {
|
|
|
4179
4190
|
return r && z(r) ? { color: e, stop: r } : { color: e, stop: null };
|
|
4180
4191
|
}, gs = function(A, t) {
|
|
4181
4192
|
var e = A[0], r = A[A.length - 1];
|
|
4182
|
-
e.stop === null && (e.stop =
|
|
4193
|
+
e.stop === null && (e.stop = rA), r.stop === null && (r.stop = kA);
|
|
4183
4194
|
for (var n = [], i = 0, s = 0; s < A.length; s++) {
|
|
4184
4195
|
var o = A[s].stop;
|
|
4185
4196
|
if (o !== null) {
|
|
@@ -4198,8 +4209,8 @@ var fs = function(A, t) {
|
|
|
4198
4209
|
B = null;
|
|
4199
4210
|
}
|
|
4200
4211
|
}
|
|
4201
|
-
return A.map(function(
|
|
4202
|
-
var w =
|
|
4212
|
+
return A.map(function(C, h) {
|
|
4213
|
+
var w = C.color;
|
|
4203
4214
|
return { color: w, stop: Math.max(Math.min(1, n[h] / t), 0) };
|
|
4204
4215
|
});
|
|
4205
4216
|
}, sh = function(A, t, e) {
|
|
@@ -4255,7 +4266,7 @@ var fs = function(A, t) {
|
|
|
4255
4266
|
}
|
|
4256
4267
|
return Array.isArray(A.size) && (i = P(A.size[0], r), s = A.size.length === 2 ? P(A.size[1], n) : i), [i, s];
|
|
4257
4268
|
}, Bh = function(A, t) {
|
|
4258
|
-
var e =
|
|
4269
|
+
var e = QA(180), r = [];
|
|
4259
4270
|
return IA(t).forEach(function(n, i) {
|
|
4260
4271
|
if (i === 0) {
|
|
4261
4272
|
var s = n[0];
|
|
@@ -4276,7 +4287,7 @@ var fs = function(A, t) {
|
|
|
4276
4287
|
/* LINEAR_GRADIENT */
|
|
4277
4288
|
};
|
|
4278
4289
|
}, Ee = function(A, t) {
|
|
4279
|
-
var e =
|
|
4290
|
+
var e = QA(180), r = [];
|
|
4280
4291
|
return IA(t).forEach(function(n, i) {
|
|
4281
4292
|
if (i === 0) {
|
|
4282
4293
|
var s = n[0];
|
|
@@ -4284,7 +4295,7 @@ var fs = function(A, t) {
|
|
|
4284
4295
|
e = $a(n);
|
|
4285
4296
|
return;
|
|
4286
4297
|
} else if (Za(s)) {
|
|
4287
|
-
e = (fr.parse(A, s) +
|
|
4298
|
+
e = (fr.parse(A, s) + QA(270)) % QA(360);
|
|
4288
4299
|
return;
|
|
4289
4300
|
}
|
|
4290
4301
|
}
|
|
@@ -4297,7 +4308,7 @@ var fs = function(A, t) {
|
|
|
4297
4308
|
/* LINEAR_GRADIENT */
|
|
4298
4309
|
};
|
|
4299
4310
|
}, ch = function(A, t) {
|
|
4300
|
-
var e =
|
|
4311
|
+
var e = QA(180), r = [], n = 1, i = 0, s = 3, o = [];
|
|
4301
4312
|
return IA(t).forEach(function(a, B) {
|
|
4302
4313
|
var c = a[0];
|
|
4303
4314
|
if (B === 0) {
|
|
@@ -4312,7 +4323,7 @@ var fs = function(A, t) {
|
|
|
4312
4323
|
if (c.type === 18) {
|
|
4313
4324
|
if (c.name === "from") {
|
|
4314
4325
|
var u = XA.parse(A, c.values[0]);
|
|
4315
|
-
r.push({ stop:
|
|
4326
|
+
r.push({ stop: rA, color: u });
|
|
4316
4327
|
} else if (c.name === "to") {
|
|
4317
4328
|
var u = XA.parse(A, c.values[0]);
|
|
4318
4329
|
r.push({ stop: kA, color: u });
|
|
@@ -4328,7 +4339,7 @@ var fs = function(A, t) {
|
|
|
4328
4339
|
}
|
|
4329
4340
|
}
|
|
4330
4341
|
}), n === 1 ? {
|
|
4331
|
-
angle: (e +
|
|
4342
|
+
angle: (e + QA(180)) % QA(360),
|
|
4332
4343
|
stops: r,
|
|
4333
4344
|
type: n
|
|
4334
4345
|
} : { size: s, shape: i, stops: r, position: o, type: n };
|
|
@@ -4346,7 +4357,7 @@ var fs = function(A, t) {
|
|
|
4346
4357
|
return i.push(ei), u;
|
|
4347
4358
|
case "top":
|
|
4348
4359
|
case "left":
|
|
4349
|
-
return i.push(
|
|
4360
|
+
return i.push(rA), u;
|
|
4350
4361
|
case "right":
|
|
4351
4362
|
case "bottom":
|
|
4352
4363
|
return i.push(kA), u;
|
|
@@ -4399,7 +4410,7 @@ var fs = function(A, t) {
|
|
|
4399
4410
|
return i.push(ei), !1;
|
|
4400
4411
|
case "top":
|
|
4401
4412
|
case "left":
|
|
4402
|
-
return i.push(
|
|
4413
|
+
return i.push(rA), !1;
|
|
4403
4414
|
case "right":
|
|
4404
4415
|
case "bottom":
|
|
4405
4416
|
return i.push(kA), !1;
|
|
@@ -4998,9 +5009,9 @@ var Ph = {
|
|
|
4998
5009
|
return t.length === 1 && Dn(t[0], "none") ? [] : IA(t).map(function(e) {
|
|
4999
5010
|
for (var r = {
|
|
5000
5011
|
color: TA.TRANSPARENT,
|
|
5001
|
-
offsetX:
|
|
5002
|
-
offsetY:
|
|
5003
|
-
blur:
|
|
5012
|
+
offsetX: rA,
|
|
5013
|
+
offsetY: rA,
|
|
5014
|
+
blur: rA
|
|
5004
5015
|
}, n = 0, i = 0; i < e.length; i++) {
|
|
5005
5016
|
var s = e[i];
|
|
5006
5017
|
YA(s) ? (n === 0 ? r.offsetX = s : n === 1 ? r.offsetY = s : r.blur = s, n++) : r.color = XA.parse(A, s);
|
|
@@ -5244,7 +5255,7 @@ var hw = {
|
|
|
5244
5255
|
return "normal";
|
|
5245
5256
|
}
|
|
5246
5257
|
}
|
|
5247
|
-
},
|
|
5258
|
+
}, j = function(A, t) {
|
|
5248
5259
|
return (A & t) !== 0;
|
|
5249
5260
|
}, Ew = {
|
|
5250
5261
|
name: "content",
|
|
@@ -5338,10 +5349,10 @@ var hw = {
|
|
|
5338
5349
|
return t.length === 1 && Dn(t[0], "none") ? [] : IA(t).map(function(e) {
|
|
5339
5350
|
for (var r = {
|
|
5340
5351
|
color: 255,
|
|
5341
|
-
offsetX:
|
|
5342
|
-
offsetY:
|
|
5343
|
-
blur:
|
|
5344
|
-
spread:
|
|
5352
|
+
offsetX: rA,
|
|
5353
|
+
offsetY: rA,
|
|
5354
|
+
blur: rA,
|
|
5355
|
+
spread: rA,
|
|
5345
5356
|
inset: !1
|
|
5346
5357
|
}, n = 0, i = 0; i < e.length; i++) {
|
|
5347
5358
|
var s = e[i];
|
|
@@ -5423,27 +5434,27 @@ var hw = {
|
|
|
5423
5434
|
}, A.prototype.isFloating = function() {
|
|
5424
5435
|
return this.float !== 0;
|
|
5425
5436
|
}, A.prototype.isInlineLevel = function() {
|
|
5426
|
-
return
|
|
5437
|
+
return j(
|
|
5427
5438
|
this.display,
|
|
5428
5439
|
4
|
|
5429
5440
|
/* INLINE */
|
|
5430
|
-
) ||
|
|
5441
|
+
) || j(
|
|
5431
5442
|
this.display,
|
|
5432
5443
|
33554432
|
|
5433
5444
|
/* INLINE_BLOCK */
|
|
5434
|
-
) ||
|
|
5445
|
+
) || j(
|
|
5435
5446
|
this.display,
|
|
5436
5447
|
268435456
|
|
5437
5448
|
/* INLINE_FLEX */
|
|
5438
|
-
) ||
|
|
5449
|
+
) || j(
|
|
5439
5450
|
this.display,
|
|
5440
5451
|
536870912
|
|
5441
5452
|
/* INLINE_GRID */
|
|
5442
|
-
) ||
|
|
5453
|
+
) || j(
|
|
5443
5454
|
this.display,
|
|
5444
5455
|
67108864
|
|
5445
5456
|
/* INLINE_LIST_ITEM */
|
|
5446
|
-
) ||
|
|
5457
|
+
) || j(
|
|
5447
5458
|
this.display,
|
|
5448
5459
|
134217728
|
|
5449
5460
|
/* INLINE_TABLE */
|
|
@@ -5490,10 +5501,10 @@ var hw = {
|
|
|
5490
5501
|
return ri.parse(A, i.parseComponentValue());
|
|
5491
5502
|
case "length":
|
|
5492
5503
|
var o = i.parseComponentValue();
|
|
5493
|
-
return YA(o) ? o :
|
|
5504
|
+
return YA(o) ? o : rA;
|
|
5494
5505
|
case "length-percentage":
|
|
5495
5506
|
var a = i.parseComponentValue();
|
|
5496
|
-
return z(a) ? a :
|
|
5507
|
+
return z(a) ? a : rA;
|
|
5497
5508
|
case "time":
|
|
5498
5509
|
return so.parse(A, i.parseComponentValue());
|
|
5499
5510
|
}
|
|
@@ -5608,27 +5619,27 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
5608
5619
|
s <= 65535 ? r.push(s) : (s -= 65536, r.push((s >> 10) + 55296, s % 1024 + 56320)), (n + 1 === e || r.length > 16384) && (i += String.fromCharCode.apply(String, r), r.length = 0);
|
|
5609
5620
|
}
|
|
5610
5621
|
return i;
|
|
5611
|
-
}, sQ = jw(Ow),
|
|
5622
|
+
}, sQ = jw(Ow), hA = "×", Wr = "÷", aQ = function(A) {
|
|
5612
5623
|
return sQ.get(A);
|
|
5613
5624
|
}, oQ = function(A, t, e) {
|
|
5614
5625
|
var r = e - 2, n = t[r], i = t[e - 1], s = t[e];
|
|
5615
5626
|
if (i === kr && s === Pr)
|
|
5616
|
-
return
|
|
5627
|
+
return hA;
|
|
5617
5628
|
if (i === kr || i === Pr || i === vs || s === kr || s === Pr || s === vs)
|
|
5618
5629
|
return Wr;
|
|
5619
5630
|
if (i === Es && [Es, Xr, ms, Hs].indexOf(s) !== -1 || (i === ms || i === Xr) && (s === Xr || s === Jr) || (i === Hs || i === Jr) && s === Jr || s === Is || s === ys || s === rQ || i === eQ)
|
|
5620
|
-
return
|
|
5631
|
+
return hA;
|
|
5621
5632
|
if (i === Is && s === xs) {
|
|
5622
5633
|
for (; n === ys; )
|
|
5623
5634
|
n = t[--r];
|
|
5624
5635
|
if (n === xs)
|
|
5625
|
-
return
|
|
5636
|
+
return hA;
|
|
5626
5637
|
}
|
|
5627
5638
|
if (i === Yr && s === Yr) {
|
|
5628
5639
|
for (var o = 0; n === Yr; )
|
|
5629
5640
|
o++, n = t[--r];
|
|
5630
5641
|
if (o % 2 === 0)
|
|
5631
|
-
return
|
|
5642
|
+
return hA;
|
|
5632
5643
|
}
|
|
5633
5644
|
return Wr;
|
|
5634
5645
|
}, BQ = function(A) {
|
|
@@ -5637,9 +5648,9 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
5637
5648
|
next: function() {
|
|
5638
5649
|
if (r >= e)
|
|
5639
5650
|
return { done: !0, value: null };
|
|
5640
|
-
for (var s =
|
|
5651
|
+
for (var s = hA; r < e && (s = oQ(t, i, ++r)) === hA; )
|
|
5641
5652
|
;
|
|
5642
|
-
if (s !==
|
|
5653
|
+
if (s !== hA || r === e) {
|
|
5643
5654
|
var o = iQ.apply(null, t.slice(n, r));
|
|
5644
5655
|
return n = r, { value: o, done: !1 };
|
|
5645
5656
|
}
|
|
@@ -5726,38 +5737,38 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
5726
5737
|
return t(r);
|
|
5727
5738
|
}, r.onerror = e, r.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(A));
|
|
5728
5739
|
});
|
|
5729
|
-
},
|
|
5740
|
+
}, eA = {
|
|
5730
5741
|
get SUPPORT_RANGE_BOUNDS() {
|
|
5731
5742
|
var A = uQ(document);
|
|
5732
|
-
return Object.defineProperty(
|
|
5743
|
+
return Object.defineProperty(eA, "SUPPORT_RANGE_BOUNDS", { value: A }), A;
|
|
5733
5744
|
},
|
|
5734
5745
|
get SUPPORT_WORD_BREAKING() {
|
|
5735
|
-
var A =
|
|
5736
|
-
return Object.defineProperty(
|
|
5746
|
+
var A = eA.SUPPORT_RANGE_BOUNDS && lQ(document);
|
|
5747
|
+
return Object.defineProperty(eA, "SUPPORT_WORD_BREAKING", { value: A }), A;
|
|
5737
5748
|
},
|
|
5738
5749
|
get SUPPORT_SVG_DRAWING() {
|
|
5739
5750
|
var A = hQ(document);
|
|
5740
|
-
return Object.defineProperty(
|
|
5751
|
+
return Object.defineProperty(eA, "SUPPORT_SVG_DRAWING", { value: A }), A;
|
|
5741
5752
|
},
|
|
5742
5753
|
get SUPPORT_FOREIGNOBJECT_DRAWING() {
|
|
5743
5754
|
var A = typeof Array.from == "function" && typeof window.fetch == "function" ? wQ(document) : Promise.resolve(!1);
|
|
5744
|
-
return Object.defineProperty(
|
|
5755
|
+
return Object.defineProperty(eA, "SUPPORT_FOREIGNOBJECT_DRAWING", { value: A }), A;
|
|
5745
5756
|
},
|
|
5746
5757
|
get SUPPORT_CORS_IMAGES() {
|
|
5747
5758
|
var A = fQ();
|
|
5748
|
-
return Object.defineProperty(
|
|
5759
|
+
return Object.defineProperty(eA, "SUPPORT_CORS_IMAGES", { value: A }), A;
|
|
5749
5760
|
},
|
|
5750
5761
|
get SUPPORT_RESPONSE_TYPE() {
|
|
5751
5762
|
var A = gQ();
|
|
5752
|
-
return Object.defineProperty(
|
|
5763
|
+
return Object.defineProperty(eA, "SUPPORT_RESPONSE_TYPE", { value: A }), A;
|
|
5753
5764
|
},
|
|
5754
5765
|
get SUPPORT_CORS_XHR() {
|
|
5755
5766
|
var A = "withCredentials" in new XMLHttpRequest();
|
|
5756
|
-
return Object.defineProperty(
|
|
5767
|
+
return Object.defineProperty(eA, "SUPPORT_CORS_XHR", { value: A }), A;
|
|
5757
5768
|
},
|
|
5758
5769
|
get SUPPORT_NATIVE_TEXT_SEGMENTATION() {
|
|
5759
5770
|
var A = !!(typeof Intl < "u" && Intl.Segmenter);
|
|
5760
|
-
return Object.defineProperty(
|
|
5771
|
+
return Object.defineProperty(eA, "SUPPORT_NATIVE_TEXT_SEGMENTATION", { value: A }), A;
|
|
5761
5772
|
}
|
|
5762
5773
|
}, Wt = (
|
|
5763
5774
|
/** @class */
|
|
@@ -5771,7 +5782,7 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
5771
5782
|
var n = UQ(t, e), i = [], s = 0;
|
|
5772
5783
|
return n.forEach(function(o) {
|
|
5773
5784
|
if (e.textDecorationLine.length || o.trim().length > 0)
|
|
5774
|
-
if (
|
|
5785
|
+
if (eA.SUPPORT_RANGE_BOUNDS) {
|
|
5775
5786
|
var a = Ks(r, s, o.length).getClientRects();
|
|
5776
5787
|
if (a.length > 1) {
|
|
5777
5788
|
var B = ii(o), c = 0;
|
|
@@ -5784,7 +5795,7 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
5784
5795
|
var u = r.splitText(o.length);
|
|
5785
5796
|
i.push(new Wt(o, CQ(A, r))), r = u;
|
|
5786
5797
|
}
|
|
5787
|
-
else
|
|
5798
|
+
else eA.SUPPORT_RANGE_BOUNDS || (r = r.splitText(o.length));
|
|
5788
5799
|
s += o.length;
|
|
5789
5800
|
}), i;
|
|
5790
5801
|
}, CQ = function(A, t) {
|
|
@@ -5807,7 +5818,7 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
5807
5818
|
var n = r.createRange();
|
|
5808
5819
|
return n.setStart(A, t), n.setEnd(A, t + e), n;
|
|
5809
5820
|
}, ii = function(A) {
|
|
5810
|
-
if (
|
|
5821
|
+
if (eA.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
|
|
5811
5822
|
var t = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
5812
5823
|
return Array.from(t.segment(A)).map(function(e) {
|
|
5813
5824
|
return e.segment;
|
|
@@ -5815,7 +5826,7 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
5815
5826
|
}
|
|
5816
5827
|
return cQ(A);
|
|
5817
5828
|
}, dQ = function(A, t) {
|
|
5818
|
-
if (
|
|
5829
|
+
if (eA.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
|
|
5819
5830
|
var e = new Intl.Segmenter(void 0, {
|
|
5820
5831
|
granularity: "word"
|
|
5821
5832
|
});
|
|
@@ -6353,7 +6364,7 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
6353
6364
|
return t[0] + o;
|
|
6354
6365
|
for (var a = 0; s > 0 && a <= 4; a++) {
|
|
6355
6366
|
var B = s % 10;
|
|
6356
|
-
B === 0 &&
|
|
6367
|
+
B === 0 && j(i, gt) && o !== "" ? o = t[B] + o : B > 1 || B === 1 && a === 0 || B === 1 && a === 1 && j(i, RA) || B === 1 && a === 1 && j(i, NA) && A > 100 || B === 1 && a > 1 && j(i, Pt) ? o = t[B] + (a > 0 ? e[a - 1] : "") + o : B === 1 && a > 0 && (o = e[a - 1] + o), s = Math.floor(s / 10);
|
|
6357
6368
|
}
|
|
6358
6369
|
return (A < 0 ? r : "") + o;
|
|
6359
6370
|
}, Rs = "十百千萬", Ns = "拾佰仟萬", Gs = "マイナス", Zr = "마이너스", ee = function(A, t, e) {
|
|
@@ -6612,15 +6623,15 @@ var eQ = 1, kr = 2, Pr = 3, vs = 4, ys = 5, rQ = 7, Es = 8, Xr = 9, Jr = 10, ms
|
|
|
6612
6623
|
var f = u.values.filter(k);
|
|
6613
6624
|
f.length && B.appendChild(o.createTextNode(t.getAttribute(f[0].value) || ""));
|
|
6614
6625
|
} else if (u.name === "counter") {
|
|
6615
|
-
var g = u.values.filter(yt),
|
|
6616
|
-
if (
|
|
6617
|
-
var w = i.counters.getCounterValue(
|
|
6618
|
-
B.appendChild(o.createTextNode(ee(w,
|
|
6626
|
+
var g = u.values.filter(yt), C = g[0], h = g[1];
|
|
6627
|
+
if (C && k(C)) {
|
|
6628
|
+
var w = i.counters.getCounterValue(C.value), Q = h && k(h) ? Tn.parse(i.context, h.value) : 3;
|
|
6629
|
+
B.appendChild(o.createTextNode(ee(w, Q, !1)));
|
|
6619
6630
|
}
|
|
6620
6631
|
} else if (u.name === "counters") {
|
|
6621
|
-
var U = u.values.filter(yt),
|
|
6622
|
-
if (
|
|
6623
|
-
var F = i.counters.getCounterValues(
|
|
6632
|
+
var U = u.values.filter(yt), C = U[0], p = U[1], h = U[2];
|
|
6633
|
+
if (C && k(C)) {
|
|
6634
|
+
var F = i.counters.getCounterValues(C.value), d = h && k(h) ? Tn.parse(i.context, h.value) : 3, y = p && p.type === 0 ? p.value : "", v = F.map(function(m) {
|
|
6624
6635
|
return ee(m, d, !1);
|
|
6625
6636
|
}).join(y);
|
|
6626
6637
|
B.appendChild(o.createTextNode(v));
|
|
@@ -6743,7 +6754,7 @@ var kQ = function(A, t) {
|
|
|
6743
6754
|
return aA(this, function(o) {
|
|
6744
6755
|
switch (o.label) {
|
|
6745
6756
|
case 0:
|
|
6746
|
-
return e = Eo.isSameOrigin(t), r = !zr(t) && this._options.useCORS === !0 &&
|
|
6757
|
+
return e = Eo.isSameOrigin(t), r = !zr(t) && this._options.useCORS === !0 && eA.SUPPORT_CORS_IMAGES && !e, n = !zr(t) && !e && !qr(t) && typeof this._options.proxy == "string" && eA.SUPPORT_CORS_XHR && !r, !e && this._options.allowTaint === !1 && !zr(t) && !qr(t) && !n && !r ? [
|
|
6747
6758
|
2
|
|
6748
6759
|
/*return*/
|
|
6749
6760
|
] : (i = t, n ? [4, this.proxy(i)] : [3, 2]);
|
|
@@ -6775,7 +6786,7 @@ var kQ = function(A, t) {
|
|
|
6775
6786
|
throw new Error("No proxy defined");
|
|
6776
6787
|
var n = t.substring(0, 256);
|
|
6777
6788
|
return new Promise(function(i, s) {
|
|
6778
|
-
var o =
|
|
6789
|
+
var o = eA.SUPPORT_RESPONSE_TYPE ? "blob" : "text", a = new XMLHttpRequest();
|
|
6779
6790
|
a.onload = function() {
|
|
6780
6791
|
if (a.status === 200)
|
|
6781
6792
|
if (o === "text")
|
|
@@ -6803,7 +6814,7 @@ var kQ = function(A, t) {
|
|
|
6803
6814
|
}, A;
|
|
6804
6815
|
})()
|
|
6805
6816
|
), eC = /^data:image\/svg\+xml/i, rC = /^data:image\/.*;base64,/i, nC = /^data:image\/.*/i, iC = function(A) {
|
|
6806
|
-
return
|
|
6817
|
+
return eA.SUPPORT_SVG_DRAWING || !aC(A);
|
|
6807
6818
|
}, zr = function(A) {
|
|
6808
6819
|
return nC.test(A);
|
|
6809
6820
|
}, sC = function(A) {
|
|
@@ -6839,35 +6850,35 @@ var kQ = function(A, t) {
|
|
|
6839
6850
|
return new A(this.end, this.endControl, this.startControl, this.start);
|
|
6840
6851
|
}, A;
|
|
6841
6852
|
})()
|
|
6842
|
-
),
|
|
6853
|
+
), wA = function(A) {
|
|
6843
6854
|
return A.type === 1;
|
|
6844
6855
|
}, oC = (
|
|
6845
6856
|
/** @class */
|
|
6846
6857
|
/* @__PURE__ */ (function() {
|
|
6847
6858
|
function A(t) {
|
|
6848
|
-
var e = t.styles, r = t.bounds, n = Vt(e.borderTopLeftRadius, r.width, r.height), i = n[0], s = n[1], o = Vt(e.borderTopRightRadius, r.width, r.height), a = o[0], B = o[1], c = Vt(e.borderBottomRightRadius, r.width, r.height), u = c[0], l = c[1], f = Vt(e.borderBottomLeftRadius, r.width, r.height), g = f[0],
|
|
6849
|
-
h.push((i + a) / r.width), h.push((g + u) / r.width), h.push((s +
|
|
6859
|
+
var e = t.styles, r = t.bounds, n = Vt(e.borderTopLeftRadius, r.width, r.height), i = n[0], s = n[1], o = Vt(e.borderTopRightRadius, r.width, r.height), a = o[0], B = o[1], c = Vt(e.borderBottomRightRadius, r.width, r.height), u = c[0], l = c[1], f = Vt(e.borderBottomLeftRadius, r.width, r.height), g = f[0], C = f[1], h = [];
|
|
6860
|
+
h.push((i + a) / r.width), h.push((g + u) / r.width), h.push((s + C) / r.height), h.push((B + l) / r.height);
|
|
6850
6861
|
var w = Math.max.apply(Math, h);
|
|
6851
|
-
w > 1 && (i /= w, s /= w, a /= w, B /= w, u /= w, l /= w, g /= w,
|
|
6852
|
-
var
|
|
6853
|
-
this.topLeftBorderDoubleOuterBox = i > 0 || s > 0 ? J(r.left + E / 3, r.top + d / 3, i - E / 3, s - d / 3,
|
|
6862
|
+
w > 1 && (i /= w, s /= w, a /= w, B /= w, u /= w, l /= w, g /= w, C /= w);
|
|
6863
|
+
var Q = r.width - a, U = r.height - l, p = r.width - u, F = r.height - C, d = e.borderTopWidth, y = e.borderRightWidth, v = e.borderBottomWidth, E = e.borderLeftWidth, L = P(e.paddingTop, t.bounds.width), m = P(e.paddingRight, t.bounds.width), K = P(e.paddingBottom, t.bounds.width), I = P(e.paddingLeft, t.bounds.width);
|
|
6864
|
+
this.topLeftBorderDoubleOuterBox = i > 0 || s > 0 ? J(r.left + E / 3, r.top + d / 3, i - E / 3, s - d / 3, G.TOP_LEFT) : new H(r.left + E / 3, r.top + d / 3), this.topRightBorderDoubleOuterBox = i > 0 || s > 0 ? J(r.left + Q, r.top + d / 3, a - y / 3, B - d / 3, G.TOP_RIGHT) : new H(r.left + r.width - y / 3, r.top + d / 3), this.bottomRightBorderDoubleOuterBox = u > 0 || l > 0 ? J(r.left + p, r.top + U, u - y / 3, l - v / 3, G.BOTTOM_RIGHT) : new H(r.left + r.width - y / 3, r.top + r.height - v / 3), this.bottomLeftBorderDoubleOuterBox = g > 0 || C > 0 ? J(r.left + E / 3, r.top + F, g - E / 3, C - v / 3, G.BOTTOM_LEFT) : new H(r.left + E / 3, r.top + r.height - v / 3), this.topLeftBorderDoubleInnerBox = i > 0 || s > 0 ? J(r.left + E * 2 / 3, r.top + d * 2 / 3, i - E * 2 / 3, s - d * 2 / 3, G.TOP_LEFT) : new H(r.left + E * 2 / 3, r.top + d * 2 / 3), this.topRightBorderDoubleInnerBox = i > 0 || s > 0 ? J(r.left + Q, r.top + d * 2 / 3, a - y * 2 / 3, B - d * 2 / 3, G.TOP_RIGHT) : new H(r.left + r.width - y * 2 / 3, r.top + d * 2 / 3), this.bottomRightBorderDoubleInnerBox = u > 0 || l > 0 ? J(r.left + p, r.top + U, u - y * 2 / 3, l - v * 2 / 3, G.BOTTOM_RIGHT) : new H(r.left + r.width - y * 2 / 3, r.top + r.height - v * 2 / 3), this.bottomLeftBorderDoubleInnerBox = g > 0 || C > 0 ? J(r.left + E * 2 / 3, r.top + F, g - E * 2 / 3, C - v * 2 / 3, G.BOTTOM_LEFT) : new H(r.left + E * 2 / 3, r.top + r.height - v * 2 / 3), this.topLeftBorderStroke = i > 0 || s > 0 ? J(r.left + E / 2, r.top + d / 2, i - E / 2, s - d / 2, G.TOP_LEFT) : new H(r.left + E / 2, r.top + d / 2), this.topRightBorderStroke = i > 0 || s > 0 ? J(r.left + Q, r.top + d / 2, a - y / 2, B - d / 2, G.TOP_RIGHT) : new H(r.left + r.width - y / 2, r.top + d / 2), this.bottomRightBorderStroke = u > 0 || l > 0 ? J(r.left + p, r.top + U, u - y / 2, l - v / 2, G.BOTTOM_RIGHT) : new H(r.left + r.width - y / 2, r.top + r.height - v / 2), this.bottomLeftBorderStroke = g > 0 || C > 0 ? J(r.left + E / 2, r.top + F, g - E / 2, C - v / 2, G.BOTTOM_LEFT) : new H(r.left + E / 2, r.top + r.height - v / 2), this.topLeftBorderBox = i > 0 || s > 0 ? J(r.left, r.top, i, s, G.TOP_LEFT) : new H(r.left, r.top), this.topRightBorderBox = a > 0 || B > 0 ? J(r.left + Q, r.top, a, B, G.TOP_RIGHT) : new H(r.left + r.width, r.top), this.bottomRightBorderBox = u > 0 || l > 0 ? J(r.left + p, r.top + U, u, l, G.BOTTOM_RIGHT) : new H(r.left + r.width, r.top + r.height), this.bottomLeftBorderBox = g > 0 || C > 0 ? J(r.left, r.top + F, g, C, G.BOTTOM_LEFT) : new H(r.left, r.top + r.height), this.topLeftPaddingBox = i > 0 || s > 0 ? J(r.left + E, r.top + d, Math.max(0, i - E), Math.max(0, s - d), G.TOP_LEFT) : new H(r.left + E, r.top + d), this.topRightPaddingBox = a > 0 || B > 0 ? J(r.left + Math.min(Q, r.width - y), r.top + d, Q > r.width + y ? 0 : Math.max(0, a - y), Math.max(0, B - d), G.TOP_RIGHT) : new H(r.left + r.width - y, r.top + d), this.bottomRightPaddingBox = u > 0 || l > 0 ? J(r.left + Math.min(p, r.width - E), r.top + Math.min(U, r.height - v), Math.max(0, u - y), Math.max(0, l - v), G.BOTTOM_RIGHT) : new H(r.left + r.width - y, r.top + r.height - v), this.bottomLeftPaddingBox = g > 0 || C > 0 ? J(r.left + E, r.top + Math.min(F, r.height - v), Math.max(0, g - E), Math.max(0, C - v), G.BOTTOM_LEFT) : new H(r.left + E, r.top + r.height - v), this.topLeftContentBox = i > 0 || s > 0 ? J(r.left + E + I, r.top + d + L, Math.max(0, i - (E + I)), Math.max(0, s - (d + L)), G.TOP_LEFT) : new H(r.left + E + I, r.top + d + L), this.topRightContentBox = a > 0 || B > 0 ? J(r.left + Math.min(Q, r.width + E + I), r.top + d + L, Q > r.width + E + I ? 0 : a - E + I, B - (d + L), G.TOP_RIGHT) : new H(r.left + r.width - (y + m), r.top + d + L), this.bottomRightContentBox = u > 0 || l > 0 ? J(r.left + Math.min(p, r.width - (E + I)), r.top + Math.min(U, r.height + d + L), Math.max(0, u - (y + m)), l - (v + K), G.BOTTOM_RIGHT) : new H(r.left + r.width - (y + m), r.top + r.height - (v + K)), this.bottomLeftContentBox = g > 0 || C > 0 ? J(r.left + E + I, r.top + F, Math.max(0, g - (E + I)), C - (v + K), G.BOTTOM_LEFT) : new H(r.left + E + I, r.top + r.height - (v + K));
|
|
6854
6865
|
}
|
|
6855
6866
|
return A;
|
|
6856
6867
|
})()
|
|
6857
|
-
),
|
|
6868
|
+
), G;
|
|
6858
6869
|
(function(A) {
|
|
6859
6870
|
A[A.TOP_LEFT = 0] = "TOP_LEFT", A[A.TOP_RIGHT = 1] = "TOP_RIGHT", A[A.BOTTOM_RIGHT = 2] = "BOTTOM_RIGHT", A[A.BOTTOM_LEFT = 3] = "BOTTOM_LEFT";
|
|
6860
|
-
})(
|
|
6871
|
+
})(G || (G = {}));
|
|
6861
6872
|
var J = function(A, t, e, r, n) {
|
|
6862
6873
|
var i = 4 * ((Math.sqrt(2) - 1) / 3), s = e * i, o = r * i, a = A + e, B = t + r;
|
|
6863
6874
|
switch (n) {
|
|
6864
|
-
case
|
|
6875
|
+
case G.TOP_LEFT:
|
|
6865
6876
|
return new xe(new H(A, B), new H(A, B - o), new H(a - s, t), new H(a, t));
|
|
6866
|
-
case
|
|
6877
|
+
case G.TOP_RIGHT:
|
|
6867
6878
|
return new xe(new H(A, t), new H(A + s, t), new H(a, B - o), new H(a, B));
|
|
6868
|
-
case
|
|
6879
|
+
case G.BOTTOM_RIGHT:
|
|
6869
6880
|
return new xe(new H(a, t), new H(a, t + o), new H(A + s, B), new H(A, B));
|
|
6870
|
-
case
|
|
6881
|
+
case G.BOTTOM_LEFT:
|
|
6871
6882
|
default:
|
|
6872
6883
|
return new xe(new H(a, B), new H(a - s, B), new H(A, t + o), new H(A, t));
|
|
6873
6884
|
}
|
|
@@ -6995,27 +7006,27 @@ var J = function(A, t, e, r, n) {
|
|
|
6995
7006
|
r = r.parent;
|
|
6996
7007
|
}
|
|
6997
7008
|
return n.filter(function(a) {
|
|
6998
|
-
return
|
|
7009
|
+
return j(a.target, t);
|
|
6999
7010
|
});
|
|
7000
7011
|
}, A;
|
|
7001
7012
|
})()
|
|
7002
7013
|
), kn = function(A, t, e, r) {
|
|
7003
7014
|
A.container.elements.forEach(function(n) {
|
|
7004
|
-
var i =
|
|
7015
|
+
var i = j(
|
|
7005
7016
|
n.flags,
|
|
7006
7017
|
4
|
|
7007
7018
|
/* CREATES_REAL_STACKING_CONTEXT */
|
|
7008
|
-
), s =
|
|
7019
|
+
), s = j(
|
|
7009
7020
|
n.flags,
|
|
7010
7021
|
2
|
|
7011
7022
|
/* CREATES_STACKING_CONTEXT */
|
|
7012
7023
|
), o = new Io(n, A);
|
|
7013
|
-
|
|
7024
|
+
j(
|
|
7014
7025
|
n.styles.display,
|
|
7015
7026
|
2048
|
|
7016
7027
|
/* LIST_ITEM */
|
|
7017
7028
|
) && r.push(o);
|
|
7018
|
-
var a =
|
|
7029
|
+
var a = j(
|
|
7019
7030
|
n.flags,
|
|
7020
7031
|
8
|
|
7021
7032
|
/* IS_LIST_OWNER */
|
|
@@ -7026,13 +7037,13 @@ var J = function(A, t, e, r, n) {
|
|
|
7026
7037
|
var u = n.styles.zIndex.order;
|
|
7027
7038
|
if (u < 0) {
|
|
7028
7039
|
var l = 0;
|
|
7029
|
-
B.negativeZIndex.some(function(g,
|
|
7030
|
-
return u > g.element.container.styles.zIndex.order ? (l =
|
|
7040
|
+
B.negativeZIndex.some(function(g, C) {
|
|
7041
|
+
return u > g.element.container.styles.zIndex.order ? (l = C, !1) : l > 0;
|
|
7031
7042
|
}), B.negativeZIndex.splice(l, 0, c);
|
|
7032
7043
|
} else if (u > 0) {
|
|
7033
7044
|
var f = 0;
|
|
7034
|
-
B.positiveZIndex.some(function(g,
|
|
7035
|
-
return u >= g.element.container.styles.zIndex.order ? (f =
|
|
7045
|
+
B.positiveZIndex.some(function(g, C) {
|
|
7046
|
+
return u >= g.element.container.styles.zIndex.order ? (f = C + 1, !1) : f > 0;
|
|
7036
7047
|
}), B.positiveZIndex.splice(f, 0, c);
|
|
7037
7048
|
} else
|
|
7038
7049
|
B.zeroOrAutoZIndexOrTransformedOrOpacity.push(c);
|
|
@@ -7041,7 +7052,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7041
7052
|
kn(o, c, i ? c : e, a);
|
|
7042
7053
|
} else
|
|
7043
7054
|
n.styles.isInlineLevel() ? t.inlineLevel.push(o) : t.nonInlineLevel.push(o), kn(o, t, e, a);
|
|
7044
|
-
|
|
7055
|
+
j(
|
|
7045
7056
|
n.flags,
|
|
7046
7057
|
8
|
|
7047
7058
|
/* IS_LIST_OWNER */
|
|
@@ -7058,38 +7069,38 @@ var J = function(A, t, e, r, n) {
|
|
|
7058
7069
|
}, Xs = function(A, t) {
|
|
7059
7070
|
switch (t) {
|
|
7060
7071
|
case 0:
|
|
7061
|
-
return
|
|
7072
|
+
return CA(A.topLeftBorderBox, A.topLeftPaddingBox, A.topRightBorderBox, A.topRightPaddingBox);
|
|
7062
7073
|
case 1:
|
|
7063
|
-
return
|
|
7074
|
+
return CA(A.topRightBorderBox, A.topRightPaddingBox, A.bottomRightBorderBox, A.bottomRightPaddingBox);
|
|
7064
7075
|
case 2:
|
|
7065
|
-
return
|
|
7076
|
+
return CA(A.bottomRightBorderBox, A.bottomRightPaddingBox, A.bottomLeftBorderBox, A.bottomLeftPaddingBox);
|
|
7066
7077
|
case 3:
|
|
7067
7078
|
default:
|
|
7068
|
-
return
|
|
7079
|
+
return CA(A.bottomLeftBorderBox, A.bottomLeftPaddingBox, A.topLeftBorderBox, A.topLeftPaddingBox);
|
|
7069
7080
|
}
|
|
7070
7081
|
}, wC = function(A, t) {
|
|
7071
7082
|
switch (t) {
|
|
7072
7083
|
case 0:
|
|
7073
|
-
return
|
|
7084
|
+
return CA(A.topLeftBorderBox, A.topLeftBorderDoubleOuterBox, A.topRightBorderBox, A.topRightBorderDoubleOuterBox);
|
|
7074
7085
|
case 1:
|
|
7075
|
-
return
|
|
7086
|
+
return CA(A.topRightBorderBox, A.topRightBorderDoubleOuterBox, A.bottomRightBorderBox, A.bottomRightBorderDoubleOuterBox);
|
|
7076
7087
|
case 2:
|
|
7077
|
-
return
|
|
7088
|
+
return CA(A.bottomRightBorderBox, A.bottomRightBorderDoubleOuterBox, A.bottomLeftBorderBox, A.bottomLeftBorderDoubleOuterBox);
|
|
7078
7089
|
case 3:
|
|
7079
7090
|
default:
|
|
7080
|
-
return
|
|
7091
|
+
return CA(A.bottomLeftBorderBox, A.bottomLeftBorderDoubleOuterBox, A.topLeftBorderBox, A.topLeftBorderDoubleOuterBox);
|
|
7081
7092
|
}
|
|
7082
7093
|
}, QC = function(A, t) {
|
|
7083
7094
|
switch (t) {
|
|
7084
7095
|
case 0:
|
|
7085
|
-
return
|
|
7096
|
+
return CA(A.topLeftBorderDoubleInnerBox, A.topLeftPaddingBox, A.topRightBorderDoubleInnerBox, A.topRightPaddingBox);
|
|
7086
7097
|
case 1:
|
|
7087
|
-
return
|
|
7098
|
+
return CA(A.topRightBorderDoubleInnerBox, A.topRightPaddingBox, A.bottomRightBorderDoubleInnerBox, A.bottomRightPaddingBox);
|
|
7088
7099
|
case 2:
|
|
7089
|
-
return
|
|
7100
|
+
return CA(A.bottomRightBorderDoubleInnerBox, A.bottomRightPaddingBox, A.bottomLeftBorderDoubleInnerBox, A.bottomLeftPaddingBox);
|
|
7090
7101
|
case 3:
|
|
7091
7102
|
default:
|
|
7092
|
-
return
|
|
7103
|
+
return CA(A.bottomLeftBorderDoubleInnerBox, A.bottomLeftPaddingBox, A.topLeftBorderDoubleInnerBox, A.topLeftPaddingBox);
|
|
7093
7104
|
}
|
|
7094
7105
|
}, CC = function(A, t) {
|
|
7095
7106
|
switch (t) {
|
|
@@ -7105,10 +7116,10 @@ var J = function(A, t, e, r, n) {
|
|
|
7105
7116
|
}
|
|
7106
7117
|
}, be = function(A, t) {
|
|
7107
7118
|
var e = [];
|
|
7108
|
-
return
|
|
7109
|
-
},
|
|
7119
|
+
return wA(A) ? e.push(A.subdivide(0.5, !1)) : e.push(A), wA(t) ? e.push(t.subdivide(0.5, !0)) : e.push(t), e;
|
|
7120
|
+
}, CA = function(A, t, e, r) {
|
|
7110
7121
|
var n = [];
|
|
7111
|
-
return
|
|
7122
|
+
return wA(A) ? n.push(A.subdivide(0.5, !1)) : n.push(A), wA(e) ? n.push(e.subdivide(0.5, !0)) : n.push(e), wA(r) ? n.push(r.subdivide(0.5, !0).reverse()) : n.push(r), wA(t) ? n.push(t.subdivide(0.5, !1).reverse()) : n.push(t), n;
|
|
7112
7123
|
}, Lo = function(A) {
|
|
7113
7124
|
var t = A.bounds, e = A.styles;
|
|
7114
7125
|
return t.add(e.borderLeftWidth, e.borderTopWidth, -(e.borderRightWidth + e.borderLeftWidth), -(e.borderTopWidth + e.borderBottomWidth));
|
|
@@ -7150,12 +7161,12 @@ var J = function(A, t, e, r, n) {
|
|
|
7150
7161
|
var f = c ? r : n * i, g = u ? n : r / i;
|
|
7151
7162
|
return [f, g];
|
|
7152
7163
|
}
|
|
7153
|
-
var
|
|
7154
|
-
return [
|
|
7164
|
+
var C = c ? r : e.width, h = u ? n : e.height;
|
|
7165
|
+
return [C, h];
|
|
7155
7166
|
}
|
|
7156
7167
|
if (a) {
|
|
7157
|
-
var w = 0,
|
|
7158
|
-
return z(s) ? w = P(s, e.width) : z(o) && (
|
|
7168
|
+
var w = 0, Q = 0;
|
|
7169
|
+
return z(s) ? w = P(s, e.width) : z(o) && (Q = P(o, e.height)), ft(s) ? w = Q * i : (!o || ft(o)) && (Q = w / i), [w, Q];
|
|
7159
7170
|
}
|
|
7160
7171
|
var U = null, p = null;
|
|
7161
7172
|
if (z(s) ? U = P(s, e.width) : o && z(o) && (p = P(o, e.height)), U !== null && (!o || ft(o)) && (p = c && u ? U / r * n : e.height), p !== null && ft(s) && (U = c && u ? p / n * r : e.width), U !== null && p !== null)
|
|
@@ -7262,7 +7273,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7262
7273
|
return aA(this, function(r) {
|
|
7263
7274
|
switch (r.label) {
|
|
7264
7275
|
case 0:
|
|
7265
|
-
if (
|
|
7276
|
+
if (j(
|
|
7266
7277
|
e.container.flags,
|
|
7267
7278
|
16
|
|
7268
7279
|
/* DEBUG_RENDER */
|
|
@@ -7305,14 +7316,14 @@ var J = function(A, t, e, r, n) {
|
|
|
7305
7316
|
var n, i, s, o, a, B, c, u, l = this;
|
|
7306
7317
|
return aA(this, function(f) {
|
|
7307
7318
|
return n = this.createFontStyle(r), i = n[0], s = n[1], o = n[2], this.ctx.font = i, this.ctx.direction = r.direction === 1 ? "rtl" : "ltr", this.ctx.textAlign = "left", this.ctx.textBaseline = "alphabetic", a = this.fontMetrics.getMetrics(s, o), B = a.baseline, c = a.middle, u = r.paintOrder, e.textBounds.forEach(function(g) {
|
|
7308
|
-
u.forEach(function(
|
|
7309
|
-
switch (
|
|
7319
|
+
u.forEach(function(C) {
|
|
7320
|
+
switch (C) {
|
|
7310
7321
|
case 0:
|
|
7311
|
-
l.ctx.fillStyle =
|
|
7322
|
+
l.ctx.fillStyle = AA(r.color), l.renderTextWithLetterSpacing(g, r.letterSpacing, B);
|
|
7312
7323
|
var h = r.textShadow;
|
|
7313
7324
|
h.length && g.text.trim().length && (h.slice(0).reverse().forEach(function(w) {
|
|
7314
|
-
l.ctx.shadowColor =
|
|
7315
|
-
}), l.ctx.shadowColor = "", l.ctx.shadowOffsetX = 0, l.ctx.shadowOffsetY = 0, l.ctx.shadowBlur = 0), r.textDecorationLine.length && (l.ctx.fillStyle =
|
|
7325
|
+
l.ctx.shadowColor = AA(w.color), l.ctx.shadowOffsetX = w.offsetX.number * l.options.scale, l.ctx.shadowOffsetY = w.offsetY.number * l.options.scale, l.ctx.shadowBlur = w.blur.number, l.renderTextWithLetterSpacing(g, r.letterSpacing, B);
|
|
7326
|
+
}), l.ctx.shadowColor = "", l.ctx.shadowOffsetX = 0, l.ctx.shadowOffsetY = 0, l.ctx.shadowBlur = 0), r.textDecorationLine.length && (l.ctx.fillStyle = AA(r.textDecorationColor || r.color), r.textDecorationLine.forEach(function(w) {
|
|
7316
7327
|
switch (w) {
|
|
7317
7328
|
case 1:
|
|
7318
7329
|
l.ctx.fillRect(g.bounds.left, Math.round(g.bounds.top + B), g.bounds.width, 1);
|
|
@@ -7327,7 +7338,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7327
7338
|
}));
|
|
7328
7339
|
break;
|
|
7329
7340
|
case 1:
|
|
7330
|
-
r.webkitTextStrokeWidth && g.text.trim().length && (l.ctx.strokeStyle =
|
|
7341
|
+
r.webkitTextStrokeWidth && g.text.trim().length && (l.ctx.strokeStyle = AA(r.webkitTextStrokeColor), l.ctx.lineWidth = r.webkitTextStrokeWidth, l.ctx.lineJoin = window.chrome ? "miter" : "round", l.ctx.strokeText(g.text, g.bounds.left, g.bounds.top + B)), l.ctx.strokeStyle = "", l.ctx.lineWidth = 0, l.ctx.lineJoin = "miter";
|
|
7331
7342
|
break;
|
|
7332
7343
|
}
|
|
7333
7344
|
});
|
|
@@ -7344,7 +7355,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7344
7355
|
}
|
|
7345
7356
|
}, t.prototype.renderNodeContent = function(e) {
|
|
7346
7357
|
return cA(this, void 0, void 0, function() {
|
|
7347
|
-
var r, n, i, s, o, a,
|
|
7358
|
+
var r, n, i, s, o, a, Q, Q, B, c, u, l, p, f, g, F, C, h, w, Q, U, p, F;
|
|
7348
7359
|
return aA(this, function(d) {
|
|
7349
7360
|
switch (d.label) {
|
|
7350
7361
|
case 0:
|
|
@@ -7364,7 +7375,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7364
7375
|
case 5:
|
|
7365
7376
|
return d.trys.push([5, 7, , 8]), [4, this.context.cache.match(r.src)];
|
|
7366
7377
|
case 6:
|
|
7367
|
-
return
|
|
7378
|
+
return Q = d.sent(), this.renderReplacedElement(r, n, Q), [3, 8];
|
|
7368
7379
|
case 7:
|
|
7369
7380
|
return d.sent(), this.context.logger.error("Error loading image " + r.src), [3, 8];
|
|
7370
7381
|
case 8:
|
|
@@ -7373,7 +7384,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7373
7384
|
case 9:
|
|
7374
7385
|
return d.trys.push([9, 11, , 12]), [4, this.context.cache.match(r.svg)];
|
|
7375
7386
|
case 10:
|
|
7376
|
-
return
|
|
7387
|
+
return Q = d.sent(), this.renderReplacedElement(r, n, Q), [3, 12];
|
|
7377
7388
|
case 11:
|
|
7378
7389
|
return d.sent(), this.context.logger.error("Error loading svg " + r.svg.substring(0, 255)), [3, 12];
|
|
7379
7390
|
case 12:
|
|
@@ -7396,40 +7407,40 @@ var J = function(A, t, e, r, n) {
|
|
|
7396
7407
|
new H(r.bounds.left + u * 0.72983, r.bounds.top + u * 0.23),
|
|
7397
7408
|
new H(r.bounds.left + u * 0.84, r.bounds.top + u * 0.34085),
|
|
7398
7409
|
new H(r.bounds.left + u * 0.39363, r.bounds.top + u * 0.79)
|
|
7399
|
-
]), this.ctx.fillStyle =
|
|
7400
|
-
switch (l = this.createFontStyle(i), p = l[0], f = l[1], g = this.fontMetrics.getMetrics(p, f).baseline, this.ctx.font = p, this.ctx.fillStyle =
|
|
7410
|
+
]), this.ctx.fillStyle = AA(Ss), this.ctx.fill(), this.ctx.restore()) : r.type === Ar && r.checked && (this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(r.bounds.left + u / 2, r.bounds.top + u / 2, u / 4, 0, Math.PI * 2, !0), this.ctx.fillStyle = AA(Ss), this.ctx.fill(), this.ctx.restore())), HC(r) && r.value.length) {
|
|
7411
|
+
switch (l = this.createFontStyle(i), p = l[0], f = l[1], g = this.fontMetrics.getMetrics(p, f).baseline, this.ctx.font = p, this.ctx.fillStyle = AA(i.color), this.ctx.textBaseline = "alphabetic", this.ctx.textAlign = xC(r.styles.textAlign), F = ir(r), C = 0, r.styles.textAlign) {
|
|
7401
7412
|
case 1:
|
|
7402
|
-
|
|
7413
|
+
C += F.width / 2;
|
|
7403
7414
|
break;
|
|
7404
7415
|
case 2:
|
|
7405
|
-
|
|
7416
|
+
C += F.width;
|
|
7406
7417
|
break;
|
|
7407
7418
|
}
|
|
7408
|
-
h = F.add(
|
|
7419
|
+
h = F.add(C, 0, 0, -F.height / 2 + 1), this.ctx.save(), this.path([
|
|
7409
7420
|
new H(F.left, F.top),
|
|
7410
7421
|
new H(F.left + F.width, F.top),
|
|
7411
7422
|
new H(F.left + F.width, F.top + F.height),
|
|
7412
7423
|
new H(F.left, F.top + F.height)
|
|
7413
7424
|
]), this.ctx.clip(), this.renderTextWithLetterSpacing(new Wt(r.value, h), i.letterSpacing, g), this.ctx.restore(), this.ctx.textBaseline = "alphabetic", this.ctx.textAlign = "left";
|
|
7414
7425
|
}
|
|
7415
|
-
if (!
|
|
7426
|
+
if (!j(
|
|
7416
7427
|
r.styles.display,
|
|
7417
7428
|
2048
|
|
7418
7429
|
/* LIST_ITEM */
|
|
7419
7430
|
)) return [3, 20];
|
|
7420
7431
|
if (r.styles.listStyleImage === null) return [3, 19];
|
|
7421
7432
|
if (w = r.styles.listStyleImage, w.type !== 0) return [3, 18];
|
|
7422
|
-
|
|
7433
|
+
Q = void 0, U = w.url, d.label = 15;
|
|
7423
7434
|
case 15:
|
|
7424
7435
|
return d.trys.push([15, 17, , 18]), [4, this.context.cache.match(U)];
|
|
7425
7436
|
case 16:
|
|
7426
|
-
return
|
|
7437
|
+
return Q = d.sent(), this.ctx.drawImage(Q, r.bounds.left - (Q.width + 10), r.bounds.top), [3, 18];
|
|
7427
7438
|
case 17:
|
|
7428
7439
|
return d.sent(), this.context.logger.error("Error loading list-style-image " + U), [3, 18];
|
|
7429
7440
|
case 18:
|
|
7430
7441
|
return [3, 20];
|
|
7431
7442
|
case 19:
|
|
7432
|
-
e.listValue && r.styles.listStyleType !== -1 && (p = this.createFontStyle(i)[0], this.ctx.font = p, this.ctx.fillStyle =
|
|
7443
|
+
e.listValue && r.styles.listStyleType !== -1 && (p = this.createFontStyle(i)[0], this.ctx.font = p, this.ctx.fillStyle = AA(i.color), this.ctx.textBaseline = "middle", this.ctx.textAlign = "right", F = new _A(r.bounds.left, r.bounds.top + P(r.styles.paddingTop, r.bounds.width), r.bounds.width, ws(i.lineHeight, i.fontSize.number) / 2 + 1), this.renderTextWithLetterSpacing(new Wt(e.listValue, F), i.letterSpacing, ws(i.lineHeight, i.fontSize.number) / 2 + 2), this.ctx.textBaseline = "bottom", this.ctx.textAlign = "left"), d.label = 20;
|
|
7433
7444
|
case 20:
|
|
7434
7445
|
return [
|
|
7435
7446
|
2
|
|
@@ -7440,11 +7451,11 @@ var J = function(A, t, e, r, n) {
|
|
|
7440
7451
|
});
|
|
7441
7452
|
}, t.prototype.renderStackContent = function(e) {
|
|
7442
7453
|
return cA(this, void 0, void 0, function() {
|
|
7443
|
-
var r, n, w, i, s, w, o, a, w, B, c, w, u, l, w, f, g, w,
|
|
7444
|
-
return aA(this, function(
|
|
7445
|
-
switch (
|
|
7454
|
+
var r, n, w, i, s, w, o, a, w, B, c, w, u, l, w, f, g, w, C, h, w;
|
|
7455
|
+
return aA(this, function(Q) {
|
|
7456
|
+
switch (Q.label) {
|
|
7446
7457
|
case 0:
|
|
7447
|
-
if (
|
|
7458
|
+
if (j(
|
|
7448
7459
|
e.element.container.flags,
|
|
7449
7460
|
16
|
|
7450
7461
|
/* DEBUG_RENDER */
|
|
@@ -7452,63 +7463,63 @@ var J = function(A, t, e, r, n) {
|
|
|
7452
7463
|
debugger;
|
|
7453
7464
|
return [4, this.renderNodeBackgroundAndBorders(e.element)];
|
|
7454
7465
|
case 1:
|
|
7455
|
-
|
|
7466
|
+
Q.sent(), r = 0, n = e.negativeZIndex, Q.label = 2;
|
|
7456
7467
|
case 2:
|
|
7457
7468
|
return r < n.length ? (w = n[r], [4, this.renderStack(w)]) : [3, 5];
|
|
7458
7469
|
case 3:
|
|
7459
|
-
|
|
7470
|
+
Q.sent(), Q.label = 4;
|
|
7460
7471
|
case 4:
|
|
7461
7472
|
return r++, [3, 2];
|
|
7462
7473
|
case 5:
|
|
7463
7474
|
return [4, this.renderNodeContent(e.element)];
|
|
7464
7475
|
case 6:
|
|
7465
|
-
|
|
7476
|
+
Q.sent(), i = 0, s = e.nonInlineLevel, Q.label = 7;
|
|
7466
7477
|
case 7:
|
|
7467
7478
|
return i < s.length ? (w = s[i], [4, this.renderNode(w)]) : [3, 10];
|
|
7468
7479
|
case 8:
|
|
7469
|
-
|
|
7480
|
+
Q.sent(), Q.label = 9;
|
|
7470
7481
|
case 9:
|
|
7471
7482
|
return i++, [3, 7];
|
|
7472
7483
|
case 10:
|
|
7473
|
-
o = 0, a = e.nonPositionedFloats,
|
|
7484
|
+
o = 0, a = e.nonPositionedFloats, Q.label = 11;
|
|
7474
7485
|
case 11:
|
|
7475
7486
|
return o < a.length ? (w = a[o], [4, this.renderStack(w)]) : [3, 14];
|
|
7476
7487
|
case 12:
|
|
7477
|
-
|
|
7488
|
+
Q.sent(), Q.label = 13;
|
|
7478
7489
|
case 13:
|
|
7479
7490
|
return o++, [3, 11];
|
|
7480
7491
|
case 14:
|
|
7481
|
-
B = 0, c = e.nonPositionedInlineLevel,
|
|
7492
|
+
B = 0, c = e.nonPositionedInlineLevel, Q.label = 15;
|
|
7482
7493
|
case 15:
|
|
7483
7494
|
return B < c.length ? (w = c[B], [4, this.renderStack(w)]) : [3, 18];
|
|
7484
7495
|
case 16:
|
|
7485
|
-
|
|
7496
|
+
Q.sent(), Q.label = 17;
|
|
7486
7497
|
case 17:
|
|
7487
7498
|
return B++, [3, 15];
|
|
7488
7499
|
case 18:
|
|
7489
|
-
u = 0, l = e.inlineLevel,
|
|
7500
|
+
u = 0, l = e.inlineLevel, Q.label = 19;
|
|
7490
7501
|
case 19:
|
|
7491
7502
|
return u < l.length ? (w = l[u], [4, this.renderNode(w)]) : [3, 22];
|
|
7492
7503
|
case 20:
|
|
7493
|
-
|
|
7504
|
+
Q.sent(), Q.label = 21;
|
|
7494
7505
|
case 21:
|
|
7495
7506
|
return u++, [3, 19];
|
|
7496
7507
|
case 22:
|
|
7497
|
-
f = 0, g = e.zeroOrAutoZIndexOrTransformedOrOpacity,
|
|
7508
|
+
f = 0, g = e.zeroOrAutoZIndexOrTransformedOrOpacity, Q.label = 23;
|
|
7498
7509
|
case 23:
|
|
7499
7510
|
return f < g.length ? (w = g[f], [4, this.renderStack(w)]) : [3, 26];
|
|
7500
7511
|
case 24:
|
|
7501
|
-
|
|
7512
|
+
Q.sent(), Q.label = 25;
|
|
7502
7513
|
case 25:
|
|
7503
7514
|
return f++, [3, 23];
|
|
7504
7515
|
case 26:
|
|
7505
|
-
|
|
7516
|
+
C = 0, h = e.positiveZIndex, Q.label = 27;
|
|
7506
7517
|
case 27:
|
|
7507
|
-
return
|
|
7518
|
+
return C < h.length ? (w = h[C], [4, this.renderStack(w)]) : [3, 30];
|
|
7508
7519
|
case 28:
|
|
7509
|
-
|
|
7520
|
+
Q.sent(), Q.label = 29;
|
|
7510
7521
|
case 29:
|
|
7511
|
-
return
|
|
7522
|
+
return C++, [3, 27];
|
|
7512
7523
|
case 30:
|
|
7513
7524
|
return [
|
|
7514
7525
|
2
|
|
@@ -7524,8 +7535,8 @@ var J = function(A, t, e, r, n) {
|
|
|
7524
7535
|
}, t.prototype.formatPath = function(e) {
|
|
7525
7536
|
var r = this;
|
|
7526
7537
|
e.forEach(function(n, i) {
|
|
7527
|
-
var s =
|
|
7528
|
-
i === 0 ? r.ctx.moveTo(s.x, s.y) : r.ctx.lineTo(s.x, s.y),
|
|
7538
|
+
var s = wA(n) ? n.start : n;
|
|
7539
|
+
i === 0 ? r.ctx.moveTo(s.x, s.y) : r.ctx.lineTo(s.x, s.y), wA(n) && r.ctx.bezierCurveTo(n.startControl.x, n.startControl.y, n.endControl.x, n.endControl.y, n.end.x, n.end.y);
|
|
7529
7540
|
});
|
|
7530
7541
|
}, t.prototype.renderRepeat = function(e, r, n, i) {
|
|
7531
7542
|
this.path(e), this.ctx.fillStyle = r, this.ctx.translate(n, i), this.ctx.fill(), this.ctx.translate(-n, -i);
|
|
@@ -7544,34 +7555,34 @@ var J = function(A, t, e, r, n) {
|
|
|
7544
7555
|
switch (B.label) {
|
|
7545
7556
|
case 0:
|
|
7546
7557
|
r = e.styles.backgroundImage.length - 1, n = function(c) {
|
|
7547
|
-
var u, l, f, L,
|
|
7548
|
-
return aA(this, function(
|
|
7549
|
-
switch (
|
|
7558
|
+
var u, l, f, L, M, _, I, b, v, g, L, M, _, I, b, C, h, w, Q, U, p, F, d, y, v, E, L, m, K, I, b, Y, M, _, X, D, O, V, N, nA, tA, BA;
|
|
7559
|
+
return aA(this, function(dA) {
|
|
7560
|
+
switch (dA.label) {
|
|
7550
7561
|
case 0:
|
|
7551
7562
|
if (c.type !== 0) return [3, 5];
|
|
7552
|
-
u = void 0, l = c.url,
|
|
7563
|
+
u = void 0, l = c.url, dA.label = 1;
|
|
7553
7564
|
case 1:
|
|
7554
|
-
return
|
|
7565
|
+
return dA.trys.push([1, 3, , 4]), [4, i.context.cache.match(l)];
|
|
7555
7566
|
case 2:
|
|
7556
|
-
return u =
|
|
7567
|
+
return u = dA.sent(), [3, 4];
|
|
7557
7568
|
case 3:
|
|
7558
|
-
return
|
|
7569
|
+
return dA.sent(), i.context.logger.error("Error loading background-image " + l), [3, 4];
|
|
7559
7570
|
case 4:
|
|
7560
7571
|
return u && (f = jr(e, r, [
|
|
7561
7572
|
u.width,
|
|
7562
7573
|
u.height,
|
|
7563
7574
|
u.width / u.height
|
|
7564
|
-
]), L = f[0],
|
|
7575
|
+
]), L = f[0], M = f[1], _ = f[2], I = f[3], b = f[4], v = i.ctx.createPattern(i.resizeImage(u, I, b), "repeat"), i.renderRepeat(L, v, M, _)), [3, 6];
|
|
7565
7576
|
case 5:
|
|
7566
|
-
lh(c) ? (g = jr(e, r, [null, null, null]), L = g[0],
|
|
7567
|
-
return y.addColorStop($.stop,
|
|
7568
|
-
}), d.fillStyle = y, d.fillRect(0, 0, I, b), I > 0 && b > 0 && (v = i.ctx.createPattern(F, "repeat"), i.renderRepeat(L, v,
|
|
7577
|
+
lh(c) ? (g = jr(e, r, [null, null, null]), L = g[0], M = g[1], _ = g[2], I = g[3], b = g[4], C = ah(c.angle, I, b), h = C[0], w = C[1], Q = C[2], U = C[3], p = C[4], F = document.createElement("canvas"), F.width = I, F.height = b, d = F.getContext("2d"), y = d.createLinearGradient(w, U, Q, p), gs(c.stops, h).forEach(function($) {
|
|
7578
|
+
return y.addColorStop($.stop, AA($.color));
|
|
7579
|
+
}), d.fillStyle = y, d.fillRect(0, 0, I, b), I > 0 && b > 0 && (v = i.ctx.createPattern(F, "repeat"), i.renderRepeat(L, v, M, _))) : fh(c) && (E = jr(e, r, [
|
|
7569
7580
|
null,
|
|
7570
7581
|
null,
|
|
7571
7582
|
null
|
|
7572
|
-
]), L = E[0], m = E[1],
|
|
7573
|
-
return
|
|
7574
|
-
}), i.path(L), i.ctx.fillStyle =
|
|
7583
|
+
]), L = E[0], m = E[1], K = E[2], I = E[3], b = E[4], Y = c.position.length === 0 ? [ei] : c.position, M = P(Y[0], I), _ = P(Y[Y.length - 1], b), X = oh(c, M, _, I, b), D = X[0], O = X[1], D > 0 && O > 0 && (V = i.ctx.createRadialGradient(m + M, K + _, 0, m + M, K + _, D), gs(c.stops, D * 2).forEach(function($) {
|
|
7584
|
+
return V.addColorStop($.stop, AA($.color));
|
|
7585
|
+
}), i.path(L), i.ctx.fillStyle = V, D !== O ? (N = e.bounds.left + 0.5 * e.bounds.width, nA = e.bounds.top + 0.5 * e.bounds.height, tA = O / D, BA = 1 / tA, i.ctx.save(), i.ctx.translate(N, nA), i.ctx.transform(1, 0, 0, tA, 0, 0), i.ctx.translate(-N, -nA), i.ctx.fillRect(m, BA * (K - nA) + nA, I, b * BA), i.ctx.restore()) : i.ctx.fill())), dA.label = 6;
|
|
7575
7586
|
case 6:
|
|
7576
7587
|
return r--, [
|
|
7577
7588
|
2
|
|
@@ -7597,7 +7608,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7597
7608
|
}, t.prototype.renderSolidBorder = function(e, r, n) {
|
|
7598
7609
|
return cA(this, void 0, void 0, function() {
|
|
7599
7610
|
return aA(this, function(i) {
|
|
7600
|
-
return this.path(Xs(n, r)), this.ctx.fillStyle =
|
|
7611
|
+
return this.path(Xs(n, r)), this.ctx.fillStyle = AA(e), this.ctx.fill(), [
|
|
7601
7612
|
2
|
|
7602
7613
|
/*return*/
|
|
7603
7614
|
];
|
|
@@ -7616,7 +7627,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7616
7627
|
/*return*/
|
|
7617
7628
|
];
|
|
7618
7629
|
case 2:
|
|
7619
|
-
return s = wC(i, n), this.path(s), this.ctx.fillStyle =
|
|
7630
|
+
return s = wC(i, n), this.path(s), this.ctx.fillStyle = AA(e), this.ctx.fill(), o = QC(i, n), this.path(o), this.ctx.fill(), [
|
|
7620
7631
|
2
|
|
7621
7632
|
/*return*/
|
|
7622
7633
|
];
|
|
@@ -7637,12 +7648,12 @@ var J = function(A, t, e, r, n) {
|
|
|
7637
7648
|
{ style: r.borderRightStyle, color: r.borderRightColor, width: r.borderRightWidth },
|
|
7638
7649
|
{ style: r.borderBottomStyle, color: r.borderBottomColor, width: r.borderBottomWidth },
|
|
7639
7650
|
{ style: r.borderLeftStyle, color: r.borderLeftColor, width: r.borderLeftWidth }
|
|
7640
|
-
], s = IC(ht(r.backgroundClip, 0), e.curves), n || r.boxShadow.length ? (this.ctx.save(), this.path(s), this.ctx.clip(), JA(r.backgroundColor) || (this.ctx.fillStyle =
|
|
7651
|
+
], s = IC(ht(r.backgroundClip, 0), e.curves), n || r.boxShadow.length ? (this.ctx.save(), this.path(s), this.ctx.clip(), JA(r.backgroundColor) || (this.ctx.fillStyle = AA(r.backgroundColor), this.ctx.fill()), [4, this.renderBackgroundImage(e.container)]) : [3, 2];
|
|
7641
7652
|
case 1:
|
|
7642
7653
|
l.sent(), this.ctx.restore(), r.boxShadow.slice(0).reverse().forEach(function(f) {
|
|
7643
7654
|
u.ctx.save();
|
|
7644
|
-
var g = rr(e.curves),
|
|
7645
|
-
f.inset ? (u.path(g), u.ctx.clip(), u.mask(h)) : (u.mask(g), u.ctx.clip(), u.path(h)), u.ctx.shadowOffsetX = f.offsetX.number +
|
|
7655
|
+
var g = rr(e.curves), C = f.inset ? 0 : EC, h = gC(g, -C + (f.inset ? 1 : -1) * f.spread.number, (f.inset ? 1 : -1) * f.spread.number, f.spread.number * (f.inset ? -2 : 2), f.spread.number * (f.inset ? -2 : 2));
|
|
7656
|
+
f.inset ? (u.path(g), u.ctx.clip(), u.mask(h)) : (u.mask(g), u.ctx.clip(), u.path(h)), u.ctx.shadowOffsetX = f.offsetX.number + C, u.ctx.shadowOffsetY = f.offsetY.number, u.ctx.shadowColor = AA(f.color), u.ctx.shadowBlur = f.blur.number, u.ctx.fillStyle = f.inset ? AA(f.color) : "rgba(0,0,0,1)", u.ctx.fill(), u.ctx.restore();
|
|
7646
7657
|
}), l.label = 2;
|
|
7647
7658
|
case 2:
|
|
7648
7659
|
o = 0, a = 0, B = i, l.label = 3;
|
|
@@ -7690,9 +7701,9 @@ var J = function(A, t, e, r, n) {
|
|
|
7690
7701
|
});
|
|
7691
7702
|
}, t.prototype.renderDashedDottedBorder = function(e, r, n, i, s) {
|
|
7692
7703
|
return cA(this, void 0, void 0, function() {
|
|
7693
|
-
var o, a, B, c, u, l, f, g,
|
|
7704
|
+
var o, a, B, c, u, l, f, g, C, h, w, Q, U, p, F, d, F, d;
|
|
7694
7705
|
return aA(this, function(y) {
|
|
7695
|
-
return this.ctx.save(), o = CC(i, n), a = Xs(i, n), s === 2 && (this.path(a), this.ctx.clip()),
|
|
7706
|
+
return this.ctx.save(), o = CC(i, n), a = Xs(i, n), s === 2 && (this.path(a), this.ctx.clip()), wA(a[0]) ? (B = a[0].start.x, c = a[0].start.y) : (B = a[0].x, c = a[0].y), wA(a[1]) ? (u = a[1].end.x, l = a[1].end.y) : (u = a[1].x, l = a[1].y), n === 0 || n === 2 ? f = Math.abs(B - u) : f = Math.abs(c - l), this.ctx.beginPath(), s === 3 ? this.formatPath(o) : this.formatPath(a.slice(0, 2)), g = r < 3 ? r * 3 : r * 2, C = r < 3 ? r * 2 : r, s === 3 && (g = r, C = r), h = !0, f <= g * 2 ? h = !1 : f <= g * 2 + C ? (w = f / (2 * g + C), g *= w, C *= w) : (Q = Math.floor((f + C) / (g + C)), U = (f - Q * g) / (Q - 1), p = (f - (Q + 1) * g) / Q, C = p <= 0 || Math.abs(C - U) < Math.abs(C - p) ? U : p), h && (s === 3 ? this.ctx.setLineDash([0, g + C]) : this.ctx.setLineDash([g, C])), s === 3 ? (this.ctx.lineCap = "round", this.ctx.lineWidth = r) : this.ctx.lineWidth = r * 2 + 1.1, this.ctx.strokeStyle = AA(e), this.ctx.stroke(), this.ctx.setLineDash([]), s === 2 && (wA(a[0]) && (F = a[3], d = a[0], this.ctx.beginPath(), this.formatPath([new H(F.end.x, F.end.y), new H(d.start.x, d.start.y)]), this.ctx.stroke()), wA(a[1]) && (F = a[1], d = a[2], this.ctx.beginPath(), this.formatPath([new H(F.end.x, F.end.y), new H(d.start.x, d.start.y)]), this.ctx.stroke())), this.ctx.restore(), [
|
|
7696
7707
|
2
|
|
7697
7708
|
/*return*/
|
|
7698
7709
|
];
|
|
@@ -7704,7 +7715,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7704
7715
|
return aA(this, function(n) {
|
|
7705
7716
|
switch (n.label) {
|
|
7706
7717
|
case 0:
|
|
7707
|
-
return this.options.backgroundColor && (this.ctx.fillStyle =
|
|
7718
|
+
return this.options.backgroundColor && (this.ctx.fillStyle = AA(this.options.backgroundColor), this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height)), r = hC(e), [4, this.renderStack(r)];
|
|
7708
7719
|
case 1:
|
|
7709
7720
|
return n.sent(), this.applyEffects([]), [2, this.canvas];
|
|
7710
7721
|
}
|
|
@@ -7754,7 +7765,7 @@ var J = function(A, t, e, r, n) {
|
|
|
7754
7765
|
case 0:
|
|
7755
7766
|
return r = _n(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, e), [4, SC(r)];
|
|
7756
7767
|
case 1:
|
|
7757
|
-
return n = i.sent(), this.options.backgroundColor && (this.ctx.fillStyle =
|
|
7768
|
+
return n = i.sent(), this.options.backgroundColor && (this.ctx.fillStyle = AA(this.options.backgroundColor), this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale)), this.ctx.drawImage(n, -this.options.x * this.options.scale, -this.options.y * this.options.scale), [2, this.canvas];
|
|
7758
7769
|
}
|
|
7759
7770
|
});
|
|
7760
7771
|
});
|
|
@@ -7809,9 +7820,9 @@ var J = function(A, t, e, r, n) {
|
|
|
7809
7820
|
typeof window < "u" && Eo.setContext(window);
|
|
7810
7821
|
var _C = function(A, t) {
|
|
7811
7822
|
return cA(void 0, void 0, void 0, function() {
|
|
7812
|
-
var e, r, n, i, s, o, a, B, c, u, l, f, g,
|
|
7813
|
-
return aA(this, function(
|
|
7814
|
-
switch (
|
|
7823
|
+
var e, r, n, i, s, o, a, B, c, u, l, f, g, C, h, w, Q, U, p, F, y, d, y, v, E, L, m, K, I, b, Y, M, _, X, D, O, V, N, nA, tA;
|
|
7824
|
+
return aA(this, function(BA) {
|
|
7825
|
+
switch (BA.label) {
|
|
7815
7826
|
case 0:
|
|
7816
7827
|
if (!A || typeof A != "object")
|
|
7817
7828
|
return [2, Promise.reject("Invalid element provided as first argument")];
|
|
@@ -7825,35 +7836,35 @@ var _C = function(A, t) {
|
|
|
7825
7836
|
proxy: t.proxy,
|
|
7826
7837
|
useCORS: (L = t.useCORS) !== null && L !== void 0 ? L : !1
|
|
7827
7838
|
}, i = pn({ logging: (m = t.logging) !== null && m !== void 0 ? m : !0, cache: t.cache }, n), s = {
|
|
7828
|
-
windowWidth: (
|
|
7839
|
+
windowWidth: (K = t.windowWidth) !== null && K !== void 0 ? K : r.innerWidth,
|
|
7829
7840
|
windowHeight: (I = t.windowHeight) !== null && I !== void 0 ? I : r.innerHeight,
|
|
7830
7841
|
scrollX: (b = t.scrollX) !== null && b !== void 0 ? b : r.pageXOffset,
|
|
7831
7842
|
scrollY: (Y = t.scrollY) !== null && Y !== void 0 ? Y : r.pageYOffset
|
|
7832
|
-
}, o = new _A(s.scrollX, s.scrollY, s.windowWidth, s.windowHeight), a = new TC(i, o), B = (
|
|
7833
|
-
allowTaint: (
|
|
7843
|
+
}, o = new _A(s.scrollX, s.scrollY, s.windowWidth, s.windowHeight), a = new TC(i, o), B = (M = t.foreignObjectRendering) !== null && M !== void 0 ? M : !1, c = {
|
|
7844
|
+
allowTaint: (_ = t.allowTaint) !== null && _ !== void 0 ? _ : !1,
|
|
7834
7845
|
onclone: t.onclone,
|
|
7835
7846
|
ignoreElements: t.ignoreElements,
|
|
7836
7847
|
inlineImages: B,
|
|
7837
7848
|
copyStyles: B
|
|
7838
7849
|
}, a.logger.debug("Starting document clone with size " + o.width + "x" + o.height + " scrolled to " + -o.left + "," + -o.top), u = new Vs(a, A, c), l = u.clonedReferenceElement, l ? [4, u.toIFrame(e, o)] : [2, Promise.reject("Unable to find element in cloned iframe")];
|
|
7839
7850
|
case 1:
|
|
7840
|
-
return f =
|
|
7851
|
+
return f = BA.sent(), g = ai(l) || OQ(l) ? gf(l.ownerDocument) : ur(a, l), C = g.width, h = g.height, w = g.left, Q = g.top, U = OC(a, l, t.backgroundColor), p = {
|
|
7841
7852
|
canvas: t.canvas,
|
|
7842
7853
|
backgroundColor: U,
|
|
7843
|
-
scale: (
|
|
7844
|
-
x: ((
|
|
7845
|
-
y: ((
|
|
7846
|
-
width: (
|
|
7847
|
-
height: (
|
|
7854
|
+
scale: (D = (X = t.scale) !== null && X !== void 0 ? X : r.devicePixelRatio) !== null && D !== void 0 ? D : 1,
|
|
7855
|
+
x: ((O = t.x) !== null && O !== void 0 ? O : 0) + w,
|
|
7856
|
+
y: ((V = t.y) !== null && V !== void 0 ? V : 0) + Q,
|
|
7857
|
+
width: (N = t.width) !== null && N !== void 0 ? N : Math.ceil(C),
|
|
7858
|
+
height: (nA = t.height) !== null && nA !== void 0 ? nA : Math.ceil(h)
|
|
7848
7859
|
}, B ? (a.logger.debug("Document cloned, using foreign object rendering"), y = new KC(a, p), [4, y.render(l)]) : [3, 3];
|
|
7849
7860
|
case 2:
|
|
7850
|
-
return F =
|
|
7861
|
+
return F = BA.sent(), [3, 5];
|
|
7851
7862
|
case 3:
|
|
7852
|
-
return a.logger.debug("Document cloned, element located at " + w + "," +
|
|
7863
|
+
return a.logger.debug("Document cloned, element located at " + w + "," + Q + " with size " + C + "x" + h + " using computed rendering"), a.logger.debug("Starting DOM parsing"), d = wo(a, l), U === d.styles.backgroundColor && (d.styles.backgroundColor = TA.TRANSPARENT), a.logger.debug("Starting renderer for element at " + p.x + "," + p.y + " with size " + p.width + "x" + p.height), y = new mC(a, p), [4, y.render(d)];
|
|
7853
7864
|
case 4:
|
|
7854
|
-
F =
|
|
7865
|
+
F = BA.sent(), BA.label = 5;
|
|
7855
7866
|
case 5:
|
|
7856
|
-
return (!((
|
|
7867
|
+
return (!((tA = t.removeContainer) !== null && tA !== void 0) || tA) && (Vs.destroy(f) || a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")), a.logger.debug("Finished rendering"), [2, F];
|
|
7857
7868
|
}
|
|
7858
7869
|
});
|
|
7859
7870
|
});
|
|
@@ -7863,11 +7874,11 @@ var _C = function(A, t) {
|
|
|
7863
7874
|
};
|
|
7864
7875
|
class RC extends WA {
|
|
7865
7876
|
constructor(t) {
|
|
7866
|
-
super(), this.points = t, this.type =
|
|
7867
|
-
const r = e.coreLayers[
|
|
7877
|
+
super(), this.points = t, this.type = S.Scatter, this.draw = (e) => {
|
|
7878
|
+
const r = e.coreLayers[S.BaseLayer], { animationDuration: n } = e.globals, { getHtmlId: i } = e, s = r.append("g"), o = this.points.map((a, B) => {
|
|
7868
7879
|
var u, l, f;
|
|
7869
7880
|
const c = tt(a.bands, e);
|
|
7870
|
-
return s.append("circle").attr("id", `${i(
|
|
7881
|
+
return s.append("circle").attr("id", `${i(S.Scatter)}-${B}`).attr("pointer-events", "none").attr("cx", c.x(a.x)).attr("cy", c.y(a.y)).attr("r", ((u = a.style) == null ? void 0 : u.radius) || "0.2%").attr("fill", ((l = a.style) == null ? void 0 : l.color) || "black").style("opacity", ((f = a.style) == null ? void 0 : f.opacity) || 1);
|
|
7871
7882
|
});
|
|
7872
7883
|
this.zoom = async () => {
|
|
7873
7884
|
const a = [];
|
|
@@ -7881,16 +7892,16 @@ class RC extends WA {
|
|
|
7881
7892
|
}
|
|
7882
7893
|
class NC extends WA {
|
|
7883
7894
|
constructor() {
|
|
7884
|
-
super(), this.type =
|
|
7895
|
+
super(), this.type = S.Area, this.lineBoundaryInfo = [], this.customTween = (e, r, n, i, s) => {
|
|
7885
7896
|
const o = e.lowResLinesSC[n], a = tt(e.linesDC[n].bands, s), B = {
|
|
7886
7897
|
x: [a.x(i.x[0]), a.x(i.x[1])],
|
|
7887
7898
|
y: [a.y(i.y[0]), a.y(i.y[1])]
|
|
7888
7899
|
}, c = this.lineBoundaryInfo[r][n], { yCoordForXAxisSC: u, xMinSC: l, xMaxSC: f } = c;
|
|
7889
7900
|
return (g) => {
|
|
7890
|
-
const
|
|
7901
|
+
const C = o.map(({ x: K, y: I }) => e.getNewPoint(K, I, g)), h = dt(C, s), w = e.getNewPoint(0, u, g).y, Q = e.getNewPoint(l, 0, g).x, U = e.getNewPoint(f, 0, g).x, p = {
|
|
7891
7902
|
...c,
|
|
7892
7903
|
yCoordForXAxisSC: w,
|
|
7893
|
-
xMinSC:
|
|
7904
|
+
xMinSC: Q,
|
|
7894
7905
|
xMaxSC: U
|
|
7895
7906
|
}, F = e.getNewPointInverse(B.x[0], B.y[0], g), d = e.getNewPointInverse(B.x[1], B.y[1], g), y = e.getNewPoint(F.x, F.y, 1), v = e.getNewPoint(d.x, d.y, 1), E = { x: a.x.invert(y.x), y: a.y.invert(y.y) }, L = { x: a.x.invert(v.x), y: a.y.invert(v.y) }, m = {
|
|
7896
7907
|
x: [E.x, L.x],
|
|
@@ -7899,26 +7910,26 @@ class NC extends WA {
|
|
|
7899
7910
|
return this.closeSvgPath(h, B, m, p);
|
|
7900
7911
|
};
|
|
7901
7912
|
}, this.closeSvgPath = (e, r, n, i) => {
|
|
7902
|
-
const { yCoordForXAxisSC: s, xMinSC: o, xMaxSC: a, xMinDC: B, xMaxDC: c, canvasPath: u } = i, [l, f] = r.y, [g,
|
|
7913
|
+
const { yCoordForXAxisSC: s, xMinSC: o, xMaxSC: a, xMinDC: B, xMaxDC: c, canvasPath: u } = i, [l, f] = r.y, [g, C] = n.y;
|
|
7903
7914
|
let h;
|
|
7904
7915
|
f < s && s < l ? h = s : f >= s ? h = f : h = l;
|
|
7905
|
-
const w = Math.max(r.x[0], o),
|
|
7916
|
+
const w = Math.max(r.x[0], o), Q = Math.min(r.x[1], a), U = Math.max(n.x[0], B), p = Math.min(n.x[1], c), F = (U + p) / 2;
|
|
7906
7917
|
if (e.length > 0) {
|
|
7907
|
-
const d = e[0].split("L")[0].substring(1).split(",").map(parseFloat)[1], y = `M${w},${h}L${w},${d}`, v = e[e.length - 1].split("L").at(-1).split(",").map(parseFloat)[1], E = `L${
|
|
7918
|
+
const d = e[0].split("L")[0].substring(1).split(",").map(parseFloat)[1], y = `M${w},${h}L${w},${d}`, v = e[e.length - 1].split("L").at(-1).split(",").map(parseFloat)[1], E = `L${Q},${v}L${Q},${h}Z`, L = e.map((m) => "L" + m.substring(1)).join("");
|
|
7908
7919
|
return y + L + E;
|
|
7909
7920
|
}
|
|
7910
7921
|
if (h === s) {
|
|
7911
7922
|
const d = {
|
|
7912
7923
|
x: F,
|
|
7913
|
-
y:
|
|
7924
|
+
y: C / 2
|
|
7914
7925
|
};
|
|
7915
|
-
return this.ctx.isPointInPath(u, d.x, d.y) ? Kr(w,
|
|
7926
|
+
return this.ctx.isPointInPath(u, d.x, d.y) ? Kr(w, Q, f, s) : Kr(w, Q, l, s);
|
|
7916
7927
|
} else {
|
|
7917
7928
|
const d = {
|
|
7918
7929
|
x: F,
|
|
7919
|
-
y: (
|
|
7930
|
+
y: (C + g) / 2
|
|
7920
7931
|
};
|
|
7921
|
-
return this.ctx.isPointInPath(u, d.x, d.y) ? Kr(w,
|
|
7932
|
+
return this.ctx.isPointInPath(u, d.x, d.y) ? Kr(w, Q, l, f) : "";
|
|
7922
7933
|
}
|
|
7923
7934
|
};
|
|
7924
7935
|
const t = document.createElement("canvas");
|
|
@@ -7926,11 +7937,11 @@ class NC extends WA {
|
|
|
7926
7937
|
}
|
|
7927
7938
|
draw(t, e) {
|
|
7928
7939
|
if (t.chartOptions.logScale.y) return;
|
|
7929
|
-
const r = t.optionalLayers.filter((i) => i.type ===
|
|
7940
|
+
const r = t.optionalLayers.filter((i) => i.type === S.Trace);
|
|
7930
7941
|
this.lineBoundaryInfo = r.map((i) => i.linesDC.map(() => null));
|
|
7931
7942
|
const n = r.map((i, s) => i.linesDC.map((o, a) => {
|
|
7932
7943
|
if (!o.fill || o.points.length === 0) return;
|
|
7933
|
-
const B = tt(o.bands, t), c = i.lowResLinesSC[a], { x: u } = Ha(o.points), l = o.points.map((y) => `L${y.x},${y.y}`).join(""), { x: f } = o.points[0], g = `M${f},0`, { x:
|
|
7944
|
+
const B = tt(o.bands, t), c = i.lowResLinesSC[a], { x: u } = Ha(o.points), l = o.points.map((y) => `L${y.x},${y.y}`).join(""), { x: f } = o.points[0], g = `M${f},0`, { x: C } = o.points[o.points.length - 1], h = `L${C},0Z`, w = g + l + h, U = {
|
|
7934
7945
|
// these are one time calculation
|
|
7935
7946
|
canvasPath: new Path2D(w),
|
|
7936
7947
|
xMinDC: u.start,
|
|
@@ -7945,7 +7956,7 @@ class NC extends WA {
|
|
|
7945
7956
|
x: [B.x(e.x[0]), B.x(e.x[1])],
|
|
7946
7957
|
y: [B.y(e.y[0]), B.y(e.y[1])]
|
|
7947
7958
|
}, F = dt(c, t), d = this.closeSvgPath(F, p, e, U);
|
|
7948
|
-
return t.coreLayers[
|
|
7959
|
+
return t.coreLayers[S.BaseLayer].append("path").attr("fill", o.style.fillColor || "black").attr("opacity", o.style.fillOpacity || 0.1).attr("d", d);
|
|
7949
7960
|
}));
|
|
7950
7961
|
this.zoom = async (i) => {
|
|
7951
7962
|
const s = [];
|
|
@@ -7970,8 +7981,8 @@ class NC extends WA {
|
|
|
7970
7981
|
const l = {
|
|
7971
7982
|
x: [c.x(i.x[0]), c.x(i.x[1])],
|
|
7972
7983
|
y: [c.y(i.y[0]), c.y(i.y[1])]
|
|
7973
|
-
}, f = r[o].lowResLinesSC[B], g = dt(f, t),
|
|
7974
|
-
a.attr("d",
|
|
7984
|
+
}, f = r[o].lowResLinesSC[B], g = dt(f, t), C = this.closeSvgPath(g, l, i, this.lineBoundaryInfo[o][B]);
|
|
7985
|
+
a.attr("d", C);
|
|
7975
7986
|
});
|
|
7976
7987
|
});
|
|
7977
7988
|
};
|
|
@@ -7979,7 +7990,7 @@ class NC extends WA {
|
|
|
7979
7990
|
}
|
|
7980
7991
|
class GC extends WA {
|
|
7981
7992
|
constructor() {
|
|
7982
|
-
super(), this.type =
|
|
7993
|
+
super(), this.type = S.Custom;
|
|
7983
7994
|
}
|
|
7984
7995
|
draw() {
|
|
7985
7996
|
}
|
|
@@ -8014,10 +8025,10 @@ class VC {
|
|
|
8014
8025
|
const u = [];
|
|
8015
8026
|
for (let l = 0; l < a.length; l++) {
|
|
8016
8027
|
const f = a[l];
|
|
8017
|
-
let g = f.points[0] && f.points[0][B] > 0,
|
|
8028
|
+
let g = f.points[0] && f.points[0][B] > 0, C = { ...f, points: [] };
|
|
8018
8029
|
for (let h = 0; h < f.points.length; h++)
|
|
8019
|
-
f.points[h][B] <= 0 && (c = `You have tried to use ${B} axis log scale but there are traces with ${B} coordinates that are <= 0`), f.points[h][B] > 0 ? (
|
|
8020
|
-
g && u.push(
|
|
8030
|
+
f.points[h][B] <= 0 && (c = `You have tried to use ${B} axis log scale but there are traces with ${B} coordinates that are <= 0`), f.points[h][B] > 0 ? (C.points.push(f.points[h]), g = !0) : g && (u.push(C), C = { ...f, points: [] }, g = !1);
|
|
8031
|
+
g && u.push(C);
|
|
8021
8032
|
}
|
|
8022
8033
|
return c && console.warn(c), u;
|
|
8023
8034
|
}, this.filterLines = (a) => {
|
|
@@ -8061,18 +8072,18 @@ class VC {
|
|
|
8061
8072
|
};
|
|
8062
8073
|
}, this.processScales = (a) => {
|
|
8063
8074
|
var U, p, F, d;
|
|
8064
|
-
const B = this.optionalLayers.filter((y) => y.type ===
|
|
8075
|
+
const B = this.optionalLayers.filter((y) => y.type === S.Trace), c = this.optionalLayers.filter((y) => y.type === S.Scatter);
|
|
8065
8076
|
let u = B.reduce((y, v) => [...v.linesDC.map((E) => E.points).flat(), ...y], []);
|
|
8066
8077
|
u = c.reduce((y, v) => [...v.points.map((E) => ({ x: E.x, y: E.y })), ...y], u);
|
|
8067
|
-
const l = Ha(u), f = 0.02, g = 0.03,
|
|
8078
|
+
const l = Ha(u), f = 0.02, g = 0.03, C = this.options.logScale.x ? this.addLogPadding : this.addLinearPadding, h = this.options.logScale.y ? this.addLogPadding : this.addLinearPadding, w = C(l.x, f), Q = h(l.y, g);
|
|
8068
8079
|
return {
|
|
8069
8080
|
x: {
|
|
8070
8081
|
start: ((U = a.x) == null ? void 0 : U.start) ?? w.start,
|
|
8071
8082
|
end: ((p = a.x) == null ? void 0 : p.end) ?? w.end
|
|
8072
8083
|
},
|
|
8073
8084
|
y: {
|
|
8074
|
-
start: ((F = a.y) == null ? void 0 : F.start) ??
|
|
8075
|
-
end: ((d = a.y) == null ? void 0 : d.end) ??
|
|
8085
|
+
start: ((F = a.y) == null ? void 0 : F.start) ?? Q.start,
|
|
8086
|
+
end: ((d = a.y) == null ? void 0 : d.end) ?? Q.end
|
|
8076
8087
|
}
|
|
8077
8088
|
};
|
|
8078
8089
|
}, this.appendClipPath = (a, B, c, u) => {
|
|
@@ -8083,69 +8094,61 @@ class VC {
|
|
|
8083
8094
|
...a.margin,
|
|
8084
8095
|
...B.margin
|
|
8085
8096
|
}
|
|
8086
|
-
}, { width: f, height: g, margin:
|
|
8087
|
-
return h.append("svg:rect").attr("width", f -
|
|
8097
|
+
}, { width: f, height: g, margin: C } = l, h = c.append("defs").append("svg:clipPath").attr("id", u(S.ClipPath));
|
|
8098
|
+
return h.append("svg:rect").attr("width", f - C.right - C.left).attr("height", g - C.bottom - C.top).attr("x", C.left).attr("y", C.top), { clipPath: h, clipPathBounds: l };
|
|
8088
8099
|
}, this.draw = (a, B, c, u, l = {}, f = {}) => {
|
|
8089
|
-
var
|
|
8090
|
-
const g = (
|
|
8100
|
+
var M, _, X, D;
|
|
8101
|
+
const g = (O) => `${O}-${this.id}`, { height: C, width: h, margin: w } = B;
|
|
8091
8102
|
this.autoscaledMaxExtents = this.processScales(c);
|
|
8092
|
-
const
|
|
8093
|
-
x: [((
|
|
8094
|
-
y: [((
|
|
8095
|
-
}
|
|
8096
|
-
if (this.options.logScale.x && v.x.some((
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
console.warn(E);
|
|
8103
|
-
const { y: K } = this.processScales({});
|
|
8104
|
-
v.y = [K.start, K.end];
|
|
8105
|
-
}
|
|
8106
|
-
const L = [w.left, h - w.right], m = [Q - w.bottom, w.top], I = (this.options.logScale.x ? dn : Cn)().domain(v.x).range(L), Y = (this.options.logScale.y ? dn : Cn)().domain(v.y).range(m);
|
|
8107
|
-
Object.entries(this.globals.tickConfig.numerical).forEach(([K, V]) => {
|
|
8108
|
-
var BA;
|
|
8109
|
-
const tA = K;
|
|
8103
|
+
const Q = na("svg").attr("id", g(S.Svg)).attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${h} ${C}`).attr("style", "overflow: visible;").attr("preserveAspectRatio", "xMinYMin"), { clipPath: U, clipPathBounds: p } = this.appendClipPath(B, f, Q, g), F = Q.append("g").attr("id", g(S.BaseLayer)).attr("clip-path", `url(#${g(S.ClipPath)})`), { x: d, y } = this.autoscaledMaxExtents, v = {
|
|
8104
|
+
x: [((M = u.x) == null ? void 0 : M.start) ?? d.start, ((_ = u.x) == null ? void 0 : _.end) ?? d.end],
|
|
8105
|
+
y: [((X = u.y) == null ? void 0 : X.start) ?? y.start, ((D = u.y) == null ? void 0 : D.end) ?? y.end]
|
|
8106
|
+
};
|
|
8107
|
+
if (this.options.logScale.x && v.x.some((O) => O <= 0) || this.options.logScale.y && v.y.some((O) => O <= 0))
|
|
8108
|
+
throw new Error("You have tried to use a log scale axis but the initial extents includes 0. Please set the initial extents to a range that does not include 0, or pass {} to default to the auto-scale.");
|
|
8109
|
+
const E = [w.left, h - w.right], L = [C - w.bottom, w.top], K = (this.options.logScale.x ? dn : Cn)().domain(v.x).range(E), b = (this.options.logScale.y ? dn : Cn)().domain(v.y).range(L);
|
|
8110
|
+
Object.entries(this.globals.tickConfig.numerical).forEach(([O, V]) => {
|
|
8111
|
+
var nA;
|
|
8112
|
+
const N = O;
|
|
8110
8113
|
if (V.count === void 0) {
|
|
8111
|
-
let
|
|
8112
|
-
h < 450 && (
|
|
8114
|
+
let tA = 10;
|
|
8115
|
+
h < 450 && (tA = 6), h < 250 && (tA = 3), (nA = l[N]) != null && nA.length && (tA = v[N][0] < 0 && v[N][1] > 0 ? 1 : 0), this.globals.tickConfig.numerical[N].count = tA;
|
|
8113
8116
|
}
|
|
8114
8117
|
});
|
|
8115
|
-
const
|
|
8118
|
+
const Y = {
|
|
8116
8119
|
id: this.id,
|
|
8117
8120
|
getHtmlId: g,
|
|
8118
8121
|
bounds: B,
|
|
8119
8122
|
clipPathBounds: p,
|
|
8120
8123
|
globals: this.globals,
|
|
8121
8124
|
scaleConfig: {
|
|
8122
|
-
numericalScales: { x:
|
|
8125
|
+
numericalScales: { x: K, y: b },
|
|
8123
8126
|
scaleExtents: this.autoscaledMaxExtents,
|
|
8124
8127
|
categoricalScales: {
|
|
8125
|
-
x: this.createCategoricalScale(l.x,
|
|
8126
|
-
y: this.createCategoricalScale(l.y,
|
|
8128
|
+
x: this.createCategoricalScale(l.x, E, K, "x"),
|
|
8129
|
+
y: this.createCategoricalScale(l.y, L, b, "y")
|
|
8127
8130
|
}
|
|
8128
8131
|
},
|
|
8129
8132
|
coreLayers: {
|
|
8130
|
-
[
|
|
8131
|
-
[
|
|
8132
|
-
[
|
|
8133
|
+
[S.Svg]: Q,
|
|
8134
|
+
[S.ClipPath]: U,
|
|
8135
|
+
[S.BaseLayer]: F
|
|
8133
8136
|
},
|
|
8134
8137
|
optionalLayers: this.optionalLayers,
|
|
8135
8138
|
chartOptions: this.options
|
|
8136
8139
|
};
|
|
8137
|
-
a.childNodes.forEach((
|
|
8140
|
+
a.childNodes.forEach((O) => O.remove()), this.optionalLayers.forEach((O) => O.draw(Y, v)), a.append(Y.coreLayers[S.Svg].node());
|
|
8138
8141
|
}, this.appendTo = (a, B = {}, c = {}, u = {}, l = {}, f = {}) => {
|
|
8139
|
-
const g = (w,
|
|
8140
|
-
const U = { width: w, height:
|
|
8142
|
+
const g = (w, Q) => {
|
|
8143
|
+
const U = { width: w, height: Q, margin: { ...this.defaultMargin, ...l } };
|
|
8141
8144
|
this.draw(a, U, B, c, u, f);
|
|
8142
|
-
}, { width:
|
|
8143
|
-
return g(
|
|
8144
|
-
const { blockSize: U, inlineSize: p } =
|
|
8145
|
+
}, { width: C, height: h } = a.getBoundingClientRect();
|
|
8146
|
+
return g(C, h), this.isResponsive && (new ResizeObserver((Q) => {
|
|
8147
|
+
const { blockSize: U, inlineSize: p } = Q[0].borderBoxSize[0];
|
|
8145
8148
|
g(p, U);
|
|
8146
|
-
}).observe(a), window.addEventListener("resize", (
|
|
8147
|
-
if (!
|
|
8148
|
-
const { innerHeight: U, innerWidth: p } =
|
|
8149
|
+
}).observe(a), window.addEventListener("resize", (Q) => {
|
|
8150
|
+
if (!Q.view) return;
|
|
8151
|
+
const { innerHeight: U, innerWidth: p } = Q.view;
|
|
8149
8152
|
g(p, U);
|
|
8150
8153
|
})), this.exportToPng = async (w = "graph.png") => {
|
|
8151
8154
|
const U = (await MC(a)).toDataURL("image/png"), p = document.createElement("a");
|
|
@@ -8154,9 +8157,9 @@ class VC {
|
|
|
8154
8157
|
}, this.createCategoricalScale = (a, B, c, u) => {
|
|
8155
8158
|
if (!(a != null && a.length))
|
|
8156
8159
|
return;
|
|
8157
|
-
const l = pa().domain(a).range(B), f = l.bandwidth(), g = a.reduce((
|
|
8158
|
-
const w = l(h),
|
|
8159
|
-
return
|
|
8160
|
+
const l = pa().domain(a).range(B), f = l.bandwidth(), g = a.reduce((C, h) => {
|
|
8161
|
+
const w = l(h), Q = u === "x" ? [w, w + f] : [w + f, w];
|
|
8162
|
+
return C[h] = c.copy().range(Q), C;
|
|
8160
8163
|
}, {});
|
|
8161
8164
|
return { main: l, bands: g };
|
|
8162
8165
|
}, this.options = {
|
|
@@ -8178,6 +8181,6 @@ class VC {
|
|
|
8178
8181
|
}
|
|
8179
8182
|
export {
|
|
8180
8183
|
VC as Chart,
|
|
8181
|
-
|
|
8184
|
+
S as LayerType,
|
|
8182
8185
|
WA as OptionalLayer
|
|
8183
8186
|
};
|