cong-min / TagCloud

☁️ 3D TagCloud.js rotating with mouse
https://cong-min.github.io/TagCloud/examples
MIT License
356 stars 91 forks source link

Radius Should Be Responsive #18

Closed danielhamam closed 2 years ago

danielhamam commented 2 years ago

Hi all,

TagCloud is great. I was able to get it working on my React project with the help of the other members under the Issues subtopics. My one complaint is that the radius units should be able to be adjusted to rem or some other unit to preserve responsiveness. Using this component in my projects breaks the screen when size is readjusted.

Was anyone about to have a seamless experience integrating this within their responsive project?

danielhamam commented 2 years ago

For those dealing with this issue:

Since radius is fixed, I had to figure out a workaround to implement this responsively into my project. I created an event listener for window resizing, and dynamically passed in the radius based on window width (via window.innerWidth). I used a simple equation, window.innerWidth - (window.innerWidth * 0.85) to calculate the radius of the TagCloud.