+ var vm = this;
+
+ $scope.topo = new nx.graphic.Topology({
+ height: 400,
+ width: 800,
+ scalable: true,
+ theme:'blue',
+ enableGradualScaling:true,
+ nodeConfig: {
+ color: '#ffffff',
+ label: 'model.label',
+ scale: 'model.scale',
+ iconType: function(vertex) {
+ var type = vertex.get().type;
+ if (type === 'bd') {
+ return 'bd'
+ } else if (type === 'vpp') {
+ return 'switch'
+ } else {
+ return 'interf';
+ }
+ }
+ },
+ linkConfig: {
+ label: 'model.label',
+ linkType: 'parallel',
+ color: function(link) {
+ if (link.getData().type === 'tunnel') {
+ return '#ffffff';
+ } else {
+ return '#ffffff';
+ }
+ },
+ width: function(link) {
+ if (link.getData().type === 'tunnel') {
+ return 5;
+ }
+ }
+ },
+ showIcon: true,
+ dataProcessor: 'force',
+ autoLayout: true,
+ enableSmartNode: false,
+ tooltipManagerConfig: {
+ nodeTooltipContentClass: 'TooltipNode',
+ linkTooltipContentClass: 'TooltipLink'
+ }
+ });
+ $scope.app = new nx.ui.Application;