Module: Nyaplot::Diagrams::Heatmap

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Jsonizable

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

Instance Attribute Details

#colorArray<String>

Returns array of color codes

Returns:

  • (Array<String>)

    array of color codes


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#fillSymbol

Returns the column label

Returns:

  • (Symbol)

    the column label


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#heightString

Returns the height

Returns:

  • (String)

    the height


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#hoverBoolean

Returns whether to change color when hovering

Returns:

  • (Boolean)

    whether to change color when hovering


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#stroke_colorString

Returns color code

Returns:

  • (String)

    color code


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#stroke_widthNumeric

Returns the width of stroke

Returns:

  • (Numeric)

    the width of stroke


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#titleString

Returns the title of this chart

Returns:

  • (String)

    the title of this chart


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#widthString

Returns the width

Returns:

  • (String)

    the width


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#xSymbol

Returns the column label from which histogram is created

Returns:

  • (Symbol)

    the column label from which histogram is created


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

#ySymbol

Returns the column label from which histogram is created

Returns:

  • (Symbol)

    the column label from which histogram is created


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

define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover])

Instance Method Details

#process_data(df, labels) ⇒ Object


326
327
328
329
330
331
332
333
334
335
# File 'lib/nyaplot/diagram.rb', line 326

def process_data(df, labels)
  label_x = labels[0]
  label_y = labels[1]
  label_fill = labels[2]
  x(label_x)
  y(label_y)
  fill(label_fill)
  @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)

337
338
339
# File 'lib/nyaplot/diagram.rb', line 337

def zoom?
  true
end