Packages

FaultTree is a library for performing [fault tree analysis](https://en.wikipedia.org/wiki/Fault_tree_analysis). It includes a small HTTP server capable of graphing the resulting FTA, or returning it as JSON.

Current section

Files

Jump to
fault_tree priv templates graph.html.eex
Raw

priv/templates/graph.html.eex

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
html{
height: 100%;
}
body {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
margin: 5px;
}
.node {cursor: pointer;}
.node text {
font: 10px sans-serif;
font-weight: bold;
}
.link {fill: none;stroke: #ccc;stroke-width: 1.5px;}
</style>
</head>
<body>
<div id="body"></div>
</body>
<script>
// global tree data
window.data = <%= @tree %>;
</script>
<script src="/js/graph.js"></script>