diff options
| author | ziejd2 | 2021-02-24 14:36:59 -0600 |
|---|---|---|
| committer | ziejd2 | 2021-02-24 14:36:59 -0600 |
| commit | 25b843f6bbacb1937bdb960777b73acbece64115 (patch) | |
| tree | 88645b9d1d8a0eea19d7229555bf8805571bc8b7 /sourcecodes/network_layout_evd.php | |
| parent | 33cedf36248f616aa37d1462c69a4a3058a5d92e (diff) | |
| download | BNW-25b843f6bbacb1937bdb960777b73acbece64115.tar.gz | |
GENENET8 update
Diffstat (limited to 'sourcecodes/network_layout_evd.php')
| -rw-r--r-- | sourcecodes/network_layout_evd.php | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/sourcecodes/network_layout_evd.php b/sourcecodes/network_layout_evd.php index 661caebc..7d97483a 100644 --- a/sourcecodes/network_layout_evd.php +++ b/sourcecodes/network_layout_evd.php @@ -25,11 +25,11 @@ foreach($leve_l as $l) } - /////////////Read data from net_figure file///////////// -$dir="./data/"; - +//$dir="./data/"; +//$dir="/tmp/bnw/"; +$dir="/var/lib/genenet/bnw/"; $keyval=valid_keyval($_GET["My_key"]); @@ -50,7 +50,7 @@ $str_arrmat=explode("\n",$matrix1); if($str_arrmat[2]=="" || $matrix1=="") { ?> - <h1><font color=blue>Error: Unable to display your network structure.</font></h1> + <h1><br><br><br><font color=blue>Error: Unable to display your network structure.</font></h1> <?php exit; } @@ -113,7 +113,8 @@ $r_index+=4; $grv=$dir.$keyval."graphviz.txt"; $line=shell_exec('/usr/bin/dot -Tplain -y '.$grv); $grviz_name_list=array(); -$g_file_name="./data/".$keyval."grviz_name_file.txt"; +//$g_file_name="./data/".$keyval."grviz_name_file.txt"; +$g_file_name=$dir.$keyval."grviz_name_file.txt"; $grviz_name=file_get_contents("$g_file_name"); $grviz_name_list=explode("\n",$grviz_name); @@ -239,7 +240,7 @@ $nedges=$ii; <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> -<script type="text/javascript" src="http://www.google.com/jsapi"></script> +<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1', {packages: ['corechart']}); </script> @@ -247,12 +248,19 @@ google.load('visualization', '1', {packages: ['corechart']}); <?php $data_val=""; +$x_max = $ID_data[0][1]; +$y_max = $ID_data[0][2]; for($i=0;$i<$nnode;$i++) { ////////////////////////////select node ////////////////////////////////////// + if($ID_data[$i][1] > $x_max) $x_max = $ID_data[$i][1]; + if($ID_data[$i][2] > $y_max) $y_max = $ID_data[$i][2]; + $name=$ID_data[$i][0]; - $fname="draw_".$name."()"; + $replaced_char = array("-","/",",",".","!","?"); + $name_replaced = str_replace($replaced_char,"_",$name); + $fname="draw_".$name_replaced."()"; $data_val.=$name; for($j=0;$j<$node;$j++) { @@ -354,7 +362,7 @@ for($i=0;$i<$nnode;$i++) function <?php print($fname);?> { // Create and populate the data table. var data = google.visualization.arrayToDataTable([ - [{label:'<?php print($name);?>',type:'number'}, {label:''}], + [{label:"<?php print($name);?>",type:'number'}, {label:''}], <?php $c_i=2; for($j=0;$j<100;$j++) @@ -465,6 +473,8 @@ function canvas_arrow_head(context, fromx, fromy, tox, toy){ </head> <body> + + <canvas id="test" width="3000" height="3000" style="position:absolute"> <script> function canvas_arrow_draw(n, polypts,context){ @@ -564,15 +574,18 @@ for($i=0;$i<$nnode;$i++) $x=$ID_data[$i][1]-8; $y=$ID_data[$i][2]-20; $name=$ID_data[$i][0]; + $replaced_char = array("-","/",",",".","?","!"); + $name_replaced = str_replace($replaced_char,"_",$name); ?> <script type="text/javascript"> - google.setOnLoadCallback(draw_<?php print($name)?>); + google.setOnLoadCallback(draw_<?php print($name_replaced)?>); </script> <div id="<?php print($name)?>" style="left: <?php print($x)?>px; top: <?php print($y)?>px; width:<?php print($width);?>; height:<?php print($height);?>; position: absolute"></div> <?php } + ?> |
