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.
mouse() function in D3. js is used to return the x-coordinate and y-coordinate of the current event. If the event is clicked then it returns the x and y position of the click.
d3-collection is deprecated, and its methods are replaced: d3. nest ⇨ d3. group and d3.
The bisector() Function in D3. js is used to returns a new bisector using the specified accessor or comparator function. This method can be used to bisect arrays of objects instead of being limited to simple arrays of primitives.
d3.mouse was removed in d3v6, you should use d3.pointer(event)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With