diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index 425f17b12c..b534093da8 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -293,6 +293,22 @@ MapController.prototype.get_edges_from_node = function(id_graph) { return return_edges; } +/** +* Function update_edges_from_clean_arrows +* Return void +* This function updates the graph id of the edges +*/ +MapController.prototype.update_edges_from_clean_arrows = function(clean_arrows) { + newEdges = []; + clean_arrows.forEach(function(arrow, index) { + newEdges[index] = []; + newEdges[index]['from'] = arrow['from']['graph_id']; + newEdges[index]['to'] = arrow['to']['graph_id']; + newEdges[index]['graph_id'] = arrow['graph_id']; + }); + edges = newEdges; +} + /** * Function get_arrow_from_id * Return void diff --git a/pandora_console/include/javascript/map/NetworkmapController.js b/pandora_console/include/javascript/map/NetworkmapController.js index 239664489c..9ef3f20116 100644 --- a/pandora_console/include/javascript/map/NetworkmapController.js +++ b/pandora_console/include/javascript/map/NetworkmapController.js @@ -173,13 +173,13 @@ NetworkmapController.prototype.get_arrows_AMA = function(id_to, id_from) { var type_to = self.get_node_type(edge['to']); var type_from = self.get_node_type(edge['from']); - + // Filter M-M edge if ((type_to != ITEM_TYPE_MODULE_NETWORKMAP) || (type_from != ITEM_TYPE_MODULE_NETWORKMAP)) { var arrow = self.get_arrow_from_id(edge['graph_id']); - + var temp = {}; temp['graph_id'] = @@ -346,7 +346,6 @@ NetworkmapController.prototype.paint_arrows = function() { var arrows_AA; $.each(edges, function(i, edge) { - var arrow_AA = self.get_arrow_AA(edge['to'], edge['from']); if (arrow_AA !== null) { if (!self.exists_arrow(clean_arrows, arrow_AA)) { @@ -370,6 +369,8 @@ NetworkmapController.prototype.paint_arrows = function() { }); } }); + + MapController.prototype.update_edges_from_clean_arrows(clean_arrows); var arrow_layouts = self._viewport.selectAll(".arrow") .data(clean_arrows)