import org.sonar.api.web.*;
@WidgetProperties({
- @WidgetProperty(key = "heightInPercents", type= WidgetPropertyType.INTEGER, defaultValue = "50", description = "Height in percents of width"),
@WidgetProperty(key = "sizeMetric", type= WidgetPropertyType.METRIC, defaultValue = CoreMetrics.NCLOC_KEY, description = "Default metric for size"),
@WidgetProperty(key = "colorMetric", type= WidgetPropertyType.METRIC, defaultValue = CoreMetrics.VIOLATIONS_DENSITY_KEY, description = "Default metric for color")
})
-<%= render :partial => 'treemap/treemap_container', :locals => {
- :treemap_id => widget.id,
- :size_metric => widget_properties['sizeMetric'],
- :color_metric => widget_properties['colorMetric'],
- :height_in_percents => widget_properties['heightInPercents'],
- :context_type => 'resource',
- :context_id => @resource.id
- } -%>
\ No newline at end of file
+<%
+ size_metric = widget_properties['sizeMetric']
+ color_metric = widget_properties['colorMetric']
+
+ filter = MeasureFilter.new
+ filter.set_criteria_value('baseId', @resource.id)
+ filter.set_criteria_value('display', 'treemap')
+ filter.set_criteria_value('tmSize', size_metric.key) if size_metric
+ filter.set_criteria_value('tmColor', color_metric.key) if color_metric
+ filter.execute(self, :user => current_user)
+%>
+<%= render :partial => "measures/display_treemap", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>