D3 Sequences Sunburst Animation

寵の児 提交于 2019-12-06 05:42:42

Solution founded:

Added functions arcTween and stash for axis interpolation

function arcTween(a){
                    var i = d3.interpolate({x: a.x0, dx: a.dx0}, a);
                    return function(t) {
                        var b = i(t);
                        a.x0 = b.x;
                        a.dx0 = b.dx;
                        return arc(b);
                    };
                };

function stash(d) {
                    d.x0 = 0; // d.x;
                    d.dx0 = 0; //d.dx;
                }; 

and transition() property to the paths initialization:

path.each(stash)
     .transition()
     .duration(750)
     .attrTween("d", arcTween);

Thanks All.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!