d3.js - Changing data for selected D3 object -
d3.js - Changing data for selected D3 object -
i'd alter x value in info variable line object while i'm changing x1 , x2 attributes. how do that? see code , image below.
function updateborder(x, whichborder) { temp_border = svg.selectall(whichborder) .attr("x1", x) .attr("x2", x); }
you can modify info in d3 callbacks.
function updateborder(x, whichborder) { temp_border = svg.selectall(whichborder) .each(function (d) { d.x = x }) .attr("x1", x) .attr("x2", x); }
but mutating info in random places not idea.
d3.js
Comments
Post a Comment