@visactor/vchart 1.2.0-beta.2 → 1.2.0-beta.3
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/index.js +49 -22
- package/build/index.min.js +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +1 -1
- package/cjs/component/tooltip/handler/base.js +1 -1
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +1 -0
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js +11 -4
- package/cjs/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -0
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +3 -0
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/interface/event.d.ts +8 -0
- package/cjs/component/tooltip/interface/event.js +6 -0
- package/cjs/component/tooltip/interface/event.js.map +1 -0
- package/cjs/component/tooltip/interface/spec.d.ts +2 -2
- package/cjs/component/tooltip/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/processor/base.js +6 -2
- package/cjs/component/tooltip/processor/base.js.map +1 -1
- package/cjs/component/tooltip/processor/dimension-tooltip.js +3 -4
- package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/cjs/component/tooltip/processor/mark-tooltip.js +1 -2
- package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +4 -2
- package/cjs/component/tooltip/tooltip.js +21 -9
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/event.d.ts +3 -1
- package/cjs/constant/event.js +2 -1
- package/cjs/constant/event.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/cjs/event/interface.d.ts +3 -0
- package/cjs/event/interface.js.map +1 -1
- package/cjs/typings/tooltip/handler.d.ts +1 -0
- package/cjs/typings/tooltip/handler.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +1 -1
- package/esm/component/tooltip/handler/base.js +1 -1
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.d.ts +1 -0
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js +11 -4
- package/esm/component/tooltip/handler/canvas/canvas-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.d.ts +1 -0
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +3 -0
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/interface/event.d.ts +8 -0
- package/esm/component/tooltip/interface/event.js +2 -0
- package/esm/component/tooltip/interface/event.js.map +1 -0
- package/esm/component/tooltip/interface/spec.d.ts +2 -2
- package/esm/component/tooltip/interface/spec.js.map +1 -1
- package/esm/component/tooltip/processor/base.js +7 -1
- package/esm/component/tooltip/processor/base.js.map +1 -1
- package/esm/component/tooltip/processor/dimension-tooltip.js +2 -7
- package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/esm/component/tooltip/processor/mark-tooltip.js +0 -3
- package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +4 -2
- package/esm/component/tooltip/tooltip.js +23 -9
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/event.d.ts +3 -1
- package/esm/constant/event.js +2 -1
- package/esm/constant/event.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/esm/event/interface.d.ts +3 -0
- package/esm/event/interface.js.map +1 -1
- package/esm/typings/tooltip/handler.d.ts +1 -0
- package/esm/typings/tooltip/handler.js.map +1 -1
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -51599,6 +51599,8 @@
|
|
|
51599
51599
|
ChartEvent["legendItemClick"] = "legendItemClick";
|
|
51600
51600
|
ChartEvent["legendItemHover"] = "legendItemHover";
|
|
51601
51601
|
ChartEvent["legendItemUnHover"] = "legendItemUnHover";
|
|
51602
|
+
ChartEvent["tooltipShow"] = "tooltipShow";
|
|
51603
|
+
ChartEvent["tooltipHide"] = "tooltipHide";
|
|
51602
51604
|
})(ChartEvent || (ChartEvent = {}));
|
|
51603
51605
|
var Event_Source_Type;
|
|
51604
51606
|
(function (Event_Source_Type) {
|
|
@@ -58168,7 +58170,7 @@
|
|
|
58168
58170
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
58169
58171
|
Factory.registerRegion('region', Region);
|
|
58170
58172
|
Factory.registerLayout('base', Layout);
|
|
58171
|
-
const version = "1.2.0-beta.
|
|
58173
|
+
const version = "1.2.0-beta.3";
|
|
58172
58174
|
Logger.getInstance(LoggerLevel.Error);
|
|
58173
58175
|
|
|
58174
58176
|
var SeriesMarkNameEnum;
|
|
@@ -86600,7 +86602,7 @@
|
|
|
86600
86602
|
return TooltipResult.success;
|
|
86601
86603
|
};
|
|
86602
86604
|
hideTooltip(params) {
|
|
86603
|
-
this.changeTooltip(false, params);
|
|
86605
|
+
return this.changeTooltip(false, params);
|
|
86604
86606
|
}
|
|
86605
86607
|
release() {
|
|
86606
86608
|
this._cacheViewSpec = undefined;
|
|
@@ -87664,6 +87666,9 @@
|
|
|
87664
87666
|
_getParentElement(spec) {
|
|
87665
87667
|
return this._container ?? super._getParentElement(spec);
|
|
87666
87668
|
}
|
|
87669
|
+
isTooltipShown() {
|
|
87670
|
+
return this.getVisibility();
|
|
87671
|
+
}
|
|
87667
87672
|
reInit() {
|
|
87668
87673
|
super.reInit();
|
|
87669
87674
|
this._initStyle();
|
|
@@ -87715,7 +87720,9 @@
|
|
|
87715
87720
|
if (!visible) {
|
|
87716
87721
|
if (this._tooltipComponent && this._tooltipComponent.attribute.visible) {
|
|
87717
87722
|
this._tooltipComponent.hideAll();
|
|
87718
|
-
|
|
87723
|
+
this._tooltipComponent.setAttributes({
|
|
87724
|
+
visibleAll: false
|
|
87725
|
+
});
|
|
87719
87726
|
}
|
|
87720
87727
|
return;
|
|
87721
87728
|
}
|
|
@@ -87725,7 +87732,6 @@
|
|
|
87725
87732
|
const pos = actualTooltip?.position;
|
|
87726
87733
|
if (!params.changePositionOnly) {
|
|
87727
87734
|
this._tooltipComponent.setAttributes({
|
|
87728
|
-
visible: true,
|
|
87729
87735
|
...this._attributeCache,
|
|
87730
87736
|
...pos
|
|
87731
87737
|
});
|
|
@@ -87735,8 +87741,14 @@
|
|
|
87735
87741
|
}
|
|
87736
87742
|
if (!this._tooltipComponent.attribute.visible) {
|
|
87737
87743
|
this._tooltipComponent.showAll();
|
|
87744
|
+
this._tooltipComponent.setAttributes({
|
|
87745
|
+
visibleAll: true
|
|
87746
|
+
});
|
|
87738
87747
|
}
|
|
87739
87748
|
}
|
|
87749
|
+
isTooltipShown() {
|
|
87750
|
+
return this._tooltipComponent?.attribute.visibleAll;
|
|
87751
|
+
}
|
|
87740
87752
|
release() {
|
|
87741
87753
|
super.release();
|
|
87742
87754
|
this._layer?.release();
|
|
@@ -87750,6 +87762,12 @@
|
|
|
87750
87762
|
this.component = component;
|
|
87751
87763
|
}
|
|
87752
87764
|
_showTooltipByHandler = (data, params) => {
|
|
87765
|
+
this.component.event.emit(ChartEvent.tooltipShow, {
|
|
87766
|
+
...params,
|
|
87767
|
+
tooltipData: data,
|
|
87768
|
+
activeType: this.activeType,
|
|
87769
|
+
tooltip: this.component
|
|
87770
|
+
});
|
|
87753
87771
|
if (this.component.tooltipHandler?.showTooltip && isValid(data)) {
|
|
87754
87772
|
return this.component.tooltipHandler.showTooltip(this.activeType, data, params) ?? TooltipResult.success;
|
|
87755
87773
|
}
|
|
@@ -87772,14 +87790,9 @@
|
|
|
87772
87790
|
if (isNil(info)) {
|
|
87773
87791
|
return false;
|
|
87774
87792
|
}
|
|
87775
|
-
if (![TooltipHandlerType.dom, TooltipHandlerType.canvas].includes(this.component.tooltipHandler.type)) {
|
|
87776
|
-
return true;
|
|
87777
|
-
}
|
|
87778
87793
|
const helper = params.model?.tooltipHelper;
|
|
87779
|
-
|
|
87780
|
-
|
|
87781
|
-
}
|
|
87782
|
-
if (!helper.activeType.includes('dimension')) {
|
|
87794
|
+
const activeType = helper?.activeType ?? this.component.getSpec().activeType;
|
|
87795
|
+
if (!activeType.includes('dimension')) {
|
|
87783
87796
|
return false;
|
|
87784
87797
|
}
|
|
87785
87798
|
return true;
|
|
@@ -87868,9 +87881,6 @@
|
|
|
87868
87881
|
if (isNil(info)) {
|
|
87869
87882
|
return false;
|
|
87870
87883
|
}
|
|
87871
|
-
if (![TooltipHandlerType.dom, TooltipHandlerType.canvas].includes(this.component.tooltipHandler.type)) {
|
|
87872
|
-
return true;
|
|
87873
|
-
}
|
|
87874
87884
|
const helper = params.model?.tooltipHelper;
|
|
87875
87885
|
if (!helper?.activeType.includes('mark')) {
|
|
87876
87886
|
return false;
|
|
@@ -87930,6 +87940,10 @@
|
|
|
87930
87940
|
_cacheInfo;
|
|
87931
87941
|
_eventList = [];
|
|
87932
87942
|
_processor;
|
|
87943
|
+
_isTooltipShown = false;
|
|
87944
|
+
isTooltipShown() {
|
|
87945
|
+
return this._isTooltipShown;
|
|
87946
|
+
}
|
|
87933
87947
|
changeRegions(regions) {
|
|
87934
87948
|
}
|
|
87935
87949
|
_registerEvent() {
|
|
@@ -87956,6 +87970,7 @@
|
|
|
87956
87970
|
});
|
|
87957
87971
|
this._eventList = [];
|
|
87958
87972
|
this.tooltipHandler?.release?.();
|
|
87973
|
+
this._isTooltipShown = false;
|
|
87959
87974
|
}
|
|
87960
87975
|
_initHandler() {
|
|
87961
87976
|
const renderMode = this._spec.renderMode ?? 'html';
|
|
@@ -88070,6 +88085,9 @@
|
|
|
88070
88085
|
this._cacheInfo = tooltipInfo;
|
|
88071
88086
|
}
|
|
88072
88087
|
}
|
|
88088
|
+
if (success) {
|
|
88089
|
+
this._isTooltipShown = true;
|
|
88090
|
+
}
|
|
88073
88091
|
const vchart = this._option.globalInstance;
|
|
88074
88092
|
if (success && VChart.globalConfig.uniqueTooltip) {
|
|
88075
88093
|
VChart.hideTooltip(vchart.id);
|
|
@@ -88089,9 +88107,21 @@
|
|
|
88089
88107
|
return result;
|
|
88090
88108
|
};
|
|
88091
88109
|
_hideTooltipByHandler = (params) => {
|
|
88110
|
+
if (!this._isTooltipShown && !this.tooltipHandler?.isTooltipShown?.()) {
|
|
88111
|
+
return TooltipResult.success;
|
|
88112
|
+
}
|
|
88113
|
+
this.event.emit(ChartEvent.tooltipHide, {
|
|
88114
|
+
...params,
|
|
88115
|
+
tooltip: this
|
|
88116
|
+
});
|
|
88092
88117
|
if (this.tooltipHandler?.hideTooltip) {
|
|
88093
|
-
this.tooltipHandler.hideTooltip(params);
|
|
88118
|
+
const result = this.tooltipHandler.hideTooltip(params);
|
|
88119
|
+
if (!result) {
|
|
88120
|
+
this._isTooltipShown = false;
|
|
88121
|
+
}
|
|
88122
|
+
return result;
|
|
88094
88123
|
}
|
|
88124
|
+
return TooltipResult.failed;
|
|
88095
88125
|
};
|
|
88096
88126
|
_initTheme(theme) {
|
|
88097
88127
|
super._initTheme(theme);
|
|
@@ -88162,17 +88192,14 @@
|
|
|
88162
88192
|
return result;
|
|
88163
88193
|
}
|
|
88164
88194
|
hideTooltip() {
|
|
88165
|
-
|
|
88166
|
-
return false;
|
|
88167
|
-
}
|
|
88168
|
-
this._alwaysShow = false;
|
|
88169
|
-
this.tooltipHandler.hideTooltip({
|
|
88195
|
+
const params = {
|
|
88170
88196
|
changePositionOnly: false,
|
|
88171
88197
|
item: undefined,
|
|
88172
88198
|
datum: undefined,
|
|
88173
88199
|
source: Event_Source_Type.chart
|
|
88174
|
-
}
|
|
88175
|
-
|
|
88200
|
+
};
|
|
88201
|
+
this._alwaysShow = false;
|
|
88202
|
+
return !this._hideTooltipByHandler(params);
|
|
88176
88203
|
}
|
|
88177
88204
|
_isSameAsCacheInfo(nextInfo) {
|
|
88178
88205
|
if (nextInfo === this._cacheInfo) {
|