tvcharts 0.8.2 → 0.8.4
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 +279 -97
- package/dist/echarts.js.map +2 -2
- package/lib/component/axisPointer/axisTrigger.js +26 -0
- package/lib/component/marker/MarkLabelView.js +9 -3
- package/lib/component/tooltip/TooltipModel.js +4 -0
- package/lib/component/tooltip/TooltipView.js +60 -1
- package/lib/component/tooltip/install.js +10 -0
- package/lib/util/color.js +47 -14
- package/package.json +1 -1
- package/types/dist/echarts.d.ts +4 -0
- package/types/dist/shared.d.ts +4 -0
- package/types/src/component/axisPointer/axisTrigger.d.ts +1 -0
- package/types/src/component/tooltip/TooltipModel.d.ts +4 -0
- package/types/src/component/tooltip/TooltipView.d.ts +11 -0
package/dist/echarts.js
CHANGED
|
@@ -801,12 +801,9 @@ function parseRgbaStringFast(str) {
|
|
|
801
801
|
for (let i = openParenIdx + 1; i < str.length - 1; i++) {
|
|
802
802
|
const c = str.charCodeAt(i);
|
|
803
803
|
if (c >= 48 && c <= 57) {
|
|
804
|
-
|
|
805
|
-
|
|
804
|
+
num = num * 10 + (c - 48);
|
|
805
|
+
if (fracDiv)
|
|
806
806
|
fracDiv *= 10;
|
|
807
|
-
} else {
|
|
808
|
-
num = num * 10 + (c - 48);
|
|
809
|
-
}
|
|
810
807
|
} else if (c === 46) {
|
|
811
808
|
if (!fracDiv)
|
|
812
809
|
fracDiv = 1;
|
|
@@ -821,7 +818,7 @@ function parseRgbaStringFast(str) {
|
|
|
821
818
|
if (index < 4) {
|
|
822
819
|
nums[index++] = fracDiv ? num / fracDiv : num;
|
|
823
820
|
}
|
|
824
|
-
if (
|
|
821
|
+
if (index < 4) {
|
|
825
822
|
nums[3] = 1;
|
|
826
823
|
}
|
|
827
824
|
return nums;
|
|
@@ -7247,7 +7244,7 @@ function getElementSSRData(el) {
|
|
|
7247
7244
|
function registerSSRDataGetter(getter) {
|
|
7248
7245
|
ssrDataGetter = getter;
|
|
7249
7246
|
}
|
|
7250
|
-
var version = "5.6.
|
|
7247
|
+
var version = "5.6.91";
|
|
7251
7248
|
|
|
7252
7249
|
// src/util/number.ts
|
|
7253
7250
|
var RADIAN_EPSILON = 1e-4;
|
|
@@ -14328,9 +14325,9 @@ function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttac
|
|
|
14328
14325
|
if (overflow) {
|
|
14329
14326
|
textStyle.overflow = overflow;
|
|
14330
14327
|
}
|
|
14331
|
-
const
|
|
14332
|
-
if (
|
|
14333
|
-
textStyle.margin =
|
|
14328
|
+
const margin2 = textStyleModel.get("minMargin");
|
|
14329
|
+
if (margin2 != null) {
|
|
14330
|
+
textStyle.margin = margin2;
|
|
14334
14331
|
}
|
|
14335
14332
|
setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);
|
|
14336
14333
|
}
|
|
@@ -15647,7 +15644,7 @@ function boxLayout(orient, group, gap, maxWidth, maxHeight) {
|
|
|
15647
15644
|
var box = boxLayout;
|
|
15648
15645
|
var vbox = curry(boxLayout, "vertical");
|
|
15649
15646
|
var hbox = curry(boxLayout, "horizontal");
|
|
15650
|
-
function getAvailableSize(positionInfo, containerRect,
|
|
15647
|
+
function getAvailableSize(positionInfo, containerRect, margin2) {
|
|
15651
15648
|
const containerWidth = containerRect.width;
|
|
15652
15649
|
const containerHeight = containerRect.height;
|
|
15653
15650
|
let x = parsePercent2(positionInfo.left, containerWidth);
|
|
@@ -15658,14 +15655,14 @@ function getAvailableSize(positionInfo, containerRect, margin) {
|
|
|
15658
15655
|
(isNaN(x2) || isNaN(parseFloat(positionInfo.right))) && (x2 = containerWidth);
|
|
15659
15656
|
(isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);
|
|
15660
15657
|
(isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);
|
|
15661
|
-
|
|
15658
|
+
margin2 = normalizeCssArray2(margin2 || 0);
|
|
15662
15659
|
return {
|
|
15663
|
-
width: Math.max(x2 - x -
|
|
15664
|
-
height: Math.max(y2 - y -
|
|
15660
|
+
width: Math.max(x2 - x - margin2[1] - margin2[3], 0),
|
|
15661
|
+
height: Math.max(y2 - y - margin2[0] - margin2[2], 0)
|
|
15665
15662
|
};
|
|
15666
15663
|
}
|
|
15667
|
-
function getLayoutRect(positionInfo, containerRect,
|
|
15668
|
-
|
|
15664
|
+
function getLayoutRect(positionInfo, containerRect, margin2) {
|
|
15665
|
+
margin2 = normalizeCssArray2(margin2 || 0);
|
|
15669
15666
|
const containerWidth = containerRect.width;
|
|
15670
15667
|
const containerHeight = containerRect.height;
|
|
15671
15668
|
let left = parsePercent2(positionInfo.left, containerWidth);
|
|
@@ -15674,8 +15671,8 @@ function getLayoutRect(positionInfo, containerRect, margin) {
|
|
|
15674
15671
|
const bottom = parsePercent2(positionInfo.bottom, containerHeight);
|
|
15675
15672
|
let width = parsePercent2(positionInfo.width, containerWidth);
|
|
15676
15673
|
let height = parsePercent2(positionInfo.height, containerHeight);
|
|
15677
|
-
const verticalMargin =
|
|
15678
|
-
const horizontalMargin =
|
|
15674
|
+
const verticalMargin = margin2[2] + margin2[0];
|
|
15675
|
+
const horizontalMargin = margin2[1] + margin2[3];
|
|
15679
15676
|
const aspect = positionInfo.aspect;
|
|
15680
15677
|
if (isNaN(width)) {
|
|
15681
15678
|
width = containerWidth - right - horizontalMargin - left;
|
|
@@ -15706,7 +15703,7 @@ function getLayoutRect(positionInfo, containerRect, margin) {
|
|
|
15706
15703
|
}
|
|
15707
15704
|
switch (positionInfo.left || positionInfo.right) {
|
|
15708
15705
|
case "center":
|
|
15709
|
-
left = containerWidth / 2 - width / 2 -
|
|
15706
|
+
left = containerWidth / 2 - width / 2 - margin2[3];
|
|
15710
15707
|
break;
|
|
15711
15708
|
case "right":
|
|
15712
15709
|
left = containerWidth - width - horizontalMargin;
|
|
@@ -15715,7 +15712,7 @@ function getLayoutRect(positionInfo, containerRect, margin) {
|
|
|
15715
15712
|
switch (positionInfo.top || positionInfo.bottom) {
|
|
15716
15713
|
case "middle":
|
|
15717
15714
|
case "center":
|
|
15718
|
-
top = containerHeight / 2 - height / 2 -
|
|
15715
|
+
top = containerHeight / 2 - height / 2 - margin2[0];
|
|
15719
15716
|
break;
|
|
15720
15717
|
case "bottom":
|
|
15721
15718
|
top = containerHeight - height - verticalMargin;
|
|
@@ -15729,11 +15726,11 @@ function getLayoutRect(positionInfo, containerRect, margin) {
|
|
|
15729
15726
|
if (isNaN(height)) {
|
|
15730
15727
|
height = containerHeight - verticalMargin - top - (bottom || 0);
|
|
15731
15728
|
}
|
|
15732
|
-
const rect = new BoundingRect_default(left +
|
|
15733
|
-
rect.margin =
|
|
15729
|
+
const rect = new BoundingRect_default(left + margin2[3], top + margin2[0], width, height);
|
|
15730
|
+
rect.margin = margin2;
|
|
15734
15731
|
return rect;
|
|
15735
15732
|
}
|
|
15736
|
-
function positionElement(el, positionInfo, containerRect,
|
|
15733
|
+
function positionElement(el, positionInfo, containerRect, margin2, opt, out2) {
|
|
15737
15734
|
const h = !opt || !opt.hv || opt.hv[0];
|
|
15738
15735
|
const v = !opt || !opt.hv || opt.hv[1];
|
|
15739
15736
|
const boundingMode = opt && opt.boundingMode || "all";
|
|
@@ -15754,7 +15751,7 @@ function positionElement(el, positionInfo, containerRect, margin, opt, out2) {
|
|
|
15754
15751
|
rect.applyTransform(transform2);
|
|
15755
15752
|
}
|
|
15756
15753
|
}
|
|
15757
|
-
const layoutRect = getLayoutRect(defaults({width: rect.width, height: rect.height}, positionInfo), containerRect,
|
|
15754
|
+
const layoutRect = getLayoutRect(defaults({width: rect.width, height: rect.height}, positionInfo), containerRect, margin2);
|
|
15758
15755
|
const dx = h ? layoutRect.x - rect.x : 0;
|
|
15759
15756
|
const dy = v ? layoutRect.y - rect.y : 0;
|
|
15760
15757
|
if (boundingMode === "raw") {
|
|
@@ -28185,6 +28182,45 @@ var OrdinalMeta = class {
|
|
|
28185
28182
|
getMarksByWeight() {
|
|
28186
28183
|
return this._marksByWeight;
|
|
28187
28184
|
}
|
|
28185
|
+
reFillExtraCategories(startTime) {
|
|
28186
|
+
const timePoints = [];
|
|
28187
|
+
const marksByWeight = new HashMap();
|
|
28188
|
+
const formatInterval = this.dataInterval === "1D";
|
|
28189
|
+
const utcOffsetTime = this.utcOffsetTime;
|
|
28190
|
+
const addItem = (value, index) => {
|
|
28191
|
+
const d = formatInterval ? convertToUTCDayStart(value - utcOffsetTime) : value * 1e3;
|
|
28192
|
+
timePoints.push({
|
|
28193
|
+
originalTime: value,
|
|
28194
|
+
index,
|
|
28195
|
+
timestamp: d / 1e3
|
|
28196
|
+
});
|
|
28197
|
+
};
|
|
28198
|
+
const categories = this.categories;
|
|
28199
|
+
each(categories, (val, index) => {
|
|
28200
|
+
addItem(val, index);
|
|
28201
|
+
});
|
|
28202
|
+
const extraCategory = this.loadMoreCategory(startTime, 300);
|
|
28203
|
+
map(extraCategory, (val, i) => {
|
|
28204
|
+
const index = i + categories.length;
|
|
28205
|
+
addItem(val, index);
|
|
28206
|
+
});
|
|
28207
|
+
if (timePoints.length) {
|
|
28208
|
+
fillWeightsForPoints(timePoints);
|
|
28209
|
+
for (let index = 0; index < timePoints.length; ++index) {
|
|
28210
|
+
const point = timePoints[index];
|
|
28211
|
+
let marksForWeight = marksByWeight.get(point.weight);
|
|
28212
|
+
if (marksForWeight === void 0) {
|
|
28213
|
+
marksForWeight = [];
|
|
28214
|
+
marksByWeight.set(point.weight, marksForWeight);
|
|
28215
|
+
}
|
|
28216
|
+
marksForWeight.push(point);
|
|
28217
|
+
}
|
|
28218
|
+
}
|
|
28219
|
+
this.extraCategory = extraCategory;
|
|
28220
|
+
this._marksByWeight = marksByWeight;
|
|
28221
|
+
this._appendCount = 0;
|
|
28222
|
+
this.cache = null;
|
|
28223
|
+
}
|
|
28188
28224
|
appendData(data) {
|
|
28189
28225
|
if (this._map) {
|
|
28190
28226
|
const length2 = this.categories.length;
|
|
@@ -28193,6 +28229,11 @@ var OrdinalMeta = class {
|
|
|
28193
28229
|
});
|
|
28194
28230
|
}
|
|
28195
28231
|
this.categories.push(...data);
|
|
28232
|
+
const lastUpdateTime = +data[data.length - 1];
|
|
28233
|
+
if (lastUpdateTime !== +this.extraCategory[0]) {
|
|
28234
|
+
this.reFillExtraCategories(lastUpdateTime);
|
|
28235
|
+
return;
|
|
28236
|
+
}
|
|
28196
28237
|
this.extraCategory.splice(0, data.length);
|
|
28197
28238
|
if (this.loadMoreCategory) {
|
|
28198
28239
|
const startTime = this.extraCategory[this.extraCategory.length - 1];
|
|
@@ -30440,29 +30481,29 @@ __export(util_exports2, {
|
|
|
30440
30481
|
|
|
30441
30482
|
// src/util/color.ts
|
|
30442
30483
|
function parseColor(color2) {
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
}
|
|
30448
|
-
if (color2.length !== 6 || !/^[0-9A-Fa-f]{6}$/.test(color2)) {
|
|
30449
|
-
return [0, 0, 0];
|
|
30450
|
-
}
|
|
30484
|
+
color2 = color2.trim().toLowerCase();
|
|
30485
|
+
const rgbRegex = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})/;
|
|
30486
|
+
const rgbMatch = color2.match(rgbRegex);
|
|
30487
|
+
if (rgbMatch) {
|
|
30451
30488
|
return [
|
|
30452
|
-
parseInt(
|
|
30453
|
-
parseInt(
|
|
30454
|
-
parseInt(
|
|
30489
|
+
parseInt(rgbMatch[1], 10),
|
|
30490
|
+
parseInt(rgbMatch[2], 10),
|
|
30491
|
+
parseInt(rgbMatch[3], 10)
|
|
30455
30492
|
];
|
|
30456
30493
|
}
|
|
30457
|
-
|
|
30458
|
-
|
|
30459
|
-
|
|
30494
|
+
if (color2.startsWith("#")) {
|
|
30495
|
+
let hex = color2.slice(1);
|
|
30496
|
+
if (hex.length === 3 || hex.length === 4) {
|
|
30497
|
+
hex = hex.split("").map((c) => c + c).join("");
|
|
30498
|
+
}
|
|
30499
|
+
if (hex.length === 6 || hex.length === 8) {
|
|
30500
|
+
const r = parseInt(hex.slice(0, 2), 16);
|
|
30501
|
+
const g = parseInt(hex.slice(2, 4), 16);
|
|
30502
|
+
const b = parseInt(hex.slice(4, 6), 16);
|
|
30503
|
+
return [r, g, b];
|
|
30504
|
+
}
|
|
30460
30505
|
}
|
|
30461
|
-
return [
|
|
30462
|
-
parseInt(match[1], 10),
|
|
30463
|
-
parseInt(match[2], 10),
|
|
30464
|
-
parseInt(match[3], 10)
|
|
30465
|
-
];
|
|
30506
|
+
return [0, 0, 0];
|
|
30466
30507
|
}
|
|
30467
30508
|
function contrastColor2(color2) {
|
|
30468
30509
|
const [r, g, b] = parseColor(color2);
|
|
@@ -30957,9 +30998,9 @@ var Axis = class {
|
|
|
30957
30998
|
function fixExtentWithBands(extent3, nTick) {
|
|
30958
30999
|
const size = extent3[1] - extent3[0];
|
|
30959
31000
|
const len2 = nTick;
|
|
30960
|
-
const
|
|
30961
|
-
extent3[0] +=
|
|
30962
|
-
extent3[1] -=
|
|
31001
|
+
const margin2 = size / len2 / 2;
|
|
31002
|
+
extent3[0] += margin2;
|
|
31003
|
+
extent3[1] -= margin2;
|
|
30963
31004
|
}
|
|
30964
31005
|
function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp2) {
|
|
30965
31006
|
const ticksLen = ticksCoords.length;
|
|
@@ -38131,8 +38172,8 @@ function constrainTextWidth(layout18, availableWidth, forceRecalculate = false)
|
|
|
38131
38172
|
}
|
|
38132
38173
|
const newRect = label.getBoundingRect();
|
|
38133
38174
|
textRect.width = newRect.width;
|
|
38134
|
-
const
|
|
38135
|
-
textRect.height = newRect.height +
|
|
38175
|
+
const margin2 = (label.style.margin || 0) + 2.1;
|
|
38176
|
+
textRect.height = newRect.height + margin2;
|
|
38136
38177
|
textRect.y -= (textRect.height - oldHeight) / 2;
|
|
38137
38178
|
}
|
|
38138
38179
|
}
|
|
@@ -38260,9 +38301,9 @@ function pieLabelLayout(seriesModel) {
|
|
|
38260
38301
|
if (!isLabelInside) {
|
|
38261
38302
|
const textRect = label.getBoundingRect().clone();
|
|
38262
38303
|
textRect.applyTransform(label.getComputedTransform());
|
|
38263
|
-
const
|
|
38264
|
-
textRect.y -=
|
|
38265
|
-
textRect.height +=
|
|
38304
|
+
const margin2 = (label.style.margin || 0) + 2.1;
|
|
38305
|
+
textRect.y -= margin2 / 2;
|
|
38306
|
+
textRect.height += margin2;
|
|
38266
38307
|
labelLayoutList.push({
|
|
38267
38308
|
label,
|
|
38268
38309
|
labelLine,
|
|
@@ -39682,12 +39723,12 @@ var Grid2 = class {
|
|
|
39682
39723
|
const labelUnionRect = estimateLabelUnionRect(axis);
|
|
39683
39724
|
if (labelUnionRect) {
|
|
39684
39725
|
const dim = axis.isHorizontal() ? "height" : "width";
|
|
39685
|
-
const
|
|
39686
|
-
gridRect[dim] -= labelUnionRect[dim] +
|
|
39726
|
+
const margin2 = axis.model.get(["axisLabel", "margin"]);
|
|
39727
|
+
gridRect[dim] -= labelUnionRect[dim] + margin2;
|
|
39687
39728
|
if (axis.position === "top") {
|
|
39688
|
-
gridRect.y += labelUnionRect.height +
|
|
39729
|
+
gridRect.y += labelUnionRect.height + margin2;
|
|
39689
39730
|
} else if (axis.position === "left") {
|
|
39690
|
-
gridRect.x += labelUnionRect.width +
|
|
39731
|
+
gridRect.x += labelUnionRect.width + margin2;
|
|
39691
39732
|
}
|
|
39692
39733
|
}
|
|
39693
39734
|
}
|
|
@@ -55748,23 +55789,49 @@ var LinePlotPath = class extends Path_default {
|
|
|
55748
55789
|
return new LinePlotShape();
|
|
55749
55790
|
}
|
|
55750
55791
|
buildPath(ctx2, shape) {
|
|
55751
|
-
const {points: points4} = shape;
|
|
55752
|
-
|
|
55753
|
-
const
|
|
55754
|
-
|
|
55755
|
-
|
|
55756
|
-
|
|
55757
|
-
|
|
55792
|
+
const {points: points4, connectSelf, barWidth} = shape;
|
|
55793
|
+
if (connectSelf) {
|
|
55794
|
+
const offset = barWidth / 2;
|
|
55795
|
+
let isMove = false;
|
|
55796
|
+
for (let index = 0; index < points4.length; index++) {
|
|
55797
|
+
const point = points4[index];
|
|
55798
|
+
if (point === 0 || isPointNull3(point)) {
|
|
55799
|
+
isMove = true;
|
|
55800
|
+
continue;
|
|
55758
55801
|
}
|
|
55759
|
-
if (
|
|
55802
|
+
if (isMove) {
|
|
55803
|
+
const nextPoint = points4[index + 1];
|
|
55804
|
+
const [x, y] = point;
|
|
55805
|
+
if (!nextPoint || isPointNull3(nextPoint)) {
|
|
55806
|
+
ctx2.moveTo(x - offset, y);
|
|
55807
|
+
ctx2.lineTo(x + offset, y);
|
|
55808
|
+
continue;
|
|
55809
|
+
}
|
|
55810
|
+
ctx2.moveTo(x, y);
|
|
55811
|
+
isMove = false;
|
|
55812
|
+
} else {
|
|
55813
|
+
const [x, y] = point;
|
|
55814
|
+
ctx2.lineTo(x, y);
|
|
55815
|
+
}
|
|
55816
|
+
}
|
|
55817
|
+
} else {
|
|
55818
|
+
for (let index = 0; index < points4.length; index++) {
|
|
55819
|
+
const point = points4[index];
|
|
55820
|
+
if (point === 0 || isPointNull3(point)) {
|
|
55821
|
+
let nextPoint = points4[++index];
|
|
55822
|
+
while ((nextPoint === 0 || isPointNull3(nextPoint)) && index < points4.length) {
|
|
55823
|
+
nextPoint = points4[++index];
|
|
55824
|
+
}
|
|
55825
|
+
if (!nextPoint) {
|
|
55826
|
+
continue;
|
|
55827
|
+
}
|
|
55828
|
+
const [x2, y2] = nextPoint;
|
|
55829
|
+
ctx2.moveTo(x2, y2);
|
|
55760
55830
|
continue;
|
|
55761
55831
|
}
|
|
55762
|
-
const [
|
|
55763
|
-
ctx2.
|
|
55764
|
-
continue;
|
|
55832
|
+
const [x, y] = point;
|
|
55833
|
+
ctx2.lineTo(x, y);
|
|
55765
55834
|
}
|
|
55766
|
-
const [x, y] = point;
|
|
55767
|
-
ctx2.lineTo(x, y);
|
|
55768
55835
|
}
|
|
55769
55836
|
}
|
|
55770
55837
|
};
|
|
@@ -56268,6 +56335,9 @@ var LinesPlotView2 = class extends Chart_default {
|
|
|
56268
56335
|
const lineGroup = this._lineGroup;
|
|
56269
56336
|
const z2 = seriesModel.get("z2");
|
|
56270
56337
|
const visualColor = getVisualGradient2(data, seriesModel.coordinateSystem, api2);
|
|
56338
|
+
const connectNulls = seriesModel.get("connectNulls");
|
|
56339
|
+
const step = seriesModel.get("step");
|
|
56340
|
+
const barSpace = Math.floor((seriesModel.coordinateSystem.getAxesByScale("ordinal")[0].scale.barSpace || calculatebandWidth(seriesModel, data)) * 0.8) || 1;
|
|
56271
56341
|
each(linePointsByKey, function(item, key) {
|
|
56272
56342
|
const [stroke, lineDash, lineWidth] = key.split(":");
|
|
56273
56343
|
const {color: color2, isDefaultColor} = getFormatColor(stroke);
|
|
@@ -56276,12 +56346,15 @@ var LinesPlotView2 = class extends Chart_default {
|
|
|
56276
56346
|
}
|
|
56277
56347
|
const el = new LinePlotPath_default({
|
|
56278
56348
|
shape: {
|
|
56279
|
-
points: item
|
|
56349
|
+
points: item,
|
|
56350
|
+
connectSelf: !connectNulls && !step,
|
|
56351
|
+
barWidth: barSpace
|
|
56280
56352
|
},
|
|
56281
56353
|
style: {
|
|
56282
56354
|
lineDash,
|
|
56283
56355
|
stroke: visualColor || color2,
|
|
56284
56356
|
lineWidth: +lineWidth,
|
|
56357
|
+
lineCap: "round",
|
|
56285
56358
|
lineJoin: "round"
|
|
56286
56359
|
},
|
|
56287
56360
|
z2: isDefaultColor ? LastZ2 : z2
|
|
@@ -58369,6 +58442,9 @@ var boxFontSizeMapping = {
|
|
|
58369
58442
|
tiny: 8
|
|
58370
58443
|
};
|
|
58371
58444
|
function getFontSize(size, text, maxWidth, font) {
|
|
58445
|
+
if (typeof size === "number") {
|
|
58446
|
+
return size;
|
|
58447
|
+
}
|
|
58372
58448
|
return boxFontSizeMapping[size] || findFontSize(text, maxWidth, font, 2);
|
|
58373
58449
|
}
|
|
58374
58450
|
|
|
@@ -60034,6 +60110,9 @@ var labelFontSizeMapping = {
|
|
|
60034
60110
|
tiny: 8
|
|
60035
60111
|
};
|
|
60036
60112
|
function getSymbolLabelFontSize(size, width) {
|
|
60113
|
+
if (typeof size === "number") {
|
|
60114
|
+
return size;
|
|
60115
|
+
}
|
|
60037
60116
|
if (size === "auto" && width) {
|
|
60038
60117
|
return Math.max(8, width / 2);
|
|
60039
60118
|
}
|
|
@@ -60172,7 +60251,8 @@ var labelsLayout = {
|
|
|
60172
60251
|
}
|
|
60173
60252
|
let textRect = void 0;
|
|
60174
60253
|
if (textShow) {
|
|
60175
|
-
|
|
60254
|
+
const textSize = fontSize ? fontSize + "px" : gfontSize;
|
|
60255
|
+
textRect = getTextRect2(text, `${textSize} ${labelModel.fontFamily || gfontFamily}`);
|
|
60176
60256
|
if (isLabel) {
|
|
60177
60257
|
symbolSize = [textRect.width + HPadding, textRect.height + VPadding];
|
|
60178
60258
|
}
|
|
@@ -61929,7 +62009,7 @@ var ThemeRiverView2 = class extends Chart_default {
|
|
|
61929
62009
|
let polygon;
|
|
61930
62010
|
const textLayout = data.getItemLayout(indices[0]);
|
|
61931
62011
|
const labelModel = seriesModel.getModel("label");
|
|
61932
|
-
const
|
|
62012
|
+
const margin2 = labelModel.get("margin");
|
|
61933
62013
|
const emphasisModel = seriesModel.getModel("emphasis");
|
|
61934
62014
|
if (status === "add") {
|
|
61935
62015
|
const layerGroup = newLayersGroups[idx] = new Group_default();
|
|
@@ -61978,7 +62058,7 @@ var ThemeRiverView2 = class extends Chart_default {
|
|
|
61978
62058
|
});
|
|
61979
62059
|
const labelEl = polygon.getTextContent();
|
|
61980
62060
|
if (labelEl) {
|
|
61981
|
-
labelEl.x = textLayout.x -
|
|
62061
|
+
labelEl.x = textLayout.x - margin2;
|
|
61982
62062
|
labelEl.y = textLayout.y0 + textLayout.y / 2;
|
|
61983
62063
|
}
|
|
61984
62064
|
polygon.useStyle(style);
|
|
@@ -65457,6 +65537,9 @@ function axisTrigger(payload, ecModel, api2) {
|
|
|
65457
65537
|
if (!tooltipDisabled) {
|
|
65458
65538
|
dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3);
|
|
65459
65539
|
}
|
|
65540
|
+
if (payload.showPoint) {
|
|
65541
|
+
dispatchPointer(ecModel, shouldHide || !outputPayload.axesInfo.length, point, dispatchAction3);
|
|
65542
|
+
}
|
|
65460
65543
|
const highlightDisabled = ecModel.get("highlightDisabled");
|
|
65461
65544
|
if (!highlightDisabled) {
|
|
65462
65545
|
dispatchHighDownActually(axesInfo, dispatchAction3, api2);
|
|
@@ -65628,6 +65711,23 @@ function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction3
|
|
|
65628
65711
|
dataByCoordSys: dataByCoordSys.list
|
|
65629
65712
|
});
|
|
65630
65713
|
}
|
|
65714
|
+
function dispatchPointer(ecModel, shouldHide, point, dispatchAction3) {
|
|
65715
|
+
if (illegalPoint(point) || shouldHide) {
|
|
65716
|
+
dispatchAction3({type: "hidePointer"});
|
|
65717
|
+
return;
|
|
65718
|
+
}
|
|
65719
|
+
const grid = ecModel.getComponent("grid", 0);
|
|
65720
|
+
const yAxis = grid.coordinateSystem.getAxis("y");
|
|
65721
|
+
const xAxis = grid.coordinateSystem.getAxis("x");
|
|
65722
|
+
const yData = yAxis.coordToData(yAxis.toLocalCoord(point[1]));
|
|
65723
|
+
const xData = xAxis.coordToData(xAxis.toLocalCoord(point[0]));
|
|
65724
|
+
dispatchAction3({
|
|
65725
|
+
type: "showPointer",
|
|
65726
|
+
escapeConnect: true,
|
|
65727
|
+
x: xData,
|
|
65728
|
+
y: yData
|
|
65729
|
+
});
|
|
65730
|
+
}
|
|
65631
65731
|
function dispatchHighDownActually(axesInfo, dispatchAction3, api2) {
|
|
65632
65732
|
const zr = api2.getZr();
|
|
65633
65733
|
const highDownKey = "axisPointerLastHighlights";
|
|
@@ -67441,20 +67541,20 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67441
67541
|
}
|
|
67442
67542
|
return params.nameMap;
|
|
67443
67543
|
}
|
|
67444
|
-
_yearTextPositionControl(textEl, point, orient, position2,
|
|
67544
|
+
_yearTextPositionControl(textEl, point, orient, position2, margin2) {
|
|
67445
67545
|
let x = point[0];
|
|
67446
67546
|
let y = point[1];
|
|
67447
67547
|
let aligns = ["center", "bottom"];
|
|
67448
67548
|
if (position2 === "bottom") {
|
|
67449
|
-
y +=
|
|
67549
|
+
y += margin2;
|
|
67450
67550
|
aligns = ["center", "top"];
|
|
67451
67551
|
} else if (position2 === "left") {
|
|
67452
|
-
x -=
|
|
67552
|
+
x -= margin2;
|
|
67453
67553
|
} else if (position2 === "right") {
|
|
67454
|
-
x +=
|
|
67554
|
+
x += margin2;
|
|
67455
67555
|
aligns = ["center", "top"];
|
|
67456
67556
|
} else {
|
|
67457
|
-
y -=
|
|
67557
|
+
y -= margin2;
|
|
67458
67558
|
}
|
|
67459
67559
|
let rotate2 = 0;
|
|
67460
67560
|
if (position2 === "left" || position2 === "right") {
|
|
@@ -67475,7 +67575,7 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67475
67575
|
if (!yearLabel.get("show")) {
|
|
67476
67576
|
return;
|
|
67477
67577
|
}
|
|
67478
|
-
const
|
|
67578
|
+
const margin2 = yearLabel.get("margin");
|
|
67479
67579
|
let pos = yearLabel.get("position");
|
|
67480
67580
|
if (!pos) {
|
|
67481
67581
|
pos = orient !== "horizontal" ? "top" : "left";
|
|
@@ -67507,16 +67607,16 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67507
67607
|
text: content
|
|
67508
67608
|
})
|
|
67509
67609
|
});
|
|
67510
|
-
yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos,
|
|
67610
|
+
yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin2));
|
|
67511
67611
|
group.add(yearText);
|
|
67512
67612
|
}
|
|
67513
|
-
_monthTextPositionControl(point, isCenter, orient, position2,
|
|
67613
|
+
_monthTextPositionControl(point, isCenter, orient, position2, margin2) {
|
|
67514
67614
|
let align = "left";
|
|
67515
67615
|
let vAlign = "top";
|
|
67516
67616
|
let x = point[0];
|
|
67517
67617
|
let y = point[1];
|
|
67518
67618
|
if (orient === "horizontal") {
|
|
67519
|
-
y = y +
|
|
67619
|
+
y = y + margin2;
|
|
67520
67620
|
if (isCenter) {
|
|
67521
67621
|
align = "center";
|
|
67522
67622
|
}
|
|
@@ -67524,7 +67624,7 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67524
67624
|
vAlign = "bottom";
|
|
67525
67625
|
}
|
|
67526
67626
|
} else {
|
|
67527
|
-
x = x +
|
|
67627
|
+
x = x + margin2;
|
|
67528
67628
|
if (isCenter) {
|
|
67529
67629
|
vAlign = "middle";
|
|
67530
67630
|
}
|
|
@@ -67545,7 +67645,7 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67545
67645
|
return;
|
|
67546
67646
|
}
|
|
67547
67647
|
let nameMap = monthLabel.get("nameMap");
|
|
67548
|
-
let
|
|
67648
|
+
let margin2 = monthLabel.get("margin");
|
|
67549
67649
|
const pos = monthLabel.get("position");
|
|
67550
67650
|
const align = monthLabel.get("align");
|
|
67551
67651
|
const termPoints = [this._tlpoints, this._blpoints];
|
|
@@ -67557,7 +67657,7 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67557
67657
|
}
|
|
67558
67658
|
const idx = pos === "start" ? 0 : 1;
|
|
67559
67659
|
const axis = orient === "horizontal" ? 0 : 1;
|
|
67560
|
-
|
|
67660
|
+
margin2 = pos === "start" ? -margin2 : margin2;
|
|
67561
67661
|
const isCenter = align === "center";
|
|
67562
67662
|
for (let i = 0; i < termPoints[idx].length - 1; i++) {
|
|
67563
67663
|
const tmp = termPoints[idx][i].slice();
|
|
@@ -67578,22 +67678,22 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67578
67678
|
const content = this._formatterLabel(formatter, params);
|
|
67579
67679
|
const monthText = new Text_default({
|
|
67580
67680
|
z2: 30,
|
|
67581
|
-
style: extend(createTextStyle(monthLabel, {text: content}), this._monthTextPositionControl(tmp, isCenter, orient, pos,
|
|
67681
|
+
style: extend(createTextStyle(monthLabel, {text: content}), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin2))
|
|
67582
67682
|
});
|
|
67583
67683
|
group.add(monthText);
|
|
67584
67684
|
}
|
|
67585
67685
|
}
|
|
67586
|
-
_weekTextPositionControl(point, orient, position2,
|
|
67686
|
+
_weekTextPositionControl(point, orient, position2, margin2, cellSize) {
|
|
67587
67687
|
let align = "center";
|
|
67588
67688
|
let vAlign = "middle";
|
|
67589
67689
|
let x = point[0];
|
|
67590
67690
|
let y = point[1];
|
|
67591
67691
|
const isStart = position2 === "start";
|
|
67592
67692
|
if (orient === "horizontal") {
|
|
67593
|
-
x = x +
|
|
67693
|
+
x = x + margin2 + (isStart ? 1 : -1) * cellSize[0] / 2;
|
|
67594
67694
|
align = isStart ? "right" : "left";
|
|
67595
67695
|
} else {
|
|
67596
|
-
y = y +
|
|
67696
|
+
y = y + margin2 + (isStart ? 1 : -1) * cellSize[1] / 2;
|
|
67597
67697
|
vAlign = isStart ? "bottom" : "top";
|
|
67598
67698
|
}
|
|
67599
67699
|
return {
|
|
@@ -67611,7 +67711,7 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67611
67711
|
const coordSys = calendarModel.coordinateSystem;
|
|
67612
67712
|
const pos = dayLabel.get("position");
|
|
67613
67713
|
let nameMap = dayLabel.get("nameMap");
|
|
67614
|
-
let
|
|
67714
|
+
let margin2 = dayLabel.get("margin");
|
|
67615
67715
|
const firstDayOfWeek = coordSys.getFirstDayOfWeek();
|
|
67616
67716
|
if (!nameMap || isString(nameMap)) {
|
|
67617
67717
|
if (nameMap) {
|
|
@@ -67622,10 +67722,10 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67622
67722
|
}
|
|
67623
67723
|
let start2 = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;
|
|
67624
67724
|
const cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];
|
|
67625
|
-
|
|
67725
|
+
margin2 = parsePercent2(margin2, Math.min(cellSize[1], cellSize[0]));
|
|
67626
67726
|
if (pos === "start") {
|
|
67627
67727
|
start2 = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;
|
|
67628
|
-
|
|
67728
|
+
margin2 = -margin2;
|
|
67629
67729
|
}
|
|
67630
67730
|
for (let i = 0; i < 7; i++) {
|
|
67631
67731
|
const tmpD = coordSys.getNextNDay(start2, i);
|
|
@@ -67634,7 +67734,7 @@ var CalendarView2 = class extends Component_default2 {
|
|
|
67634
67734
|
day = Math.abs((i + firstDayOfWeek) % 7);
|
|
67635
67735
|
const weekText = new Text_default({
|
|
67636
67736
|
z2: 30,
|
|
67637
|
-
style: extend(createTextStyle(dayLabel, {text: nameMap[day]}), this._weekTextPositionControl(point, orient, pos,
|
|
67737
|
+
style: extend(createTextStyle(dayLabel, {text: nameMap[day]}), this._weekTextPositionControl(point, orient, pos, margin2, cellSize))
|
|
67638
67738
|
});
|
|
67639
67739
|
group.add(weekText);
|
|
67640
67740
|
}
|
|
@@ -68995,6 +69095,10 @@ var AxisProxy = class {
|
|
|
68995
69095
|
this._percentWindow = [void 0, void 0];
|
|
68996
69096
|
} else {
|
|
68997
69097
|
const dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);
|
|
69098
|
+
if (dataWindow.valueWindow[0] === dataWindow.valueWindow[1]) {
|
|
69099
|
+
dataWindow.valueWindow[0] = dataWindow.valueWindow[0] - 0.5;
|
|
69100
|
+
dataWindow.valueWindow[1] = dataWindow.valueWindow[1] + 0.5;
|
|
69101
|
+
}
|
|
68998
69102
|
this._valueWindow = dataWindow.valueWindow;
|
|
68999
69103
|
this._percentWindow = dataWindow.percentWindow;
|
|
69000
69104
|
}
|
|
@@ -70742,6 +70846,10 @@ TooltipModel.defaultOption = {
|
|
|
70742
70846
|
width: 1,
|
|
70743
70847
|
type: "dashed",
|
|
70744
70848
|
textStyle: {}
|
|
70849
|
+
},
|
|
70850
|
+
pointerStyle: {
|
|
70851
|
+
r: 6,
|
|
70852
|
+
color: "rgb(41,98,255)"
|
|
70745
70853
|
}
|
|
70746
70854
|
},
|
|
70747
70855
|
textStyle: {
|
|
@@ -71237,6 +71345,7 @@ var TooltipView2 = class extends Component_default2 {
|
|
|
71237
71345
|
constructor() {
|
|
71238
71346
|
super(...arguments);
|
|
71239
71347
|
this.type = TooltipView2.type;
|
|
71348
|
+
this._lastPoint = [];
|
|
71240
71349
|
}
|
|
71241
71350
|
init(ecModel, api2) {
|
|
71242
71351
|
if (env_default.node || !api2.getDom()) {
|
|
@@ -71256,6 +71365,7 @@ var TooltipView2 = class extends Component_default2 {
|
|
|
71256
71365
|
this._tooltipModel = tooltipModel;
|
|
71257
71366
|
this._ecModel = ecModel;
|
|
71258
71367
|
this._api = api2;
|
|
71368
|
+
this._keepShowPoint(tooltipModel, ecModel);
|
|
71259
71369
|
if (!tooltipModel.get("showContent")) {
|
|
71260
71370
|
return;
|
|
71261
71371
|
}
|
|
@@ -71727,10 +71837,65 @@ var TooltipView2 = class extends Component_default2 {
|
|
|
71727
71837
|
from: this.uid
|
|
71728
71838
|
});
|
|
71729
71839
|
}
|
|
71840
|
+
_updatePointer(tooltipModel, ecModel, point) {
|
|
71841
|
+
const [x, y] = point;
|
|
71842
|
+
const grid = ecModel.getComponent("grid", 0);
|
|
71843
|
+
const yAxis = grid.coordinateSystem.getAxis("y");
|
|
71844
|
+
const xAxis = grid.coordinateSystem.getAxis("x");
|
|
71845
|
+
const cx = xAxis.toGlobalCoord(xAxis.dataToCoord(x));
|
|
71846
|
+
const cy = yAxis.toGlobalCoord(yAxis.dataToCoord(y));
|
|
71847
|
+
const pointerEl = this._pointEl;
|
|
71848
|
+
const pointerStyle = tooltipModel.getModel("axisPointer").get("pointerStyle");
|
|
71849
|
+
pointerEl.attr({
|
|
71850
|
+
style: {
|
|
71851
|
+
fill: pointerStyle.color
|
|
71852
|
+
},
|
|
71853
|
+
shape: {
|
|
71854
|
+
cx,
|
|
71855
|
+
cy
|
|
71856
|
+
}
|
|
71857
|
+
});
|
|
71858
|
+
}
|
|
71859
|
+
_keepShowPoint(tooltipModel, ecModel) {
|
|
71860
|
+
if (!this._pointEl) {
|
|
71861
|
+
return;
|
|
71862
|
+
}
|
|
71863
|
+
this.group.add(this._pointEl);
|
|
71864
|
+
this._updatePointer(tooltipModel, ecModel, this._lastPoint);
|
|
71865
|
+
}
|
|
71866
|
+
showPoint(tooltipModel, ecModel, api2, payload) {
|
|
71867
|
+
const pointerStyle = tooltipModel.getModel("axisPointer").get("pointerStyle");
|
|
71868
|
+
if (!this._pointEl) {
|
|
71869
|
+
this._pointEl = new Circle_default({
|
|
71870
|
+
shape: {
|
|
71871
|
+
r: pointerStyle.r
|
|
71872
|
+
},
|
|
71873
|
+
style: {
|
|
71874
|
+
fill: pointerStyle.color
|
|
71875
|
+
}
|
|
71876
|
+
});
|
|
71877
|
+
this.group.add(this._pointEl);
|
|
71878
|
+
}
|
|
71879
|
+
const {x, y} = payload;
|
|
71880
|
+
this._updatePointer(tooltipModel, ecModel, [x, y]);
|
|
71881
|
+
this._lastPoint = [x, y];
|
|
71882
|
+
}
|
|
71883
|
+
hidePoint(tooltipModel, ecModel, api2, payload) {
|
|
71884
|
+
if (this._pointEl) {
|
|
71885
|
+
this.group.remove(this._pointEl);
|
|
71886
|
+
this._pointEl = null;
|
|
71887
|
+
this._lastPoint = [];
|
|
71888
|
+
}
|
|
71889
|
+
}
|
|
71730
71890
|
dispose(ecModel, api2) {
|
|
71731
71891
|
if (env_default.node || !api2.getDom()) {
|
|
71732
71892
|
return;
|
|
71733
71893
|
}
|
|
71894
|
+
if (this._pointEl) {
|
|
71895
|
+
this.group.remove(this._pointEl);
|
|
71896
|
+
this._pointEl = null;
|
|
71897
|
+
this._lastPoint = [];
|
|
71898
|
+
}
|
|
71734
71899
|
clear(this, "_updatePosition");
|
|
71735
71900
|
this._tooltipContent.dispose();
|
|
71736
71901
|
unregister("itemTooltip", api2);
|
|
@@ -71877,6 +72042,16 @@ function install51(registers) {
|
|
|
71877
72042
|
event: "hideTip",
|
|
71878
72043
|
update: "tooltip:manuallyHideTip"
|
|
71879
72044
|
}, noop);
|
|
72045
|
+
registers.registerAction({
|
|
72046
|
+
type: "showPointer",
|
|
72047
|
+
event: "showPointer",
|
|
72048
|
+
update: "tooltip:showPoint"
|
|
72049
|
+
}, noop);
|
|
72050
|
+
registers.registerAction({
|
|
72051
|
+
type: "hidePointer",
|
|
72052
|
+
event: "hidePointer",
|
|
72053
|
+
update: "tooltip:hidePoint"
|
|
72054
|
+
}, noop);
|
|
71880
72055
|
}
|
|
71881
72056
|
|
|
71882
72057
|
// src/component/brush/preprocessor.ts
|
|
@@ -72788,6 +72963,7 @@ function getTextYOffset(height, align, paddings) {
|
|
|
72788
72963
|
return paddings;
|
|
72789
72964
|
}
|
|
72790
72965
|
}
|
|
72966
|
+
var margin = 6;
|
|
72791
72967
|
function getXYByPosition(rect, position2, width, height, frame_width = 0) {
|
|
72792
72968
|
let x = rect.x;
|
|
72793
72969
|
let y = rect.y;
|
|
@@ -72804,16 +72980,16 @@ function getXYByPosition(rect, position2, width, height, frame_width = 0) {
|
|
|
72804
72980
|
x = x + (rect.width - width) / 2 + frame_width;
|
|
72805
72981
|
break;
|
|
72806
72982
|
case "top":
|
|
72807
|
-
y = y + frame_width;
|
|
72983
|
+
y = y + frame_width + margin;
|
|
72808
72984
|
break;
|
|
72809
72985
|
case "bottom":
|
|
72810
|
-
y = y + rect.height - height - frame_width;
|
|
72986
|
+
y = y + rect.height - height - frame_width - margin;
|
|
72811
72987
|
break;
|
|
72812
72988
|
case "middle":
|
|
72813
72989
|
y = y + (rect.height - height) / 2 + frame_width;
|
|
72814
72990
|
break;
|
|
72815
72991
|
default:
|
|
72816
|
-
y = y + frame_width;
|
|
72992
|
+
y = y + frame_width + margin;
|
|
72817
72993
|
break;
|
|
72818
72994
|
}
|
|
72819
72995
|
}
|
|
@@ -75744,7 +75920,10 @@ var markerTypeCalculator2 = {
|
|
|
75744
75920
|
const closeValue = seriesData.getByRawIndex("close", lastIndex);
|
|
75745
75921
|
const openValue = seriesData.getByRawIndex("open", lastIndex);
|
|
75746
75922
|
const sign = openValue > closeValue ? -1 : 1;
|
|
75747
|
-
fill = dataItem.get(sign > 0 ?
|
|
75923
|
+
fill = dataItem.get(sign > 0 ? positiveColorQuery : negativeColorQuery);
|
|
75924
|
+
if (fill === "transparent") {
|
|
75925
|
+
fill = dataItem.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);
|
|
75926
|
+
}
|
|
75748
75927
|
} else if (isPlot(seriesModel.subType)) {
|
|
75749
75928
|
const isLinesPlot = seriesModel.subType === "linesPlot";
|
|
75750
75929
|
const dataItem = seriesData.getItemModel(lastIndex, true);
|
|
@@ -75780,7 +75959,10 @@ var markerTypeCalculator2 = {
|
|
|
75780
75959
|
const closeValue = seriesData.get("close", lastItem);
|
|
75781
75960
|
const openValue = seriesData.get("open", lastItem);
|
|
75782
75961
|
const sign = openValue > closeValue ? -1 : 1;
|
|
75783
|
-
fill = dataItem.get(sign > 0 ?
|
|
75962
|
+
fill = dataItem.get(sign > 0 ? positiveColorQuery : negativeColorQuery);
|
|
75963
|
+
if (fill === "transparent") {
|
|
75964
|
+
fill = dataItem.get(sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);
|
|
75965
|
+
}
|
|
75784
75966
|
}
|
|
75785
75967
|
return {
|
|
75786
75968
|
value: seriesData.getByRawIndex(item.valueDim, lastIndex),
|