sparklines 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/MIT-LICENSE +21 -0
- data/Manifest.txt +17 -3
- data/Rakefile +1 -0
- data/lib/sparklines.rb +1 -1
- data/lib/sparklines_helper.rb +18 -0
- data/samples/area-high.png +0 -0
- data/samples/area.png +0 -0
- data/samples/discrete.png +0 -0
- data/samples/pie-large.png +0 -0
- data/samples/pie.png +0 -0
- data/samples/pie0.png +0 -0
- data/samples/pie1.png +0 -0
- data/samples/pie100.png +0 -0
- data/samples/pie45.png +0 -0
- data/samples/pie95.png +0 -0
- data/samples/pie99.png +0 -0
- data/samples/smooth-colored.png +0 -0
- data/samples/smooth.png +0 -0
- data/test/test_all.rb +3 -0
- metadata +18 -4
data/CHANGELOG
CHANGED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2005 Geoffrey Grosenbach boss@topfunky.com
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
data/Manifest.txt
CHANGED
@@ -1,7 +1,21 @@
|
|
1
|
-
|
1
|
+
CHANGELOG
|
2
|
+
MIT-LICENSE
|
2
3
|
Manifest.txt
|
3
4
|
README
|
4
|
-
|
5
|
+
Rakefile
|
5
6
|
lib/sparklines.rb
|
7
|
+
lib/sparklines_helper.rb
|
8
|
+
samples/area-high.png
|
9
|
+
samples/area.png
|
10
|
+
samples/discrete.png
|
11
|
+
samples/pie-large.png
|
12
|
+
samples/pie.png
|
13
|
+
samples/pie0.png
|
14
|
+
samples/pie1.png
|
15
|
+
samples/pie100.png
|
16
|
+
samples/pie45.png
|
17
|
+
samples/pie95.png
|
18
|
+
samples/pie99.png
|
19
|
+
samples/smooth-colored.png
|
20
|
+
samples/smooth.png
|
6
21
|
test/test_all.rb
|
7
|
-
test/output
|
data/Rakefile
CHANGED
@@ -12,6 +12,7 @@ Hoe.new('Sparklines', Sparklines::VERSION) do |p|
|
|
12
12
|
p.summary = "Tiny graphs."
|
13
13
|
p.url = "http://nubyonrails.com/pages/sparklines"
|
14
14
|
p.clean_globs = ['test/output/*']
|
15
|
+
p.changes = "Cleanup project for better compliance with hoe release cycle."
|
15
16
|
|
16
17
|
# * extra_deps - An array of rubygem dependencies.
|
17
18
|
end
|
data/lib/sparklines.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Provides a tag for embedding sparklines graphs into your Rails app.
|
2
|
+
#
|
3
|
+
module SparklinesHelper
|
4
|
+
|
5
|
+
# Call with an array of data and a hash of params for the Sparklines module.
|
6
|
+
#
|
7
|
+
# sparkline_tag [42, 37, 43, 182], :type => 'bar', :line_color => 'black'
|
8
|
+
#
|
9
|
+
# You can also pass :class => 'some_css_class' ('sparkline' by default).
|
10
|
+
def sparkline_tag(results=[], options={})
|
11
|
+
url = { :controller => 'sparklines',
|
12
|
+
:results => results.join(',') }
|
13
|
+
options = url.merge(options)
|
14
|
+
|
15
|
+
%(<img src="#{ url_for options }" class="#{options[:class] || 'sparkline'}" alt="Sparkline Graph" />)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
Binary file
|
data/samples/area.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/samples/pie.png
ADDED
Binary file
|
data/samples/pie0.png
ADDED
Binary file
|
data/samples/pie1.png
ADDED
Binary file
|
data/samples/pie100.png
ADDED
Binary file
|
data/samples/pie45.png
ADDED
Binary file
|
data/samples/pie95.png
ADDED
Binary file
|
data/samples/pie99.png
ADDED
Binary file
|
Binary file
|
data/samples/smooth.png
ADDED
Binary file
|
data/test/test_all.rb
CHANGED
@@ -2,11 +2,14 @@
|
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'lib/sparklines'
|
5
|
+
require 'fileutils'
|
5
6
|
|
6
7
|
class SparklinesTest < Test::Unit::TestCase
|
7
8
|
|
8
9
|
def setup
|
9
10
|
@output_dir = "test/output"
|
11
|
+
FileUtils.mkdir_p(@output_dir)
|
12
|
+
|
10
13
|
@data = %w( 1 5 15 20 30 50 57 58 55 48
|
11
14
|
44 43 42 42 46 48 49 53 55 59
|
12
15
|
60 65 75 90 105 106 107 110 115 120
|
metadata
CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: sparklines
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.4.
|
6
|
+
version: 0.4.3
|
7
7
|
date: 2007-06-15 00:00:00 -07:00
|
8
8
|
summary: Tiny graphs.
|
9
9
|
require_paths:
|
@@ -29,13 +29,27 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Geoffrey Grosenbach
|
31
31
|
files:
|
32
|
-
-
|
32
|
+
- CHANGELOG
|
33
|
+
- MIT-LICENSE
|
33
34
|
- Manifest.txt
|
34
35
|
- README
|
35
|
-
-
|
36
|
+
- Rakefile
|
36
37
|
- lib/sparklines.rb
|
38
|
+
- lib/sparklines_helper.rb
|
39
|
+
- samples/area-high.png
|
40
|
+
- samples/area.png
|
41
|
+
- samples/discrete.png
|
42
|
+
- samples/pie-large.png
|
43
|
+
- samples/pie.png
|
44
|
+
- samples/pie0.png
|
45
|
+
- samples/pie1.png
|
46
|
+
- samples/pie100.png
|
47
|
+
- samples/pie45.png
|
48
|
+
- samples/pie95.png
|
49
|
+
- samples/pie99.png
|
50
|
+
- samples/smooth-colored.png
|
51
|
+
- samples/smooth.png
|
37
52
|
- test/test_all.rb
|
38
|
-
- test/output
|
39
53
|
test_files:
|
40
54
|
- test/test_all.rb
|
41
55
|
rdoc_options:
|