jasondavies / d3-cloud

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

wordcloud overlap #191

Closed ranoushh closed 1 month ago

ranoushh commented 1 month ago

hello, Im aware this is an issue posted before, but I've tried all the solutions and nothing has helped. I've made sure the layout for the cloud includes this:

.text(function(d) { return d.text; })

and I've made sure layout font and draw functions both have the same font-family

.font("sans-serif") --- inside layout .style("font-family", "sans-serif") --- inside draw function

but I still keep getting the overlapping words issue. I followed this site for my code https://using-d3js.com/07_01_word_clouds.html any help would be appreciated! it seems the two solutions I mentioned are what fixes it for everyone but mine. thank you!

ranoushh commented 1 month ago

forgot to mention: padding isn't ideal for me because making it bigger does prevent the overlap but it makes all the words way too far apart