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")

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s