Class: Plotly::Layout
Constant Summary collapse
- ATTRS =
i(title xaxis yaxis).freeze
- AXISES =
i(xaxis yaxis).freeze
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Layout
constructor
A new instance of Layout.
Methods included from Castable
Constructor Details
#initialize(opts = {}) ⇒ Layout
Returns a new instance of Layout.
17 18 19 20 21 22 23 24 |
# File 'lib/plotly/layout.rb', line 17 def initialize(opts = {}) return unless opts.is_a?(Hash) opts.each do |k, v| v.convert_to(Plotly::Axis) if AXISES.include?(k) instance_variable_set("@#{k}", v) end end |