d3.js - Angular 4 : properly importing and using d3 and d3-cloud and their typings -


i'm trying use d3 + d3-cloud make word cloud angular cli (angular 4+)

i did npm i of both libraries plus respective typings :

"dependencies": {     "d3": "^4.10.2",     "d3-cloud": "^1.2.4"   },   "devdependencies": {     "@types/d3": "^4.10.0",     "@types/d3.cloud.layout": "^1.2.32"   } 

and import them in component :

import * d3 'd3' import * cloud 'd3-cloud' 

console logging them in ngoninit returns instances of both libraries.

the typings d3 working (if type d3.i intellisense) nothing cloud.

i tried d3.layout.cloud typescript error, i'm guessing should use cloudinstead since i've instantiated way since don't intellisense i'm not sure.

cloud.layout.cloud() results in cannot read property 'cloud' of undefined error.

i'm confused how should import , use d3-cloud , typings, read this thread user never answered question of how fixed problem.

is method right way of using these libraries ?


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -