Graphviz:因果関係図を作ってみよう
時間的にもっとも古い原因を左上に書く
↓こんな
code:d3.js
const digraph = ` digraph Causal_diagram {
label="風が吹けば桶屋が儲かる";
s1->s2->s3->s4;
s4->s5->s6->s7;
}
`
code:d3.js
d3.select("#graph").graphviz()
.fade(false)
.renderDot(digraph);
code:vizScript.js
const graph = `
digraph Causal_diagram {
label="風が吹けば桶屋が儲かる";
s1->s2->s3->s4;
s4->s5->s6->s7;
}
`;
const viz = new Viz();
viz.renderSVGElement(graph)
.then(function(element) {
const editor = document.getElementById('editor');
editor.appendChild(element);
});
viz-script-button.icon (実行ボタン)