4

Max Alcalá Sáinz

Blog, photography portfolio, catalyst, but cacophony for the most part.

Top 1000 Stack Overflow Tags, Visualized

Drag, zoom in and out with your mouse/pinch for relative sizes:

Source

I was very excited when I learned about Stack Exchange’s public Data Explorer (how come nobody told me about this!!). It is really interesting to see the internal schema (which I assume is that same one used in production), as well as the popular queries to see how far away people are from getting a badge.

I wanted to see how popular different languages and frameworks were around the SO community, so I whipped up a query and set to work…

Stack Overflow Query
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SELECT
  TagTotals.TagName,
  Sum(TagTotals.Count)

FROM(
  SELECT
    TagSynonyms.TargetTagName as TagName,
    Tags.Count
  FROM
    Tags
      INNER JOIN
    TagSynonyms ON (
      Tags.TagName = TagSynonyms.SourceTagName
    )

  UNION ALL

  SELECT
    Tags.TagName,
    Tags.Count
  FROM
    Tags
      LEFT JOIN
    TagSynonyms ON (
      Tags.TagName = TagSynonyms.SourceTagName
    )
  WHERE
    TagSynonyms.SourceTagName IS NULL
  ) as TagTotals

GROUP BY TagTotals.TagName;

That gives you a listing of the number of times a tag has been used in a post. It rolls in tag synonyms, so you get a good idea of the tag groupings. Then I made a JSON out of it and loaded it through d3.layout.pack() to get radii and coordinates for the relative sizes of the bubbles. The text is also scaled through radii for good proportionality:

Hope you like it!

EDIT – Someone on Reddit spotted an oopsie in my SQL… now it’s fixed. Thanks!