tvcharts 0.5.75 → 0.5.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/echarts.js +190 -78
- package/dist/echarts.js.map +2 -2
- package/lib/component/axis/AxisBuilder.js +10 -26
- package/lib/component/axisPointer/axisTrigger.js +4 -1
- package/lib/component/marker/MarkLabelView.js +22 -13
- package/lib/core/echarts.js +65 -2
- package/lib/scale/Ordinal.js +7 -1
- package/lib/util/states.js +31 -0
- package/package.json +1 -1
- package/types/dist/echarts.d.ts +2314 -2297
- package/types/dist/shared.d.ts +2314 -2297
- package/types/src/core/echarts.d.ts +16 -0
- package/types/src/scale/Ordinal.d.ts +1 -0
- package/types/src/util/states.d.ts +10 -0
- package/types/src/util/types.d.ts +1 -0
package/dist/echarts.js
CHANGED
|
@@ -2128,9 +2128,9 @@ function isHover(displayable, x, y) {
|
|
|
2128
2128
|
if (clipPath && !clipPath.contain(x, y)) {
|
|
2129
2129
|
return false;
|
|
2130
2130
|
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2131
|
+
}
|
|
2132
|
+
if (el.silent) {
|
|
2133
|
+
isSilent = true;
|
|
2134
2134
|
}
|
|
2135
2135
|
const hostEl = el.__hostTarget;
|
|
2136
2136
|
el = hostEl ? hostEl : el.parent;
|
|
@@ -2161,7 +2161,6 @@ var Handler_default = Handler;
|
|
|
2161
2161
|
// node_modules/zrender/src/core/timsort.ts
|
|
2162
2162
|
var DEFAULT_MIN_MERGE = 32;
|
|
2163
2163
|
var DEFAULT_MIN_GALLOPING = 7;
|
|
2164
|
-
var DEFAULT_TMP_STORAGE_LENGTH = 256;
|
|
2165
2164
|
function minRunLength(n) {
|
|
2166
2165
|
var r = 0;
|
|
2167
2166
|
while (n >= DEFAULT_MIN_MERGE) {
|
|
@@ -2322,18 +2321,10 @@ function gallopRight(value, array, start2, length2, hint, compare2) {
|
|
|
2322
2321
|
}
|
|
2323
2322
|
function TimSort(array, compare2) {
|
|
2324
2323
|
let minGallop = DEFAULT_MIN_GALLOPING;
|
|
2325
|
-
let length2 = 0;
|
|
2326
|
-
let tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
|
|
2327
|
-
let stackLength = 0;
|
|
2328
2324
|
let runStart;
|
|
2329
2325
|
let runLength;
|
|
2330
2326
|
let stackSize = 0;
|
|
2331
|
-
length2 = array.length;
|
|
2332
|
-
if (length2 < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
|
|
2333
|
-
tmpStorageLength = length2 >>> 1;
|
|
2334
|
-
}
|
|
2335
2327
|
var tmp = [];
|
|
2336
|
-
stackLength = length2 < 120 ? 5 : length2 < 1542 ? 10 : length2 < 119151 ? 19 : 40;
|
|
2337
2328
|
runStart = [];
|
|
2338
2329
|
runLength = [];
|
|
2339
2330
|
function pushRun(_runStart, _runLength) {
|
|
@@ -2367,8 +2358,8 @@ function TimSort(array, compare2) {
|
|
|
2367
2358
|
var start1 = runStart[i];
|
|
2368
2359
|
var length1 = runLength[i];
|
|
2369
2360
|
var start2 = runStart[i + 1];
|
|
2370
|
-
var
|
|
2371
|
-
runLength[i] = length1 +
|
|
2361
|
+
var length2 = runLength[i + 1];
|
|
2362
|
+
runLength[i] = length1 + length2;
|
|
2372
2363
|
if (i === stackSize - 3) {
|
|
2373
2364
|
runStart[i + 1] = runStart[i + 2];
|
|
2374
2365
|
runLength[i + 1] = runLength[i + 2];
|
|
@@ -2380,17 +2371,17 @@ function TimSort(array, compare2) {
|
|
|
2380
2371
|
if (length1 === 0) {
|
|
2381
2372
|
return;
|
|
2382
2373
|
}
|
|
2383
|
-
|
|
2384
|
-
if (
|
|
2374
|
+
length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare2);
|
|
2375
|
+
if (length2 === 0) {
|
|
2385
2376
|
return;
|
|
2386
2377
|
}
|
|
2387
|
-
if (length1 <=
|
|
2388
|
-
mergeLow(start1, length1, start2,
|
|
2378
|
+
if (length1 <= length2) {
|
|
2379
|
+
mergeLow(start1, length1, start2, length2);
|
|
2389
2380
|
} else {
|
|
2390
|
-
mergeHigh(start1, length1, start2,
|
|
2381
|
+
mergeHigh(start1, length1, start2, length2);
|
|
2391
2382
|
}
|
|
2392
2383
|
}
|
|
2393
|
-
function mergeLow(start1, length1, start2,
|
|
2384
|
+
function mergeLow(start1, length1, start2, length2) {
|
|
2394
2385
|
var i = 0;
|
|
2395
2386
|
for (i = 0; i < length1; i++) {
|
|
2396
2387
|
tmp[i] = array[start1 + i];
|
|
@@ -2399,17 +2390,17 @@ function TimSort(array, compare2) {
|
|
|
2399
2390
|
var cursor2 = start2;
|
|
2400
2391
|
var dest = start1;
|
|
2401
2392
|
array[dest++] = array[cursor2++];
|
|
2402
|
-
if (--
|
|
2393
|
+
if (--length2 === 0) {
|
|
2403
2394
|
for (i = 0; i < length1; i++) {
|
|
2404
2395
|
array[dest + i] = tmp[cursor1 + i];
|
|
2405
2396
|
}
|
|
2406
2397
|
return;
|
|
2407
2398
|
}
|
|
2408
2399
|
if (length1 === 1) {
|
|
2409
|
-
for (i = 0; i <
|
|
2400
|
+
for (i = 0; i < length2; i++) {
|
|
2410
2401
|
array[dest + i] = array[cursor2 + i];
|
|
2411
2402
|
}
|
|
2412
|
-
array[dest +
|
|
2403
|
+
array[dest + length2] = tmp[cursor1];
|
|
2413
2404
|
return;
|
|
2414
2405
|
}
|
|
2415
2406
|
var _minGallop = minGallop;
|
|
@@ -2425,7 +2416,7 @@ function TimSort(array, compare2) {
|
|
|
2425
2416
|
array[dest++] = array[cursor2++];
|
|
2426
2417
|
count2++;
|
|
2427
2418
|
count1 = 0;
|
|
2428
|
-
if (--
|
|
2419
|
+
if (--length2 === 0) {
|
|
2429
2420
|
exit = true;
|
|
2430
2421
|
break;
|
|
2431
2422
|
}
|
|
@@ -2457,19 +2448,19 @@ function TimSort(array, compare2) {
|
|
|
2457
2448
|
}
|
|
2458
2449
|
}
|
|
2459
2450
|
array[dest++] = array[cursor2++];
|
|
2460
|
-
if (--
|
|
2451
|
+
if (--length2 === 0) {
|
|
2461
2452
|
exit = true;
|
|
2462
2453
|
break;
|
|
2463
2454
|
}
|
|
2464
|
-
count2 = gallopLeft(tmp[cursor1], array, cursor2,
|
|
2455
|
+
count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare2);
|
|
2465
2456
|
if (count2 !== 0) {
|
|
2466
2457
|
for (i = 0; i < count2; i++) {
|
|
2467
2458
|
array[dest + i] = array[cursor2 + i];
|
|
2468
2459
|
}
|
|
2469
2460
|
dest += count2;
|
|
2470
2461
|
cursor2 += count2;
|
|
2471
|
-
|
|
2472
|
-
if (
|
|
2462
|
+
length2 -= count2;
|
|
2463
|
+
if (length2 === 0) {
|
|
2473
2464
|
exit = true;
|
|
2474
2465
|
break;
|
|
2475
2466
|
}
|
|
@@ -2492,10 +2483,10 @@ function TimSort(array, compare2) {
|
|
|
2492
2483
|
minGallop = _minGallop;
|
|
2493
2484
|
minGallop < 1 && (minGallop = 1);
|
|
2494
2485
|
if (length1 === 1) {
|
|
2495
|
-
for (i = 0; i <
|
|
2486
|
+
for (i = 0; i < length2; i++) {
|
|
2496
2487
|
array[dest + i] = array[cursor2 + i];
|
|
2497
2488
|
}
|
|
2498
|
-
array[dest +
|
|
2489
|
+
array[dest + length2] = tmp[cursor1];
|
|
2499
2490
|
} else if (length1 === 0) {
|
|
2500
2491
|
throw new Error();
|
|
2501
2492
|
} else {
|
|
@@ -2504,25 +2495,25 @@ function TimSort(array, compare2) {
|
|
|
2504
2495
|
}
|
|
2505
2496
|
}
|
|
2506
2497
|
}
|
|
2507
|
-
function mergeHigh(start1, length1, start2,
|
|
2498
|
+
function mergeHigh(start1, length1, start2, length2) {
|
|
2508
2499
|
var i = 0;
|
|
2509
|
-
for (i = 0; i <
|
|
2500
|
+
for (i = 0; i < length2; i++) {
|
|
2510
2501
|
tmp[i] = array[start2 + i];
|
|
2511
2502
|
}
|
|
2512
2503
|
var cursor1 = start1 + length1 - 1;
|
|
2513
|
-
var cursor2 =
|
|
2514
|
-
var dest = start2 +
|
|
2504
|
+
var cursor2 = length2 - 1;
|
|
2505
|
+
var dest = start2 + length2 - 1;
|
|
2515
2506
|
var customCursor = 0;
|
|
2516
2507
|
var customDest = 0;
|
|
2517
2508
|
array[dest--] = array[cursor1--];
|
|
2518
2509
|
if (--length1 === 0) {
|
|
2519
|
-
customCursor = dest - (
|
|
2520
|
-
for (i = 0; i <
|
|
2510
|
+
customCursor = dest - (length2 - 1);
|
|
2511
|
+
for (i = 0; i < length2; i++) {
|
|
2521
2512
|
array[customCursor + i] = tmp[i];
|
|
2522
2513
|
}
|
|
2523
2514
|
return;
|
|
2524
2515
|
}
|
|
2525
|
-
if (
|
|
2516
|
+
if (length2 === 1) {
|
|
2526
2517
|
dest -= length1;
|
|
2527
2518
|
cursor1 -= length1;
|
|
2528
2519
|
customDest = dest + 1;
|
|
@@ -2551,7 +2542,7 @@ function TimSort(array, compare2) {
|
|
|
2551
2542
|
array[dest--] = tmp[cursor2--];
|
|
2552
2543
|
count2++;
|
|
2553
2544
|
count1 = 0;
|
|
2554
|
-
if (--
|
|
2545
|
+
if (--length2 === 1) {
|
|
2555
2546
|
exit = true;
|
|
2556
2547
|
break;
|
|
2557
2548
|
}
|
|
@@ -2577,21 +2568,21 @@ function TimSort(array, compare2) {
|
|
|
2577
2568
|
}
|
|
2578
2569
|
}
|
|
2579
2570
|
array[dest--] = tmp[cursor2--];
|
|
2580
|
-
if (--
|
|
2571
|
+
if (--length2 === 1) {
|
|
2581
2572
|
exit = true;
|
|
2582
2573
|
break;
|
|
2583
2574
|
}
|
|
2584
|
-
count2 =
|
|
2575
|
+
count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare2);
|
|
2585
2576
|
if (count2 !== 0) {
|
|
2586
2577
|
dest -= count2;
|
|
2587
2578
|
cursor2 -= count2;
|
|
2588
|
-
|
|
2579
|
+
length2 -= count2;
|
|
2589
2580
|
customDest = dest + 1;
|
|
2590
2581
|
customCursor = cursor2 + 1;
|
|
2591
2582
|
for (i = 0; i < count2; i++) {
|
|
2592
2583
|
array[customDest + i] = tmp[customCursor + i];
|
|
2593
2584
|
}
|
|
2594
|
-
if (
|
|
2585
|
+
if (length2 <= 1) {
|
|
2595
2586
|
exit = true;
|
|
2596
2587
|
break;
|
|
2597
2588
|
}
|
|
@@ -2615,7 +2606,7 @@ function TimSort(array, compare2) {
|
|
|
2615
2606
|
if (minGallop < 1) {
|
|
2616
2607
|
minGallop = 1;
|
|
2617
2608
|
}
|
|
2618
|
-
if (
|
|
2609
|
+
if (length2 === 1) {
|
|
2619
2610
|
dest -= length1;
|
|
2620
2611
|
cursor1 -= length1;
|
|
2621
2612
|
customDest = dest + 1;
|
|
@@ -2624,11 +2615,11 @@ function TimSort(array, compare2) {
|
|
|
2624
2615
|
array[customDest + i] = array[customCursor + i];
|
|
2625
2616
|
}
|
|
2626
2617
|
array[dest] = tmp[cursor2];
|
|
2627
|
-
} else if (
|
|
2618
|
+
} else if (length2 === 0) {
|
|
2628
2619
|
throw new Error();
|
|
2629
2620
|
} else {
|
|
2630
|
-
customCursor = dest - (
|
|
2631
|
-
for (i = 0; i <
|
|
2621
|
+
customCursor = dest - (length2 - 1);
|
|
2622
|
+
for (i = 0; i < length2; i++) {
|
|
2632
2623
|
array[customCursor + i] = tmp[i];
|
|
2633
2624
|
}
|
|
2634
2625
|
}
|
|
@@ -5409,6 +5400,7 @@ var Transformable2 = class {
|
|
|
5409
5400
|
const parent = this.parent;
|
|
5410
5401
|
let m2 = this.transform;
|
|
5411
5402
|
if (parent && parent.transform) {
|
|
5403
|
+
parent.invTransform = parent.invTransform || create2();
|
|
5412
5404
|
mul2(tmpTransform, parent.invTransform, m2);
|
|
5413
5405
|
m2 = tmpTransform;
|
|
5414
5406
|
}
|
|
@@ -6905,7 +6897,7 @@ var ZRender = class {
|
|
|
6905
6897
|
const ssrMode = opts.ssr || painter.ssrOnly;
|
|
6906
6898
|
this.storage = storage2;
|
|
6907
6899
|
this.painter = painter;
|
|
6908
|
-
const
|
|
6900
|
+
const handlerProxy = !env_default.node && !env_default.worker && !ssrMode ? new HandlerProxy_default(painter.getViewportRoot(), painter.root) : null;
|
|
6909
6901
|
const useCoarsePointer = opts.useCoarsePointer;
|
|
6910
6902
|
const usePointerSize = useCoarsePointer == null || useCoarsePointer === "auto" ? env_default.touchEventsSupported : !!useCoarsePointer;
|
|
6911
6903
|
const defaultPointerSize = 44;
|
|
@@ -6913,7 +6905,7 @@ var ZRender = class {
|
|
|
6913
6905
|
if (usePointerSize) {
|
|
6914
6906
|
pointerSize = retrieve2(opts.pointerSize, defaultPointerSize);
|
|
6915
6907
|
}
|
|
6916
|
-
this.handler = new Handler_default(storage2, painter,
|
|
6908
|
+
this.handler = new Handler_default(storage2, painter, handlerProxy, painter.root, pointerSize);
|
|
6917
6909
|
this.animation = new Animation_default({
|
|
6918
6910
|
stage: {
|
|
6919
6911
|
update: ssrMode ? null : () => this._flush(true)
|
|
@@ -6924,7 +6916,7 @@ var ZRender = class {
|
|
|
6924
6916
|
}
|
|
6925
6917
|
}
|
|
6926
6918
|
add(el) {
|
|
6927
|
-
if (!el) {
|
|
6919
|
+
if (this._disposed || !el) {
|
|
6928
6920
|
return;
|
|
6929
6921
|
}
|
|
6930
6922
|
this.storage.addRoot(el);
|
|
@@ -6932,7 +6924,7 @@ var ZRender = class {
|
|
|
6932
6924
|
this.refresh();
|
|
6933
6925
|
}
|
|
6934
6926
|
remove(el) {
|
|
6935
|
-
if (!el) {
|
|
6927
|
+
if (this._disposed || !el) {
|
|
6936
6928
|
return;
|
|
6937
6929
|
}
|
|
6938
6930
|
this.storage.delRoot(el);
|
|
@@ -6940,12 +6932,18 @@ var ZRender = class {
|
|
|
6940
6932
|
this.refresh();
|
|
6941
6933
|
}
|
|
6942
6934
|
configLayer(zLevel, config) {
|
|
6935
|
+
if (this._disposed) {
|
|
6936
|
+
return;
|
|
6937
|
+
}
|
|
6943
6938
|
if (this.painter.configLayer) {
|
|
6944
6939
|
this.painter.configLayer(zLevel, config);
|
|
6945
6940
|
}
|
|
6946
6941
|
this.refresh();
|
|
6947
6942
|
}
|
|
6948
6943
|
setBackgroundColor(backgroundColor2) {
|
|
6944
|
+
if (this._disposed) {
|
|
6945
|
+
return;
|
|
6946
|
+
}
|
|
6949
6947
|
if (this.painter.setBackgroundColor) {
|
|
6950
6948
|
this.painter.setBackgroundColor(backgroundColor2);
|
|
6951
6949
|
}
|
|
@@ -6963,6 +6961,9 @@ var ZRender = class {
|
|
|
6963
6961
|
return this._darkMode;
|
|
6964
6962
|
}
|
|
6965
6963
|
refreshImmediately(fromInside) {
|
|
6964
|
+
if (this._disposed) {
|
|
6965
|
+
return;
|
|
6966
|
+
}
|
|
6966
6967
|
if (!fromInside) {
|
|
6967
6968
|
this.animation.update(true);
|
|
6968
6969
|
}
|
|
@@ -6971,10 +6972,16 @@ var ZRender = class {
|
|
|
6971
6972
|
this._needsRefresh = false;
|
|
6972
6973
|
}
|
|
6973
6974
|
refresh() {
|
|
6975
|
+
if (this._disposed) {
|
|
6976
|
+
return;
|
|
6977
|
+
}
|
|
6974
6978
|
this._needsRefresh = true;
|
|
6975
6979
|
this.animation.start();
|
|
6976
6980
|
}
|
|
6977
6981
|
flush() {
|
|
6982
|
+
if (this._disposed) {
|
|
6983
|
+
return;
|
|
6984
|
+
}
|
|
6978
6985
|
this._flush(false);
|
|
6979
6986
|
}
|
|
6980
6987
|
_flush(fromInside) {
|
|
@@ -7005,6 +7012,9 @@ var ZRender = class {
|
|
|
7005
7012
|
this._sleepAfterStill = stillFramesCount;
|
|
7006
7013
|
}
|
|
7007
7014
|
wakeUp() {
|
|
7015
|
+
if (this._disposed) {
|
|
7016
|
+
return;
|
|
7017
|
+
}
|
|
7008
7018
|
this.animation.start();
|
|
7009
7019
|
this._stillFrameAccum = 0;
|
|
7010
7020
|
}
|
|
@@ -7012,42 +7022,74 @@ var ZRender = class {
|
|
|
7012
7022
|
this._needsRefreshHover = true;
|
|
7013
7023
|
}
|
|
7014
7024
|
refreshHoverImmediately() {
|
|
7025
|
+
if (this._disposed) {
|
|
7026
|
+
return;
|
|
7027
|
+
}
|
|
7015
7028
|
this._needsRefreshHover = false;
|
|
7016
7029
|
if (this.painter.refreshHover && this.painter.getType() === "canvas") {
|
|
7017
7030
|
this.painter.refreshHover();
|
|
7018
7031
|
}
|
|
7019
7032
|
}
|
|
7020
7033
|
resize(opts) {
|
|
7034
|
+
if (this._disposed) {
|
|
7035
|
+
return;
|
|
7036
|
+
}
|
|
7021
7037
|
opts = opts || {};
|
|
7022
7038
|
this.painter.resize(opts.width, opts.height);
|
|
7023
7039
|
this.handler.resize();
|
|
7024
7040
|
}
|
|
7025
7041
|
clearAnimation() {
|
|
7042
|
+
if (this._disposed) {
|
|
7043
|
+
return;
|
|
7044
|
+
}
|
|
7026
7045
|
this.animation.clear();
|
|
7027
7046
|
}
|
|
7028
7047
|
getWidth() {
|
|
7048
|
+
if (this._disposed) {
|
|
7049
|
+
return;
|
|
7050
|
+
}
|
|
7029
7051
|
return this.painter.getWidth();
|
|
7030
7052
|
}
|
|
7031
7053
|
getHeight() {
|
|
7054
|
+
if (this._disposed) {
|
|
7055
|
+
return;
|
|
7056
|
+
}
|
|
7032
7057
|
return this.painter.getHeight();
|
|
7033
7058
|
}
|
|
7034
7059
|
setCursorStyle(cursorStyle) {
|
|
7060
|
+
if (this._disposed) {
|
|
7061
|
+
return;
|
|
7062
|
+
}
|
|
7035
7063
|
this.handler.setCursorStyle(cursorStyle);
|
|
7036
7064
|
}
|
|
7037
7065
|
findHover(x, y) {
|
|
7066
|
+
if (this._disposed) {
|
|
7067
|
+
return;
|
|
7068
|
+
}
|
|
7038
7069
|
return this.handler.findHover(x, y);
|
|
7039
7070
|
}
|
|
7040
7071
|
on(eventName, eventHandler, context) {
|
|
7041
|
-
this.
|
|
7072
|
+
if (!this._disposed) {
|
|
7073
|
+
this.handler.on(eventName, eventHandler, context);
|
|
7074
|
+
}
|
|
7042
7075
|
return this;
|
|
7043
7076
|
}
|
|
7044
7077
|
off(eventName, eventHandler) {
|
|
7078
|
+
if (this._disposed) {
|
|
7079
|
+
return;
|
|
7080
|
+
}
|
|
7045
7081
|
this.handler.off(eventName, eventHandler);
|
|
7046
7082
|
}
|
|
7047
7083
|
trigger(eventName, event) {
|
|
7084
|
+
if (this._disposed) {
|
|
7085
|
+
return;
|
|
7086
|
+
}
|
|
7048
7087
|
this.handler.trigger(eventName, event);
|
|
7049
7088
|
}
|
|
7050
7089
|
clear() {
|
|
7090
|
+
if (this._disposed) {
|
|
7091
|
+
return;
|
|
7092
|
+
}
|
|
7051
7093
|
const roots2 = this.storage.getRoots();
|
|
7052
7094
|
for (let i = 0; i < roots2.length; i++) {
|
|
7053
7095
|
if (roots2[i] instanceof Group_default) {
|
|
@@ -7058,12 +7100,16 @@ var ZRender = class {
|
|
|
7058
7100
|
this.painter.clear();
|
|
7059
7101
|
}
|
|
7060
7102
|
dispose() {
|
|
7103
|
+
if (this._disposed) {
|
|
7104
|
+
return;
|
|
7105
|
+
}
|
|
7061
7106
|
this.animation.stop();
|
|
7062
7107
|
this.clear();
|
|
7063
7108
|
this.storage.dispose();
|
|
7064
7109
|
this.painter.dispose();
|
|
7065
7110
|
this.handler.dispose();
|
|
7066
7111
|
this.animation = this.storage = this.painter = this.handler = null;
|
|
7112
|
+
this._disposed = true;
|
|
7067
7113
|
delInstance(this.id);
|
|
7068
7114
|
}
|
|
7069
7115
|
};
|
|
@@ -7089,9 +7135,7 @@ function getInstance(id) {
|
|
|
7089
7135
|
function registerPainter(name, Ctor) {
|
|
7090
7136
|
painterCtors[name] = Ctor;
|
|
7091
7137
|
}
|
|
7092
|
-
var ssrDataGetter
|
|
7093
|
-
return null;
|
|
7094
|
-
};
|
|
7138
|
+
var ssrDataGetter;
|
|
7095
7139
|
function getElementSSRData(el) {
|
|
7096
7140
|
if (typeof ssrDataGetter === "function") {
|
|
7097
7141
|
return ssrDataGetter(el);
|
|
@@ -7100,7 +7144,7 @@ function getElementSSRData(el) {
|
|
|
7100
7144
|
function registerSSRDataGetter(getter) {
|
|
7101
7145
|
ssrDataGetter = getter;
|
|
7102
7146
|
}
|
|
7103
|
-
var version = "5.
|
|
7147
|
+
var version = "5.5.0";
|
|
7104
7148
|
|
|
7105
7149
|
// src/util/number.ts
|
|
7106
7150
|
var RADIAN_EPSILON = 1e-4;
|
|
@@ -9449,7 +9493,6 @@ var PathProxy2 = class {
|
|
|
9449
9493
|
let delta = data[i++];
|
|
9450
9494
|
const endAngle = delta + startAngle;
|
|
9451
9495
|
i += 1;
|
|
9452
|
-
const anticlockwise = !data[i++];
|
|
9453
9496
|
if (isFirst) {
|
|
9454
9497
|
x0 = mathCos2(startAngle) * rx + cx;
|
|
9455
9498
|
y0 = mathSin2(startAngle) * ry + cy;
|
|
@@ -11715,6 +11758,27 @@ function getAllSelectedIndices(ecModel) {
|
|
|
11715
11758
|
});
|
|
11716
11759
|
return ret;
|
|
11717
11760
|
}
|
|
11761
|
+
function getSeriesPointData(ecModel, payload = {}) {
|
|
11762
|
+
const seriesPointData = [];
|
|
11763
|
+
ecModel.eachSeries(function(seriesModel) {
|
|
11764
|
+
const data = seriesModel.getData();
|
|
11765
|
+
const index = payload.dataIndex ?? data.count() - 1;
|
|
11766
|
+
const values = data.getValues(index);
|
|
11767
|
+
const style = data.getItemVisual(index, "style");
|
|
11768
|
+
const dim = seriesModel.subType === "candlestick" ? "close" : "y";
|
|
11769
|
+
const currentValue = data.get(dim, index);
|
|
11770
|
+
const prevValue = data.get(dim, index - 1);
|
|
11771
|
+
const changePercent = ((currentValue - prevValue) / prevValue * 100).toFixed(2) + "%";
|
|
11772
|
+
seriesPointData.push({
|
|
11773
|
+
name: seriesModel.name,
|
|
11774
|
+
data: values,
|
|
11775
|
+
color: style.fill,
|
|
11776
|
+
seriesId: seriesModel.id,
|
|
11777
|
+
changePercent
|
|
11778
|
+
});
|
|
11779
|
+
});
|
|
11780
|
+
return seriesPointData;
|
|
11781
|
+
}
|
|
11718
11782
|
function enableHoverEmphasis(el, focus, blurScope) {
|
|
11719
11783
|
setAsHighDownDispatcher(el, true);
|
|
11720
11784
|
traverseUpdateState(el, setDefaultStateProxy);
|
|
@@ -23101,6 +23165,37 @@ var ECharts = class extends Eventful_default {
|
|
|
23101
23165
|
const dataIndexInside = parsedFinder.hasOwnProperty("dataIndexInside") ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty("dataIndex") ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;
|
|
23102
23166
|
return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);
|
|
23103
23167
|
}
|
|
23168
|
+
getDataByIndex(finder) {
|
|
23169
|
+
const ecModel = this._model;
|
|
23170
|
+
const parsedFinder = parseFinder(ecModel, finder, {
|
|
23171
|
+
defaultMainType: "series"
|
|
23172
|
+
});
|
|
23173
|
+
const seriesModel = parsedFinder.seriesModel;
|
|
23174
|
+
if (true) {
|
|
23175
|
+
if (!seriesModel) {
|
|
23176
|
+
warn("There is no specified series model");
|
|
23177
|
+
}
|
|
23178
|
+
}
|
|
23179
|
+
const data = seriesModel.getData();
|
|
23180
|
+
const dataIndexInside = parsedFinder.hasOwnProperty("dataIndexInside") ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty("dataIndex") ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;
|
|
23181
|
+
return dataIndexInside != null ? data.getValues(dataIndexInside) : data.getValues(data.count() - 1);
|
|
23182
|
+
}
|
|
23183
|
+
getCategories(finder) {
|
|
23184
|
+
const ecModel = this._model;
|
|
23185
|
+
const parsedFinder = parseFinder(ecModel, finder, {
|
|
23186
|
+
defaultMainType: "series"
|
|
23187
|
+
});
|
|
23188
|
+
const seriesModel = parsedFinder.seriesModel;
|
|
23189
|
+
if (true) {
|
|
23190
|
+
if (!seriesModel) {
|
|
23191
|
+
warn("There is no specified series model");
|
|
23192
|
+
}
|
|
23193
|
+
}
|
|
23194
|
+
const data = seriesModel.getData();
|
|
23195
|
+
const dataIndex = parsedFinder.hasOwnProperty("dataIndex") ? data.indexOfRawIndex(parsedFinder.dataIndex) : 0;
|
|
23196
|
+
const axis = seriesModel.getBaseAxis();
|
|
23197
|
+
return axis.scale.getLabel({value: dataIndex});
|
|
23198
|
+
}
|
|
23104
23199
|
getViewOfComponentModel(componentModel) {
|
|
23105
23200
|
return this._componentsMap[componentModel.__viewId];
|
|
23106
23201
|
}
|
|
@@ -23162,7 +23257,7 @@ var ECharts = class extends Eventful_default {
|
|
|
23162
23257
|
this.trigger(eventType, event);
|
|
23163
23258
|
}, this);
|
|
23164
23259
|
});
|
|
23165
|
-
each(["selectchanged"], (eventType) => {
|
|
23260
|
+
each(["selectchanged", "selectitem"], (eventType) => {
|
|
23166
23261
|
this._messageCenter.on(eventType, function(event) {
|
|
23167
23262
|
this.trigger(eventType, event);
|
|
23168
23263
|
}, this);
|
|
@@ -23686,6 +23781,11 @@ ECharts.internalField = function() {
|
|
|
23686
23781
|
};
|
|
23687
23782
|
messageCenter.trigger(newObj.type, newObj);
|
|
23688
23783
|
}
|
|
23784
|
+
const isUpdateAxisPointer = payload.type === "updateAxisPointer";
|
|
23785
|
+
if (isUpdateAxisPointer) {
|
|
23786
|
+
const data = getSeriesPointData(ecModel, {dataIndex: eventObj.dataIndexInside});
|
|
23787
|
+
messageCenter.trigger("selectitem", {data, dataIndex: eventObj.dataIndexInside});
|
|
23788
|
+
}
|
|
23689
23789
|
}
|
|
23690
23790
|
};
|
|
23691
23791
|
flushPendingActions = function(silent) {
|
|
@@ -23849,6 +23949,9 @@ ECharts.internalField = function() {
|
|
|
23849
23949
|
updateStates(seriesModel, chartView);
|
|
23850
23950
|
});
|
|
23851
23951
|
updateHoverLayerStatus(ecIns, ecModel);
|
|
23952
|
+
const data = getSeriesPointData(ecModel);
|
|
23953
|
+
const messageCenter = ecIns._messageCenter;
|
|
23954
|
+
messageCenter.trigger("selectitem", {data});
|
|
23852
23955
|
lifecycle_default.trigger("series:afterupdate", ecModel, api2, updateParams);
|
|
23853
23956
|
};
|
|
23854
23957
|
markStatusToUpdate = function(ecIns) {
|
|
@@ -30458,7 +30561,7 @@ function setMetaData(attrs, el) {
|
|
|
30458
30561
|
const metaData = getElementSSRData(el);
|
|
30459
30562
|
if (metaData) {
|
|
30460
30563
|
metaData.each((val, key) => {
|
|
30461
|
-
attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + "";
|
|
30564
|
+
val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + "");
|
|
30462
30565
|
});
|
|
30463
30566
|
if (el.isSilent()) {
|
|
30464
30567
|
attrs[META_DATA_PREFIX + "silent"] = "true";
|
|
@@ -31328,8 +31431,7 @@ function createBackgroundVNode(width, height, backgroundColor2, scope) {
|
|
|
31328
31431
|
width,
|
|
31329
31432
|
height,
|
|
31330
31433
|
x: "0",
|
|
31331
|
-
y: "0"
|
|
31332
|
-
id: "0"
|
|
31434
|
+
y: "0"
|
|
31333
31435
|
});
|
|
31334
31436
|
if (isGradient(backgroundColor2)) {
|
|
31335
31437
|
setGradient({fill: backgroundColor2}, bgVNode.attrs, "fill", scope);
|
|
@@ -31509,7 +31611,7 @@ var Layer = class extends Eventful_default {
|
|
|
31509
31611
|
}
|
|
31510
31612
|
for (let i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {
|
|
31511
31613
|
const el = prevList[i];
|
|
31512
|
-
const shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);
|
|
31614
|
+
const shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true);
|
|
31513
31615
|
if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {
|
|
31514
31616
|
const prevRect = el.getPrevPaintRect();
|
|
31515
31617
|
if (prevRect) {
|
|
@@ -37804,29 +37906,33 @@ var builders = {
|
|
|
37804
37906
|
},
|
|
37805
37907
|
axisBackground(opt, axisModel, group, transformGroup) {
|
|
37806
37908
|
const shown = axisModel.get(["axisBackground", "show"]);
|
|
37807
|
-
if (!shown) {
|
|
37909
|
+
if (!shown || axisModel.axis.dim !== "y") {
|
|
37808
37910
|
return;
|
|
37809
37911
|
}
|
|
37810
37912
|
const extent3 = axisModel.axis.getExtent();
|
|
37811
37913
|
const matrix13 = transformGroup.transform;
|
|
37812
37914
|
const pt12 = [extent3[0], 0];
|
|
37915
|
+
const pt22 = [extent3[1], 0];
|
|
37916
|
+
const inverse = pt12[0] > pt22[0];
|
|
37813
37917
|
if (matrix13) {
|
|
37814
37918
|
applyTransform(pt12, pt12, matrix13);
|
|
37919
|
+
applyTransform(pt22, pt22, matrix13);
|
|
37815
37920
|
}
|
|
37816
37921
|
const style = extend({}, axisModel.getModel(["axisBackground", "backStyle"]).getAreaStyle());
|
|
37817
37922
|
const position2 = axisModel.axis.position;
|
|
37818
37923
|
const api2 = axisModel.ecModel.scheduler.api;
|
|
37924
|
+
const pt = inverse ? pt22 : pt12;
|
|
37819
37925
|
const background = new Rect_default({
|
|
37820
37926
|
shape: position2 === "left" ? {
|
|
37821
37927
|
x: 0,
|
|
37822
37928
|
y: 0,
|
|
37823
|
-
width:
|
|
37824
|
-
height:
|
|
37929
|
+
width: pt[0],
|
|
37930
|
+
height: pt[1]
|
|
37825
37931
|
} : {
|
|
37826
|
-
x:
|
|
37932
|
+
x: pt[0],
|
|
37827
37933
|
y: 0,
|
|
37828
|
-
width: api2.getWidth() -
|
|
37829
|
-
height:
|
|
37934
|
+
width: api2.getWidth() - pt[0],
|
|
37935
|
+
height: pt[1]
|
|
37830
37936
|
},
|
|
37831
37937
|
style,
|
|
37832
37938
|
cursor: "ns-resize",
|
|
@@ -57769,7 +57875,10 @@ function axisTrigger(payload, ecModel, api2) {
|
|
|
57769
57875
|
processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);
|
|
57770
57876
|
});
|
|
57771
57877
|
updateModelActually(showValueMap, axesInfo, outputPayload);
|
|
57772
|
-
|
|
57878
|
+
const tooltipDisabled = ecModel.get("tooltipDisabled");
|
|
57879
|
+
if (!tooltipDisabled) {
|
|
57880
|
+
dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3);
|
|
57881
|
+
}
|
|
57773
57882
|
const highlightDisabled = ecModel.get("highlightDisabled");
|
|
57774
57883
|
if (!highlightDisabled) {
|
|
57775
57884
|
dispatchHighDownActually(axesInfo, dispatchAction3, api2);
|
|
@@ -66860,7 +66969,8 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66860
66969
|
}
|
|
66861
66970
|
const gridRect = coordSys.master.getRect();
|
|
66862
66971
|
const yAxisModel = coordSys.getAxis("y");
|
|
66863
|
-
const
|
|
66972
|
+
const offset = yAxisModel.model.get("offset") || 0;
|
|
66973
|
+
const x = yAxisModel.position === "right" ? gridRect.x + gridRect.width + offset : gridRect.x - offset;
|
|
66864
66974
|
each(markLabelData, (item) => {
|
|
66865
66975
|
let el = markerGroupMap.get(item.name);
|
|
66866
66976
|
if (item.$action === "remove") {
|
|
@@ -66943,6 +67053,7 @@ var MarkLabelView2 = class extends Component_default2 {
|
|
|
66943
67053
|
const gridRect = coordSys.master.getRect();
|
|
66944
67054
|
const yAxisModel = coordSys.getAxis("y");
|
|
66945
67055
|
const position2 = yAxisModel.position;
|
|
67056
|
+
const offset = yAxisModel.model.get("offset") || 0;
|
|
66946
67057
|
each(labels, (label) => {
|
|
66947
67058
|
if (!label.children) {
|
|
66948
67059
|
return;
|
|
@@ -67061,10 +67172,10 @@ function getLeftTextX(x, text, textStyle, ecModel) {
|
|
|
67061
67172
|
const paddings = normalizeCssArray2(textStyle.padding || 0);
|
|
67062
67173
|
return x - textRect.width - paddings[1] - paddings[3] - 1;
|
|
67063
67174
|
}
|
|
67064
|
-
function createText({option, gridRect, position: position2, ecModel, y}) {
|
|
67175
|
+
function createText({option, gridRect, position: position2, ecModel, y, offset}) {
|
|
67065
67176
|
const isLeft = position2 === "left";
|
|
67066
67177
|
const {style, zlevel} = option;
|
|
67067
|
-
const startX = isLeft ? gridRect.x : gridRect.x + gridRect.width;
|
|
67178
|
+
const startX = isLeft ? gridRect.x - offset : gridRect.x + gridRect.width + offset;
|
|
67068
67179
|
const x = isLeft ? getLeftTextX(startX, style.text, style, ecModel) : startX;
|
|
67069
67180
|
const textEl = new Text_default({
|
|
67070
67181
|
x,
|
|
@@ -67076,9 +67187,9 @@ function createText({option, gridRect, position: position2, ecModel, y}) {
|
|
|
67076
67187
|
inner21(textEl).y = y;
|
|
67077
67188
|
return textEl;
|
|
67078
67189
|
}
|
|
67079
|
-
function updateText({option, gridRect, position: position2, ecModel, el, y}) {
|
|
67190
|
+
function updateText({option, gridRect, position: position2, ecModel, el, y, offset}) {
|
|
67080
67191
|
const isLeft = position2 === "left";
|
|
67081
|
-
const startX = isLeft ? gridRect.x : gridRect.x + gridRect.width;
|
|
67192
|
+
const startX = isLeft ? gridRect.x - offset : gridRect.x + gridRect.width + offset;
|
|
67082
67193
|
const {style} = option;
|
|
67083
67194
|
const x = isLeft ? getLeftTextX(startX, style.text, style, ecModel) : startX;
|
|
67084
67195
|
el.x = x;
|
|
@@ -67101,7 +67212,7 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67101
67212
|
zlevel
|
|
67102
67213
|
});
|
|
67103
67214
|
const textNameEl = new Text_default({
|
|
67104
|
-
x: isLeft ? x : getLeftTextX(x, labelData.name, textStyle, markerModel.ecModel),
|
|
67215
|
+
x: isLeft ? gridRect.x : getLeftTextX(gridRect.x + gridRect.width, labelData.name, textStyle, markerModel.ecModel),
|
|
67105
67216
|
y: labelY,
|
|
67106
67217
|
style: Object.assign({text: labelData.name}, textStyle),
|
|
67107
67218
|
z: 101,
|
|
@@ -67111,7 +67222,7 @@ function createLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67111
67222
|
const lineEl = new Line_default({
|
|
67112
67223
|
style: lineStyle,
|
|
67113
67224
|
shape: {
|
|
67114
|
-
x1: showName && isLeft ? gridRect.x
|
|
67225
|
+
x1: showName && isLeft ? gridRect.x + 10 : gridRect.x,
|
|
67115
67226
|
y1: y,
|
|
67116
67227
|
x2: showName && !isLeft ? gridRect.x + gridRect.width - 10 : gridRect.x + gridRect.width,
|
|
67117
67228
|
y2: y
|
|
@@ -67146,7 +67257,7 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67146
67257
|
}
|
|
67147
67258
|
element.attr({
|
|
67148
67259
|
shape: {
|
|
67149
|
-
x1: showName && isLeft ? gridRect.x
|
|
67260
|
+
x1: showName && isLeft ? gridRect.x + 10 : gridRect.x,
|
|
67150
67261
|
y1: y,
|
|
67151
67262
|
x2: showName && !isLeft ? gridRect.x + gridRect.width - 10 : gridRect.x + gridRect.width,
|
|
67152
67263
|
y2: y
|
|
@@ -67158,7 +67269,8 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67158
67269
|
case "textLabel":
|
|
67159
67270
|
const textLabel = labelData.text;
|
|
67160
67271
|
const labelX = isLeft ? getLeftTextX(x, textLabel, textStyle, markerModel.ecModel) : x;
|
|
67161
|
-
|
|
67272
|
+
const margin = isLeft ? -1 : 1;
|
|
67273
|
+
element.x = labelX + (labelTextStyle ? margin : 0);
|
|
67162
67274
|
element.y = labelY;
|
|
67163
67275
|
element.attr("style", Object.assign({text: textLabel}, textStyle, labelTextStyle));
|
|
67164
67276
|
break;
|
|
@@ -67168,7 +67280,7 @@ function updateLabel({x, y, labelData, markerModel, gridRect, position: position
|
|
|
67168
67280
|
return;
|
|
67169
67281
|
}
|
|
67170
67282
|
const nameLabel = labelData.name;
|
|
67171
|
-
const nameX = isLeft ? x : getLeftTextX(x, nameLabel, textStyle, markerModel.ecModel);
|
|
67283
|
+
const nameX = isLeft ? gridRect.x : getLeftTextX(gridRect.x + gridRect.width, nameLabel, textStyle, markerModel.ecModel);
|
|
67172
67284
|
element.x = nameX;
|
|
67173
67285
|
element.y = labelY;
|
|
67174
67286
|
element.attr("style", Object.assign({text: nameLabel}, textStyle, labelTextStyle));
|