@orbcharts/core 4.0.0 → 4.0.1
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/orbcharts-core.es.js +203 -203
- package/dist/orbcharts-core.umd.js +3 -3
- package/package.json +1 -1
- package/src/chart/createChart.ts +8 -0
|
@@ -148,17 +148,17 @@ function wt(t, e, r) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
function a(y, A) {
|
|
151
|
-
n[y] && (s[y] = function(
|
|
151
|
+
n[y] && (s[y] = function(m) {
|
|
152
152
|
return new Promise(function(d, b) {
|
|
153
|
-
o.push([y,
|
|
153
|
+
o.push([y, m, d, b]) > 1 || c(y, m);
|
|
154
154
|
});
|
|
155
155
|
}, A && (s[y] = A(s[y])));
|
|
156
156
|
}
|
|
157
157
|
function c(y, A) {
|
|
158
158
|
try {
|
|
159
159
|
i(n[y](A));
|
|
160
|
-
} catch (
|
|
161
|
-
S(o[0][3],
|
|
160
|
+
} catch (m) {
|
|
161
|
+
S(o[0][3], m);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
function i(y) {
|
|
@@ -233,8 +233,8 @@ var ve = function() {
|
|
|
233
233
|
var i = c.value;
|
|
234
234
|
i.remove(this);
|
|
235
235
|
}
|
|
236
|
-
} catch (
|
|
237
|
-
e = { error:
|
|
236
|
+
} catch (m) {
|
|
237
|
+
e = { error: m };
|
|
238
238
|
} finally {
|
|
239
239
|
try {
|
|
240
240
|
c && !c.done && (r = a.return) && r.call(a);
|
|
@@ -248,8 +248,8 @@ var ve = function() {
|
|
|
248
248
|
if (V(f))
|
|
249
249
|
try {
|
|
250
250
|
f();
|
|
251
|
-
} catch (
|
|
252
|
-
o =
|
|
251
|
+
} catch (m) {
|
|
252
|
+
o = m instanceof Ae ? m.errors : [m];
|
|
253
253
|
}
|
|
254
254
|
var w = this._finalizers;
|
|
255
255
|
if (w) {
|
|
@@ -259,12 +259,12 @@ var ve = function() {
|
|
|
259
259
|
var A = y.value;
|
|
260
260
|
try {
|
|
261
261
|
je(A);
|
|
262
|
-
} catch (
|
|
263
|
-
o = o ?? [],
|
|
262
|
+
} catch (m) {
|
|
263
|
+
o = o ?? [], m instanceof Ae ? o = fe(fe([], le(o)), le(m.errors)) : o.push(m);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
} catch (
|
|
267
|
-
n = { error:
|
|
266
|
+
} catch (m) {
|
|
267
|
+
n = { error: m };
|
|
268
268
|
} finally {
|
|
269
269
|
try {
|
|
270
270
|
y && !y.done && (s = S.return) && s.call(S);
|
|
@@ -1283,25 +1283,25 @@ function lt(t) {
|
|
|
1283
1283
|
return new oe();
|
|
1284
1284
|
} : e, n = t.resetOnError, s = n === void 0 ? !0 : n, o = t.resetOnComplete, u = o === void 0 ? !0 : o, a = t.resetOnRefCountZero, c = a === void 0 ? !0 : a;
|
|
1285
1285
|
return function(i) {
|
|
1286
|
-
var f, w, S, y = 0, A = !1,
|
|
1286
|
+
var f, w, S, y = 0, A = !1, m = !1, d = function() {
|
|
1287
1287
|
w == null || w.unsubscribe(), w = void 0;
|
|
1288
1288
|
}, b = function() {
|
|
1289
|
-
d(), f = S = void 0, A =
|
|
1289
|
+
d(), f = S = void 0, A = m = !1;
|
|
1290
1290
|
}, O = function() {
|
|
1291
1291
|
var I = f;
|
|
1292
1292
|
b(), I == null || I.unsubscribe();
|
|
1293
1293
|
};
|
|
1294
1294
|
return z(function(I, h) {
|
|
1295
|
-
y++, !
|
|
1295
|
+
y++, !m && !A && d();
|
|
1296
1296
|
var p = S = S ?? r();
|
|
1297
1297
|
h.add(function() {
|
|
1298
|
-
y--, y === 0 && !
|
|
1298
|
+
y--, y === 0 && !m && !A && (w = Se(O, c));
|
|
1299
1299
|
}), p.subscribe(h), !f && y > 0 && (f = new ye({
|
|
1300
1300
|
next: function(E) {
|
|
1301
1301
|
return p.next(E);
|
|
1302
1302
|
},
|
|
1303
1303
|
error: function(E) {
|
|
1304
|
-
|
|
1304
|
+
m = !0, d(), w = Se(b, s, E), p.error(E);
|
|
1305
1305
|
},
|
|
1306
1306
|
complete: function() {
|
|
1307
1307
|
A = !0, d(), w = Se(b, u), p.complete();
|
|
@@ -1753,50 +1753,50 @@ const Fe = {
|
|
|
1753
1753
|
const u = [];
|
|
1754
1754
|
return o.forEach((a, c) => {
|
|
1755
1755
|
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1756
|
-
i.forEach((
|
|
1757
|
-
const d = $(
|
|
1758
|
-
f.has(d) || f.set(d, []), f.get(d).push(
|
|
1756
|
+
i.forEach((m) => {
|
|
1757
|
+
const d = $(m, e.series, "");
|
|
1758
|
+
f.has(d) || f.set(d, []), f.get(d).push(m);
|
|
1759
1759
|
});
|
|
1760
1760
|
let w = Array.from(f.keys());
|
|
1761
1761
|
if (Array.isArray(e.series.sort))
|
|
1762
|
-
w = e.series.sort.filter((
|
|
1762
|
+
w = e.series.sort.filter((m) => f.has(m)).concat(w.filter((m) => !e.series.sort.includes(m)));
|
|
1763
1763
|
else if (e.series.sort === "original") {
|
|
1764
|
-
const
|
|
1764
|
+
const m = [];
|
|
1765
1765
|
i.forEach((d) => {
|
|
1766
1766
|
const b = $(d, e.series, "");
|
|
1767
|
-
|
|
1768
|
-
}), w =
|
|
1769
|
-
} else e.series.sort === "alphabetical" && w.sort((
|
|
1767
|
+
m.includes(b) || m.push(b);
|
|
1768
|
+
}), w = m;
|
|
1769
|
+
} else e.series.sort === "alphabetical" && w.sort((m, d) => m.localeCompare(d, void 0, { numeric: !0 }));
|
|
1770
1770
|
const S = [];
|
|
1771
1771
|
if (e.category.sort === "original")
|
|
1772
|
-
i.forEach((
|
|
1773
|
-
const d = $(
|
|
1772
|
+
i.forEach((m) => {
|
|
1773
|
+
const d = $(m, e.category, "");
|
|
1774
1774
|
S.includes(d) || S.push(d);
|
|
1775
1775
|
});
|
|
1776
1776
|
else if (e.category.sort === "alphabetical") {
|
|
1777
|
-
const
|
|
1777
|
+
const m = /* @__PURE__ */ new Set();
|
|
1778
1778
|
i.forEach((d) => {
|
|
1779
|
-
|
|
1780
|
-
}), S.push(...Array.from(
|
|
1779
|
+
m.add($(d, e.category, ""));
|
|
1780
|
+
}), S.push(...Array.from(m).sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 })));
|
|
1781
1781
|
} else if (Array.isArray(e.category.sort)) {
|
|
1782
|
-
const
|
|
1782
|
+
const m = [];
|
|
1783
1783
|
i.forEach((b) => {
|
|
1784
1784
|
const O = $(b, e.category, "");
|
|
1785
|
-
|
|
1785
|
+
m.includes(O) || m.push(O);
|
|
1786
1786
|
});
|
|
1787
1787
|
const d = e.category.sort;
|
|
1788
1788
|
S.push(
|
|
1789
|
-
...d.filter((b) =>
|
|
1790
|
-
...
|
|
1789
|
+
...d.filter((b) => m.includes(b)),
|
|
1790
|
+
...m.filter((b) => !d.includes(b))
|
|
1791
1791
|
);
|
|
1792
1792
|
}
|
|
1793
1793
|
const y = /* @__PURE__ */ new Map();
|
|
1794
|
-
S.forEach((
|
|
1795
|
-
y.set(
|
|
1794
|
+
S.forEach((m, d) => {
|
|
1795
|
+
y.set(m, d);
|
|
1796
1796
|
});
|
|
1797
1797
|
const A = [];
|
|
1798
|
-
w.forEach((
|
|
1799
|
-
const b = f.get(
|
|
1798
|
+
w.forEach((m, d) => {
|
|
1799
|
+
const b = f.get(m), O = /* @__PURE__ */ new Map();
|
|
1800
1800
|
b.forEach((p) => {
|
|
1801
1801
|
const E = $(p, e.category, "");
|
|
1802
1802
|
O.has(E) || O.set(E, []), O.get(E).push(p);
|
|
@@ -1805,7 +1805,7 @@ const Fe = {
|
|
|
1805
1805
|
e.category.sort === "original" && e.value.aggregate === "none" ? (b.forEach((p, E) => {
|
|
1806
1806
|
const k = $(p, e.category, ""), C = y.get(k), l = p[e.value.from];
|
|
1807
1807
|
h.push({
|
|
1808
|
-
id: p.id || `${a}-${
|
|
1808
|
+
id: p.id || `${a}-${m}-${k}-${E}`,
|
|
1809
1809
|
index: C,
|
|
1810
1810
|
// Series 模式下 index 對應 categoryIndex
|
|
1811
1811
|
modelType: "series",
|
|
@@ -1818,7 +1818,7 @@ const Fe = {
|
|
|
1818
1818
|
categoryIndex: C,
|
|
1819
1819
|
datasetIndex: c
|
|
1820
1820
|
}, r),
|
|
1821
|
-
series:
|
|
1821
|
+
series: m,
|
|
1822
1822
|
seriesIndex: d,
|
|
1823
1823
|
category: k,
|
|
1824
1824
|
categoryIndex: C
|
|
@@ -1826,10 +1826,10 @@ const Fe = {
|
|
|
1826
1826
|
}), e.value.sort === "asc" ? h.sort((p, E) => p.value === null && E.value === null ? 0 : p.value === null ? 1 : E.value === null ? -1 : p.value - E.value) : e.value.sort === "desc" && h.sort((p, E) => p.value === null && E.value === null ? 0 : p.value === null ? 1 : E.value === null ? -1 : E.value - p.value)) : I.forEach((p) => {
|
|
1827
1827
|
const E = y.get(p), k = O.get(p);
|
|
1828
1828
|
if (e.value.aggregate === "none") {
|
|
1829
|
-
let C = k.map((l,
|
|
1829
|
+
let C = k.map((l, g) => {
|
|
1830
1830
|
const T = l[e.value.from];
|
|
1831
1831
|
return {
|
|
1832
|
-
id: l.id || `${a}-${
|
|
1832
|
+
id: l.id || `${a}-${m}-${p}-${g}`,
|
|
1833
1833
|
index: E,
|
|
1834
1834
|
// Series 模式下 index 對應 categoryIndex
|
|
1835
1835
|
modelType: "series",
|
|
@@ -1842,26 +1842,26 @@ const Fe = {
|
|
|
1842
1842
|
categoryIndex: E,
|
|
1843
1843
|
datasetIndex: c
|
|
1844
1844
|
}, r),
|
|
1845
|
-
series:
|
|
1845
|
+
series: m,
|
|
1846
1846
|
seriesIndex: d,
|
|
1847
1847
|
category: p,
|
|
1848
1848
|
categoryIndex: E
|
|
1849
1849
|
};
|
|
1850
1850
|
});
|
|
1851
|
-
e.value.sort === "asc" ? C.sort((l,
|
|
1851
|
+
e.value.sort === "asc" ? C.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : l.value - g.value) : e.value.sort === "desc" && C.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : g.value - l.value), h.push(...C);
|
|
1852
1852
|
} else {
|
|
1853
1853
|
const C = k.map((B) => {
|
|
1854
1854
|
if (e.value.aggregate === "count")
|
|
1855
1855
|
return 1;
|
|
1856
|
-
const
|
|
1857
|
-
return typeof
|
|
1858
|
-
}), l = de(C, e.value.aggregate),
|
|
1859
|
-
id:
|
|
1856
|
+
const v = B[e.value.from];
|
|
1857
|
+
return typeof v == "number" ? v : null;
|
|
1858
|
+
}), l = de(C, e.value.aggregate), g = k[0], T = {
|
|
1859
|
+
id: g.id || `${a}-${m}-${p}-aggregated`,
|
|
1860
1860
|
index: E,
|
|
1861
1861
|
// Series 模式下 index 對應 categoryIndex
|
|
1862
1862
|
modelType: "series",
|
|
1863
|
-
name:
|
|
1864
|
-
data:
|
|
1863
|
+
name: g.name || p,
|
|
1864
|
+
data: g.data,
|
|
1865
1865
|
value: l,
|
|
1866
1866
|
color: D(e.color.by, {
|
|
1867
1867
|
index: E,
|
|
@@ -1869,7 +1869,7 @@ const Fe = {
|
|
|
1869
1869
|
categoryIndex: E,
|
|
1870
1870
|
datasetIndex: c
|
|
1871
1871
|
}, r),
|
|
1872
|
-
series:
|
|
1872
|
+
series: m,
|
|
1873
1873
|
seriesIndex: d,
|
|
1874
1874
|
category: p,
|
|
1875
1875
|
categoryIndex: E
|
|
@@ -1930,7 +1930,7 @@ const Fe = {
|
|
|
1930
1930
|
const y = new Set(S);
|
|
1931
1931
|
let A = Array.from(y);
|
|
1932
1932
|
Array.isArray(e.category.sort) ? A = e.category.sort.filter((d) => y.has(d)).concat(A.filter((d) => !e.category.sort.includes(d))) : e.category.sort === "original" ? A = S : e.category.sort === "alphabetical" && A.sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 }));
|
|
1933
|
-
const
|
|
1933
|
+
const m = [];
|
|
1934
1934
|
w.forEach((d, b) => {
|
|
1935
1935
|
const O = f.get(d), I = /* @__PURE__ */ new Map();
|
|
1936
1936
|
O.forEach((p) => {
|
|
@@ -1960,10 +1960,10 @@ const Fe = {
|
|
|
1960
1960
|
categoryIndex: E
|
|
1961
1961
|
});
|
|
1962
1962
|
else if (e.value.aggregate === "none") {
|
|
1963
|
-
let C = k.map((l,
|
|
1963
|
+
let C = k.map((l, g) => {
|
|
1964
1964
|
const T = l[e.value.from];
|
|
1965
1965
|
return {
|
|
1966
|
-
id: l.id || `${a}-${d}-${p}-${
|
|
1966
|
+
id: l.id || `${a}-${d}-${p}-${g}`,
|
|
1967
1967
|
index: E,
|
|
1968
1968
|
// Grid 模式下 index 對應 categoryIndex
|
|
1969
1969
|
modelType: "grid",
|
|
@@ -1982,20 +1982,20 @@ const Fe = {
|
|
|
1982
1982
|
categoryIndex: E
|
|
1983
1983
|
};
|
|
1984
1984
|
});
|
|
1985
|
-
e.value.sort === "asc" ? C.sort((l,
|
|
1985
|
+
e.value.sort === "asc" ? C.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : l.value - g.value) : e.value.sort === "desc" && C.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : g.value - l.value), h.push(...C);
|
|
1986
1986
|
} else {
|
|
1987
1987
|
const C = k.map((B) => {
|
|
1988
1988
|
if (e.value.aggregate === "count")
|
|
1989
1989
|
return 1;
|
|
1990
|
-
const
|
|
1991
|
-
return typeof
|
|
1992
|
-
}), l = de(C, e.value.aggregate),
|
|
1993
|
-
id:
|
|
1990
|
+
const v = B[e.value.from];
|
|
1991
|
+
return typeof v == "number" ? v : null;
|
|
1992
|
+
}), l = de(C, e.value.aggregate), g = k[0], T = {
|
|
1993
|
+
id: g.id || `${a}-${d}-${p}-aggregated`,
|
|
1994
1994
|
index: E,
|
|
1995
1995
|
// Grid 模式下 index 對應 categoryIndex
|
|
1996
1996
|
modelType: "grid",
|
|
1997
|
-
name:
|
|
1998
|
-
data:
|
|
1997
|
+
name: g.name || p,
|
|
1998
|
+
data: g.data,
|
|
1999
1999
|
value: l,
|
|
2000
2000
|
color: D(e.color.by, {
|
|
2001
2001
|
index: E,
|
|
@@ -2010,8 +2010,8 @@ const Fe = {
|
|
|
2010
2010
|
};
|
|
2011
2011
|
h.push(T);
|
|
2012
2012
|
}
|
|
2013
|
-
}),
|
|
2014
|
-
}), u.push(
|
|
2013
|
+
}), m.push(h);
|
|
2014
|
+
}), u.push(m);
|
|
2015
2015
|
}), u;
|
|
2016
2016
|
}, Fr = (t, e, r) => {
|
|
2017
2017
|
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
@@ -2052,14 +2052,14 @@ const Fe = {
|
|
|
2052
2052
|
else if (e.series.sort === "original") {
|
|
2053
2053
|
const y = [];
|
|
2054
2054
|
i.forEach((A) => {
|
|
2055
|
-
const
|
|
2056
|
-
y.includes(
|
|
2055
|
+
const m = $(A, e.series, "");
|
|
2056
|
+
y.includes(m) || y.push(m);
|
|
2057
2057
|
}), w = y;
|
|
2058
2058
|
} else e.series.sort === "alphabetical" && w.sort((y, A) => y.localeCompare(A, void 0, { numeric: !0 }));
|
|
2059
2059
|
const S = [];
|
|
2060
2060
|
w.forEach((y, A) => {
|
|
2061
|
-
const
|
|
2062
|
-
|
|
2061
|
+
const m = f.get(y), d = /* @__PURE__ */ new Map();
|
|
2062
|
+
m.forEach((I) => {
|
|
2063
2063
|
const h = $(I, e.category, "");
|
|
2064
2064
|
d.has(h) || d.set(h, []), d.get(h).push(I);
|
|
2065
2065
|
});
|
|
@@ -2068,7 +2068,7 @@ const Fe = {
|
|
|
2068
2068
|
b = e.category.sort.filter((I) => d.has(I)).concat(b.filter((I) => !e.category.sort.includes(I)));
|
|
2069
2069
|
else if (e.category.sort === "original") {
|
|
2070
2070
|
const I = [];
|
|
2071
|
-
|
|
2071
|
+
m.forEach((h) => {
|
|
2072
2072
|
const p = $(h, e.category, "");
|
|
2073
2073
|
I.includes(p) || I.push(p);
|
|
2074
2074
|
}), b = I;
|
|
@@ -2076,11 +2076,11 @@ const Fe = {
|
|
|
2076
2076
|
const O = [];
|
|
2077
2077
|
b.forEach((I, h) => {
|
|
2078
2078
|
d.get(I).forEach((E, k) => {
|
|
2079
|
-
const C = e.multivariate.map((
|
|
2079
|
+
const C = e.multivariate.map((g, T) => ({
|
|
2080
2080
|
index: T,
|
|
2081
|
-
name:
|
|
2081
|
+
name: g.name,
|
|
2082
2082
|
value: (() => {
|
|
2083
|
-
const B = E[
|
|
2083
|
+
const B = E[g.from];
|
|
2084
2084
|
return typeof B == "number" ? B : null;
|
|
2085
2085
|
})()
|
|
2086
2086
|
})), l = {
|
|
@@ -2150,36 +2150,36 @@ const Fe = {
|
|
|
2150
2150
|
return a.forEach((i, f) => {
|
|
2151
2151
|
const w = u.get(i), S = [], y = /* @__PURE__ */ new Map();
|
|
2152
2152
|
w.forEach((l) => {
|
|
2153
|
-
const
|
|
2154
|
-
y.has(
|
|
2153
|
+
const g = $(l, e.series, "");
|
|
2154
|
+
y.has(g) || y.set(g, []), y.get(g).push(l);
|
|
2155
2155
|
});
|
|
2156
2156
|
let A = Array.from(y.keys());
|
|
2157
2157
|
if (Array.isArray(e.series.sort))
|
|
2158
2158
|
A = e.series.sort.filter((l) => y.has(l)).concat(A.filter((l) => !e.series.sort.includes(l)));
|
|
2159
2159
|
else if (e.series.sort === "original") {
|
|
2160
2160
|
const l = [];
|
|
2161
|
-
w.forEach((
|
|
2162
|
-
const T = $(
|
|
2161
|
+
w.forEach((g) => {
|
|
2162
|
+
const T = $(g, e.series, "");
|
|
2163
2163
|
l.includes(T) || l.push(T);
|
|
2164
2164
|
}), A = l;
|
|
2165
|
-
} else e.series.sort === "alphabetical" && A.sort((l,
|
|
2166
|
-
A.forEach((l,
|
|
2165
|
+
} else e.series.sort === "alphabetical" && A.sort((l, g) => l.localeCompare(g, void 0, { numeric: !0 }));
|
|
2166
|
+
A.forEach((l, g) => {
|
|
2167
2167
|
const T = y.get(l), B = /* @__PURE__ */ new Map();
|
|
2168
2168
|
T.forEach((x) => {
|
|
2169
2169
|
const _ = $(x, e.category, "");
|
|
2170
2170
|
B.has(_) || B.set(_, []), B.get(_).push(x);
|
|
2171
2171
|
});
|
|
2172
|
-
let
|
|
2172
|
+
let v = Array.from(B.keys());
|
|
2173
2173
|
if (Array.isArray(e.category.sort))
|
|
2174
|
-
|
|
2174
|
+
v = e.category.sort.filter((x) => B.has(x)).concat(v.filter((x) => !e.category.sort.includes(x)));
|
|
2175
2175
|
else if (e.category.sort === "original") {
|
|
2176
2176
|
const x = [];
|
|
2177
2177
|
T.forEach((_) => {
|
|
2178
2178
|
const P = $(_, e.category, "");
|
|
2179
2179
|
x.includes(P) || x.push(P);
|
|
2180
|
-
}),
|
|
2181
|
-
} else e.category.sort === "alphabetical" &&
|
|
2182
|
-
|
|
2180
|
+
}), v = x;
|
|
2181
|
+
} else e.category.sort === "alphabetical" && v.sort((x, _) => x.localeCompare(_, void 0, { numeric: !0 }));
|
|
2182
|
+
v.forEach((x, _) => {
|
|
2183
2183
|
const P = B.get(x);
|
|
2184
2184
|
if (e.value.aggregate === "none") {
|
|
2185
2185
|
let j = P.map((M, L) => {
|
|
@@ -2194,12 +2194,12 @@ const Fe = {
|
|
|
2194
2194
|
value: typeof F == "number" ? F : null,
|
|
2195
2195
|
color: D(e.color.by, {
|
|
2196
2196
|
index: _,
|
|
2197
|
-
seriesIndex:
|
|
2197
|
+
seriesIndex: g,
|
|
2198
2198
|
categoryIndex: _,
|
|
2199
2199
|
datasetIndex: f
|
|
2200
2200
|
}, r),
|
|
2201
2201
|
series: l,
|
|
2202
|
-
seriesIndex:
|
|
2202
|
+
seriesIndex: g,
|
|
2203
2203
|
category: x,
|
|
2204
2204
|
categoryIndex: _
|
|
2205
2205
|
};
|
|
@@ -2221,12 +2221,12 @@ const Fe = {
|
|
|
2221
2221
|
value: M,
|
|
2222
2222
|
color: D(e.color.by, {
|
|
2223
2223
|
index: _,
|
|
2224
|
-
seriesIndex:
|
|
2224
|
+
seriesIndex: g,
|
|
2225
2225
|
categoryIndex: _,
|
|
2226
2226
|
datasetIndex: f
|
|
2227
2227
|
}, r),
|
|
2228
2228
|
series: l,
|
|
2229
|
-
seriesIndex:
|
|
2229
|
+
seriesIndex: g,
|
|
2230
2230
|
category: x,
|
|
2231
2231
|
categoryIndex: _
|
|
2232
2232
|
};
|
|
@@ -2234,10 +2234,10 @@ const Fe = {
|
|
|
2234
2234
|
}
|
|
2235
2235
|
});
|
|
2236
2236
|
});
|
|
2237
|
-
const
|
|
2237
|
+
const m = [], d = /* @__PURE__ */ new Map();
|
|
2238
2238
|
S.forEach((l) => {
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2239
|
+
const g = s.find((T) => T.id === l.id || T.name === l.name);
|
|
2240
|
+
g != null && g.id && d.set(g.id, l.index), g != null && g.name && d.set(g.name, l.index);
|
|
2241
2241
|
});
|
|
2242
2242
|
const b = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
|
|
2243
2243
|
S.forEach((l) => {
|
|
@@ -2246,22 +2246,22 @@ const Fe = {
|
|
|
2246
2246
|
let I = b.size, h = O.size;
|
|
2247
2247
|
const p = (l) => (b.has(l) || b.set(l, I++), b.get(l)), E = (l) => (O.has(l) || O.set(l, h++), O.get(l)), k = o.filter((l) => $(l, e.dataset, "") === i), C = /* @__PURE__ */ new Map();
|
|
2248
2248
|
k.forEach((l) => {
|
|
2249
|
-
const
|
|
2249
|
+
const g = l.source, T = l.target, B = $(l, e.series, ""), v = $(l, e.category, ""), x = `${g}-${T}-${B}-${v}`;
|
|
2250
2250
|
C.has(x) || C.set(x, []), C.get(x).push(l);
|
|
2251
|
-
}), Array.from(C.entries()).forEach(([l,
|
|
2252
|
-
const B =
|
|
2251
|
+
}), Array.from(C.entries()).forEach(([l, g], T) => {
|
|
2252
|
+
const B = g[0], v = B.source, x = B.target, _ = d.get(v) ?? -1, P = d.get(x) ?? -1;
|
|
2253
2253
|
if (_ >= 0 && P >= 0)
|
|
2254
2254
|
if (e.value.aggregate === "none")
|
|
2255
|
-
|
|
2255
|
+
g.forEach((j, M) => {
|
|
2256
2256
|
const L = j[e.value.from], F = $(j, e.series, ""), J = $(j, e.category, ""), re = p(F), ge = E(J), xe = {
|
|
2257
2257
|
id: j.id || `edge-${T}-${M}`,
|
|
2258
|
-
index:
|
|
2258
|
+
index: m.length,
|
|
2259
2259
|
modelType: "graph",
|
|
2260
2260
|
name: j.name || "",
|
|
2261
2261
|
data: j.data,
|
|
2262
2262
|
value: typeof L == "number" ? L : null,
|
|
2263
2263
|
color: D(e.color.by, {
|
|
2264
|
-
index:
|
|
2264
|
+
index: m.length,
|
|
2265
2265
|
seriesIndex: re,
|
|
2266
2266
|
categoryIndex: ge,
|
|
2267
2267
|
datasetIndex: f
|
|
@@ -2270,28 +2270,28 @@ const Fe = {
|
|
|
2270
2270
|
seriesIndex: re,
|
|
2271
2271
|
category: J,
|
|
2272
2272
|
categoryIndex: ge,
|
|
2273
|
-
source:
|
|
2273
|
+
source: v,
|
|
2274
2274
|
sourceIndex: _,
|
|
2275
2275
|
target: x,
|
|
2276
2276
|
targetIndex: P
|
|
2277
2277
|
};
|
|
2278
|
-
|
|
2278
|
+
m.push(xe);
|
|
2279
2279
|
});
|
|
2280
2280
|
else {
|
|
2281
|
-
const j =
|
|
2281
|
+
const j = g.map((xe) => {
|
|
2282
2282
|
if (e.value.aggregate === "count")
|
|
2283
2283
|
return 1;
|
|
2284
2284
|
const ke = xe[e.value.from];
|
|
2285
2285
|
return typeof ke == "number" ? ke : null;
|
|
2286
2286
|
}), M = de(j, e.value.aggregate), L = $(B, e.series, ""), F = $(B, e.category, ""), J = p(L), re = E(F), ge = {
|
|
2287
2287
|
id: B.id || `edge-${T}-aggregated`,
|
|
2288
|
-
index:
|
|
2288
|
+
index: m.length,
|
|
2289
2289
|
modelType: "graph",
|
|
2290
2290
|
name: B.name || "",
|
|
2291
2291
|
data: B.data,
|
|
2292
2292
|
value: M,
|
|
2293
2293
|
color: D(e.color.by, {
|
|
2294
|
-
index:
|
|
2294
|
+
index: m.length,
|
|
2295
2295
|
seriesIndex: J,
|
|
2296
2296
|
categoryIndex: re,
|
|
2297
2297
|
datasetIndex: f
|
|
@@ -2300,14 +2300,14 @@ const Fe = {
|
|
|
2300
2300
|
seriesIndex: J,
|
|
2301
2301
|
category: F,
|
|
2302
2302
|
categoryIndex: re,
|
|
2303
|
-
source:
|
|
2303
|
+
source: v,
|
|
2304
2304
|
sourceIndex: _,
|
|
2305
2305
|
target: x,
|
|
2306
2306
|
targetIndex: P
|
|
2307
2307
|
};
|
|
2308
|
-
|
|
2308
|
+
m.push(ge);
|
|
2309
2309
|
}
|
|
2310
|
-
}), c.push({ nodes: S, edges:
|
|
2310
|
+
}), c.push({ nodes: S, edges: m });
|
|
2311
2311
|
}), c;
|
|
2312
2312
|
}, Nr = (t, e, r) => {
|
|
2313
2313
|
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
@@ -2339,54 +2339,54 @@ const Fe = {
|
|
|
2339
2339
|
return o.forEach((a, c) => {
|
|
2340
2340
|
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2341
2341
|
i.forEach((l) => {
|
|
2342
|
-
const
|
|
2343
|
-
f.has(
|
|
2342
|
+
const g = $(l, e.series, "");
|
|
2343
|
+
f.has(g) || f.set(g, []), f.get(g).push(l);
|
|
2344
2344
|
});
|
|
2345
2345
|
let w = Array.from(f.keys());
|
|
2346
2346
|
if (Array.isArray(e.series.sort))
|
|
2347
2347
|
w = e.series.sort.filter((l) => f.has(l)).concat(w.filter((l) => !e.series.sort.includes(l)));
|
|
2348
2348
|
else if (e.series.sort === "original") {
|
|
2349
2349
|
const l = [];
|
|
2350
|
-
i.forEach((
|
|
2351
|
-
const T = $(
|
|
2350
|
+
i.forEach((g) => {
|
|
2351
|
+
const T = $(g, e.series, "");
|
|
2352
2352
|
l.includes(T) || l.push(T);
|
|
2353
2353
|
}), w = l;
|
|
2354
|
-
} else e.series.sort === "alphabetical" && w.sort((l,
|
|
2354
|
+
} else e.series.sort === "alphabetical" && w.sort((l, g) => l.localeCompare(g, void 0, { numeric: !0 }));
|
|
2355
2355
|
const S = /* @__PURE__ */ new Map();
|
|
2356
2356
|
i.forEach((l) => {
|
|
2357
|
-
const
|
|
2358
|
-
S.has(
|
|
2357
|
+
const g = $(l, e.category, "");
|
|
2358
|
+
S.has(g) || S.set(g, []), S.get(g).push(l);
|
|
2359
2359
|
});
|
|
2360
2360
|
let y = Array.from(S.keys());
|
|
2361
2361
|
if (Array.isArray(e.category.sort))
|
|
2362
2362
|
y = e.category.sort.filter((l) => S.has(l)).concat(y.filter((l) => !e.category.sort.includes(l)));
|
|
2363
2363
|
else if (e.category.sort === "original") {
|
|
2364
2364
|
const l = [];
|
|
2365
|
-
i.forEach((
|
|
2366
|
-
const T = $(
|
|
2365
|
+
i.forEach((g) => {
|
|
2366
|
+
const T = $(g, e.category, "");
|
|
2367
2367
|
l.includes(T) || l.push(T);
|
|
2368
2368
|
}), y = l;
|
|
2369
|
-
} else e.category.sort === "alphabetical" && y.sort((l,
|
|
2369
|
+
} else e.category.sort === "alphabetical" && y.sort((l, g) => l.localeCompare(g, void 0, { numeric: !0 }));
|
|
2370
2370
|
const A = /* @__PURE__ */ new Map();
|
|
2371
2371
|
i.forEach((l) => {
|
|
2372
|
-
const
|
|
2373
|
-
A.has(
|
|
2372
|
+
const g = l.id || "unknown";
|
|
2373
|
+
A.has(g) || A.set(g, []), A.get(g).push(l);
|
|
2374
2374
|
});
|
|
2375
|
-
let
|
|
2375
|
+
let m = 0;
|
|
2376
2376
|
const d = w[0] || "", b = w.indexOf(d), O = /* @__PURE__ */ new Map();
|
|
2377
|
-
Array.from(A.entries()).forEach(([l,
|
|
2378
|
-
const T =
|
|
2377
|
+
Array.from(A.entries()).forEach(([l, g]) => {
|
|
2378
|
+
const T = g[0], B = $(T, e.series, ""), v = w.indexOf(B), x = $(T, e.category, ""), _ = y.indexOf(x);
|
|
2379
2379
|
if (e.value.aggregate === "none") {
|
|
2380
2380
|
const P = T[e.value.from], j = {
|
|
2381
2381
|
id: l,
|
|
2382
|
-
index:
|
|
2382
|
+
index: m++,
|
|
2383
2383
|
modelType: "tree",
|
|
2384
2384
|
name: T.name || l,
|
|
2385
2385
|
data: T.data,
|
|
2386
2386
|
value: typeof P == "number" ? P : null,
|
|
2387
2387
|
color: D(e.color.by, {
|
|
2388
|
-
index:
|
|
2389
|
-
seriesIndex:
|
|
2388
|
+
index: m - 1,
|
|
2389
|
+
seriesIndex: v,
|
|
2390
2390
|
categoryIndex: _,
|
|
2391
2391
|
datasetIndex: c
|
|
2392
2392
|
}, r),
|
|
@@ -2399,27 +2399,27 @@ const Fe = {
|
|
|
2399
2399
|
// 稍後計算
|
|
2400
2400
|
children: [],
|
|
2401
2401
|
series: B,
|
|
2402
|
-
seriesIndex:
|
|
2402
|
+
seriesIndex: v,
|
|
2403
2403
|
category: x,
|
|
2404
2404
|
categoryIndex: _
|
|
2405
2405
|
};
|
|
2406
2406
|
O.set(l, j);
|
|
2407
2407
|
} else {
|
|
2408
|
-
const P =
|
|
2408
|
+
const P = g.map((L) => {
|
|
2409
2409
|
if (e.value.aggregate === "count")
|
|
2410
2410
|
return 1;
|
|
2411
2411
|
const F = L[e.value.from];
|
|
2412
2412
|
return typeof F == "number" ? F : null;
|
|
2413
2413
|
}), j = de(P, e.value.aggregate), M = {
|
|
2414
2414
|
id: l,
|
|
2415
|
-
index:
|
|
2415
|
+
index: m++,
|
|
2416
2416
|
modelType: "tree",
|
|
2417
2417
|
name: T.name || l,
|
|
2418
2418
|
data: T.data,
|
|
2419
2419
|
value: j,
|
|
2420
2420
|
color: D(e.color.by, {
|
|
2421
|
-
index:
|
|
2422
|
-
seriesIndex:
|
|
2421
|
+
index: m - 1,
|
|
2422
|
+
seriesIndex: v,
|
|
2423
2423
|
categoryIndex: _,
|
|
2424
2424
|
datasetIndex: c
|
|
2425
2425
|
}, r),
|
|
@@ -2432,7 +2432,7 @@ const Fe = {
|
|
|
2432
2432
|
// 稍後計算
|
|
2433
2433
|
children: [],
|
|
2434
2434
|
series: B,
|
|
2435
|
-
seriesIndex:
|
|
2435
|
+
seriesIndex: v,
|
|
2436
2436
|
category: x,
|
|
2437
2437
|
categoryIndex: _
|
|
2438
2438
|
};
|
|
@@ -2449,24 +2449,24 @@ const Fe = {
|
|
|
2449
2449
|
I.forEach((l) => {
|
|
2450
2450
|
l.parent === null ? p.push(l) : (E.has(l.parent) || E.set(l.parent, []), E.get(l.parent).push(l));
|
|
2451
2451
|
});
|
|
2452
|
-
function k(l,
|
|
2453
|
-
l.depth =
|
|
2452
|
+
function k(l, g) {
|
|
2453
|
+
l.depth = g;
|
|
2454
2454
|
const T = E.get(l.id) || [];
|
|
2455
|
-
return e.value.sort === "asc" ? T.sort((B,
|
|
2456
|
-
B.seq =
|
|
2457
|
-
}), l.children = T.map((B) => k(B,
|
|
2455
|
+
return e.value.sort === "asc" ? T.sort((B, v) => B.value === null && v.value === null ? 0 : B.value === null ? 1 : v.value === null ? -1 : B.value - v.value) : e.value.sort === "desc" && T.sort((B, v) => B.value === null && v.value === null ? 0 : B.value === null ? 1 : v.value === null ? -1 : v.value - B.value), T.forEach((B, v) => {
|
|
2456
|
+
B.seq = v;
|
|
2457
|
+
}), l.children = T.map((B) => k(B, g + 1)), l;
|
|
2458
2458
|
}
|
|
2459
2459
|
const C = p.map((l) => k(l, 0));
|
|
2460
2460
|
if (C.length === 0)
|
|
2461
2461
|
u.push({
|
|
2462
2462
|
id: `empty-${a}`,
|
|
2463
|
-
index:
|
|
2463
|
+
index: m++,
|
|
2464
2464
|
modelType: "tree",
|
|
2465
2465
|
name: "Empty Tree",
|
|
2466
2466
|
data: {},
|
|
2467
2467
|
value: null,
|
|
2468
2468
|
color: D(e.color.by, {
|
|
2469
|
-
index:
|
|
2469
|
+
index: m - 1,
|
|
2470
2470
|
seriesIndex: b < 0 ? 0 : b,
|
|
2471
2471
|
categoryIndex: 0,
|
|
2472
2472
|
datasetIndex: c
|
|
@@ -2486,13 +2486,13 @@ const Fe = {
|
|
|
2486
2486
|
else {
|
|
2487
2487
|
const l = {
|
|
2488
2488
|
id: `virtual-root-${a}`,
|
|
2489
|
-
index:
|
|
2489
|
+
index: m++,
|
|
2490
2490
|
modelType: "tree",
|
|
2491
2491
|
name: `Virtual Root (${a})`,
|
|
2492
2492
|
data: {},
|
|
2493
2493
|
value: null,
|
|
2494
2494
|
color: D(e.color.by, {
|
|
2495
|
-
index:
|
|
2495
|
+
index: m - 1,
|
|
2496
2496
|
seriesIndex: b < 0 ? 0 : b,
|
|
2497
2497
|
categoryIndex: 0,
|
|
2498
2498
|
datasetIndex: c
|
|
@@ -2501,9 +2501,9 @@ const Fe = {
|
|
|
2501
2501
|
parentIndex: null,
|
|
2502
2502
|
depth: 0,
|
|
2503
2503
|
seq: 0,
|
|
2504
|
-
children: C.map((
|
|
2505
|
-
const B = (
|
|
2506
|
-
return B(
|
|
2504
|
+
children: C.map((g, T) => {
|
|
2505
|
+
const B = (v, x) => (v.depth = x, x === 1 && (v.seq = T), v.children = v.children.map((_) => B(_, x + 1)), v);
|
|
2506
|
+
return B(g, 1);
|
|
2507
2507
|
}),
|
|
2508
2508
|
series: d,
|
|
2509
2509
|
seriesIndex: b < 0 ? 0 : b,
|
|
@@ -2821,14 +2821,14 @@ function qr(t) {
|
|
|
2821
2821
|
function Wr({ svgElement$: t, canvasElement$: e, pluginsInstance$: r }) {
|
|
2822
2822
|
let n = [], s = [];
|
|
2823
2823
|
const o = (c, i, f) => {
|
|
2824
|
-
const w = r.getValue().reduce((A,
|
|
2824
|
+
const w = r.getValue().reduce((A, m, d) => (A[m._getId()] = d, A), {}), S = f.map((A) => ({
|
|
2825
2825
|
...A,
|
|
2826
2826
|
pluginSeq: w[A.pluginId]
|
|
2827
2827
|
}));
|
|
2828
2828
|
return (c === "svg" ? n : s).filter((A) => A.pluginId !== i).map((A) => ({
|
|
2829
2829
|
...A,
|
|
2830
2830
|
pluginSeq: w[A.pluginId]
|
|
2831
|
-
})).concat(S).sort((A,
|
|
2831
|
+
})).concat(S).sort((A, m) => A.layerIndex - m.layerIndex || A.pluginSeq - m.pluginSeq);
|
|
2832
2832
|
}, u = {}, a = {};
|
|
2833
2833
|
return (c, i, f) => {
|
|
2834
2834
|
const w = c === "svg" ? t.getValue() : e.getValue();
|
|
@@ -2885,20 +2885,20 @@ const Yr = (t, e) => {
|
|
|
2885
2885
|
}
|
|
2886
2886
|
const r = new oe(), n = new N((e == null ? void 0 : e.data) || []), s = e && e.encoding ? Y(De, e.encoding) : De, o = new N(s), u = e && e.theme ? Y(Ne, e.theme) : Ne, a = new N(u), c = new N((e == null ? void 0 : e.plugins) || []), i = e && e.size ? Y(Fe, e.size) : Fe, f = new N(i), w = new N(null), S = new N(null), y = (() => {
|
|
2887
2887
|
const b = f.pipe(
|
|
2888
|
-
wr((
|
|
2889
|
-
() =>
|
|
2888
|
+
wr((v) => hr(
|
|
2889
|
+
() => v.width === "auto" || v.height === "auto",
|
|
2890
2890
|
// 有 'auto' 的話就監聽element的尺寸
|
|
2891
2891
|
jr(t).pipe(
|
|
2892
2892
|
q((x) => ({
|
|
2893
|
-
width:
|
|
2894
|
-
height:
|
|
2893
|
+
width: v.width === "auto" ? x.width : v.width,
|
|
2894
|
+
height: v.height === "auto" ? x.height <= 0 ? x.width : x.height : v.height
|
|
2895
2895
|
})),
|
|
2896
|
-
W(
|
|
2896
|
+
W(v.resizeDebounce),
|
|
2897
2897
|
dr((x, _) => JSON.stringify(x) === JSON.stringify(_))
|
|
2898
2898
|
),
|
|
2899
2899
|
Xt({
|
|
2900
|
-
width:
|
|
2901
|
-
height:
|
|
2900
|
+
width: v.width,
|
|
2901
|
+
height: v.height
|
|
2902
2902
|
})
|
|
2903
2903
|
)),
|
|
2904
2904
|
Er(r),
|
|
@@ -2911,9 +2911,9 @@ const Yr = (t, e) => {
|
|
|
2911
2911
|
a
|
|
2912
2912
|
]).pipe(
|
|
2913
2913
|
W(0),
|
|
2914
|
-
q(([
|
|
2914
|
+
q(([v, x, _]) => {
|
|
2915
2915
|
try {
|
|
2916
|
-
return Kr(
|
|
2916
|
+
return Kr(v, x, _);
|
|
2917
2917
|
} catch (P) {
|
|
2918
2918
|
throw new Error(he({
|
|
2919
2919
|
from: "Chart.seriesData$",
|
|
@@ -2921,7 +2921,7 @@ const Yr = (t, e) => {
|
|
|
2921
2921
|
}));
|
|
2922
2922
|
}
|
|
2923
2923
|
}),
|
|
2924
|
-
ie((
|
|
2924
|
+
ie((v) => (console.error(G(v)), ae)),
|
|
2925
2925
|
ne(1)
|
|
2926
2926
|
), h = H([
|
|
2927
2927
|
n,
|
|
@@ -2929,9 +2929,9 @@ const Yr = (t, e) => {
|
|
|
2929
2929
|
a
|
|
2930
2930
|
]).pipe(
|
|
2931
2931
|
W(0),
|
|
2932
|
-
q(([
|
|
2932
|
+
q(([v, x, _]) => {
|
|
2933
2933
|
try {
|
|
2934
|
-
return Rr(
|
|
2934
|
+
return Rr(v, x, _);
|
|
2935
2935
|
} catch (P) {
|
|
2936
2936
|
throw new Error(he({
|
|
2937
2937
|
from: "Chart.gridData$",
|
|
@@ -2939,7 +2939,7 @@ const Yr = (t, e) => {
|
|
|
2939
2939
|
}));
|
|
2940
2940
|
}
|
|
2941
2941
|
}),
|
|
2942
|
-
ie((
|
|
2942
|
+
ie((v) => (console.error(G(v)), ae)),
|
|
2943
2943
|
ne(1)
|
|
2944
2944
|
), p = H([
|
|
2945
2945
|
n,
|
|
@@ -2947,9 +2947,9 @@ const Yr = (t, e) => {
|
|
|
2947
2947
|
a
|
|
2948
2948
|
]).pipe(
|
|
2949
2949
|
W(0),
|
|
2950
|
-
q(([
|
|
2950
|
+
q(([v, x, _]) => {
|
|
2951
2951
|
try {
|
|
2952
|
-
return Fr(
|
|
2952
|
+
return Fr(v, x, _);
|
|
2953
2953
|
} catch (P) {
|
|
2954
2954
|
throw new Error(he({
|
|
2955
2955
|
from: "Chart.multivariateData$",
|
|
@@ -2957,7 +2957,7 @@ const Yr = (t, e) => {
|
|
|
2957
2957
|
}));
|
|
2958
2958
|
}
|
|
2959
2959
|
}),
|
|
2960
|
-
ie((
|
|
2960
|
+
ie((v) => (console.error(G(v)), ae)),
|
|
2961
2961
|
ne(1)
|
|
2962
2962
|
), E = H([
|
|
2963
2963
|
n,
|
|
@@ -2965,9 +2965,9 @@ const Yr = (t, e) => {
|
|
|
2965
2965
|
a
|
|
2966
2966
|
]).pipe(
|
|
2967
2967
|
W(0),
|
|
2968
|
-
q(([
|
|
2968
|
+
q(([v, x, _]) => {
|
|
2969
2969
|
try {
|
|
2970
|
-
return Dr(
|
|
2970
|
+
return Dr(v, x, _);
|
|
2971
2971
|
} catch (P) {
|
|
2972
2972
|
throw new Error(he({
|
|
2973
2973
|
from: "Chart.graphData$",
|
|
@@ -2975,7 +2975,7 @@ const Yr = (t, e) => {
|
|
|
2975
2975
|
}));
|
|
2976
2976
|
}
|
|
2977
2977
|
}),
|
|
2978
|
-
ie((
|
|
2978
|
+
ie((v) => (console.error(G(v)), ae)),
|
|
2979
2979
|
ne(1)
|
|
2980
2980
|
), k = H([
|
|
2981
2981
|
n,
|
|
@@ -2983,9 +2983,9 @@ const Yr = (t, e) => {
|
|
|
2983
2983
|
a
|
|
2984
2984
|
]).pipe(
|
|
2985
2985
|
W(0),
|
|
2986
|
-
q(([
|
|
2986
|
+
q(([v, x, _]) => {
|
|
2987
2987
|
try {
|
|
2988
|
-
return Nr(
|
|
2988
|
+
return Nr(v, x, _);
|
|
2989
2989
|
} catch (P) {
|
|
2990
2990
|
throw new Error(he({
|
|
2991
2991
|
from: "Chart.treeData$",
|
|
@@ -2993,11 +2993,11 @@ const Yr = (t, e) => {
|
|
|
2993
2993
|
}));
|
|
2994
2994
|
}
|
|
2995
2995
|
}),
|
|
2996
|
-
ie((
|
|
2996
|
+
ie((v) => (console.error(G(v)), ae)),
|
|
2997
2997
|
ne(1)
|
|
2998
2998
|
), C = new N([]);
|
|
2999
|
-
c.subscribe((
|
|
3000
|
-
const x = {}, _ =
|
|
2999
|
+
c.subscribe((v) => {
|
|
3000
|
+
const x = {}, _ = v.map((j) => {
|
|
3001
3001
|
var L;
|
|
3002
3002
|
let M = j._getId();
|
|
3003
3003
|
if (x[M]) {
|
|
@@ -3006,8 +3006,8 @@ const Yr = (t, e) => {
|
|
|
3006
3006
|
}
|
|
3007
3007
|
return x[M] = j._getId(), M;
|
|
3008
3008
|
});
|
|
3009
|
-
|
|
3010
|
-
const P =
|
|
3009
|
+
v.forEach((j, M) => j._setId(_[M]));
|
|
3010
|
+
const P = v.map((j) => ({
|
|
3011
3011
|
id: j._getId(),
|
|
3012
3012
|
name: j._name,
|
|
3013
3013
|
elementType: j._elementType,
|
|
@@ -3017,7 +3017,7 @@ const Yr = (t, e) => {
|
|
|
3017
3017
|
});
|
|
3018
3018
|
const l = a.asObservable().pipe(
|
|
3019
3019
|
ne(1)
|
|
3020
|
-
),
|
|
3020
|
+
), g = new oe(), T = g.asObservable().pipe(
|
|
3021
3021
|
lt()
|
|
3022
3022
|
);
|
|
3023
3023
|
return {
|
|
@@ -3034,7 +3034,7 @@ const Yr = (t, e) => {
|
|
|
3034
3034
|
plugins$: C,
|
|
3035
3035
|
theme$: l,
|
|
3036
3036
|
event$: T,
|
|
3037
|
-
eventTrigger$:
|
|
3037
|
+
eventTrigger$: g,
|
|
3038
3038
|
_updateLayerElements: Wr({
|
|
3039
3039
|
svgElement$: w,
|
|
3040
3040
|
canvasElement$: S,
|
|
@@ -3043,7 +3043,7 @@ const Yr = (t, e) => {
|
|
|
3043
3043
|
};
|
|
3044
3044
|
})();
|
|
3045
3045
|
let A = null;
|
|
3046
|
-
const
|
|
3046
|
+
const m = () => (A || (A = document.createElement("div"), A.classList.add("orbcharts-container"), A.style.position = "relative", t.appendChild(A)), A);
|
|
3047
3047
|
let d = [];
|
|
3048
3048
|
return c.subscribe((b) => {
|
|
3049
3049
|
d.filter((p) => !b.includes(p)).forEach((p) => {
|
|
@@ -3052,7 +3052,7 @@ const Yr = (t, e) => {
|
|
|
3052
3052
|
let I = !1, h = !1;
|
|
3053
3053
|
b.forEach((p) => {
|
|
3054
3054
|
p._elementType === "svg" ? I = !0 : p._elementType === "canvas" && (h = !0);
|
|
3055
|
-
}), I && !y.svg ? (y.svg = Br("orbcharts-root-svg"),
|
|
3055
|
+
}), I && !y.svg ? (y.svg = Br("orbcharts-root-svg"), m().appendChild(y.svg), w.next(y.svg)) : !I && y.svg && (y.svg.remove(), y.svg = null, w.next(null)), h && !y.canvas ? (y.canvas = ht("orbcharts-root-canvas"), m().appendChild(y.canvas), S.next(y.canvas)) : !h && y.canvas && (y.canvas.remove(), y.canvas = null, S.next(null)), b.forEach((p) => {
|
|
3056
3056
|
p._injectContext(y);
|
|
3057
3057
|
});
|
|
3058
3058
|
}), H({
|
|
@@ -3072,12 +3072,12 @@ const Yr = (t, e) => {
|
|
|
3072
3072
|
).subscribe(({ size: b, canvas: O }) => {
|
|
3073
3073
|
O && (O.width = b.width, O.height = b.height);
|
|
3074
3074
|
}), /* @__PURE__ */ (() => {
|
|
3075
|
-
function b(
|
|
3076
|
-
f.next(
|
|
3075
|
+
function b(v) {
|
|
3076
|
+
f.next(v);
|
|
3077
3077
|
}
|
|
3078
|
-
function O(
|
|
3078
|
+
function O(v) {
|
|
3079
3079
|
try {
|
|
3080
|
-
const { status: x, columnName: _, expectToBe: P } = vt(
|
|
3080
|
+
const { status: x, columnName: _, expectToBe: P } = vt(v);
|
|
3081
3081
|
if (x === "error")
|
|
3082
3082
|
throw new Error(Q({
|
|
3083
3083
|
columnName: _,
|
|
@@ -3092,11 +3092,11 @@ const Yr = (t, e) => {
|
|
|
3092
3092
|
} catch (x) {
|
|
3093
3093
|
console.error(G(x));
|
|
3094
3094
|
}
|
|
3095
|
-
n.next(
|
|
3095
|
+
n.next(v);
|
|
3096
3096
|
}
|
|
3097
|
-
function I(
|
|
3097
|
+
function I(v) {
|
|
3098
3098
|
try {
|
|
3099
|
-
const { status: _, columnName: P, expectToBe: j } = dt(
|
|
3099
|
+
const { status: _, columnName: P, expectToBe: j } = dt(v);
|
|
3100
3100
|
if (_ === "error")
|
|
3101
3101
|
throw new Error(Q({
|
|
3102
3102
|
columnName: P,
|
|
@@ -3111,18 +3111,18 @@ const Yr = (t, e) => {
|
|
|
3111
3111
|
} catch (_) {
|
|
3112
3112
|
console.error(G(_));
|
|
3113
3113
|
}
|
|
3114
|
-
const x = Y(o.getValue(),
|
|
3114
|
+
const x = Y(o.getValue(), v);
|
|
3115
3115
|
o.next(x);
|
|
3116
3116
|
}
|
|
3117
|
-
function h(
|
|
3118
|
-
o.next(
|
|
3117
|
+
function h(v) {
|
|
3118
|
+
o.next(v);
|
|
3119
3119
|
}
|
|
3120
3120
|
function p() {
|
|
3121
3121
|
return o.getValue();
|
|
3122
3122
|
}
|
|
3123
|
-
function E(
|
|
3123
|
+
function E(v) {
|
|
3124
3124
|
try {
|
|
3125
|
-
const { status: x, columnName: _, expectToBe: P } = $e(
|
|
3125
|
+
const { status: x, columnName: _, expectToBe: P } = $e(v);
|
|
3126
3126
|
if (x === "error")
|
|
3127
3127
|
throw new Error(Q({
|
|
3128
3128
|
columnName: _,
|
|
@@ -3137,11 +3137,11 @@ const Yr = (t, e) => {
|
|
|
3137
3137
|
} catch (x) {
|
|
3138
3138
|
console.error(G(x));
|
|
3139
3139
|
}
|
|
3140
|
-
c.next(
|
|
3140
|
+
c.next(v);
|
|
3141
3141
|
}
|
|
3142
|
-
function k(
|
|
3142
|
+
function k(v) {
|
|
3143
3143
|
try {
|
|
3144
|
-
const { status: x, columnName: _, expectToBe: P } = $e([
|
|
3144
|
+
const { status: x, columnName: _, expectToBe: P } = $e([v]);
|
|
3145
3145
|
if (x === "error")
|
|
3146
3146
|
throw new Error(Q({
|
|
3147
3147
|
columnName: _,
|
|
@@ -3156,14 +3156,14 @@ const Yr = (t, e) => {
|
|
|
3156
3156
|
} catch (x) {
|
|
3157
3157
|
console.error(G(x));
|
|
3158
3158
|
}
|
|
3159
|
-
c.next([...c.getValue(),
|
|
3159
|
+
c.next([...c.getValue(), v]);
|
|
3160
3160
|
}
|
|
3161
|
-
function C(
|
|
3162
|
-
c.next(c.getValue().filter((x) => x._getId() !==
|
|
3161
|
+
function C(v) {
|
|
3162
|
+
c.next(c.getValue().filter((x) => x._getId() !== v));
|
|
3163
3163
|
}
|
|
3164
|
-
function l(
|
|
3164
|
+
function l(v) {
|
|
3165
3165
|
try {
|
|
3166
|
-
const { status: _, columnName: P, expectToBe: j } = pt(
|
|
3166
|
+
const { status: _, columnName: P, expectToBe: j } = pt(v);
|
|
3167
3167
|
if (_ === "error")
|
|
3168
3168
|
throw new Error(Q({
|
|
3169
3169
|
columnName: P,
|
|
@@ -3178,17 +3178,17 @@ const Yr = (t, e) => {
|
|
|
3178
3178
|
} catch (_) {
|
|
3179
3179
|
console.error(G(_));
|
|
3180
3180
|
}
|
|
3181
|
-
const x = Y(a.getValue(),
|
|
3181
|
+
const x = Y(a.getValue(), v);
|
|
3182
3182
|
a.next(x);
|
|
3183
3183
|
}
|
|
3184
|
-
function
|
|
3185
|
-
a.next(
|
|
3184
|
+
function g(v) {
|
|
3185
|
+
a.next(v);
|
|
3186
3186
|
}
|
|
3187
3187
|
function T() {
|
|
3188
3188
|
return a.getValue();
|
|
3189
3189
|
}
|
|
3190
3190
|
function B() {
|
|
3191
|
-
r.next(void 0), kr(t), A = null;
|
|
3191
|
+
r.next(void 0), c.getValue().forEach((v) => v.destroy()), kr(t), A = null;
|
|
3192
3192
|
}
|
|
3193
3193
|
return {
|
|
3194
3194
|
resize: b,
|
|
@@ -3202,7 +3202,7 @@ const Yr = (t, e) => {
|
|
|
3202
3202
|
removePlugin: C,
|
|
3203
3203
|
// setTheme,
|
|
3204
3204
|
updateTheme: l,
|
|
3205
|
-
forceReplaceTheme:
|
|
3205
|
+
forceReplaceTheme: g,
|
|
3206
3206
|
getTheme: T,
|
|
3207
3207
|
destroy: B,
|
|
3208
3208
|
context: y
|
|
@@ -3239,7 +3239,7 @@ const mt = (t, e, r) => {
|
|
|
3239
3239
|
];
|
|
3240
3240
|
}).filter(([, E]) => E !== -1).sort((E, k) => E[1] - k[1]).map(([E]) => E))
|
|
3241
3241
|
);
|
|
3242
|
-
let
|
|
3242
|
+
let m = Y(
|
|
3243
3243
|
e.defaultParams ?? {},
|
|
3244
3244
|
r ?? {}
|
|
3245
3245
|
);
|
|
@@ -3263,7 +3263,7 @@ const mt = (t, e, r) => {
|
|
|
3263
3263
|
} catch (E) {
|
|
3264
3264
|
console.error(G(E));
|
|
3265
3265
|
}
|
|
3266
|
-
h.next(
|
|
3266
|
+
h.next(m);
|
|
3267
3267
|
}), b.subscribe((p) => {
|
|
3268
3268
|
h.next(p);
|
|
3269
3269
|
});
|
|
@@ -3294,7 +3294,7 @@ const mt = (t, e, r) => {
|
|
|
3294
3294
|
}))
|
|
3295
3295
|
);
|
|
3296
3296
|
e.setup && (s = e.setup(h)), a.forEach((C) => {
|
|
3297
|
-
var l,
|
|
3297
|
+
var l, g;
|
|
3298
3298
|
if (p.has(C._name)) {
|
|
3299
3299
|
const T = t === "svg" ? {
|
|
3300
3300
|
// svgG: (pluginSetupProps as PluginSetupProps<'svg', ExtendContext, PluginParams>).svgG.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
@@ -3311,7 +3311,7 @@ const mt = (t, e, r) => {
|
|
|
3311
3311
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3312
3312
|
context: h.context,
|
|
3313
3313
|
pluginParams$: O,
|
|
3314
|
-
initLayerParams: ((
|
|
3314
|
+
initLayerParams: ((g = d.getValue()) == null ? void 0 : g[C._name]) || {}
|
|
3315
3315
|
};
|
|
3316
3316
|
C._enable(T);
|
|
3317
3317
|
} else
|
|
@@ -3362,19 +3362,19 @@ const mt = (t, e, r) => {
|
|
|
3362
3362
|
// params = { ...params, ...partial }
|
|
3363
3363
|
// },
|
|
3364
3364
|
updateParams: (h) => {
|
|
3365
|
-
|
|
3365
|
+
m = Y(m, h), d.next(h), Object.keys(h).forEach((p) => {
|
|
3366
3366
|
const E = c[p];
|
|
3367
3367
|
E && E._updateParams(h[p]);
|
|
3368
3368
|
});
|
|
3369
3369
|
},
|
|
3370
3370
|
forceReplaceParams: (h) => {
|
|
3371
|
-
|
|
3371
|
+
m = h, b.next(h), Object.keys(h).forEach((p) => {
|
|
3372
3372
|
const E = c[p];
|
|
3373
3373
|
E && E._forceReplaceParams(h[p]);
|
|
3374
3374
|
});
|
|
3375
3375
|
},
|
|
3376
3376
|
getParams: () => {
|
|
3377
|
-
const h = Object.assign({},
|
|
3377
|
+
const h = Object.assign({}, m);
|
|
3378
3378
|
return a.forEach((p) => {
|
|
3379
3379
|
h[p._name] = p._getParams();
|
|
3380
3380
|
}), h;
|