pbosetti-flotr 1.3 → 1.3.1

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.
data/README.markdown ADDED
@@ -0,0 +1,60 @@
1
+ Introduction
2
+ ============
3
+ Flotr (pron.: like "plotter") is a plot/chart facility to be used within Ruby.
4
+
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
+
7
+ Usage
8
+ =====
9
+ The following code produces the flotr.html file located in the root project folder:
10
+
11
+ require "lib/flotr"
12
+ # Create a new plot
13
+ plot = Flotr::Plot.new("Test plot")
14
+
15
+ # Create two empty series
16
+ sin = Flotr::Data.new(:label => "Sin(x)", :color => "red")
17
+ cos = Flotr::Data.new(:label => "Cos(x)", :color => "blue")
18
+
19
+ # Push data into the two series
20
+ 100.times do |i|
21
+ sin.data << [i, Math::sin(Math::PI / 100 * i)]
22
+ cos.data << [i, Math::cos(Math::PI / 100 * i)]
23
+ end
24
+
25
+ plot << sin
26
+ plot << cos
27
+ plot.show
28
+
29
+ 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.
30
+
31
+ The default template (since v1.3) allows zooming the plot. Reload the page to reset to full view.
32
+
33
+ Templates
34
+ =========
35
+ Flotr uses templates for formatting the plots. Currently there are the following templates available:
36
+ 1. interacting: a simple layout that shows point coordinates on mouse hover
37
+ 2. zooming: a smaller overview is added on the right side of the main plot, allowing zooming of different plot areas
38
+
39
+ The current template can be selected as follows (amongst those installed by default):
40
+
41
+ p = Flotr::Plot.new
42
+ p.std_template #=> "zooming"
43
+ p.std_templates #=> ["interacting" , "zooming"]
44
+ p.std_template = "interacting"
45
+ p.std_template #=> "interacting"
46
+
47
+ Custom templates can be selected this way:
48
+
49
+ p.template = "full/path/to/template.rhtml"
50
+
51
+ Look within lib/*.rhtml for template examples. Templates follow the Erubis syntax.
52
+
53
+ Example
54
+ =======
55
+
56
+ ![Obligatory example](http://cloud.github.com/downloads/pbosetti/flotr/plot.png)
57
+
58
+ Thanks to
59
+ =========
60
+ The author of jflot, [Ryan Funduk](http://ryanfunduk.com/flot)
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"
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paolo Bosetti
@@ -32,14 +32,7 @@ extra_rdoc_files: []
32
32
 
33
33
  files:
34
34
  - flotr.rb
35
- - lib/flotr.rb
36
- - lib/excanvas.js
37
- - lib/excanvas.pack.js
38
- - lib/interacting.rhtml
39
- - lib/zooming.rhtml
40
- - lib/jquery.flot.js
41
- - lib/jquery.min.js
42
- - lib/layout.css
35
+ - README.markdown
43
36
  has_rdoc: true
44
37
  homepage: http://github.com/pbosetti/flotr
45
38
  post_install_message: