get rid of d3 v3/v4 and only have v3

This commit is contained in:
Oliver Gorwits
2017-12-30 13:42:58 +00:00
parent 18c3f16c8f
commit 79f22a47b3
2 changed files with 23 additions and 47 deletions

View File

@@ -100,7 +100,7 @@ $.getJSON('[% uri_for('/ajax/data/device/netmap') %]?[% my_query %]', function(m
.showLinkDirection(false)
.colorScheme('color20')
.preventLabelOverlappingOnForceEnd(
(mapdata['v3']['newnodes'] && ('[% params.mapshow %]' == 'neighbors'))
(mapdata['newnodes'] && ('[% params.mapshow %]' == 'neighbors'))
? true : false
)
.nodeEventToStopPinMode('none')
@@ -118,13 +118,13 @@ $.getJSON('[% uri_for('/ajax/data/device/netmap') %]?[% my_query %]', function(m
.gravity(0.3);
graph['nd2'] = {};
graph['nd2']['centernode'] = mapdata['v3']['centernode'];
graph['nd2']['centernode'] = mapdata['centernode'];
graph['nd2']['dragging'] = false;
graph.inspect().main.force.on('end.setupfornetdisco', function() {
graph.inspect().main.nodes.each(function(n) { n.fixed = true });
if (mapdata['v3']['newnodes'] && ('[% params.mapshow %]' != 'neighbors')) {
if (mapdata['newnodes'] && ('[% params.mapshow %]' != 'neighbors')) {
$.post(
'[% uri_for('/ajax/data/device/netmappositions') %]'
,$("#nd_vlan-entry, #nd_devgrp-select, input[name='mapshow']").serialize()
@@ -206,14 +206,7 @@ $.getJSON('[% uri_for('/ajax/data/device/netmap') %]?[% my_query %]', function(m
.append("path")
.attr("id", "nd2_netmap-spinner");
var netmapdata = {'data': {
'nodes': mapdata['v4']['nodes'].map(function(node) {
var index = node['index'];
return mapdata['v3']['nodes'][index];
}),
'links': mapdata['v3']['links']
}};
graph.start(netmapdata);
graph.start(mapdata);
d3.select("#nd2_netmap-spinner").call(spin);
graph.inspect().main.links.each(function(l) {