@@ -64,11 +64,11 @@ function loadEpidata(
64
64
name : string ,
65
65
epidata : Record < string , unknown > [ ] ,
66
66
columns : string [ ] ,
67
- columnNames : Record < string , string > ,
67
+ columnRenamings : Record < string , string > ,
68
68
params : Record < string , unknown > ,
69
69
) : DataGroup {
70
70
const datasets : DataSet [ ] = [ ] ;
71
- const colNames = new Map ( Object . entries ( columnNames ) ) ;
71
+ const colRenamings = new Map ( Object . entries ( columnRenamings ) ) ;
72
72
73
73
for ( const col of columns ) {
74
74
const points : EpiPoint [ ] = [ ] ;
@@ -93,8 +93,8 @@ function loadEpidata(
93
93
}
94
94
points . push ( new EpiPoint ( date , row [ col ] as number ) ) ;
95
95
}
96
- // overwrite default column name if there's an overwrite in columnNames
97
- const title = colNames . has ( col ) ? colNames . get ( col ) : col ;
96
+ // overwrite default column name if there's an overwrite in columnRenamings
97
+ const title = colRenamings . has ( col ) ? colRenamings . get ( col ) : col ;
98
98
datasets . push ( new DataSet ( points , title , params ) ) ;
99
99
}
100
100
return new DataGroup ( name , datasets ) ;
@@ -116,7 +116,7 @@ export function loadDataSet(
116
116
fixedParams : Record < string , unknown > ,
117
117
userParams : Record < string , unknown > ,
118
118
columns : string [ ] ,
119
- columnNames : Record < string , string > = { } ,
119
+ columnRenamings : Record < string , string > = { } ,
120
120
) : Promise < DataGroup | null > {
121
121
const duplicates = get ( expandedDataGroups ) . filter ( ( d ) => d . title == title ) ;
122
122
if ( duplicates . length > 0 ) {
@@ -140,7 +140,7 @@ export function loadDataSet(
140
140
url . searchParams . set ( 'format' , 'json' ) ;
141
141
return fetchImpl < Record < string , unknown > [ ] > ( url )
142
142
. then ( ( res ) => {
143
- return loadEpidata ( title , res , columns , columnNames , { _endpoint : endpoint , ...params } ) ;
143
+ return loadEpidata ( title , res , columns , columnRenamings , { _endpoint : endpoint , ...params } ) ;
144
144
} )
145
145
. catch ( ( error ) => {
146
146
console . warn ( 'failed fetching data' , error ) ;
0 commit comments