title: D3 y(number) returns NaN
body: <p>I've been banging my head against a wall trying to figure this one out. My normally reliable Google-Fu has failed me. Nothing on I've found on SO has pointed me in the right direction. Would love some help on this.</p>
  
  <p>I'm building a grouped bar chart. For some reason, y(number) will only give me NaN even though I am passing it a number.</p>
  
  <p>Code below:</p>
  
  <pre><code>const data = [
    {
      'provider': 'twitter',
      'likes': 2362,
      'comments': 107,
      'shares': 1129
    },
    {
      'provider': 'facebook',
      'likes': 2783,
      'comments': 148,
      'shares': 1069
    },
    {
      'provider': 'instagram',
      'likes': 1878,
      'comments': 101,
      'shares': 1032
    },
    {
      'provider': 'tumblr',
      'likes': 2965,
      'comments': 147,
      'shares': 1393
    }
  ]
  
  const margin = {top: 10, right: 10, bottom: 10, left: 10},
    width = 628 - margin.left - margin.right,
    height = 300 - margin.top - margin.bottom
  
  const x0 = d3.scaleBand()
    .rangeRound([0, width])
    .paddingInner(0.1)
  
  const x1 = d3.scaleBand()
    .padding(0.1)
  
  const y = d3.scaleLinear()
    .rangeRound([height, 0])
  
  const keys = d3.keys(data[0]).filter((key) =&gt; (key !== 'provider'))
  
  console.log('keys ', keys) // keys  ["likes","comments","shares"]
  
  data.forEach((d) =&gt; {
    d.values = keys.map((name) =&gt; ({name: name, value: +d[name]}))
  })
  
  x0.domain(data.map(d =&gt; d.provider))
  x1.domain(keys).range([0, x0.bandwidth()])
  y.domain(0, d3.max(data, (d) =&gt; (d3.max(d.values, (d) =&gt; (d.value)))))
  
  console.log('max', d3.max(data, (d) =&gt; (d3.max(d.values, (d) =&gt; (d.value))))) // max 2965
  
  const svg = d3.select('body').append('svg')
    .attr('width', 628)
    .attr('height', 300)
  
  const provider = svg.selectAll('.provider')
    .data(data)
      .enter().append('g')
      .attr('class', d =&gt; 'provider-' + d.provider)
      .attr('transform', d =&gt; `translate(${x0(d.provider)}, 0)`)
  
  provider.selectAll('rect')
    .data(d =&gt; d.values)
    .enter().append('rect')
    .attr('width', x1.bandwidth())
    .attr('x', d =&gt; x1(d.name))
    .attr('y', d =&gt; {
      console.log('d.value ', d.value) // d.value  2362
      console.log('y(d.value) ', y(d.value)) // NaN
    })
  </code></pre>