d3js nicely transition lines with added points

前端 未结 1 410
感情败类
感情败类 2021-01-18 19:08

Say I have a path I created with d3 something like:

line = d3.line()
    .curve(d3.curveLinear)
    .x(function(d) { return x(d.x)         


        
相关标签:
1条回答
  • 2021-01-18 19:58

    You should have a look at this page and this github

    .attrTween('d', function () { 
        return d3.interpolatePath(line(data), line(data2)); 
    });
    

    Have a look at this fiddle

    0 讨论(0)
提交回复
热议问题