@WidgetProperties({
@WidgetProperty(key = MeasureFilterTreemapWidget.FILTER_PROPERTY, type = WidgetPropertyType.FILTER, optional = false),
@WidgetProperty(key = MeasureFilterTreemapWidget.SIZE_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true),
- @WidgetProperty(key = MeasureFilterTreemapWidget.COLOR_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true)
+ @WidgetProperty(key = MeasureFilterTreemapWidget.COLOR_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true, options = "type:PERCENT")
}
)
public class MeasureFilterTreemapWidget extends AbstractRubyTemplate implements RubyRailsWidget {
this.colorMetric = colorMetric;
this.breadcrumb = [];
treemaps[id] = this;
- this.rootNode().height(this.rootNode().width() * 0.6);
+ this.rootNode().height(this.rootNode().width() * 0.55);
this.initNodes();
};
-Treemap.prototype.changeSizeMetric = function (metric) {
- this.sizeMetric = metric;
- this.load();
- return false;
-};
-Treemap.prototype.changeColorMetric = function (metric) {
- this.colorMetric = metric;
- this.load();
- return false;
-};
Treemap.prototype.currentContext = function () {
if (this.breadcrumb.length > 0) {
return this.breadcrumb[this.breadcrumb.length - 1];
});
});
$j('#tm-' + this.id).find('[rid]').each(function (index) {
- this.on("contextmenu", function (event) {
- event.preventDefault();
- // right click
- if (self.breadcrumb.length > 1) {
- self.breadcrumb.pop();
+ this.on("contextmenu", function (event) {
+ event.stopPropagation();
+ event.preventDefault();
+ // right click
+ if (self.breadcrumb.length > 1) {
+ self.breadcrumb.pop();
+ self.load();
+ } else {
+ $j("#tm-loading-" + self.id).show();
+ location.reload();
+ }
+ return false;
+ });
+
+ this.on("click", function (event) {
+ var source = $j(this);
+ var rid = source.attr('rid');
+ var has_leaves = !!(source.attr('l'));
+ if (!has_leaves) {
+ var context = new TreemapContext(rid, source.text());
+ self.breadcrumb.push(context);
self.load();
- } else {
- location.reload();
}
- return false;
- });
- this.on("click", function (event) {
- var source = $j(this);
- var rid = source.attr('rid');
- var has_leaves = !!(source.attr('l'));
- if (!has_leaves) {
- var context = new TreemapContext(rid, source.text());
- self.breadcrumb.push(context);
- self.load();
- }
- }
- );
- }
- );
+ }
+ )
+ });
};
(function ($j) {