欢迎就是需要使用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. bzoj 1212: [HNOI2004]L语言 AC自动机+状压

    为什么这道题网上所有题解写的都是N*Len的trie树的暴力啊,4E的复杂度... 为什么暴力还跑这么快啊TAT.. 有一个O(Len)的做法就是先把AC自动机建出来,因为每个字典串的长度很小,所以我 ...

  2. 利用机器学习实现微信小程序-加减大师自动答题

    之前有看到微信小程序<跳一跳>别人用python实现自动运行,后来看到别人用hash码实现<加减大师>的自动答题领取娃娃,最近一直在研究深度学习,为啥不用机器学习实现呢?不就是 ...

  3. 论C语言中二级指针和二维数组之间的区别

    刚开始学习C语言的时候,觉得一个数组可以定义一个一级指针去访问,想当然的就觉得可以定义一个二级指针去访问二维数组.很显然这是错误的. 我们来看看C语言的数组在内存中的存储方式. 实际上C语言中的数组, ...

  4. 【Asp.net入门4-01】基本开发工具

  5. python 文件读写,打开 未完。。。

    导入库 os库   import os 获取当前目录 os.getcwd() 切换目录 os.chdir('路径') 打开写入文件 import osos.getcwd()os.chdir('E:\\ ...

  6. TCP、UDP绑定同一端口通信的解释

    昨日突然讨论起TCP与UDP是否可以在同一端口进行绑定,通信. 在印象当中我记得是可以的,今日google了相关资料, 确定以及肯定的: TCP.UDP可以绑定同一端口来进行通信: 网络中可以被命名和 ...

  7. [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

    转载自:https://segmentfault.com/a/1190000006435886 解决办法:添加package.config.js配置文件中,添加本文章的红色部分代码 import vu ...

  8. 使用 Collections 实现排序 sort方法 对List 实体类实现Comparable类 示例

    package com.test.jj; import java.util.ArrayList; import java.util.Collections; public class Test { A ...

  9. [USACO07NOV]挤奶的时间Milking Time

    https://daniu.luogu.org/problemnew/show/2889 按右端点从小到大排序后DP dp[i] 到第i个时间段的最大产奶量 不能按左端点排序,第i段由第j段更新时,第 ...

  10. python核心编程笔记——Chapter8

    Chapter8.条件和循环 这一章感觉有用的点并不多,在我眼里就只有迭代器,列表解析和生成器表达式值得研究而已. 8.2.循环,难度不大. #!usr/bin/env python #-*-codi ...