rails_charts 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/rails_charts/base_chart.rb +5 -4
- data/lib/rails_charts/javascript.rb +1 -1
- data/lib/rails_charts/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0db109991186734239f8485f11d19b85bee73432b5e86d1b760d27896da74a3
|
4
|
+
data.tar.gz: 5812049f8bcde1230cd2e287dfe0f975d84f668ecac1ae8da2c8727a73211a14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73b70652d62ae84627231b215ae7b579d68b3fce0d86e10138e74d11754ccda663c0f69385207d678fe80ed3b5b86b8339ab167a567271b51eefab0fecd9f80a
|
7
|
+
data.tar.gz: 8afb7e3df989eacba1441cc521798208b88e8a7d19522085d832d8f8d66d21e4df239e8022f70bc2f9a8e39d028babb1b147585f55781e2177acd2a51bbae446
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Rails Charts
|
2
2
|
|
3
3
|
[![RailsJazz](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/my_other.svg?raw=true)](https://www.railsjazz.com)
|
4
|
+
[![Listed on OpenSource-Heroes.com](https://opensource-heroes.com/badge-v1.svg)](https://opensource-heroes.com/r/railsjazz/rails_charts)
|
5
|
+
|
4
6
|
|
5
7
|
![Charts](docs/all.jpg)
|
6
8
|
|
@@ -511,6 +513,9 @@ You are welcome to contributes. Some open tasks:
|
|
511
513
|
|
512
514
|
`rspec` - to run specs.
|
513
515
|
|
516
|
+
[<img src="https://opensource-heroes.com/svg/embed/railsjazz/rails_charts"
|
517
|
+
/>](https://opensource-heroes.com/r/railsjazz/rails_charts)
|
518
|
+
|
514
519
|
## License
|
515
520
|
|
516
521
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module RailsCharts
|
2
2
|
class BaseChart
|
3
|
-
CHART_JS_PATTERN = /"RAILS_CHART_JS:(
|
3
|
+
CHART_JS_PATTERN = /"RAILS_CHART_JS:((?!RAILS_CHART_JS:).*?):RAILS_CHART_JS_END"/
|
4
4
|
|
5
5
|
using RubyExt
|
6
6
|
|
7
7
|
attr_reader :data, :options, :chart_id, :container_id, :defaults
|
8
|
-
attr_reader :width, :height, :style, :klass, :theme, :locale
|
8
|
+
attr_reader :width, :height, :style, :klass, :theme, :locale, :renderer
|
9
9
|
attr_reader :other_options, :debug
|
10
10
|
attr_reader :vertical
|
11
11
|
|
@@ -22,6 +22,7 @@ module RailsCharts
|
|
22
22
|
@height = options.delete(:height).presence || RailsCharts.options[:height]
|
23
23
|
@theme = options.delete(:theme).presence || RailsCharts.options[:theme]
|
24
24
|
@locale = options.delete(:locale).presence || RailsCharts.options[:locale]
|
25
|
+
@renderer = options.delete(:renderer).presence || RailsCharts.options[:renderer] || "canvas"
|
25
26
|
@klass = options.delete(:class).presence || RailsCharts.options[:class]
|
26
27
|
@style = options.delete(:style).presence || RailsCharts.options[:style]
|
27
28
|
|
@@ -54,7 +55,7 @@ module RailsCharts
|
|
54
55
|
if (!chartDom) { return }
|
55
56
|
|
56
57
|
var lib = ("echarts" in window) ? window.echarts : echarts;
|
57
|
-
var chart = lib.init(chartDom, #{theme.to_json}, { "locale": #{locale.to_json} });
|
58
|
+
var chart = lib.init(chartDom, #{theme.to_json}, { "locale": #{locale.to_json}, "renderer": #{renderer.to_json} });
|
58
59
|
var option = #{option};
|
59
60
|
option && chart.setOption(option);
|
60
61
|
|
@@ -121,4 +122,4 @@ module RailsCharts
|
|
121
122
|
end
|
122
123
|
|
123
124
|
end
|
124
|
-
end
|
125
|
+
end
|
data/lib/rails_charts/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_charts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Kasyanchuk
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
- !ruby/object:Gem::Version
|
270
270
|
version: '0'
|
271
271
|
requirements: []
|
272
|
-
rubygems_version: 3.
|
272
|
+
rubygems_version: 3.4.22
|
273
273
|
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: One more solution to create charts in Ruby on Rails application
|