rubyvis 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.travis.yml +13 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +37 -0
- data/History.txt +6 -0
- data/LICENSE.txt +23 -0
- data/{README.txt → README.md} +15 -12
- data/Rakefile +4 -11
- data/lib/rubyvis.rb +1 -1
- data/lib/rubyvis/scale/quantitative.rb +14 -18
- data/lib/rubyvis/scene/svg_label.rb +1 -1
- data/rubyvis.gemspec +21 -0
- data/spec/anchor_spec.rb +2 -1
- data/spec/line_spec.rb +2 -2
- data/spec/scale_linear_datetime_spec.rb +23 -8
- data/spec/spec_helper.rb +2 -1
- metadata +31 -214
- data/.gemtest +0 -0
- data/vendor/protovis/protovis-r3.3.js +0 -287
- data/vendor/protovis/src/behavior/Behavior.js +0 -32
- data/vendor/protovis/src/behavior/Drag.js +0 -112
- data/vendor/protovis/src/behavior/Pan.js +0 -110
- data/vendor/protovis/src/behavior/Point.js +0 -157
- data/vendor/protovis/src/behavior/Resize.js +0 -104
- data/vendor/protovis/src/behavior/Select.js +0 -100
- data/vendor/protovis/src/behavior/Zoom.js +0 -85
- data/vendor/protovis/src/color/Color.js +0 -598
- data/vendor/protovis/src/color/Colors.js +0 -135
- data/vendor/protovis/src/color/Ramp.js +0 -17
- data/vendor/protovis/src/data/Arrays.js +0 -277
- data/vendor/protovis/src/data/Dom.js +0 -380
- data/vendor/protovis/src/data/Flatten.js +0 -146
- data/vendor/protovis/src/data/Histogram.js +0 -120
- data/vendor/protovis/src/data/LinearScale.js +0 -54
- data/vendor/protovis/src/data/LogScale.js +0 -142
- data/vendor/protovis/src/data/Nest.js +0 -257
- data/vendor/protovis/src/data/Numbers.js +0 -313
- data/vendor/protovis/src/data/Objects.js +0 -78
- data/vendor/protovis/src/data/OrdinalScale.js +0 -267
- data/vendor/protovis/src/data/QuantileScale.js +0 -180
- data/vendor/protovis/src/data/QuantitativeScale.js +0 -440
- data/vendor/protovis/src/data/RootScale.js +0 -55
- data/vendor/protovis/src/data/Scale.js +0 -86
- data/vendor/protovis/src/data/Transform.js +0 -109
- data/vendor/protovis/src/data/Tree.js +0 -124
- data/vendor/protovis/src/data/Vector.js +0 -118
- data/vendor/protovis/src/geo/Geo.js +0 -5
- data/vendor/protovis/src/geo/GeoScale.js +0 -307
- data/vendor/protovis/src/geo/LatLng.js +0 -23
- data/vendor/protovis/src/geo/Projection.js +0 -43
- data/vendor/protovis/src/geo/Projections.js +0 -117
- data/vendor/protovis/src/lang/Array.js +0 -112
- data/vendor/protovis/src/lang/init.js +0 -26
- data/vendor/protovis/src/layout/Arc.js +0 -178
- data/vendor/protovis/src/layout/Bullet.js +0 -164
- data/vendor/protovis/src/layout/Cluster.js +0 -205
- data/vendor/protovis/src/layout/Force.js +0 -309
- data/vendor/protovis/src/layout/Grid.js +0 -119
- data/vendor/protovis/src/layout/Hierarchy.js +0 -249
- data/vendor/protovis/src/layout/Horizon.js +0 -159
- data/vendor/protovis/src/layout/Indent.js +0 -83
- data/vendor/protovis/src/layout/Layout.js +0 -56
- data/vendor/protovis/src/layout/Matrix.js +0 -177
- data/vendor/protovis/src/layout/Network.js +0 -302
- data/vendor/protovis/src/layout/Pack.js +0 -323
- data/vendor/protovis/src/layout/Partition.js +0 -203
- data/vendor/protovis/src/layout/Rollup.js +0 -203
- data/vendor/protovis/src/layout/Stack.js +0 -391
- data/vendor/protovis/src/layout/Tree.js +0 -282
- data/vendor/protovis/src/layout/Treemap.js +0 -347
- data/vendor/protovis/src/mark/Anchor.js +0 -81
- data/vendor/protovis/src/mark/Area.js +0 -268
- data/vendor/protovis/src/mark/Bar.js +0 -93
- data/vendor/protovis/src/mark/Dot.js +0 -212
- data/vendor/protovis/src/mark/Ease.js +0 -150
- data/vendor/protovis/src/mark/Image.js +0 -154
- data/vendor/protovis/src/mark/Label.js +0 -155
- data/vendor/protovis/src/mark/Line.js +0 -195
- data/vendor/protovis/src/mark/Mark.js +0 -1237
- data/vendor/protovis/src/mark/Panel.js +0 -273
- data/vendor/protovis/src/mark/Rule.js +0 -143
- data/vendor/protovis/src/mark/Transient.js +0 -7
- data/vendor/protovis/src/mark/Transition.js +0 -195
- data/vendor/protovis/src/mark/Wedge.js +0 -244
- data/vendor/protovis/src/physics/BoundConstraint.js +0 -75
- data/vendor/protovis/src/physics/ChargeForce.js +0 -184
- data/vendor/protovis/src/physics/CollisionConstraint.js +0 -113
- data/vendor/protovis/src/physics/Constraint.js +0 -26
- data/vendor/protovis/src/physics/DragForce.js +0 -49
- data/vendor/protovis/src/physics/Force.js +0 -25
- data/vendor/protovis/src/physics/Particle.js +0 -81
- data/vendor/protovis/src/physics/PositionConstraint.js +0 -72
- data/vendor/protovis/src/physics/Quadtree.js +0 -195
- data/vendor/protovis/src/physics/Simulation.js +0 -159
- data/vendor/protovis/src/physics/SpringForce.js +0 -141
- data/vendor/protovis/src/pv-internals.js +0 -154
- data/vendor/protovis/src/pv.js +0 -95
- data/vendor/protovis/src/scene/SvgArea.js +0 -172
- data/vendor/protovis/src/scene/SvgBar.js +0 -28
- data/vendor/protovis/src/scene/SvgCurve.js +0 -354
- data/vendor/protovis/src/scene/SvgDot.js +0 -81
- data/vendor/protovis/src/scene/SvgImage.js +0 -45
- data/vendor/protovis/src/scene/SvgLabel.js +0 -46
- data/vendor/protovis/src/scene/SvgLine.js +0 -159
- data/vendor/protovis/src/scene/SvgPanel.js +0 -126
- data/vendor/protovis/src/scene/SvgRule.js +0 -26
- data/vendor/protovis/src/scene/SvgScene.js +0 -185
- data/vendor/protovis/src/scene/SvgWedge.js +0 -66
- data/vendor/protovis/src/text/DateFormat.js +0 -262
- data/vendor/protovis/src/text/Format.js +0 -78
- data/vendor/protovis/src/text/NumberFormat.js +0 -227
- data/vendor/protovis/src/text/TimeFormat.js +0 -115
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0920b8934ac03cbc5cdcdd9e018b270c755c9a99
|
4
|
+
data.tar.gz: d581b5a9847a03c8dd5d05c6db260448164ad6e0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6cd729bb91aa0d934def2639956cb577d7656d57435adaacef8c5e37ee1a91347a0462da8d253ce0a0429a7ee46fe90ec6029b32d5aa819001303e83122f97d5
|
7
|
+
data.tar.gz: cc3455449762a6cba3acabb67130bac1ede70814241867be0792ae4daf2264777c3f2d7f5e09d9ef9d04f16419be2b7d6fe0ae8215b85404af1fe4c9626aaa78
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
RedCloth (4.2.9)
|
5
|
+
coderay (1.1.0)
|
6
|
+
diff-lcs (1.2.5)
|
7
|
+
haml (4.0.5)
|
8
|
+
tilt
|
9
|
+
mini_portile (0.6.0)
|
10
|
+
nokogiri (1.6.3.1)
|
11
|
+
mini_portile (= 0.6.0)
|
12
|
+
rake (10.3.2)
|
13
|
+
rspec (3.0.0)
|
14
|
+
rspec-core (~> 3.0.0)
|
15
|
+
rspec-expectations (~> 3.0.0)
|
16
|
+
rspec-mocks (~> 3.0.0)
|
17
|
+
rspec-core (3.0.3)
|
18
|
+
rspec-support (~> 3.0.0)
|
19
|
+
rspec-expectations (3.0.3)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.0.0)
|
22
|
+
rspec-mocks (3.0.3)
|
23
|
+
rspec-support (~> 3.0.0)
|
24
|
+
rspec-support (3.0.3)
|
25
|
+
tilt (2.0.1)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
RedCloth
|
32
|
+
coderay
|
33
|
+
haml
|
34
|
+
nokogiri
|
35
|
+
rake
|
36
|
+
rspec
|
37
|
+
rspec-mocks
|
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 0.6.1 / 2014-08-07
|
2
|
+
* Change license to BSD 2-Clause
|
3
|
+
* Merge pull request #19 from pivotal-cloudplanner/master
|
4
|
+
* Added travis and bundler support
|
5
|
+
* Resolved bug #15
|
6
|
+
|
1
7
|
=== 0.6.0 / 2013-07-10
|
2
8
|
+ Added support for dashed lines (ex.: stroke_dasharray('9,5,3'))
|
3
9
|
- Raises an exception on log scale when domain includes 0 or negative values
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Copyright (c) 2010-2014, Claudio Bustos
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
8
|
+
list of conditions and the following disclaimer.
|
9
|
+
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
12
|
+
and/or other materials provided with the distribution.
|
13
|
+
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
15
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
16
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
17
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
18
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
19
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
20
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
21
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
22
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
23
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/{README.txt → README.md}
RENAMED
@@ -1,12 +1,15 @@
|
|
1
|
-
|
1
|
+
# Rubyvis
|
2
2
|
|
3
|
-
*
|
3
|
+
* https://github.com/clbustos/rubyvis
|
4
4
|
|
5
|
-
|
5
|
+
[![Build Status](https://travis-ci.org/clbustos/rubyvis.svg?branch=master)](https://travis-ci.org/clbustos/rubyvis)
|
6
|
+
|
7
|
+
|
8
|
+
## DESCRIPTION:
|
6
9
|
|
7
10
|
Ruby port of Protovis[http://vis.stanford.edu/protovis/], a Javascript visualization toolkit.
|
8
11
|
|
9
|
-
|
12
|
+
## FEATURES/PROBLEMS:
|
10
13
|
|
11
14
|
This library implements almost completely core API of protovis, including all static marks, SVG builder class and data classes. Spec coverage is near 90%
|
12
15
|
|
@@ -43,7 +46,7 @@ User could use +pv+ freely, cause is defined as a global method which call Rubyv
|
|
43
46
|
|
44
47
|
Nokogiri is used as XML library. If not available, or $rubyvis_no_nokogiri is set to true, REXML is used. Nokogiri is 30%-35% faster that REXML on our test.
|
45
48
|
|
46
|
-
|
49
|
+
## CURRENT PROGRESS
|
47
50
|
|
48
51
|
* pv.js
|
49
52
|
* pv-internals.js
|
@@ -93,7 +96,7 @@ Nokogiri is used as XML library. If not available, or $rubyvis_no_nokogiri is se
|
|
93
96
|
* text/Format.js (incomplete)
|
94
97
|
* text/NumberFormat.js (incomplete)
|
95
98
|
|
96
|
-
|
99
|
+
## SYNOPSIS:
|
97
100
|
|
98
101
|
The primary API, based on Gregory Brown's Ruby Best Practices, uses blocks and name of marks as methods
|
99
102
|
|
@@ -134,7 +137,7 @@ The library allows you to use chain methods API, like original protovis
|
|
134
137
|
|
135
138
|
See examples directory for original protovis examples adaptations and others graphics
|
136
139
|
|
137
|
-
|
140
|
+
## THE MOST FREQUENT QUESTION (MFQ)
|
138
141
|
|
139
142
|
¿Why use a server-side technology if I can use a client-side, which is faster and more economic for developer?
|
140
143
|
|
@@ -142,14 +145,14 @@ If you want to present graphs: (a) complex and/or dynamically generated, (b) onl
|
|
142
145
|
|
143
146
|
Rubyvis is designed mainly for off-line operation, like batch creation of graphs for use on printed documents (rtf-pdf), with possibility of use easily the script for on-line use.
|
144
147
|
|
145
|
-
|
148
|
+
## REQUIREMENTS:
|
146
149
|
|
147
|
-
Tested on Ruby 1.
|
150
|
+
Tested on Ruby 1.9.2, 1.9.3, 2.0.0, 2.1.1 and Jruby (mode 1.9)
|
148
151
|
|
149
|
-
|
152
|
+
## INSTALL:
|
150
153
|
|
151
154
|
$ gem install rubyvis
|
152
155
|
|
153
|
-
|
156
|
+
## LICENSE:
|
154
157
|
|
155
|
-
|
158
|
+
BSD 2-Clause (see LICENSE.txt)
|
data/Rakefile
CHANGED
@@ -3,23 +3,16 @@ $:.unshift(File.expand_path(File.dirname(__FILE__)+"/lib"))
|
|
3
3
|
$:.unshift(File.expand_path(File.dirname(__FILE__)))
|
4
4
|
|
5
5
|
require 'rubygems'
|
6
|
-
require 'hoe'
|
7
6
|
require 'rubyvis'
|
8
7
|
require 'rspec'
|
9
8
|
require 'rspec/core/rake_task'
|
10
9
|
require './lib/rspec/expectations/differ'
|
11
|
-
require 'rubyforge'
|
12
10
|
|
13
|
-
|
14
|
-
|
11
|
+
require 'bundler'
|
12
|
+
Bundler::GemHelper.install_tasks
|
13
|
+
|
14
|
+
|
15
15
|
|
16
|
-
h=Hoe.spec 'rubyvis' do
|
17
|
-
self.testlib=:rspec
|
18
|
-
self.rspec_options << "-c" << "-b"
|
19
|
-
self.developer('Claudio Bustos', 'clbustos_at_gmail.com')
|
20
|
-
self.version=Rubyvis::VERSION
|
21
|
-
self.extra_dev_deps << ["coderay",">=0"] << ["haml",">=0"] << ["nokogiri", ">=0"] << ["rspec",">=2.7"] << ["RedCloth",">=0"]
|
22
|
-
end
|
23
16
|
desc "Publicar docs en rubyforge"
|
24
17
|
task :publicar_docs => [:clean, :docs] do
|
25
18
|
#ruby %{agregar_adsense_a_doc.rb}
|
data/lib/rubyvis.rb
CHANGED
@@ -34,7 +34,7 @@ require 'rubyvis/mark/shorcut_methods'
|
|
34
34
|
module Rubyvis
|
35
35
|
@@nokogiri=nil
|
36
36
|
# Rubyvis version
|
37
|
-
VERSION = '0.6.
|
37
|
+
VERSION = '0.6.1'
|
38
38
|
# Protovis API on which current Rubyvis is based
|
39
39
|
PROTOVIS_API_VERSION='3.3'
|
40
40
|
# You actually can do it! http://snipplr.com/view/2137/uses-for-infinity-in-ruby/
|
@@ -245,32 +245,29 @@ module Rubyvis
|
|
245
245
|
end
|
246
246
|
end
|
247
247
|
def ticks_floor(d,prec) # :nodoc:
|
248
|
-
|
249
|
-
#p ar
|
250
|
-
# [ sec, min, hour, day, month, year, wday, yday, isdst, zone ]
|
248
|
+
dfloor=d
|
251
249
|
case(prec)
|
252
|
-
when 31536e6
|
253
|
-
|
254
|
-
when 2592e6
|
255
|
-
|
256
|
-
when 6048e5
|
257
|
-
|
258
|
-
when 864e5
|
259
|
-
|
260
|
-
when 36e5
|
261
|
-
|
262
|
-
when 6e4
|
263
|
-
|
250
|
+
when 31536e6, :month
|
251
|
+
dfloor = Time.utc(d.year,1,d.day,d.hour,d.min,d.sec)
|
252
|
+
when 2592e6, :month_day
|
253
|
+
dfloor = Time.utc(d.year,d.month,1,d.hour,d.min,d.sec)
|
254
|
+
when 6048e5, :week_day
|
255
|
+
dfloor = dfloor - d.wday*864e2 # TODO
|
256
|
+
when 864e5, :hour
|
257
|
+
dfloor = Time.utc(d.year,d.month,d.day,0,d.min,d.sec)
|
258
|
+
when 36e5, :minute
|
259
|
+
dfloor = Time.utc(d.year,d.month,d.day,d.hour,0,d.sec)
|
260
|
+
when 6e4, :second
|
261
|
+
dfloor = Time.utc(d.year,d.month,d.day,d.hour,d.min,0)
|
264
262
|
when 1e3
|
265
263
|
# do nothing
|
266
264
|
end
|
267
|
-
|
265
|
+
return dfloor
|
268
266
|
end
|
269
267
|
|
270
268
|
private :ticks_floor
|
271
269
|
|
272
270
|
def to_date(d) # :nodoc:
|
273
|
-
|
274
271
|
Time.utc(*d)
|
275
272
|
end
|
276
273
|
# Returns an array of evenly-spaced, suitably-rounded values in the input
|
@@ -331,7 +328,6 @@ module Rubyvis
|
|
331
328
|
format = "%S.%Qs";
|
332
329
|
increment = lambda {|d| Time.at(d.to_f+(step/1000.0)) }
|
333
330
|
end
|
334
|
-
|
335
331
|
@tick_format = Rubyvis.Format.date(format);
|
336
332
|
date = Time.at(min.to_f)
|
337
333
|
dates = []
|
data/rubyvis.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.unshift(File.expand_path(File.dirname(__FILE__)+"/lib"))
|
3
|
+
require File.expand_path("../lib/rubyvis", __FILE__)
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "rubyvis"
|
7
|
+
s.version = Rubyvis::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ['Claudio Bustos']
|
10
|
+
s.email = []
|
11
|
+
s.homepage = "http://rubygems.org/gems/rubyvis"
|
12
|
+
s.summary = "Rubyvis"
|
13
|
+
s.description = "Rubyvis"
|
14
|
+
|
15
|
+
s.required_rubygems_version = ">= 1.3.6"
|
16
|
+
s.add_development_dependency "bundler", ">= 1.0.0"
|
17
|
+
s.add_development_dependency "rspec"
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
20
|
+
s.require_path = 'lib'
|
21
|
+
end
|
data/spec/anchor_spec.rb
CHANGED
@@ -7,7 +7,8 @@ describe Rubyvis::Anchor do
|
|
7
7
|
Rubyvis::Anchor.properties.should==props
|
8
8
|
end
|
9
9
|
it "should be initialized with an object which respond to parent" do
|
10
|
-
my_mock=
|
10
|
+
my_mock=double('mark')
|
11
|
+
my_mock.stub(:parent)
|
11
12
|
my_mock.should_receive(:parent).with(no_args())
|
12
13
|
Rubyvis.Anchor(my_mock)
|
13
14
|
|
data/spec/line_spec.rb
CHANGED
@@ -116,7 +116,7 @@ top(5)
|
|
116
116
|
# obj.attributes["d"].value
|
117
117
|
exp_data="M2.1161165235168156,4.883883476483184L4.116116523516816,6.883883476483184 5.883883476483184,5.116116523516816 3.8838834764831844,3.1161165235168156"
|
118
118
|
obs=""
|
119
|
-
obs.stub
|
119
|
+
obs.stub(:attributes).and_return({'d'=>OpenStruct.new({:value=>Rubyvis::SvgScene.path_join(s0,s1,s2,s3)})})
|
120
120
|
|
121
121
|
obs.should have_path_data_close_to exp_data
|
122
122
|
|
@@ -126,7 +126,7 @@ top(5)
|
|
126
126
|
s3=OpenStruct.new({:left=>7.5,:top=>8,:visible=>true, :line_width=>4.5})
|
127
127
|
exp_data="M2.2625631329235425,5.2374368670764575L4.2625631329235425,7.2374368670764575 6.7374368670764575,4.7625631329235425 4.7374368670764575,2.7625631329235425"
|
128
128
|
obs=""
|
129
|
-
obs.stub
|
129
|
+
obs.stub(:attributes).and_return({'d'=>OpenStruct.new({:value=>Rubyvis::SvgScene.path_join(s0,s1,s2,s3)})})
|
130
130
|
obs.should have_path_data_close_to exp_data
|
131
131
|
|
132
132
|
end
|
@@ -3,6 +3,7 @@ describe "Rubyvis::Scale::Linear with dates" do
|
|
3
3
|
it "should be created as Javascript" do
|
4
4
|
h=280
|
5
5
|
y = Rubyvis.Scale.linear(Time.utc(2010,1,1), Time.utc(2010,2,1))
|
6
|
+
|
6
7
|
end
|
7
8
|
|
8
9
|
before do
|
@@ -10,6 +11,13 @@ describe "Rubyvis::Scale::Linear with dates" do
|
|
10
11
|
@ed=Time.utc(2010,2,1)
|
11
12
|
@h=280
|
12
13
|
@y = Rubyvis.Scale.linear(@bd, @ed).range(0,@h)
|
14
|
+
def @y.mock_ticks_floor(d,prec)
|
15
|
+
ticks_floor(d,prec)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
it "should not crash on :week_day precision (bug #15)" do
|
19
|
+
ct=Time.utc(2012,03,19,10,10,10)
|
20
|
+
@y.mock_ticks_floor(ct,:week_day).should==Time.utc(2012,03,18,10,10,10)
|
13
21
|
end
|
14
22
|
it "y should be a Scale" do
|
15
23
|
@y.should be_a(Rubyvis::Scale::Linear)
|
@@ -46,11 +54,18 @@ describe "Rubyvis::Scale::Linear with dates" do
|
|
46
54
|
|
47
55
|
#p @y.ticks
|
48
56
|
end
|
49
|
-
it "should
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
+
it "should return correct tick_floor" do
|
58
|
+
ct=Time.utc(2012,04,05,10,10,10)
|
59
|
+
@y.mock_ticks_floor(ct,:month).should==Time.utc(2012,01,05,10,10,10)
|
60
|
+
@y.mock_ticks_floor(ct,:month_day).should==Time.utc(2012,04,01,10,10,10)
|
61
|
+
@y.mock_ticks_floor(ct,:week_day).should==Time.utc(2012,04,01,10,10,10)
|
62
|
+
@y.mock_ticks_floor(ct,:hour).should==Time.utc(2012,04,05,00,10,10)
|
63
|
+
@y.mock_ticks_floor(ct,:minute).should==Time.utc(2012,04,05,10,00,10)
|
64
|
+
@y.mock_ticks_floor(ct,:second).should==Time.utc(2012,04,05,10,10,00)
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should returns correct tick_format"
|
69
|
+
it "should nice nicely"
|
70
|
+
|
71
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -8,6 +8,7 @@ begin
|
|
8
8
|
rescue LoadError
|
9
9
|
end
|
10
10
|
require 'rspec'
|
11
|
+
require 'rspec/mocks'
|
11
12
|
#require 'spec/autorun'
|
12
13
|
require 'rubyvis'
|
13
14
|
require 'pp'
|
@@ -94,7 +95,7 @@ end
|
|
94
95
|
RSpec::Matchers.define :have_svg_attributes do |exp|
|
95
96
|
match do |obs|
|
96
97
|
exp.each {|k,v|
|
97
|
-
obs.attributes[k].should
|
98
|
+
obs.attributes[k].should be_truthy
|
98
99
|
obs.attributes[k].value.should==v
|
99
100
|
}
|
100
101
|
end
|
metadata
CHANGED
@@ -1,142 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyvis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
5
|
-
prerelease:
|
4
|
+
version: 0.6.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Claudio Bustos
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-08-07 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
14
|
+
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 1.0.0
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: coderay
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: haml
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: nokogiri
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
26
|
+
version: 1.0.0
|
78
27
|
- !ruby/object:Gem::Dependency
|
79
28
|
name: rspec
|
80
29
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
30
|
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '2.7'
|
86
|
-
type: :development
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '2.7'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: RedCloth
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
31
|
+
- - ">="
|
100
32
|
- !ruby/object:Gem::Version
|
101
33
|
version: '0'
|
102
34
|
type: :development
|
103
35
|
prerelease: false
|
104
36
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
37
|
requirements:
|
107
|
-
- -
|
38
|
+
- - ">="
|
108
39
|
- !ruby/object:Gem::Version
|
109
40
|
version: '0'
|
110
|
-
|
111
|
-
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '3.3'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '3.3'
|
126
|
-
description: Ruby port of Protovis[http://vis.stanford.edu/protovis/], a Javascript
|
127
|
-
visualization toolkit.
|
128
|
-
email:
|
129
|
-
- clbustos_at_gmail.com
|
41
|
+
description: Rubyvis
|
42
|
+
email: []
|
130
43
|
executables: []
|
131
44
|
extensions: []
|
132
|
-
extra_rdoc_files:
|
133
|
-
- History.txt
|
134
|
-
- Manifest.txt
|
135
|
-
- README.txt
|
45
|
+
extra_rdoc_files: []
|
136
46
|
files:
|
47
|
+
- ".gitignore"
|
48
|
+
- ".travis.yml"
|
49
|
+
- Gemfile
|
50
|
+
- Gemfile.lock
|
137
51
|
- History.txt
|
52
|
+
- LICENSE.txt
|
138
53
|
- Manifest.txt
|
139
|
-
- README.
|
54
|
+
- README.md
|
140
55
|
- Rakefile
|
141
56
|
- examples/1_basic/1a_bar_rbp_api.rb
|
142
57
|
- examples/1_basic/1b_bar_pv_api.rb
|
@@ -184,6 +99,8 @@ files:
|
|
184
99
|
- examples/6_pv_networks/arc.rb
|
185
100
|
- examples/6_pv_networks/matrix.rb
|
186
101
|
- examples/6_pv_networks/miserables_data.rb
|
102
|
+
- lib/rspec/expectations/differ.rb
|
103
|
+
- lib/rspec/expectations/differ_spec.rb
|
187
104
|
- lib/rubyvis.rb
|
188
105
|
- lib/rubyvis/color/color.rb
|
189
106
|
- lib/rubyvis/color/colors.rb
|
@@ -242,8 +159,7 @@ files:
|
|
242
159
|
- lib/rubyvis/sceneelement.rb
|
243
160
|
- lib/rubyvis/transform.rb
|
244
161
|
- lib/rubyvis/vector.rb
|
245
|
-
-
|
246
|
-
- lib/rspec/expectations/differ_spec.rb
|
162
|
+
- rubyvis.gemspec
|
247
163
|
- spec/anchor_spec.rb
|
248
164
|
- spec/area_spec.rb
|
249
165
|
- spec/bar_spec.rb
|
@@ -333,131 +249,32 @@ files:
|
|
333
249
|
- spec/spec_helper.rb
|
334
250
|
- spec/vector_spec.rb
|
335
251
|
- spec/wedge_spec.rb
|
336
|
-
- vendor/protovis/protovis-r3.3.js
|
337
|
-
- vendor/protovis/src/behavior/Behavior.js
|
338
|
-
- vendor/protovis/src/behavior/Drag.js
|
339
|
-
- vendor/protovis/src/behavior/Pan.js
|
340
|
-
- vendor/protovis/src/behavior/Point.js
|
341
|
-
- vendor/protovis/src/behavior/Resize.js
|
342
|
-
- vendor/protovis/src/behavior/Select.js
|
343
|
-
- vendor/protovis/src/behavior/Zoom.js
|
344
|
-
- vendor/protovis/src/color/Color.js
|
345
|
-
- vendor/protovis/src/color/Colors.js
|
346
|
-
- vendor/protovis/src/color/Ramp.js
|
347
|
-
- vendor/protovis/src/data/Arrays.js
|
348
|
-
- vendor/protovis/src/data/Dom.js
|
349
|
-
- vendor/protovis/src/data/Flatten.js
|
350
|
-
- vendor/protovis/src/data/Histogram.js
|
351
|
-
- vendor/protovis/src/data/LinearScale.js
|
352
|
-
- vendor/protovis/src/data/LogScale.js
|
353
|
-
- vendor/protovis/src/data/Nest.js
|
354
|
-
- vendor/protovis/src/data/Numbers.js
|
355
|
-
- vendor/protovis/src/data/Objects.js
|
356
|
-
- vendor/protovis/src/data/OrdinalScale.js
|
357
|
-
- vendor/protovis/src/data/QuantileScale.js
|
358
|
-
- vendor/protovis/src/data/QuantitativeScale.js
|
359
|
-
- vendor/protovis/src/data/RootScale.js
|
360
|
-
- vendor/protovis/src/data/Scale.js
|
361
|
-
- vendor/protovis/src/data/Transform.js
|
362
|
-
- vendor/protovis/src/data/Tree.js
|
363
|
-
- vendor/protovis/src/data/Vector.js
|
364
|
-
- vendor/protovis/src/geo/Geo.js
|
365
|
-
- vendor/protovis/src/geo/GeoScale.js
|
366
|
-
- vendor/protovis/src/geo/LatLng.js
|
367
|
-
- vendor/protovis/src/geo/Projection.js
|
368
|
-
- vendor/protovis/src/geo/Projections.js
|
369
|
-
- vendor/protovis/src/lang/Array.js
|
370
|
-
- vendor/protovis/src/lang/init.js
|
371
|
-
- vendor/protovis/src/layout/Arc.js
|
372
|
-
- vendor/protovis/src/layout/Bullet.js
|
373
|
-
- vendor/protovis/src/layout/Cluster.js
|
374
|
-
- vendor/protovis/src/layout/Force.js
|
375
|
-
- vendor/protovis/src/layout/Grid.js
|
376
|
-
- vendor/protovis/src/layout/Hierarchy.js
|
377
|
-
- vendor/protovis/src/layout/Horizon.js
|
378
|
-
- vendor/protovis/src/layout/Indent.js
|
379
|
-
- vendor/protovis/src/layout/Layout.js
|
380
|
-
- vendor/protovis/src/layout/Matrix.js
|
381
|
-
- vendor/protovis/src/layout/Network.js
|
382
|
-
- vendor/protovis/src/layout/Pack.js
|
383
|
-
- vendor/protovis/src/layout/Partition.js
|
384
|
-
- vendor/protovis/src/layout/Rollup.js
|
385
|
-
- vendor/protovis/src/layout/Stack.js
|
386
|
-
- vendor/protovis/src/layout/Tree.js
|
387
|
-
- vendor/protovis/src/layout/Treemap.js
|
388
|
-
- vendor/protovis/src/mark/Anchor.js
|
389
|
-
- vendor/protovis/src/mark/Area.js
|
390
|
-
- vendor/protovis/src/mark/Bar.js
|
391
|
-
- vendor/protovis/src/mark/Dot.js
|
392
|
-
- vendor/protovis/src/mark/Ease.js
|
393
|
-
- vendor/protovis/src/mark/Image.js
|
394
|
-
- vendor/protovis/src/mark/Label.js
|
395
|
-
- vendor/protovis/src/mark/Line.js
|
396
|
-
- vendor/protovis/src/mark/Mark.js
|
397
|
-
- vendor/protovis/src/mark/Panel.js
|
398
|
-
- vendor/protovis/src/mark/Rule.js
|
399
|
-
- vendor/protovis/src/mark/Transient.js
|
400
|
-
- vendor/protovis/src/mark/Transition.js
|
401
|
-
- vendor/protovis/src/mark/Wedge.js
|
402
|
-
- vendor/protovis/src/physics/BoundConstraint.js
|
403
|
-
- vendor/protovis/src/physics/ChargeForce.js
|
404
|
-
- vendor/protovis/src/physics/CollisionConstraint.js
|
405
|
-
- vendor/protovis/src/physics/Constraint.js
|
406
|
-
- vendor/protovis/src/physics/DragForce.js
|
407
|
-
- vendor/protovis/src/physics/Force.js
|
408
|
-
- vendor/protovis/src/physics/Particle.js
|
409
|
-
- vendor/protovis/src/physics/PositionConstraint.js
|
410
|
-
- vendor/protovis/src/physics/Quadtree.js
|
411
|
-
- vendor/protovis/src/physics/Simulation.js
|
412
|
-
- vendor/protovis/src/physics/SpringForce.js
|
413
|
-
- vendor/protovis/src/pv-internals.js
|
414
|
-
- vendor/protovis/src/pv.js
|
415
|
-
- vendor/protovis/src/scene/SvgArea.js
|
416
|
-
- vendor/protovis/src/scene/SvgBar.js
|
417
|
-
- vendor/protovis/src/scene/SvgCurve.js
|
418
|
-
- vendor/protovis/src/scene/SvgDot.js
|
419
|
-
- vendor/protovis/src/scene/SvgImage.js
|
420
|
-
- vendor/protovis/src/scene/SvgLabel.js
|
421
|
-
- vendor/protovis/src/scene/SvgLine.js
|
422
|
-
- vendor/protovis/src/scene/SvgPanel.js
|
423
|
-
- vendor/protovis/src/scene/SvgRule.js
|
424
|
-
- vendor/protovis/src/scene/SvgScene.js
|
425
|
-
- vendor/protovis/src/scene/SvgWedge.js
|
426
|
-
- vendor/protovis/src/text/DateFormat.js
|
427
|
-
- vendor/protovis/src/text/Format.js
|
428
|
-
- vendor/protovis/src/text/NumberFormat.js
|
429
|
-
- vendor/protovis/src/text/TimeFormat.js
|
430
252
|
- web/Rakefile
|
431
253
|
- web/build_site.rb
|
432
254
|
- web/examples.haml
|
433
255
|
- web/index.haml
|
434
256
|
- web/style.css
|
435
|
-
|
436
|
-
homepage: http://rubyvis.rubyforge.org/
|
257
|
+
homepage: http://rubygems.org/gems/rubyvis
|
437
258
|
licenses: []
|
259
|
+
metadata: {}
|
438
260
|
post_install_message:
|
439
|
-
rdoc_options:
|
440
|
-
- --main
|
441
|
-
- README.txt
|
261
|
+
rdoc_options: []
|
442
262
|
require_paths:
|
443
263
|
- lib
|
444
264
|
required_ruby_version: !ruby/object:Gem::Requirement
|
445
|
-
none: false
|
446
265
|
requirements:
|
447
|
-
- -
|
266
|
+
- - ">="
|
448
267
|
- !ruby/object:Gem::Version
|
449
268
|
version: '0'
|
450
269
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
451
|
-
none: false
|
452
270
|
requirements:
|
453
|
-
- -
|
271
|
+
- - ">="
|
454
272
|
- !ruby/object:Gem::Version
|
455
|
-
version:
|
273
|
+
version: 1.3.6
|
456
274
|
requirements: []
|
457
|
-
rubyforge_project:
|
458
|
-
rubygems_version:
|
275
|
+
rubyforge_project:
|
276
|
+
rubygems_version: 2.2.2
|
459
277
|
signing_key:
|
460
|
-
specification_version:
|
461
|
-
summary:
|
462
|
-
toolkit.
|
278
|
+
specification_version: 4
|
279
|
+
summary: Rubyvis
|
463
280
|
test_files: []
|