'Generate flow chart html from json or xml

I have a problem in my web project. I need a generator which will generate flow chart(mathematically graph form) html structure from json or xml object.

Problem is that when generates flow chart there have connection lines. I want to write algorithm for optimally draw this lines and place charts in screen. I thing there must be such libraries. But I can't find any library which generates optimal fow chart screen from json or xml(or any other object structure). I found such libraries :

http://raphaeljs.com/

for example as form



Solution 1:[1]

If you consider a commercial solution, have a look on yFiles for HTML.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David