rails_charts 0.0.5 → 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: c53d42b8e9c6d5e80a79cb661c49d9d2e62b9ceb391dbc6ade050ca37991584d
4
- data.tar.gz: ef96a672ec278a563147a3329a680376825cd289fae535c7abc6be6828d6e05e
3
+ metadata.gz: e0db109991186734239f8485f11d19b85bee73432b5e86d1b760d27896da74a3
4
+ data.tar.gz: 5812049f8bcde1230cd2e287dfe0f975d84f668ecac1ae8da2c8727a73211a14
5
5
  SHA512:
6
- metadata.gz: f70838bdbc3be64442826252e373cb37d3851d7a7782b3b157aa2923170651ba363cd6462f0194b0dab5d4b4753c63340b26c4e6ff893bc076a36ec51b984618
7
- data.tar.gz: 1e8729d5c90e81236d3be3f0f5832767782865f50d6ac962a5c06c5a5a309424ebdeb03c9e4b617892e44eacedbc881ba4d85ebd49429488e3e24a02f7e16d57
6
+ metadata.gz: 73b70652d62ae84627231b215ae7b579d68b3fce0d86e10138e74d11754ccda663c0f69385207d678fe80ed3b5b86b8339ab167a567271b51eefab0fecd9f80a
7
+ data.tar.gz: 8afb7e3df989eacba1441cc521798208b88e8a7d19522085d832d8f8d66d21e4df239e8022f70bc2f9a8e39d028babb1b147585f55781e2177acd2a51bbae446
data/README.md CHANGED
@@ -513,6 +513,9 @@ You are welcome to contributes. Some open tasks:
513
513
 
514
514
  `rspec` - to run specs.
515
515
 
516
+ [<img src="https://opensource-heroes.com/svg/embed/railsjazz/rails_charts"
517
+ />](https://opensource-heroes.com/r/railsjazz/rails_charts)
518
+
516
519
  ## License
517
520
 
518
521
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -5,7 +5,7 @@ module RailsCharts
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.5"
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.5
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: 2023-04-05 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.4.8
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