Skip to content

Commit

Permalink
override appearance of summary tracks with [label:summary] stanzas
Browse files Browse the repository at this point in the history
  • Loading branch information
lstein committed May 24, 2011
1 parent cf3bf2d commit 2d430c4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
5 changes: 3 additions & 2 deletions MANIFEST
Expand Up @@ -298,6 +298,8 @@ htdocs/images/buttons/sortable.gif
htdocs/images/buttons/sorted_down.gif
htdocs/images/buttons/sorted_up.gif
htdocs/images/buttons/spinner.gif
htdocs/images/buttons/square.png
htdocs/images/buttons/square.xpm
htdocs/images/buttons/tools.png
htdocs/images/buttons/trash.gif
htdocs/images/buttons/trash.png
Expand Down Expand Up @@ -573,6 +575,7 @@ lib/Bio/Graphics/Browser2/Render/HTML.pm
lib/Bio/Graphics/Browser2/Render/Login.pm
lib/Bio/Graphics/Browser2/Render/Slave.pm
lib/Bio/Graphics/Browser2/Render/Slave/Status.pm
lib/Bio/Graphics/Browser2/Render/TrackConfig.pm
lib/Bio/Graphics/Browser2/RenderPanels.pm
lib/Bio/Graphics/Browser2/Session.pm
lib/Bio/Graphics/Browser2/Shellwords.pm
Expand Down Expand Up @@ -645,5 +648,3 @@ t/testdata/phylo_align/species.tre
t/testdata/phylo_align/volvox_alignment.conf
t/testdata/phylo_align/volvox_phyloalign.gff
t/testdata/TemplateCopy.pm
META.yml
META.json
16 changes: 16 additions & 0 deletions lib/Bio/Graphics/Browser2/DataSource.pm
Expand Up @@ -415,6 +415,22 @@ sub default_style {
return $self->SUPER::style('TRACK DEFAULTS');
}

sub summary_style {
my $self = shift;
my $type = shift;
$type .= ":summary";

local $self->{config} = $self->{_user_tracks}{config}
if exists $self->{_user_tracks}{config}{$type};

my $config = $self->{config} or return;
my $hashref = $config->{$type};
unless ($hashref) {
$hashref = $config->{$type} or return;
}
return map {("-$_" => $hashref->{$_})} keys %$hashref;
}

sub style {
my ($self,$label,$length) = @_;
my $l = $self->semantic_label($label,$length);
Expand Down
11 changes: 6 additions & 5 deletions lib/Bio/Graphics/Browser2/RenderPanels.pm
Expand Up @@ -2066,17 +2066,18 @@ sub create_track_args {
: {};

my @override = map {'-'.$_ => $override->{$_}} keys %$override;
warn "override = @override";

push @override,(-feature_limit => $override->{limit}) if $override->{limit};
push @override,(-record_label_positions => 0) unless $args->{section} && $args->{section} eq 'detail';

if ($is_summary) {
unshift @override,(-glyph => 'wiggle_density',
-height => 15,
-min_score => 0,
-autoscale => 'local'
unshift @override,(
-glyph => 'wiggle_density',
-height => 15,
-min_score => 0,
-autoscale => 'local',
);
push @override, $source->i18n_style("$label:summary",$lang);
}
my $hilite_callback = $args->{hilite_callback};

Expand Down

0 comments on commit 2d430c4

Please sign in to comment.