You may wish to embed figures produced with Blast Radius in other documents. You will need the following:
- an
svgfile andjsondocument representing the graph and its layout. These are produced with Blast Radius, as follows
[...]$ terraform graph | blast-radius --svg > graph.svg
[...]$ terraform graph | blast-radius --json > graph.jsonjavascriptandcss. You can find these in the.../blastradius/server/staticdirectory. Copy these files to an appropriate location, and ammend the following includes to reflect those locations.
<script src="/static/js/d3.v4.js"></script>
<script src="/static/js/d3-tip.js"></script>
<script src="/static/js/blast-radius.js"></script>
<script src="/static/js/categories.js"></script>
<link rel="stylesheet" type="text/css" href="/static/css/style.css">- A uniquely identified DOM element, where the
<svg>should appear, and a call toblastradius(...)somewhere after (usually at the end of the<html>document.
<div id="graph"></div>
<script>
blastradius('#graph', '/graph.svg', '/graph.json');
</script>That's it. Ideas to simplify this process strongly desired.