Open drag0s opened 5 years ago
Same here. Seems like it's failing to calculate the positions of word, unlike the demo.
I ran into this as well, but I managed to get it working in the end. For me, it was the ommision of some things from the demo which seemed superfluous at the time, along with using the material-ui style system, rather than inline styles.
The inline styles on the WordCloud tag are necessary as it appears that the underlying d3-cloud component uses it to determine metrics. In particular, it needs fontSize
and padding
(and maybe more?). Setting these through className
did not work, it had to be set through style
.
HTH
Hey there! 👋
Sometimes I experience overlapping words like in this picture:
Is there anything I can do to avoid overlapping words?
The code from the screenshot: (https://stackblitz.com/edit/react-tag-cloud-dqfvdv?file=App.js)
Thanks in advance!