Module: Treemap

Defined in:
lib/chart_helpers/less_common/treemap.rb

Instance Method Summary collapse

Instance Method Details

#radio_input(value, checked) ⇒ Object



11
12
13
14
15
# File 'lib/chart_helpers/less_common/treemap.rb', line 11

def radio_input value, checked
  data = radio_button_tag( :mode, value, checked )
  data << value
  ( :label, data, class: 'radio inline')
end

#treemap(data_url, element = '.treemap') ⇒ Object



3
4
5
6
7
8
9
# File 'lib/chart_helpers/less_common/treemap.rb', line 3

def treemap( data_url, element='.treemap' )
  TreemapGenerator.new.generate( element, data_url )
  treemap_inputs =  radio_input( 'size', true )
  treemap_inputs << radio_input( 'count', false )
  treemap_form   =  ( :form, treemap_inputs )
  ( :div, treemap_form, class: element[1..-1] )
end