rubyvis 0.1.5 → 0.1.6

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.
Files changed (57) hide show
  1. data/History.txt +9 -1
  2. data/Manifest.txt +9 -4
  3. data/README.txt +59 -8
  4. data/examples/antibiotics/antibiotics.rb +16 -8
  5. data/examples/area.rb +6 -49
  6. data/examples/bar_column_chart.rb +4 -0
  7. data/examples/crimea/{crimea.rb → crimea_data.rb} +0 -0
  8. data/examples/crimea/crimea_grouped_bar.rb +2 -2
  9. data/examples/crimea/crimea_line.rb +1 -1
  10. data/examples/dot.rb +7 -8
  11. data/examples/first.rb +4 -0
  12. data/examples/grouped_charts.rb +3 -0
  13. data/examples/line.rb +19 -61
  14. data/examples/line_and_step.rb +4 -0
  15. data/examples/nested_grid.rb +53 -0
  16. data/examples/scatterplot.rb +2 -0
  17. data/examples/second.rb +14 -2
  18. data/examples/third.rb +9 -6
  19. data/lib/rubyvis/color/color.rb +8 -6
  20. data/lib/rubyvis/color/colors.rb +4 -6
  21. data/lib/rubyvis/format/number.rb +2 -2
  22. data/lib/rubyvis/internals.rb +15 -3
  23. data/lib/rubyvis/javascript_behaviour.rb +20 -8
  24. data/lib/rubyvis/layout/stack.rb +13 -16
  25. data/lib/rubyvis/mark/anchor.rb +64 -2
  26. data/lib/rubyvis/mark/area.rb +4 -3
  27. data/lib/rubyvis/mark/bar.rb +51 -2
  28. data/lib/rubyvis/mark/dot.rb +88 -5
  29. data/lib/rubyvis/mark/label.rb +94 -3
  30. data/lib/rubyvis/mark/line.rb +3 -2
  31. data/lib/rubyvis/mark/panel.rb +1 -0
  32. data/lib/rubyvis/mark/rule.rb +2 -1
  33. data/lib/rubyvis/mark/wedge.rb +2 -1
  34. data/lib/rubyvis/mark.rb +419 -54
  35. data/lib/rubyvis/nest.rb +20 -20
  36. data/lib/rubyvis/scale/linear.rb +1 -1
  37. data/lib/rubyvis/scale/log.rb +1 -1
  38. data/lib/rubyvis/scale/ordinal.rb +120 -8
  39. data/lib/rubyvis/scale/quantitative.rb +159 -15
  40. data/lib/rubyvis/scale.rb +1 -1
  41. data/lib/rubyvis/scene/svg_area.rb +12 -12
  42. data/lib/rubyvis/scene/svg_line.rb +5 -5
  43. data/lib/rubyvis/scene/svg_panel.rb +1 -1
  44. data/lib/rubyvis/scene/svg_scene.rb +1 -1
  45. data/lib/rubyvis.rb +35 -6
  46. data/spec/anchor_spec.rb +15 -15
  47. data/web/Rakefile +34 -0
  48. data/web/build_site.rb +86 -0
  49. data/web/examples.haml +26 -0
  50. data/web/index.haml +97 -0
  51. data/web/style.css +82 -0
  52. data.tar.gz.sig +0 -0
  53. metadata +14 -9
  54. metadata.gz.sig +0 -0
  55. data/lib/rubyvis/label.rb +0 -1
  56. data/web/first.svg +0 -1
  57. data/web/index.html +0 -48
@@ -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| pv.color(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
@@ -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| pv.color(d)}], [:fill_style, lambda {|d| pv.color(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)})