@@ -226,6 +226,10 @@ export class PlotUi {
226226 for ( const group of this . state . groups ) {
227227 const xMeans : number [ ] = [ ] ;
228228 const yMeans : number [ ] = [ ] ;
229+ const xLowErrors : number [ ] = [ ] ;
230+ const xHighErrors : number [ ] = [ ] ;
231+ const yLowErrors : number [ ] = [ ] ;
232+ const yHighErrors : number [ ] = [ ] ;
229233 const meanTexts : string [ ] = [ ] ;
230234 const colors : string [ ] = [ ] ;
231235 const batchIndices : number [ ] = [ ] ;
@@ -250,14 +254,37 @@ export class PlotUi {
250254 this . state . metrics . findIndex ( ( metric ) => metric === xMetric ) ;
251255 const yMetricIndex =
252256 this . state . metrics . findIndex ( ( metric ) => metric === yMetric ) ;
253- if ( showRelativeRatios ) {
254- xMeans . push ( batchSelection . stats [ xMetricIndex ] . getRelativeMean (
255- useGeometricMean ) ) ;
256- yMeans . push ( batchSelection . stats [ yMetricIndex ] . getRelativeMean (
257- useGeometricMean ) ) ;
258- } else {
259- xMeans . push ( batchSelection . stats [ xMetricIndex ] . getAbsoluteMean ( ) ) ;
260- yMeans . push ( batchSelection . stats [ yMetricIndex ] . getAbsoluteMean ( ) ) ;
257+ const xMean = showRelativeRatios ?
258+ batchSelection . stats [ xMetricIndex ] . getRelativeMean (
259+ useGeometricMean ) :
260+ batchSelection . stats [ xMetricIndex ] . getAbsoluteMean ( ) ;
261+ const yMean = showRelativeRatios ?
262+ batchSelection . stats [ yMetricIndex ] . getRelativeMean (
263+ useGeometricMean ) :
264+ batchSelection . stats [ yMetricIndex ] . getAbsoluteMean ( ) ;
265+ xMeans . push ( xMean ) ;
266+ yMeans . push ( yMean ) ;
267+ if ( ! useGeometricMean ) {
268+ if ( this . state . horizontalQuantile === 0.1 ) {
269+ const xLowError = showRelativeRatios ?
270+ batchSelection . stats [ xMetricIndex ] . getRelativeLowQuantile ( ) :
271+ batchSelection . stats [ xMetricIndex ] . getAbsoluteLowQuantile ( ) ;
272+ const xHighError = showRelativeRatios ?
273+ batchSelection . stats [ xMetricIndex ] . getRelativeHighQuantile ( ) :
274+ batchSelection . stats [ xMetricIndex ] . getAbsoluteHighQuantile ( ) ;
275+ xLowErrors . push ( xMean - xLowError ) ;
276+ xHighErrors . push ( xHighError - xMean ) ;
277+ }
278+ if ( this . state . verticalQuantile === 0.1 ) {
279+ const yLowError = showRelativeRatios ?
280+ batchSelection . stats [ yMetricIndex ] . getRelativeLowQuantile ( ) :
281+ batchSelection . stats [ yMetricIndex ] . getAbsoluteLowQuantile ( ) ;
282+ const yHighError = showRelativeRatios ?
283+ batchSelection . stats [ yMetricIndex ] . getRelativeHighQuantile ( ) :
284+ batchSelection . stats [ yMetricIndex ] . getAbsoluteHighQuantile ( ) ;
285+ yLowErrors . push ( yMean - yLowError ) ;
286+ yHighErrors . push ( yHighError - yMean ) ;
287+ }
261288 }
262289 meanTexts . push ( batch . name ) ;
263290 colors . push ( batch . color ) ;
@@ -269,7 +296,7 @@ export class PlotUi {
269296 let hovertemplate = '%{text} vs ' + referenceBatch . name + '<br>' ;
270297 hovertemplate += xAxis + ': %{x:.2f}<br>' ;
271298 hovertemplate += yAxis + ': %{y:.2f}' ;
272- const geomeans : PlotlyData = {
299+ let geomeans : PlotlyData = {
273300 x : xMeans ,
274301 y : yMeans ,
275302 text : meanTexts ,
@@ -284,6 +311,25 @@ export class PlotUi {
284311 isAggregated : true ,
285312 batchIndices,
286313 } ;
314+ // TODO(yguyon): Fix quantiles then enable them with showRelativeRatios.
315+ if ( ! showRelativeRatios && ! useGeometricMean &&
316+ this . state . horizontalQuantile === 0.1 ) {
317+ geomeans . error_x = {
318+ type : 'data' ,
319+ symmetric : false ,
320+ array : xLowErrors ,
321+ arrayminus : xHighErrors ,
322+ } ;
323+ }
324+ if ( ! showRelativeRatios && ! useGeometricMean &&
325+ this . state . verticalQuantile === 0.1 ) {
326+ geomeans . error_y = {
327+ type : 'data' ,
328+ symmetric : false ,
329+ array : yLowErrors ,
330+ arrayminus : yHighErrors ,
331+ } ;
332+ }
287333 this . plotlyData . push ( geomeans ) ;
288334 }
289335 }
0 commit comments