wusamzong commented on code in PR #157:
URL: https://github.com/apache/yunikorn-web/pull/157#discussion_r1442910338


##########
src/app/models/node-utilization.model.ts:
##########
@@ -25,4 +28,42 @@ export class NodeUtilization {
       nodeNames: null | string[];
     }[],
   ) {}
+
+  // transform NodeUtilization to NodeUtilizationChartData for NodeUtilization 
bar chart
+  toNodeUtilizationChartData(){
+    const MAX_NODES_IN_DESCRIPTION = 15;
+    const backgroundColor = CHART_COLORS[0];
+    let type = this.type;
+    let utilization = this.utilization;
+    // prepare data
+    let chartDataItems = new Array<ChartDataItem>();
+    let index = 0;

Review Comment:
   This variable is declared but never used.



##########
src/app/utils/constants.ts:
##########
@@ -20,3 +20,4 @@ export const DEFAULT_PARTITION_VALUE = '';
 export const DEFAULT_PROTOCOL = 'http:';
 export const NOT_AVAILABLE = 'n/a';
 export const PARTITION_DEFAULT = 'default';
+export const CHART_COLORS = ['#4285f4', '#db4437', '#f4b400', '#0f9d58', 
'#ff6d00', '#3949ab', '#facc54', '#26bbf0', '#cc6164', '#60cea5'];

Review Comment:
   same question above.



##########
src/app/models/node-utilization.model.ts:
##########
@@ -25,4 +28,42 @@ export class NodeUtilization {
       nodeNames: null | string[];
     }[],
   ) {}
+
+  // transform NodeUtilization to NodeUtilizationChartData for NodeUtilization 
bar chart
+  toNodeUtilizationChartData(){
+    const MAX_NODES_IN_DESCRIPTION = 15;
+    const backgroundColor = CHART_COLORS[0];

Review Comment:
   I have a small question. Is it intended for backgroundColor to always be 
CHART_COLORS[0]? In the original implementation, the bar's background color 
would change. However, in this implementation, the background color remains 
constant, so there seems to be no need to declare an array CHART_COLORS with 
multiple colors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to