提交 f92fc655 编写于 作者: doc_wei's avatar doc_wei

11

上级 9b6fa893
......@@ -11,6 +11,8 @@ layui.config({
var tip_index = 0;//鼠标移上去的tip的index
var sel = null;//选中项
// 关闭 G6 的体验改进计划打点请求
G6.track(false);
......@@ -45,6 +47,12 @@ layui.config({
net.read(data);
net.render();
//设置点击选中项
net.on("itemactived", function(e){
sel = e.item;
console.log(sel);
});
var i = 1;//位置坐标
$("body").on("mouseenter", "#addCircle", function(e){//添加圆形节点
tip_index = layer.tips('添加圆形', '#addCircle', {time: 0, tips: 3});
......@@ -84,9 +92,14 @@ layui.config({
net.refresh();
}
});
$('#addCustom1').on('click', function() {//添加自定义节点图形
net.beginAdd('node', {
$("body").on("mouseenter", "#addCustom1", function(e){//添加自定义节点图形
tip_index = layer.tips('添加自定义节点图形', '#addCustom1', {time: 0, tips: 3});
}).on('mouseleave', '#addCustom1', function(){
layer.close(tip_index);
});
$("body").on("click", "#addCustom1", function(e){//添加自定义节点图形
net.beginAdd('node', {
label: '[未定义]',
shape: 'circle'
});
......
......@@ -26,6 +26,9 @@
<li>
<button class="layui-btn layui-btn-primary layui-btn-sm" id="addSmooth"><i class="iconfont icon-quxian"></i></button>
</li>
<li>
<button class="layui-btn layui-btn-primary layui-btn-sm" id="addCustom1"><i class="iconfont icon-quxian"></i></button>
</li>
<li>
<button class="layui-btn layui-btn-primary layui-btn-sm" id="drag"><i class="fa fa-arrows"></i></button>
</li>
......@@ -40,7 +43,6 @@
<!--
<button id="delete">删除</button>
<button id="addCustom1">自定义形1</button>
<button id="addCustom2">自定义形2</button>
<button id="addCustom3">自定义形3</button> -->
<div class="layui-col-xs12">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册