update angular to 13.1.0
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, Input, Output, ViewChild, EventEmitter, ɵpublishDefaultGlobalUtils } from '@angular/core';
|
||||
import { DashTypeAndColor, PlotResponseStats } from '../plot.service';
|
||||
import { DashTypeAndColor, PlotResponseStats, DataSeriesStats } from '../plot.service';
|
||||
import { UtilService } from '../utils.service';
|
||||
|
||||
@Component({
|
||||
@@ -10,7 +10,7 @@ import { UtilService } from '../utils.service';
|
||||
export class PlotDetailsComponent {
|
||||
|
||||
@Input()
|
||||
stats: PlotResponseStats;
|
||||
stats!: PlotResponseStats;
|
||||
|
||||
hasPercentiles = false;
|
||||
|
||||
@@ -25,17 +25,19 @@ export class PlotDetailsComponent {
|
||||
ngOnInit() {
|
||||
this.hasPercentiles = false;
|
||||
this.percentilesToPlot.clear();
|
||||
for (let i = 0; i < this.stats.dataSeriesStats.length; i++)
|
||||
{
|
||||
const stat = this.stats.dataSeriesStats[i];
|
||||
if (stat.percentiles.hasOwnProperty("50.000"))
|
||||
if (this.stats) {
|
||||
for (let i = 0; i < this.stats.dataSeriesStats.length; i++)
|
||||
{
|
||||
this.hasPercentiles = true;
|
||||
this.percentilesToPlot.set('median','50.000');
|
||||
this.percentilesToPlot.set('75th','75.000');
|
||||
this.percentilesToPlot.set('95th','95.000');
|
||||
this.percentilesToPlot.set('99th','99.000');
|
||||
break;
|
||||
const stat = this.stats.dataSeriesStats[i];
|
||||
if (stat.percentiles.hasOwnProperty("50.000"))
|
||||
{
|
||||
this.hasPercentiles = true;
|
||||
this.percentilesToPlot.set('median','50.000');
|
||||
this.percentilesToPlot.set('75th','75.000');
|
||||
this.percentilesToPlot.set('95th','95.000');
|
||||
this.percentilesToPlot.set('99th','99.000');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,4 +51,27 @@ export class PlotDetailsComponent {
|
||||
+" plot-details-plotType_"+typeAndColor.pointType
|
||||
+" plot-details-plotType_"+typeAndColor.color.toLocaleLowerCase();
|
||||
}
|
||||
|
||||
toPercent(statsRow: DataSeriesStats, statsCol: DataSeriesStats, key: string){
|
||||
const percentile = this.percentilesToPlot.get(key);
|
||||
if (percentile) {
|
||||
const rowValue = statsRow.percentiles.get(percentile);
|
||||
const columnValue = statsCol.percentiles.get(percentile);
|
||||
if (rowValue !== undefined && columnValue !== undefined) {
|
||||
return this.utils.toPercent(rowValue / columnValue);
|
||||
}
|
||||
}
|
||||
return "?%"
|
||||
}
|
||||
|
||||
percentileStat(key: string, stat: DataSeriesStats): string{
|
||||
const plotKey = this.percentilesToPlot.get(key);
|
||||
if (plotKey !== undefined){
|
||||
const value = stat.percentiles.get(plotKey);
|
||||
if (value !== undefined){
|
||||
return this.utils.format(value, this.valueFormat);
|
||||
}
|
||||
}
|
||||
return "no value";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user