Method: Rubyvis::Mark#scale
- Defined in:
- lib/rubyvis/mark.rb
#scale ⇒ Object
The current scale factor, based on any enclosing transforms. The current scale can be used to create scale-independent graphics. For example, to define a dot that has a radius of 10 irrespective of any zooming, say:
<pre>dot.shape_radius(lambda { 10 / self.scale})</pre>
Note that the stroke width and font size are defined irrespective of scale (i.e., in screen space) already. Also note that when a transform is applied to a panel, the scale affects only the child marks, not the panel itself.
107 108 109 |
# File 'lib/rubyvis/mark.rb', line 107 def scale @scale end |