欢迎就是需要使用jsplumb跟正在使用jsplumb的一起讨论 欢迎私聊

1.关于jsplumb的connection的一些事件

####connection拖动的事件

instance.bind('connectionDragStop', function(conn) {});

####连接废弃

instance.bind('connectionAborted', (conn, originalEvent) => {})

####在落下来某一个点之前

instance.bind('beforeDrop', (conn) => {})

####

instance.bind('beforeDrag', (conn) => {})

####

instance.bind('connectionDrag', (conn) => {})

####

instance.bind('beforeDetach', (conn) => {})

####想要拿到连线的点击事件啊,hover事件啊,都可以通过bind来实现

instance.bind('click', function(c) {})

等等这些事件吧~~~~~

2.就是关于连接线的一些样式问题

  1.你可以在一个页面上实现多种连接的样式,这个都是可以实现的

  2.有关于线是实线啊,虚线啊这些也都是可以实现的 虚线的话dashstyle可以来实现,应该是跟css差不多的

恩。。。。。

放一些废弃代码

initConnect(instance) {
var that = this;
instance.batch(function() {
for (const point of that.$store.state.nodes) {
that.initNode(instance, point.node_id)
if (point.child_nodes.length > || point.parent_node == 'root') {
instance.addEndpoint(point.node_id, {
uuid: `${point.node_id}-bottom`,
anchor: 'Bottom',
maxConnections: -,
// connectorStyle: { stroke: '#2FB39C', strokeWidth: 2 },
// connectorHoverStyle: {
// strokeWidth: 3,
// stroke: "yellow",
// },
deleteEndpointsOnEmpty: true,
dragOptions: {},
}, {
isSource: true,
isTarget: true,
});
}
if (point.parent_node !== 'root') {
instance.addEndpoint(point.node_id, {
uuid: `${point.node_id}-top`,
anchor: 'Top',
maxConnections: -,
deleteEndpointsOnEmpty: true,
}, {
isSource: true,
isTarget: true,
});
}
if (point.jump_nodes.length > ) {
point.jump_nodes.forEach((item, index) => {
instance.connect({
source: point.node_id,
target: item,
paintStyle: {
stroke: "#E72F1F",
strokeWidth: 2.5,
dashstyle: "4 2", },
maxConnections: -,
anchor: 'Right',
overlays: [
["Arrow",
{
width: ,
length: ,
location: ,
events: {
click: function() {
// alert('click')
}
}
}
],
["Custom", {
create: function(component) {
return $('<img src=' + shears + '>');
},
location: -,
events: {
click: function(e) {
that.deleteConfirmFun(instance, e.component)
}, }
}]
]
});
})
}
}
// init transition
for (const i of that.$store.state.lines) {
const uuid = [`${i[]}-bottom`, `${i[]}-top`];
instance.connect({
uuids: uuid,
});
} })
var sourceEndpoint=this.jsPlumbInstance.getEndpoint(`A1-bottom`);
console.log('sourceEndpoint',sourceEndpoint)
},
addConnect(point) {
var parent=this.findParentNode(point.node_id);
// console.log('parentNode',parentNode)
this.jsPlumbInstance.addEndpoint(point.node_id, {
uuid: `${point.node_id}-bottom`,
anchor: 'Bottom',
maxConnections: -,
deleteEndpointsOnEmpty: true,
dragOptions: {},
}, {
isSource: true,
isTarget: true,
});
this.jsPlumbInstance.addEndpoint(point.node_id, {
uuid: `${point.node_id}-top`,
anchor: 'Top',
maxConnections: -,
deleteEndpointsOnEmpty: true,
}, {
isSource: true,
isTarget: true,
});
var sourceEndpoint=this.jsPlumbInstance.getEndpoint(`${parent.node_id}-bottom`);
var targetEndpoint=this.jsPlumbInstance.getEndpoint(`${point.node_id}-top`);
const uuid = [`${parent.node_id}-bottom`, `${point.node_id}-top`];
this.jsPlumbInstance.connect({
source:sourceEndpoint,
target:targetEndpoint
})
this.jsPlumbInstance.repaintEverything({clearEdits:false})
},
deleteEndpoint() {
console.log('')
// jsPlumb.detach(conn);
// 删除他与子元素的连接
console.log(this.jsPlumbInstance)
// this.jsPlumbInstance.remove(this.nodes[0].node_id);
// this.jsPlumbInstance.empty(this.nodes[0].node_id); var a = this.jsPlumbInstance.getEndpoint(`${this.nodes[].node_id}-bottom`)
console.log('a', a)
this.jsPlumbInstance.deleteEndpoint(a)
},

恩。。。还有一个问题

就是如果你连线的元素发生了位置的转移,如果你是通过端点去连接的

然后我想说 是确实需要重绘的

如果你元素的位置发生了改变

有什么想说的 欢迎来指教

 

使用jsplumb的一些笔记的更多相关文章

  1. jsPlumb.jsAPI阅读笔记(官方文档翻译)

    jsPlumb DOCS 公司要开始做流程控制器,所以先调研下jsPlumb,下文是阅读jsPlumb提供的document所产生的归纳总结 setup 如果不使用jQuery或者类jQuery库,则 ...

  2. [转]jsPlumb插件做一个模仿viso的可拖拉流程图

    原贴:https://www.cnblogs.com/sggx/p/3836432.html 前言 这是我第一次写博客,心情还是有点小小的激动!这次主要分享的是用jsPlumb,做一个可以给用户自定义 ...

  3. jsPlumb 学习笔记

    介绍 使用svg完成画图,四个概念: anchor: endpoint在的位置,可通过name访问 endpoint:connection的一端节点,通过addPoint makeSource, co ...

  4. 前端流程图jsplumb学习笔记

    1.这篇博客很好,另外两个是官网文档 http://www.cnblogs.com/leomYili/p/6346526.html https://jsplumbtoolkit.com/communi ...

  5. jsPlumb学习笔记

    这就是一个给元素画连接线的工具. <!DOCTYPE html> <html> <head> <title>jsPlumb</title> ...

  6. jsplumb实现流程图

    流程图使用工具汇总 jsPlumb,开源软件,推荐使用,参考学习链接: jsplumb学习笔记.基本概念.中文简易教程 jTopo myflow Go.js JointJS,属于商业软件 mxGrap ...

  7. git-简单流程(学习笔记)

    这是阅读廖雪峰的官方网站的笔记,用于自己以后回看 1.进入项目文件夹 初始化一个Git仓库,使用git init命令. 添加文件到Git仓库,分两步: 第一步,使用命令git add <file ...

  8. js学习笔记:webpack基础入门(一)

    之前听说过webpack,今天想正式的接触一下,先跟着webpack的官方用户指南走: 在这里有: 如何安装webpack 如何使用webpack 如何使用loader 如何使用webpack的开发者 ...

  9. SQL Server技术内幕笔记合集

    SQL Server技术内幕笔记合集 发这一篇文章主要是方便大家找到我的笔记入口,方便大家o(∩_∩)o Microsoft SQL Server 6.5 技术内幕 笔记http://www.cnbl ...

随机推荐

  1. [USACO18OPEN]Out of Sorts P 冒泡排序理解之二

    题目描述 Bessie把快速排序和冒泡排序混在了一起 给一个伪快排的代码: 冒泡: bubble_sort_pass (A) { to length(A)- ], swap A[i] and A[i+ ...

  2. Redis学习基础三

    回顾: 上一基础上浅尝了redis的存储数据类型,这一节将分别介绍数据类型的基础使用 一.启动本地Redis服务 1.打开cmd 窗口 使用 cd 命令切换至redis 安装根目录 运行: redis ...

  3. Python 字符串前面加u,r,b的含义

    1.字符串前加 u 例:u"我是含有中文字符组成的字符串." 作用: 后面字符串以 Unicode 格式 进行编码,一般用在中文字符串前面,防止因为源码储存格式问题,导致再次使用时 ...

  4. ElasticStack系列之十五 & query cache 引起性能问题思考

    问题描述 一个线上集群,执行的 Query DSL 都是一样的,只是参数不同.统计数据显示 98% ~ 99% 的查询相应速度都很快,只需要 4 ~ 6ms,但是有 1% 左右的查询响应时间在 100 ...

  5. P4889 kls与flag

    P4889 kls与flag 一堆杆子, 每个有特定高度 \(a_{i}\) , 现想把杆子弄倒, 可以在一维内往左弄倒和往右弄倒, 求最大优秀对数, 定义优秀对数为两杆倒后顶点重合 Solution ...

  6. Java基础-IO流对象之随机访问文件(RandomAccessFile)

    Java基础-IO流对象之随机访问文件(RandomAccessFile) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.RandomAccessFile简介 此类的实例支持对 ...

  7. [Web] Web请求过程之一:HTTP

    请求过程: 1.用户在浏览器输入 www.sdjtu.edu.cn 这个URL. 2.浏览器请求 DNS 服务器将这个 URL 解析成对应的 IP 地址. 3.浏览器向 IP 地址对应的这个服务器发起 ...

  8. np.diff函数

    np.diff函数 觉得有用的话,欢迎一起讨论相互学习~Follow Me 数组中a[n]-a[n-1] import numpy as np a=np.array([1, 6, 7, 8, 12]) ...

  9. 互斥锁 pthread_mutex_init()函数

    Linux下为了多线程同步,通常用到锁的概念.posix下抽象了一个锁类型的结构:ptread_mutex_t.通过对该结构的操作,来判断资源是否可以访问.顾名思义,加锁(lock)后,别人就无法打开 ...

  10. java8 write file 写文件

    1.用BufferedWriter写入文件 //Get the file reference Path path = Paths.get("c:/output.txt"); //U ...