2 filter_id = widget_properties['filter']
3 size_metric = widget_properties['sizeMetric']
4 color_metric = widget_properties['colorMetric']
5 filter = MeasureFilter.find_by_id(filter_id.to_i) if filter_id
6 if filter && (!filter.require_authentication? || logged_in?)
7 url_options = {:controller => 'measures', :action => 'filter', :id => filter.id, :display => 'treemap'}
8 filter.load_criteria_from_data
9 filter.set_criteria_value('display', 'treemap')
11 filter.set_criteria_value('tmSize', size_metric.key)
12 url_options['tmSize']=size_metric.key
15 filter.set_criteria_value('tmColor', color_metric.key)
16 url_options['tmColor']=color_metric.key
18 filter.execute(self, :user => current_user)
20 @widget_title = link_to h(filter.name), url_options
22 <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>