问题
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:
d3.mouse was removed in d3v6, you should use d3.pointer(event)
来源:https://stackoverflow.com/questions/65134858/d3-mouse-is-not-a-function