@orbcharts/core 4.0.0-alpha.0 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +200 -200
- package/dist/orbcharts-core.es.js +876 -865
- package/dist/orbcharts-core.umd.js +3 -3
- package/dist/src/types/Plugin.d.ts +1 -1
- package/package.json +1 -1
- package/src/OrbCharts.ts +34 -34
- package/src/chart/createChart.ts +1013 -996
- package/src/chart/createGraphData.ts +391 -391
- package/src/chart/createGridData.ts +247 -247
- package/src/chart/createMultivariateData.ts +181 -181
- package/src/chart/createSeriesData.ts +297 -297
- package/src/chart/createTreeData.ts +344 -344
- package/src/chart/defaults.ts +119 -119
- package/src/defineCanvasLayer.ts +23 -23
- package/src/defineCanvasPlugin.ts +38 -38
- package/src/defineSVGLayer.ts +23 -23
- package/src/defineSVGPlugin.ts +38 -38
- package/src/index.ts +8 -8
- package/src/layer/createLayer.ts +137 -137
- package/src/plugin/createPlugin.ts +487 -469
- package/src/test/createGraphData.test.ts +103 -103
- package/src/test/createTreeData.test.ts +97 -97
- package/src/test/simple-graph-test.js +51 -51
- package/src/test/simple-tree-test.js +58 -58
- package/src/types/Chart.ts +62 -62
- package/src/types/ChartContext.ts +41 -41
- package/src/types/Common.ts +4 -4
- package/src/types/Encoding.ts +42 -42
- package/src/types/Event.ts +25 -25
- package/src/types/Layers.ts +92 -92
- package/src/types/ModelData.ts +94 -94
- package/src/types/Plugin.ts +101 -98
- package/src/types/RawData.ts +67 -67
- package/src/types/RenderData.ts +15 -15
- package/src/types/Theme.ts +20 -20
- package/src/types/Validator.ts +35 -35
- package/src/types/index.ts +12 -12
- package/src/utils/aggregateUtils.ts +99 -99
- package/src/utils/colorUtils.ts +63 -63
- package/src/utils/commonUtils.ts +56 -56
- package/src/utils/dom-lifecycle.ts +164 -164
- package/src/utils/dom.ts +54 -54
- package/src/utils/errorMessage.ts +40 -40
- package/src/utils/index.ts +7 -7
- package/src/utils/observables.ts +16 -16
- package/src/utils/orbchartsUtils.ts +8 -8
- package/src/utils/validator.ts +127 -127
|
@@ -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(
|
|
26
|
+
i(n.next(f));
|
|
27
27
|
} catch (b) {
|
|
28
28
|
u(b);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function l(
|
|
31
|
+
function l(f) {
|
|
32
32
|
try {
|
|
33
|
-
i(n.throw(
|
|
33
|
+
i(n.throw(f));
|
|
34
34
|
} catch (b) {
|
|
35
35
|
u(b);
|
|
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(p) {
|
|
146
|
+
return function(A) {
|
|
147
|
+
return Promise.resolve(A).then(p, b);
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
function a(
|
|
151
|
-
n[
|
|
152
|
-
return new Promise(function(
|
|
153
|
-
s.push([
|
|
150
|
+
function a(p, A) {
|
|
151
|
+
n[p] && (o[p] = function(m) {
|
|
152
|
+
return new Promise(function(h, w) {
|
|
153
|
+
s.push([p, m, h, w]) > 1 || l(p, m);
|
|
154
154
|
});
|
|
155
|
-
},
|
|
155
|
+
}, A && (o[p] = A(o[p])));
|
|
156
156
|
}
|
|
157
|
-
function l(
|
|
157
|
+
function l(p, A) {
|
|
158
158
|
try {
|
|
159
|
-
i(n[
|
|
160
|
-
} catch (
|
|
161
|
-
|
|
159
|
+
i(n[p](A));
|
|
160
|
+
} catch (m) {
|
|
161
|
+
_(s[0][3], m);
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function i(
|
|
165
|
-
|
|
164
|
+
function i(p) {
|
|
165
|
+
p.value instanceof ie ? Promise.resolve(p.value.v).then(f, b) : _(s[0][2], p);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
l("next",
|
|
167
|
+
function f(p) {
|
|
168
|
+
l("next", p);
|
|
169
169
|
}
|
|
170
|
-
function b(
|
|
171
|
-
l("throw",
|
|
170
|
+
function b(p) {
|
|
171
|
+
l("throw", p);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
173
|
+
function _(p, A) {
|
|
174
|
+
p(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
254
|
var b = this._finalizers;
|
|
255
255
|
if (b) {
|
|
256
256
|
this._finalizers = null;
|
|
257
257
|
try {
|
|
258
|
-
for (var
|
|
259
|
-
var
|
|
258
|
+
for (var _ = ue(b), p = _.next(); !p.done; p = _.next()) {
|
|
259
|
+
var A = p.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
|
+
p && !p.done && (o = _.return) && o.call(_);
|
|
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,7 +871,7 @@ 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
876
|
function X(t) {
|
|
877
877
|
if (t instanceof R)
|
|
@@ -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
|
});
|
|
@@ -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
|
}
|
|
@@ -1141,7 +1141,7 @@ function ur(t, e) {
|
|
|
1141
1141
|
return r[n] = e[o], r;
|
|
1142
1142
|
}, {});
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function Z() {
|
|
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 b = Be(t[
|
|
1161
|
-
b.subscribe(N(n, function(
|
|
1162
|
-
s[
|
|
1160
|
+
var b = Be(t[f], e), _ = !1;
|
|
1161
|
+
b.subscribe(N(n, function(p) {
|
|
1162
|
+
s[f] = p, _ || (_ = !0, a--), a || n.next(r(s.slice()));
|
|
1163
1163
|
}, function() {
|
|
1164
1164
|
--u || n.complete();
|
|
1165
1165
|
}));
|
|
@@ -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
|
|
1286
|
+
var f, b, _, p = 0, A = !1, m = !1, h = function() {
|
|
1287
1287
|
b == null || b.unsubscribe(), b = void 0;
|
|
1288
|
-
},
|
|
1289
|
-
|
|
1290
|
-
},
|
|
1291
|
-
var
|
|
1292
|
-
|
|
1288
|
+
}, w = function() {
|
|
1289
|
+
h(), f = _ = void 0, A = m = !1;
|
|
1290
|
+
}, C = function() {
|
|
1291
|
+
var O = f;
|
|
1292
|
+
w(), 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, y) {
|
|
1295
|
+
p++, !m && !A && h();
|
|
1296
|
+
var g = _ = _ ?? r();
|
|
1297
|
+
y.add(function() {
|
|
1298
|
+
p--, p === 0 && !m && !A && (b = Ae(C, l));
|
|
1299
|
+
}), g.subscribe(y), !f && p > 0 && (f = new he({
|
|
1300
|
+
next: function(E) {
|
|
1301
|
+
return g.next(E);
|
|
1302
1302
|
},
|
|
1303
|
-
error: function(
|
|
1304
|
-
|
|
1303
|
+
error: function(E) {
|
|
1304
|
+
m = !0, h(), b = Ae(w, o, E), g.error(E);
|
|
1305
1305
|
},
|
|
1306
1306
|
complete: function() {
|
|
1307
|
-
|
|
1307
|
+
A = !0, h(), b = Ae(w, u), g.complete();
|
|
1308
1308
|
}
|
|
1309
|
-
}), X(
|
|
1309
|
+
}), X(O).subscribe(f));
|
|
1310
1310
|
})(i);
|
|
1311
1311
|
};
|
|
1312
1312
|
}
|
|
@@ -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
|
-
X(t(l,
|
|
1349
|
-
return n.next(e ? e(l, b,
|
|
1347
|
+
var i = 0, f = s++;
|
|
1348
|
+
X(t(l, f)).subscribe(o = N(n, function(b) {
|
|
1349
|
+
return n.next(e ? e(l, b, f, i++) : b);
|
|
1350
1350
|
}, function() {
|
|
1351
1351
|
o = null, a();
|
|
1352
1352
|
}));
|
|
@@ -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":
|
|
@@ -1446,7 +1446,7 @@ function Ir(t) {
|
|
|
1446
1446
|
function ct(t) {
|
|
1447
1447
|
return !!(t && t.nodeType);
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1449
|
+
function W(t, e) {
|
|
1450
1450
|
if (Q(e) === !1 || Q(t) === !1)
|
|
1451
1451
|
return Object.assign({}, t);
|
|
1452
1452
|
const r = (n, o) => {
|
|
@@ -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 J({ 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 H({ 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,11 +1525,11 @@ 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 = {
|
|
@@ -1551,7 +1551,7 @@ function Lr(t, e) {
|
|
|
1551
1551
|
if (e[s]) {
|
|
1552
1552
|
const u = e[s], a = t[s];
|
|
1553
1553
|
if (u.toBeTypes) {
|
|
1554
|
-
if (u.toBeTypes.some((
|
|
1554
|
+
if (u.toBeTypes.some((f) => r[f](a)) === !1)
|
|
1555
1555
|
return !0;
|
|
1556
1556
|
} else if (u.toBe) {
|
|
1557
1557
|
const { toBe: l, test: i } = u;
|
|
@@ -1720,8 +1720,8 @@ const Ke = {
|
|
|
1720
1720
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
1721
1721
|
o ? t.forEach((a, l) => {
|
|
1722
1722
|
a.forEach((i) => {
|
|
1723
|
-
const
|
|
1724
|
-
n.has(
|
|
1723
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
1724
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
1725
1725
|
});
|
|
1726
1726
|
}) : t.forEach((a) => {
|
|
1727
1727
|
const l = a[e.dataset.from] || "default";
|
|
@@ -1733,8 +1733,8 @@ const Ke = {
|
|
|
1733
1733
|
else if (e.dataset.sort === "original") {
|
|
1734
1734
|
const a = [];
|
|
1735
1735
|
o ? t.forEach((l, i) => {
|
|
1736
|
-
l.forEach((
|
|
1737
|
-
const b =
|
|
1736
|
+
l.forEach((f) => {
|
|
1737
|
+
const b = f[e.dataset.from] || `dataset-${i}`;
|
|
1738
1738
|
a.includes(b) || a.push(b);
|
|
1739
1739
|
});
|
|
1740
1740
|
}) : t.forEach((l) => {
|
|
@@ -1744,139 +1744,139 @@ const Ke = {
|
|
|
1744
1744
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
1745
1745
|
const u = [];
|
|
1746
1746
|
return s.forEach((a, l) => {
|
|
1747
|
-
const i = n.get(a),
|
|
1748
|
-
i.forEach((
|
|
1749
|
-
const
|
|
1750
|
-
|
|
1747
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1748
|
+
i.forEach((m) => {
|
|
1749
|
+
const h = m[e.series.from] || "default";
|
|
1750
|
+
f.has(h) || f.set(h, []), f.get(h).push(m);
|
|
1751
1751
|
});
|
|
1752
|
-
let b = Array.from(
|
|
1752
|
+
let b = Array.from(f.keys());
|
|
1753
1753
|
if (Array.isArray(e.series.sort))
|
|
1754
|
-
b = e.series.sort.filter((
|
|
1754
|
+
b = e.series.sort.filter((m) => f.has(m)).concat(b.filter((m) => !e.series.sort.includes(m)));
|
|
1755
1755
|
else if (e.series.sort === "original") {
|
|
1756
|
-
const
|
|
1757
|
-
i.forEach((
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
}), b =
|
|
1761
|
-
} else e.series.sort === "alphabetical" && b.sort((
|
|
1762
|
-
const
|
|
1756
|
+
const m = [];
|
|
1757
|
+
i.forEach((h) => {
|
|
1758
|
+
const w = h[e.series.from] || "default";
|
|
1759
|
+
m.includes(w) || m.push(w);
|
|
1760
|
+
}), b = m;
|
|
1761
|
+
} else e.series.sort === "alphabetical" && b.sort((m, h) => m.localeCompare(h, void 0, { numeric: !0 }));
|
|
1762
|
+
const _ = [];
|
|
1763
1763
|
if (e.category.sort === "original")
|
|
1764
|
-
i.forEach((
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1764
|
+
i.forEach((m) => {
|
|
1765
|
+
const h = m[e.category.from] || "default";
|
|
1766
|
+
_.includes(h) || _.push(h);
|
|
1767
1767
|
});
|
|
1768
1768
|
else if (e.category.sort === "alphabetical") {
|
|
1769
|
-
const
|
|
1770
|
-
i.forEach((
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1769
|
+
const m = /* @__PURE__ */ new Set();
|
|
1770
|
+
i.forEach((h) => {
|
|
1771
|
+
m.add(h[e.category.from] || "default");
|
|
1772
|
+
}), _.push(...Array.from(m).sort((h, w) => h.localeCompare(w, void 0, { numeric: !0 })));
|
|
1773
1773
|
} else if (Array.isArray(e.category.sort)) {
|
|
1774
|
-
const
|
|
1775
|
-
i.forEach((
|
|
1776
|
-
const
|
|
1777
|
-
|
|
1774
|
+
const m = [];
|
|
1775
|
+
i.forEach((w) => {
|
|
1776
|
+
const C = w[e.category.from] || "default";
|
|
1777
|
+
m.includes(C) || m.push(C);
|
|
1778
1778
|
});
|
|
1779
|
-
const
|
|
1780
|
-
|
|
1781
|
-
...
|
|
1782
|
-
...
|
|
1779
|
+
const h = e.category.sort;
|
|
1780
|
+
_.push(
|
|
1781
|
+
...h.filter((w) => m.includes(w)),
|
|
1782
|
+
...m.filter((w) => !h.includes(w))
|
|
1783
1783
|
);
|
|
1784
1784
|
}
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1787
|
-
|
|
1785
|
+
const p = /* @__PURE__ */ new Map();
|
|
1786
|
+
_.forEach((m, h) => {
|
|
1787
|
+
p.set(m, h);
|
|
1788
1788
|
});
|
|
1789
|
-
const
|
|
1790
|
-
b.forEach((
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1789
|
+
const A = [];
|
|
1790
|
+
b.forEach((m, h) => {
|
|
1791
|
+
const w = f.get(m), C = /* @__PURE__ */ new Map();
|
|
1792
|
+
w.forEach((g) => {
|
|
1793
|
+
const E = g[e.category.from] || "default";
|
|
1794
|
+
C.has(E) || C.set(E, []), C.get(E).push(g);
|
|
1795
1795
|
});
|
|
1796
|
-
const
|
|
1797
|
-
e.category.sort === "original" && e.value.aggregate === "none" ? (
|
|
1798
|
-
const B =
|
|
1799
|
-
|
|
1800
|
-
id:
|
|
1796
|
+
const O = _.filter((g) => C.has(g)), y = [];
|
|
1797
|
+
e.category.sort === "original" && e.value.aggregate === "none" ? (w.forEach((g, E) => {
|
|
1798
|
+
const B = g[e.category.from] || "default", I = p.get(B), c = g[e.value.from];
|
|
1799
|
+
y.push({
|
|
1800
|
+
id: g.id || `${a}-${m}-${B}-${E}`,
|
|
1801
1801
|
index: I,
|
|
1802
1802
|
// Series 模式下 index 對應 categoryIndex
|
|
1803
1803
|
modelType: "series",
|
|
1804
|
-
name:
|
|
1805
|
-
data:
|
|
1804
|
+
name: g.name || "",
|
|
1805
|
+
data: g.data,
|
|
1806
1806
|
value: typeof c == "number" ? c : null,
|
|
1807
|
-
color:
|
|
1807
|
+
color: F(e.color.from, {
|
|
1808
1808
|
index: I,
|
|
1809
|
-
seriesIndex:
|
|
1809
|
+
seriesIndex: h,
|
|
1810
1810
|
categoryIndex: I,
|
|
1811
1811
|
datasetIndex: l
|
|
1812
1812
|
}, r),
|
|
1813
|
-
series:
|
|
1814
|
-
seriesIndex:
|
|
1813
|
+
series: m,
|
|
1814
|
+
seriesIndex: h,
|
|
1815
1815
|
category: B,
|
|
1816
1816
|
categoryIndex: I
|
|
1817
1817
|
});
|
|
1818
|
-
}), e.value.sort === "asc" ?
|
|
1819
|
-
const
|
|
1818
|
+
}), e.value.sort === "asc" ? y.sort((g, E) => g.value === null && E.value === null ? 0 : g.value === null ? 1 : E.value === null ? -1 : g.value - E.value) : e.value.sort === "desc" && y.sort((g, E) => g.value === null && E.value === null ? 0 : g.value === null ? 1 : E.value === null ? -1 : E.value - g.value)) : O.forEach((g) => {
|
|
1819
|
+
const E = p.get(g), B = C.get(g);
|
|
1820
1820
|
if (e.value.aggregate === "none") {
|
|
1821
|
-
let I = B.map((c,
|
|
1822
|
-
const
|
|
1821
|
+
let I = B.map((c, v) => {
|
|
1822
|
+
const $ = c[e.value.from];
|
|
1823
1823
|
return {
|
|
1824
|
-
id: c.id || `${a}-${
|
|
1825
|
-
index:
|
|
1824
|
+
id: c.id || `${a}-${m}-${g}-${v}`,
|
|
1825
|
+
index: E,
|
|
1826
1826
|
// Series 模式下 index 對應 categoryIndex
|
|
1827
1827
|
modelType: "series",
|
|
1828
1828
|
name: c.name || "",
|
|
1829
1829
|
data: c.data,
|
|
1830
|
-
value: typeof
|
|
1831
|
-
color:
|
|
1832
|
-
index:
|
|
1833
|
-
seriesIndex:
|
|
1834
|
-
categoryIndex:
|
|
1830
|
+
value: typeof $ == "number" ? $ : null,
|
|
1831
|
+
color: F(e.color.from, {
|
|
1832
|
+
index: E,
|
|
1833
|
+
seriesIndex: h,
|
|
1834
|
+
categoryIndex: E,
|
|
1835
1835
|
datasetIndex: l
|
|
1836
1836
|
}, r),
|
|
1837
|
-
series:
|
|
1838
|
-
seriesIndex:
|
|
1839
|
-
category:
|
|
1840
|
-
categoryIndex:
|
|
1837
|
+
series: m,
|
|
1838
|
+
seriesIndex: h,
|
|
1839
|
+
category: g,
|
|
1840
|
+
categoryIndex: E
|
|
1841
1841
|
};
|
|
1842
1842
|
});
|
|
1843
|
-
e.value.sort === "asc" ? I.sort((c,
|
|
1843
|
+
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), y.push(...I);
|
|
1844
1844
|
} else {
|
|
1845
|
-
const I = B.map((
|
|
1845
|
+
const I = B.map((d) => {
|
|
1846
1846
|
if (e.value.aggregate === "count")
|
|
1847
1847
|
return 1;
|
|
1848
|
-
const
|
|
1849
|
-
return typeof
|
|
1850
|
-
}), c = pe(I, e.value.aggregate),
|
|
1851
|
-
id:
|
|
1852
|
-
index:
|
|
1848
|
+
const x = d[e.value.from];
|
|
1849
|
+
return typeof x == "number" ? x : null;
|
|
1850
|
+
}), c = pe(I, e.value.aggregate), v = B[0], $ = {
|
|
1851
|
+
id: v.id || `${a}-${m}-${g}-aggregated`,
|
|
1852
|
+
index: E,
|
|
1853
1853
|
// Series 模式下 index 對應 categoryIndex
|
|
1854
1854
|
modelType: "series",
|
|
1855
|
-
name:
|
|
1856
|
-
data:
|
|
1855
|
+
name: v.name || g,
|
|
1856
|
+
data: v.data,
|
|
1857
1857
|
value: c,
|
|
1858
|
-
color:
|
|
1859
|
-
index:
|
|
1860
|
-
seriesIndex:
|
|
1861
|
-
categoryIndex:
|
|
1858
|
+
color: F(e.color.from, {
|
|
1859
|
+
index: E,
|
|
1860
|
+
seriesIndex: h,
|
|
1861
|
+
categoryIndex: E,
|
|
1862
1862
|
datasetIndex: l
|
|
1863
1863
|
}, r),
|
|
1864
|
-
series:
|
|
1865
|
-
seriesIndex:
|
|
1866
|
-
category:
|
|
1867
|
-
categoryIndex:
|
|
1864
|
+
series: m,
|
|
1865
|
+
seriesIndex: h,
|
|
1866
|
+
category: g,
|
|
1867
|
+
categoryIndex: E
|
|
1868
1868
|
};
|
|
1869
|
-
|
|
1869
|
+
y.push($);
|
|
1870
1870
|
}
|
|
1871
|
-
}),
|
|
1872
|
-
}), u.push(
|
|
1871
|
+
}), A.push(y);
|
|
1872
|
+
}), u.push(A);
|
|
1873
1873
|
}), u;
|
|
1874
1874
|
}, Rr = (t, e, r) => {
|
|
1875
1875
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
1876
1876
|
o ? t.forEach((a, l) => {
|
|
1877
1877
|
a.forEach((i) => {
|
|
1878
|
-
const
|
|
1879
|
-
n.has(
|
|
1878
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
1879
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
1880
1880
|
});
|
|
1881
1881
|
}) : t.forEach((a) => {
|
|
1882
1882
|
const l = a[e.dataset.from] || "default";
|
|
@@ -1888,8 +1888,8 @@ const Ke = {
|
|
|
1888
1888
|
else if (e.dataset.sort === "original") {
|
|
1889
1889
|
const a = [];
|
|
1890
1890
|
o ? t.forEach((l, i) => {
|
|
1891
|
-
l.forEach((
|
|
1892
|
-
const b =
|
|
1891
|
+
l.forEach((f) => {
|
|
1892
|
+
const b = f[e.dataset.from] || `dataset-${i}`;
|
|
1893
1893
|
a.includes(b) || a.push(b);
|
|
1894
1894
|
});
|
|
1895
1895
|
}) : t.forEach((l) => {
|
|
@@ -1899,118 +1899,118 @@ const Ke = {
|
|
|
1899
1899
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
1900
1900
|
const u = [];
|
|
1901
1901
|
return s.forEach((a, l) => {
|
|
1902
|
-
const i = n.get(a),
|
|
1903
|
-
i.forEach((
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1902
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
1903
|
+
i.forEach((h) => {
|
|
1904
|
+
const w = h[e.series.from] || "default";
|
|
1905
|
+
f.has(w) || f.set(w, []), f.get(w).push(h);
|
|
1906
1906
|
});
|
|
1907
|
-
let b = Array.from(
|
|
1907
|
+
let b = Array.from(f.keys());
|
|
1908
1908
|
if (Array.isArray(e.series.sort))
|
|
1909
|
-
b = e.series.sort.filter((
|
|
1909
|
+
b = e.series.sort.filter((h) => f.has(h)).concat(b.filter((h) => !e.series.sort.includes(h)));
|
|
1910
1910
|
else if (e.series.sort === "original") {
|
|
1911
|
-
const
|
|
1912
|
-
i.forEach((
|
|
1913
|
-
const
|
|
1914
|
-
|
|
1915
|
-
}), b =
|
|
1916
|
-
} else e.series.sort === "alphabetical" && b.sort((
|
|
1917
|
-
const
|
|
1918
|
-
i.forEach((
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1911
|
+
const h = [];
|
|
1912
|
+
i.forEach((w) => {
|
|
1913
|
+
const C = w[e.series.from] || "default";
|
|
1914
|
+
h.includes(C) || h.push(C);
|
|
1915
|
+
}), b = h;
|
|
1916
|
+
} else e.series.sort === "alphabetical" && b.sort((h, w) => h.localeCompare(w, void 0, { numeric: !0 }));
|
|
1917
|
+
const _ = [];
|
|
1918
|
+
i.forEach((h) => {
|
|
1919
|
+
const w = h[e.category.from] || "default";
|
|
1920
|
+
_.includes(w) || _.push(w);
|
|
1921
1921
|
});
|
|
1922
|
-
const
|
|
1923
|
-
let
|
|
1924
|
-
Array.isArray(e.category.sort) ?
|
|
1925
|
-
const
|
|
1926
|
-
b.forEach((
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1929
|
-
const
|
|
1930
|
-
|
|
1922
|
+
const p = new Set(_);
|
|
1923
|
+
let A = Array.from(p);
|
|
1924
|
+
Array.isArray(e.category.sort) ? A = e.category.sort.filter((h) => p.has(h)).concat(A.filter((h) => !e.category.sort.includes(h))) : e.category.sort === "original" ? A = _ : e.category.sort === "alphabetical" && A.sort((h, w) => h.localeCompare(w, void 0, { numeric: !0 }));
|
|
1925
|
+
const m = [];
|
|
1926
|
+
b.forEach((h, w) => {
|
|
1927
|
+
const C = f.get(h), O = /* @__PURE__ */ new Map();
|
|
1928
|
+
C.forEach((g) => {
|
|
1929
|
+
const E = g[e.category.from] || "default";
|
|
1930
|
+
O.has(E) || O.set(E, []), O.get(E).push(g);
|
|
1931
1931
|
});
|
|
1932
|
-
const
|
|
1933
|
-
|
|
1934
|
-
const B =
|
|
1932
|
+
const y = [];
|
|
1933
|
+
A.forEach((g, E) => {
|
|
1934
|
+
const B = O.get(g);
|
|
1935
1935
|
if (!B)
|
|
1936
|
-
|
|
1937
|
-
id: `${a}-${
|
|
1938
|
-
index:
|
|
1936
|
+
y.push({
|
|
1937
|
+
id: `${a}-${h}-${g}-null`,
|
|
1938
|
+
index: E,
|
|
1939
1939
|
modelType: "grid",
|
|
1940
|
-
name:
|
|
1940
|
+
name: g,
|
|
1941
1941
|
data: void 0,
|
|
1942
1942
|
value: null,
|
|
1943
|
-
color:
|
|
1944
|
-
index:
|
|
1945
|
-
seriesIndex:
|
|
1946
|
-
categoryIndex:
|
|
1943
|
+
color: F(e.color.from, {
|
|
1944
|
+
index: E,
|
|
1945
|
+
seriesIndex: w,
|
|
1946
|
+
categoryIndex: E,
|
|
1947
1947
|
datasetIndex: l
|
|
1948
1948
|
}, r),
|
|
1949
|
-
series:
|
|
1950
|
-
seriesIndex:
|
|
1951
|
-
category:
|
|
1952
|
-
categoryIndex:
|
|
1949
|
+
series: h,
|
|
1950
|
+
seriesIndex: w,
|
|
1951
|
+
category: g,
|
|
1952
|
+
categoryIndex: E
|
|
1953
1953
|
});
|
|
1954
1954
|
else if (e.value.aggregate === "none") {
|
|
1955
|
-
let I = B.map((c,
|
|
1956
|
-
const
|
|
1955
|
+
let I = B.map((c, v) => {
|
|
1956
|
+
const $ = c[e.value.from];
|
|
1957
1957
|
return {
|
|
1958
|
-
id: c.id || `${a}-${
|
|
1959
|
-
index:
|
|
1958
|
+
id: c.id || `${a}-${h}-${g}-${v}`,
|
|
1959
|
+
index: E,
|
|
1960
1960
|
// Grid 模式下 index 對應 categoryIndex
|
|
1961
1961
|
modelType: "grid",
|
|
1962
1962
|
name: c.name || "",
|
|
1963
1963
|
data: c.data,
|
|
1964
|
-
value: typeof
|
|
1965
|
-
color:
|
|
1966
|
-
index:
|
|
1967
|
-
seriesIndex:
|
|
1968
|
-
categoryIndex:
|
|
1964
|
+
value: typeof $ == "number" ? $ : null,
|
|
1965
|
+
color: F(e.color.from, {
|
|
1966
|
+
index: E,
|
|
1967
|
+
seriesIndex: w,
|
|
1968
|
+
categoryIndex: E,
|
|
1969
1969
|
datasetIndex: l
|
|
1970
1970
|
}, r),
|
|
1971
|
-
series:
|
|
1972
|
-
seriesIndex:
|
|
1973
|
-
category:
|
|
1974
|
-
categoryIndex:
|
|
1971
|
+
series: h,
|
|
1972
|
+
seriesIndex: w,
|
|
1973
|
+
category: g,
|
|
1974
|
+
categoryIndex: E
|
|
1975
1975
|
};
|
|
1976
1976
|
});
|
|
1977
|
-
e.value.sort === "asc" ? I.sort((c,
|
|
1977
|
+
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), y.push(...I);
|
|
1978
1978
|
} else {
|
|
1979
|
-
const I = B.map((
|
|
1979
|
+
const I = B.map((d) => {
|
|
1980
1980
|
if (e.value.aggregate === "count")
|
|
1981
1981
|
return 1;
|
|
1982
|
-
const
|
|
1983
|
-
return typeof
|
|
1984
|
-
}), c = pe(I, e.value.aggregate),
|
|
1985
|
-
id:
|
|
1986
|
-
index:
|
|
1982
|
+
const x = d[e.value.from];
|
|
1983
|
+
return typeof x == "number" ? x : null;
|
|
1984
|
+
}), c = pe(I, e.value.aggregate), v = B[0], $ = {
|
|
1985
|
+
id: v.id || `${a}-${h}-${g}-aggregated`,
|
|
1986
|
+
index: E,
|
|
1987
1987
|
// Grid 模式下 index 對應 categoryIndex
|
|
1988
1988
|
modelType: "grid",
|
|
1989
|
-
name:
|
|
1990
|
-
data:
|
|
1989
|
+
name: v.name || g,
|
|
1990
|
+
data: v.data,
|
|
1991
1991
|
value: c,
|
|
1992
|
-
color:
|
|
1993
|
-
index:
|
|
1994
|
-
seriesIndex:
|
|
1995
|
-
categoryIndex:
|
|
1992
|
+
color: F(e.color.from, {
|
|
1993
|
+
index: E,
|
|
1994
|
+
seriesIndex: w,
|
|
1995
|
+
categoryIndex: E,
|
|
1996
1996
|
datasetIndex: l
|
|
1997
1997
|
}, r),
|
|
1998
|
-
series:
|
|
1999
|
-
seriesIndex:
|
|
2000
|
-
category:
|
|
2001
|
-
categoryIndex:
|
|
1998
|
+
series: h,
|
|
1999
|
+
seriesIndex: w,
|
|
2000
|
+
category: g,
|
|
2001
|
+
categoryIndex: E
|
|
2002
2002
|
};
|
|
2003
|
-
|
|
2003
|
+
y.push($);
|
|
2004
2004
|
}
|
|
2005
|
-
}),
|
|
2006
|
-
}), u.push(
|
|
2005
|
+
}), m.push(y);
|
|
2006
|
+
}), u.push(m);
|
|
2007
2007
|
}), u;
|
|
2008
2008
|
}, Kr = (t, e, r) => {
|
|
2009
2009
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
2010
2010
|
o ? t.forEach((a, l) => {
|
|
2011
2011
|
a.forEach((i) => {
|
|
2012
|
-
const
|
|
2013
|
-
n.has(
|
|
2012
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
2013
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
2014
2014
|
});
|
|
2015
2015
|
}) : t.forEach((a) => {
|
|
2016
2016
|
const l = a[e.dataset.from] || "default";
|
|
@@ -2022,8 +2022,8 @@ const Ke = {
|
|
|
2022
2022
|
else if (e.dataset.sort === "original") {
|
|
2023
2023
|
const a = [];
|
|
2024
2024
|
o ? t.forEach((l, i) => {
|
|
2025
|
-
l.forEach((
|
|
2026
|
-
const b =
|
|
2025
|
+
l.forEach((f) => {
|
|
2026
|
+
const b = f[e.dataset.from] || `dataset-${i}`;
|
|
2027
2027
|
a.includes(b) || a.push(b);
|
|
2028
2028
|
});
|
|
2029
2029
|
}) : t.forEach((l) => {
|
|
@@ -2033,280 +2033,280 @@ const Ke = {
|
|
|
2033
2033
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
2034
2034
|
const u = [];
|
|
2035
2035
|
return s.forEach((a, l) => {
|
|
2036
|
-
const i = n.get(a),
|
|
2037
|
-
i.forEach((
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2036
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2037
|
+
i.forEach((p) => {
|
|
2038
|
+
const A = p[e.series.from] || "default";
|
|
2039
|
+
f.has(A) || f.set(A, []), f.get(A).push(p);
|
|
2040
2040
|
});
|
|
2041
|
-
let b = Array.from(
|
|
2041
|
+
let b = Array.from(f.keys());
|
|
2042
2042
|
if (Array.isArray(e.series.sort))
|
|
2043
|
-
b = e.series.sort.filter((
|
|
2043
|
+
b = e.series.sort.filter((p) => f.has(p)).concat(b.filter((p) => !e.series.sort.includes(p)));
|
|
2044
2044
|
else if (e.series.sort === "original") {
|
|
2045
|
-
const
|
|
2046
|
-
i.forEach((
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2049
|
-
}), b =
|
|
2050
|
-
} else e.series.sort === "alphabetical" && b.sort((
|
|
2051
|
-
const
|
|
2052
|
-
b.forEach((
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2045
|
+
const p = [];
|
|
2046
|
+
i.forEach((A) => {
|
|
2047
|
+
const m = A[e.series.from] || "default";
|
|
2048
|
+
p.includes(m) || p.push(m);
|
|
2049
|
+
}), b = p;
|
|
2050
|
+
} else e.series.sort === "alphabetical" && b.sort((p, A) => p.localeCompare(A, void 0, { numeric: !0 }));
|
|
2051
|
+
const _ = [];
|
|
2052
|
+
b.forEach((p, A) => {
|
|
2053
|
+
const m = f.get(p), h = /* @__PURE__ */ new Map();
|
|
2054
|
+
m.forEach((O) => {
|
|
2055
|
+
const y = O[e.category.from] || "default";
|
|
2056
|
+
h.has(y) || h.set(y, []), h.get(y).push(O);
|
|
2057
2057
|
});
|
|
2058
|
-
let
|
|
2058
|
+
let w = Array.from(h.keys());
|
|
2059
2059
|
if (Array.isArray(e.category.sort))
|
|
2060
|
-
|
|
2060
|
+
w = e.category.sort.filter((O) => h.has(O)).concat(w.filter((O) => !e.category.sort.includes(O)));
|
|
2061
2061
|
else if (e.category.sort === "original") {
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2064
|
-
const
|
|
2065
|
-
|
|
2066
|
-
}),
|
|
2067
|
-
} else e.category.sort === "alphabetical" &&
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
const I = e.multivariate.map((
|
|
2072
|
-
index:
|
|
2073
|
-
name:
|
|
2062
|
+
const O = [];
|
|
2063
|
+
m.forEach((y) => {
|
|
2064
|
+
const g = y[e.category.from] || "default";
|
|
2065
|
+
O.includes(g) || O.push(g);
|
|
2066
|
+
}), w = O;
|
|
2067
|
+
} else e.category.sort === "alphabetical" && w.sort((O, y) => O.localeCompare(y, void 0, { numeric: !0 }));
|
|
2068
|
+
const C = [];
|
|
2069
|
+
w.forEach((O, y) => {
|
|
2070
|
+
h.get(O).forEach((E, B) => {
|
|
2071
|
+
const I = e.multivariate.map((v, $) => ({
|
|
2072
|
+
index: $,
|
|
2073
|
+
name: v.name,
|
|
2074
2074
|
value: (() => {
|
|
2075
|
-
const
|
|
2076
|
-
return typeof
|
|
2075
|
+
const d = E[v.from];
|
|
2076
|
+
return typeof d == "number" ? d : null;
|
|
2077
2077
|
})()
|
|
2078
2078
|
})), c = {
|
|
2079
|
-
id:
|
|
2079
|
+
id: E.id || `${a}-${p}-${O}-${B}`,
|
|
2080
2080
|
index: B,
|
|
2081
2081
|
modelType: "multivariate",
|
|
2082
|
-
name:
|
|
2083
|
-
data:
|
|
2082
|
+
name: E.name || "",
|
|
2083
|
+
data: E.data,
|
|
2084
2084
|
value: null,
|
|
2085
2085
|
// MultivariateData 的主要值在 values 陣列中,這裡設為 null
|
|
2086
|
-
color:
|
|
2086
|
+
color: F(e.color.from, {
|
|
2087
2087
|
index: B,
|
|
2088
|
-
seriesIndex:
|
|
2089
|
-
categoryIndex:
|
|
2088
|
+
seriesIndex: A,
|
|
2089
|
+
categoryIndex: y,
|
|
2090
2090
|
datasetIndex: l
|
|
2091
2091
|
}, r),
|
|
2092
2092
|
multivariate: I,
|
|
2093
|
-
series:
|
|
2094
|
-
seriesIndex:
|
|
2095
|
-
category:
|
|
2096
|
-
categoryIndex:
|
|
2093
|
+
series: p,
|
|
2094
|
+
seriesIndex: A,
|
|
2095
|
+
category: O,
|
|
2096
|
+
categoryIndex: y
|
|
2097
2097
|
};
|
|
2098
|
-
|
|
2098
|
+
C.push(c);
|
|
2099
2099
|
});
|
|
2100
|
-
}),
|
|
2101
|
-
}), u.push(
|
|
2100
|
+
}), _.push(C);
|
|
2101
|
+
}), u.push(_);
|
|
2102
2102
|
}), u;
|
|
2103
2103
|
}, Fr = (t, e, r) => {
|
|
2104
2104
|
const n = Array.isArray(t[0]), o = [], s = [];
|
|
2105
2105
|
n ? t.forEach((i) => {
|
|
2106
|
-
i.forEach((
|
|
2107
|
-
|
|
2106
|
+
i.forEach((f) => {
|
|
2107
|
+
f.source && f.target ? s.push(f) : o.push(f);
|
|
2108
2108
|
});
|
|
2109
2109
|
}) : t.forEach((i) => {
|
|
2110
2110
|
i.source && i.target ? s.push(i) : o.push(i);
|
|
2111
2111
|
});
|
|
2112
2112
|
const u = /* @__PURE__ */ new Map();
|
|
2113
|
-
n ? t.forEach((i,
|
|
2113
|
+
n ? t.forEach((i, f) => {
|
|
2114
2114
|
i.forEach((b) => {
|
|
2115
2115
|
if (!b.source || !b.target) {
|
|
2116
|
-
const
|
|
2117
|
-
u.has(
|
|
2116
|
+
const _ = b[e.dataset.from] || `dataset-${f}`;
|
|
2117
|
+
u.has(_) || u.set(_, []), u.get(_).push(b);
|
|
2118
2118
|
}
|
|
2119
2119
|
});
|
|
2120
2120
|
}) : o.forEach((i) => {
|
|
2121
|
-
const
|
|
2122
|
-
u.has(
|
|
2121
|
+
const f = i[e.dataset.from] || "default";
|
|
2122
|
+
u.has(f) || u.set(f, []), u.get(f).push(i);
|
|
2123
2123
|
});
|
|
2124
2124
|
let a = Array.from(u.keys());
|
|
2125
2125
|
if (Array.isArray(e.dataset.sort))
|
|
2126
2126
|
a = e.dataset.sort.filter((i) => u.has(i)).concat(a.filter((i) => !e.dataset.sort.includes(i)));
|
|
2127
2127
|
else if (e.dataset.sort === "original") {
|
|
2128
2128
|
const i = [];
|
|
2129
|
-
n ? t.forEach((
|
|
2130
|
-
|
|
2131
|
-
if (!
|
|
2132
|
-
const
|
|
2133
|
-
i.includes(
|
|
2129
|
+
n ? t.forEach((f, b) => {
|
|
2130
|
+
f.forEach((_) => {
|
|
2131
|
+
if (!_.source || !_.target) {
|
|
2132
|
+
const p = _[e.dataset.from] || `dataset-${b}`;
|
|
2133
|
+
i.includes(p) || i.push(p);
|
|
2134
2134
|
}
|
|
2135
2135
|
});
|
|
2136
|
-
}) : o.forEach((
|
|
2137
|
-
const b =
|
|
2136
|
+
}) : o.forEach((f) => {
|
|
2137
|
+
const b = f[e.dataset.from] || "default";
|
|
2138
2138
|
i.includes(b) || i.push(b);
|
|
2139
2139
|
}), a = i;
|
|
2140
|
-
} else e.dataset.sort === "alphabetical" && a.sort((i,
|
|
2140
|
+
} else e.dataset.sort === "alphabetical" && a.sort((i, f) => i.localeCompare(f, void 0, { numeric: !0 }));
|
|
2141
2141
|
const l = [];
|
|
2142
|
-
return a.forEach((i,
|
|
2143
|
-
const b = u.get(i),
|
|
2142
|
+
return a.forEach((i, f) => {
|
|
2143
|
+
const b = u.get(i), _ = [], p = /* @__PURE__ */ new Map();
|
|
2144
2144
|
b.forEach((c) => {
|
|
2145
|
-
const
|
|
2146
|
-
|
|
2145
|
+
const v = c[e.series.from] || "default";
|
|
2146
|
+
p.has(v) || p.set(v, []), p.get(v).push(c);
|
|
2147
2147
|
});
|
|
2148
|
-
let
|
|
2148
|
+
let A = Array.from(p.keys());
|
|
2149
2149
|
if (Array.isArray(e.series.sort))
|
|
2150
|
-
|
|
2150
|
+
A = e.series.sort.filter((c) => p.has(c)).concat(A.filter((c) => !e.series.sort.includes(c)));
|
|
2151
2151
|
else if (e.series.sort === "original") {
|
|
2152
2152
|
const c = [];
|
|
2153
|
-
b.forEach((
|
|
2154
|
-
const
|
|
2155
|
-
c.includes(
|
|
2156
|
-
}),
|
|
2157
|
-
} else e.series.sort === "alphabetical" &&
|
|
2158
|
-
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
const
|
|
2162
|
-
|
|
2153
|
+
b.forEach((v) => {
|
|
2154
|
+
const $ = v[e.series.from] || "default";
|
|
2155
|
+
c.includes($) || c.push($);
|
|
2156
|
+
}), A = c;
|
|
2157
|
+
} else e.series.sort === "alphabetical" && A.sort((c, v) => c.localeCompare(v, void 0, { numeric: !0 }));
|
|
2158
|
+
A.forEach((c, v) => {
|
|
2159
|
+
const $ = p.get(c), d = /* @__PURE__ */ new Map();
|
|
2160
|
+
$.forEach((S) => {
|
|
2161
|
+
const T = S[e.category.from] || "default";
|
|
2162
|
+
d.has(T) || d.set(T, []), d.get(T).push(S);
|
|
2163
2163
|
});
|
|
2164
|
-
let
|
|
2164
|
+
let x = Array.from(d.keys());
|
|
2165
2165
|
if (Array.isArray(e.category.sort))
|
|
2166
|
-
|
|
2166
|
+
x = e.category.sort.filter((S) => d.has(S)).concat(x.filter((S) => !e.category.sort.includes(S)));
|
|
2167
2167
|
else if (e.category.sort === "original") {
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
}),
|
|
2173
|
-
} else e.category.sort === "alphabetical" &&
|
|
2174
|
-
|
|
2175
|
-
const
|
|
2168
|
+
const S = [];
|
|
2169
|
+
$.forEach((T) => {
|
|
2170
|
+
const P = T[e.category.from] || "default";
|
|
2171
|
+
S.includes(P) || S.push(P);
|
|
2172
|
+
}), x = S;
|
|
2173
|
+
} else e.category.sort === "alphabetical" && x.sort((S, T) => S.localeCompare(T, void 0, { numeric: !0 }));
|
|
2174
|
+
x.forEach((S, T) => {
|
|
2175
|
+
const P = d.get(S);
|
|
2176
2176
|
if (e.value.aggregate === "none") {
|
|
2177
|
-
let
|
|
2178
|
-
const
|
|
2177
|
+
let j = P.map((M, k) => {
|
|
2178
|
+
const K = M[e.value.from];
|
|
2179
2179
|
return {
|
|
2180
|
-
id:
|
|
2181
|
-
index:
|
|
2180
|
+
id: M.id || `${i}-${c}-${S}-${k}`,
|
|
2181
|
+
index: _.length + k,
|
|
2182
2182
|
// 在所有 nodes 中的索引
|
|
2183
2183
|
modelType: "graph",
|
|
2184
|
-
name:
|
|
2185
|
-
data:
|
|
2186
|
-
value: typeof
|
|
2187
|
-
color:
|
|
2188
|
-
index:
|
|
2189
|
-
seriesIndex:
|
|
2190
|
-
categoryIndex:
|
|
2191
|
-
datasetIndex:
|
|
2184
|
+
name: M.name || "",
|
|
2185
|
+
data: M.data,
|
|
2186
|
+
value: typeof K == "number" ? K : null,
|
|
2187
|
+
color: F(e.color.from, {
|
|
2188
|
+
index: T,
|
|
2189
|
+
seriesIndex: v,
|
|
2190
|
+
categoryIndex: T,
|
|
2191
|
+
datasetIndex: f
|
|
2192
2192
|
}, r),
|
|
2193
2193
|
series: c,
|
|
2194
|
-
seriesIndex:
|
|
2195
|
-
category:
|
|
2196
|
-
categoryIndex:
|
|
2194
|
+
seriesIndex: v,
|
|
2195
|
+
category: S,
|
|
2196
|
+
categoryIndex: T
|
|
2197
2197
|
};
|
|
2198
2198
|
});
|
|
2199
|
-
e.value.sort === "asc" ?
|
|
2199
|
+
e.value.sort === "asc" ? j.sort((M, k) => M.value === null && k.value === null ? 0 : M.value === null ? 1 : k.value === null ? -1 : M.value - k.value) : e.value.sort === "desc" && j.sort((M, k) => M.value === null && k.value === null ? 0 : M.value === null ? 1 : k.value === null ? -1 : k.value - M.value), _.push(...j);
|
|
2200
2200
|
} else {
|
|
2201
|
-
const
|
|
2201
|
+
const j = P.map((ne) => {
|
|
2202
2202
|
if (e.value.aggregate === "count")
|
|
2203
2203
|
return 1;
|
|
2204
2204
|
const ee = ne[e.value.from];
|
|
2205
2205
|
return typeof ee == "number" ? ee : null;
|
|
2206
|
-
}),
|
|
2207
|
-
id: k.id || `${i}-${c}-${
|
|
2208
|
-
index:
|
|
2206
|
+
}), M = pe(j, e.value.aggregate), k = P[0], K = {
|
|
2207
|
+
id: k.id || `${i}-${c}-${S}-aggregated`,
|
|
2208
|
+
index: _.length,
|
|
2209
2209
|
// 在所有 nodes 中的索引
|
|
2210
2210
|
modelType: "graph",
|
|
2211
|
-
name: k.name ||
|
|
2211
|
+
name: k.name || S,
|
|
2212
2212
|
data: k.data,
|
|
2213
|
-
value:
|
|
2214
|
-
color:
|
|
2215
|
-
index:
|
|
2216
|
-
seriesIndex:
|
|
2217
|
-
categoryIndex:
|
|
2218
|
-
datasetIndex:
|
|
2213
|
+
value: M,
|
|
2214
|
+
color: F(e.color.from, {
|
|
2215
|
+
index: T,
|
|
2216
|
+
seriesIndex: v,
|
|
2217
|
+
categoryIndex: T,
|
|
2218
|
+
datasetIndex: f
|
|
2219
2219
|
}, r),
|
|
2220
2220
|
series: c,
|
|
2221
|
-
seriesIndex:
|
|
2222
|
-
category:
|
|
2223
|
-
categoryIndex:
|
|
2221
|
+
seriesIndex: v,
|
|
2222
|
+
category: S,
|
|
2223
|
+
categoryIndex: T
|
|
2224
2224
|
};
|
|
2225
|
-
|
|
2225
|
+
_.push(K);
|
|
2226
2226
|
}
|
|
2227
2227
|
});
|
|
2228
2228
|
});
|
|
2229
|
-
const
|
|
2230
|
-
|
|
2231
|
-
const
|
|
2232
|
-
|
|
2229
|
+
const m = [], h = /* @__PURE__ */ new Map();
|
|
2230
|
+
_.forEach((c) => {
|
|
2231
|
+
const v = o.find(($) => $.id === c.id || $.name === c.name);
|
|
2232
|
+
v != null && v.id && h.set(v.id, c.index), v != null && v.name && h.set(v.name, c.index);
|
|
2233
2233
|
});
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2236
|
-
|
|
2234
|
+
const w = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
2235
|
+
_.forEach((c) => {
|
|
2236
|
+
w.has(c.series) || w.set(c.series, c.seriesIndex), C.has(c.category) || C.set(c.category, c.categoryIndex);
|
|
2237
2237
|
});
|
|
2238
|
-
let
|
|
2239
|
-
const
|
|
2238
|
+
let O = w.size, y = C.size;
|
|
2239
|
+
const g = (c) => (w.has(c) || w.set(c, O++), w.get(c)), E = (c) => (C.has(c) || C.set(c, y++), C.get(c)), B = s.filter((c) => (c[e.dataset.from] || "default") === i), I = /* @__PURE__ */ new Map();
|
|
2240
2240
|
B.forEach((c) => {
|
|
2241
|
-
const
|
|
2242
|
-
I.has(
|
|
2243
|
-
}), Array.from(I.entries()).forEach(([c,
|
|
2244
|
-
const
|
|
2245
|
-
if (
|
|
2241
|
+
const v = c.source, $ = c.target, d = c[e.series.from] || "default", x = c[e.category.from] || "default", S = `${v}-${$}-${d}-${x}`;
|
|
2242
|
+
I.has(S) || I.set(S, []), I.get(S).push(c);
|
|
2243
|
+
}), Array.from(I.entries()).forEach(([c, v], $) => {
|
|
2244
|
+
const d = v[0], x = d.source, S = d.target, T = h.get(x) ?? -1, P = h.get(S) ?? -1;
|
|
2245
|
+
if (T >= 0 && P >= 0)
|
|
2246
2246
|
if (e.value.aggregate === "none")
|
|
2247
|
-
|
|
2248
|
-
const k =
|
|
2249
|
-
id:
|
|
2250
|
-
index:
|
|
2247
|
+
v.forEach((j, M) => {
|
|
2248
|
+
const k = j[e.value.from], K = j[e.series.from] || "default", ne = j[e.category.from] || "default", ee = g(K), ve = E(ne), Ee = {
|
|
2249
|
+
id: j.id || `edge-${$}-${M}`,
|
|
2250
|
+
index: m.length,
|
|
2251
2251
|
modelType: "graph",
|
|
2252
|
-
name:
|
|
2253
|
-
data:
|
|
2252
|
+
name: j.name || "",
|
|
2253
|
+
data: j.data,
|
|
2254
2254
|
value: typeof k == "number" ? k : null,
|
|
2255
|
-
color:
|
|
2256
|
-
index:
|
|
2255
|
+
color: F(e.color.from, {
|
|
2256
|
+
index: m.length,
|
|
2257
2257
|
seriesIndex: ee,
|
|
2258
2258
|
categoryIndex: ve,
|
|
2259
|
-
datasetIndex:
|
|
2259
|
+
datasetIndex: f
|
|
2260
2260
|
}, r),
|
|
2261
|
-
series:
|
|
2261
|
+
series: K,
|
|
2262
2262
|
seriesIndex: ee,
|
|
2263
2263
|
category: ne,
|
|
2264
2264
|
categoryIndex: ve,
|
|
2265
|
-
source:
|
|
2266
|
-
sourceIndex:
|
|
2267
|
-
target:
|
|
2268
|
-
targetIndex:
|
|
2265
|
+
source: x,
|
|
2266
|
+
sourceIndex: T,
|
|
2267
|
+
target: S,
|
|
2268
|
+
targetIndex: P
|
|
2269
2269
|
};
|
|
2270
|
-
|
|
2270
|
+
m.push(Ee);
|
|
2271
2271
|
});
|
|
2272
2272
|
else {
|
|
2273
|
-
const
|
|
2273
|
+
const j = v.map((Ee) => {
|
|
2274
2274
|
if (e.value.aggregate === "count")
|
|
2275
2275
|
return 1;
|
|
2276
2276
|
const Pe = Ee[e.value.from];
|
|
2277
2277
|
return typeof Pe == "number" ? Pe : null;
|
|
2278
|
-
}),
|
|
2279
|
-
id:
|
|
2280
|
-
index:
|
|
2278
|
+
}), M = pe(j, e.value.aggregate), k = d[e.series.from] || "default", K = d[e.category.from] || "default", ne = g(k), ee = E(K), ve = {
|
|
2279
|
+
id: d.id || `edge-${$}-aggregated`,
|
|
2280
|
+
index: m.length,
|
|
2281
2281
|
modelType: "graph",
|
|
2282
|
-
name:
|
|
2283
|
-
data:
|
|
2284
|
-
value:
|
|
2285
|
-
color:
|
|
2286
|
-
index:
|
|
2282
|
+
name: d.name || "",
|
|
2283
|
+
data: d.data,
|
|
2284
|
+
value: M,
|
|
2285
|
+
color: F(e.color.from, {
|
|
2286
|
+
index: m.length,
|
|
2287
2287
|
seriesIndex: ne,
|
|
2288
2288
|
categoryIndex: ee,
|
|
2289
|
-
datasetIndex:
|
|
2289
|
+
datasetIndex: f
|
|
2290
2290
|
}, r),
|
|
2291
2291
|
series: k,
|
|
2292
2292
|
seriesIndex: ne,
|
|
2293
|
-
category:
|
|
2293
|
+
category: K,
|
|
2294
2294
|
categoryIndex: ee,
|
|
2295
|
-
source:
|
|
2296
|
-
sourceIndex:
|
|
2297
|
-
target:
|
|
2298
|
-
targetIndex:
|
|
2295
|
+
source: x,
|
|
2296
|
+
sourceIndex: T,
|
|
2297
|
+
target: S,
|
|
2298
|
+
targetIndex: P
|
|
2299
2299
|
};
|
|
2300
|
-
|
|
2300
|
+
m.push(ve);
|
|
2301
2301
|
}
|
|
2302
|
-
}), l.push({ nodes:
|
|
2302
|
+
}), l.push({ nodes: _, edges: m });
|
|
2303
2303
|
}), l;
|
|
2304
2304
|
}, Dr = (t, e, r) => {
|
|
2305
2305
|
const n = /* @__PURE__ */ new Map(), o = Array.isArray(t[0]);
|
|
2306
2306
|
o ? t.forEach((a, l) => {
|
|
2307
2307
|
a.forEach((i) => {
|
|
2308
|
-
const
|
|
2309
|
-
n.has(
|
|
2308
|
+
const f = i[e.dataset.from] || `dataset-${l}`;
|
|
2309
|
+
n.has(f) || n.set(f, []), n.get(f).push(i);
|
|
2310
2310
|
});
|
|
2311
2311
|
}) : t.forEach((a) => {
|
|
2312
2312
|
const l = a[e.dataset.from] || "default";
|
|
@@ -2318,8 +2318,8 @@ const Ke = {
|
|
|
2318
2318
|
else if (e.dataset.sort === "original") {
|
|
2319
2319
|
const a = [];
|
|
2320
2320
|
o ? t.forEach((l, i) => {
|
|
2321
|
-
l.forEach((
|
|
2322
|
-
const b =
|
|
2321
|
+
l.forEach((f) => {
|
|
2322
|
+
const b = f[e.dataset.from] || `dataset-${i}`;
|
|
2323
2323
|
a.includes(b) || a.push(b);
|
|
2324
2324
|
});
|
|
2325
2325
|
}) : t.forEach((l) => {
|
|
@@ -2329,60 +2329,60 @@ const Ke = {
|
|
|
2329
2329
|
} else e.dataset.sort === "alphabetical" && s.sort((a, l) => a.localeCompare(l, void 0, { numeric: !0 }));
|
|
2330
2330
|
const u = [];
|
|
2331
2331
|
return s.forEach((a, l) => {
|
|
2332
|
-
const i = n.get(a),
|
|
2332
|
+
const i = n.get(a), f = /* @__PURE__ */ new Map();
|
|
2333
2333
|
i.forEach((c) => {
|
|
2334
|
-
const
|
|
2335
|
-
|
|
2334
|
+
const v = c[e.series.from] || "default";
|
|
2335
|
+
f.has(v) || f.set(v, []), f.get(v).push(c);
|
|
2336
2336
|
});
|
|
2337
|
-
let b = Array.from(
|
|
2337
|
+
let b = Array.from(f.keys());
|
|
2338
2338
|
if (Array.isArray(e.series.sort))
|
|
2339
|
-
b = e.series.sort.filter((c) =>
|
|
2339
|
+
b = e.series.sort.filter((c) => f.has(c)).concat(b.filter((c) => !e.series.sort.includes(c)));
|
|
2340
2340
|
else if (e.series.sort === "original") {
|
|
2341
2341
|
const c = [];
|
|
2342
|
-
i.forEach((
|
|
2343
|
-
const
|
|
2344
|
-
c.includes(
|
|
2342
|
+
i.forEach((v) => {
|
|
2343
|
+
const $ = v[e.series.from] || "default";
|
|
2344
|
+
c.includes($) || c.push($);
|
|
2345
2345
|
}), b = c;
|
|
2346
|
-
} else e.series.sort === "alphabetical" && b.sort((c,
|
|
2347
|
-
const
|
|
2346
|
+
} else e.series.sort === "alphabetical" && b.sort((c, v) => c.localeCompare(v, void 0, { numeric: !0 }));
|
|
2347
|
+
const _ = /* @__PURE__ */ new Map();
|
|
2348
2348
|
i.forEach((c) => {
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2349
|
+
const v = c[e.category.from] || "default";
|
|
2350
|
+
_.has(v) || _.set(v, []), _.get(v).push(c);
|
|
2351
2351
|
});
|
|
2352
|
-
let
|
|
2352
|
+
let p = Array.from(_.keys());
|
|
2353
2353
|
if (Array.isArray(e.category.sort))
|
|
2354
|
-
|
|
2354
|
+
p = e.category.sort.filter((c) => _.has(c)).concat(p.filter((c) => !e.category.sort.includes(c)));
|
|
2355
2355
|
else if (e.category.sort === "original") {
|
|
2356
2356
|
const c = [];
|
|
2357
|
-
i.forEach((
|
|
2358
|
-
const
|
|
2359
|
-
c.includes(
|
|
2360
|
-
}),
|
|
2361
|
-
} else e.category.sort === "alphabetical" &&
|
|
2362
|
-
const
|
|
2357
|
+
i.forEach((v) => {
|
|
2358
|
+
const $ = v[e.category.from] || "default";
|
|
2359
|
+
c.includes($) || c.push($);
|
|
2360
|
+
}), p = c;
|
|
2361
|
+
} else e.category.sort === "alphabetical" && p.sort((c, v) => c.localeCompare(v, void 0, { numeric: !0 }));
|
|
2362
|
+
const A = /* @__PURE__ */ new Map();
|
|
2363
2363
|
i.forEach((c) => {
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2364
|
+
const v = c.id || "unknown";
|
|
2365
|
+
A.has(v) || A.set(v, []), A.get(v).push(c);
|
|
2366
2366
|
});
|
|
2367
|
-
let
|
|
2368
|
-
const
|
|
2369
|
-
Array.from(
|
|
2370
|
-
const
|
|
2367
|
+
let m = 0;
|
|
2368
|
+
const h = b[0] || "default", w = b.indexOf(h), C = /* @__PURE__ */ new Map();
|
|
2369
|
+
Array.from(A.entries()).forEach(([c, v]) => {
|
|
2370
|
+
const $ = v[0], d = $[e.series.from] || "default", x = b.indexOf(d), S = $[e.category.from] || "default", T = p.indexOf(S);
|
|
2371
2371
|
if (e.value.aggregate === "none") {
|
|
2372
|
-
const
|
|
2372
|
+
const P = $[e.value.from], j = {
|
|
2373
2373
|
id: c,
|
|
2374
|
-
index:
|
|
2374
|
+
index: m++,
|
|
2375
2375
|
modelType: "tree",
|
|
2376
|
-
name:
|
|
2377
|
-
data:
|
|
2378
|
-
value: typeof
|
|
2379
|
-
color:
|
|
2380
|
-
index:
|
|
2381
|
-
seriesIndex:
|
|
2382
|
-
categoryIndex:
|
|
2376
|
+
name: $.name || c,
|
|
2377
|
+
data: $.data,
|
|
2378
|
+
value: typeof P == "number" ? P : null,
|
|
2379
|
+
color: F(e.color.from, {
|
|
2380
|
+
index: m - 1,
|
|
2381
|
+
seriesIndex: x,
|
|
2382
|
+
categoryIndex: T,
|
|
2383
2383
|
datasetIndex: l
|
|
2384
2384
|
}, r),
|
|
2385
|
-
parent:
|
|
2385
|
+
parent: $.parent || null,
|
|
2386
2386
|
parentIndex: null,
|
|
2387
2387
|
// 稍後設定
|
|
2388
2388
|
depth: 0,
|
|
@@ -2390,32 +2390,32 @@ const Ke = {
|
|
|
2390
2390
|
seq: 0,
|
|
2391
2391
|
// 稍後計算
|
|
2392
2392
|
children: [],
|
|
2393
|
-
series:
|
|
2394
|
-
seriesIndex:
|
|
2395
|
-
category:
|
|
2396
|
-
categoryIndex:
|
|
2393
|
+
series: d,
|
|
2394
|
+
seriesIndex: x,
|
|
2395
|
+
category: S,
|
|
2396
|
+
categoryIndex: T
|
|
2397
2397
|
};
|
|
2398
|
-
|
|
2398
|
+
C.set(c, j);
|
|
2399
2399
|
} else {
|
|
2400
|
-
const
|
|
2400
|
+
const P = v.map((k) => {
|
|
2401
2401
|
if (e.value.aggregate === "count")
|
|
2402
2402
|
return 1;
|
|
2403
|
-
const
|
|
2404
|
-
return typeof
|
|
2405
|
-
}),
|
|
2403
|
+
const K = k[e.value.from];
|
|
2404
|
+
return typeof K == "number" ? K : null;
|
|
2405
|
+
}), j = pe(P, e.value.aggregate), M = {
|
|
2406
2406
|
id: c,
|
|
2407
|
-
index:
|
|
2407
|
+
index: m++,
|
|
2408
2408
|
modelType: "tree",
|
|
2409
|
-
name:
|
|
2410
|
-
data:
|
|
2411
|
-
value:
|
|
2412
|
-
color:
|
|
2413
|
-
index:
|
|
2414
|
-
seriesIndex:
|
|
2415
|
-
categoryIndex:
|
|
2409
|
+
name: $.name || c,
|
|
2410
|
+
data: $.data,
|
|
2411
|
+
value: j,
|
|
2412
|
+
color: F(e.color.from, {
|
|
2413
|
+
index: m - 1,
|
|
2414
|
+
seriesIndex: x,
|
|
2415
|
+
categoryIndex: T,
|
|
2416
2416
|
datasetIndex: l
|
|
2417
2417
|
}, r),
|
|
2418
|
-
parent:
|
|
2418
|
+
parent: $.parent || null,
|
|
2419
2419
|
parentIndex: null,
|
|
2420
2420
|
// 稍後設定
|
|
2421
2421
|
depth: 0,
|
|
@@ -2423,43 +2423,43 @@ const Ke = {
|
|
|
2423
2423
|
seq: 0,
|
|
2424
2424
|
// 稍後計算
|
|
2425
2425
|
children: [],
|
|
2426
|
-
series:
|
|
2427
|
-
seriesIndex:
|
|
2428
|
-
category:
|
|
2429
|
-
categoryIndex:
|
|
2426
|
+
series: d,
|
|
2427
|
+
seriesIndex: x,
|
|
2428
|
+
category: S,
|
|
2429
|
+
categoryIndex: T
|
|
2430
2430
|
};
|
|
2431
|
-
|
|
2431
|
+
C.set(c, M);
|
|
2432
2432
|
}
|
|
2433
2433
|
});
|
|
2434
|
-
const
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
}),
|
|
2438
|
-
c.parent &&
|
|
2434
|
+
const O = Array.from(C.values()), y = /* @__PURE__ */ new Map();
|
|
2435
|
+
O.forEach((c) => {
|
|
2436
|
+
y.set(c.id, c.index);
|
|
2437
|
+
}), O.forEach((c) => {
|
|
2438
|
+
c.parent && y.has(c.parent) && (c.parentIndex = y.get(c.parent));
|
|
2439
2439
|
});
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2442
|
-
c.parent === null ?
|
|
2440
|
+
const g = [], E = /* @__PURE__ */ new Map();
|
|
2441
|
+
O.forEach((c) => {
|
|
2442
|
+
c.parent === null ? g.push(c) : (E.has(c.parent) || E.set(c.parent, []), E.get(c.parent).push(c));
|
|
2443
2443
|
});
|
|
2444
|
-
function B(c,
|
|
2445
|
-
c.depth =
|
|
2446
|
-
const
|
|
2447
|
-
return e.value.sort === "asc" ?
|
|
2448
|
-
|
|
2449
|
-
}), c.children =
|
|
2444
|
+
function B(c, v) {
|
|
2445
|
+
c.depth = v;
|
|
2446
|
+
const $ = E.get(c.id) || [];
|
|
2447
|
+
return e.value.sort === "asc" ? $.sort((d, x) => d.value === null && x.value === null ? 0 : d.value === null ? 1 : x.value === null ? -1 : d.value - x.value) : e.value.sort === "desc" && $.sort((d, x) => d.value === null && x.value === null ? 0 : d.value === null ? 1 : x.value === null ? -1 : x.value - d.value), $.forEach((d, x) => {
|
|
2448
|
+
d.seq = x;
|
|
2449
|
+
}), c.children = $.map((d) => B(d, v + 1)), c;
|
|
2450
2450
|
}
|
|
2451
|
-
const I =
|
|
2451
|
+
const I = g.map((c) => B(c, 0));
|
|
2452
2452
|
if (I.length === 0)
|
|
2453
2453
|
u.push({
|
|
2454
2454
|
id: `empty-${a}`,
|
|
2455
|
-
index:
|
|
2455
|
+
index: m++,
|
|
2456
2456
|
modelType: "tree",
|
|
2457
2457
|
name: "Empty Tree",
|
|
2458
2458
|
data: {},
|
|
2459
2459
|
value: null,
|
|
2460
|
-
color:
|
|
2461
|
-
index:
|
|
2462
|
-
seriesIndex:
|
|
2460
|
+
color: F(e.color.from, {
|
|
2461
|
+
index: m - 1,
|
|
2462
|
+
seriesIndex: w < 0 ? 0 : w,
|
|
2463
2463
|
categoryIndex: 0,
|
|
2464
2464
|
datasetIndex: l
|
|
2465
2465
|
}, r),
|
|
@@ -2468,8 +2468,8 @@ const Ke = {
|
|
|
2468
2468
|
depth: 0,
|
|
2469
2469
|
seq: 0,
|
|
2470
2470
|
children: [],
|
|
2471
|
-
series:
|
|
2472
|
-
seriesIndex:
|
|
2471
|
+
series: h,
|
|
2472
|
+
seriesIndex: w < 0 ? 0 : w,
|
|
2473
2473
|
category: "default",
|
|
2474
2474
|
categoryIndex: 0
|
|
2475
2475
|
});
|
|
@@ -2478,14 +2478,14 @@ const Ke = {
|
|
|
2478
2478
|
else {
|
|
2479
2479
|
const c = {
|
|
2480
2480
|
id: `virtual-root-${a}`,
|
|
2481
|
-
index:
|
|
2481
|
+
index: m++,
|
|
2482
2482
|
modelType: "tree",
|
|
2483
2483
|
name: `Virtual Root (${a})`,
|
|
2484
2484
|
data: {},
|
|
2485
2485
|
value: null,
|
|
2486
|
-
color:
|
|
2487
|
-
index:
|
|
2488
|
-
seriesIndex:
|
|
2486
|
+
color: F(e.color.from, {
|
|
2487
|
+
index: m - 1,
|
|
2488
|
+
seriesIndex: w < 0 ? 0 : w,
|
|
2489
2489
|
categoryIndex: 0,
|
|
2490
2490
|
datasetIndex: l
|
|
2491
2491
|
}, r),
|
|
@@ -2493,12 +2493,12 @@ const Ke = {
|
|
|
2493
2493
|
parentIndex: null,
|
|
2494
2494
|
depth: 0,
|
|
2495
2495
|
seq: 0,
|
|
2496
|
-
children: I.map((
|
|
2497
|
-
const
|
|
2498
|
-
return
|
|
2496
|
+
children: I.map((v, $) => {
|
|
2497
|
+
const d = (x, S) => (x.depth = S, S === 1 && (x.seq = $), x.children = x.children.map((T) => d(T, S + 1)), x);
|
|
2498
|
+
return d(v, 1);
|
|
2499
2499
|
}),
|
|
2500
|
-
series:
|
|
2501
|
-
seriesIndex:
|
|
2500
|
+
series: h,
|
|
2501
|
+
seriesIndex: w < 0 ? 0 : w,
|
|
2502
2502
|
category: "default",
|
|
2503
2503
|
categoryIndex: 0
|
|
2504
2504
|
};
|
|
@@ -2526,13 +2526,13 @@ function Nr(t, e, r) {
|
|
|
2526
2526
|
}
|
|
2527
2527
|
function Ne(t, e, r, n, o) {
|
|
2528
2528
|
Object.keys(r).filter((i) => !e.includes(i)).forEach((i) => {
|
|
2529
|
-
const
|
|
2530
|
-
|
|
2529
|
+
const f = r[i];
|
|
2530
|
+
f && f.parentNode === t && t.removeChild(f), delete r[i];
|
|
2531
2531
|
});
|
|
2532
2532
|
const a = e.filter((i) => !r[i]);
|
|
2533
2533
|
a.forEach((i) => {
|
|
2534
|
-
const
|
|
2535
|
-
r[i] =
|
|
2534
|
+
const f = n(i);
|
|
2535
|
+
r[i] = f, t.appendChild(f);
|
|
2536
2536
|
}), e.filter((i) => r[i] && !a.includes(i)).forEach((i) => {
|
|
2537
2537
|
r[i];
|
|
2538
2538
|
}), e.length > 0 && Nr(t, e, r);
|
|
@@ -2803,386 +2803,388 @@ function qr(t) {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
function Gr({ svgElement$: t, canvasElement$: e, pluginsInstance$: r }) {
|
|
2805
2805
|
let n = [], o = [];
|
|
2806
|
-
const s = (l, i,
|
|
2807
|
-
const b = r.getValue().reduce((
|
|
2808
|
-
...
|
|
2809
|
-
pluginSeq: b[
|
|
2806
|
+
const s = (l, i, f) => {
|
|
2807
|
+
const b = r.getValue().reduce((A, m, h) => (A[m._getId()] = h, A), {}), _ = f.map((A) => ({
|
|
2808
|
+
...A,
|
|
2809
|
+
pluginSeq: b[A.pluginId]
|
|
2810
2810
|
}));
|
|
2811
|
-
return (l === "svg" ? n : o).filter((
|
|
2812
|
-
...
|
|
2813
|
-
pluginSeq: b[
|
|
2814
|
-
})).concat(
|
|
2811
|
+
return (l === "svg" ? n : o).filter((A) => A.pluginId !== i).map((A) => ({
|
|
2812
|
+
...A,
|
|
2813
|
+
pluginSeq: b[A.pluginId]
|
|
2814
|
+
})).concat(_).sort((A, m) => A.layerIndex - m.layerIndex || A.pluginSeq - m.pluginSeq);
|
|
2815
2815
|
}, u = {}, a = {};
|
|
2816
|
-
return (l, i,
|
|
2816
|
+
return (l, i, f) => {
|
|
2817
2817
|
const b = l === "svg" ? t.getValue() : e.getValue();
|
|
2818
2818
|
if (!b)
|
|
2819
2819
|
return {};
|
|
2820
|
-
const
|
|
2820
|
+
const _ = l === "svg" ? u : a, p = s(l, i, f), A = p.map((h) => Mr(h.pluginId, h.layerName));
|
|
2821
2821
|
return l === "svg" ? (Ne(
|
|
2822
2822
|
b,
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
(
|
|
2826
|
-
), n =
|
|
2823
|
+
A,
|
|
2824
|
+
_,
|
|
2825
|
+
(h) => Br(h)
|
|
2826
|
+
), n = p) : (Ne(
|
|
2827
2827
|
b,
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
(
|
|
2831
|
-
), o =
|
|
2832
|
-
const [
|
|
2833
|
-
return
|
|
2828
|
+
A,
|
|
2829
|
+
_,
|
|
2830
|
+
(h) => ft(h)
|
|
2831
|
+
), o = p), Object.entries(_).reduce((h, [w, C]) => {
|
|
2832
|
+
const [O, y, g] = w.split("-");
|
|
2833
|
+
return y === i && (h[g] = C), h;
|
|
2834
2834
|
}, {});
|
|
2835
2835
|
};
|
|
2836
2836
|
}
|
|
2837
2837
|
const Wr = (t, e) => {
|
|
2838
2838
|
try {
|
|
2839
|
-
const { status:
|
|
2840
|
-
if (
|
|
2841
|
-
throw new Error(
|
|
2842
|
-
columnName:
|
|
2843
|
-
expectToBe:
|
|
2839
|
+
const { status: h, columnName: w, expectToBe: C } = qr(e);
|
|
2840
|
+
if (h === "error")
|
|
2841
|
+
throw new Error(J({
|
|
2842
|
+
columnName: w,
|
|
2843
|
+
expectToBe: C,
|
|
2844
2844
|
from: "Chart.constructor"
|
|
2845
2845
|
}));
|
|
2846
|
-
if (
|
|
2847
|
-
console.warn(
|
|
2848
|
-
columnName:
|
|
2849
|
-
expectToBe:
|
|
2846
|
+
if (h === "warning")
|
|
2847
|
+
console.warn(H({
|
|
2848
|
+
columnName: w,
|
|
2849
|
+
expectToBe: C,
|
|
2850
2850
|
from: "Chart.constructor"
|
|
2851
2851
|
}));
|
|
2852
2852
|
else {
|
|
2853
|
-
const { status:
|
|
2854
|
-
if (
|
|
2855
|
-
throw new Error(
|
|
2856
|
-
columnName:
|
|
2857
|
-
expectToBe:
|
|
2853
|
+
const { status: O, columnName: y, expectToBe: g } = Ur(t);
|
|
2854
|
+
if (O === "error")
|
|
2855
|
+
throw new Error(J({
|
|
2856
|
+
columnName: y,
|
|
2857
|
+
expectToBe: g,
|
|
2858
2858
|
from: "Chart.constructor"
|
|
2859
2859
|
}));
|
|
2860
|
-
|
|
2861
|
-
columnName:
|
|
2862
|
-
expectToBe:
|
|
2860
|
+
O === "warning" && console.warn(H({
|
|
2861
|
+
columnName: y,
|
|
2862
|
+
expectToBe: g,
|
|
2863
2863
|
from: "Chart.constructor"
|
|
2864
2864
|
}));
|
|
2865
2865
|
}
|
|
2866
|
-
} catch (
|
|
2867
|
-
throw new Error(
|
|
2866
|
+
} catch (h) {
|
|
2867
|
+
throw new Error(h);
|
|
2868
2868
|
}
|
|
2869
|
-
const r = new oe(), n = new D((e == null ? void 0 : e.data) || []), o = e && e.encoding ?
|
|
2870
|
-
const
|
|
2871
|
-
br((
|
|
2872
|
-
() =>
|
|
2869
|
+
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), b = new D(null), _ = new D(null), p = (() => {
|
|
2870
|
+
const h = f.pipe(
|
|
2871
|
+
br((d) => fr(
|
|
2872
|
+
() => d.width === "auto" || d.height === "auto",
|
|
2873
2873
|
// 有 'auto' 的話就監聽element的尺寸
|
|
2874
|
-
|
|
2875
|
-
q((
|
|
2876
|
-
width:
|
|
2877
|
-
height:
|
|
2874
|
+
jr(t).pipe(
|
|
2875
|
+
q((x) => ({
|
|
2876
|
+
width: d.width === "auto" ? x.width : d.width,
|
|
2877
|
+
height: d.height === "auto" ? x.height <= 0 ? x.width : x.height : d.height
|
|
2878
2878
|
})),
|
|
2879
|
-
G(
|
|
2880
|
-
pr((
|
|
2879
|
+
G(d.resizeDebounce),
|
|
2880
|
+
pr((x, S) => JSON.stringify(x) === JSON.stringify(S))
|
|
2881
2881
|
),
|
|
2882
2882
|
Qt({
|
|
2883
|
-
width:
|
|
2884
|
-
height:
|
|
2883
|
+
width: d.width,
|
|
2884
|
+
height: d.height
|
|
2885
2885
|
})
|
|
2886
2886
|
)),
|
|
2887
2887
|
wr(r),
|
|
2888
2888
|
te(1)
|
|
2889
|
-
),
|
|
2889
|
+
), w = s.asObservable().pipe(
|
|
2890
2890
|
te(1)
|
|
2891
|
-
),
|
|
2891
|
+
), C = Z([
|
|
2892
2892
|
n,
|
|
2893
2893
|
s,
|
|
2894
2894
|
a
|
|
2895
2895
|
]).pipe(
|
|
2896
2896
|
G(0),
|
|
2897
|
-
q(([
|
|
2897
|
+
q(([d, x, S]) => {
|
|
2898
2898
|
try {
|
|
2899
|
-
return Vr(
|
|
2900
|
-
} catch (
|
|
2899
|
+
return Vr(d, x, S);
|
|
2900
|
+
} catch (T) {
|
|
2901
2901
|
throw new Error(fe({
|
|
2902
2902
|
from: "Chart.seriesData$",
|
|
2903
|
-
systemMessage:
|
|
2903
|
+
systemMessage: T
|
|
2904
2904
|
}));
|
|
2905
2905
|
}
|
|
2906
2906
|
}),
|
|
2907
|
-
ae((
|
|
2907
|
+
ae((d) => (console.error(z(d)), se)),
|
|
2908
2908
|
te(1)
|
|
2909
|
-
),
|
|
2909
|
+
), O = Z([
|
|
2910
2910
|
n,
|
|
2911
2911
|
s,
|
|
2912
2912
|
a
|
|
2913
2913
|
]).pipe(
|
|
2914
2914
|
G(0),
|
|
2915
|
-
q(([
|
|
2915
|
+
q(([d, x, S]) => {
|
|
2916
2916
|
try {
|
|
2917
|
-
return Rr(
|
|
2918
|
-
} catch (
|
|
2917
|
+
return Rr(d, x, S);
|
|
2918
|
+
} catch (T) {
|
|
2919
2919
|
throw new Error(fe({
|
|
2920
2920
|
from: "Chart.gridData$",
|
|
2921
|
-
systemMessage:
|
|
2921
|
+
systemMessage: T
|
|
2922
2922
|
}));
|
|
2923
2923
|
}
|
|
2924
2924
|
}),
|
|
2925
|
-
ae((
|
|
2925
|
+
ae((d) => (console.error(z(d)), se)),
|
|
2926
2926
|
te(1)
|
|
2927
|
-
),
|
|
2927
|
+
), y = Z([
|
|
2928
2928
|
n,
|
|
2929
2929
|
s,
|
|
2930
2930
|
a
|
|
2931
2931
|
]).pipe(
|
|
2932
2932
|
G(0),
|
|
2933
|
-
q(([
|
|
2933
|
+
q(([d, x, S]) => {
|
|
2934
2934
|
try {
|
|
2935
|
-
return Kr(
|
|
2936
|
-
} catch (
|
|
2935
|
+
return Kr(d, x, S);
|
|
2936
|
+
} catch (T) {
|
|
2937
2937
|
throw new Error(fe({
|
|
2938
2938
|
from: "Chart.multivariateData$",
|
|
2939
|
-
systemMessage:
|
|
2939
|
+
systemMessage: T
|
|
2940
2940
|
}));
|
|
2941
2941
|
}
|
|
2942
2942
|
}),
|
|
2943
|
-
ae((
|
|
2943
|
+
ae((d) => (console.error(z(d)), se)),
|
|
2944
2944
|
te(1)
|
|
2945
|
-
),
|
|
2945
|
+
), g = Z([
|
|
2946
2946
|
n,
|
|
2947
2947
|
s,
|
|
2948
2948
|
a
|
|
2949
2949
|
]).pipe(
|
|
2950
2950
|
G(0),
|
|
2951
|
-
q(([
|
|
2951
|
+
q(([d, x, S]) => {
|
|
2952
2952
|
try {
|
|
2953
|
-
return Fr(
|
|
2954
|
-
} catch (
|
|
2953
|
+
return Fr(d, x, S);
|
|
2954
|
+
} catch (T) {
|
|
2955
2955
|
throw new Error(fe({
|
|
2956
2956
|
from: "Chart.graphData$",
|
|
2957
|
-
systemMessage:
|
|
2957
|
+
systemMessage: T
|
|
2958
2958
|
}));
|
|
2959
2959
|
}
|
|
2960
2960
|
}),
|
|
2961
|
-
ae((
|
|
2961
|
+
ae((d) => (console.error(z(d)), se)),
|
|
2962
2962
|
te(1)
|
|
2963
|
-
),
|
|
2963
|
+
), E = Z([
|
|
2964
2964
|
n,
|
|
2965
2965
|
s,
|
|
2966
2966
|
a
|
|
2967
2967
|
]).pipe(
|
|
2968
2968
|
G(0),
|
|
2969
|
-
q(([
|
|
2969
|
+
q(([d, x, S]) => {
|
|
2970
2970
|
try {
|
|
2971
|
-
return Dr(
|
|
2972
|
-
} catch (
|
|
2971
|
+
return Dr(d, x, S);
|
|
2972
|
+
} catch (T) {
|
|
2973
2973
|
throw new Error(fe({
|
|
2974
2974
|
from: "Chart.treeData$",
|
|
2975
|
-
systemMessage:
|
|
2975
|
+
systemMessage: T
|
|
2976
2976
|
}));
|
|
2977
2977
|
}
|
|
2978
2978
|
}),
|
|
2979
|
-
ae((
|
|
2979
|
+
ae((d) => (console.error(z(d)), se)),
|
|
2980
2980
|
te(1)
|
|
2981
|
-
),
|
|
2982
|
-
l.subscribe((
|
|
2983
|
-
const
|
|
2984
|
-
var
|
|
2985
|
-
let
|
|
2986
|
-
if (
|
|
2987
|
-
const
|
|
2988
|
-
|
|
2981
|
+
), B = new D([]);
|
|
2982
|
+
l.subscribe((d) => {
|
|
2983
|
+
const x = {}, S = d.map((P) => {
|
|
2984
|
+
var M;
|
|
2985
|
+
let j = P._getId();
|
|
2986
|
+
if (x[j]) {
|
|
2987
|
+
const k = ((M = x[j].split("[")[1]) == null ? void 0 : M.split("]")[0]) || "0", K = parseInt(k) + 1;
|
|
2988
|
+
j = `${j.split("[")[0]}[${K}]`;
|
|
2989
2989
|
}
|
|
2990
|
-
return
|
|
2990
|
+
return x[j] = P._getId(), j;
|
|
2991
2991
|
});
|
|
2992
|
-
|
|
2993
|
-
const
|
|
2994
|
-
id:
|
|
2995
|
-
name:
|
|
2996
|
-
elementType:
|
|
2997
|
-
shownLayers:
|
|
2992
|
+
d.forEach((P, j) => P._setId(S[j]));
|
|
2993
|
+
const T = d.map((P) => ({
|
|
2994
|
+
id: P._getId(),
|
|
2995
|
+
name: P._name,
|
|
2996
|
+
elementType: P._elementType,
|
|
2997
|
+
shownLayers: P.getShownLayerNames()
|
|
2998
2998
|
}));
|
|
2999
|
-
|
|
2999
|
+
B.next(T);
|
|
3000
3000
|
});
|
|
3001
|
-
const
|
|
3001
|
+
const I = a.asObservable().pipe(
|
|
3002
3002
|
te(1)
|
|
3003
|
-
),
|
|
3003
|
+
), c = new oe(), v = c.asObservable().pipe(
|
|
3004
3004
|
lt()
|
|
3005
3005
|
);
|
|
3006
3006
|
return {
|
|
3007
3007
|
root: t,
|
|
3008
3008
|
svg: null,
|
|
3009
3009
|
canvas: null,
|
|
3010
|
-
size$:
|
|
3011
|
-
encoding$:
|
|
3012
|
-
seriesData$:
|
|
3013
|
-
gridData$:
|
|
3014
|
-
multivariateData$:
|
|
3015
|
-
graphData$:
|
|
3016
|
-
treeData$:
|
|
3017
|
-
plugins$:
|
|
3018
|
-
theme$:
|
|
3019
|
-
event$:
|
|
3020
|
-
eventTrigger$:
|
|
3010
|
+
size$: h,
|
|
3011
|
+
encoding$: w,
|
|
3012
|
+
seriesData$: C,
|
|
3013
|
+
gridData$: O,
|
|
3014
|
+
multivariateData$: y,
|
|
3015
|
+
graphData$: g,
|
|
3016
|
+
treeData$: E,
|
|
3017
|
+
plugins$: B,
|
|
3018
|
+
theme$: I,
|
|
3019
|
+
event$: v,
|
|
3020
|
+
eventTrigger$: c,
|
|
3021
3021
|
_updateLayerElements: Gr({
|
|
3022
3022
|
svgElement$: b,
|
|
3023
|
-
canvasElement$:
|
|
3023
|
+
canvasElement$: _,
|
|
3024
3024
|
pluginsInstance$: l
|
|
3025
3025
|
})
|
|
3026
3026
|
};
|
|
3027
3027
|
})();
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3028
|
+
let A = null;
|
|
3029
|
+
const m = () => (A || (A = document.createElement("div"), A.classList.add("orbcharts-container"), A.style.position = "relative", t.appendChild(A)), A);
|
|
3030
|
+
return l.subscribe((h) => {
|
|
3031
|
+
let w = !1, C = !1;
|
|
3032
|
+
h.forEach((O) => {
|
|
3033
|
+
O._elementType === "svg" ? w = !0 : O._elementType === "canvas" && (C = !0);
|
|
3034
|
+
}), w && !p.svg ? (p.svg = Cr("orbcharts-root-svg"), m().appendChild(p.svg), b.next(p.svg)) : !w && p.svg && (p.svg.remove(), p.svg = null, b.next(null)), C && !p.canvas ? (p.canvas = ft("orbcharts-root-canvas"), m().appendChild(p.canvas), _.next(p.canvas)) : !C && p.canvas && (p.canvas.remove(), p.canvas = null, _.next(null)), h.forEach((O) => {
|
|
3035
|
+
O._injectContext(p);
|
|
3034
3036
|
});
|
|
3035
|
-
}),
|
|
3036
|
-
size:
|
|
3037
|
+
}), Z({
|
|
3038
|
+
size: p.size$,
|
|
3037
3039
|
svg: b
|
|
3038
3040
|
}).pipe(
|
|
3039
3041
|
G(0),
|
|
3040
|
-
ye(({ svg:
|
|
3041
|
-
).subscribe(({ size:
|
|
3042
|
-
|
|
3043
|
-
}),
|
|
3044
|
-
size:
|
|
3045
|
-
canvas:
|
|
3042
|
+
ye(({ svg: h }) => !!h)
|
|
3043
|
+
).subscribe(({ size: h, svg: w }) => {
|
|
3044
|
+
w && (w.setAttribute("width", h.width.toString()), w.setAttribute("height", h.height.toString()));
|
|
3045
|
+
}), Z({
|
|
3046
|
+
size: p.size$,
|
|
3047
|
+
canvas: _
|
|
3046
3048
|
}).pipe(
|
|
3047
3049
|
G(0),
|
|
3048
|
-
ye(({ canvas:
|
|
3049
|
-
).subscribe(({ size:
|
|
3050
|
-
|
|
3050
|
+
ye(({ canvas: h }) => !!h)
|
|
3051
|
+
).subscribe(({ size: h, canvas: w }) => {
|
|
3052
|
+
w && (w.width = h.width, w.height = h.height);
|
|
3051
3053
|
}), /* @__PURE__ */ (() => {
|
|
3052
|
-
function
|
|
3053
|
-
|
|
3054
|
+
function h(d) {
|
|
3055
|
+
f.next(d);
|
|
3054
3056
|
}
|
|
3055
|
-
function
|
|
3057
|
+
function w(d) {
|
|
3056
3058
|
try {
|
|
3057
|
-
const { status:
|
|
3058
|
-
if (
|
|
3059
|
-
throw new Error(
|
|
3059
|
+
const { status: x, columnName: S, expectToBe: T } = dt(d);
|
|
3060
|
+
if (x === "error")
|
|
3061
|
+
throw new Error(J({
|
|
3060
3062
|
columnName: S,
|
|
3061
|
-
expectToBe:
|
|
3063
|
+
expectToBe: T,
|
|
3062
3064
|
from: "Chart.setData"
|
|
3063
3065
|
}));
|
|
3064
|
-
|
|
3066
|
+
x === "warning" && console.warn(H({
|
|
3065
3067
|
columnName: S,
|
|
3066
|
-
expectToBe:
|
|
3068
|
+
expectToBe: T,
|
|
3067
3069
|
from: "Chart.setData"
|
|
3068
3070
|
}));
|
|
3069
|
-
} catch (
|
|
3070
|
-
console.error(z(
|
|
3071
|
+
} catch (x) {
|
|
3072
|
+
console.error(z(x));
|
|
3071
3073
|
}
|
|
3072
|
-
n.next(
|
|
3074
|
+
n.next(d);
|
|
3073
3075
|
}
|
|
3074
|
-
function d
|
|
3076
|
+
function C(d) {
|
|
3075
3077
|
try {
|
|
3076
|
-
const { status: S, columnName:
|
|
3078
|
+
const { status: S, columnName: T, expectToBe: P } = pt(d);
|
|
3077
3079
|
if (S === "error")
|
|
3078
|
-
throw new Error(
|
|
3079
|
-
columnName:
|
|
3080
|
-
expectToBe:
|
|
3080
|
+
throw new Error(J({
|
|
3081
|
+
columnName: T,
|
|
3082
|
+
expectToBe: P,
|
|
3081
3083
|
from: "Chart.updateEncoding"
|
|
3082
3084
|
}));
|
|
3083
|
-
S === "warning" && console.warn(
|
|
3084
|
-
columnName:
|
|
3085
|
-
expectToBe:
|
|
3085
|
+
S === "warning" && console.warn(H({
|
|
3086
|
+
columnName: T,
|
|
3087
|
+
expectToBe: P,
|
|
3086
3088
|
from: "Chart.updateEncoding"
|
|
3087
3089
|
}));
|
|
3088
3090
|
} catch (S) {
|
|
3089
3091
|
console.error(z(S));
|
|
3090
3092
|
}
|
|
3091
|
-
const
|
|
3092
|
-
s.next(
|
|
3093
|
+
const x = W(s.getValue(), d);
|
|
3094
|
+
s.next(x);
|
|
3093
3095
|
}
|
|
3094
|
-
function
|
|
3095
|
-
s.next(
|
|
3096
|
+
function O(d) {
|
|
3097
|
+
s.next(d);
|
|
3096
3098
|
}
|
|
3097
|
-
function
|
|
3099
|
+
function y() {
|
|
3098
3100
|
return s.getValue();
|
|
3099
3101
|
}
|
|
3100
|
-
function
|
|
3102
|
+
function g(d) {
|
|
3101
3103
|
try {
|
|
3102
|
-
const { status:
|
|
3103
|
-
if (
|
|
3104
|
-
throw new Error(
|
|
3104
|
+
const { status: x, columnName: S, expectToBe: T } = $e(d);
|
|
3105
|
+
if (x === "error")
|
|
3106
|
+
throw new Error(J({
|
|
3105
3107
|
columnName: S,
|
|
3106
|
-
expectToBe:
|
|
3108
|
+
expectToBe: T,
|
|
3107
3109
|
from: "Chart.setPlugins"
|
|
3108
3110
|
}));
|
|
3109
|
-
|
|
3111
|
+
x === "warning" && console.warn(H({
|
|
3110
3112
|
columnName: S,
|
|
3111
|
-
expectToBe:
|
|
3113
|
+
expectToBe: T,
|
|
3112
3114
|
from: "Chart.setPlugins"
|
|
3113
3115
|
}));
|
|
3114
|
-
} catch (
|
|
3115
|
-
console.error(z(
|
|
3116
|
+
} catch (x) {
|
|
3117
|
+
console.error(z(x));
|
|
3116
3118
|
}
|
|
3117
|
-
l.next(
|
|
3119
|
+
l.next(d);
|
|
3118
3120
|
}
|
|
3119
|
-
function
|
|
3121
|
+
function E(d) {
|
|
3120
3122
|
try {
|
|
3121
|
-
const { status:
|
|
3122
|
-
if (
|
|
3123
|
-
throw new Error(
|
|
3123
|
+
const { status: x, columnName: S, expectToBe: T } = $e([d]);
|
|
3124
|
+
if (x === "error")
|
|
3125
|
+
throw new Error(J({
|
|
3124
3126
|
columnName: S,
|
|
3125
|
-
expectToBe:
|
|
3127
|
+
expectToBe: T,
|
|
3126
3128
|
from: "Chart.addPlugin"
|
|
3127
3129
|
}));
|
|
3128
|
-
|
|
3130
|
+
x === "warning" && console.warn(H({
|
|
3129
3131
|
columnName: S,
|
|
3130
|
-
expectToBe:
|
|
3132
|
+
expectToBe: T,
|
|
3131
3133
|
from: "Chart.addPlugin"
|
|
3132
3134
|
}));
|
|
3133
|
-
} catch (
|
|
3134
|
-
console.error(z(
|
|
3135
|
+
} catch (x) {
|
|
3136
|
+
console.error(z(x));
|
|
3135
3137
|
}
|
|
3136
|
-
l.next([...l.getValue(),
|
|
3138
|
+
l.next([...l.getValue(), d]);
|
|
3137
3139
|
}
|
|
3138
|
-
function
|
|
3139
|
-
l.next(l.getValue().filter((
|
|
3140
|
+
function B(d) {
|
|
3141
|
+
l.next(l.getValue().filter((x) => x._getId() !== d));
|
|
3140
3142
|
}
|
|
3141
|
-
function
|
|
3143
|
+
function I(d) {
|
|
3142
3144
|
try {
|
|
3143
|
-
const { status: S, columnName:
|
|
3145
|
+
const { status: S, columnName: T, expectToBe: P } = yt(d);
|
|
3144
3146
|
if (S === "error")
|
|
3145
|
-
throw new Error(
|
|
3146
|
-
columnName:
|
|
3147
|
-
expectToBe:
|
|
3147
|
+
throw new Error(J({
|
|
3148
|
+
columnName: T,
|
|
3149
|
+
expectToBe: P,
|
|
3148
3150
|
from: "Chart.updateTheme"
|
|
3149
3151
|
}));
|
|
3150
|
-
S === "warning" && console.warn(
|
|
3151
|
-
columnName:
|
|
3152
|
-
expectToBe:
|
|
3152
|
+
S === "warning" && console.warn(H({
|
|
3153
|
+
columnName: T,
|
|
3154
|
+
expectToBe: P,
|
|
3153
3155
|
from: "Chart.updateTheme"
|
|
3154
3156
|
}));
|
|
3155
3157
|
} catch (S) {
|
|
3156
3158
|
console.error(z(S));
|
|
3157
3159
|
}
|
|
3158
|
-
const
|
|
3159
|
-
a.next(
|
|
3160
|
+
const x = W(a.getValue(), d);
|
|
3161
|
+
a.next(x);
|
|
3160
3162
|
}
|
|
3161
|
-
function
|
|
3162
|
-
a.next(
|
|
3163
|
+
function c(d) {
|
|
3164
|
+
a.next(d);
|
|
3163
3165
|
}
|
|
3164
|
-
function
|
|
3166
|
+
function v() {
|
|
3165
3167
|
return a.getValue();
|
|
3166
3168
|
}
|
|
3167
|
-
function
|
|
3168
|
-
r.next(void 0), Pr(t);
|
|
3169
|
+
function $() {
|
|
3170
|
+
r.next(void 0), Pr(t), A = null;
|
|
3169
3171
|
}
|
|
3170
3172
|
return {
|
|
3171
|
-
resize:
|
|
3172
|
-
setData:
|
|
3173
|
+
resize: h,
|
|
3174
|
+
setData: w,
|
|
3173
3175
|
// setEncoding,
|
|
3174
|
-
updateEncoding:
|
|
3175
|
-
forceReplaceEncoding:
|
|
3176
|
-
getEncoding:
|
|
3177
|
-
setPlugins:
|
|
3178
|
-
addPlugin:
|
|
3179
|
-
removePlugin:
|
|
3176
|
+
updateEncoding: C,
|
|
3177
|
+
forceReplaceEncoding: O,
|
|
3178
|
+
getEncoding: y,
|
|
3179
|
+
setPlugins: g,
|
|
3180
|
+
addPlugin: E,
|
|
3181
|
+
removePlugin: B,
|
|
3180
3182
|
// setTheme,
|
|
3181
|
-
updateTheme:
|
|
3182
|
-
forceReplaceTheme:
|
|
3183
|
-
getTheme:
|
|
3184
|
-
destroy:
|
|
3185
|
-
context:
|
|
3183
|
+
updateTheme: I,
|
|
3184
|
+
forceReplaceTheme: c,
|
|
3185
|
+
getTheme: v,
|
|
3186
|
+
destroy: $,
|
|
3187
|
+
context: p
|
|
3186
3188
|
};
|
|
3187
3189
|
})();
|
|
3188
3190
|
};
|
|
@@ -3195,100 +3197,104 @@ const mt = (t, e, r) => {
|
|
|
3195
3197
|
let n = e.name, o = () => {
|
|
3196
3198
|
};
|
|
3197
3199
|
const s = new D(null), u = s.pipe(
|
|
3198
|
-
ye((
|
|
3199
|
-
), a = {
|
|
3200
|
+
ye((y) => y !== null)
|
|
3201
|
+
), a = e.layers.map((y) => new y()), l = {
|
|
3200
3202
|
// 將陣列轉成字典
|
|
3201
|
-
...
|
|
3202
|
-
},
|
|
3203
|
-
if (
|
|
3204
|
-
const
|
|
3205
|
-
return Object.keys(
|
|
3203
|
+
...a.reduce((y, g) => (y[g._name] = g, y), {})
|
|
3204
|
+
}, i = () => new Set(a.map((y) => y._name)), f = (y) => {
|
|
3205
|
+
if (y) {
|
|
3206
|
+
const g = i();
|
|
3207
|
+
return Object.keys(y).filter((B) => g.has(B));
|
|
3206
3208
|
}
|
|
3207
3209
|
return [];
|
|
3208
|
-
},
|
|
3209
|
-
new Set(
|
|
3210
|
-
),
|
|
3211
|
-
q((
|
|
3212
|
-
var
|
|
3210
|
+
}, b = a.reduce((y, g) => (g._initShow && y.push(g._name), y), []), _ = f(r), p = new D(
|
|
3211
|
+
new Set(_.length > 0 ? _ : b)
|
|
3212
|
+
), A = p.pipe(
|
|
3213
|
+
q((y) => Array.from(y).map((E) => {
|
|
3214
|
+
var B;
|
|
3213
3215
|
return [
|
|
3214
|
-
|
|
3215
|
-
((
|
|
3216
|
+
E,
|
|
3217
|
+
((B = a.find((I) => I._name === E)) == null ? void 0 : B._layerIndex) ?? -1
|
|
3216
3218
|
];
|
|
3217
|
-
}).filter(([,
|
|
3218
|
-
)
|
|
3219
|
+
}).filter(([, E]) => E !== -1).sort((E, B) => E[1] - B[1]).map(([E]) => E))
|
|
3220
|
+
);
|
|
3221
|
+
let m = W(
|
|
3222
|
+
e.defaultParams ?? {},
|
|
3219
3223
|
r ?? {}
|
|
3220
|
-
)
|
|
3221
|
-
|
|
3224
|
+
);
|
|
3225
|
+
const h = new D(
|
|
3226
|
+
r ?? {}
|
|
3227
|
+
), w = new oe(), C = new R((y) => {
|
|
3228
|
+
h.subscribe((g) => {
|
|
3222
3229
|
try {
|
|
3223
|
-
const { status:
|
|
3224
|
-
if (
|
|
3225
|
-
throw new Error(
|
|
3226
|
-
columnName:
|
|
3227
|
-
expectToBe:
|
|
3230
|
+
const { status: E, columnName: B, expectToBe: I } = e.validator(g);
|
|
3231
|
+
if (E === "error")
|
|
3232
|
+
throw new Error(J({
|
|
3233
|
+
columnName: B,
|
|
3234
|
+
expectToBe: I,
|
|
3228
3235
|
from: `${e.name}.params$`
|
|
3229
3236
|
}));
|
|
3230
|
-
|
|
3231
|
-
columnName:
|
|
3232
|
-
expectToBe:
|
|
3237
|
+
E === "warning" && console.warn(H({
|
|
3238
|
+
columnName: B,
|
|
3239
|
+
expectToBe: I,
|
|
3233
3240
|
from: `${e.name}.params$`
|
|
3234
3241
|
}));
|
|
3235
|
-
} catch (
|
|
3236
|
-
console.error(z(
|
|
3242
|
+
} catch (E) {
|
|
3243
|
+
console.error(z(E));
|
|
3237
3244
|
}
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
p.next(_);
|
|
3245
|
+
y.next(m);
|
|
3246
|
+
}), w.subscribe((g) => {
|
|
3247
|
+
y.next(g);
|
|
3242
3248
|
});
|
|
3243
|
-
}),
|
|
3244
|
-
q((
|
|
3245
|
-
context:
|
|
3249
|
+
}), O = u.pipe(
|
|
3250
|
+
q((y) => ({
|
|
3251
|
+
context: y,
|
|
3246
3252
|
// 初始化時 context 有可能被 in place 擴展
|
|
3247
|
-
pluginParams$:
|
|
3253
|
+
pluginParams$: C
|
|
3248
3254
|
})),
|
|
3249
3255
|
gr()
|
|
3250
3256
|
// 只做初始化
|
|
3251
3257
|
);
|
|
3252
|
-
return
|
|
3253
|
-
pluginSetupProps:
|
|
3254
|
-
ShownLayerNameSet:
|
|
3255
|
-
shownLayerNamesSeq:
|
|
3258
|
+
return Z({
|
|
3259
|
+
pluginSetupProps: O,
|
|
3260
|
+
ShownLayerNameSet: p,
|
|
3261
|
+
shownLayerNamesSeq: A
|
|
3256
3262
|
}).pipe(
|
|
3257
3263
|
G(0)
|
|
3258
|
-
).subscribe(({ pluginSetupProps:
|
|
3259
|
-
const
|
|
3264
|
+
).subscribe(({ pluginSetupProps: y, ShownLayerNameSet: g, shownLayerNamesSeq: E }) => {
|
|
3265
|
+
const B = y.context._updateLayerElements(
|
|
3260
3266
|
t,
|
|
3261
3267
|
n,
|
|
3262
|
-
|
|
3268
|
+
E.map((I) => ({
|
|
3263
3269
|
pluginId: n,
|
|
3264
3270
|
pluginName: e.name,
|
|
3265
|
-
layerName:
|
|
3266
|
-
layerIndex:
|
|
3271
|
+
layerName: I,
|
|
3272
|
+
layerIndex: l[I]._layerIndex
|
|
3267
3273
|
}))
|
|
3268
3274
|
);
|
|
3269
|
-
e.setup && (o = e.setup(
|
|
3270
|
-
var
|
|
3271
|
-
if (
|
|
3272
|
-
const
|
|
3275
|
+
e.setup && (o = e.setup(y)), a.forEach((I) => {
|
|
3276
|
+
var c, v;
|
|
3277
|
+
if (g.has(I._name)) {
|
|
3278
|
+
const $ = t === "svg" ? {
|
|
3273
3279
|
// svgG: (pluginSetupProps as PluginSetupProps<'svg', ExtendContext, PluginParams>).svgG.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3274
|
-
svgG:
|
|
3280
|
+
svgG: B[I._name],
|
|
3275
3281
|
// canvas: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3276
3282
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3277
|
-
context:
|
|
3278
|
-
pluginParams$:
|
|
3279
|
-
initLayerParams: ((
|
|
3283
|
+
context: y.context,
|
|
3284
|
+
pluginParams$: C,
|
|
3285
|
+
initLayerParams: ((c = h.getValue()) == null ? void 0 : c[I._name]) || {}
|
|
3280
3286
|
} : {
|
|
3281
3287
|
// svgG: context.root.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3282
3288
|
// canvas: (pluginSetupProps as PluginSetupProps<'canvas', ExtendContext, PluginParams>).canvas.querySelector(`.${createLayerClassName(config.name, layer.name)}`),
|
|
3283
|
-
canvas:
|
|
3289
|
+
canvas: B[I._name],
|
|
3284
3290
|
// context: Object.assign({}, context) as ChartContext<ExtendContext>,
|
|
3285
|
-
context:
|
|
3286
|
-
pluginParams$:
|
|
3287
|
-
initLayerParams: ((
|
|
3291
|
+
context: y.context,
|
|
3292
|
+
pluginParams$: C,
|
|
3293
|
+
initLayerParams: ((v = h.getValue()) == null ? void 0 : v[I._name]) || {}
|
|
3288
3294
|
};
|
|
3289
|
-
|
|
3295
|
+
I._enable($);
|
|
3290
3296
|
} else
|
|
3291
|
-
|
|
3297
|
+
I._disable();
|
|
3292
3298
|
});
|
|
3293
3299
|
}), {
|
|
3294
3300
|
// name: `${config.name}-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -3302,51 +3308,56 @@ const mt = (t, e, r) => {
|
|
|
3302
3308
|
// contextExtension,
|
|
3303
3309
|
// layer visibility controls
|
|
3304
3310
|
_getId: () => n,
|
|
3305
|
-
_setId: (
|
|
3306
|
-
n =
|
|
3311
|
+
_setId: (y) => {
|
|
3312
|
+
n = y;
|
|
3307
3313
|
},
|
|
3308
3314
|
// 由 chart 注入 context
|
|
3309
|
-
_injectContext: (
|
|
3310
|
-
s.next(Object.assign({},
|
|
3315
|
+
_injectContext: (y) => {
|
|
3316
|
+
s.next(Object.assign({}, y));
|
|
3311
3317
|
},
|
|
3312
|
-
show: (
|
|
3313
|
-
|
|
3318
|
+
show: (y) => {
|
|
3319
|
+
y = Array.isArray(y) ? y : [y], p.next(/* @__PURE__ */ new Set([...Array.from(p.getValue()), ...y]));
|
|
3314
3320
|
},
|
|
3315
|
-
showOnly: (
|
|
3316
|
-
|
|
3321
|
+
showOnly: (y) => {
|
|
3322
|
+
y = Array.isArray(y) ? y : [y], p.next(/* @__PURE__ */ new Set([...y]));
|
|
3317
3323
|
},
|
|
3318
3324
|
showAll: () => {
|
|
3319
|
-
|
|
3325
|
+
p.next(i());
|
|
3320
3326
|
},
|
|
3321
|
-
hide: (
|
|
3322
|
-
|
|
3327
|
+
hide: (y) => {
|
|
3328
|
+
y = Array.isArray(y) ? y : [y], p.next(/* @__PURE__ */ new Set([...Array.from(p.getValue()).filter((g) => !y.includes(g))]));
|
|
3323
3329
|
},
|
|
3324
3330
|
hideAll: () => {
|
|
3325
|
-
|
|
3331
|
+
p.next(/* @__PURE__ */ new Set());
|
|
3326
3332
|
},
|
|
3327
|
-
toggle: (
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
}),
|
|
3333
|
+
toggle: (y) => {
|
|
3334
|
+
y = Array.isArray(y) ? y : [y], Array.from(p.getValue()).forEach((g) => {
|
|
3335
|
+
y.includes(g) ? y.splice(y.indexOf(g), 1) : y.push(g);
|
|
3336
|
+
}), p.next(new Set(y));
|
|
3331
3337
|
},
|
|
3332
|
-
getShownLayerNames: () => Array.from(
|
|
3338
|
+
getShownLayerNames: () => Array.from(p.getValue()),
|
|
3333
3339
|
// layer params
|
|
3334
3340
|
// setLayers: (partial: DeepPartial<PluginParams>) => {
|
|
3335
3341
|
// params = { ...params, ...partial }
|
|
3336
3342
|
// },
|
|
3337
|
-
updateParams: (
|
|
3338
|
-
|
|
3339
|
-
const
|
|
3340
|
-
|
|
3343
|
+
updateParams: (y) => {
|
|
3344
|
+
m = W(m, y), h.next(y), Object.keys(y).forEach((g) => {
|
|
3345
|
+
const E = l[g];
|
|
3346
|
+
E && E._updateParams(y[g]);
|
|
3341
3347
|
});
|
|
3342
3348
|
},
|
|
3343
|
-
forceReplaceParams: (
|
|
3344
|
-
y.next(
|
|
3345
|
-
const
|
|
3346
|
-
|
|
3349
|
+
forceReplaceParams: (y) => {
|
|
3350
|
+
m = y, w.next(y), Object.keys(y).forEach((g) => {
|
|
3351
|
+
const E = l[g];
|
|
3352
|
+
E && E._forceReplaceParams(y[g]);
|
|
3347
3353
|
});
|
|
3348
3354
|
},
|
|
3349
|
-
getParams: () =>
|
|
3355
|
+
getParams: () => {
|
|
3356
|
+
const y = Object.assign({}, m);
|
|
3357
|
+
return a.forEach((g) => {
|
|
3358
|
+
y[g._name] = g._getParams();
|
|
3359
|
+
}), y;
|
|
3360
|
+
},
|
|
3350
3361
|
// layer: <LayerName extends keyof PluginParams>(name: LayerName) => ({
|
|
3351
3362
|
// // set: (partial: DeepPartial<PluginParams[LayerName]>) => {
|
|
3352
3363
|
// // if (params[name]) {
|
|
@@ -3372,8 +3383,8 @@ const mt = (t, e, r) => {
|
|
|
3372
3383
|
// }
|
|
3373
3384
|
// }),
|
|
3374
3385
|
destroy: () => {
|
|
3375
|
-
o(), s.complete(),
|
|
3376
|
-
|
|
3386
|
+
o(), s.complete(), p.complete(), a.forEach((y) => {
|
|
3387
|
+
y._destroy();
|
|
3377
3388
|
});
|
|
3378
3389
|
}
|
|
3379
3390
|
// // outputs
|
|
@@ -3392,7 +3403,7 @@ const mt = (t, e, r) => {
|
|
|
3392
3403
|
const o = new D(null), s = o.pipe(
|
|
3393
3404
|
ye((u) => u !== null)
|
|
3394
3405
|
);
|
|
3395
|
-
return
|
|
3406
|
+
return Z({
|
|
3396
3407
|
layerParams: r,
|
|
3397
3408
|
enabledProps: s
|
|
3398
3409
|
}).pipe(
|
|
@@ -3405,7 +3416,7 @@ const mt = (t, e, r) => {
|
|
|
3405
3416
|
context: a.context,
|
|
3406
3417
|
pluginParams$: a.pluginParams$,
|
|
3407
3418
|
layerParams$: r.pipe(
|
|
3408
|
-
q((l) =>
|
|
3419
|
+
q((l) => W(l, a.initLayerParams ?? {}))
|
|
3409
3420
|
)
|
|
3410
3421
|
}) : e.setup({
|
|
3411
3422
|
// svgG: enabledProps.svgG,
|
|
@@ -3414,7 +3425,7 @@ const mt = (t, e, r) => {
|
|
|
3414
3425
|
context: a.context,
|
|
3415
3426
|
pluginParams$: a.pluginParams$,
|
|
3416
3427
|
layerParams$: r.pipe(
|
|
3417
|
-
q((l) =>
|
|
3428
|
+
q((l) => W(l, a.initLayerParams ?? {}))
|
|
3418
3429
|
)
|
|
3419
3430
|
});
|
|
3420
3431
|
}), o.pipe(ye((u) => u === null)).subscribe(() => {
|
|
@@ -3435,22 +3446,22 @@ const mt = (t, e, r) => {
|
|
|
3435
3446
|
// },
|
|
3436
3447
|
_updateParams: (u) => {
|
|
3437
3448
|
try {
|
|
3438
|
-
const { status: l, columnName: i, expectToBe:
|
|
3449
|
+
const { status: l, columnName: i, expectToBe: f } = e.validator(u);
|
|
3439
3450
|
if (l === "error")
|
|
3440
|
-
throw new Error(
|
|
3451
|
+
throw new Error(J({
|
|
3441
3452
|
columnName: i,
|
|
3442
|
-
expectToBe:
|
|
3453
|
+
expectToBe: f,
|
|
3443
3454
|
from: `${e.name}.params$`
|
|
3444
3455
|
}));
|
|
3445
|
-
l === "warning" && console.warn(
|
|
3456
|
+
l === "warning" && console.warn(H({
|
|
3446
3457
|
columnName: i,
|
|
3447
|
-
expectToBe:
|
|
3458
|
+
expectToBe: f,
|
|
3448
3459
|
from: `${e.name}.params$`
|
|
3449
3460
|
}));
|
|
3450
3461
|
} catch (l) {
|
|
3451
3462
|
console.error(z(l));
|
|
3452
3463
|
}
|
|
3453
|
-
const a =
|
|
3464
|
+
const a = W(r.getValue(), u);
|
|
3454
3465
|
r.next(a);
|
|
3455
3466
|
},
|
|
3456
3467
|
_forceReplaceParams: (u) => {
|
|
@@ -3486,22 +3497,22 @@ export {
|
|
|
3486
3497
|
ft as createCanvas,
|
|
3487
3498
|
Zr as createCanvasElement,
|
|
3488
3499
|
Jr as createDiv,
|
|
3489
|
-
|
|
3500
|
+
Mr as createLayerClassName,
|
|
3490
3501
|
ht as createMessagePrefix,
|
|
3491
3502
|
z as createOrbChartsErrorMessage,
|
|
3492
|
-
|
|
3503
|
+
kr as createPluginClassName,
|
|
3493
3504
|
Cr as createSVG,
|
|
3494
3505
|
Br as createSVGGroup,
|
|
3495
3506
|
fe as createUnexpectedErrorMessage,
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3507
|
+
J as createValidatorErrorMessage,
|
|
3508
|
+
H as createValidatorWarningMessage,
|
|
3509
|
+
W as deepOverwrite,
|
|
3499
3510
|
on as defineCanvasLayer,
|
|
3500
3511
|
rn as defineCanvasPlugin,
|
|
3501
3512
|
en as defineSVGLayer,
|
|
3502
3513
|
Qr as defineSVGPlugin,
|
|
3503
3514
|
Yr as formatCommaNumber,
|
|
3504
|
-
|
|
3515
|
+
F as getColorByFrom,
|
|
3505
3516
|
Or as getColorByIndex,
|
|
3506
3517
|
ct as isDom,
|
|
3507
3518
|
Ir as isFunction,
|
|
@@ -3512,7 +3523,7 @@ export {
|
|
|
3512
3523
|
Sr as min,
|
|
3513
3524
|
Tr as none,
|
|
3514
3525
|
Pr as removeElementChildren,
|
|
3515
|
-
|
|
3526
|
+
jr as resizeObservable,
|
|
3516
3527
|
Er as sum,
|
|
3517
3528
|
V as validateObject
|
|
3518
3529
|
};
|