fsm.svg

0.4.0 • Public • Published

fsm.svg

Gitter NPM Version

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);

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i fsm.svg

Weekly Downloads

12

Version

0.4.0

License

MIT

Unpacked Size

1.41 MB

Total Files

45

Last publish

Collaborators

  • pengfei.wang