Added lost code

This commit is contained in:
Arturo Gonzalez 2017-11-27 15:00:59 +01:00
parent 7b956e8ef6
commit 21bbfb557b
2 changed files with 28 additions and 4 deletions

View File

@ -342,6 +342,7 @@ function networkmap_db_node_to_js_node($node, &$count, &$count_item_holding_area
$item['py'] = (int)$node['y'];
$item['z'] = (int)$node['z'];
$item['state'] = $node['state'];
$item['deleted'] = $node['deleted'];
if ($item['state'] == 'holding_area') {
//40 = DEFAULT NODE RADIUS
//30 = for to align
@ -520,6 +521,7 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
$item['id_agent_end'] = (int)$id_target_agent;
$item['target'] = -1;
$item['source'] = -1;
$item['deleted'] = $relation['deleted'];
if (enterprise_installed()) {
$target_and_source = array();
@ -717,7 +719,9 @@ function networkmap_write_js_array($id, $nodes_and_relations = array(), $map_das
$item = networkmap_db_node_to_js_node(
$node, $count, $count_item_holding_area);
if ($item['deleted']) {
continue;
}
echo "networkmap.nodes.push(" . json_encode($item) . ");\n";
$nodes_graph[$item['id']] = $item;
}
@ -733,6 +737,9 @@ function networkmap_write_js_array($id, $nodes_and_relations = array(), $map_das
$links_js = networkmap_links_to_js_links($relations, $nodes_graph);
foreach ($links_js as $link_js) {
if ($link_js['deleted']) {
continue;
}
if ($link_js['target'] == -1)
continue;
if ($link_js['source'] == -1)

View File

@ -2155,6 +2155,7 @@ function refresh_holding_area() {
temp_node['image_url'] = node['image_url'];
temp_node['image_width'] = node['image_width'];
temp_node['image_height'] = node['image_width'];
temp_node['deleted'] = false;
graph.nodes.push(temp_node);
});
@ -3149,10 +3150,19 @@ function myMouseoutRhombusFunction(node_id) {
}
function draw_elements_graph() {
link = link.data(force.links(), function (d) {
link = link.data(force.links().filter(function(d, i) {
if (d['deleted']) {
return false;
}
else {
return true;
}
}),
function (d) {
return d.source.id + networkmap_id + "-" + d.target.id + networkmap_id + Math.random();
});
link_temp = link.enter()
.append("g")
.attr("id", function (d) {
@ -3333,7 +3343,14 @@ function draw_elements_graph() {
return (Array(25).join(" ")) + text_link;
});
node = node.data(force.nodes(), function (d) { return d.id; });
node = node.data(force.nodes().filter(function(d, i) {
if (d['deleted']) {
return false;
}
else {
return true;
}
}), function (d) { return d.id; });
node_temp = node.enter()
.append("g")