我正在使用 React Native 和 Linux 创建一个测试应用程序。
当我npm start在命令行中输入时。我收到以下消息。
但是,没有弹出“模拟器”或“服务器”向我显示该应用程序。
当我单击重新加载时,我收到警告消息。warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
我正在使用 JS、D3、鼠标事件和 HTML。
我试图找出鼠标悬停在 SVG 上时的 x 和 y 位置。
我的代码
let svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height)
.on("mouseover", function(){
let x = d3.select(this).attr("x")
console.log(x)
})
Run Code Online (Sandbox Code Playgroud)
我在网上查了一下,发现有人在谈论使用,d3.mouse(this)但我不断得到 d3.mouse() 不是一个函数。
有人可以帮我吗:) 谢谢