效果如下:

代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
<script src="js/vue.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.1.0/build/g6.js"></script>
</head>
<body>
<div id="app">
<div id="mountNode"></div>
</div>
<script>
var vm = new Vue({
el: '#app',
data: {
nodes: [
{
id: '1',
label:'开始',
x: 80,
y: 80,
size: [100, 50],
shape: 'ellipse', //rect方形 ellipse 椭圆 diamond 菱形
style: {
radius:30, //bordr-radius
stroke: '#afe2a9', //border色
fill: '#f1fcf1', //填充色
lineWidth: 2 //border宽
}
},
{
id: '2',
x: 240,
label:'过程',
y: 80,
size: [100, 50],
shape: 'rect',
style: {
radius:10, //bordr-radius
stroke: '#afcdda', //border色
fill: '#e8f3f5', //填充色
lineWidth: 2 //border宽
}
},
{
id: '3',
x: 400,
y: 80,
label:'判断',
size: [110,60],
shape: 'diamond', //菱形
style: {
radius:25, //bordr-radius
stroke: '#7d7dc5', //border色
fill: '#e3e4fa', //填充色
lineWidth: 2 //border宽
}
},
{
id: '4',
x: 400,
y: 200,
size: [100,50],
label:'维修',
shape: 'rect',
style: {
radius:10,
stroke: '#fbb9b8',
fill: '#f9e7e6',
lineWidth: 2
}
},
{
id: '5',
x: 560,
y: 80,
size: [100, 50],
shape: 'ellipse',
label:'装箱',
style: {
stroke: '#b3b8b5',
fill: '#ffffff',
lineWidth: 2
}
},
],
edges: [
{source: '1',target: '2', label: '贴片'},
{source: '2', target: '3', label: '贴片'},
{source: '3', target: '5', label: '打样'},
{source: '3', target: '4', label: '维修'},
]
},
methods: {
dataFun(){
this.edges.forEach((item,index)=>{
Object.assign(item,{shape:'line'})
Object.assign(item,{color:'#ccc'})
Object.assign(item,{size:2})
Object.assign(item,{labelCfg: {
refY: 15,
position: 'center',
autoRotate: false,
style: {
lineWidth: 20,
fill: '#989d9b',
}
}})
})
}
},
mounted() {
const graph = new G6.Graph({
container: 'mountNode',
width: 700,
height: 300,
defaultNode: {
label: 'node-label',
labelCfg: {
offset: [10, 10, 10, 10],
style: {
fill: '#797b7e',
fontSize: 15,
fontWeight: 'bold'
}
},
}
}); let info = {};
info['nodes'] = this.nodes;
info['edges'] = this.edges;
graph.data(info);
graph.render();
},
created() {
this.dataFun()
}
});
</script>
</body>
</html>

说明:
vue为本地的静态文件,需自己替换。

vue + antV G6 实现流程图完整代码 (antv G6 流程图)的更多相关文章

  1. div css仿京东订单流程图样式代码

    效果展示 http://hovertree.com/texiao/css/25/ 本效果适合PC,也适合移动端 手机扫描二维码查看效果: 效果图: 代码如下: <!DOCTYPE html> ...

  2. log4net保存到数据库系列四、完整代码配置log4net

    园子里面有很多关于log4net保存到数据库的帖子,但是要动手操作还是比较不易,从头开始学习log4net数据库日志一.WebConfig中配置log4net 一.WebConfig中配置log4ne ...

  3. java mail实现Email的发送,完整代码

    java mail实现Email的发送,完整代码 1.对应用程序配置邮件会话 首先, 导入jar <dependencies> <dependency> <groupId ...

  4. JavaScript与html5写的贪吃蛇完整代码

    JavaScript与html5写的贪吃蛇完整代码 查看运行效果可访问http://www.codesocang.com/texiao/youxitexiao/2014/0402/7045.html# ...

  5. 【搜索引擎Jediael开发4】V0.01完整代码

    截止目前,已完成如下功能: 1.指定某个地址,使用HttpClient下载该网页至本地文件 2.使用HtmlParser解释第1步下载的网页,抽取其中包含的链接信息 3.下载第2步的所有链接指向的网页 ...

  6. jQuery弹出窗口完整代码

    jQuery弹出窗口完整代码 效果体验:http://keleyi.com/keleyi/phtml/jqtexiao/1.htm 1 <!DOCTYPE html PUBLIC "- ...

  7. python实现邮件发送完整代码(带附件发送方式)

    实例一:利用SMTP与EMAIL实现邮件发送,带附件(完整代码) __author__ = 'Administrator'#coding=gb2312 from email.Header import ...

  8. 基于Python使用SVM识别简单的字符验证码的完整代码开源分享

    关键字:Python,SVM,字符验证码,机器学习,验证码识别 1   概述 基于Python使用SVM识别简单的验证字符串的完整代码开源分享. 因为目前有了更厉害的新技术来解决这类问题了,但是本文作 ...

  9. 单点登录SSO:可一键运行的完整代码

    单点登录方案不同于一个普通站点,它的部署比较繁琐:涉及到好几个站点,要改host.安装证书.配置HTTPS. 看到的不少这方面示例都是基于HTTP的,不认同这种简化: 1. 它体现不出混合HTTP/H ...

  10. Delphi实现图像文本旋转特效完整代码

    Delphi实现图像文本旋转特效完整代码,本程序利用的控件主要是Panel 控件.Image 控件.Edit 控件.Label 控件和Button 控件.本程序的关键是利用Delphi 的bmp_ro ...

随机推荐

  1. centos7本地yum配置和使用

    1.打开centos的yum文件夹 输入命令cd  /etc/yum.repos.d/ 2.用wget下载repo文件 输入命令wget  http://mirrors.aliyun.com/repo ...

  2. 小程序隐藏scroll-view滚动条的方法

    在wxss文件上加上 ::-webkit-scrollbar{ width: 0; height: 0; color: transparent; }

  3. DSP(数字信号处理)与监控摄像机相关技术解读

    提起安防领域,我们第一个想到的应该就是监控摄像机了,它对于安防的重要性,就像人的眼睛对于人的作用一样,是重要的信息获取来源. 监控摄像机广泛应用于学校.公司.银行.交通.平安城市等多个安保领域. 广州 ...

  4. 技嘉b75m-d3v在nvme固态安装win7并且oem激活的实现过程

    本篇文章主要讲述了实现台式机主板oem激活win7以及旧平台主板使用nvme固态安装win7的过程 事情的起因是我去年在小黄鱼买了台戴尔n4110,今年买了台惠普银河舰队2代,并且把里面128GB的n ...

  5. mysql redis 开启远程访问

    springboot 加载外部yml nohup java -jar warehouse-0.0.1-SNAPSHOT.jar --Dspring.config.location=/root/www/ ...

  6. VSCode-WSL配置 C++ —— 以OpenCV4为例

    生成并编辑c_cpp_properties.json 命令窗口输入:>C/C++: Edit Configurations(JSON),就会自动生成该文件 在includePath中加上需要in ...

  7. R7-7 调查电视节目受欢迎程度

    R7-7 调查电视节目受欢迎程度 分数 15 全屏浏览题目 切换布局 作者 颜晖 单位 浙大城市学院 某电视台要调查观众对该台8个栏目(设相应栏目编号为1~8)的受欢迎情况,共调查了n位观众(1≤n≤ ...

  8. vue组件之间的传参

    vue组件之间传参有三种传参方式'父传子','子传父','非父子组件之间传值' 父传子 父组件 <template> <CounterCom :num="5"&g ...

  9. fragment加radio不可滑动

    public class MainActivity extends AppCompatActivity implements RadioGroup.OnCheckedChangeListener { ...

  10. WEB漏洞扫描工具之OWASP ZAP

    添加扫描策略 使用新建的扫描策略