Skip to content

Commit acfddbe

Browse files
committed
Added Readme notes for TkCanvas backend
1 parent 2d2ae9e commit acfddbe

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

Diff for: README.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,26 @@ An advanced plotting library for Ruby.
55

66
It aims to allow you to visualize anything, anywhere with a flexible, extensible, Ruby-like API.
77

8-
# Usage
8+
# Backends
9+
10+
Rubyplot can use different backends to render its plots:
11+
12+
- `magick` Using ImageMagick
13+
- `gr` Using the GR framework
14+
- `tk_canvas` Interactive drawing in a Canvas object using Ruby/Tk
15+
16+
Call `Rubyplot.set_backend` at the start of your program to select
17+
the desired backend.
18+
19+
Pick the desired one:
20+
21+
``` ruby
22+
Rubyplot.set_backend(:magick)
23+
Rubyplot.set_backend(:gr)
24+
Rubyplot.set_backend(:tk_canvas)
25+
```
26+
27+
# Installing GR
928

1029
Install the GR framework from the [website](https://gr-framework.org/c.html).
1130

@@ -17,6 +36,25 @@ export GKS_FONTPATH="/home/sameer/Downloads/gr"
1736
export RUBYPLOT_BACKEND="GR"
1837
```
1938

39+
# Installing Tk
40+
41+
In addition to install the `tk` gem in your project, you need to
42+
install the Tcl/Tk runtime in your system. The instructions depending
43+
on the OS but it is a safe bet to install the Community Edition of
44+
Active Tcl from https://www.activestate.com/
45+
46+
You have more details about installing Tk in different systems in the
47+
excelent [TkDocs](https://tkdocs.com/tutorial/install.html) website.
48+
49+
If you want to have a more modern way of interacting with Tk from
50+
Ruby, you can use
51+
[TkComponent](https://github.com/josepegea/tk_component) and
52+
[TkInspect](https://github.com/josepegea/tk_inspect).
53+
54+
# Examples
55+
56+
See the [examples](./examples) to see some how-to code.
57+
2058
# Short term priorities
2159

2260
Check milestones in GitHub for more information.

Diff for: examples/tk_canvas_wrapper/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ using the TkCanvasWrapper.
66
## Running
77

88
bundle exec tk_plot_demo.rb
9-
9+

Diff for: rubyplot.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Rubyplot::DESCRIPTION = "An advanced plotting library for Ruby."
88
Gem::Specification.new do |spec|
99
spec.name = 'rubyplot'
1010
spec.version = Rubyplot::VERSION
11-
spec.authors = ['Arafat Khan', 'Pranav Garg', 'John Woods', 'Pjotr Prins', 'Sameer Deshmukh']
11+
spec.authors = ['Arafat Khan', 'Pranav Garg', 'John Woods', 'Pjotr Prins', 'Sameer Deshmukh', 'Josep Egea']
1212
spec.email = ['[email protected]'] # add other author ids
1313
spec.summary = %q{An advaced plotting library for Ruby.}
1414
spec.description = Rubyplot::DESCRIPTION

0 commit comments

Comments
 (0)