title: D3 Treemap multiple parameter summing up the stack
body: <p>This is actually a strange question. I am working on this <a href="https://secure.polisci.ohio-state.edu/faq/d3/zoomabletreemap_code.php" rel="nofollow">https://secure.polisci.ohio-state.edu/faq/d3/zoomabletreemap_code.php</a> and currently trying to pass more than one parameter in the treemap and trying to sum them up the stack, as whats mostly done in zoomable treemap.</p>
  
  <p>The code documented for this change is given as:</p>
  
  <pre><code>// Aggregate the values for internal nodes. This is normally done by the
  // treemap layout, but not here because of our custom implementation.
  function accumulate(d) {
  return d.children
  ? d.value = d.children.reduce(function(p, v) { return p + accumulate(v); }, 0)
  : d.value;
  }
  </code></pre>
  
  <p>But in my approach I have to sum up using more than one parameter, say value and count.
  I tried to change the same code to add two parameters, but that didnt seem to do the trick, could someone guide me please:</p>
  
  <pre><code>   function accumulate(d) {
      return d.children
      ? d.value = d.children.reduce(function(p, v) { return p + accumulate(v); }, 0)
      : d.value;
      }
          function accumulate1(d) {
      return d.children
      ? d.count = d.children.reduce(function(p, v) { return p + accumulate(v); }, 0)
      : d.count;
      }
  </code></pre>
  
  <p>As two separate function, and then calling them separately to sum both count and value up the stack, starting from leaf nodes.
  But this is not working. Could you please guide me?</p>