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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f624c9ad155015b47d5bb2f4e7ede4253c9c56cbcc872cb03279f5be9210b427
4
- data.tar.gz: e1bca3b0812cadf060220514186764188742e6f6d8d87b2ac9db07325c32eb10
3
+ metadata.gz: e0db109991186734239f8485f11d19b85bee73432b5e86d1b760d27896da74a3
4
+ data.tar.gz: 5812049f8bcde1230cd2e287dfe0f975d84f668ecac1ae8da2c8727a73211a14
5
5
  SHA512:
6
- metadata.gz: c0e5933e814a589621025f45d169417a8aeaa8da44cb2c00bbcde2175f5c24ff38ebc15f5fc464b203c3c13ca0e52e724ca8e7264e26cdc8bc5784981d01d557
7
- data.tar.gz: 18e131a0526afc482ec562a5f283f2b6f81fa93ed6b59320594f7ac6094fd862ca22be2bdb29d0f7f466ba6c9a1581c3bd2b238d9609d8abb08aa709dc089ed6
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:(.*):RAILS_CHART_JS_END"/
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
@@ -6,7 +6,7 @@ module RailsCharts
6
6
  @code = code
7
7
  end
8
8
 
9
- def as_json(attrs)
9
+ def as_json(options = nil)
10
10
  "RAILS_CHART_JS:#{Base64.strict_encode64(code)}:RAILS_CHART_JS_END"
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module RailsCharts
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
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
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: 2022-10-19 00:00:00.000000000 Z
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.2.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