Demo: Map with labels

Originally Designed for a FireFox Greasemonkey Script. Adapted for limited Safari/Chrome support.

The problem: Given a scatter plot with labels, how can you display the labels with as little overlap as possible?

My solution: Treat the labels as like-charged ions that are attached to their points by springs. Then calculate iterations of how they would move using Coulomb's Law and Hooke's Law. Actually calculating the positions of least energy is not only computationaly excessive, but the iterative approach produces "good enough" results.

Reload Map

toggle

Final Notes: The map isn't perfect or as efficient as I would like, and I certainly could make it perform better and look better (It looks worse in Safari/Chrome for one thing). I have some interest in developing this further and maybe even making it as nice as Protovis, but I'm not using this code enough right now and I don't have the free time.