From 27bfa1a008c0eefca5bf11118e1761fd58389fd2 Mon Sep 17 00:00:00 2001 From: "rniwa@webkit.org" Date: Tue, 28 Oct 2014 18:01:32 +0000 Subject: [PATCH] Remove App.PaneController.bugsChangeCount in the new perf dashboard https://bugs.webkit.org/show_bug.cgi?id=138111 Reviewed by Darin Adler. * public/v2/app.js: (App.PaneController.bugsChangeCount): Removed. (App.PaneController.actions.associateBug): Call _updateMarkedPoints instead of incrementing bugsChangeCount. (App.PaneController._updateMarkedPoints): Extracted from App.InteractiveChartComponent._updateDotsWithBugs. Finds the list of current run's points that are associated with bugs. (App.InteractiveChartComponent._updateMarkedDots): Renamed from _updateDotsWithBugs. * public/v2/chart-pane.css: (.chart .marked): Renamed from .hasBugs. * public/v2/index.html: Specify chartPointRadius and markedPoints. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175262 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Websites/perf.webkit.org/ChangeLog | 17 ++++++++++ Websites/perf.webkit.org/public/v2/app.js | 40 ++++++++++++++++------- Websites/perf.webkit.org/public/v2/chart-pane.css | 4 +-- Websites/perf.webkit.org/public/v2/index.html | 3 +- 4 files changed, 50 insertions(+), 14 deletions(-) diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog index af11ed5..796c7e7 100644 --- a/Websites/perf.webkit.org/ChangeLog +++ b/Websites/perf.webkit.org/ChangeLog @@ -1,3 +1,20 @@ +2014-10-28 Ryosuke Niwa + + Remove App.PaneController.bugsChangeCount in the new perf dashboard + https://bugs.webkit.org/show_bug.cgi?id=138111 + + Reviewed by Darin Adler. + + * public/v2/app.js: + (App.PaneController.bugsChangeCount): Removed. + (App.PaneController.actions.associateBug): Call _updateMarkedPoints instead of incrementing bugsChangeCount. + (App.PaneController._updateMarkedPoints): Extracted from App.InteractiveChartComponent._updateDotsWithBugs. + Finds the list of current run's points that are associated with bugs. + (App.InteractiveChartComponent._updateMarkedDots): Renamed from _updateDotsWithBugs. + * public/v2/chart-pane.css: + (.chart .marked): Renamed from .hasBugs. + * public/v2/index.html: Specify chartPointRadius and markedPoints. + 2014-10-27 Ryosuke Niwa REGRESSION: commit logs are not shown sometimes on the new dashboard UI diff --git a/Websites/perf.webkit.org/public/v2/app.js b/Websites/perf.webkit.org/public/v2/app.js index 309dd0f..e984286 100755 --- a/Websites/perf.webkit.org/public/v2/app.js +++ b/Websites/perf.webkit.org/public/v2/app.js @@ -664,7 +664,6 @@ App.PaneController = Ember.ObjectController.extend({ sharedTime: Ember.computed.alias('parentController.sharedTime'), sharedSelection: Ember.computed.alias('parentController.sharedSelection'), selection: null, - bugsChangeCount: 0, // Dirty hack. Used to call InteractiveChartComponent's _updateDotsWithBugs. actions: { toggleDetails: function() { @@ -689,7 +688,7 @@ App.PaneController = Ember.ObjectController.extend({ var self = this; point.measurement.associateBug(bugTracker.get('id'), bugNumber).then(function () { self._updateBugs(); - self.set('bugsChangeCount', self.get('bugsChangeCount') + 1); + self._updateMarkedPoints(); }); }, toggleSearchPane: function () @@ -843,7 +842,24 @@ App.PaneController = Ember.ObjectController.extend({ editedBugNumber: this._hasRange ? null : bugNumbers[0], }); // FIXME: Create urls for new bugs. })); - } + }, + _updateMarkedPoints: function () + { + var chartData = this.get('chartData'); + if (!chartData || !chartData.current) { + this.set('markedPoints', {}); + return; + } + + var series = chartData.current.timeSeriesByCommitTime().series(); + var markedPoints = {}; + for (var i = 0; i < series.length; i++) { + var measurement = series[i].measurement; + if (measurement.hasBugs()) + markedPoints[measurement.id()] = true; + } + this.set('markedPoints', markedPoints); + }.observes('chartData'), }); App.InteractiveChartComponent = Ember.Component.extend({ @@ -989,7 +1005,7 @@ App.InteractiveChartComponent = Ember.Component.extend({ .data(this._currentTimeSeriesData) .enter().append("circle") .attr("class", "dot") - .attr("r", this.get('interactive') ? 2 : 1)); + .attr("r", this.get('chartPointRadius') || 1)); if (this.get('interactive')) { this._attachEventListener(element, "mousemove", this._mouseMoved.bind(this)); @@ -1120,7 +1136,7 @@ App.InteractiveChartComponent = Ember.Component.extend({ .attr("cx", function(measurement) { return xScale(measurement.time); }) .attr("cy", function(measurement) { return yScale(measurement.value); }); }); - this._updateDotsWithBugs(); + this._updateMarkedDots(); this._updateHighlightPositions(); if (this._brush) { @@ -1149,13 +1165,15 @@ App.InteractiveChartComponent = Ember.Component.extend({ .style("z-index", "100") .text(this._yAxisUnit); }, - _updateDotsWithBugs: function () { - if (!this.get('interactive')) - return; + _updateMarkedDots: function () { + var markedPoints = this.get('markedPoints') || {}; + var defaultDotRadius = this.get('chartPointRadius') || 1; this._dots.forEach(function (dot) { - dot.classed('hasBugs', function (point) { return !!point.measurement.hasBugs(); }); - }) - }.observes('bugsChangeCount'), // Never used for anything but to call this method :( + dot.classed('marked', function (point) { return markedPoints[point.measurement.id()]; }); + dot.attr('r', function (point) { + return markedPoints[point.measurement.id()] ? defaultDotRadius * 1.5 : defaultDotRadius; }); + }); + }.observes('markedPoints'), _updateHighlightPositions: function () { var xScale = this._x; var yScale = this._y; diff --git a/Websites/perf.webkit.org/public/v2/chart-pane.css b/Websites/perf.webkit.org/public/v2/chart-pane.css index 6384389..3b0b7f2 100755 --- a/Websites/perf.webkit.org/public/v2/chart-pane.css +++ b/Websites/perf.webkit.org/public/v2/chart-pane.css @@ -258,8 +258,8 @@ stroke: none; } -.chart .hasBugs { - fill: #33f; +.chart .marked { + fill: #c33; } .chart path.area { diff --git a/Websites/perf.webkit.org/public/v2/index.html b/Websites/perf.webkit.org/public/v2/index.html index 934ba8d..892d956 100755 --- a/Websites/perf.webkit.org/public/v2/index.html +++ b/Websites/perf.webkit.org/public/v2/index.html @@ -154,6 +154,7 @@ chartData=chartData domain=mainPlotDomain interactive=true + chartPointRadius=2 currentItem=currentItem currentTime=sharedTime selectedItem=selectedItem @@ -162,7 +163,7 @@ sharedSelection=sharedSelection selectionChanged="rangeChanged" selectionIsLocked=timeRangeIsLocked - bugsChangeCount=bugsChangeCount + markedPoints=markedPoints zoom="zoomed"}} {{else}} {{#if failure}} -- 1.8.3.1