Monday, June 05, 2006

HTML Graphs

Via Robert, I've come across this little tool for creating a graph of the HTML on your webpage.
Everyday, we look at dozens of websites. The structure of these websites is defined in HTML, the lingua franca for publishing information on the web. Your browser's job is to render the HTML according to the specs (most of the time, at least). You can look at the code behind any website by selecting the "View source" tab somewhere in your browser's menu.

HTML consists of so-called tags, like the A tag for links, IMG tag for images and so on. Since tags are nested in other tags, they are arranged in a hierarchical manner, and that hierarchy can be represented as a graph. I've written a little app that visualizes such a graph, and here are some screenshots of websites that I often look at.

I've used some color to indicate the most used tags in the following way:
blue: for links (the A tag)
red: for tables (TABLE, TR and TD tags)
green: for the DIV tag
violet: for images (the IMG tag)
yellow: for forms (FORM, INPUT, TEXTAREA, SELECT and OPTION tags)
orange: for linebreaks and blockquotes (BR, P, and BLOCKQUOTE tags)
black: the HTML tag, the root node
gray: all other tags

I've put a few of my sites through this little applet, and come up with the following neat little graphs.



This is the graph for The Kitchen. I have an awful lot of links and buttons on the site, which has grown up quite organically anyway. The cluster of orange tags at the bottom represents, I think, my posts.



The graph for my Devil's Kitchen Design site. It's nice and clean: the blue cluster at the bottom represents the menu.



The graph for my brother's solo site, Gronk. It would be difficult to get much simpler than this one.



The graph for the Triptych Media site. The cluster up to the right, again, represents the menu: the orange cluster at the bottom left is the main text of the page. As you can see, the whole thing is held together by DIV tags.

I'm not quite sure what we should take from these little maps, but they are quite beautiful anyway...

No comments:

Steve Baker: still decent, still libertarian

When your humble Devil adopted Steve Baker MP as this blog’s mascot in 2010 , Steve was somewhat concerned—and asked a number of free market...