/[Frey]/trunk/lib/Frey/CSS/Area.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Frey/CSS/Area.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 955 - (show annotations)
Wed Jan 7 00:04:46 2009 UTC (15 years, 3 months ago) by dpavlin
File size: 905 byte(s)
Frey::CSS::Area now takes spunge for data source
1 package Frey::CSS::Area;
2 use Moose;
3
4 extends 'Frey';
5 with 'Frey::Web';
6 #with 'Frey::Storage';
7
8 =head1 DESCRIPTION
9
10 CSS area graph based on example from L<http://www.khanate.co.uk/graph/>
11
12 =cut
13
14 has sponge => (
15 is => 'rw',
16 isa => 'Sponge',
17 required => 1,
18 );
19
20 sub as_markup {
21 my ($self) = @_;
22
23 $self->add_css( 'static/Frey/CSS/Area.css' );
24 $self->add_js ( 'static/Frey/CSS/Area.js' );
25
26 my $html
27 = qq|<ul class="graph" onclick="gr.makeGraphs(); return false;">|
28 . join("\n",
29 map {
30 my ( $val, $name ) = ( $_->[0], $_->[1] );
31 die "first column data isn't numeric ", $self->dump( $_ ) unless $val =~ m{^\d+$};
32 qq|<li><span class="name">$name</span> <span class="val">$val</span></li>|;
33 } @{ $self->sponge->{rows} }
34 )
35 . qq|</ul>|
36 ;
37
38 $html .= qq|
39 <br style="clear:both" />
40 <div class="note">
41 Click on the table or graph to switch view
42 </div>
43 |;
44
45 return $html;
46 }
47
48 1;

  ViewVC Help
Powered by ViewVC 1.1.26