New maps in progress... (Fixed fake arrows and non necessary tooltips)
This commit is contained in:
parent
3cae98989c
commit
2831607723
|
@ -1547,7 +1547,9 @@ MapController.prototype.events_for_nodes = function(id_node) {
|
|||
|
||||
if (d3.event.defaultPrevented) return;
|
||||
|
||||
if ((d['type'] == ITEM_TYPE_AGENT_NETWORKMAP) || (d['type'] == ITEM_TYPE_MODULE_NETWORKMAP)) {
|
||||
self.tooltip_map_create(self, this);
|
||||
}
|
||||
})
|
||||
.on("contextmenu", d3.contextMenu(node_menu, function(node) {
|
||||
self._last_event = "contextmenu";
|
||||
|
|
|
@ -70,6 +70,7 @@ NetworkmapController.prototype.init_map = function() {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (filter['show_modules']) {
|
||||
if (filter['show_module_group']) {
|
||||
var arrow_GM = self.get_arrow_GM(edge['to'], edge['from']);
|
||||
|
@ -90,11 +91,13 @@ NetworkmapController.prototype.init_map = function() {
|
|||
var arrow_AM = self.get_arrow_AM(edge['to'], edge['from']);
|
||||
if (arrow_AM !== null) {
|
||||
if (!self.exists_arrow(clean_arrows, arrow_AM)) {
|
||||
if (!self.fake_arrow_AM(arrow_AM)) {
|
||||
clean_arrows.push(arrow_AM);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
clean_arrows.forEach(function(arrow, index) {
|
||||
|
@ -134,6 +137,22 @@ NetworkmapController.prototype.init_map = function() {
|
|||
MapController.prototype.init_map.call(this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Function fake_arrow_AM
|
||||
* Return bool
|
||||
* This function returns if the AM arrow is a fake arrow
|
||||
*/
|
||||
NetworkmapController.prototype.fake_arrow_AM = function(arrow_AM) {
|
||||
var agent_to = parseInt(arrow_AM['to']['id_agent']);
|
||||
var agent_from = parseInt(arrow_AM['from']['id_agent']);
|
||||
if (agent_to == agent_from) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function filter_only_agents
|
||||
* Return void
|
||||
|
|
Loading…
Reference in New Issue