jasondavies / d3-cloud

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

rouding the word sizes causes lots of words to be dropped out of the map in the place function #102

Closed mauricioxrodriguez closed 7 years ago

mauricioxrodriguez commented 7 years ago

Hi I just noticed that when having certain input data for 250 words from sizes set from 10 to 100 lots of words get dropped from the map. We inspected the sizes we are passing from our DB and noticed that there were many passed with similar sizes with decimal numbers and the rounding of the algorithm makes them the same and they get dropped from the map resulting in some instances in 40 or 50 or even more words getting dropped. I have read the threads from other devs about this and even downloaded the one for the overflow suggestion but that does not seem to work for us. Do you have any suggestions as to how we should be the ideal sizing for each word so that they don't collide?

jasondavies commented 7 years ago

If words cannot be placed in the available area, I’m afraid they get dropped. I don’t think this is anything to do with rounding. See #36; it’s something that would be nice to fix by auto-scaling the internal area, but not supported at the moment.