关键词搜索

源码搜索 ×
×

visjs笔记-将edges(边)分开(防止重叠)

发布2022-06-16浏览451次

详情内容

也就是从这个效果:

变成这种效果:

代码是从这样的:

  1. let edges = new vis.DataSet([
  2. {
  3. from: 1,
  4. to: 2,
  5. label: '<b>①用户提交表单</b>'
  6. },
  7. {
  8. from: 2,
  9. to: 3,
  10. label: '<b>②验证并提交数据</b>'
  11. },
  12. {
  13. from: 3,
  14. to: 4,
  15. smooth: {type: 'curvedCW', roundness: 0.5},
  16. label: '<b>③分析数据调用模块</b>'
  17. },
  18. {
  19. from: 4,
  20. to: 3,
  21. label: '<b>④结果以Base64返回</b>'
  22. },
  23. {
  24. from: 3,
  25. to: 2,
  26. label: '<b>⑤结果以Json形式返回</b>'
  27. },
  28. {
  29. from: 2,
  30. to: 1,
  31. label: '<b>⑥头像返回给用户</b>'
  32. }
  33. ]);

改成这样的:

  1. let edges = new vis.DataSet([
  2. {
  3. from: 1,
  4. to: 2,
  5. smooth: {type: 'curvedCW', roundness: 0.5},
  6. label: '<b>①用户提交表单</b>'
  7. },
  8. {
  9. from: 2,
  10. to: 3,
  11. smooth: {type: 'curvedCW', roundness: 0.5},
  12. label: '<b>②验证并提交数据</b>'
  13. },
  14. {
  15. from: 3,
  16. to: 4,
  17. smooth: {type: 'curvedCW', roundness: 0.5},
  18. label: '<b>③分析数据调用模块</b>'
  19. },
  20. {
  21. from: 4,
  22. to: 3,
  23. smooth: {type: 'curvedCW', roundness: 0.5},
  24. label: '<b>④结果以Base64返回</b>'
  25. },
  26. {
  27. from: 3,
  28. to: 2,
  29. smooth: {type: 'curvedCW', roundness: 0.5},
  30. label: '<b>⑤结果以Json形式返回</b>'
  31. },
  32. {
  33. from: 2,
  34. to: 1,
  35. smooth: {type: 'curvedCW', roundness: 0.5},
  36. label: '<b>⑥头像返回给用户</b>'
  37. }
  38. ]);

 其实就是添加好roundness和curvedCW即可。

相关技术文章

点击QQ咨询
开通会员
返回顶部
×
微信扫码支付
微信扫码支付
确定支付下载
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载