首页 > 解决方案 > 可见网络重叠号码问题

问题描述

现在我正在使用 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"}
    ];

标签: javascripthtmlangularnetworkingvisnetwork

解决方案


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


推荐阅读