<commit_before># $Id$

package EnsEMBL::Web::ZMenu::Marker;

use strict;

use base qw(EnsEMBL::Web::ZMenu);

sub content {
  my $self = shift;
  my $hub  = $self->hub;
  my $m    = $hub->param('m');
  
  $self->caption($m);
  
  $self->add_entry({
    label => 'Marker info.',
    link  => $hub->url({
      type   => 'Marker',
      action => 'Details',
      m      => $m
    })
  });
}

1;<commit_msg>support for multiple features<commit_after># $Id$

package EnsEMBL::Web::ZMenu::Marker;

use strict;

use Bio::EnsEMBL::GlyphSet::_marker;

use base qw(EnsEMBL::Web::ZMenu);

sub content {
  my $self       = shift;
  my $hub        = $self->hub;
  my $m          = $hub->param('m');
  my $click_data = $self->click_data;
  my @features;
  
  if ($click_data) {
    my $glyphset = Bio::EnsEMBL::GlyphSet::_marker->new($click_data);
    $glyphset->{'text_export'} = 1;
    @features = @{$glyphset->features};
    @features = () unless grep $_->{'drawing_id'} eq $m, @features;
  }
  
  @features = { drawing_id => $m } unless scalar @features;
  
  $self->feature_content($_) for @features;
}

sub feature_content {
  my ($self, $f) = @_;
  my $hub = $self->hub;
  
  $self->new_feature;
  $self->caption($f->{'drawing_id'});
  
  $self->add_entry({
    label => 'Marker info.',
    link  => $hub->url({
      type   => 'Marker',
      action => 'Details',
      m      => $f->{'drawing_id'}
    })
  });
}

1;
{'fraction_non_alphanumeric': 0.20396600566572237, 'fraction_numerical': 0.002124645892351275, 'mean_word_length': 2.8501362397820165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3500533', 'n_tokens_mistral': 557, 'n_tokens_neox': 544, 'n_words': 111}