d3.mouse( container ) in D3.js

Find x,y coordinates of the current mouse event relative to a container element.

Arguments

nametypedescription
container Element The HTML or SVG container element to find the coordinates relative to.
Return Type
Array

Description

For more details see https://github.com/mbostock/d3/wiki/Selections#wiki-d3_mouse.

See Also