@orbcharts/core 4.0.0-pre-alpha.3 → 4.0.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/orbcharts-core.es.js +1662 -1589
- package/dist/orbcharts-core.umd.js +6 -6
- package/dist/src/test/simple-graph-test.d.ts +1 -2
- package/dist/src/types/Encoding.d.ts +4 -1
- package/dist/src/types/Plugin.d.ts +1 -1
- package/dist/src/utils/colorUtils.d.ts +1 -1
- package/dist/src/utils/encodingUtils.d.ts +11 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/chart/createChart.ts +47 -4
- package/src/chart/createGraphData.ts +20 -19
- package/src/chart/createGridData.ts +12 -11
- package/src/chart/createMultivariateData.ts +10 -9
- package/src/chart/createSeriesData.ts +15 -14
- package/src/chart/createTreeData.ts +18 -17
- package/src/chart/defaults.ts +47 -24
- package/src/plugin/createPlugin.ts +33 -15
- package/src/test/createGraphData.test.ts +1 -1
- package/src/test/createTreeData.test.ts +1 -1
- package/src/test/simple-graph-test.js +1 -1
- package/src/types/Encoding.ts +4 -1
- package/src/types/Plugin.ts +4 -1
- package/src/utils/colorUtils.ts +1 -1
- package/src/utils/encodingUtils.ts +18 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/validator.ts +10 -0
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
var
|
|
2
|
-
return
|
|
1
|
+
var _e = function(t, e) {
|
|
2
|
+
return _e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
3
3
|
r.__proto__ = n;
|
|
4
4
|
} || function(r, n) {
|
|
5
|
-
for (var
|
|
6
|
-
},
|
|
5
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
|
|
6
|
+
}, _e(t, e);
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function Z(t, e) {
|
|
9
9
|
if (typeof e != "function" && e !== null)
|
|
10
10
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
11
|
-
|
|
11
|
+
_e(t, e);
|
|
12
12
|
function r() {
|
|
13
13
|
this.constructor = t;
|
|
14
14
|
}
|
|
15
15
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
function o
|
|
19
|
-
return
|
|
20
|
-
u(
|
|
17
|
+
function bt(t, e, r, n) {
|
|
18
|
+
function s(o) {
|
|
19
|
+
return o instanceof r ? o : new r(function(u) {
|
|
20
|
+
u(o);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
return new (r || (r = Promise))(function(
|
|
24
|
-
function a(
|
|
23
|
+
return new (r || (r = Promise))(function(o, u) {
|
|
24
|
+
function a(f) {
|
|
25
25
|
try {
|
|
26
|
-
i(n.next(
|
|
27
|
-
} catch (
|
|
28
|
-
u(
|
|
26
|
+
i(n.next(f));
|
|
27
|
+
} catch (w) {
|
|
28
|
+
u(w);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function c(f) {
|
|
32
32
|
try {
|
|
33
|
-
i(n.throw(
|
|
34
|
-
} catch (
|
|
35
|
-
u(
|
|
33
|
+
i(n.throw(f));
|
|
34
|
+
} catch (w) {
|
|
35
|
+
u(w);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function i(
|
|
39
|
-
|
|
38
|
+
function i(f) {
|
|
39
|
+
f.done ? o(f.value) : s(f.value).then(a, c);
|
|
40
40
|
}
|
|
41
41
|
i((n = n.apply(t, e || [])).next());
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ze(t, e) {
|
|
45
45
|
var r = { label: 0, sent: function() {
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
48
|
-
}, trys: [], ops: [] }, n,
|
|
46
|
+
if (o[0] & 1) throw o[1];
|
|
47
|
+
return o[1];
|
|
48
|
+
}, trys: [], ops: [] }, n, s, o, u = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
49
49
|
return u.next = a(0), u.throw = a(1), u.return = a(2), typeof Symbol == "function" && (u[Symbol.iterator] = function() {
|
|
50
50
|
return this;
|
|
51
51
|
}), u;
|
|
52
52
|
function a(i) {
|
|
53
|
-
return function(
|
|
54
|
-
return
|
|
53
|
+
return function(f) {
|
|
54
|
+
return c([i, f]);
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function c(i) {
|
|
58
58
|
if (n) throw new TypeError("Generator is already executing.");
|
|
59
59
|
for (; u && (u = 0, i[0] && (r = 0)), r; ) try {
|
|
60
|
-
if (n = 1,
|
|
61
|
-
switch (
|
|
60
|
+
if (n = 1, s && (o = i[0] & 2 ? s.return : i[0] ? s.throw || ((o = s.return) && o.call(s), 0) : s.next) && !(o = o.call(s, i[1])).done) return o;
|
|
61
|
+
switch (s = 0, o && (i = [i[0] & 2, o.value]), i[0]) {
|
|
62
62
|
case 0:
|
|
63
63
|
case 1:
|
|
64
|
-
|
|
64
|
+
o = i;
|
|
65
65
|
break;
|
|
66
66
|
case 4:
|
|
67
67
|
return r.label++, { value: i[1], done: !1 };
|
|
68
68
|
case 5:
|
|
69
|
-
r.label++,
|
|
69
|
+
r.label++, s = i[1], i = [0];
|
|
70
70
|
continue;
|
|
71
71
|
case 7:
|
|
72
72
|
i = r.ops.pop(), r.trys.pop();
|
|
73
73
|
continue;
|
|
74
74
|
default:
|
|
75
|
-
if (
|
|
75
|
+
if (o = r.trys, !(o = o.length > 0 && o[o.length - 1]) && (i[0] === 6 || i[0] === 2)) {
|
|
76
76
|
r = 0;
|
|
77
77
|
continue;
|
|
78
78
|
}
|
|
79
|
-
if (i[0] === 3 && (!
|
|
79
|
+
if (i[0] === 3 && (!o || i[1] > o[0] && i[1] < o[3])) {
|
|
80
80
|
r.label = i[1];
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
|
-
if (i[0] === 6 && r.label <
|
|
84
|
-
r.label =
|
|
83
|
+
if (i[0] === 6 && r.label < o[1]) {
|
|
84
|
+
r.label = o[1], o = i;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
88
|
-
r.label =
|
|
87
|
+
if (o && r.label < o[2]) {
|
|
88
|
+
r.label = o[2], r.ops.push(i);
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
o[2] && r.ops.pop(), r.trys.pop();
|
|
92
92
|
continue;
|
|
93
93
|
}
|
|
94
94
|
i = e.call(t, r);
|
|
95
|
-
} catch (
|
|
96
|
-
i = [6,
|
|
95
|
+
} catch (f) {
|
|
96
|
+
i = [6, f], s = 0;
|
|
97
97
|
} finally {
|
|
98
|
-
n =
|
|
98
|
+
n = o = 0;
|
|
99
99
|
}
|
|
100
100
|
if (i[0] & 5) throw i[1];
|
|
101
101
|
return { value: i[0] ? i[1] : void 0, done: !0 };
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ce(t) {
|
|
105
105
|
var e = typeof Symbol == "function" && Symbol.iterator, r = e && t[e], n = 0;
|
|
106
106
|
if (r) return r.call(t);
|
|
107
107
|
if (t && typeof t.length == "number") return {
|
|
@@ -114,173 +114,173 @@ function ue(t) {
|
|
|
114
114
|
function le(t, e) {
|
|
115
115
|
var r = typeof Symbol == "function" && t[Symbol.iterator];
|
|
116
116
|
if (!r) return t;
|
|
117
|
-
var n = r.call(t),
|
|
117
|
+
var n = r.call(t), s, o = [], u;
|
|
118
118
|
try {
|
|
119
|
-
for (; (e === void 0 || e-- > 0) && !(
|
|
119
|
+
for (; (e === void 0 || e-- > 0) && !(s = n.next()).done; ) o.push(s.value);
|
|
120
120
|
} catch (a) {
|
|
121
121
|
u = { error: a };
|
|
122
122
|
} finally {
|
|
123
123
|
try {
|
|
124
|
-
|
|
124
|
+
s && !s.done && (r = n.return) && r.call(n);
|
|
125
125
|
} finally {
|
|
126
126
|
if (u) throw u.error;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
return
|
|
129
|
+
return o;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (r || arguments.length === 2) for (var n = 0,
|
|
133
|
-
(
|
|
134
|
-
return t.concat(
|
|
131
|
+
function fe(t, e, r) {
|
|
132
|
+
if (r || arguments.length === 2) for (var n = 0, s = e.length, o; n < s; n++)
|
|
133
|
+
(o || !(n in e)) && (o || (o = Array.prototype.slice.call(e, 0, n)), o[n] = e[n]);
|
|
134
|
+
return t.concat(o || Array.prototype.slice.call(e));
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return this instanceof
|
|
136
|
+
function ue(t) {
|
|
137
|
+
return this instanceof ue ? (this.v = t, this) : new ue(t);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function wt(t, e, r) {
|
|
140
140
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
141
|
-
var n = r.apply(t, e || []),
|
|
142
|
-
return
|
|
141
|
+
var n = r.apply(t, e || []), s, o = [];
|
|
142
|
+
return s = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", u), s[Symbol.asyncIterator] = function() {
|
|
143
143
|
return this;
|
|
144
|
-
},
|
|
145
|
-
function u(
|
|
146
|
-
return function(
|
|
147
|
-
return Promise.resolve(
|
|
144
|
+
}, s;
|
|
145
|
+
function u(y) {
|
|
146
|
+
return function(A) {
|
|
147
|
+
return Promise.resolve(A).then(y, w);
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
function a(
|
|
151
|
-
n[
|
|
152
|
-
return new Promise(function(d,
|
|
153
|
-
|
|
150
|
+
function a(y, A) {
|
|
151
|
+
n[y] && (s[y] = function(v) {
|
|
152
|
+
return new Promise(function(d, b) {
|
|
153
|
+
o.push([y, v, d, b]) > 1 || c(y, v);
|
|
154
154
|
});
|
|
155
|
-
},
|
|
155
|
+
}, A && (s[y] = A(s[y])));
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function c(y, A) {
|
|
158
158
|
try {
|
|
159
|
-
i(n[
|
|
160
|
-
} catch (
|
|
161
|
-
|
|
159
|
+
i(n[y](A));
|
|
160
|
+
} catch (v) {
|
|
161
|
+
S(o[0][3], v);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function i(
|
|
165
|
-
|
|
164
|
+
function i(y) {
|
|
165
|
+
y.value instanceof ue ? Promise.resolve(y.value.v).then(f, w) : S(o[0][2], y);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
167
|
+
function f(y) {
|
|
168
|
+
c("next", y);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
|
|
170
|
+
function w(y) {
|
|
171
|
+
c("throw", y);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
173
|
+
function S(y, A) {
|
|
174
|
+
y(A), o.shift(), o.length && c(o[0][0], o[0][1]);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Et(t) {
|
|
178
178
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
179
179
|
var e = t[Symbol.asyncIterator], r;
|
|
180
|
-
return e ? e.call(t) : (t = typeof
|
|
180
|
+
return e ? e.call(t) : (t = typeof ce == "function" ? ce(t) : t[Symbol.iterator](), r = {}, n("next"), n("throw"), n("return"), r[Symbol.asyncIterator] = function() {
|
|
181
181
|
return this;
|
|
182
182
|
}, r);
|
|
183
|
-
function n(
|
|
184
|
-
r[
|
|
185
|
-
return new Promise(function(a,
|
|
186
|
-
u = t[
|
|
183
|
+
function n(o) {
|
|
184
|
+
r[o] = t[o] && function(u) {
|
|
185
|
+
return new Promise(function(a, c) {
|
|
186
|
+
u = t[o](u), s(a, c, u.done, u.value);
|
|
187
187
|
});
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
function o
|
|
191
|
-
Promise.resolve(
|
|
192
|
-
|
|
190
|
+
function s(o, u, a, c) {
|
|
191
|
+
Promise.resolve(c).then(function(i) {
|
|
192
|
+
o({ value: i, done: a });
|
|
193
193
|
}, u);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function V(t) {
|
|
197
197
|
return typeof t == "function";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Oe(t) {
|
|
200
200
|
var e = function(n) {
|
|
201
201
|
Error.call(n), n.stack = new Error().stack;
|
|
202
202
|
}, r = t(e);
|
|
203
203
|
return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
|
|
204
204
|
}
|
|
205
|
-
var
|
|
205
|
+
var Ae = Oe(function(t) {
|
|
206
206
|
return function(r) {
|
|
207
207
|
t(this), this.message = r ? r.length + ` errors occurred during unsubscription:
|
|
208
|
-
` + r.map(function(n,
|
|
209
|
-
return
|
|
208
|
+
` + r.map(function(n, s) {
|
|
209
|
+
return s + 1 + ") " + n.toString();
|
|
210
210
|
}).join(`
|
|
211
211
|
`) : "", this.name = "UnsubscriptionError", this.errors = r;
|
|
212
212
|
};
|
|
213
213
|
});
|
|
214
|
-
function
|
|
214
|
+
function Ee(t, e) {
|
|
215
215
|
if (t) {
|
|
216
216
|
var r = t.indexOf(e);
|
|
217
217
|
0 <= r && t.splice(r, 1);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
var
|
|
220
|
+
var ve = function() {
|
|
221
221
|
function t(e) {
|
|
222
222
|
this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
223
223
|
}
|
|
224
224
|
return t.prototype.unsubscribe = function() {
|
|
225
|
-
var e, r, n,
|
|
225
|
+
var e, r, n, s, o;
|
|
226
226
|
if (!this.closed) {
|
|
227
227
|
this.closed = !0;
|
|
228
228
|
var u = this._parentage;
|
|
229
229
|
if (u)
|
|
230
230
|
if (this._parentage = null, Array.isArray(u))
|
|
231
231
|
try {
|
|
232
|
-
for (var a =
|
|
233
|
-
var i =
|
|
232
|
+
for (var a = ce(u), c = a.next(); !c.done; c = a.next()) {
|
|
233
|
+
var i = c.value;
|
|
234
234
|
i.remove(this);
|
|
235
235
|
}
|
|
236
|
-
} catch (
|
|
237
|
-
e = { error:
|
|
236
|
+
} catch (v) {
|
|
237
|
+
e = { error: v };
|
|
238
238
|
} finally {
|
|
239
239
|
try {
|
|
240
|
-
|
|
240
|
+
c && !c.done && (r = a.return) && r.call(a);
|
|
241
241
|
} finally {
|
|
242
242
|
if (e) throw e.error;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
else
|
|
246
246
|
u.remove(this);
|
|
247
|
-
var
|
|
248
|
-
if (
|
|
247
|
+
var f = this.initialTeardown;
|
|
248
|
+
if (V(f))
|
|
249
249
|
try {
|
|
250
|
-
|
|
251
|
-
} catch (
|
|
252
|
-
|
|
250
|
+
f();
|
|
251
|
+
} catch (v) {
|
|
252
|
+
o = v instanceof Ae ? v.errors : [v];
|
|
253
253
|
}
|
|
254
|
-
var
|
|
255
|
-
if (
|
|
254
|
+
var w = this._finalizers;
|
|
255
|
+
if (w) {
|
|
256
256
|
this._finalizers = null;
|
|
257
257
|
try {
|
|
258
|
-
for (var
|
|
259
|
-
var
|
|
258
|
+
for (var S = ce(w), y = S.next(); !y.done; y = S.next()) {
|
|
259
|
+
var A = y.value;
|
|
260
260
|
try {
|
|
261
|
-
|
|
262
|
-
} catch (
|
|
263
|
-
|
|
261
|
+
je(A);
|
|
262
|
+
} catch (v) {
|
|
263
|
+
o = o ?? [], v instanceof Ae ? o = fe(fe([], le(o)), le(v.errors)) : o.push(v);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
} catch (
|
|
267
|
-
n = { error:
|
|
266
|
+
} catch (v) {
|
|
267
|
+
n = { error: v };
|
|
268
268
|
} finally {
|
|
269
269
|
try {
|
|
270
|
-
|
|
270
|
+
y && !y.done && (s = S.return) && s.call(S);
|
|
271
271
|
} finally {
|
|
272
272
|
if (n) throw n.error;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
if (
|
|
277
|
-
throw new
|
|
276
|
+
if (o)
|
|
277
|
+
throw new Ae(o);
|
|
278
278
|
}
|
|
279
279
|
}, t.prototype.add = function(e) {
|
|
280
280
|
var r;
|
|
281
281
|
if (e && e !== this)
|
|
282
282
|
if (this.closed)
|
|
283
|
-
|
|
283
|
+
je(e);
|
|
284
284
|
else {
|
|
285
285
|
if (e instanceof t) {
|
|
286
286
|
if (e.closed || e._hasParent(this))
|
|
@@ -297,52 +297,52 @@ var de = function() {
|
|
|
297
297
|
this._parentage = Array.isArray(r) ? (r.push(e), r) : r ? [r, e] : e;
|
|
298
298
|
}, t.prototype._removeParent = function(e) {
|
|
299
299
|
var r = this._parentage;
|
|
300
|
-
r === e ? this._parentage = null : Array.isArray(r) &&
|
|
300
|
+
r === e ? this._parentage = null : Array.isArray(r) && Ee(r, e);
|
|
301
301
|
}, t.prototype.remove = function(e) {
|
|
302
302
|
var r = this._finalizers;
|
|
303
|
-
r &&
|
|
303
|
+
r && Ee(r, e), e instanceof t && e._removeParent(this);
|
|
304
304
|
}, t.EMPTY = function() {
|
|
305
305
|
var e = new t();
|
|
306
306
|
return e.closed = !0, e;
|
|
307
307
|
}(), t;
|
|
308
|
-
}(),
|
|
308
|
+
}(), Ge = ve.EMPTY;
|
|
309
309
|
function qe(t) {
|
|
310
|
-
return t instanceof
|
|
310
|
+
return t instanceof ve || t && "closed" in t && V(t.remove) && V(t.add) && V(t.unsubscribe);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
|
|
312
|
+
function je(t) {
|
|
313
|
+
V(t) ? t() : t.unsubscribe();
|
|
314
314
|
}
|
|
315
|
-
var
|
|
315
|
+
var xt = {
|
|
316
316
|
Promise: void 0
|
|
317
|
-
},
|
|
317
|
+
}, At = {
|
|
318
318
|
setTimeout: function(t, e) {
|
|
319
319
|
for (var r = [], n = 2; n < arguments.length; n++)
|
|
320
320
|
r[n - 2] = arguments[n];
|
|
321
|
-
return setTimeout.apply(void 0,
|
|
321
|
+
return setTimeout.apply(void 0, fe([t, e], le(r)));
|
|
322
322
|
},
|
|
323
323
|
clearTimeout: function(t) {
|
|
324
324
|
return clearTimeout(t);
|
|
325
325
|
},
|
|
326
326
|
delegate: void 0
|
|
327
327
|
};
|
|
328
|
-
function
|
|
329
|
-
|
|
328
|
+
function We(t) {
|
|
329
|
+
At.setTimeout(function() {
|
|
330
330
|
throw t;
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Te() {
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function we(t) {
|
|
336
336
|
t();
|
|
337
337
|
}
|
|
338
|
-
var
|
|
339
|
-
|
|
338
|
+
var Ie = function(t) {
|
|
339
|
+
Z(e, t);
|
|
340
340
|
function e(r) {
|
|
341
341
|
var n = t.call(this) || this;
|
|
342
|
-
return n.isStopped = !1, r ? (n.destination = r, qe(r) && r.add(n)) : n.destination =
|
|
342
|
+
return n.isStopped = !1, r ? (n.destination = r, qe(r) && r.add(n)) : n.destination = Tt, n;
|
|
343
343
|
}
|
|
344
|
-
return e.create = function(r, n,
|
|
345
|
-
return new
|
|
344
|
+
return e.create = function(r, n, s) {
|
|
345
|
+
return new ye(r, n, s);
|
|
346
346
|
}, e.prototype.next = function(r) {
|
|
347
347
|
this.isStopped || this._next(r);
|
|
348
348
|
}, e.prototype.error = function(r) {
|
|
@@ -366,7 +366,7 @@ var Oe = function(t) {
|
|
|
366
366
|
this.unsubscribe();
|
|
367
367
|
}
|
|
368
368
|
}, e;
|
|
369
|
-
}(
|
|
369
|
+
}(ve), St = function() {
|
|
370
370
|
function t(e) {
|
|
371
371
|
this.partialObserver = e;
|
|
372
372
|
}
|
|
@@ -376,7 +376,7 @@ var Oe = function(t) {
|
|
|
376
376
|
try {
|
|
377
377
|
r.next(e);
|
|
378
378
|
} catch (n) {
|
|
379
|
-
|
|
379
|
+
be(n);
|
|
380
380
|
}
|
|
381
381
|
}, t.prototype.error = function(e) {
|
|
382
382
|
var r = this.partialObserver;
|
|
@@ -384,42 +384,42 @@ var Oe = function(t) {
|
|
|
384
384
|
try {
|
|
385
385
|
r.error(e);
|
|
386
386
|
} catch (n) {
|
|
387
|
-
|
|
387
|
+
be(n);
|
|
388
388
|
}
|
|
389
389
|
else
|
|
390
|
-
|
|
390
|
+
be(e);
|
|
391
391
|
}, t.prototype.complete = function() {
|
|
392
392
|
var e = this.partialObserver;
|
|
393
393
|
if (e.complete)
|
|
394
394
|
try {
|
|
395
395
|
e.complete();
|
|
396
396
|
} catch (r) {
|
|
397
|
-
|
|
397
|
+
be(r);
|
|
398
398
|
}
|
|
399
399
|
}, t;
|
|
400
|
-
}(),
|
|
401
|
-
|
|
402
|
-
function e(r, n,
|
|
403
|
-
var
|
|
404
|
-
return
|
|
400
|
+
}(), ye = function(t) {
|
|
401
|
+
Z(e, t);
|
|
402
|
+
function e(r, n, s) {
|
|
403
|
+
var o = t.call(this) || this, u;
|
|
404
|
+
return V(r) || !r ? u = {
|
|
405
405
|
next: r ?? void 0,
|
|
406
406
|
error: n ?? void 0,
|
|
407
|
-
complete:
|
|
408
|
-
} : u = r,
|
|
407
|
+
complete: s ?? void 0
|
|
408
|
+
} : u = r, o.destination = new St(u), o;
|
|
409
409
|
}
|
|
410
410
|
return e;
|
|
411
|
-
}(
|
|
412
|
-
function
|
|
413
|
-
|
|
411
|
+
}(Ie);
|
|
412
|
+
function be(t) {
|
|
413
|
+
We(t);
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function _t(t) {
|
|
416
416
|
throw t;
|
|
417
417
|
}
|
|
418
|
-
var
|
|
418
|
+
var Tt = {
|
|
419
419
|
closed: !0,
|
|
420
|
-
next:
|
|
421
|
-
error:
|
|
422
|
-
complete:
|
|
420
|
+
next: Te,
|
|
421
|
+
error: _t,
|
|
422
|
+
complete: Te
|
|
423
423
|
}, Ce = function() {
|
|
424
424
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
425
425
|
}();
|
|
@@ -428,8 +428,8 @@ function me(t) {
|
|
|
428
428
|
}
|
|
429
429
|
function $t(t) {
|
|
430
430
|
return t.length === 0 ? me : t.length === 1 ? t[0] : function(r) {
|
|
431
|
-
return t.reduce(function(n,
|
|
432
|
-
return
|
|
431
|
+
return t.reduce(function(n, s) {
|
|
432
|
+
return s(n);
|
|
433
433
|
}, r);
|
|
434
434
|
};
|
|
435
435
|
}
|
|
@@ -441,11 +441,11 @@ var R = function() {
|
|
|
441
441
|
var r = new t();
|
|
442
442
|
return r.source = this, r.operator = e, r;
|
|
443
443
|
}, t.prototype.subscribe = function(e, r, n) {
|
|
444
|
-
var
|
|
445
|
-
return
|
|
446
|
-
var u =
|
|
447
|
-
|
|
448
|
-
}),
|
|
444
|
+
var s = this, o = It(e) ? e : new ye(e, r, n);
|
|
445
|
+
return we(function() {
|
|
446
|
+
var u = s, a = u.operator, c = u.source;
|
|
447
|
+
o.add(a ? a.call(o, c) : c ? s._subscribe(o) : s._trySubscribe(o));
|
|
448
|
+
}), o;
|
|
449
449
|
}, t.prototype._trySubscribe = function(e) {
|
|
450
450
|
try {
|
|
451
451
|
return this._subscribe(e);
|
|
@@ -454,17 +454,17 @@ var R = function() {
|
|
|
454
454
|
}
|
|
455
455
|
}, t.prototype.forEach = function(e, r) {
|
|
456
456
|
var n = this;
|
|
457
|
-
return r = Me(r), new r(function(
|
|
458
|
-
var u = new
|
|
457
|
+
return r = Me(r), new r(function(s, o) {
|
|
458
|
+
var u = new ye({
|
|
459
459
|
next: function(a) {
|
|
460
460
|
try {
|
|
461
461
|
e(a);
|
|
462
|
-
} catch (
|
|
463
|
-
|
|
462
|
+
} catch (c) {
|
|
463
|
+
o(c), u.unsubscribe();
|
|
464
464
|
}
|
|
465
465
|
},
|
|
466
|
-
error:
|
|
467
|
-
complete:
|
|
466
|
+
error: o,
|
|
467
|
+
complete: s
|
|
468
468
|
});
|
|
469
469
|
n.subscribe(u);
|
|
470
470
|
});
|
|
@@ -479,14 +479,14 @@ var R = function() {
|
|
|
479
479
|
return $t(e)(this);
|
|
480
480
|
}, t.prototype.toPromise = function(e) {
|
|
481
481
|
var r = this;
|
|
482
|
-
return e = Me(e), new e(function(n,
|
|
483
|
-
var
|
|
482
|
+
return e = Me(e), new e(function(n, s) {
|
|
483
|
+
var o;
|
|
484
484
|
r.subscribe(function(u) {
|
|
485
|
-
return
|
|
485
|
+
return o = u;
|
|
486
486
|
}, function(u) {
|
|
487
|
-
return
|
|
487
|
+
return s(u);
|
|
488
488
|
}, function() {
|
|
489
|
-
return n(
|
|
489
|
+
return n(o);
|
|
490
490
|
});
|
|
491
491
|
});
|
|
492
492
|
}, t.create = function(e) {
|
|
@@ -495,18 +495,18 @@ var R = function() {
|
|
|
495
495
|
}();
|
|
496
496
|
function Me(t) {
|
|
497
497
|
var e;
|
|
498
|
-
return (e = t ??
|
|
499
|
-
}
|
|
500
|
-
function Tt(t) {
|
|
501
|
-
return t && j(t.next) && j(t.error) && j(t.complete);
|
|
498
|
+
return (e = t ?? xt.Promise) !== null && e !== void 0 ? e : Promise;
|
|
502
499
|
}
|
|
503
500
|
function Ot(t) {
|
|
504
|
-
return t && t
|
|
501
|
+
return t && V(t.next) && V(t.error) && V(t.complete);
|
|
502
|
+
}
|
|
503
|
+
function It(t) {
|
|
504
|
+
return t && t instanceof Ie || Ot(t) && qe(t);
|
|
505
505
|
}
|
|
506
506
|
function Ct(t) {
|
|
507
|
-
return
|
|
507
|
+
return V(t == null ? void 0 : t.lift);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function z(t) {
|
|
510
510
|
return function(e) {
|
|
511
511
|
if (Ct(e))
|
|
512
512
|
return e.lift(function(r) {
|
|
@@ -519,36 +519,36 @@ function U(t) {
|
|
|
519
519
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return new
|
|
522
|
+
function U(t, e, r, n, s) {
|
|
523
|
+
return new Bt(t, e, r, n, s);
|
|
524
524
|
}
|
|
525
|
-
var
|
|
526
|
-
|
|
527
|
-
function e(r, n,
|
|
528
|
-
var
|
|
529
|
-
return
|
|
525
|
+
var Bt = function(t) {
|
|
526
|
+
Z(e, t);
|
|
527
|
+
function e(r, n, s, o, u, a) {
|
|
528
|
+
var c = t.call(this, r) || this;
|
|
529
|
+
return c.onFinalize = u, c.shouldUnsubscribe = a, c._next = n ? function(i) {
|
|
530
530
|
try {
|
|
531
531
|
n(i);
|
|
532
|
-
} catch (
|
|
533
|
-
r.error(
|
|
532
|
+
} catch (f) {
|
|
533
|
+
r.error(f);
|
|
534
534
|
}
|
|
535
|
-
} : t.prototype._next,
|
|
535
|
+
} : t.prototype._next, c._error = o ? function(i) {
|
|
536
536
|
try {
|
|
537
|
-
|
|
538
|
-
} catch (
|
|
539
|
-
r.error(
|
|
537
|
+
o(i);
|
|
538
|
+
} catch (f) {
|
|
539
|
+
r.error(f);
|
|
540
540
|
} finally {
|
|
541
541
|
this.unsubscribe();
|
|
542
542
|
}
|
|
543
|
-
} : t.prototype._error,
|
|
543
|
+
} : t.prototype._error, c._complete = s ? function() {
|
|
544
544
|
try {
|
|
545
|
-
|
|
545
|
+
s();
|
|
546
546
|
} catch (i) {
|
|
547
547
|
r.error(i);
|
|
548
548
|
} finally {
|
|
549
549
|
this.unsubscribe();
|
|
550
550
|
}
|
|
551
|
-
} : t.prototype._complete,
|
|
551
|
+
} : t.prototype._complete, c;
|
|
552
552
|
}
|
|
553
553
|
return e.prototype.unsubscribe = function() {
|
|
554
554
|
var r;
|
|
@@ -557,56 +557,56 @@ var It = function(t) {
|
|
|
557
557
|
t.prototype.unsubscribe.call(this), !n && ((r = this.onFinalize) === null || r === void 0 || r.call(this));
|
|
558
558
|
}
|
|
559
559
|
}, e;
|
|
560
|
-
}(
|
|
560
|
+
}(Ie), Pt = Oe(function(t) {
|
|
561
561
|
return function() {
|
|
562
562
|
t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
563
563
|
};
|
|
564
564
|
}), oe = function(t) {
|
|
565
|
-
|
|
565
|
+
Z(e, t);
|
|
566
566
|
function e() {
|
|
567
567
|
var r = t.call(this) || this;
|
|
568
568
|
return r.closed = !1, r.currentObservers = null, r.observers = [], r.isStopped = !1, r.hasError = !1, r.thrownError = null, r;
|
|
569
569
|
}
|
|
570
570
|
return e.prototype.lift = function(r) {
|
|
571
|
-
var n = new
|
|
571
|
+
var n = new Le(this, this);
|
|
572
572
|
return n.operator = r, n;
|
|
573
573
|
}, e.prototype._throwIfClosed = function() {
|
|
574
574
|
if (this.closed)
|
|
575
|
-
throw new
|
|
575
|
+
throw new Pt();
|
|
576
576
|
}, e.prototype.next = function(r) {
|
|
577
577
|
var n = this;
|
|
578
|
-
|
|
579
|
-
var
|
|
578
|
+
we(function() {
|
|
579
|
+
var s, o;
|
|
580
580
|
if (n._throwIfClosed(), !n.isStopped) {
|
|
581
581
|
n.currentObservers || (n.currentObservers = Array.from(n.observers));
|
|
582
582
|
try {
|
|
583
|
-
for (var u =
|
|
584
|
-
var
|
|
585
|
-
|
|
583
|
+
for (var u = ce(n.currentObservers), a = u.next(); !a.done; a = u.next()) {
|
|
584
|
+
var c = a.value;
|
|
585
|
+
c.next(r);
|
|
586
586
|
}
|
|
587
587
|
} catch (i) {
|
|
588
|
-
|
|
588
|
+
s = { error: i };
|
|
589
589
|
} finally {
|
|
590
590
|
try {
|
|
591
|
-
a && !a.done && (
|
|
591
|
+
a && !a.done && (o = u.return) && o.call(u);
|
|
592
592
|
} finally {
|
|
593
|
-
if (
|
|
593
|
+
if (s) throw s.error;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
});
|
|
598
598
|
}, e.prototype.error = function(r) {
|
|
599
599
|
var n = this;
|
|
600
|
-
|
|
600
|
+
we(function() {
|
|
601
601
|
if (n._throwIfClosed(), !n.isStopped) {
|
|
602
602
|
n.hasError = n.isStopped = !0, n.thrownError = r;
|
|
603
|
-
for (var
|
|
604
|
-
|
|
603
|
+
for (var s = n.observers; s.length; )
|
|
604
|
+
s.shift().error(r);
|
|
605
605
|
}
|
|
606
606
|
});
|
|
607
607
|
}, e.prototype.complete = function() {
|
|
608
608
|
var r = this;
|
|
609
|
-
|
|
609
|
+
we(function() {
|
|
610
610
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
611
611
|
r.isStopped = !0;
|
|
612
612
|
for (var n = r.observers; n.length; )
|
|
@@ -627,40 +627,40 @@ var It = function(t) {
|
|
|
627
627
|
}, e.prototype._subscribe = function(r) {
|
|
628
628
|
return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
|
|
629
629
|
}, e.prototype._innerSubscribe = function(r) {
|
|
630
|
-
var n = this,
|
|
631
|
-
return
|
|
632
|
-
n.currentObservers = null,
|
|
630
|
+
var n = this, s = this, o = s.hasError, u = s.isStopped, a = s.observers;
|
|
631
|
+
return o || u ? Ge : (this.currentObservers = null, a.push(r), new ve(function() {
|
|
632
|
+
n.currentObservers = null, Ee(a, r);
|
|
633
633
|
}));
|
|
634
634
|
}, e.prototype._checkFinalizedStatuses = function(r) {
|
|
635
|
-
var n = this,
|
|
636
|
-
|
|
635
|
+
var n = this, s = n.hasError, o = n.thrownError, u = n.isStopped;
|
|
636
|
+
s ? r.error(o) : u && r.complete();
|
|
637
637
|
}, e.prototype.asObservable = function() {
|
|
638
638
|
var r = new R();
|
|
639
639
|
return r.source = this, r;
|
|
640
640
|
}, e.create = function(r, n) {
|
|
641
|
-
return new
|
|
641
|
+
return new Le(r, n);
|
|
642
642
|
}, e;
|
|
643
|
-
}(R),
|
|
644
|
-
|
|
643
|
+
}(R), Le = function(t) {
|
|
644
|
+
Z(e, t);
|
|
645
645
|
function e(r, n) {
|
|
646
|
-
var
|
|
647
|
-
return
|
|
646
|
+
var s = t.call(this) || this;
|
|
647
|
+
return s.destination = r, s.source = n, s;
|
|
648
648
|
}
|
|
649
649
|
return e.prototype.next = function(r) {
|
|
650
|
-
var n,
|
|
651
|
-
(
|
|
650
|
+
var n, s;
|
|
651
|
+
(s = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || s === void 0 || s.call(n, r);
|
|
652
652
|
}, e.prototype.error = function(r) {
|
|
653
|
-
var n,
|
|
654
|
-
(
|
|
653
|
+
var n, s;
|
|
654
|
+
(s = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || s === void 0 || s.call(n, r);
|
|
655
655
|
}, e.prototype.complete = function() {
|
|
656
656
|
var r, n;
|
|
657
657
|
(n = (r = this.destination) === null || r === void 0 ? void 0 : r.complete) === null || n === void 0 || n.call(r);
|
|
658
658
|
}, e.prototype._subscribe = function(r) {
|
|
659
|
-
var n,
|
|
660
|
-
return (
|
|
659
|
+
var n, s;
|
|
660
|
+
return (s = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r)) !== null && s !== void 0 ? s : Ge;
|
|
661
661
|
}, e;
|
|
662
|
-
}(oe),
|
|
663
|
-
|
|
662
|
+
}(oe), N = function(t) {
|
|
663
|
+
Z(e, t);
|
|
664
664
|
function e(r) {
|
|
665
665
|
var n = t.call(this) || this;
|
|
666
666
|
return n._value = r, n;
|
|
@@ -675,114 +675,114 @@ var It = function(t) {
|
|
|
675
675
|
var n = t.prototype._subscribe.call(this, r);
|
|
676
676
|
return !n.closed && r.next(this._value), n;
|
|
677
677
|
}, e.prototype.getValue = function() {
|
|
678
|
-
var r = this, n = r.hasError,
|
|
678
|
+
var r = this, n = r.hasError, s = r.thrownError, o = r._value;
|
|
679
679
|
if (n)
|
|
680
|
-
throw
|
|
681
|
-
return this._throwIfClosed(),
|
|
680
|
+
throw s;
|
|
681
|
+
return this._throwIfClosed(), o;
|
|
682
682
|
}, e.prototype.next = function(r) {
|
|
683
683
|
t.prototype.next.call(this, this._value = r);
|
|
684
684
|
}, e;
|
|
685
|
-
}(oe),
|
|
685
|
+
}(oe), Be = {
|
|
686
686
|
now: function() {
|
|
687
|
-
return (
|
|
687
|
+
return (Be.delegate || Date).now();
|
|
688
688
|
},
|
|
689
689
|
delegate: void 0
|
|
690
|
-
},
|
|
691
|
-
|
|
692
|
-
function e(r, n,
|
|
693
|
-
r === void 0 && (r = 1 / 0), n === void 0 && (n = 1 / 0),
|
|
694
|
-
var
|
|
695
|
-
return
|
|
690
|
+
}, kt = function(t) {
|
|
691
|
+
Z(e, t);
|
|
692
|
+
function e(r, n, s) {
|
|
693
|
+
r === void 0 && (r = 1 / 0), n === void 0 && (n = 1 / 0), s === void 0 && (s = Be);
|
|
694
|
+
var o = t.call(this) || this;
|
|
695
|
+
return o._bufferSize = r, o._windowTime = n, o._timestampProvider = s, o._buffer = [], o._infiniteTimeWindow = !0, o._infiniteTimeWindow = n === 1 / 0, o._bufferSize = Math.max(1, r), o._windowTime = Math.max(1, n), o;
|
|
696
696
|
}
|
|
697
697
|
return e.prototype.next = function(r) {
|
|
698
|
-
var n = this,
|
|
699
|
-
|
|
698
|
+
var n = this, s = n.isStopped, o = n._buffer, u = n._infiniteTimeWindow, a = n._timestampProvider, c = n._windowTime;
|
|
699
|
+
s || (o.push(r), !u && o.push(a.now() + c)), this._trimBuffer(), t.prototype.next.call(this, r);
|
|
700
700
|
}, e.prototype._subscribe = function(r) {
|
|
701
701
|
this._throwIfClosed(), this._trimBuffer();
|
|
702
|
-
for (var n = this._innerSubscribe(r),
|
|
703
|
-
r.next(a[
|
|
702
|
+
for (var n = this._innerSubscribe(r), s = this, o = s._infiniteTimeWindow, u = s._buffer, a = u.slice(), c = 0; c < a.length && !r.closed; c += o ? 1 : 2)
|
|
703
|
+
r.next(a[c]);
|
|
704
704
|
return this._checkFinalizedStatuses(r), n;
|
|
705
705
|
}, e.prototype._trimBuffer = function() {
|
|
706
|
-
var r = this, n = r._bufferSize,
|
|
707
|
-
if (n < 1 / 0 && a <
|
|
708
|
-
for (var
|
|
709
|
-
i =
|
|
710
|
-
i &&
|
|
706
|
+
var r = this, n = r._bufferSize, s = r._timestampProvider, o = r._buffer, u = r._infiniteTimeWindow, a = (u ? 1 : 2) * n;
|
|
707
|
+
if (n < 1 / 0 && a < o.length && o.splice(0, o.length - a), !u) {
|
|
708
|
+
for (var c = s.now(), i = 0, f = 1; f < o.length && o[f] <= c; f += 2)
|
|
709
|
+
i = f;
|
|
710
|
+
i && o.splice(0, i + 1);
|
|
711
711
|
}
|
|
712
712
|
}, e;
|
|
713
|
-
}(oe),
|
|
714
|
-
|
|
713
|
+
}(oe), jt = function(t) {
|
|
714
|
+
Z(e, t);
|
|
715
715
|
function e(r, n) {
|
|
716
716
|
return t.call(this) || this;
|
|
717
717
|
}
|
|
718
718
|
return e.prototype.schedule = function(r, n) {
|
|
719
719
|
return this;
|
|
720
720
|
}, e;
|
|
721
|
-
}(
|
|
721
|
+
}(ve), Ve = {
|
|
722
722
|
setInterval: function(t, e) {
|
|
723
723
|
for (var r = [], n = 2; n < arguments.length; n++)
|
|
724
724
|
r[n - 2] = arguments[n];
|
|
725
|
-
return setInterval.apply(void 0,
|
|
725
|
+
return setInterval.apply(void 0, fe([t, e], le(r)));
|
|
726
726
|
},
|
|
727
727
|
clearInterval: function(t) {
|
|
728
728
|
return clearInterval(t);
|
|
729
729
|
},
|
|
730
730
|
delegate: void 0
|
|
731
731
|
}, Mt = function(t) {
|
|
732
|
-
|
|
732
|
+
Z(e, t);
|
|
733
733
|
function e(r, n) {
|
|
734
|
-
var
|
|
735
|
-
return
|
|
734
|
+
var s = t.call(this, r, n) || this;
|
|
735
|
+
return s.scheduler = r, s.work = n, s.pending = !1, s;
|
|
736
736
|
}
|
|
737
737
|
return e.prototype.schedule = function(r, n) {
|
|
738
|
-
var
|
|
738
|
+
var s;
|
|
739
739
|
if (n === void 0 && (n = 0), this.closed)
|
|
740
740
|
return this;
|
|
741
741
|
this.state = r;
|
|
742
|
-
var
|
|
743
|
-
return
|
|
744
|
-
}, e.prototype.requestAsyncId = function(r, n,
|
|
745
|
-
return
|
|
746
|
-
}, e.prototype.recycleAsyncId = function(r, n,
|
|
747
|
-
if (
|
|
742
|
+
var o = this.id, u = this.scheduler;
|
|
743
|
+
return o != null && (this.id = this.recycleAsyncId(u, o, n)), this.pending = !0, this.delay = n, this.id = (s = this.id) !== null && s !== void 0 ? s : this.requestAsyncId(u, this.id, n), this;
|
|
744
|
+
}, e.prototype.requestAsyncId = function(r, n, s) {
|
|
745
|
+
return s === void 0 && (s = 0), Ve.setInterval(r.flush.bind(r, this), s);
|
|
746
|
+
}, e.prototype.recycleAsyncId = function(r, n, s) {
|
|
747
|
+
if (s === void 0 && (s = 0), s != null && this.delay === s && this.pending === !1)
|
|
748
748
|
return n;
|
|
749
|
-
n != null &&
|
|
749
|
+
n != null && Ve.clearInterval(n);
|
|
750
750
|
}, e.prototype.execute = function(r, n) {
|
|
751
751
|
if (this.closed)
|
|
752
752
|
return new Error("executing a cancelled action");
|
|
753
753
|
this.pending = !1;
|
|
754
|
-
var
|
|
755
|
-
if (
|
|
756
|
-
return
|
|
754
|
+
var s = this._execute(r, n);
|
|
755
|
+
if (s)
|
|
756
|
+
return s;
|
|
757
757
|
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
758
758
|
}, e.prototype._execute = function(r, n) {
|
|
759
|
-
var
|
|
759
|
+
var s = !1, o;
|
|
760
760
|
try {
|
|
761
761
|
this.work(r);
|
|
762
762
|
} catch (u) {
|
|
763
|
-
|
|
763
|
+
s = !0, o = u || new Error("Scheduled action threw falsy error");
|
|
764
764
|
}
|
|
765
|
-
if (
|
|
766
|
-
return this.unsubscribe(),
|
|
765
|
+
if (s)
|
|
766
|
+
return this.unsubscribe(), o;
|
|
767
767
|
}, e.prototype.unsubscribe = function() {
|
|
768
768
|
if (!this.closed) {
|
|
769
|
-
var r = this, n = r.id,
|
|
770
|
-
this.work = this.state = this.scheduler = null, this.pending = !1,
|
|
769
|
+
var r = this, n = r.id, s = r.scheduler, o = s.actions;
|
|
770
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, Ee(o, this), n != null && (this.id = this.recycleAsyncId(s, n, null)), this.delay = null, t.prototype.unsubscribe.call(this);
|
|
771
771
|
}
|
|
772
772
|
}, e;
|
|
773
|
-
}(
|
|
773
|
+
}(jt), Ke = function() {
|
|
774
774
|
function t(e, r) {
|
|
775
775
|
r === void 0 && (r = t.now), this.schedulerActionCtor = e, this.now = r;
|
|
776
776
|
}
|
|
777
777
|
return t.prototype.schedule = function(e, r, n) {
|
|
778
778
|
return r === void 0 && (r = 0), new this.schedulerActionCtor(this, e).schedule(n, r);
|
|
779
|
-
}, t.now =
|
|
780
|
-
}(),
|
|
781
|
-
|
|
779
|
+
}, t.now = Be.now, t;
|
|
780
|
+
}(), Lt = function(t) {
|
|
781
|
+
Z(e, t);
|
|
782
782
|
function e(r, n) {
|
|
783
|
-
n === void 0 && (n =
|
|
784
|
-
var
|
|
785
|
-
return
|
|
783
|
+
n === void 0 && (n = Ke.now);
|
|
784
|
+
var s = t.call(this, r, n) || this;
|
|
785
|
+
return s.actions = [], s._active = !1, s;
|
|
786
786
|
}
|
|
787
787
|
return e.prototype.flush = function(r) {
|
|
788
788
|
var n = this.actions;
|
|
@@ -790,72 +790,72 @@ var It = function(t) {
|
|
|
790
790
|
n.push(r);
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
|
-
var
|
|
793
|
+
var s;
|
|
794
794
|
this._active = !0;
|
|
795
795
|
do
|
|
796
|
-
if (
|
|
796
|
+
if (s = r.execute(r.state, r.delay))
|
|
797
797
|
break;
|
|
798
798
|
while (r = n.shift());
|
|
799
|
-
if (this._active = !1,
|
|
799
|
+
if (this._active = !1, s) {
|
|
800
800
|
for (; r = n.shift(); )
|
|
801
801
|
r.unsubscribe();
|
|
802
|
-
throw
|
|
802
|
+
throw s;
|
|
803
803
|
}
|
|
804
804
|
}, e;
|
|
805
|
-
}(
|
|
805
|
+
}(Ke), Vt = new Lt(Mt), ae = new R(function(t) {
|
|
806
806
|
return t.complete();
|
|
807
807
|
});
|
|
808
|
-
function
|
|
809
|
-
return t &&
|
|
808
|
+
function Kt(t) {
|
|
809
|
+
return t && V(t.schedule);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function Ye(t) {
|
|
812
812
|
return t[t.length - 1];
|
|
813
813
|
}
|
|
814
814
|
function Rt(t) {
|
|
815
|
-
return
|
|
815
|
+
return V(Ye(t)) ? t.pop() : void 0;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
818
|
-
return
|
|
817
|
+
function Ze(t) {
|
|
818
|
+
return Kt(Ye(t)) ? t.pop() : void 0;
|
|
819
819
|
}
|
|
820
|
-
var
|
|
820
|
+
var Je = function(t) {
|
|
821
821
|
return t && typeof t.length == "number" && typeof t != "function";
|
|
822
822
|
};
|
|
823
|
-
function Je(t) {
|
|
824
|
-
return j(t == null ? void 0 : t.then);
|
|
825
|
-
}
|
|
826
823
|
function He(t) {
|
|
827
|
-
return
|
|
824
|
+
return V(t == null ? void 0 : t.then);
|
|
828
825
|
}
|
|
829
826
|
function Qe(t) {
|
|
830
|
-
return
|
|
827
|
+
return V(t[Ce]);
|
|
831
828
|
}
|
|
832
829
|
function Xe(t) {
|
|
830
|
+
return Symbol.asyncIterator && V(t == null ? void 0 : t[Symbol.asyncIterator]);
|
|
831
|
+
}
|
|
832
|
+
function et(t) {
|
|
833
833
|
return new TypeError("You provided " + (t !== null && typeof t == "object" ? "an invalid object" : "'" + t + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Ft() {
|
|
836
836
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
837
837
|
}
|
|
838
|
-
var
|
|
839
|
-
function tt(t) {
|
|
840
|
-
return j(t == null ? void 0 : t[et]);
|
|
841
|
-
}
|
|
838
|
+
var tt = Ft();
|
|
842
839
|
function rt(t) {
|
|
843
|
-
return
|
|
844
|
-
|
|
845
|
-
|
|
840
|
+
return V(t == null ? void 0 : t[tt]);
|
|
841
|
+
}
|
|
842
|
+
function nt(t) {
|
|
843
|
+
return wt(this, arguments, function() {
|
|
844
|
+
var r, n, s, o;
|
|
845
|
+
return ze(this, function(u) {
|
|
846
846
|
switch (u.label) {
|
|
847
847
|
case 0:
|
|
848
848
|
r = t.getReader(), u.label = 1;
|
|
849
849
|
case 1:
|
|
850
850
|
u.trys.push([1, , 9, 10]), u.label = 2;
|
|
851
851
|
case 2:
|
|
852
|
-
return [4,
|
|
852
|
+
return [4, ue(r.read())];
|
|
853
853
|
case 3:
|
|
854
|
-
return n = u.sent(),
|
|
854
|
+
return n = u.sent(), s = n.value, o = n.done, o ? [4, ue(void 0)] : [3, 5];
|
|
855
855
|
case 4:
|
|
856
856
|
return [2, u.sent()];
|
|
857
857
|
case 5:
|
|
858
|
-
return [4,
|
|
858
|
+
return [4, ue(s)];
|
|
859
859
|
case 6:
|
|
860
860
|
return [4, u.sent()];
|
|
861
861
|
case 7:
|
|
@@ -870,58 +870,58 @@ function rt(t) {
|
|
|
870
870
|
});
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
|
-
function
|
|
874
|
-
return
|
|
873
|
+
function st(t) {
|
|
874
|
+
return V(t == null ? void 0 : t.getReader);
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function te(t) {
|
|
877
877
|
if (t instanceof R)
|
|
878
878
|
return t;
|
|
879
879
|
if (t != null) {
|
|
880
|
-
if (
|
|
881
|
-
return Ft(t);
|
|
882
|
-
if (Ze(t))
|
|
880
|
+
if (Qe(t))
|
|
883
881
|
return Dt(t);
|
|
884
882
|
if (Je(t))
|
|
885
883
|
return Nt(t);
|
|
886
|
-
if (
|
|
887
|
-
return ot(t);
|
|
888
|
-
if (tt(t))
|
|
884
|
+
if (He(t))
|
|
889
885
|
return Ut(t);
|
|
890
|
-
if (
|
|
886
|
+
if (Xe(t))
|
|
887
|
+
return ot(t);
|
|
888
|
+
if (rt(t))
|
|
891
889
|
return zt(t);
|
|
890
|
+
if (st(t))
|
|
891
|
+
return Gt(t);
|
|
892
892
|
}
|
|
893
|
-
throw
|
|
893
|
+
throw et(t);
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function Dt(t) {
|
|
896
896
|
return new R(function(e) {
|
|
897
897
|
var r = t[Ce]();
|
|
898
|
-
if (
|
|
898
|
+
if (V(r.subscribe))
|
|
899
899
|
return r.subscribe(e);
|
|
900
900
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
901
901
|
});
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function Nt(t) {
|
|
904
904
|
return new R(function(e) {
|
|
905
905
|
for (var r = 0; r < t.length && !e.closed; r++)
|
|
906
906
|
e.next(t[r]);
|
|
907
907
|
e.complete();
|
|
908
908
|
});
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function Ut(t) {
|
|
911
911
|
return new R(function(e) {
|
|
912
912
|
t.then(function(r) {
|
|
913
913
|
e.closed || (e.next(r), e.complete());
|
|
914
914
|
}, function(r) {
|
|
915
915
|
return e.error(r);
|
|
916
|
-
}).then(null,
|
|
916
|
+
}).then(null, We);
|
|
917
917
|
});
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function zt(t) {
|
|
920
920
|
return new R(function(e) {
|
|
921
921
|
var r, n;
|
|
922
922
|
try {
|
|
923
|
-
for (var
|
|
924
|
-
var u =
|
|
923
|
+
for (var s = ce(t), o = s.next(); !o.done; o = s.next()) {
|
|
924
|
+
var u = o.value;
|
|
925
925
|
if (e.next(u), e.closed)
|
|
926
926
|
return;
|
|
927
927
|
}
|
|
@@ -929,7 +929,7 @@ function Ut(t) {
|
|
|
929
929
|
r = { error: a };
|
|
930
930
|
} finally {
|
|
931
931
|
try {
|
|
932
|
-
|
|
932
|
+
o && !o.done && (n = s.return) && n.call(s);
|
|
933
933
|
} finally {
|
|
934
934
|
if (r) throw r.error;
|
|
935
935
|
}
|
|
@@ -944,38 +944,38 @@ function ot(t) {
|
|
|
944
944
|
});
|
|
945
945
|
});
|
|
946
946
|
}
|
|
947
|
-
function
|
|
948
|
-
return ot(
|
|
947
|
+
function Gt(t) {
|
|
948
|
+
return ot(nt(t));
|
|
949
949
|
}
|
|
950
950
|
function qt(t, e) {
|
|
951
|
-
var r, n,
|
|
952
|
-
return
|
|
951
|
+
var r, n, s, o;
|
|
952
|
+
return bt(this, void 0, void 0, function() {
|
|
953
953
|
var u, a;
|
|
954
|
-
return
|
|
955
|
-
switch (
|
|
954
|
+
return ze(this, function(c) {
|
|
955
|
+
switch (c.label) {
|
|
956
956
|
case 0:
|
|
957
|
-
|
|
957
|
+
c.trys.push([0, 5, 6, 11]), r = Et(t), c.label = 1;
|
|
958
958
|
case 1:
|
|
959
959
|
return [4, r.next()];
|
|
960
960
|
case 2:
|
|
961
|
-
if (n =
|
|
961
|
+
if (n = c.sent(), !!n.done) return [3, 4];
|
|
962
962
|
if (u = n.value, e.next(u), e.closed)
|
|
963
963
|
return [2];
|
|
964
|
-
|
|
964
|
+
c.label = 3;
|
|
965
965
|
case 3:
|
|
966
966
|
return [3, 1];
|
|
967
967
|
case 4:
|
|
968
968
|
return [3, 11];
|
|
969
969
|
case 5:
|
|
970
|
-
return a =
|
|
970
|
+
return a = c.sent(), s = { error: a }, [3, 11];
|
|
971
971
|
case 6:
|
|
972
|
-
return
|
|
972
|
+
return c.trys.push([6, , 9, 10]), n && !n.done && (o = r.return) ? [4, o.call(r)] : [3, 8];
|
|
973
973
|
case 7:
|
|
974
|
-
|
|
974
|
+
c.sent(), c.label = 8;
|
|
975
975
|
case 8:
|
|
976
976
|
return [3, 10];
|
|
977
977
|
case 9:
|
|
978
|
-
if (
|
|
978
|
+
if (s) throw s.error;
|
|
979
979
|
return [7];
|
|
980
980
|
case 10:
|
|
981
981
|
return [7];
|
|
@@ -985,45 +985,45 @@ function qt(t, e) {
|
|
|
985
985
|
});
|
|
986
986
|
});
|
|
987
987
|
}
|
|
988
|
-
function
|
|
989
|
-
n === void 0 && (n = 0),
|
|
990
|
-
var
|
|
991
|
-
r(),
|
|
988
|
+
function se(t, e, r, n, s) {
|
|
989
|
+
n === void 0 && (n = 0), s === void 0 && (s = !1);
|
|
990
|
+
var o = e.schedule(function() {
|
|
991
|
+
r(), s ? t.add(this.schedule(null, n)) : this.unsubscribe();
|
|
992
992
|
}, n);
|
|
993
|
-
if (t.add(
|
|
994
|
-
return
|
|
995
|
-
}
|
|
996
|
-
function
|
|
997
|
-
return e === void 0 && (e = 0),
|
|
998
|
-
r.subscribe(
|
|
999
|
-
return
|
|
1000
|
-
return n.next(
|
|
993
|
+
if (t.add(o), !s)
|
|
994
|
+
return o;
|
|
995
|
+
}
|
|
996
|
+
function at(t, e) {
|
|
997
|
+
return e === void 0 && (e = 0), z(function(r, n) {
|
|
998
|
+
r.subscribe(U(n, function(s) {
|
|
999
|
+
return se(n, t, function() {
|
|
1000
|
+
return n.next(s);
|
|
1001
1001
|
}, e);
|
|
1002
1002
|
}, function() {
|
|
1003
|
-
return
|
|
1003
|
+
return se(n, t, function() {
|
|
1004
1004
|
return n.complete();
|
|
1005
1005
|
}, e);
|
|
1006
|
-
}, function(
|
|
1007
|
-
return
|
|
1008
|
-
return n.error(
|
|
1006
|
+
}, function(s) {
|
|
1007
|
+
return se(n, t, function() {
|
|
1008
|
+
return n.error(s);
|
|
1009
1009
|
}, e);
|
|
1010
1010
|
}));
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1014
|
-
return e === void 0 && (e = 0),
|
|
1013
|
+
function it(t, e) {
|
|
1014
|
+
return e === void 0 && (e = 0), z(function(r, n) {
|
|
1015
1015
|
n.add(t.schedule(function() {
|
|
1016
1016
|
return r.subscribe(n);
|
|
1017
1017
|
}, e));
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
|
-
function Gt(t, e) {
|
|
1021
|
-
return X(t).pipe(at(e), st(e));
|
|
1022
|
-
}
|
|
1023
1020
|
function Wt(t, e) {
|
|
1024
|
-
return
|
|
1021
|
+
return te(t).pipe(it(e), at(e));
|
|
1025
1022
|
}
|
|
1026
1023
|
function Yt(t, e) {
|
|
1024
|
+
return te(t).pipe(it(e), at(e));
|
|
1025
|
+
}
|
|
1026
|
+
function Zt(t, e) {
|
|
1027
1027
|
return new R(function(r) {
|
|
1028
1028
|
var n = 0;
|
|
1029
1029
|
return e.schedule(function() {
|
|
@@ -1031,98 +1031,98 @@ function Yt(t, e) {
|
|
|
1031
1031
|
});
|
|
1032
1032
|
});
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1034
|
+
function Jt(t, e) {
|
|
1035
1035
|
return new R(function(r) {
|
|
1036
1036
|
var n;
|
|
1037
|
-
return
|
|
1038
|
-
n = t[
|
|
1039
|
-
var
|
|
1037
|
+
return se(r, e, function() {
|
|
1038
|
+
n = t[tt](), se(r, e, function() {
|
|
1039
|
+
var s, o, u;
|
|
1040
1040
|
try {
|
|
1041
|
-
|
|
1041
|
+
s = n.next(), o = s.value, u = s.done;
|
|
1042
1042
|
} catch (a) {
|
|
1043
1043
|
r.error(a);
|
|
1044
1044
|
return;
|
|
1045
1045
|
}
|
|
1046
|
-
u ? r.complete() : r.next(
|
|
1046
|
+
u ? r.complete() : r.next(o);
|
|
1047
1047
|
}, 0, !0);
|
|
1048
1048
|
}), function() {
|
|
1049
|
-
return
|
|
1049
|
+
return V(n == null ? void 0 : n.return) && n.return();
|
|
1050
1050
|
};
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function ut(t, e) {
|
|
1054
1054
|
if (!t)
|
|
1055
1055
|
throw new Error("Iterable cannot be null");
|
|
1056
1056
|
return new R(function(r) {
|
|
1057
|
-
|
|
1057
|
+
se(r, e, function() {
|
|
1058
1058
|
var n = t[Symbol.asyncIterator]();
|
|
1059
|
-
|
|
1060
|
-
n.next().then(function(
|
|
1061
|
-
|
|
1059
|
+
se(r, e, function() {
|
|
1060
|
+
n.next().then(function(s) {
|
|
1061
|
+
s.done ? r.complete() : r.next(s.value);
|
|
1062
1062
|
});
|
|
1063
1063
|
}, 0, !0);
|
|
1064
1064
|
});
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
|
-
function Jt(t, e) {
|
|
1068
|
-
return it(rt(t), e);
|
|
1069
|
-
}
|
|
1070
1067
|
function Ht(t, e) {
|
|
1068
|
+
return ut(nt(t), e);
|
|
1069
|
+
}
|
|
1070
|
+
function Qt(t, e) {
|
|
1071
1071
|
if (t != null) {
|
|
1072
|
-
if (He(t))
|
|
1073
|
-
return Gt(t, e);
|
|
1074
|
-
if (Ze(t))
|
|
1075
|
-
return Yt(t, e);
|
|
1076
|
-
if (Je(t))
|
|
1077
|
-
return Wt(t, e);
|
|
1078
1072
|
if (Qe(t))
|
|
1079
|
-
return
|
|
1080
|
-
if (
|
|
1073
|
+
return Wt(t, e);
|
|
1074
|
+
if (Je(t))
|
|
1081
1075
|
return Zt(t, e);
|
|
1082
|
-
if (
|
|
1076
|
+
if (He(t))
|
|
1077
|
+
return Yt(t, e);
|
|
1078
|
+
if (Xe(t))
|
|
1079
|
+
return ut(t, e);
|
|
1080
|
+
if (rt(t))
|
|
1083
1081
|
return Jt(t, e);
|
|
1082
|
+
if (st(t))
|
|
1083
|
+
return Ht(t, e);
|
|
1084
1084
|
}
|
|
1085
|
-
throw
|
|
1085
|
+
throw et(t);
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return e ?
|
|
1087
|
+
function Pe(t, e) {
|
|
1088
|
+
return e ? Qt(t, e) : te(t);
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function Xt() {
|
|
1091
1091
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1092
1092
|
t[e] = arguments[e];
|
|
1093
|
-
var r =
|
|
1094
|
-
return
|
|
1093
|
+
var r = Ze(t);
|
|
1094
|
+
return Pe(t, r);
|
|
1095
1095
|
}
|
|
1096
|
-
var
|
|
1096
|
+
var ct = Oe(function(t) {
|
|
1097
1097
|
return function() {
|
|
1098
1098
|
t(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
1099
1099
|
};
|
|
1100
1100
|
});
|
|
1101
1101
|
function q(t, e) {
|
|
1102
|
-
return
|
|
1103
|
-
var
|
|
1104
|
-
r.subscribe(
|
|
1105
|
-
n.next(t.call(e,
|
|
1102
|
+
return z(function(r, n) {
|
|
1103
|
+
var s = 0;
|
|
1104
|
+
r.subscribe(U(n, function(o) {
|
|
1105
|
+
n.next(t.call(e, o, s++));
|
|
1106
1106
|
}));
|
|
1107
1107
|
});
|
|
1108
1108
|
}
|
|
1109
|
-
var
|
|
1110
|
-
function
|
|
1111
|
-
return
|
|
1109
|
+
var er = Array.isArray;
|
|
1110
|
+
function tr(t, e) {
|
|
1111
|
+
return er(e) ? t.apply(void 0, fe([], le(e))) : t(e);
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function rr(t) {
|
|
1114
1114
|
return q(function(e) {
|
|
1115
|
-
return
|
|
1115
|
+
return tr(t, e);
|
|
1116
1116
|
});
|
|
1117
1117
|
}
|
|
1118
|
-
var
|
|
1119
|
-
function
|
|
1118
|
+
var nr = Array.isArray, sr = Object.getPrototypeOf, or = Object.prototype, ar = Object.keys;
|
|
1119
|
+
function ir(t) {
|
|
1120
1120
|
if (t.length === 1) {
|
|
1121
1121
|
var e = t[0];
|
|
1122
|
-
if (
|
|
1122
|
+
if (nr(e))
|
|
1123
1123
|
return { args: e, keys: null };
|
|
1124
|
-
if (
|
|
1125
|
-
var r =
|
|
1124
|
+
if (ur(e)) {
|
|
1125
|
+
var r = ar(e);
|
|
1126
1126
|
return {
|
|
1127
1127
|
args: r.map(function(n) {
|
|
1128
1128
|
return e[n];
|
|
@@ -1133,147 +1133,147 @@ function ar(t) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
return { args: t, keys: null };
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1137
|
-
return t && typeof t == "object" &&
|
|
1136
|
+
function ur(t) {
|
|
1137
|
+
return t && typeof t == "object" && sr(t) === or;
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1140
|
-
return t.reduce(function(r, n,
|
|
1141
|
-
return r[n] = e[
|
|
1139
|
+
function cr(t, e) {
|
|
1140
|
+
return t.reduce(function(r, n, s) {
|
|
1141
|
+
return r[n] = e[s], r;
|
|
1142
1142
|
}, {});
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function H() {
|
|
1145
1145
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1146
1146
|
t[e] = arguments[e];
|
|
1147
|
-
var r =
|
|
1148
|
-
if (
|
|
1149
|
-
return
|
|
1150
|
-
var a = new R(lr(
|
|
1151
|
-
return
|
|
1147
|
+
var r = Ze(t), n = Rt(t), s = ir(t), o = s.args, u = s.keys;
|
|
1148
|
+
if (o.length === 0)
|
|
1149
|
+
return Pe([], r);
|
|
1150
|
+
var a = new R(lr(o, r, u ? function(c) {
|
|
1151
|
+
return cr(u, c);
|
|
1152
1152
|
} : me));
|
|
1153
|
-
return n ? a.pipe(
|
|
1153
|
+
return n ? a.pipe(rr(n)) : a;
|
|
1154
1154
|
}
|
|
1155
1155
|
function lr(t, e, r) {
|
|
1156
1156
|
return r === void 0 && (r = me), function(n) {
|
|
1157
1157
|
Re(e, function() {
|
|
1158
|
-
for (var
|
|
1158
|
+
for (var s = t.length, o = new Array(s), u = s, a = s, c = function(f) {
|
|
1159
1159
|
Re(e, function() {
|
|
1160
|
-
var
|
|
1161
|
-
|
|
1162
|
-
|
|
1160
|
+
var w = Pe(t[f], e), S = !1;
|
|
1161
|
+
w.subscribe(U(n, function(y) {
|
|
1162
|
+
o[f] = y, S || (S = !0, a--), a || n.next(r(o.slice()));
|
|
1163
1163
|
}, function() {
|
|
1164
1164
|
--u || n.complete();
|
|
1165
1165
|
}));
|
|
1166
1166
|
}, n);
|
|
1167
|
-
}, i = 0; i <
|
|
1168
|
-
|
|
1167
|
+
}, i = 0; i < s; i++)
|
|
1168
|
+
c(i);
|
|
1169
1169
|
}, n);
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
function Re(t, e, r) {
|
|
1173
|
-
t ?
|
|
1173
|
+
t ? se(r, t, e) : e();
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1175
|
+
function fr(t) {
|
|
1176
1176
|
return new R(function(e) {
|
|
1177
|
-
|
|
1177
|
+
te(t()).subscribe(e);
|
|
1178
1178
|
});
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1181
|
-
return
|
|
1180
|
+
function hr(t, e, r) {
|
|
1181
|
+
return fr(function() {
|
|
1182
1182
|
return t() ? e : r;
|
|
1183
1183
|
});
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return
|
|
1187
|
-
var
|
|
1188
|
-
r.subscribe(
|
|
1189
|
-
return t.call(e,
|
|
1185
|
+
function pe(t, e) {
|
|
1186
|
+
return z(function(r, n) {
|
|
1187
|
+
var s = 0;
|
|
1188
|
+
r.subscribe(U(n, function(o) {
|
|
1189
|
+
return t.call(e, o, s++) && n.next(o);
|
|
1190
1190
|
}));
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return
|
|
1195
|
-
var n = null,
|
|
1196
|
-
n = e.subscribe(
|
|
1197
|
-
|
|
1198
|
-
})),
|
|
1193
|
+
function ie(t) {
|
|
1194
|
+
return z(function(e, r) {
|
|
1195
|
+
var n = null, s = !1, o;
|
|
1196
|
+
n = e.subscribe(U(r, void 0, void 0, function(u) {
|
|
1197
|
+
o = te(t(u, ie(t)(e))), n ? (n.unsubscribe(), n = null, o.subscribe(r)) : s = !0;
|
|
1198
|
+
})), s && (n.unsubscribe(), n = null, o.subscribe(r));
|
|
1199
1199
|
});
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
return e === void 0 && (e =
|
|
1203
|
-
var
|
|
1204
|
-
if (
|
|
1205
|
-
|
|
1206
|
-
var i =
|
|
1207
|
-
|
|
1201
|
+
function W(t, e) {
|
|
1202
|
+
return e === void 0 && (e = Vt), z(function(r, n) {
|
|
1203
|
+
var s = null, o = null, u = null, a = function() {
|
|
1204
|
+
if (s) {
|
|
1205
|
+
s.unsubscribe(), s = null;
|
|
1206
|
+
var i = o;
|
|
1207
|
+
o = null, n.next(i);
|
|
1208
1208
|
}
|
|
1209
1209
|
};
|
|
1210
|
-
function
|
|
1211
|
-
var i = u + t,
|
|
1212
|
-
if (
|
|
1213
|
-
|
|
1210
|
+
function c() {
|
|
1211
|
+
var i = u + t, f = e.now();
|
|
1212
|
+
if (f < i) {
|
|
1213
|
+
s = this.schedule(void 0, i - f), n.add(s);
|
|
1214
1214
|
return;
|
|
1215
1215
|
}
|
|
1216
1216
|
a();
|
|
1217
1217
|
}
|
|
1218
|
-
r.subscribe(
|
|
1219
|
-
|
|
1218
|
+
r.subscribe(U(n, function(i) {
|
|
1219
|
+
o = i, u = e.now(), s || (s = e.schedule(c, t), n.add(s));
|
|
1220
1220
|
}, function() {
|
|
1221
1221
|
a(), n.complete();
|
|
1222
1222
|
}, void 0, function() {
|
|
1223
|
-
|
|
1223
|
+
o = s = null;
|
|
1224
1224
|
}));
|
|
1225
1225
|
});
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1228
|
-
return
|
|
1227
|
+
function yr(t) {
|
|
1228
|
+
return z(function(e, r) {
|
|
1229
1229
|
var n = !1;
|
|
1230
|
-
e.subscribe(
|
|
1231
|
-
n = !0, r.next(
|
|
1230
|
+
e.subscribe(U(r, function(s) {
|
|
1231
|
+
n = !0, r.next(s);
|
|
1232
1232
|
}, function() {
|
|
1233
1233
|
n || r.next(t), r.complete();
|
|
1234
1234
|
}));
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function pr(t) {
|
|
1238
1238
|
return t <= 0 ? function() {
|
|
1239
|
-
return
|
|
1240
|
-
} :
|
|
1239
|
+
return ae;
|
|
1240
|
+
} : z(function(e, r) {
|
|
1241
1241
|
var n = 0;
|
|
1242
|
-
e.subscribe(
|
|
1243
|
-
++n <= t && (r.next(
|
|
1242
|
+
e.subscribe(U(r, function(s) {
|
|
1243
|
+
++n <= t && (r.next(s), t <= n && r.complete());
|
|
1244
1244
|
}));
|
|
1245
1245
|
});
|
|
1246
1246
|
}
|
|
1247
|
-
function
|
|
1248
|
-
return e === void 0 && (e = me), t = t ??
|
|
1249
|
-
var
|
|
1250
|
-
r.subscribe(
|
|
1247
|
+
function dr(t, e) {
|
|
1248
|
+
return e === void 0 && (e = me), t = t ?? vr, z(function(r, n) {
|
|
1249
|
+
var s, o = !0;
|
|
1250
|
+
r.subscribe(U(n, function(u) {
|
|
1251
1251
|
var a = e(u);
|
|
1252
|
-
(
|
|
1252
|
+
(o || !t(s, a)) && (o = !1, s = a, n.next(u));
|
|
1253
1253
|
}));
|
|
1254
1254
|
});
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function vr(t, e) {
|
|
1257
1257
|
return t === e;
|
|
1258
1258
|
}
|
|
1259
1259
|
function mr(t) {
|
|
1260
|
-
return t === void 0 && (t =
|
|
1260
|
+
return t === void 0 && (t = gr), z(function(e, r) {
|
|
1261
1261
|
var n = !1;
|
|
1262
|
-
e.subscribe(
|
|
1263
|
-
n = !0, r.next(
|
|
1262
|
+
e.subscribe(U(r, function(s) {
|
|
1263
|
+
n = !0, r.next(s);
|
|
1264
1264
|
}, function() {
|
|
1265
1265
|
return n ? r.complete() : r.error(t());
|
|
1266
1266
|
}));
|
|
1267
1267
|
});
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return new
|
|
1269
|
+
function gr() {
|
|
1270
|
+
return new ct();
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1272
|
+
function br(t, e) {
|
|
1273
1273
|
var r = arguments.length >= 2;
|
|
1274
1274
|
return function(n) {
|
|
1275
|
-
return n.pipe(me,
|
|
1276
|
-
return new
|
|
1275
|
+
return n.pipe(me, pr(1), r ? yr(e) : mr(function() {
|
|
1276
|
+
return new ct();
|
|
1277
1277
|
}));
|
|
1278
1278
|
};
|
|
1279
1279
|
}
|
|
@@ -1281,32 +1281,32 @@ function lt(t) {
|
|
|
1281
1281
|
t === void 0 && (t = {});
|
|
1282
1282
|
var e = t.connector, r = e === void 0 ? function() {
|
|
1283
1283
|
return new oe();
|
|
1284
|
-
} : e, n = t.resetOnError,
|
|
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
|
|
1287
|
-
|
|
1288
|
-
},
|
|
1289
|
-
d(),
|
|
1290
|
-
},
|
|
1291
|
-
var
|
|
1292
|
-
|
|
1286
|
+
var f, w, S, y = 0, A = !1, v = !1, d = function() {
|
|
1287
|
+
w == null || w.unsubscribe(), w = void 0;
|
|
1288
|
+
}, b = function() {
|
|
1289
|
+
d(), f = S = void 0, A = v = !1;
|
|
1290
|
+
}, O = function() {
|
|
1291
|
+
var I = f;
|
|
1292
|
+
b(), I == null || I.unsubscribe();
|
|
1293
1293
|
};
|
|
1294
|
-
return
|
|
1295
|
-
|
|
1296
|
-
var
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
}),
|
|
1300
|
-
next: function(
|
|
1301
|
-
return
|
|
1294
|
+
return z(function(I, h) {
|
|
1295
|
+
y++, !v && !A && d();
|
|
1296
|
+
var p = S = S ?? r();
|
|
1297
|
+
h.add(function() {
|
|
1298
|
+
y--, y === 0 && !v && !A && (w = Se(O, c));
|
|
1299
|
+
}), p.subscribe(h), !f && y > 0 && (f = new ye({
|
|
1300
|
+
next: function(E) {
|
|
1301
|
+
return p.next(E);
|
|
1302
1302
|
},
|
|
1303
|
-
error: function(
|
|
1304
|
-
|
|
1303
|
+
error: function(E) {
|
|
1304
|
+
v = !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();
|
|
1308
1308
|
}
|
|
1309
|
-
}),
|
|
1309
|
+
}), te(I).subscribe(f));
|
|
1310
1310
|
})(i);
|
|
1311
1311
|
};
|
|
1312
1312
|
}
|
|
@@ -1318,106 +1318,106 @@ function Se(t, e) {
|
|
|
1318
1318
|
return;
|
|
1319
1319
|
}
|
|
1320
1320
|
if (e !== !1) {
|
|
1321
|
-
var
|
|
1321
|
+
var s = new ye({
|
|
1322
1322
|
next: function() {
|
|
1323
|
-
|
|
1323
|
+
s.unsubscribe(), t();
|
|
1324
1324
|
}
|
|
1325
1325
|
});
|
|
1326
|
-
return
|
|
1326
|
+
return te(e.apply(void 0, fe([], le(r)))).subscribe(s);
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1330
|
-
var n,
|
|
1329
|
+
function ne(t, e, r) {
|
|
1330
|
+
var n, s = !1;
|
|
1331
1331
|
return n = t, lt({
|
|
1332
1332
|
connector: function() {
|
|
1333
|
-
return new
|
|
1333
|
+
return new kt(n, e, r);
|
|
1334
1334
|
},
|
|
1335
1335
|
resetOnError: !0,
|
|
1336
1336
|
resetOnComplete: !1,
|
|
1337
|
-
resetOnRefCountZero:
|
|
1337
|
+
resetOnRefCountZero: s
|
|
1338
1338
|
});
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return
|
|
1342
|
-
var
|
|
1343
|
-
return u && !
|
|
1340
|
+
function wr(t, e) {
|
|
1341
|
+
return z(function(r, n) {
|
|
1342
|
+
var s = null, o = 0, u = !1, a = function() {
|
|
1343
|
+
return u && !s && n.complete();
|
|
1344
1344
|
};
|
|
1345
|
-
r.subscribe(
|
|
1346
|
-
|
|
1347
|
-
var i = 0,
|
|
1348
|
-
|
|
1349
|
-
return n.next(e ? e(
|
|
1345
|
+
r.subscribe(U(n, function(c) {
|
|
1346
|
+
s == null || s.unsubscribe();
|
|
1347
|
+
var i = 0, f = o++;
|
|
1348
|
+
te(t(c, f)).subscribe(s = U(n, function(w) {
|
|
1349
|
+
return n.next(e ? e(c, w, f, i++) : w);
|
|
1350
1350
|
}, function() {
|
|
1351
|
-
|
|
1351
|
+
s = null, a();
|
|
1352
1352
|
}));
|
|
1353
1353
|
}, function() {
|
|
1354
1354
|
u = !0, a();
|
|
1355
1355
|
}));
|
|
1356
1356
|
});
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1359
|
-
return
|
|
1360
|
-
|
|
1358
|
+
function Er(t) {
|
|
1359
|
+
return z(function(e, r) {
|
|
1360
|
+
te(t).subscribe(U(r, function() {
|
|
1361
1361
|
return r.complete();
|
|
1362
|
-
},
|
|
1362
|
+
}, Te)), !r.closed && e.subscribe(r);
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1365
|
+
function xr(t) {
|
|
1366
1366
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1367
1367
|
return e.length === 0 ? null : e.reduce((r, n) => r + n, 0);
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1369
|
+
function Ar(t) {
|
|
1370
1370
|
const e = t.filter((n) => n !== null && !isNaN(n));
|
|
1371
|
-
return e.length === 0 ? null : e.reduce((n,
|
|
1371
|
+
return e.length === 0 ? null : e.reduce((n, s) => n + s, 0) / e.length;
|
|
1372
1372
|
}
|
|
1373
1373
|
function Sr(t) {
|
|
1374
|
-
const e = t.filter((
|
|
1374
|
+
const e = t.filter((s) => s !== null && !isNaN(s));
|
|
1375
1375
|
if (e.length === 0) return null;
|
|
1376
|
-
const r = [...e].sort((
|
|
1376
|
+
const r = [...e].sort((s, o) => s - o), n = Math.floor(r.length / 2);
|
|
1377
1377
|
return r.length % 2 === 0 ? (r[n - 1] + r[n]) / 2 : r[n];
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1379
|
+
function _r(t) {
|
|
1380
1380
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1381
1381
|
return e.length === 0 ? null : Math.min(...e);
|
|
1382
1382
|
}
|
|
1383
|
-
function
|
|
1383
|
+
function Tr(t) {
|
|
1384
1384
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1385
1385
|
return e.length === 0 ? null : Math.max(...e);
|
|
1386
1386
|
}
|
|
1387
1387
|
function $r(t) {
|
|
1388
1388
|
return t.filter((e) => e !== null && !isNaN(e)).length;
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Or(t) {
|
|
1391
1391
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1392
1392
|
return e.length > 0 ? e[0] : null;
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function de(t, e) {
|
|
1395
1395
|
switch (e) {
|
|
1396
1396
|
case "sum":
|
|
1397
|
-
return Er(t);
|
|
1398
|
-
case "mean":
|
|
1399
1397
|
return xr(t);
|
|
1398
|
+
case "mean":
|
|
1399
|
+
return Ar(t);
|
|
1400
1400
|
case "median":
|
|
1401
1401
|
return Sr(t);
|
|
1402
1402
|
case "min":
|
|
1403
|
-
return Ar(t);
|
|
1404
|
-
case "max":
|
|
1405
1403
|
return _r(t);
|
|
1404
|
+
case "max":
|
|
1405
|
+
return Tr(t);
|
|
1406
1406
|
case "count":
|
|
1407
1407
|
return $r(t);
|
|
1408
1408
|
case "none":
|
|
1409
|
-
return
|
|
1409
|
+
return Or(t);
|
|
1410
1410
|
default:
|
|
1411
1411
|
throw new Error(`Unknown aggregate type: ${e}`);
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1414
|
+
function Ir(t, e) {
|
|
1415
1415
|
let r;
|
|
1416
1416
|
e.colorScheme === "auto" ? r = "light" : r = e.colorScheme;
|
|
1417
|
-
const n = e.colors[r].data,
|
|
1418
|
-
return n[
|
|
1417
|
+
const n = e.colors[r].data, s = t % n.length;
|
|
1418
|
+
return n[s];
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function D(t, e, r) {
|
|
1421
1421
|
let n;
|
|
1422
1422
|
switch (t) {
|
|
1423
1423
|
case "index":
|
|
@@ -1435,33 +1435,33 @@ function K(t, e, r) {
|
|
|
1435
1435
|
default:
|
|
1436
1436
|
n = 0;
|
|
1437
1437
|
}
|
|
1438
|
-
return
|
|
1438
|
+
return Ir(n, r);
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function ee(t) {
|
|
1441
1441
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
1442
1442
|
}
|
|
1443
1443
|
function Cr(t) {
|
|
1444
1444
|
return Object.prototype.toString.call(t) === "[object Function]";
|
|
1445
1445
|
}
|
|
1446
|
-
function
|
|
1446
|
+
function ft(t) {
|
|
1447
1447
|
return !!(t && t.nodeType);
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1450
|
-
if (
|
|
1449
|
+
function Y(t, e) {
|
|
1450
|
+
if (ee(e) === !1 || ee(t) === !1)
|
|
1451
1451
|
return Object.assign({}, t);
|
|
1452
|
-
const r = (n,
|
|
1453
|
-
const
|
|
1454
|
-
for (let u of Object.keys(
|
|
1452
|
+
const r = (n, s) => {
|
|
1453
|
+
const o = Object.assign({}, n);
|
|
1454
|
+
for (let u of Object.keys(s)) {
|
|
1455
1455
|
if (!(u in n))
|
|
1456
1456
|
continue;
|
|
1457
1457
|
let a;
|
|
1458
|
-
|
|
1458
|
+
ee(s[u]) && ee(n[u]) ? (a = r(n[u], s[u]), o[u] = a) : o[u] = s[u];
|
|
1459
1459
|
}
|
|
1460
|
-
return
|
|
1460
|
+
return o;
|
|
1461
1461
|
};
|
|
1462
1462
|
return r(t, e);
|
|
1463
1463
|
}
|
|
1464
|
-
function
|
|
1464
|
+
function Zr(t = 0) {
|
|
1465
1465
|
try {
|
|
1466
1466
|
let e = t.toString().split(".");
|
|
1467
1467
|
return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), e.join(".");
|
|
@@ -1469,56 +1469,59 @@ function Yr(t = 0) {
|
|
|
1469
1469
|
console.error(e);
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function Br(t) {
|
|
1473
1473
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1474
1474
|
return e.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), e.setAttribute("xmls", "http://www.w3.org/2000/svg"), e.setAttribute("version", "1.1"), e.style.position = "absolute", t && e.classList.add(t), e;
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1476
|
+
function Jr(t) {
|
|
1477
1477
|
const e = document.createElement("canvas");
|
|
1478
1478
|
return e.style.position = "absolute", t && e.classList.add(t), e;
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function Pr(t) {
|
|
1481
1481
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1482
1482
|
return t && e.classList.add(t), e;
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function ht(t) {
|
|
1485
1485
|
const e = document.createElement("canvas");
|
|
1486
1486
|
return t && e.classList.add(t), e;
|
|
1487
1487
|
}
|
|
1488
|
-
function
|
|
1488
|
+
function Hr(t) {
|
|
1489
1489
|
const e = document.createElement("div");
|
|
1490
1490
|
return t && e.classList.add(t), e;
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1493
|
-
if (
|
|
1492
|
+
function kr(t) {
|
|
1493
|
+
if (ft(t))
|
|
1494
1494
|
for (; t.firstChild; )
|
|
1495
1495
|
t.removeChild(t.firstChild);
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function $(t, e, r = "") {
|
|
1498
|
+
return e.ignore ? "" : t[e.from] || r;
|
|
1499
|
+
}
|
|
1500
|
+
function yt(t) {
|
|
1498
1501
|
return `[OrbCharts ${t}]:`;
|
|
1499
1502
|
}
|
|
1500
|
-
function
|
|
1501
|
-
return `${
|
|
1503
|
+
function G(t) {
|
|
1504
|
+
return `${yt("error")} ${t.message}`;
|
|
1502
1505
|
}
|
|
1503
|
-
function
|
|
1506
|
+
function he({ from: t, systemMessage: e }) {
|
|
1504
1507
|
return `unexpected error from '${t}':
|
|
1505
1508
|
${e}`;
|
|
1506
1509
|
}
|
|
1507
|
-
function
|
|
1510
|
+
function Q({ columnName: t, expectToBe: e, from: r }) {
|
|
1508
1511
|
return `Invalid value: '${t}' must be '${e}'
|
|
1509
1512
|
|
|
1510
1513
|
----> find in '${r}'`;
|
|
1511
1514
|
}
|
|
1512
|
-
function
|
|
1513
|
-
return `${
|
|
1515
|
+
function X({ columnName: t, expectToBe: e, from: r }) {
|
|
1516
|
+
return `${yt("warning")} Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
|
|
1514
1517
|
|
|
1515
1518
|
----> find in '${r}'`;
|
|
1516
1519
|
}
|
|
1517
|
-
function
|
|
1520
|
+
function jr(t) {
|
|
1518
1521
|
return new R((e) => {
|
|
1519
1522
|
const r = new ResizeObserver((n) => {
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1523
|
+
const s = n[0];
|
|
1524
|
+
s && s.contentRect && e.next(s.contentRect);
|
|
1522
1525
|
});
|
|
1523
1526
|
return r.observe(t), function() {
|
|
1524
1527
|
r.unobserve(t);
|
|
@@ -1528,48 +1531,50 @@ function kr(t) {
|
|
|
1528
1531
|
function Mr(t) {
|
|
1529
1532
|
return `orbcharts-${t}`;
|
|
1530
1533
|
}
|
|
1531
|
-
function
|
|
1534
|
+
function Lr(t, e) {
|
|
1532
1535
|
return `${Mr(t)}-${e}`;
|
|
1533
1536
|
}
|
|
1534
|
-
function
|
|
1537
|
+
function Vr(t, e) {
|
|
1535
1538
|
const r = {
|
|
1536
|
-
string: (
|
|
1537
|
-
number: (
|
|
1538
|
-
boolean: (
|
|
1539
|
-
object: (
|
|
1539
|
+
string: (o) => typeof o == "string",
|
|
1540
|
+
number: (o) => typeof o == "number",
|
|
1541
|
+
boolean: (o) => typeof o == "boolean",
|
|
1542
|
+
object: (o) => ee(o),
|
|
1540
1543
|
// 嚴格判斷是否為純物件
|
|
1541
|
-
"object[]": (
|
|
1542
|
-
"string[]": (
|
|
1543
|
-
"number[]": (
|
|
1544
|
-
Function: (
|
|
1545
|
-
null: (
|
|
1546
|
-
undefined: (
|
|
1544
|
+
"object[]": (o) => Array.isArray(o) && o.every((u) => ee(u)),
|
|
1545
|
+
"string[]": (o) => Array.isArray(o) && o.every((u) => typeof u == "string"),
|
|
1546
|
+
"number[]": (o) => Array.isArray(o) && o.every((u) => typeof u == "number"),
|
|
1547
|
+
Function: (o) => Cr(o),
|
|
1548
|
+
null: (o) => o === null,
|
|
1549
|
+
undefined: (o) => o === void 0
|
|
1547
1550
|
}, n = {
|
|
1548
|
-
ColorType: (
|
|
1551
|
+
ColorType: (o) => o === "none" || o === "data" || o === "primary" || o === "secondary" || o === "dataContrast" || o === "background"
|
|
1549
1552
|
};
|
|
1550
|
-
return Object.keys(t).find((
|
|
1551
|
-
if (e[
|
|
1552
|
-
const u = e[
|
|
1553
|
+
return Object.keys(t).find((o) => {
|
|
1554
|
+
if (e[o]) {
|
|
1555
|
+
const u = e[o], a = t[o];
|
|
1556
|
+
if (a === void 0)
|
|
1557
|
+
return !1;
|
|
1553
1558
|
if (u.toBeTypes) {
|
|
1554
|
-
if (u.toBeTypes.some((
|
|
1559
|
+
if (u.toBeTypes.some((f) => r[f](a)) === !1)
|
|
1555
1560
|
return !0;
|
|
1556
1561
|
} else if (u.toBe) {
|
|
1557
|
-
const { toBe:
|
|
1562
|
+
const { toBe: c, test: i } = u;
|
|
1558
1563
|
if (i(a) === !1)
|
|
1559
1564
|
return !0;
|
|
1560
1565
|
} else if (u.toBeOption) {
|
|
1561
|
-
const
|
|
1562
|
-
if (n[
|
|
1566
|
+
const c = u.toBeOption;
|
|
1567
|
+
if (n[c](a) === !1)
|
|
1563
1568
|
return !0;
|
|
1564
1569
|
}
|
|
1565
1570
|
}
|
|
1566
1571
|
return !1;
|
|
1567
1572
|
});
|
|
1568
1573
|
}
|
|
1569
|
-
function
|
|
1570
|
-
const r =
|
|
1574
|
+
function K(t, e) {
|
|
1575
|
+
const r = Vr(t, e);
|
|
1571
1576
|
if (r) {
|
|
1572
|
-
const n = e[r],
|
|
1577
|
+
const n = e[r], s = n.toBeTypes ? n.toBeTypes.join(" | ") : n.toBe ? n.toBe : n.toBeOption ? n.toBeOption : "";
|
|
1573
1578
|
return {
|
|
1574
1579
|
status: "error",
|
|
1575
1580
|
// message: createValidatorErrorMessage({
|
|
@@ -1578,7 +1583,7 @@ function V(t, e) {
|
|
|
1578
1583
|
// from
|
|
1579
1584
|
// })
|
|
1580
1585
|
columnName: r,
|
|
1581
|
-
expectToBe:
|
|
1586
|
+
expectToBe: s
|
|
1582
1587
|
};
|
|
1583
1588
|
} else
|
|
1584
1589
|
return {
|
|
@@ -1587,22 +1592,25 @@ function V(t, e) {
|
|
|
1587
1592
|
expectToBe: ""
|
|
1588
1593
|
};
|
|
1589
1594
|
}
|
|
1590
|
-
const
|
|
1595
|
+
const Fe = {
|
|
1591
1596
|
width: "auto",
|
|
1592
1597
|
height: "auto",
|
|
1593
1598
|
resizeDebounce: 50
|
|
1594
|
-
},
|
|
1599
|
+
}, De = {
|
|
1595
1600
|
dataset: {
|
|
1596
1601
|
from: "dataset",
|
|
1597
|
-
sort: "original"
|
|
1602
|
+
sort: "original",
|
|
1603
|
+
ignore: !1
|
|
1598
1604
|
},
|
|
1599
1605
|
series: {
|
|
1600
1606
|
from: "series",
|
|
1601
|
-
sort: "original"
|
|
1607
|
+
sort: "original",
|
|
1608
|
+
ignore: !1
|
|
1602
1609
|
},
|
|
1603
1610
|
category: {
|
|
1604
1611
|
from: "category",
|
|
1605
|
-
sort: "original"
|
|
1612
|
+
sort: "original",
|
|
1613
|
+
ignore: !1
|
|
1606
1614
|
},
|
|
1607
1615
|
value: {
|
|
1608
1616
|
from: "value",
|
|
@@ -1615,9 +1623,9 @@ const Ke = {
|
|
|
1615
1623
|
{ from: "z", name: "z" }
|
|
1616
1624
|
],
|
|
1617
1625
|
color: {
|
|
1618
|
-
|
|
1626
|
+
by: "series"
|
|
1619
1627
|
}
|
|
1620
|
-
},
|
|
1628
|
+
}, Ne = {
|
|
1621
1629
|
// colorScheme: 'light',
|
|
1622
1630
|
// colors: {
|
|
1623
1631
|
// light: {
|
|
@@ -1640,16 +1648,36 @@ const Ke = {
|
|
|
1640
1648
|
colors: {
|
|
1641
1649
|
light: {
|
|
1642
1650
|
data: [
|
|
1643
|
-
"#0088FF",
|
|
1644
|
-
"#FF3232",
|
|
1645
|
-
"#38BEA8",
|
|
1646
|
-
"#6F3BD5",
|
|
1647
|
-
"#314285",
|
|
1648
|
-
"#42C724",
|
|
1649
|
-
"#D52580",
|
|
1650
|
-
"#F4721B",
|
|
1651
|
-
"#D117EA",
|
|
1652
|
-
"#7E7D7D"
|
|
1651
|
+
// "#0088FF",
|
|
1652
|
+
// "#FF3232",
|
|
1653
|
+
// "#38BEA8",
|
|
1654
|
+
// "#6F3BD5",
|
|
1655
|
+
// "#314285",
|
|
1656
|
+
// "#42C724",
|
|
1657
|
+
// "#D52580",
|
|
1658
|
+
// "#F4721B",
|
|
1659
|
+
// "#D117EA",
|
|
1660
|
+
// "#7E7D7D"
|
|
1661
|
+
"#4E79A7",
|
|
1662
|
+
// blue
|
|
1663
|
+
"#F28E2B",
|
|
1664
|
+
// orange
|
|
1665
|
+
"#E15759",
|
|
1666
|
+
// red
|
|
1667
|
+
"#76B7B2",
|
|
1668
|
+
// teal
|
|
1669
|
+
"#59A14F",
|
|
1670
|
+
// green
|
|
1671
|
+
"#EDC948",
|
|
1672
|
+
// yellow (已調過不刺眼)
|
|
1673
|
+
"#B07AA1",
|
|
1674
|
+
// purple
|
|
1675
|
+
"#FF9DA7",
|
|
1676
|
+
// pink
|
|
1677
|
+
"#9C755F",
|
|
1678
|
+
// brown
|
|
1679
|
+
"#BAB0AC"
|
|
1680
|
+
// gray
|
|
1653
1681
|
],
|
|
1654
1682
|
primary: "#000000",
|
|
1655
1683
|
secondary: "#e0e0e0",
|
|
@@ -1658,16 +1686,36 @@ const Ke = {
|
|
|
1658
1686
|
},
|
|
1659
1687
|
dark: {
|
|
1660
1688
|
data: [
|
|
1661
|
-
"#4BABFF",
|
|
1662
|
-
"#FF6C6C",
|
|
1663
|
-
"#7DD3C4",
|
|
1664
|
-
"#8E6BC9",
|
|
1665
|
-
"#5366AC",
|
|
1666
|
-
"#86DC72",
|
|
1667
|
-
"#FF72BB",
|
|
1668
|
-
"#F9B052",
|
|
1669
|
-
"#EF76FF",
|
|
1670
|
-
"#C4C4C4"
|
|
1689
|
+
// "#4BABFF",
|
|
1690
|
+
// "#FF6C6C",
|
|
1691
|
+
// "#7DD3C4",
|
|
1692
|
+
// "#8E6BC9",
|
|
1693
|
+
// "#5366AC",
|
|
1694
|
+
// "#86DC72",
|
|
1695
|
+
// "#FF72BB",
|
|
1696
|
+
// "#F9B052",
|
|
1697
|
+
// "#EF76FF",
|
|
1698
|
+
// "#C4C4C4"
|
|
1699
|
+
"#7EA6E0",
|
|
1700
|
+
// blue (亮化)
|
|
1701
|
+
"#FFB86B",
|
|
1702
|
+
// orange
|
|
1703
|
+
"#FF7A7A",
|
|
1704
|
+
// red
|
|
1705
|
+
"#6ED0CC",
|
|
1706
|
+
// teal
|
|
1707
|
+
"#7ED97A",
|
|
1708
|
+
// green
|
|
1709
|
+
"#FFE06E",
|
|
1710
|
+
// yellow
|
|
1711
|
+
"#D4A5D8",
|
|
1712
|
+
// purple
|
|
1713
|
+
"#FFB3BA",
|
|
1714
|
+
// pink
|
|
1715
|
+
"#C89F7A",
|
|
1716
|
+
// brown
|
|
1717
|
+
"#D3D3D3"
|
|
1718
|
+
// gray
|
|
1671
1719
|
],
|
|
1672
1720
|
primary: "#FFFFFF",
|
|
1673
1721
|
secondary: "#e0e0e0",
|
|
@@ -1676,673 +1724,673 @@ const Ke = {
|
|
|
1676
1724
|
}
|
|
1677
1725
|
},
|
|
1678
1726
|
fontSize: "0.875rem"
|
|
1679
|
-
},
|
|
1680
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1681
|
-
|
|
1727
|
+
}, Kr = (t, e, r) => {
|
|
1728
|
+
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
1729
|
+
s ? t.forEach((a, c) => {
|
|
1682
1730
|
a.forEach((i) => {
|
|
1683
|
-
const
|
|
1684
|
-
n.has(
|
|
1731
|
+
const f = $(i, e.dataset, `dataset-${c}`);
|
|
1732
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
1685
1733
|
});
|
|
1686
1734
|
}) : t.forEach((a) => {
|
|
1687
|
-
const
|
|
1688
|
-
n.has(
|
|
1735
|
+
const c = $(a, e.dataset, "");
|
|
1736
|
+
n.has(c) || n.set(c, []), n.get(c).push(a);
|
|
1689
1737
|
});
|
|
1690
|
-
let
|
|
1738
|
+
let o = Array.from(n.keys());
|
|
1691
1739
|
if (Array.isArray(e.dataset.sort))
|
|
1692
|
-
|
|
1740
|
+
o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
|
|
1693
1741
|
else if (e.dataset.sort === "original") {
|
|
1694
1742
|
const a = [];
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
const
|
|
1698
|
-
a.includes(
|
|
1743
|
+
s ? t.forEach((c, i) => {
|
|
1744
|
+
c.forEach((f) => {
|
|
1745
|
+
const w = $(f, e.dataset, `dataset-${i}`);
|
|
1746
|
+
a.includes(w) || a.push(w);
|
|
1699
1747
|
});
|
|
1700
|
-
}) : t.forEach((
|
|
1701
|
-
const i =
|
|
1748
|
+
}) : t.forEach((c) => {
|
|
1749
|
+
const i = $(c, e.dataset, "");
|
|
1702
1750
|
a.includes(i) || a.push(i);
|
|
1703
|
-
}),
|
|
1704
|
-
} else e.dataset.sort === "alphabetical" &&
|
|
1751
|
+
}), o = a;
|
|
1752
|
+
} else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
|
|
1705
1753
|
const u = [];
|
|
1706
|
-
return
|
|
1707
|
-
const i = n.get(a),
|
|
1708
|
-
i.forEach((
|
|
1709
|
-
const d =
|
|
1710
|
-
|
|
1754
|
+
return o.forEach((a, c) => {
|
|
1755
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1756
|
+
i.forEach((v) => {
|
|
1757
|
+
const d = $(v, e.series, "");
|
|
1758
|
+
f.has(d) || f.set(d, []), f.get(d).push(v);
|
|
1711
1759
|
});
|
|
1712
|
-
let
|
|
1760
|
+
let w = Array.from(f.keys());
|
|
1713
1761
|
if (Array.isArray(e.series.sort))
|
|
1714
|
-
|
|
1762
|
+
w = e.series.sort.filter((v) => f.has(v)).concat(w.filter((v) => !e.series.sort.includes(v)));
|
|
1715
1763
|
else if (e.series.sort === "original") {
|
|
1716
|
-
const
|
|
1764
|
+
const v = [];
|
|
1717
1765
|
i.forEach((d) => {
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1720
|
-
}),
|
|
1721
|
-
} else e.series.sort === "alphabetical" &&
|
|
1722
|
-
const
|
|
1766
|
+
const b = $(d, e.series, "");
|
|
1767
|
+
v.includes(b) || v.push(b);
|
|
1768
|
+
}), w = v;
|
|
1769
|
+
} else e.series.sort === "alphabetical" && w.sort((v, d) => v.localeCompare(d, void 0, { numeric: !0 }));
|
|
1770
|
+
const S = [];
|
|
1723
1771
|
if (e.category.sort === "original")
|
|
1724
|
-
i.forEach((
|
|
1725
|
-
const d =
|
|
1726
|
-
|
|
1772
|
+
i.forEach((v) => {
|
|
1773
|
+
const d = $(v, e.category, "");
|
|
1774
|
+
S.includes(d) || S.push(d);
|
|
1727
1775
|
});
|
|
1728
1776
|
else if (e.category.sort === "alphabetical") {
|
|
1729
|
-
const
|
|
1777
|
+
const v = /* @__PURE__ */ new Set();
|
|
1730
1778
|
i.forEach((d) => {
|
|
1731
|
-
|
|
1732
|
-
}),
|
|
1779
|
+
v.add($(d, e.category, ""));
|
|
1780
|
+
}), S.push(...Array.from(v).sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 })));
|
|
1733
1781
|
} else if (Array.isArray(e.category.sort)) {
|
|
1734
|
-
const
|
|
1735
|
-
i.forEach((
|
|
1736
|
-
const
|
|
1737
|
-
|
|
1782
|
+
const v = [];
|
|
1783
|
+
i.forEach((b) => {
|
|
1784
|
+
const O = $(b, e.category, "");
|
|
1785
|
+
v.includes(O) || v.push(O);
|
|
1738
1786
|
});
|
|
1739
1787
|
const d = e.category.sort;
|
|
1740
|
-
|
|
1741
|
-
...d.filter((
|
|
1742
|
-
...
|
|
1788
|
+
S.push(
|
|
1789
|
+
...d.filter((b) => v.includes(b)),
|
|
1790
|
+
...v.filter((b) => !d.includes(b))
|
|
1743
1791
|
);
|
|
1744
1792
|
}
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1747
|
-
|
|
1793
|
+
const y = /* @__PURE__ */ new Map();
|
|
1794
|
+
S.forEach((v, d) => {
|
|
1795
|
+
y.set(v, d);
|
|
1748
1796
|
});
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1751
|
-
const
|
|
1752
|
-
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1797
|
+
const A = [];
|
|
1798
|
+
w.forEach((v, d) => {
|
|
1799
|
+
const b = f.get(v), O = /* @__PURE__ */ new Map();
|
|
1800
|
+
b.forEach((p) => {
|
|
1801
|
+
const E = $(p, e.category, "");
|
|
1802
|
+
O.has(E) || O.set(E, []), O.get(E).push(p);
|
|
1755
1803
|
});
|
|
1756
|
-
const
|
|
1757
|
-
e.category.sort === "original" && e.value.aggregate === "none" ? (
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
id:
|
|
1804
|
+
const I = S.filter((p) => O.has(p)), h = [];
|
|
1805
|
+
e.category.sort === "original" && e.value.aggregate === "none" ? (b.forEach((p, E) => {
|
|
1806
|
+
const k = $(p, e.category, ""), C = y.get(k), l = p[e.value.from];
|
|
1807
|
+
h.push({
|
|
1808
|
+
id: p.id || `${a}-${v}-${k}-${E}`,
|
|
1761
1809
|
index: C,
|
|
1762
1810
|
// Series 模式下 index 對應 categoryIndex
|
|
1763
1811
|
modelType: "series",
|
|
1764
|
-
name:
|
|
1765
|
-
data:
|
|
1766
|
-
value: typeof
|
|
1767
|
-
color:
|
|
1812
|
+
name: p.name || "",
|
|
1813
|
+
data: p.data,
|
|
1814
|
+
value: typeof l == "number" ? l : null,
|
|
1815
|
+
color: D(e.color.by, {
|
|
1768
1816
|
index: C,
|
|
1769
1817
|
seriesIndex: d,
|
|
1770
1818
|
categoryIndex: C,
|
|
1771
|
-
datasetIndex:
|
|
1819
|
+
datasetIndex: c
|
|
1772
1820
|
}, r),
|
|
1773
|
-
series:
|
|
1821
|
+
series: v,
|
|
1774
1822
|
seriesIndex: d,
|
|
1775
|
-
category:
|
|
1823
|
+
category: k,
|
|
1776
1824
|
categoryIndex: C
|
|
1777
1825
|
});
|
|
1778
|
-
}), e.value.sort === "asc" ?
|
|
1779
|
-
const
|
|
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
|
+
const E = y.get(p), k = O.get(p);
|
|
1780
1828
|
if (e.value.aggregate === "none") {
|
|
1781
|
-
let C =
|
|
1782
|
-
const
|
|
1829
|
+
let C = k.map((l, m) => {
|
|
1830
|
+
const T = l[e.value.from];
|
|
1783
1831
|
return {
|
|
1784
|
-
id:
|
|
1785
|
-
index:
|
|
1832
|
+
id: l.id || `${a}-${v}-${p}-${m}`,
|
|
1833
|
+
index: E,
|
|
1786
1834
|
// Series 模式下 index 對應 categoryIndex
|
|
1787
1835
|
modelType: "series",
|
|
1788
|
-
name:
|
|
1789
|
-
data:
|
|
1790
|
-
value: typeof
|
|
1791
|
-
color:
|
|
1792
|
-
index:
|
|
1836
|
+
name: l.name || "",
|
|
1837
|
+
data: l.data,
|
|
1838
|
+
value: typeof T == "number" ? T : null,
|
|
1839
|
+
color: D(e.color.by, {
|
|
1840
|
+
index: E,
|
|
1793
1841
|
seriesIndex: d,
|
|
1794
|
-
categoryIndex:
|
|
1795
|
-
datasetIndex:
|
|
1842
|
+
categoryIndex: E,
|
|
1843
|
+
datasetIndex: c
|
|
1796
1844
|
}, r),
|
|
1797
|
-
series:
|
|
1845
|
+
series: v,
|
|
1798
1846
|
seriesIndex: d,
|
|
1799
|
-
category:
|
|
1800
|
-
categoryIndex:
|
|
1847
|
+
category: p,
|
|
1848
|
+
categoryIndex: E
|
|
1801
1849
|
};
|
|
1802
1850
|
});
|
|
1803
|
-
e.value.sort === "asc" ? C.sort((
|
|
1851
|
+
e.value.sort === "asc" ? C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : l.value - m.value) : e.value.sort === "desc" && C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : m.value - l.value), h.push(...C);
|
|
1804
1852
|
} else {
|
|
1805
|
-
const C =
|
|
1853
|
+
const C = k.map((B) => {
|
|
1806
1854
|
if (e.value.aggregate === "count")
|
|
1807
1855
|
return 1;
|
|
1808
|
-
const
|
|
1809
|
-
return typeof
|
|
1810
|
-
}),
|
|
1811
|
-
id:
|
|
1812
|
-
index:
|
|
1856
|
+
const g = B[e.value.from];
|
|
1857
|
+
return typeof g == "number" ? g : null;
|
|
1858
|
+
}), l = de(C, e.value.aggregate), m = k[0], T = {
|
|
1859
|
+
id: m.id || `${a}-${v}-${p}-aggregated`,
|
|
1860
|
+
index: E,
|
|
1813
1861
|
// Series 模式下 index 對應 categoryIndex
|
|
1814
1862
|
modelType: "series",
|
|
1815
|
-
name:
|
|
1816
|
-
data:
|
|
1817
|
-
value:
|
|
1818
|
-
color:
|
|
1819
|
-
index:
|
|
1863
|
+
name: m.name || p,
|
|
1864
|
+
data: m.data,
|
|
1865
|
+
value: l,
|
|
1866
|
+
color: D(e.color.by, {
|
|
1867
|
+
index: E,
|
|
1820
1868
|
seriesIndex: d,
|
|
1821
|
-
categoryIndex:
|
|
1822
|
-
datasetIndex:
|
|
1869
|
+
categoryIndex: E,
|
|
1870
|
+
datasetIndex: c
|
|
1823
1871
|
}, r),
|
|
1824
|
-
series:
|
|
1872
|
+
series: v,
|
|
1825
1873
|
seriesIndex: d,
|
|
1826
|
-
category:
|
|
1827
|
-
categoryIndex:
|
|
1874
|
+
category: p,
|
|
1875
|
+
categoryIndex: E
|
|
1828
1876
|
};
|
|
1829
|
-
|
|
1877
|
+
h.push(T);
|
|
1830
1878
|
}
|
|
1831
|
-
}),
|
|
1832
|
-
}), u.push(
|
|
1879
|
+
}), A.push(h);
|
|
1880
|
+
}), u.push(A);
|
|
1833
1881
|
}), u;
|
|
1834
1882
|
}, Rr = (t, e, r) => {
|
|
1835
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1836
|
-
|
|
1883
|
+
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
1884
|
+
s ? t.forEach((a, c) => {
|
|
1837
1885
|
a.forEach((i) => {
|
|
1838
|
-
const
|
|
1839
|
-
n.has(
|
|
1886
|
+
const f = $(i, e.dataset, `dataset-${c}`);
|
|
1887
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
1840
1888
|
});
|
|
1841
1889
|
}) : t.forEach((a) => {
|
|
1842
|
-
const
|
|
1843
|
-
n.has(
|
|
1890
|
+
const c = $(a, e.dataset, "");
|
|
1891
|
+
n.has(c) || n.set(c, []), n.get(c).push(a);
|
|
1844
1892
|
});
|
|
1845
|
-
let
|
|
1893
|
+
let o = Array.from(n.keys());
|
|
1846
1894
|
if (Array.isArray(e.dataset.sort))
|
|
1847
|
-
|
|
1895
|
+
o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
|
|
1848
1896
|
else if (e.dataset.sort === "original") {
|
|
1849
1897
|
const a = [];
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
const
|
|
1853
|
-
a.includes(
|
|
1898
|
+
s ? t.forEach((c, i) => {
|
|
1899
|
+
c.forEach((f) => {
|
|
1900
|
+
const w = $(f, e.dataset, `dataset-${i}`);
|
|
1901
|
+
a.includes(w) || a.push(w);
|
|
1854
1902
|
});
|
|
1855
|
-
}) : t.forEach((
|
|
1856
|
-
const i =
|
|
1903
|
+
}) : t.forEach((c) => {
|
|
1904
|
+
const i = $(c, e.dataset, "");
|
|
1857
1905
|
a.includes(i) || a.push(i);
|
|
1858
|
-
}),
|
|
1859
|
-
} else e.dataset.sort === "alphabetical" &&
|
|
1906
|
+
}), o = a;
|
|
1907
|
+
} else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
|
|
1860
1908
|
const u = [];
|
|
1861
|
-
return
|
|
1862
|
-
const i = n.get(a),
|
|
1909
|
+
return o.forEach((a, c) => {
|
|
1910
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1863
1911
|
i.forEach((d) => {
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1912
|
+
const b = $(d, e.series, "");
|
|
1913
|
+
f.has(b) || f.set(b, []), f.get(b).push(d);
|
|
1866
1914
|
});
|
|
1867
|
-
let
|
|
1915
|
+
let w = Array.from(f.keys());
|
|
1868
1916
|
if (Array.isArray(e.series.sort))
|
|
1869
|
-
|
|
1917
|
+
w = e.series.sort.filter((d) => f.has(d)).concat(w.filter((d) => !e.series.sort.includes(d)));
|
|
1870
1918
|
else if (e.series.sort === "original") {
|
|
1871
1919
|
const d = [];
|
|
1872
|
-
i.forEach((
|
|
1873
|
-
const
|
|
1874
|
-
d.includes(
|
|
1875
|
-
}),
|
|
1876
|
-
} else e.series.sort === "alphabetical" &&
|
|
1877
|
-
const
|
|
1920
|
+
i.forEach((b) => {
|
|
1921
|
+
const O = $(b, e.series, "");
|
|
1922
|
+
d.includes(O) || d.push(O);
|
|
1923
|
+
}), w = d;
|
|
1924
|
+
} else e.series.sort === "alphabetical" && w.sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 }));
|
|
1925
|
+
const S = [];
|
|
1878
1926
|
i.forEach((d) => {
|
|
1879
|
-
const
|
|
1880
|
-
|
|
1927
|
+
const b = $(d, e.category, "");
|
|
1928
|
+
S.includes(b) || S.push(b);
|
|
1881
1929
|
});
|
|
1882
|
-
const
|
|
1883
|
-
let
|
|
1884
|
-
Array.isArray(e.category.sort) ?
|
|
1885
|
-
const
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1930
|
+
const y = new Set(S);
|
|
1931
|
+
let A = Array.from(y);
|
|
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 v = [];
|
|
1934
|
+
w.forEach((d, b) => {
|
|
1935
|
+
const O = f.get(d), I = /* @__PURE__ */ new Map();
|
|
1936
|
+
O.forEach((p) => {
|
|
1937
|
+
const E = $(p, e.category, "");
|
|
1938
|
+
I.has(E) || I.set(E, []), I.get(E).push(p);
|
|
1891
1939
|
});
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1894
|
-
const
|
|
1895
|
-
if (!
|
|
1896
|
-
|
|
1897
|
-
id: `${a}-${d}-${
|
|
1898
|
-
index:
|
|
1940
|
+
const h = [];
|
|
1941
|
+
A.forEach((p, E) => {
|
|
1942
|
+
const k = I.get(p);
|
|
1943
|
+
if (!k)
|
|
1944
|
+
h.push({
|
|
1945
|
+
id: `${a}-${d}-${p}-null`,
|
|
1946
|
+
index: E,
|
|
1899
1947
|
modelType: "grid",
|
|
1900
|
-
name:
|
|
1948
|
+
name: p,
|
|
1901
1949
|
data: void 0,
|
|
1902
1950
|
value: null,
|
|
1903
|
-
color:
|
|
1904
|
-
index:
|
|
1905
|
-
seriesIndex:
|
|
1906
|
-
categoryIndex:
|
|
1907
|
-
datasetIndex:
|
|
1951
|
+
color: D(e.color.by, {
|
|
1952
|
+
index: E,
|
|
1953
|
+
seriesIndex: b,
|
|
1954
|
+
categoryIndex: E,
|
|
1955
|
+
datasetIndex: c
|
|
1908
1956
|
}, r),
|
|
1909
1957
|
series: d,
|
|
1910
|
-
seriesIndex:
|
|
1911
|
-
category:
|
|
1912
|
-
categoryIndex:
|
|
1958
|
+
seriesIndex: b,
|
|
1959
|
+
category: p,
|
|
1960
|
+
categoryIndex: E
|
|
1913
1961
|
});
|
|
1914
1962
|
else if (e.value.aggregate === "none") {
|
|
1915
|
-
let C =
|
|
1916
|
-
const
|
|
1963
|
+
let C = k.map((l, m) => {
|
|
1964
|
+
const T = l[e.value.from];
|
|
1917
1965
|
return {
|
|
1918
|
-
id:
|
|
1919
|
-
index:
|
|
1966
|
+
id: l.id || `${a}-${d}-${p}-${m}`,
|
|
1967
|
+
index: E,
|
|
1920
1968
|
// Grid 模式下 index 對應 categoryIndex
|
|
1921
1969
|
modelType: "grid",
|
|
1922
|
-
name:
|
|
1923
|
-
data:
|
|
1924
|
-
value: typeof
|
|
1925
|
-
color:
|
|
1926
|
-
index:
|
|
1927
|
-
seriesIndex:
|
|
1928
|
-
categoryIndex:
|
|
1929
|
-
datasetIndex:
|
|
1970
|
+
name: l.name || "",
|
|
1971
|
+
data: l.data,
|
|
1972
|
+
value: typeof T == "number" ? T : null,
|
|
1973
|
+
color: D(e.color.by, {
|
|
1974
|
+
index: E,
|
|
1975
|
+
seriesIndex: b,
|
|
1976
|
+
categoryIndex: E,
|
|
1977
|
+
datasetIndex: c
|
|
1930
1978
|
}, r),
|
|
1931
1979
|
series: d,
|
|
1932
|
-
seriesIndex:
|
|
1933
|
-
category:
|
|
1934
|
-
categoryIndex:
|
|
1980
|
+
seriesIndex: b,
|
|
1981
|
+
category: p,
|
|
1982
|
+
categoryIndex: E
|
|
1935
1983
|
};
|
|
1936
1984
|
});
|
|
1937
|
-
e.value.sort === "asc" ? C.sort((
|
|
1985
|
+
e.value.sort === "asc" ? C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : l.value - m.value) : e.value.sort === "desc" && C.sort((l, m) => l.value === null && m.value === null ? 0 : l.value === null ? 1 : m.value === null ? -1 : m.value - l.value), h.push(...C);
|
|
1938
1986
|
} else {
|
|
1939
|
-
const C =
|
|
1987
|
+
const C = k.map((B) => {
|
|
1940
1988
|
if (e.value.aggregate === "count")
|
|
1941
1989
|
return 1;
|
|
1942
|
-
const
|
|
1943
|
-
return typeof
|
|
1944
|
-
}),
|
|
1945
|
-
id:
|
|
1946
|
-
index:
|
|
1990
|
+
const g = B[e.value.from];
|
|
1991
|
+
return typeof g == "number" ? g : null;
|
|
1992
|
+
}), l = de(C, e.value.aggregate), m = k[0], T = {
|
|
1993
|
+
id: m.id || `${a}-${d}-${p}-aggregated`,
|
|
1994
|
+
index: E,
|
|
1947
1995
|
// Grid 模式下 index 對應 categoryIndex
|
|
1948
1996
|
modelType: "grid",
|
|
1949
|
-
name:
|
|
1950
|
-
data:
|
|
1951
|
-
value:
|
|
1952
|
-
color:
|
|
1953
|
-
index:
|
|
1954
|
-
seriesIndex:
|
|
1955
|
-
categoryIndex:
|
|
1956
|
-
datasetIndex:
|
|
1997
|
+
name: m.name || p,
|
|
1998
|
+
data: m.data,
|
|
1999
|
+
value: l,
|
|
2000
|
+
color: D(e.color.by, {
|
|
2001
|
+
index: E,
|
|
2002
|
+
seriesIndex: b,
|
|
2003
|
+
categoryIndex: E,
|
|
2004
|
+
datasetIndex: c
|
|
1957
2005
|
}, r),
|
|
1958
2006
|
series: d,
|
|
1959
|
-
seriesIndex:
|
|
1960
|
-
category:
|
|
1961
|
-
categoryIndex:
|
|
2007
|
+
seriesIndex: b,
|
|
2008
|
+
category: p,
|
|
2009
|
+
categoryIndex: E
|
|
1962
2010
|
};
|
|
1963
|
-
|
|
2011
|
+
h.push(T);
|
|
1964
2012
|
}
|
|
1965
|
-
}),
|
|
1966
|
-
}), u.push(
|
|
2013
|
+
}), v.push(h);
|
|
2014
|
+
}), u.push(v);
|
|
1967
2015
|
}), u;
|
|
1968
|
-
},
|
|
1969
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1970
|
-
|
|
2016
|
+
}, Fr = (t, e, r) => {
|
|
2017
|
+
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
2018
|
+
s ? t.forEach((a, c) => {
|
|
1971
2019
|
a.forEach((i) => {
|
|
1972
|
-
const
|
|
1973
|
-
n.has(
|
|
2020
|
+
const f = $(i, e.dataset, `dataset-${c}`);
|
|
2021
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
1974
2022
|
});
|
|
1975
2023
|
}) : t.forEach((a) => {
|
|
1976
|
-
const
|
|
1977
|
-
n.has(
|
|
2024
|
+
const c = $(a, e.dataset, "");
|
|
2025
|
+
n.has(c) || n.set(c, []), n.get(c).push(a);
|
|
1978
2026
|
});
|
|
1979
|
-
let
|
|
2027
|
+
let o = Array.from(n.keys());
|
|
1980
2028
|
if (Array.isArray(e.dataset.sort))
|
|
1981
|
-
|
|
2029
|
+
o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
|
|
1982
2030
|
else if (e.dataset.sort === "original") {
|
|
1983
2031
|
const a = [];
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
const
|
|
1987
|
-
a.includes(
|
|
2032
|
+
s ? t.forEach((c, i) => {
|
|
2033
|
+
c.forEach((f) => {
|
|
2034
|
+
const w = $(f, e.dataset, `dataset-${i}`);
|
|
2035
|
+
a.includes(w) || a.push(w);
|
|
1988
2036
|
});
|
|
1989
|
-
}) : t.forEach((
|
|
1990
|
-
const i =
|
|
2037
|
+
}) : t.forEach((c) => {
|
|
2038
|
+
const i = $(c, e.dataset, "");
|
|
1991
2039
|
a.includes(i) || a.push(i);
|
|
1992
|
-
}),
|
|
1993
|
-
} else e.dataset.sort === "alphabetical" &&
|
|
2040
|
+
}), o = a;
|
|
2041
|
+
} else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
|
|
1994
2042
|
const u = [];
|
|
1995
|
-
return
|
|
1996
|
-
const i = n.get(a),
|
|
1997
|
-
i.forEach((
|
|
1998
|
-
const
|
|
1999
|
-
|
|
2043
|
+
return o.forEach((a, c) => {
|
|
2044
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2045
|
+
i.forEach((y) => {
|
|
2046
|
+
const A = $(y, e.series, "");
|
|
2047
|
+
f.has(A) || f.set(A, []), f.get(A).push(y);
|
|
2000
2048
|
});
|
|
2001
|
-
let
|
|
2049
|
+
let w = Array.from(f.keys());
|
|
2002
2050
|
if (Array.isArray(e.series.sort))
|
|
2003
|
-
|
|
2051
|
+
w = e.series.sort.filter((y) => f.has(y)).concat(w.filter((y) => !e.series.sort.includes(y)));
|
|
2004
2052
|
else if (e.series.sort === "original") {
|
|
2005
|
-
const
|
|
2006
|
-
i.forEach((
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2009
|
-
}),
|
|
2010
|
-
} else e.series.sort === "alphabetical" &&
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
const
|
|
2014
|
-
|
|
2015
|
-
const
|
|
2016
|
-
d.has(
|
|
2053
|
+
const y = [];
|
|
2054
|
+
i.forEach((A) => {
|
|
2055
|
+
const v = $(A, e.series, "");
|
|
2056
|
+
y.includes(v) || y.push(v);
|
|
2057
|
+
}), w = y;
|
|
2058
|
+
} else e.series.sort === "alphabetical" && w.sort((y, A) => y.localeCompare(A, void 0, { numeric: !0 }));
|
|
2059
|
+
const S = [];
|
|
2060
|
+
w.forEach((y, A) => {
|
|
2061
|
+
const v = f.get(y), d = /* @__PURE__ */ new Map();
|
|
2062
|
+
v.forEach((I) => {
|
|
2063
|
+
const h = $(I, e.category, "");
|
|
2064
|
+
d.has(h) || d.set(h, []), d.get(h).push(I);
|
|
2017
2065
|
});
|
|
2018
|
-
let
|
|
2066
|
+
let b = Array.from(d.keys());
|
|
2019
2067
|
if (Array.isArray(e.category.sort))
|
|
2020
|
-
|
|
2068
|
+
b = e.category.sort.filter((I) => d.has(I)).concat(b.filter((I) => !e.category.sort.includes(I)));
|
|
2021
2069
|
else if (e.category.sort === "original") {
|
|
2022
|
-
const
|
|
2023
|
-
|
|
2024
|
-
const
|
|
2025
|
-
|
|
2026
|
-
}),
|
|
2027
|
-
} else e.category.sort === "alphabetical" &&
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2030
|
-
d.get(
|
|
2031
|
-
const C = e.multivariate.map((
|
|
2032
|
-
index:
|
|
2033
|
-
name:
|
|
2070
|
+
const I = [];
|
|
2071
|
+
v.forEach((h) => {
|
|
2072
|
+
const p = $(h, e.category, "");
|
|
2073
|
+
I.includes(p) || I.push(p);
|
|
2074
|
+
}), b = I;
|
|
2075
|
+
} else e.category.sort === "alphabetical" && b.sort((I, h) => I.localeCompare(h, void 0, { numeric: !0 }));
|
|
2076
|
+
const O = [];
|
|
2077
|
+
b.forEach((I, h) => {
|
|
2078
|
+
d.get(I).forEach((E, k) => {
|
|
2079
|
+
const C = e.multivariate.map((m, T) => ({
|
|
2080
|
+
index: T,
|
|
2081
|
+
name: m.name,
|
|
2034
2082
|
value: (() => {
|
|
2035
|
-
const
|
|
2036
|
-
return typeof
|
|
2083
|
+
const B = E[m.from];
|
|
2084
|
+
return typeof B == "number" ? B : null;
|
|
2037
2085
|
})()
|
|
2038
|
-
})),
|
|
2039
|
-
id:
|
|
2040
|
-
index:
|
|
2086
|
+
})), l = {
|
|
2087
|
+
id: E.id || `${a}-${y}-${I}-${k}`,
|
|
2088
|
+
index: k,
|
|
2041
2089
|
modelType: "multivariate",
|
|
2042
|
-
name:
|
|
2043
|
-
data:
|
|
2090
|
+
name: E.name || "",
|
|
2091
|
+
data: E.data,
|
|
2044
2092
|
value: null,
|
|
2045
2093
|
// MultivariateData 的主要值在 values 陣列中,這裡設為 null
|
|
2046
|
-
color:
|
|
2047
|
-
index:
|
|
2048
|
-
seriesIndex:
|
|
2049
|
-
categoryIndex:
|
|
2050
|
-
datasetIndex:
|
|
2094
|
+
color: D(e.color.by, {
|
|
2095
|
+
index: k,
|
|
2096
|
+
seriesIndex: A,
|
|
2097
|
+
categoryIndex: h,
|
|
2098
|
+
datasetIndex: c
|
|
2051
2099
|
}, r),
|
|
2052
2100
|
multivariate: C,
|
|
2053
|
-
series:
|
|
2054
|
-
seriesIndex:
|
|
2055
|
-
category:
|
|
2056
|
-
categoryIndex:
|
|
2101
|
+
series: y,
|
|
2102
|
+
seriesIndex: A,
|
|
2103
|
+
category: I,
|
|
2104
|
+
categoryIndex: h
|
|
2057
2105
|
};
|
|
2058
|
-
|
|
2106
|
+
O.push(l);
|
|
2059
2107
|
});
|
|
2060
|
-
}),
|
|
2061
|
-
}), u.push(
|
|
2108
|
+
}), S.push(O);
|
|
2109
|
+
}), u.push(S);
|
|
2062
2110
|
}), u;
|
|
2063
|
-
},
|
|
2064
|
-
const n = Array.isArray(t[0]),
|
|
2111
|
+
}, Dr = (t, e, r) => {
|
|
2112
|
+
const n = Array.isArray(t[0]), s = [], o = [];
|
|
2065
2113
|
n ? t.forEach((i) => {
|
|
2066
|
-
i.forEach((
|
|
2067
|
-
|
|
2114
|
+
i.forEach((f) => {
|
|
2115
|
+
f.source && f.target ? o.push(f) : s.push(f);
|
|
2068
2116
|
});
|
|
2069
2117
|
}) : t.forEach((i) => {
|
|
2070
|
-
i.source && i.target ?
|
|
2118
|
+
i.source && i.target ? o.push(i) : s.push(i);
|
|
2071
2119
|
});
|
|
2072
2120
|
const u = /* @__PURE__ */ new Map();
|
|
2073
|
-
n ? t.forEach((i,
|
|
2074
|
-
i.forEach((
|
|
2075
|
-
if (!
|
|
2076
|
-
const
|
|
2077
|
-
u.has(
|
|
2121
|
+
n ? t.forEach((i, f) => {
|
|
2122
|
+
i.forEach((w) => {
|
|
2123
|
+
if (!w.source || !w.target) {
|
|
2124
|
+
const S = $(w, e.dataset, `dataset-${f}`);
|
|
2125
|
+
u.has(S) || u.set(S, []), u.get(S).push(w);
|
|
2078
2126
|
}
|
|
2079
2127
|
});
|
|
2080
|
-
}) :
|
|
2081
|
-
const
|
|
2082
|
-
u.has(
|
|
2128
|
+
}) : s.forEach((i) => {
|
|
2129
|
+
const f = $(i, e.dataset, "");
|
|
2130
|
+
u.has(f) || u.set(f, []), u.get(f).push(i);
|
|
2083
2131
|
});
|
|
2084
2132
|
let a = Array.from(u.keys());
|
|
2085
2133
|
if (Array.isArray(e.dataset.sort))
|
|
2086
2134
|
a = e.dataset.sort.filter((i) => u.has(i)).concat(a.filter((i) => !e.dataset.sort.includes(i)));
|
|
2087
2135
|
else if (e.dataset.sort === "original") {
|
|
2088
2136
|
const i = [];
|
|
2089
|
-
n ? t.forEach((
|
|
2090
|
-
|
|
2091
|
-
if (!
|
|
2092
|
-
const
|
|
2093
|
-
i.includes(
|
|
2137
|
+
n ? t.forEach((f, w) => {
|
|
2138
|
+
f.forEach((S) => {
|
|
2139
|
+
if (!S.source || !S.target) {
|
|
2140
|
+
const y = $(S, e.dataset, `dataset-${w}`);
|
|
2141
|
+
i.includes(y) || i.push(y);
|
|
2094
2142
|
}
|
|
2095
2143
|
});
|
|
2096
|
-
}) :
|
|
2097
|
-
const
|
|
2098
|
-
i.includes(
|
|
2144
|
+
}) : s.forEach((f) => {
|
|
2145
|
+
const w = $(f, e.dataset, "");
|
|
2146
|
+
i.includes(w) || i.push(w);
|
|
2099
2147
|
}), a = i;
|
|
2100
|
-
} else e.dataset.sort === "alphabetical" && a.sort((i,
|
|
2101
|
-
const
|
|
2102
|
-
return a.forEach((i,
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2105
|
-
const
|
|
2106
|
-
|
|
2148
|
+
} else e.dataset.sort === "alphabetical" && a.sort((i, f) => i.localeCompare(f, void 0, { numeric: !0 }));
|
|
2149
|
+
const c = [];
|
|
2150
|
+
return a.forEach((i, f) => {
|
|
2151
|
+
const w = u.get(i), S = [], y = /* @__PURE__ */ new Map();
|
|
2152
|
+
w.forEach((l) => {
|
|
2153
|
+
const m = $(l, e.series, "");
|
|
2154
|
+
y.has(m) || y.set(m, []), y.get(m).push(l);
|
|
2107
2155
|
});
|
|
2108
|
-
let
|
|
2156
|
+
let A = Array.from(y.keys());
|
|
2109
2157
|
if (Array.isArray(e.series.sort))
|
|
2110
|
-
|
|
2158
|
+
A = e.series.sort.filter((l) => y.has(l)).concat(A.filter((l) => !e.series.sort.includes(l)));
|
|
2111
2159
|
else if (e.series.sort === "original") {
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
const
|
|
2115
|
-
|
|
2116
|
-
}),
|
|
2117
|
-
} else e.series.sort === "alphabetical" &&
|
|
2118
|
-
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2121
|
-
const
|
|
2122
|
-
|
|
2160
|
+
const l = [];
|
|
2161
|
+
w.forEach((m) => {
|
|
2162
|
+
const T = $(m, e.series, "");
|
|
2163
|
+
l.includes(T) || l.push(T);
|
|
2164
|
+
}), A = l;
|
|
2165
|
+
} else e.series.sort === "alphabetical" && A.sort((l, m) => l.localeCompare(m, void 0, { numeric: !0 }));
|
|
2166
|
+
A.forEach((l, m) => {
|
|
2167
|
+
const T = y.get(l), B = /* @__PURE__ */ new Map();
|
|
2168
|
+
T.forEach((x) => {
|
|
2169
|
+
const _ = $(x, e.category, "");
|
|
2170
|
+
B.has(_) || B.set(_, []), B.get(_).push(x);
|
|
2123
2171
|
});
|
|
2124
|
-
let
|
|
2172
|
+
let g = Array.from(B.keys());
|
|
2125
2173
|
if (Array.isArray(e.category.sort))
|
|
2126
|
-
|
|
2174
|
+
g = e.category.sort.filter((x) => B.has(x)).concat(g.filter((x) => !e.category.sort.includes(x)));
|
|
2127
2175
|
else if (e.category.sort === "original") {
|
|
2128
|
-
const
|
|
2129
|
-
|
|
2130
|
-
const
|
|
2131
|
-
|
|
2132
|
-
}),
|
|
2133
|
-
} else e.category.sort === "alphabetical" &&
|
|
2134
|
-
|
|
2135
|
-
const
|
|
2176
|
+
const x = [];
|
|
2177
|
+
T.forEach((_) => {
|
|
2178
|
+
const P = $(_, e.category, "");
|
|
2179
|
+
x.includes(P) || x.push(P);
|
|
2180
|
+
}), g = x;
|
|
2181
|
+
} else e.category.sort === "alphabetical" && g.sort((x, _) => x.localeCompare(_, void 0, { numeric: !0 }));
|
|
2182
|
+
g.forEach((x, _) => {
|
|
2183
|
+
const P = B.get(x);
|
|
2136
2184
|
if (e.value.aggregate === "none") {
|
|
2137
|
-
let
|
|
2138
|
-
const F =
|
|
2185
|
+
let j = P.map((M, L) => {
|
|
2186
|
+
const F = M[e.value.from];
|
|
2139
2187
|
return {
|
|
2140
|
-
id:
|
|
2141
|
-
index:
|
|
2188
|
+
id: M.id || `${i}-${l}-${x}-${L}`,
|
|
2189
|
+
index: S.length + L,
|
|
2142
2190
|
// 在所有 nodes 中的索引
|
|
2143
2191
|
modelType: "graph",
|
|
2144
|
-
name:
|
|
2145
|
-
data:
|
|
2192
|
+
name: M.name || "",
|
|
2193
|
+
data: M.data,
|
|
2146
2194
|
value: typeof F == "number" ? F : null,
|
|
2147
|
-
color:
|
|
2148
|
-
index:
|
|
2149
|
-
seriesIndex:
|
|
2150
|
-
categoryIndex:
|
|
2151
|
-
datasetIndex:
|
|
2195
|
+
color: D(e.color.by, {
|
|
2196
|
+
index: _,
|
|
2197
|
+
seriesIndex: m,
|
|
2198
|
+
categoryIndex: _,
|
|
2199
|
+
datasetIndex: f
|
|
2152
2200
|
}, r),
|
|
2153
|
-
series:
|
|
2154
|
-
seriesIndex:
|
|
2155
|
-
category:
|
|
2156
|
-
categoryIndex:
|
|
2201
|
+
series: l,
|
|
2202
|
+
seriesIndex: m,
|
|
2203
|
+
category: x,
|
|
2204
|
+
categoryIndex: _
|
|
2157
2205
|
};
|
|
2158
2206
|
});
|
|
2159
|
-
e.value.sort === "asc" ?
|
|
2207
|
+
e.value.sort === "asc" ? j.sort((M, L) => M.value === null && L.value === null ? 0 : M.value === null ? 1 : L.value === null ? -1 : M.value - L.value) : e.value.sort === "desc" && j.sort((M, L) => M.value === null && L.value === null ? 0 : M.value === null ? 1 : L.value === null ? -1 : L.value - M.value), S.push(...j);
|
|
2160
2208
|
} else {
|
|
2161
|
-
const
|
|
2209
|
+
const j = P.map((J) => {
|
|
2162
2210
|
if (e.value.aggregate === "count")
|
|
2163
2211
|
return 1;
|
|
2164
|
-
const
|
|
2165
|
-
return typeof
|
|
2166
|
-
}),
|
|
2167
|
-
id:
|
|
2168
|
-
index:
|
|
2212
|
+
const re = J[e.value.from];
|
|
2213
|
+
return typeof re == "number" ? re : null;
|
|
2214
|
+
}), M = de(j, e.value.aggregate), L = P[0], F = {
|
|
2215
|
+
id: L.id || `${i}-${l}-${x}-aggregated`,
|
|
2216
|
+
index: S.length,
|
|
2169
2217
|
// 在所有 nodes 中的索引
|
|
2170
2218
|
modelType: "graph",
|
|
2171
|
-
name:
|
|
2172
|
-
data:
|
|
2173
|
-
value:
|
|
2174
|
-
color:
|
|
2175
|
-
index:
|
|
2176
|
-
seriesIndex:
|
|
2177
|
-
categoryIndex:
|
|
2178
|
-
datasetIndex:
|
|
2219
|
+
name: L.name || x,
|
|
2220
|
+
data: L.data,
|
|
2221
|
+
value: M,
|
|
2222
|
+
color: D(e.color.by, {
|
|
2223
|
+
index: _,
|
|
2224
|
+
seriesIndex: m,
|
|
2225
|
+
categoryIndex: _,
|
|
2226
|
+
datasetIndex: f
|
|
2179
2227
|
}, r),
|
|
2180
|
-
series:
|
|
2181
|
-
seriesIndex:
|
|
2182
|
-
category:
|
|
2183
|
-
categoryIndex:
|
|
2228
|
+
series: l,
|
|
2229
|
+
seriesIndex: m,
|
|
2230
|
+
category: x,
|
|
2231
|
+
categoryIndex: _
|
|
2184
2232
|
};
|
|
2185
|
-
|
|
2233
|
+
S.push(F);
|
|
2186
2234
|
}
|
|
2187
2235
|
});
|
|
2188
2236
|
});
|
|
2189
|
-
const
|
|
2190
|
-
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2237
|
+
const v = [], d = /* @__PURE__ */ new Map();
|
|
2238
|
+
S.forEach((l) => {
|
|
2239
|
+
const m = s.find((T) => T.id === l.id || T.name === l.name);
|
|
2240
|
+
m != null && m.id && d.set(m.id, l.index), m != null && m.name && d.set(m.name, l.index);
|
|
2193
2241
|
});
|
|
2194
|
-
const
|
|
2195
|
-
|
|
2196
|
-
|
|
2242
|
+
const b = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
|
|
2243
|
+
S.forEach((l) => {
|
|
2244
|
+
b.has(l.series) || b.set(l.series, l.seriesIndex), O.has(l.category) || O.set(l.category, l.categoryIndex);
|
|
2197
2245
|
});
|
|
2198
|
-
let
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2201
|
-
const
|
|
2202
|
-
C.has(
|
|
2203
|
-
}), Array.from(C.entries()).forEach(([
|
|
2204
|
-
const
|
|
2205
|
-
if (
|
|
2246
|
+
let I = b.size, h = O.size;
|
|
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
|
+
k.forEach((l) => {
|
|
2249
|
+
const m = l.source, T = l.target, B = $(l, e.series, ""), g = $(l, e.category, ""), x = `${m}-${T}-${B}-${g}`;
|
|
2250
|
+
C.has(x) || C.set(x, []), C.get(x).push(l);
|
|
2251
|
+
}), Array.from(C.entries()).forEach(([l, m], T) => {
|
|
2252
|
+
const B = m[0], g = B.source, x = B.target, _ = d.get(g) ?? -1, P = d.get(x) ?? -1;
|
|
2253
|
+
if (_ >= 0 && P >= 0)
|
|
2206
2254
|
if (e.value.aggregate === "none")
|
|
2207
|
-
|
|
2208
|
-
const
|
|
2209
|
-
id:
|
|
2210
|
-
index:
|
|
2255
|
+
m.forEach((j, M) => {
|
|
2256
|
+
const L = j[e.value.from], F = $(j, e.series, ""), J = $(j, e.category, ""), re = p(F), ge = E(J), xe = {
|
|
2257
|
+
id: j.id || `edge-${T}-${M}`,
|
|
2258
|
+
index: v.length,
|
|
2211
2259
|
modelType: "graph",
|
|
2212
|
-
name:
|
|
2213
|
-
data:
|
|
2214
|
-
value: typeof
|
|
2215
|
-
color:
|
|
2216
|
-
index:
|
|
2217
|
-
seriesIndex:
|
|
2218
|
-
categoryIndex:
|
|
2219
|
-
datasetIndex:
|
|
2260
|
+
name: j.name || "",
|
|
2261
|
+
data: j.data,
|
|
2262
|
+
value: typeof L == "number" ? L : null,
|
|
2263
|
+
color: D(e.color.by, {
|
|
2264
|
+
index: v.length,
|
|
2265
|
+
seriesIndex: re,
|
|
2266
|
+
categoryIndex: ge,
|
|
2267
|
+
datasetIndex: f
|
|
2220
2268
|
}, r),
|
|
2221
2269
|
series: F,
|
|
2222
|
-
seriesIndex:
|
|
2223
|
-
category:
|
|
2224
|
-
categoryIndex:
|
|
2225
|
-
source:
|
|
2226
|
-
sourceIndex:
|
|
2227
|
-
target:
|
|
2228
|
-
targetIndex:
|
|
2270
|
+
seriesIndex: re,
|
|
2271
|
+
category: J,
|
|
2272
|
+
categoryIndex: ge,
|
|
2273
|
+
source: g,
|
|
2274
|
+
sourceIndex: _,
|
|
2275
|
+
target: x,
|
|
2276
|
+
targetIndex: P
|
|
2229
2277
|
};
|
|
2230
|
-
|
|
2278
|
+
v.push(xe);
|
|
2231
2279
|
});
|
|
2232
2280
|
else {
|
|
2233
|
-
const
|
|
2281
|
+
const j = m.map((xe) => {
|
|
2234
2282
|
if (e.value.aggregate === "count")
|
|
2235
2283
|
return 1;
|
|
2236
|
-
const
|
|
2237
|
-
return typeof
|
|
2238
|
-
}),
|
|
2239
|
-
id:
|
|
2240
|
-
index:
|
|
2284
|
+
const ke = xe[e.value.from];
|
|
2285
|
+
return typeof ke == "number" ? ke : null;
|
|
2286
|
+
}), M = de(j, e.value.aggregate), L = $(B, e.series, ""), F = $(B, e.category, ""), J = p(L), re = E(F), ge = {
|
|
2287
|
+
id: B.id || `edge-${T}-aggregated`,
|
|
2288
|
+
index: v.length,
|
|
2241
2289
|
modelType: "graph",
|
|
2242
|
-
name:
|
|
2243
|
-
data:
|
|
2244
|
-
value:
|
|
2245
|
-
color:
|
|
2246
|
-
index:
|
|
2247
|
-
seriesIndex:
|
|
2248
|
-
categoryIndex:
|
|
2249
|
-
datasetIndex:
|
|
2290
|
+
name: B.name || "",
|
|
2291
|
+
data: B.data,
|
|
2292
|
+
value: M,
|
|
2293
|
+
color: D(e.color.by, {
|
|
2294
|
+
index: v.length,
|
|
2295
|
+
seriesIndex: J,
|
|
2296
|
+
categoryIndex: re,
|
|
2297
|
+
datasetIndex: f
|
|
2250
2298
|
}, r),
|
|
2251
|
-
series:
|
|
2252
|
-
seriesIndex:
|
|
2299
|
+
series: L,
|
|
2300
|
+
seriesIndex: J,
|
|
2253
2301
|
category: F,
|
|
2254
|
-
categoryIndex:
|
|
2255
|
-
source:
|
|
2256
|
-
sourceIndex:
|
|
2257
|
-
target:
|
|
2258
|
-
targetIndex:
|
|
2302
|
+
categoryIndex: re,
|
|
2303
|
+
source: g,
|
|
2304
|
+
sourceIndex: _,
|
|
2305
|
+
target: x,
|
|
2306
|
+
targetIndex: P
|
|
2259
2307
|
};
|
|
2260
|
-
|
|
2308
|
+
v.push(ge);
|
|
2261
2309
|
}
|
|
2262
|
-
}),
|
|
2263
|
-
}),
|
|
2264
|
-
},
|
|
2265
|
-
const n = /* @__PURE__ */ new Map(),
|
|
2266
|
-
|
|
2310
|
+
}), c.push({ nodes: S, edges: v });
|
|
2311
|
+
}), c;
|
|
2312
|
+
}, Nr = (t, e, r) => {
|
|
2313
|
+
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
2314
|
+
s ? t.forEach((a, c) => {
|
|
2267
2315
|
a.forEach((i) => {
|
|
2268
|
-
const
|
|
2269
|
-
n.has(
|
|
2316
|
+
const f = $(i, e.dataset, `dataset-${c}`);
|
|
2317
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
2270
2318
|
});
|
|
2271
2319
|
}) : t.forEach((a) => {
|
|
2272
|
-
const
|
|
2273
|
-
n.has(
|
|
2320
|
+
const c = $(a, e.dataset, "");
|
|
2321
|
+
n.has(c) || n.set(c, []), n.get(c).push(a);
|
|
2274
2322
|
});
|
|
2275
|
-
let
|
|
2323
|
+
let o = Array.from(n.keys());
|
|
2276
2324
|
if (Array.isArray(e.dataset.sort))
|
|
2277
|
-
|
|
2325
|
+
o = e.dataset.sort.filter((a) => n.has(a)).concat(o.filter((a) => !e.dataset.sort.includes(a)));
|
|
2278
2326
|
else if (e.dataset.sort === "original") {
|
|
2279
2327
|
const a = [];
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
const
|
|
2283
|
-
a.includes(
|
|
2328
|
+
s ? t.forEach((c, i) => {
|
|
2329
|
+
c.forEach((f) => {
|
|
2330
|
+
const w = $(f, e.dataset, `dataset-${i}`);
|
|
2331
|
+
a.includes(w) || a.push(w);
|
|
2284
2332
|
});
|
|
2285
|
-
}) : t.forEach((
|
|
2286
|
-
const i =
|
|
2333
|
+
}) : t.forEach((c) => {
|
|
2334
|
+
const i = $(c, e.dataset, "");
|
|
2287
2335
|
a.includes(i) || a.push(i);
|
|
2288
|
-
}),
|
|
2289
|
-
} else e.dataset.sort === "alphabetical" &&
|
|
2336
|
+
}), o = a;
|
|
2337
|
+
} else e.dataset.sort === "alphabetical" && o.sort((a, c) => a.localeCompare(c, void 0, { numeric: !0 }));
|
|
2290
2338
|
const u = [];
|
|
2291
|
-
return
|
|
2292
|
-
const i = n.get(a),
|
|
2293
|
-
i.forEach((
|
|
2294
|
-
const
|
|
2295
|
-
|
|
2339
|
+
return o.forEach((a, c) => {
|
|
2340
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2341
|
+
i.forEach((l) => {
|
|
2342
|
+
const m = $(l, e.series, "");
|
|
2343
|
+
f.has(m) || f.set(m, []), f.get(m).push(l);
|
|
2296
2344
|
});
|
|
2297
|
-
let
|
|
2345
|
+
let w = Array.from(f.keys());
|
|
2298
2346
|
if (Array.isArray(e.series.sort))
|
|
2299
|
-
|
|
2347
|
+
w = e.series.sort.filter((l) => f.has(l)).concat(w.filter((l) => !e.series.sort.includes(l)));
|
|
2300
2348
|
else if (e.series.sort === "original") {
|
|
2301
|
-
const
|
|
2302
|
-
i.forEach((
|
|
2303
|
-
const
|
|
2304
|
-
|
|
2305
|
-
}),
|
|
2306
|
-
} else e.series.sort === "alphabetical" &&
|
|
2307
|
-
const
|
|
2308
|
-
i.forEach((
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2349
|
+
const l = [];
|
|
2350
|
+
i.forEach((m) => {
|
|
2351
|
+
const T = $(m, e.series, "");
|
|
2352
|
+
l.includes(T) || l.push(T);
|
|
2353
|
+
}), w = l;
|
|
2354
|
+
} else e.series.sort === "alphabetical" && w.sort((l, m) => l.localeCompare(m, void 0, { numeric: !0 }));
|
|
2355
|
+
const S = /* @__PURE__ */ new Map();
|
|
2356
|
+
i.forEach((l) => {
|
|
2357
|
+
const m = $(l, e.category, "");
|
|
2358
|
+
S.has(m) || S.set(m, []), S.get(m).push(l);
|
|
2311
2359
|
});
|
|
2312
|
-
let
|
|
2360
|
+
let y = Array.from(S.keys());
|
|
2313
2361
|
if (Array.isArray(e.category.sort))
|
|
2314
|
-
|
|
2362
|
+
y = e.category.sort.filter((l) => S.has(l)).concat(y.filter((l) => !e.category.sort.includes(l)));
|
|
2315
2363
|
else if (e.category.sort === "original") {
|
|
2316
|
-
const
|
|
2317
|
-
i.forEach((
|
|
2318
|
-
const
|
|
2319
|
-
|
|
2320
|
-
}),
|
|
2321
|
-
} else e.category.sort === "alphabetical" &&
|
|
2322
|
-
const
|
|
2323
|
-
i.forEach((
|
|
2324
|
-
const
|
|
2325
|
-
|
|
2364
|
+
const l = [];
|
|
2365
|
+
i.forEach((m) => {
|
|
2366
|
+
const T = $(m, e.category, "");
|
|
2367
|
+
l.includes(T) || l.push(T);
|
|
2368
|
+
}), y = l;
|
|
2369
|
+
} else e.category.sort === "alphabetical" && y.sort((l, m) => l.localeCompare(m, void 0, { numeric: !0 }));
|
|
2370
|
+
const A = /* @__PURE__ */ new Map();
|
|
2371
|
+
i.forEach((l) => {
|
|
2372
|
+
const m = l.id || "unknown";
|
|
2373
|
+
A.has(m) || A.set(m, []), A.get(m).push(l);
|
|
2326
2374
|
});
|
|
2327
|
-
let
|
|
2328
|
-
const d =
|
|
2329
|
-
Array.from(
|
|
2330
|
-
const
|
|
2375
|
+
let v = 0;
|
|
2376
|
+
const d = w[0] || "", b = w.indexOf(d), O = /* @__PURE__ */ new Map();
|
|
2377
|
+
Array.from(A.entries()).forEach(([l, m]) => {
|
|
2378
|
+
const T = m[0], B = $(T, e.series, ""), g = w.indexOf(B), x = $(T, e.category, ""), _ = y.indexOf(x);
|
|
2331
2379
|
if (e.value.aggregate === "none") {
|
|
2332
|
-
const
|
|
2333
|
-
id:
|
|
2334
|
-
index:
|
|
2380
|
+
const P = T[e.value.from], j = {
|
|
2381
|
+
id: l,
|
|
2382
|
+
index: v++,
|
|
2335
2383
|
modelType: "tree",
|
|
2336
|
-
name:
|
|
2337
|
-
data:
|
|
2338
|
-
value: typeof
|
|
2339
|
-
color:
|
|
2340
|
-
index:
|
|
2341
|
-
seriesIndex:
|
|
2342
|
-
categoryIndex:
|
|
2343
|
-
datasetIndex:
|
|
2384
|
+
name: T.name || l,
|
|
2385
|
+
data: T.data,
|
|
2386
|
+
value: typeof P == "number" ? P : null,
|
|
2387
|
+
color: D(e.color.by, {
|
|
2388
|
+
index: v - 1,
|
|
2389
|
+
seriesIndex: g,
|
|
2390
|
+
categoryIndex: _,
|
|
2391
|
+
datasetIndex: c
|
|
2344
2392
|
}, r),
|
|
2345
|
-
parent:
|
|
2393
|
+
parent: T.parent || null,
|
|
2346
2394
|
parentIndex: null,
|
|
2347
2395
|
// 稍後設定
|
|
2348
2396
|
depth: 0,
|
|
@@ -2350,32 +2398,32 @@ const Ke = {
|
|
|
2350
2398
|
seq: 0,
|
|
2351
2399
|
// 稍後計算
|
|
2352
2400
|
children: [],
|
|
2353
|
-
series:
|
|
2354
|
-
seriesIndex:
|
|
2355
|
-
category:
|
|
2356
|
-
categoryIndex:
|
|
2401
|
+
series: B,
|
|
2402
|
+
seriesIndex: g,
|
|
2403
|
+
category: x,
|
|
2404
|
+
categoryIndex: _
|
|
2357
2405
|
};
|
|
2358
|
-
|
|
2406
|
+
O.set(l, j);
|
|
2359
2407
|
} else {
|
|
2360
|
-
const
|
|
2408
|
+
const P = m.map((L) => {
|
|
2361
2409
|
if (e.value.aggregate === "count")
|
|
2362
2410
|
return 1;
|
|
2363
|
-
const F =
|
|
2411
|
+
const F = L[e.value.from];
|
|
2364
2412
|
return typeof F == "number" ? F : null;
|
|
2365
|
-
}),
|
|
2366
|
-
id:
|
|
2367
|
-
index:
|
|
2413
|
+
}), j = de(P, e.value.aggregate), M = {
|
|
2414
|
+
id: l,
|
|
2415
|
+
index: v++,
|
|
2368
2416
|
modelType: "tree",
|
|
2369
|
-
name:
|
|
2370
|
-
data:
|
|
2371
|
-
value:
|
|
2372
|
-
color:
|
|
2373
|
-
index:
|
|
2374
|
-
seriesIndex:
|
|
2375
|
-
categoryIndex:
|
|
2376
|
-
datasetIndex:
|
|
2417
|
+
name: T.name || l,
|
|
2418
|
+
data: T.data,
|
|
2419
|
+
value: j,
|
|
2420
|
+
color: D(e.color.by, {
|
|
2421
|
+
index: v - 1,
|
|
2422
|
+
seriesIndex: g,
|
|
2423
|
+
categoryIndex: _,
|
|
2424
|
+
datasetIndex: c
|
|
2377
2425
|
}, r),
|
|
2378
|
-
parent:
|
|
2426
|
+
parent: T.parent || null,
|
|
2379
2427
|
parentIndex: null,
|
|
2380
2428
|
// 稍後設定
|
|
2381
2429
|
depth: 0,
|
|
@@ -2383,45 +2431,45 @@ const Ke = {
|
|
|
2383
2431
|
seq: 0,
|
|
2384
2432
|
// 稍後計算
|
|
2385
2433
|
children: [],
|
|
2386
|
-
series:
|
|
2387
|
-
seriesIndex:
|
|
2388
|
-
category:
|
|
2389
|
-
categoryIndex:
|
|
2434
|
+
series: B,
|
|
2435
|
+
seriesIndex: g,
|
|
2436
|
+
category: x,
|
|
2437
|
+
categoryIndex: _
|
|
2390
2438
|
};
|
|
2391
|
-
|
|
2439
|
+
O.set(l, M);
|
|
2392
2440
|
}
|
|
2393
2441
|
});
|
|
2394
|
-
const
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
}),
|
|
2398
|
-
|
|
2442
|
+
const I = Array.from(O.values()), h = /* @__PURE__ */ new Map();
|
|
2443
|
+
I.forEach((l) => {
|
|
2444
|
+
h.set(l.id, l.index);
|
|
2445
|
+
}), I.forEach((l) => {
|
|
2446
|
+
l.parent && h.has(l.parent) && (l.parentIndex = h.get(l.parent));
|
|
2399
2447
|
});
|
|
2400
|
-
const
|
|
2401
|
-
|
|
2402
|
-
|
|
2448
|
+
const p = [], E = /* @__PURE__ */ new Map();
|
|
2449
|
+
I.forEach((l) => {
|
|
2450
|
+
l.parent === null ? p.push(l) : (E.has(l.parent) || E.set(l.parent, []), E.get(l.parent).push(l));
|
|
2403
2451
|
});
|
|
2404
|
-
function
|
|
2405
|
-
|
|
2406
|
-
const
|
|
2407
|
-
return e.value.sort === "asc" ?
|
|
2408
|
-
|
|
2409
|
-
}),
|
|
2452
|
+
function k(l, m) {
|
|
2453
|
+
l.depth = m;
|
|
2454
|
+
const T = E.get(l.id) || [];
|
|
2455
|
+
return e.value.sort === "asc" ? T.sort((B, g) => B.value === null && g.value === null ? 0 : B.value === null ? 1 : g.value === null ? -1 : B.value - g.value) : e.value.sort === "desc" && T.sort((B, g) => B.value === null && g.value === null ? 0 : B.value === null ? 1 : g.value === null ? -1 : g.value - B.value), T.forEach((B, g) => {
|
|
2456
|
+
B.seq = g;
|
|
2457
|
+
}), l.children = T.map((B) => k(B, m + 1)), l;
|
|
2410
2458
|
}
|
|
2411
|
-
const C =
|
|
2459
|
+
const C = p.map((l) => k(l, 0));
|
|
2412
2460
|
if (C.length === 0)
|
|
2413
2461
|
u.push({
|
|
2414
2462
|
id: `empty-${a}`,
|
|
2415
|
-
index:
|
|
2463
|
+
index: v++,
|
|
2416
2464
|
modelType: "tree",
|
|
2417
2465
|
name: "Empty Tree",
|
|
2418
2466
|
data: {},
|
|
2419
2467
|
value: null,
|
|
2420
|
-
color:
|
|
2421
|
-
index:
|
|
2422
|
-
seriesIndex:
|
|
2468
|
+
color: D(e.color.by, {
|
|
2469
|
+
index: v - 1,
|
|
2470
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2423
2471
|
categoryIndex: 0,
|
|
2424
|
-
datasetIndex:
|
|
2472
|
+
datasetIndex: c
|
|
2425
2473
|
}, r),
|
|
2426
2474
|
parent: null,
|
|
2427
2475
|
parentIndex: null,
|
|
@@ -2429,84 +2477,84 @@ const Ke = {
|
|
|
2429
2477
|
seq: 0,
|
|
2430
2478
|
children: [],
|
|
2431
2479
|
series: d,
|
|
2432
|
-
seriesIndex:
|
|
2433
|
-
category: "
|
|
2480
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2481
|
+
category: "",
|
|
2434
2482
|
categoryIndex: 0
|
|
2435
2483
|
});
|
|
2436
2484
|
else if (C.length === 1)
|
|
2437
2485
|
u.push(C[0]);
|
|
2438
2486
|
else {
|
|
2439
|
-
const
|
|
2487
|
+
const l = {
|
|
2440
2488
|
id: `virtual-root-${a}`,
|
|
2441
|
-
index:
|
|
2489
|
+
index: v++,
|
|
2442
2490
|
modelType: "tree",
|
|
2443
2491
|
name: `Virtual Root (${a})`,
|
|
2444
2492
|
data: {},
|
|
2445
2493
|
value: null,
|
|
2446
|
-
color:
|
|
2447
|
-
index:
|
|
2448
|
-
seriesIndex:
|
|
2494
|
+
color: D(e.color.by, {
|
|
2495
|
+
index: v - 1,
|
|
2496
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2449
2497
|
categoryIndex: 0,
|
|
2450
|
-
datasetIndex:
|
|
2498
|
+
datasetIndex: c
|
|
2451
2499
|
}, r),
|
|
2452
2500
|
parent: null,
|
|
2453
2501
|
parentIndex: null,
|
|
2454
2502
|
depth: 0,
|
|
2455
2503
|
seq: 0,
|
|
2456
|
-
children: C.map((
|
|
2457
|
-
const
|
|
2458
|
-
return
|
|
2504
|
+
children: C.map((m, T) => {
|
|
2505
|
+
const B = (g, x) => (g.depth = x, x === 1 && (g.seq = T), g.children = g.children.map((_) => B(_, x + 1)), g);
|
|
2506
|
+
return B(m, 1);
|
|
2459
2507
|
}),
|
|
2460
2508
|
series: d,
|
|
2461
|
-
seriesIndex:
|
|
2462
|
-
category: "
|
|
2509
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2510
|
+
category: "",
|
|
2463
2511
|
categoryIndex: 0
|
|
2464
2512
|
};
|
|
2465
|
-
u.push(
|
|
2513
|
+
u.push(l);
|
|
2466
2514
|
}
|
|
2467
2515
|
}), u;
|
|
2468
2516
|
};
|
|
2469
|
-
function
|
|
2517
|
+
function Ur(t, e, r) {
|
|
2470
2518
|
const n = e.map((a) => r[a]).filter((a) => a && a.parentNode === t);
|
|
2471
2519
|
if (n.length === 0) return;
|
|
2472
|
-
let
|
|
2520
|
+
let s = !0, o = null;
|
|
2473
2521
|
for (const a of n) {
|
|
2474
|
-
if (
|
|
2475
|
-
|
|
2522
|
+
if (o && o.nextElementSibling !== a) {
|
|
2523
|
+
s = !1;
|
|
2476
2524
|
break;
|
|
2477
2525
|
}
|
|
2478
|
-
|
|
2526
|
+
o = a;
|
|
2479
2527
|
}
|
|
2480
|
-
if (
|
|
2528
|
+
if (s) return;
|
|
2481
2529
|
const u = document.createDocumentFragment();
|
|
2482
2530
|
e.forEach((a) => {
|
|
2483
|
-
const
|
|
2484
|
-
|
|
2531
|
+
const c = r[a];
|
|
2532
|
+
c && c.parentNode === t && u.appendChild(c);
|
|
2485
2533
|
}), t.appendChild(u);
|
|
2486
2534
|
}
|
|
2487
|
-
function
|
|
2535
|
+
function Ue(t, e, r, n, s) {
|
|
2488
2536
|
Object.keys(r).filter((i) => !e.includes(i)).forEach((i) => {
|
|
2489
|
-
const
|
|
2490
|
-
|
|
2537
|
+
const f = r[i];
|
|
2538
|
+
f && f.parentNode === t && t.removeChild(f), delete r[i];
|
|
2491
2539
|
});
|
|
2492
2540
|
const a = e.filter((i) => !r[i]);
|
|
2493
2541
|
a.forEach((i) => {
|
|
2494
|
-
const
|
|
2495
|
-
r[i] =
|
|
2542
|
+
const f = n(i);
|
|
2543
|
+
r[i] = f, t.appendChild(f);
|
|
2496
2544
|
}), e.filter((i) => r[i] && !a.includes(i)).forEach((i) => {
|
|
2497
2545
|
r[i];
|
|
2498
|
-
}), e.length > 0 &&
|
|
2546
|
+
}), e.length > 0 && Ur(t, e, r);
|
|
2499
2547
|
}
|
|
2500
|
-
function
|
|
2501
|
-
return
|
|
2548
|
+
function zr(t) {
|
|
2549
|
+
return K({ element: t }, {
|
|
2502
2550
|
element: {
|
|
2503
2551
|
toBe: "Dom",
|
|
2504
|
-
test: (r) =>
|
|
2552
|
+
test: (r) => ft(r)
|
|
2505
2553
|
}
|
|
2506
2554
|
});
|
|
2507
2555
|
}
|
|
2508
|
-
function
|
|
2509
|
-
return
|
|
2556
|
+
function Gr(t) {
|
|
2557
|
+
return K(t, {
|
|
2510
2558
|
width: {
|
|
2511
2559
|
toBe: '"auto" | number',
|
|
2512
2560
|
test: (r) => r === "auto" || typeof r == "number"
|
|
@@ -2521,8 +2569,8 @@ function zr(t) {
|
|
|
2521
2569
|
}
|
|
2522
2570
|
});
|
|
2523
2571
|
}
|
|
2524
|
-
function
|
|
2525
|
-
const e =
|
|
2572
|
+
function pt(t) {
|
|
2573
|
+
const e = K(t, {
|
|
2526
2574
|
colorScheme: {
|
|
2527
2575
|
toBe: '"dark" | "light" | "auto"',
|
|
2528
2576
|
test: (r) => r === "dark" || r === "light" || r === "auto"
|
|
@@ -2536,7 +2584,7 @@ function yt(t) {
|
|
|
2536
2584
|
}
|
|
2537
2585
|
});
|
|
2538
2586
|
if (t.colors) {
|
|
2539
|
-
const r =
|
|
2587
|
+
const r = K(t.colors, {
|
|
2540
2588
|
light: {
|
|
2541
2589
|
toBeTypes: ["object"],
|
|
2542
2590
|
test: (n) => n.data && n.primary && n.secondary && n.dataContrast && n.background
|
|
@@ -2549,7 +2597,7 @@ function yt(t) {
|
|
|
2549
2597
|
if (r.status === "error")
|
|
2550
2598
|
return r;
|
|
2551
2599
|
if (t.colors.light) {
|
|
2552
|
-
const n =
|
|
2600
|
+
const n = K(t.colors.light, {
|
|
2553
2601
|
data: {
|
|
2554
2602
|
toBeTypes: ["string[]"]
|
|
2555
2603
|
},
|
|
@@ -2570,7 +2618,7 @@ function yt(t) {
|
|
|
2570
2618
|
return n;
|
|
2571
2619
|
}
|
|
2572
2620
|
if (t.colors.dark) {
|
|
2573
|
-
const n =
|
|
2621
|
+
const n = K(t.colors.dark, {
|
|
2574
2622
|
data: {
|
|
2575
2623
|
toBeTypes: ["string[]"]
|
|
2576
2624
|
},
|
|
@@ -2593,8 +2641,8 @@ function yt(t) {
|
|
|
2593
2641
|
}
|
|
2594
2642
|
return e;
|
|
2595
2643
|
}
|
|
2596
|
-
function
|
|
2597
|
-
const e =
|
|
2644
|
+
function dt(t) {
|
|
2645
|
+
const e = K(t, {
|
|
2598
2646
|
dataset: {
|
|
2599
2647
|
toBeTypes: ["object"]
|
|
2600
2648
|
},
|
|
@@ -2615,46 +2663,55 @@ function pt(t) {
|
|
|
2615
2663
|
}
|
|
2616
2664
|
});
|
|
2617
2665
|
if (t.dataset) {
|
|
2618
|
-
const r =
|
|
2666
|
+
const r = K(t.dataset, {
|
|
2619
2667
|
from: {
|
|
2620
2668
|
toBeTypes: ["string"]
|
|
2621
2669
|
},
|
|
2622
2670
|
sort: {
|
|
2623
2671
|
toBe: '"original" | "alphabetical" | string[]',
|
|
2624
|
-
test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((
|
|
2672
|
+
test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((s) => typeof s == "string")
|
|
2673
|
+
},
|
|
2674
|
+
ignore: {
|
|
2675
|
+
toBeTypes: ["boolean"]
|
|
2625
2676
|
}
|
|
2626
2677
|
});
|
|
2627
2678
|
if (r.status === "error")
|
|
2628
2679
|
return r;
|
|
2629
2680
|
}
|
|
2630
2681
|
if (t.series) {
|
|
2631
|
-
const r =
|
|
2682
|
+
const r = K(t.series, {
|
|
2632
2683
|
from: {
|
|
2633
2684
|
toBeTypes: ["string"]
|
|
2634
2685
|
},
|
|
2635
2686
|
sort: {
|
|
2636
2687
|
toBe: '"original" | "alphabetical" | string[]',
|
|
2637
|
-
test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((
|
|
2688
|
+
test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((s) => typeof s == "string")
|
|
2689
|
+
},
|
|
2690
|
+
ignore: {
|
|
2691
|
+
toBeTypes: ["boolean"]
|
|
2638
2692
|
}
|
|
2639
2693
|
});
|
|
2640
2694
|
if (r.status === "error")
|
|
2641
2695
|
return r;
|
|
2642
2696
|
}
|
|
2643
2697
|
if (t.category) {
|
|
2644
|
-
const r =
|
|
2698
|
+
const r = K(t.category, {
|
|
2645
2699
|
from: {
|
|
2646
2700
|
toBeTypes: ["string"]
|
|
2647
2701
|
},
|
|
2648
2702
|
sort: {
|
|
2649
2703
|
toBe: '"original" | "alphabetical" | string[]',
|
|
2650
|
-
test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((
|
|
2704
|
+
test: (n) => n === "original" || n === "alphabetical" || Array.isArray(n) && n.every((s) => typeof s == "string")
|
|
2705
|
+
},
|
|
2706
|
+
ignore: {
|
|
2707
|
+
toBeTypes: ["boolean"]
|
|
2651
2708
|
}
|
|
2652
2709
|
});
|
|
2653
2710
|
if (r.status === "error")
|
|
2654
2711
|
return r;
|
|
2655
2712
|
}
|
|
2656
2713
|
if (t.value) {
|
|
2657
|
-
const r =
|
|
2714
|
+
const r = K(t.value, {
|
|
2658
2715
|
from: {
|
|
2659
2716
|
toBeTypes: ["string"]
|
|
2660
2717
|
},
|
|
@@ -2671,18 +2728,18 @@ function pt(t) {
|
|
|
2671
2728
|
return r;
|
|
2672
2729
|
}
|
|
2673
2730
|
if (t.multivariate) {
|
|
2674
|
-
const r =
|
|
2731
|
+
const r = K({ multivariate: t.multivariate }, {
|
|
2675
2732
|
multivariate: {
|
|
2676
2733
|
toBe: "EncodingMultivariateItem[]",
|
|
2677
|
-
test: (n) => Array.isArray(n) && n.every((
|
|
2734
|
+
test: (n) => Array.isArray(n) && n.every((s) => typeof s.from == "string" && typeof s.label == "string")
|
|
2678
2735
|
}
|
|
2679
2736
|
});
|
|
2680
2737
|
if (r.status === "error")
|
|
2681
2738
|
return r;
|
|
2682
2739
|
}
|
|
2683
2740
|
if (t.color) {
|
|
2684
|
-
const r =
|
|
2685
|
-
|
|
2741
|
+
const r = K(t.color, {
|
|
2742
|
+
by: {
|
|
2686
2743
|
toBe: '"index" | "series" | "category" | "dataset"',
|
|
2687
2744
|
test: (n) => ["index", "series", "category", "dataset"].includes(n)
|
|
2688
2745
|
}
|
|
@@ -2692,27 +2749,27 @@ function pt(t) {
|
|
|
2692
2749
|
}
|
|
2693
2750
|
return e;
|
|
2694
2751
|
}
|
|
2695
|
-
function
|
|
2696
|
-
return
|
|
2752
|
+
function vt(t) {
|
|
2753
|
+
return K({ data: t }, {
|
|
2697
2754
|
data: {
|
|
2698
2755
|
toBe: "RawDataColumn[] | RawDataColumn[][]",
|
|
2699
2756
|
// 畢免資料量過大檢查不完,不深度檢查
|
|
2700
|
-
test: (r) => Array.isArray(r) && r.every((n) => Array.isArray(n) ||
|
|
2757
|
+
test: (r) => Array.isArray(r) && r.every((n) => Array.isArray(n) || ee(n))
|
|
2701
2758
|
}
|
|
2702
2759
|
});
|
|
2703
2760
|
}
|
|
2704
2761
|
function $e(t) {
|
|
2705
|
-
return
|
|
2762
|
+
return K({ plugins: t }, {
|
|
2706
2763
|
plugins: {
|
|
2707
2764
|
toBe: "PluginEntity[]",
|
|
2708
|
-
test: (r) => Array.isArray(r) && r.every((n) =>
|
|
2765
|
+
test: (r) => Array.isArray(r) && r.every((n) => ee(n) && typeof n._name == "string" && typeof n._injectContext == "function")
|
|
2709
2766
|
}
|
|
2710
2767
|
});
|
|
2711
2768
|
}
|
|
2712
2769
|
function qr(t) {
|
|
2713
2770
|
if (!t)
|
|
2714
2771
|
return { status: "success", columnName: "", expectToBe: "" };
|
|
2715
|
-
const e =
|
|
2772
|
+
const e = K(t, {
|
|
2716
2773
|
size: {
|
|
2717
2774
|
toBeTypes: ["object"]
|
|
2718
2775
|
},
|
|
@@ -2729,28 +2786,28 @@ function qr(t) {
|
|
|
2729
2786
|
},
|
|
2730
2787
|
plugins: {
|
|
2731
2788
|
toBe: "PluginEntity[]",
|
|
2732
|
-
test: (r) => Array.isArray(r) && r.every((n) =>
|
|
2789
|
+
test: (r) => Array.isArray(r) && r.every((n) => ee(n) && typeof n._name == "string" && typeof n._injectContext == "function")
|
|
2733
2790
|
}
|
|
2734
2791
|
});
|
|
2735
2792
|
if (e.status === "error")
|
|
2736
2793
|
return e;
|
|
2737
2794
|
if (t.size) {
|
|
2738
|
-
const r =
|
|
2795
|
+
const r = Gr(t.size);
|
|
2739
2796
|
if (r.status === "error")
|
|
2740
2797
|
return r;
|
|
2741
2798
|
}
|
|
2742
2799
|
if (t.theme) {
|
|
2743
|
-
const r =
|
|
2800
|
+
const r = pt(t.theme);
|
|
2744
2801
|
if (r.status === "error")
|
|
2745
2802
|
return r;
|
|
2746
2803
|
}
|
|
2747
2804
|
if (t.encoding) {
|
|
2748
|
-
const r =
|
|
2805
|
+
const r = dt(t.encoding);
|
|
2749
2806
|
if (r.status === "error")
|
|
2750
2807
|
return r;
|
|
2751
2808
|
}
|
|
2752
2809
|
if (t.data) {
|
|
2753
|
-
const r =
|
|
2810
|
+
const r = vt(t.data);
|
|
2754
2811
|
if (r.status === "error")
|
|
2755
2812
|
return r;
|
|
2756
2813
|
}
|
|
@@ -2761,494 +2818,504 @@ function qr(t) {
|
|
|
2761
2818
|
}
|
|
2762
2819
|
return e;
|
|
2763
2820
|
}
|
|
2764
|
-
function
|
|
2765
|
-
let n = [],
|
|
2766
|
-
const
|
|
2767
|
-
const
|
|
2768
|
-
...
|
|
2769
|
-
pluginSeq:
|
|
2821
|
+
function Wr({ svgElement$: t, canvasElement$: e, pluginsInstance$: r }) {
|
|
2822
|
+
let n = [], s = [];
|
|
2823
|
+
const o = (c, i, f) => {
|
|
2824
|
+
const w = r.getValue().reduce((A, v, d) => (A[v._getId()] = d, A), {}), S = f.map((A) => ({
|
|
2825
|
+
...A,
|
|
2826
|
+
pluginSeq: w[A.pluginId]
|
|
2770
2827
|
}));
|
|
2771
|
-
return (
|
|
2772
|
-
...
|
|
2773
|
-
pluginSeq:
|
|
2774
|
-
})).concat(
|
|
2828
|
+
return (c === "svg" ? n : s).filter((A) => A.pluginId !== i).map((A) => ({
|
|
2829
|
+
...A,
|
|
2830
|
+
pluginSeq: w[A.pluginId]
|
|
2831
|
+
})).concat(S).sort((A, v) => A.layerIndex - v.layerIndex || A.pluginSeq - v.pluginSeq);
|
|
2775
2832
|
}, u = {}, a = {};
|
|
2776
|
-
return (
|
|
2777
|
-
const
|
|
2778
|
-
if (!
|
|
2833
|
+
return (c, i, f) => {
|
|
2834
|
+
const w = c === "svg" ? t.getValue() : e.getValue();
|
|
2835
|
+
if (!w)
|
|
2779
2836
|
return {};
|
|
2780
|
-
const
|
|
2781
|
-
return
|
|
2782
|
-
b,
|
|
2783
|
-
v,
|
|
2837
|
+
const S = c === "svg" ? u : a, y = o(c, i, f), A = y.map((d) => Lr(d.pluginId, d.layerName));
|
|
2838
|
+
return c === "svg" ? (Ue(
|
|
2784
2839
|
w,
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2840
|
+
A,
|
|
2841
|
+
S,
|
|
2842
|
+
(d) => Pr(d)
|
|
2843
|
+
), n = y) : (Ue(
|
|
2789
2844
|
w,
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2845
|
+
A,
|
|
2846
|
+
S,
|
|
2847
|
+
(d) => ht(d)
|
|
2848
|
+
), s = y), Object.entries(S).reduce((d, [b, O]) => {
|
|
2849
|
+
const [I, h, p] = b.split("-");
|
|
2850
|
+
return h === i && (d[p] = O), d;
|
|
2794
2851
|
}, {});
|
|
2795
2852
|
};
|
|
2796
2853
|
}
|
|
2797
|
-
const
|
|
2854
|
+
const Yr = (t, e) => {
|
|
2798
2855
|
try {
|
|
2799
|
-
const { status:
|
|
2800
|
-
if (
|
|
2801
|
-
throw new Error(
|
|
2802
|
-
columnName:
|
|
2803
|
-
expectToBe:
|
|
2856
|
+
const { status: b, columnName: O, expectToBe: I } = qr(e);
|
|
2857
|
+
if (b === "error")
|
|
2858
|
+
throw new Error(Q({
|
|
2859
|
+
columnName: O,
|
|
2860
|
+
expectToBe: I,
|
|
2804
2861
|
from: "Chart.constructor"
|
|
2805
2862
|
}));
|
|
2806
|
-
if (
|
|
2807
|
-
console.warn(
|
|
2808
|
-
columnName:
|
|
2809
|
-
expectToBe:
|
|
2863
|
+
if (b === "warning")
|
|
2864
|
+
console.warn(X({
|
|
2865
|
+
columnName: O,
|
|
2866
|
+
expectToBe: I,
|
|
2810
2867
|
from: "Chart.constructor"
|
|
2811
2868
|
}));
|
|
2812
2869
|
else {
|
|
2813
|
-
const { status:
|
|
2814
|
-
if (
|
|
2815
|
-
throw new Error(
|
|
2870
|
+
const { status: h, columnName: p, expectToBe: E } = zr(t);
|
|
2871
|
+
if (h === "error")
|
|
2872
|
+
throw new Error(Q({
|
|
2816
2873
|
columnName: p,
|
|
2817
|
-
expectToBe:
|
|
2874
|
+
expectToBe: E,
|
|
2818
2875
|
from: "Chart.constructor"
|
|
2819
2876
|
}));
|
|
2820
|
-
|
|
2877
|
+
h === "warning" && console.warn(X({
|
|
2821
2878
|
columnName: p,
|
|
2822
|
-
expectToBe:
|
|
2879
|
+
expectToBe: E,
|
|
2823
2880
|
from: "Chart.constructor"
|
|
2824
2881
|
}));
|
|
2825
2882
|
}
|
|
2826
|
-
} catch (
|
|
2827
|
-
throw new Error(
|
|
2883
|
+
} catch (b) {
|
|
2884
|
+
throw new Error(b);
|
|
2828
2885
|
}
|
|
2829
|
-
const r = new oe(), n = new
|
|
2830
|
-
const
|
|
2831
|
-
|
|
2832
|
-
() =>
|
|
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
|
+
const b = f.pipe(
|
|
2888
|
+
wr((g) => hr(
|
|
2889
|
+
() => g.width === "auto" || g.height === "auto",
|
|
2833
2890
|
// 有 'auto' 的話就監聽element的尺寸
|
|
2834
|
-
|
|
2835
|
-
q((
|
|
2836
|
-
width:
|
|
2837
|
-
height:
|
|
2891
|
+
jr(t).pipe(
|
|
2892
|
+
q((x) => ({
|
|
2893
|
+
width: g.width === "auto" ? x.width : g.width,
|
|
2894
|
+
height: g.height === "auto" ? x.height <= 0 ? x.width : x.height : g.height
|
|
2838
2895
|
})),
|
|
2839
|
-
|
|
2840
|
-
|
|
2896
|
+
W(g.resizeDebounce),
|
|
2897
|
+
dr((x, _) => JSON.stringify(x) === JSON.stringify(_))
|
|
2841
2898
|
),
|
|
2842
|
-
|
|
2843
|
-
width:
|
|
2844
|
-
height:
|
|
2899
|
+
Xt({
|
|
2900
|
+
width: g.width,
|
|
2901
|
+
height: g.height
|
|
2845
2902
|
})
|
|
2846
2903
|
)),
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
),
|
|
2850
|
-
|
|
2851
|
-
),
|
|
2904
|
+
Er(r),
|
|
2905
|
+
ne(1)
|
|
2906
|
+
), O = o.asObservable().pipe(
|
|
2907
|
+
ne(1)
|
|
2908
|
+
), I = H([
|
|
2852
2909
|
n,
|
|
2853
|
-
|
|
2910
|
+
o,
|
|
2854
2911
|
a
|
|
2855
2912
|
]).pipe(
|
|
2856
|
-
|
|
2857
|
-
q(([
|
|
2913
|
+
W(0),
|
|
2914
|
+
q(([g, x, _]) => {
|
|
2858
2915
|
try {
|
|
2859
|
-
return
|
|
2860
|
-
} catch (
|
|
2861
|
-
throw new Error(
|
|
2916
|
+
return Kr(g, x, _);
|
|
2917
|
+
} catch (P) {
|
|
2918
|
+
throw new Error(he({
|
|
2862
2919
|
from: "Chart.seriesData$",
|
|
2863
|
-
systemMessage:
|
|
2920
|
+
systemMessage: P
|
|
2864
2921
|
}));
|
|
2865
2922
|
}
|
|
2866
2923
|
}),
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
),
|
|
2924
|
+
ie((g) => (console.error(G(g)), ae)),
|
|
2925
|
+
ne(1)
|
|
2926
|
+
), h = H([
|
|
2870
2927
|
n,
|
|
2871
|
-
|
|
2928
|
+
o,
|
|
2872
2929
|
a
|
|
2873
2930
|
]).pipe(
|
|
2874
|
-
|
|
2875
|
-
q(([
|
|
2931
|
+
W(0),
|
|
2932
|
+
q(([g, x, _]) => {
|
|
2876
2933
|
try {
|
|
2877
|
-
return Rr(
|
|
2878
|
-
} catch (
|
|
2879
|
-
throw new Error(
|
|
2934
|
+
return Rr(g, x, _);
|
|
2935
|
+
} catch (P) {
|
|
2936
|
+
throw new Error(he({
|
|
2880
2937
|
from: "Chart.gridData$",
|
|
2881
|
-
systemMessage:
|
|
2938
|
+
systemMessage: P
|
|
2882
2939
|
}));
|
|
2883
2940
|
}
|
|
2884
2941
|
}),
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
), p =
|
|
2942
|
+
ie((g) => (console.error(G(g)), ae)),
|
|
2943
|
+
ne(1)
|
|
2944
|
+
), p = H([
|
|
2888
2945
|
n,
|
|
2889
|
-
|
|
2946
|
+
o,
|
|
2890
2947
|
a
|
|
2891
2948
|
]).pipe(
|
|
2892
|
-
|
|
2893
|
-
q(([
|
|
2949
|
+
W(0),
|
|
2950
|
+
q(([g, x, _]) => {
|
|
2894
2951
|
try {
|
|
2895
|
-
return
|
|
2896
|
-
} catch (
|
|
2897
|
-
throw new Error(
|
|
2952
|
+
return Fr(g, x, _);
|
|
2953
|
+
} catch (P) {
|
|
2954
|
+
throw new Error(he({
|
|
2898
2955
|
from: "Chart.multivariateData$",
|
|
2899
|
-
systemMessage:
|
|
2956
|
+
systemMessage: P
|
|
2900
2957
|
}));
|
|
2901
2958
|
}
|
|
2902
2959
|
}),
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
),
|
|
2960
|
+
ie((g) => (console.error(G(g)), ae)),
|
|
2961
|
+
ne(1)
|
|
2962
|
+
), E = H([
|
|
2906
2963
|
n,
|
|
2907
|
-
|
|
2964
|
+
o,
|
|
2908
2965
|
a
|
|
2909
2966
|
]).pipe(
|
|
2910
|
-
|
|
2911
|
-
q(([
|
|
2967
|
+
W(0),
|
|
2968
|
+
q(([g, x, _]) => {
|
|
2912
2969
|
try {
|
|
2913
|
-
return
|
|
2914
|
-
} catch (
|
|
2915
|
-
throw new Error(
|
|
2970
|
+
return Dr(g, x, _);
|
|
2971
|
+
} catch (P) {
|
|
2972
|
+
throw new Error(he({
|
|
2916
2973
|
from: "Chart.graphData$",
|
|
2917
|
-
systemMessage:
|
|
2974
|
+
systemMessage: P
|
|
2918
2975
|
}));
|
|
2919
2976
|
}
|
|
2920
2977
|
}),
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
),
|
|
2978
|
+
ie((g) => (console.error(G(g)), ae)),
|
|
2979
|
+
ne(1)
|
|
2980
|
+
), k = H([
|
|
2924
2981
|
n,
|
|
2925
|
-
|
|
2982
|
+
o,
|
|
2926
2983
|
a
|
|
2927
2984
|
]).pipe(
|
|
2928
|
-
|
|
2929
|
-
q(([
|
|
2985
|
+
W(0),
|
|
2986
|
+
q(([g, x, _]) => {
|
|
2930
2987
|
try {
|
|
2931
|
-
return
|
|
2932
|
-
} catch (
|
|
2933
|
-
throw new Error(
|
|
2988
|
+
return Nr(g, x, _);
|
|
2989
|
+
} catch (P) {
|
|
2990
|
+
throw new Error(he({
|
|
2934
2991
|
from: "Chart.treeData$",
|
|
2935
|
-
systemMessage:
|
|
2992
|
+
systemMessage: P
|
|
2936
2993
|
}));
|
|
2937
2994
|
}
|
|
2938
2995
|
}),
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
),
|
|
2942
|
-
|
|
2943
|
-
const
|
|
2996
|
+
ie((g) => (console.error(G(g)), ae)),
|
|
2997
|
+
ne(1)
|
|
2998
|
+
), C = new N([]);
|
|
2999
|
+
c.subscribe((g) => {
|
|
3000
|
+
const x = {}, _ = g.map((j) => {
|
|
2944
3001
|
var L;
|
|
2945
|
-
let
|
|
2946
|
-
if (
|
|
2947
|
-
const
|
|
2948
|
-
|
|
3002
|
+
let M = j._getId();
|
|
3003
|
+
if (x[M]) {
|
|
3004
|
+
const F = ((L = x[M].split("[")[1]) == null ? void 0 : L.split("]")[0]) || "0", J = parseInt(F) + 1;
|
|
3005
|
+
M = `${M.split("[")[0]}[${J}]`;
|
|
2949
3006
|
}
|
|
2950
|
-
return
|
|
3007
|
+
return x[M] = j._getId(), M;
|
|
2951
3008
|
});
|
|
2952
|
-
|
|
2953
|
-
const
|
|
2954
|
-
id:
|
|
2955
|
-
name:
|
|
2956
|
-
elementType:
|
|
2957
|
-
shownLayers:
|
|
3009
|
+
g.forEach((j, M) => j._setId(_[M]));
|
|
3010
|
+
const P = g.map((j) => ({
|
|
3011
|
+
id: j._getId(),
|
|
3012
|
+
name: j._name,
|
|
3013
|
+
elementType: j._elementType,
|
|
3014
|
+
shownLayers: j.getShownLayerNames()
|
|
2958
3015
|
}));
|
|
2959
|
-
|
|
3016
|
+
C.next(P);
|
|
2960
3017
|
});
|
|
2961
|
-
const
|
|
2962
|
-
|
|
2963
|
-
),
|
|
3018
|
+
const l = a.asObservable().pipe(
|
|
3019
|
+
ne(1)
|
|
3020
|
+
), m = new oe(), T = m.asObservable().pipe(
|
|
2964
3021
|
lt()
|
|
2965
3022
|
);
|
|
2966
3023
|
return {
|
|
2967
3024
|
root: t,
|
|
2968
3025
|
svg: null,
|
|
2969
3026
|
canvas: null,
|
|
2970
|
-
size$:
|
|
2971
|
-
encoding$:
|
|
2972
|
-
seriesData$:
|
|
2973
|
-
gridData$:
|
|
3027
|
+
size$: b,
|
|
3028
|
+
encoding$: O,
|
|
3029
|
+
seriesData$: I,
|
|
3030
|
+
gridData$: h,
|
|
2974
3031
|
multivariateData$: p,
|
|
2975
|
-
graphData$:
|
|
2976
|
-
treeData$:
|
|
2977
|
-
plugins$:
|
|
2978
|
-
theme$:
|
|
2979
|
-
event$:
|
|
2980
|
-
eventTrigger$:
|
|
2981
|
-
_updateLayerElements:
|
|
2982
|
-
svgElement$:
|
|
2983
|
-
canvasElement$:
|
|
2984
|
-
pluginsInstance$:
|
|
3032
|
+
graphData$: E,
|
|
3033
|
+
treeData$: k,
|
|
3034
|
+
plugins$: C,
|
|
3035
|
+
theme$: l,
|
|
3036
|
+
event$: T,
|
|
3037
|
+
eventTrigger$: m,
|
|
3038
|
+
_updateLayerElements: Wr({
|
|
3039
|
+
svgElement$: w,
|
|
3040
|
+
canvasElement$: S,
|
|
3041
|
+
pluginsInstance$: c
|
|
2985
3042
|
})
|
|
2986
3043
|
};
|
|
2987
3044
|
})();
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
3045
|
+
let A = null;
|
|
3046
|
+
const v = () => (A || (A = document.createElement("div"), A.classList.add("orbcharts-container"), A.style.position = "relative", t.appendChild(A)), A);
|
|
3047
|
+
let d = [];
|
|
3048
|
+
return c.subscribe((b) => {
|
|
3049
|
+
d.filter((p) => !b.includes(p)).forEach((p) => {
|
|
3050
|
+
y._updateLayerElements(p._elementType, p._getId(), []), p.destroy();
|
|
3051
|
+
}), d = b;
|
|
3052
|
+
let I = !1, h = !1;
|
|
3053
|
+
b.forEach((p) => {
|
|
3054
|
+
p._elementType === "svg" ? I = !0 : p._elementType === "canvas" && (h = !0);
|
|
3055
|
+
}), I && !y.svg ? (y.svg = Br("orbcharts-root-svg"), v().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"), v().appendChild(y.canvas), S.next(y.canvas)) : !h && y.canvas && (y.canvas.remove(), y.canvas = null, S.next(null)), b.forEach((p) => {
|
|
3056
|
+
p._injectContext(y);
|
|
2994
3057
|
});
|
|
2995
|
-
}),
|
|
2996
|
-
size:
|
|
2997
|
-
svg:
|
|
3058
|
+
}), H({
|
|
3059
|
+
size: y.size$,
|
|
3060
|
+
svg: w
|
|
2998
3061
|
}).pipe(
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
).subscribe(({ size:
|
|
3002
|
-
|
|
3003
|
-
}),
|
|
3004
|
-
size:
|
|
3005
|
-
canvas:
|
|
3062
|
+
W(0),
|
|
3063
|
+
pe(({ svg: b }) => !!b)
|
|
3064
|
+
).subscribe(({ size: b, svg: O }) => {
|
|
3065
|
+
O && (O.setAttribute("width", b.width.toString()), O.setAttribute("height", b.height.toString()));
|
|
3066
|
+
}), H({
|
|
3067
|
+
size: y.size$,
|
|
3068
|
+
canvas: S
|
|
3006
3069
|
}).pipe(
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
).subscribe(({ size:
|
|
3010
|
-
|
|
3070
|
+
W(0),
|
|
3071
|
+
pe(({ canvas: b }) => !!b)
|
|
3072
|
+
).subscribe(({ size: b, canvas: O }) => {
|
|
3073
|
+
O && (O.width = b.width, O.height = b.height);
|
|
3011
3074
|
}), /* @__PURE__ */ (() => {
|
|
3012
|
-
function
|
|
3013
|
-
|
|
3075
|
+
function b(g) {
|
|
3076
|
+
f.next(g);
|
|
3014
3077
|
}
|
|
3015
|
-
function
|
|
3078
|
+
function O(g) {
|
|
3016
3079
|
try {
|
|
3017
|
-
const { status:
|
|
3018
|
-
if (
|
|
3019
|
-
throw new Error(
|
|
3020
|
-
columnName:
|
|
3021
|
-
expectToBe:
|
|
3080
|
+
const { status: x, columnName: _, expectToBe: P } = vt(g);
|
|
3081
|
+
if (x === "error")
|
|
3082
|
+
throw new Error(Q({
|
|
3083
|
+
columnName: _,
|
|
3084
|
+
expectToBe: P,
|
|
3022
3085
|
from: "Chart.setData"
|
|
3023
3086
|
}));
|
|
3024
|
-
|
|
3025
|
-
columnName:
|
|
3026
|
-
expectToBe:
|
|
3087
|
+
x === "warning" && console.warn(X({
|
|
3088
|
+
columnName: _,
|
|
3089
|
+
expectToBe: P,
|
|
3027
3090
|
from: "Chart.setData"
|
|
3028
3091
|
}));
|
|
3029
|
-
} catch (
|
|
3030
|
-
console.error(
|
|
3092
|
+
} catch (x) {
|
|
3093
|
+
console.error(G(x));
|
|
3031
3094
|
}
|
|
3032
|
-
n.next(
|
|
3095
|
+
n.next(g);
|
|
3033
3096
|
}
|
|
3034
|
-
function
|
|
3097
|
+
function I(g) {
|
|
3035
3098
|
try {
|
|
3036
|
-
const { status:
|
|
3037
|
-
if (
|
|
3038
|
-
throw new Error(
|
|
3039
|
-
columnName:
|
|
3040
|
-
expectToBe:
|
|
3099
|
+
const { status: _, columnName: P, expectToBe: j } = dt(g);
|
|
3100
|
+
if (_ === "error")
|
|
3101
|
+
throw new Error(Q({
|
|
3102
|
+
columnName: P,
|
|
3103
|
+
expectToBe: j,
|
|
3041
3104
|
from: "Chart.updateEncoding"
|
|
3042
3105
|
}));
|
|
3043
|
-
|
|
3044
|
-
columnName:
|
|
3045
|
-
expectToBe:
|
|
3106
|
+
_ === "warning" && console.warn(X({
|
|
3107
|
+
columnName: P,
|
|
3108
|
+
expectToBe: j,
|
|
3046
3109
|
from: "Chart.updateEncoding"
|
|
3047
3110
|
}));
|
|
3048
|
-
} catch (
|
|
3049
|
-
console.error(
|
|
3111
|
+
} catch (_) {
|
|
3112
|
+
console.error(G(_));
|
|
3050
3113
|
}
|
|
3051
|
-
const
|
|
3052
|
-
|
|
3114
|
+
const x = Y(o.getValue(), g);
|
|
3115
|
+
o.next(x);
|
|
3053
3116
|
}
|
|
3054
|
-
function
|
|
3055
|
-
|
|
3117
|
+
function h(g) {
|
|
3118
|
+
o.next(g);
|
|
3056
3119
|
}
|
|
3057
3120
|
function p() {
|
|
3058
|
-
return
|
|
3121
|
+
return o.getValue();
|
|
3059
3122
|
}
|
|
3060
|
-
function
|
|
3123
|
+
function E(g) {
|
|
3061
3124
|
try {
|
|
3062
|
-
const { status:
|
|
3063
|
-
if (
|
|
3064
|
-
throw new Error(
|
|
3065
|
-
columnName:
|
|
3066
|
-
expectToBe:
|
|
3125
|
+
const { status: x, columnName: _, expectToBe: P } = $e(g);
|
|
3126
|
+
if (x === "error")
|
|
3127
|
+
throw new Error(Q({
|
|
3128
|
+
columnName: _,
|
|
3129
|
+
expectToBe: P,
|
|
3067
3130
|
from: "Chart.setPlugins"
|
|
3068
3131
|
}));
|
|
3069
|
-
|
|
3070
|
-
columnName:
|
|
3071
|
-
expectToBe:
|
|
3132
|
+
x === "warning" && console.warn(X({
|
|
3133
|
+
columnName: _,
|
|
3134
|
+
expectToBe: P,
|
|
3072
3135
|
from: "Chart.setPlugins"
|
|
3073
3136
|
}));
|
|
3074
|
-
} catch (
|
|
3075
|
-
console.error(
|
|
3137
|
+
} catch (x) {
|
|
3138
|
+
console.error(G(x));
|
|
3076
3139
|
}
|
|
3077
|
-
|
|
3140
|
+
c.next(g);
|
|
3078
3141
|
}
|
|
3079
|
-
function
|
|
3142
|
+
function k(g) {
|
|
3080
3143
|
try {
|
|
3081
|
-
const { status:
|
|
3082
|
-
if (
|
|
3083
|
-
throw new Error(
|
|
3084
|
-
columnName:
|
|
3085
|
-
expectToBe:
|
|
3144
|
+
const { status: x, columnName: _, expectToBe: P } = $e([g]);
|
|
3145
|
+
if (x === "error")
|
|
3146
|
+
throw new Error(Q({
|
|
3147
|
+
columnName: _,
|
|
3148
|
+
expectToBe: P,
|
|
3086
3149
|
from: "Chart.addPlugin"
|
|
3087
3150
|
}));
|
|
3088
|
-
|
|
3089
|
-
columnName:
|
|
3090
|
-
expectToBe:
|
|
3151
|
+
x === "warning" && console.warn(X({
|
|
3152
|
+
columnName: _,
|
|
3153
|
+
expectToBe: P,
|
|
3091
3154
|
from: "Chart.addPlugin"
|
|
3092
3155
|
}));
|
|
3093
|
-
} catch (
|
|
3094
|
-
console.error(
|
|
3156
|
+
} catch (x) {
|
|
3157
|
+
console.error(G(x));
|
|
3095
3158
|
}
|
|
3096
|
-
|
|
3159
|
+
c.next([...c.getValue(), g]);
|
|
3097
3160
|
}
|
|
3098
|
-
function
|
|
3099
|
-
|
|
3161
|
+
function C(g) {
|
|
3162
|
+
c.next(c.getValue().filter((x) => x._getId() !== g));
|
|
3100
3163
|
}
|
|
3101
|
-
function
|
|
3164
|
+
function l(g) {
|
|
3102
3165
|
try {
|
|
3103
|
-
const { status:
|
|
3104
|
-
if (
|
|
3105
|
-
throw new Error(
|
|
3106
|
-
columnName:
|
|
3107
|
-
expectToBe:
|
|
3166
|
+
const { status: _, columnName: P, expectToBe: j } = pt(g);
|
|
3167
|
+
if (_ === "error")
|
|
3168
|
+
throw new Error(Q({
|
|
3169
|
+
columnName: P,
|
|
3170
|
+
expectToBe: j,
|
|
3108
3171
|
from: "Chart.updateTheme"
|
|
3109
3172
|
}));
|
|
3110
|
-
|
|
3111
|
-
columnName:
|
|
3112
|
-
expectToBe:
|
|
3173
|
+
_ === "warning" && console.warn(X({
|
|
3174
|
+
columnName: P,
|
|
3175
|
+
expectToBe: j,
|
|
3113
3176
|
from: "Chart.updateTheme"
|
|
3114
3177
|
}));
|
|
3115
|
-
} catch (
|
|
3116
|
-
console.error(
|
|
3178
|
+
} catch (_) {
|
|
3179
|
+
console.error(G(_));
|
|
3117
3180
|
}
|
|
3118
|
-
const
|
|
3119
|
-
a.next(
|
|
3181
|
+
const x = Y(a.getValue(), g);
|
|
3182
|
+
a.next(x);
|
|
3120
3183
|
}
|
|
3121
|
-
function
|
|
3122
|
-
a.next(
|
|
3184
|
+
function m(g) {
|
|
3185
|
+
a.next(g);
|
|
3123
3186
|
}
|
|
3124
|
-
function
|
|
3187
|
+
function T() {
|
|
3125
3188
|
return a.getValue();
|
|
3126
3189
|
}
|
|
3127
|
-
function
|
|
3128
|
-
r.next(void 0),
|
|
3190
|
+
function B() {
|
|
3191
|
+
r.next(void 0), kr(t), A = null;
|
|
3129
3192
|
}
|
|
3130
3193
|
return {
|
|
3131
|
-
resize:
|
|
3132
|
-
setData:
|
|
3194
|
+
resize: b,
|
|
3195
|
+
setData: O,
|
|
3133
3196
|
// setEncoding,
|
|
3134
|
-
updateEncoding:
|
|
3135
|
-
forceReplaceEncoding:
|
|
3197
|
+
updateEncoding: I,
|
|
3198
|
+
forceReplaceEncoding: h,
|
|
3136
3199
|
getEncoding: p,
|
|
3137
|
-
setPlugins:
|
|
3138
|
-
addPlugin:
|
|
3139
|
-
removePlugin:
|
|
3200
|
+
setPlugins: E,
|
|
3201
|
+
addPlugin: k,
|
|
3202
|
+
removePlugin: C,
|
|
3140
3203
|
// setTheme,
|
|
3141
|
-
updateTheme:
|
|
3142
|
-
forceReplaceTheme:
|
|
3143
|
-
getTheme:
|
|
3144
|
-
destroy:
|
|
3145
|
-
context:
|
|
3204
|
+
updateTheme: l,
|
|
3205
|
+
forceReplaceTheme: m,
|
|
3206
|
+
getTheme: T,
|
|
3207
|
+
destroy: B,
|
|
3208
|
+
context: y
|
|
3146
3209
|
};
|
|
3147
3210
|
})();
|
|
3148
3211
|
};
|
|
3149
|
-
class
|
|
3212
|
+
class Qr {
|
|
3150
3213
|
constructor(e, r) {
|
|
3151
|
-
return
|
|
3214
|
+
return Yr(e, r);
|
|
3152
3215
|
}
|
|
3153
3216
|
}
|
|
3154
3217
|
const mt = (t, e, r) => {
|
|
3155
|
-
let n = e.name,
|
|
3218
|
+
let n = e.name, s = () => {
|
|
3156
3219
|
};
|
|
3157
|
-
const
|
|
3158
|
-
|
|
3159
|
-
), a = {
|
|
3220
|
+
const o = new N(null), u = o.pipe(
|
|
3221
|
+
pe((h) => h !== null)
|
|
3222
|
+
), a = e.layers.map((h) => new h()), c = {
|
|
3160
3223
|
// 將陣列轉成字典
|
|
3161
|
-
...
|
|
3162
|
-
},
|
|
3163
|
-
if (
|
|
3164
|
-
const
|
|
3165
|
-
return Object.keys(
|
|
3224
|
+
...a.reduce((h, p) => (h[p._name] = p, h), {})
|
|
3225
|
+
}, i = () => new Set(a.map((h) => h._name)), f = (h) => {
|
|
3226
|
+
if (h) {
|
|
3227
|
+
const p = i();
|
|
3228
|
+
return Object.keys(h).filter((k) => p.has(k));
|
|
3166
3229
|
}
|
|
3167
3230
|
return [];
|
|
3168
|
-
},
|
|
3169
|
-
new Set(
|
|
3170
|
-
),
|
|
3171
|
-
q((
|
|
3172
|
-
var
|
|
3231
|
+
}, w = a.reduce((h, p) => (p._initShow && h.push(p._name), h), []), S = f(r), y = new N(
|
|
3232
|
+
new Set(S.length > 0 ? S : w)
|
|
3233
|
+
), A = y.pipe(
|
|
3234
|
+
q((h) => Array.from(h).map((E) => {
|
|
3235
|
+
var k;
|
|
3173
3236
|
return [
|
|
3174
|
-
|
|
3175
|
-
((
|
|
3237
|
+
E,
|
|
3238
|
+
((k = a.find((C) => C._name === E)) == null ? void 0 : k._layerIndex) ?? -1
|
|
3176
3239
|
];
|
|
3177
|
-
}).filter(([,
|
|
3178
|
-
)
|
|
3240
|
+
}).filter(([, E]) => E !== -1).sort((E, k) => E[1] - k[1]).map(([E]) => E))
|
|
3241
|
+
);
|
|
3242
|
+
let v = Y(
|
|
3243
|
+
e.defaultParams ?? {},
|
|
3244
|
+
r ?? {}
|
|
3245
|
+
);
|
|
3246
|
+
const d = new N(
|
|
3179
3247
|
r ?? {}
|
|
3180
|
-
),
|
|
3181
|
-
|
|
3248
|
+
), b = new oe(), O = new R((h) => {
|
|
3249
|
+
d.subscribe((p) => {
|
|
3182
3250
|
try {
|
|
3183
|
-
const { status:
|
|
3184
|
-
if (
|
|
3185
|
-
throw new Error(
|
|
3186
|
-
columnName:
|
|
3187
|
-
expectToBe:
|
|
3251
|
+
const { status: E, columnName: k, expectToBe: C } = e.validator(p);
|
|
3252
|
+
if (E === "error")
|
|
3253
|
+
throw new Error(Q({
|
|
3254
|
+
columnName: k,
|
|
3255
|
+
expectToBe: C,
|
|
3188
3256
|
from: `${e.name}.params$`
|
|
3189
3257
|
}));
|
|
3190
|
-
|
|
3191
|
-
columnName:
|
|
3192
|
-
expectToBe:
|
|
3258
|
+
E === "warning" && console.warn(X({
|
|
3259
|
+
columnName: k,
|
|
3260
|
+
expectToBe: C,
|
|
3193
3261
|
from: `${e.name}.params$`
|
|
3194
3262
|
}));
|
|
3195
|
-
} catch (
|
|
3196
|
-
console.error(
|
|
3263
|
+
} catch (E) {
|
|
3264
|
+
console.error(G(E));
|
|
3197
3265
|
}
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
p.next(_);
|
|
3266
|
+
h.next(v);
|
|
3267
|
+
}), b.subscribe((p) => {
|
|
3268
|
+
h.next(p);
|
|
3202
3269
|
});
|
|
3203
|
-
}),
|
|
3204
|
-
q((
|
|
3205
|
-
context:
|
|
3270
|
+
}), I = u.pipe(
|
|
3271
|
+
q((h) => ({
|
|
3272
|
+
context: h,
|
|
3206
3273
|
// 初始化時 context 有可能被 in place 擴展
|
|
3207
|
-
pluginParams$:
|
|
3274
|
+
pluginParams$: O
|
|
3208
3275
|
})),
|
|
3209
|
-
|
|
3276
|
+
br()
|
|
3210
3277
|
// 只做初始化
|
|
3211
3278
|
);
|
|
3212
|
-
return
|
|
3213
|
-
pluginSetupProps:
|
|
3214
|
-
ShownLayerNameSet:
|
|
3215
|
-
shownLayerNamesSeq:
|
|
3279
|
+
return H({
|
|
3280
|
+
pluginSetupProps: I,
|
|
3281
|
+
ShownLayerNameSet: y,
|
|
3282
|
+
shownLayerNamesSeq: A
|
|
3216
3283
|
}).pipe(
|
|
3217
|
-
|
|
3218
|
-
).subscribe(({ pluginSetupProps:
|
|
3219
|
-
const
|
|
3284
|
+
W(0)
|
|
3285
|
+
).subscribe(({ pluginSetupProps: h, ShownLayerNameSet: p, shownLayerNamesSeq: E }) => {
|
|
3286
|
+
const k = h.context._updateLayerElements(
|
|
3220
3287
|
t,
|
|
3221
3288
|
n,
|
|
3222
|
-
|
|
3289
|
+
E.map((C) => ({
|
|
3223
3290
|
pluginId: n,
|
|
3224
3291
|
pluginName: e.name,
|
|
3225
|
-
layerName:
|
|
3226
|
-
layerIndex:
|
|
3292
|
+
layerName: C,
|
|
3293
|
+
layerIndex: c[C]._layerIndex
|
|
3227
3294
|
}))
|
|
3228
3295
|
);
|
|
3229
|
-
e.setup && (
|
|
3230
|
-
var
|
|
3231
|
-
if (
|
|
3232
|
-
const
|
|
3296
|
+
e.setup && (s = e.setup(h)), a.forEach((C) => {
|
|
3297
|
+
var l, m;
|
|
3298
|
+
if (p.has(C._name)) {
|
|
3299
|
+
const T = t === "svg" ? {
|
|
3233
3300
|
// svgG: (pluginSetupProps as PluginSetupProps<'svg', ExtendContext, PluginParams>).svgG.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3234
|
-
svgG:
|
|
3301
|
+
svgG: k[C._name],
|
|
3235
3302
|
// canvas: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3236
3303
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3237
|
-
context:
|
|
3238
|
-
pluginParams$:
|
|
3239
|
-
initLayerParams: ((
|
|
3304
|
+
context: h.context,
|
|
3305
|
+
pluginParams$: O,
|
|
3306
|
+
initLayerParams: ((l = d.getValue()) == null ? void 0 : l[C._name]) || {}
|
|
3240
3307
|
} : {
|
|
3241
3308
|
// svgG: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3242
3309
|
// canvas: (pluginSetupProps as PluginSetupProps<'canvas', ExtendContext, PluginParams>).canvas.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3243
|
-
canvas:
|
|
3310
|
+
canvas: k[C._name],
|
|
3244
3311
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3245
|
-
context:
|
|
3246
|
-
pluginParams$:
|
|
3247
|
-
initLayerParams: ((
|
|
3312
|
+
context: h.context,
|
|
3313
|
+
pluginParams$: O,
|
|
3314
|
+
initLayerParams: ((m = d.getValue()) == null ? void 0 : m[C._name]) || {}
|
|
3248
3315
|
};
|
|
3249
|
-
|
|
3316
|
+
C._enable(T);
|
|
3250
3317
|
} else
|
|
3251
|
-
|
|
3318
|
+
C._disable();
|
|
3252
3319
|
});
|
|
3253
3320
|
}), {
|
|
3254
3321
|
// name: `${config.name}-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -3262,51 +3329,56 @@ const mt = (t, e, r) => {
|
|
|
3262
3329
|
// contextExtension,
|
|
3263
3330
|
// layer visibility controls
|
|
3264
3331
|
_getId: () => n,
|
|
3265
|
-
_setId: (
|
|
3266
|
-
n =
|
|
3332
|
+
_setId: (h) => {
|
|
3333
|
+
n = h;
|
|
3267
3334
|
},
|
|
3268
3335
|
// 由 chart 注入 context
|
|
3269
|
-
_injectContext: (
|
|
3270
|
-
|
|
3336
|
+
_injectContext: (h) => {
|
|
3337
|
+
o.next(Object.assign({}, h));
|
|
3271
3338
|
},
|
|
3272
|
-
show: (
|
|
3273
|
-
|
|
3339
|
+
show: (h) => {
|
|
3340
|
+
h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...Array.from(y.getValue()), ...h]));
|
|
3274
3341
|
},
|
|
3275
|
-
showOnly: (
|
|
3276
|
-
|
|
3342
|
+
showOnly: (h) => {
|
|
3343
|
+
h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...h]));
|
|
3277
3344
|
},
|
|
3278
3345
|
showAll: () => {
|
|
3279
|
-
|
|
3346
|
+
y.next(i());
|
|
3280
3347
|
},
|
|
3281
|
-
hide: (
|
|
3282
|
-
|
|
3348
|
+
hide: (h) => {
|
|
3349
|
+
h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...Array.from(y.getValue()).filter((p) => !h.includes(p))]));
|
|
3283
3350
|
},
|
|
3284
3351
|
hideAll: () => {
|
|
3285
|
-
|
|
3352
|
+
y.next(/* @__PURE__ */ new Set());
|
|
3286
3353
|
},
|
|
3287
|
-
toggle: (
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
}),
|
|
3354
|
+
toggle: (h) => {
|
|
3355
|
+
h = Array.isArray(h) ? h : [h], Array.from(y.getValue()).forEach((p) => {
|
|
3356
|
+
h.includes(p) ? h.splice(h.indexOf(p), 1) : h.push(p);
|
|
3357
|
+
}), y.next(new Set(h));
|
|
3291
3358
|
},
|
|
3292
|
-
getShownLayerNames: () => Array.from(
|
|
3359
|
+
getShownLayerNames: () => Array.from(y.getValue()),
|
|
3293
3360
|
// layer params
|
|
3294
3361
|
// setLayers: (partial: DeepPartial<PluginParams>) => {
|
|
3295
3362
|
// params = { ...params, ...partial }
|
|
3296
3363
|
// },
|
|
3297
|
-
updateParams: (
|
|
3298
|
-
v.next(
|
|
3299
|
-
const
|
|
3300
|
-
|
|
3364
|
+
updateParams: (h) => {
|
|
3365
|
+
v = Y(v, h), d.next(h), Object.keys(h).forEach((p) => {
|
|
3366
|
+
const E = c[p];
|
|
3367
|
+
E && E._updateParams(h[p]);
|
|
3301
3368
|
});
|
|
3302
3369
|
},
|
|
3303
|
-
forceReplaceParams: (
|
|
3304
|
-
|
|
3305
|
-
const
|
|
3306
|
-
|
|
3370
|
+
forceReplaceParams: (h) => {
|
|
3371
|
+
v = h, b.next(h), Object.keys(h).forEach((p) => {
|
|
3372
|
+
const E = c[p];
|
|
3373
|
+
E && E._forceReplaceParams(h[p]);
|
|
3307
3374
|
});
|
|
3308
3375
|
},
|
|
3309
|
-
getParams: () =>
|
|
3376
|
+
getParams: () => {
|
|
3377
|
+
const h = Object.assign({}, v);
|
|
3378
|
+
return a.forEach((p) => {
|
|
3379
|
+
h[p._name] = p._getParams();
|
|
3380
|
+
}), h;
|
|
3381
|
+
},
|
|
3310
3382
|
// layer: <LayerName extends keyof PluginParams>(name: LayerName) => ({
|
|
3311
3383
|
// // set: (partial: DeepPartial<PluginParams[LayerName]>) => {
|
|
3312
3384
|
// // if (params[name]) {
|
|
@@ -3332,8 +3404,8 @@ const mt = (t, e, r) => {
|
|
|
3332
3404
|
// }
|
|
3333
3405
|
// }),
|
|
3334
3406
|
destroy: () => {
|
|
3335
|
-
|
|
3336
|
-
|
|
3407
|
+
s(), o.complete(), y.complete(), a.forEach((h) => {
|
|
3408
|
+
h._destroy();
|
|
3337
3409
|
});
|
|
3338
3410
|
}
|
|
3339
3411
|
// // outputs
|
|
@@ -3341,22 +3413,22 @@ const mt = (t, e, r) => {
|
|
|
3341
3413
|
// subscriber.next(params)
|
|
3342
3414
|
// })
|
|
3343
3415
|
};
|
|
3344
|
-
},
|
|
3416
|
+
}, Xr = (t) => class {
|
|
3345
3417
|
constructor(r) {
|
|
3346
3418
|
return mt("svg", t, r);
|
|
3347
3419
|
}
|
|
3348
|
-
},
|
|
3349
|
-
const r = new
|
|
3420
|
+
}, gt = (t, e) => {
|
|
3421
|
+
const r = new N(Object.assign({}, e.defaultParams));
|
|
3350
3422
|
let n = () => {
|
|
3351
3423
|
};
|
|
3352
|
-
const
|
|
3353
|
-
|
|
3424
|
+
const s = new N(null), o = s.pipe(
|
|
3425
|
+
pe((u) => u !== null)
|
|
3354
3426
|
);
|
|
3355
|
-
return
|
|
3427
|
+
return H({
|
|
3356
3428
|
layerParams: r,
|
|
3357
|
-
enabledProps:
|
|
3429
|
+
enabledProps: o
|
|
3358
3430
|
}).pipe(
|
|
3359
|
-
|
|
3431
|
+
W(0)
|
|
3360
3432
|
).subscribe(({ layerParams: u, enabledProps: a }) => {
|
|
3361
3433
|
n(), n = t === "svg" ? e.setup({
|
|
3362
3434
|
svgG: a.svgG,
|
|
@@ -3365,7 +3437,7 @@ const mt = (t, e, r) => {
|
|
|
3365
3437
|
context: a.context,
|
|
3366
3438
|
pluginParams$: a.pluginParams$,
|
|
3367
3439
|
layerParams$: r.pipe(
|
|
3368
|
-
q((
|
|
3440
|
+
q((c) => Y(c, a.initLayerParams ?? {}))
|
|
3369
3441
|
)
|
|
3370
3442
|
}) : e.setup({
|
|
3371
3443
|
// svgG: enabledProps.svgG,
|
|
@@ -3374,10 +3446,10 @@ const mt = (t, e, r) => {
|
|
|
3374
3446
|
context: a.context,
|
|
3375
3447
|
pluginParams$: a.pluginParams$,
|
|
3376
3448
|
layerParams$: r.pipe(
|
|
3377
|
-
q((
|
|
3449
|
+
q((c) => Y(c, a.initLayerParams ?? {}))
|
|
3378
3450
|
)
|
|
3379
3451
|
});
|
|
3380
|
-
}),
|
|
3452
|
+
}), s.pipe(pe((u) => u === null)).subscribe(() => {
|
|
3381
3453
|
n();
|
|
3382
3454
|
}), {
|
|
3383
3455
|
_name: e.name,
|
|
@@ -3385,32 +3457,32 @@ const mt = (t, e, r) => {
|
|
|
3385
3457
|
_layerIndex: e.layerIndex,
|
|
3386
3458
|
_initShow: e.initShow,
|
|
3387
3459
|
_enable: (u) => {
|
|
3388
|
-
|
|
3460
|
+
s.next(u);
|
|
3389
3461
|
},
|
|
3390
3462
|
_disable: () => {
|
|
3391
|
-
|
|
3463
|
+
s.next(null);
|
|
3392
3464
|
},
|
|
3393
3465
|
// setParams: (partial) => {
|
|
3394
3466
|
// previousParams$.next(deepOverwrite(defaultParams$.getValue(), partial))
|
|
3395
3467
|
// },
|
|
3396
3468
|
_updateParams: (u) => {
|
|
3397
3469
|
try {
|
|
3398
|
-
const { status:
|
|
3399
|
-
if (
|
|
3400
|
-
throw new Error(
|
|
3470
|
+
const { status: c, columnName: i, expectToBe: f } = e.validator(u);
|
|
3471
|
+
if (c === "error")
|
|
3472
|
+
throw new Error(Q({
|
|
3401
3473
|
columnName: i,
|
|
3402
|
-
expectToBe:
|
|
3474
|
+
expectToBe: f,
|
|
3403
3475
|
from: `${e.name}.params$`
|
|
3404
3476
|
}));
|
|
3405
|
-
|
|
3477
|
+
c === "warning" && console.warn(X({
|
|
3406
3478
|
columnName: i,
|
|
3407
|
-
expectToBe:
|
|
3479
|
+
expectToBe: f,
|
|
3408
3480
|
from: `${e.name}.params$`
|
|
3409
3481
|
}));
|
|
3410
|
-
} catch (
|
|
3411
|
-
console.error(
|
|
3482
|
+
} catch (c) {
|
|
3483
|
+
console.error(G(c));
|
|
3412
3484
|
}
|
|
3413
|
-
const a =
|
|
3485
|
+
const a = Y(r.getValue(), u);
|
|
3414
3486
|
r.next(a);
|
|
3415
3487
|
},
|
|
3416
3488
|
_forceReplaceParams: (u) => {
|
|
@@ -3423,56 +3495,57 @@ const mt = (t, e, r) => {
|
|
|
3423
3495
|
// enableProps$.next(true)
|
|
3424
3496
|
// },
|
|
3425
3497
|
_destroy: () => {
|
|
3426
|
-
|
|
3498
|
+
s.next(null), s.complete(), r.complete();
|
|
3427
3499
|
}
|
|
3428
3500
|
};
|
|
3429
|
-
},
|
|
3501
|
+
}, tn = (t) => class {
|
|
3430
3502
|
constructor() {
|
|
3431
|
-
return
|
|
3503
|
+
return gt("svg", t);
|
|
3432
3504
|
}
|
|
3433
|
-
},
|
|
3505
|
+
}, nn = (t) => class {
|
|
3434
3506
|
constructor(r) {
|
|
3435
3507
|
return mt("canvas", t, r);
|
|
3436
3508
|
}
|
|
3437
3509
|
}, on = (t) => class {
|
|
3438
3510
|
constructor() {
|
|
3439
|
-
return
|
|
3511
|
+
return gt("canvas", t);
|
|
3440
3512
|
}
|
|
3441
3513
|
};
|
|
3442
3514
|
export {
|
|
3443
|
-
|
|
3444
|
-
|
|
3515
|
+
Qr as OrbCharts,
|
|
3516
|
+
de as aggregate,
|
|
3445
3517
|
$r as count,
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3518
|
+
ht as createCanvas,
|
|
3519
|
+
Jr as createCanvasElement,
|
|
3520
|
+
Hr as createDiv,
|
|
3521
|
+
Lr as createLayerClassName,
|
|
3522
|
+
yt as createMessagePrefix,
|
|
3523
|
+
G as createOrbChartsErrorMessage,
|
|
3452
3524
|
Mr as createPluginClassName,
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3525
|
+
Br as createSVG,
|
|
3526
|
+
Pr as createSVGGroup,
|
|
3527
|
+
he as createUnexpectedErrorMessage,
|
|
3528
|
+
Q as createValidatorErrorMessage,
|
|
3529
|
+
X as createValidatorWarningMessage,
|
|
3530
|
+
Y as deepOverwrite,
|
|
3459
3531
|
on as defineCanvasLayer,
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3532
|
+
nn as defineCanvasPlugin,
|
|
3533
|
+
tn as defineSVGLayer,
|
|
3534
|
+
Xr as defineSVGPlugin,
|
|
3535
|
+
Zr as formatCommaNumber,
|
|
3536
|
+
D as getColorByFrom,
|
|
3537
|
+
Ir as getColorByIndex,
|
|
3538
|
+
ft as isDom,
|
|
3467
3539
|
Cr as isFunction,
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3540
|
+
ee as isPlainObject,
|
|
3541
|
+
Tr as max,
|
|
3542
|
+
Ar as mean,
|
|
3471
3543
|
Sr as median,
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3544
|
+
_r as min,
|
|
3545
|
+
Or as none,
|
|
3546
|
+
kr as removeElementChildren,
|
|
3547
|
+
jr as resizeObservable,
|
|
3548
|
+
$ as resolveGroupKey,
|
|
3549
|
+
xr as sum,
|
|
3550
|
+
K as validateObject
|
|
3478
3551
|
};
|