Manipulate elements by binding new data

后端 未结 3 428
盖世英雄少女心
盖世英雄少女心 2021-02-04 04:38

I am trying to work out how to update some D3.js elements just by binding new data. I\'m not actually sure if this is possible or not, but it feels like it should be.

So

3条回答
  •  青春惊慌失措
    2021-02-04 05:06

    OK, now I've got it! You need to tell it WHAT to transition:

    circle.data(data1).transition().duration(2500).attr("cx", function(d) {
          return d*10;
      });
    

提交回复
热议问题