From 486de1283ab3d18ee255b89da1870690136d1de2 Mon Sep 17 00:00:00 2001 From: "rniwa@webkit.org" Date: Fri, 3 Apr 2015 20:43:56 +0000 Subject: [PATCH] REGRESSION: Perf dashboard sometimes fails to update zooming level https://bugs.webkit.org/show_bug.cgi?id=143359 Reviewed by Darin Adler. The bug was caused by various bugs that ended up in an exception. * public/v2/app.js: (App.Pane._handleFetchErrors): Removed superfluous console.log. (App.Pane.computeStatus): Fixed the bug in r182185 that previousPoint could be null. (App.PaneController.actions.zoomed): Update the overview when the main chart triggered a zoom. * public/v2/index.html: Replaced all instances of href="#" by href="javascript:false" to avoid navigating to # when Ember.js fails to attach event listeners on time. * public/v2/interactive-chart.js: (App.InteractiveChartComponent._updateDimensionsIfNeeded): Avoid using a negative width or height when the containing element's size is 0. (App.InteractiveChartComponent._updateBrush): Ditto. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182329 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Websites/perf.webkit.org/ChangeLog | 20 ++++++++++++ Websites/perf.webkit.org/public/v2/app.js | 12 +++++-- Websites/perf.webkit.org/public/v2/index.html | 32 +++++++++---------- .../public/v2/interactive-chart.js | 6 ++-- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog index 195ebd3c9f3c..bb80e125cc87 100644 --- a/Websites/perf.webkit.org/ChangeLog +++ b/Websites/perf.webkit.org/ChangeLog @@ -1,3 +1,23 @@ +2015-04-03 Ryosuke Niwa + + REGRESSION: Perf dashboard sometimes fails to update zooming level + https://bugs.webkit.org/show_bug.cgi?id=143359 + + Reviewed by Darin Adler. + + The bug was caused by various bugs that ended up in an exception. + + * public/v2/app.js: + (App.Pane._handleFetchErrors): Removed superfluous console.log. + (App.Pane.computeStatus): Fixed the bug in r182185 that previousPoint could be null. + (App.PaneController.actions.zoomed): Update the overview when the main chart triggered a zoom. + * public/v2/index.html: Replaced all instances of href="#" by href="javascript:false" to avoid navigating + to # when Ember.js fails to attach event listeners on time. + * public/v2/interactive-chart.js: + (App.InteractiveChartComponent._updateDimensionsIfNeeded): Avoid using a negative width or height when + the containing element's size is 0. + (App.InteractiveChartComponent._updateBrush): Ditto. + 2015-04-02 Ryosuke Niwa Perf dashboard should have UI to test out anomaly detection strategies diff --git a/Websites/perf.webkit.org/public/v2/app.js b/Websites/perf.webkit.org/public/v2/app.js index 4595f10e6893..6a53a32702fe 100755 --- a/Websites/perf.webkit.org/public/v2/app.js +++ b/Websites/perf.webkit.org/public/v2/app.js @@ -374,7 +374,6 @@ App.Pane = Ember.Object.extend({ }, _handleFetchErrors: function (platformId, metricId, result) { - console.log(platformId, metricId, result) if (!result || typeof(result) === "string") this.set('failure', 'Failed to fetch the JSON with an error: ' + result); else if (!result.platform) @@ -423,13 +422,18 @@ App.Pane = Ember.Object.extend({ } else if (diffFromTarget !== undefined) label = formatter(Math.abs(diffFromTarget)) + ' until target'; - var valueDelta = previousPoint ? chartData.deltaFormatter(currentPoint.value - previousPoint.value) : null; + var valueDelta = null; + var relativeDelta = null; + if (previousPoint) { + valueDelta = chartData.deltaFormatter(currentPoint.value - previousPoint.value); + relativeDelta = d3.format('+.2p')((currentPoint.value - previousPoint.value) / previousPoint.value); + } return { className: className, label: label, currentValue: chartData.formatter(currentPoint.value), valueDelta: valueDelta, - relativeDelta: d3.format('+.2p')((currentPoint.value - previousPoint.value) / previousPoint.value), + relativeDelta: relativeDelta, }; }, _relativeDifferentToLaterPointInTimeSeries: function (currentPoint, timeSeries) @@ -969,6 +973,8 @@ App.PaneController = Ember.ObjectController.extend({ zoomed: function (selection) { this.set('mainPlotDomain', selection ? selection : this.get('overviewDomain')); + if (selection) + this.set('overviewSelection', selection); Ember.run.debounce(this, 'propagateZoom', 100); }, }, diff --git a/Websites/perf.webkit.org/public/v2/index.html b/Websites/perf.webkit.org/public/v2/index.html index a62db5dd2c95..4ecf3bb662a4 100755 --- a/Websites/perf.webkit.org/public/v2/index.html +++ b/Websites/perf.webkit.org/public/v2/index.html @@ -31,7 +31,7 @@ {{view App.NumberOfDaysControlView tagName="ul" numberOfDays=numberOfDays}}
  • - + {{#if controller.editMode}} Finish editing {{else}} @@ -49,7 +49,7 @@ {{#each headerColumns}} {{#if controller.editMode}} - + {{partial "close-button"}} {{input value=label}} @@ -68,7 +68,7 @@ {{#if controller.editMode}} - + {{partial "close-button"}} {{input value=header}} @@ -106,7 +106,7 @@ {{/if}} {{/if}} {{#if controller.editMode}} - + {{partial "close-button"}} {{/if}} @@ -146,17 +146,17 @@

    {{metric.fullName}} - {{ platform.name}}

    - {{partial "close-button"}} + {{partial "close-button"}} {{#if movingAverageStrategies}} - {{partial "stat-button"}} + {{partial "stat-button"}} {{/if}} {{#if App.Manifest.bugTrackers}} - + {{partial "analysis-button"}} {{/if}} {{#if App.Manifest.repositoriesWithReportedCommits}} - {{partial "search-button"}} + {{partial "search-button"}} {{/if}}
    @@ -227,7 +227,7 @@ @@ -493,7 +493,7 @@ {{else}}
  • {{#if actionName}} - {{label}} + {{label}} {{else}} {{label}} {{/if}} diff --git a/Websites/perf.webkit.org/public/v2/interactive-chart.js b/Websites/perf.webkit.org/public/v2/interactive-chart.js index 40ed2d00bf04..1b0c7603cd4b 100644 --- a/Websites/perf.webkit.org/public/v2/interactive-chart.js +++ b/Websites/perf.webkit.org/public/v2/interactive-chart.js @@ -238,8 +238,8 @@ App.InteractiveChartComponent = Ember.Component.extend({ margin.left += 3 * rem; this._margin = margin; - this._contentWidth = this._totalWidth - margin.left - margin.right; - this._contentHeight = this._totalHeight - margin.top - margin.bottom; + this._contentWidth = Math.max(0, this._totalWidth - margin.left - margin.right); + this._contentHeight = Math.max(0, this._totalHeight - margin.top - margin.bottom); this._svg.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); @@ -275,7 +275,7 @@ App.InteractiveChartComponent = Ember.Component.extend({ .call(this._brush) .selectAll("rect") .attr("y", 1) - .attr("height", this._contentHeight - 2); + .attr("height", Math.max(0, this._contentHeight - 2)); this._updateSelectionToolbar(); }, _relayoutDataAndAxes: function (selection) -- 2.36.0