@orbcharts/core 4.0.0-alpha.0 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orbcharts-core.es.js +942 -925
- package/dist/orbcharts-core.umd.js +3 -3
- package/dist/src/types/Plugin.d.ts +1 -1
- package/package.json +1 -1
- package/src/chart/createChart.ts +37 -3
- package/src/plugin/createPlugin.ts +33 -15
- package/src/types/Plugin.ts +4 -1
- package/src/utils/validator.ts +10 -0
|
@@ -5,7 +5,7 @@ var Se = function(t, e) {
|
|
|
5
5
|
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
|
|
6
6
|
}, Se(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
|
Se(t, e);
|
|
@@ -21,22 +21,22 @@ function gt(t, e, r, n) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
return new (r || (r = Promise))(function(s, u) {
|
|
24
|
-
function a(
|
|
24
|
+
function a(f) {
|
|
25
25
|
try {
|
|
26
|
-
i(n.next(
|
|
27
|
-
} catch (
|
|
28
|
-
u(
|
|
26
|
+
i(n.next(f));
|
|
27
|
+
} catch (w) {
|
|
28
|
+
u(w);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function l(
|
|
31
|
+
function l(f) {
|
|
32
32
|
try {
|
|
33
|
-
i(n.throw(
|
|
34
|
-
} catch (
|
|
35
|
-
u(
|
|
33
|
+
i(n.throw(f));
|
|
34
|
+
} catch (w) {
|
|
35
|
+
u(w);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function i(
|
|
39
|
-
|
|
38
|
+
function i(f) {
|
|
39
|
+
f.done ? s(f.value) : o(f.value).then(a, l);
|
|
40
40
|
}
|
|
41
41
|
i((n = n.apply(t, e || [])).next());
|
|
42
42
|
});
|
|
@@ -50,8 +50,8 @@ function Ue(t, e) {
|
|
|
50
50
|
return this;
|
|
51
51
|
}), u;
|
|
52
52
|
function a(i) {
|
|
53
|
-
return function(
|
|
54
|
-
return l([i,
|
|
53
|
+
return function(f) {
|
|
54
|
+
return l([i, f]);
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
function l(i) {
|
|
@@ -92,8 +92,8 @@ function Ue(t, e) {
|
|
|
92
92
|
continue;
|
|
93
93
|
}
|
|
94
94
|
i = e.call(t, r);
|
|
95
|
-
} catch (
|
|
96
|
-
i = [6,
|
|
95
|
+
} catch (f) {
|
|
96
|
+
i = [6, f], o = 0;
|
|
97
97
|
} finally {
|
|
98
98
|
n = s = 0;
|
|
99
99
|
}
|
|
@@ -142,36 +142,36 @@ function bt(t, e, r) {
|
|
|
142
142
|
return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", u), o[Symbol.asyncIterator] = function() {
|
|
143
143
|
return this;
|
|
144
144
|
}, o;
|
|
145
|
-
function u(
|
|
146
|
-
return function(
|
|
147
|
-
return Promise.resolve(
|
|
145
|
+
function u(y) {
|
|
146
|
+
return function(A) {
|
|
147
|
+
return Promise.resolve(A).then(y, w);
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
function a(
|
|
151
|
-
n[
|
|
152
|
-
return new Promise(function(d,
|
|
153
|
-
s.push([
|
|
150
|
+
function a(y, A) {
|
|
151
|
+
n[y] && (o[y] = function(m) {
|
|
152
|
+
return new Promise(function(d, b) {
|
|
153
|
+
s.push([y, m, d, b]) > 1 || l(y, m);
|
|
154
154
|
});
|
|
155
|
-
},
|
|
155
|
+
}, A && (o[y] = A(o[y])));
|
|
156
156
|
}
|
|
157
|
-
function l(
|
|
157
|
+
function l(y, A) {
|
|
158
158
|
try {
|
|
159
|
-
i(n[
|
|
160
|
-
} catch (
|
|
161
|
-
|
|
159
|
+
i(n[y](A));
|
|
160
|
+
} catch (m) {
|
|
161
|
+
S(s[0][3], m);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function i(
|
|
165
|
-
|
|
164
|
+
function i(y) {
|
|
165
|
+
y.value instanceof ie ? Promise.resolve(y.value.v).then(f, w) : S(s[0][2], y);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
l("next",
|
|
167
|
+
function f(y) {
|
|
168
|
+
l("next", y);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
l("throw",
|
|
170
|
+
function w(y) {
|
|
171
|
+
l("throw", y);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
173
|
+
function S(y, A) {
|
|
174
|
+
y(A), s.shift(), s.length && l(s[0][0], s[0][1]);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
function wt(t) {
|
|
@@ -193,7 +193,7 @@ function wt(t) {
|
|
|
193
193
|
}, u);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function L(t) {
|
|
197
197
|
return typeof t == "function";
|
|
198
198
|
}
|
|
199
199
|
function Te(t) {
|
|
@@ -233,8 +233,8 @@ var de = function() {
|
|
|
233
233
|
var i = l.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
|
l && !l.done && (r = a.return) && r.call(a);
|
|
@@ -244,30 +244,30 @@ var de = function() {
|
|
|
244
244
|
}
|
|
245
245
|
else
|
|
246
246
|
u.remove(this);
|
|
247
|
-
var
|
|
248
|
-
if (
|
|
247
|
+
var f = this.initialTeardown;
|
|
248
|
+
if (L(f))
|
|
249
249
|
try {
|
|
250
|
-
|
|
251
|
-
} catch (
|
|
252
|
-
s =
|
|
250
|
+
f();
|
|
251
|
+
} catch (m) {
|
|
252
|
+
s = m instanceof xe ? m.errors : [m];
|
|
253
253
|
}
|
|
254
|
-
var
|
|
255
|
-
if (
|
|
254
|
+
var w = this._finalizers;
|
|
255
|
+
if (w) {
|
|
256
256
|
this._finalizers = null;
|
|
257
257
|
try {
|
|
258
|
-
for (var
|
|
259
|
-
var
|
|
258
|
+
for (var S = ue(w), y = S.next(); !y.done; y = S.next()) {
|
|
259
|
+
var A = y.value;
|
|
260
260
|
try {
|
|
261
|
-
|
|
262
|
-
} catch (
|
|
263
|
-
s = s ?? [],
|
|
261
|
+
je(A);
|
|
262
|
+
} catch (m) {
|
|
263
|
+
s = s ?? [], m instanceof xe ? s = ce(ce([], le(s)), le(m.errors)) : s.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 && (o = S.return) && o.call(S);
|
|
271
271
|
} finally {
|
|
272
272
|
if (n) throw n.error;
|
|
273
273
|
}
|
|
@@ -280,7 +280,7 @@ var de = function() {
|
|
|
280
280
|
var r;
|
|
281
281
|
if (e && e !== this)
|
|
282
282
|
if (this.closed)
|
|
283
|
-
|
|
283
|
+
je(e);
|
|
284
284
|
else {
|
|
285
285
|
if (e instanceof t) {
|
|
286
286
|
if (e.closed || e._hasParent(this))
|
|
@@ -307,10 +307,10 @@ var de = function() {
|
|
|
307
307
|
}(), t;
|
|
308
308
|
}(), ze = de.EMPTY;
|
|
309
309
|
function qe(t) {
|
|
310
|
-
return t instanceof de || t && "closed" in t &&
|
|
310
|
+
return t instanceof de || t && "closed" in t && L(t.remove) && L(t.add) && L(t.unsubscribe);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
|
|
312
|
+
function je(t) {
|
|
313
|
+
L(t) ? t() : t.unsubscribe();
|
|
314
314
|
}
|
|
315
315
|
var Et = {
|
|
316
316
|
Promise: void 0
|
|
@@ -336,7 +336,7 @@ function be(t) {
|
|
|
336
336
|
t();
|
|
337
337
|
}
|
|
338
338
|
var Oe = function(t) {
|
|
339
|
-
|
|
339
|
+
Y(e, t);
|
|
340
340
|
function e(r) {
|
|
341
341
|
var n = t.call(this) || this;
|
|
342
342
|
return n.isStopped = !1, r ? (n.destination = r, qe(r) && r.add(n)) : n.destination = _t, n;
|
|
@@ -398,10 +398,10 @@ var Oe = function(t) {
|
|
|
398
398
|
}
|
|
399
399
|
}, t;
|
|
400
400
|
}(), he = function(t) {
|
|
401
|
-
|
|
401
|
+
Y(e, t);
|
|
402
402
|
function e(r, n, o) {
|
|
403
403
|
var s = t.call(this) || this, u;
|
|
404
|
-
return
|
|
404
|
+
return L(r) || !r ? u = {
|
|
405
405
|
next: r ?? void 0,
|
|
406
406
|
error: n ?? void 0,
|
|
407
407
|
complete: o ?? void 0
|
|
@@ -454,7 +454,7 @@ var R = function() {
|
|
|
454
454
|
}
|
|
455
455
|
}, t.prototype.forEach = function(e, r) {
|
|
456
456
|
var n = this;
|
|
457
|
-
return r =
|
|
457
|
+
return r = ke(r), new r(function(o, s) {
|
|
458
458
|
var u = new he({
|
|
459
459
|
next: function(a) {
|
|
460
460
|
try {
|
|
@@ -479,7 +479,7 @@ var R = function() {
|
|
|
479
479
|
return $t(e)(this);
|
|
480
480
|
}, t.prototype.toPromise = function(e) {
|
|
481
481
|
var r = this;
|
|
482
|
-
return e =
|
|
482
|
+
return e = ke(e), new e(function(n, o) {
|
|
483
483
|
var s;
|
|
484
484
|
r.subscribe(function(u) {
|
|
485
485
|
return s = u;
|
|
@@ -493,18 +493,18 @@ var R = function() {
|
|
|
493
493
|
return new t(e);
|
|
494
494
|
}, t;
|
|
495
495
|
}();
|
|
496
|
-
function
|
|
496
|
+
function ke(t) {
|
|
497
497
|
var e;
|
|
498
498
|
return (e = t ?? Et.Promise) !== null && e !== void 0 ? e : Promise;
|
|
499
499
|
}
|
|
500
500
|
function Tt(t) {
|
|
501
|
-
return t &&
|
|
501
|
+
return t && L(t.next) && L(t.error) && L(t.complete);
|
|
502
502
|
}
|
|
503
503
|
function Ot(t) {
|
|
504
504
|
return t && t instanceof Oe || Tt(t) && qe(t);
|
|
505
505
|
}
|
|
506
506
|
function It(t) {
|
|
507
|
-
return
|
|
507
|
+
return L(t == null ? void 0 : t.lift);
|
|
508
508
|
}
|
|
509
509
|
function U(t) {
|
|
510
510
|
return function(e) {
|
|
@@ -523,20 +523,20 @@ function N(t, e, r, n, o) {
|
|
|
523
523
|
return new Ct(t, e, r, n, o);
|
|
524
524
|
}
|
|
525
525
|
var Ct = function(t) {
|
|
526
|
-
|
|
526
|
+
Y(e, t);
|
|
527
527
|
function e(r, n, o, s, u, a) {
|
|
528
528
|
var l = t.call(this, r) || this;
|
|
529
529
|
return l.onFinalize = u, l.shouldUnsubscribe = a, l._next = n ? function(i) {
|
|
530
530
|
try {
|
|
531
531
|
n(i);
|
|
532
|
-
} catch (
|
|
533
|
-
r.error(
|
|
532
|
+
} catch (f) {
|
|
533
|
+
r.error(f);
|
|
534
534
|
}
|
|
535
535
|
} : t.prototype._next, l._error = s ? function(i) {
|
|
536
536
|
try {
|
|
537
537
|
s(i);
|
|
538
|
-
} catch (
|
|
539
|
-
r.error(
|
|
538
|
+
} catch (f) {
|
|
539
|
+
r.error(f);
|
|
540
540
|
} finally {
|
|
541
541
|
this.unsubscribe();
|
|
542
542
|
}
|
|
@@ -562,13 +562,13 @@ var Ct = function(t) {
|
|
|
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;
|
|
569
569
|
}
|
|
570
570
|
return e.prototype.lift = function(r) {
|
|
571
|
-
var n = new
|
|
571
|
+
var n = new Me(this, this);
|
|
572
572
|
return n.operator = r, n;
|
|
573
573
|
}, e.prototype._throwIfClosed = function() {
|
|
574
574
|
if (this.closed)
|
|
@@ -638,10 +638,10 @@ var Ct = function(t) {
|
|
|
638
638
|
var r = new R();
|
|
639
639
|
return r.source = this, r;
|
|
640
640
|
}, e.create = function(r, n) {
|
|
641
|
-
return new
|
|
641
|
+
return new Me(r, n);
|
|
642
642
|
}, e;
|
|
643
|
-
}(R),
|
|
644
|
-
|
|
643
|
+
}(R), Me = function(t) {
|
|
644
|
+
Y(e, t);
|
|
645
645
|
function e(r, n) {
|
|
646
646
|
var o = t.call(this) || this;
|
|
647
647
|
return o.destination = r, o.source = n, o;
|
|
@@ -660,7 +660,7 @@ var Ct = function(t) {
|
|
|
660
660
|
return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r)) !== null && o !== void 0 ? o : ze;
|
|
661
661
|
}, e;
|
|
662
662
|
}(oe), D = 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 Ct = function(t) {
|
|
|
688
688
|
},
|
|
689
689
|
delegate: void 0
|
|
690
690
|
}, Pt = function(t) {
|
|
691
|
-
|
|
691
|
+
Y(e, t);
|
|
692
692
|
function e(r, n, o) {
|
|
693
693
|
r === void 0 && (r = 1 / 0), n === void 0 && (n = 1 / 0), o === void 0 && (o = Ce);
|
|
694
694
|
var s = t.call(this) || this;
|
|
@@ -705,13 +705,13 @@ var Ct = function(t) {
|
|
|
705
705
|
}, e.prototype._trimBuffer = function() {
|
|
706
706
|
var r = this, n = r._bufferSize, o = r._timestampProvider, s = r._buffer, u = r._infiniteTimeWindow, a = (u ? 1 : 2) * n;
|
|
707
707
|
if (n < 1 / 0 && a < s.length && s.splice(0, s.length - a), !u) {
|
|
708
|
-
for (var l = o.now(), i = 0,
|
|
709
|
-
i =
|
|
708
|
+
for (var l = o.now(), i = 0, f = 1; f < s.length && s[f] <= l; f += 2)
|
|
709
|
+
i = f;
|
|
710
710
|
i && s.splice(0, i + 1);
|
|
711
711
|
}
|
|
712
712
|
}, e;
|
|
713
|
-
}(oe),
|
|
714
|
-
|
|
713
|
+
}(oe), jt = function(t) {
|
|
714
|
+
Y(e, t);
|
|
715
715
|
function e(r, n) {
|
|
716
716
|
return t.call(this) || this;
|
|
717
717
|
}
|
|
@@ -728,8 +728,8 @@ var Ct = function(t) {
|
|
|
728
728
|
return clearInterval(t);
|
|
729
729
|
},
|
|
730
730
|
delegate: void 0
|
|
731
|
-
},
|
|
732
|
-
|
|
731
|
+
}, kt = function(t) {
|
|
732
|
+
Y(e, t);
|
|
733
733
|
function e(r, n) {
|
|
734
734
|
var o = t.call(this, r, n) || this;
|
|
735
735
|
return o.scheduler = r, o.work = n, o.pending = !1, o;
|
|
@@ -770,15 +770,15 @@ var Ct = function(t) {
|
|
|
770
770
|
this.work = this.state = this.scheduler = null, this.pending = !1, we(s, this), n != null && (this.id = this.recycleAsyncId(o, n, null)), this.delay = null, t.prototype.unsubscribe.call(this);
|
|
771
771
|
}
|
|
772
772
|
}, e;
|
|
773
|
-
}(
|
|
773
|
+
}(jt), Ve = function() {
|
|
774
774
|
function t(e, r) {
|
|
775
775
|
r === void 0 && (r = t.now), this.schedulerActionCtor = e, this.now = r;
|
|
776
776
|
}
|
|
777
777
|
return t.prototype.schedule = function(e, r, n) {
|
|
778
778
|
return r === void 0 && (r = 0), new this.schedulerActionCtor(this, e).schedule(n, r);
|
|
779
779
|
}, t.now = Ce.now, t;
|
|
780
|
-
}(),
|
|
781
|
-
|
|
780
|
+
}(), Mt = function(t) {
|
|
781
|
+
Y(e, t);
|
|
782
782
|
function e(r, n) {
|
|
783
783
|
n === void 0 && (n = Ve.now);
|
|
784
784
|
var o = t.call(this, r, n) || this;
|
|
@@ -802,17 +802,17 @@ var Ct = function(t) {
|
|
|
802
802
|
throw o;
|
|
803
803
|
}
|
|
804
804
|
}, e;
|
|
805
|
-
}(Ve), Lt = new
|
|
805
|
+
}(Ve), Lt = new Mt(kt), se = new R(function(t) {
|
|
806
806
|
return t.complete();
|
|
807
807
|
});
|
|
808
808
|
function Vt(t) {
|
|
809
|
-
return t &&
|
|
809
|
+
return t && L(t.schedule);
|
|
810
810
|
}
|
|
811
811
|
function We(t) {
|
|
812
812
|
return t[t.length - 1];
|
|
813
813
|
}
|
|
814
814
|
function Rt(t) {
|
|
815
|
-
return
|
|
815
|
+
return L(We(t)) ? t.pop() : void 0;
|
|
816
816
|
}
|
|
817
817
|
function Ye(t) {
|
|
818
818
|
return Vt(We(t)) ? t.pop() : void 0;
|
|
@@ -821,13 +821,13 @@ var Ze = function(t) {
|
|
|
821
821
|
return t && typeof t.length == "number" && typeof t != "function";
|
|
822
822
|
};
|
|
823
823
|
function Je(t) {
|
|
824
|
-
return
|
|
824
|
+
return L(t == null ? void 0 : t.then);
|
|
825
825
|
}
|
|
826
826
|
function He(t) {
|
|
827
|
-
return
|
|
827
|
+
return L(t[Ie]);
|
|
828
828
|
}
|
|
829
829
|
function Qe(t) {
|
|
830
|
-
return Symbol.asyncIterator &&
|
|
830
|
+
return Symbol.asyncIterator && L(t == null ? void 0 : t[Symbol.asyncIterator]);
|
|
831
831
|
}
|
|
832
832
|
function Xe(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.");
|
|
@@ -837,7 +837,7 @@ function Kt() {
|
|
|
837
837
|
}
|
|
838
838
|
var et = Kt();
|
|
839
839
|
function tt(t) {
|
|
840
|
-
return
|
|
840
|
+
return L(t == null ? void 0 : t[et]);
|
|
841
841
|
}
|
|
842
842
|
function rt(t) {
|
|
843
843
|
return bt(this, arguments, function() {
|
|
@@ -871,9 +871,9 @@ function rt(t) {
|
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
873
|
function nt(t) {
|
|
874
|
-
return
|
|
874
|
+
return L(t == null ? void 0 : t.getReader);
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function ee(t) {
|
|
877
877
|
if (t instanceof R)
|
|
878
878
|
return t;
|
|
879
879
|
if (t != null) {
|
|
@@ -895,7 +895,7 @@ function X(t) {
|
|
|
895
895
|
function Ft(t) {
|
|
896
896
|
return new R(function(e) {
|
|
897
897
|
var r = t[Ie]();
|
|
898
|
-
if (
|
|
898
|
+
if (L(r.subscribe))
|
|
899
899
|
return r.subscribe(e);
|
|
900
900
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
901
901
|
});
|
|
@@ -985,7 +985,7 @@ function qt(t, e) {
|
|
|
985
985
|
});
|
|
986
986
|
});
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function ne(t, e, r, n, o) {
|
|
989
989
|
n === void 0 && (n = 0), o === void 0 && (o = !1);
|
|
990
990
|
var s = e.schedule(function() {
|
|
991
991
|
r(), o ? t.add(this.schedule(null, n)) : this.unsubscribe();
|
|
@@ -996,15 +996,15 @@ function re(t, e, r, n, o) {
|
|
|
996
996
|
function st(t, e) {
|
|
997
997
|
return e === void 0 && (e = 0), U(function(r, n) {
|
|
998
998
|
r.subscribe(N(n, function(o) {
|
|
999
|
-
return
|
|
999
|
+
return ne(n, t, function() {
|
|
1000
1000
|
return n.next(o);
|
|
1001
1001
|
}, e);
|
|
1002
1002
|
}, function() {
|
|
1003
|
-
return
|
|
1003
|
+
return ne(n, t, function() {
|
|
1004
1004
|
return n.complete();
|
|
1005
1005
|
}, e);
|
|
1006
1006
|
}, function(o) {
|
|
1007
|
-
return
|
|
1007
|
+
return ne(n, t, function() {
|
|
1008
1008
|
return n.error(o);
|
|
1009
1009
|
}, e);
|
|
1010
1010
|
}));
|
|
@@ -1018,10 +1018,10 @@ function at(t, e) {
|
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
function Gt(t, e) {
|
|
1021
|
-
return
|
|
1021
|
+
return ee(t).pipe(at(e), st(e));
|
|
1022
1022
|
}
|
|
1023
1023
|
function Wt(t, e) {
|
|
1024
|
-
return
|
|
1024
|
+
return ee(t).pipe(at(e), st(e));
|
|
1025
1025
|
}
|
|
1026
1026
|
function Yt(t, e) {
|
|
1027
1027
|
return new R(function(r) {
|
|
@@ -1034,8 +1034,8 @@ function Yt(t, e) {
|
|
|
1034
1034
|
function Zt(t, e) {
|
|
1035
1035
|
return new R(function(r) {
|
|
1036
1036
|
var n;
|
|
1037
|
-
return
|
|
1038
|
-
n = t[et](),
|
|
1037
|
+
return ne(r, e, function() {
|
|
1038
|
+
n = t[et](), ne(r, e, function() {
|
|
1039
1039
|
var o, s, u;
|
|
1040
1040
|
try {
|
|
1041
1041
|
o = n.next(), s = o.value, u = o.done;
|
|
@@ -1046,7 +1046,7 @@ function Zt(t, e) {
|
|
|
1046
1046
|
u ? r.complete() : r.next(s);
|
|
1047
1047
|
}, 0, !0);
|
|
1048
1048
|
}), function() {
|
|
1049
|
-
return
|
|
1049
|
+
return L(n == null ? void 0 : n.return) && n.return();
|
|
1050
1050
|
};
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
@@ -1054,9 +1054,9 @@ function it(t, e) {
|
|
|
1054
1054
|
if (!t)
|
|
1055
1055
|
throw new Error("Iterable cannot be null");
|
|
1056
1056
|
return new R(function(r) {
|
|
1057
|
-
|
|
1057
|
+
ne(r, e, function() {
|
|
1058
1058
|
var n = t[Symbol.asyncIterator]();
|
|
1059
|
-
|
|
1059
|
+
ne(r, e, function() {
|
|
1060
1060
|
n.next().then(function(o) {
|
|
1061
1061
|
o.done ? r.complete() : r.next(o.value);
|
|
1062
1062
|
});
|
|
@@ -1085,7 +1085,7 @@ function Ht(t, e) {
|
|
|
1085
1085
|
throw Xe(t);
|
|
1086
1086
|
}
|
|
1087
1087
|
function Be(t, e) {
|
|
1088
|
-
return e ? Ht(t, e) :
|
|
1088
|
+
return e ? Ht(t, e) : ee(t);
|
|
1089
1089
|
}
|
|
1090
1090
|
function Qt() {
|
|
1091
1091
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
@@ -1141,7 +1141,7 @@ function ur(t, e) {
|
|
|
1141
1141
|
return r[n] = e[o], r;
|
|
1142
1142
|
}, {});
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function J() {
|
|
1145
1145
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
1146
1146
|
t[e] = arguments[e];
|
|
1147
1147
|
var r = Ye(t), n = Rt(t), o = ar(t), s = o.args, u = o.keys;
|
|
@@ -1155,11 +1155,11 @@ function Y() {
|
|
|
1155
1155
|
function lr(t, e, r) {
|
|
1156
1156
|
return r === void 0 && (r = me), function(n) {
|
|
1157
1157
|
Re(e, function() {
|
|
1158
|
-
for (var o = t.length, s = new Array(o), u = o, a = o, l = function(
|
|
1158
|
+
for (var o = t.length, s = new Array(o), u = o, a = o, l = function(f) {
|
|
1159
1159
|
Re(e, function() {
|
|
1160
|
-
var
|
|
1161
|
-
|
|
1162
|
-
s[
|
|
1160
|
+
var w = Be(t[f], e), S = !1;
|
|
1161
|
+
w.subscribe(N(n, function(y) {
|
|
1162
|
+
s[f] = y, S || (S = !0, a--), a || n.next(r(s.slice()));
|
|
1163
1163
|
}, function() {
|
|
1164
1164
|
--u || n.complete();
|
|
1165
1165
|
}));
|
|
@@ -1170,11 +1170,11 @@ function lr(t, e, r) {
|
|
|
1170
1170
|
};
|
|
1171
1171
|
}
|
|
1172
1172
|
function Re(t, e, r) {
|
|
1173
|
-
t ?
|
|
1173
|
+
t ? ne(r, t, e) : e();
|
|
1174
1174
|
}
|
|
1175
1175
|
function cr(t) {
|
|
1176
1176
|
return new R(function(e) {
|
|
1177
|
-
|
|
1177
|
+
ee(t()).subscribe(e);
|
|
1178
1178
|
});
|
|
1179
1179
|
}
|
|
1180
1180
|
function fr(t, e, r) {
|
|
@@ -1194,7 +1194,7 @@ function ae(t) {
|
|
|
1194
1194
|
return U(function(e, r) {
|
|
1195
1195
|
var n = null, o = !1, s;
|
|
1196
1196
|
n = e.subscribe(N(r, void 0, void 0, function(u) {
|
|
1197
|
-
s =
|
|
1197
|
+
s = ee(t(u, ae(t)(e))), n ? (n.unsubscribe(), n = null, s.subscribe(r)) : o = !0;
|
|
1198
1198
|
})), o && (n.unsubscribe(), n = null, s.subscribe(r));
|
|
1199
1199
|
});
|
|
1200
1200
|
}
|
|
@@ -1208,9 +1208,9 @@ function G(t, e) {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
};
|
|
1210
1210
|
function l() {
|
|
1211
|
-
var i = u + t,
|
|
1212
|
-
if (
|
|
1213
|
-
o = this.schedule(void 0, i -
|
|
1211
|
+
var i = u + t, f = e.now();
|
|
1212
|
+
if (f < i) {
|
|
1213
|
+
o = this.schedule(void 0, i - f), n.add(o);
|
|
1214
1214
|
return;
|
|
1215
1215
|
}
|
|
1216
1216
|
a();
|
|
@@ -1283,30 +1283,30 @@ function lt(t) {
|
|
|
1283
1283
|
return new oe();
|
|
1284
1284
|
} : e, n = t.resetOnError, o = n === void 0 ? !0 : n, s = t.resetOnComplete, u = s === void 0 ? !0 : s, a = t.resetOnRefCountZero, l = a === void 0 ? !0 : a;
|
|
1285
1285
|
return function(i) {
|
|
1286
|
-
var
|
|
1287
|
-
|
|
1288
|
-
},
|
|
1289
|
-
d(),
|
|
1290
|
-
},
|
|
1291
|
-
var
|
|
1292
|
-
|
|
1286
|
+
var f, w, S, y = 0, A = !1, m = !1, d = function() {
|
|
1287
|
+
w == null || w.unsubscribe(), w = void 0;
|
|
1288
|
+
}, b = function() {
|
|
1289
|
+
d(), f = S = void 0, A = m = !1;
|
|
1290
|
+
}, T = function() {
|
|
1291
|
+
var O = f;
|
|
1292
|
+
b(), O == null || O.unsubscribe();
|
|
1293
1293
|
};
|
|
1294
|
-
return U(function(
|
|
1295
|
-
|
|
1296
|
-
var
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
}),
|
|
1300
|
-
next: function(
|
|
1301
|
-
return
|
|
1294
|
+
return U(function(O, h) {
|
|
1295
|
+
y++, !m && !A && d();
|
|
1296
|
+
var p = S = S ?? r();
|
|
1297
|
+
h.add(function() {
|
|
1298
|
+
y--, y === 0 && !m && !A && (w = Ae(T, l));
|
|
1299
|
+
}), p.subscribe(h), !f && y > 0 && (f = new he({
|
|
1300
|
+
next: function(E) {
|
|
1301
|
+
return p.next(E);
|
|
1302
1302
|
},
|
|
1303
|
-
error: function(
|
|
1304
|
-
|
|
1303
|
+
error: function(E) {
|
|
1304
|
+
m = !0, d(), w = Ae(b, o, E), p.error(E);
|
|
1305
1305
|
},
|
|
1306
1306
|
complete: function() {
|
|
1307
|
-
|
|
1307
|
+
A = !0, d(), w = Ae(b, u), p.complete();
|
|
1308
1308
|
}
|
|
1309
|
-
}),
|
|
1309
|
+
}), ee(O).subscribe(f));
|
|
1310
1310
|
})(i);
|
|
1311
1311
|
};
|
|
1312
1312
|
}
|
|
@@ -1323,10 +1323,10 @@ function Ae(t, e) {
|
|
|
1323
1323
|
o.unsubscribe(), t();
|
|
1324
1324
|
}
|
|
1325
1325
|
});
|
|
1326
|
-
return
|
|
1326
|
+
return ee(e.apply(void 0, ce([], le(r)))).subscribe(o);
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1329
|
+
function re(t, e, r) {
|
|
1330
1330
|
var n, o = !1;
|
|
1331
1331
|
return n = t, lt({
|
|
1332
1332
|
connector: function() {
|
|
@@ -1344,9 +1344,9 @@ function br(t, e) {
|
|
|
1344
1344
|
};
|
|
1345
1345
|
r.subscribe(N(n, function(l) {
|
|
1346
1346
|
o == null || o.unsubscribe();
|
|
1347
|
-
var i = 0,
|
|
1348
|
-
|
|
1349
|
-
return n.next(e ? e(l,
|
|
1347
|
+
var i = 0, f = s++;
|
|
1348
|
+
ee(t(l, f)).subscribe(o = N(n, function(w) {
|
|
1349
|
+
return n.next(e ? e(l, w, f, i++) : w);
|
|
1350
1350
|
}, function() {
|
|
1351
1351
|
o = null, a();
|
|
1352
1352
|
}));
|
|
@@ -1357,7 +1357,7 @@ function br(t, e) {
|
|
|
1357
1357
|
}
|
|
1358
1358
|
function wr(t) {
|
|
1359
1359
|
return U(function(e, r) {
|
|
1360
|
-
|
|
1360
|
+
ee(t).subscribe(N(r, function() {
|
|
1361
1361
|
return r.complete();
|
|
1362
1362
|
}, _e)), !r.closed && e.subscribe(r);
|
|
1363
1363
|
});
|
|
@@ -1417,7 +1417,7 @@ function Or(t, e) {
|
|
|
1417
1417
|
const n = e.colors[r].data, o = t % n.length;
|
|
1418
1418
|
return n[o];
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function F(t, e, r) {
|
|
1421
1421
|
let n;
|
|
1422
1422
|
switch (t) {
|
|
1423
1423
|
case "index":
|
|
@@ -1437,7 +1437,7 @@ function K(t, e, r) {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
return Or(n, r);
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function X(t) {
|
|
1441
1441
|
return Object.prototype.toString.call(t) === "[object Object]";
|
|
1442
1442
|
}
|
|
1443
1443
|
function Ir(t) {
|
|
@@ -1446,8 +1446,8 @@ function Ir(t) {
|
|
|
1446
1446
|
function ct(t) {
|
|
1447
1447
|
return !!(t && t.nodeType);
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1450
|
-
if (
|
|
1449
|
+
function W(t, e) {
|
|
1450
|
+
if (X(e) === !1 || X(t) === !1)
|
|
1451
1451
|
return Object.assign({}, t);
|
|
1452
1452
|
const r = (n, o) => {
|
|
1453
1453
|
const s = Object.assign({}, n);
|
|
@@ -1455,7 +1455,7 @@ function H(t, e) {
|
|
|
1455
1455
|
if (!(u in n))
|
|
1456
1456
|
continue;
|
|
1457
1457
|
let a;
|
|
1458
|
-
|
|
1458
|
+
X(o[u]) && X(n[u]) ? (a = r(n[u], o[u]), s[u] = a) : s[u] = o[u];
|
|
1459
1459
|
}
|
|
1460
1460
|
return s;
|
|
1461
1461
|
};
|
|
@@ -1504,17 +1504,17 @@ function fe({ from: t, systemMessage: e }) {
|
|
|
1504
1504
|
return `unexpected error from '${t}':
|
|
1505
1505
|
${e}`;
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function H({ columnName: t, expectToBe: e, from: r }) {
|
|
1508
1508
|
return `Invalid value: '${t}' must be '${e}'
|
|
1509
1509
|
|
|
1510
1510
|
----> find in '${r}'`;
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function Q({ columnName: t, expectToBe: e, from: r }) {
|
|
1513
1513
|
return `${ht("warning")} Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
|
|
1514
1514
|
|
|
1515
1515
|
----> find in '${r}'`;
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function jr(t) {
|
|
1518
1518
|
return new R((e) => {
|
|
1519
1519
|
const r = new ResizeObserver((n) => {
|
|
1520
1520
|
const o = n[0];
|
|
@@ -1525,20 +1525,20 @@ function kr(t) {
|
|
|
1525
1525
|
};
|
|
1526
1526
|
});
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function kr(t) {
|
|
1529
1529
|
return `orbcharts-${t}`;
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1532
|
-
return `${
|
|
1531
|
+
function Mr(t, e) {
|
|
1532
|
+
return `${kr(t)}-${e}`;
|
|
1533
1533
|
}
|
|
1534
1534
|
function Lr(t, e) {
|
|
1535
1535
|
const r = {
|
|
1536
1536
|
string: (s) => typeof s == "string",
|
|
1537
1537
|
number: (s) => typeof s == "number",
|
|
1538
1538
|
boolean: (s) => typeof s == "boolean",
|
|
1539
|
-
object: (s) =>
|
|
1539
|
+
object: (s) => X(s),
|
|
1540
1540
|
// 嚴格判斷是否為純物件
|
|
1541
|
-
"object[]": (s) => Array.isArray(s) && s.every((u) =>
|
|
1541
|
+
"object[]": (s) => Array.isArray(s) && s.every((u) => X(u)),
|
|
1542
1542
|
"string[]": (s) => Array.isArray(s) && s.every((u) => typeof u == "string"),
|
|
1543
1543
|
"number[]": (s) => Array.isArray(s) && s.every((u) => typeof u == "number"),
|
|
1544
1544
|
Function: (s) => Ir(s),
|
|
@@ -1550,8 +1550,10 @@ function Lr(t, e) {
|
|
|
1550
1550
|
return Object.keys(t).find((s) => {
|
|
1551
1551
|
if (e[s]) {
|
|
1552
1552
|
const u = e[s], a = t[s];
|
|
1553
|
+
if (a === void 0)
|
|
1554
|
+
return !1;
|
|
1553
1555
|
if (u.toBeTypes) {
|
|
1554
|
-
if (u.toBeTypes.some((
|
|
1556
|
+
if (u.toBeTypes.some((f) => r[f](a)) === !1)
|
|
1555
1557
|
return !0;
|
|
1556
1558
|
} else if (u.toBe) {
|
|
1557
1559
|
const { toBe: l, test: i } = u;
|
|
@@ -1720,8 +1722,8 @@ const Ke = {
|
|
|
1720
1722
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
1721
1723
|
o ? t.forEach((a, l) => {
|
|
1722
1724
|
a.forEach((i) => {
|
|
1723
|
-
const
|
|
1724
|
-
n.has(
|
|
1725
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
1726
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
1725
1727
|
});
|
|
1726
1728
|
}) : t.forEach((a) => {
|
|
1727
1729
|
const l = a[e.dataset.from] || "default";
|
|
@@ -1733,9 +1735,9 @@ const Ke = {
|
|
|
1733
1735
|
else if (e.dataset.sort === "original") {
|
|
1734
1736
|
const a = [];
|
|
1735
1737
|
o ? t.forEach((l, i) => {
|
|
1736
|
-
l.forEach((
|
|
1737
|
-
const
|
|
1738
|
-
a.includes(
|
|
1738
|
+
l.forEach((f) => {
|
|
1739
|
+
const w = f[e.dataset.from] || `dataset-${i}`;
|
|
1740
|
+
a.includes(w) || a.push(w);
|
|
1739
1741
|
});
|
|
1740
1742
|
}) : t.forEach((l) => {
|
|
1741
1743
|
const i = l[e.dataset.from] || "default";
|
|
@@ -1744,139 +1746,139 @@ const Ke = {
|
|
|
1744
1746
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
1745
1747
|
const u = [];
|
|
1746
1748
|
return s.forEach((a, l) => {
|
|
1747
|
-
const i = n.get(a),
|
|
1748
|
-
i.forEach((
|
|
1749
|
-
const d =
|
|
1750
|
-
|
|
1749
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1750
|
+
i.forEach((m) => {
|
|
1751
|
+
const d = m[e.series.from] || "default";
|
|
1752
|
+
f.has(d) || f.set(d, []), f.get(d).push(m);
|
|
1751
1753
|
});
|
|
1752
|
-
let
|
|
1754
|
+
let w = Array.from(f.keys());
|
|
1753
1755
|
if (Array.isArray(e.series.sort))
|
|
1754
|
-
|
|
1756
|
+
w = e.series.sort.filter((m) => f.has(m)).concat(w.filter((m) => !e.series.sort.includes(m)));
|
|
1755
1757
|
else if (e.series.sort === "original") {
|
|
1756
|
-
const
|
|
1758
|
+
const m = [];
|
|
1757
1759
|
i.forEach((d) => {
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
}),
|
|
1761
|
-
} else e.series.sort === "alphabetical" &&
|
|
1762
|
-
const
|
|
1760
|
+
const b = d[e.series.from] || "default";
|
|
1761
|
+
m.includes(b) || m.push(b);
|
|
1762
|
+
}), w = m;
|
|
1763
|
+
} else e.series.sort === "alphabetical" && w.sort((m, d) => m.localeCompare(d, void 0, { numeric: !0 }));
|
|
1764
|
+
const S = [];
|
|
1763
1765
|
if (e.category.sort === "original")
|
|
1764
|
-
i.forEach((
|
|
1765
|
-
const d =
|
|
1766
|
-
|
|
1766
|
+
i.forEach((m) => {
|
|
1767
|
+
const d = m[e.category.from] || "default";
|
|
1768
|
+
S.includes(d) || S.push(d);
|
|
1767
1769
|
});
|
|
1768
1770
|
else if (e.category.sort === "alphabetical") {
|
|
1769
|
-
const
|
|
1771
|
+
const m = /* @__PURE__ */ new Set();
|
|
1770
1772
|
i.forEach((d) => {
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1773
|
+
m.add(d[e.category.from] || "default");
|
|
1774
|
+
}), S.push(...Array.from(m).sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 })));
|
|
1773
1775
|
} else if (Array.isArray(e.category.sort)) {
|
|
1774
|
-
const
|
|
1775
|
-
i.forEach((
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1776
|
+
const m = [];
|
|
1777
|
+
i.forEach((b) => {
|
|
1778
|
+
const T = b[e.category.from] || "default";
|
|
1779
|
+
m.includes(T) || m.push(T);
|
|
1778
1780
|
});
|
|
1779
1781
|
const d = e.category.sort;
|
|
1780
|
-
|
|
1781
|
-
...d.filter((
|
|
1782
|
-
...
|
|
1782
|
+
S.push(
|
|
1783
|
+
...d.filter((b) => m.includes(b)),
|
|
1784
|
+
...m.filter((b) => !d.includes(b))
|
|
1783
1785
|
);
|
|
1784
1786
|
}
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1787
|
-
|
|
1787
|
+
const y = /* @__PURE__ */ new Map();
|
|
1788
|
+
S.forEach((m, d) => {
|
|
1789
|
+
y.set(m, d);
|
|
1788
1790
|
});
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1791
|
+
const A = [];
|
|
1792
|
+
w.forEach((m, d) => {
|
|
1793
|
+
const b = f.get(m), T = /* @__PURE__ */ new Map();
|
|
1794
|
+
b.forEach((p) => {
|
|
1795
|
+
const E = p[e.category.from] || "default";
|
|
1796
|
+
T.has(E) || T.set(E, []), T.get(E).push(p);
|
|
1795
1797
|
});
|
|
1796
|
-
const
|
|
1797
|
-
e.category.sort === "original" && e.value.aggregate === "none" ? (
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
id:
|
|
1798
|
+
const O = S.filter((p) => T.has(p)), h = [];
|
|
1799
|
+
e.category.sort === "original" && e.value.aggregate === "none" ? (b.forEach((p, E) => {
|
|
1800
|
+
const P = p[e.category.from] || "default", I = y.get(P), c = p[e.value.from];
|
|
1801
|
+
h.push({
|
|
1802
|
+
id: p.id || `${a}-${m}-${P}-${E}`,
|
|
1801
1803
|
index: I,
|
|
1802
1804
|
// Series 模式下 index 對應 categoryIndex
|
|
1803
1805
|
modelType: "series",
|
|
1804
|
-
name:
|
|
1805
|
-
data:
|
|
1806
|
+
name: p.name || "",
|
|
1807
|
+
data: p.data,
|
|
1806
1808
|
value: typeof c == "number" ? c : null,
|
|
1807
|
-
color:
|
|
1809
|
+
color: F(e.color.from, {
|
|
1808
1810
|
index: I,
|
|
1809
1811
|
seriesIndex: d,
|
|
1810
1812
|
categoryIndex: I,
|
|
1811
1813
|
datasetIndex: l
|
|
1812
1814
|
}, r),
|
|
1813
|
-
series:
|
|
1815
|
+
series: m,
|
|
1814
1816
|
seriesIndex: d,
|
|
1815
|
-
category:
|
|
1817
|
+
category: P,
|
|
1816
1818
|
categoryIndex: I
|
|
1817
1819
|
});
|
|
1818
|
-
}), e.value.sort === "asc" ?
|
|
1819
|
-
const
|
|
1820
|
+
}), 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)) : O.forEach((p) => {
|
|
1821
|
+
const E = y.get(p), P = T.get(p);
|
|
1820
1822
|
if (e.value.aggregate === "none") {
|
|
1821
|
-
let I =
|
|
1822
|
-
const
|
|
1823
|
+
let I = P.map((c, v) => {
|
|
1824
|
+
const $ = c[e.value.from];
|
|
1823
1825
|
return {
|
|
1824
|
-
id: c.id || `${a}-${
|
|
1825
|
-
index:
|
|
1826
|
+
id: c.id || `${a}-${m}-${p}-${v}`,
|
|
1827
|
+
index: E,
|
|
1826
1828
|
// Series 模式下 index 對應 categoryIndex
|
|
1827
1829
|
modelType: "series",
|
|
1828
1830
|
name: c.name || "",
|
|
1829
1831
|
data: c.data,
|
|
1830
|
-
value: typeof
|
|
1831
|
-
color:
|
|
1832
|
-
index:
|
|
1832
|
+
value: typeof $ == "number" ? $ : null,
|
|
1833
|
+
color: F(e.color.from, {
|
|
1834
|
+
index: E,
|
|
1833
1835
|
seriesIndex: d,
|
|
1834
|
-
categoryIndex:
|
|
1836
|
+
categoryIndex: E,
|
|
1835
1837
|
datasetIndex: l
|
|
1836
1838
|
}, r),
|
|
1837
|
-
series:
|
|
1839
|
+
series: m,
|
|
1838
1840
|
seriesIndex: d,
|
|
1839
|
-
category:
|
|
1840
|
-
categoryIndex:
|
|
1841
|
+
category: p,
|
|
1842
|
+
categoryIndex: E
|
|
1841
1843
|
};
|
|
1842
1844
|
});
|
|
1843
|
-
e.value.sort === "asc" ? I.sort((c,
|
|
1845
|
+
e.value.sort === "asc" ? I.sort((c, v) => c.value === null && v.value === null ? 0 : c.value === null ? 1 : v.value === null ? -1 : c.value - v.value) : e.value.sort === "desc" && I.sort((c, v) => c.value === null && v.value === null ? 0 : c.value === null ? 1 : v.value === null ? -1 : v.value - c.value), h.push(...I);
|
|
1844
1846
|
} else {
|
|
1845
|
-
const I =
|
|
1847
|
+
const I = P.map((C) => {
|
|
1846
1848
|
if (e.value.aggregate === "count")
|
|
1847
1849
|
return 1;
|
|
1848
|
-
const
|
|
1849
|
-
return typeof
|
|
1850
|
-
}), c = pe(I, e.value.aggregate),
|
|
1851
|
-
id:
|
|
1852
|
-
index:
|
|
1850
|
+
const g = C[e.value.from];
|
|
1851
|
+
return typeof g == "number" ? g : null;
|
|
1852
|
+
}), c = pe(I, e.value.aggregate), v = P[0], $ = {
|
|
1853
|
+
id: v.id || `${a}-${m}-${p}-aggregated`,
|
|
1854
|
+
index: E,
|
|
1853
1855
|
// Series 模式下 index 對應 categoryIndex
|
|
1854
1856
|
modelType: "series",
|
|
1855
|
-
name:
|
|
1856
|
-
data:
|
|
1857
|
+
name: v.name || p,
|
|
1858
|
+
data: v.data,
|
|
1857
1859
|
value: c,
|
|
1858
|
-
color:
|
|
1859
|
-
index:
|
|
1860
|
+
color: F(e.color.from, {
|
|
1861
|
+
index: E,
|
|
1860
1862
|
seriesIndex: d,
|
|
1861
|
-
categoryIndex:
|
|
1863
|
+
categoryIndex: E,
|
|
1862
1864
|
datasetIndex: l
|
|
1863
1865
|
}, r),
|
|
1864
|
-
series:
|
|
1866
|
+
series: m,
|
|
1865
1867
|
seriesIndex: d,
|
|
1866
|
-
category:
|
|
1867
|
-
categoryIndex:
|
|
1868
|
+
category: p,
|
|
1869
|
+
categoryIndex: E
|
|
1868
1870
|
};
|
|
1869
|
-
|
|
1871
|
+
h.push($);
|
|
1870
1872
|
}
|
|
1871
|
-
}),
|
|
1872
|
-
}), u.push(
|
|
1873
|
+
}), A.push(h);
|
|
1874
|
+
}), u.push(A);
|
|
1873
1875
|
}), u;
|
|
1874
1876
|
}, Rr = (t, e, r) => {
|
|
1875
1877
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
1876
1878
|
o ? t.forEach((a, l) => {
|
|
1877
1879
|
a.forEach((i) => {
|
|
1878
|
-
const
|
|
1879
|
-
n.has(
|
|
1880
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
1881
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
1880
1882
|
});
|
|
1881
1883
|
}) : t.forEach((a) => {
|
|
1882
1884
|
const l = a[e.dataset.from] || "default";
|
|
@@ -1888,9 +1890,9 @@ const Ke = {
|
|
|
1888
1890
|
else if (e.dataset.sort === "original") {
|
|
1889
1891
|
const a = [];
|
|
1890
1892
|
o ? t.forEach((l, i) => {
|
|
1891
|
-
l.forEach((
|
|
1892
|
-
const
|
|
1893
|
-
a.includes(
|
|
1893
|
+
l.forEach((f) => {
|
|
1894
|
+
const w = f[e.dataset.from] || `dataset-${i}`;
|
|
1895
|
+
a.includes(w) || a.push(w);
|
|
1894
1896
|
});
|
|
1895
1897
|
}) : t.forEach((l) => {
|
|
1896
1898
|
const i = l[e.dataset.from] || "default";
|
|
@@ -1899,118 +1901,118 @@ const Ke = {
|
|
|
1899
1901
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
1900
1902
|
const u = [];
|
|
1901
1903
|
return s.forEach((a, l) => {
|
|
1902
|
-
const i = n.get(a),
|
|
1904
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1903
1905
|
i.forEach((d) => {
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1906
|
+
const b = d[e.series.from] || "default";
|
|
1907
|
+
f.has(b) || f.set(b, []), f.get(b).push(d);
|
|
1906
1908
|
});
|
|
1907
|
-
let
|
|
1909
|
+
let w = Array.from(f.keys());
|
|
1908
1910
|
if (Array.isArray(e.series.sort))
|
|
1909
|
-
|
|
1911
|
+
w = e.series.sort.filter((d) => f.has(d)).concat(w.filter((d) => !e.series.sort.includes(d)));
|
|
1910
1912
|
else if (e.series.sort === "original") {
|
|
1911
1913
|
const d = [];
|
|
1912
|
-
i.forEach((
|
|
1913
|
-
const
|
|
1914
|
-
d.includes(
|
|
1915
|
-
}),
|
|
1916
|
-
} else e.series.sort === "alphabetical" &&
|
|
1917
|
-
const
|
|
1914
|
+
i.forEach((b) => {
|
|
1915
|
+
const T = b[e.series.from] || "default";
|
|
1916
|
+
d.includes(T) || d.push(T);
|
|
1917
|
+
}), w = d;
|
|
1918
|
+
} else e.series.sort === "alphabetical" && w.sort((d, b) => d.localeCompare(b, void 0, { numeric: !0 }));
|
|
1919
|
+
const S = [];
|
|
1918
1920
|
i.forEach((d) => {
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1921
|
+
const b = d[e.category.from] || "default";
|
|
1922
|
+
S.includes(b) || S.push(b);
|
|
1921
1923
|
});
|
|
1922
|
-
const
|
|
1923
|
-
let
|
|
1924
|
-
Array.isArray(e.category.sort) ?
|
|
1925
|
-
const
|
|
1926
|
-
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1924
|
+
const y = new Set(S);
|
|
1925
|
+
let A = Array.from(y);
|
|
1926
|
+
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 }));
|
|
1927
|
+
const m = [];
|
|
1928
|
+
w.forEach((d, b) => {
|
|
1929
|
+
const T = f.get(d), O = /* @__PURE__ */ new Map();
|
|
1930
|
+
T.forEach((p) => {
|
|
1931
|
+
const E = p[e.category.from] || "default";
|
|
1932
|
+
O.has(E) || O.set(E, []), O.get(E).push(p);
|
|
1931
1933
|
});
|
|
1932
|
-
const
|
|
1933
|
-
|
|
1934
|
-
const
|
|
1935
|
-
if (!
|
|
1936
|
-
|
|
1937
|
-
id: `${a}-${d}-${
|
|
1938
|
-
index:
|
|
1934
|
+
const h = [];
|
|
1935
|
+
A.forEach((p, E) => {
|
|
1936
|
+
const P = O.get(p);
|
|
1937
|
+
if (!P)
|
|
1938
|
+
h.push({
|
|
1939
|
+
id: `${a}-${d}-${p}-null`,
|
|
1940
|
+
index: E,
|
|
1939
1941
|
modelType: "grid",
|
|
1940
|
-
name:
|
|
1942
|
+
name: p,
|
|
1941
1943
|
data: void 0,
|
|
1942
1944
|
value: null,
|
|
1943
|
-
color:
|
|
1944
|
-
index:
|
|
1945
|
-
seriesIndex:
|
|
1946
|
-
categoryIndex:
|
|
1945
|
+
color: F(e.color.from, {
|
|
1946
|
+
index: E,
|
|
1947
|
+
seriesIndex: b,
|
|
1948
|
+
categoryIndex: E,
|
|
1947
1949
|
datasetIndex: l
|
|
1948
1950
|
}, r),
|
|
1949
1951
|
series: d,
|
|
1950
|
-
seriesIndex:
|
|
1951
|
-
category:
|
|
1952
|
-
categoryIndex:
|
|
1952
|
+
seriesIndex: b,
|
|
1953
|
+
category: p,
|
|
1954
|
+
categoryIndex: E
|
|
1953
1955
|
});
|
|
1954
1956
|
else if (e.value.aggregate === "none") {
|
|
1955
|
-
let I =
|
|
1956
|
-
const
|
|
1957
|
+
let I = P.map((c, v) => {
|
|
1958
|
+
const $ = c[e.value.from];
|
|
1957
1959
|
return {
|
|
1958
|
-
id: c.id || `${a}-${d}-${
|
|
1959
|
-
index:
|
|
1960
|
+
id: c.id || `${a}-${d}-${p}-${v}`,
|
|
1961
|
+
index: E,
|
|
1960
1962
|
// Grid 模式下 index 對應 categoryIndex
|
|
1961
1963
|
modelType: "grid",
|
|
1962
1964
|
name: c.name || "",
|
|
1963
1965
|
data: c.data,
|
|
1964
|
-
value: typeof
|
|
1965
|
-
color:
|
|
1966
|
-
index:
|
|
1967
|
-
seriesIndex:
|
|
1968
|
-
categoryIndex:
|
|
1966
|
+
value: typeof $ == "number" ? $ : null,
|
|
1967
|
+
color: F(e.color.from, {
|
|
1968
|
+
index: E,
|
|
1969
|
+
seriesIndex: b,
|
|
1970
|
+
categoryIndex: E,
|
|
1969
1971
|
datasetIndex: l
|
|
1970
1972
|
}, r),
|
|
1971
1973
|
series: d,
|
|
1972
|
-
seriesIndex:
|
|
1973
|
-
category:
|
|
1974
|
-
categoryIndex:
|
|
1974
|
+
seriesIndex: b,
|
|
1975
|
+
category: p,
|
|
1976
|
+
categoryIndex: E
|
|
1975
1977
|
};
|
|
1976
1978
|
});
|
|
1977
|
-
e.value.sort === "asc" ? I.sort((c,
|
|
1979
|
+
e.value.sort === "asc" ? I.sort((c, v) => c.value === null && v.value === null ? 0 : c.value === null ? 1 : v.value === null ? -1 : c.value - v.value) : e.value.sort === "desc" && I.sort((c, v) => c.value === null && v.value === null ? 0 : c.value === null ? 1 : v.value === null ? -1 : v.value - c.value), h.push(...I);
|
|
1978
1980
|
} else {
|
|
1979
|
-
const I =
|
|
1981
|
+
const I = P.map((C) => {
|
|
1980
1982
|
if (e.value.aggregate === "count")
|
|
1981
1983
|
return 1;
|
|
1982
|
-
const
|
|
1983
|
-
return typeof
|
|
1984
|
-
}), c = pe(I, e.value.aggregate),
|
|
1985
|
-
id:
|
|
1986
|
-
index:
|
|
1984
|
+
const g = C[e.value.from];
|
|
1985
|
+
return typeof g == "number" ? g : null;
|
|
1986
|
+
}), c = pe(I, e.value.aggregate), v = P[0], $ = {
|
|
1987
|
+
id: v.id || `${a}-${d}-${p}-aggregated`,
|
|
1988
|
+
index: E,
|
|
1987
1989
|
// Grid 模式下 index 對應 categoryIndex
|
|
1988
1990
|
modelType: "grid",
|
|
1989
|
-
name:
|
|
1990
|
-
data:
|
|
1991
|
+
name: v.name || p,
|
|
1992
|
+
data: v.data,
|
|
1991
1993
|
value: c,
|
|
1992
|
-
color:
|
|
1993
|
-
index:
|
|
1994
|
-
seriesIndex:
|
|
1995
|
-
categoryIndex:
|
|
1994
|
+
color: F(e.color.from, {
|
|
1995
|
+
index: E,
|
|
1996
|
+
seriesIndex: b,
|
|
1997
|
+
categoryIndex: E,
|
|
1996
1998
|
datasetIndex: l
|
|
1997
1999
|
}, r),
|
|
1998
2000
|
series: d,
|
|
1999
|
-
seriesIndex:
|
|
2000
|
-
category:
|
|
2001
|
-
categoryIndex:
|
|
2001
|
+
seriesIndex: b,
|
|
2002
|
+
category: p,
|
|
2003
|
+
categoryIndex: E
|
|
2002
2004
|
};
|
|
2003
|
-
|
|
2005
|
+
h.push($);
|
|
2004
2006
|
}
|
|
2005
|
-
}),
|
|
2006
|
-
}), u.push(
|
|
2007
|
+
}), m.push(h);
|
|
2008
|
+
}), u.push(m);
|
|
2007
2009
|
}), u;
|
|
2008
2010
|
}, Kr = (t, e, r) => {
|
|
2009
2011
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
2010
2012
|
o ? t.forEach((a, l) => {
|
|
2011
2013
|
a.forEach((i) => {
|
|
2012
|
-
const
|
|
2013
|
-
n.has(
|
|
2014
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
2015
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
2014
2016
|
});
|
|
2015
2017
|
}) : t.forEach((a) => {
|
|
2016
2018
|
const l = a[e.dataset.from] || "default";
|
|
@@ -2022,9 +2024,9 @@ const Ke = {
|
|
|
2022
2024
|
else if (e.dataset.sort === "original") {
|
|
2023
2025
|
const a = [];
|
|
2024
2026
|
o ? t.forEach((l, i) => {
|
|
2025
|
-
l.forEach((
|
|
2026
|
-
const
|
|
2027
|
-
a.includes(
|
|
2027
|
+
l.forEach((f) => {
|
|
2028
|
+
const w = f[e.dataset.from] || `dataset-${i}`;
|
|
2029
|
+
a.includes(w) || a.push(w);
|
|
2028
2030
|
});
|
|
2029
2031
|
}) : t.forEach((l) => {
|
|
2030
2032
|
const i = l[e.dataset.from] || "default";
|
|
@@ -2033,280 +2035,280 @@ const Ke = {
|
|
|
2033
2035
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
2034
2036
|
const u = [];
|
|
2035
2037
|
return s.forEach((a, l) => {
|
|
2036
|
-
const i = n.get(a),
|
|
2037
|
-
i.forEach((
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2038
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2039
|
+
i.forEach((y) => {
|
|
2040
|
+
const A = y[e.series.from] || "default";
|
|
2041
|
+
f.has(A) || f.set(A, []), f.get(A).push(y);
|
|
2040
2042
|
});
|
|
2041
|
-
let
|
|
2043
|
+
let w = Array.from(f.keys());
|
|
2042
2044
|
if (Array.isArray(e.series.sort))
|
|
2043
|
-
|
|
2045
|
+
w = e.series.sort.filter((y) => f.has(y)).concat(w.filter((y) => !e.series.sort.includes(y)));
|
|
2044
2046
|
else if (e.series.sort === "original") {
|
|
2045
|
-
const
|
|
2046
|
-
i.forEach((
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2049
|
-
}),
|
|
2050
|
-
} else e.series.sort === "alphabetical" &&
|
|
2051
|
-
const
|
|
2052
|
-
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2056
|
-
d.has(
|
|
2047
|
+
const y = [];
|
|
2048
|
+
i.forEach((A) => {
|
|
2049
|
+
const m = A[e.series.from] || "default";
|
|
2050
|
+
y.includes(m) || y.push(m);
|
|
2051
|
+
}), w = y;
|
|
2052
|
+
} else e.series.sort === "alphabetical" && w.sort((y, A) => y.localeCompare(A, void 0, { numeric: !0 }));
|
|
2053
|
+
const S = [];
|
|
2054
|
+
w.forEach((y, A) => {
|
|
2055
|
+
const m = f.get(y), d = /* @__PURE__ */ new Map();
|
|
2056
|
+
m.forEach((O) => {
|
|
2057
|
+
const h = O[e.category.from] || "default";
|
|
2058
|
+
d.has(h) || d.set(h, []), d.get(h).push(O);
|
|
2057
2059
|
});
|
|
2058
|
-
let
|
|
2060
|
+
let b = Array.from(d.keys());
|
|
2059
2061
|
if (Array.isArray(e.category.sort))
|
|
2060
|
-
|
|
2062
|
+
b = e.category.sort.filter((O) => d.has(O)).concat(b.filter((O) => !e.category.sort.includes(O)));
|
|
2061
2063
|
else if (e.category.sort === "original") {
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2064
|
-
const
|
|
2065
|
-
|
|
2066
|
-
}),
|
|
2067
|
-
} else e.category.sort === "alphabetical" &&
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
d.get(
|
|
2071
|
-
const I = e.multivariate.map((
|
|
2072
|
-
index:
|
|
2073
|
-
name:
|
|
2064
|
+
const O = [];
|
|
2065
|
+
m.forEach((h) => {
|
|
2066
|
+
const p = h[e.category.from] || "default";
|
|
2067
|
+
O.includes(p) || O.push(p);
|
|
2068
|
+
}), b = O;
|
|
2069
|
+
} else e.category.sort === "alphabetical" && b.sort((O, h) => O.localeCompare(h, void 0, { numeric: !0 }));
|
|
2070
|
+
const T = [];
|
|
2071
|
+
b.forEach((O, h) => {
|
|
2072
|
+
d.get(O).forEach((E, P) => {
|
|
2073
|
+
const I = e.multivariate.map((v, $) => ({
|
|
2074
|
+
index: $,
|
|
2075
|
+
name: v.name,
|
|
2074
2076
|
value: (() => {
|
|
2075
|
-
const
|
|
2076
|
-
return typeof
|
|
2077
|
+
const C = E[v.from];
|
|
2078
|
+
return typeof C == "number" ? C : null;
|
|
2077
2079
|
})()
|
|
2078
2080
|
})), c = {
|
|
2079
|
-
id:
|
|
2080
|
-
index:
|
|
2081
|
+
id: E.id || `${a}-${y}-${O}-${P}`,
|
|
2082
|
+
index: P,
|
|
2081
2083
|
modelType: "multivariate",
|
|
2082
|
-
name:
|
|
2083
|
-
data:
|
|
2084
|
+
name: E.name || "",
|
|
2085
|
+
data: E.data,
|
|
2084
2086
|
value: null,
|
|
2085
2087
|
// MultivariateData 的主要值在 values 陣列中,這裡設為 null
|
|
2086
|
-
color:
|
|
2087
|
-
index:
|
|
2088
|
-
seriesIndex:
|
|
2089
|
-
categoryIndex:
|
|
2088
|
+
color: F(e.color.from, {
|
|
2089
|
+
index: P,
|
|
2090
|
+
seriesIndex: A,
|
|
2091
|
+
categoryIndex: h,
|
|
2090
2092
|
datasetIndex: l
|
|
2091
2093
|
}, r),
|
|
2092
2094
|
multivariate: I,
|
|
2093
|
-
series:
|
|
2094
|
-
seriesIndex:
|
|
2095
|
-
category:
|
|
2096
|
-
categoryIndex:
|
|
2095
|
+
series: y,
|
|
2096
|
+
seriesIndex: A,
|
|
2097
|
+
category: O,
|
|
2098
|
+
categoryIndex: h
|
|
2097
2099
|
};
|
|
2098
|
-
|
|
2100
|
+
T.push(c);
|
|
2099
2101
|
});
|
|
2100
|
-
}),
|
|
2101
|
-
}), u.push(
|
|
2102
|
+
}), S.push(T);
|
|
2103
|
+
}), u.push(S);
|
|
2102
2104
|
}), u;
|
|
2103
2105
|
}, Fr = (t, e, r) => {
|
|
2104
2106
|
const n = Array.isArray(t[0]), o = [], s = [];
|
|
2105
2107
|
n ? t.forEach((i) => {
|
|
2106
|
-
i.forEach((
|
|
2107
|
-
|
|
2108
|
+
i.forEach((f) => {
|
|
2109
|
+
f.source && f.target ? s.push(f) : o.push(f);
|
|
2108
2110
|
});
|
|
2109
2111
|
}) : t.forEach((i) => {
|
|
2110
2112
|
i.source && i.target ? s.push(i) : o.push(i);
|
|
2111
2113
|
});
|
|
2112
2114
|
const u = /* @__PURE__ */ new Map();
|
|
2113
|
-
n ? t.forEach((i,
|
|
2114
|
-
i.forEach((
|
|
2115
|
-
if (!
|
|
2116
|
-
const
|
|
2117
|
-
u.has(
|
|
2115
|
+
n ? t.forEach((i, f) => {
|
|
2116
|
+
i.forEach((w) => {
|
|
2117
|
+
if (!w.source || !w.target) {
|
|
2118
|
+
const S = w[e.dataset.from] || `dataset-${f}`;
|
|
2119
|
+
u.has(S) || u.set(S, []), u.get(S).push(w);
|
|
2118
2120
|
}
|
|
2119
2121
|
});
|
|
2120
2122
|
}) : o.forEach((i) => {
|
|
2121
|
-
const
|
|
2122
|
-
u.has(
|
|
2123
|
+
const f = i[e.dataset.from] || "default";
|
|
2124
|
+
u.has(f) || u.set(f, []), u.get(f).push(i);
|
|
2123
2125
|
});
|
|
2124
2126
|
let a = Array.from(u.keys());
|
|
2125
2127
|
if (Array.isArray(e.dataset.sort))
|
|
2126
2128
|
a = e.dataset.sort.filter((i) => u.has(i)).concat(a.filter((i) => !e.dataset.sort.includes(i)));
|
|
2127
2129
|
else if (e.dataset.sort === "original") {
|
|
2128
2130
|
const i = [];
|
|
2129
|
-
n ? t.forEach((
|
|
2130
|
-
|
|
2131
|
-
if (!
|
|
2132
|
-
const
|
|
2133
|
-
i.includes(
|
|
2131
|
+
n ? t.forEach((f, w) => {
|
|
2132
|
+
f.forEach((S) => {
|
|
2133
|
+
if (!S.source || !S.target) {
|
|
2134
|
+
const y = S[e.dataset.from] || `dataset-${w}`;
|
|
2135
|
+
i.includes(y) || i.push(y);
|
|
2134
2136
|
}
|
|
2135
2137
|
});
|
|
2136
|
-
}) : o.forEach((
|
|
2137
|
-
const
|
|
2138
|
-
i.includes(
|
|
2138
|
+
}) : o.forEach((f) => {
|
|
2139
|
+
const w = f[e.dataset.from] || "default";
|
|
2140
|
+
i.includes(w) || i.push(w);
|
|
2139
2141
|
}), a = i;
|
|
2140
|
-
} else e.dataset.sort === "alphabetical" && a.sort((i,
|
|
2142
|
+
} else e.dataset.sort === "alphabetical" && a.sort((i, f) => i.localeCompare(f, void 0, { numeric: !0 }));
|
|
2141
2143
|
const l = [];
|
|
2142
|
-
return a.forEach((i,
|
|
2143
|
-
const
|
|
2144
|
-
|
|
2145
|
-
const
|
|
2146
|
-
|
|
2144
|
+
return a.forEach((i, f) => {
|
|
2145
|
+
const w = u.get(i), S = [], y = /* @__PURE__ */ new Map();
|
|
2146
|
+
w.forEach((c) => {
|
|
2147
|
+
const v = c[e.series.from] || "default";
|
|
2148
|
+
y.has(v) || y.set(v, []), y.get(v).push(c);
|
|
2147
2149
|
});
|
|
2148
|
-
let
|
|
2150
|
+
let A = Array.from(y.keys());
|
|
2149
2151
|
if (Array.isArray(e.series.sort))
|
|
2150
|
-
|
|
2152
|
+
A = e.series.sort.filter((c) => y.has(c)).concat(A.filter((c) => !e.series.sort.includes(c)));
|
|
2151
2153
|
else if (e.series.sort === "original") {
|
|
2152
2154
|
const c = [];
|
|
2153
|
-
|
|
2154
|
-
const
|
|
2155
|
-
c.includes(
|
|
2156
|
-
}),
|
|
2157
|
-
} else e.series.sort === "alphabetical" &&
|
|
2158
|
-
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
const
|
|
2162
|
-
|
|
2155
|
+
w.forEach((v) => {
|
|
2156
|
+
const $ = v[e.series.from] || "default";
|
|
2157
|
+
c.includes($) || c.push($);
|
|
2158
|
+
}), A = c;
|
|
2159
|
+
} else e.series.sort === "alphabetical" && A.sort((c, v) => c.localeCompare(v, void 0, { numeric: !0 }));
|
|
2160
|
+
A.forEach((c, v) => {
|
|
2161
|
+
const $ = y.get(c), C = /* @__PURE__ */ new Map();
|
|
2162
|
+
$.forEach((x) => {
|
|
2163
|
+
const _ = x[e.category.from] || "default";
|
|
2164
|
+
C.has(_) || C.set(_, []), C.get(_).push(x);
|
|
2163
2165
|
});
|
|
2164
|
-
let
|
|
2166
|
+
let g = Array.from(C.keys());
|
|
2165
2167
|
if (Array.isArray(e.category.sort))
|
|
2166
|
-
|
|
2168
|
+
g = e.category.sort.filter((x) => C.has(x)).concat(g.filter((x) => !e.category.sort.includes(x)));
|
|
2167
2169
|
else if (e.category.sort === "original") {
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
}),
|
|
2173
|
-
} else e.category.sort === "alphabetical" &&
|
|
2174
|
-
|
|
2175
|
-
const
|
|
2170
|
+
const x = [];
|
|
2171
|
+
$.forEach((_) => {
|
|
2172
|
+
const B = _[e.category.from] || "default";
|
|
2173
|
+
x.includes(B) || x.push(B);
|
|
2174
|
+
}), g = x;
|
|
2175
|
+
} else e.category.sort === "alphabetical" && g.sort((x, _) => x.localeCompare(_, void 0, { numeric: !0 }));
|
|
2176
|
+
g.forEach((x, _) => {
|
|
2177
|
+
const B = C.get(x);
|
|
2176
2178
|
if (e.value.aggregate === "none") {
|
|
2177
|
-
let
|
|
2178
|
-
const
|
|
2179
|
+
let j = B.map((k, M) => {
|
|
2180
|
+
const K = k[e.value.from];
|
|
2179
2181
|
return {
|
|
2180
|
-
id:
|
|
2181
|
-
index:
|
|
2182
|
+
id: k.id || `${i}-${c}-${x}-${M}`,
|
|
2183
|
+
index: S.length + M,
|
|
2182
2184
|
// 在所有 nodes 中的索引
|
|
2183
2185
|
modelType: "graph",
|
|
2184
|
-
name:
|
|
2185
|
-
data:
|
|
2186
|
-
value: typeof
|
|
2187
|
-
color:
|
|
2188
|
-
index:
|
|
2189
|
-
seriesIndex:
|
|
2190
|
-
categoryIndex:
|
|
2191
|
-
datasetIndex:
|
|
2186
|
+
name: k.name || "",
|
|
2187
|
+
data: k.data,
|
|
2188
|
+
value: typeof K == "number" ? K : null,
|
|
2189
|
+
color: F(e.color.from, {
|
|
2190
|
+
index: _,
|
|
2191
|
+
seriesIndex: v,
|
|
2192
|
+
categoryIndex: _,
|
|
2193
|
+
datasetIndex: f
|
|
2192
2194
|
}, r),
|
|
2193
2195
|
series: c,
|
|
2194
|
-
seriesIndex:
|
|
2195
|
-
category:
|
|
2196
|
-
categoryIndex:
|
|
2196
|
+
seriesIndex: v,
|
|
2197
|
+
category: x,
|
|
2198
|
+
categoryIndex: _
|
|
2197
2199
|
};
|
|
2198
2200
|
});
|
|
2199
|
-
e.value.sort === "asc" ?
|
|
2201
|
+
e.value.sort === "asc" ? j.sort((k, M) => k.value === null && M.value === null ? 0 : k.value === null ? 1 : M.value === null ? -1 : k.value - M.value) : e.value.sort === "desc" && j.sort((k, M) => k.value === null && M.value === null ? 0 : k.value === null ? 1 : M.value === null ? -1 : M.value - k.value), S.push(...j);
|
|
2200
2202
|
} else {
|
|
2201
|
-
const
|
|
2203
|
+
const j = B.map((Z) => {
|
|
2202
2204
|
if (e.value.aggregate === "count")
|
|
2203
2205
|
return 1;
|
|
2204
|
-
const
|
|
2205
|
-
return typeof
|
|
2206
|
-
}),
|
|
2207
|
-
id:
|
|
2208
|
-
index:
|
|
2206
|
+
const te = Z[e.value.from];
|
|
2207
|
+
return typeof te == "number" ? te : null;
|
|
2208
|
+
}), k = pe(j, e.value.aggregate), M = B[0], K = {
|
|
2209
|
+
id: M.id || `${i}-${c}-${x}-aggregated`,
|
|
2210
|
+
index: S.length,
|
|
2209
2211
|
// 在所有 nodes 中的索引
|
|
2210
2212
|
modelType: "graph",
|
|
2211
|
-
name:
|
|
2212
|
-
data:
|
|
2213
|
-
value:
|
|
2214
|
-
color:
|
|
2215
|
-
index:
|
|
2216
|
-
seriesIndex:
|
|
2217
|
-
categoryIndex:
|
|
2218
|
-
datasetIndex:
|
|
2213
|
+
name: M.name || x,
|
|
2214
|
+
data: M.data,
|
|
2215
|
+
value: k,
|
|
2216
|
+
color: F(e.color.from, {
|
|
2217
|
+
index: _,
|
|
2218
|
+
seriesIndex: v,
|
|
2219
|
+
categoryIndex: _,
|
|
2220
|
+
datasetIndex: f
|
|
2219
2221
|
}, r),
|
|
2220
2222
|
series: c,
|
|
2221
|
-
seriesIndex:
|
|
2222
|
-
category:
|
|
2223
|
-
categoryIndex:
|
|
2223
|
+
seriesIndex: v,
|
|
2224
|
+
category: x,
|
|
2225
|
+
categoryIndex: _
|
|
2224
2226
|
};
|
|
2225
|
-
|
|
2227
|
+
S.push(K);
|
|
2226
2228
|
}
|
|
2227
2229
|
});
|
|
2228
2230
|
});
|
|
2229
|
-
const
|
|
2230
|
-
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2231
|
+
const m = [], d = /* @__PURE__ */ new Map();
|
|
2232
|
+
S.forEach((c) => {
|
|
2233
|
+
const v = o.find(($) => $.id === c.id || $.name === c.name);
|
|
2234
|
+
v != null && v.id && d.set(v.id, c.index), v != null && v.name && d.set(v.name, c.index);
|
|
2233
2235
|
});
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2236
|
-
|
|
2236
|
+
const b = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map();
|
|
2237
|
+
S.forEach((c) => {
|
|
2238
|
+
b.has(c.series) || b.set(c.series, c.seriesIndex), T.has(c.category) || T.set(c.category, c.categoryIndex);
|
|
2237
2239
|
});
|
|
2238
|
-
let
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2241
|
-
const
|
|
2242
|
-
I.has(
|
|
2243
|
-
}), Array.from(I.entries()).forEach(([c,
|
|
2244
|
-
const
|
|
2245
|
-
if (
|
|
2240
|
+
let O = b.size, h = T.size;
|
|
2241
|
+
const p = (c) => (b.has(c) || b.set(c, O++), b.get(c)), E = (c) => (T.has(c) || T.set(c, h++), T.get(c)), P = s.filter((c) => (c[e.dataset.from] || "default") === i), I = /* @__PURE__ */ new Map();
|
|
2242
|
+
P.forEach((c) => {
|
|
2243
|
+
const v = c.source, $ = c.target, C = c[e.series.from] || "default", g = c[e.category.from] || "default", x = `${v}-${$}-${C}-${g}`;
|
|
2244
|
+
I.has(x) || I.set(x, []), I.get(x).push(c);
|
|
2245
|
+
}), Array.from(I.entries()).forEach(([c, v], $) => {
|
|
2246
|
+
const C = v[0], g = C.source, x = C.target, _ = d.get(g) ?? -1, B = d.get(x) ?? -1;
|
|
2247
|
+
if (_ >= 0 && B >= 0)
|
|
2246
2248
|
if (e.value.aggregate === "none")
|
|
2247
|
-
|
|
2248
|
-
const
|
|
2249
|
-
id:
|
|
2250
|
-
index:
|
|
2249
|
+
v.forEach((j, k) => {
|
|
2250
|
+
const M = j[e.value.from], K = j[e.series.from] || "default", Z = j[e.category.from] || "default", te = p(K), ve = E(Z), Ee = {
|
|
2251
|
+
id: j.id || `edge-${$}-${k}`,
|
|
2252
|
+
index: m.length,
|
|
2251
2253
|
modelType: "graph",
|
|
2252
|
-
name:
|
|
2253
|
-
data:
|
|
2254
|
-
value: typeof
|
|
2255
|
-
color:
|
|
2256
|
-
index:
|
|
2257
|
-
seriesIndex:
|
|
2254
|
+
name: j.name || "",
|
|
2255
|
+
data: j.data,
|
|
2256
|
+
value: typeof M == "number" ? M : null,
|
|
2257
|
+
color: F(e.color.from, {
|
|
2258
|
+
index: m.length,
|
|
2259
|
+
seriesIndex: te,
|
|
2258
2260
|
categoryIndex: ve,
|
|
2259
|
-
datasetIndex:
|
|
2261
|
+
datasetIndex: f
|
|
2260
2262
|
}, r),
|
|
2261
|
-
series:
|
|
2262
|
-
seriesIndex:
|
|
2263
|
-
category:
|
|
2263
|
+
series: K,
|
|
2264
|
+
seriesIndex: te,
|
|
2265
|
+
category: Z,
|
|
2264
2266
|
categoryIndex: ve,
|
|
2265
|
-
source:
|
|
2266
|
-
sourceIndex:
|
|
2267
|
-
target:
|
|
2268
|
-
targetIndex:
|
|
2267
|
+
source: g,
|
|
2268
|
+
sourceIndex: _,
|
|
2269
|
+
target: x,
|
|
2270
|
+
targetIndex: B
|
|
2269
2271
|
};
|
|
2270
|
-
|
|
2272
|
+
m.push(Ee);
|
|
2271
2273
|
});
|
|
2272
2274
|
else {
|
|
2273
|
-
const
|
|
2275
|
+
const j = v.map((Ee) => {
|
|
2274
2276
|
if (e.value.aggregate === "count")
|
|
2275
2277
|
return 1;
|
|
2276
2278
|
const Pe = Ee[e.value.from];
|
|
2277
2279
|
return typeof Pe == "number" ? Pe : null;
|
|
2278
|
-
}),
|
|
2279
|
-
id:
|
|
2280
|
-
index:
|
|
2280
|
+
}), k = pe(j, e.value.aggregate), M = C[e.series.from] || "default", K = C[e.category.from] || "default", Z = p(M), te = E(K), ve = {
|
|
2281
|
+
id: C.id || `edge-${$}-aggregated`,
|
|
2282
|
+
index: m.length,
|
|
2281
2283
|
modelType: "graph",
|
|
2282
|
-
name:
|
|
2283
|
-
data:
|
|
2284
|
-
value:
|
|
2285
|
-
color:
|
|
2286
|
-
index:
|
|
2287
|
-
seriesIndex:
|
|
2288
|
-
categoryIndex:
|
|
2289
|
-
datasetIndex:
|
|
2284
|
+
name: C.name || "",
|
|
2285
|
+
data: C.data,
|
|
2286
|
+
value: k,
|
|
2287
|
+
color: F(e.color.from, {
|
|
2288
|
+
index: m.length,
|
|
2289
|
+
seriesIndex: Z,
|
|
2290
|
+
categoryIndex: te,
|
|
2291
|
+
datasetIndex: f
|
|
2290
2292
|
}, r),
|
|
2291
|
-
series:
|
|
2292
|
-
seriesIndex:
|
|
2293
|
-
category:
|
|
2294
|
-
categoryIndex:
|
|
2295
|
-
source:
|
|
2296
|
-
sourceIndex:
|
|
2297
|
-
target:
|
|
2298
|
-
targetIndex:
|
|
2293
|
+
series: M,
|
|
2294
|
+
seriesIndex: Z,
|
|
2295
|
+
category: K,
|
|
2296
|
+
categoryIndex: te,
|
|
2297
|
+
source: g,
|
|
2298
|
+
sourceIndex: _,
|
|
2299
|
+
target: x,
|
|
2300
|
+
targetIndex: B
|
|
2299
2301
|
};
|
|
2300
|
-
|
|
2302
|
+
m.push(ve);
|
|
2301
2303
|
}
|
|
2302
|
-
}), l.push({ nodes:
|
|
2304
|
+
}), l.push({ nodes: S, edges: m });
|
|
2303
2305
|
}), l;
|
|
2304
2306
|
}, Dr = (t, e, r) => {
|
|
2305
2307
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
2306
2308
|
o ? t.forEach((a, l) => {
|
|
2307
2309
|
a.forEach((i) => {
|
|
2308
|
-
const
|
|
2309
|
-
n.has(
|
|
2310
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
2311
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
2310
2312
|
});
|
|
2311
2313
|
}) : t.forEach((a) => {
|
|
2312
2314
|
const l = a[e.dataset.from] || "default";
|
|
@@ -2318,9 +2320,9 @@ const Ke = {
|
|
|
2318
2320
|
else if (e.dataset.sort === "original") {
|
|
2319
2321
|
const a = [];
|
|
2320
2322
|
o ? t.forEach((l, i) => {
|
|
2321
|
-
l.forEach((
|
|
2322
|
-
const
|
|
2323
|
-
a.includes(
|
|
2323
|
+
l.forEach((f) => {
|
|
2324
|
+
const w = f[e.dataset.from] || `dataset-${i}`;
|
|
2325
|
+
a.includes(w) || a.push(w);
|
|
2324
2326
|
});
|
|
2325
2327
|
}) : t.forEach((l) => {
|
|
2326
2328
|
const i = l[e.dataset.from] || "default";
|
|
@@ -2329,60 +2331,60 @@ const Ke = {
|
|
|
2329
2331
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
2330
2332
|
const u = [];
|
|
2331
2333
|
return s.forEach((a, l) => {
|
|
2332
|
-
const i = n.get(a),
|
|
2334
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2333
2335
|
i.forEach((c) => {
|
|
2334
|
-
const
|
|
2335
|
-
|
|
2336
|
+
const v = c[e.series.from] || "default";
|
|
2337
|
+
f.has(v) || f.set(v, []), f.get(v).push(c);
|
|
2336
2338
|
});
|
|
2337
|
-
let
|
|
2339
|
+
let w = Array.from(f.keys());
|
|
2338
2340
|
if (Array.isArray(e.series.sort))
|
|
2339
|
-
|
|
2341
|
+
w = e.series.sort.filter((c) => f.has(c)).concat(w.filter((c) => !e.series.sort.includes(c)));
|
|
2340
2342
|
else if (e.series.sort === "original") {
|
|
2341
2343
|
const c = [];
|
|
2342
|
-
i.forEach((
|
|
2343
|
-
const
|
|
2344
|
-
c.includes(
|
|
2345
|
-
}),
|
|
2346
|
-
} else e.series.sort === "alphabetical" &&
|
|
2347
|
-
const
|
|
2344
|
+
i.forEach((v) => {
|
|
2345
|
+
const $ = v[e.series.from] || "default";
|
|
2346
|
+
c.includes($) || c.push($);
|
|
2347
|
+
}), w = c;
|
|
2348
|
+
} else e.series.sort === "alphabetical" && w.sort((c, v) => c.localeCompare(v, void 0, { numeric: !0 }));
|
|
2349
|
+
const S = /* @__PURE__ */ new Map();
|
|
2348
2350
|
i.forEach((c) => {
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2351
|
+
const v = c[e.category.from] || "default";
|
|
2352
|
+
S.has(v) || S.set(v, []), S.get(v).push(c);
|
|
2351
2353
|
});
|
|
2352
|
-
let
|
|
2354
|
+
let y = Array.from(S.keys());
|
|
2353
2355
|
if (Array.isArray(e.category.sort))
|
|
2354
|
-
|
|
2356
|
+
y = e.category.sort.filter((c) => S.has(c)).concat(y.filter((c) => !e.category.sort.includes(c)));
|
|
2355
2357
|
else if (e.category.sort === "original") {
|
|
2356
2358
|
const c = [];
|
|
2357
|
-
i.forEach((
|
|
2358
|
-
const
|
|
2359
|
-
c.includes(
|
|
2360
|
-
}),
|
|
2361
|
-
} else e.category.sort === "alphabetical" &&
|
|
2362
|
-
const
|
|
2359
|
+
i.forEach((v) => {
|
|
2360
|
+
const $ = v[e.category.from] || "default";
|
|
2361
|
+
c.includes($) || c.push($);
|
|
2362
|
+
}), y = c;
|
|
2363
|
+
} else e.category.sort === "alphabetical" && y.sort((c, v) => c.localeCompare(v, void 0, { numeric: !0 }));
|
|
2364
|
+
const A = /* @__PURE__ */ new Map();
|
|
2363
2365
|
i.forEach((c) => {
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2366
|
+
const v = c.id || "unknown";
|
|
2367
|
+
A.has(v) || A.set(v, []), A.get(v).push(c);
|
|
2366
2368
|
});
|
|
2367
|
-
let
|
|
2368
|
-
const d =
|
|
2369
|
-
Array.from(
|
|
2370
|
-
const
|
|
2369
|
+
let m = 0;
|
|
2370
|
+
const d = w[0] || "default", b = w.indexOf(d), T = /* @__PURE__ */ new Map();
|
|
2371
|
+
Array.from(A.entries()).forEach(([c, v]) => {
|
|
2372
|
+
const $ = v[0], C = $[e.series.from] || "default", g = w.indexOf(C), x = $[e.category.from] || "default", _ = y.indexOf(x);
|
|
2371
2373
|
if (e.value.aggregate === "none") {
|
|
2372
|
-
const
|
|
2374
|
+
const B = $[e.value.from], j = {
|
|
2373
2375
|
id: c,
|
|
2374
|
-
index:
|
|
2376
|
+
index: m++,
|
|
2375
2377
|
modelType: "tree",
|
|
2376
|
-
name:
|
|
2377
|
-
data:
|
|
2378
|
-
value: typeof
|
|
2379
|
-
color:
|
|
2380
|
-
index:
|
|
2381
|
-
seriesIndex:
|
|
2382
|
-
categoryIndex:
|
|
2378
|
+
name: $.name || c,
|
|
2379
|
+
data: $.data,
|
|
2380
|
+
value: typeof B == "number" ? B : null,
|
|
2381
|
+
color: F(e.color.from, {
|
|
2382
|
+
index: m - 1,
|
|
2383
|
+
seriesIndex: g,
|
|
2384
|
+
categoryIndex: _,
|
|
2383
2385
|
datasetIndex: l
|
|
2384
2386
|
}, r),
|
|
2385
|
-
parent:
|
|
2387
|
+
parent: $.parent || null,
|
|
2386
2388
|
parentIndex: null,
|
|
2387
2389
|
// 稍後設定
|
|
2388
2390
|
depth: 0,
|
|
@@ -2390,32 +2392,32 @@ const Ke = {
|
|
|
2390
2392
|
seq: 0,
|
|
2391
2393
|
// 稍後計算
|
|
2392
2394
|
children: [],
|
|
2393
|
-
series:
|
|
2394
|
-
seriesIndex:
|
|
2395
|
-
category:
|
|
2396
|
-
categoryIndex:
|
|
2395
|
+
series: C,
|
|
2396
|
+
seriesIndex: g,
|
|
2397
|
+
category: x,
|
|
2398
|
+
categoryIndex: _
|
|
2397
2399
|
};
|
|
2398
|
-
|
|
2400
|
+
T.set(c, j);
|
|
2399
2401
|
} else {
|
|
2400
|
-
const
|
|
2402
|
+
const B = v.map((M) => {
|
|
2401
2403
|
if (e.value.aggregate === "count")
|
|
2402
2404
|
return 1;
|
|
2403
|
-
const
|
|
2404
|
-
return typeof
|
|
2405
|
-
}),
|
|
2405
|
+
const K = M[e.value.from];
|
|
2406
|
+
return typeof K == "number" ? K : null;
|
|
2407
|
+
}), j = pe(B, e.value.aggregate), k = {
|
|
2406
2408
|
id: c,
|
|
2407
|
-
index:
|
|
2409
|
+
index: m++,
|
|
2408
2410
|
modelType: "tree",
|
|
2409
|
-
name:
|
|
2410
|
-
data:
|
|
2411
|
-
value:
|
|
2412
|
-
color:
|
|
2413
|
-
index:
|
|
2414
|
-
seriesIndex:
|
|
2415
|
-
categoryIndex:
|
|
2411
|
+
name: $.name || c,
|
|
2412
|
+
data: $.data,
|
|
2413
|
+
value: j,
|
|
2414
|
+
color: F(e.color.from, {
|
|
2415
|
+
index: m - 1,
|
|
2416
|
+
seriesIndex: g,
|
|
2417
|
+
categoryIndex: _,
|
|
2416
2418
|
datasetIndex: l
|
|
2417
2419
|
}, r),
|
|
2418
|
-
parent:
|
|
2420
|
+
parent: $.parent || null,
|
|
2419
2421
|
parentIndex: null,
|
|
2420
2422
|
// 稍後設定
|
|
2421
2423
|
depth: 0,
|
|
@@ -2423,43 +2425,43 @@ const Ke = {
|
|
|
2423
2425
|
seq: 0,
|
|
2424
2426
|
// 稍後計算
|
|
2425
2427
|
children: [],
|
|
2426
|
-
series:
|
|
2427
|
-
seriesIndex:
|
|
2428
|
-
category:
|
|
2429
|
-
categoryIndex:
|
|
2428
|
+
series: C,
|
|
2429
|
+
seriesIndex: g,
|
|
2430
|
+
category: x,
|
|
2431
|
+
categoryIndex: _
|
|
2430
2432
|
};
|
|
2431
|
-
|
|
2433
|
+
T.set(c, k);
|
|
2432
2434
|
}
|
|
2433
2435
|
});
|
|
2434
|
-
const
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
}),
|
|
2438
|
-
c.parent &&
|
|
2436
|
+
const O = Array.from(T.values()), h = /* @__PURE__ */ new Map();
|
|
2437
|
+
O.forEach((c) => {
|
|
2438
|
+
h.set(c.id, c.index);
|
|
2439
|
+
}), O.forEach((c) => {
|
|
2440
|
+
c.parent && h.has(c.parent) && (c.parentIndex = h.get(c.parent));
|
|
2439
2441
|
});
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2442
|
-
c.parent === null ?
|
|
2442
|
+
const p = [], E = /* @__PURE__ */ new Map();
|
|
2443
|
+
O.forEach((c) => {
|
|
2444
|
+
c.parent === null ? p.push(c) : (E.has(c.parent) || E.set(c.parent, []), E.get(c.parent).push(c));
|
|
2443
2445
|
});
|
|
2444
|
-
function
|
|
2445
|
-
c.depth =
|
|
2446
|
-
const
|
|
2447
|
-
return e.value.sort === "asc" ?
|
|
2448
|
-
|
|
2449
|
-
}), c.children =
|
|
2446
|
+
function P(c, v) {
|
|
2447
|
+
c.depth = v;
|
|
2448
|
+
const $ = E.get(c.id) || [];
|
|
2449
|
+
return e.value.sort === "asc" ? $.sort((C, g) => C.value === null && g.value === null ? 0 : C.value === null ? 1 : g.value === null ? -1 : C.value - g.value) : e.value.sort === "desc" && $.sort((C, g) => C.value === null && g.value === null ? 0 : C.value === null ? 1 : g.value === null ? -1 : g.value - C.value), $.forEach((C, g) => {
|
|
2450
|
+
C.seq = g;
|
|
2451
|
+
}), c.children = $.map((C) => P(C, v + 1)), c;
|
|
2450
2452
|
}
|
|
2451
|
-
const I =
|
|
2453
|
+
const I = p.map((c) => P(c, 0));
|
|
2452
2454
|
if (I.length === 0)
|
|
2453
2455
|
u.push({
|
|
2454
2456
|
id: `empty-${a}`,
|
|
2455
|
-
index:
|
|
2457
|
+
index: m++,
|
|
2456
2458
|
modelType: "tree",
|
|
2457
2459
|
name: "Empty Tree",
|
|
2458
2460
|
data: {},
|
|
2459
2461
|
value: null,
|
|
2460
|
-
color:
|
|
2461
|
-
index:
|
|
2462
|
-
seriesIndex:
|
|
2462
|
+
color: F(e.color.from, {
|
|
2463
|
+
index: m - 1,
|
|
2464
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2463
2465
|
categoryIndex: 0,
|
|
2464
2466
|
datasetIndex: l
|
|
2465
2467
|
}, r),
|
|
@@ -2469,7 +2471,7 @@ const Ke = {
|
|
|
2469
2471
|
seq: 0,
|
|
2470
2472
|
children: [],
|
|
2471
2473
|
series: d,
|
|
2472
|
-
seriesIndex:
|
|
2474
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2473
2475
|
category: "default",
|
|
2474
2476
|
categoryIndex: 0
|
|
2475
2477
|
});
|
|
@@ -2478,14 +2480,14 @@ const Ke = {
|
|
|
2478
2480
|
else {
|
|
2479
2481
|
const c = {
|
|
2480
2482
|
id: `virtual-root-${a}`,
|
|
2481
|
-
index:
|
|
2483
|
+
index: m++,
|
|
2482
2484
|
modelType: "tree",
|
|
2483
2485
|
name: `Virtual Root (${a})`,
|
|
2484
2486
|
data: {},
|
|
2485
2487
|
value: null,
|
|
2486
|
-
color:
|
|
2487
|
-
index:
|
|
2488
|
-
seriesIndex:
|
|
2488
|
+
color: F(e.color.from, {
|
|
2489
|
+
index: m - 1,
|
|
2490
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2489
2491
|
categoryIndex: 0,
|
|
2490
2492
|
datasetIndex: l
|
|
2491
2493
|
}, r),
|
|
@@ -2493,12 +2495,12 @@ const Ke = {
|
|
|
2493
2495
|
parentIndex: null,
|
|
2494
2496
|
depth: 0,
|
|
2495
2497
|
seq: 0,
|
|
2496
|
-
children: I.map((
|
|
2497
|
-
const
|
|
2498
|
-
return
|
|
2498
|
+
children: I.map((v, $) => {
|
|
2499
|
+
const C = (g, x) => (g.depth = x, x === 1 && (g.seq = $), g.children = g.children.map((_) => C(_, x + 1)), g);
|
|
2500
|
+
return C(v, 1);
|
|
2499
2501
|
}),
|
|
2500
2502
|
series: d,
|
|
2501
|
-
seriesIndex:
|
|
2503
|
+
seriesIndex: b < 0 ? 0 : b,
|
|
2502
2504
|
category: "default",
|
|
2503
2505
|
categoryIndex: 0
|
|
2504
2506
|
};
|
|
@@ -2526,13 +2528,13 @@ function Nr(t, e, r) {
|
|
|
2526
2528
|
}
|
|
2527
2529
|
function Ne(t, e, r, n, o) {
|
|
2528
2530
|
Object.keys(r).filter((i) => !e.includes(i)).forEach((i) => {
|
|
2529
|
-
const
|
|
2530
|
-
|
|
2531
|
+
const f = r[i];
|
|
2532
|
+
f && f.parentNode === t && t.removeChild(f), delete r[i];
|
|
2531
2533
|
});
|
|
2532
2534
|
const a = e.filter((i) => !r[i]);
|
|
2533
2535
|
a.forEach((i) => {
|
|
2534
|
-
const
|
|
2535
|
-
r[i] =
|
|
2536
|
+
const f = n(i);
|
|
2537
|
+
r[i] = f, t.appendChild(f);
|
|
2536
2538
|
}), e.filter((i) => r[i] && !a.includes(i)).forEach((i) => {
|
|
2537
2539
|
r[i];
|
|
2538
2540
|
}), e.length > 0 && Nr(t, e, r);
|
|
@@ -2737,7 +2739,7 @@ function dt(t) {
|
|
|
2737
2739
|
data: {
|
|
2738
2740
|
toBe: "RawDataColumn[] | RawDataColumn[][]",
|
|
2739
2741
|
// 畢免資料量過大檢查不完,不深度檢查
|
|
2740
|
-
test: (r) => Array.isArray(r) && r.every((n) => Array.isArray(n) ||
|
|
2742
|
+
test: (r) => Array.isArray(r) && r.every((n) => Array.isArray(n) || X(n))
|
|
2741
2743
|
}
|
|
2742
2744
|
});
|
|
2743
2745
|
}
|
|
@@ -2745,7 +2747,7 @@ function $e(t) {
|
|
|
2745
2747
|
return V({ plugins: t }, {
|
|
2746
2748
|
plugins: {
|
|
2747
2749
|
toBe: "PluginEntity[]",
|
|
2748
|
-
test: (r) => Array.isArray(r) && r.every((n) =>
|
|
2750
|
+
test: (r) => Array.isArray(r) && r.every((n) => X(n) && typeof n._name == "string" && typeof n._injectContext == "function")
|
|
2749
2751
|
}
|
|
2750
2752
|
});
|
|
2751
2753
|
}
|
|
@@ -2769,7 +2771,7 @@ function qr(t) {
|
|
|
2769
2771
|
},
|
|
2770
2772
|
plugins: {
|
|
2771
2773
|
toBe: "PluginEntity[]",
|
|
2772
|
-
test: (r) => Array.isArray(r) && r.every((n) =>
|
|
2774
|
+
test: (r) => Array.isArray(r) && r.every((n) => X(n) && typeof n._name == "string" && typeof n._injectContext == "function")
|
|
2773
2775
|
}
|
|
2774
2776
|
});
|
|
2775
2777
|
if (e.status === "error")
|
|
@@ -2803,386 +2805,392 @@ function qr(t) {
|
|
|
2803
2805
|
}
|
|
2804
2806
|
function Gr({ svgElement$: t, canvasElement$: e, pluginsInstance$: r }) {
|
|
2805
2807
|
let n = [], o = [];
|
|
2806
|
-
const s = (l, i,
|
|
2807
|
-
const
|
|
2808
|
-
...
|
|
2809
|
-
pluginSeq:
|
|
2808
|
+
const s = (l, i, f) => {
|
|
2809
|
+
const w = r.getValue().reduce((A, m, d) => (A[m._getId()] = d, A), {}), S = f.map((A) => ({
|
|
2810
|
+
...A,
|
|
2811
|
+
pluginSeq: w[A.pluginId]
|
|
2810
2812
|
}));
|
|
2811
|
-
return (l === "svg" ? n : o).filter((
|
|
2812
|
-
...
|
|
2813
|
-
pluginSeq:
|
|
2814
|
-
})).concat(
|
|
2813
|
+
return (l === "svg" ? n : o).filter((A) => A.pluginId !== i).map((A) => ({
|
|
2814
|
+
...A,
|
|
2815
|
+
pluginSeq: w[A.pluginId]
|
|
2816
|
+
})).concat(S).sort((A, m) => A.layerIndex - m.layerIndex || A.pluginSeq - m.pluginSeq);
|
|
2815
2817
|
}, u = {}, a = {};
|
|
2816
|
-
return (l, i,
|
|
2817
|
-
const
|
|
2818
|
-
if (!
|
|
2818
|
+
return (l, i, f) => {
|
|
2819
|
+
const w = l === "svg" ? t.getValue() : e.getValue();
|
|
2820
|
+
if (!w)
|
|
2819
2821
|
return {};
|
|
2820
|
-
const
|
|
2822
|
+
const S = l === "svg" ? u : a, y = s(l, i, f), A = y.map((d) => Mr(d.pluginId, d.layerName));
|
|
2821
2823
|
return l === "svg" ? (Ne(
|
|
2822
|
-
b,
|
|
2823
|
-
v,
|
|
2824
2824
|
w,
|
|
2825
|
+
A,
|
|
2826
|
+
S,
|
|
2825
2827
|
(d) => Br(d)
|
|
2826
|
-
), n =
|
|
2827
|
-
b,
|
|
2828
|
-
v,
|
|
2828
|
+
), n = y) : (Ne(
|
|
2829
2829
|
w,
|
|
2830
|
+
A,
|
|
2831
|
+
S,
|
|
2830
2832
|
(d) => ft(d)
|
|
2831
|
-
), o =
|
|
2832
|
-
const [
|
|
2833
|
-
return
|
|
2833
|
+
), o = y), Object.entries(S).reduce((d, [b, T]) => {
|
|
2834
|
+
const [O, h, p] = b.split("-");
|
|
2835
|
+
return h === i && (d[p] = T), d;
|
|
2834
2836
|
}, {});
|
|
2835
2837
|
};
|
|
2836
2838
|
}
|
|
2837
2839
|
const Wr = (t, e) => {
|
|
2838
2840
|
try {
|
|
2839
|
-
const { status:
|
|
2840
|
-
if (
|
|
2841
|
-
throw new Error(
|
|
2842
|
-
columnName:
|
|
2843
|
-
expectToBe:
|
|
2841
|
+
const { status: b, columnName: T, expectToBe: O } = qr(e);
|
|
2842
|
+
if (b === "error")
|
|
2843
|
+
throw new Error(H({
|
|
2844
|
+
columnName: T,
|
|
2845
|
+
expectToBe: O,
|
|
2844
2846
|
from: "Chart.constructor"
|
|
2845
2847
|
}));
|
|
2846
|
-
if (
|
|
2847
|
-
console.warn(
|
|
2848
|
-
columnName:
|
|
2849
|
-
expectToBe:
|
|
2848
|
+
if (b === "warning")
|
|
2849
|
+
console.warn(Q({
|
|
2850
|
+
columnName: T,
|
|
2851
|
+
expectToBe: O,
|
|
2850
2852
|
from: "Chart.constructor"
|
|
2851
2853
|
}));
|
|
2852
2854
|
else {
|
|
2853
|
-
const { status:
|
|
2854
|
-
if (
|
|
2855
|
-
throw new Error(
|
|
2855
|
+
const { status: h, columnName: p, expectToBe: E } = Ur(t);
|
|
2856
|
+
if (h === "error")
|
|
2857
|
+
throw new Error(H({
|
|
2856
2858
|
columnName: p,
|
|
2857
|
-
expectToBe:
|
|
2859
|
+
expectToBe: E,
|
|
2858
2860
|
from: "Chart.constructor"
|
|
2859
2861
|
}));
|
|
2860
|
-
|
|
2862
|
+
h === "warning" && console.warn(Q({
|
|
2861
2863
|
columnName: p,
|
|
2862
|
-
expectToBe:
|
|
2864
|
+
expectToBe: E,
|
|
2863
2865
|
from: "Chart.constructor"
|
|
2864
2866
|
}));
|
|
2865
2867
|
}
|
|
2866
|
-
} catch (
|
|
2867
|
-
throw new Error(
|
|
2868
|
+
} catch (b) {
|
|
2869
|
+
throw new Error(b);
|
|
2868
2870
|
}
|
|
2869
|
-
const r = new oe(), n = new D((e == null ? void 0 : e.data) || []), o = e && e.encoding ?
|
|
2870
|
-
const
|
|
2871
|
-
br((
|
|
2872
|
-
() =>
|
|
2871
|
+
const r = new oe(), n = new D((e == null ? void 0 : e.data) || []), o = e && e.encoding ? W(Fe, e.encoding) : Fe, s = new D(o), u = e && e.theme ? W(De, e.theme) : De, a = new D(u), l = new D((e == null ? void 0 : e.plugins) || []), i = e && e.size ? W(Ke, e.size) : Ke, f = new D(i), w = new D(null), S = new D(null), y = (() => {
|
|
2872
|
+
const b = f.pipe(
|
|
2873
|
+
br((g) => fr(
|
|
2874
|
+
() => g.width === "auto" || g.height === "auto",
|
|
2873
2875
|
// 有 'auto' 的話就監聽element的尺寸
|
|
2874
|
-
|
|
2875
|
-
q((
|
|
2876
|
-
width:
|
|
2877
|
-
height:
|
|
2876
|
+
jr(t).pipe(
|
|
2877
|
+
q((x) => ({
|
|
2878
|
+
width: g.width === "auto" ? x.width : g.width,
|
|
2879
|
+
height: g.height === "auto" ? x.height <= 0 ? x.width : x.height : g.height
|
|
2878
2880
|
})),
|
|
2879
|
-
G(
|
|
2880
|
-
pr((
|
|
2881
|
+
G(g.resizeDebounce),
|
|
2882
|
+
pr((x, _) => JSON.stringify(x) === JSON.stringify(_))
|
|
2881
2883
|
),
|
|
2882
2884
|
Qt({
|
|
2883
|
-
width:
|
|
2884
|
-
height:
|
|
2885
|
+
width: g.width,
|
|
2886
|
+
height: g.height
|
|
2885
2887
|
})
|
|
2886
2888
|
)),
|
|
2887
2889
|
wr(r),
|
|
2888
|
-
|
|
2889
|
-
),
|
|
2890
|
-
|
|
2891
|
-
),
|
|
2890
|
+
re(1)
|
|
2891
|
+
), T = s.asObservable().pipe(
|
|
2892
|
+
re(1)
|
|
2893
|
+
), O = J([
|
|
2892
2894
|
n,
|
|
2893
2895
|
s,
|
|
2894
2896
|
a
|
|
2895
2897
|
]).pipe(
|
|
2896
2898
|
G(0),
|
|
2897
|
-
q(([
|
|
2899
|
+
q(([g, x, _]) => {
|
|
2898
2900
|
try {
|
|
2899
|
-
return Vr(
|
|
2900
|
-
} catch (
|
|
2901
|
+
return Vr(g, x, _);
|
|
2902
|
+
} catch (B) {
|
|
2901
2903
|
throw new Error(fe({
|
|
2902
2904
|
from: "Chart.seriesData$",
|
|
2903
|
-
systemMessage:
|
|
2905
|
+
systemMessage: B
|
|
2904
2906
|
}));
|
|
2905
2907
|
}
|
|
2906
2908
|
}),
|
|
2907
|
-
ae((
|
|
2908
|
-
|
|
2909
|
-
),
|
|
2909
|
+
ae((g) => (console.error(z(g)), se)),
|
|
2910
|
+
re(1)
|
|
2911
|
+
), h = J([
|
|
2910
2912
|
n,
|
|
2911
2913
|
s,
|
|
2912
2914
|
a
|
|
2913
2915
|
]).pipe(
|
|
2914
2916
|
G(0),
|
|
2915
|
-
q(([
|
|
2917
|
+
q(([g, x, _]) => {
|
|
2916
2918
|
try {
|
|
2917
|
-
return Rr(
|
|
2918
|
-
} catch (
|
|
2919
|
+
return Rr(g, x, _);
|
|
2920
|
+
} catch (B) {
|
|
2919
2921
|
throw new Error(fe({
|
|
2920
2922
|
from: "Chart.gridData$",
|
|
2921
|
-
systemMessage:
|
|
2923
|
+
systemMessage: B
|
|
2922
2924
|
}));
|
|
2923
2925
|
}
|
|
2924
2926
|
}),
|
|
2925
|
-
ae((
|
|
2926
|
-
|
|
2927
|
-
), p =
|
|
2927
|
+
ae((g) => (console.error(z(g)), se)),
|
|
2928
|
+
re(1)
|
|
2929
|
+
), p = J([
|
|
2928
2930
|
n,
|
|
2929
2931
|
s,
|
|
2930
2932
|
a
|
|
2931
2933
|
]).pipe(
|
|
2932
2934
|
G(0),
|
|
2933
|
-
q(([
|
|
2935
|
+
q(([g, x, _]) => {
|
|
2934
2936
|
try {
|
|
2935
|
-
return Kr(
|
|
2936
|
-
} catch (
|
|
2937
|
+
return Kr(g, x, _);
|
|
2938
|
+
} catch (B) {
|
|
2937
2939
|
throw new Error(fe({
|
|
2938
2940
|
from: "Chart.multivariateData$",
|
|
2939
|
-
systemMessage:
|
|
2941
|
+
systemMessage: B
|
|
2940
2942
|
}));
|
|
2941
2943
|
}
|
|
2942
2944
|
}),
|
|
2943
|
-
ae((
|
|
2944
|
-
|
|
2945
|
-
),
|
|
2945
|
+
ae((g) => (console.error(z(g)), se)),
|
|
2946
|
+
re(1)
|
|
2947
|
+
), E = J([
|
|
2946
2948
|
n,
|
|
2947
2949
|
s,
|
|
2948
2950
|
a
|
|
2949
2951
|
]).pipe(
|
|
2950
2952
|
G(0),
|
|
2951
|
-
q(([
|
|
2953
|
+
q(([g, x, _]) => {
|
|
2952
2954
|
try {
|
|
2953
|
-
return Fr(
|
|
2954
|
-
} catch (
|
|
2955
|
+
return Fr(g, x, _);
|
|
2956
|
+
} catch (B) {
|
|
2955
2957
|
throw new Error(fe({
|
|
2956
2958
|
from: "Chart.graphData$",
|
|
2957
|
-
systemMessage:
|
|
2959
|
+
systemMessage: B
|
|
2958
2960
|
}));
|
|
2959
2961
|
}
|
|
2960
2962
|
}),
|
|
2961
|
-
ae((
|
|
2962
|
-
|
|
2963
|
-
),
|
|
2963
|
+
ae((g) => (console.error(z(g)), se)),
|
|
2964
|
+
re(1)
|
|
2965
|
+
), P = J([
|
|
2964
2966
|
n,
|
|
2965
2967
|
s,
|
|
2966
2968
|
a
|
|
2967
2969
|
]).pipe(
|
|
2968
2970
|
G(0),
|
|
2969
|
-
q(([
|
|
2971
|
+
q(([g, x, _]) => {
|
|
2970
2972
|
try {
|
|
2971
|
-
return Dr(
|
|
2972
|
-
} catch (
|
|
2973
|
+
return Dr(g, x, _);
|
|
2974
|
+
} catch (B) {
|
|
2973
2975
|
throw new Error(fe({
|
|
2974
2976
|
from: "Chart.treeData$",
|
|
2975
|
-
systemMessage:
|
|
2977
|
+
systemMessage: B
|
|
2976
2978
|
}));
|
|
2977
2979
|
}
|
|
2978
2980
|
}),
|
|
2979
|
-
ae((
|
|
2980
|
-
|
|
2981
|
-
),
|
|
2982
|
-
l.subscribe((
|
|
2983
|
-
const
|
|
2984
|
-
var
|
|
2985
|
-
let
|
|
2986
|
-
if (
|
|
2987
|
-
const
|
|
2988
|
-
|
|
2981
|
+
ae((g) => (console.error(z(g)), se)),
|
|
2982
|
+
re(1)
|
|
2983
|
+
), I = new D([]);
|
|
2984
|
+
l.subscribe((g) => {
|
|
2985
|
+
const x = {}, _ = g.map((j) => {
|
|
2986
|
+
var M;
|
|
2987
|
+
let k = j._getId();
|
|
2988
|
+
if (x[k]) {
|
|
2989
|
+
const K = ((M = x[k].split("[")[1]) == null ? void 0 : M.split("]")[0]) || "0", Z = parseInt(K) + 1;
|
|
2990
|
+
k = `${k.split("[")[0]}[${Z}]`;
|
|
2989
2991
|
}
|
|
2990
|
-
return
|
|
2992
|
+
return x[k] = j._getId(), k;
|
|
2991
2993
|
});
|
|
2992
|
-
|
|
2993
|
-
const
|
|
2994
|
-
id:
|
|
2995
|
-
name:
|
|
2996
|
-
elementType:
|
|
2997
|
-
shownLayers:
|
|
2994
|
+
g.forEach((j, k) => j._setId(_[k]));
|
|
2995
|
+
const B = g.map((j) => ({
|
|
2996
|
+
id: j._getId(),
|
|
2997
|
+
name: j._name,
|
|
2998
|
+
elementType: j._elementType,
|
|
2999
|
+
shownLayers: j.getShownLayerNames()
|
|
2998
3000
|
}));
|
|
2999
|
-
|
|
3001
|
+
I.next(B);
|
|
3000
3002
|
});
|
|
3001
|
-
const
|
|
3002
|
-
|
|
3003
|
-
),
|
|
3003
|
+
const c = a.asObservable().pipe(
|
|
3004
|
+
re(1)
|
|
3005
|
+
), v = new oe(), $ = v.asObservable().pipe(
|
|
3004
3006
|
lt()
|
|
3005
3007
|
);
|
|
3006
3008
|
return {
|
|
3007
3009
|
root: t,
|
|
3008
3010
|
svg: null,
|
|
3009
3011
|
canvas: null,
|
|
3010
|
-
size$:
|
|
3011
|
-
encoding$:
|
|
3012
|
-
seriesData$:
|
|
3013
|
-
gridData$:
|
|
3012
|
+
size$: b,
|
|
3013
|
+
encoding$: T,
|
|
3014
|
+
seriesData$: O,
|
|
3015
|
+
gridData$: h,
|
|
3014
3016
|
multivariateData$: p,
|
|
3015
|
-
graphData$:
|
|
3016
|
-
treeData$:
|
|
3017
|
-
plugins$:
|
|
3018
|
-
theme$:
|
|
3019
|
-
event$:
|
|
3020
|
-
eventTrigger$:
|
|
3017
|
+
graphData$: E,
|
|
3018
|
+
treeData$: P,
|
|
3019
|
+
plugins$: I,
|
|
3020
|
+
theme$: c,
|
|
3021
|
+
event$: $,
|
|
3022
|
+
eventTrigger$: v,
|
|
3021
3023
|
_updateLayerElements: Gr({
|
|
3022
|
-
svgElement$:
|
|
3023
|
-
canvasElement$:
|
|
3024
|
+
svgElement$: w,
|
|
3025
|
+
canvasElement$: S,
|
|
3024
3026
|
pluginsInstance$: l
|
|
3025
3027
|
})
|
|
3026
3028
|
};
|
|
3027
3029
|
})();
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3030
|
+
let A = null;
|
|
3031
|
+
const m = () => (A || (A = document.createElement("div"), A.classList.add("orbcharts-container"), A.style.position = "relative", t.appendChild(A)), A);
|
|
3032
|
+
let d = [];
|
|
3033
|
+
return l.subscribe((b) => {
|
|
3034
|
+
d.filter((p) => !b.includes(p)).forEach((p) => {
|
|
3035
|
+
y._updateLayerElements(p._elementType, p._getId(), []), p.destroy();
|
|
3036
|
+
}), d = b;
|
|
3037
|
+
let O = !1, h = !1;
|
|
3038
|
+
b.forEach((p) => {
|
|
3039
|
+
p._elementType === "svg" ? O = !0 : p._elementType === "canvas" && (h = !0);
|
|
3040
|
+
}), O && !y.svg ? (y.svg = Cr("orbcharts-root-svg"), m().appendChild(y.svg), w.next(y.svg)) : !O && y.svg && (y.svg.remove(), y.svg = null, w.next(null)), h && !y.canvas ? (y.canvas = ft("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) => {
|
|
3041
|
+
p._injectContext(y);
|
|
3034
3042
|
});
|
|
3035
|
-
}),
|
|
3036
|
-
size:
|
|
3037
|
-
svg:
|
|
3043
|
+
}), J({
|
|
3044
|
+
size: y.size$,
|
|
3045
|
+
svg: w
|
|
3038
3046
|
}).pipe(
|
|
3039
3047
|
G(0),
|
|
3040
|
-
ye(({ svg:
|
|
3041
|
-
).subscribe(({ size:
|
|
3042
|
-
|
|
3043
|
-
}),
|
|
3044
|
-
size:
|
|
3045
|
-
canvas:
|
|
3048
|
+
ye(({ svg: b }) => !!b)
|
|
3049
|
+
).subscribe(({ size: b, svg: T }) => {
|
|
3050
|
+
T && (T.setAttribute("width", b.width.toString()), T.setAttribute("height", b.height.toString()));
|
|
3051
|
+
}), J({
|
|
3052
|
+
size: y.size$,
|
|
3053
|
+
canvas: S
|
|
3046
3054
|
}).pipe(
|
|
3047
3055
|
G(0),
|
|
3048
|
-
ye(({ canvas:
|
|
3049
|
-
).subscribe(({ size:
|
|
3050
|
-
|
|
3056
|
+
ye(({ canvas: b }) => !!b)
|
|
3057
|
+
).subscribe(({ size: b, canvas: T }) => {
|
|
3058
|
+
T && (T.width = b.width, T.height = b.height);
|
|
3051
3059
|
}), /* @__PURE__ */ (() => {
|
|
3052
|
-
function
|
|
3053
|
-
|
|
3060
|
+
function b(g) {
|
|
3061
|
+
f.next(g);
|
|
3054
3062
|
}
|
|
3055
|
-
function
|
|
3063
|
+
function T(g) {
|
|
3056
3064
|
try {
|
|
3057
|
-
const { status:
|
|
3058
|
-
if (
|
|
3059
|
-
throw new Error(
|
|
3060
|
-
columnName:
|
|
3061
|
-
expectToBe:
|
|
3065
|
+
const { status: x, columnName: _, expectToBe: B } = dt(g);
|
|
3066
|
+
if (x === "error")
|
|
3067
|
+
throw new Error(H({
|
|
3068
|
+
columnName: _,
|
|
3069
|
+
expectToBe: B,
|
|
3062
3070
|
from: "Chart.setData"
|
|
3063
3071
|
}));
|
|
3064
|
-
|
|
3065
|
-
columnName:
|
|
3066
|
-
expectToBe:
|
|
3072
|
+
x === "warning" && console.warn(Q({
|
|
3073
|
+
columnName: _,
|
|
3074
|
+
expectToBe: B,
|
|
3067
3075
|
from: "Chart.setData"
|
|
3068
3076
|
}));
|
|
3069
|
-
} catch (
|
|
3070
|
-
console.error(z(
|
|
3077
|
+
} catch (x) {
|
|
3078
|
+
console.error(z(x));
|
|
3071
3079
|
}
|
|
3072
|
-
n.next(
|
|
3080
|
+
n.next(g);
|
|
3073
3081
|
}
|
|
3074
|
-
function
|
|
3082
|
+
function O(g) {
|
|
3075
3083
|
try {
|
|
3076
|
-
const { status:
|
|
3077
|
-
if (
|
|
3078
|
-
throw new Error(
|
|
3079
|
-
columnName:
|
|
3080
|
-
expectToBe:
|
|
3084
|
+
const { status: _, columnName: B, expectToBe: j } = pt(g);
|
|
3085
|
+
if (_ === "error")
|
|
3086
|
+
throw new Error(H({
|
|
3087
|
+
columnName: B,
|
|
3088
|
+
expectToBe: j,
|
|
3081
3089
|
from: "Chart.updateEncoding"
|
|
3082
3090
|
}));
|
|
3083
|
-
|
|
3084
|
-
columnName:
|
|
3085
|
-
expectToBe:
|
|
3091
|
+
_ === "warning" && console.warn(Q({
|
|
3092
|
+
columnName: B,
|
|
3093
|
+
expectToBe: j,
|
|
3086
3094
|
from: "Chart.updateEncoding"
|
|
3087
3095
|
}));
|
|
3088
|
-
} catch (
|
|
3089
|
-
console.error(z(
|
|
3096
|
+
} catch (_) {
|
|
3097
|
+
console.error(z(_));
|
|
3090
3098
|
}
|
|
3091
|
-
const
|
|
3092
|
-
s.next(
|
|
3099
|
+
const x = W(s.getValue(), g);
|
|
3100
|
+
s.next(x);
|
|
3093
3101
|
}
|
|
3094
|
-
function
|
|
3095
|
-
s.next(
|
|
3102
|
+
function h(g) {
|
|
3103
|
+
s.next(g);
|
|
3096
3104
|
}
|
|
3097
3105
|
function p() {
|
|
3098
3106
|
return s.getValue();
|
|
3099
3107
|
}
|
|
3100
|
-
function
|
|
3108
|
+
function E(g) {
|
|
3101
3109
|
try {
|
|
3102
|
-
const { status:
|
|
3103
|
-
if (
|
|
3104
|
-
throw new Error(
|
|
3105
|
-
columnName:
|
|
3106
|
-
expectToBe:
|
|
3110
|
+
const { status: x, columnName: _, expectToBe: B } = $e(g);
|
|
3111
|
+
if (x === "error")
|
|
3112
|
+
throw new Error(H({
|
|
3113
|
+
columnName: _,
|
|
3114
|
+
expectToBe: B,
|
|
3107
3115
|
from: "Chart.setPlugins"
|
|
3108
3116
|
}));
|
|
3109
|
-
|
|
3110
|
-
columnName:
|
|
3111
|
-
expectToBe:
|
|
3117
|
+
x === "warning" && console.warn(Q({
|
|
3118
|
+
columnName: _,
|
|
3119
|
+
expectToBe: B,
|
|
3112
3120
|
from: "Chart.setPlugins"
|
|
3113
3121
|
}));
|
|
3114
|
-
} catch (
|
|
3115
|
-
console.error(z(
|
|
3122
|
+
} catch (x) {
|
|
3123
|
+
console.error(z(x));
|
|
3116
3124
|
}
|
|
3117
|
-
l.next(
|
|
3125
|
+
l.next(g);
|
|
3118
3126
|
}
|
|
3119
|
-
function
|
|
3127
|
+
function P(g) {
|
|
3120
3128
|
try {
|
|
3121
|
-
const { status:
|
|
3122
|
-
if (
|
|
3123
|
-
throw new Error(
|
|
3124
|
-
columnName:
|
|
3125
|
-
expectToBe:
|
|
3129
|
+
const { status: x, columnName: _, expectToBe: B } = $e([g]);
|
|
3130
|
+
if (x === "error")
|
|
3131
|
+
throw new Error(H({
|
|
3132
|
+
columnName: _,
|
|
3133
|
+
expectToBe: B,
|
|
3126
3134
|
from: "Chart.addPlugin"
|
|
3127
3135
|
}));
|
|
3128
|
-
|
|
3129
|
-
columnName:
|
|
3130
|
-
expectToBe:
|
|
3136
|
+
x === "warning" && console.warn(Q({
|
|
3137
|
+
columnName: _,
|
|
3138
|
+
expectToBe: B,
|
|
3131
3139
|
from: "Chart.addPlugin"
|
|
3132
3140
|
}));
|
|
3133
|
-
} catch (
|
|
3134
|
-
console.error(z(
|
|
3141
|
+
} catch (x) {
|
|
3142
|
+
console.error(z(x));
|
|
3135
3143
|
}
|
|
3136
|
-
l.next([...l.getValue(),
|
|
3144
|
+
l.next([...l.getValue(), g]);
|
|
3137
3145
|
}
|
|
3138
|
-
function
|
|
3139
|
-
l.next(l.getValue().filter((
|
|
3146
|
+
function I(g) {
|
|
3147
|
+
l.next(l.getValue().filter((x) => x._getId() !== g));
|
|
3140
3148
|
}
|
|
3141
|
-
function
|
|
3149
|
+
function c(g) {
|
|
3142
3150
|
try {
|
|
3143
|
-
const { status:
|
|
3144
|
-
if (
|
|
3145
|
-
throw new Error(
|
|
3146
|
-
columnName:
|
|
3147
|
-
expectToBe:
|
|
3151
|
+
const { status: _, columnName: B, expectToBe: j } = yt(g);
|
|
3152
|
+
if (_ === "error")
|
|
3153
|
+
throw new Error(H({
|
|
3154
|
+
columnName: B,
|
|
3155
|
+
expectToBe: j,
|
|
3148
3156
|
from: "Chart.updateTheme"
|
|
3149
3157
|
}));
|
|
3150
|
-
|
|
3151
|
-
columnName:
|
|
3152
|
-
expectToBe:
|
|
3158
|
+
_ === "warning" && console.warn(Q({
|
|
3159
|
+
columnName: B,
|
|
3160
|
+
expectToBe: j,
|
|
3153
3161
|
from: "Chart.updateTheme"
|
|
3154
3162
|
}));
|
|
3155
|
-
} catch (
|
|
3156
|
-
console.error(z(
|
|
3163
|
+
} catch (_) {
|
|
3164
|
+
console.error(z(_));
|
|
3157
3165
|
}
|
|
3158
|
-
const
|
|
3159
|
-
a.next(
|
|
3166
|
+
const x = W(a.getValue(), g);
|
|
3167
|
+
a.next(x);
|
|
3160
3168
|
}
|
|
3161
|
-
function
|
|
3162
|
-
a.next(
|
|
3169
|
+
function v(g) {
|
|
3170
|
+
a.next(g);
|
|
3163
3171
|
}
|
|
3164
|
-
function
|
|
3172
|
+
function $() {
|
|
3165
3173
|
return a.getValue();
|
|
3166
3174
|
}
|
|
3167
|
-
function
|
|
3168
|
-
r.next(void 0), Pr(t);
|
|
3175
|
+
function C() {
|
|
3176
|
+
r.next(void 0), Pr(t), A = null;
|
|
3169
3177
|
}
|
|
3170
3178
|
return {
|
|
3171
|
-
resize:
|
|
3172
|
-
setData:
|
|
3179
|
+
resize: b,
|
|
3180
|
+
setData: T,
|
|
3173
3181
|
// setEncoding,
|
|
3174
|
-
updateEncoding:
|
|
3175
|
-
forceReplaceEncoding:
|
|
3182
|
+
updateEncoding: O,
|
|
3183
|
+
forceReplaceEncoding: h,
|
|
3176
3184
|
getEncoding: p,
|
|
3177
|
-
setPlugins:
|
|
3178
|
-
addPlugin:
|
|
3179
|
-
removePlugin:
|
|
3185
|
+
setPlugins: E,
|
|
3186
|
+
addPlugin: P,
|
|
3187
|
+
removePlugin: I,
|
|
3180
3188
|
// setTheme,
|
|
3181
|
-
updateTheme:
|
|
3182
|
-
forceReplaceTheme:
|
|
3183
|
-
getTheme:
|
|
3184
|
-
destroy:
|
|
3185
|
-
context:
|
|
3189
|
+
updateTheme: c,
|
|
3190
|
+
forceReplaceTheme: v,
|
|
3191
|
+
getTheme: $,
|
|
3192
|
+
destroy: C,
|
|
3193
|
+
context: y
|
|
3186
3194
|
};
|
|
3187
3195
|
})();
|
|
3188
3196
|
};
|
|
@@ -3195,100 +3203,104 @@ const mt = (t, e, r) => {
|
|
|
3195
3203
|
let n = e.name, o = () => {
|
|
3196
3204
|
};
|
|
3197
3205
|
const s = new D(null), u = s.pipe(
|
|
3198
|
-
ye((
|
|
3199
|
-
), a = {
|
|
3206
|
+
ye((h) => h !== null)
|
|
3207
|
+
), a = e.layers.map((h) => new h()), l = {
|
|
3200
3208
|
// 將陣列轉成字典
|
|
3201
|
-
...
|
|
3202
|
-
},
|
|
3203
|
-
if (
|
|
3204
|
-
const
|
|
3205
|
-
return Object.keys(
|
|
3209
|
+
...a.reduce((h, p) => (h[p._name] = p, h), {})
|
|
3210
|
+
}, i = () => new Set(a.map((h) => h._name)), f = (h) => {
|
|
3211
|
+
if (h) {
|
|
3212
|
+
const p = i();
|
|
3213
|
+
return Object.keys(h).filter((P) => p.has(P));
|
|
3206
3214
|
}
|
|
3207
3215
|
return [];
|
|
3208
|
-
},
|
|
3209
|
-
new Set(
|
|
3210
|
-
),
|
|
3211
|
-
q((
|
|
3212
|
-
var
|
|
3216
|
+
}, w = a.reduce((h, p) => (p._initShow && h.push(p._name), h), []), S = f(r), y = new D(
|
|
3217
|
+
new Set(S.length > 0 ? S : w)
|
|
3218
|
+
), A = y.pipe(
|
|
3219
|
+
q((h) => Array.from(h).map((E) => {
|
|
3220
|
+
var P;
|
|
3213
3221
|
return [
|
|
3214
|
-
|
|
3215
|
-
((
|
|
3222
|
+
E,
|
|
3223
|
+
((P = a.find((I) => I._name === E)) == null ? void 0 : P._layerIndex) ?? -1
|
|
3216
3224
|
];
|
|
3217
|
-
}).filter(([,
|
|
3218
|
-
)
|
|
3225
|
+
}).filter(([, E]) => E !== -1).sort((E, P) => E[1] - P[1]).map(([E]) => E))
|
|
3226
|
+
);
|
|
3227
|
+
let m = W(
|
|
3228
|
+
e.defaultParams ?? {},
|
|
3229
|
+
r ?? {}
|
|
3230
|
+
);
|
|
3231
|
+
const d = new D(
|
|
3219
3232
|
r ?? {}
|
|
3220
|
-
),
|
|
3221
|
-
|
|
3233
|
+
), b = new oe(), T = new R((h) => {
|
|
3234
|
+
d.subscribe((p) => {
|
|
3222
3235
|
try {
|
|
3223
|
-
const { status:
|
|
3224
|
-
if (
|
|
3225
|
-
throw new Error(
|
|
3226
|
-
columnName:
|
|
3227
|
-
expectToBe:
|
|
3236
|
+
const { status: E, columnName: P, expectToBe: I } = e.validator(p);
|
|
3237
|
+
if (E === "error")
|
|
3238
|
+
throw new Error(H({
|
|
3239
|
+
columnName: P,
|
|
3240
|
+
expectToBe: I,
|
|
3228
3241
|
from: `${e.name}.params$`
|
|
3229
3242
|
}));
|
|
3230
|
-
|
|
3231
|
-
columnName:
|
|
3232
|
-
expectToBe:
|
|
3243
|
+
E === "warning" && console.warn(Q({
|
|
3244
|
+
columnName: P,
|
|
3245
|
+
expectToBe: I,
|
|
3233
3246
|
from: `${e.name}.params$`
|
|
3234
3247
|
}));
|
|
3235
|
-
} catch (
|
|
3236
|
-
console.error(z(
|
|
3248
|
+
} catch (E) {
|
|
3249
|
+
console.error(z(E));
|
|
3237
3250
|
}
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
p.next(_);
|
|
3251
|
+
h.next(m);
|
|
3252
|
+
}), b.subscribe((p) => {
|
|
3253
|
+
h.next(p);
|
|
3242
3254
|
});
|
|
3243
|
-
}),
|
|
3244
|
-
q((
|
|
3245
|
-
context:
|
|
3255
|
+
}), O = u.pipe(
|
|
3256
|
+
q((h) => ({
|
|
3257
|
+
context: h,
|
|
3246
3258
|
// 初始化時 context 有可能被 in place 擴展
|
|
3247
|
-
pluginParams$:
|
|
3259
|
+
pluginParams$: T
|
|
3248
3260
|
})),
|
|
3249
3261
|
gr()
|
|
3250
3262
|
// 只做初始化
|
|
3251
3263
|
);
|
|
3252
|
-
return
|
|
3253
|
-
pluginSetupProps:
|
|
3254
|
-
ShownLayerNameSet:
|
|
3255
|
-
shownLayerNamesSeq:
|
|
3264
|
+
return J({
|
|
3265
|
+
pluginSetupProps: O,
|
|
3266
|
+
ShownLayerNameSet: y,
|
|
3267
|
+
shownLayerNamesSeq: A
|
|
3256
3268
|
}).pipe(
|
|
3257
3269
|
G(0)
|
|
3258
|
-
).subscribe(({ pluginSetupProps:
|
|
3259
|
-
const
|
|
3270
|
+
).subscribe(({ pluginSetupProps: h, ShownLayerNameSet: p, shownLayerNamesSeq: E }) => {
|
|
3271
|
+
const P = h.context._updateLayerElements(
|
|
3260
3272
|
t,
|
|
3261
3273
|
n,
|
|
3262
|
-
|
|
3274
|
+
E.map((I) => ({
|
|
3263
3275
|
pluginId: n,
|
|
3264
3276
|
pluginName: e.name,
|
|
3265
|
-
layerName:
|
|
3266
|
-
layerIndex:
|
|
3277
|
+
layerName: I,
|
|
3278
|
+
layerIndex: l[I]._layerIndex
|
|
3267
3279
|
}))
|
|
3268
3280
|
);
|
|
3269
|
-
e.setup && (o = e.setup(
|
|
3270
|
-
var
|
|
3271
|
-
if (
|
|
3272
|
-
const
|
|
3281
|
+
e.setup && (o = e.setup(h)), a.forEach((I) => {
|
|
3282
|
+
var c, v;
|
|
3283
|
+
if (p.has(I._name)) {
|
|
3284
|
+
const $ = t === "svg" ? {
|
|
3273
3285
|
// svgG: (pluginSetupProps as PluginSetupProps<'svg', ExtendContext, PluginParams>).svgG.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3274
|
-
svgG:
|
|
3286
|
+
svgG: P[I._name],
|
|
3275
3287
|
// canvas: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3276
3288
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3277
|
-
context:
|
|
3278
|
-
pluginParams$:
|
|
3279
|
-
initLayerParams: ((
|
|
3289
|
+
context: h.context,
|
|
3290
|
+
pluginParams$: T,
|
|
3291
|
+
initLayerParams: ((c = d.getValue()) == null ? void 0 : c[I._name]) || {}
|
|
3280
3292
|
} : {
|
|
3281
3293
|
// svgG: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3282
3294
|
// canvas: (pluginSetupProps as PluginSetupProps<'canvas', ExtendContext, PluginParams>).canvas.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3283
|
-
canvas:
|
|
3295
|
+
canvas: P[I._name],
|
|
3284
3296
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3285
|
-
context:
|
|
3286
|
-
pluginParams$:
|
|
3287
|
-
initLayerParams: ((
|
|
3297
|
+
context: h.context,
|
|
3298
|
+
pluginParams$: T,
|
|
3299
|
+
initLayerParams: ((v = d.getValue()) == null ? void 0 : v[I._name]) || {}
|
|
3288
3300
|
};
|
|
3289
|
-
|
|
3301
|
+
I._enable($);
|
|
3290
3302
|
} else
|
|
3291
|
-
|
|
3303
|
+
I._disable();
|
|
3292
3304
|
});
|
|
3293
3305
|
}), {
|
|
3294
3306
|
// name: `${config.name}-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -3302,51 +3314,56 @@ const mt = (t, e, r) => {
|
|
|
3302
3314
|
// contextExtension,
|
|
3303
3315
|
// layer visibility controls
|
|
3304
3316
|
_getId: () => n,
|
|
3305
|
-
_setId: (
|
|
3306
|
-
n =
|
|
3317
|
+
_setId: (h) => {
|
|
3318
|
+
n = h;
|
|
3307
3319
|
},
|
|
3308
3320
|
// 由 chart 注入 context
|
|
3309
|
-
_injectContext: (
|
|
3310
|
-
s.next(Object.assign({},
|
|
3321
|
+
_injectContext: (h) => {
|
|
3322
|
+
s.next(Object.assign({}, h));
|
|
3311
3323
|
},
|
|
3312
|
-
show: (
|
|
3313
|
-
|
|
3324
|
+
show: (h) => {
|
|
3325
|
+
h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...Array.from(y.getValue()), ...h]));
|
|
3314
3326
|
},
|
|
3315
|
-
showOnly: (
|
|
3316
|
-
|
|
3327
|
+
showOnly: (h) => {
|
|
3328
|
+
h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...h]));
|
|
3317
3329
|
},
|
|
3318
3330
|
showAll: () => {
|
|
3319
|
-
|
|
3331
|
+
y.next(i());
|
|
3320
3332
|
},
|
|
3321
|
-
hide: (
|
|
3322
|
-
|
|
3333
|
+
hide: (h) => {
|
|
3334
|
+
h = Array.isArray(h) ? h : [h], y.next(/* @__PURE__ */ new Set([...Array.from(y.getValue()).filter((p) => !h.includes(p))]));
|
|
3323
3335
|
},
|
|
3324
3336
|
hideAll: () => {
|
|
3325
|
-
|
|
3337
|
+
y.next(/* @__PURE__ */ new Set());
|
|
3326
3338
|
},
|
|
3327
|
-
toggle: (
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
}),
|
|
3339
|
+
toggle: (h) => {
|
|
3340
|
+
h = Array.isArray(h) ? h : [h], Array.from(y.getValue()).forEach((p) => {
|
|
3341
|
+
h.includes(p) ? h.splice(h.indexOf(p), 1) : h.push(p);
|
|
3342
|
+
}), y.next(new Set(h));
|
|
3331
3343
|
},
|
|
3332
|
-
getShownLayerNames: () => Array.from(
|
|
3344
|
+
getShownLayerNames: () => Array.from(y.getValue()),
|
|
3333
3345
|
// layer params
|
|
3334
3346
|
// setLayers: (partial: DeepPartial<PluginParams>) => {
|
|
3335
3347
|
// params = { ...params, ...partial }
|
|
3336
3348
|
// },
|
|
3337
|
-
updateParams: (
|
|
3338
|
-
|
|
3339
|
-
const
|
|
3340
|
-
|
|
3349
|
+
updateParams: (h) => {
|
|
3350
|
+
m = W(m, h), d.next(h), Object.keys(h).forEach((p) => {
|
|
3351
|
+
const E = l[p];
|
|
3352
|
+
E && E._updateParams(h[p]);
|
|
3341
3353
|
});
|
|
3342
3354
|
},
|
|
3343
|
-
forceReplaceParams: (
|
|
3344
|
-
|
|
3345
|
-
const
|
|
3346
|
-
|
|
3355
|
+
forceReplaceParams: (h) => {
|
|
3356
|
+
m = h, b.next(h), Object.keys(h).forEach((p) => {
|
|
3357
|
+
const E = l[p];
|
|
3358
|
+
E && E._forceReplaceParams(h[p]);
|
|
3347
3359
|
});
|
|
3348
3360
|
},
|
|
3349
|
-
getParams: () =>
|
|
3361
|
+
getParams: () => {
|
|
3362
|
+
const h = Object.assign({}, m);
|
|
3363
|
+
return a.forEach((p) => {
|
|
3364
|
+
h[p._name] = p._getParams();
|
|
3365
|
+
}), h;
|
|
3366
|
+
},
|
|
3350
3367
|
// layer: <LayerName extends keyof PluginParams>(name: LayerName) => ({
|
|
3351
3368
|
// // set: (partial: DeepPartial<PluginParams[LayerName]>) => {
|
|
3352
3369
|
// // if (params[name]) {
|
|
@@ -3372,8 +3389,8 @@ const mt = (t, e, r) => {
|
|
|
3372
3389
|
// }
|
|
3373
3390
|
// }),
|
|
3374
3391
|
destroy: () => {
|
|
3375
|
-
o(), s.complete(),
|
|
3376
|
-
|
|
3392
|
+
o(), s.complete(), y.complete(), a.forEach((h) => {
|
|
3393
|
+
h._destroy();
|
|
3377
3394
|
});
|
|
3378
3395
|
}
|
|
3379
3396
|
// // outputs
|
|
@@ -3392,7 +3409,7 @@ const mt = (t, e, r) => {
|
|
|
3392
3409
|
const o = new D(null), s = o.pipe(
|
|
3393
3410
|
ye((u) => u !== null)
|
|
3394
3411
|
);
|
|
3395
|
-
return
|
|
3412
|
+
return J({
|
|
3396
3413
|
layerParams: r,
|
|
3397
3414
|
enabledProps: s
|
|
3398
3415
|
}).pipe(
|
|
@@ -3405,7 +3422,7 @@ const mt = (t, e, r) => {
|
|
|
3405
3422
|
context: a.context,
|
|
3406
3423
|
pluginParams$: a.pluginParams$,
|
|
3407
3424
|
layerParams$: r.pipe(
|
|
3408
|
-
q((l) =>
|
|
3425
|
+
q((l) => W(l, a.initLayerParams ?? {}))
|
|
3409
3426
|
)
|
|
3410
3427
|
}) : e.setup({
|
|
3411
3428
|
// svgG: enabledProps.svgG,
|
|
@@ -3414,7 +3431,7 @@ const mt = (t, e, r) => {
|
|
|
3414
3431
|
context: a.context,
|
|
3415
3432
|
pluginParams$: a.pluginParams$,
|
|
3416
3433
|
layerParams$: r.pipe(
|
|
3417
|
-
q((l) =>
|
|
3434
|
+
q((l) => W(l, a.initLayerParams ?? {}))
|
|
3418
3435
|
)
|
|
3419
3436
|
});
|
|
3420
3437
|
}), o.pipe(ye((u) => u === null)).subscribe(() => {
|
|
@@ -3435,22 +3452,22 @@ const mt = (t, e, r) => {
|
|
|
3435
3452
|
// },
|
|
3436
3453
|
_updateParams: (u) => {
|
|
3437
3454
|
try {
|
|
3438
|
-
const { status: l, columnName: i, expectToBe:
|
|
3455
|
+
const { status: l, columnName: i, expectToBe: f } = e.validator(u);
|
|
3439
3456
|
if (l === "error")
|
|
3440
|
-
throw new Error(
|
|
3457
|
+
throw new Error(H({
|
|
3441
3458
|
columnName: i,
|
|
3442
|
-
expectToBe:
|
|
3459
|
+
expectToBe: f,
|
|
3443
3460
|
from: `${e.name}.params$`
|
|
3444
3461
|
}));
|
|
3445
|
-
l === "warning" && console.warn(
|
|
3462
|
+
l === "warning" && console.warn(Q({
|
|
3446
3463
|
columnName: i,
|
|
3447
|
-
expectToBe:
|
|
3464
|
+
expectToBe: f,
|
|
3448
3465
|
from: `${e.name}.params$`
|
|
3449
3466
|
}));
|
|
3450
3467
|
} catch (l) {
|
|
3451
3468
|
console.error(z(l));
|
|
3452
3469
|
}
|
|
3453
|
-
const a =
|
|
3470
|
+
const a = W(r.getValue(), u);
|
|
3454
3471
|
r.next(a);
|
|
3455
3472
|
},
|
|
3456
3473
|
_forceReplaceParams: (u) => {
|
|
@@ -3486,33 +3503,33 @@ export {
|
|
|
3486
3503
|
ft as createCanvas,
|
|
3487
3504
|
Zr as createCanvasElement,
|
|
3488
3505
|
Jr as createDiv,
|
|
3489
|
-
|
|
3506
|
+
Mr as createLayerClassName,
|
|
3490
3507
|
ht as createMessagePrefix,
|
|
3491
3508
|
z as createOrbChartsErrorMessage,
|
|
3492
|
-
|
|
3509
|
+
kr as createPluginClassName,
|
|
3493
3510
|
Cr as createSVG,
|
|
3494
3511
|
Br as createSVGGroup,
|
|
3495
3512
|
fe as createUnexpectedErrorMessage,
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3513
|
+
H as createValidatorErrorMessage,
|
|
3514
|
+
Q as createValidatorWarningMessage,
|
|
3515
|
+
W as deepOverwrite,
|
|
3499
3516
|
on as defineCanvasLayer,
|
|
3500
3517
|
rn as defineCanvasPlugin,
|
|
3501
3518
|
en as defineSVGLayer,
|
|
3502
3519
|
Qr as defineSVGPlugin,
|
|
3503
3520
|
Yr as formatCommaNumber,
|
|
3504
|
-
|
|
3521
|
+
F as getColorByFrom,
|
|
3505
3522
|
Or as getColorByIndex,
|
|
3506
3523
|
ct as isDom,
|
|
3507
3524
|
Ir as isFunction,
|
|
3508
|
-
|
|
3525
|
+
X as isPlainObject,
|
|
3509
3526
|
_r as max,
|
|
3510
3527
|
xr as mean,
|
|
3511
3528
|
Ar as median,
|
|
3512
3529
|
Sr as min,
|
|
3513
3530
|
Tr as none,
|
|
3514
3531
|
Pr as removeElementChildren,
|
|
3515
|
-
|
|
3532
|
+
jr as resizeObservable,
|
|
3516
3533
|
Er as sum,
|
|
3517
3534
|
V as validateObject
|
|
3518
3535
|
};
|