Chart.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Chart/Google.pm ↑ Summary
1 package Wight::Chart;
2  
3 #ABSTRACT: Save charts to images using phantomjs
4  
5 our $VERSION = '0.003'; # VERSION
6  
7 5 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 0 ▶use Wight;
Subroutine BEGIN: called CC=1 SCAR=2.6
10 use Encode;
11 use File::Share qw/dist_file/;
12 use Cwd;
13 use JSON::XS;
14  
15 has 'output' => ( is => 'rw', default => sub { 'example.png'} );
16 has 'rows' => ( is => 'rw' );
17 has 'options' => ( is => 'rw', default => sub { {} } );
18 has 'columns' => ( is => 'rw' );
19 has 'wight' => ( is => 'lazy' );
20 has 'width' => ( is => 'rw', default => 900 );
21 has 'height' => ( is => 'rw', default => 500 );
22  
23 sub _build_wight {
24 my $self = shift;
25 my $wight = Wight->new();
26 #File::Share won't work with dzil
27 #
28 my $file = -e 'share/' . $self->src_html ?
29 getcwd . '/share/' . $self->src_html
30 :
31 dist_file('Wight-Chart', $self->src_html );
32  
33 $wight->resize($self->width, $self->height);
34 $wight->visit("file:///$file");
35 $wight;
36 }
37  
38  
39  
40 1;
41  
42 __END__
« Chart/Google.pm ↑ Summary