title: Error: Argument of type 'Node' is not assignable to parameter of type 'BaseType'
body: <p>I inherited a codebase which uses d3.js stack component. When I try to compile the Angular code I receive the following error:</p>
  
  <blockquote>
    <p>ERROR in src/app/components/universal/column-chart/column-chart.component.ts(238,28): error TS2345: Argument of type 'Node' is not assignable to parameter of type 'BaseType'.<br>
       Type 'Node' is not assignable to type 'EnterElement'.<br>
       Property 'querySelector' is missing in type 'Node'.</p>
  </blockquote>
  
  <p>The code which causes this error is the line <code>return d3.select(...</code></p>
  
  <pre><code>stacks.append('text')
    .text(d =&gt; {
      return `$${ d['total'].spent.amount }`;
    })
    .attr('y', (d, i, j) =&gt; {
      return d3.select(j[i]['parentNode']).select('.bar')['_groups'][0][0]['y'].baseVal.value - 5;
    });
  </code></pre>