Hello, WordCram: Word Clouds in Processing

Today I’m releasing WordCram, an open-source Processing library that lets you generate word clouds. It does the heavy lifting — text analysis, collision detection, bin-packing — for you, so you can focus on making your word clouds as beautiful, as revealing, or as silly as you like.

I’ve been working on WordCram for about a month, and I think it’s ready to be out of the lab. Download the bits, and try it out.

Here’s the flavor of it:

import wordcram.*;
import wordcram.text.*;

void setup() {
  size(600, 400);
  background(0);

  WordCram wordCram = new WordCram(this,
    new TextSplitter().split(loadStrings("tao-te-ching.txt")),
    Fonters.FonterFor(createFont("sans", 1)),
    Sizers.byWeight(5, 60),
    Colorers.TwoHuesRandomSats(this),
    Anglers.MostlyHoriz,
    new CenterClumpWordPlacer(),
    new SpiralWordNudger());

  while (wordCram.hasMore()) {
    wordCram.drawNext();
  }
}

The result:

A wordcram of the Tao Te Ching

You can see by the code — Colorers, Anglers, Placers — that it’s pretty pluggable.  But there’s still work to do — better performance, a cleaner API, sensible defaults for some of those components — so if you like what you see and want to help out, tweet me or email me at wordcram-at-gmail.

In the meantime, I’ll be working on smoothing out those components and putting up some tutorials here.

WordCram is inspired by Wordle, and built for Processing, so a big thank-you to Jonathan Feinberg, Ben Fry, and Casey Reas.

Advertisements
This entry was posted in examples. Bookmark the permalink.

2 Responses to Hello, WordCram: Word Clouds in Processing

  1. Thanks Anthea! Many more to come…

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s