score:0

Accepted answer

Is this what you're looking for?

<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="http://viz-js.com/bower_components/viz.js/viz-lite.js"></script>
<script src="https://github.com/magjac/d3-graphviz/releases/download/v0.1.2/d3-graphviz.min.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>

var dot = [
    'digraph G {',
    '    graph [rankdir=LR]',
    '    A -> B',
    '    A -> C',
    '    B -> D',
    '    C -> D',
    '    A -> D',
    '}',
 ].join('\n');

  d3.select("#graph").graphviz()
    .renderDot(dot);

</script>


Related Query