Tagged: ruby

simple MagicCloud example

Simple demo of the MagicCloud gem, as the docs are not explicit about how to output an image:

require "magic_cloud"

words = [
 ['test', 50],
 ['me', 40],
 ['tenderly', 30]
]

cloud = MagicCloud::Cloud.new(words, rotate: :free, scale: :log)
img = cloud.draw(800, 600)
img.write("magic_cloud.png")