charma 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -1
- data/examples/bar_charts.pdf +19 -1187
- data/examples/bar_charts.rb +3 -2
- data/examples/line_charts.pdf +19 -1171
- data/examples/line_charts.rb +3 -2
- data/examples/shortest.pdf +285 -0
- data/examples/shortest.rb +13 -0
- data/examples/violin_charts.pdf +11 -389
- data/examples/violin_charts.rb +3 -2
- data/lib/charma/bar_chart.rb +0 -1
- data/lib/charma/line_chart.rb +0 -10
- data/lib/charma/page.rb +0 -1
- data/lib/charma/version.rb +1 -1
- data/lib/charma/violin_chart.rb +1 -1
- metadata +3 -1
data/examples/violin_charts.rb
CHANGED
@@ -20,7 +20,7 @@ foobar = SampleMaker.new(20000)
|
|
20
20
|
|
21
21
|
small = SampleMaker.new(6)
|
22
22
|
|
23
|
-
Charma::Document.new
|
23
|
+
Charma::Document.new do |doc|
|
24
24
|
[
|
25
25
|
{
|
26
26
|
title: "Lorem ipsum",
|
@@ -62,4 +62,5 @@ Charma::Document.new{ |doc|
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
65
|
+
doc.render( File.basename(__FILE__, ".*")+".pdf" )
|
66
|
+
end
|
data/lib/charma/bar_chart.rb
CHANGED
data/lib/charma/line_chart.rb
CHANGED
@@ -104,7 +104,6 @@ module Charma
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def render( pdf, rect )
|
107
|
-
stroke_rect(pdf, rect)
|
108
107
|
title_text = @opts[:title]
|
109
108
|
title, main, ticks, bottom = rect.vsplit(
|
110
109
|
(title_text ? 1 : 0),
|
@@ -127,15 +126,6 @@ module Charma
|
|
127
126
|
yvalues = tick_values(:y, yrange)
|
128
127
|
render_yticks(pdf, yticks, yrange, yvalues)
|
129
128
|
render_y_grid(pdf, chart, yrange, yvalues)
|
130
|
-
|
131
|
-
# end
|
132
|
-
# if @opts[:x_ticks]
|
133
|
-
# _, _, xticks = ticks.hsplit(*hratio)
|
134
|
-
# render_xticks(pdf, xticks)
|
135
|
-
# end
|
136
|
-
# yvalues = ytick_values(yrange)
|
137
|
-
# render_yticks(pdf, yticks, yrange, yvalues)
|
138
|
-
# render_y_grid(pdf, chart, yrange, yvalues)
|
139
129
|
end
|
140
130
|
end
|
141
131
|
end
|
data/lib/charma/page.rb
CHANGED
data/lib/charma/version.rb
CHANGED
data/lib/charma/violin_chart.rb
CHANGED
@@ -78,6 +78,7 @@ module Charma
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def render_chart(pdf, rect, yrange)
|
81
|
+
stroke_rect(pdf, rect)
|
81
82
|
y_values = @opts[:series].map{ |s| s[:y] }.transpose
|
82
83
|
bar_areas = rect.hsplit(*Array.new(y_values.size,1))
|
83
84
|
cols = if y_values.first.size==1
|
@@ -93,7 +94,6 @@ module Charma
|
|
93
94
|
|
94
95
|
# BarChart の render とほぼ同じなのでなんとかする
|
95
96
|
def render( pdf, rect )
|
96
|
-
stroke_rect(pdf, rect)
|
97
97
|
title_text = @opts[:title]
|
98
98
|
title, main, ticks, bottom = rect.vsplit(
|
99
99
|
(title_text ? 1 : 0),
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: charma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nabetani
|
@@ -105,6 +105,8 @@ files:
|
|
105
105
|
- examples/line_charts.pdf
|
106
106
|
- examples/line_charts.rb
|
107
107
|
- examples/runall.rb
|
108
|
+
- examples/shortest.pdf
|
109
|
+
- examples/shortest.rb
|
108
110
|
- examples/violin_charts.pdf
|
109
111
|
- examples/violin_charts.rb
|
110
112
|
- lib/charma.rb
|