-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlay bug when changing layout size #81
Comments
We also had an overlay issue when using 'cloudLayout.start()' in a loop, where each loop reduces the fontSize in order to overcome the 'bigger words not appearing' bug (see #36). It appears that d3-cloud adds some info/attributes to the tags you pass in cloudLayout.words(). Notably, d3-cloud stores the 'x' and 'y' positions of each tag. When iterating, these pieces of information are not removed/refresh/updated. Hence, iteration N re-uses information produced previously, which leads to weird results (ie. overlapping). We overcome the overlapping issue by manually removing the added information, and passing an array of 'fresh' tags to 'cloudLayout.words()'. |
Also, check the font family: |
How did you manage to remove the information manually? @Kcnarf |
In case other people have this problem : we had the issue when running d3-cloud several times with decreasing font sizes until every word fit, every once in a while the layout would look random. |
Here is the code that breaks for me - https://gist.github.com/StefanDimov/88a4b2a749c267ab4f78
I want to change the layout size on window resize, so the space will be efficiently used, but sometimes when I shrink the browser's width as much as I can and then expand it some words start to layered on top of others. Doesn't occur consistently, but most of the times it's there.
The text was updated successfully, but these errors were encountered: