I have a Markov chain that I would like to represent graphically in javascript. I need to provide nodes, links, and transition probabilities. Perhaps something like one of these two diagrams:


Finding a good image library (like Raphael) is not a problem. The problem for me is to find a way to make sure that the nodes are laid out beautifully, with a minimum number of lines intersecting in front of other nodes or lines. Something like the "Lay out diagram" option in OmniGraffle (I'm sure there is a similar feature in Visio).
Is there a JS library that can do this for me, and if anyone does not know how to approach this problem? Please note that my brand chains are likely to be much more complex than the examples above.
javascript graphics markov-chains
Jeff
source share