JointJS - JavaScript diagramming library - Demos.

Smart Routing

Try to drag elements and see how the link avoids the obstacles.

Source Code on GitHub.