quacky-charts 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -12
- data/lib/quacky/pie_chart_builder.rb +10 -0
- data/lib/{quacky-charts → quacky}/version.rb +1 -1
- data/lib/quacky-charts.rb +9 -8
- data/quacky-charts.gemspec +1 -1
- metadata +3 -2
data/README.md
CHANGED
@@ -6,34 +6,30 @@ QuackyCharts is a graphing gem I'm working on. The goal is to easily create cha
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
|
9
|
+
gem 'quacky-charts'
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
13
|
-
|
13
|
+
$ bundle
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
$ gem install quacky-charts
|
18
|
-
|
19
|
-
Install the needed JS files
|
15
|
+
Run this command to install the needed JS files:
|
20
16
|
|
21
17
|
$ rails generate quacky:install
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
21
|
+
Add these lines to app/assets/javascripts/application.js:
|
26
22
|
|
27
23
|
//= require d3.v2.min
|
28
24
|
//= require pie_charts.js
|
29
25
|
|
30
|
-
|
26
|
+
and to the controller:
|
31
27
|
|
32
|
-
@
|
28
|
+
@chart = QuackyC::PieChartBuilder.new
|
33
29
|
|
34
|
-
|
30
|
+
and finally, in the view:
|
35
31
|
|
36
|
-
<%= @
|
32
|
+
<%= @chart.draw %>
|
37
33
|
|
38
34
|
## Contributing
|
39
35
|
|
data/lib/quacky-charts.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
require "quacky
|
2
|
-
|
3
|
-
|
4
|
-
module QuackyCharts
|
5
|
-
class Builder
|
1
|
+
require "quacky/version"
|
2
|
+
require "quacky/pie_chart_builder"
|
6
3
|
|
7
|
-
|
8
|
-
content_tag(:div, nil, :class => 'pie-chart')
|
9
|
-
end
|
4
|
+
include ActionView::Helpers::TagHelper
|
10
5
|
|
6
|
+
module Quacky
|
7
|
+
|
8
|
+
# return a content tag that can be selected by the client-side, and drawn on
|
9
|
+
def draw
|
10
|
+
content_tag(:div, nil, :class => 'pie-chart')
|
11
11
|
end
|
12
|
+
|
12
13
|
end
|
data/quacky-charts.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quacky-charts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -27,7 +27,8 @@ files:
|
|
27
27
|
- lib/generators/quacky/templates/d3.v2.min.js
|
28
28
|
- lib/generators/quacky/templates/pie_charts.js
|
29
29
|
- lib/quacky-charts.rb
|
30
|
-
- lib/quacky
|
30
|
+
- lib/quacky/pie_chart_builder.rb
|
31
|
+
- lib/quacky/version.rb
|
31
32
|
- quacky-charts.gemspec
|
32
33
|
homepage: ''
|
33
34
|
licenses: []
|