From 9fb2c0d67412a029d1b3e36ec4523048de389d76 Mon Sep 17 00:00:00 2001 From: Louis Rossouw Date: Wed, 29 Jul 2015 01:17:08 +0200 Subject: [PATCH] Implement configurable network map parameters. --- html/includes/print-map.inc.php | 34 +---------------------------- includes/defaults.inc.php | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/html/includes/print-map.inc.php b/html/includes/print-map.inc.php index 23aeff1b74..eb41929fe2 100644 --- a/html/includes/print-map.inc.php +++ b/html/includes/print-map.inc.php @@ -214,39 +214,7 @@ echo $edges; edges: edges, stabilize: true }; -var options = { - layout:{ - randomSeed:2 - }, - "edges": { - "smooth": { - enabled: false - }, - font: { - size: 12, - color: 'red', - face: 'sans', - background: 'white', - strokeWidth:3, - align: 'middle', - strokeWidth: 2 - } - }, - "physics": { - "forceAtlas2Based": { - "gravitationalConstant": -800, - "centralGravity": 0.03, - "springLength": 50, - "springConstant": 0, - "damping": 1, - "avoidOverlap": 1 - }, - "maxVelocity": 50, - "minVelocity": 0.01, - "solver": "forceAtlas2Based", - "timestep": 0.30 - } -} + var options = ; var network = new vis.Network(container, data, options); network.on('click', function (properties) { if (properties.nodes > 0) { diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index af6b937dc5..ff52c59abe 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -319,8 +319,46 @@ $config['network_map_legend'] = array( '90' => '#ff6600', '100' => '#ff0000', ); + +// Network Map Items $config['network_map_items'] = array('xdp','mac'); +// Network Map Visualization Options +// See http://visjs.org/docs/network/ for description of these options. +$config['network_map_vis_options'] = '{ + layout:{ + randomSeed:2 + }, + "edges": { + "smooth": { + enabled: false + }, + font: { + size: 12, + color: "red", + face: "sans", + background: "white", + strokeWidth:3, + align: "middle", + strokeWidth: 2 + } + }, + "physics": { + "forceAtlas2Based": { + "gravitationalConstant": -800, + "centralGravity": 0.03, + "springLength": 50, + "springConstant": 0, + "damping": 1, + "avoidOverlap": 1 + }, + "maxVelocity": 50, + "minVelocity": 0.01, + "solver": "forceAtlas2Based", + "timestep": 0.30 + } +}'; + // Device page options $config['show_overview_tab'] = true;