d3.mouse is not a function

Viewed 7435

Upgraded d3 library and now getting an error for executing the following code

console.log(`\n${JSON.stringify(d3.mouse)}\n`);
const mouse = d3.mouse(this);

Getting

undefined

d3.mouse is not a function

And it is not defined anywhere. I went trough d3 exports and this function is not really exported from anywhere.

1 Answers

d3.mouse was removed in d3v6, you should use d3.pointer(event)

Related