timdream / wordcloud2.js

Tag cloud/Wordle presentation on 2D canvas or HTML
https://wordcloud2-js.timdream.org/
MIT License
2.34k stars 510 forks source link

"Uncaught RangeError: Maximum call stack size exceeded" on small screen sizes #165

Open vasilzhigilei opened 3 years ago

vasilzhigilei commented 3 years ago

Uncaught RangeError: Maximum call stack size exceeded at getTextInfo (wordcloud2.js:514) at putWord (wordcloud2.js:913) at putWord (wordcloud2.js:987) ...

when wordcloud2 tries to put words into an area on a small screen size. Some of the words do get big in size, and there are a fair number of words. This error lags the mobile device, ruining the UX. Any way to avoid this?

vasilzhigilei commented 3 years ago

Update: Adding abortThreshold: 1000, to options avoids the issue, but it doesn't seem like a very good fix (just aborting after 1 second doesn't seem like the best solution- not all words appear on small screen sizes, but at least the error doesn't get thrown anymore)