title: D3 Sankey diagram using typescript
body: <p>I have the code from here <a href="https://gist.github.com/d3noob/013054e8d7807dff76247b81b0e29030" rel="nofollow noreferrer">https://gist.github.com/d3noob/013054e8d7807dff76247b81b0e29030</a> working in vanilla javascript, but I am struggling to get a Sankey diagram working in my Angular 2 project (built using Angular CLI) which uses Typescript.</p>
  
  <p>D3 works fine in the project, but even with the the Sankey plugin and typings installed from npm:</p>
  
  <p>Plugin: <a href="https://www.npmjs.com/package/d3-sankey" rel="nofollow noreferrer">https://www.npmjs.com/package/d3-sankey</a></p>
  
  <p>Typings: <a href="https://www.npmjs.com/package/@types/d3-sankey" rel="nofollow noreferrer">https://www.npmjs.com/package/@types/d3-sankey</a></p>
  
  <p>I get errors on:</p>
  
  <pre><code>const sankey = d3.sankey()
  .nodeWidth(20)
  .nodePadding(40)
  .size([width, height])
  
  const path = sankey.link()
  </code></pre>
  
  <p>and </p>
  
  <pre><code>sankey
      .nodes(graph.nodes)
      .links(graph.links)
      .layout(32)
  </code></pre>
  
  <p>as neither .link() nor .layout() are recognised properties of sankey. Has anyone got a sankey diagram working using Typescript and Angularjs 2+? Any help would be appreciated.</p>