本文整理汇总了TypeScript中d3.mouse函数的典型用法代码示例。如果您正苦于以下问题:TypeScript mouse函数的具体用法?TypeScript mouse怎么用?TypeScript mouse使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mouse函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: reset
reset() {
const svgNode = this.scope.svg.node();
const mx = d3.mouse(svgNode)[0];
const my = d3.mouse(svgNode)[1];
const t = d3.zoomIdentity.translate(0, 0).scale(1);
this.scope.svg.call(this.scope.plotZoom.zoomObj.transform, t);
const lMargin = this.scope.layout.leftLayoutMargin;
const bMargin = this.scope.layout.bottomLayoutMargin;
const H = plotUtils.safeHeight(this.scope.jqsvg);
if (mx < lMargin && my < H - bMargin) {
_.extend(this.focus, _.pick(this.defaultFocus, "yl", "yr", "yspan", "yl_r", "yr_r", "yspan_r"));
} else if (my > H - bMargin && mx > lMargin) {
_.extend(this.focus, _.pick(this.defaultFocus, "xl", "xr", "xspan"));
} else {
_.extend(this.focus, this.defaultFocus);
}
this.fix(this.focus);
this.scope.plotRange.calcMapping(true);
this.scope.emitZoomLevelChange();
this.scope.update();
}
示例2: zoomBoxZooming
zoomBoxZooming(): void {
const svgNode = this.scope.svg.node();
// right click zoom
this.scope.mousep2 = {
x: d3.mouse(svgNode)[0],
y: d3.mouse(svgNode)[1]
};
this.locateBox = this.getLocateBoxCoords();
this.scope.rpipeRects = [];
this.renderLocateBox();
}
示例3: function
.on('start', function () {
resizer.resizerRight.classed("dragged", true);
const x = d3.mouse(this.parentElement)[0];
if (x < (resizer.clientWidth - deadWidth)) {
resizer.sepRightSnap = resizer.sepRight;
}
})
示例4: function
.on('start', function () {
resizer.resizer_right.classed("dragged", true);
let x = d3.mouse(this.parentElement)[0];
if (x < (resizer.client_width - dead_width)) {
resizer.sep_right_snap = resizer.sep_right;
}
})
示例5: toggleTooltip
export function toggleTooltip(scope, d) {
if (!d || scope.zoomed === true) {
return;
} // prevent dragging and toggling at the same time
const id = d.id;
if (!scope.tips[id]) {
tooltip(scope, d, d3.mouse(scope.svg[0][0]));
} else {
scope.tips[id].sticking = !scope.tips[id].sticking;
if (scope.tips[id].sticking === false) {
hideTips(scope, d.id);
untooltip(scope, d);
}
}
renderTips(scope);
}
示例6: function
svg.on("click", function(a, b, c) {
const coords = d3.mouse(svg.node());
balls.push(randomBall(coords[0], coords[1]));
});