vue 集成jTopo 處理方法
jTopo 幫助說(shuō)明網(wǎng)站
http://www.jtopo.com/index.html
使用例子:
http://www.jtopo.com/demo/helloworld.html
不建議直接安裝 github 上的代碼,因?yàn)榇a版本不是最新,有部分功能未實(shí)現(xiàn)。
下載最新的js類庫(kù)文件放到 vue 項(xiàng)目 public 文件夾下。
引入 import "/jtopo/jtopo-0.4.8-min.js";
<template> <div> <PanelBase title="拓?fù)鋱D"> <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; }
總結(jié)
以上所述是小編給大家介紹的vue 集成jTopo 處理方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺(jué)得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
相關(guān)文章
vue2響應(yīng)式原理之Object.defineProperty()方法的使用
這篇文章主要介紹了vue2響應(yīng)式原理之Object.defineProperty()方法的使用,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-10-10vue+openlayers+nodejs+postgis實(shí)現(xiàn)軌跡運(yùn)動(dòng)效果
使用postgres(postgis)數(shù)據(jù)庫(kù)以及nodejs作為后臺(tái),vue和openlayers做前端,openlayers使用http請(qǐng)求通過(guò)nodejs從postgres數(shù)據(jù)庫(kù)獲取數(shù)據(jù),這篇文章主要介紹了vue+openlayers+nodejs+postgis實(shí)現(xiàn)軌跡運(yùn)動(dòng),需要的朋友可以參考下2024-05-05Vue 組件修改根實(shí)例的數(shù)據(jù)的方法
這篇文章主要介紹了Vue 組件修改根實(shí)例的數(shù)據(jù)的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-04-04vue+element加入簽名效果(移動(dòng)端可用)
這篇文章主要介紹了vue+element加入簽名效果(移動(dòng)端),本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-06-06Vue如何實(shí)現(xiàn)自動(dòng)觸發(fā)功能
這篇文章主要介紹了Vue如何實(shí)現(xiàn)自動(dòng)觸發(fā)功能,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-01-01vue3中如何用threejs畫一些簡(jiǎn)單的幾何體
最近學(xué)習(xí)threejs有些時(shí)間了,就想著著手做些東西,下面這篇文章主要給大家介紹了關(guān)于vue3中如何用threejs畫一些簡(jiǎn)單的幾何體的相關(guān)資料,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-03-03?面試問(wèn)題Vue雙向數(shù)據(jù)綁定原理
這篇文章主要介紹了?面試問(wèn)題Vue雙向數(shù)據(jù)綁定原理,文章圍繞主題展開(kāi)詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-09-09