Skip to content

Instantly share code, notes, and snippets.

@magjac
Created April 23, 2018 05:16
Show Gist options
  • Save magjac/aa887717385a9c5f9742b9a64f179705 to your computer and use it in GitHub Desktop.
Save magjac/aa887717385a9c5f9742b9a64f179705 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v5.min.js"></script>
<script src="https://unpkg.com/[email protected]/viz.js" type="javascript/worker"></script>
<script src="https://unpkg.com/[email protected]/build/d3-graphviz.min.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
dotSrc = `
digraph {
node [shape = box, color=blue];
edge [dir = none];
I0000 [label=<<table border="0" cellborder="0"><tr><td><img src="http://yuanqingfei.me/images/sparrow2.jpeg" width="50" height="60"/></td></tr><tr><td>清<br/>袁<br/>1122</td></tr></table>>]
}
`;
d3.select("#graph").graphviz()
.addImage("http://yuanqingfei.me/images/sparrow2.jpeg", 50, 60)
.renderDot(dotSrc);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment