1- import { Component , computed , inject , linkedSignal } from '@angular/core' ;
2- import { toSignal } from '@angular/core/rxjs-interop' ;
3- import { map } from 'rxjs' ;
4- import { ComparisonScoreDistribution } from '../../shared/comparison/comparison-score-distribution' ;
5- import { ComparisonBuildDistribution } from '../../shared/comparison/comparison-build-distribution' ;
6- import { ModelComparisonData } from '../../shared/comparison/comparison-data' ;
7- import { ReportsFetcher } from '../../services/reports-fetcher' ;
8- import { ReportSelect } from '../../shared/report-select/report-select' ;
9- import { ComparisonRuntimeDistribution } from '../../shared/comparison/comparison-runtime-distribution' ;
10- import { ActivatedRoute } from '@angular/router' ;
1+ import { Component , computed , inject , linkedSignal } from '@angular/core' ;
2+ import { toSignal } from '@angular/core/rxjs-interop' ;
3+ import { map } from 'rxjs' ;
4+ import { ComparisonScoreDistribution } from '../../shared/comparison/comparison-score-distribution' ;
5+ import { ComparisonBuildDistribution } from '../../shared/comparison/comparison-build-distribution' ;
6+ import { ModelComparisonData } from '../../shared/comparison/comparison-data' ;
7+ import { ReportsFetcher } from '../../services/reports-fetcher' ;
8+ import { ReportSelect } from '../../shared/report-select/report-select' ;
9+ import { ComparisonRuntimeDistribution } from '../../shared/comparison/comparison-runtime-distribution' ;
10+ import { ActivatedRoute } from '@angular/router' ;
1111
1212@Component ( {
1313 templateUrl : './comparison.html' ,
@@ -31,10 +31,10 @@ export class ComparisonPage {
3131 } ) ,
3232 computation : ( ) => {
3333 const allGroups = this . groups ( ) ;
34- const results : { reportName : string ; groupId : string | null } [ ] = [ ] ;
34+ const results : { reportName : string ; groupId : string | null } [ ] = [ ] ;
3535
36- this . selectedGroups ( ) . forEach ( ( id ) => {
37- const correspondingGroup = allGroups . find ( ( group ) => group . id === id ) ;
36+ this . selectedGroups ( ) . forEach ( id => {
37+ const correspondingGroup = allGroups . find ( group => group . id === id ) ;
3838
3939 if ( correspondingGroup ) {
4040 results . push ( {
@@ -50,34 +50,33 @@ export class ComparisonPage {
5050
5151 readonly selectedGroups = toSignal < string [ ] > (
5252 this . route . queryParams . pipe (
53- map ( ( params ) => {
53+ map ( params => {
5454 const ids = params [ 'groups' ] ;
5555 return ids && Array . isArray ( ids ) ? ids : [ ] ;
56- } )
56+ } ) ,
5757 ) ,
58- { requireSync : true }
58+ { requireSync : true } ,
5959 ) ;
6060
6161 readonly comparisonModelData = computed ( ( ) => {
6262 const allGroups = this . groups ( ) ;
6363 const selectedGroups = this . groupsToCompare ( )
64- . map ( ( g ) => ( {
64+ . map ( g => ( {
6565 reportName : g . reportName ,
66- group : allGroups . find ( ( current ) => current . id === g . groupId ) ! ,
66+ group : allGroups . find ( current => current . id === g . groupId ) ! ,
6767 } ) )
68- . filter ( ( g ) => ! ! g . group ) ;
68+ . filter ( g => ! ! g . group ) ;
6969
7070 if ( selectedGroups . length < 2 ) {
7171 return null ;
7272 }
7373
7474 return {
7575 averageAppsCount : Math . floor (
76- selectedGroups . reduce ( ( acc , r ) => r . group . appsCount + acc , 0 ) /
77- selectedGroups . length
76+ selectedGroups . reduce ( ( acc , r ) => r . group . appsCount + acc , 0 ) / selectedGroups . length ,
7877 ) ,
7978 series : [
80- ...selectedGroups . map ( ( r ) => ( {
79+ ...selectedGroups . map ( r => ( {
8180 name : r . reportName ,
8281 stats : r . group . stats ,
8382 appsCount : r . group . appsCount ,
@@ -86,15 +85,15 @@ export class ComparisonPage {
8685 } satisfies ModelComparisonData ;
8786 } ) ;
8887
89- protected updateReportName ( report : { reportName : string } , newName : string ) {
88+ protected updateReportName ( report : { reportName : string } , newName : string ) {
9089 report . reportName = newName ;
9190 this . groupsToCompare . set ( [ ...this . groupsToCompare ( ) ] ) ;
9291 }
9392
9493 protected setSelectedGroup ( index : number , groupId : string | undefined ) {
9594 const allGroups = this . groups ( ) ;
9695 const current = this . groupsToCompare ( ) ;
97- const correspondingGroup = allGroups . find ( ( group ) => group . id === groupId ) ;
96+ const correspondingGroup = allGroups . find ( group => group . id === groupId ) ;
9897
9998 if ( correspondingGroup ) {
10099 current [ index ] = {
0 commit comments