diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index 3f1a5f6e9a..78c8792a32 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -1196,6 +1196,10 @@ class NetworkMap $head .= 'overlap="scalexy";'; } + if ($layout == 'spring1' || $layout == 'spring2') { + $head .= 'sep="'.$node_sep.'";'; + } + if ($layout == 'flat') { $head .= 'ranksep="'.$rank_sep.'";'; } @@ -3505,6 +3509,7 @@ class NetworkMap url_background_grid: url_background_grid, refresh_time: '.$this->mapOptions['refresh_time'].', font_size: '.$this->mapOptions['font_size'].', + method: '.$this->map['generation_method'].', base_url_homedir: "'.ui_get_full_url(false).'" }); init_drag_and_drop(); diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index de685384be..cee02a588f 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -1126,6 +1126,10 @@ function networkmap_open_graph( $head .= 'overlap="scalexy";'; } + if ($layout == 'spring1' || $layout == 'spring2') { + $head .= 'sep="'.$node_sep.'";'; + } + if ($layout === 'flat') { $head .= 'ranksep="'.$rank_sep.'";'; } else if ($layout === 'spring2') { diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 01bb0dc959..a32fb47e0b 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -55,10 +55,30 @@ function draw_minimap() { var relation_min_nodes = minimap_relation; var relation_minimap_w = 2; var relation_minimap_h = 2; - if (graph.nodes.length > 100) { + if (graph.nodes.length > 100 && graph.nodes.length < 500) { relation_min_nodes = 0.01; relation_minimap_w = (graph.nodes.length / 100) * 2.5; relation_minimap_h = 1.5; + } else if (graph.nodes.length >= 500 && graph.nodes.length < 1000) { + if (typeof method != "undefined" && method == 4) { + relation_min_nodes = 0.002; + relation_minimap_w = (graph.nodes.length / 500) * 2.5; + relation_minimap_h = 3; + } else { + relation_min_nodes = 0.008; + relation_minimap_w = (graph.nodes.length / 500) * 2.5; + relation_minimap_h = 3; + } + } else if (graph.nodes.length >= 1000) { + if (typeof method != "undefined" && method == 4) { + relation_min_nodes = 0.001; + relation_minimap_w = (graph.nodes.length / 1000) * 4.5; + relation_minimap_h = 4; + } else { + relation_min_nodes = 0.0015; + relation_minimap_w = (graph.nodes.length / 1000) * 3.5; + relation_minimap_h = 3.5; + } } //Draw the items and lines @@ -1792,10 +1812,30 @@ function init_minimap() { var relation_minimap_w = 2; var relation_minimap_h = 2; - if (graph.nodes.length > 100) { + if (graph.nodes.length > 100 && graph.nodes.length < 500) { relation_min_nodes = 0.01; relation_minimap_w = (graph.nodes.length / 100) * 2.5; relation_minimap_h = 1.5; + } else if (graph.nodes.length >= 500 && graph.nodes.length < 1000) { + if (typeof method != "undefined" && method == 4) { + relation_min_nodes = 0.002; + relation_minimap_w = (graph.nodes.length / 500) * 2.5; + relation_minimap_h = 3; + } else { + relation_min_nodes = 0.008; + relation_minimap_w = (graph.nodes.length / 500) * 2.5; + relation_minimap_h = 3; + } + } else if (graph.nodes.length >= 1000) { + if (typeof method != "undefined" && method == 4) { + relation_min_nodes = 0.001; + relation_minimap_w = (graph.nodes.length / 1000) * 4.5; + relation_minimap_h = 4; + } else { + relation_min_nodes = 0.0015; + relation_minimap_w = (graph.nodes.length / 1000) * 3.5; + relation_minimap_h = 3.5; + } } $("#minimap_" + networkmap_id).bind("mousemove", function(event) { @@ -3092,6 +3132,10 @@ function init_graph(parameter_object) { window.refresh_time = parameter_object.refresh_time; } + if (typeof parameter_object.method != "undefined") { + window.method = parameter_object.method; + } + var rect_center_x = graph.nodes[0].x; var rect_center_y = graph.nodes[0].y; diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index a638bc9aa9..732e647560 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -57,10 +57,10 @@ if ($new_networkmap) { $offset_x = ''; $offset_y = ''; $scale_z = 0.5; - $node_sep = 10; - $rank_sep = 1.0; + $node_sep = 0.25; + $rank_sep = 0.5; $mindist = 1.0; - $kval = 5; + $kval = 0.3; $refresh_time = 300; } @@ -617,7 +617,7 @@ $(document).ready(function() { $("#form_editor-kval") .css('display', 'none'); $("#form_editor-nodesep") - .css('display', ''); + .css('display', 'none'); } else if (method == 'neato') { $("#form_editor-ranksep")