rubyvis 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -1
- data/Manifest.txt +9 -4
- data/README.txt +59 -8
- data/examples/antibiotics/antibiotics.rb +16 -8
- data/examples/area.rb +6 -49
- data/examples/bar_column_chart.rb +4 -0
- data/examples/crimea/{crimea.rb → crimea_data.rb} +0 -0
- data/examples/crimea/crimea_grouped_bar.rb +2 -2
- data/examples/crimea/crimea_line.rb +1 -1
- data/examples/dot.rb +7 -8
- data/examples/first.rb +4 -0
- data/examples/grouped_charts.rb +3 -0
- data/examples/line.rb +19 -61
- data/examples/line_and_step.rb +4 -0
- data/examples/nested_grid.rb +53 -0
- data/examples/scatterplot.rb +2 -0
- data/examples/second.rb +14 -2
- data/examples/third.rb +9 -6
- data/lib/rubyvis/color/color.rb +8 -6
- data/lib/rubyvis/color/colors.rb +4 -6
- data/lib/rubyvis/format/number.rb +2 -2
- data/lib/rubyvis/internals.rb +15 -3
- data/lib/rubyvis/javascript_behaviour.rb +20 -8
- data/lib/rubyvis/layout/stack.rb +13 -16
- data/lib/rubyvis/mark/anchor.rb +64 -2
- data/lib/rubyvis/mark/area.rb +4 -3
- data/lib/rubyvis/mark/bar.rb +51 -2
- data/lib/rubyvis/mark/dot.rb +88 -5
- data/lib/rubyvis/mark/label.rb +94 -3
- data/lib/rubyvis/mark/line.rb +3 -2
- data/lib/rubyvis/mark/panel.rb +1 -0
- data/lib/rubyvis/mark/rule.rb +2 -1
- data/lib/rubyvis/mark/wedge.rb +2 -1
- data/lib/rubyvis/mark.rb +419 -54
- data/lib/rubyvis/nest.rb +20 -20
- data/lib/rubyvis/scale/linear.rb +1 -1
- data/lib/rubyvis/scale/log.rb +1 -1
- data/lib/rubyvis/scale/ordinal.rb +120 -8
- data/lib/rubyvis/scale/quantitative.rb +159 -15
- data/lib/rubyvis/scale.rb +1 -1
- data/lib/rubyvis/scene/svg_area.rb +12 -12
- data/lib/rubyvis/scene/svg_line.rb +5 -5
- data/lib/rubyvis/scene/svg_panel.rb +1 -1
- data/lib/rubyvis/scene/svg_scene.rb +1 -1
- data/lib/rubyvis.rb +35 -6
- data/spec/anchor_spec.rb +15 -15
- data/web/Rakefile +34 -0
- data/web/build_site.rb +86 -0
- data/web/examples.haml +26 -0
- data/web/index.haml +97 -0
- data/web/style.css +82 -0
- data.tar.gz.sig +0 -0
- metadata +14 -9
- metadata.gz.sig +0 -0
- data/lib/rubyvis/label.rb +0 -1
- data/web/first.svg +0 -1
- data/web/index.html +0 -48
data/lib/rubyvis/mark/rule.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
module Rubyvis
|
2
|
+
# Alias for Rubyvis::Rule
|
2
3
|
def self.Rule
|
3
4
|
Rubyvis::Rule
|
4
5
|
end
|
5
6
|
class Rule < Mark
|
6
7
|
include LinePrototype
|
7
8
|
@properties=Mark.properties.dup
|
8
|
-
attr_accessor_dsl :width, :height, :line_width, [:stroke_style, lambda {|d|
|
9
|
+
attr_accessor_dsl :width, :height, :line_width, [:stroke_style, lambda {|d| Rubyvis.color(d)}]
|
9
10
|
def self.defaults
|
10
11
|
Rule.new.extend(Mark.defaults).line_width(1).stroke_style('black').antialias(false)
|
11
12
|
end
|
data/lib/rubyvis/mark/wedge.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
module Rubyvis
|
2
|
+
# Alias for Rubyvis::Wedge
|
2
3
|
def self.Wedge
|
3
4
|
Rubyvis::Wedge
|
4
5
|
end
|
@@ -7,7 +8,7 @@ module Rubyvis
|
|
7
8
|
"wedge"
|
8
9
|
end
|
9
10
|
@properties=Mark.properties.dup
|
10
|
-
attr_accessor_dsl :start_angle, :end_angle, :angle, :inner_radius, :outer_radius, :line_width, [:stroke_style, lambda {|d|
|
11
|
+
attr_accessor_dsl :start_angle, :end_angle, :angle, :inner_radius, :outer_radius, :line_width, [:stroke_style, lambda {|d| Rubyvis.color(d)}], [:fill_style, lambda {|d| Rubyvis.color(d)}]
|
11
12
|
def self.defaults
|
12
13
|
a=Rubyvis.Colors.category20()
|
13
14
|
Wedge.new.extend(Mark.defaults).start_angle(lambda {s=self.sibling; s ? s.end_angle: -Math::PI.quo(2) } ).inner_radius( 0 ).line_width( 1.5 ).stroke_style( nil ).fill_style( lambda {a.scale(self.index)})
|