Working with Highchart Treemaps (drilldown)
<p>I have a problem with HighChart Treemaps. Ive been working on a custom algorithm with equal tiles. Though i got my custom algorithm to work (Thanks to other SO questions) , I'm not able to achieve drilldown. The custom algorithm works perfectly for the parent nodes. When I click on a parent, Only the latest child covers the entire map. I tried customizing the algo, but it went nowhere.</p>

<p>Any help is highly appreciated. Code posted on JSfiddle. And the green tile has children. Purple parent doesn't have one.</p>

<pre><code>function myFunction(parent, children) {
var x = parent.x,
        y = parent.y,
    w=20,
    h=20,i,j,
        childrenAreas = [];
        console.log(parent);
        console.log(children);
Highcharts.each(children, function(child) {   


    if(child.level == 1)
    {
    //console.log("if part"+child.i+" "+x+ " "+y);
    if(x&gt;=parent.width)
       {
       x=parent.x;
       y+=h;

       }
       else
       {
     x+=w;
   }

    }
    else
    {
         //console.log(child);


    } 
childrenAreas.push({
        x: x,
        y: y,
        width: w,
        height: h
    });
 //console.log(parent.x+w);



});
//console.log(childrenAreas);
return childrenAreas;
</code></pre>

<p>};</p>

<p><a href="https://jsfiddle.net/99rbh2qj/1/" rel="nofollow">Complete code on JSfiddle </a></p>

<p>TIA</p>