ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/2] ignite git commit: IGNITE-843: WIP charts: fixed resize.
Date Fri, 04 Sep 2015 10:08:10 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 e3b3c57eb -> 7ebc5fee8


IGNITE-843: WIP charts: fixed resize.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bffbdd0c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bffbdd0c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bffbdd0c

Branch: refs/heads/ignite-843
Commit: bffbdd0cef52104e37062df453cea6d120d91b3c
Parents: e3b3c57
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Sep 4 16:46:05 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Sep 4 16:46:05 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 32 ++++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bffbdd0c/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index 57b7a0b..6227802 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -16,8 +16,8 @@
  */
 
 // Controller for SQL notebook screen.
-controlCenterModule.controller('sqlController', ['$scope', '$window','$controller', '$http',
'$common', '$confirm',
-    function ($scope, $window, $controller, $http, $common, $confirm) {
+controlCenterModule.controller('sqlController', ['$scope', '$window','$controller', '$http',
'$timeout', '$common', '$confirm',
+    function ($scope, $window, $controller, $http, $timeout, $common, $confirm) {
     // Initialize the super class and extend it.
     angular.extend(this, $controller('agent-download', {$scope: $scope}));
     $scope.agentGoal = 'execute sql statements';
@@ -385,18 +385,18 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
     function _insertChart(paragraph, datum, chart) {
         var chartId = 'chart-' + paragraph.id;
 
-        // Remove previous chart.
-        d3.selectAll('#' + chartId + ' svg > *').remove();
+        $timeout(function() {
+            // Remove previous chart.
+            d3.selectAll('#' + chartId + ' svg > *').remove();
 
-        // Insert new chart.
-        d3.select('#' + chartId + ' svg')
-            .datum(datum)
-            .call(chart)
-            .attr('height', 400);
+            // Insert new chart.
+            d3.select('#' + chartId + ' svg')
+                .datum(datum)
+                .call(chart)
+                .attr('height', 400);
 
-        nv.utils.windowResize(chart.update);
-
-        return chart;
+            chart.update();
+        });
     }
 
     function _barChart(paragraph) {
@@ -416,7 +416,7 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                 return {label: (row.length > 1) ? row[1] : index++, value: _isNumber(row,
0, 0)}
             });
 
-            return _insertChart(paragraph, [{key: 'bar', values: values}], chart);
+            _insertChart(paragraph, [{key: 'bar', values: values}], chart);
         });
     }
 
@@ -438,7 +438,7 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                 .donutRatio(0.35)
                 .height(400);
 
-            return _insertChart(paragraph, paragraph.rows, chart);
+            _insertChart(paragraph, paragraph.rows, chart);
         });
     }
 
@@ -457,7 +457,7 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                 .y(_y)
                 .height(400);
 
-            return _insertChart(paragraph, _datum('Line chart', paragraph.rows), chart);
+            _insertChart(paragraph, _datum('Line chart', paragraph.rows), chart);
         });
     }
 
@@ -468,7 +468,7 @@ controlCenterModule.controller('sqlController', ['$scope', '$window','$controlle
                 .y(_y)
                 .height(400);
 
-            return _insertChart(paragraph, _datum('Area chart', paragraph.rows), chart);
+            _insertChart(paragraph, _datum('Area chart', paragraph.rows), chart);
         });
     }
 }]);


Mime
View raw message