java代码识别节点拓扑图_vue 集成 vis-network 实现网络拓扑图

本文介绍如何用Vue集成vis-network库来构建一个节点拓扑图。通过展示具体的java代码,展示了如何定义节点(如服务器、集线器等)和边,创建一个互动的网络拓扑结构。
摘要由CSDN通过智能技术生成

let DIR = "/jtopo/";

let nodes = [

{ id: 1, shape: "circularImage", image: DIR + "server.png" },

{ id: 2, shape: "circularImage", image: DIR + "server.png" },

{ id: 3, shape: "circularImage", image: DIR + "server.png" },

{

id: 4,

shape: "circularImage",

image: DIR + "gather.png",

label: "pictures by this guy!"

},

{ id: 5, shape: "circularImage", image: DIR + "wanjet.png" },

{ id: 6, shape: "circularImage", image: DIR + "center.png" },

{ id: 7, shape: "circularImage", image: DIR + "cloud.png" },

{ id: 8, shape: "circularImage", image: DIR + "center.png" },

{ id: 9, shape: "circularImage", image: DIR + "wanjet.png" },

{ id: 10, shape: "circularImage", image: DIR + "gather.png" }

// { id: 11, shape: "circularImage", image: DIR + "11.png" },

// { id: 12, shape: "circularImage", image: DIR + "12.png" },

// { id: 13, shape: "circularImage", image: DIR + "13.png" },

// { id: 14, shape: "circularImage", image: DIR + "14.png" },

// {

// id: 15,

// shape: "circularImage",

// image: DIR + "missing.png",

// brokenImage: DIR + "missingBrokenImage.png",

// label: "when imagesnfailnto load"

// },

// {

// id: 16,

// shape: "circularImage",

// image: DIR + "anotherMissing.png",

// brokenImage: DIR + "9.png",

// label: "fallback image in action"

// }

];

let edges = [

{ from: 1, to: 4 },

{ from: 2, to: 4 },

{ from: 3, to: 4 },

{ from: 4, to: 5 },

{ from: 5, to: 6 },

{ from: 6, to: 7 },

{ from: 8, to: 7 },

{ from: 9, to: 8 },

{ from: 10, to: 9 }

// { from: 8, to: 10 },

// { from: 10, to: 11 },

// { from: 11, to: 12 },

// { from: 12, to: 13 },

// { from: 13, to: 14 },

// { from: 9, to: 16 }

];

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值