From 53b0934c3eb35a4edaf1b8e2a2a7e331f0a16c8d Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 11 Oct 2016 15:01:55 +0200 Subject: [PATCH] New networkmaps in progress... (Fixed some errors and added new images to map) --- .../images/icono_delete_networkmaps.png | Bin 0 -> 869 bytes .../images/icono_refresh_networkmaps.png | Bin 0 -> 999 bytes .../include/functions_pandora_networkmap.php | 2 +- .../functions_pandora_networkmap.js | 44 ++++++++++++------ 4 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 pandora_console/images/icono_delete_networkmaps.png create mode 100644 pandora_console/images/icono_refresh_networkmaps.png diff --git a/pandora_console/images/icono_delete_networkmaps.png b/pandora_console/images/icono_delete_networkmaps.png new file mode 100644 index 0000000000000000000000000000000000000000..30fd5f8b137162d26fbfab990ddc67692318e6b5 GIT binary patch literal 869 zcmV-r1DgDaP)u=7y*gB`hJx(gJgkW0bU#6uy00^+bS<*slqylDU=6*&-#sP82zkmNg*bq4t z32<<5Fi=tjPy#?z?ANbf1qNLrB04xg4KMV94#Y>!)G%Nyl7vx0fcT)cGSwWk5m==W zY7N2wHb-J>a#G|V4FO-g#XcdR%;!kmD7*A-1;yzDR>M-IWJER$RE{GDKd6!biNV_C zur@kK43=(iRbON~2sy~Xbta1#UiD(Y>JOCYVd)N6?M0Ok0@eKZ+9SvnJ8~|gdSwO+ z_IJ?ik1HBr;_rVwKr~?pgeXN0djAW%gJ2;76G!J$HJ5>a5-=Tsa@*J6ufSyu%tBCF zx%_S=yx@HN^(4a=V4EJKj#LMc6hfe2hvlRjA2!1s07|$Zhr$vtNc`TXeekrSL}VF6 vatOhC!q|Gl!?uNn96}d>)&GG3cFzL`GJ%M* zZ{~qHU;n&92pWqdfjJuo_3tYK8xuFC$6zKztE^`r2>=8TQHb%}xpNKt z{QUK}6#V(~2i123gW%rheee(kIUdBvP;~s|WQI_sC2*gC_*eszs1QdEL~%|XOhsTT zUQGtO=gHTTD51}SY=Wg&E*O&q00IaccfbG*08;ss#0tzw2EdqcAlDGQF$c;JpkxRG z2cLI<0|!0A@CG+X@tN22P(ssQvI5RN`+6Q>gEl-&2Pb@FjmXgk!k~DC6$dyC(h~{? zE5rq0-hyR)tnm*5O1w@CGTi3yoCjhHu`4p%1sd@6_bae#vE@b({Sjr=frU{xJXq5cP@)Xv*GCp*e|QuW@s8JFu{@kZsDxj~^A7sO2@H4MImOk zTcElCp5lRZ7$|Ll#ECWtR&xEulEOja_|g#^z;Zl#g5+iuWBC2|D>(bWDk8it0(l2k zB_o3X`I+!y9l3bH>opAlUz~vo%6spB-X}lSVBj~7k^!qhpsE5F0C`=B&xx=>dO{Hl z_de~z>ilhwi{RA_!B_(o7mtBa4AKOO8BlnA0VYO};UM58+lM>T-n@D9KYCsRrQ~go zir}RsD3GxgztFtqh%={xic(l~Q#G#Ypk&zN}K2WWM1PD-m+2artL{V7Y z3aF?=#}+h1FR>E6&JOf;Kq+=YV-=!$&1=jzTyDnunR!3SOH5QG zU}-+s7;r~B-(@S#8;rjJ~ThAc;m?>SlA_qnAD%wMqd( zFH*X!Xq9)+oy=y~)!<42(&8mFhJXUh$plVmhFQj(4-z$CnET={l4OZIbX1zATzl|o zhF~9J6Xg%CrfY7Gvu*9P_I9-c!y(!WGDcpApXk7hw)C=Eq>;u)hmYAcvR3`=c>=jZ Vlx``aV1obv002ovPDHLkV1fbwzUKe{ literal 0 HcmV?d00001 diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index 9d33bf2a09..0d26031172 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -1241,7 +1241,7 @@ function show_networkmap($id = 0, $user_readonly = false, $nodes_and_relations = echo ''; diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index f73bd08543..3ccbe8000a 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -23,8 +23,14 @@ function draw_minimap() { context_minimap.beginPath(); //Paint the item - center_orig_x = (value.x + value.image_width / 4) * relation_min_nodes + minimap_w / relation_minimap_w; - center_orig_y = (value.y + value.image_height / 4) * relation_min_nodes + minimap_h / relation_minimap_h; + if (graph.nodes.length > 100) { + center_orig_x = (value.x + value.image_width / 4) * relation_min_nodes + minimap_w / relation_minimap_w; + center_orig_y = (value.y + value.image_height / 4) * relation_min_nodes + minimap_h / relation_minimap_h; + } + else { + center_orig_x = (value.x + value.image_width / 2) * relation_min_nodes; + center_orig_y = (value.y + value.image_height / 2) * relation_min_nodes; + } context_minimap.arc(center_orig_x, center_orig_y, 2, 0, Math.PI * 2, false); @@ -38,15 +44,27 @@ function draw_minimap() { context_minimap.fill(); }); - //Draw the rect of viewport - context_minimap.beginPath(); - context_minimap.strokeStyle = "#3f3f3f"; - context_minimap.strokeRect( - (-translation[0] / scale) * relation_min_nodes + minimap_w / relation_minimap_w, - (-translation[1] / scale) * relation_min_nodes + minimap_h / relation_minimap_h, - width_svg * relation_min_nodes / scale, - height_svg * relation_min_nodes / scale); - + if (graph.nodes.length > 100) { + //Draw the rect of viewport + context_minimap.beginPath(); + context_minimap.strokeStyle = "#3f3f3f"; + context_minimap.strokeRect( + (-translation[0] / scale) * relation_min_nodes + minimap_w / relation_minimap_w, + (-translation[1] / scale) * relation_min_nodes + minimap_h / relation_minimap_h, + width_svg * relation_min_nodes / scale, + height_svg * relation_min_nodes / scale); + } + else { + //Draw the rect of viewport + context_minimap.beginPath(); + context_minimap.strokeStyle = "#f00"; + context_minimap.strokeRect( + (-translation[0] / scale) * relation_min_nodes, + (-translation[1] / scale) * relation_min_nodes, + width_svg * relation_min_nodes / scale, + height_svg * relation_min_nodes / scale); + } + context_minimap.beginPath(); context_minimap.strokeStyle = "#82B92E"; context_minimap.strokeRect( @@ -895,7 +913,7 @@ function hide_labels_function() { //Change the image arrow $("#hide_labels > a").attr("title", "Show Labels"); - $("#image_hide_show_labels").attr("src", "images/refresh.png"); + $("#image_hide_show_labels").attr("src", "images/icono_refresh_networkmaps.png"); d3.selectAll(".node_text").style("display", "none"); } @@ -905,7 +923,7 @@ function show_labels_function() { console.log("PINTA"); //Change the image arrow $("#hide_labels > a").attr("title", "Hide Labels"); - $("#image_hide_show_labels").attr("src", "images/delete.png"); + $("#image_hide_show_labels").attr("src", "images/icono_delete_networkmaps.png"); d3.selectAll(".node_text").style("display", ""); }