mountain-goat 0.1.4 → 0.1.5
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/lib/mgflotilla.rb +4 -4
- data/lib/mountain-goat/version.rb +1 -1
- metadata +3 -3
data/lib/mgflotilla.rb
CHANGED
@@ -27,9 +27,9 @@ module MGFlotilla
|
|
27
27
|
def mg_chart(placeholder, series, options = {}, html_options = {})
|
28
28
|
html_options.reverse_merge!({ :js_includes => true, :js_tags => true, :placeholder_tag => true, :placeholder_size => "800x300", :pie_hover => false, :pie_hover_absolute => false })
|
29
29
|
width, height = html_options[:placeholder_size].split("x") if html_options[:placeholder_size].respond_to?(:split)
|
30
|
-
additional_js =
|
30
|
+
additional_js = mg_get_additional_js(placeholder, html_options)
|
31
31
|
|
32
|
-
data, x_is_date, y_is_date =
|
32
|
+
data, x_is_date, y_is_date = mg_series_to_json(series)
|
33
33
|
if x_is_date
|
34
34
|
options[:xaxis] ||= {}
|
35
35
|
options[:xaxis].merge!({ :mode => 'time' })
|
@@ -79,7 +79,7 @@ module MGFlotilla
|
|
79
79
|
end
|
80
80
|
|
81
81
|
private
|
82
|
-
def
|
82
|
+
def mg_series_to_json(series)
|
83
83
|
data_sets = []
|
84
84
|
x_is_date, y_is_date = false, false
|
85
85
|
series.each do |name, values|
|
@@ -116,7 +116,7 @@ module MGFlotilla
|
|
116
116
|
return data_sets.to_json, x_is_date, y_is_date
|
117
117
|
end
|
118
118
|
|
119
|
-
def
|
119
|
+
def mg_get_additional_js(placeholder, options)
|
120
120
|
res = ""
|
121
121
|
if options[:pie_hover]
|
122
122
|
res << <<-EOF
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mountain-goat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Geoffrey Hayes
|