Class: RubyPost::BaseGraphData
- Inherits:
-
BaseDrawCommand
- Object
- Object
- BaseDrawCommand
- RubyPost::BaseGraphData
- Defined in:
- lib/graph.rb
Overview
Base class for all graph data. There are some commands, such as autogrid that must be called after the data is entered with gdraw. There are others that must be set before the call, such as setcoords. These macro ensure that order is maintained
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseDrawCommand
Instance Method Summary collapse
- #add_coords(coords) ⇒ Object
-
#add_grid(grid) ⇒ Object
add a grid to the graph.
-
#add_label(coords) ⇒ Object
add a label to this graph data.
- #add_post_command(c) ⇒ Object
- #add_pre_command(c) ⇒ Object
- #add_range(range) ⇒ Object
- #compile_post_commands ⇒ Object
- #compile_pre_commands ⇒ Object
-
#initialize ⇒ BaseGraphData
constructor
A new instance of BaseGraphData.
Methods inherited from BaseDrawCommand
#add_option, #color, #colour, #compile_options, #rotate, #scale, #set_drawable, #translate
Methods inherited from Object
Constructor Details
#initialize ⇒ BaseGraphData
Returns a new instance of BaseGraphData.
60 61 62 63 64 |
# File 'lib/graph.rb', line 60 def initialize super() @pre_commands = Array.new @post_commands = Array.new end |
Instance Method Details
#add_coords(coords) ⇒ Object
90 91 92 |
# File 'lib/graph.rb', line 90 def add_coords(coords) add_pre_command(coords) end |
#add_grid(grid) ⇒ Object
add a grid to the graph. This is always done as a post command in metapost
82 83 84 |
# File 'lib/graph.rb', line 82 def add_grid(grid) add_post_command(grid) end |
#add_label(coords) ⇒ Object
add a label to this graph data
95 96 97 |
# File 'lib/graph.rb', line 95 def add_label(coords) add_post_command(coords) end |
#add_post_command(c) ⇒ Object
70 71 72 |
# File 'lib/graph.rb', line 70 def add_post_command(c) @post_commands.push(c) end |
#add_pre_command(c) ⇒ Object
66 67 68 |
# File 'lib/graph.rb', line 66 def add_pre_command(c) @pre_commands.push(c) end |
#add_range(range) ⇒ Object
86 87 88 |
# File 'lib/graph.rb', line 86 def add_range(range) add_pre_command(range) end |