Closed Francklepanda closed 7 years ago
MagicCloud is a standalone Ruby library, it knows nothing about Rails. So, your typical workflow to show it in Rails view is:
cloud = MagicCloud::Cloud.new(...)
img = cloud.draw(width, height)
img.write('some_name.png')
image_tag 'some_name.png'
Note, that it will produce static cloud image (which is the target of the library). If you need a pretty JS word cloud, clickable and recizable, consider using d3.js and https://github.com/jasondavies/d3-cloud
Thanks a lot ! I don't understand why I have some words who disappear :/
my code is :
and the result :
Thanks for https://github.com/jasondavies/d3-cloud I think I will use that to have clickable words :)
I don't understand why I have some words who disappear :/
Its because magic cloud is dumb (I didn't have enough time recently to update it): it calculates long words size with default font, sees it is too huge for the image size and just drops them. Try larger image size...
Hello
when I try to use MagicCloud::Cloud.new(words, rotate: :free, scale: :log) it shows me # on my view
how can I use it ? will it create an image and I should use image_tag ? sorry for this question I think I didn't understand something ^^
Franck