d3-cloud icon indicating copy to clipboard operation
d3-cloud copied to clipboard

not-so-simple example

Open jeroen opened this issue 12 years ago • 5 comments

As I understand it, the d3-cloud library only renders a set of {word, size} pairs into a chart. It does not actually have any functionality to create these pairs, correct? Creating wordcloud will almost always involve converting some big string(s) of text to a set of word/size pairs. Perhaps it would be useful to include an example that illustrates how to go about this? Or perhaps adopt some of this functionality in the library?

jeroen avatar Nov 14 '12 01:11 jeroen

Here is a simple text to wordmap function as extracted from your example: http://pastebin.com/yH8cXk5N. Perhaps that would be useful to others as well.

jeroen avatar Nov 14 '12 02:11 jeroen

Also it is not working as expected, everytime I referesh the browser it misses some of the words some time. can you check why is it happening ?

sumitarora avatar Dec 28 '12 22:12 sumitarora

I agree it would be useful to include automatic word-frequency computation (and stop-word removal).

@sumitarora, this is expected if there isn't sufficient room left to place a particular word at a particular size. This can happen if you have long words with a large size, or even just long words in general are quite hard to place.

jasondavies avatar Dec 31 '12 11:12 jasondavies

Thanks for the nice implementation! I wish there was a flag that allows to force the cloud to show all words as sumitarora said.

padmalcom avatar Jun 21 '13 06:06 padmalcom

@jasondavies , regarding the word-skipping problem, would it be possible to retry the word at a different position and rotation until it succeeds?

ccblaisdell avatar Feb 27 '14 16:02 ccblaisdell