0

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]

Karim
  • 41
  • 4
  • So what's the question? – Lars Kotthoff Aug 30 '14 at 10:29
  • 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](http://bl.ocks.org/mbostock/5944371) – Karim Aug 30 '14 at 16:35

0 Answers0