rubyvis 0.1.2 → 0.1.3
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.
- data.tar.gz.sig +0 -0
- data/History.txt +13 -1
- data/Manifest.txt +19 -0
- data/examples/antibiotics/antibiotics.rb +96 -0
- data/examples/antibiotics/antibiotics_data.rb +20 -0
- data/examples/area.rb +103 -0
- data/examples/bar_column_chart.rb +55 -0
- data/examples/barley/barley.rb +29 -19
- data/examples/barley/barley_data.rb +122 -0
- data/examples/crimea/crimea_grouped_bar.rb +59 -0
- data/examples/dot.rb +19 -0
- data/examples/first.rb +1 -6
- data/examples/line.rb +84 -0
- data/examples/pie_and_donut.rb +38 -0
- data/examples/scatterplot.rb +55 -0
- data/examples/second.rb +3 -4
- data/examples/third.rb +1 -1
- data/lib/rubyvis.rb +3 -1
- data/lib/rubyvis/color/color.rb +31 -3
- data/lib/rubyvis/color/colors.rb +3 -3
- data/lib/rubyvis/format/number.rb +80 -10
- data/lib/rubyvis/internals.rb +11 -5
- data/lib/rubyvis/javascript_behaviour.rb +1 -0
- data/lib/rubyvis/mark.rb +43 -20
- data/lib/rubyvis/mark/anchor.rb +1 -1
- data/lib/rubyvis/mark/area.rb +15 -13
- data/lib/rubyvis/mark/bar.rb +2 -2
- data/lib/rubyvis/mark/dot.rb +85 -0
- data/lib/rubyvis/mark/label.rb +1 -1
- data/lib/rubyvis/mark/line.rb +7 -6
- data/lib/rubyvis/mark/panel.rb +0 -1
- data/lib/rubyvis/mark/rule.rb +5 -4
- data/lib/rubyvis/mark/wedge.rb +124 -0
- data/lib/rubyvis/nest.rb +158 -0
- data/lib/rubyvis/scale.rb +4 -0
- data/lib/rubyvis/scale/log.rb +55 -0
- data/lib/rubyvis/scale/ordinal.rb +34 -11
- data/lib/rubyvis/scale/quantitative.rb +17 -3
- data/lib/rubyvis/scene/svg_area.rb +197 -0
- data/lib/rubyvis/scene/svg_dot.rb +67 -0
- data/lib/rubyvis/scene/svg_label.rb +17 -15
- data/lib/rubyvis/scene/svg_line.rb +0 -2
- data/lib/rubyvis/scene/svg_rule.rb +2 -2
- data/lib/rubyvis/scene/svg_scene.rb +8 -1
- data/lib/rubyvis/scene/svg_wedge.rb +56 -0
- data/lib/rubyvis/sceneelement.rb +2 -1
- data/spec/bar_spec.rb +27 -3
- data/spec/label_spec.rb +1 -1
- data/spec/nest_spec.rb +41 -0
- data/spec/panel_spec.rb +1 -1
- data/spec/scale_linear_spec.rb +2 -2
- data/spec/scale_ordinal_spec.rb +81 -0
- data/spec/spec.opts +0 -1
- metadata +24 -3
- metadata.gz.sig +0 -0
@@ -11,21 +11,23 @@ module Rubyvis
|
|
11
11
|
dy=0
|
12
12
|
anchor='start'
|
13
13
|
case s.text_baseline
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
when 'middle'
|
15
|
+
dy=".35em"
|
16
|
+
when "top"
|
17
|
+
dy = ".71em"
|
18
|
+
y = s.text_margin
|
19
|
+
when "bottom"
|
20
|
+
y = "-" + s.text_margin.to_s
|
20
21
|
end
|
22
|
+
|
21
23
|
case s.text_align
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
when 'right'
|
25
|
+
anchor = "end"
|
26
|
+
x = "-" + s.text_margin.to_s
|
27
|
+
when "center"
|
28
|
+
anchor = "middle"
|
29
|
+
when "left"
|
30
|
+
x = s.text_margin
|
29
31
|
end
|
30
32
|
e=SvgScene.expect(e,'text', {
|
31
33
|
"pointer-events"=> s.events,
|
@@ -33,9 +35,9 @@ module Rubyvis
|
|
33
35
|
"x"=> x,
|
34
36
|
"y"=> y,
|
35
37
|
"dy"=> dy,
|
36
|
-
"transform"=> "translate(
|
38
|
+
"transform"=> "translate(#{s.left},#{s.top})" + (s.text_angle!=0 ? " rotate(" + (180 * s.text_angle / Math::PI).to_s + ")" : "") + (self.scale != 1 ? " scale(" + 1 / self.scale + ")" : ""),
|
37
39
|
"fill"=> fill.color,
|
38
|
-
"fill-opacity"=> fill.opacity
|
40
|
+
"fill-opacity"=> fill.opacity==0 ? nil : fill.opacity,
|
39
41
|
"text-anchor"=> anchor
|
40
42
|
}, {
|
41
43
|
"font"=> s.font, "text-shadow"=> s.text_shadow, "text-decoration"=> s.text_decoration })
|
@@ -5,7 +5,7 @@ module Rubyvis
|
|
5
5
|
scenes.each_with_index do |s,i|
|
6
6
|
next unless s.visible
|
7
7
|
stroke=s.stroke_style
|
8
|
-
next if(
|
8
|
+
next if(stroke.opacity==0.0)
|
9
9
|
e=SvgScene.expect(e,'line', {
|
10
10
|
"shape-rendering"=> s.antialias ? nil : "crispEdges",
|
11
11
|
"pointer-events"=> s.events,
|
@@ -16,7 +16,7 @@ module Rubyvis
|
|
16
16
|
'y2'=>s.top+s.height,
|
17
17
|
"stroke"=> stroke.color,
|
18
18
|
"stroke-opacity"=> stroke.opacity,
|
19
|
-
"stroke-width"=> s.line_width/self.scale
|
19
|
+
"stroke-width"=> s.line_width / self.scale
|
20
20
|
})
|
21
21
|
|
22
22
|
e=SvgScene.append(e,scenes,i)
|
@@ -3,6 +3,9 @@ require 'rubyvis/scene/svg_bar'
|
|
3
3
|
require 'rubyvis/scene/svg_rule'
|
4
4
|
require 'rubyvis/scene/svg_label'
|
5
5
|
require 'rubyvis/scene/svg_line'
|
6
|
+
require 'rubyvis/scene/svg_dot'
|
7
|
+
require 'rubyvis/scene/svg_area'
|
8
|
+
require 'rubyvis/scene/svg_wedge'
|
6
9
|
|
7
10
|
class REXML::Element
|
8
11
|
attr_accessor :_scene
|
@@ -71,7 +74,11 @@ module Rubyvis
|
|
71
74
|
end
|
72
75
|
def self.create(type)
|
73
76
|
el=Element.new "#{type}"
|
74
|
-
|
77
|
+
if type=='svg'
|
78
|
+
el.add_namespace(self.svg)
|
79
|
+
#el.add_namespace("xmlns:xmlns", self.xmlns)
|
80
|
+
#el.add_namespace("xlink", self.xlink)
|
81
|
+
end
|
75
82
|
el
|
76
83
|
end
|
77
84
|
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Rubyvis
|
2
|
+
module SvgScene
|
3
|
+
def self.wedge(scenes)
|
4
|
+
e=scenes._g.elements[1]
|
5
|
+
scenes.each_with_index do |s,i|
|
6
|
+
next unless s.visible
|
7
|
+
fill=s.fill_style
|
8
|
+
stroke=s.stroke_style
|
9
|
+
next if(fill.opacity==0.0 and stroke.opacity==0.0)
|
10
|
+
# /* points */
|
11
|
+
|
12
|
+
r1 = s.inner_radius
|
13
|
+
r2 = s.outer_radius
|
14
|
+
a = (s.angle).abs
|
15
|
+
_p=nil
|
16
|
+
|
17
|
+
if (a >= 2 * Math::PI)
|
18
|
+
if (r1)
|
19
|
+
_p = "M0,#{r2 }A#{r2},#{r2} 0 1,1 0,#{-r2}A#{r2 },#{r2 } 0 1,1 0,#{r2}M0,#{r1}A#{r1},#{r1} 0 1,1 0,#{-r1}A#{r1},#{r1} 0 1,1 0,#{r1 }Z"
|
20
|
+
else
|
21
|
+
_p = "M0,#{r2}A#{r2},#{r2} 0 1,1 0,#{-r2}A#{r2},#{r2} 0 1,1 0,#{r2 }Z"
|
22
|
+
end
|
23
|
+
else
|
24
|
+
sa = [s.start_angle, s.end_angle].min
|
25
|
+
ea = [s.start_angle, s.end_angle].max
|
26
|
+
c1 = Math.cos(sa)
|
27
|
+
c2 = Math.cos(ea)
|
28
|
+
s1 = Math.sin(sa)
|
29
|
+
s2 = Math.sin(ea)
|
30
|
+
if (r1)
|
31
|
+
_p = "M#{r2 * c1},#{r2 * s1}A#{r2},#{r2} 0 #{((a < Math::PI) ? "0" : "1")},1 #{r2 * c2},#{r2 * s2}L#{r1 * c2},#{r1 * s2}A#{r1},#{r1} 0 #{((a < Math::PI) ? "0" : "1")},0 #{r1 * c1},#{r1 * s1}Z"
|
32
|
+
else
|
33
|
+
_p = "M#{r2 * c1},#{r2 * s1}A#{r2},#{r2} 0 #{((a < Math.PI) ? "0" : "1")},1 #{r2 * c2},#{r2 * s2}L0,0Z"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
e = self.expect(e, "path", {
|
38
|
+
"shape-rendering"=> s.antialias ? nil : "crispEdges",
|
39
|
+
"pointer-events"=> s.events,
|
40
|
+
"cursor"=> s.cursor,
|
41
|
+
"transform"=> "translate(#{s.left},#{s.top})",
|
42
|
+
"d"=> _p,
|
43
|
+
"fill"=> fill.color,
|
44
|
+
"fill-rule"=> "evenodd",
|
45
|
+
"fill-opacity"=> (fill.opacity==0) ? nil : fill.opacity,
|
46
|
+
"stroke"=> stroke.color,
|
47
|
+
"stroke-opacity"=> (stroke.opacity==0) ? nil : stroke.opacity,
|
48
|
+
"stroke-width"=> stroke.opacity>0 ? s.line_width / self.scale.to_f : nil
|
49
|
+
});
|
50
|
+
e=SvgScene.append(e,scenes,i)
|
51
|
+
|
52
|
+
end
|
53
|
+
e
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/rubyvis/sceneelement.rb
CHANGED
@@ -5,7 +5,8 @@ module Rubyvis
|
|
5
5
|
end
|
6
6
|
include Enumerable
|
7
7
|
attr_accessor :visible
|
8
|
-
attr_accessor :mark, :type, :child_index, :parent, :parent_index, :target, :defs, :data, :antialias, :line_width, :fill_style, :overflow, :width, :height, :top, :bottom, :left, :right, :title, :reverse, :stroke_style, :transform, :canvas, :_g, :events, :cursor, :children, :id, :segmented, :interpolate, :tension, :name, :text_baseline, :text_align, :text, :font, :text_angle, :text_style, :text_margin, :text_decoration, :text_shadow, :line_join, :eccentricity
|
8
|
+
attr_accessor :mark, :type, :child_index, :parent, :parent_index, :target, :defs, :data, :antialias, :line_width, :fill_style, :overflow, :width, :height, :top, :bottom, :left, :right, :title, :reverse, :stroke_style, :transform, :canvas, :_g, :events, :cursor, :children, :id, :segmented, :interpolate, :tension, :name, :text_baseline, :text_align, :text, :font, :text_angle, :text_style, :text_margin, :text_decoration, :text_shadow, :line_join, :eccentricity, :shape_size, :shape, :shape_angle, :shape_radius, :start_angle, :end_angle, :angle, :inner_radius, :outer_radius
|
9
|
+
|
9
10
|
def []=(v,i)
|
10
11
|
if v.is_a? Numeric
|
11
12
|
@scenes[v]=i
|
data/spec/bar_spec.rb
CHANGED
@@ -20,24 +20,48 @@ require File.dirname(__FILE__)+"/spec_helper.rb"
|
|
20
20
|
@h=200
|
21
21
|
@w=200
|
22
22
|
@vis = Rubyvis.Panel.new.width(@w).height(@h)
|
23
|
-
@vis.add(pv.Bar).data([1,2]).width(20).height(lambda {|d| d * 80}).bottom(0).left(lambda {self.index * 25});
|
23
|
+
@bar=@vis.add(pv.Bar).data([1,2]).width(20).height(lambda {|d| d * 80}).bottom(0).left(lambda {self.index * 25});
|
24
24
|
end
|
25
25
|
it "should bould propertly" do
|
26
26
|
@vis.render
|
27
27
|
s=@vis.to_svg
|
28
28
|
doc=Nokogiri::XML(s)
|
29
|
-
attribs=doc.xpath("//
|
29
|
+
attribs=doc.xpath("//xmlns:rect").map {|v|
|
30
30
|
[v.attributes['y'].value, v.attributes['height'].value, v.attributes['fill'].value]
|
31
31
|
}
|
32
32
|
attribs.should==[["120","80","rgb(31,119,180)"],["40","160","rgb(31,119,180)"]]
|
33
33
|
end
|
34
|
+
|
35
|
+
it "should bould properly with string fill_style" do
|
36
|
+
@bar.fill_style('red')
|
37
|
+
@vis.render
|
38
|
+
s=@vis.to_svg
|
39
|
+
doc=Nokogiri::XML(s)
|
40
|
+
doc.at_xpath("//xmlns:rect").attributes['fill'].value.should=='rgb(255,0,0)'
|
41
|
+
end
|
42
|
+
it "should bould properly with pv.color" do
|
43
|
+
@bar.fill_style(pv.color('red'))
|
44
|
+
@vis.render
|
45
|
+
s=@vis.to_svg
|
46
|
+
doc=Nokogiri::XML(s)
|
47
|
+
doc.at_xpath("//xmlns:rect").attributes['fill'].value.should=='rgb(255,0,0)'
|
48
|
+
end
|
49
|
+
it "should bould properly with pv.colors" do
|
50
|
+
@bar.fill_style(pv.colors('black','red'))
|
51
|
+
@vis.render
|
52
|
+
s=@vis.to_svg
|
53
|
+
doc=Nokogiri::XML(s)
|
54
|
+
attr=doc.xpath("//xmlns:rect").map {|x| x.attributes['fill'].value}
|
55
|
+
attr.should==['rgb(0,0,0)', 'rgb(255,0,0)']
|
56
|
+
end
|
57
|
+
|
34
58
|
it "should bould propertly with double data" do
|
35
59
|
@vis = Rubyvis.Panel.new.width(@w).height(100)
|
36
60
|
@vis.add(pv.Bar).data([1,2]).width(20).height(lambda {|d| d * 10}).bottom(0).left(lambda {self.index * 25}).add(pv.Bar).width(10).height(lambda {|d| d * 30}).bottom(0).left(lambda {self.index * 25});
|
37
61
|
@vis.render
|
38
62
|
s=@vis.to_svg
|
39
63
|
doc=Nokogiri::XML(s)
|
40
|
-
attribs=doc.xpath("//
|
64
|
+
attribs=doc.xpath("//xmlns:rect").map {|v|
|
41
65
|
x=v.attributes['x'] ? v.attributes['x'].value : nil
|
42
66
|
[x, v.attributes['y'].value, v.attributes['height'].value]
|
43
67
|
}
|
data/spec/label_spec.rb
CHANGED
@@ -31,7 +31,7 @@ require File.dirname(__FILE__)+"/spec_helper.rb"
|
|
31
31
|
|
32
32
|
doc=Nokogiri::XML(s)
|
33
33
|
|
34
|
-
attribs=doc.xpath("//
|
34
|
+
attribs=doc.xpath("//xmlns:text").map {|v|
|
35
35
|
[v.attributes['y'].value, v.attributes['transform'].value, v.text] }
|
36
36
|
attribs.should==[["-3","translate(0,100)","1"],["-3","translate(25,100)","2"]]
|
37
37
|
end
|
data/spec/nest_spec.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.dirname(__FILE__)+"/spec_helper.rb"
|
2
|
+
describe Rubyvis::Nest do
|
3
|
+
before do
|
4
|
+
@data=[
|
5
|
+
{ :year=>2010, :city=>'London',:value=>1},
|
6
|
+
{ :year=>2010, :city=>'France',:value=>2},
|
7
|
+
{ :year=>2011, :city=>'London',:value=>5},
|
8
|
+
{ :year=>2011, :city=>'France',:value=>6},
|
9
|
+
|
10
|
+
]
|
11
|
+
end
|
12
|
+
it "should generate correct map" do
|
13
|
+
nest = pv.nest(@data).key(lambda {|d| d[:year]}).key(lambda {|d| d[:city]}).map();
|
14
|
+
expected={2010=>{"London"=>[{:year=>2010, :city=>"London", :value=>1}], "France"=>[{:year=>2010, :city=>"France", :value=>2}]}, 2011=>{"London"=>[{:year=>2011, :city=>"London", :value=>5}], "France"=>[{:year=>2011, :city=>"France", :value=>6}]}}
|
15
|
+
nest.should==expected
|
16
|
+
|
17
|
+
end
|
18
|
+
it "should generate correct entries" do
|
19
|
+
nest = pv.nest(@data).key(lambda {|d| d[:year]}).key(lambda {|d| d[:city]}).entries();
|
20
|
+
expected=[
|
21
|
+
Rubyvis::NestedArray.new(:key=>2010, :values=>
|
22
|
+
[
|
23
|
+
Rubyvis::NestedArray.new(:key=>'London', :values=>
|
24
|
+
[{:year=>2010, :city=>'London',:value=>1}]),
|
25
|
+
Rubyvis::NestedArray.new(:key=>'France', :values=>
|
26
|
+
[{:year=>2010, :city=>'France',:value=>2}])
|
27
|
+
]),
|
28
|
+
Rubyvis::NestedArray.new(:key=>2011, :values=>
|
29
|
+
[
|
30
|
+
Rubyvis::NestedArray.new(:key=>'London', :values=>
|
31
|
+
[{:year=>2011, :city=>'London',:value=>3}]),
|
32
|
+
Rubyvis::NestedArray.new(:key=>'France', :values=>
|
33
|
+
[{:year=>2011, :city=>'France',:value=>4}])
|
34
|
+
])
|
35
|
+
]
|
36
|
+
|
37
|
+
nest.should==expected
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
data/spec/panel_spec.rb
CHANGED
@@ -20,7 +20,7 @@ describe Rubyvis::Panel do
|
|
20
20
|
doc=Nokogiri::XML(@vis.to_svg)
|
21
21
|
values={"font-size"=>"10px", "font-family"=>"sans-serif", "fill"=>"none", "stroke"=>"none", "stroke-width"=>"1.5", "width"=>"200.0", "height"=>"200.0"}
|
22
22
|
values.each {|k,v|
|
23
|
-
doc.at_xpath("//svg").attributes[k].value.should==v
|
23
|
+
doc.at_xpath("//xmlns:svg").attributes[k].value.should==v
|
24
24
|
}
|
25
25
|
end
|
26
26
|
end
|
data/spec/scale_linear_spec.rb
CHANGED
@@ -101,11 +101,11 @@ describe Rubyvis::Scale::Linear do
|
|
101
101
|
@y.ticks(5).should==[0,200,400,600,800,1000]
|
102
102
|
|
103
103
|
end
|
104
|
-
it "should returns correct tick_format"
|
105
104
|
it "should nice nicely" do
|
106
105
|
@y.domain([0.20147987687960267, 0.996679553296417])
|
107
106
|
@y.nice
|
108
107
|
@y.domain().should==[0.2,1]
|
109
|
-
|
110
108
|
end
|
109
|
+
|
110
|
+
it "should returns correct tick_format"
|
111
111
|
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require File.dirname(__FILE__)+"/spec_helper.rb"
|
2
|
+
describe Rubyvis::Scale::Ordinal do
|
3
|
+
if Rubyvis::JohnsonLoader.available?
|
4
|
+
context "direct protovis API comparison" do
|
5
|
+
before(:all) do
|
6
|
+
@rt= Rubyvis::JohnsonLoader.new("/data/OrdinalScale.js").runtime
|
7
|
+
end
|
8
|
+
before do
|
9
|
+
@base = %w{a b c d e f}
|
10
|
+
@range = %w{black red white orange yellow blue}
|
11
|
+
@n=rand(3)+3
|
12
|
+
@base=@base[0,@n]
|
13
|
+
@range=@range[0,@n]
|
14
|
+
@y = Rubyvis.Scale.ordinal(@base).range(@range)
|
15
|
+
@rt[:domain] = @base
|
16
|
+
@rt[:range] = @range
|
17
|
+
@y_js=@rt.evaluate("y=pv.Scale.ordinal(domain).range(range)")
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
it "domain() implemented equally" do
|
22
|
+
@y.domain(@base[0])
|
23
|
+
@rt.evaluate("y.domain(domain[0])")
|
24
|
+
@y.domain.should==@rt.evaluate("y.domain()").to_a
|
25
|
+
@y.domain(@base[0],@base[1])
|
26
|
+
@rt.evaluate("y.domain(domain[0],domain[1])")
|
27
|
+
@y.domain.should==@rt.evaluate("y.domain()").to_a
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
describe "on ruby domain" do
|
33
|
+
it "should be created as Javascript" do
|
34
|
+
lambda {y = Rubyvis.Scale.ordinal(%w{a b c}).range(%w{red blue black})}.should_not raise_exception
|
35
|
+
end
|
36
|
+
|
37
|
+
before do
|
38
|
+
@domain=%w{a b c}
|
39
|
+
@range=%w{red white blue}
|
40
|
+
@y = Rubyvis.Scale.ordinal(@domain).range(@range)
|
41
|
+
end
|
42
|
+
it "y should be a Scale::Ordinal" do
|
43
|
+
@y.should be_a(Rubyvis::Scale::Ordinal)
|
44
|
+
end
|
45
|
+
it "should respond to domain" do
|
46
|
+
@y.domain.should==%w{a b c}
|
47
|
+
@y.domain(%w{a})
|
48
|
+
@y.domain.should==%w{a}
|
49
|
+
@y.domain(1,100,300)
|
50
|
+
@y.domain.should==[1,100,300]
|
51
|
+
end
|
52
|
+
it "should respond to range" do
|
53
|
+
@y.range.should==@range.map {|c| pv.color(c)}
|
54
|
+
@y.range('red')
|
55
|
+
@y.range.should==[pv.color('red')]
|
56
|
+
@y.range('black','white')
|
57
|
+
@y.range.should==[pv.color('black'), pv.color('white')]
|
58
|
+
end
|
59
|
+
it "should returns correct scale with unknown values" do
|
60
|
+
@y.scale(1).should==pv.color('red')
|
61
|
+
@y.scale('x').should==pv.color('white')
|
62
|
+
@y.scale(9).should==pv.color('blue')
|
63
|
+
@y.scale(1).should==pv.color('red')
|
64
|
+
end
|
65
|
+
it "should returns correct scale with known values" do
|
66
|
+
@y.scale('a').should==pv.color('red')
|
67
|
+
@y.scale('b').should==pv.color('white')
|
68
|
+
@y.scale('c').should==pv.color('blue')
|
69
|
+
end
|
70
|
+
it "should return correct by" do
|
71
|
+
@y = Rubyvis.Scale.ordinal(@domain).range(@range).by(lambda {|v| v.nombre})
|
72
|
+
a=OpenStruct.new({:nombre=>'c'})
|
73
|
+
b=OpenStruct.new({:nombre=>'b'})
|
74
|
+
c=OpenStruct.new({:nombre=>'a'})
|
75
|
+
@y.call(a).should==pv.color('blue')
|
76
|
+
@y.call(b).should==pv.color('white')
|
77
|
+
@y.call(c).should==pv.color('red')
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/spec/spec.opts
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Claudio Bustos
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
rpP0jjs0
|
36
36
|
-----END CERTIFICATE-----
|
37
37
|
|
38
|
-
date: 2010-10-
|
38
|
+
date: 2010-10-08 00:00:00 -04:00
|
39
39
|
default_executable:
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -82,10 +82,20 @@ files:
|
|
82
82
|
- Manifest.txt
|
83
83
|
- README.txt
|
84
84
|
- Rakefile
|
85
|
+
- examples/antibiotics/antibiotics.rb
|
86
|
+
- examples/antibiotics/antibiotics_data.rb
|
87
|
+
- examples/area.rb
|
88
|
+
- examples/bar_column_chart.rb
|
85
89
|
- examples/barley/barley.rb
|
90
|
+
- examples/barley/barley_data.rb
|
86
91
|
- examples/crimea/crimea.rb
|
92
|
+
- examples/crimea/crimea_grouped_bar.rb
|
87
93
|
- examples/crimea/crimea_line.rb
|
94
|
+
- examples/dot.rb
|
88
95
|
- examples/first.rb
|
96
|
+
- examples/line.rb
|
97
|
+
- examples/pie_and_donut.rb
|
98
|
+
- examples/scatterplot.rb
|
89
99
|
- examples/second.rb
|
90
100
|
- examples/third.rb
|
91
101
|
- lib/rubyvis.rb
|
@@ -102,21 +112,28 @@ files:
|
|
102
112
|
- lib/rubyvis/mark/anchor.rb
|
103
113
|
- lib/rubyvis/mark/area.rb
|
104
114
|
- lib/rubyvis/mark/bar.rb
|
115
|
+
- lib/rubyvis/mark/dot.rb
|
105
116
|
- lib/rubyvis/mark/label.rb
|
106
117
|
- lib/rubyvis/mark/line.rb
|
107
118
|
- lib/rubyvis/mark/panel.rb
|
108
119
|
- lib/rubyvis/mark/rule.rb
|
120
|
+
- lib/rubyvis/mark/wedge.rb
|
121
|
+
- lib/rubyvis/nest.rb
|
109
122
|
- lib/rubyvis/property.rb
|
110
123
|
- lib/rubyvis/scale.rb
|
111
124
|
- lib/rubyvis/scale/linear.rb
|
125
|
+
- lib/rubyvis/scale/log.rb
|
112
126
|
- lib/rubyvis/scale/ordinal.rb
|
113
127
|
- lib/rubyvis/scale/quantitative.rb
|
128
|
+
- lib/rubyvis/scene/svg_area.rb
|
114
129
|
- lib/rubyvis/scene/svg_bar.rb
|
130
|
+
- lib/rubyvis/scene/svg_dot.rb
|
115
131
|
- lib/rubyvis/scene/svg_label.rb
|
116
132
|
- lib/rubyvis/scene/svg_line.rb
|
117
133
|
- lib/rubyvis/scene/svg_panel.rb
|
118
134
|
- lib/rubyvis/scene/svg_rule.rb
|
119
135
|
- lib/rubyvis/scene/svg_scene.rb
|
136
|
+
- lib/rubyvis/scene/svg_wedge.rb
|
120
137
|
- lib/rubyvis/sceneelement.rb
|
121
138
|
- lib/rubyvis/transform.rb
|
122
139
|
- spec/bar_spec.rb
|
@@ -124,9 +141,11 @@ files:
|
|
124
141
|
- spec/javascript_behaviour_spec.rb
|
125
142
|
- spec/label_spec.rb
|
126
143
|
- spec/mark_spec.rb
|
144
|
+
- spec/nest_spec.rb
|
127
145
|
- spec/panel_spec.rb
|
128
146
|
- spec/scale_linear_datetime_spec.rb
|
129
147
|
- spec/scale_linear_spec.rb
|
148
|
+
- spec/scale_ordinal_spec.rb
|
130
149
|
- spec/scale_spec.rb
|
131
150
|
- spec/spec.opts
|
132
151
|
- spec/spec_helper.rb
|
@@ -259,6 +278,8 @@ specification_version: 3
|
|
259
278
|
summary: Ruby port of Protovis, a great visualization toolkit
|
260
279
|
test_files:
|
261
280
|
- spec/bar_spec.rb
|
281
|
+
- spec/nest_spec.rb
|
282
|
+
- spec/scale_ordinal_spec.rb
|
262
283
|
- spec/internal_spec.rb
|
263
284
|
- spec/panel_spec.rb
|
264
285
|
- spec/scale_linear_datetime_spec.rb
|