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
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
19 if !filter.require_authentication? || logged_in?
20 filter.execute(self, :user => current_user)
22 @widget_title = link_to h(filter.name), url_options
24 <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>
29 <p><%= image_tag 'warning.png' %> <%= message 'measure_filter.widget.unknown_filter_warning' -%></p>