From a67d40a447fd37d84f396ba0c80e66b5b9749a1c Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 30 Mar 2017 15:56:00 +0200 Subject: [PATCH] Added a few modifications to move the footer when nodes table is too long and recolocate interface text with every movement to see it well --- .../functions_pandora_networkmap.js | 45 +++++++++++++++++-- .../agentes/pandora_networkmap.view.php | 15 +++++++ 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index f47a8657e5..d1649f8628 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -2310,6 +2310,7 @@ function init_drag_and_drop() { graph.nodes[d.id].py = d.py + delta[1]; }); + draw_elements_graph(); set_positions_graph(); d3.event.sourceEvent.stopPropagation(); @@ -2979,8 +2980,27 @@ function draw_elements_graph() { .attr("xml:space", "preserve") .append("textPath") .attr("xlink:href", function(d) { - return "#link_id_text_" + d.id_db + networkmap_id; + if (d.source.x < d.target.x) { + return "#link_id_text_" + d.id_db + networkmap_id; + } + else { + return "#link_reverse_id_" + d.id_db + networkmap_id; + } }) + .attr("startOffset", function(d) { + if (d.source.x < d.target.x) { + return ""; + } + else { + return "85%"; + }}) + .attr("text-anchor", function(d) { + if (d.source.x < d.target.x) { + return ""; + } + else { + return "end"; + }}) .append("tspan") .attr("style", "font-size: 12px; " + "font-style:normal; " + @@ -3005,8 +3025,27 @@ function draw_elements_graph() { .attr("xml:space", "preserve") .append("textPath") .attr("xlink:href", function(d) { - return "#link_reverse_id_" + d.id_db + networkmap_id; + if (d.source.x < d.target.x) { + return "#link_id_text_" + d.id_db + networkmap_id; + } + else { + return "#link_reverse_id_" + d.id_db + networkmap_id; + } }) + .attr("startOffset", function(d) { + if (d.source.x < d.target.x) { + return "85%"; + } + else { + return ""; + }}) + .attr("text-anchor", function(d) { + if (d.source.x < d.target.x) { + return "end"; + } + else { + return ""; + }}) .append("tspan") .attr("style", "font-size: 12px; " + "font-style:normal; " + @@ -3026,7 +3065,7 @@ function draw_elements_graph() { return (Array(25).join(" ")) + text_link; }); - + node = node.data(force.nodes(), function(d) { return d.id;}); node_temp = node.enter() diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 960cab857c..4896ad2e64 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -759,3 +759,18 @@ else { show_networkmap($id, $user_readonly, $nodes_and_relations, $dash_mode, $map_dash_details); } ?> + + \ No newline at end of file