# Returns a list.
- my ( $i, $max_val, $min_val, $factor, $factor_height, $x1, $y1, $x2, $y2, @block, $mean, @features );
+ my ( $i, $max_val, $min_val, $factor, $factor_height, $x1, $y1, $x2, $y2, $block_max, $mean, @features );
+
+ $cookie->{ 'TRACK_OFFSET' } += 10;
$factor = $cookie->{ 'IMG_WIDTH' } / ( $end - $beg );
$factor_height = $cookie->{ 'WIGGLE_HEIGHT' } / $max_val;
}
+ $block_max = 0;
+
$x1 = 0;
$y1 = $cookie->{ 'TRACK_OFFSET' } + $cookie->{ 'WIGGLE_HEIGHT' };
for ( $i = 0; $i < scalar @{ $vals }; $i++ )
{
- push @block, $vals->[ $i ];
+ $block_max = Maasha::Calc::max( $block_max, $vals->[ $i ] );
$x2 = int( $i * $factor );
if ( $x2 > $x1 )
{
- $mean = sprintf( "%.0f", Maasha::Calc::mean( \@block ) );
-
- $y2 = $cookie->{ 'TRACK_OFFSET' } + $cookie->{ 'WIGGLE_HEIGHT' } - ( $mean * $factor_height );
+ $y2 = $cookie->{ 'TRACK_OFFSET' } + $cookie->{ 'WIGGLE_HEIGHT' } - sprintf( "%.0f", $block_max * $factor_height );
push @features, {
type => 'wiggle',
$x1 = $x2;
$y1 = $y2;
- undef @block;
+ $block_max = 0;
}
}
font_size => $cookie->{ 'SEQ_FONT_SIZE' } - 2,
color => $cookie->{ 'SEQ_COLOR' },
x1 => 0,
- y1 => $cookie->{ 'TRACK_OFFSET' },
+ y1 => $cookie->{ 'TRACK_OFFSET' } - 5,
};
$cookie->{ 'TRACK_OFFSET' } += $cookie->{ 'WIGGLE_HEIGHT' } + $cookie->{ 'TRACK_SPACE' };