cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
36 lines (35 loc) • 1.45 kB
JavaScript
import { __extends } from "../../../../tslib/tslib.es6.mjs";
import { register, unregister } from "./globalListener.mjs";
import ComponentView from "../../view/Component.mjs";
var AxisPointerView = function(_super) {
__extends(AxisPointerView2, _super);
function AxisPointerView2() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = AxisPointerView2.type;
return _this;
}
AxisPointerView2.prototype.render = function(globalAxisPointerModel, ecModel, api) {
var globalTooltipModel = ecModel.getComponent("tooltip");
var triggerOn = globalAxisPointerModel.get("triggerOn") || globalTooltipModel && globalTooltipModel.get("triggerOn") || "mousemove|click";
register("axisPointer", api, function(currTrigger, e, dispatchAction) {
if (triggerOn !== "none" && (currTrigger === "leave" || triggerOn.indexOf(currTrigger) >= 0)) {
dispatchAction({
type: "updateAxisPointer",
currTrigger,
x: e && e.offsetX,
y: e && e.offsetY
});
}
});
};
AxisPointerView2.prototype.remove = function(ecModel, api) {
unregister("axisPointer", api);
};
AxisPointerView2.prototype.dispose = function(ecModel, api) {
unregister("axisPointer", api);
};
AxisPointerView2.type = "axisPointer";
return AxisPointerView2;
}(ComponentView);
var AxisPointerView$1 = AxisPointerView;
export { AxisPointerView$1 as default };