Vizceral动态展示线路图组件
Vizceral是一组采用
使用:
如果使用 React 或者 web 组件,可参看以下两个项目:
或者从零开始:
npm install vizceral --save
import Vizceral from 'vizceral'; const viz = new Vizceral(); // Add event handlers for the vizceral events viz.on('viewChanged', view => {}); viz.on('nodeHighlighted', node => {}); viz.on('rendered', data => {}); viz.on('nodeContextSizeChanged', dimensions => {}); // Sample data viz.updateData({ name: 'us-west-2', renderer: 'global', nodes: [ {name: 'INTERNET'}, {name: 'service'} ], connections: [ { source: 'INTERNET', target: 'service', metrics: { normal: 100, warning: 95, danger: 5 }, metadata: { streaming: true } } ] }); viz.setView(); viz.animate();
评论