Skip to content

Commit

Permalink
[hotfix] treemap was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed May 20, 2016
1 parent e77d50b commit c53874c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions caravel/assets/visualizations/treemap.js
Expand Up @@ -72,13 +72,11 @@ function treemap(slice) {
// We also take a snapshot of the original children (_children) to avoid
// the children being overwritten when when layout is computed.
var accumulate = function (d) {
var results;
if (d._children === d.children) {
results = d.children.reduce(function (p, v) { return p + accumulate(v); }, 0);
} else {
results = d.value;
d._children = d.children;
if (d._children) {
d.value = d.children.reduce(function (p, v) { return p + accumulate(v); }, 0);
}
return results;
return d.value;
};

// Compute the treemap layout recursively such that each group of siblings
Expand Down

0 comments on commit c53874c

Please sign in to comment.