views:

92

answers:

4

I want the algorithm for creating a Treemap visualization.

Something like this: An Easy Way to Make a Treemap

Problem is that I do not want to use R ... and I want the source-code. Preferably in Python or Java.

Thing is that I have to customize it ... instead of colors I want images, so something that gives me coordinates would be awesome.

Thanks,

+3  A: 

http://sourceforge.net/projects/treemap/ is an opensource implementation of the algorithm described in the shneiderman paper. there is also a reference implementation in their archive

Nikolaus Gradwohl
+2  A: 

The wikipedia article seems to have some good links at the end.

I'd probably first try the easy approach of recursion and proportional division. At first level of the tree, divide the target area vertically (each area here is a branch, area size depends on branch size):

+-------+-------+-------+
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
+-------+-------+-------+

At second level, divide horizontally:

+-------+-------+-------+
|       |       |       |
+-------+       |       |
|       +-------+       |
|       |       |       |
|       |       +-------+
|       |       |       |
+-------+-------+-------+

At third level divide vertically again:

+--+----+----+--+----+--+
|  |    |    |  |    |  |
+--+-+--+    |  |    |  |
|    |  +-+--+--+    |  |
|    |  | |     |    |  |
|    |  | |     +---++--+
|    |  | |     |   |   |
+----+--+-+-----+---+---+

Etc.

Vilx-
+2  A: 

This is another good starter - a LOT to read and an archive containing treemap algorithms. The visualization part may be missing.

Andreas_D
A: 

Prefuse also has implemented a TreeMap. Here's an example. Here's the code for the example.

Jay Askren