I have a normal sequence sunburst jsfiddle as you can it is working normally.
I am trying to improve this sunburst to get a zooming technique.
with the following code I can et one step zooming,
var path = vis.data([json]).selectAll("path")
.
.
.on("click", click)
.each(stash);
the click function is:
function click(d)
also the code has the arctween, stash and reposition functions as below
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;
}
function reposition(node, x, k) {
node.x = x;
if (node.children && (n = node.children.length)) {
var i = -1, n;
while (++i < n) x += reposition(node.children[i], x, k);
}
return node.dx = node.value * k;
}
this is the final version of my sunburst with zooming JSfiddle
the Question is: How can I make the sequences sunburst works with zooming approach? and how to stop zoomin and o back as [bilevel or zoomable sunburst]