title: Building a d3.js widget in flutter
body: <p>I'm getting started with flutter and trying build a Stateful Widget, which when called would display a d3.js chart.  My thinking is to build a chart into a stateful widget and use the changenotifier provider to update the chart data, and d3.js has beautiful plots.</p>
  <p>I've found a couple of other references of other people doing similar things...</p>
  <p><a href="https://stackoverflow.com/questions/13533207/dart-js-interop-with-d3">Dart js interop with D3</a></p>
  <p><a href="https://stackoverflow.com/questions/23487606/how-to-embed-a-d3-chart-in-a-polymer-dart-element">How to embed a D3 chart in a Polymer.dart element?</a>.</p>
  <p>It seems to make sense that if I already had an element in my html code that I could reference from my dart code I could attach to that, and create my plot - as in the latter reference...</p>
  <pre><code>import 'dart:js' as js;
  js.context['d3'].callMethod('select', [shadowRoot.querySelector('.chart')]);
  </code></pre>
  <p>What I don't understand, is how I would be able to create that .chart element in the DOM within my stateful widget itself so that from the perspective of my dart code, it sees it as just a dart widget.</p>
  <p>Put another way, what is it than I can select that is local to the widget itself so that I can nest the resulting widget in other widgets?</p>
  <p>Is wanting to wrap the d3.js in a stateful widget in dart something that could be accomplished in a relatively encapsulated way?  And is trying to create the html within the widget itself a good approach?</p>