svg-graph 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +7 -5
  3. data/Manifest.txt +53 -17
  4. data/README.markdown +14 -0
  5. data/README.txt +10 -3
  6. data/Rakefile +6 -0
  7. data/build.xml +143 -0
  8. data/dist.xml.in +46 -0
  9. data/images/bar.png +0 -0
  10. data/images/bar.svg +76 -0
  11. data/images/bar.svgz +0 -0
  12. data/images/barhorizontal.png +0 -0
  13. data/images/barhorizontal.svg +76 -0
  14. data/images/barhorizontal.svgz +0 -0
  15. data/images/line.png +0 -0
  16. data/images/line.svg +80 -0
  17. data/images/line.svgz +0 -0
  18. data/images/pie.png +0 -0
  19. data/images/pie.svg +70 -0
  20. data/images/pie.svgz +0 -0
  21. data/images/plot.png +0 -0
  22. data/images/plot.svg +131 -0
  23. data/images/plot.svgz +0 -0
  24. data/images/schedule.png +0 -0
  25. data/images/schedule.svg +67 -0
  26. data/images/timeseries.png +0 -0
  27. data/images/timeseries.svg +179 -0
  28. data/images/timeseries.svgz +0 -0
  29. data/index.xml +281 -0
  30. data/install.rb +161 -0
  31. data/lib/SVG/Graph/Bar.rb +1 -1
  32. data/lib/SVG/Graph/Graph.rb +11 -9
  33. data/lib/SVG/Graph/Line.rb +1 -0
  34. data/lib/SVG/Graph/Pie.rb +3 -3
  35. data/lib/SVG/Graph/Plot.rb +69 -20
  36. data/lib/SVG/Graph/Schedule.rb +19 -5
  37. data/lib/SVG/Graph/TimeSeries.rb +62 -45
  38. data/lib/svggraph.rb +1 -2
  39. data/screenshots.xml +148 -0
  40. data/style/common.xsl +37 -0
  41. data/style/release_html.xsl +169 -0
  42. data/style/release_txt.xsl +25 -0
  43. data/svg-graph.gemspec +59 -0
  44. data/test/data.txt +4 -0
  45. data/test/plot.rb +51 -0
  46. data/test/schedule.rb +43 -0
  47. data/test/single.rb +33 -0
  48. data/test/test.rb +54 -0
  49. data/test/test_plot.rb +170 -0
  50. data/test/test_svg_graph.rb +24 -55
  51. data/test/timeseries.rb +58 -0
  52. metadata +79 -14
  53. metadata.gz.sig +2 -1
data/lib/svggraph.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  module SVG
2
2
  module Graph
3
- VERSION = '1.0.1'
4
- ORIGINAL_VERSION='0.6.1'
3
+ VERSION = '1.0.3'
5
4
  autoload(:Bar, 'SVG/Graph/Bar')
6
5
  autoload(:BarBase, 'SVG/Graph/BarBase')
7
6
  autoload(:BarHorizontal, 'SVG/Graph/BarHorizontal')
data/screenshots.xml ADDED
@@ -0,0 +1,148 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
+ <article>
5
+ <title>Screenshots</title>
6
+
7
+ <sect1>
8
+ <title>SVGs</title>
9
+
10
+ <para>Here are the SVG screenshots in all their glory. KSVG doesn't handle
11
+ CSS properly yet, and neither does librsvg. Adobe and Batik both
12
+ do.<mediaobject>
13
+ <imageobject>
14
+ <imagedata fileref="images/bar.svg" format="SVG" />
15
+ </imageobject>
16
+
17
+ <caption>
18
+ <para>SVG::Chart::Bar</para>
19
+ </caption>
20
+ </mediaobject><mediaobject>
21
+ <imageobject>
22
+ <imagedata fileref="images/barhorizontal.svg" format="SVG" />
23
+ </imageobject>
24
+
25
+ <caption>
26
+ <para>SVG::Chart::BarHorizontal</para>
27
+ </caption>
28
+ </mediaobject><mediaobject>
29
+ <imageobject>
30
+ <imagedata fileref="images/line.svg" format="SVG" />
31
+ </imageobject>
32
+
33
+ <caption>
34
+ <para>SVG::Chart::Line</para>
35
+ </caption>
36
+ </mediaobject><mediaobject>
37
+ <imageobject>
38
+ <imagedata fileref="images/pie.svg" format="SVG" />
39
+ </imageobject>
40
+
41
+ <caption>
42
+ <para>SVG::Chart::Pie</para>
43
+ </caption>
44
+ </mediaobject><mediaobject>
45
+ <imageobject>
46
+ <imagedata fileref="images/plot.svg" format="SVG" />
47
+ </imageobject>
48
+
49
+ <caption>
50
+ <para>SVG::Chart::Plot</para>
51
+ </caption>
52
+ </mediaobject><mediaobject>
53
+ <imageobject>
54
+ <imagedata fileref="images/timeseries.svg" format="SVG" />
55
+ </imageobject>
56
+
57
+ <caption>
58
+ <para>SVG::Chart::TimeSeries</para>
59
+ </caption>
60
+ </mediaobject><mediaobject>
61
+ <imageobject>
62
+ <imagedata fileref="images/schedule.svg" format="SVG" />
63
+ </imageobject>
64
+
65
+ <caption>
66
+ <para>SVG::Chart::Schedule</para>
67
+ </caption>
68
+ </mediaobject></para>
69
+ </sect1>
70
+
71
+ <sect1>
72
+ <title>PNGs</title>
73
+
74
+ <para>Here are the icky, bitmapped PNGs. PNG is a beautiful file format,
75
+ don't get me wrong; but it is best for things that vector graphics
76
+ <emphasis>aren't</emphasis> good at, such as pictures.</para>
77
+
78
+ <mediaobject>
79
+ <imageobject>
80
+ <imagedata fileref="images/bar.png" format="PNG" />
81
+ </imageobject>
82
+
83
+ <caption>
84
+ <para>SVG::Chart::Bar</para>
85
+ </caption>
86
+ </mediaobject>
87
+
88
+ <mediaobject>
89
+ <imageobject>
90
+ <imagedata fileref="images/barhorizontal.png" format="PNG" />
91
+ </imageobject>
92
+
93
+ <caption>
94
+ <para>SVG::Chart::BarHorizontal</para>
95
+ </caption>
96
+ </mediaobject>
97
+
98
+ <mediaobject>
99
+ <imageobject>
100
+ <imagedata fileref="images/line.png" format="PNG" />
101
+ </imageobject>
102
+
103
+ <caption>
104
+ <para>SVG::Chart::Line</para>
105
+ </caption>
106
+ </mediaobject>
107
+
108
+ <mediaobject>
109
+ <imageobject>
110
+ <imagedata fileref="images/pie.png" format="PNG" />
111
+ </imageobject>
112
+
113
+ <caption>
114
+ <para>SVG::Chart::Pie</para>
115
+ </caption>
116
+ </mediaobject>
117
+
118
+ <mediaobject>
119
+ <imageobject>
120
+ <imagedata fileref="images/plot.png" format="PNG" />
121
+ </imageobject>
122
+
123
+ <caption>
124
+ <para>SVG::Chart::Plot</para>
125
+ </caption>
126
+ </mediaobject>
127
+
128
+ <mediaobject>
129
+ <imageobject>
130
+ <imagedata fileref="images/timeseries.png" format="PNG" />
131
+ </imageobject>
132
+
133
+ <caption>
134
+ <para>SVG::Chart::TimeSeries</para>
135
+ </caption>
136
+ </mediaobject>
137
+
138
+ <mediaobject>
139
+ <imageobject>
140
+ <imagedata fileref="images/schedule.png" format="PNG" />
141
+ </imageobject>
142
+
143
+ <caption>
144
+ <para>SVG::Chart::Schedule</para>
145
+ </caption>
146
+ </mediaobject>
147
+ </sect1>
148
+ </article>
data/style/common.xsl ADDED
@@ -0,0 +1,37 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
5
+ <xsl:stylesheet
6
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
7
+
8
+ <xsl:template name='get-announce'>
9
+ <xsl:param name='text'/>
10
+ <xsl:if test='contains( $text, "@@" )'>
11
+ <xsl:call-template name='announce-callback'>
12
+ <xsl:with-param name='announcement'><xsl:value-of
13
+ select='substring-before(
14
+ substring-after( $text, "@@" ), "@@" )'/></xsl:with-param>
15
+ </xsl:call-template>
16
+ <xsl:call-template name='get-announce'>
17
+ <xsl:with-param name='text' select='substring-after(
18
+ substring-after( $text, "@@" ), "@@" )'/>
19
+ </xsl:call-template>
20
+ </xsl:if>
21
+ </xsl:template>
22
+
23
+ <xsl:template name='strip-announcements'>
24
+ <xsl:param name='text'/>
25
+ <xsl:choose>
26
+ <xsl:when test='contains( $text, "@@" )'><xsl:value-of
27
+ select='substring-before( $text, "@@" )'/><xsl:call-template
28
+ name='strip-announcements'><xsl:with-param
29
+ name='text'><xsl:value-of
30
+ select='substring-after( substring-after( $text, "@@" ), "@@" )'
31
+ /></xsl:with-param></xsl:call-template></xsl:when>
32
+ <xsl:otherwise>
33
+ <xsl:value-of select='$text'/>
34
+ </xsl:otherwise>
35
+ </xsl:choose>
36
+ </xsl:template>
37
+ </xsl:stylesheet>
@@ -0,0 +1,169 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
5
+ <xsl:stylesheet
6
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
7
+
8
+ <xsl:output indent="yes" method="html"/>
9
+
10
+ <xsl:include href='common.xsl'/>
11
+
12
+ <xsl:param name='version'/>
13
+ <xsl:param name='release'/>
14
+ <xsl:param name='previous'/>
15
+ <xsl:param name='last'/>
16
+
17
+ <xsl:template match='/log'>
18
+ <HTML>
19
+ <HEAD><TITLE>FormsTK Change Log</TITLE></HEAD>
20
+ <BODY>
21
+ <H1 ALIGN='center'>FormsTK Change Log</H1>
22
+ <H2 ALIGN='center'><xsl:value-of select='$release'/> (<xsl:value-of
23
+ select='$version'/>)</H2>
24
+ <H3 ALIGN='center'>Since previous minor release
25
+ (<xsl:value-of select='$previous'/>)
26
+ </H3>
27
+
28
+ <xsl:call-template name='do-executive-summary'>
29
+ <xsl:with-param name='nodeset' select='previous'/>
30
+ </xsl:call-template>
31
+
32
+ <xsl:apply-templates select='previous/logentry[string-length(normalize-space(msg/text())) > 0]'/>
33
+
34
+ <H3 ALIGN='center'>Since last major release
35
+ (<xsl:value-of select='$last'/>)
36
+ </H3>
37
+
38
+ <xsl:call-template name='do-executive-summary'>
39
+ <xsl:with-param name='nodeset' select='last'/>
40
+ </xsl:call-template>
41
+
42
+ <xsl:apply-templates select='last/logentry[string-length(normalize-space(msg/text())) > 0]'/>
43
+ </BODY>
44
+ </HTML>
45
+ </xsl:template>
46
+
47
+ <xsl:template match='versioninfo'>
48
+ <xsl:value-of select='@release'/> (<xsl:value-of select='normalize-space( substring-after( @version, ":" ))'/>)
49
+ <xsl:value-of select='@date'/>
50
+ </xsl:template>
51
+
52
+ <xsl:template match='logentry'>
53
+ <xsl:param name='message'><xsl:call-template
54
+ name='strip-announcements'><xsl:with-param name='text'
55
+ select='msg/text()'/></xsl:call-template></xsl:param>
56
+
57
+ <DIV STYLE='display: block;
58
+ border: 2px solid #444;
59
+ background-color: #ddf;
60
+ margin-bottom: 10px;'>
61
+
62
+ <DIV STYLE='display: block;
63
+ float: right;
64
+ background-color: #DfD;
65
+ margin: 0px;
66
+ padding: 2px;'><xsl:value-of select='date/text()'/></DIV>
67
+ <DIV STYLE='display: block;
68
+ background-color: #DfD;
69
+ margin: 0px;
70
+ padding: 2px;'><xsl:value-of select='@revision'/></DIV>
71
+
72
+ <PRE><xsl:call-template name='word-wrap'><xsl:with-param
73
+ name='T' select='$message'/></xsl:call-template></PRE>
74
+
75
+ <DIV STYLE='display: block;
76
+ background-color: #DfD;
77
+ margin: 0px;
78
+ padding: 2px;'><xsl:value-of select='author/text()'/></DIV>
79
+ </DIV>
80
+ </xsl:template>
81
+
82
+
83
+ <xsl:template name='word-wrap'>
84
+ <xsl:param name='L'/>
85
+ <xsl:param name='T'/>
86
+ <xsl:param name='LL'>80</xsl:param>
87
+ <xsl:variable name="cr" select="'&#xa;'"/>
88
+
89
+ <xsl:variable name='NT' select='normalize-space($T)'/>
90
+ <xsl:variable name='NL' select='normalize-space($L)'/>
91
+ <xsl:variable name='LT' select='concat( $NL, " ", $NT )'/>
92
+
93
+ <xsl:choose>
94
+ <xsl:when test='contains( $L, $cr )'>
95
+ <xsl:value-of
96
+ select='normalize-space(substring-before( $L, $cr ))'/><xsl:text>
97
+ </xsl:text><xsl:call-template name='word-wrap'><xsl:with-param name='T'
98
+ select='concat( substring-after( $L, $cr ), " ",
99
+ $T)'/></xsl:call-template>
100
+ </xsl:when>
101
+ <xsl:otherwise>
102
+ <xsl:choose>
103
+ <xsl:when test='string-length( $NT ) = 0'>
104
+ <xsl:value-of select='normalize-space($L)'/>
105
+ </xsl:when>
106
+ <xsl:when test='string-length(normalize-space(concat( $L, " ",
107
+ substring-before($NT, " ")))) &lt;= $LL'>
108
+ <xsl:choose>
109
+ <xsl:when test='substring-before($T, $cr) =
110
+ substring-before($NT, " ")'>
111
+ <xsl:value-of select='concat($NL, " ",
112
+ substring-before($T, $cr))'/><xsl:text>
113
+ </xsl:text><xsl:call-template name='word-wrap'><xsl:with-param name='T'
114
+ select='substring-after($T, $cr)'/></xsl:call-template>
115
+ </xsl:when>
116
+ <xsl:when test='not( contains( $NT, " " ) )'>
117
+ <xsl:value-of select='normalize-space($LT)'/>
118
+ </xsl:when>
119
+ <xsl:otherwise>
120
+ <xsl:call-template name='word-wrap'><xsl:with-param name='L'
121
+ select='concat($L, " ",
122
+ substring-before($T, " "))'/><xsl:with-param
123
+ name='T' select='substring-after($T, " ")'/></xsl:call-template>
124
+ </xsl:otherwise>
125
+ </xsl:choose>
126
+ </xsl:when>
127
+ <xsl:when test='string-length(normalize-space(concat(
128
+ $L, " ", $NT))) &lt;= $LL'>
129
+ <xsl:value-of select='$LT'/>
130
+ </xsl:when>
131
+ <xsl:otherwise>
132
+ <xsl:value-of select='$NL'/><xsl:text>
133
+ </xsl:text><xsl:call-template name='word-wrap'><xsl:with-param name='T'
134
+ select='$T'/></xsl:call-template>
135
+ </xsl:otherwise>
136
+ </xsl:choose>
137
+ </xsl:otherwise>
138
+ </xsl:choose>
139
+ </xsl:template>
140
+
141
+
142
+ <xsl:template name='announce-callback'>
143
+ <xsl:param name='announcement'/>
144
+ <LI><xsl:value-of select='$announcement'/></LI>
145
+ </xsl:template>
146
+
147
+ <xsl:template name='do-executive-summary'>
148
+ <xsl:param name='nodeset'/>
149
+
150
+ <DIV STYLE='display: block;
151
+ border: 2px solid #444;
152
+ background-color: #EEF;
153
+ margin-bottom: 10px;'>
154
+
155
+ <DIV STYLE='display: block;
156
+ background-color: #ADA;
157
+ margin: 0px;
158
+ padding: 2px;'>Executive Summary</DIV>
159
+
160
+ <UL>
161
+ <xsl:for-each select='$nodeset/logentry[contains(msg/text(), "@@")]'>
162
+ <xsl:call-template name='get-announce'>
163
+ <xsl:with-param name='text' select='msg/text()'/>
164
+ </xsl:call-template>
165
+ </xsl:for-each>
166
+ </UL>
167
+ </DIV>
168
+ </xsl:template>
169
+ </xsl:stylesheet>
@@ -0,0 +1,25 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+
3
+ <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
5
+ <xsl:stylesheet
6
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
7
+
8
+ <xsl:output indent="yes" method="text"/>
9
+
10
+ <xsl:template match='/log'>
11
+ FormsTK Change Log
12
+ <xsl:apply-templates select='logentry[string-length(normalize-space(msg/text())) > 0]'/>
13
+ </xsl:template>
14
+
15
+ <xsl:template match='logentry'>
16
+ <xsl:text>============================================================
17
+ </xsl:text>
18
+ <xsl:value-of select='normalize-space(@revision)'/> (<xsl:value-of select='date/text()'/>) <xsl:value-of select='author/text()'/>
19
+ <xsl:text>
20
+ </xsl:text>
21
+ <xsl:value-of select='msg/text()'/>
22
+ <xsl:text>
23
+ </xsl:text>
24
+ </xsl:template>
25
+ </xsl:stylesheet>
data/svg-graph.gemspec ADDED
@@ -0,0 +1,59 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{svg-graph}
8
+ s.version = "1.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = [%q{Sean Russell}, %q{Claudio Bustos}]
12
+ s.date = %q{2011-08-04}
13
+ s.description = %q{Gem version of SVG:::Graph. SVG:::Graph is a pure Ruby library for generating charts, which are a type of graph where the values of one axis are not scalar. SVG::Graph has a verry similar API to the Perl library SVG::TT::Graph, and the resulting charts also look the same. This isn't surprising, because SVG::Graph started as a loose port of SVG::TT::Graph, although the internal code no longer resembles the Perl original at all.
14
+ }
15
+ s.email = [%q{ser_AT_germane-software.com}, %q{clbustos_AT_gmail.com}]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.markdown",
19
+ "README.txt"
20
+ ]
21
+ s.files = [
22
+ "GPL.txt",
23
+ "History.txt",
24
+ "LICENSE.txt",
25
+ "Manifest.txt",
26
+ "README.txt",
27
+ "Rakefile",
28
+ "lib/SVG/Graph/Bar.rb",
29
+ "lib/SVG/Graph/BarBase.rb",
30
+ "lib/SVG/Graph/BarHorizontal.rb",
31
+ "lib/SVG/Graph/Graph.rb",
32
+ "lib/SVG/Graph/Line.rb",
33
+ "lib/SVG/Graph/Pie.rb",
34
+ "lib/SVG/Graph/Plot.rb",
35
+ "lib/SVG/Graph/Schedule.rb",
36
+ "lib/SVG/Graph/TimeSeries.rb",
37
+ "lib/svggraph.rb",
38
+ "test/test_svg_graph.rb"
39
+ ]
40
+ s.homepage = %q{http://www.germane-software.com/software/SVG/SVG::Graph/}
41
+ s.licenses = [%q{GPL}]
42
+ s.require_paths = [%q{lib}]
43
+ s.rubyforge_project = %q{ruby-statsample}
44
+ s.rubygems_version = %q{1.8.6}
45
+ s.summary = %q{SVG:::Graph is a pure Ruby library for generating charts, which are a type of graph where the values of one axis are not scalar.}
46
+
47
+ if s.respond_to? :specification_version then
48
+ s.specification_version = 3
49
+
50
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
52
+ else
53
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
54
+ end
55
+ else
56
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
57
+ end
58
+ end
59
+