2 Star 6 Fork 5

AndRu/jtopo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test-json.html 10.25 KB
一键复制 编辑 原始数据 按行查看 历史
nick 提交于 2015-12-19 19:59 . jtopo demo
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jtopo-0.4.8-min.js" type="text/javascript"></script>
<script src="js/toolbar.js" type="text/javascript"></script>
<script src="js/jquery.toolbar.js" type="text/javascript"></script>
<script src="js/jquery.snippet.min.js" type="text/javascript"></script>
<script src="js/site.js" type="text/javascript"></script>
<script src="js/func.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var node;
var canvas = document.getElementById('canvas');
canvas.height = window.innerHeight * 0.895;
canvas.width = window.innerWidth * 0.98;
var jsonStr='[{"elementType":"node","x":546,"y":249,"id":795,"Image":"undefined","text":"三牌楼校区","textPosition":"Middle_Center"},{"elementType":"node","x":1932,"y":249,"id":2181,"Image":"undefined","text":"仙林校区","textPosition":"Middle_Center"},{"elementType":"node","x":396,"y":20,"id":416,"Image":"cloud.jpg","text":"CERNET","textPosition":"Middle_Center"},{"elementType":"node","x":486,"y":20,"id":506,"Image":"cloud.jpg","text":"chinaet","textPosition":"Middle_Center"},{"elementType":"node","x":436,"y":80,"id":516,"Image":"8000.jpg","text":"Cabletron8000","textPosition":"Middle_Left"},{"elementType":"link","nodeAid":416,"nodeZid":516,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":506,"nodeZid":516,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":436,"y":140,"id":576,"Image":"ER16.jpg","text":"凯创ER16","textPosition":"Middle_Left"},{"elementType":"node","x":1932,"y":140,"id":2072,"Image":"ER16.jpg","text":"凯创ER16","textPosition":"Middle_Left"},{"elementType":"link","nodeAid":516,"nodeZid":576,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":576,"nodeZid":2072,"text":"万兆高速链路","fontColor":"255,0,0"},{"elementType":"node","x":296,"y":260,"id":556,"Image":"ER16.jpg","text":"联想5950","textPosition":"Middle_Left"},{"elementType":"node","x":386,"y":260,"id":646,"Image":"5200.jpg","text":"HUAWEI5200A","textPosition":"Bottom_Center"},{"elementType":"node","x":776,"y":260,"id":1036,"Image":"中间.jpg","text":"","textPosition":"Bottom_Center"},{"elementType":"node","x":1206,"y":260,"id":1466,"Image":"ER16.jpg","text":"ENTERASYSES科技楼","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":576,"nodeZid":556,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":576,"nodeZid":646,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":576,"nodeZid":1036,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":576,"nodeZid":1466,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":1432,"y":260,"id":1692,"Image":"ER16.jpg","text":"凯创N7教1楼","textPosition":"Bottom_Center"},{"elementType":"node","x":1622,"y":260,"id":1882,"Image":"ER16.jpg","text":"凯创N7教2楼","textPosition":"Bottom_Center"},{"elementType":"node","x":1812,"y":260,"id":2072,"Image":"ER16.jpg","text":"凯创N7教3楼","textPosition":"Bottom_Center"},{"elementType":"node","x":2002,"y":260,"id":2262,"Image":"ER16.jpg","text":"凯创N7教4楼","textPosition":"Bottom_Center"},{"elementType":"node","x":2232,"y":260,"id":2492,"Image":"2948.jpg","text":"VH2402仙林网络中心","textPosition":"Bottom_Center"},{"elementType":"node","x":2412,"y":260,"id":2672,"Image":"ER16.jpg","text":"凯创N7教5楼","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":2072,"nodeZid":1692,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2072,"nodeZid":1882,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2072,"nodeZid":2072,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2072,"nodeZid":2262,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2072,"nodeZid":2492,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2072,"nodeZid":2672,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":216,"y":380,"id":596,"Image":"serve.jpg","text":"EMC存储","textPosition":"Bottom_Center"},{"elementType":"node","x":296,"y":380,"id":676,"Image":"2948.jpg","text":"VH4802","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":556,"nodeZid":596,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":556,"nodeZid":676,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":386,"y":380,"id":766,"Image":"cloud.jpg","text":"学生宿舍","textPosition":"Middle_Center"},{"elementType":"link","nodeAid":646,"nodeZid":766,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":476,"y":380,"id":856,"Image":"2948.jpg","text":"CISCO2948","textPosition":"Bottom_Center"},{"elementType":"node","x":566,"y":380,"id":946,"Image":"2948.jpg","text":"教学主楼CISCO2960","textPosition":"Bottom_Center"},{"elementType":"node","x":656,"y":380,"id":1036,"Image":"2948.jpg","text":"无线楼VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":746,"y":380,"id":1126,"Image":"2948.jpg","text":"有线楼CISCO3542","textPosition":"Bottom_Center"},{"elementType":"node","x":836,"y":380,"id":1216,"Image":"2948.jpg","text":"图书馆CISCO2948","textPosition":"Bottom_Center"},{"elementType":"node","x":926,"y":380,"id":1306,"Image":"2948.jpg","text":"IBM8260","textPosition":"Bottom_Center"},{"elementType":"node","x":1016,"y":380,"id":1396,"Image":"2948.jpg","text":"办公北楼IBM8271","textPosition":"Bottom_Center"},{"elementType":"node","x":1106,"y":380,"id":1486,"Image":"2948.jpg","text":"办公南楼IBM8271","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":1036,"nodeZid":856,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1036,"nodeZid":946,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1036,"nodeZid":1036,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1036,"nodeZid":1126,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1036,"nodeZid":1216,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1036,"nodeZid":1306,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1036,"nodeZid":1396,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1036,"nodeZid":1486,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":1206,"y":380,"id":1586,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":1286,"y":380,"id":1666,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":1466,"nodeZid":1586,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1466,"nodeZid":1666,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":1372,"y":380,"id":1752,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":1462,"y":380,"id":1842,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":1552,"y":380,"id":1932,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":1642,"y":380,"id":2022,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":1732,"y":380,"id":2112,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":1822,"y":380,"id":2202,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":1912,"y":380,"id":2292,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":2002,"y":380,"id":2382,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":2232,"y":380,"id":2612,"Image":"cloud.jpg","text":"学生宿舍","textPosition":"Middle_Center"},{"elementType":"node","x":2362,"y":380,"id":2742,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"node","x":2462,"y":380,"id":2842,"Image":"2948.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":1692,"nodeZid":1752,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1692,"nodeZid":1842,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1882,"nodeZid":1932,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":1882,"nodeZid":2022,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2072,"nodeZid":2112,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2072,"nodeZid":2202,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2262,"nodeZid":2292,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2262,"nodeZid":2382,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2492,"nodeZid":2612,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2672,"nodeZid":2742,"text":"","fontColor":"0, 200, 255"},{"elementType":"link","nodeAid":2672,"nodeZid":2842,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":476,"y":500,"id":976,"Image":"serv.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":856,"nodeZid":976,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":296,"y":500,"id":796,"Image":"serv.jpg","text":"VH2402","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":676,"nodeZid":796,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":746,"y":500,"id":1246,"Image":"2948.jpg","text":"有线楼CISCO2948","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":1126,"nodeZid":1246,"text":"","fontColor":"0, 200, 255"},{"elementType":"node","x":926,"y":500,"id":1426,"Image":"2948.jpg","text":"图书馆IBM8271","textPosition":"Bottom_Center"},{"elementType":"link","nodeAid":1306,"nodeZid":1426,"text":"","fontColor":"0, 200, 255"}]';
//eval("var jsonObj = "+jsonStr);
var jsonObj = eval("("+jsonStr+")");
jsonObj.forEach(function(a){
for(var key in a){
if(a.text == "三牌楼校区");
}
})
});
</script>
<body>
<textarea id="jtopo_textfield" style="display:none;width: 60px;position: absolute;" onkeydown="if(event.keyCode==13)this.blur();"></textarea>
<div class="right">
<div id="content">
<canvas id="canvas">sorry,your browser do not support canvas label</canvas>
</div>
</div>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/wuyu22222/jtopo.git
git@gitee.com:wuyu22222/jtopo.git
wuyu22222
jtopo
jtopo
master

搜索帮助