Class: RCharts::GraphHelper::Series::Point
- Inherits:
-
Struct
- Object
- Struct
- RCharts::GraphHelper::Series::Point
- Defined in:
- app/helpers/rcharts/graph_helper/series/point.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #complete? ⇒ Boolean
- #control(previous_point, next_point, smoothing: 1.0, reverse: false) ⇒ Object
- #incomplete? ⇒ Boolean
- #to_s ⇒ Object
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x
7 8 9 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 7 def x @x end |
#y ⇒ Object
Returns the value of attribute y
7 8 9 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 7 def y @y end |
Instance Method Details
#+(other) ⇒ Object
10 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 10 def +(other) = Point.new(x + other.x, y + other.y) |
#-(other) ⇒ Object
12 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 12 def -(other) = Point.new(x - other.x, y - other.y) |
#complete? ⇒ Boolean
24 25 26 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 24 def complete? !incomplete? end |
#control(previous_point, next_point, smoothing: 1.0, reverse: false) ⇒ Object
14 15 16 17 18 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 14 def control(previous_point, next_point, smoothing: 1.0, reverse: false) (self + handle_offset(previous_point, next_point, smoothing:, reverse:)).then do |control| clamp(control, (reverse ? previous_point : next_point)) end end |
#incomplete? ⇒ Boolean
20 21 22 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 20 def incomplete? x.nil? || y.nil? end |
#to_s ⇒ Object
8 |
# File 'app/helpers/rcharts/graph_helper/series/point.rb', line 8 def to_s = "#{x},#{y}" |