title: d3.js stack layout upgrading from v3 to v4
body: <p>Using D3 v3, I formatted my data to match Mike's example to quick start my dev process. Example page here <a href="https://github.com/d3/d3-3.x-api-reference/blob/master/Stack-Layout.md" rel="nofollow">https://github.com/d3/d3-3.x-api-reference/blob/master/Stack-Layout.md</a></p>
  
  <pre><code>var data = [
    {
      "name": "apples",
      "values": [
        { "x": 0, "y":  91},
        { "x": 1, "y": 290}
      ]
    },
    {
      "name": "oranges",
      "values": [
        { "x": 0, "y":  9},
        { "x": 1, "y": 49}
      ]
    }
  ];
  </code></pre>
  
  <p>Then all i had to do to obtain the stacked values was</p>
  
  <pre><code>var stack = d3.layout.stack().values(d=&gt;d.values)
  
  var layers = stack(data)
  </code></pre>
  
  <p>Exactly how he did it in his example.</p>
  
  <p>However, in v4 it seems like the stack function expects tabular formatted data, so the above data would look like this.</p>
  
  <pre><code>var data = [
    {x: 0, apples: 91, oranges: 9},
    {x: 1, apples: 290, oranges: 49},
  ];
  </code></pre>
  
  <p>Is there an easy way to keep my data format and use the v4 stack function? I can't seem to grok the new way to do this. In my current data format, i have useful properties associated with the values array. If i change my data format to tabular, I don't see a convenient way to pair properties with values.</p>