在d3 v6中拖动形状

问题描述

当我尝试拖动矩形时什么也没有发生。 (相反,鼠标悬停事件可以正常工作)。为什么不拖动注册

    svg.append("rect")
    .attr("x",100)
    .attr("y",100)
    .attr("width",50)
    .attr("height",50)
    .style("fill","firebrick")
    //.on("mouSEOver",function(d) { d3.select(this).attr("height",100); } )
    //.on("mouSEOut",50); } )
    //.select(this).call(drag)
    .on("drag",function() { 
        d3.select(this)
            .attr("x",d3.event.x + current.attr("x"))
            .attr("y",d3.event.y + current.attr("y"))
    });

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)