@@ -73,7 +73,7 @@ class ComparisonDataset {
7373 }
7474}
7575
76- function renderAbsoluteValue ( x : Optional < PredicateInfo > , metric : Metric ) {
76+ function renderOptionalValue ( x : Optional < number > , unit ?: string ) {
7777 switch ( x ) {
7878 case AbsentReason . NotSeen :
7979 return < AbsentNumberCell > n/a</ AbsentNumberCell > ;
@@ -84,13 +84,17 @@ function renderAbsoluteValue(x: Optional<PredicateInfo>, metric: Metric) {
8484 default :
8585 return (
8686 < NumberCell >
87- { formatDecimal ( metric . get ( x ) ) }
88- { renderUnit ( metric . unit ) }
87+ { formatDecimal ( x ) }
88+ { renderUnit ( unit ) }
8989 </ NumberCell >
9090 ) ;
9191 }
9292}
9393
94+ function renderPredicateMetric ( x : Optional < PredicateInfo > , metric : Metric ) {
95+ return renderOptionalValue ( metricGetOptional ( metric , x ) , metric . unit ) ;
96+ }
97+
9498function renderDelta ( x : number , unit ?: string ) {
9599 const sign = x > 0 ? "+" : "" ;
96100 return (
@@ -539,8 +543,8 @@ function ComparePerformanceWithData(props: {
539543 < ChevronCell >
540544 < Chevron expanded = { expandedPredicates . has ( row . name ) } />
541545 </ ChevronCell >
542- { comparison && renderAbsoluteValue ( row . before , metric ) }
543- { renderAbsoluteValue ( row . after , metric ) }
546+ { comparison && renderPredicateMetric ( row . before , metric ) }
547+ { renderPredicateMetric ( row . after , metric ) }
544548 { comparison && renderDelta ( row . diff , metric . unit ) }
545549 < NameCell > { rowNames [ rowIndex ] } </ NameCell >
546550 </ PredicateTR >
0 commit comments