prawn-graph 1.0.1 → 1.0.2

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: 6390e1f2b56cd0e602ed9bad9f9e79d8bf8d24fd
4
- data.tar.gz: 5a17ad2247533d9a61a26043521e26c7dd21f1f8
3
+ metadata.gz: af7f2dacb03275d7904c31811e51ef3a8da4f632
4
+ data.tar.gz: 0f9c1e3d8d90e91bf8e5c642e9b478a61b003f5d
5
5
  SHA512:
6
- metadata.gz: 18a28570e31af7e7d7dce328cfd1277d50e13c255d47afa015ef3a8fc0e06d76f64e43c726b0c5a67afb885ed2ede934d5f73e7f16d52d18ae8136fabcfbdf5e
7
- data.tar.gz: 8dd7705229fa6450dd46f8a679560299a9feba69a7356f9c7f60e4326e9ba65eade94c5f77cb1d94679477de849cc48da21dbd2ff4355848ad9cb324c14dc8e9
6
+ metadata.gz: e182b1dfc064ed83565aa2abbd0abc06341ad65d89f975b906ed904e76f0d95414ddd6e8c09d24e9ca9b1500c86f1548ea22461280f02c335a473f43db953065
7
+ data.tar.gz: fdb85146ae87527f54d8aa3672502b21df6487a86330f51494ac4eea6a0cae8f0a55963ff5fa137990fb9352937114d1ff411c355fa3cf0398886cb9b2c11ca6
data/README.md CHANGED
@@ -8,11 +8,6 @@
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
-
16
11
  An extension for the [prawn pdf library][5] which adds the ability to draw graphs (or charts if
17
12
  you perfer) in PDF documents.
18
13
 
@@ -43,6 +38,12 @@ We build automatically using Travis CI. Our [.travis.yml][9] file targets the sa
43
38
  Unlike previous versions of `prawn-graph`, this version does not at this time include a theme api or the
44
39
  ability to change the colors used to render the graph.
45
40
 
41
+ ### Removed deprecated methods
42
+
43
+ The `bar_chart`, `line_chart`, `bar_graph`, and `line_graph` methods have been removed. This means that this
44
+ version of prawn-graph is no-longer backwards compatible. If you _must_ use those old methods, then please
45
+ use version `0.9.10` and **upgrade your calls to prawn graph to use the new `graph` methods as soon as possible**.
46
+
46
47
  ## Installation
47
48
 
48
49
  To use prawn-graph, you can add the following to your `Gemfile`:
@@ -13,21 +13,14 @@ module Prawn
13
13
 
14
14
  private
15
15
 
16
- def mark_minimum_value(min_marked, value, x, y)
17
- if @series.mark_minimum? && min_marked == false && value != 0 && value == @series.min
18
- draw_marker_point(@canvas.theme.min, x, y)
19
- min_marked = true
16
+ def apply_marker_to_graph(value_marked, value, x, y, color)
17
+ if @series.mark_maximum? && value_marked == false && value != 0 && value == @series.max
18
+ draw_marker_point(color, x, y)
19
+ value_marked = true
20
20
  end
21
- min_marked
21
+ value_marked
22
22
  end
23
23
 
24
- def mark_maximum_value(max_marked, value, x, y)
25
- if @series.mark_maximum? && max_marked == false && value != 0 && value == @series.max
26
- draw_marker_point(@canvas.theme.max, x, y)
27
- max_marked = true
28
- end
29
- max_marked
30
- end
31
24
 
32
25
  def mark_average_line
33
26
  if @series.mark_average?
@@ -73,10 +66,10 @@ module Prawn
73
66
  prawn.fill_ellipse([ ( this_x_offset), this_y ], 1)
74
67
  end
75
68
 
76
- min_marked = mark_minimum_value(min_marked, previous_value, previous_x_offset, previous_y)
77
- min_marked = mark_minimum_value(min_marked, this_value, this_x_offset, this_y)
78
- max_marked = mark_maximum_value(max_marked, previous_value, previous_x_offset, previous_y)
79
- max_marked = mark_maximum_value(max_marked, this_value, this_x_offset, this_y)
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)
80
73
 
81
74
  j += 1
82
75
  end
@@ -1,5 +1,5 @@
1
1
  module Prawn
2
2
  module Graph
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
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.1
4
+ version: 1.0.2
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-20 00:00:00.000000000 Z
12
+ date: 2016-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler