# How is this “United States of Reddit” graph created?

Below is a graph from p. 202 of Christian Rudder's Dataclysm, though it was made by James Dowdell. It illustrates the relationships betweens various top 200 subreddits, which are areas of interest on reddit.com where users can submit links, comments, and votes. These are similar to tags on this site. The size of the subreddit regions represent their popularity. The subreddits are grouped by cross-commenting, and the darker tint represents the percentage of people that stay within that subreddit and don’t post to others.

Is this just a standard Voronoi partitioning, with some coloring for insularity, or is it something more involved?

How might one go about making one of these?

• I don't know, but my guess is that it's a Voronoi cartogram--one adjusts the point centers (not shown) until each of the Voronoi region areas is proportional to a predetermined value. – whuber Oct 6 '14 at 23:36

First, I am James Dowdell, so I'm rather uniquely qualified to answer (created an account to answer, can confirm identity if anybody is worried).

The simple answer is indeed what others have surmised: this is a http://en.wikipedia.org/wiki/Voronoi_diagram . We used the same concept on page 194, where the voronoi sites there are the latitude longitude pairs listed by craigslist.org .

Unfortunately, this knowledge itself isn't actually very useful. With the Craigslist graph, it's clear what values to use for the sites. But what magic trick did Dataclysm use to assign x/y coordinates in this graph?

The answer to that is far more involved than most people would expect, and I can't say I recommend redoing what we did. I bet somebody else here could recommend an approach that gets more or less the same result and is far simpler.

The truth is:

Christian and I went back and forth for over 3 months creating graphs for this chapter, that we could never make work. But, the results of one approach often fed into the next.

1. The most critical thing unfortunately involves a technique and some image assets I'm not at liberty to explore or share in any meaningful way, because we may still yet use them somehow. What I'll say is that we took a complicated http://en.wikipedia.org/wiki/Graph_theory#Graph that we compiled with permission from Reddit's data, involving userids and subreddits, and we played around with this graph and various derivatives of it inside http://gephi.github.io/ (I'm particularly a fan of "OpenOrd" these days). In fact we got a magnificent image - would have been the highlight of the book if it had been published - but while it would have worked fine on a website it didn't print well in a book - not enough room or resolution. Christian was originally considering setting it as a fold out in the book, but it just wasn't cost effective for Crown.

2. However, at this point we had an image that had x/y coordinates for the subreddits and they were at least relatively arranged properly in x/y space. We were also in a hurry because the publish deadline was approaching. I'm a programmer first and a data guy second, so to accomodate the extremely tight boundaries of the page in the book and the time left on the clock, my instinct was to write a program in Box2D which simulated the boundaries of the page as walls, put an extremely shrunk version of the graph inside, and simulated growing those nodes (not natural for Box2D by the way, it expects rigid bodies that don't change) until everything was flush against the walls and each other. Nodes grew at a rate proportional to the size of the subreddit they represented, which meant that final sizes would also be proportional in the same way. I unfortunately don't have a screenshot of the actual run that produced the graph in the book, but the run for an unpublished related graph I attach here: screenshot of box2d program while running

3. The result of that didn't look very nice at all, but it did give me something very valuable: the voronoi sites. I took the centroids of the resulting box2d polygons, put them through a standard process, and that's what was used for the graph in the book. Text labels were applied by hand in photoshop I believe.

Incidentally, the cell coloring was related to a statistic we had developed to form the graph back in (A)

• Welcome to the site. This is close to how I might have tried to do it. Use whatever graph layout to assign xy coordinates to the nodes. (It may be possible in some force based layouts to make the cells approximately the size you want based on specifying edge weights and mass, but I doubt they will be exact.) After creating the voronoi areas of the original graph layout, then I would use a cartogram tool, like Scapetoad, to make the ending areas proportional to the statistic of interest. This ends up being pretty similar to the program you suggest in box2d. – Andy W Nov 4 '14 at 13:34

It looks more like a word cloud problem with a Voronoi polygon appearance. You need to use the word frequency to decide the location (high frequency means center). As long as the location of the words determined, drawing the Voronoi polygon should not be a big deal.