title: d3 parition layout messes up when changing value accessor
body: <p>I'm trying to make a d3 partition layout behave like Mike's treemap example on:
  <a href="http://bl.ocks.org/mbostock/4063582" rel="nofollow">Treemap</a>.</p>
  
  <p>I did following steps on the file:</p>
  
  <ul>
  <li>search-replace "treemap" with "partition" </li>
  <li>remove the .sticky call on treemap layout because partition doesn's
  support it</li>
  <li>fix the color scheme for leaf nodes -> always return color(d.name)</li>
  <li>always put text on node -> always return d.name in text attribute</li>
  </ul>
  
  <p>Initially the partition renders fine.  But if you switch between value functions "size" and "count" using the input controls at the top right, there are data nodes that start shifting their level in the hierarchy!!!  </p>
  
  <p>Can anyone help explain me what the solution to this problem is?</p>
  
  <p>To easily reproduce the problem, I've created a jsfiddle on:
  <a href="https://jsfiddle.net/rc6vx3te/" rel="nofollow">jsfiddle for partition</a></p>
  
  <pre><code>d3.selectAll("input").on("change", function change() {
      var value = this.value === "count"
          ? function() { return 1; }
          : function(d) { return d.size; };
      node
          .data(partition.value(value).nodes)
              .transition()
              .duration(1500)
              .call(position);
  });
  </code></pre>