diff options
author | gregor herrmann <gregoa@debian.org> | 2022-12-10 17:25:00 +0100 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2022-12-10 17:25:00 +0100 |
commit | 99fc20fc1d8c9f2daf7b186177201f794053a8c9 (patch) | |
tree | f3679db08d6ec767c7d695b5800d847eb3c4f821 | |
parent | de4faf36bec1124e177c55ec48c455cd633857a2 (diff) |
New upstream version 2.403.9
34 files changed, 175 insertions, 64 deletions
@@ -1,3 +1,9 @@ +2.403.9 2022-12-11 lichtkind +-------- + * = minor feature add + * + add_datafile now reads CSV + * & added test for loading data files + 2.403.8 2022-10-22 lichtkind -------- * = POD rewrite release @@ -39,6 +39,8 @@ t/Humidity.t t/Math_1_over_x.t t/bars.t t/bars_10.t +t/bars_11.t +t/bars_12.t t/bars_2.t t/bars_3.t t/bars_4.t @@ -57,6 +59,8 @@ t/composite_6.t t/composite_7.t t/composite_8.t t/composite_f.t +t/data/in.csv +t/data/in.tsv t/direction_1.t t/direction_2.t t/direction_3.t @@ -132,3 +136,4 @@ t/stackedbars.t t/stackedbars_2.t t/stackedbars_3.t t/stackedbars_4.t +xt/author/pod-syntax.t @@ -33,15 +33,17 @@ "ExtUtils::MakeMaker" : "0" } }, + "develop" : { + "requires" : { + "Test::Pod" : "1.41" + } + }, "runtime" : { "requires" : { "Carp" : "1.35", "GD" : "2", "Graphics::Toolkit::Color" : "1", "perl" : "v5.12.0" - }, - "suggests" : { - "Graphics::ColorNames" : "0" } }, "test" : { @@ -55,63 +57,63 @@ "provides" : { "Chart" : { "file" : "lib/Chart.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Bars" : { "file" : "lib/Chart/Bars.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Composite" : { "file" : "lib/Chart/Composite.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Direction" : { "file" : "lib/Chart/Direction.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::ErrorBars" : { "file" : "lib/Chart/ErrorBars.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::HorizontalBars" : { "file" : "lib/Chart/HorizontalBars.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Lines" : { "file" : "lib/Chart/Lines.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::LinesPoints" : { "file" : "lib/Chart/LinesPoints.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Mountain" : { "file" : "lib/Chart/Mountain.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Pareto" : { "file" : "lib/Chart/Pareto.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Pie" : { "file" : "lib/Chart/Pie.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Points" : { "file" : "lib/Chart/Points.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Property" : { "file" : "lib/Chart/Property.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::Split" : { "file" : "lib/Chart/Split.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" }, "Chart::StackedBars" : { "file" : "lib/Chart/StackedBars.pm", - "version" : "v2.403.8" + "version" : "v2.403.9" } }, "release_status" : "stable", @@ -122,7 +124,7 @@ "web" : "https://github.com/lichtkind/Chart" } }, - "version" : "v2.403.8", + "version" : "v2.403.9", "x_generated_by_perl" : "v5.30.0", "x_maintainers" : [ "Herbert Breunung <lichtkind@cpan.org>" @@ -28,49 +28,49 @@ no_index: provides: Chart: file: lib/Chart.pm - version: v2.403.8 + version: v2.403.9 Chart::Bars: file: lib/Chart/Bars.pm - version: v2.403.8 + version: v2.403.9 Chart::Composite: file: lib/Chart/Composite.pm - version: v2.403.8 + version: v2.403.9 Chart::Direction: file: lib/Chart/Direction.pm - version: v2.403.8 + version: v2.403.9 Chart::ErrorBars: file: lib/Chart/ErrorBars.pm - version: v2.403.8 + version: v2.403.9 Chart::HorizontalBars: file: lib/Chart/HorizontalBars.pm - version: v2.403.8 + version: v2.403.9 Chart::Lines: file: lib/Chart/Lines.pm - version: v2.403.8 + version: v2.403.9 Chart::LinesPoints: file: lib/Chart/LinesPoints.pm - version: v2.403.8 + version: v2.403.9 Chart::Mountain: file: lib/Chart/Mountain.pm - version: v2.403.8 + version: v2.403.9 Chart::Pareto: file: lib/Chart/Pareto.pm - version: v2.403.8 + version: v2.403.9 Chart::Pie: file: lib/Chart/Pie.pm - version: v2.403.8 + version: v2.403.9 Chart::Points: file: lib/Chart/Points.pm - version: v2.403.8 + version: v2.403.9 Chart::Property: file: lib/Chart/Property.pm - version: v2.403.8 + version: v2.403.9 Chart::Split: file: lib/Chart/Split.pm - version: v2.403.8 + version: v2.403.9 Chart::StackedBars: file: lib/Chart/StackedBars.pm - version: v2.403.8 + version: v2.403.9 requires: Carp: '1.35' GD: '2' @@ -78,7 +78,7 @@ requires: perl: v5.12.0 resources: repository: git://github.com/lichtkind/Chart.git -version: v2.403.8 +version: v2.403.9 x_generated_by_perl: v5.30.0 x_maintainers: - 'Herbert Breunung <lichtkind@cpan.org>' diff --git a/Makefile.PL b/Makefile.PL index 9c79b13..e9c67c6 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -26,7 +26,7 @@ my %WriteMakefileArgs = ( "Test::More" => "1.3", "Test::Warn" => "0.30" }, - "VERSION" => "v2.403.8", + "VERSION" => "v2.403.9", "test" => { "TESTS" => "t/*.t" } @@ -5,7 +5,6 @@ requires "Carp" => "1.35"; requires "GD" => "2"; requires "Graphics::Toolkit::Color" => "1"; requires "perl" => "v5.12.0"; -suggests "Graphics::ColorNames" => "0"; on 'test' => sub { requires "File::Temp" => "0.19"; @@ -16,3 +15,7 @@ on 'test' => sub { on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; }; + +on 'develop' => sub { + requires "Test::Pod" => "1.41"; +}; @@ -18,7 +18,7 @@ GD = 2 Graphics::Toolkit::Color = 1 [Prereqs / RuntimeSuggests] -Graphics::ColorNames = 0 +;Alien::Font::Uni [Prereqs / TestRequires] File::Temp = 0.19 @@ -50,6 +50,7 @@ exclude_match = ^dev allow_decimal_underscore = 1 [Repository] +[PodSyntaxTests] [AbstractFromPOD] [Pod2Readme] [MetaJSON] diff --git a/lib/Chart.pm b/lib/Chart.pm index 1fb1a1e..7fc2091 100644 --- a/lib/Chart.pm +++ b/lib/Chart.pm @@ -1,7 +1,7 @@ use v5.12; package Chart; -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Points; use Chart::Lines; @@ -419,11 +419,8 @@ Ricardo Signes (rjbs@cpan.org) Petr Pisar (ppisar@redhat.com) - - =back - =head1 COPYRIGHT Copyright(c) 1997-1998 by David Bonner, 1999 by Peter Clark, diff --git a/lib/Chart/Bars.pm b/lib/Chart/Bars.pm index 879cff6..8c82162 100644 --- a/lib/Chart/Bars.pm +++ b/lib/Chart/Bars.pm @@ -5,7 +5,7 @@ use v5.12; package Chart::Bars; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/Base.pm b/lib/Chart/Base.pm index 2a4b0c2..97db6ca 100644 --- a/lib/Chart/Base.pm +++ b/lib/Chart/Base.pm @@ -5,7 +5,7 @@ use v5.12; package Chart::Base; -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use FileHandle; use Carp; @@ -193,7 +193,7 @@ sub add_datafile { } while (<$File>) { - @array = split; + @array = split /\s*,\s*|\s+/; next unless @array and substr($array[0], 0, 1) ne '#'; if ($format eq 'set'){ $self->add_dataset( @array ) } else { $self->add_pt( @array ) } diff --git a/lib/Chart/BrushStyles.pm b/lib/Chart/BrushStyles.pm index ab420df..87dcd80 100644 --- a/lib/Chart/BrushStyles.pm +++ b/lib/Chart/BrushStyles.pm @@ -4,7 +4,7 @@ use v5.12; package Chart::BrushStyles; -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Carp; use GD; diff --git a/lib/Chart/Composite.pm b/lib/Chart/Composite.pm index c1f007f..4cd26be 100644 --- a/lib/Chart/Composite.pm +++ b/lib/Chart/Composite.pm @@ -4,7 +4,7 @@ use v5.12; package Chart::Composite; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/Constants.pm b/lib/Chart/Constants.pm index 9aff487..6abc852 100644 --- a/lib/Chart/Constants.pm +++ b/lib/Chart/Constants.pm @@ -4,7 +4,7 @@ use v5.12; package Chart::Constants; -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use constant PI => 4 * atan2( 1, 1 ); diff --git a/lib/Chart/Direction.pm b/lib/Chart/Direction.pm index e8fc3c6..fc3ae98 100644 --- a/lib/Chart/Direction.pm +++ b/lib/Chart/Direction.pm @@ -5,7 +5,7 @@ use v5.12; package Chart::Direction; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/ErrorBars.pm b/lib/Chart/ErrorBars.pm index 24ef675..3c41579 100644 --- a/lib/Chart/ErrorBars.pm +++ b/lib/Chart/ErrorBars.pm @@ -6,7 +6,7 @@ use v5.12; package Chart::ErrorBars; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/HorizontalBars.pm b/lib/Chart/HorizontalBars.pm index 85630a1..5b6e74d 100644 --- a/lib/Chart/HorizontalBars.pm +++ b/lib/Chart/HorizontalBars.pm @@ -3,7 +3,7 @@ use v5.12; package Chart::HorizontalBars; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/Lines.pm b/lib/Chart/Lines.pm index 6dadc64..a1a75dc 100644 --- a/lib/Chart/Lines.pm +++ b/lib/Chart/Lines.pm @@ -5,7 +5,7 @@ use v5.12; package Chart::Lines; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/LinesPoints.pm b/lib/Chart/LinesPoints.pm index 511dd8a..275ad72 100644 --- a/lib/Chart/LinesPoints.pm +++ b/lib/Chart/LinesPoints.pm @@ -8,7 +8,7 @@ use v5.12; package Chart::LinesPoints; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/Manual/Methods.pod b/lib/Chart/Manual/Methods.pod index f4ac8b1..f672c2f 100644 --- a/lib/Chart/Manual/Methods.pod +++ b/lib/Chart/Manual/Methods.pod @@ -15,7 +15,7 @@ This are all methods for the chart user. Loads all data of a chart (one or more data sets) from a file. (Works only if no data yet added.) You have to either provide a filename -or filehandle (old school or in SCALAR). +or filehandle (OLD_SCHOOL or $scalar). $graph->add_dataset( 'file.tsv' ); $graph->add_dataset( $file_handle ); diff --git a/lib/Chart/Manual/Properties.pod b/lib/Chart/Manual/Properties.pod index c00732a..bc3f0d3 100644 --- a/lib/Chart/Manual/Properties.pod +++ b/lib/Chart/Manual/Properties.pod @@ -97,8 +97,8 @@ L</title>. Summary of all properties, grouped by chart type where there applicable. Sections are named after the Chart type in question, except B<All> and B<NoPie>. +The format is: name ... L<type|/"DATA TYPES">, description; C<default value>. -The format is: name, L<type|/"DATA TYPES">, description, default value Click on name for a longer explanation. diff --git a/lib/Chart/Mountain.pm b/lib/Chart/Mountain.pm index a277d00..e503db6 100644 --- a/lib/Chart/Mountain.pm +++ b/lib/Chart/Mountain.pm @@ -24,7 +24,7 @@ use v5.12; package Chart::Mountain; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/Pareto.pm b/lib/Chart/Pareto.pm index a1f63fe..48470dd 100644 --- a/lib/Chart/Pareto.pm +++ b/lib/Chart/Pareto.pm @@ -2,7 +2,7 @@ use v5.12; package Chart::Pareto; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/Pie.pm b/lib/Chart/Pie.pm index aa3629b..910bf93 100644 --- a/lib/Chart/Pie.pm +++ b/lib/Chart/Pie.pm @@ -5,7 +5,7 @@ use v5.12; package Chart::Pie; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Carp; use GD; diff --git a/lib/Chart/Points.pm b/lib/Chart/Points.pm index 036701f..17d2e51 100644 --- a/lib/Chart/Points.pm +++ b/lib/Chart/Points.pm @@ -5,7 +5,7 @@ use v5.12; package Chart::Points; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Carp; use GD; diff --git a/lib/Chart/Property.pm b/lib/Chart/Property.pm index 73c82f0..cf7bc06 100644 --- a/lib/Chart/Property.pm +++ b/lib/Chart/Property.pm @@ -4,7 +4,7 @@ use v5.12; package Chart::Property; -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Carp; diff --git a/lib/Chart/Property/DataType/Color.pm b/lib/Chart/Property/DataType/Color.pm index d6d2336..0c37a6b 100644 --- a/lib/Chart/Property/DataType/Color.pm +++ b/lib/Chart/Property/DataType/Color.pm @@ -5,7 +5,7 @@ use v5.12; package Chart::Property::DataType::Color; -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use base qw(Graphics::Toolkit::Color); diff --git a/lib/Chart/Property/DataType/Font.pm b/lib/Chart/Property/DataType/Font.pm index e1edc88..3b60f10 100644 --- a/lib/Chart/Property/DataType/Font.pm +++ b/lib/Chart/Property/DataType/Font.pm @@ -4,7 +4,7 @@ use v5.12; package Chart::Property::DataType::Font; -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Carp; diff --git a/lib/Chart/Split.pm b/lib/Chart/Split.pm index 5f6a7b6..c7059ff 100644 --- a/lib/Chart/Split.pm +++ b/lib/Chart/Split.pm @@ -18,7 +18,7 @@ use v5.12; package Chart::Split; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/lib/Chart/StackedBars.pm b/lib/Chart/StackedBars.pm index c001b0c..22349b4 100644 --- a/lib/Chart/StackedBars.pm +++ b/lib/Chart/StackedBars.pm @@ -2,7 +2,7 @@ use v5.12; package Chart::StackedBars; our @ISA = qw(Chart::Base); -our $VERSION = 'v2.403.8'; +our $VERSION = 'v2.403.9'; use Chart::Base; use GD; diff --git a/t/bars_11.t b/t/bars_11.t new file mode 100644 index 0000000..e24ff89 --- /dev/null +++ b/t/bars_11.t @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w + +BEGIN { unshift @INC, 'lib', '../lib'} +use Chart::Bars; +use strict; +use POSIX; +use File::Temp 0.19; +my $samples = File::Temp->newdir(); + +print "1..1\n"; + +my $file = File::Spec->catfile( File::Spec->curdir, 't', 'data', "in.tsv" ); + +my $g = Chart::Bars->new( 600, 400 ); +$g->add_datafile( $file ); + +$g->set( + colors => { dataset0 => [ 25, 220, 147 ], }, + graph_border => 0, + grey_background => 'false', + grid_lines => 'true', + include_zero => 'true', + + # integer_ticks_only => 'true', + legend => 'none', + png_border => 4, + precision => 1, + skip_int_ticks => 1000, + text_space => 3, + title => "Tickets", + title_font => GD::Font->Giant, + transparent => 'false', + x_ticks => 'vertical', + y_axes => 'both', + y_label => '# Tickets', + x_label => 'Date', +); + +$g->png("$samples/bars_11.png"); +print "ok 1\n"; + +exit(0); + diff --git a/t/bars_12.t b/t/bars_12.t new file mode 100644 index 0000000..9e5e27a --- /dev/null +++ b/t/bars_12.t @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w + +BEGIN { unshift @INC, 'lib', '../lib'} +use Chart::Bars; +use strict; +use POSIX; +use File::Temp 0.19; +my $samples = File::Temp->newdir(); + +print "1..1\n"; + +my $file = File::Spec->catfile( File::Spec->curdir, 't', 'data', "in.csv" ); + +my $g = Chart::Bars->new( 600, 400 ); +$g->add_datafile( $file ); + +$g->set( + colors => { dataset0 => [ 25, 220, 147 ], }, + graph_border => 0, + grey_background => 'false', + grid_lines => 'true', + include_zero => 'true', + + # integer_ticks_only => 'true', + legend => 'none', + png_border => 4, + precision => 1, + skip_int_ticks => 1000, + text_space => 3, + title => "Tickets", + title_font => GD::Font->Giant, + transparent => 'false', + x_ticks => 'vertical', + y_axes => 'both', + y_label => '# Tickets', + x_label => 'Date', +); + +$g->png("$samples/bars_11.png"); +print "ok 1\n"; + +exit(0); + diff --git a/t/data/in.csv b/t/data/in.csv new file mode 100644 index 0000000..da458af --- /dev/null +++ b/t/data/in.csv @@ -0,0 +1,2 @@ +200202, 200203, 200204, 200205, 200206, 200207, 200208, 200209, 200210, 200211, 200212, 200301 +6626, 7090, 7580, 7671, 8764, 8664, 6343, 5518, 6257, 5391, 5401, 6002 diff --git a/t/data/in.tsv b/t/data/in.tsv new file mode 100644 index 0000000..79db6ec --- /dev/null +++ b/t/data/in.tsv @@ -0,0 +1,2 @@ +200202 200203 200204 200205 200206 200207 200208 200209 200210 200211 200212 200301 +6626 7090 7580 7671 8764 8664 6343 5518 6257 5391 5401 6002 diff --git a/xt/author/pod-syntax.t b/xt/author/pod-syntax.t new file mode 100644 index 0000000..e563e5d --- /dev/null +++ b/xt/author/pod-syntax.t @@ -0,0 +1,7 @@ +#!perl +# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. +use strict; use warnings; +use Test::More; +use Test::Pod 1.41; + +all_pod_files_ok(); |