@@ -14,7 +14,6 @@ import {
1414 * Extracts the numeric values for the series when they are wrapped.
1515 *
1616 * In the same single loop, for the sake of efficiency, it determines
17- * - the maximum y value (used for scaling the graph),
1817 * - the start and end labels of both series (used for generating appropriate X axis labels),
1918 *
2019 */
@@ -78,16 +77,15 @@ export const remapAndFillData = ({
7877
7978 lastTimeLabel = timeLabel
8079
81- const outerValue =
80+ const value =
8281 indexOfResult !== null
8382 ? getValue ( data . results [ indexOfResult ] ! )
8483 : getValue ( { metrics : data . meta . empty_metrics } )
85- const numericValue = getNumericValue ( outerValue )
8684
8785 mainSeries = {
8886 mainSeriesDefined,
89- numericValue ,
90- outerValue ,
87+ value ,
88+ numericValue : getNumericValue ( value ) ,
9189 isPartial,
9290 timeLabel
9391 }
@@ -102,16 +100,15 @@ export const remapAndFillData = ({
102100
103101 lastComparisonTimeLabel = comparisonTimeLabel
104102
105- const comparisonOuterValue =
103+ const comparisonValue =
106104 indexOfComparisonResult !== null
107105 ? getValue ( data . comparison_results [ indexOfComparisonResult ] ! )
108106 : getValue ( { metrics : data . meta . empty_metrics } )
109- const comparisonNumericValue = getNumericValue ( comparisonOuterValue )
110107
111108 comparisonSeries = {
112109 comparisonSeriesDefined,
113- comparisonNumericValue ,
114- comparisonOuterValue ,
110+ comparisonValue ,
111+ comparisonNumericValue : getNumericValue ( comparisonValue ) ,
115112 comparisonTimeLabel
116113 }
117114 } else {
@@ -123,7 +120,10 @@ export const remapAndFillData = ({
123120 comparisonSeries . comparisonSeriesDefined &&
124121 change === null
125122 ) {
126- change = getChange ( mainSeries . numericValue , comparisonSeries . comparisonNumericValue )
123+ change = getChange (
124+ mainSeries . numericValue ,
125+ comparisonSeries . comparisonNumericValue
126+ )
127127 }
128128
129129 return {
@@ -228,7 +228,7 @@ type MainSeriesValue =
228228 | {
229229 mainSeriesDefined : true
230230 numericValue : number
231- outerValue : RevenueMetricValue | number
231+ value : RevenueMetricValue | number
232232 isPartial : boolean
233233 timeLabel : string
234234 }
@@ -240,6 +240,6 @@ type ComparisonSeriesValue =
240240 | {
241241 comparisonSeriesDefined : true
242242 comparisonNumericValue : number
243- comparisonOuterValue : RevenueMetricValue | number
243+ comparisonValue : RevenueMetricValue | number
244244 comparisonTimeLabel : string
245245 }
0 commit comments