apucher closed pull request #3577: Applied humanizeFloat to anomaly-graph 
component
URL: https://github.com/apache/incubator-pinot/pull/3577
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js 
b/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js
index 6218f6abcc..396d001a03 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js
@@ -4,6 +4,7 @@ import { later } from '@ember/runloop';
 import Component from '@ember/component';
 import moment from 'moment';
 import d3 from 'd3';
+import { humanizeFloat } from 'thirdeye-frontend/utils/utils';
 
 const COLOR_MAPPING = {
   blue: '#33AADA',
@@ -185,7 +186,7 @@ export default Component.extend({
           .attr('y1', 10)
           .attr('x2', 30)
           .attr('y2', 10)
-          .attr('stroke-dasharray', (d) => {
+          .attr('stroke-dasharray', () => {
             const dasharrayNum = 'none';
             return dasharrayNum;
           });
@@ -385,7 +386,6 @@ export default Component.extend({
    * Graph Legend config
    */
   legend: computed('showGraphLegend', function() {
-    const showGraphLegend = this.get('showGraphLegend');
     return {
       position: 'inset',
       show: false
@@ -459,7 +459,7 @@ export default Component.extend({
           show: true,
           // min: 0,
           tick: {
-            format: d3.format('.2s')
+            format: function(d){return humanizeFloat(d);}
           }
         },
         y2: {
@@ -559,7 +559,7 @@ export default Component.extend({
 
       // Return data only when it's selected
       if (primaryMetric.isSelected) {
-        const { baselineValues, currentValues } = 
primaryMetric.subDimensionContributionMap['All'];
+        const { currentValues } = 
primaryMetric.subDimensionContributionMap['All'];
         return [
           [`${primaryMetric.metricName}-current`, ...currentValues]
         ];
@@ -583,7 +583,7 @@ export default Component.extend({
       selectedMetrics.forEach((metric)  => {
         if (!metric) { return; }
 
-        const { baselineValues, currentValues } = 
metric.subDimensionContributionMap['All'];
+        const { currentValues } = metric.subDimensionContributionMap['All'];
         columns.push([`${metric.metricName}-current`, ...currentValues]);
       });
       return columns;
@@ -600,7 +600,7 @@ export default Component.extend({
       const selectedDimensions = this.get('selectedDimensions') || [];
 
       selectedDimensions.forEach((dimension) => {
-        const { baselineValues, currentValues } = dimension;
+        const { currentValues } = dimension;
         columns.push([`${dimension.name}-current`, ...currentValues]);
       });
       return columns;
diff --git 
a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js 
b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js
index 697b5cf60f..5694129397 100644
--- 
a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js
+++ 
b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js
@@ -14,6 +14,7 @@ import {
   makeTime
 } from 'thirdeye-frontend/utils/rca-utils';
 import _ from 'lodash';
+import { humanizeFloat } from 'thirdeye-frontend/utils/utils';
 
 const TIMESERIES_MODE_ABSOLUTE = 'absolute';
 const TIMESERIES_MODE_RELATIVE = 'relative';
@@ -115,7 +116,7 @@ export default Component.extend({
         y: {
           show: true,
           tick: {
-            format: d3.format('.2s')
+            format: function(d){return humanizeFloat(d)}
           }
         },
         y2: {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to