prawn-graph 1.0.3 → 1.0.4

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
  SHA1:
3
- metadata.gz: cd018a8cdcb6cd24889db1254665dbd84623ba36
4
- data.tar.gz: 9d4e41276c8ba84f1b280517cffebcb2c30c9410
3
+ metadata.gz: 48595c4b07bae03905c3f1884ea25c7940793669
4
+ data.tar.gz: d64af98709158716e5130bcd278ad5c5b783fdcb
5
5
  SHA512:
6
- metadata.gz: 70e6bb7ca34bbe7c843e19f700fe14ba4b998c39ba0f65401d5c508a8a665eb73834dbecf4b6f7675921427e01ce39d755c6993256b95ecbf06f5d3e377aeab0
7
- data.tar.gz: d5b799cb11c5e1f528dc1cbdb67c19e2f921345ffc947a8da714fbc3f7e4543f99284ca5cfa6ca1e9d2642feb70124a7e3a68150beb18ecc97e8f4b0c3e26b37
6
+ metadata.gz: 3f4551d1a9c008ab92462af6b261c25db9b9ec8fd6d9ba4fd1b0fde0602ae2d67a14e05f2760d1e1b34bf7c8d07727c133e0931a4d40d39444790ac6e739b94a
7
+ data.tar.gz: 3da90cd7612b627883d015ca24c2cf4b7b59a4e3274ae2e52f1b3fb6d279b70aa43837059e1ebd18b4bac09c6eee0e53c5d57a1c55ec101f0ea94dbe83801715
@@ -15,3 +15,4 @@ before_install: gem install bundler -v 1.11.2
15
15
  addons:
16
16
  code_climate:
17
17
  repo_token: 9646aae52d1d1670d545c46bd94f5d86b92d516c5e3cb9890fcef62acc3a34b6
18
+ after_script: codeclimate-test-reporter
@@ -3,4 +3,5 @@ Past and present direct and indirect contributors to prawn-graph
3
3
 
4
4
  * Ryan Stenhouse <https://github.com/hhry>
5
5
  * Roger Nesbitt <https://github.com/mogest>
6
- * S. Hessam M. Mehr <https://github.com/hessammehr>
6
+ * S. Hessam M. Mehr <https://github.com/hessammehr>
7
+ * Randall Fulton <https://github.com/randall-fulton>
data/README.md CHANGED
@@ -8,6 +8,11 @@
8
8
  [![security](https://hakiri.io/github/HHRy/prawn-graph/master.svg)](https://hakiri.io/github/HHRy/prawn-graph/master)
9
9
  ![Maintained: yes](https://img.shields.io/badge/maintained-yes-brightgreen.png)
10
10
 
11
+ **This readme reflects the state of _master_ which is not the released version of prawn-graph.**
12
+
13
+ **The code being used to cut gems for release is the `stable` Branch, please make pull requests for**
14
+ **bug fixes from that branch.**
15
+
11
16
  An extension for the [prawn pdf library][5] which adds the ability to draw graphs (or charts if
12
17
  you perfer) in PDF documents.
13
18
 
@@ -44,6 +49,7 @@ The `bar_chart`, `line_chart`, `bar_graph`, and `line_graph` methods have been r
44
49
  version of prawn-graph is no-longer backwards compatible. If you _must_ use those old methods, then please
45
50
  use version `0.9.10` and **upgrade your calls to prawn graph to use the new `graph` methods as soon as possible**.
46
51
 
52
+
47
53
  ## Installation
48
54
 
49
55
  To use prawn-graph, you can add the following to your `Gemfile`:
@@ -1,6 +1,7 @@
1
1
  require "ostruct"
2
2
  require "bigdecimal"
3
3
  require "prawn"
4
+ require "prawn_shapes"
4
5
  require "prawn/graph/version"
5
6
  require "prawn/graph/calculations"
6
7
 
@@ -14,7 +14,7 @@ module Prawn
14
14
  private
15
15
 
16
16
  def apply_marker_to_graph(value_marked, value, x, y, color)
17
- if value_marked == false && value != 0 && value == @series.max
17
+ if @series.mark_maximum? && value_marked == false && value != 0 && value == @series.max
18
18
  draw_marker_point(color, x, y)
19
19
  value_marked = true
20
20
  end
@@ -66,15 +66,10 @@ module Prawn
66
66
  prawn.fill_ellipse([ ( this_x_offset), this_y ], 1)
67
67
  end
68
68
 
69
- if @series.mark_minimum?
70
- min_marked = apply_marker_to_graph(min_marked, previous_value, previous_x_offset, previous_y, @canvas.theme.min)
71
- min_marked = apply_marker_to_graph(min_marked, this_value, this_x_offset, this_y, @canvas.theme.min)
72
- end
73
-
74
- if @series.mark_maximum?
75
- max_marked = apply_marker_to_graph(max_marked, previous_value, previous_x_offset, previous_y, @canvas.theme.max)
76
- max_marked = apply_marker_to_graph(max_marked, this_value, this_x_offset, this_y, @canvas.theme.max)
77
- end
69
+ min_marked = apply_marker_to_graph(min_marked, previous_value, previous_x_offset, previous_y, @canvas.theme.min)
70
+ min_marked = apply_marker_to_graph(min_marked, this_value, this_x_offset, this_y, @canvas.theme.min)
71
+ max_marked = apply_marker_to_graph(max_marked, previous_value, previous_x_offset, previous_y, @canvas.theme.max)
72
+ max_marked = apply_marker_to_graph(max_marked, this_value, this_x_offset, this_y, @canvas.theme.max)
78
73
 
79
74
  j += 1
80
75
  end
@@ -68,7 +68,7 @@ module Prawn
68
68
  def add_y_axis_label(value)
69
69
  unless value.zero?
70
70
  y = (point_height_percentage(value) * @plot_area_height)
71
- prawn.text_box "#{max}", at: [-14, y], height: 5, overflow: :shrink_to_fit, width: 12, valign: :bottom, align: :right
71
+ prawn.text_box "#{value}", at: [-14, y], height: 5, overflow: :shrink_to_fit, width: 12, valign: :bottom, align: :right
72
72
  end
73
73
  end
74
74
 
@@ -1,5 +1,5 @@
1
1
  module Prawn
2
2
  module Graph
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
@@ -35,6 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.required_ruby_version = '>= 2.0.0'
36
36
 
37
37
  spec.add_runtime_dependency "prawn", ">= 0.11.1", "< 3"
38
+ spec.add_runtime_dependency "prawn_shapes", ">= 1.2", "< 2"
39
+
38
40
 
39
41
  spec.metadata = {
40
42
  "issue_tracker" => "https://github.com/HHRy/prawn-graph/issues",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stenhouse
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-07-21 00:00:00.000000000 Z
12
+ date: 2016-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -115,6 +115,26 @@ dependencies:
115
115
  - - "<"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '3'
118
+ - !ruby/object:Gem::Dependency
119
+ name: prawn_shapes
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '1.2'
125
+ - - "<"
126
+ - !ruby/object:Gem::Version
127
+ version: '2'
128
+ type: :runtime
129
+ prerelease: false
130
+ version_requirements: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '1.2'
135
+ - - "<"
136
+ - !ruby/object:Gem::Version
137
+ version: '2'
118
138
  description: Prawn::Graph adds straightforward native graph drawing to Prawn without
119
139
  the need to depend on anything else. All generated graphs are pure PDF Vector Images.
120
140
  It results in smaller document sizes and less complication.
@@ -178,4 +198,3 @@ signing_key:
178
198
  specification_version: 4
179
199
  summary: Easily add graphs to Prawn PDF documents
180
200
  test_files: []
181
- has_rdoc: