Module: Nyaplot::Diagrams::Scatter

Includes:
Jsonizable
Defined in:
lib/nyaplot/diagram.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Jsonizable

#before_to_json, #get_property, included, #init_properties, #set_property, #to_json

Instance Attribute Details

#colorArray<String>

Returns color code.

Returns:

  • (Array<String>)

    color code



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#fill_bySymbol

Returns the column label to decide how to fill sybmols.

Returns:

  • (Symbol)

    the column label to decide how to fill sybmols



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#shapeArray<String>

Returns shapes for each symbol.

Returns:

  • (Array<String>)

    shapes for each symbol



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#shape_bySymbol

Returns the column label to decide shapes.

Returns:

  • (Symbol)

    the column label to decide shapes



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#sizeArray<Numeric>

Returns the range of symbol size.

Returns:

  • (Array<Numeric>)

    the range of symbol size



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#size_bySymbol

Returns the column label to decide size of symbols.

Returns:

  • (Symbol)

    the column label to decide size of symbols



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#stroke_colorString

Returns color code.

Returns:

  • (String)

    color code



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#stroke_widthNumeric

Returns the width of stroke.

Returns:

  • (Numeric)

    the width of stroke



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#titleString

Returns the title of this chart.

Returns:

  • (String)

    the title of this chart



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#tooltip_contentsArray<Symbol>

Returns column labels to display in tool-tip box.

Returns:

  • (Array<Symbol>)

    column labels to display in tool-tip box



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#xSymbol

Returns the column label from which the line chart is created.

Returns:

  • (Symbol)

    the column label from which the line chart is created



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

#ySymbol

Returns the column label from which the line chart is created.

Returns:

  • (Symbol)

    the column label from which the line chart is created



165
# File 'lib/nyaplot/diagram.rb', line 165

define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents])

Instance Method Details

#process_data(df, labels) ⇒ Object



167
168
169
170
171
172
173
174
# File 'lib/nyaplot/diagram.rb', line 167

def process_data(df, labels)
  label_x = labels[0]
  label_y = labels[1]
  x(label_x)
  y(label_y)
  @xrange = [df[label_x].to_a.min, df[label_x].to_a.max]
  @yrange = [df[label_y].to_a.min, df[label_y].to_a.max]
end

#zoom?Boolean

Returns:

  • (Boolean)


176
177
178
# File 'lib/nyaplot/diagram.rb', line 176

def zoom?
  true
end