squid 1.0.0.beta4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +1 -1
- data/README.md +8 -101
- data/Rakefile +0 -11
- data/examples/{screenshots/readme_01.png → readme.png} +0 -0
- data/lib/squid/version.rb +1 -1
- metadata +5 -45
- data/examples/readme/01-basic.rb +0 -5
- data/examples/readme/02-type-point.rb +0 -5
- data/examples/readme/03-type-line.rb +0 -5
- data/examples/readme/04-color.rb +0 -5
- data/examples/readme/05-gridlines.rb +0 -5
- data/examples/readme/06-ticks.rb +0 -5
- data/examples/readme/07-baseline.rb +0 -5
- data/examples/readme/08-every.rb +0 -5
- data/examples/readme/09-legend.rb +0 -5
- data/examples/readme/10-legend-offset.rb +0 -5
- data/examples/readme/11-format.rb +0 -5
- data/examples/readme/12-labels.rb +0 -5
- data/examples/readme/13-border.rb +0 -5
- data/examples/readme/14-height.rb +0 -5
- data/examples/readme/15-multiple-columns.rb +0 -5
- data/examples/readme/16-multiple-stacks.rb +0 -5
- data/examples/readme/17-singular-options.rb +0 -5
- data/examples/readme/18-plural-options.rb +0 -5
- data/examples/readme/19-two-axis.rb +0 -5
- data/examples/readme/readme.rb +0 -30
- data/examples/readme.rb +0 -7
- data/examples/screenshots/readme_00.png +0 -0
- data/examples/screenshots/readme_02.png +0 -0
- data/examples/screenshots/readme_03.png +0 -0
- data/examples/screenshots/readme_04.png +0 -0
- data/examples/screenshots/readme_05.png +0 -0
- data/examples/screenshots/readme_06.png +0 -0
- data/examples/screenshots/readme_07.png +0 -0
- data/examples/screenshots/readme_08.png +0 -0
- data/examples/screenshots/readme_09.png +0 -0
- data/examples/screenshots/readme_10.png +0 -0
- data/examples/screenshots/readme_11.png +0 -0
- data/examples/screenshots/readme_12.png +0 -0
- data/examples/screenshots/readme_13.png +0 -0
- data/examples/screenshots/readme_14.png +0 -0
- data/examples/screenshots/readme_15.png +0 -0
- data/examples/screenshots/readme_16.png +0 -0
- data/examples/screenshots/readme_17.png +0 -0
- data/examples/screenshots/readme_18.png +0 -0
- data/examples/screenshots/readme_19.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb7adb69f44a7ea7f14d6fd37978e93c0fdeb880
|
4
|
+
data.tar.gz: bc57c30c7eff1cfa811dd81b965e23fb5a058bfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc98af60cfceca88f7de615fa00f46dc792bd4b2c1df6ac2cce16392b3ceb1df5c6a912300abdec004e7d963945f154412eec81e8ceb3606ea832dfe7e322886
|
7
|
+
data.tar.gz: 0937cd2ca8cdbfd064e955b9a50cb1178823f97174088f99a7bf6b2519094fc3901e70b2e8208c528d0651a25b74e7ae0734b7232ec845ef8493eeeb6b0c739c
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,6 @@ For more information about changelogs, check
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
|
-
## 1.0.0 -
|
9
|
+
## 1.0.0 - 2015.08.31
|
10
10
|
|
11
11
|
* [FEATURE] Add `chart` method to Prawn::Document to draw graphs.
|
data/README.md
CHANGED
@@ -26,107 +26,16 @@ data = {views: {2013 => 182, 2014 => 46, 2015 => 134}}
|
|
26
26
|
chart data
|
27
27
|
```
|
28
28
|
|
29
|
-
![01-basic](https://raw.githubusercontent.com/fullscreen/squid/master/examples/
|
29
|
+
![01-basic](https://raw.githubusercontent.com/fullscreen/squid/master/examples/readme.png "chart(data)")
|
30
30
|
|
31
|
+
A comprehensive guide to Squid options
|
32
|
+
======================================
|
31
33
|
|
32
|
-
|
33
|
-
-------------
|
34
|
+
All the settings available for the `chart` method are detailed on the [Squid homepage](http://fullscreen.github.io/squid):
|
34
35
|
|
35
|
-
|
36
|
+
[![Squid homepage](https://cloud.githubusercontent.com/assets/7408595/9561009/3a333b1c-4de8-11e5-9eeb-0c45649e41b7.png)](http://fullscreen.github.io/squid)
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
##### `:type` sets the type of graph. Can be `:column` (default), `:point`, or `:line`.
|
40
|
-
|
41
|
-
![02-type-point](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_02.png "chart(data, type: :point)")
|
42
|
-
|
43
|
-
##### `:line_width` changes the line width (default: `3`, only applies to line graphs).
|
44
|
-
|
45
|
-
![03-type-line](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_03.png "chart(data, type: :line, line_width: 10)")
|
46
|
-
|
47
|
-
##### `:color` changes the color of the chart (default: `'2e578c'`).
|
48
|
-
|
49
|
-
![04-colors](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_04.png "chart(data, colors: ['5d9648'])")
|
50
|
-
|
51
|
-
##### `:steps` changes the number of gridlines (default: `4`).
|
52
|
-
|
53
|
-
![05-gridlines](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_05.png "chart(data, steps: 6)")
|
54
|
-
|
55
|
-
##### `:ticks` shows/hides the ticks between the baseline and each category (default: `true`).
|
56
|
-
|
57
|
-
![06-ticks](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_06.png "chart(data, ticks: false)")
|
58
|
-
|
59
|
-
##### `:baseline` shows/hides the baseline (default: `true`).
|
60
|
-
|
61
|
-
![07-baseline](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_07.png "chart(data, baseline: false)")
|
62
|
-
|
63
|
-
##### `:every` specifies how often to show category labels on the baseline (default: `1`).
|
64
|
-
|
65
|
-
![08-every](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_08.png "chart(data, every: 2)")
|
66
|
-
|
67
|
-
##### `:legend` shows/hides the legend (default: `true`).
|
68
|
-
|
69
|
-
![09-legend](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_09.png "chart(data, legend: false)")
|
70
|
-
|
71
|
-
##### `:legend` can also set the right and bottom margins of the legend (default: `{right: 0, bottom: 15}`).
|
72
|
-
|
73
|
-
![10-legend-offset](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_10.png "chart(data, legend: {right: 50})")
|
74
|
-
|
75
|
-
##### `:format` changes the format of the axis labels. Can be `:integer` (default), `:float`, `:percentage`, `:currency`, or `:seconds`.
|
76
|
-
|
77
|
-
![11-format](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_11.png "chart(data, format: :percentage)")
|
78
|
-
|
79
|
-
##### `:label` shows/hides the value for each point in the graph (default: `false`).
|
80
|
-
|
81
|
-
![12-label](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_12.png "chart(data, label: true)")
|
82
|
-
|
83
|
-
##### `:border` shows/hides a border around the graph (default: `false`).
|
84
|
-
|
85
|
-
![13-border](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_13.png "chart(data, border: true)")
|
86
|
-
|
87
|
-
##### `:height` changes the height of the graph (default: `250`).
|
88
|
-
|
89
|
-
![14-height](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_14.png "chart(data, height: 150)")
|
90
|
-
|
91
|
-
Multiple series
|
92
|
-
---------------
|
93
|
-
|
94
|
-
By providing multiple key/values `data` to the `chart` method, you can plot multiple series on a graph.
|
95
|
-
|
96
|
-
For instance, the following code generates the graph below:
|
97
|
-
|
98
|
-
```ruby
|
99
|
-
data = {safari: {2013 => 43.2, 2014 => 46.1, 2015 => 50.7},
|
100
|
-
firefox: {2013 => 56.8, 2014 => 53.9, 2015 => 49.3}}
|
101
|
-
chart data, labels: true, format: :percentage
|
102
|
-
```
|
103
|
-
|
104
|
-
![15-multiple-columns](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_15.png "chart(data, label: true, format: :percentage)")
|
105
|
-
|
106
|
-
When plotting multiple series, the option `type: :stack` can be set to display stacked columns:
|
107
|
-
|
108
|
-
![16-multiple-stacks](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_16.png "chart(data, type: :stack, format: :percentage)")
|
109
|
-
|
110
|
-
Any value set for the `:color`, `:format`, `:line_width` and `:label` options will be applied to the first series only:
|
111
|
-
|
112
|
-
![17-singular-options](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_17.png "chart data, type: :line, color: '6f3d79', format: :percentage, line_width: 0.5, label: true")
|
113
|
-
|
114
|
-
To customize each series, use the _plural_ options `:colors`, `:formats`, `:line_widths` and `:labels` instead:
|
115
|
-
|
116
|
-
![18-plural-options](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_18.png "chart data, type: :line, colors: ['6f3d79', '7d807f'], formats: [:percentage, :percentage], line_widths: [0.5, 6], labels: [true, true]")
|
117
|
-
|
118
|
-
|
119
|
-
Finally, the option `type: :two_axis` can be set to display two separate axes in your series belong to two different domains.
|
120
|
-
|
121
|
-
For instance, the following code generates the graph below:
|
122
|
-
|
123
|
-
```ruby
|
124
|
-
data = {views: {2013 => 182, 2014 => 46, 2015 => 88},
|
125
|
-
earnings: {2013 => 104_323, 2014 => 27_234, 2015 => 14_123}}
|
126
|
-
chart data, type: :two_axis
|
127
|
-
```
|
128
|
-
|
129
|
-
![19-two-axis](https://raw.githubusercontent.com/fullscreen/squid/master/examples/screenshots/readme_19.png "chart(data, type: :two_axis)")
|
38
|
+
Please proceed to [http://fullscreen.github.io/squid](http://fullscreen.github.io/squid) for more details and examples.
|
130
39
|
|
131
40
|
How to install
|
132
41
|
==============
|
@@ -134,7 +43,7 @@ How to install
|
|
134
43
|
Squid requires **Ruby 2.1 or higher**.
|
135
44
|
If used in a Rails project, requires **Rails 4.0 or higher**.
|
136
45
|
|
137
|
-
To include in your project, add `gem 'squid', github: 'fullscreen/squid'` to the `Gemfile` file of your Ruby project.
|
46
|
+
To include in your project, add `gem 'squid, ~> 1.0', github: 'fullscreen/squid'` to the `Gemfile` file of your Ruby project.
|
138
47
|
|
139
48
|
How to generate the manual
|
140
49
|
==========================
|
@@ -145,9 +54,7 @@ How to contribute
|
|
145
54
|
=================
|
146
55
|
|
147
56
|
If you’ve made it this far in the README… thanks! :v:
|
148
|
-
|
149
|
-
I’m about to release version 1 of this gem.
|
150
|
-
Feel free to try it out and send issues or pull requests.
|
57
|
+
Feel free to try it the gem, explore the code, and send issues or pull requests.
|
151
58
|
|
152
59
|
All pull requests will have to make Travis and Code Climate happy in order to be accepted. :kissing_smiling_eyes:
|
153
60
|
|
data/Rakefile
CHANGED
@@ -7,17 +7,6 @@ task :manual do
|
|
7
7
|
puts 'DONE!'
|
8
8
|
end
|
9
9
|
|
10
|
-
desc 'Generate the readme'
|
11
|
-
task :readme do
|
12
|
-
print 'Building readme... '
|
13
|
-
require_relative 'examples/readme'
|
14
|
-
print 'Extracting screenshots...'
|
15
|
-
# Note: images 17, 18 and 19 need to be cropped at 309 (not 280) because they have more code
|
16
|
-
`convert -density 175 -colorspace sRGB readme.pdf -resize 50% -quality 100 -crop 744x320+0+280 examples/screenshots/readme_%02d.png`
|
17
|
-
puts 'DONE!'
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
10
|
require "rspec/core/rake_task"
|
22
11
|
require "rspec/core/version"
|
23
12
|
|
File without changes
|
data/lib/squid/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prawn
|
@@ -140,47 +140,7 @@ files:
|
|
140
140
|
- bin/console
|
141
141
|
- bin/setup
|
142
142
|
- examples/manual.rb
|
143
|
-
- examples/readme.
|
144
|
-
- examples/readme/01-basic.rb
|
145
|
-
- examples/readme/02-type-point.rb
|
146
|
-
- examples/readme/03-type-line.rb
|
147
|
-
- examples/readme/04-color.rb
|
148
|
-
- examples/readme/05-gridlines.rb
|
149
|
-
- examples/readme/06-ticks.rb
|
150
|
-
- examples/readme/07-baseline.rb
|
151
|
-
- examples/readme/08-every.rb
|
152
|
-
- examples/readme/09-legend.rb
|
153
|
-
- examples/readme/10-legend-offset.rb
|
154
|
-
- examples/readme/11-format.rb
|
155
|
-
- examples/readme/12-labels.rb
|
156
|
-
- examples/readme/13-border.rb
|
157
|
-
- examples/readme/14-height.rb
|
158
|
-
- examples/readme/15-multiple-columns.rb
|
159
|
-
- examples/readme/16-multiple-stacks.rb
|
160
|
-
- examples/readme/17-singular-options.rb
|
161
|
-
- examples/readme/18-plural-options.rb
|
162
|
-
- examples/readme/19-two-axis.rb
|
163
|
-
- examples/readme/readme.rb
|
164
|
-
- examples/screenshots/readme_00.png
|
165
|
-
- examples/screenshots/readme_01.png
|
166
|
-
- examples/screenshots/readme_02.png
|
167
|
-
- examples/screenshots/readme_03.png
|
168
|
-
- examples/screenshots/readme_04.png
|
169
|
-
- examples/screenshots/readme_05.png
|
170
|
-
- examples/screenshots/readme_06.png
|
171
|
-
- examples/screenshots/readme_07.png
|
172
|
-
- examples/screenshots/readme_08.png
|
173
|
-
- examples/screenshots/readme_09.png
|
174
|
-
- examples/screenshots/readme_10.png
|
175
|
-
- examples/screenshots/readme_11.png
|
176
|
-
- examples/screenshots/readme_12.png
|
177
|
-
- examples/screenshots/readme_13.png
|
178
|
-
- examples/screenshots/readme_14.png
|
179
|
-
- examples/screenshots/readme_15.png
|
180
|
-
- examples/screenshots/readme_16.png
|
181
|
-
- examples/screenshots/readme_17.png
|
182
|
-
- examples/screenshots/readme_18.png
|
183
|
-
- examples/screenshots/readme_19.png
|
143
|
+
- examples/readme.png
|
184
144
|
- examples/squid/baseline.rb
|
185
145
|
- examples/squid/basic.rb
|
186
146
|
- examples/squid/border.rb
|
@@ -230,9 +190,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
190
|
version: 2.1.0
|
231
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
232
192
|
requirements:
|
233
|
-
- - "
|
193
|
+
- - ">="
|
234
194
|
- !ruby/object:Gem::Version
|
235
|
-
version:
|
195
|
+
version: '0'
|
236
196
|
requirements: []
|
237
197
|
rubyforge_project:
|
238
198
|
rubygems_version: 2.4.5.1
|
data/examples/readme/01-basic.rb
DELETED
data/examples/readme/04-color.rb
DELETED
data/examples/readme/06-ticks.rb
DELETED
data/examples/readme/08-every.rb
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
2
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
3
|
-
data = {safari: {2013 => 43.2, 2014 => 46.1, 2015 => 50.7}, firefox: {2013 => 56.8, 2014 => 53.9, 2015 => 49.3}}
|
4
|
-
chart data, label: true, format: :percentage
|
5
|
-
end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
2
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
3
|
-
data = {safari: {2013 => 43.2, 2014 => 46.1, 2015 => 50.7}, firefox: {2013 => 56.8, 2014 => 53.9, 2015 => 49.3}}
|
4
|
-
chart data, type: :stack, format: :percentage
|
5
|
-
end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
2
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
3
|
-
data = {safari: {2013 => 53.2, 2014 => 56.1, 2015 => 60.7}, firefox: {2013 => 46.8, 2014 => 43.9, 2015 => 39.3}}
|
4
|
-
chart data, type: :line, color: '6f3d79', format: :percentage, line_width: 0.5, label: true
|
5
|
-
end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
2
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
3
|
-
data = {safari: {2013 => 53.2, 2014 => 56.1, 2015 => 60.7}, firefox: {2013 => 46.8, 2014 => 43.9, 2015 => 39.3}}
|
4
|
-
chart data, type: :line, colors: ['6f3d79', '7d807f'], formats: [:percentage, :percentage], line_widths: [0.5, 6], labels: [true, true]
|
5
|
-
end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
2
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
3
|
-
data = {earnings: {2013 => 104_323, 2014 => 27_234, 2015 => 74_123}, views: {2013 => 182, 2014 => 46, 2015 => 88}, uniques: {2013 => 153, 2014 => 36, 2015 => 78} }
|
4
|
-
chart data, type: :two_axis
|
5
|
-
end
|
data/examples/readme/readme.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
Prawn::ManualBuilder::Example.generate 'readme.pdf' do
|
2
|
-
package 'readme' do |p|
|
3
|
-
p.name = 'Readme'
|
4
|
-
|
5
|
-
p.intro do
|
6
|
-
end
|
7
|
-
|
8
|
-
p.section 'Single series' do |s|
|
9
|
-
s.example '01-basic'
|
10
|
-
s.example '02-type-point'
|
11
|
-
s.example '03-type-line'
|
12
|
-
s.example '04-color'
|
13
|
-
s.example '05-gridlines'
|
14
|
-
s.example '06-ticks'
|
15
|
-
s.example '07-baseline'
|
16
|
-
s.example '08-every'
|
17
|
-
s.example '09-legend'
|
18
|
-
s.example '10-legend-offset'
|
19
|
-
s.example '11-format'
|
20
|
-
s.example '12-labels'
|
21
|
-
s.example '13-border'
|
22
|
-
s.example '14-height'
|
23
|
-
s.example '15-multiple-columns'
|
24
|
-
s.example '16-multiple-stacks'
|
25
|
-
s.example '17-singular-options'
|
26
|
-
s.example '18-plural-options'
|
27
|
-
s.example '19-two-axis'
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/examples/readme.rb
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|