sub graph { # calculate and display the graphs my($hm1,$hm2,$hm3,$bdr,$cs,$spacer,$mode,$descr); if(!$i{histmode} or $i{histmode} == 1){ $hm1 = ' checked'; $spacer = ''; $cs = 4; $bdr = 0; $descr = qq~mode one
bar height = fixed
bar width = number of nodes at that rep
~ } elsif($i{histmode} == 2){ $hm2 = ' checked'; $spacer = ''; $cs = 3; $bdr = 1; $descr = qq~mode two
bar height = rep
bar width = number of nodes at that rep
~ } elsif($i{histmode} == 3){ $hm3 = ' checked'; $spacer = ''; $cs = 4; $bdr = 0; $descr = qq~mode three
bar height = number of nodes at that rep
bar width = rep
~ } print qq~

~; my@high = sort {$b <=> $a} values %rep_freq; my@hig = sort {$b <=> $a} keys %rep_freq; my$mult = sprintf "%d", (600/$high[0]); # normalize bar width to scale (highest num = 600 pixels) my$mul = sprintf "%d", (600/$hig[0]); # normalize bar width to scale (highest num = 600 pixels) print qq~~; my($ar,$fc,$arf,$fcf) = ''; for(sort {$b <=> $a} keys %rep_freq){ my$w = ($rep_freq{$_}*$mult); my$h = 5; if($i{'histmode'}){ if($i{'histmode'} == 2){ $h = $_ || 1 } elsif($i{'histmode'} == 3){ $w = ($_*$mul); $h = $rep_freq{$_} } } if($_ == $avgrep){ # highlight avg rep $ar = 'bgcolor="#880066"'; $fc = '' } else{$ar=''; $fc='';} if($rep_freq{$_} == $high[0]){ # highlight frequency high $arf = 'bgcolor="#880066"'; $fcf = '' } else{$arf=''; $fcf=''} print qq~ $spacer~ } print qq~
  

Number of nodes by reputation
average rep and maximum num highlighted

$descr
1 2 3
$nb rep $nb$nb num $nb 
$fc $_ $nb$fcf $rep_freq{$_} $nb
$nb rep $nb$nb num $nb 

~; }