plasticine 1.1.1 → 1.2.0

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.
@@ -1,12 +1,16 @@
1
1
  module Plasticine::Helpers
2
2
  def d3_include_tag
3
- ('<![if ! lt IE 9]>' + javascript_include_tag("d3") + '<![endif]>').html_safe
3
+ javascript_include_tag("d3")
4
4
  end
5
5
 
6
6
  def column_visual(id, options={})
7
7
  PlasticineTagHelper.new(self, id, options[:from], options[:to], options[:step]).column(options)
8
8
  end
9
9
 
10
+ def line_visual(id, options={})
11
+ PlasticineTagHelper.new(self, id, options[:from], options[:to], options[:step]).line(options)
12
+ end
13
+
10
14
 
11
15
  class PlasticineTagHelper
12
16
  attr_reader :rails_helpers
@@ -36,6 +40,19 @@ module Plasticine::Helpers
36
40
  visual 'column', options
37
41
  end
38
42
 
43
+ def line(options={})
44
+ options.reverse_merge! lines_left_padding: 20, lines_right_padding: 20, lines_margin: 1, y_spacing_ratio: 1.10
45
+
46
+ options[:data] = {
47
+ lines_left_padding: options.delete(:lines_left_padding),
48
+ lines_right_padding: options.delete(:lines_right_padding),
49
+ lines_margin: options.delete(:lines_margin),
50
+ y_spacing_ratio: options.delete(:y_spacing_ratio)
51
+ }
52
+
53
+ visual 'line', options
54
+ end
55
+
39
56
 
40
57
  private
41
58
 
data/plasticine.gemspec CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |gem|
3
3
  gem.description = "Data visualization toolkit for Rails App using D3.js"
4
4
  gem.summary = "Data visualization toolkit for Rails App using D3.js"
5
5
  gem.homepage = "https://github.com/alchimikweb/plasticine"
6
- gem.version = "1.1.1"
6
+ gem.version = "1.2.0"
7
7
  gem.licenses = ["MIT"]
8
8
 
9
9
  gem.authors = ["Sebastien Rosa"]
File without changes
File without changes
File without changes
File without changes