fsm.svg
Installation
$ npm install fsm.svg
Load
HTML
<script src="https://cdn.jsdelivr.net/npm/fsm.svg/dist/fsm-svg.common.min.js"></script>
ES6
import FsmSvg from "fsm.svg";
Usage
in your file
var svg = FsmSvg.init("#flow");
svg.setOption({
states: [
{
label: "Normal",
color: "#8FBC8F"
},
{
label: "Warning",
color: "#EC0000"
},
{
label: "Problematic",
color: "#A64EA6"
},
{
label: "Exit"
}
],
links: [[0, 1], [0, 2], [1, 0], [1, 2], [2, 0], [2, 1]]
});
// scale states[1]:Warning
svg.scale(1, 1.4);
// restore
setTimeout(() => {
fsm.scale(1, 1);
}, 1600);