title: How to update data in d3 chart with an onchange slider event?
body: <p>Attached is my minimum working example in JS Fiddle. I am able to only show the initial data, but when I change the slider, the data does not update. Where am I going wrong in my code here? Apologies for the poor structure - I am still a beginner in D3.</p>
  <p><a href="https://jsfiddle.net/pv02z8em/1/" rel="nofollow noreferrer">https://jsfiddle.net/pv02z8em/1/</a></p>
  <pre><code>   chartGroup
      .selectAll('.line-series')
      .data(data, d=&gt; d.x)
      .join(
        enter =&gt; {
          enter.append('path')
          .attr('class', d =&gt; `line-series x_${d.x}`)
          .attr(&quot;d&quot;, drawLine(data))
          .style('stroke', 'dodgerblue')
          .style('stroke-width', 2)
          .style('fill', 'none')
          .style('opacity', 1)
        },
        update =&gt; { update.transition().duration(500) },
        exit =&gt; { exit.remove() }
      )
  }
  </code></pre>