REGRESSION(r180000): Changing moving average or enveloping strategy doesn't update...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Mar 2015 17:16:07 +0000 (17:16 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Mar 2015 17:16:07 +0000 (17:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143254

Reviewed by Antti Koivisto.

The bug was caused by App.Pane no longer replacing 'chartData' property when updating the moving average
or the enveloping values. Fixed the bug by creating a new chartData object when the strategy is changed
so that the interactive chart component will observe a change to 'chartData'.

* public/v2/app.js:
(App.Pane._movingAverageOrEnvelopeStrategyDidChange): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182184 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v2/app.js

index 3ba42b7..35b3abd 100644 (file)
@@ -1,3 +1,17 @@
+2015-03-31  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION(r180000): Changing moving average or enveloping strategy doesn't update the graph
+        https://bugs.webkit.org/show_bug.cgi?id=143254
+
+        Reviewed by Antti Koivisto.
+        
+        The bug was caused by App.Pane no longer replacing 'chartData' property when updating the moving average
+        or the enveloping values. Fixed the bug by creating a new chartData object when the strategy is changed
+        so that the interactive chart component will observe a change to 'chartData'.
+
+        * public/v2/app.js:
+        (App.Pane._movingAverageOrEnvelopeStrategyDidChange): Added.
+
 2015-03-19  Ryosuke Niwa  <rniwa@webkit.org>
 
         Unreviewed build fixes.
index f5a74e0..0f75449 100755 (executable)
@@ -500,6 +500,18 @@ App.Pane = Ember.Object.extend({
         this._updateStrategyConfigIfNeeded(envelopingStrategy, 'envelopingConfig');
 
         chartData.movingAverage = this._computeMovingAverageAndOutliers(chartData, movingAverageStrategy, envelopingStrategy);
+    },
+    _movingAverageOrEnvelopeStrategyDidChange: function () {
+        this._updateMovingAverageAndEnvelope();
+
+        var newChartData = {};
+        var chartData = this.get('chartData');
+        if (!chartData)
+            return;
+        for (var property in chartData)
+            newChartData[property] = chartData[property];
+        this.set('chartData', newChartData);
+
     }.observes('chosenMovingAverageStrategy', 'chosenMovingAverageStrategy.parameterList.@each.value',
         'chosenEnvelopingStrategy', 'chosenEnvelopingStrategy.parameterList.@each.value'),
     _computeMovingAverageAndOutliers: function (chartData, movingAverageStrategy, envelopingStrategy)