Skip to content

Commit

Permalink
[fixing the build] a new version of eslint is more picky
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed May 16, 2016
1 parent 83e0e58 commit d305679
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions caravel/assets/visualizations/treemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,16 @@ 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) {
return (d._children = d.children)
? d.value = d.children.reduce(function (p, v) { return p + accumulate(v); }, 0)
: d.value;
var results;
if (d._children === d.children) {
results = d.children.reduce(function (p, v) { return p + accumulate(v); }, 0);
} else {
results = d.value;
}
return results;
};


// Compute the treemap layout recursively such that each group of siblings
// uses the same size (1x1) rather than the dimensions of the parent cell.
// This optimizes the layout for the current zoom state. Note that a wrapper
Expand Down

0 comments on commit d305679

Please sign in to comment.