I have the code from here https://gist.github.com/d3noob/013054e8d7807dff76247b81b0e29030 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.
D3 works fine in the project, but even with the the Sankey plugin and typings installed from npm:
Plugin: https://www.npmjs.com/package/d3-sankey
Typings: https://www.npmjs.com/package/@types/d3-sankey
I get errors on:
const sankey = d3.sankey()
.nodeWidth(20)
.nodePadding(40)
.size([width, height])
const path = sankey.link()
and
sankey
.nodes(graph.nodes)
.links(graph.links)
.layout(32)
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.