Class: Plotly::Marker

Inherits:
Object show all
Includes:
Castable
Defined in:
lib/plotly/marker.rb

Constant Summary collapse

ATTRS =
%i(size color opacity line).freeze

Instance Method Summary collapse

Methods included from Castable

#to_h

Constructor Details

#initialize(opts) ⇒ Marker

Returns a new instance of Marker.

Parameters:

  • opts (Hash)

    a customizable set of options

Options Hash (opts):

  • size (Fixnum)
  • color (String)

    e.g.‘rgba(0, 0, 200, .5)’

  • line (Hash or Plotly::Line)


14
15
16
17
18
19
20
21
# File 'lib/plotly/marker.rb', line 14

def initialize(opts)
  return unless opts.is_a?(Hash)

  opts.each do |k, v|
    v.convert_to(Plotly::Line) if k.to_sym == :line
    instance_variable_set("@#{k}", v)
  end
end