<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#cy {
width: 100%;
height:100%;
position: absolute;
left: 0;
top:0;
}
</style>
</head>
<body>
<div id="cy"></div>
<script src="./jquery.min.js"></script>
<script src="./main.js"></script>
<script>
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: true,
autounselectify: true,
motionBlur:!1,
maxZoom:2.5,
minZoom:.4,
wheelSensitivity:.1,//滑动滚轮一次缩放大小
textureOnViewport:!1,
style: [{
selector: 'node',
style: {
"content": function (ele) {
return ele.data('label') || ele.data('id')
},
"text-valign": 'center',
"width": function (a) {
return "Company" == a.data('type') ? 60 : 45
},
"height": function (a) {
return "Company" == a.data('type') ? 60 : 45
},
"background-color": function (a) {
return !a.data('target') ? '#47D2AC' : "Company" == a.data('type') ?
'#2196F4' : '#EAA829'
},
"color": '#fff',
"border-color": function (a) {
return !a.data('target') ? '#47D2AC' : "Company" == a.data('type') ?
'#2196F4' : '#EAA829'
},
"border-width": 1,
"text-wrap": "wrap",
"font-size": 10,
"font-family": "microsoft yahei",
"overlay-color": "#fff",
"overlay-opacity": 0,
"background-opacity": 1,
"shape": "ellipse",
"z-index-compare": "manual",
"z-index": 20,
"padding": function (a) {
return "Company" == a.data("type") ? 3 : 0
},
"text-max-width": 60,
"text-margin-y": function (a) {
return "Company" == a.data("type") ? 4 : 2
},
"label": function (a) {
a = a.data("id");
var b = a.length;
return 5 >= b ? a : 5 <= b && 9 >= b ? a.substring(0, b - 5) + "\n" + a.substring(
b - 5, b) : 9 <= b && 13 >= b ? a.substring(0, 4) + "\n" + a.substring(
4, 9) + "\n" + a.substring(9, 13) : a.substring(0, 4) + "\n" + a.substring(
4, 9) + "\n" + a.substring(9, 12) + ".."
},
}
},
{
selector: 'edge',
style: {
// 添加箭头
"line-style": function (a) {
return "solid"
},
"curve-style": "bezier",
"control-point-step-size": 20,
"target-arrow-shape": "triangle",
"target-arrow-color": function (a) {
// return a.data("color")
return '#DCDCDC'
},
"arrow-scale": .5,
"line-color": function (a) {
// return a.data("color")
return '#DCDCDC'
},
"label": function (a) {
return a.data("label")
},
"text-opacity": .8,
"font-size": 10,
"background-color": function (a) {
return "#333"
},
"width": 1,
"overlay-color": "#fff",
"overlay-opacity": 0,
"font-family": "microsoft yahei"
}
},
{
selector: ':selected',
style: {
"border-width": 3,
"border-color": '#333',
"background-color": 'black',
"line-color": 'black',
"target-arrow-color": 'black',
"source-arrow-color": 'black'
}
},
{
selector: ".nodeHover", //节点变暗,有悬停效果
style: {
"shape": "ellipse",
"background-opacity": .8
}
},
{
selector: ".nodeActive",
style: {
"border-color": '#4EA2F0',
"border-width": 10,
"border-opacity": .5
}
},
{
selector: ".edgeShow",
style: {
"color": "#999",
"text-opacity": 1,
"font-weight": 400,
"label": function (a) {
return a.data("label")
},
"font-size": 10,
"arrow-scale": .8,
"width": 1.5,
"source-text-margin-y": 20,
"target-text-margin-y": 20,
},
},
{
selector: ".edgeActive",
style: {
"arrow-scale": .8,
"width": 1.5,
"color": "#330",
"text-opacity": 1,
"font-size": 10,
"text-background-color": "#fff",
"text-background-opacity": .8,
"text-background-padding": 0,
"source-text-margin-y": 20,
"target-text-margin-y": 20,
"z-index-compare": "manual",
"z-index": 1,
"line-color": function (a) { //直线颜色
return "#4EA2F0"
},
"target-arrow-color": function (a) { //箭头颜色
return "#4EA2F0"
},
label: function (a) {
return a.data("label")
}
}
},
{
selector: ".dull",
style: {
"z-index": 1,
"opacity": .2
}
}
],
elements: {
nodes:[
{data:{id:'RepAdams',target:true,type:'People'}},
{dat
土豆片片
- 粉丝: 1855
- 资源: 5869
最新资源
- 有源滤波器(APF)主要由两大部分构成:指令电流检测部分和补偿电流生成部分 主要工作原理是检测补偿点处电压和电流,通过谐波检测手段,将负载电流分为谐波电流和基波电流,然后将谐波电流反极性作为补偿电流
- 机械设计钣金件的助力搬运机械手sw20非常好的设计图纸100%好用.zip
- 基于java+springboot+vue+mysql的动漫交流与推荐平台 源码+数据库+论文(高分毕业设计).zip
- 基于java+springboot+vue+mysql的茶叶商城系统 源码+数据库+论文(高分毕业设计).zip
- EKF扩展卡尔曼滤波算法做电池SOC估计,在Simulink环境下对电池进行建模,包括: 1.电池模型 2.电池容量校正与温度补偿 3.电流效率 采用m脚本编写EKF扩展卡尔曼滤波算法,在Simuli
- HRNet的onnx格式转rknn格式的工程
- 价值799元(完美运行版)2024最新小R付费进群自动定位版本
- 机械设计PF-1315反击式破碎机sw14可编辑非常好的设计图纸100%好用.zip
- 基于java+springboot+vue+mysql的教务管理系统 源码+数据库+论文(高分毕业设计).zip
- 单相光伏并网逆变器设计方案参考资料 资料包含: 1.硬件设计概要和软件设计总体方案文档; 2.Matlap Simulink仿真文件; 3.控制代码;
- 基于java+springboot+vue+mysql的二手车交易系统 源码+数据库+论文(高分毕业设计).zip
- 基于java+springboot+vue+mysql的公交智能化系统 源码+数据库+论文(高分毕业设计).zip
- 基于java+springboot+vue+mysql的考试报名系统 源码+数据库+论文(高分毕业设计).zip
- 使用unity绘制颜色板
- 基于java+springboot+vue+mysql的旅游网站系统 源码+数据库+论文(高分毕业设计).zip
- 基于java+springboot+vue+mysql的凉州区助农惠农服务平台 源码+数据库+论文(高分毕业设计).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈