WordCram

open-source word clouds for Processing

Follow WordCram on Twitter @wordcram

Ask a Question in the Forum /wordcram

Pull Requests Welcome on GitHub danbernier/WordCram

Latest News

WordCram 1.0.0 Released, for Processing 3.0

WordCram 0.6.2 Released

WordCram 0.6.1 Released

All posts

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.

>>