rgviz-rails 0.57 → 0.58
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rgviz_rails/view_helper.rb +9 -6
- metadata +3 -3
@@ -4,8 +4,10 @@ module Rgviz
|
|
4
4
|
def get_package(name)
|
5
5
|
down = name.downcase
|
6
6
|
case down
|
7
|
-
when '
|
8
|
-
|
7
|
+
when 'areachart', 'barchart', 'bubblechart', 'candlestickchart',
|
8
|
+
'columnchart', 'combochart', 'linechart', 'piechart',
|
9
|
+
'scatterchart', 'steppedareachart' then 'corechart'
|
10
|
+
else down
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
@@ -20,6 +22,7 @@ module Rgviz
|
|
20
22
|
hidden = options[:hidden]
|
21
23
|
extensions = options[:extensions]
|
22
24
|
conditions = options[:conditions]
|
25
|
+
package = options[:package]
|
23
26
|
|
24
27
|
rgviz_events, google_events = events.partition{|x| x[0].to_s.start_with? 'rgviz'}
|
25
28
|
rgviz_events = rgviz_events.inject(Hash.new){|h, y| h[y[0]] = y[1]; h}
|
@@ -149,12 +152,12 @@ module Rgviz
|
|
149
152
|
|
150
153
|
if !options.has_key?(:load_package) || options[:load_package]
|
151
154
|
# Load visualizations and the package, if not already loaded
|
152
|
-
|
155
|
+
package ||= get_package(kind)
|
153
156
|
|
154
157
|
@packages ||= []
|
155
|
-
unless @packages.include?(
|
156
|
-
out << "google.load(\"visualization\", \"1\", {'packages':['#{
|
157
|
-
@packages <<
|
158
|
+
unless @packages.include?(package)
|
159
|
+
out << "google.load(\"visualization\", \"1\", {'packages':['#{package}']});\n"
|
160
|
+
@packages << package
|
158
161
|
end
|
159
162
|
end
|
160
163
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgviz-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.58'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-26 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rgviz
|
16
|
-
requirement: &
|
16
|
+
requirement: &70259916198240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70259916198240
|
25
25
|
description:
|
26
26
|
email: aborenszweig@manas.com.ar
|
27
27
|
executables: []
|