pbosetti-flotr 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.markdown +18 -6
  2. data/lib/flotr.rb +1 -1
  3. metadata +1 -1
data/README.markdown CHANGED
@@ -4,11 +4,22 @@ Flotr (pron.: like "plotter") is a plot/chart facility to be used within Ruby.
4
4
 
5
5
  It is intended to be as portable as possible, and is thus aimed to generate HTML plots thanks to the great [flot library](http://ryanfunduk.com/flot).
6
6
 
7
+ Installation
8
+ ============
9
+ First, you have to be sure to have the Github repository added to your rubygems configuration. This step only has to be performed the first time you install a gem hosted on Github:
10
+
11
+ gem sources -a http://gems.github.com
12
+
13
+ Next, simply install the gem:
14
+
15
+ sudo gem install pbosetti-flotr
16
+
7
17
  Usage
8
18
  =====
9
- The following code produces the flotr.html file located in the root project folder:
19
+ The following code produces the `flotr.html` file located in the current folder:
10
20
 
11
- require "lib/flotr"
21
+ require "rubygems"
22
+ require "flotr"
12
23
  # Create a new plot
13
24
  plot = Flotr::Plot.new("Test plot")
14
25
 
@@ -25,15 +36,16 @@ The following code produces the flotr.html file located in the root project fold
25
36
  plot << sin << cos
26
37
  plot.show
27
38
 
28
- At the moment, the Flotr::Plot.plot method automatically opens the plot within a browser window under OS X and Windows. On other platforms (Linux) you have to open the generated file by hands.
39
+ At the moment, the `Flotr::Plot.show` method automatically opens the plot within a browser window under OS X and Windows. On other platforms (Linux) you have to open the generated file by hands.
29
40
 
30
41
  The default template (since v1.3) allows zooming the plot. Reload the page to reset to full view.
31
42
 
32
43
  Templates
33
44
  =========
34
45
  Flotr uses templates for formatting the plots. Currently there are the following templates available:
35
- 1. interacting: a simple layout that shows point coordinates on mouse hover
36
- 2. zooming: a smaller overview is added on the right side of the main plot, allowing zooming of different plot areas
46
+
47
+ 1. `interacting`: a simple layout that shows point coordinates on mouse hover
48
+ 2. `zooming`: a smaller overview is added on the right side of the main plot, allowing zooming of different plot areas
37
49
 
38
50
  The current template can be selected as follows (amongst those installed by default):
39
51
 
@@ -47,7 +59,7 @@ Custom templates can be selected this way:
47
59
 
48
60
  p.template = "full/path/to/template.rhtml"
49
61
 
50
- Look within lib/*.rhtml for template examples. Templates follow the Erubis syntax.
62
+ Look within `lib/*.rhtml` for template examples. Templates follow the Erubis syntax.
51
63
 
52
64
  Example
53
65
  =======
data/lib/flotr.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  # reserved.
6
6
  require "rubygems"
7
7
  require "erubis"
8
- require "CGI"
8
+ require "cgi"
9
9
 
10
10
  class String
11
11
  def escapeHTML
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pbosetti-flotr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paolo Bosetti