diff options
Diffstat (limited to 'sourcecodes/network_layout_evd_2.php')
| -rw-r--r-- | sourcecodes/network_layout_evd_2.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sourcecodes/network_layout_evd_2.php b/sourcecodes/network_layout_evd_2.php index 7703daab..d6bfa495 100644 --- a/sourcecodes/network_layout_evd_2.php +++ b/sourcecodes/network_layout_evd_2.php @@ -102,6 +102,7 @@ $str_arrmat=array(); $str_arrmat=explode("\n",$matrix1); $node=trim($str_arrmat[1]); +$node=is_numeric($node) ? $node : 0; if($str_arrmat[2]=="" || $matrix1=="") { @@ -199,6 +200,7 @@ $str_arrmat_old=explode("\n",$matrix1_old); $datamat_old=array(); $data_read_old=array(); $node_old=trim($str_arrmat_old[0]); +$node_old=is_numeric($node_old) ? $node_old : 0; $r_index_old=$node_old+2; for($i=0;$i<$node_old;$i++) @@ -282,7 +284,7 @@ foreach($str_arrname as $row) if($j==2) $ID_data[$ii][$k]=$grviz_name_list[$cell]; else - $ID_data[$ii][$k]=round($cell/10*900); + $ID_data[$ii][$k]=round((is_numeric($cell) ? $cell : 0)/10*900); $k++; } } @@ -349,15 +351,16 @@ foreach($str_arrname as $row) else if($j==4 && $flag==1) { $edge_data[$ii][4]=$cell; - $number_of_point=$cell*2; + $number_of_point=(is_numeric($cell) ? $cell : 0)*2; $index=5; } else if($j>4 && $number_of_point>0 && $flag==1) { + $cell_num=is_numeric($cell) ? $cell : 0; if(($j%2)!=0) - $edge_data[$ii][$index]=round($cell/10*900)+60; + $edge_data[$ii][$index]=round($cell_num/10*900)+60; else - $edge_data[$ii][$index]=round($cell/10*900)+48; + $edge_data[$ii][$index]=round($cell_num/10*900)+48; $number_of_point--; $index++; } |
