New maps in progress... (Fixed "delete arrows" with new data)
This commit is contained in:
parent
07928af596
commit
3e399356d3
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue