您好,登錄后才能下訂單哦!
jTopo 幫助說明網站
http://www.jtopo.com/index.html
使用例子:
http://www.jtopo.com/demo/helloworld.html
不建議直接安裝 github 上的代碼,因為代碼版本不是最新,有部分功能未實現。
下載最新的js類庫文件放到 vue 項目 public 文件夾下。
引入 import "/jtopo/jtopo-0.4.8-min.js";
<template> <div> <PanelBase title="拓撲圖"> <div slot="head-btns" class="panel-head-btns"></div> <div slot="body-content"> <section class="table-section"> <canvas width="2000" height="600" id="canvas"></canvas> </section> </div> </PanelBase> </div> </template> let canvas = document.getElementById("canvas"); that.stage = new JTopo.Stage(canvas); that.scene = new JTopo.Scene(that.stage); that.scene.background = "/jtopo/aa.png"; let s1 = that.node("a1", 305, 43, "server.png"); s1.alarm = "2 W"; let s2 = that.node("a2", 365, 43, "server.png"); let s3 = that.node("a3", 425, 43, "server.png"); let g1 = that.node("a4", 366, 125, "gather.png"); that.linkNode(s1, g1, true); that.linkNode(s2, g1, true); that.linkNode(s3, g1, true); let w1 = that.node("a5", 324, 167, "wanjet.png"); that.linkNode(g1, w1); let c1 = that.node("a6", 364, 214, "center.png"); that.linkNode(w1, c1); let cloud = that.node("a7", 344, 259, "cloud.png"); that.linkNode(c1, cloud); let c2 = that.node("a8", 364, 328, "center.png"); that.linkNode(cloud, c2); let w2 = that.node("a9", 324, 377, "wanjet.png"); that.linkNode(c2, w2); linkNode(nodeA: number, nodeZ: number, f: boolean) { /**連線*/ let link; if (f) { link = new JTopo.FoldLink(nodeA, nodeZ); } else { link = new JTopo.Link(nodeA, nodeZ); } link.direction = "vertical"; this.scene.add(link); return link; }, hostLink(nodeA: any, nodeZ: any, name: string) { let link1 = new JTopo.FlexionalLink(nodeA, nodeZ, name); //var link = new JTopo.FlexionalLink(nodeA, nodeZ, text); //var link = new JTopo.FlexionalLink(nodeA, nodeZ, text);// 二次折線 link1.shadow = false; link1.offsetGap = 44; this.scene.add(link1); return link1; }
總結
以上所述是小編給大家介紹的vue 集成jTopo 處理方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對億速云網站的支持!
如果你覺得本文對你有幫助,歡迎轉載,煩請注明出處,謝謝!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。