Skip to content

Commit 34a5f3e

Browse files
committed
add notes on vision and roadmap
1 parent ffc8cad commit 34a5f3e

File tree

5 files changed

+46
-45
lines changed

5 files changed

+46
-45
lines changed

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
# rubyplot
22
An advanced plotting library for Ruby.
33

4-
Rubyplot aims to be the most advanced visualization solution for Rubyists.
4+
**Rubyplot aims to be the most advanced visualization solution for Rubyists.**
5+
It aims to allow you to visualize anything, anywhere with a simple, Ruby-like API.
56

6-
# Roadmap
7+
# Roadmap by priority
8+
The release schedule and feature roadmap is as follows. Check issues labelled with
9+
the version tags for knowing what we're working on currently. Listed by priority.
710

8-
The library in its current form is heavily under development.
11+
## Release v0.1.rc1
12+
Deadline: 15 January 2019
913

10-
Here's the roadmap for rubyplot for the near future. Please write a mail to the sciruby ML
11-
or open an issue if you feel something is amiss:
14+
* Support currently available plots fully with various customization options on Axes.
15+
* Fully automated testing infrastructure. Travis integration with rubocop.
16+
* Create a 'debug mode' for easy debugging.
1217

13-
## Near future
18+
## Release v0.1.rc2
19+
Deadline: 26 February 2019
1420

15-
* Finish integration of rmagick and GR backends.
16-
* Creating an Artist layer on RMagick based on GR Framework (The current
17-
necessary functions are included in GR FunctionClasses file in Rubyplot-GR)
18-
and integrating it with the existing scripting layer.
19-
* Integrate with nmatrix/plures.
20-
* Write tutorials and documentation.
21-
* Addition to events sub-layer in the backend layer.
22-
* Further development of scripting layer for additional features.
23-
* Make new plots on a priority basis. Here's the list: https://github.com/SciRuby/rubyplot/issues/4
21+
* Support multiple Axes on the same Figure.
22+
* Support atleast 3 new kinds of plots.
2423

25-
## Long term
24+
## Release v0.1.rc3
25+
Deadline: 15 April 2019
2626

27-
* Integrate with iruby notebook, daru, statsample, rb-gsl, etc.
28-
* Integrate with red data tools projects like charty, red-chainer, etc.
29-
* Integrate with QT/web front end to provide widget support etc.
27+
* Support atleast 3 new kinds of plots.
28+
* Support Simple Plotting Interface.
29+
* Move from using Ruby Arrays to a typed-array based system.
3030

31+
# Long term vision
32+
Rubyplot's long term vision, by priority:
33+
34+
* Integrate the Rubyplot interface with the GR framework.
35+
* Generate various types of publication quality plots.
36+
* Interactive plotting using QT/GTK.
37+
* Interactive or static plots for web backend.

lib/rubyplot/artist/figure.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def initialize(height: nil, width: nil)
4444
@left_spacing = 0.05
4545
@right_spacing = 0.05
4646
@subplots = nil
47+
@n = 0
4748
setup_default_theme
4849
add_subplots @nrows, @ncols
4950
end
@@ -57,6 +58,13 @@ def add_subplot(nrow, ncol)
5758
end
5859

5960
def write(file_name)
61+
@backend.set_base_image_gradient(
62+
Rubyplot::Color::COLOR_INDEX[@theme_options[:background_colors][0]],
63+
Rubyplot::Color::COLOR_INDEX[@theme_options[:background_colors][1]],
64+
@width,
65+
@height,
66+
@theme_options[:background_direction]
67+
)
6068
@subplots.each { |i| i.each(&:draw) }
6169
@backend.write(file_name)
6270
end
@@ -72,13 +80,6 @@ def setup_default_theme
7280
@theme_options = defaults.merge Themes::CLASSIC_WHITE
7381
@marker_color = @theme_options[:marker_color]
7482
@font_color = @theme_options[:font_color] || @marker_color
75-
@backend.set_base_image_gradient(
76-
Rubyplot::Color::COLOR_INDEX[@theme_options[:background_colors][0]],
77-
Rubyplot::Color::COLOR_INDEX[@theme_options[:background_colors][1]],
78-
@width,
79-
@height,
80-
@theme_options[:background_direction]
81-
)
8283
end
8384
end
8485
# class Figure

lib/rubyplot/backend/magick_wrapper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def draw_text(text,font_color:,font: nil,pointsize:,
5959
@draw.gravity = GRAVITY_MEASURE[gravity] || Magick::ForgetGravity
6060
@draw.stroke stroke
6161
@draw.stroke_antialias true
62+
@draw.text_antialias = true
6263
@draw.rotation = rotation if rotation
6364
@draw.annotate(@base_image, 0,0,x.to_i,y.to_i, text.gsub('%', '%%'))
6465
@draw.rotation = 90.0 if rotation

spec/axes_spec.rb

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
end
2929
end
3030
axes.title = "net earnings in different months."
31+
axes.x_title = "X title"
32+
axes.y_title = "Y title"
3133
axes.x_ticks = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July',
3234
'August', 'September', 'October', 'November', 'December']
3335
end
@@ -153,7 +155,7 @@
153155
end
154156

155157
context "#line!" do
156-
it "makes a simple line plot", focus: true do
158+
it "makes a simple line plot" do
157159
@figure = Rubyplot::Figure.new
158160
axes = @figure.add_subplot 0,0
159161
axes.line! do |p|
@@ -164,24 +166,20 @@
164166
axes.title = "A line graph."
165167
end
166168

167-
it "plots 2 simple lines on the same axes" do
169+
it "plots 2 simple lines on the same axes", focus: true do
168170
@figure = Rubyplot::Figure.new
169171
axes = @figure.add_subplot 0,0
170172
axes.line! do |p|
171-
p.data [20, 23, 19, 8]
173+
p.data [3, 5, 10, 15]
172174
p.label = "Marco"
173175
p.color = :blue
174176
end
175177
axes.line! do |p|
176-
p.data [1, 53, 76, 18]
178+
p.data [1, 9, 13, 28]
177179
p.label = "John"
178180
p.color = :green
179181
end
180182
axes.title = "A line graph."
181-
axes.x_ticks = {
182-
0 => "Ola Ruby",
183-
1 => "Hello Ruby"
184-
}
185183
end
186184

187185
skip "fails to match the reference image" do
@@ -277,7 +275,7 @@
277275
end
278276

279277
context "#bar!" do
280-
it "adds a simple bar plot", focus: true do
278+
it "adds a simple bar plot" do
281279
@figure = Rubyplot::Figure.new
282280
axes = @figure.add_subplot 0,0
283281
axes.bar!(600) do |p|
@@ -323,15 +321,10 @@
323321
axes.title = "Plot with X-Y axes."
324322
axes.x_title = "Score (%)"
325323
axes.y_title = "Students"
326-
axes.x_ticks = {
327-
0 => '5/6',
328-
1 => '5/15',
329-
2 => '5/24',
330-
3 => '5/36'
331-
}
324+
axes.x_ticks = [ '5/6', '5/15', '5/24', '5/36' ]
332325
end
333326

334-
it "adds multiple bar plots for wide graph", focus: true do
327+
it "adds multiple bar plots for wide graph" do
335328
@figure = Rubyplot::Figure.new(height: 400, width: 800)
336329
axes = @figure.add_subplot 0,0
337330
@planet_data.each do |name, nums|
@@ -342,7 +335,7 @@
342335
end
343336
end
344337

345-
skip "plots both positive and negative values" do
338+
it "plots both positive and negative values" do
346339
@figure = Rubyplot::Figure.new
347340
axes = @figure.add_subplot 0,0
348341
axes.bar! do |p|
@@ -362,7 +355,7 @@
362355
}
363356
end
364357

365-
skip "tests negative values" do
358+
it "tests negative values" do
366359
@figure = Rubyplot::Figure.new
367360
axes = @figure.add_subplot 0,0
368361
axes.title = "all negative bar graph."

spec/spec_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def compare_with_reference(test_image, reference_image)
4545
base_image = SPEC_ROOT + TEMP_DIR + plot_name
4646
other_image = SPEC_ROOT + FIXTURES_DIR + plot_name
4747
@figure.write(other_image)
48-
4948
@figure.write(base_image)
5049

5150
expect(base_image).to eq_image(other_image, 10)

0 commit comments

Comments
 (0)