jasondavies / d3-cloud

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

Need some instruction on how to get started #177

Open newjie opened 2 years ago

newjie commented 2 years ago

I know very little about Github so I am not sure how to get started with this library and need some very basic helps.

1) How can I directly use this on a browser? I downloaded the zip file and extracted them to a word folder, and then under the same folder, I create a test.html file:

 <head>
  <script src="/word/build/d3.layout.cloud.js"></script>
  <script src="/word/examples/browserify.js"></script>
</head>
<body>
</body>

The browserify.js file will generate an error. I understand it can only be used under nodejs environment. But how can I directly use it on my webpage?

2) How to install the library through npm? I also tried installing it on my linux server. Again, I extracted the downloaded .zip file to a word folder, and under this folder I ran npm i d3-cloud However, this is what I got:

image

the log says:

verbose stack Error: Refusing to install d3-cloud as a dependency of itself

UPDATE OK. I have been able to install the package by running npm i under the word folder. Still the question is, how can I use this library on my webpage?

rjalexa commented 5 months ago

Same need. Nobody ever replied? :(