本文整理匯總了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]));
});