@visactor/vtable
Version:
canvas table width high performance
42 lines (38 loc) • 1.32 kB
JavaScript
import { Icon } from "../graphic/icon";
import * as icons from "../../icons";
const regedIcons = icons.get();
export class DrillIcon {
constructor() {
const iconOption = regedIcons.drillDown;
this.icon = new Icon({
x: -1e3,
y: -1e3,
image: iconOption.svg,
width: iconOption.width,
height: iconOption.height,
dx: -iconOption.width / 2,
dy: -iconOption.height / 2,
visible: !1,
funcType: iconOption.funcType,
cursor: iconOption.cursor
}), this.icon.role = "icon-drill";
}
appand(parent) {
parent.appendChild(this.icon);
}
update(visible, x, y, drillDown, drillUp, scene) {
if (!visible || drillDown && drillUp) return this.icon.setAttributes({
x: -1e3,
y: -1e3,
visible: !1
}), void scene.updateNextFrame();
const drillDownOption = regedIcons.drillDown, drillUpOption = regedIcons.drillUp;
this.icon.setAttributes({
x: x,
y: y,
image: drillDown ? drillDownOption.svg : drillUpOption.svg,
visible: !0
}), this.icon.loadImage(this.icon.attribute.image), scene.updateNextFrame();
}
}
//# sourceMappingURL=drill-icon.js.map