@visactor/vchart 2.0.13-alpha.1 → 2.0.13-alpha.10
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 +98 -36
- package/build/index.js +98 -36
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/compile/compiler.d.ts +1 -0
- package/cjs/compile/compiler.js +3 -0
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +2 -1
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +4 -1
- package/cjs/component/brush/brush.js +18 -2
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +1 -0
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/crosshair/interface/spec.d.ts +1 -0
- package/cjs/component/crosshair/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/interface/common.d.ts +1 -0
- package/cjs/component/tooltip/interface/common.js.map +1 -1
- package/cjs/component/tooltip/processor/base.js +1 -1
- package/cjs/component/tooltip/processor/base.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +1 -0
- package/cjs/component/tooltip/tooltip.js +3 -2
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +10 -2
- package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/cjs/core/interface.d.ts +9 -1
- package/cjs/core/interface.js.map +1 -1
- package/cjs/core/vchart.d.ts +4 -0
- package/cjs/core/vchart.js +10 -1
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/events/dimension/dimension-hover.js +4 -2
- package/cjs/event/events/dimension/dimension-hover.js.map +1 -1
- package/cjs/interaction/interface/trigger.d.ts +1 -1
- package/cjs/interaction/interface/trigger.js.map +1 -1
- package/cjs/interaction/triggers/base.d.ts +3 -2
- package/cjs/interaction/triggers/base.js +2 -2
- package/cjs/interaction/triggers/base.js.map +1 -1
- package/cjs/interaction/triggers/element-highlight.d.ts +3 -3
- package/cjs/interaction/triggers/element-highlight.js +11 -11
- package/cjs/interaction/triggers/element-highlight.js.map +1 -1
- package/cjs/interaction/triggers/element-select.d.ts +3 -3
- package/cjs/interaction/triggers/element-select.js +13 -13
- package/cjs/interaction/triggers/element-select.js.map +1 -1
- package/esm/compile/compiler.d.ts +1 -0
- package/esm/compile/compiler.js +3 -0
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compilable-item.d.ts +2 -1
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/component/brush/brush.d.ts +4 -1
- package/esm/component/brush/brush.js +18 -2
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +1 -0
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/crosshair/interface/spec.d.ts +1 -0
- package/esm/component/crosshair/interface/spec.js.map +1 -1
- package/esm/component/tooltip/interface/common.d.ts +1 -0
- package/esm/component/tooltip/interface/common.js.map +1 -1
- package/esm/component/tooltip/processor/base.js +1 -1
- package/esm/component/tooltip/processor/base.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +1 -0
- package/esm/component/tooltip/tooltip.js +3 -2
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +10 -2
- package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/esm/core/interface.d.ts +9 -1
- package/esm/core/interface.js.map +1 -1
- package/esm/core/vchart.d.ts +4 -0
- package/esm/core/vchart.js +10 -1
- package/esm/core/vchart.js.map +1 -1
- package/esm/event/event.js +1 -1
- package/esm/event/event.js.map +1 -1
- package/esm/event/events/dimension/dimension-hover.js +4 -2
- package/esm/event/events/dimension/dimension-hover.js.map +1 -1
- package/esm/interaction/interface/trigger.d.ts +1 -1
- package/esm/interaction/interface/trigger.js.map +1 -1
- package/esm/interaction/triggers/base.d.ts +3 -2
- package/esm/interaction/triggers/base.js +2 -2
- package/esm/interaction/triggers/base.js.map +1 -1
- package/esm/interaction/triggers/element-highlight.d.ts +3 -3
- package/esm/interaction/triggers/element-highlight.js +11 -11
- package/esm/interaction/triggers/element-highlight.js.map +1 -1
- package/esm/interaction/triggers/element-select.d.ts +3 -3
- package/esm/interaction/triggers/element-select.js +13 -13
- package/esm/interaction/triggers/element-select.js.map +1 -1
- package/package.json +9 -9
package/build/index.es.js
CHANGED
|
@@ -51096,6 +51096,7 @@ loadBrushComponent();
|
|
|
51096
51096
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
51097
51097
|
constructor(attributes, options) {
|
|
51098
51098
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeBrushState = !1, this._activeDrawState = !1, this._cacheDrawPoints = [], this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._firstUpdate = !0, this._onBrushStart = e => {
|
|
51099
|
+
if (!1 === this.attribute.interactive) return;
|
|
51099
51100
|
if (!1 === this._beforeBrushEvent(e)) return;
|
|
51100
51101
|
const {
|
|
51101
51102
|
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
@@ -51104,11 +51105,11 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51104
51105
|
} = this.attribute;
|
|
51105
51106
|
array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), e.stopPropagation(), this._firstUpdate = !0, this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._startPos = this.eventPosToStagePos(e), this._cacheDrawPoints = [this._startPos];
|
|
51106
51107
|
}, this._onBrushing = e => {
|
|
51107
|
-
!1 !== this._beforeBrushEvent(e) && (this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e))));
|
|
51108
|
+
!1 !== this.attribute.interactive && !1 !== this._beforeBrushEvent(e) && (this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e))));
|
|
51108
51109
|
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
51109
|
-
this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
|
|
51110
|
+
!1 !== this.attribute.interactive && (this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51110
51111
|
}, this._onBrushClear = e => {
|
|
51111
|
-
!1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51112
|
+
!1 !== this.attribute.interactive && !1 !== this._beforeBrushEvent(e) && (e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1);
|
|
51112
51113
|
};
|
|
51113
51114
|
}
|
|
51114
51115
|
_bindBrushEvents() {
|
|
@@ -51120,6 +51121,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51120
51121
|
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
51121
51122
|
}
|
|
51122
51123
|
_initDraw(e) {
|
|
51124
|
+
if (!1 === this.attribute.interactive) return;
|
|
51123
51125
|
const {
|
|
51124
51126
|
brushMode: brushMode
|
|
51125
51127
|
} = this.attribute,
|
|
@@ -51128,6 +51130,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51128
51130
|
}
|
|
51129
51131
|
_initMove(e) {
|
|
51130
51132
|
var _a, _b;
|
|
51133
|
+
if (!1 === this.attribute.interactive) return;
|
|
51131
51134
|
this._cacheMovePoint = this.eventPosToStagePos(e), this._operatingMaskMoveDx = null !== (_a = this._operatingMask.attribute.dx) && void 0 !== _a ? _a : 0, this._operatingMaskMoveDy = null !== (_b = this._operatingMask.attribute.dy) && void 0 !== _b ? _b : 0;
|
|
51132
51135
|
const {
|
|
51133
51136
|
interactiveRange: interactiveRange
|
|
@@ -51152,6 +51155,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51152
51155
|
}
|
|
51153
51156
|
_drawing(e) {
|
|
51154
51157
|
var _a;
|
|
51158
|
+
if (!1 === this.attribute.interactive) return;
|
|
51155
51159
|
const pos = this.eventPosToStagePos(e),
|
|
51156
51160
|
{
|
|
51157
51161
|
brushType: brushType,
|
|
@@ -51176,6 +51180,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51176
51180
|
(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold) && (1 !== Object.keys(this._brushMaskAABBBoundsDict).length || this._activeBrushState ? this._dispatchBrushEvent(IOperateType.drawing, e) : (this._activeBrushState = !0, this._dispatchBrushEvent(IOperateType.brushActive, e)));
|
|
51177
51181
|
}
|
|
51178
51182
|
_moving(e) {
|
|
51183
|
+
if (!1 === this.attribute.interactive) return;
|
|
51179
51184
|
const startPos = this._cacheMovePoint,
|
|
51180
51185
|
pos = this.eventPosToStagePos(e);
|
|
51181
51186
|
if (pos.x === (null == startPos ? void 0 : startPos.x) && pos.y === (null == startPos ? void 0 : startPos.y)) return;
|
|
@@ -51189,6 +51194,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51189
51194
|
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
51190
51195
|
}
|
|
51191
51196
|
_drawEnd(e) {
|
|
51197
|
+
if (!1 === this.attribute.interactive) return;
|
|
51192
51198
|
const {
|
|
51193
51199
|
removeOnClick = !0,
|
|
51194
51200
|
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
@@ -51206,7 +51212,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
51206
51212
|
}
|
|
51207
51213
|
}
|
|
51208
51214
|
_moveEnd(e) {
|
|
51209
|
-
this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e);
|
|
51215
|
+
!1 !== this.attribute.interactive && (this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e));
|
|
51210
51216
|
}
|
|
51211
51217
|
render() {
|
|
51212
51218
|
this._bindBrushEvents();
|
|
@@ -53862,7 +53868,7 @@ let Event$1 = class Event {
|
|
|
53862
53868
|
if (ComposedEventCtor) {
|
|
53863
53869
|
const composedEvent = new ComposedEventCtor(this._eventDispatcher, this._mode);
|
|
53864
53870
|
composedEvent.register(eType, handler);
|
|
53865
|
-
this._composedEventMap.set(callback, {
|
|
53871
|
+
this._composedEventMap.set(handler.callback, {
|
|
53866
53872
|
eventType: eType,
|
|
53867
53873
|
event: composedEvent
|
|
53868
53874
|
});
|
|
@@ -54899,6 +54905,9 @@ class Compiler {
|
|
|
54899
54905
|
getRootGroup() {
|
|
54900
54906
|
return this._rootGroup;
|
|
54901
54907
|
}
|
|
54908
|
+
getOption() {
|
|
54909
|
+
return this._option;
|
|
54910
|
+
}
|
|
54902
54911
|
constructor(container, option) {
|
|
54903
54912
|
this._count = 0;
|
|
54904
54913
|
this._rootMarks = [];
|
|
@@ -60020,9 +60029,9 @@ class BaseTrigger {
|
|
|
60020
60029
|
});
|
|
60021
60030
|
}
|
|
60022
60031
|
}
|
|
60023
|
-
start(g) {
|
|
60032
|
+
start(g, e) {
|
|
60024
60033
|
}
|
|
60025
|
-
reset(g) {
|
|
60034
|
+
reset(g, e) {
|
|
60026
60035
|
}
|
|
60027
60036
|
dispatchEvent(type, params) {
|
|
60028
60037
|
if (this.options.event) {
|
|
@@ -60053,17 +60062,17 @@ class ElementHighlight extends BaseTrigger {
|
|
|
60053
60062
|
constructor(options) {
|
|
60054
60063
|
super(options);
|
|
60055
60064
|
this.type = "element-highlight";
|
|
60056
|
-
this.resetAll = () => {
|
|
60065
|
+
this.resetAll = (e) => {
|
|
60057
60066
|
const { highlightState, blurState, interaction } = this.options;
|
|
60058
60067
|
if (this._lastGraphic) {
|
|
60059
60068
|
interaction.clearAllStatesOfTrigger(this, highlightState, blurState);
|
|
60060
|
-
this.dispatchEvent('reset', { graphics: [this._lastGraphic], options: this.options });
|
|
60069
|
+
this.dispatchEvent('reset', Object.assign({ graphics: [this._lastGraphic], options: this.options }, e));
|
|
60061
60070
|
this._lastGraphic = null;
|
|
60062
60071
|
interaction.setStatedGraphics(this, []);
|
|
60063
60072
|
}
|
|
60064
60073
|
};
|
|
60065
60074
|
this.handleStart = (e) => {
|
|
60066
|
-
this.start(e.item);
|
|
60075
|
+
this.start(e.item, e);
|
|
60067
60076
|
};
|
|
60068
60077
|
this.handleReset = (e) => {
|
|
60069
60078
|
const { interaction } = this.options;
|
|
@@ -60074,10 +60083,10 @@ class ElementHighlight extends BaseTrigger {
|
|
|
60074
60083
|
const markGraphic = e.item;
|
|
60075
60084
|
const hasActiveElement = markGraphic && this._markSet.getMarkInId(markGraphic.context.markId);
|
|
60076
60085
|
if (this._resetType.includes('view') && !hasActiveElement) {
|
|
60077
|
-
this.resetAll();
|
|
60086
|
+
this.resetAll(e);
|
|
60078
60087
|
}
|
|
60079
60088
|
else if (this._resetType.includes('self') && hasActiveElement) {
|
|
60080
|
-
this.resetAll();
|
|
60089
|
+
this.resetAll(e);
|
|
60081
60090
|
}
|
|
60082
60091
|
};
|
|
60083
60092
|
this.options = Object.assign({}, defaultOptions$6, options);
|
|
@@ -60109,7 +60118,7 @@ class ElementHighlight extends BaseTrigger {
|
|
|
60109
60118
|
events.push({ type: eventName, handler: this.handleReset });
|
|
60110
60119
|
return events;
|
|
60111
60120
|
}
|
|
60112
|
-
start(markGraphic) {
|
|
60121
|
+
start(markGraphic, e) {
|
|
60113
60122
|
if (markGraphic && this._markSet.getMarkInId(markGraphic.context.markId)) {
|
|
60114
60123
|
const { highlightState, blurState, interaction } = this.options;
|
|
60115
60124
|
if (this._lastGraphic === markGraphic) {
|
|
@@ -60118,20 +60127,20 @@ class ElementHighlight extends BaseTrigger {
|
|
|
60118
60127
|
const newStatedGraphics = interaction.updateStates(this, [markGraphic], interaction.getStatedGraphics(this), highlightState, blurState);
|
|
60119
60128
|
interaction.setStatedGraphics(this, newStatedGraphics);
|
|
60120
60129
|
this._lastGraphic = markGraphic;
|
|
60121
|
-
this.dispatchEvent('start', { graphics: newStatedGraphics, options: this.options });
|
|
60130
|
+
this.dispatchEvent('start', Object.assign({ graphics: newStatedGraphics, options: this.options }, e));
|
|
60122
60131
|
}
|
|
60123
60132
|
else if (this._lastGraphic && this._resetType === 'view') {
|
|
60124
|
-
this.resetAll();
|
|
60133
|
+
this.resetAll(e);
|
|
60125
60134
|
}
|
|
60126
60135
|
}
|
|
60127
|
-
reset(markGraphic) {
|
|
60136
|
+
reset(markGraphic, e) {
|
|
60128
60137
|
if (markGraphic) {
|
|
60129
60138
|
if (this._markSet.getMarkInId(markGraphic.context.markId)) {
|
|
60130
60139
|
markGraphic.removeState([this.options.highlightState, this.options.blurState]);
|
|
60131
60140
|
}
|
|
60132
60141
|
}
|
|
60133
60142
|
else {
|
|
60134
|
-
this.resetAll();
|
|
60143
|
+
this.resetAll(e);
|
|
60135
60144
|
}
|
|
60136
60145
|
}
|
|
60137
60146
|
}
|
|
@@ -60150,17 +60159,17 @@ class ElementSelect extends BaseTrigger {
|
|
|
60150
60159
|
super(options);
|
|
60151
60160
|
this.type = "element-select";
|
|
60152
60161
|
this._resetType = [];
|
|
60153
|
-
this.resetAll = () => {
|
|
60162
|
+
this.resetAll = (e) => {
|
|
60154
60163
|
const { state, reverseState, interaction } = this.options;
|
|
60155
60164
|
const statedGraphics = interaction.getStatedGraphics(this);
|
|
60156
60165
|
if (statedGraphics && statedGraphics.length) {
|
|
60157
60166
|
interaction.clearAllStatesOfTrigger(this, state, reverseState);
|
|
60158
|
-
this.dispatchEvent('reset', { graphics: statedGraphics, options: this.options });
|
|
60167
|
+
this.dispatchEvent('reset', Object.assign({ graphics: statedGraphics, options: this.options }, e));
|
|
60159
60168
|
interaction.setStatedGraphics(this, []);
|
|
60160
60169
|
}
|
|
60161
60170
|
};
|
|
60162
60171
|
this.handleStart = (e) => {
|
|
60163
|
-
this.start(e.item);
|
|
60172
|
+
this.start(e.item, e);
|
|
60164
60173
|
};
|
|
60165
60174
|
this.handleReset = (e) => {
|
|
60166
60175
|
const { interaction } = this.options;
|
|
@@ -60171,10 +60180,10 @@ class ElementSelect extends BaseTrigger {
|
|
|
60171
60180
|
const markGraphic = e.item;
|
|
60172
60181
|
const hasActiveElement = markGraphic && this._markSet.getMarkInId(markGraphic.context.markId);
|
|
60173
60182
|
if (this._resetType.includes('view') && !hasActiveElement) {
|
|
60174
|
-
this.resetAll();
|
|
60183
|
+
this.resetAll(e);
|
|
60175
60184
|
}
|
|
60176
60185
|
else if (this._resetType.includes('self') && hasActiveElement) {
|
|
60177
|
-
this.resetAll();
|
|
60186
|
+
this.resetAll(e);
|
|
60178
60187
|
}
|
|
60179
60188
|
};
|
|
60180
60189
|
this.options = Object.assign({}, defaultOptions$5, options);
|
|
@@ -60204,7 +60213,7 @@ class ElementSelect extends BaseTrigger {
|
|
|
60204
60213
|
this._resetType = resetType;
|
|
60205
60214
|
return events;
|
|
60206
60215
|
}
|
|
60207
|
-
start(markGraphic) {
|
|
60216
|
+
start(markGraphic, e) {
|
|
60208
60217
|
const { state, reverseState, isMultiple, interaction } = this.options;
|
|
60209
60218
|
const statedGraphics = interaction.getStatedGraphics(this);
|
|
60210
60219
|
if (markGraphic && this._markSet.getMarkInId(markGraphic.context.markId)) {
|
|
@@ -60215,7 +60224,7 @@ class ElementSelect extends BaseTrigger {
|
|
|
60215
60224
|
interaction.setStatedGraphics(this, interaction.updateStates(this, newStatedGraphics, statedGraphics, state, reverseState));
|
|
60216
60225
|
}
|
|
60217
60226
|
else {
|
|
60218
|
-
this.resetAll();
|
|
60227
|
+
this.resetAll(e);
|
|
60219
60228
|
}
|
|
60220
60229
|
}
|
|
60221
60230
|
}
|
|
@@ -60226,26 +60235,26 @@ class ElementSelect extends BaseTrigger {
|
|
|
60226
60235
|
markGraphic.addState(state, true);
|
|
60227
60236
|
const newStatedGraphics = this.options.interaction.updateStates(this, isMultiple && statedGraphics ? [...statedGraphics, markGraphic] : [markGraphic], statedGraphics, state, reverseState);
|
|
60228
60237
|
interaction.setStatedGraphics(this, newStatedGraphics);
|
|
60229
|
-
this.dispatchEvent('start', { graphics: newStatedGraphics, options: this.options });
|
|
60238
|
+
this.dispatchEvent('start', Object.assign({ graphics: newStatedGraphics, options: this.options }, e));
|
|
60230
60239
|
if (this._resetType.includes('timeout')) {
|
|
60231
60240
|
this._timer = setTimeout(() => {
|
|
60232
|
-
this.resetAll();
|
|
60241
|
+
this.resetAll(e);
|
|
60233
60242
|
}, this.options.triggerOff);
|
|
60234
60243
|
}
|
|
60235
60244
|
}
|
|
60236
60245
|
}
|
|
60237
60246
|
else if (this._resetType.includes('view') && statedGraphics && statedGraphics.length) {
|
|
60238
|
-
this.resetAll();
|
|
60247
|
+
this.resetAll(e);
|
|
60239
60248
|
}
|
|
60240
60249
|
}
|
|
60241
|
-
reset(markGraphic) {
|
|
60250
|
+
reset(markGraphic, e) {
|
|
60242
60251
|
if (markGraphic) {
|
|
60243
60252
|
if (this._markSet.getMarkInId(markGraphic.context.markId)) {
|
|
60244
60253
|
markGraphic.removeState([this.options.state, this.options.reverseState]);
|
|
60245
60254
|
}
|
|
60246
60255
|
}
|
|
60247
60256
|
else {
|
|
60248
|
-
this.resetAll();
|
|
60257
|
+
this.resetAll(e);
|
|
60249
60258
|
}
|
|
60250
60259
|
}
|
|
60251
60260
|
}
|
|
@@ -60375,6 +60384,7 @@ class VChart {
|
|
|
60375
60384
|
this._observer = null;
|
|
60376
60385
|
this._context = {};
|
|
60377
60386
|
this._renderState = RenderStateEnum.render;
|
|
60387
|
+
this._disableDimensionHoverEvent = false;
|
|
60378
60388
|
this._doResize = () => {
|
|
60379
60389
|
const { width, height } = this.getCurrentSize();
|
|
60380
60390
|
if (this._currentSize.width !== width || this._currentSize.height !== height) {
|
|
@@ -60519,7 +60529,7 @@ class VChart {
|
|
|
60519
60529
|
this._compiler.updateLayoutTag();
|
|
60520
60530
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
60521
60531
|
this._initDataSet(this._option.dataSet);
|
|
60522
|
-
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
60532
|
+
this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
|
|
60523
60533
|
this._bindResizeEvent();
|
|
60524
60534
|
this._bindViewEvent();
|
|
60525
60535
|
this._initChartPlugin();
|
|
@@ -61172,7 +61182,7 @@ class VChart {
|
|
|
61172
61182
|
resize = true;
|
|
61173
61183
|
}
|
|
61174
61184
|
const lasAutoSize = this._autoSize;
|
|
61175
|
-
this._autoSize = isTrueBrowser(this._option.mode) ? (_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true : false;
|
|
61185
|
+
this._autoSize = isTrueBrowser(this._option.mode) ? ((_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true) : false;
|
|
61176
61186
|
if (this._autoSize !== lasAutoSize) {
|
|
61177
61187
|
resize = true;
|
|
61178
61188
|
}
|
|
@@ -61413,6 +61423,22 @@ class VChart {
|
|
|
61413
61423
|
var _a;
|
|
61414
61424
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
61415
61425
|
}
|
|
61426
|
+
disableDimensionHoverEvent(value) {
|
|
61427
|
+
if (value !== undefined) {
|
|
61428
|
+
this._disableDimensionHoverEvent = value;
|
|
61429
|
+
}
|
|
61430
|
+
return this._disableDimensionHoverEvent;
|
|
61431
|
+
}
|
|
61432
|
+
disableCrossHair(value = true) {
|
|
61433
|
+
this.getChart()
|
|
61434
|
+
.getComponentsByKey('crosshair')
|
|
61435
|
+
.forEach(crosshair => (crosshair.enable = !value));
|
|
61436
|
+
}
|
|
61437
|
+
disableTooltip(value = true) {
|
|
61438
|
+
this.getChart()
|
|
61439
|
+
.getComponentsByKey('tooltip')
|
|
61440
|
+
.forEach(tooltip => (tooltip.enable = !value));
|
|
61441
|
+
}
|
|
61416
61442
|
showCrosshair(cb) {
|
|
61417
61443
|
var _a;
|
|
61418
61444
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.showCrosshair(cb);
|
|
@@ -64433,7 +64459,8 @@ class DimensionHoverEvent extends DimensionEvent {
|
|
|
64433
64459
|
super(...arguments);
|
|
64434
64460
|
this._cacheDimensionInfo = null;
|
|
64435
64461
|
this.onMouseMove = (params) => {
|
|
64436
|
-
|
|
64462
|
+
var _a, _b, _c, _d;
|
|
64463
|
+
if (!params || ((_d = (_c = (_b = (_a = params.chart) === null || _a === void 0 ? void 0 : _a.getOption()) === null || _b === void 0 ? void 0 : _b.globalInstance) === null || _c === void 0 ? void 0 : _c.disableDimensionHoverEvent) === null || _d === void 0 ? void 0 : _d.call(_c))) {
|
|
64437
64464
|
return;
|
|
64438
64465
|
}
|
|
64439
64466
|
const x = params.event.viewX;
|
|
@@ -64455,7 +64482,8 @@ class DimensionHoverEvent extends DimensionEvent {
|
|
|
64455
64482
|
}
|
|
64456
64483
|
};
|
|
64457
64484
|
this.onMouseOut = (params) => {
|
|
64458
|
-
|
|
64485
|
+
var _a, _b, _c, _d;
|
|
64486
|
+
if (!params || ((_d = (_c = (_b = (_a = params.chart) === null || _a === void 0 ? void 0 : _a.getOption()) === null || _b === void 0 ? void 0 : _b.globalInstance) === null || _c === void 0 ? void 0 : _c.disableDimensionHoverEvent) === null || _d === void 0 ? void 0 : _d.call(_c))) {
|
|
64459
64487
|
return;
|
|
64460
64488
|
}
|
|
64461
64489
|
this._callback.call(null, Object.assign(Object.assign({}, params), { action: 'leave', dimensionInfo: this._cacheDimensionInfo ? this._cacheDimensionInfo.slice() : [] }));
|
|
@@ -71753,6 +71781,9 @@ class BaseTooltipProcessor {
|
|
|
71753
71781
|
}
|
|
71754
71782
|
shouldHandleTooltip(params, info) {
|
|
71755
71783
|
var _a, _b;
|
|
71784
|
+
if (!this.component.enable) {
|
|
71785
|
+
return false;
|
|
71786
|
+
}
|
|
71756
71787
|
if (isNil$1(info)) {
|
|
71757
71788
|
return false;
|
|
71758
71789
|
}
|
|
@@ -95664,11 +95695,15 @@ function showTooltip(datum, options, component) {
|
|
|
95664
95695
|
});
|
|
95665
95696
|
return originDatum;
|
|
95666
95697
|
};
|
|
95698
|
+
const transform = region.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse();
|
|
95667
95699
|
const getMockEvent = (originPos) => {
|
|
95668
95700
|
var _a, _b;
|
|
95669
95701
|
const pos = bound(originPos);
|
|
95670
|
-
const
|
|
95671
|
-
const
|
|
95702
|
+
const tempX = (_a = opt.x) !== null && _a !== void 0 ? _a : regionPos.x + pos.x;
|
|
95703
|
+
const tempY = (_b = opt.y) !== null && _b !== void 0 ? _b : regionPos.y + pos.y;
|
|
95704
|
+
const canvasPoint = { x: 0, y: 0 };
|
|
95705
|
+
transform.transformPoint({ x: tempX, y: tempY }, canvasPoint);
|
|
95706
|
+
const { x: canvasX, y: canvasY } = canvasPoint;
|
|
95672
95707
|
return {
|
|
95673
95708
|
canvasX,
|
|
95674
95709
|
canvasY,
|
|
@@ -96046,6 +96081,7 @@ class Tooltip extends BaseComponent {
|
|
|
96046
96081
|
this.specKey = 'tooltip';
|
|
96047
96082
|
this.layoutType = 'none';
|
|
96048
96083
|
this._isReleased = false;
|
|
96084
|
+
this.enable = true;
|
|
96049
96085
|
this._alwaysShow = false;
|
|
96050
96086
|
this._eventList = [];
|
|
96051
96087
|
this._isTooltipShown = false;
|
|
@@ -103201,6 +103237,9 @@ class Brush extends BaseComponent {
|
|
|
103201
103237
|
this._initMarkBrushState(componentIndex, '');
|
|
103202
103238
|
brushComponent.children[0].removeAllChild();
|
|
103203
103239
|
}
|
|
103240
|
+
_shouldEnableInteractive() {
|
|
103241
|
+
return this.getOption().getCompiler().getOption().interactive !== false;
|
|
103242
|
+
}
|
|
103204
103243
|
_createBrushComponent(region, componentIndex) {
|
|
103205
103244
|
var _a, _b;
|
|
103206
103245
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -103214,10 +103253,16 @@ class Brush extends BaseComponent {
|
|
|
103214
103253
|
this._emitEvent(ChartEvent.brushActive, region, e);
|
|
103215
103254
|
});
|
|
103216
103255
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
103256
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103257
|
+
this._option.globalInstance.disableDimensionHoverEvent(true);
|
|
103258
|
+
}
|
|
103217
103259
|
this._setRegionMarkPickable(region, true);
|
|
103218
103260
|
this._emitEvent(ChartEvent.brushStart, region, e);
|
|
103219
103261
|
});
|
|
103220
103262
|
brush.addEventListener(IOperateType.moveStart, (e) => {
|
|
103263
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103264
|
+
this._option.globalInstance.disableDimensionHoverEvent(true);
|
|
103265
|
+
}
|
|
103221
103266
|
this._setRegionMarkPickable(region, true);
|
|
103222
103267
|
this._emitEvent(ChartEvent.brushStart, region, e);
|
|
103223
103268
|
});
|
|
@@ -103232,12 +103277,18 @@ class Brush extends BaseComponent {
|
|
|
103232
103277
|
this._emitEvent(ChartEvent.brushChange, region, e);
|
|
103233
103278
|
});
|
|
103234
103279
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
103280
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103281
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103282
|
+
}
|
|
103235
103283
|
this._setRegionMarkPickable(region, true);
|
|
103236
103284
|
this._initMarkBrushState(componentIndex, '');
|
|
103237
103285
|
this._emitEvent(ChartEvent.brushClear, region, e);
|
|
103238
103286
|
});
|
|
103239
103287
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
103240
103288
|
var _a;
|
|
103289
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103290
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103291
|
+
}
|
|
103241
103292
|
this._setRegionMarkPickable(region, true);
|
|
103242
103293
|
const { operateMask } = e.detail;
|
|
103243
103294
|
const { updateElementsState = true } = this._spec;
|
|
@@ -103261,6 +103312,9 @@ class Brush extends BaseComponent {
|
|
|
103261
103312
|
}
|
|
103262
103313
|
});
|
|
103263
103314
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
103315
|
+
if (this._spec.disableDimensionHoverWhenBrushing) {
|
|
103316
|
+
this._option.globalInstance.disableDimensionHoverEvent(false);
|
|
103317
|
+
}
|
|
103264
103318
|
this._setRegionMarkPickable(region, true);
|
|
103265
103319
|
const { operateMask } = e.detail;
|
|
103266
103320
|
const { updateElementsState = true } = this._spec;
|
|
@@ -103286,7 +103340,8 @@ class Brush extends BaseComponent {
|
|
|
103286
103340
|
maxX: seriesRegionEndX
|
|
103287
103341
|
},
|
|
103288
103342
|
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
103289
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
103343
|
+
yRange: [seriesRegionStartY, seriesRegionEndY],
|
|
103344
|
+
interactive: this._shouldEnableInteractive()
|
|
103290
103345
|
};
|
|
103291
103346
|
}
|
|
103292
103347
|
_transformBrushedMarkAttr(brushedStyle) {
|
|
@@ -103307,6 +103362,7 @@ class Brush extends BaseComponent {
|
|
|
103307
103362
|
}
|
|
103308
103363
|
_handleBrushChange(region, e) {
|
|
103309
103364
|
const { operateMask } = e.detail;
|
|
103365
|
+
this._operateMask = operateMask;
|
|
103310
103366
|
const { updateElementsState = true } = this._spec;
|
|
103311
103367
|
if (updateElementsState) {
|
|
103312
103368
|
this._reconfigItem(operateMask, region);
|
|
@@ -103604,6 +103660,12 @@ class Brush extends BaseComponent {
|
|
|
103604
103660
|
this._brushComponents = null;
|
|
103605
103661
|
}
|
|
103606
103662
|
}
|
|
103663
|
+
clearBrushStateAndMask() {
|
|
103664
|
+
this._relativeRegions.forEach((region, componentIndex) => {
|
|
103665
|
+
this._initMarkBrushState(componentIndex, '');
|
|
103666
|
+
this._brushComponents[componentIndex].children[0].removeAllChild();
|
|
103667
|
+
});
|
|
103668
|
+
}
|
|
103607
103669
|
}
|
|
103608
103670
|
Brush.type = ComponentTypeEnum.brush;
|
|
103609
103671
|
Brush.builtInTheme = {
|