r54814 - in /trunk/libchart-gnuplot-perl: ./ debian/ examples/ lib/Chart/ lib/Chart/Gnuplot/ t/

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Sat Mar 27 09:07:33 UTC 2010


Author: carnil-guest
Date: Sat Mar 27 09:07:23 2010
New Revision: 54814

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54814
Log:
New upstream release

Added:
    trunk/libchart-gnuplot-perl/examples/axisTics_1.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_1.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_10.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_10.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_11.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_11.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_12.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_12.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_13.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_13.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_2.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_2.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_3.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_3.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_4.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_4.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_5.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_5.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_6.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_6.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_7.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_7.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_8.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_8.pl
    trunk/libchart-gnuplot-perl/examples/axisTics_9.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/axisTics_9.pl
    trunk/libchart-gnuplot-perl/examples/background_1.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/background_1.pl
    trunk/libchart-gnuplot-perl/examples/background_2.pl
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/examples/background_2.pl
    trunk/libchart-gnuplot-perl/t/axisLabel_1.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/axisLabel_1.gp
    trunk/libchart-gnuplot-perl/t/axisLabel_2.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/axisLabel_2.gp
    trunk/libchart-gnuplot-perl/t/axisTics.t
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/axisTics.t
    trunk/libchart-gnuplot-perl/t/axisTics_1.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/axisTics_1.gp
    trunk/libchart-gnuplot-perl/t/border.t
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/border.t
    trunk/libchart-gnuplot-perl/t/border_1.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/border_1.gp
    trunk/libchart-gnuplot-perl/t/chartTitle_1.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/chartTitle_1.gp
    trunk/libchart-gnuplot-perl/t/chartTitle_2.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/chartTitle_2.gp
    trunk/libchart-gnuplot-perl/t/copy.t
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/copy.t
    trunk/libchart-gnuplot-perl/t/copy_1.dat
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/copy_1.dat
    trunk/libchart-gnuplot-perl/t/copy_1.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/copy_1.gp
    trunk/libchart-gnuplot-perl/t/copy_2.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/copy_2.gp
    trunk/libchart-gnuplot-perl/t/copy_3.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/copy_3.gp
    trunk/libchart-gnuplot-perl/t/copy_4.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/copy_4.gp
    trunk/libchart-gnuplot-perl/t/copy_5.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/copy_5.gp
    trunk/libchart-gnuplot-perl/t/dataSrc_1.dat
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/dataSrc_1.dat
    trunk/libchart-gnuplot-perl/t/dataSrc_2.dat
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/dataSrc_2.dat
    trunk/libchart-gnuplot-perl/t/dataSrc_3.dat
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/dataSrc_3.dat
    trunk/libchart-gnuplot-perl/t/grid_1.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/grid_1.gp
    trunk/libchart-gnuplot-perl/t/grid_2.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/grid_2.gp
    trunk/libchart-gnuplot-perl/t/grid_3.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/grid_3.gp
    trunk/libchart-gnuplot-perl/t/legend.t
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/legend.t
    trunk/libchart-gnuplot-perl/t/legend_1.gp
      - copied unchanged from r54813, branches/upstream/libchart-gnuplot-perl/current/t/legend_1.gp
Removed:
    trunk/libchart-gnuplot-perl/examples/bg_1.pl
    trunk/libchart-gnuplot-perl/examples/bg_2.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_1.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_10.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_11.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_12.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_13.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_2.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_3.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_4.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_5.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_6.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_7.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_8.pl
    trunk/libchart-gnuplot-perl/examples/ticFmt_9.pl
    trunk/libchart-gnuplot-perl/t/data.dat
Modified:
    trunk/libchart-gnuplot-perl/Changes
    trunk/libchart-gnuplot-perl/MANIFEST
    trunk/libchart-gnuplot-perl/META.yml
    trunk/libchart-gnuplot-perl/Makefile.PL
    trunk/libchart-gnuplot-perl/README
    trunk/libchart-gnuplot-perl/debian/changelog
    trunk/libchart-gnuplot-perl/examples/Makefile
    trunk/libchart-gnuplot-perl/examples/main.html
    trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot.pm
    trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot/Util.pm
    trunk/libchart-gnuplot-perl/t/axisLabel.t
    trunk/libchart-gnuplot-perl/t/chartTitle.t
    trunk/libchart-gnuplot-perl/t/dataSrc.t
    trunk/libchart-gnuplot-perl/t/grid.t

Modified: trunk/libchart-gnuplot-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/Changes?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/Changes (original)
+++ trunk/libchart-gnuplot-perl/Changes Sat Mar 27 09:07:23 2010
@@ -1,4 +1,15 @@
 Change log for Chart::Gnuplot
+
+0.13
+    - Improve error handling
+    - Add method to copy the chart and data set objects
+    - Add specific get-set methods for xdata, ydata, zdata, points, datafile
+      and func so that different data sources cannot co-exist in the same data
+      set object
+    - Keep the plot window from disappearing immediately for interactive
+      terminals
+      (Thanks to Alex White)
+    - More strict testsuite. Add more test cases
 
 0.12
     - More understandable error messages

Modified: trunk/libchart-gnuplot-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/MANIFEST?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/MANIFEST (original)
+++ trunk/libchart-gnuplot-perl/MANIFEST Sat Mar 27 09:07:23 2010
@@ -13,8 +13,21 @@
 examples/axisLabel_6.pl
 examples/axisLabel_7.pl
 examples/axisLabel_8.pl
-examples/bg_1.pl
-examples/bg_2.pl
+examples/axisTics_1.pl
+examples/axisTics_2.pl
+examples/axisTics_3.pl
+examples/axisTics_4.pl
+examples/axisTics_5.pl
+examples/axisTics_6.pl
+examples/axisTics_7.pl
+examples/axisTics_8.pl
+examples/axisTics_9.pl
+examples/axisTics_10.pl
+examples/axisTics_11.pl
+examples/axisTics_12.pl
+examples/axisTics_13.pl
+examples/background_1.pl
+examples/background_2.pl
 examples/border_1.pl
 examples/border_2.pl
 examples/border_3.pl
@@ -93,29 +106,38 @@
 examples/range_1.pl
 examples/range_2.pl
 examples/range_3.pl
-examples/ticFmt_1.pl
-examples/ticFmt_2.pl
-examples/ticFmt_3.pl
-examples/ticFmt_4.pl
-examples/ticFmt_5.pl
-examples/ticFmt_6.pl
-examples/ticFmt_7.pl
-examples/ticFmt_8.pl
-examples/ticFmt_9.pl
-examples/ticFmt_10.pl
-examples/ticFmt_11.pl
-examples/ticFmt_12.pl
-examples/ticFmt_13.pl
 examples/index.html
 examples/list.html
 examples/main.html
 examples/dataSrc_3.dat
 examples/plot3d_3.dat
+t/axisLabel_1.gp
+t/axisLabel_2.gp
 t/axisLabel.t
+t/axisTics_1.gp
+t/axisTics.t
+t/border_1.gp
+t/border.t
+t/copy_1.dat
+t/copy_1.gp
+t/copy_2.gp
+t/copy_3.gp
+t/copy_4.gp
+t/copy_5.gp
+t/copy.t
+t/chartTitle_1.gp
+t/chartTitle_2.gp
 t/chartTitle.t
-t/data.dat
+t/dataSrc_1.dat
+t/dataSrc_2.dat
+t/dataSrc_3.dat
 t/dataSrc.t
+t/grid_1.gp
+t/grid_2.gp
+t/grid_3.gp
 t/grid.t
+t/legend_1.gp
+t/legend.t
 t/use.t
 Changes
 README

Modified: trunk/libchart-gnuplot-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/META.yml?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/META.yml (original)
+++ trunk/libchart-gnuplot-perl/META.yml Sat Mar 27 09:07:23 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Chart-Gnuplot
-version:            0.12
+version:            0.13
 abstract:           Plot graph using Gnuplot on the fly
 author:
     - Ka-Wai Mak
@@ -13,6 +13,7 @@
 requires:
     File::Copy:  2.08
     File::Temp:  0.14
+    Storable:    2.15
 no_index:
     directory:
         - t

Modified: trunk/libchart-gnuplot-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/Makefile.PL?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/Makefile.PL (original)
+++ trunk/libchart-gnuplot-perl/Makefile.PL Sat Mar 27 09:07:23 2010
@@ -5,7 +5,11 @@
 	NAME          => 'Chart::Gnuplot',
 	VERSION_FROM  => 'lib/Chart/Gnuplot.pm',
 	ABSTRACT_FROM => "lib/Chart/Gnuplot.pm",
-	PREREQ_PM     => { File::Copy => 2.08, File::Temp => 0.14 },
+	PREREQ_PM     => {
+        File::Copy => 2.08,
+        File::Temp => 0.14,
+        Storable   => 2.15,
+    },
 	dist          => {
 		SUFFIX   => '.gz',
 		COMPRESS => 'gzip -f'

Modified: trunk/libchart-gnuplot-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/README?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/README (original)
+++ trunk/libchart-gnuplot-perl/README Sat Mar 27 09:07:23 2010
@@ -13,9 +13,10 @@
 =============
 File::Copy v2.08 or later
 File::Temp v0.14 or later
+Storable v2.15 or later
 
 Copyright
 =========
-Copyright (c) 2008-2009 Ka-Wai Mak. All rights reserved.
+Copyright (c) 2008-2010 Ka-Wai Mak. All rights reserved.
 This program is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.

Modified: trunk/libchart-gnuplot-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/debian/changelog?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/debian/changelog (original)
+++ trunk/libchart-gnuplot-perl/debian/changelog Sat Mar 27 09:07:23 2010
@@ -1,3 +1,9 @@
+libchart-gnuplot-perl (0.13-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Sat, 27 Mar 2010 10:07:05 +0100
+
 libchart-gnuplot-perl (0.12-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libchart-gnuplot-perl/examples/Makefile
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/examples/Makefile?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/examples/Makefile (original)
+++ trunk/libchart-gnuplot-perl/examples/Makefile Sat Mar 27 09:07:23 2010
@@ -7,8 +7,21 @@
 axisLabel_6.png \
 axisLabel_7.png \
 axisLabel_8.png \
-bg_1.png \
-bg_2.png \
+axisTics_1.png \
+axisTics_2.png \
+axisTics_3.png \
+axisTics_4.png \
+axisTics_5.png \
+axisTics_6.png \
+axisTics_7.png \
+axisTics_8.png \
+axisTics_9.png \
+axisTics_10.png \
+axisTics_11.png \
+axisTics_12.png \
+axisTics_13.png \
+background_1.png \
+background_2.png \
 border_1.png \
 border_2.png \
 border_3.png \
@@ -87,19 +100,6 @@
 range_1.png \
 range_2.png \
 range_3.png \
-ticFmt_1.png \
-ticFmt_2.png \
-ticFmt_3.png \
-ticFmt_4.png \
-ticFmt_5.png \
-ticFmt_6.png \
-ticFmt_7.png \
-ticFmt_8.png \
-ticFmt_9.png \
-ticFmt_10.png \
-ticFmt_11.png \
-ticFmt_12.png \
-ticFmt_13.png \
 
 all: mkdir $(IMAGES)
 

Modified: trunk/libchart-gnuplot-perl/examples/main.html
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/examples/main.html?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/examples/main.html (original)
+++ trunk/libchart-gnuplot-perl/examples/main.html Sat Mar 27 09:07:23 2010
@@ -322,68 +322,68 @@
 <table border=0 width=100%>
 <tr>
 <td width=65%>Number of minor tics between consecutive major tics</td>
-<td align="center"><a href="ticFmt_1.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_1.png">sample image</a></td>
+<td align="center"><a href="axisTics_1.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_1.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Specify the tics to label</td>
-<td align="center"><a href="ticFmt_2.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_2.png">sample image</a></td>
+<td align="center"><a href="axisTics_2.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_2.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Re-label the tics</td>
-<td align="center"><a href="ticFmt_3.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_3.png">sample image</a></td>
+<td align="center"><a href="axisTics_3.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_3.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Tic label number format</td>
-<td align="center"><a href="ticFmt_4.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_4.png">sample image</a></td>
+<td align="center"><a href="axisTics_4.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_4.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Tic label font</td>
-<td align="center"><a href="ticFmt_5.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_5.png">sample image</a></td>
+<td align="center"><a href="axisTics_5.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_5.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Tic label font and font size</td>
-<td align="center"><a href="ticFmt_6.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_6.png">sample image</a></td>
+<td align="center"><a href="axisTics_6.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_6.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Tic label color</td>
-<td align="center"><a href="ticFmt_7.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_7.png">sample image</a></td>
+<td align="center"><a href="axisTics_7.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_7.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Location of the tic label</td>
-<td align="center"><a href="ticFmt_8.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_8.png">sample image</a></td>
+<td align="center"><a href="axisTics_8.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_8.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Rotate the tic label</td>
-<td align="center"><a href="ticFmt_9.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_9.png">sample image</a></td>
+<td align="center"><a href="axisTics_9.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_9.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Tic length</td>
-<td align="center"><a href="ticFmt_10.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_10.png">sample image</a></td>
+<td align="center"><a href="axisTics_10.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_10.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Remove the tics on the opposite axis</td>
-<td align="center"><a href="ticFmt_11.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_11.png">sample image</a></td>
+<td align="center"><a href="axisTics_11.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_11.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Turn on and off the tics</td>
-<td align="center"><a href="ticFmt_12.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_12.png">sample image</a></td>
+<td align="center"><a href="axisTics_12.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_12.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Composite example</td>
-<td align="center"><a href="ticFmt_13.pl">script</a></td>
-<td align="center"><a href="gallery/ticFmt_13.png">sample image</a></td>
+<td align="center"><a href="axisTics_13.pl">script</a></td>
+<td align="center"><a href="gallery/axisTics_13.png">sample image</a></td>
 </tr>
 </table>
 
@@ -594,13 +594,13 @@
 <table border=0 width=100%>
 <tr>
 <td width=65%>Background color of the chart</td>
-<td align="center"><a href="bg_1.pl">script</a></td>
-<td align="center"><a href="gallery/bg_1.png">sample image</a></td>
+<td align="center"><a href="background_1.pl">script</a></td>
+<td align="center"><a href="gallery/background_1.png">sample image</a></td>
 </tr>
 <tr>
 <td width=65%>Background color of the plot area</td>
-<td align="center"><a href="bg_2.pl">script</a></td>
-<td align="center"><a href="gallery/bg_2.png">sample image</a></td>
+<td align="center"><a href="background_2.pl">script</a></td>
+<td align="center"><a href="gallery/background_2.png">sample image</a></td>
 </tr>
 </table>
 

Modified: trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot.pm?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot.pm (original)
+++ trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot.pm Sat Mar 27 09:07:23 2010
@@ -2,10 +2,10 @@
 use strict;
 use vars qw($VERSION);
 use Carp;
-use File::Copy;
+use File::Copy qw(move);
 use File::Temp qw(tempdir);
-use Chart::Gnuplot::Util qw(_lineType _pointType);
-$VERSION = '0.12';
+use Chart::Gnuplot::Util qw(_lineType _pointType _copy);
+$VERSION = '0.13';
 
 # Constructor
 sub new
@@ -922,13 +922,16 @@
     # Execute gnuplot
     my $gnuplot = 'gnuplot';
     $gnuplot = $self->{gnuplot} if (defined $self->{gnuplot});
-    my $err = `$gnuplot $self->{_script} 2>&1`;
+    my $cmd = "$gnuplot $self->{_script}";
+    $cmd .= " -" if ($self->{terminal} =~ /^(ggi|pm|windows|wxt|x11)(\s|$)/);
+    my $err = `$cmd 2>&1`;
 
     # Capture and process error message from Gnuplot
     if (defined $err && $err ne '')
     {
         my ($errTmp) = ($err =~ /\", line \d+:\s(.+)/);
         die "$errTmp\n" if (defined $errTmp);
+        warn "$err\n";
     }
 
     # Convert the image to the user-specified format
@@ -1041,11 +1044,6 @@
 }
 
 
-sub histogram
-{
-}
-
-
 # Change the image format
 # - called by plot2d()
 #
@@ -1080,7 +1078,18 @@
         # Rotate 90 deg for landscape image
         if (defined $self->{orient} && $self->{orient} eq 'portrait')
         {
-            system("$convert $temp $temp".".$imgfmt");
+            my $cmd = "$convert $temp $temp".".$imgfmt 2>&1";
+            my $err = `$cmd`;
+            if (defined $err && $err ne '')
+            {
+                die "Unsupported image format ($imgfmt)\n" if
+                    ($err =~ /^convert: unable to open module file/);
+
+                my ($errTmp) = ($err =~ /^convert: (.+)/);
+                die "$errTmp Perhaps the image format is not supported\n" if
+                    (defined $errTmp);
+                die "$err\n";
+            }
         }
         else
         {
@@ -1092,7 +1101,9 @@
                     ($err =~ /^convert: unable to open module file/);
 
                 my ($errTmp) = ($err =~ /^convert: (.+)/);
-                die "$errTmp Perhaps the image format is not supported\n";
+                die "$errTmp Perhaps the image format is not supported\n" if
+                    (defined $errTmp);
+                die "$err\n";
             }
         }
     }
@@ -1173,13 +1184,30 @@
     return($self)
 }
 
+
+# Copy method of the chart object
+sub copy
+{
+    my ($self, $num) = @_;
+    my @clone = &_copy(@_);
+
+    foreach my $clone (@clone)
+    {
+        my $dirTmp = tempdir(CLEANUP => 1);
+        ($^O eq 'MSWin32')? ($dirTmp .= '\\'): ($dirTmp .= '/');
+        $clone->{_script} = $dirTmp . "plot";
+    }
+    return($clone[0]) if (!defined $num);
+    return(@clone);
+}
+
 ################## Chart::Gnuplot::DataSet class ##################
 
 package Chart::Gnuplot::DataSet;
 use strict;
 use Carp;
 use File::Temp qw(tempdir);
-use Chart::Gnuplot::Util qw(_lineType _pointType);
+use Chart::Gnuplot::Util qw(_lineType _pointType _copy);
 
 # Constructor
 sub new
@@ -1205,6 +1233,91 @@
     $self->{$attr} = $key if (defined $key);
     return($self->{$attr});
 }
+
+
+# xdata get-set method
+sub xdata
+{
+    my ($self, $xdata) = @_;
+    return($self->{xdata}) if (!defined $xdata);
+
+    delete $self->{points};
+    delete $self->{datafile};
+    delete $self->{func};
+    $self->{xdata} = $xdata;
+}
+
+
+# ydata get-set method
+sub ydata
+{
+    my ($self, $ydata) = @_;
+    return($self->{ydata}) if (!defined $ydata);
+
+    delete $self->{points};
+    delete $self->{datafile};
+    delete $self->{func};
+    $self->{ydata} = $ydata;
+}
+
+
+# zdata get-set method
+sub zdata
+{
+    my ($self, $zdata) = @_;
+    return($self->{zdata}) if (!defined $zdata);
+
+    delete $self->{points};
+    delete $self->{datafile};
+    delete $self->{func};
+    $self->{zdata} = $zdata;
+}
+
+
+# points get-set method
+sub points
+{
+    my ($self, $points) = @_;
+    return($self->{points}) if (!defined $points);
+
+    delete $self->{xdata};
+    delete $self->{ydata};
+    delete $self->{zdata};
+    delete $self->{datafile};
+    delete $self->{func};
+    $self->{points} = $points;
+}
+
+
+# datafile get-set method
+sub datafile
+{
+    my ($self, $datafile) = @_;
+    return($self->{datafile}) if (!defined $datafile);
+
+    delete $self->{xdata};
+    delete $self->{ydata};
+    delete $self->{zdata};
+    delete $self->{points};
+    delete $self->{func};
+    $self->{datafile} = $datafile;
+}
+
+
+# func get-set method
+sub func
+{
+    my ($self, $func) = @_;
+    return($self->{func}) if (!defined $func);
+
+    delete $self->{xdata};
+    delete $self->{ydata};
+    delete $self->{zdata};
+    delete $self->{points};
+    delete $self->{datafile};
+    $self->{func} = $func;
+}
+
 
 
 # Thaw the data set object to string
@@ -1620,6 +1733,23 @@
 }
 
 
+# Copy method of the data set object
+sub copy
+{
+    my ($self, $num) = @_;
+    my @clone = &_copy(@_);
+
+    foreach my $clone (@clone)
+    {
+        my $dirTmp = tempdir(CLEANUP => 1);
+        ($^O eq 'MSWin32')? ($dirTmp .= '\\'): ($dirTmp .= '/');
+        $clone->{_data} = $dirTmp . "data";
+    }
+    return($clone[0]) if (!defined $num);
+    return(@clone);
+}
+
+
 1;
 
 __END__
@@ -2040,6 +2170,22 @@
         pointsize  => 5,
         pointcolor => "blue",
     );
+
+=head3 copy
+
+Copy the chart object. This method is especially useful when you want to copy a
+chart with highly customized format. E.g.
+
+    my $chart = Chart::Gnuplot->new(
+        ...
+    );
+
+    # $copy and $chart will have the same format
+    my $copy = $chart->copy;
+
+You may also make multiple copies . E.g.
+
+    my @copies = $chart->copy(10);  # make 10 copies
 
 =head3 convert
 
@@ -2315,6 +2461,22 @@
 Constructor of the dataset object. If no option is specified, default values
 would be used. See L<Dataset Options> for available options.
 
+=head3 copy
+
+Copy the dataset object. This method is especially useful when you want to copy
+a dataset with highly customized format. E.g.
+
+    my $dataset = Chart::Gnuplot::DataSet->new(
+        ...
+    );
+
+    # $copy and $dataset will have the same format and contain the same data
+    my $copy = $dataset->copy;
+
+You may also make multiple copies . E.g.
+
+    my @copies = $dataset->copy(10);  # make 10 copies
+
 =head1 EXAMPLES
 
 Some simple examples are shown below. Many more come with the distribution.
@@ -2478,17 +2640,15 @@
 
 =item 3. Add curve fitting method.
 
-=item 4. Add method to copy Chart and DataSet objects.
-
-=item 5. Improve the testsuite.
-
-=item 6. Reduce number of temporary files generated.
+=item 4. Improve the testsuite.
+
+=item 5. Reduce number of temporary files generated.
 
 =back
 
 =head1 REQUIREMENTS
 
-L<File::Copy>, L<File::Temp>
+L<File::Copy>, L<File::Temp>, L<Storable>
 
 Gnuplot L<http://www.gnuplot.info>
 
@@ -2508,7 +2668,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (c) 2008-2009 Ka-Wai Mak. All rights reserved.
+Copyright (c) 2008-2010 Ka-Wai Mak. All rights reserved.
 
 =head1 LICENSE
 

Modified: trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot/Util.pm?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot/Util.pm (original)
+++ trunk/libchart-gnuplot-perl/lib/Chart/Gnuplot/Util.pm Sat Mar 27 09:07:23 2010
@@ -4,7 +4,7 @@
 use Exporter;
 
 @ISA = qw(Exporter);
- at EXPORT_OK = qw(_lineType _pointType);
+ at EXPORT_OK = qw(_lineType _pointType _copy);
 
 # Convert named line type to indexed line type of gnuplot
 #
@@ -72,6 +72,24 @@
 	return($type{$type});
 }
 
+
+# Copy object using dclone() of Storable
+sub _copy
+{
+    my ($obj, $num) = @_;
+    use Storable;
+
+    my @clones = ();
+    $num = 1 if (!defined $num);
+
+    for (my $i = 0; $i < $num; $i++)
+    {
+        push(@clones, Storable::dclone($obj));
+    }
+    return(@clones);
+}
+
+
 1;
 
 __END__

Modified: trunk/libchart-gnuplot-perl/t/axisLabel.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/t/axisLabel.t?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/t/axisLabel.t (original)
+++ trunk/libchart-gnuplot-perl/t/axisLabel.t Sat Mar 27 09:07:23 2010
@@ -9,14 +9,17 @@
 # Test default setting of axis labels
 {
     my $c = Chart::Gnuplot->new(
-        output => $temp,
+        output  => $temp,
         xlabel  => 'x-label',
         ylabel  => 'y-label',
         x2label => 'x2-label',
         y2label => 'y2-label',
     );
-    ok(ref($c) eq 'Chart::Gnuplot');
+
+    $c->_setChart();
+    ok(&diff($c->{_script}, "axisLabel_1.gp") == 0);
 }
+
 
 # Test formatting the axis labels
 {
@@ -34,5 +37,27 @@
             rotate => 80,
         },
     );
-    ok(ref($c) eq 'Chart::Gnuplot');
+
+    $c->_setChart();
+    ok(&diff($c->{_script}, "axisLabel_2.gp") == 0);
 }
+
+###################################################################
+
+# Compare two files
+# - return 0 if two files are the same, except the ordering of the lines
+# - return 1 otherwise
+sub diff
+{
+    my ($f1, $f2) = @_;
+    $f2 = "t/".$f2 if (!-e $f2);
+
+    open(F1, $f1) || return(1);
+    open(F2, $f2) || return(1);
+    my @c1 = <F1>;
+    my @c2 = <F2>;
+    close(F1);
+    close(F2);
+    return(0) if (join("", sort @c1) eq join("", sort @c2));
+    return(1);
+}

Modified: trunk/libchart-gnuplot-perl/t/chartTitle.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/t/chartTitle.t?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/t/chartTitle.t (original)
+++ trunk/libchart-gnuplot-perl/t/chartTitle.t Sat Mar 27 09:07:23 2010
@@ -12,8 +12,11 @@
         output => $temp,
         title  => "My chart title",
     );
-    ok(ref($c) eq 'Chart::Gnuplot');
+
+    $c->_setChart();
+    ok(&diff($c->{_script}, "chartTitle_1.gp") == 0);
 }
+
 
 # Test formatting the chart title
 {
@@ -27,5 +30,27 @@
             enhanced => "on",
         },
     );
-    ok(ref($c) eq 'Chart::Gnuplot');
+
+    $c->_setChart();
+    ok(&diff($c->{_script}, "chartTitle_2.gp") == 0);
 }
+
+###################################################################
+
+# Compare two files
+# - return 0 if two files are the same, except the ordering of the lines
+# - return 1 otherwise
+sub diff
+{
+    my ($f1, $f2) = @_;
+    $f2 = "t/".$f2 if (!-e $f2);
+
+    open(F1, $f1) || return(1);
+    open(F2, $f2) || return(1);
+    my @c1 = <F1>;
+    my @c2 = <F2>;
+    close(F1);
+    close(F2);
+    return(0) if (join("", sort @c1) eq join("", sort @c2));
+    return(1);
+}

Modified: trunk/libchart-gnuplot-perl/t/dataSrc.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/t/dataSrc.t?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/t/dataSrc.t (original)
+++ trunk/libchart-gnuplot-perl/t/dataSrc.t Sat Mar 27 09:07:23 2010
@@ -4,22 +4,21 @@
 
 BEGIN {use Chart::Gnuplot;}
 
-my $temp = "temp.ps";
 
 # Test plotting from Perl arrays of x coordinates and y coordinates
 {
     my @x = (-10 .. 10);
     my @y = (0 .. 20);
 
-    my $c = Chart::Gnuplot->new(
-        output => $temp,
-    );
     my $d = Chart::Gnuplot::DataSet->new(
         xdata => \@x,
         ydata => \@y,
     );
-    ok(ref($c) eq 'Chart::Gnuplot' && ref($d) eq 'Chart::Gnuplot::DataSet');
+
+    $d->_thaw();
+    ok(&diff($d->{_data}, "dataSrc_1.dat") == 0);
 }
+
 
 # Test plotting from Perl array of x-y pairs
 {
@@ -32,36 +31,55 @@
         [9, 3],
     );
 
-    my $c = Chart::Gnuplot->new(
-        output => $temp,
-    );
     my $d = Chart::Gnuplot::DataSet->new(
         points => \@xy,
     );
-    ok(ref($c) eq 'Chart::Gnuplot' && ref($d) eq 'Chart::Gnuplot::DataSet');
+
+    $d->_thaw();
+    ok(&diff($d->{_data}, "dataSrc_2.dat") == 0);
 }
+
 
 # Test plotting from data file
 {
-    my $infile = "t/data.dat";
-    $infile = "data.dat" if (!-e "t/data.dat");
+    my $infile = "dataSrc_3.dat";
+    $infile = "t/".$infile if (!-e $infile);
 
-    my $c = Chart::Gnuplot->new(
-        output => $temp,
-    );
     my $d = Chart::Gnuplot::DataSet->new(
         datafile => $infile,
     );
-    ok(ref($c) eq 'Chart::Gnuplot' && ref($d) eq 'Chart::Gnuplot::DataSet');
+
+    my $string = $d->_thaw();
+    ok($string eq "'$infile' title \"\"");
 }
+
 
 # Test plotting from mathematical expression
 {
-    my $c = Chart::Gnuplot->new(
-        output => $temp,
-    );
     my $d = Chart::Gnuplot::DataSet->new(
         func => "sin(x)",
     );
-    ok(ref($c) eq 'Chart::Gnuplot' && ref($d) eq 'Chart::Gnuplot::DataSet');
+
+    my $string = $d->_thaw();
+    ok($string eq "sin(x) title \"\"");
 }
+
+###################################################################
+
+# Compare two files
+# - return 0 if two files are the same, except the ordering of the lines
+# - return 1 otherwise
+sub diff
+{
+    my ($f1, $f2) = @_;
+    $f2 = "t/".$f2 if (!-e $f2);
+
+    open(F1, $f1) || return(1);
+    open(F2, $f2) || return(1);
+    my @c1 = <F1>;
+    my @c2 = <F2>;
+    close(F1);
+    close(F2);
+    return(0) if (join("", sort @c1) eq join("", sort @c2));
+    return(1);
+}

Modified: trunk/libchart-gnuplot-perl/t/grid.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libchart-gnuplot-perl/t/grid.t?rev=54814&op=diff
==============================================================================
--- trunk/libchart-gnuplot-perl/t/grid.t (original)
+++ trunk/libchart-gnuplot-perl/t/grid.t Sat Mar 27 09:07:23 2010
@@ -12,8 +12,11 @@
         output => $temp,
         grid   => 'on',
     );
-    ok(ref($c) eq 'Chart::Gnuplot');
+
+    $c->_setChart();
+    ok(&diff($c->{_script}, "grid_1.gp") == 0);
 }
+
 
 # Test formatting the gridlines
 {
@@ -26,8 +29,11 @@
             width    => "2,1",
         },
     );
-    ok(ref($c) eq 'Chart::Gnuplot');
+
+    $c->_setChart();
+    ok(&diff($c->{_script}, "grid_2.gp") == 0);
 }
+
 
 # Test setting major and minor gridlines
 {
@@ -46,5 +52,27 @@
             width    => "1",
         },
     );
-    ok(ref($c) eq 'Chart::Gnuplot');
+
+    $c->_setChart();
+    ok(&diff($c->{_script}, "grid_3.gp") == 0);
 }
+
+###################################################################
+
+# Compare two files
+# - return 0 if two files are the same, except the ordering of the lines
+# - return 1 otherwise
+sub diff
+{
+    my ($f1, $f2) = @_;
+    $f2 = "t/".$f2 if (!-e $f2);
+
+    open(F1, $f1) || return(1);
+    open(F2, $f2) || return(1);
+    my @c1 = <F1>;
+    my @c2 = <F2>;
+    close(F1);
+    close(F2);
+    return(0) if (join("", sort @c1) eq join("", sort @c2));
+    return(1);
+}




More information about the Pkg-perl-cvs-commits mailing list