};
+ // Configure metric label
+ this.metricLabel = this.gWrap.append('text')
+ .text(this.metrics()[this.mainMetric].name)
+ .attr('dy', '9px')
+ .style('font-size', '11px');
+
+
// Show maxResultsReached message
if (this.maxResultsReached()) {
this.maxResultsReachedLabel = this.gWrap.append('text')
// Update available size
this.availableWidth = this.width() - this.margin().left - this.margin().right - this.legendWidth();
- this.availableHeight = barHeight * this.components().length;
+ this.availableHeight = barHeight * this.components().length + this._lineHeight;
var totalHeight = this.availableHeight + this.margin().top + this.margin().bottom;
if (this.maxResultsReached()) {
totalHeight += this._lineHeight;
.attr('height', this.height());
+ // Update plot
+ this.plotWrap
+ .attr('transform', trans(0, this._lineHeight));
+
+
// Update scales
- var xDomain;
- if (this.options().displayWorstBestValues) {
- var metric = this.metrics()[this.mainMetric];
+ var xDomain,
+ metric = this.metrics()[this.mainMetric];
+ if (this.options().displayWorstBestValues && metric.worstValue != null && metric.bestValue != null) {
xDomain = [metric.worstValue, metric.bestValue];
} else {
xDomain = d3.extent(this.components(), function(d) {
}
this.x
.domain(xDomain)
- .range([this.availableWidth / 8, this.availableWidth]);
+ .range([0, this.availableWidth]);
this.y
.domain(this.components().map(function(d, i) { return i; }))
.transition()
.attr('x', this.legendWidth())
.attr('y', 0)
- .attr('width', function(d) { return widget.x(widget.getMainMetric(d)); })
+ .attr('width', function(d) { return Math.max(2, widget.x(widget.getMainMetric(d))); })
.attr('height', barHeight);
this.bars.selectAll('.component')
});
+ // Configure metric label
+ this.metricLabel
+ .attr('transform', trans(this.legendWidth(), 0));
+
+
// Show maxResultsReached message
if (this.maxResultsReached()) {
this.maxResultsReachedLabel