This is an automated email from the ASF dual-hosted git repository.

nju_yaho pushed a commit to tag ebay-3.1.0-release-20200701
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 56b8cd01978efc76d63f8f6e9cc21428991303e6
Author: sanjulian <julian....@hotmail.com>
AuthorDate: Thu May 28 10:45:28 2020 +0800

    KYLIN-4536 Update cube planner label and info
---
 webapp/app/js/controllers/cube.js | 22 +++++++++-------------
 webapp/app/js/model/cubeConfig.js | 10 +++-------
 2 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/webapp/app/js/controllers/cube.js 
b/webapp/app/js/controllers/cube.js
index 0d48dbc..5664690 100755
--- a/webapp/app/js/controllers/cube.js
+++ b/webapp/app/js/controllers/cube.js
@@ -227,14 +227,14 @@ KylinApp.controller('CubeCtrl', function ($scope, 
$rootScope, AccessService, Mes
             $scope.currentOptions.caption = 
angular.copy(cubeConfig.currentCaption);
             if ($scope.cube.recommendCuboids){
                 $scope.currentOptions.caption.css['text-align'] = 'right';
-                $scope.currentOptions.caption.css['right'] = '-12px';
+                $scope.currentOptions.caption.css['right'] = '-120px';
             }
             $scope.currentOptions.chart.color = function(d) {
                 var cuboid = _.find(data.nodeInfos, function(o) { return 
o.name == d; });
                 if (cuboid.deleted) {
                     return d3.scale.category20c().range()[17];
                 } else {
-                    return getColorByQuery(0, 1/data.nodeInfos.length, 
cuboid.query_rate);
+                    return getColorByQuery(1/data.nodeInfos.length, 
cuboid.query_rate);
                 }
             };
             $scope.currentOptions.chart.sunburst = getSunburstDispatch();
@@ -246,14 +246,10 @@ KylinApp.controller('CubeCtrl', function ($scope, 
$rootScope, AccessService, Mes
             $scope.recommendOptions.caption = 
angular.copy(cubeConfig.recommendCaption);
             $scope.recommendOptions.chart.color = function(d) {
                 var cuboid = _.find(data.nodeInfos, function(o) { return 
o.name == d; });
-                if (cuboid.row_count < 0) {
+                if (!cuboid.existed) {
                     return d3.scale.category20c().range()[5];
                 } else {
-                    var colorIndex = 0;
-                    if (!cuboid.existed) {
-                        colorIndex = 8;
-                    }
-                    return getColorByQuery(colorIndex, 
1/data.nodeInfos.length, cuboid.query_rate);
+                    return getColorByQuery(1/data.nodeInfos.length, 
cuboid.query_rate);
                 }
             };
             $scope.recommendOptions.chart.sunburst = getSunburstDispatch();
@@ -282,15 +278,15 @@ KylinApp.controller('CubeCtrl', function ($scope, 
$rootScope, AccessService, Mes
     };
 
     // Different color for chart element by query count
-    function getColorByQuery(colorIndex, baseRate, queryRate) {
+    function getColorByQuery(baseRate, queryRate) {
         if (queryRate > (3 * baseRate)) {
-            return d3.scale.category20c().range()[colorIndex];
+            return d3.scale.category20c().range()[0];
         } else if (queryRate > (2 * baseRate)) {
-            return d3.scale.category20c().range()[colorIndex+1];
+            return d3.scale.category20c().range()[1];
         } else if (queryRate > baseRate) {
-            return d3.scale.category20c().range()[colorIndex+2];
+            return d3.scale.category20c().range()[2];
         } else {
-            return d3.scale.category20c().range()[colorIndex+3];
+            return d3.scale.category20c().range()[3];
         }
     }
 
diff --git a/webapp/app/js/model/cubeConfig.js 
b/webapp/app/js/model/cubeConfig.js
index 77285f9..9dc9a68 100644
--- a/webapp/app/js/model/cubeConfig.js
+++ b/webapp/app/js/model/cubeConfig.js
@@ -176,7 +176,7 @@ KylinApp.constant('cubeConfig', {
   },
   currentCaption: {
     enable: true,
-    html: '<div>Existed: <i class="fa fa-square" style="color:#38c;"></i> 
Hottest '
+    html: '<div><i class="fa fa-square" style="color:#38c;"></i> Hottest '
           + '<i class="fa fa-square" style="color:#7bd;"></i> Hot '
           + '<i class="fa fa-square" style="color:#ade;"></i> Warm '
           + '<i class="fa fa-square" style="color:#cef;"></i> Cold '
@@ -189,17 +189,13 @@ KylinApp.constant('cubeConfig', {
   },
   recommendCaption: {
     enable: true,
-    html: '<div>New: <i class="fa fa-square" style="color:#3a5;"></i> Hottest '
-      + '<i class="fa fa-square" style="color:#7c7;"></i> Hot '
-      + '<i class="fa fa-square" style="color:#aea;"></i> Warm '
-      + '<i class="fa fa-square" style="color:#cfc;"></i> Cold '
-      + '<i class="fa fa-square" style="color:#f94;"></i> Mandatory</div>',
+    html: '<div><i class="fa fa-square" style="color:#f94;"></i> New</div>',
     css: {
       position: 'relative',
       top: '-35px',
       height: 0,
       'text-align': 'left',
-      'left': '-12px'
+      'left': '93px'
     }
   }
 });

Reply via email to