d3js move a node without dragging

前端 未结 2 1903
一生所求
一生所求 2021-01-16 14:15

I\'m moving a node in my d3.js graph using the following code:

d3.select(\"#\"+ nodeid).attr(\"x\",x);
d3.select(\"#\"+ nodeid).attr(\"y\",y);
2条回答
  •  既然无缘
    2021-01-16 14:34

    I ended up just adding this to the code as well

    d3.select("#"+ nodeid).data([{x: x, y: y}]);
    

提交回复
热议问题