[fixing the build] a new version of eslint is more picky

This commit is contained in:
Maxime Beauchemin 2016-05-16 16:33:03 -07:00
parent 83e0e58888
commit d30567959b
1 changed files with 8 additions and 3 deletions

View File

@ -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