@@ -241,8 +241,7 @@ const Graph = (props: any) => {
241241 icon : 'roundRect' ,
242242 } ) ) ;
243243 const station = timeseries
244- ?. filter ( x => 'historical_variable' in x . info )
245- . filter ( x => x . info . historical_variable === 'tdd' )
244+ ?. filter ( x => x . info . climatological_variable === 'tdd' )
246245 . filter ( x => x . info . processing_method . indexOf ( snsfltr ) >= 0 )
247246 . map ( x => ( {
248247 name : labelFor ( x , 'station' ) ,
@@ -286,8 +285,8 @@ const Graph = (props: any) => {
286285 )
287286 . map ( x => ( ret [ getName ( x ) ] = true ) ) ;
288287 timeseries
289- ?. filter ( x => Object . keys ( x . info ) . indexOf ( 'station' ) > 0 )
290- . filter ( x => x . name . indexOf ( snsfltr ) >= 0 )
288+ ?. filter ( x => x . info . climatological_variable === 'tdd' )
289+ . filter ( x => x . info . processing_method . indexOf ( snsfltr ) >= 0 )
291290 . map ( x => ( ret [ getName ( x , 'station' ) ] = true ) ) ;
292291 //.map(x => (ret[x.name] = x.info.processing_method === 'no_smoothing'));
293292 return ret ;
@@ -438,21 +437,21 @@ const Graph = (props: any) => {
438437 "uncertainty_type": "upper_bound",
439438 "year_period": "year"
440439}*/ const getName = ( item , mode = 'timeseries' ) => {
441- if ( 'station' in item . info ) mode = 'sensor' ;
440+ if ( item . info . climatological_variable === 'tdd' ) mode = 'sensor' ;
442441 let tdata : any = { } ;
443442 for ( let k in item . translations . parameter_values ) {
444443 tdata [ k ] = item . translations . parameter_values [ k ] [ i18n . language ] ;
445444 }
446445 if ( mode === 'timeseries' ) return `${ tdata . series_nameg } ${ tdata . scenario } ` ;
447- else return ` ${ tdata . station } ` ;
446+ else return 'Osservazioni' ;
448447 } ;
449448
450449 let pseriesObj = timeseries . filter ( item => {
451450 return (
452451 ( item . info . processing_method === 'MOVING_AVERAGE_11_YEARS' &&
453452 item . info . scenario ) ||
454453 ( item . info . processing_method === 'NO_SMOOTHING' &&
455- item . info . historical_variable === 'tdd' )
454+ item . info . climatological_varable === 'tdd' )
456455 ) ;
457456 } ) ;
458457 let opseriesObj = [
@@ -466,7 +465,7 @@ const Graph = (props: any) => {
466465 x =>
467466 x . info . scenario === 'rcp26' &&
468467 x . info . climatological_variable === 'tas' &&
469- ! ( 'undertainty_type ' in x . info ) ,
468+ ! ( 'uncertainty_type ' in x . info ) ,
470469 ) [ 0 ] ,
471470 pseriesObj . filter (
472471 x =>
@@ -484,7 +483,7 @@ const Graph = (props: any) => {
484483 x =>
485484 x . info . scenario === 'rcp45' &&
486485 x . info . climatological_variable === 'tas' &&
487- ! ( 'undertainty_type ' in x . info ) ,
486+ ! ( 'uncertainty_type ' in x . info ) ,
488487 ) [ 0 ] ,
489488 pseriesObj . filter (
490489 x =>
0 commit comments