Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more fixes to track configure dialog

  • Loading branch information...
commit 248805a8889528170d85d536d3bab536d88986eb 1 parent d6d511b
@lstein lstein authored
View
7 lib/Bio/Graphics/Browser2/Render.pm
@@ -2127,10 +2127,11 @@ sub reconfigure_track {
$state->{features}{$label}{options} = param('format_option');
my $dynamic = $self->translate('DYNAMIC_VALUE');
my $mode = param('mode');
+ my $mult = $self->details_mult;
- my $length = param('segment_length') || 0;
- my $semantic_low = param('apply_semantic_low') || 0;
- my $semantic_hi = param('apply_semantic_hi') || 0;
+ my $length = param('segment_length') * $mult || 0;
+ my $semantic_low = param('apply_semantic_low') * $mult || 0;
+ my $semantic_hi = param('apply_semantic_hi') * $mult || 0;
my $delete_semantic = param('delete_semantic');
my $summary = param('summary_mode');
View
23 lib/Bio/Graphics/Browser2/Render/TrackConfig.pm
@@ -43,13 +43,14 @@ sub config_dialog {
delete $state->{features}{$label}{summary_mode_len};
}
+ my $scaled_length = $length/$render->details_mult;
my $semantic_override = $render->find_override_region($state->{features}{$label}{semantic_override},$length);
$semantic_override ||= 0;
my ($semantic_level) = $slabel =~ /(\d+)$/;
$semantic_level ||= 0;
my @level = map {
- scalar $render->data_source->unit_label($_)
+ scalar $render->data_source->unit_label($_/$render->details_mult)
} split ':',($semantic_override || $semantic_level);
my $level = join '..',@level;
@@ -64,7 +65,8 @@ sub config_dialog {
my $return_html = start_html();
- my $title = div({-class=>'config-title'},$key);
+ my $showing = $render->data_source->unit_label($scaled_length);
+ my $title = div({-class=>'config-title'},$key,br(),div({-style=>'font-size:9pt'},"(Currently showing $showing)"));
my $dynamic = $render->translate('DYNAMIC_VALUE');
my $height = $self->setting( $label => 'height' , $length, $summary_mode) || 10;
@@ -492,17 +494,18 @@ END
)
);
- my ($low,$hi) = $render->find_override_bounds($state->{features}{$label}{semantic_override},$length);
- $low ||= $semantic_level;
+ my ($low,$hi) = $render->find_override_bounds($state->{features}{$label}{semantic_override},$scaled_length);
+ $low = $semantic_level unless defined $low;
$hi ||= MAX;
+ my $mult = $render->details_mult;
push @rows,TR({-class=>'general'},
th( {-align => 'right' },
$render->translate('APPLY_CONFIG')
),
td(
- $self->region_size_menu('apply_semantic_low',$length,MIN,$low),
+ $self->region_size_menu('apply_semantic_low',$scaled_length,[$low/$mult,MIN],$low/$mult),
'-',
- $self->region_size_menu('apply_semantic_hi',$hi,MAX),
+ $self->region_size_menu('apply_semantic_hi',$scaled_length,[$hi/$mult,MAX],$hi/$mult),
)
) unless $summary_mode;
@@ -544,7 +547,7 @@ END
$form .= table({-id=>'config_table',-border => 0 },@rows);
$form .= end_form();
- $return_html
+ $return_html
.= table( TR( td( { -valign => 'top' }, [ $form ] ) ) );
$return_html .= script({-type=>'text/javascript'},"track_configure.glyph_select(\$('config_table'),\$('glyph_picker_id'))");
$return_html .= end_html();
@@ -573,12 +576,12 @@ sub setting {
sub region_size_menu {
my $self = shift;
- my ($name,$length,$extra_val,$default) = @_;
- $extra_val ||= 0;
+ my ($name,$length,$extra_vals,$default) = @_;
+ $extra_vals ||= [];
my $source = $self->render->data_source;
my %seen;
- my @r = sort {$a<=>$b} $source->get_ranges(),$length,$extra_val;
+ my @r = sort {$a<=>$b} ($source->get_ranges(),$length,@$extra_vals);
my @ranges = grep {!$seen{$source->unit_label($_)}++} @r;
my %labels = map {$_=> scalar $source->unit_label($_)} @ranges;
Please sign in to comment.
Something went wrong with that request. Please try again.