58 Star 249 Fork 85

lianglongqun / flowable-diagram

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo2.html 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
lianglongqun 提交于 2017-07-07 22:57 . demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="snap.svg.js"></script>
<script src="diagram.js"></script>
</head>
<body>
<style>
#svg {
width : 490px;
height : 290px;
border : 1px solid #000000;
}
</style>
<svg id="svg"></svg>
<script>
var cx = 100;
var data = {
"nodes": [
{
"type": "start",
"cx": cx,
"y": 20
},
{
"type" : "decision",
"id" : "d1",
"name" : "请假天数是否大于3",
"cx" : cx,
"y" : 80,
"w" : 180
},
{
"type": "task",
"id": "task1",
"name": "运维人员审批",
"highlight": true,
"cx": cx,
"y": 170,
"w": 140
},
{
"type": "task",
"id": "devtask",
"name": "开发人员审批",
"cx": cx + 200,
"y": 170,
"w": 140
},
{
"type": "end",
"cx": cx,
"y": 220
}
],
"lines": [
{
"from": "start",
"to": "d1"
},
{
"from": "d1",
"to": "task1",
"text" : ""
},
{
"from": "task1",
"to": "end"
},
{
"from": "d1",
"to": "devtask",
"text" : "",
"direction" : "x"
},
{
"from": "devtask",
"to": "end",
"direction" : "y"
}
]
};
var flow = new Flow("svg", data);
flow.render();
</script>
</body>
</html>
JavaScript
1
https://gitee.com/jscode/flowable-diagram.git
git@gitee.com:jscode/flowable-diagram.git
jscode
flowable-diagram
flowable-diagram
master

搜索帮助