更新时间:2022-11-10 11:01:33
自D3 V6 起,所有鼠标事件处理程序都将一个事件作为第一个参数传递,将数据作为第二个参数传递.在 V5 或更早的版本中,您的代码将可用.
Since D3 V6, all mouse event handlers has an event passed as the first argument and data as the second. In the V5 or earlier, your code will work.
V6或更高版本:
.on('mouseover', (event, d) => console.log(d.mass));
V5或更早版本:
.on('mouseover', d => console.log(d.mass));