d3.mouse不是一个函数 [英] d3.mouse is not a function

查看:70
本文介绍了d3.mouse不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级了d3库,现在执行以下代码时出现错误

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);

获取

undefined

d3.mouse is not a function

它在任何地方都没有定义.我通过 d3导出,该功能实际上并没有从任何地方导出.

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

推荐答案

d3.mouse已在d3v6中删除,您应该使用d3.pointer(event)

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

这篇关于d3.mouse不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆