@orbcharts/core 4.0.0 → 4.0.2
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 +560 -598
- package/dist/orbcharts-core.umd.js +3 -3
- package/package.json +1 -1
- package/src/chart/createChart.ts +14 -4
- package/src/layer/createLayer.ts +5 -3
- package/src/plugin/createPlugin.ts +21 -9
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
return
|
|
1
|
+
var Te = function(t, e) {
|
|
2
|
+
return Te = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
3
3
|
r.__proto__ = n;
|
|
4
4
|
} || function(r, n) {
|
|
5
5
|
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
|
|
6
|
-
},
|
|
6
|
+
}, Te(t, e);
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function Y(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
|
+
Te(t, e);
|
|
12
12
|
function r() {
|
|
13
13
|
this.constructor = t;
|
|
14
14
|
}
|
|
@@ -101,7 +101,7 @@ function ze(t, e) {
|
|
|
101
101
|
return { value: i[0] ? i[1] : void 0, done: !0 };
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ue(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 {
|
|
@@ -111,7 +111,7 @@ function ce(t) {
|
|
|
111
111
|
};
|
|
112
112
|
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function ce(t, e) {
|
|
115
115
|
var r = typeof Symbol == "function" && t[Symbol.iterator];
|
|
116
116
|
if (!r) return t;
|
|
117
117
|
var n = r.call(t), s, o = [], u;
|
|
@@ -128,13 +128,13 @@ function le(t, e) {
|
|
|
128
128
|
}
|
|
129
129
|
return o;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function le(t, e, r) {
|
|
132
132
|
if (r || arguments.length === 2) for (var n = 0, s = e.length, o; n < s; n++)
|
|
133
133
|
(o || !(n in e)) && (o || (o = Array.prototype.slice.call(e, 0, n)), o[n] = e[n]);
|
|
134
134
|
return t.concat(o || Array.prototype.slice.call(e));
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
return this instanceof
|
|
136
|
+
function ie(t) {
|
|
137
|
+
return this instanceof ie ? (this.v = t, this) : new ie(t);
|
|
138
138
|
}
|
|
139
139
|
function wt(t, e, r) {
|
|
140
140
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
@@ -148,21 +148,21 @@ function wt(t, e, r) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
function a(y, A) {
|
|
151
|
-
n[y] && (s[y] = function(
|
|
151
|
+
n[y] && (s[y] = function(m) {
|
|
152
152
|
return new Promise(function(d, b) {
|
|
153
|
-
o.push([y,
|
|
153
|
+
o.push([y, m, d, b]) > 1 || c(y, m);
|
|
154
154
|
});
|
|
155
155
|
}, A && (s[y] = A(s[y])));
|
|
156
156
|
}
|
|
157
157
|
function c(y, A) {
|
|
158
158
|
try {
|
|
159
159
|
i(n[y](A));
|
|
160
|
-
} catch (
|
|
161
|
-
S(o[0][3],
|
|
160
|
+
} catch (m) {
|
|
161
|
+
S(o[0][3], m);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
function i(y) {
|
|
165
|
-
y.value instanceof
|
|
165
|
+
y.value instanceof ie ? Promise.resolve(y.value.v).then(f, w) : S(o[0][2], y);
|
|
166
166
|
}
|
|
167
167
|
function f(y) {
|
|
168
168
|
c("next", y);
|
|
@@ -177,7 +177,7 @@ function wt(t, e, r) {
|
|
|
177
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 ue == "function" ? ue(t) : t[Symbol.iterator](), r = {}, n("next"), n("throw"), n("return"), r[Symbol.asyncIterator] = function() {
|
|
181
181
|
return this;
|
|
182
182
|
}, r);
|
|
183
183
|
function n(o) {
|
|
@@ -196,13 +196,13 @@ function Et(t) {
|
|
|
196
196
|
function V(t) {
|
|
197
197
|
return typeof t == "function";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Ge(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 Se = Ge(function(t) {
|
|
206
206
|
return function(r) {
|
|
207
207
|
t(this), this.message = r ? r.length + ` errors occurred during unsubscription:
|
|
208
208
|
` + r.map(function(n, s) {
|
|
@@ -217,7 +217,7 @@ function Ee(t, e) {
|
|
|
217
217
|
0 <= r && t.splice(r, 1);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
var
|
|
220
|
+
var me = function() {
|
|
221
221
|
function t(e) {
|
|
222
222
|
this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
223
223
|
}
|
|
@@ -229,12 +229,12 @@ var ve = function() {
|
|
|
229
229
|
if (u)
|
|
230
230
|
if (this._parentage = null, Array.isArray(u))
|
|
231
231
|
try {
|
|
232
|
-
for (var a =
|
|
232
|
+
for (var a = ue(u), c = a.next(); !c.done; c = a.next()) {
|
|
233
233
|
var i = c.value;
|
|
234
234
|
i.remove(this);
|
|
235
235
|
}
|
|
236
|
-
} catch (
|
|
237
|
-
e = { error:
|
|
236
|
+
} catch (m) {
|
|
237
|
+
e = { error: m };
|
|
238
238
|
} finally {
|
|
239
239
|
try {
|
|
240
240
|
c && !c.done && (r = a.return) && r.call(a);
|
|
@@ -248,23 +248,23 @@ var ve = function() {
|
|
|
248
248
|
if (V(f))
|
|
249
249
|
try {
|
|
250
250
|
f();
|
|
251
|
-
} catch (
|
|
252
|
-
o =
|
|
251
|
+
} catch (m) {
|
|
252
|
+
o = m instanceof Se ? m.errors : [m];
|
|
253
253
|
}
|
|
254
254
|
var w = this._finalizers;
|
|
255
255
|
if (w) {
|
|
256
256
|
this._finalizers = null;
|
|
257
257
|
try {
|
|
258
|
-
for (var S =
|
|
258
|
+
for (var S = ue(w), y = S.next(); !y.done; y = S.next()) {
|
|
259
259
|
var A = y.value;
|
|
260
260
|
try {
|
|
261
261
|
je(A);
|
|
262
|
-
} catch (
|
|
263
|
-
o = o ?? [],
|
|
262
|
+
} catch (m) {
|
|
263
|
+
o = o ?? [], m instanceof Se ? o = le(le([], ce(o)), ce(m.errors)) : o.push(m);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
} catch (
|
|
267
|
-
n = { error:
|
|
266
|
+
} catch (m) {
|
|
267
|
+
n = { error: m };
|
|
268
268
|
} finally {
|
|
269
269
|
try {
|
|
270
270
|
y && !y.done && (s = S.return) && s.call(S);
|
|
@@ -274,7 +274,7 @@ var ve = function() {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
if (o)
|
|
277
|
-
throw new
|
|
277
|
+
throw new Se(o);
|
|
278
278
|
}
|
|
279
279
|
}, t.prototype.add = function(e) {
|
|
280
280
|
var r;
|
|
@@ -305,9 +305,9 @@ var ve = function() {
|
|
|
305
305
|
var e = new t();
|
|
306
306
|
return e.closed = !0, e;
|
|
307
307
|
}(), t;
|
|
308
|
-
}(),
|
|
309
|
-
function
|
|
310
|
-
return t instanceof
|
|
308
|
+
}(), qe = me.EMPTY;
|
|
309
|
+
function We(t) {
|
|
310
|
+
return t instanceof me || t && "closed" in t && V(t.remove) && V(t.add) && V(t.unsubscribe);
|
|
311
311
|
}
|
|
312
312
|
function je(t) {
|
|
313
313
|
V(t) ? t() : t.unsubscribe();
|
|
@@ -318,31 +318,31 @@ var xt = {
|
|
|
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, le([t, e], ce(r)));
|
|
322
322
|
},
|
|
323
323
|
clearTimeout: function(t) {
|
|
324
324
|
return clearTimeout(t);
|
|
325
325
|
},
|
|
326
326
|
delegate: void 0
|
|
327
327
|
};
|
|
328
|
-
function
|
|
328
|
+
function Ye(t) {
|
|
329
329
|
At.setTimeout(function() {
|
|
330
330
|
throw t;
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function $e() {
|
|
334
334
|
}
|
|
335
335
|
function we(t) {
|
|
336
336
|
t();
|
|
337
337
|
}
|
|
338
|
-
var
|
|
339
|
-
|
|
338
|
+
var Ce = function(t) {
|
|
339
|
+
Y(e, t);
|
|
340
340
|
function e(r) {
|
|
341
341
|
var n = t.call(this) || this;
|
|
342
|
-
return n.isStopped = !1, r ? (n.destination = r,
|
|
342
|
+
return n.isStopped = !1, r ? (n.destination = r, We(r) && r.add(n)) : n.destination = Tt, n;
|
|
343
343
|
}
|
|
344
344
|
return e.create = function(r, n, s) {
|
|
345
|
-
return new
|
|
345
|
+
return new pe(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 Ie = function(t) {
|
|
|
366
366
|
this.unsubscribe();
|
|
367
367
|
}
|
|
368
368
|
}, e;
|
|
369
|
-
}(
|
|
369
|
+
}(me), St = function() {
|
|
370
370
|
function t(e) {
|
|
371
371
|
this.partialObserver = e;
|
|
372
372
|
}
|
|
@@ -397,8 +397,8 @@ var Ie = function(t) {
|
|
|
397
397
|
be(r);
|
|
398
398
|
}
|
|
399
399
|
}, t;
|
|
400
|
-
}(),
|
|
401
|
-
|
|
400
|
+
}(), pe = function(t) {
|
|
401
|
+
Y(e, t);
|
|
402
402
|
function e(r, n, s) {
|
|
403
403
|
var o = t.call(this) || this, u;
|
|
404
404
|
return V(r) || !r ? u = {
|
|
@@ -408,26 +408,26 @@ var Ie = function(t) {
|
|
|
408
408
|
} : u = r, o.destination = new St(u), o;
|
|
409
409
|
}
|
|
410
410
|
return e;
|
|
411
|
-
}(
|
|
411
|
+
}(Ce);
|
|
412
412
|
function be(t) {
|
|
413
|
-
|
|
413
|
+
Ye(t);
|
|
414
414
|
}
|
|
415
415
|
function _t(t) {
|
|
416
416
|
throw t;
|
|
417
417
|
}
|
|
418
418
|
var Tt = {
|
|
419
419
|
closed: !0,
|
|
420
|
-
next:
|
|
420
|
+
next: $e,
|
|
421
421
|
error: _t,
|
|
422
|
-
complete:
|
|
423
|
-
},
|
|
422
|
+
complete: $e
|
|
423
|
+
}, Ie = function() {
|
|
424
424
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
425
425
|
}();
|
|
426
|
-
function
|
|
426
|
+
function xe(t) {
|
|
427
427
|
return t;
|
|
428
428
|
}
|
|
429
429
|
function $t(t) {
|
|
430
|
-
return t.length === 0 ?
|
|
430
|
+
return t.length === 0 ? xe : t.length === 1 ? t[0] : function(r) {
|
|
431
431
|
return t.reduce(function(n, s) {
|
|
432
432
|
return s(n);
|
|
433
433
|
}, r);
|
|
@@ -441,7 +441,7 @@ 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 s = this, o =
|
|
444
|
+
var s = this, o = Ct(e) ? e : new pe(e, r, n);
|
|
445
445
|
return we(function() {
|
|
446
446
|
var u = s, a = u.operator, c = u.source;
|
|
447
447
|
o.add(a ? a.call(o, c) : c ? s._subscribe(o) : s._trySubscribe(o));
|
|
@@ -455,7 +455,7 @@ var R = function() {
|
|
|
455
455
|
}, t.prototype.forEach = function(e, r) {
|
|
456
456
|
var n = this;
|
|
457
457
|
return r = Me(r), new r(function(s, o) {
|
|
458
|
-
var u = new
|
|
458
|
+
var u = new pe({
|
|
459
459
|
next: function(a) {
|
|
460
460
|
try {
|
|
461
461
|
e(a);
|
|
@@ -471,7 +471,7 @@ var R = function() {
|
|
|
471
471
|
}, t.prototype._subscribe = function(e) {
|
|
472
472
|
var r;
|
|
473
473
|
return (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e);
|
|
474
|
-
}, t.prototype[
|
|
474
|
+
}, t.prototype[Ie] = function() {
|
|
475
475
|
return this;
|
|
476
476
|
}, t.prototype.pipe = function() {
|
|
477
477
|
for (var e = [], r = 0; r < arguments.length; r++)
|
|
@@ -500,15 +500,15 @@ function Me(t) {
|
|
|
500
500
|
function Ot(t) {
|
|
501
501
|
return t && V(t.next) && V(t.error) && V(t.complete);
|
|
502
502
|
}
|
|
503
|
-
function It(t) {
|
|
504
|
-
return t && t instanceof Ie || Ot(t) && qe(t);
|
|
505
|
-
}
|
|
506
503
|
function Ct(t) {
|
|
504
|
+
return t && t instanceof Ce || Ot(t) && We(t);
|
|
505
|
+
}
|
|
506
|
+
function It(t) {
|
|
507
507
|
return V(t == null ? void 0 : t.lift);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Z(t) {
|
|
510
510
|
return function(e) {
|
|
511
|
-
if (
|
|
511
|
+
if (It(e))
|
|
512
512
|
return e.lift(function(r) {
|
|
513
513
|
try {
|
|
514
514
|
return t(r, this);
|
|
@@ -519,11 +519,11 @@ function z(t) {
|
|
|
519
519
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function W(t, e, r, n, s) {
|
|
523
523
|
return new Bt(t, e, r, n, s);
|
|
524
524
|
}
|
|
525
525
|
var Bt = function(t) {
|
|
526
|
-
|
|
526
|
+
Y(e, t);
|
|
527
527
|
function e(r, n, s, o, u, a) {
|
|
528
528
|
var c = t.call(this, r) || this;
|
|
529
529
|
return c.onFinalize = u, c.shouldUnsubscribe = a, c._next = n ? function(i) {
|
|
@@ -557,12 +557,12 @@ var Bt = 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
|
+
}(Ce), Pt = Ge(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
|
+
Y(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;
|
|
@@ -580,7 +580,7 @@ var Bt = function(t) {
|
|
|
580
580
|
if (n._throwIfClosed(), !n.isStopped) {
|
|
581
581
|
n.currentObservers || (n.currentObservers = Array.from(n.observers));
|
|
582
582
|
try {
|
|
583
|
-
for (var u =
|
|
583
|
+
for (var u = ue(n.currentObservers), a = u.next(); !a.done; a = u.next()) {
|
|
584
584
|
var c = a.value;
|
|
585
585
|
c.next(r);
|
|
586
586
|
}
|
|
@@ -628,7 +628,7 @@ var Bt = function(t) {
|
|
|
628
628
|
return this._throwIfClosed(), this._checkFinalizedStatuses(r), this._innerSubscribe(r);
|
|
629
629
|
}, e.prototype._innerSubscribe = function(r) {
|
|
630
630
|
var n = this, s = this, o = s.hasError, u = s.isStopped, a = s.observers;
|
|
631
|
-
return o || u ?
|
|
631
|
+
return o || u ? qe : (this.currentObservers = null, a.push(r), new me(function() {
|
|
632
632
|
n.currentObservers = null, Ee(a, r);
|
|
633
633
|
}));
|
|
634
634
|
}, e.prototype._checkFinalizedStatuses = function(r) {
|
|
@@ -641,7 +641,7 @@ var Bt = function(t) {
|
|
|
641
641
|
return new Le(r, n);
|
|
642
642
|
}, e;
|
|
643
643
|
}(R), Le = function(t) {
|
|
644
|
-
|
|
644
|
+
Y(e, t);
|
|
645
645
|
function e(r, n) {
|
|
646
646
|
var s = t.call(this) || this;
|
|
647
647
|
return s.destination = r, s.source = n, s;
|
|
@@ -657,10 +657,10 @@ var Bt = function(t) {
|
|
|
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
659
|
var n, s;
|
|
660
|
-
return (s = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r)) !== null && s !== void 0 ? s :
|
|
660
|
+
return (s = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r)) !== null && s !== void 0 ? s : qe;
|
|
661
661
|
}, e;
|
|
662
662
|
}(oe), N = function(t) {
|
|
663
|
-
|
|
663
|
+
Y(e, t);
|
|
664
664
|
function e(r) {
|
|
665
665
|
var n = t.call(this) || this;
|
|
666
666
|
return n._value = r, n;
|
|
@@ -688,7 +688,7 @@ var Bt = function(t) {
|
|
|
688
688
|
},
|
|
689
689
|
delegate: void 0
|
|
690
690
|
}, kt = function(t) {
|
|
691
|
-
|
|
691
|
+
Y(e, t);
|
|
692
692
|
function e(r, n, s) {
|
|
693
693
|
r === void 0 && (r = 1 / 0), n === void 0 && (n = 1 / 0), s === void 0 && (s = Be);
|
|
694
694
|
var o = t.call(this) || this;
|
|
@@ -711,25 +711,25 @@ var Bt = function(t) {
|
|
|
711
711
|
}
|
|
712
712
|
}, e;
|
|
713
713
|
}(oe), jt = function(t) {
|
|
714
|
-
|
|
714
|
+
Y(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
|
+
}(me), 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, le([t, e], ce(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
|
+
Y(e, t);
|
|
733
733
|
function e(r, n) {
|
|
734
734
|
var s = t.call(this, r, n) || this;
|
|
735
735
|
return s.scheduler = r, s.work = n, s.pending = !1, s;
|
|
@@ -778,7 +778,7 @@ var Bt = function(t) {
|
|
|
778
778
|
return r === void 0 && (r = 0), new this.schedulerActionCtor(this, e).schedule(n, r);
|
|
779
779
|
}, t.now = Be.now, t;
|
|
780
780
|
}(), Lt = function(t) {
|
|
781
|
-
|
|
781
|
+
Y(e, t);
|
|
782
782
|
function e(r, n) {
|
|
783
783
|
n === void 0 && (n = Ke.now);
|
|
784
784
|
var s = t.call(this, r, n) || this;
|
|
@@ -802,44 +802,44 @@ var Bt = function(t) {
|
|
|
802
802
|
throw s;
|
|
803
803
|
}
|
|
804
804
|
}, e;
|
|
805
|
-
}(Ke), Vt = new Lt(Mt),
|
|
805
|
+
}(Ke), Vt = new Lt(Mt), fe = new R(function(t) {
|
|
806
806
|
return t.complete();
|
|
807
807
|
});
|
|
808
808
|
function Kt(t) {
|
|
809
809
|
return t && V(t.schedule);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function Ze(t) {
|
|
812
812
|
return t[t.length - 1];
|
|
813
813
|
}
|
|
814
814
|
function Rt(t) {
|
|
815
|
-
return V(
|
|
815
|
+
return V(Ze(t)) ? t.pop() : void 0;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
818
|
-
return Kt(
|
|
817
|
+
function Je(t) {
|
|
818
|
+
return Kt(Ze(t)) ? t.pop() : void 0;
|
|
819
819
|
}
|
|
820
|
-
var
|
|
820
|
+
var He = function(t) {
|
|
821
821
|
return t && typeof t.length == "number" && typeof t != "function";
|
|
822
822
|
};
|
|
823
|
-
function He(t) {
|
|
824
|
-
return V(t == null ? void 0 : t.then);
|
|
825
|
-
}
|
|
826
823
|
function Qe(t) {
|
|
827
|
-
return V(t
|
|
824
|
+
return V(t == null ? void 0 : t.then);
|
|
828
825
|
}
|
|
829
826
|
function Xe(t) {
|
|
830
|
-
return
|
|
827
|
+
return V(t[Ie]);
|
|
831
828
|
}
|
|
832
829
|
function et(t) {
|
|
830
|
+
return Symbol.asyncIterator && V(t == null ? void 0 : t[Symbol.asyncIterator]);
|
|
831
|
+
}
|
|
832
|
+
function tt(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
835
|
function Ft() {
|
|
836
836
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
837
837
|
}
|
|
838
|
-
var
|
|
839
|
-
function rt(t) {
|
|
840
|
-
return V(t == null ? void 0 : t[tt]);
|
|
841
|
-
}
|
|
838
|
+
var rt = Ft();
|
|
842
839
|
function nt(t) {
|
|
840
|
+
return V(t == null ? void 0 : t[rt]);
|
|
841
|
+
}
|
|
842
|
+
function st(t) {
|
|
843
843
|
return wt(this, arguments, function() {
|
|
844
844
|
var r, n, s, o;
|
|
845
845
|
return ze(this, function(u) {
|
|
@@ -849,13 +849,13 @@ function nt(t) {
|
|
|
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, ie(r.read())];
|
|
853
853
|
case 3:
|
|
854
|
-
return n = u.sent(), s = n.value, o = n.done, o ? [4,
|
|
854
|
+
return n = u.sent(), s = n.value, o = n.done, o ? [4, ie(void 0)] : [3, 5];
|
|
855
855
|
case 4:
|
|
856
856
|
return [2, u.sent()];
|
|
857
857
|
case 5:
|
|
858
|
-
return [4,
|
|
858
|
+
return [4, ie(s)];
|
|
859
859
|
case 6:
|
|
860
860
|
return [4, u.sent()];
|
|
861
861
|
case 7:
|
|
@@ -870,31 +870,31 @@ function nt(t) {
|
|
|
870
870
|
});
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function ot(t) {
|
|
874
874
|
return V(t == null ? void 0 : t.getReader);
|
|
875
875
|
}
|
|
876
876
|
function te(t) {
|
|
877
877
|
if (t instanceof R)
|
|
878
878
|
return t;
|
|
879
879
|
if (t != null) {
|
|
880
|
-
if (
|
|
880
|
+
if (Xe(t))
|
|
881
881
|
return Dt(t);
|
|
882
|
-
if (Je(t))
|
|
883
|
-
return Nt(t);
|
|
884
882
|
if (He(t))
|
|
883
|
+
return Nt(t);
|
|
884
|
+
if (Qe(t))
|
|
885
885
|
return Ut(t);
|
|
886
|
-
if (
|
|
887
|
-
return
|
|
888
|
-
if (
|
|
886
|
+
if (et(t))
|
|
887
|
+
return at(t);
|
|
888
|
+
if (nt(t))
|
|
889
889
|
return zt(t);
|
|
890
|
-
if (
|
|
890
|
+
if (ot(t))
|
|
891
891
|
return Gt(t);
|
|
892
892
|
}
|
|
893
|
-
throw
|
|
893
|
+
throw tt(t);
|
|
894
894
|
}
|
|
895
895
|
function Dt(t) {
|
|
896
896
|
return new R(function(e) {
|
|
897
|
-
var r = t[
|
|
897
|
+
var r = t[Ie]();
|
|
898
898
|
if (V(r.subscribe))
|
|
899
899
|
return r.subscribe(e);
|
|
900
900
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
@@ -913,14 +913,14 @@ function Ut(t) {
|
|
|
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, Ye);
|
|
917
917
|
});
|
|
918
918
|
}
|
|
919
919
|
function zt(t) {
|
|
920
920
|
return new R(function(e) {
|
|
921
921
|
var r, n;
|
|
922
922
|
try {
|
|
923
|
-
for (var s =
|
|
923
|
+
for (var s = ue(t), o = s.next(); !o.done; o = s.next()) {
|
|
924
924
|
var u = o.value;
|
|
925
925
|
if (e.next(u), e.closed)
|
|
926
926
|
return;
|
|
@@ -937,7 +937,7 @@ function zt(t) {
|
|
|
937
937
|
e.complete();
|
|
938
938
|
});
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function at(t) {
|
|
941
941
|
return new R(function(e) {
|
|
942
942
|
qt(t, e).catch(function(r) {
|
|
943
943
|
return e.error(r);
|
|
@@ -945,7 +945,7 @@ function ot(t) {
|
|
|
945
945
|
});
|
|
946
946
|
}
|
|
947
947
|
function Gt(t) {
|
|
948
|
-
return
|
|
948
|
+
return at(st(t));
|
|
949
949
|
}
|
|
950
950
|
function qt(t, e) {
|
|
951
951
|
var r, n, s, o;
|
|
@@ -993,9 +993,9 @@ function se(t, e, r, n, s) {
|
|
|
993
993
|
if (t.add(o), !s)
|
|
994
994
|
return o;
|
|
995
995
|
}
|
|
996
|
-
function
|
|
997
|
-
return e === void 0 && (e = 0),
|
|
998
|
-
r.subscribe(
|
|
996
|
+
function it(t, e) {
|
|
997
|
+
return e === void 0 && (e = 0), Z(function(r, n) {
|
|
998
|
+
r.subscribe(W(n, function(s) {
|
|
999
999
|
return se(n, t, function() {
|
|
1000
1000
|
return n.next(s);
|
|
1001
1001
|
}, e);
|
|
@@ -1010,18 +1010,18 @@ function at(t, e) {
|
|
|
1010
1010
|
}));
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1014
|
-
return e === void 0 && (e = 0),
|
|
1013
|
+
function ut(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
1020
|
function Wt(t, e) {
|
|
1021
|
-
return te(t).pipe(
|
|
1021
|
+
return te(t).pipe(ut(e), it(e));
|
|
1022
1022
|
}
|
|
1023
1023
|
function Yt(t, e) {
|
|
1024
|
-
return te(t).pipe(
|
|
1024
|
+
return te(t).pipe(ut(e), it(e));
|
|
1025
1025
|
}
|
|
1026
1026
|
function Zt(t, e) {
|
|
1027
1027
|
return new R(function(r) {
|
|
@@ -1035,7 +1035,7 @@ function Jt(t, e) {
|
|
|
1035
1035
|
return new R(function(r) {
|
|
1036
1036
|
var n;
|
|
1037
1037
|
return se(r, e, function() {
|
|
1038
|
-
n = t[
|
|
1038
|
+
n = t[rt](), se(r, e, function() {
|
|
1039
1039
|
var s, o, u;
|
|
1040
1040
|
try {
|
|
1041
1041
|
s = n.next(), o = s.value, u = s.done;
|
|
@@ -1050,7 +1050,7 @@ function Jt(t, e) {
|
|
|
1050
1050
|
};
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function ct(t, e) {
|
|
1054
1054
|
if (!t)
|
|
1055
1055
|
throw new Error("Iterable cannot be null");
|
|
1056
1056
|
return new R(function(r) {
|
|
@@ -1065,24 +1065,24 @@ function ut(t, e) {
|
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
function Ht(t, e) {
|
|
1068
|
-
return
|
|
1068
|
+
return ct(st(t), e);
|
|
1069
1069
|
}
|
|
1070
1070
|
function Qt(t, e) {
|
|
1071
1071
|
if (t != null) {
|
|
1072
|
-
if (
|
|
1072
|
+
if (Xe(t))
|
|
1073
1073
|
return Wt(t, e);
|
|
1074
|
-
if (Je(t))
|
|
1075
|
-
return Zt(t, e);
|
|
1076
1074
|
if (He(t))
|
|
1075
|
+
return Zt(t, e);
|
|
1076
|
+
if (Qe(t))
|
|
1077
1077
|
return Yt(t, e);
|
|
1078
|
-
if (
|
|
1079
|
-
return
|
|
1080
|
-
if (
|
|
1078
|
+
if (et(t))
|
|
1079
|
+
return ct(t, e);
|
|
1080
|
+
if (nt(t))
|
|
1081
1081
|
return Jt(t, e);
|
|
1082
|
-
if (
|
|
1082
|
+
if (ot(t))
|
|
1083
1083
|
return Ht(t, e);
|
|
1084
1084
|
}
|
|
1085
|
-
throw
|
|
1085
|
+
throw tt(t);
|
|
1086
1086
|
}
|
|
1087
1087
|
function Pe(t, e) {
|
|
1088
1088
|
return e ? Qt(t, e) : te(t);
|
|
@@ -1090,28 +1090,23 @@ function Pe(t, e) {
|
|
|
1090
1090
|
function Xt() {
|
|
1091
1091
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1092
1092
|
t[e] = arguments[e];
|
|
1093
|
-
var r =
|
|
1093
|
+
var r = Je(t);
|
|
1094
1094
|
return Pe(t, r);
|
|
1095
1095
|
}
|
|
1096
|
-
|
|
1097
|
-
return function() {
|
|
1098
|
-
t(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
1099
|
-
};
|
|
1100
|
-
});
|
|
1101
|
-
function q(t, e) {
|
|
1102
|
-
return z(function(r, n) {
|
|
1096
|
+
function z(t, e) {
|
|
1097
|
+
return Z(function(r, n) {
|
|
1103
1098
|
var s = 0;
|
|
1104
|
-
r.subscribe(
|
|
1099
|
+
r.subscribe(W(n, function(o) {
|
|
1105
1100
|
n.next(t.call(e, o, s++));
|
|
1106
1101
|
}));
|
|
1107
1102
|
});
|
|
1108
1103
|
}
|
|
1109
1104
|
var er = Array.isArray;
|
|
1110
1105
|
function tr(t, e) {
|
|
1111
|
-
return er(e) ? t.apply(void 0,
|
|
1106
|
+
return er(e) ? t.apply(void 0, le([], ce(e))) : t(e);
|
|
1112
1107
|
}
|
|
1113
1108
|
function rr(t) {
|
|
1114
|
-
return
|
|
1109
|
+
return z(function(e) {
|
|
1115
1110
|
return tr(t, e);
|
|
1116
1111
|
});
|
|
1117
1112
|
}
|
|
@@ -1144,21 +1139,21 @@ function cr(t, e) {
|
|
|
1144
1139
|
function H() {
|
|
1145
1140
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1146
1141
|
t[e] = arguments[e];
|
|
1147
|
-
var r =
|
|
1142
|
+
var r = Je(t), n = Rt(t), s = ir(t), o = s.args, u = s.keys;
|
|
1148
1143
|
if (o.length === 0)
|
|
1149
1144
|
return Pe([], r);
|
|
1150
1145
|
var a = new R(lr(o, r, u ? function(c) {
|
|
1151
1146
|
return cr(u, c);
|
|
1152
|
-
} :
|
|
1147
|
+
} : xe));
|
|
1153
1148
|
return n ? a.pipe(rr(n)) : a;
|
|
1154
1149
|
}
|
|
1155
1150
|
function lr(t, e, r) {
|
|
1156
|
-
return r === void 0 && (r =
|
|
1151
|
+
return r === void 0 && (r = xe), function(n) {
|
|
1157
1152
|
Re(e, function() {
|
|
1158
1153
|
for (var s = t.length, o = new Array(s), u = s, a = s, c = function(f) {
|
|
1159
1154
|
Re(e, function() {
|
|
1160
1155
|
var w = Pe(t[f], e), S = !1;
|
|
1161
|
-
w.subscribe(
|
|
1156
|
+
w.subscribe(W(n, function(y) {
|
|
1162
1157
|
o[f] = y, S || (S = !0, a--), a || n.next(r(o.slice()));
|
|
1163
1158
|
}, function() {
|
|
1164
1159
|
--u || n.complete();
|
|
@@ -1182,24 +1177,24 @@ function hr(t, e, r) {
|
|
|
1182
1177
|
return t() ? e : r;
|
|
1183
1178
|
});
|
|
1184
1179
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return
|
|
1180
|
+
function de(t, e) {
|
|
1181
|
+
return Z(function(r, n) {
|
|
1187
1182
|
var s = 0;
|
|
1188
|
-
r.subscribe(
|
|
1183
|
+
r.subscribe(W(n, function(o) {
|
|
1189
1184
|
return t.call(e, o, s++) && n.next(o);
|
|
1190
1185
|
}));
|
|
1191
1186
|
});
|
|
1192
1187
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return
|
|
1188
|
+
function ae(t) {
|
|
1189
|
+
return Z(function(e, r) {
|
|
1195
1190
|
var n = null, s = !1, o;
|
|
1196
|
-
n = e.subscribe(
|
|
1197
|
-
o = te(t(u,
|
|
1191
|
+
n = e.subscribe(W(r, void 0, void 0, function(u) {
|
|
1192
|
+
o = te(t(u, ae(t)(e))), n ? (n.unsubscribe(), n = null, o.subscribe(r)) : s = !0;
|
|
1198
1193
|
})), s && (n.unsubscribe(), n = null, o.subscribe(r));
|
|
1199
1194
|
});
|
|
1200
1195
|
}
|
|
1201
|
-
function
|
|
1202
|
-
return e === void 0 && (e = Vt),
|
|
1196
|
+
function G(t, e) {
|
|
1197
|
+
return e === void 0 && (e = Vt), Z(function(r, n) {
|
|
1203
1198
|
var s = null, o = null, u = null, a = function() {
|
|
1204
1199
|
if (s) {
|
|
1205
1200
|
s.unsubscribe(), s = null;
|
|
@@ -1215,7 +1210,7 @@ function W(t, e) {
|
|
|
1215
1210
|
}
|
|
1216
1211
|
a();
|
|
1217
1212
|
}
|
|
1218
|
-
r.subscribe(
|
|
1213
|
+
r.subscribe(W(n, function(i) {
|
|
1219
1214
|
o = i, u = e.now(), s || (s = e.schedule(c, t), n.add(s));
|
|
1220
1215
|
}, function() {
|
|
1221
1216
|
a(), n.complete();
|
|
@@ -1224,93 +1219,52 @@ function W(t, e) {
|
|
|
1224
1219
|
}));
|
|
1225
1220
|
});
|
|
1226
1221
|
}
|
|
1227
|
-
function yr(t) {
|
|
1228
|
-
return
|
|
1229
|
-
var n = !1;
|
|
1230
|
-
e.subscribe(U(r, function(s) {
|
|
1231
|
-
n = !0, r.next(s);
|
|
1232
|
-
}, function() {
|
|
1233
|
-
n || r.next(t), r.complete();
|
|
1234
|
-
}));
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
function pr(t) {
|
|
1238
|
-
return t <= 0 ? function() {
|
|
1239
|
-
return ae;
|
|
1240
|
-
} : z(function(e, r) {
|
|
1241
|
-
var n = 0;
|
|
1242
|
-
e.subscribe(U(r, function(s) {
|
|
1243
|
-
++n <= t && (r.next(s), t <= n && r.complete());
|
|
1244
|
-
}));
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
function dr(t, e) {
|
|
1248
|
-
return e === void 0 && (e = me), t = t ?? vr, z(function(r, n) {
|
|
1222
|
+
function yr(t, e) {
|
|
1223
|
+
return e === void 0 && (e = xe), t = t ?? pr, Z(function(r, n) {
|
|
1249
1224
|
var s, o = !0;
|
|
1250
|
-
r.subscribe(
|
|
1225
|
+
r.subscribe(W(n, function(u) {
|
|
1251
1226
|
var a = e(u);
|
|
1252
1227
|
(o || !t(s, a)) && (o = !1, s = a, n.next(u));
|
|
1253
1228
|
}));
|
|
1254
1229
|
});
|
|
1255
1230
|
}
|
|
1256
|
-
function
|
|
1231
|
+
function pr(t, e) {
|
|
1257
1232
|
return t === e;
|
|
1258
1233
|
}
|
|
1259
|
-
function mr(t) {
|
|
1260
|
-
return t === void 0 && (t = gr), z(function(e, r) {
|
|
1261
|
-
var n = !1;
|
|
1262
|
-
e.subscribe(U(r, function(s) {
|
|
1263
|
-
n = !0, r.next(s);
|
|
1264
|
-
}, function() {
|
|
1265
|
-
return n ? r.complete() : r.error(t());
|
|
1266
|
-
}));
|
|
1267
|
-
});
|
|
1268
|
-
}
|
|
1269
|
-
function gr() {
|
|
1270
|
-
return new ct();
|
|
1271
|
-
}
|
|
1272
|
-
function br(t, e) {
|
|
1273
|
-
var r = arguments.length >= 2;
|
|
1274
|
-
return function(n) {
|
|
1275
|
-
return n.pipe(me, pr(1), r ? yr(e) : mr(function() {
|
|
1276
|
-
return new ct();
|
|
1277
|
-
}));
|
|
1278
|
-
};
|
|
1279
|
-
}
|
|
1280
1234
|
function lt(t) {
|
|
1281
1235
|
t === void 0 && (t = {});
|
|
1282
1236
|
var e = t.connector, r = e === void 0 ? function() {
|
|
1283
1237
|
return new oe();
|
|
1284
1238
|
} : 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
1239
|
return function(i) {
|
|
1286
|
-
var f, w, S, y = 0, A = !1,
|
|
1240
|
+
var f, w, S, y = 0, A = !1, m = !1, d = function() {
|
|
1287
1241
|
w == null || w.unsubscribe(), w = void 0;
|
|
1288
1242
|
}, b = function() {
|
|
1289
|
-
d(), f = S = void 0, A =
|
|
1243
|
+
d(), f = S = void 0, A = m = !1;
|
|
1290
1244
|
}, O = function() {
|
|
1291
|
-
var
|
|
1292
|
-
b(),
|
|
1245
|
+
var C = f;
|
|
1246
|
+
b(), C == null || C.unsubscribe();
|
|
1293
1247
|
};
|
|
1294
|
-
return
|
|
1295
|
-
y++, !
|
|
1248
|
+
return Z(function(C, h) {
|
|
1249
|
+
y++, !m && !A && d();
|
|
1296
1250
|
var p = S = S ?? r();
|
|
1297
1251
|
h.add(function() {
|
|
1298
|
-
y--, y === 0 && !
|
|
1299
|
-
}), p.subscribe(h), !f && y > 0 && (f = new
|
|
1252
|
+
y--, y === 0 && !m && !A && (w = _e(O, c));
|
|
1253
|
+
}), p.subscribe(h), !f && y > 0 && (f = new pe({
|
|
1300
1254
|
next: function(E) {
|
|
1301
1255
|
return p.next(E);
|
|
1302
1256
|
},
|
|
1303
1257
|
error: function(E) {
|
|
1304
|
-
|
|
1258
|
+
m = !0, d(), w = _e(b, s, E), p.error(E);
|
|
1305
1259
|
},
|
|
1306
1260
|
complete: function() {
|
|
1307
|
-
A = !0, d(), w =
|
|
1261
|
+
A = !0, d(), w = _e(b, u), p.complete();
|
|
1308
1262
|
}
|
|
1309
|
-
}), te(
|
|
1263
|
+
}), te(C).subscribe(f));
|
|
1310
1264
|
})(i);
|
|
1311
1265
|
};
|
|
1312
1266
|
}
|
|
1313
|
-
function
|
|
1267
|
+
function _e(t, e) {
|
|
1314
1268
|
for (var r = [], n = 2; n < arguments.length; n++)
|
|
1315
1269
|
r[n - 2] = arguments[n];
|
|
1316
1270
|
if (e === !0) {
|
|
@@ -1318,12 +1272,12 @@ function Se(t, e) {
|
|
|
1318
1272
|
return;
|
|
1319
1273
|
}
|
|
1320
1274
|
if (e !== !1) {
|
|
1321
|
-
var s = new
|
|
1275
|
+
var s = new pe({
|
|
1322
1276
|
next: function() {
|
|
1323
1277
|
s.unsubscribe(), t();
|
|
1324
1278
|
}
|
|
1325
1279
|
});
|
|
1326
|
-
return te(e.apply(void 0,
|
|
1280
|
+
return te(e.apply(void 0, le([], ce(r)))).subscribe(s);
|
|
1327
1281
|
}
|
|
1328
1282
|
}
|
|
1329
1283
|
function ne(t, e, r) {
|
|
@@ -1337,15 +1291,15 @@ function ne(t, e, r) {
|
|
|
1337
1291
|
resetOnRefCountZero: s
|
|
1338
1292
|
});
|
|
1339
1293
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return
|
|
1294
|
+
function dr(t, e) {
|
|
1295
|
+
return Z(function(r, n) {
|
|
1342
1296
|
var s = null, o = 0, u = !1, a = function() {
|
|
1343
1297
|
return u && !s && n.complete();
|
|
1344
1298
|
};
|
|
1345
|
-
r.subscribe(
|
|
1299
|
+
r.subscribe(W(n, function(c) {
|
|
1346
1300
|
s == null || s.unsubscribe();
|
|
1347
1301
|
var i = 0, f = o++;
|
|
1348
|
-
te(t(c, f)).subscribe(s =
|
|
1302
|
+
te(t(c, f)).subscribe(s = W(n, function(w) {
|
|
1349
1303
|
return n.next(e ? e(c, w, f, i++) : w);
|
|
1350
1304
|
}, function() {
|
|
1351
1305
|
s = null, a();
|
|
@@ -1355,63 +1309,63 @@ function wr(t, e) {
|
|
|
1355
1309
|
}));
|
|
1356
1310
|
});
|
|
1357
1311
|
}
|
|
1358
|
-
function
|
|
1359
|
-
return
|
|
1360
|
-
te(t).subscribe(
|
|
1312
|
+
function he(t) {
|
|
1313
|
+
return Z(function(e, r) {
|
|
1314
|
+
te(t).subscribe(W(r, function() {
|
|
1361
1315
|
return r.complete();
|
|
1362
|
-
},
|
|
1316
|
+
}, $e)), !r.closed && e.subscribe(r);
|
|
1363
1317
|
});
|
|
1364
1318
|
}
|
|
1365
|
-
function
|
|
1319
|
+
function vr(t) {
|
|
1366
1320
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1367
1321
|
return e.length === 0 ? null : e.reduce((r, n) => r + n, 0);
|
|
1368
1322
|
}
|
|
1369
|
-
function
|
|
1323
|
+
function mr(t) {
|
|
1370
1324
|
const e = t.filter((n) => n !== null && !isNaN(n));
|
|
1371
1325
|
return e.length === 0 ? null : e.reduce((n, s) => n + s, 0) / e.length;
|
|
1372
1326
|
}
|
|
1373
|
-
function
|
|
1327
|
+
function gr(t) {
|
|
1374
1328
|
const e = t.filter((s) => s !== null && !isNaN(s));
|
|
1375
1329
|
if (e.length === 0) return null;
|
|
1376
1330
|
const r = [...e].sort((s, o) => s - o), n = Math.floor(r.length / 2);
|
|
1377
1331
|
return r.length % 2 === 0 ? (r[n - 1] + r[n]) / 2 : r[n];
|
|
1378
1332
|
}
|
|
1379
|
-
function
|
|
1333
|
+
function br(t) {
|
|
1380
1334
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1381
1335
|
return e.length === 0 ? null : Math.min(...e);
|
|
1382
1336
|
}
|
|
1383
|
-
function
|
|
1337
|
+
function wr(t) {
|
|
1384
1338
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1385
1339
|
return e.length === 0 ? null : Math.max(...e);
|
|
1386
1340
|
}
|
|
1387
|
-
function
|
|
1341
|
+
function Er(t) {
|
|
1388
1342
|
return t.filter((e) => e !== null && !isNaN(e)).length;
|
|
1389
1343
|
}
|
|
1390
|
-
function
|
|
1344
|
+
function xr(t) {
|
|
1391
1345
|
const e = t.filter((r) => r !== null && !isNaN(r));
|
|
1392
1346
|
return e.length > 0 ? e[0] : null;
|
|
1393
1347
|
}
|
|
1394
|
-
function
|
|
1348
|
+
function ve(t, e) {
|
|
1395
1349
|
switch (e) {
|
|
1396
1350
|
case "sum":
|
|
1397
|
-
return
|
|
1351
|
+
return vr(t);
|
|
1398
1352
|
case "mean":
|
|
1399
|
-
return
|
|
1353
|
+
return mr(t);
|
|
1400
1354
|
case "median":
|
|
1401
|
-
return
|
|
1355
|
+
return gr(t);
|
|
1402
1356
|
case "min":
|
|
1403
|
-
return
|
|
1357
|
+
return br(t);
|
|
1404
1358
|
case "max":
|
|
1405
|
-
return
|
|
1359
|
+
return wr(t);
|
|
1406
1360
|
case "count":
|
|
1407
|
-
return
|
|
1361
|
+
return Er(t);
|
|
1408
1362
|
case "none":
|
|
1409
|
-
return
|
|
1363
|
+
return xr(t);
|
|
1410
1364
|
default:
|
|
1411
1365
|
throw new Error(`Unknown aggregate type: ${e}`);
|
|
1412
1366
|
}
|
|
1413
1367
|
}
|
|
1414
|
-
function
|
|
1368
|
+
function Ar(t, e) {
|
|
1415
1369
|
let r;
|
|
1416
1370
|
e.colorScheme === "auto" ? r = "light" : r = e.colorScheme;
|
|
1417
1371
|
const n = e.colors[r].data, s = t % n.length;
|
|
@@ -1435,18 +1389,18 @@ function D(t, e, r) {
|
|
|
1435
1389
|
default:
|
|
1436
1390
|
n = 0;
|
|
1437
1391
|
}
|
|
1438
|
-
return
|
|
1392
|
+
return Ar(n, r);
|
|
1439
1393
|
}
|
|
1440
1394
|
function ee(t) {
|
|
1441
1395
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
1442
1396
|
}
|
|
1443
|
-
function
|
|
1397
|
+
function Sr(t) {
|
|
1444
1398
|
return Object.prototype.toString.call(t) === "[object Function]";
|
|
1445
1399
|
}
|
|
1446
1400
|
function ft(t) {
|
|
1447
1401
|
return !!(t && t.nodeType);
|
|
1448
1402
|
}
|
|
1449
|
-
function
|
|
1403
|
+
function q(t, e) {
|
|
1450
1404
|
if (ee(e) === !1 || ee(t) === !1)
|
|
1451
1405
|
return Object.assign({}, t);
|
|
1452
1406
|
const r = (n, s) => {
|
|
@@ -1461,7 +1415,7 @@ function Y(t, e) {
|
|
|
1461
1415
|
};
|
|
1462
1416
|
return r(t, e);
|
|
1463
1417
|
}
|
|
1464
|
-
function
|
|
1418
|
+
function Ur(t = 0) {
|
|
1465
1419
|
try {
|
|
1466
1420
|
let e = t.toString().split(".");
|
|
1467
1421
|
return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), e.join(".");
|
|
@@ -1469,15 +1423,15 @@ function Zr(t = 0) {
|
|
|
1469
1423
|
console.error(e);
|
|
1470
1424
|
}
|
|
1471
1425
|
}
|
|
1472
|
-
function
|
|
1426
|
+
function _r(t) {
|
|
1473
1427
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1474
1428
|
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
1429
|
}
|
|
1476
|
-
function
|
|
1430
|
+
function zr(t) {
|
|
1477
1431
|
const e = document.createElement("canvas");
|
|
1478
1432
|
return e.style.position = "absolute", t && e.classList.add(t), e;
|
|
1479
1433
|
}
|
|
1480
|
-
function
|
|
1434
|
+
function Tr(t) {
|
|
1481
1435
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1482
1436
|
return t && e.classList.add(t), e;
|
|
1483
1437
|
}
|
|
@@ -1485,11 +1439,11 @@ function ht(t) {
|
|
|
1485
1439
|
const e = document.createElement("canvas");
|
|
1486
1440
|
return t && e.classList.add(t), e;
|
|
1487
1441
|
}
|
|
1488
|
-
function
|
|
1442
|
+
function Gr(t) {
|
|
1489
1443
|
const e = document.createElement("div");
|
|
1490
1444
|
return t && e.classList.add(t), e;
|
|
1491
1445
|
}
|
|
1492
|
-
function
|
|
1446
|
+
function $r(t) {
|
|
1493
1447
|
if (ft(t))
|
|
1494
1448
|
for (; t.firstChild; )
|
|
1495
1449
|
t.removeChild(t.firstChild);
|
|
@@ -1500,10 +1454,10 @@ function $(t, e, r = "") {
|
|
|
1500
1454
|
function yt(t) {
|
|
1501
1455
|
return `[OrbCharts ${t}]:`;
|
|
1502
1456
|
}
|
|
1503
|
-
function
|
|
1457
|
+
function U(t) {
|
|
1504
1458
|
return `${yt("error")} ${t.message}`;
|
|
1505
1459
|
}
|
|
1506
|
-
function
|
|
1460
|
+
function ye({ from: t, systemMessage: e }) {
|
|
1507
1461
|
return `unexpected error from '${t}':
|
|
1508
1462
|
${e}`;
|
|
1509
1463
|
}
|
|
@@ -1517,7 +1471,7 @@ function X({ columnName: t, expectToBe: e, from: r }) {
|
|
|
1517
1471
|
|
|
1518
1472
|
----> find in '${r}'`;
|
|
1519
1473
|
}
|
|
1520
|
-
function
|
|
1474
|
+
function Or(t) {
|
|
1521
1475
|
return new R((e) => {
|
|
1522
1476
|
const r = new ResizeObserver((n) => {
|
|
1523
1477
|
const s = n[0];
|
|
@@ -1528,13 +1482,13 @@ function jr(t) {
|
|
|
1528
1482
|
};
|
|
1529
1483
|
});
|
|
1530
1484
|
}
|
|
1531
|
-
function
|
|
1485
|
+
function Cr(t) {
|
|
1532
1486
|
return `orbcharts-${t}`;
|
|
1533
1487
|
}
|
|
1534
|
-
function
|
|
1535
|
-
return `${
|
|
1488
|
+
function Ir(t, e) {
|
|
1489
|
+
return `${Cr(t)}-${e}`;
|
|
1536
1490
|
}
|
|
1537
|
-
function
|
|
1491
|
+
function Br(t, e) {
|
|
1538
1492
|
const r = {
|
|
1539
1493
|
string: (o) => typeof o == "string",
|
|
1540
1494
|
number: (o) => typeof o == "number",
|
|
@@ -1544,7 +1498,7 @@ function Vr(t, e) {
|
|
|
1544
1498
|
"object[]": (o) => Array.isArray(o) && o.every((u) => ee(u)),
|
|
1545
1499
|
"string[]": (o) => Array.isArray(o) && o.every((u) => typeof u == "string"),
|
|
1546
1500
|
"number[]": (o) => Array.isArray(o) && o.every((u) => typeof u == "number"),
|
|
1547
|
-
Function: (o) =>
|
|
1501
|
+
Function: (o) => Sr(o),
|
|
1548
1502
|
null: (o) => o === null,
|
|
1549
1503
|
undefined: (o) => o === void 0
|
|
1550
1504
|
}, n = {
|
|
@@ -1572,7 +1526,7 @@ function Vr(t, e) {
|
|
|
1572
1526
|
});
|
|
1573
1527
|
}
|
|
1574
1528
|
function K(t, e) {
|
|
1575
|
-
const r =
|
|
1529
|
+
const r = Br(t, e);
|
|
1576
1530
|
if (r) {
|
|
1577
1531
|
const n = e[r], s = n.toBeTypes ? n.toBeTypes.join(" | ") : n.toBe ? n.toBe : n.toBeOption ? n.toBeOption : "";
|
|
1578
1532
|
return {
|
|
@@ -1724,7 +1678,7 @@ const Fe = {
|
|
|
1724
1678
|
}
|
|
1725
1679
|
},
|
|
1726
1680
|
fontSize: "0.875rem"
|
|
1727
|
-
},
|
|
1681
|
+
}, Pr = (t, e, r) => {
|
|
1728
1682
|
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
1729
1683
|
s ? t.forEach((a, c) => {
|
|
1730
1684
|
a.forEach((i) => {
|
|
@@ -1753,83 +1707,83 @@ const Fe = {
|
|
|
1753
1707
|
const u = [];
|
|
1754
1708
|
return o.forEach((a, c) => {
|
|
1755
1709
|
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1756
|
-
i.forEach((
|
|
1757
|
-
const d = $(
|
|
1758
|
-
f.has(d) || f.set(d, []), f.get(d).push(
|
|
1710
|
+
i.forEach((m) => {
|
|
1711
|
+
const d = $(m, e.series, "");
|
|
1712
|
+
f.has(d) || f.set(d, []), f.get(d).push(m);
|
|
1759
1713
|
});
|
|
1760
1714
|
let w = Array.from(f.keys());
|
|
1761
1715
|
if (Array.isArray(e.series.sort))
|
|
1762
|
-
w = e.series.sort.filter((
|
|
1716
|
+
w = e.series.sort.filter((m) => f.has(m)).concat(w.filter((m) => !e.series.sort.includes(m)));
|
|
1763
1717
|
else if (e.series.sort === "original") {
|
|
1764
|
-
const
|
|
1718
|
+
const m = [];
|
|
1765
1719
|
i.forEach((d) => {
|
|
1766
1720
|
const b = $(d, e.series, "");
|
|
1767
|
-
|
|
1768
|
-
}), w =
|
|
1769
|
-
} else e.series.sort === "alphabetical" && w.sort((
|
|
1721
|
+
m.includes(b) || m.push(b);
|
|
1722
|
+
}), w = m;
|
|
1723
|
+
} else e.series.sort === "alphabetical" && w.sort((m, d) => m.localeCompare(d, void 0, { numeric: !0 }));
|
|
1770
1724
|
const S = [];
|
|
1771
1725
|
if (e.category.sort === "original")
|
|
1772
|
-
i.forEach((
|
|
1773
|
-
const d = $(
|
|
1726
|
+
i.forEach((m) => {
|
|
1727
|
+
const d = $(m, e.category, "");
|
|
1774
1728
|
S.includes(d) || S.push(d);
|
|
1775
1729
|
});
|
|
1776
1730
|
else if (e.category.sort === "alphabetical") {
|
|
1777
|
-
const
|
|
1731
|
+
const m = /* @__PURE__ */ new Set();
|
|
1778
1732
|
i.forEach((d) => {
|
|
1779
|
-
|
|
1780
|
-
}), S.push(...Array.from(
|
|
1733
|
+
m.add($(d, e.category, ""));
|
|
1734
|
+
}), S.push(...Array.from(m).sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 })));
|
|
1781
1735
|
} else if (Array.isArray(e.category.sort)) {
|
|
1782
|
-
const
|
|
1736
|
+
const m = [];
|
|
1783
1737
|
i.forEach((b) => {
|
|
1784
1738
|
const O = $(b, e.category, "");
|
|
1785
|
-
|
|
1739
|
+
m.includes(O) || m.push(O);
|
|
1786
1740
|
});
|
|
1787
1741
|
const d = e.category.sort;
|
|
1788
1742
|
S.push(
|
|
1789
|
-
...d.filter((b) =>
|
|
1790
|
-
...
|
|
1743
|
+
...d.filter((b) => m.includes(b)),
|
|
1744
|
+
...m.filter((b) => !d.includes(b))
|
|
1791
1745
|
);
|
|
1792
1746
|
}
|
|
1793
1747
|
const y = /* @__PURE__ */ new Map();
|
|
1794
|
-
S.forEach((
|
|
1795
|
-
y.set(
|
|
1748
|
+
S.forEach((m, d) => {
|
|
1749
|
+
y.set(m, d);
|
|
1796
1750
|
});
|
|
1797
1751
|
const A = [];
|
|
1798
|
-
w.forEach((
|
|
1799
|
-
const b = f.get(
|
|
1752
|
+
w.forEach((m, d) => {
|
|
1753
|
+
const b = f.get(m), O = /* @__PURE__ */ new Map();
|
|
1800
1754
|
b.forEach((p) => {
|
|
1801
1755
|
const E = $(p, e.category, "");
|
|
1802
1756
|
O.has(E) || O.set(E, []), O.get(E).push(p);
|
|
1803
1757
|
});
|
|
1804
|
-
const
|
|
1758
|
+
const C = S.filter((p) => O.has(p)), h = [];
|
|
1805
1759
|
e.category.sort === "original" && e.value.aggregate === "none" ? (b.forEach((p, E) => {
|
|
1806
|
-
const k = $(p, e.category, ""),
|
|
1760
|
+
const k = $(p, e.category, ""), I = y.get(k), l = p[e.value.from];
|
|
1807
1761
|
h.push({
|
|
1808
|
-
id: p.id || `${a}-${
|
|
1809
|
-
index:
|
|
1762
|
+
id: p.id || `${a}-${m}-${k}-${E}`,
|
|
1763
|
+
index: I,
|
|
1810
1764
|
// Series 模式下 index 對應 categoryIndex
|
|
1811
1765
|
modelType: "series",
|
|
1812
1766
|
name: p.name || "",
|
|
1813
1767
|
data: p.data,
|
|
1814
1768
|
value: typeof l == "number" ? l : null,
|
|
1815
1769
|
color: D(e.color.by, {
|
|
1816
|
-
index:
|
|
1770
|
+
index: I,
|
|
1817
1771
|
seriesIndex: d,
|
|
1818
|
-
categoryIndex:
|
|
1772
|
+
categoryIndex: I,
|
|
1819
1773
|
datasetIndex: c
|
|
1820
1774
|
}, r),
|
|
1821
|
-
series:
|
|
1775
|
+
series: m,
|
|
1822
1776
|
seriesIndex: d,
|
|
1823
1777
|
category: k,
|
|
1824
|
-
categoryIndex:
|
|
1778
|
+
categoryIndex: I
|
|
1825
1779
|
});
|
|
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)) :
|
|
1780
|
+
}), 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)) : C.forEach((p) => {
|
|
1827
1781
|
const E = y.get(p), k = O.get(p);
|
|
1828
1782
|
if (e.value.aggregate === "none") {
|
|
1829
|
-
let
|
|
1783
|
+
let I = k.map((l, g) => {
|
|
1830
1784
|
const T = l[e.value.from];
|
|
1831
1785
|
return {
|
|
1832
|
-
id: l.id || `${a}-${
|
|
1786
|
+
id: l.id || `${a}-${m}-${p}-${g}`,
|
|
1833
1787
|
index: E,
|
|
1834
1788
|
// Series 模式下 index 對應 categoryIndex
|
|
1835
1789
|
modelType: "series",
|
|
@@ -1842,26 +1796,26 @@ const Fe = {
|
|
|
1842
1796
|
categoryIndex: E,
|
|
1843
1797
|
datasetIndex: c
|
|
1844
1798
|
}, r),
|
|
1845
|
-
series:
|
|
1799
|
+
series: m,
|
|
1846
1800
|
seriesIndex: d,
|
|
1847
1801
|
category: p,
|
|
1848
1802
|
categoryIndex: E
|
|
1849
1803
|
};
|
|
1850
1804
|
});
|
|
1851
|
-
e.value.sort === "asc" ?
|
|
1805
|
+
e.value.sort === "asc" ? I.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : l.value - g.value) : e.value.sort === "desc" && I.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : g.value - l.value), h.push(...I);
|
|
1852
1806
|
} else {
|
|
1853
|
-
const
|
|
1807
|
+
const I = k.map((B) => {
|
|
1854
1808
|
if (e.value.aggregate === "count")
|
|
1855
1809
|
return 1;
|
|
1856
|
-
const
|
|
1857
|
-
return typeof
|
|
1858
|
-
}), l =
|
|
1859
|
-
id:
|
|
1810
|
+
const v = B[e.value.from];
|
|
1811
|
+
return typeof v == "number" ? v : null;
|
|
1812
|
+
}), l = ve(I, e.value.aggregate), g = k[0], T = {
|
|
1813
|
+
id: g.id || `${a}-${m}-${p}-aggregated`,
|
|
1860
1814
|
index: E,
|
|
1861
1815
|
// Series 模式下 index 對應 categoryIndex
|
|
1862
1816
|
modelType: "series",
|
|
1863
|
-
name:
|
|
1864
|
-
data:
|
|
1817
|
+
name: g.name || p,
|
|
1818
|
+
data: g.data,
|
|
1865
1819
|
value: l,
|
|
1866
1820
|
color: D(e.color.by, {
|
|
1867
1821
|
index: E,
|
|
@@ -1869,7 +1823,7 @@ const Fe = {
|
|
|
1869
1823
|
categoryIndex: E,
|
|
1870
1824
|
datasetIndex: c
|
|
1871
1825
|
}, r),
|
|
1872
|
-
series:
|
|
1826
|
+
series: m,
|
|
1873
1827
|
seriesIndex: d,
|
|
1874
1828
|
category: p,
|
|
1875
1829
|
categoryIndex: E
|
|
@@ -1879,7 +1833,7 @@ const Fe = {
|
|
|
1879
1833
|
}), A.push(h);
|
|
1880
1834
|
}), u.push(A);
|
|
1881
1835
|
}), u;
|
|
1882
|
-
},
|
|
1836
|
+
}, kr = (t, e, r) => {
|
|
1883
1837
|
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
1884
1838
|
s ? t.forEach((a, c) => {
|
|
1885
1839
|
a.forEach((i) => {
|
|
@@ -1930,16 +1884,16 @@ const Fe = {
|
|
|
1930
1884
|
const y = new Set(S);
|
|
1931
1885
|
let A = Array.from(y);
|
|
1932
1886
|
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
|
|
1887
|
+
const m = [];
|
|
1934
1888
|
w.forEach((d, b) => {
|
|
1935
|
-
const O = f.get(d),
|
|
1889
|
+
const O = f.get(d), C = /* @__PURE__ */ new Map();
|
|
1936
1890
|
O.forEach((p) => {
|
|
1937
1891
|
const E = $(p, e.category, "");
|
|
1938
|
-
|
|
1892
|
+
C.has(E) || C.set(E, []), C.get(E).push(p);
|
|
1939
1893
|
});
|
|
1940
1894
|
const h = [];
|
|
1941
1895
|
A.forEach((p, E) => {
|
|
1942
|
-
const k =
|
|
1896
|
+
const k = C.get(p);
|
|
1943
1897
|
if (!k)
|
|
1944
1898
|
h.push({
|
|
1945
1899
|
id: `${a}-${d}-${p}-null`,
|
|
@@ -1960,10 +1914,10 @@ const Fe = {
|
|
|
1960
1914
|
categoryIndex: E
|
|
1961
1915
|
});
|
|
1962
1916
|
else if (e.value.aggregate === "none") {
|
|
1963
|
-
let
|
|
1917
|
+
let I = k.map((l, g) => {
|
|
1964
1918
|
const T = l[e.value.from];
|
|
1965
1919
|
return {
|
|
1966
|
-
id: l.id || `${a}-${d}-${p}-${
|
|
1920
|
+
id: l.id || `${a}-${d}-${p}-${g}`,
|
|
1967
1921
|
index: E,
|
|
1968
1922
|
// Grid 模式下 index 對應 categoryIndex
|
|
1969
1923
|
modelType: "grid",
|
|
@@ -1982,20 +1936,20 @@ const Fe = {
|
|
|
1982
1936
|
categoryIndex: E
|
|
1983
1937
|
};
|
|
1984
1938
|
});
|
|
1985
|
-
e.value.sort === "asc" ?
|
|
1939
|
+
e.value.sort === "asc" ? I.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : l.value - g.value) : e.value.sort === "desc" && I.sort((l, g) => l.value === null && g.value === null ? 0 : l.value === null ? 1 : g.value === null ? -1 : g.value - l.value), h.push(...I);
|
|
1986
1940
|
} else {
|
|
1987
|
-
const
|
|
1941
|
+
const I = k.map((B) => {
|
|
1988
1942
|
if (e.value.aggregate === "count")
|
|
1989
1943
|
return 1;
|
|
1990
|
-
const
|
|
1991
|
-
return typeof
|
|
1992
|
-
}), l =
|
|
1993
|
-
id:
|
|
1944
|
+
const v = B[e.value.from];
|
|
1945
|
+
return typeof v == "number" ? v : null;
|
|
1946
|
+
}), l = ve(I, e.value.aggregate), g = k[0], T = {
|
|
1947
|
+
id: g.id || `${a}-${d}-${p}-aggregated`,
|
|
1994
1948
|
index: E,
|
|
1995
1949
|
// Grid 模式下 index 對應 categoryIndex
|
|
1996
1950
|
modelType: "grid",
|
|
1997
|
-
name:
|
|
1998
|
-
data:
|
|
1951
|
+
name: g.name || p,
|
|
1952
|
+
data: g.data,
|
|
1999
1953
|
value: l,
|
|
2000
1954
|
color: D(e.color.by, {
|
|
2001
1955
|
index: E,
|
|
@@ -2010,10 +1964,10 @@ const Fe = {
|
|
|
2010
1964
|
};
|
|
2011
1965
|
h.push(T);
|
|
2012
1966
|
}
|
|
2013
|
-
}),
|
|
2014
|
-
}), u.push(
|
|
1967
|
+
}), m.push(h);
|
|
1968
|
+
}), u.push(m);
|
|
2015
1969
|
}), u;
|
|
2016
|
-
},
|
|
1970
|
+
}, jr = (t, e, r) => {
|
|
2017
1971
|
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
2018
1972
|
s ? t.forEach((a, c) => {
|
|
2019
1973
|
a.forEach((i) => {
|
|
@@ -2052,39 +2006,39 @@ const Fe = {
|
|
|
2052
2006
|
else if (e.series.sort === "original") {
|
|
2053
2007
|
const y = [];
|
|
2054
2008
|
i.forEach((A) => {
|
|
2055
|
-
const
|
|
2056
|
-
y.includes(
|
|
2009
|
+
const m = $(A, e.series, "");
|
|
2010
|
+
y.includes(m) || y.push(m);
|
|
2057
2011
|
}), w = y;
|
|
2058
2012
|
} else e.series.sort === "alphabetical" && w.sort((y, A) => y.localeCompare(A, void 0, { numeric: !0 }));
|
|
2059
2013
|
const S = [];
|
|
2060
2014
|
w.forEach((y, A) => {
|
|
2061
|
-
const
|
|
2062
|
-
|
|
2063
|
-
const h = $(
|
|
2064
|
-
d.has(h) || d.set(h, []), d.get(h).push(
|
|
2015
|
+
const m = f.get(y), d = /* @__PURE__ */ new Map();
|
|
2016
|
+
m.forEach((C) => {
|
|
2017
|
+
const h = $(C, e.category, "");
|
|
2018
|
+
d.has(h) || d.set(h, []), d.get(h).push(C);
|
|
2065
2019
|
});
|
|
2066
2020
|
let b = Array.from(d.keys());
|
|
2067
2021
|
if (Array.isArray(e.category.sort))
|
|
2068
|
-
b = e.category.sort.filter((
|
|
2022
|
+
b = e.category.sort.filter((C) => d.has(C)).concat(b.filter((C) => !e.category.sort.includes(C)));
|
|
2069
2023
|
else if (e.category.sort === "original") {
|
|
2070
|
-
const
|
|
2071
|
-
|
|
2024
|
+
const C = [];
|
|
2025
|
+
m.forEach((h) => {
|
|
2072
2026
|
const p = $(h, e.category, "");
|
|
2073
|
-
|
|
2074
|
-
}), b =
|
|
2075
|
-
} else e.category.sort === "alphabetical" && b.sort((
|
|
2027
|
+
C.includes(p) || C.push(p);
|
|
2028
|
+
}), b = C;
|
|
2029
|
+
} else e.category.sort === "alphabetical" && b.sort((C, h) => C.localeCompare(h, void 0, { numeric: !0 }));
|
|
2076
2030
|
const O = [];
|
|
2077
|
-
b.forEach((
|
|
2078
|
-
d.get(
|
|
2079
|
-
const
|
|
2031
|
+
b.forEach((C, h) => {
|
|
2032
|
+
d.get(C).forEach((E, k) => {
|
|
2033
|
+
const I = e.multivariate.map((g, T) => ({
|
|
2080
2034
|
index: T,
|
|
2081
|
-
name:
|
|
2035
|
+
name: g.name,
|
|
2082
2036
|
value: (() => {
|
|
2083
|
-
const B = E[
|
|
2037
|
+
const B = E[g.from];
|
|
2084
2038
|
return typeof B == "number" ? B : null;
|
|
2085
2039
|
})()
|
|
2086
2040
|
})), l = {
|
|
2087
|
-
id: E.id || `${a}-${y}-${
|
|
2041
|
+
id: E.id || `${a}-${y}-${C}-${k}`,
|
|
2088
2042
|
index: k,
|
|
2089
2043
|
modelType: "multivariate",
|
|
2090
2044
|
name: E.name || "",
|
|
@@ -2097,10 +2051,10 @@ const Fe = {
|
|
|
2097
2051
|
categoryIndex: h,
|
|
2098
2052
|
datasetIndex: c
|
|
2099
2053
|
}, r),
|
|
2100
|
-
multivariate:
|
|
2054
|
+
multivariate: I,
|
|
2101
2055
|
series: y,
|
|
2102
2056
|
seriesIndex: A,
|
|
2103
|
-
category:
|
|
2057
|
+
category: C,
|
|
2104
2058
|
categoryIndex: h
|
|
2105
2059
|
};
|
|
2106
2060
|
O.push(l);
|
|
@@ -2108,7 +2062,7 @@ const Fe = {
|
|
|
2108
2062
|
}), S.push(O);
|
|
2109
2063
|
}), u.push(S);
|
|
2110
2064
|
}), u;
|
|
2111
|
-
},
|
|
2065
|
+
}, Mr = (t, e, r) => {
|
|
2112
2066
|
const n = Array.isArray(t[0]), s = [], o = [];
|
|
2113
2067
|
n ? t.forEach((i) => {
|
|
2114
2068
|
i.forEach((f) => {
|
|
@@ -2150,36 +2104,36 @@ const Fe = {
|
|
|
2150
2104
|
return a.forEach((i, f) => {
|
|
2151
2105
|
const w = u.get(i), S = [], y = /* @__PURE__ */ new Map();
|
|
2152
2106
|
w.forEach((l) => {
|
|
2153
|
-
const
|
|
2154
|
-
y.has(
|
|
2107
|
+
const g = $(l, e.series, "");
|
|
2108
|
+
y.has(g) || y.set(g, []), y.get(g).push(l);
|
|
2155
2109
|
});
|
|
2156
2110
|
let A = Array.from(y.keys());
|
|
2157
2111
|
if (Array.isArray(e.series.sort))
|
|
2158
2112
|
A = e.series.sort.filter((l) => y.has(l)).concat(A.filter((l) => !e.series.sort.includes(l)));
|
|
2159
2113
|
else if (e.series.sort === "original") {
|
|
2160
2114
|
const l = [];
|
|
2161
|
-
w.forEach((
|
|
2162
|
-
const T = $(
|
|
2115
|
+
w.forEach((g) => {
|
|
2116
|
+
const T = $(g, e.series, "");
|
|
2163
2117
|
l.includes(T) || l.push(T);
|
|
2164
2118
|
}), A = l;
|
|
2165
|
-
} else e.series.sort === "alphabetical" && A.sort((l,
|
|
2166
|
-
A.forEach((l,
|
|
2119
|
+
} else e.series.sort === "alphabetical" && A.sort((l, g) => l.localeCompare(g, void 0, { numeric: !0 }));
|
|
2120
|
+
A.forEach((l, g) => {
|
|
2167
2121
|
const T = y.get(l), B = /* @__PURE__ */ new Map();
|
|
2168
2122
|
T.forEach((x) => {
|
|
2169
2123
|
const _ = $(x, e.category, "");
|
|
2170
2124
|
B.has(_) || B.set(_, []), B.get(_).push(x);
|
|
2171
2125
|
});
|
|
2172
|
-
let
|
|
2126
|
+
let v = Array.from(B.keys());
|
|
2173
2127
|
if (Array.isArray(e.category.sort))
|
|
2174
|
-
|
|
2128
|
+
v = e.category.sort.filter((x) => B.has(x)).concat(v.filter((x) => !e.category.sort.includes(x)));
|
|
2175
2129
|
else if (e.category.sort === "original") {
|
|
2176
2130
|
const x = [];
|
|
2177
2131
|
T.forEach((_) => {
|
|
2178
2132
|
const P = $(_, e.category, "");
|
|
2179
2133
|
x.includes(P) || x.push(P);
|
|
2180
|
-
}),
|
|
2181
|
-
} else e.category.sort === "alphabetical" &&
|
|
2182
|
-
|
|
2134
|
+
}), v = x;
|
|
2135
|
+
} else e.category.sort === "alphabetical" && v.sort((x, _) => x.localeCompare(_, void 0, { numeric: !0 }));
|
|
2136
|
+
v.forEach((x, _) => {
|
|
2183
2137
|
const P = B.get(x);
|
|
2184
2138
|
if (e.value.aggregate === "none") {
|
|
2185
2139
|
let j = P.map((M, L) => {
|
|
@@ -2194,12 +2148,12 @@ const Fe = {
|
|
|
2194
2148
|
value: typeof F == "number" ? F : null,
|
|
2195
2149
|
color: D(e.color.by, {
|
|
2196
2150
|
index: _,
|
|
2197
|
-
seriesIndex:
|
|
2151
|
+
seriesIndex: g,
|
|
2198
2152
|
categoryIndex: _,
|
|
2199
2153
|
datasetIndex: f
|
|
2200
2154
|
}, r),
|
|
2201
2155
|
series: l,
|
|
2202
|
-
seriesIndex:
|
|
2156
|
+
seriesIndex: g,
|
|
2203
2157
|
category: x,
|
|
2204
2158
|
categoryIndex: _
|
|
2205
2159
|
};
|
|
@@ -2211,7 +2165,7 @@ const Fe = {
|
|
|
2211
2165
|
return 1;
|
|
2212
2166
|
const re = J[e.value.from];
|
|
2213
2167
|
return typeof re == "number" ? re : null;
|
|
2214
|
-
}), M =
|
|
2168
|
+
}), M = ve(j, e.value.aggregate), L = P[0], F = {
|
|
2215
2169
|
id: L.id || `${i}-${l}-${x}-aggregated`,
|
|
2216
2170
|
index: S.length,
|
|
2217
2171
|
// 在所有 nodes 中的索引
|
|
@@ -2221,12 +2175,12 @@ const Fe = {
|
|
|
2221
2175
|
value: M,
|
|
2222
2176
|
color: D(e.color.by, {
|
|
2223
2177
|
index: _,
|
|
2224
|
-
seriesIndex:
|
|
2178
|
+
seriesIndex: g,
|
|
2225
2179
|
categoryIndex: _,
|
|
2226
2180
|
datasetIndex: f
|
|
2227
2181
|
}, r),
|
|
2228
2182
|
series: l,
|
|
2229
|
-
seriesIndex:
|
|
2183
|
+
seriesIndex: g,
|
|
2230
2184
|
category: x,
|
|
2231
2185
|
categoryIndex: _
|
|
2232
2186
|
};
|
|
@@ -2234,34 +2188,34 @@ const Fe = {
|
|
|
2234
2188
|
}
|
|
2235
2189
|
});
|
|
2236
2190
|
});
|
|
2237
|
-
const
|
|
2191
|
+
const m = [], d = /* @__PURE__ */ new Map();
|
|
2238
2192
|
S.forEach((l) => {
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2193
|
+
const g = s.find((T) => T.id === l.id || T.name === l.name);
|
|
2194
|
+
g != null && g.id && d.set(g.id, l.index), g != null && g.name && d.set(g.name, l.index);
|
|
2241
2195
|
});
|
|
2242
2196
|
const b = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
|
|
2243
2197
|
S.forEach((l) => {
|
|
2244
2198
|
b.has(l.series) || b.set(l.series, l.seriesIndex), O.has(l.category) || O.set(l.category, l.categoryIndex);
|
|
2245
2199
|
});
|
|
2246
|
-
let
|
|
2247
|
-
const p = (l) => (b.has(l) || b.set(l,
|
|
2200
|
+
let C = b.size, h = O.size;
|
|
2201
|
+
const p = (l) => (b.has(l) || b.set(l, C++), b.get(l)), E = (l) => (O.has(l) || O.set(l, h++), O.get(l)), k = o.filter((l) => $(l, e.dataset, "") === i), I = /* @__PURE__ */ new Map();
|
|
2248
2202
|
k.forEach((l) => {
|
|
2249
|
-
const
|
|
2250
|
-
|
|
2251
|
-
}), Array.from(
|
|
2252
|
-
const B =
|
|
2203
|
+
const g = l.source, T = l.target, B = $(l, e.series, ""), v = $(l, e.category, ""), x = `${g}-${T}-${B}-${v}`;
|
|
2204
|
+
I.has(x) || I.set(x, []), I.get(x).push(l);
|
|
2205
|
+
}), Array.from(I.entries()).forEach(([l, g], T) => {
|
|
2206
|
+
const B = g[0], v = B.source, x = B.target, _ = d.get(v) ?? -1, P = d.get(x) ?? -1;
|
|
2253
2207
|
if (_ >= 0 && P >= 0)
|
|
2254
2208
|
if (e.value.aggregate === "none")
|
|
2255
|
-
|
|
2256
|
-
const L = j[e.value.from], F = $(j, e.series, ""), J = $(j, e.category, ""), re = p(F), ge = E(J),
|
|
2209
|
+
g.forEach((j, M) => {
|
|
2210
|
+
const L = j[e.value.from], F = $(j, e.series, ""), J = $(j, e.category, ""), re = p(F), ge = E(J), Ae = {
|
|
2257
2211
|
id: j.id || `edge-${T}-${M}`,
|
|
2258
|
-
index:
|
|
2212
|
+
index: m.length,
|
|
2259
2213
|
modelType: "graph",
|
|
2260
2214
|
name: j.name || "",
|
|
2261
2215
|
data: j.data,
|
|
2262
2216
|
value: typeof L == "number" ? L : null,
|
|
2263
2217
|
color: D(e.color.by, {
|
|
2264
|
-
index:
|
|
2218
|
+
index: m.length,
|
|
2265
2219
|
seriesIndex: re,
|
|
2266
2220
|
categoryIndex: ge,
|
|
2267
2221
|
datasetIndex: f
|
|
@@ -2270,28 +2224,28 @@ const Fe = {
|
|
|
2270
2224
|
seriesIndex: re,
|
|
2271
2225
|
category: J,
|
|
2272
2226
|
categoryIndex: ge,
|
|
2273
|
-
source:
|
|
2227
|
+
source: v,
|
|
2274
2228
|
sourceIndex: _,
|
|
2275
2229
|
target: x,
|
|
2276
2230
|
targetIndex: P
|
|
2277
2231
|
};
|
|
2278
|
-
|
|
2232
|
+
m.push(Ae);
|
|
2279
2233
|
});
|
|
2280
2234
|
else {
|
|
2281
|
-
const j =
|
|
2235
|
+
const j = g.map((Ae) => {
|
|
2282
2236
|
if (e.value.aggregate === "count")
|
|
2283
2237
|
return 1;
|
|
2284
|
-
const ke =
|
|
2238
|
+
const ke = Ae[e.value.from];
|
|
2285
2239
|
return typeof ke == "number" ? ke : null;
|
|
2286
|
-
}), M =
|
|
2240
|
+
}), M = ve(j, e.value.aggregate), L = $(B, e.series, ""), F = $(B, e.category, ""), J = p(L), re = E(F), ge = {
|
|
2287
2241
|
id: B.id || `edge-${T}-aggregated`,
|
|
2288
|
-
index:
|
|
2242
|
+
index: m.length,
|
|
2289
2243
|
modelType: "graph",
|
|
2290
2244
|
name: B.name || "",
|
|
2291
2245
|
data: B.data,
|
|
2292
2246
|
value: M,
|
|
2293
2247
|
color: D(e.color.by, {
|
|
2294
|
-
index:
|
|
2248
|
+
index: m.length,
|
|
2295
2249
|
seriesIndex: J,
|
|
2296
2250
|
categoryIndex: re,
|
|
2297
2251
|
datasetIndex: f
|
|
@@ -2300,16 +2254,16 @@ const Fe = {
|
|
|
2300
2254
|
seriesIndex: J,
|
|
2301
2255
|
category: F,
|
|
2302
2256
|
categoryIndex: re,
|
|
2303
|
-
source:
|
|
2257
|
+
source: v,
|
|
2304
2258
|
sourceIndex: _,
|
|
2305
2259
|
target: x,
|
|
2306
2260
|
targetIndex: P
|
|
2307
2261
|
};
|
|
2308
|
-
|
|
2262
|
+
m.push(ge);
|
|
2309
2263
|
}
|
|
2310
|
-
}), c.push({ nodes: S, edges:
|
|
2264
|
+
}), c.push({ nodes: S, edges: m });
|
|
2311
2265
|
}), c;
|
|
2312
|
-
},
|
|
2266
|
+
}, Lr = (t, e, r) => {
|
|
2313
2267
|
const n = /* @__PURE__ */ new Map(), s = Array.isArray(t[0]);
|
|
2314
2268
|
s ? t.forEach((a, c) => {
|
|
2315
2269
|
a.forEach((i) => {
|
|
@@ -2339,54 +2293,54 @@ const Fe = {
|
|
|
2339
2293
|
return o.forEach((a, c) => {
|
|
2340
2294
|
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2341
2295
|
i.forEach((l) => {
|
|
2342
|
-
const
|
|
2343
|
-
f.has(
|
|
2296
|
+
const g = $(l, e.series, "");
|
|
2297
|
+
f.has(g) || f.set(g, []), f.get(g).push(l);
|
|
2344
2298
|
});
|
|
2345
2299
|
let w = Array.from(f.keys());
|
|
2346
2300
|
if (Array.isArray(e.series.sort))
|
|
2347
2301
|
w = e.series.sort.filter((l) => f.has(l)).concat(w.filter((l) => !e.series.sort.includes(l)));
|
|
2348
2302
|
else if (e.series.sort === "original") {
|
|
2349
2303
|
const l = [];
|
|
2350
|
-
i.forEach((
|
|
2351
|
-
const T = $(
|
|
2304
|
+
i.forEach((g) => {
|
|
2305
|
+
const T = $(g, e.series, "");
|
|
2352
2306
|
l.includes(T) || l.push(T);
|
|
2353
2307
|
}), w = l;
|
|
2354
|
-
} else e.series.sort === "alphabetical" && w.sort((l,
|
|
2308
|
+
} else e.series.sort === "alphabetical" && w.sort((l, g) => l.localeCompare(g, void 0, { numeric: !0 }));
|
|
2355
2309
|
const S = /* @__PURE__ */ new Map();
|
|
2356
2310
|
i.forEach((l) => {
|
|
2357
|
-
const
|
|
2358
|
-
S.has(
|
|
2311
|
+
const g = $(l, e.category, "");
|
|
2312
|
+
S.has(g) || S.set(g, []), S.get(g).push(l);
|
|
2359
2313
|
});
|
|
2360
2314
|
let y = Array.from(S.keys());
|
|
2361
2315
|
if (Array.isArray(e.category.sort))
|
|
2362
2316
|
y = e.category.sort.filter((l) => S.has(l)).concat(y.filter((l) => !e.category.sort.includes(l)));
|
|
2363
2317
|
else if (e.category.sort === "original") {
|
|
2364
2318
|
const l = [];
|
|
2365
|
-
i.forEach((
|
|
2366
|
-
const T = $(
|
|
2319
|
+
i.forEach((g) => {
|
|
2320
|
+
const T = $(g, e.category, "");
|
|
2367
2321
|
l.includes(T) || l.push(T);
|
|
2368
2322
|
}), y = l;
|
|
2369
|
-
} else e.category.sort === "alphabetical" && y.sort((l,
|
|
2323
|
+
} else e.category.sort === "alphabetical" && y.sort((l, g) => l.localeCompare(g, void 0, { numeric: !0 }));
|
|
2370
2324
|
const A = /* @__PURE__ */ new Map();
|
|
2371
2325
|
i.forEach((l) => {
|
|
2372
|
-
const
|
|
2373
|
-
A.has(
|
|
2326
|
+
const g = l.id || "unknown";
|
|
2327
|
+
A.has(g) || A.set(g, []), A.get(g).push(l);
|
|
2374
2328
|
});
|
|
2375
|
-
let
|
|
2329
|
+
let m = 0;
|
|
2376
2330
|
const d = w[0] || "", b = w.indexOf(d), O = /* @__PURE__ */ new Map();
|
|
2377
|
-
Array.from(A.entries()).forEach(([l,
|
|
2378
|
-
const T =
|
|
2331
|
+
Array.from(A.entries()).forEach(([l, g]) => {
|
|
2332
|
+
const T = g[0], B = $(T, e.series, ""), v = w.indexOf(B), x = $(T, e.category, ""), _ = y.indexOf(x);
|
|
2379
2333
|
if (e.value.aggregate === "none") {
|
|
2380
2334
|
const P = T[e.value.from], j = {
|
|
2381
2335
|
id: l,
|
|
2382
|
-
index:
|
|
2336
|
+
index: m++,
|
|
2383
2337
|
modelType: "tree",
|
|
2384
2338
|
name: T.name || l,
|
|
2385
2339
|
data: T.data,
|
|
2386
2340
|
value: typeof P == "number" ? P : null,
|
|
2387
2341
|
color: D(e.color.by, {
|
|
2388
|
-
index:
|
|
2389
|
-
seriesIndex:
|
|
2342
|
+
index: m - 1,
|
|
2343
|
+
seriesIndex: v,
|
|
2390
2344
|
categoryIndex: _,
|
|
2391
2345
|
datasetIndex: c
|
|
2392
2346
|
}, r),
|
|
@@ -2399,27 +2353,27 @@ const Fe = {
|
|
|
2399
2353
|
// 稍後計算
|
|
2400
2354
|
children: [],
|
|
2401
2355
|
series: B,
|
|
2402
|
-
seriesIndex:
|
|
2356
|
+
seriesIndex: v,
|
|
2403
2357
|
category: x,
|
|
2404
2358
|
categoryIndex: _
|
|
2405
2359
|
};
|
|
2406
2360
|
O.set(l, j);
|
|
2407
2361
|
} else {
|
|
2408
|
-
const P =
|
|
2362
|
+
const P = g.map((L) => {
|
|
2409
2363
|
if (e.value.aggregate === "count")
|
|
2410
2364
|
return 1;
|
|
2411
2365
|
const F = L[e.value.from];
|
|
2412
2366
|
return typeof F == "number" ? F : null;
|
|
2413
|
-
}), j =
|
|
2367
|
+
}), j = ve(P, e.value.aggregate), M = {
|
|
2414
2368
|
id: l,
|
|
2415
|
-
index:
|
|
2369
|
+
index: m++,
|
|
2416
2370
|
modelType: "tree",
|
|
2417
2371
|
name: T.name || l,
|
|
2418
2372
|
data: T.data,
|
|
2419
2373
|
value: j,
|
|
2420
2374
|
color: D(e.color.by, {
|
|
2421
|
-
index:
|
|
2422
|
-
seriesIndex:
|
|
2375
|
+
index: m - 1,
|
|
2376
|
+
seriesIndex: v,
|
|
2423
2377
|
categoryIndex: _,
|
|
2424
2378
|
datasetIndex: c
|
|
2425
2379
|
}, r),
|
|
@@ -2432,41 +2386,41 @@ const Fe = {
|
|
|
2432
2386
|
// 稍後計算
|
|
2433
2387
|
children: [],
|
|
2434
2388
|
series: B,
|
|
2435
|
-
seriesIndex:
|
|
2389
|
+
seriesIndex: v,
|
|
2436
2390
|
category: x,
|
|
2437
2391
|
categoryIndex: _
|
|
2438
2392
|
};
|
|
2439
2393
|
O.set(l, M);
|
|
2440
2394
|
}
|
|
2441
2395
|
});
|
|
2442
|
-
const
|
|
2443
|
-
|
|
2396
|
+
const C = Array.from(O.values()), h = /* @__PURE__ */ new Map();
|
|
2397
|
+
C.forEach((l) => {
|
|
2444
2398
|
h.set(l.id, l.index);
|
|
2445
|
-
}),
|
|
2399
|
+
}), C.forEach((l) => {
|
|
2446
2400
|
l.parent && h.has(l.parent) && (l.parentIndex = h.get(l.parent));
|
|
2447
2401
|
});
|
|
2448
2402
|
const p = [], E = /* @__PURE__ */ new Map();
|
|
2449
|
-
|
|
2403
|
+
C.forEach((l) => {
|
|
2450
2404
|
l.parent === null ? p.push(l) : (E.has(l.parent) || E.set(l.parent, []), E.get(l.parent).push(l));
|
|
2451
2405
|
});
|
|
2452
|
-
function k(l,
|
|
2453
|
-
l.depth =
|
|
2406
|
+
function k(l, g) {
|
|
2407
|
+
l.depth = g;
|
|
2454
2408
|
const T = E.get(l.id) || [];
|
|
2455
|
-
return e.value.sort === "asc" ? T.sort((B,
|
|
2456
|
-
B.seq =
|
|
2457
|
-
}), l.children = T.map((B) => k(B,
|
|
2409
|
+
return e.value.sort === "asc" ? T.sort((B, v) => B.value === null && v.value === null ? 0 : B.value === null ? 1 : v.value === null ? -1 : B.value - v.value) : e.value.sort === "desc" && T.sort((B, v) => B.value === null && v.value === null ? 0 : B.value === null ? 1 : v.value === null ? -1 : v.value - B.value), T.forEach((B, v) => {
|
|
2410
|
+
B.seq = v;
|
|
2411
|
+
}), l.children = T.map((B) => k(B, g + 1)), l;
|
|
2458
2412
|
}
|
|
2459
|
-
const
|
|
2460
|
-
if (
|
|
2413
|
+
const I = p.map((l) => k(l, 0));
|
|
2414
|
+
if (I.length === 0)
|
|
2461
2415
|
u.push({
|
|
2462
2416
|
id: `empty-${a}`,
|
|
2463
|
-
index:
|
|
2417
|
+
index: m++,
|
|
2464
2418
|
modelType: "tree",
|
|
2465
2419
|
name: "Empty Tree",
|
|
2466
2420
|
data: {},
|
|
2467
2421
|
value: null,
|
|
2468
2422
|
color: D(e.color.by, {
|
|
2469
|
-
index:
|
|
2423
|
+
index: m - 1,
|
|
2470
2424
|
seriesIndex: b < 0 ? 0 : b,
|
|
2471
2425
|
categoryIndex: 0,
|
|
2472
2426
|
datasetIndex: c
|
|
@@ -2481,18 +2435,18 @@ const Fe = {
|
|
|
2481
2435
|
category: "",
|
|
2482
2436
|
categoryIndex: 0
|
|
2483
2437
|
});
|
|
2484
|
-
else if (
|
|
2485
|
-
u.push(
|
|
2438
|
+
else if (I.length === 1)
|
|
2439
|
+
u.push(I[0]);
|
|
2486
2440
|
else {
|
|
2487
2441
|
const l = {
|
|
2488
2442
|
id: `virtual-root-${a}`,
|
|
2489
|
-
index:
|
|
2443
|
+
index: m++,
|
|
2490
2444
|
modelType: "tree",
|
|
2491
2445
|
name: `Virtual Root (${a})`,
|
|
2492
2446
|
data: {},
|
|
2493
2447
|
value: null,
|
|
2494
2448
|
color: D(e.color.by, {
|
|
2495
|
-
index:
|
|
2449
|
+
index: m - 1,
|
|
2496
2450
|
seriesIndex: b < 0 ? 0 : b,
|
|
2497
2451
|
categoryIndex: 0,
|
|
2498
2452
|
datasetIndex: c
|
|
@@ -2501,9 +2455,9 @@ const Fe = {
|
|
|
2501
2455
|
parentIndex: null,
|
|
2502
2456
|
depth: 0,
|
|
2503
2457
|
seq: 0,
|
|
2504
|
-
children:
|
|
2505
|
-
const B = (
|
|
2506
|
-
return B(
|
|
2458
|
+
children: I.map((g, T) => {
|
|
2459
|
+
const B = (v, x) => (v.depth = x, x === 1 && (v.seq = T), v.children = v.children.map((_) => B(_, x + 1)), v);
|
|
2460
|
+
return B(g, 1);
|
|
2507
2461
|
}),
|
|
2508
2462
|
series: d,
|
|
2509
2463
|
seriesIndex: b < 0 ? 0 : b,
|
|
@@ -2514,7 +2468,7 @@ const Fe = {
|
|
|
2514
2468
|
}
|
|
2515
2469
|
}), u;
|
|
2516
2470
|
};
|
|
2517
|
-
function
|
|
2471
|
+
function Vr(t, e, r) {
|
|
2518
2472
|
const n = e.map((a) => r[a]).filter((a) => a && a.parentNode === t);
|
|
2519
2473
|
if (n.length === 0) return;
|
|
2520
2474
|
let s = !0, o = null;
|
|
@@ -2543,9 +2497,9 @@ function Ue(t, e, r, n, s) {
|
|
|
2543
2497
|
r[i] = f, t.appendChild(f);
|
|
2544
2498
|
}), e.filter((i) => r[i] && !a.includes(i)).forEach((i) => {
|
|
2545
2499
|
r[i];
|
|
2546
|
-
}), e.length > 0 &&
|
|
2500
|
+
}), e.length > 0 && Vr(t, e, r);
|
|
2547
2501
|
}
|
|
2548
|
-
function
|
|
2502
|
+
function Kr(t) {
|
|
2549
2503
|
return K({ element: t }, {
|
|
2550
2504
|
element: {
|
|
2551
2505
|
toBe: "Dom",
|
|
@@ -2553,7 +2507,7 @@ function zr(t) {
|
|
|
2553
2507
|
}
|
|
2554
2508
|
});
|
|
2555
2509
|
}
|
|
2556
|
-
function
|
|
2510
|
+
function Rr(t) {
|
|
2557
2511
|
return K(t, {
|
|
2558
2512
|
width: {
|
|
2559
2513
|
toBe: '"auto" | number',
|
|
@@ -2758,7 +2712,7 @@ function vt(t) {
|
|
|
2758
2712
|
}
|
|
2759
2713
|
});
|
|
2760
2714
|
}
|
|
2761
|
-
function
|
|
2715
|
+
function Oe(t) {
|
|
2762
2716
|
return K({ plugins: t }, {
|
|
2763
2717
|
plugins: {
|
|
2764
2718
|
toBe: "PluginEntity[]",
|
|
@@ -2766,7 +2720,7 @@ function $e(t) {
|
|
|
2766
2720
|
}
|
|
2767
2721
|
});
|
|
2768
2722
|
}
|
|
2769
|
-
function
|
|
2723
|
+
function Fr(t) {
|
|
2770
2724
|
if (!t)
|
|
2771
2725
|
return { status: "success", columnName: "", expectToBe: "" };
|
|
2772
2726
|
const e = K(t, {
|
|
@@ -2792,7 +2746,7 @@ function qr(t) {
|
|
|
2792
2746
|
if (e.status === "error")
|
|
2793
2747
|
return e;
|
|
2794
2748
|
if (t.size) {
|
|
2795
|
-
const r =
|
|
2749
|
+
const r = Rr(t.size);
|
|
2796
2750
|
if (r.status === "error")
|
|
2797
2751
|
return r;
|
|
2798
2752
|
}
|
|
@@ -2812,62 +2766,62 @@ function qr(t) {
|
|
|
2812
2766
|
return r;
|
|
2813
2767
|
}
|
|
2814
2768
|
if (t.plugins) {
|
|
2815
|
-
const r =
|
|
2769
|
+
const r = Oe(t.plugins);
|
|
2816
2770
|
if (r.status === "error")
|
|
2817
2771
|
return r;
|
|
2818
2772
|
}
|
|
2819
2773
|
return e;
|
|
2820
2774
|
}
|
|
2821
|
-
function
|
|
2775
|
+
function Dr({ svgElement$: t, canvasElement$: e, pluginsInstance$: r }) {
|
|
2822
2776
|
let n = [], s = [];
|
|
2823
2777
|
const o = (c, i, f) => {
|
|
2824
|
-
const w = r.getValue().reduce((A,
|
|
2778
|
+
const w = r.getValue().reduce((A, m, d) => (A[m._getId()] = d, A), {}), S = f.map((A) => ({
|
|
2825
2779
|
...A,
|
|
2826
2780
|
pluginSeq: w[A.pluginId]
|
|
2827
2781
|
}));
|
|
2828
2782
|
return (c === "svg" ? n : s).filter((A) => A.pluginId !== i).map((A) => ({
|
|
2829
2783
|
...A,
|
|
2830
2784
|
pluginSeq: w[A.pluginId]
|
|
2831
|
-
})).concat(S).sort((A,
|
|
2785
|
+
})).concat(S).sort((A, m) => A.layerIndex - m.layerIndex || A.pluginSeq - m.pluginSeq);
|
|
2832
2786
|
}, u = {}, a = {};
|
|
2833
2787
|
return (c, i, f) => {
|
|
2834
2788
|
const w = c === "svg" ? t.getValue() : e.getValue();
|
|
2835
2789
|
if (!w)
|
|
2836
2790
|
return {};
|
|
2837
|
-
const S = c === "svg" ? u : a, y = o(c, i, f), A = y.map((d) =>
|
|
2791
|
+
const S = c === "svg" ? u : a, y = o(c, i, f), A = y.map((d) => Ir(d.pluginId, d.layerName));
|
|
2838
2792
|
return c === "svg" ? (Ue(
|
|
2839
2793
|
w,
|
|
2840
2794
|
A,
|
|
2841
2795
|
S,
|
|
2842
|
-
(d) =>
|
|
2796
|
+
(d) => Tr(d)
|
|
2843
2797
|
), n = y) : (Ue(
|
|
2844
2798
|
w,
|
|
2845
2799
|
A,
|
|
2846
2800
|
S,
|
|
2847
2801
|
(d) => ht(d)
|
|
2848
2802
|
), s = y), Object.entries(S).reduce((d, [b, O]) => {
|
|
2849
|
-
const [
|
|
2803
|
+
const [C, h, p] = b.split("-");
|
|
2850
2804
|
return h === i && (d[p] = O), d;
|
|
2851
2805
|
}, {});
|
|
2852
2806
|
};
|
|
2853
2807
|
}
|
|
2854
|
-
const
|
|
2808
|
+
const Nr = (t, e) => {
|
|
2855
2809
|
try {
|
|
2856
|
-
const { status: b, columnName: O, expectToBe:
|
|
2810
|
+
const { status: b, columnName: O, expectToBe: C } = Fr(e);
|
|
2857
2811
|
if (b === "error")
|
|
2858
2812
|
throw new Error(Q({
|
|
2859
2813
|
columnName: O,
|
|
2860
|
-
expectToBe:
|
|
2814
|
+
expectToBe: C,
|
|
2861
2815
|
from: "Chart.constructor"
|
|
2862
2816
|
}));
|
|
2863
2817
|
if (b === "warning")
|
|
2864
2818
|
console.warn(X({
|
|
2865
2819
|
columnName: O,
|
|
2866
|
-
expectToBe:
|
|
2820
|
+
expectToBe: C,
|
|
2867
2821
|
from: "Chart.constructor"
|
|
2868
2822
|
}));
|
|
2869
2823
|
else {
|
|
2870
|
-
const { status: h, columnName: p, expectToBe: E } =
|
|
2824
|
+
const { status: h, columnName: p, expectToBe: E } = Kr(t);
|
|
2871
2825
|
if (h === "error")
|
|
2872
2826
|
throw new Error(Q({
|
|
2873
2827
|
columnName: p,
|
|
@@ -2883,121 +2837,121 @@ const Yr = (t, e) => {
|
|
|
2883
2837
|
} catch (b) {
|
|
2884
2838
|
throw new Error(b);
|
|
2885
2839
|
}
|
|
2886
|
-
const r = new oe(), n = new N((e == null ? void 0 : e.data) || []), s = e && e.encoding ?
|
|
2840
|
+
const r = new oe(), n = new N((e == null ? void 0 : e.data) || []), s = e && e.encoding ? q(De, e.encoding) : De, o = new N(s), u = e && e.theme ? q(Ne, e.theme) : Ne, a = new N(u), c = new N((e == null ? void 0 : e.plugins) || []), i = e && e.size ? q(Fe, e.size) : Fe, f = new N(i), w = new N(null), S = new N(null), y = (() => {
|
|
2887
2841
|
const b = f.pipe(
|
|
2888
|
-
|
|
2889
|
-
() =>
|
|
2842
|
+
dr((v) => hr(
|
|
2843
|
+
() => v.width === "auto" || v.height === "auto",
|
|
2890
2844
|
// 有 'auto' 的話就監聽element的尺寸
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
width:
|
|
2894
|
-
height:
|
|
2845
|
+
Or(t).pipe(
|
|
2846
|
+
z((x) => ({
|
|
2847
|
+
width: v.width === "auto" ? x.width : v.width,
|
|
2848
|
+
height: v.height === "auto" ? x.height <= 0 ? x.width : x.height : v.height
|
|
2895
2849
|
})),
|
|
2896
|
-
|
|
2897
|
-
|
|
2850
|
+
G(v.resizeDebounce),
|
|
2851
|
+
yr((x, _) => JSON.stringify(x) === JSON.stringify(_))
|
|
2898
2852
|
),
|
|
2899
2853
|
Xt({
|
|
2900
|
-
width:
|
|
2901
|
-
height:
|
|
2854
|
+
width: v.width,
|
|
2855
|
+
height: v.height
|
|
2902
2856
|
})
|
|
2903
2857
|
)),
|
|
2904
|
-
|
|
2858
|
+
he(r),
|
|
2905
2859
|
ne(1)
|
|
2906
2860
|
), O = o.asObservable().pipe(
|
|
2907
2861
|
ne(1)
|
|
2908
|
-
),
|
|
2862
|
+
), C = H([
|
|
2909
2863
|
n,
|
|
2910
2864
|
o,
|
|
2911
2865
|
a
|
|
2912
2866
|
]).pipe(
|
|
2913
|
-
|
|
2914
|
-
|
|
2867
|
+
G(0),
|
|
2868
|
+
z(([v, x, _]) => {
|
|
2915
2869
|
try {
|
|
2916
|
-
return
|
|
2870
|
+
return Pr(v, x, _);
|
|
2917
2871
|
} catch (P) {
|
|
2918
|
-
throw new Error(
|
|
2872
|
+
throw new Error(ye({
|
|
2919
2873
|
from: "Chart.seriesData$",
|
|
2920
2874
|
systemMessage: P
|
|
2921
2875
|
}));
|
|
2922
2876
|
}
|
|
2923
2877
|
}),
|
|
2924
|
-
|
|
2878
|
+
ae((v) => (console.error(U(v)), fe)),
|
|
2925
2879
|
ne(1)
|
|
2926
2880
|
), h = H([
|
|
2927
2881
|
n,
|
|
2928
2882
|
o,
|
|
2929
2883
|
a
|
|
2930
2884
|
]).pipe(
|
|
2931
|
-
|
|
2932
|
-
|
|
2885
|
+
G(0),
|
|
2886
|
+
z(([v, x, _]) => {
|
|
2933
2887
|
try {
|
|
2934
|
-
return
|
|
2888
|
+
return kr(v, x, _);
|
|
2935
2889
|
} catch (P) {
|
|
2936
|
-
throw new Error(
|
|
2890
|
+
throw new Error(ye({
|
|
2937
2891
|
from: "Chart.gridData$",
|
|
2938
2892
|
systemMessage: P
|
|
2939
2893
|
}));
|
|
2940
2894
|
}
|
|
2941
2895
|
}),
|
|
2942
|
-
|
|
2896
|
+
ae((v) => (console.error(U(v)), fe)),
|
|
2943
2897
|
ne(1)
|
|
2944
2898
|
), p = H([
|
|
2945
2899
|
n,
|
|
2946
2900
|
o,
|
|
2947
2901
|
a
|
|
2948
2902
|
]).pipe(
|
|
2949
|
-
|
|
2950
|
-
|
|
2903
|
+
G(0),
|
|
2904
|
+
z(([v, x, _]) => {
|
|
2951
2905
|
try {
|
|
2952
|
-
return
|
|
2906
|
+
return jr(v, x, _);
|
|
2953
2907
|
} catch (P) {
|
|
2954
|
-
throw new Error(
|
|
2908
|
+
throw new Error(ye({
|
|
2955
2909
|
from: "Chart.multivariateData$",
|
|
2956
2910
|
systemMessage: P
|
|
2957
2911
|
}));
|
|
2958
2912
|
}
|
|
2959
2913
|
}),
|
|
2960
|
-
|
|
2914
|
+
ae((v) => (console.error(U(v)), fe)),
|
|
2961
2915
|
ne(1)
|
|
2962
2916
|
), E = H([
|
|
2963
2917
|
n,
|
|
2964
2918
|
o,
|
|
2965
2919
|
a
|
|
2966
2920
|
]).pipe(
|
|
2967
|
-
|
|
2968
|
-
|
|
2921
|
+
G(0),
|
|
2922
|
+
z(([v, x, _]) => {
|
|
2969
2923
|
try {
|
|
2970
|
-
return
|
|
2924
|
+
return Mr(v, x, _);
|
|
2971
2925
|
} catch (P) {
|
|
2972
|
-
throw new Error(
|
|
2926
|
+
throw new Error(ye({
|
|
2973
2927
|
from: "Chart.graphData$",
|
|
2974
2928
|
systemMessage: P
|
|
2975
2929
|
}));
|
|
2976
2930
|
}
|
|
2977
2931
|
}),
|
|
2978
|
-
|
|
2932
|
+
ae((v) => (console.error(U(v)), fe)),
|
|
2979
2933
|
ne(1)
|
|
2980
2934
|
), k = H([
|
|
2981
2935
|
n,
|
|
2982
2936
|
o,
|
|
2983
2937
|
a
|
|
2984
2938
|
]).pipe(
|
|
2985
|
-
|
|
2986
|
-
|
|
2939
|
+
G(0),
|
|
2940
|
+
z(([v, x, _]) => {
|
|
2987
2941
|
try {
|
|
2988
|
-
return
|
|
2942
|
+
return Lr(v, x, _);
|
|
2989
2943
|
} catch (P) {
|
|
2990
|
-
throw new Error(
|
|
2944
|
+
throw new Error(ye({
|
|
2991
2945
|
from: "Chart.treeData$",
|
|
2992
2946
|
systemMessage: P
|
|
2993
2947
|
}));
|
|
2994
2948
|
}
|
|
2995
2949
|
}),
|
|
2996
|
-
|
|
2950
|
+
ae((v) => (console.error(U(v)), fe)),
|
|
2997
2951
|
ne(1)
|
|
2998
|
-
),
|
|
2999
|
-
c.subscribe((
|
|
3000
|
-
const x = {}, _ =
|
|
2952
|
+
), I = new N([]);
|
|
2953
|
+
c.pipe(he(r)).subscribe((v) => {
|
|
2954
|
+
const x = {}, _ = v.map((j) => {
|
|
3001
2955
|
var L;
|
|
3002
2956
|
let M = j._getId();
|
|
3003
2957
|
if (x[M]) {
|
|
@@ -3006,18 +2960,18 @@ const Yr = (t, e) => {
|
|
|
3006
2960
|
}
|
|
3007
2961
|
return x[M] = j._getId(), M;
|
|
3008
2962
|
});
|
|
3009
|
-
|
|
3010
|
-
const P =
|
|
2963
|
+
v.forEach((j, M) => j._setId(_[M]));
|
|
2964
|
+
const P = v.map((j) => ({
|
|
3011
2965
|
id: j._getId(),
|
|
3012
2966
|
name: j._name,
|
|
3013
2967
|
elementType: j._elementType,
|
|
3014
2968
|
shownLayers: j.getShownLayerNames()
|
|
3015
2969
|
}));
|
|
3016
|
-
|
|
2970
|
+
I.next(P);
|
|
3017
2971
|
});
|
|
3018
2972
|
const l = a.asObservable().pipe(
|
|
3019
2973
|
ne(1)
|
|
3020
|
-
),
|
|
2974
|
+
), g = new oe(), T = g.asObservable().pipe(
|
|
3021
2975
|
lt()
|
|
3022
2976
|
);
|
|
3023
2977
|
return {
|
|
@@ -3026,16 +2980,16 @@ const Yr = (t, e) => {
|
|
|
3026
2980
|
canvas: null,
|
|
3027
2981
|
size$: b,
|
|
3028
2982
|
encoding$: O,
|
|
3029
|
-
seriesData$:
|
|
2983
|
+
seriesData$: C,
|
|
3030
2984
|
gridData$: h,
|
|
3031
2985
|
multivariateData$: p,
|
|
3032
2986
|
graphData$: E,
|
|
3033
2987
|
treeData$: k,
|
|
3034
|
-
plugins$:
|
|
2988
|
+
plugins$: I,
|
|
3035
2989
|
theme$: l,
|
|
3036
2990
|
event$: T,
|
|
3037
|
-
eventTrigger$:
|
|
3038
|
-
_updateLayerElements:
|
|
2991
|
+
eventTrigger$: g,
|
|
2992
|
+
_updateLayerElements: Dr({
|
|
3039
2993
|
svgElement$: w,
|
|
3040
2994
|
canvasElement$: S,
|
|
3041
2995
|
pluginsInstance$: c
|
|
@@ -3043,41 +2997,43 @@ const Yr = (t, e) => {
|
|
|
3043
2997
|
};
|
|
3044
2998
|
})();
|
|
3045
2999
|
let A = null;
|
|
3046
|
-
const
|
|
3000
|
+
const m = () => (A || (A = document.createElement("div"), A.classList.add("orbcharts-container"), A.style.position = "relative", t.appendChild(A)), A);
|
|
3047
3001
|
let d = [];
|
|
3048
|
-
return c.subscribe((b) => {
|
|
3002
|
+
return c.pipe(he(r)).subscribe((b) => {
|
|
3049
3003
|
d.filter((p) => !b.includes(p)).forEach((p) => {
|
|
3050
3004
|
y._updateLayerElements(p._elementType, p._getId(), []), p.destroy();
|
|
3051
3005
|
}), d = b;
|
|
3052
|
-
let
|
|
3006
|
+
let C = !1, h = !1;
|
|
3053
3007
|
b.forEach((p) => {
|
|
3054
|
-
p._elementType === "svg" ?
|
|
3055
|
-
}),
|
|
3008
|
+
p._elementType === "svg" ? C = !0 : p._elementType === "canvas" && (h = !0);
|
|
3009
|
+
}), C && !y.svg ? (y.svg = _r("orbcharts-root-svg"), m().appendChild(y.svg), w.next(y.svg)) : !C && y.svg && (y.svg.remove(), y.svg = null, w.next(null)), h && !y.canvas ? (y.canvas = ht("orbcharts-root-canvas"), m().appendChild(y.canvas), S.next(y.canvas)) : !h && y.canvas && (y.canvas.remove(), y.canvas = null, S.next(null)), b.forEach((p) => {
|
|
3056
3010
|
p._injectContext(y);
|
|
3057
3011
|
});
|
|
3058
3012
|
}), H({
|
|
3059
3013
|
size: y.size$,
|
|
3060
3014
|
svg: w
|
|
3061
3015
|
}).pipe(
|
|
3062
|
-
|
|
3063
|
-
|
|
3016
|
+
G(0),
|
|
3017
|
+
de(({ svg: b }) => !!b),
|
|
3018
|
+
he(r)
|
|
3064
3019
|
).subscribe(({ size: b, svg: O }) => {
|
|
3065
3020
|
O && (O.setAttribute("width", b.width.toString()), O.setAttribute("height", b.height.toString()));
|
|
3066
3021
|
}), H({
|
|
3067
3022
|
size: y.size$,
|
|
3068
3023
|
canvas: S
|
|
3069
3024
|
}).pipe(
|
|
3070
|
-
|
|
3071
|
-
|
|
3025
|
+
G(0),
|
|
3026
|
+
de(({ canvas: b }) => !!b),
|
|
3027
|
+
he(r)
|
|
3072
3028
|
).subscribe(({ size: b, canvas: O }) => {
|
|
3073
3029
|
O && (O.width = b.width, O.height = b.height);
|
|
3074
3030
|
}), /* @__PURE__ */ (() => {
|
|
3075
|
-
function b(
|
|
3076
|
-
f.next(
|
|
3031
|
+
function b(v) {
|
|
3032
|
+
f.next(v);
|
|
3077
3033
|
}
|
|
3078
|
-
function O(
|
|
3034
|
+
function O(v) {
|
|
3079
3035
|
try {
|
|
3080
|
-
const { status: x, columnName: _, expectToBe: P } = vt(
|
|
3036
|
+
const { status: x, columnName: _, expectToBe: P } = vt(v);
|
|
3081
3037
|
if (x === "error")
|
|
3082
3038
|
throw new Error(Q({
|
|
3083
3039
|
columnName: _,
|
|
@@ -3090,13 +3046,13 @@ const Yr = (t, e) => {
|
|
|
3090
3046
|
from: "Chart.setData"
|
|
3091
3047
|
}));
|
|
3092
3048
|
} catch (x) {
|
|
3093
|
-
console.error(
|
|
3049
|
+
console.error(U(x));
|
|
3094
3050
|
}
|
|
3095
|
-
n.next(
|
|
3051
|
+
n.next(v);
|
|
3096
3052
|
}
|
|
3097
|
-
function
|
|
3053
|
+
function C(v) {
|
|
3098
3054
|
try {
|
|
3099
|
-
const { status: _, columnName: P, expectToBe: j } = dt(
|
|
3055
|
+
const { status: _, columnName: P, expectToBe: j } = dt(v);
|
|
3100
3056
|
if (_ === "error")
|
|
3101
3057
|
throw new Error(Q({
|
|
3102
3058
|
columnName: P,
|
|
@@ -3109,20 +3065,20 @@ const Yr = (t, e) => {
|
|
|
3109
3065
|
from: "Chart.updateEncoding"
|
|
3110
3066
|
}));
|
|
3111
3067
|
} catch (_) {
|
|
3112
|
-
console.error(
|
|
3068
|
+
console.error(U(_));
|
|
3113
3069
|
}
|
|
3114
|
-
const x =
|
|
3070
|
+
const x = q(o.getValue(), v);
|
|
3115
3071
|
o.next(x);
|
|
3116
3072
|
}
|
|
3117
|
-
function h(
|
|
3118
|
-
o.next(
|
|
3073
|
+
function h(v) {
|
|
3074
|
+
o.next(v);
|
|
3119
3075
|
}
|
|
3120
3076
|
function p() {
|
|
3121
3077
|
return o.getValue();
|
|
3122
3078
|
}
|
|
3123
|
-
function E(
|
|
3079
|
+
function E(v) {
|
|
3124
3080
|
try {
|
|
3125
|
-
const { status: x, columnName: _, expectToBe: P } =
|
|
3081
|
+
const { status: x, columnName: _, expectToBe: P } = Oe(v);
|
|
3126
3082
|
if (x === "error")
|
|
3127
3083
|
throw new Error(Q({
|
|
3128
3084
|
columnName: _,
|
|
@@ -3135,13 +3091,13 @@ const Yr = (t, e) => {
|
|
|
3135
3091
|
from: "Chart.setPlugins"
|
|
3136
3092
|
}));
|
|
3137
3093
|
} catch (x) {
|
|
3138
|
-
console.error(
|
|
3094
|
+
console.error(U(x));
|
|
3139
3095
|
}
|
|
3140
|
-
c.next(
|
|
3096
|
+
c.next(v);
|
|
3141
3097
|
}
|
|
3142
|
-
function k(
|
|
3098
|
+
function k(v) {
|
|
3143
3099
|
try {
|
|
3144
|
-
const { status: x, columnName: _, expectToBe: P } =
|
|
3100
|
+
const { status: x, columnName: _, expectToBe: P } = Oe([v]);
|
|
3145
3101
|
if (x === "error")
|
|
3146
3102
|
throw new Error(Q({
|
|
3147
3103
|
columnName: _,
|
|
@@ -3154,16 +3110,16 @@ const Yr = (t, e) => {
|
|
|
3154
3110
|
from: "Chart.addPlugin"
|
|
3155
3111
|
}));
|
|
3156
3112
|
} catch (x) {
|
|
3157
|
-
console.error(
|
|
3113
|
+
console.error(U(x));
|
|
3158
3114
|
}
|
|
3159
|
-
c.next([...c.getValue(),
|
|
3115
|
+
c.next([...c.getValue(), v]);
|
|
3160
3116
|
}
|
|
3161
|
-
function
|
|
3162
|
-
c.next(c.getValue().filter((x) => x._getId() !==
|
|
3117
|
+
function I(v) {
|
|
3118
|
+
c.next(c.getValue().filter((x) => x._getId() !== v));
|
|
3163
3119
|
}
|
|
3164
|
-
function l(
|
|
3120
|
+
function l(v) {
|
|
3165
3121
|
try {
|
|
3166
|
-
const { status: _, columnName: P, expectToBe: j } = pt(
|
|
3122
|
+
const { status: _, columnName: P, expectToBe: j } = pt(v);
|
|
3167
3123
|
if (_ === "error")
|
|
3168
3124
|
throw new Error(Q({
|
|
3169
3125
|
columnName: P,
|
|
@@ -3176,49 +3132,49 @@ const Yr = (t, e) => {
|
|
|
3176
3132
|
from: "Chart.updateTheme"
|
|
3177
3133
|
}));
|
|
3178
3134
|
} catch (_) {
|
|
3179
|
-
console.error(
|
|
3135
|
+
console.error(U(_));
|
|
3180
3136
|
}
|
|
3181
|
-
const x =
|
|
3137
|
+
const x = q(a.getValue(), v);
|
|
3182
3138
|
a.next(x);
|
|
3183
3139
|
}
|
|
3184
|
-
function
|
|
3185
|
-
a.next(
|
|
3140
|
+
function g(v) {
|
|
3141
|
+
a.next(v);
|
|
3186
3142
|
}
|
|
3187
3143
|
function T() {
|
|
3188
3144
|
return a.getValue();
|
|
3189
3145
|
}
|
|
3190
3146
|
function B() {
|
|
3191
|
-
r.next(void 0),
|
|
3147
|
+
r.next(void 0), c.getValue().forEach((v) => v.destroy()), $r(t), A = null;
|
|
3192
3148
|
}
|
|
3193
3149
|
return {
|
|
3194
3150
|
resize: b,
|
|
3195
3151
|
setData: O,
|
|
3196
3152
|
// setEncoding,
|
|
3197
|
-
updateEncoding:
|
|
3153
|
+
updateEncoding: C,
|
|
3198
3154
|
forceReplaceEncoding: h,
|
|
3199
3155
|
getEncoding: p,
|
|
3200
3156
|
setPlugins: E,
|
|
3201
3157
|
addPlugin: k,
|
|
3202
|
-
removePlugin:
|
|
3158
|
+
removePlugin: I,
|
|
3203
3159
|
// setTheme,
|
|
3204
3160
|
updateTheme: l,
|
|
3205
|
-
forceReplaceTheme:
|
|
3161
|
+
forceReplaceTheme: g,
|
|
3206
3162
|
getTheme: T,
|
|
3207
3163
|
destroy: B,
|
|
3208
3164
|
context: y
|
|
3209
3165
|
};
|
|
3210
3166
|
})();
|
|
3211
3167
|
};
|
|
3212
|
-
class
|
|
3168
|
+
class qr {
|
|
3213
3169
|
constructor(e, r) {
|
|
3214
|
-
return
|
|
3170
|
+
return Nr(e, r);
|
|
3215
3171
|
}
|
|
3216
3172
|
}
|
|
3217
3173
|
const mt = (t, e, r) => {
|
|
3218
3174
|
let n = e.name, s = () => {
|
|
3219
3175
|
};
|
|
3220
3176
|
const o = new N(null), u = o.pipe(
|
|
3221
|
-
|
|
3177
|
+
de((h) => h !== null)
|
|
3222
3178
|
), a = e.layers.map((h) => new h()), c = {
|
|
3223
3179
|
// 將陣列轉成字典
|
|
3224
3180
|
...a.reduce((h, p) => (h[p._name] = p, h), {})
|
|
@@ -3231,15 +3187,15 @@ const mt = (t, e, r) => {
|
|
|
3231
3187
|
}, w = a.reduce((h, p) => (p._initShow && h.push(p._name), h), []), S = f(r), y = new N(
|
|
3232
3188
|
new Set(S.length > 0 ? S : w)
|
|
3233
3189
|
), A = y.pipe(
|
|
3234
|
-
|
|
3190
|
+
z((h) => Array.from(h).map((E) => {
|
|
3235
3191
|
var k;
|
|
3236
3192
|
return [
|
|
3237
3193
|
E,
|
|
3238
|
-
((k = a.find((
|
|
3194
|
+
((k = a.find((I) => I._name === E)) == null ? void 0 : k._layerIndex) ?? -1
|
|
3239
3195
|
];
|
|
3240
3196
|
}).filter(([, E]) => E !== -1).sort((E, k) => E[1] - k[1]).map(([E]) => E))
|
|
3241
3197
|
);
|
|
3242
|
-
let
|
|
3198
|
+
let m = q(
|
|
3243
3199
|
e.defaultParams ?? {},
|
|
3244
3200
|
r ?? {}
|
|
3245
3201
|
);
|
|
@@ -3248,74 +3204,80 @@ const mt = (t, e, r) => {
|
|
|
3248
3204
|
), b = new oe(), O = new R((h) => {
|
|
3249
3205
|
d.subscribe((p) => {
|
|
3250
3206
|
try {
|
|
3251
|
-
const { status: E, columnName: k, expectToBe:
|
|
3207
|
+
const { status: E, columnName: k, expectToBe: I } = e.validator(p);
|
|
3252
3208
|
if (E === "error")
|
|
3253
3209
|
throw new Error(Q({
|
|
3254
3210
|
columnName: k,
|
|
3255
|
-
expectToBe:
|
|
3211
|
+
expectToBe: I,
|
|
3256
3212
|
from: `${e.name}.params$`
|
|
3257
3213
|
}));
|
|
3258
3214
|
E === "warning" && console.warn(X({
|
|
3259
3215
|
columnName: k,
|
|
3260
|
-
expectToBe:
|
|
3216
|
+
expectToBe: I,
|
|
3261
3217
|
from: `${e.name}.params$`
|
|
3262
3218
|
}));
|
|
3263
3219
|
} catch (E) {
|
|
3264
|
-
console.error(
|
|
3220
|
+
console.error(U(E));
|
|
3265
3221
|
}
|
|
3266
|
-
h.next(
|
|
3222
|
+
h.next(m);
|
|
3267
3223
|
}), b.subscribe((p) => {
|
|
3268
3224
|
h.next(p);
|
|
3269
3225
|
});
|
|
3270
|
-
}),
|
|
3271
|
-
|
|
3226
|
+
}), C = u.pipe(
|
|
3227
|
+
z((h) => ({
|
|
3272
3228
|
context: h,
|
|
3273
3229
|
// 初始化時 context 有可能被 in place 擴展
|
|
3274
3230
|
pluginParams$: O
|
|
3275
|
-
}))
|
|
3276
|
-
|
|
3277
|
-
//
|
|
3231
|
+
}))
|
|
3232
|
+
// 不能用 first():同一個 plugin 物件可能被重新 _injectContext() 綁定到
|
|
3233
|
+
// 「另一個」全新的 chart instance(例如呼叫端銷毀舊 chart 後、沿用同一組
|
|
3234
|
+
// plugin 物件建立新 chart——React StrictMode 的掛載→清除→再掛載就是這種
|
|
3235
|
+
// 情境)。first() 只接受第一次注入的 context、之後永久 complete,會讓後續
|
|
3236
|
+
// 重新注入的 context 被靜靜地忽略,導致新 chart 的這個 plugin 永遠不會
|
|
3237
|
+
// 觸發 _updateLayerElements/_enable,畫面呈現「plugin 已建立、layer 群組
|
|
3238
|
+
// 存在,但沒有畫出任何圖形」(保留 pluginSetupProps$ 為 hot、可重複觸發)。
|
|
3278
3239
|
);
|
|
3279
3240
|
return H({
|
|
3280
|
-
pluginSetupProps:
|
|
3241
|
+
pluginSetupProps: C,
|
|
3281
3242
|
ShownLayerNameSet: y,
|
|
3282
3243
|
shownLayerNamesSeq: A
|
|
3283
3244
|
}).pipe(
|
|
3284
|
-
|
|
3245
|
+
G(0)
|
|
3285
3246
|
).subscribe(({ pluginSetupProps: h, ShownLayerNameSet: p, shownLayerNamesSeq: E }) => {
|
|
3247
|
+
s();
|
|
3286
3248
|
const k = h.context._updateLayerElements(
|
|
3287
3249
|
t,
|
|
3288
3250
|
n,
|
|
3289
|
-
E.map((
|
|
3251
|
+
E.map((I) => ({
|
|
3290
3252
|
pluginId: n,
|
|
3291
3253
|
pluginName: e.name,
|
|
3292
|
-
layerName:
|
|
3293
|
-
layerIndex: c[
|
|
3254
|
+
layerName: I,
|
|
3255
|
+
layerIndex: c[I]._layerIndex
|
|
3294
3256
|
}))
|
|
3295
3257
|
);
|
|
3296
|
-
e.setup && (s = e.setup(h)), a.forEach((
|
|
3297
|
-
var l,
|
|
3298
|
-
if (p.has(
|
|
3258
|
+
e.setup && (s = e.setup(h)), a.forEach((I) => {
|
|
3259
|
+
var l, g;
|
|
3260
|
+
if (p.has(I._name)) {
|
|
3299
3261
|
const T = t === "svg" ? {
|
|
3300
3262
|
// svgG: (pluginSetupProps as PluginSetupProps<'svg', ExtendContext, PluginParams>).svgG.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3301
|
-
svgG: k[
|
|
3263
|
+
svgG: k[I._name],
|
|
3302
3264
|
// canvas: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3303
3265
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3304
3266
|
context: h.context,
|
|
3305
3267
|
pluginParams$: O,
|
|
3306
|
-
initLayerParams: ((l = d.getValue()) == null ? void 0 : l[
|
|
3268
|
+
initLayerParams: ((l = d.getValue()) == null ? void 0 : l[I._name]) || {}
|
|
3307
3269
|
} : {
|
|
3308
3270
|
// svgG: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3309
3271
|
// canvas: (pluginSetupProps as PluginSetupProps<'canvas', ExtendContext, PluginParams>).canvas.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3310
|
-
canvas: k[
|
|
3272
|
+
canvas: k[I._name],
|
|
3311
3273
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3312
3274
|
context: h.context,
|
|
3313
3275
|
pluginParams$: O,
|
|
3314
|
-
initLayerParams: ((
|
|
3276
|
+
initLayerParams: ((g = d.getValue()) == null ? void 0 : g[I._name]) || {}
|
|
3315
3277
|
};
|
|
3316
|
-
|
|
3278
|
+
I._enable(T);
|
|
3317
3279
|
} else
|
|
3318
|
-
|
|
3280
|
+
I._disable();
|
|
3319
3281
|
});
|
|
3320
3282
|
}), {
|
|
3321
3283
|
// name: `${config.name}-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -3362,19 +3324,19 @@ const mt = (t, e, r) => {
|
|
|
3362
3324
|
// params = { ...params, ...partial }
|
|
3363
3325
|
// },
|
|
3364
3326
|
updateParams: (h) => {
|
|
3365
|
-
|
|
3327
|
+
m = q(m, h), d.next(h), Object.keys(h).forEach((p) => {
|
|
3366
3328
|
const E = c[p];
|
|
3367
3329
|
E && E._updateParams(h[p]);
|
|
3368
3330
|
});
|
|
3369
3331
|
},
|
|
3370
3332
|
forceReplaceParams: (h) => {
|
|
3371
|
-
|
|
3333
|
+
m = h, b.next(h), Object.keys(h).forEach((p) => {
|
|
3372
3334
|
const E = c[p];
|
|
3373
3335
|
E && E._forceReplaceParams(h[p]);
|
|
3374
3336
|
});
|
|
3375
3337
|
},
|
|
3376
3338
|
getParams: () => {
|
|
3377
|
-
const h = Object.assign({},
|
|
3339
|
+
const h = Object.assign({}, m);
|
|
3378
3340
|
return a.forEach((p) => {
|
|
3379
3341
|
h[p._name] = p._getParams();
|
|
3380
3342
|
}), h;
|
|
@@ -3404,7 +3366,7 @@ const mt = (t, e, r) => {
|
|
|
3404
3366
|
// }
|
|
3405
3367
|
// }),
|
|
3406
3368
|
destroy: () => {
|
|
3407
|
-
s(),
|
|
3369
|
+
s(), a.forEach((h) => {
|
|
3408
3370
|
h._destroy();
|
|
3409
3371
|
});
|
|
3410
3372
|
}
|
|
@@ -3413,7 +3375,7 @@ const mt = (t, e, r) => {
|
|
|
3413
3375
|
// subscriber.next(params)
|
|
3414
3376
|
// })
|
|
3415
3377
|
};
|
|
3416
|
-
},
|
|
3378
|
+
}, Wr = (t) => class {
|
|
3417
3379
|
constructor(r) {
|
|
3418
3380
|
return mt("svg", t, r);
|
|
3419
3381
|
}
|
|
@@ -3422,13 +3384,13 @@ const mt = (t, e, r) => {
|
|
|
3422
3384
|
let n = () => {
|
|
3423
3385
|
};
|
|
3424
3386
|
const s = new N(null), o = s.pipe(
|
|
3425
|
-
|
|
3387
|
+
de((u) => u !== null)
|
|
3426
3388
|
);
|
|
3427
3389
|
return H({
|
|
3428
3390
|
layerParams: r,
|
|
3429
3391
|
enabledProps: o
|
|
3430
3392
|
}).pipe(
|
|
3431
|
-
|
|
3393
|
+
G(0)
|
|
3432
3394
|
).subscribe(({ layerParams: u, enabledProps: a }) => {
|
|
3433
3395
|
n(), n = t === "svg" ? e.setup({
|
|
3434
3396
|
svgG: a.svgG,
|
|
@@ -3437,7 +3399,7 @@ const mt = (t, e, r) => {
|
|
|
3437
3399
|
context: a.context,
|
|
3438
3400
|
pluginParams$: a.pluginParams$,
|
|
3439
3401
|
layerParams$: r.pipe(
|
|
3440
|
-
|
|
3402
|
+
z((c) => q(c, a.initLayerParams ?? {}))
|
|
3441
3403
|
)
|
|
3442
3404
|
}) : e.setup({
|
|
3443
3405
|
// svgG: enabledProps.svgG,
|
|
@@ -3446,10 +3408,10 @@ const mt = (t, e, r) => {
|
|
|
3446
3408
|
context: a.context,
|
|
3447
3409
|
pluginParams$: a.pluginParams$,
|
|
3448
3410
|
layerParams$: r.pipe(
|
|
3449
|
-
|
|
3411
|
+
z((c) => q(c, a.initLayerParams ?? {}))
|
|
3450
3412
|
)
|
|
3451
3413
|
});
|
|
3452
|
-
}), s.pipe(
|
|
3414
|
+
}), s.pipe(de((u) => u === null)).subscribe(() => {
|
|
3453
3415
|
n();
|
|
3454
3416
|
}), {
|
|
3455
3417
|
_name: e.name,
|
|
@@ -3480,9 +3442,9 @@ const mt = (t, e, r) => {
|
|
|
3480
3442
|
from: `${e.name}.params$`
|
|
3481
3443
|
}));
|
|
3482
3444
|
} catch (c) {
|
|
3483
|
-
console.error(
|
|
3445
|
+
console.error(U(c));
|
|
3484
3446
|
}
|
|
3485
|
-
const a =
|
|
3447
|
+
const a = q(r.getValue(), u);
|
|
3486
3448
|
r.next(a);
|
|
3487
3449
|
},
|
|
3488
3450
|
_forceReplaceParams: (u) => {
|
|
@@ -3495,57 +3457,57 @@ const mt = (t, e, r) => {
|
|
|
3495
3457
|
// enableProps$.next(true)
|
|
3496
3458
|
// },
|
|
3497
3459
|
_destroy: () => {
|
|
3498
|
-
s.next(null)
|
|
3460
|
+
s.next(null);
|
|
3499
3461
|
}
|
|
3500
3462
|
};
|
|
3501
|
-
},
|
|
3463
|
+
}, Zr = (t) => class {
|
|
3502
3464
|
constructor() {
|
|
3503
3465
|
return gt("svg", t);
|
|
3504
3466
|
}
|
|
3505
|
-
},
|
|
3467
|
+
}, Hr = (t) => class {
|
|
3506
3468
|
constructor(r) {
|
|
3507
3469
|
return mt("canvas", t, r);
|
|
3508
3470
|
}
|
|
3509
|
-
},
|
|
3471
|
+
}, Xr = (t) => class {
|
|
3510
3472
|
constructor() {
|
|
3511
3473
|
return gt("canvas", t);
|
|
3512
3474
|
}
|
|
3513
3475
|
};
|
|
3514
3476
|
export {
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3477
|
+
qr as OrbCharts,
|
|
3478
|
+
ve as aggregate,
|
|
3479
|
+
Er as count,
|
|
3518
3480
|
ht as createCanvas,
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3481
|
+
zr as createCanvasElement,
|
|
3482
|
+
Gr as createDiv,
|
|
3483
|
+
Ir as createLayerClassName,
|
|
3522
3484
|
yt as createMessagePrefix,
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3485
|
+
U as createOrbChartsErrorMessage,
|
|
3486
|
+
Cr as createPluginClassName,
|
|
3487
|
+
_r as createSVG,
|
|
3488
|
+
Tr as createSVGGroup,
|
|
3489
|
+
ye as createUnexpectedErrorMessage,
|
|
3528
3490
|
Q as createValidatorErrorMessage,
|
|
3529
3491
|
X as createValidatorWarningMessage,
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3492
|
+
q as deepOverwrite,
|
|
3493
|
+
Xr as defineCanvasLayer,
|
|
3494
|
+
Hr as defineCanvasPlugin,
|
|
3495
|
+
Zr as defineSVGLayer,
|
|
3496
|
+
Wr as defineSVGPlugin,
|
|
3497
|
+
Ur as formatCommaNumber,
|
|
3536
3498
|
D as getColorByFrom,
|
|
3537
|
-
|
|
3499
|
+
Ar as getColorByIndex,
|
|
3538
3500
|
ft as isDom,
|
|
3539
|
-
|
|
3501
|
+
Sr as isFunction,
|
|
3540
3502
|
ee as isPlainObject,
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3503
|
+
wr as max,
|
|
3504
|
+
mr as mean,
|
|
3505
|
+
gr as median,
|
|
3506
|
+
br as min,
|
|
3507
|
+
xr as none,
|
|
3508
|
+
$r as removeElementChildren,
|
|
3509
|
+
Or as resizeObservable,
|
|
3548
3510
|
$ as resolveGroupKey,
|
|
3549
|
-
|
|
3511
|
+
vr as sum,
|
|
3550
3512
|
K as validateObject
|
|
3551
3513
|
};
|