@visactor/vchart 2.0.11-alpha.0 → 2.0.11-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +28 -15
- package/build/index.js +28 -15
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/crosshair/base.js +1 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +2 -1
- package/cjs/component/tooltip/tooltip.js +17 -11
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/esm/component/crosshair/base.js +1 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +2 -1
- package/esm/component/tooltip/tooltip.js +16 -11
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/package.json +8 -8
package/build/index.es.js
CHANGED
|
@@ -61532,7 +61532,7 @@ const lookup = (data, opt) => {
|
|
|
61532
61532
|
});
|
|
61533
61533
|
};
|
|
61534
61534
|
|
|
61535
|
-
const version = "2.0.11-alpha.
|
|
61535
|
+
const version = "2.0.11-alpha.2";
|
|
61536
61536
|
|
|
61537
61537
|
const addVChartProperty = (data, op) => {
|
|
61538
61538
|
const context = op.beforeCall();
|
|
@@ -95882,7 +95882,10 @@ class Tooltip extends BaseComponent {
|
|
|
95882
95882
|
for (let i = 0, len = supportedTooltip.length; i < len; i++) {
|
|
95883
95883
|
const type = supportedTooltip[i];
|
|
95884
95884
|
const res = this.processor[type] ? this._showTooltipByMouseEvent(type, mouseEventData, params, isClick) : false;
|
|
95885
|
-
if (res) {
|
|
95885
|
+
if (res === 'unShowByOption') {
|
|
95886
|
+
success[type] = 'unShowByOption';
|
|
95887
|
+
}
|
|
95888
|
+
else if (res) {
|
|
95886
95889
|
success[type] = true;
|
|
95887
95890
|
break;
|
|
95888
95891
|
}
|
|
@@ -95895,23 +95898,19 @@ class Tooltip extends BaseComponent {
|
|
|
95895
95898
|
success.dimension = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick);
|
|
95896
95899
|
}
|
|
95897
95900
|
}
|
|
95898
|
-
if (
|
|
95899
|
-
this.
|
|
95901
|
+
if (success.mark !== true && success.group !== true && (success.dimension !== true || isNil$1(dimensionInfo))) {
|
|
95902
|
+
if (!this._cacheActiveType || success[this._cacheActiveType] !== 'unShowByOption') {
|
|
95903
|
+
this._handleChartMouseOut(params);
|
|
95904
|
+
}
|
|
95900
95905
|
}
|
|
95901
95906
|
else {
|
|
95902
95907
|
this._initEventOfTooltipContent();
|
|
95903
95908
|
}
|
|
95904
95909
|
};
|
|
95905
95910
|
this._showTooltipByMouseEvent = (activeType, mouseEventData, params, isClick, useCache) => {
|
|
95906
|
-
var _a
|
|
95907
|
-
if (
|
|
95908
|
-
|
|
95909
|
-
return false;
|
|
95910
|
-
}
|
|
95911
|
-
if (isObject$2(this._option.componentShowContent.tooltip) &&
|
|
95912
|
-
this._option.componentShowContent.tooltip[activeType] === false) {
|
|
95913
|
-
return false;
|
|
95914
|
-
}
|
|
95911
|
+
var _a;
|
|
95912
|
+
if (!this._showContentByEvent(activeType)) {
|
|
95913
|
+
return 'unShowByOption';
|
|
95915
95914
|
}
|
|
95916
95915
|
const processor = this.processor[activeType];
|
|
95917
95916
|
if (!processor.shouldHandleTooltip(params, mouseEventData.tooltipInfo[activeType])) {
|
|
@@ -95945,7 +95944,7 @@ class Tooltip extends BaseComponent {
|
|
|
95945
95944
|
}, this._spec.hideTimer);
|
|
95946
95945
|
}
|
|
95947
95946
|
}
|
|
95948
|
-
const vchart = (
|
|
95947
|
+
const vchart = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance;
|
|
95949
95948
|
if (success && VChart.globalConfig.uniqueTooltip && vchart) {
|
|
95950
95949
|
VChart.hideTooltip(vchart.id);
|
|
95951
95950
|
}
|
|
@@ -96170,6 +96169,19 @@ class Tooltip extends BaseComponent {
|
|
|
96170
96169
|
}
|
|
96171
96170
|
return throttle(callback, wait);
|
|
96172
96171
|
}
|
|
96172
|
+
_showContentByEvent(activeType) {
|
|
96173
|
+
var _a;
|
|
96174
|
+
if ((_a = this._option) === null || _a === void 0 ? void 0 : _a.componentShowContent) {
|
|
96175
|
+
if (this._option.componentShowContent.tooltip === false) {
|
|
96176
|
+
return false;
|
|
96177
|
+
}
|
|
96178
|
+
if (isObject$2(this._option.componentShowContent.tooltip) &&
|
|
96179
|
+
this._option.componentShowContent.tooltip[activeType] === false) {
|
|
96180
|
+
return false;
|
|
96181
|
+
}
|
|
96182
|
+
}
|
|
96183
|
+
return true;
|
|
96184
|
+
}
|
|
96173
96185
|
reInit(spec) {
|
|
96174
96186
|
var _a, _b, _c;
|
|
96175
96187
|
super.reInit(spec);
|
|
@@ -96200,6 +96212,7 @@ class Tooltip extends BaseComponent {
|
|
|
96200
96212
|
const result = showTooltip(datum, options, this);
|
|
96201
96213
|
if (result !== 'none') {
|
|
96202
96214
|
this._alwaysShow = !!(options === null || options === void 0 ? void 0 : options.alwaysShow);
|
|
96215
|
+
this._cacheActiveType = result;
|
|
96203
96216
|
}
|
|
96204
96217
|
return result;
|
|
96205
96218
|
}
|
|
@@ -96526,7 +96539,7 @@ class BaseCrossHair extends BaseComponent {
|
|
|
96526
96539
|
}
|
|
96527
96540
|
_registerEvent(eventName, isOut, click) {
|
|
96528
96541
|
var _a;
|
|
96529
|
-
if (
|
|
96542
|
+
if (((_a = this._option.componentShowContent) === null || _a === void 0 ? void 0 : _a.crosshair) === false) {
|
|
96530
96543
|
return;
|
|
96531
96544
|
}
|
|
96532
96545
|
const handler = isOut ? this._handleOutEvent : click ? this._handleClickInEvent : this._handleHoverInEvent;
|
package/build/index.js
CHANGED
|
@@ -61538,7 +61538,7 @@
|
|
|
61538
61538
|
});
|
|
61539
61539
|
};
|
|
61540
61540
|
|
|
61541
|
-
const version = "2.0.11-alpha.
|
|
61541
|
+
const version = "2.0.11-alpha.2";
|
|
61542
61542
|
|
|
61543
61543
|
const addVChartProperty = (data, op) => {
|
|
61544
61544
|
const context = op.beforeCall();
|
|
@@ -95888,7 +95888,10 @@
|
|
|
95888
95888
|
for (let i = 0, len = supportedTooltip.length; i < len; i++) {
|
|
95889
95889
|
const type = supportedTooltip[i];
|
|
95890
95890
|
const res = this.processor[type] ? this._showTooltipByMouseEvent(type, mouseEventData, params, isClick) : false;
|
|
95891
|
-
if (res) {
|
|
95891
|
+
if (res === 'unShowByOption') {
|
|
95892
|
+
success[type] = 'unShowByOption';
|
|
95893
|
+
}
|
|
95894
|
+
else if (res) {
|
|
95892
95895
|
success[type] = true;
|
|
95893
95896
|
break;
|
|
95894
95897
|
}
|
|
@@ -95901,23 +95904,19 @@
|
|
|
95901
95904
|
success.dimension = this._showTooltipByMouseEvent('dimension', mouseEventData, params, isClick);
|
|
95902
95905
|
}
|
|
95903
95906
|
}
|
|
95904
|
-
if (
|
|
95905
|
-
this.
|
|
95907
|
+
if (success.mark !== true && success.group !== true && (success.dimension !== true || isNil$1(dimensionInfo))) {
|
|
95908
|
+
if (!this._cacheActiveType || success[this._cacheActiveType] !== 'unShowByOption') {
|
|
95909
|
+
this._handleChartMouseOut(params);
|
|
95910
|
+
}
|
|
95906
95911
|
}
|
|
95907
95912
|
else {
|
|
95908
95913
|
this._initEventOfTooltipContent();
|
|
95909
95914
|
}
|
|
95910
95915
|
};
|
|
95911
95916
|
this._showTooltipByMouseEvent = (activeType, mouseEventData, params, isClick, useCache) => {
|
|
95912
|
-
var _a
|
|
95913
|
-
if (
|
|
95914
|
-
|
|
95915
|
-
return false;
|
|
95916
|
-
}
|
|
95917
|
-
if (isObject$2(this._option.componentShowContent.tooltip) &&
|
|
95918
|
-
this._option.componentShowContent.tooltip[activeType] === false) {
|
|
95919
|
-
return false;
|
|
95920
|
-
}
|
|
95917
|
+
var _a;
|
|
95918
|
+
if (!this._showContentByEvent(activeType)) {
|
|
95919
|
+
return 'unShowByOption';
|
|
95921
95920
|
}
|
|
95922
95921
|
const processor = this.processor[activeType];
|
|
95923
95922
|
if (!processor.shouldHandleTooltip(params, mouseEventData.tooltipInfo[activeType])) {
|
|
@@ -95951,7 +95950,7 @@
|
|
|
95951
95950
|
}, this._spec.hideTimer);
|
|
95952
95951
|
}
|
|
95953
95952
|
}
|
|
95954
|
-
const vchart = (
|
|
95953
|
+
const vchart = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance;
|
|
95955
95954
|
if (success && VChart.globalConfig.uniqueTooltip && vchart) {
|
|
95956
95955
|
VChart.hideTooltip(vchart.id);
|
|
95957
95956
|
}
|
|
@@ -96176,6 +96175,19 @@
|
|
|
96176
96175
|
}
|
|
96177
96176
|
return throttle(callback, wait);
|
|
96178
96177
|
}
|
|
96178
|
+
_showContentByEvent(activeType) {
|
|
96179
|
+
var _a;
|
|
96180
|
+
if ((_a = this._option) === null || _a === void 0 ? void 0 : _a.componentShowContent) {
|
|
96181
|
+
if (this._option.componentShowContent.tooltip === false) {
|
|
96182
|
+
return false;
|
|
96183
|
+
}
|
|
96184
|
+
if (isObject$2(this._option.componentShowContent.tooltip) &&
|
|
96185
|
+
this._option.componentShowContent.tooltip[activeType] === false) {
|
|
96186
|
+
return false;
|
|
96187
|
+
}
|
|
96188
|
+
}
|
|
96189
|
+
return true;
|
|
96190
|
+
}
|
|
96179
96191
|
reInit(spec) {
|
|
96180
96192
|
var _a, _b, _c;
|
|
96181
96193
|
super.reInit(spec);
|
|
@@ -96206,6 +96218,7 @@
|
|
|
96206
96218
|
const result = showTooltip(datum, options, this);
|
|
96207
96219
|
if (result !== 'none') {
|
|
96208
96220
|
this._alwaysShow = !!(options === null || options === void 0 ? void 0 : options.alwaysShow);
|
|
96221
|
+
this._cacheActiveType = result;
|
|
96209
96222
|
}
|
|
96210
96223
|
return result;
|
|
96211
96224
|
}
|
|
@@ -96532,7 +96545,7 @@
|
|
|
96532
96545
|
}
|
|
96533
96546
|
_registerEvent(eventName, isOut, click) {
|
|
96534
96547
|
var _a;
|
|
96535
|
-
if (
|
|
96548
|
+
if (((_a = this._option.componentShowContent) === null || _a === void 0 ? void 0 : _a.crosshair) === false) {
|
|
96536
96549
|
return;
|
|
96537
96550
|
}
|
|
96538
96551
|
const handler = isOut ? this._handleOutEvent : click ? this._handleClickInEvent : this._handleHoverInEvent;
|