title: How to use SimulationLinkDatum and SimulationNodeDatum in d3
body: <p>I'm having a problem using the SimulationLinkDatum Type. I made two classes Node and Link that implement SimulationNodeDatum and SimulationLinkDatum.  When I go to try and use SimulationLinkDatum typescript says that d.source.x, d.targe.x, etc typescript says that "<strong>Property 'x' does not exist on type 'string | number | Node'.</strong>" </p>
  
  <p>I understand that the SimulationLinkDatum accepts <code>number | string | &lt;T&gt;</code> for the source and target node properties and that if you use number or string that it will be mutated into a SimulationNodeDatum. Is this just something that we have to live with or is there a better way of using these interfaces?</p>
  
  <p>Thanks</p>
  
  <pre><code>class D3Component {
      private createPathString(d: SimulationLinkDatum&lt;Node&gt;) {
          return 'M' + d.source.x + ',' + d.source.y + 'L' + d.target.x + ',' + d.target.y;
      }
  }
  class Node implements SimulationNodeDatum {
      public x: number;
      public y: number;
      constructor (public id: number) {}
  }
  
  class Link implements SimulationLinkDatum&lt;Node&gt; {
      constructor (public source: Node, public target: Node)  {}
  }
  </code></pre>