Force directed layout –> tag cloud?

When I’m not doing mapping, I occasionally digress into other application scenarios.  Of late, tag clouds have been all the rage, and yet, when recently faced with the challenge of implementing one, I realized that the layout algorithm is non-trivial.

In the past, force directed layouts had been helpful, and so I thought of applying them here.  If you’re not familiar with the concept, the idea is to model an arbitray graph with nodes as charged particles connected by spring edges (see for a more detailed discussion.)  Computing the physics and running the algorithm iteratively causes the graph to untangle itself.

To get an idea how this works, check out the graph sample in Kevin Moore’s WPF Bag of Tricks.  The effect is quite nice, and should work nicely for tag clouds built in either WPF or Silverlight.  This will be the topic of my next scintillating series (once I wrap up the mapping work I’ve been doing.)

Comments (0)