vizceral-example的例子 博客分类: javascript javascript
程序员文章站
2024-03-14 16:13:16
...
自定义图和加载结构
代码在
https://github.com/killinux/vizceral-example
vizceral-example/sample_data_chat.json
vizceral-example/src/components/trafficFlow.jsx
修改155行
代码在
https://github.com/killinux/vizceral-example
vizceral-example/sample_data_chat.json
{ "renderer": "region", "name": "test", "maxVolume": 100.0, "nodes": [ { "renderer": "region", "name": "main", "maxVolume": 100.0 , "displayName": "点外卖" }, { "renderer": "region", "name": "findShop", "maxVolume": 100.0 , "displayName": "找商店" }, { "renderer": "region", "name": "findGoods", "maxVolume": 100.0, "displayName": "找商品" }, { "renderer": "region", "name": "out", "maxVolume": 100.0, "displayName": "没找到你要的哟" }, { "renderer": "region", "name": "getIt", "maxVolume": 100.0, "displayName": "找到喽,您要的是 $shop 的 $goods" } ], "connections": [ { "source": "main", "target": "findShop", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } }, { "source": "main", "target": "findGoods", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } }, { "source": "findGoods", "target": "findShop", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } }, { "source": "findShop", "target": "findGoods", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } }, { "source": "findShop", "target": "out", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } }, { "source": "findGoods", "target": "out", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } }, { "source": "findShop", "target": "getIt", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } }, { "source": "findGoods", "target": "getIt", "metrics": { "danger": 1, "normal": 10.0, "warning": 1.0 } } ] }
vizceral-example/src/components/trafficFlow.jsx
修改155行
beginSampleData () { this.traffic = { nodes: [], connections: [] }; // request.get('sample_data.json') // modify by hao request.get('sample_data_chat.json') .set('Accept', 'application/json') .end((err, res) => { if (res && res.status === 200) { this.traffic.clientUpdateTime = Date.now(); this.updateData(res.body); } }); }
推荐阅读
-
vizceral-example的例子 博客分类: javascript javascript
-
一个简单的Chrome扩展——Back to Top(附源码) 博客分类: Javascript ChromeEXTHTML5CSS浏览器
-
使用HTML5和Google Maps构建手机LBS游戏 博客分类: Javascript游戏开发
-
客户端获取服务器时间倒计时 博客分类: JavaScript ASPAjax电子商务JavaScriptXHTML
-
客户端获取服务器时间倒计时 博客分类: JavaScript ASPAjax电子商务JavaScriptXHTML
-
js 字符连接对象 博客分类: js JavaScript
-
JS中的prototype 博客分类: jss css javascript
-
js简单性能问题以及js学习总结 博客分类: javascript jsjavascript性能
-
javascript思维导图-经典 博客分类: 移动互联网开发移动互联网开发,html5js javascript思维导图经典
-
javascript : 回调函数例子 博客分类: javascript javascript