line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::IPerl::Plugin::ChartClicker; |
2
|
|
|
|
|
|
|
# ABSTRACT: IPerl plugin to make Chart::Clicker charts displayable |
3
|
|
|
|
|
|
|
$Devel::IPerl::Plugin::ChartClicker::VERSION = '0.008'; |
4
|
1
|
|
|
1
|
|
4408540
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
52
|
|
5
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Chart::Clicker; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
20
|
|
8
|
1
|
|
|
1
|
|
443
|
use Role::Tiny; |
|
1
|
|
|
|
|
4592
|
|
|
1
|
|
|
|
|
9
|
|
9
|
1
|
|
|
1
|
|
761
|
use Devel::IPerl::Display::SVG; |
|
1
|
|
|
|
|
164611
|
|
|
1
|
|
|
|
|
50
|
|
10
|
1
|
|
|
1
|
|
575
|
use Devel::IPerl::Display::PNG; |
|
1
|
|
|
|
|
7786
|
|
|
1
|
|
|
|
|
183
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $IPerl_compat = 1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $IPerl_format_info = { |
15
|
|
|
|
|
|
|
'SVG' => { suffix => '.svg', displayable => 'Devel::IPerl::Display::SVG' }, |
16
|
|
|
|
|
|
|
'PNG' => { suffix => '.png', displayable => 'Devel::IPerl::Display::PNG' }, |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub register { |
20
|
1
|
|
|
1
|
0
|
174
|
Role::Tiny->apply_roles_to_package( 'Chart::Clicker', q(Devel::IPerl::Plugin::ChartClicker::IPerlRole) ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
package |
25
|
|
|
|
|
|
|
Devel::IPerl::Plugin::ChartClicker::IPerlRole; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
1
|
|
16
|
use Moo::Role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
28
|
1
|
|
|
1
|
|
4871
|
use Capture::Tiny qw(capture_stderr capture_stdout); |
|
1
|
|
|
|
|
5964
|
|
|
1
|
|
|
|
|
105
|
|
29
|
1
|
|
|
1
|
|
13
|
use File::Temp; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
326
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub iperl_data_representations { |
33
|
1
|
|
|
1
|
0
|
50367
|
my ($cc) = @_; |
34
|
1
|
50
|
|
|
|
6
|
return unless $Devel::IPerl::Plugin::ChartClicker::IPerl_compat; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
23
|
my $format = uc($cc->format); |
37
|
1
|
|
|
|
|
11
|
my $format_info = $Devel::IPerl::Plugin::ChartClicker::IPerl_format_info; |
38
|
|
|
|
|
|
|
|
39
|
1
|
50
|
|
|
|
8
|
return unless exists($format_info->{$format}); |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
4
|
my $suffix = $format_info->{$format}{suffix}; |
42
|
1
|
|
|
|
|
4
|
my $displayable = $format_info->{$format}{displayable}; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
14
|
my $tmp = File::Temp->new( SUFFIX => $suffix ); |
45
|
1
|
|
|
|
|
778
|
my $tmp_filename = $tmp->filename; |
46
|
|
|
|
|
|
|
capture_stderr( sub { |
47
|
1
|
|
|
1
|
|
577
|
$cc->write_output( $tmp_filename ); |
48
|
1
|
|
|
|
|
38
|
}); |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $displayable->new( filename => $tmp_filename )->iperl_data_representations; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=pod |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=encoding UTF-8 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 NAME |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Devel::IPerl::Plugin::ChartClicker - IPerl plugin to make Chart::Clicker charts displayable |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 VERSION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
version 0.008 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHORS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=over 4 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Zakariyya Mughal <zmughal@cpan.org> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Zhenyi Zhou <zhouzhen1@gmail.com> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=back |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Zakariyya Mughal. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
90
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |