jasondavies / d3-cloud

Create word clouds in JavaScript.
https://www.jasondavies.com/wordcloud/
Other
3.82k stars 1.08k forks source link

how to use it? #172

Closed kongmengfei closed 2 years ago

kongmengfei commented 2 years ago

how can i use it in my project? is there any document to explain API /props?

Emporea commented 2 years ago

This repo is so old it works only with older versions of d3. I just hope i can get it to work. I go through some error messages when trying.

Emporea commented 2 years ago

@kongmengfei

Its actually pretty easy. I struggeled of just changing cloud to d3.layout.cloud in examples/browserify.js. If you include your d3 cdn your are fine and can just use the code in browserify.js

If you dont understand or have any further questions just let me know.

superdiazzz commented 2 years ago

@kongmengfei

Its actually pretty easy. I struggeled of just changing cloud to d3.layout.cloud in examples/browserify.js. If you include your d3 cdn your are fine and can just use the code in browserify.js

If you dont understand or have any further questions just let me know.

i have tried change to this let layout = d3.layout.cloud() but still unreadable. Btw, i use d3 by npm install

jasondavies commented 2 years ago

This repo is so old it works only with older versions of d3. I just hope i can get it to work. I go through some error messages when trying.

This is simply not true: there's no requirement to use any specific version of D3 (or even D3 at all) -- this library simply generates sizes and positions for a given set of words. There's a couple of examples in the repository but I may need to update them to reflect modern usage.