javascript - 可见网络重叠号码问题
问题描述
现在我正在使用 Visnetwork 开发一个项目(Angular 8),一切正常,除了线上的重叠数字,我们可以在不分隔线的情况下做到这一点,我的意思是我们可以改变数字在一行上的位置吗?你能帮我吗。(请查看此截图)
var edges = [
{ from: 2, to: 1, color:'#FF7F50', label: "2", arrows: "top",},
{ from: 1, to: 2, color:'#FF7F50', label: "2", arrows: "top"},
{ from: 6, to: 5, color:'#1085E0', label: "12", arrows: "top",},
{ from: 5, to: 6, color:'#1085E0', label: "5", arrows: "top"},
{ from: 5, to: 5, color:'pink', label: "5", arrows: "top"},
{ from: 6, to: 6, color:'#1085E0', label: "5", arrows: "top"},
{ from: 7, to: 2, color:'red' , label: "8", arrows: "middle"},
{ from: 4, to: 5, color:'#FF7F50', title: "Title", arrows: "to, from"},
{ from: 6, to: 7, color:'#0C7D1A', title: "Title", arrows: "middle"}
];
解决方案
var edges = [
{ from: 2, to: 1, color:'#FF7F50', label: "2", arrows: "top", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 1, to: 2, color:'#FF7F50', label: "2", arrows: "top", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 6, to: 5, color:'#1085E0', label: "12", arrows: "top", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 5, to: 6, color:'#1085E0', label: "5", arrows: "top", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 5, to: 5, color:'pink', label: "5", arrows: "top", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 6, to: 6, color:'#1085E0', label: "5", arrows: "top", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 7, to: 2, color:'red' , label: "8", arrows: "middle", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 4, to: 5, color:'#FF7F50', title: "Title", arrows: "to, from", smooth: { type: "curvedCW", roundness: 0.2 } },
{ from: 6, to: 7, color:'#0C7D1A', title: "Title", arrows: "middle", smooth: { type: "curvedCW", roundness: 0.2 } }
];
请参阅Stackblitz
推荐阅读
- python - 简单问题——这个函数中的 NoSuchElementException 和 WebDriverException 是什么意思?
- javascript - React:作为道具传递的函数无法正常工作
- getstream-io - 查看一个用户是否在关注另一个用户的方法?
- java - 快速java问题,如何使代码静音
- java - SpringBoot - Firestore:Firebase 应用程序未在 tomcat 服务器上初始化
- python - 从一个文件中获取属于另一个文件的元素
- excel - Excel TRIM 函数错误
- javascript - 为什么 chrome 控制台在这里没有返回 undefined ?
- django - 如何在 Django 中仅重命名 values() 中的某些项目?
- ios - 水平 UIStackView - 如何对齐里面的项目,使一个向左浮动,另一个在中心?