2018-03-14 14:28:45 +01:00
import { Component } from '@angular/core' ;
import { Observable } from 'rxjs/Observable' ;
import { ActivatedRoute , Router } from '@angular/router' ;
2018-03-17 23:52:30 +01:00
import { Location , TitleCasePipe } from '@angular/common' ;
2018-03-01 12:45:37 +01:00
import "rxjs/add/observable/zip" ;
2018-03-14 14:28:45 +01:00
import { EnvProperties } from '../openaireLibrary/utils/properties/env-properties' ;
import { ErrorCodes } from '../openaireLibrary/utils/properties/errorCodes' ;
2018-03-17 23:52:30 +01:00
import { availableCharts , availableEntities , StatisticsDisplay , StatisticsSummary } from "./statisticsEntities" ;
2018-03-14 14:28:45 +01:00
import { Properties } from '../utils/properties' ;
import { StatisticsService } from '../utils/services/statistics.service' ;
import { CommunityService } from "../openaireLibrary/connect/community/community.service" ;
import { CommunitiesService } from "../openaireLibrary/connect/communities/communities.service" ;
import { ConfigurationService } from '../openaireLibrary/utils/configuration/configuration.service' ;
import { PiwikService } from '../openaireLibrary/utils/piwik/piwik.service' ;
import { Meta } from '../openaireLibrary/sharedComponents/metaService' ;
2018-03-17 23:52:30 +01:00
import { DomSanitizer , SafeResourceUrl , SafeUrl } from '@angular/platform-browser' ;
2018-03-01 12:45:37 +01:00
@Component ( {
selector : 'statistics' ,
templateUrl : 'statistics.component.html' ,
} )
2018-03-14 14:28:45 +01:00
2018-03-01 12:45:37 +01:00
export class StatisticsComponent {
public piwiksub : any ;
public subfunders : any ;
2018-03-12 12:26:23 +01:00
public pageTitle = "OpenAIRE" ;
2018-03-01 12:45:37 +01:00
properties :EnvProperties ;
public communityId = null ;
public communityInfo = null ;
2018-03-17 23:52:30 +01:00
entitiesList : string [ ] = availableEntities ;
chartCatsList : string [ ] = availableCharts ;
allowedCharts : string [ ] = [ ] ;
statisticsSum : StatisticsSummary ;
statisticsDisplay : StatisticsDisplay ;
chartsUrlMap : { } ;
public displayedTimeline : string ;
public displayedTimelineUrl : string ;
public displayedGraph : string ;
public displayedGraphUrl : string ;
public displayedProjectChart : string ;
public displayedProjectChartUrl : string ;
2018-03-14 14:28:45 +01:00
2018-03-01 12:45:37 +01:00
constructor (
2018-03-14 14:28:45 +01:00
private route : ActivatedRoute ,
2018-03-01 12:45:37 +01:00
private _router : Router ,
2018-03-17 23:52:30 +01:00
private location : Location ,
private _meta : Meta ,
private _piwikService :PiwikService ,
2018-03-01 12:45:37 +01:00
private config : ConfigurationService ,
2018-03-17 23:52:30 +01:00
private _communityService :CommunityService ,
private _communitiesService :CommunitiesService ,
private _statisticsService : StatisticsService ,
private titleCase : TitleCasePipe ,
private sanitizer : DomSanitizer
2018-03-01 12:45:37 +01:00
) {
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects " ;
var title = "OpenAIRE" ;
this . _meta . setTitle ( title ) ;
this . _meta . updateMeta ( "description" , description ) ;
this . _meta . updateProperty ( "og:description" , description ) ;
this . _meta . updateProperty ( "og:title" , title ) ;
console . log ( "Heree " + document . location . hostname ) ;
}
public ngOnInit() {
this . route . data
. subscribe ( ( data : { envSpecific : EnvProperties } ) = > {
this . properties = data . envSpecific ;
2018-03-17 23:52:30 +01:00
var url = data . envSpecific . baseLink + this . _router . url ;
2018-03-01 12:45:37 +01:00
this . _meta . updateProperty ( "og:url" , url ) ;
if ( this . properties . enablePiwikTrack && ( typeof document !== 'undefined' ) ) {
this . piwiksub = this . _piwikService . trackView ( this . properties , "OpenAIRE" ) . subscribe ( ) ;
}
2018-03-01 17:11:31 +01:00
this . route . queryParams . subscribe (
communityId = > {
this . communityId = communityId [ 'communityId' ] ;
2018-03-13 17:06:04 +01:00
console . log ( " Stats! " + this . properties . statisticsAPIURL ) ;
2018-03-17 23:52:30 +01:00
this . createStatisticsObjects ( ) ;
} ) ;
2018-03-01 17:11:31 +01:00
} ) ;
2018-03-01 12:45:37 +01:00
}
public ngOnDestroy() {
if ( this . piwiksub ) {
this . piwiksub . unsubscribe ( ) ;
}
}
2018-03-14 14:28:45 +01:00
2018-03-17 23:52:30 +01:00
getCamelCaseString ( inputString : string ) {
return this . titleCase . transform ( inputString ) ;
}
2018-03-01 12:45:37 +01:00
2018-03-17 23:52:30 +01:00
createStatisticsObjects() {
console . log ( " Stats! " + this . properties . statisticsAPIURL ) ;
this . _statisticsService . getCommunityStatistics ( this . properties . statisticsAPIURL , this . communityId ) . subscribe (
res = > {
this . statisticsSum = res ;
} ,
error = > {
console . log ( error )
} ,
( ) = > {
this . getDisplayOptions ( ) ;
} ) ;
2018-03-01 12:45:37 +01:00
}
2018-03-17 23:52:30 +01:00
getDisplayOptions() {
this . _statisticsService . getCommunityAdminStatisticsChoices ( this . properties . adminToolsAPIURL , this . communityId )
. subscribe (
res = > {
this . statisticsDisplay = res ;
} ,
error = > {
console . log ( error )
} ,
( ) = > {
2018-03-19 10:07:06 +01:00
this . createChartUrlMap ( ) ;
this . initializeDisplayedCharts ( 'showInMonitor' ) ;
2018-03-17 23:52:30 +01:00
}
) ;
}
2018-03-19 10:07:06 +01:00
/* / ! * checks which charts exist and which the admin has chosen to display in connect monitor * ! /
2018-03-17 23:52:30 +01:00
private createCharts() {
this . createChartUrlMap ( ) ;
2018-03-19 10:07:06 +01:00
/ ! * f o r e a c h e n t i t y f i n d t h e s t a t i s t i c s d i s p l a y i n f o r m a t i o n
2018-03-17 23:52:30 +01:00
from apiUrl / statistics / communityId
2018-03-19 10:07:06 +01:00
* ! /
2018-03-17 23:52:30 +01:00
for ( let entity of this . entitiesList ) {
let displayOptionsForEntity = this . statisticsDisplay . entities [ entity ] ;
2018-03-19 10:07:06 +01:00
/!* if the community has produced such entities *!/
2018-03-17 23:52:30 +01:00
if ( displayOptionsForEntity && this . statisticsSum [ entity + ( entity == 'software' ? '' : 's' ) ] [ 'total' ] ) {
2018-03-19 10:07:06 +01:00
/!* create a map of charts to be displayed *!/
2018-03-17 23:52:30 +01:00
let chartsMap : Map < string , any > = new Map < string , any > ( ) ;
2018-03-19 10:07:06 +01:00
/ ! * f o r e a c h c h a r t c a t e g o r y f i n d w h i c h c h a r t s e x i s t
2018-03-17 23:52:30 +01:00
and which the admin has chosen to be displayed here
2018-03-19 10:07:06 +01:00
* ! /
2018-03-17 23:52:30 +01:00
for ( let chart of this . chartCatsList ) {
2018-03-19 10:07:06 +01:00
/!* current chart is *!/
2018-03-17 23:52:30 +01:00
let displayOptionsForCharts = this . statisticsDisplay . entities [ entity ] . charts . map [ chart ] ;
2018-03-19 10:07:06 +01:00
/!* in the future we probably won't need to check if the url exists *!/
/!* currently the url titles are created using the entity name and the chart name in camelcase *!/
2018-03-17 23:52:30 +01:00
let urlString = this . chartsUrlMap [ entity + this . getCamelCaseString ( chart ) ] ;
if ( displayOptionsForCharts && displayOptionsForCharts . showInMonitor && urlString ) {
chartsMap . set ( chart , urlString ) ;
this . allowedCharts . push ( entity + this . getCamelCaseString ( chart ) ) ;
}
}
2018-03-19 10:07:06 +01:00
/!* add the entity's charts to the charts map *!/
2018-03-17 23:52:30 +01:00
this . charts . set ( entity , chartsMap ) ;
2018-03-19 10:07:06 +01:00
/!* add the entity in the available entities for the current community *!/
2018-03-17 23:52:30 +01:00
this . entitiesForCommunity . push ( entity ) ;
}
}
this . onChangeEntity ( this . entitiesForCommunity [ 0 ] ) ;
2018-03-19 10:07:06 +01:00
} * /
initializeDisplayedCharts ( mode : string ) {
let firstEntity : string ;
for ( let entity of this . entitiesList ) {
if ( this . statisticsDisplay . entities [ entity ] ) {
for ( let chart of this . chartCatsList ) {
if ( this . statisticsDisplay . entities [ entity ] . charts . map [ chart ] &&
this . statisticsDisplay . entities [ entity ] . charts . map [ chart ] [ mode ] &&
this . chartsUrlMap [ entity + this . getCamelCaseString ( chart ) ] ) {
this . allowedCharts . push ( entity + this . getCamelCaseString ( chart ) ) ;
}
}
if ( ! firstEntity ) {
firstEntity = entity ;
this . onChangeEntity ( entity ) ;
}
}
}
2018-03-17 23:52:30 +01:00
}
createChartUrlMap() {
this . chartsUrlMap = {
publicationTimeline : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&persistent=false&data=com=query&data={"query":"comTimelinePubs","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":" ${ this . communityId . toUpperCase ( ) } publications through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83% ` ) ,
publicationGraph : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comOAPubs","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":" ${ this . communityId . toUpperCase ( ) } publications by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=90% ` ) ,
publicationProjectcolumn : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comProjectPubs","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=70%&h=90% ` ) ,
publicationProjectpie : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comProjectPubs","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=91%&h=90% ` ) ,
publicationProjecttable : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } gtable.php?com=query&data={"query":"comProjectPubs","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Publications"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83% ` ) ,
datasetTimeline : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comTimelineData","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":" ${ this . communityId . toUpperCase ( ) } datasets through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83% ` ) ,
datasetGraph : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comOAData","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":" ${ this . communityId . toUpperCase ( ) } datasets by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=90% ` ) ,
datasetProjectcolumn : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comProjectData","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"} ` ) ,
datasetProjectpie : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comProjectData","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=91%&h=90% ` ) ,
datasetProjecttable : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } gtable.php?com=query&data={"query":"comProjectData","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Datasets"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83% ` ) ,
softwareTimeline : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comTimelineSoft","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[{"f":0,"text":"Yearly"}],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":" ${ this . communityId . toUpperCase ( ) } software through the years","subtitle":"","xaxistitle":"Year"}&w=70%&h=83% ` ) ,
softwareGraph : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comOASoft","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"bestlicense","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"order":"d","yaxisheaders":[""],"fieldsheaders":[""],"in":[],"filters":[],"having":[],"incfilters":[],"inchaving":[],"title":" ${ this . communityId . toUpperCase ( ) } software by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=90% ` ) ,
softwareProjectcolumn : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comProjectSoft","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"} ` ) ,
softwareProjectpie : this.sanitizer.bypassSecurityTrustResourceUrl ( ` ${ this . properties . statisticsFrameAPIURL } chart.php?com=query&data={"query":"comProjectSoft","comId":" ${ this . communityId } ","table":"result","fields":[{"fld":"number","agg":"count","type":"pie","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=91%&h=90% ` ) ,
softwareProjecttable : this.sanitizer.bypassSecurityTrustResourceUrl ( this . properties . statisticsFrameAPIURL + 'gtable.php?com=query&data={"query":"comProjectSoft","comId":"' + this . communityId + '","table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"year","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"yaxisheaders":["Software"],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"year","max":"2013","min":"2007","to":-1},{"name":"result_projects-project-funding_lvl0","values":["FP7"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funding_lvl2","values":["ERC"],"to":"-1"}],"having":[],"incfilters":[],"inchaving":[],"title":"","subtitle":"","xaxistitle":"Project"}&w=90%&h=83%' )
} ;
}
onChangeEntity ( entity : string ) {
this . displayedTimeline = ` ${ entity } Timeline ` ;
this . displayedTimelineUrl = this . chartsUrlMap [ this . displayedTimeline ] ;
this . displayedGraph = ` ${ entity } Graph ` ;
this . displayedGraphUrl = this . chartsUrlMap [ this . displayedGraph ] ;
this . displayedProjectChart = this . allowedCharts . filter ( x = > x . includes ( entity + 'Project' ) ) [ 0 ] ;
this . displayedProjectChartUrl = this . chartsUrlMap [ this . displayedProjectChart ] ;
console . log ( ` displayed Timeline is: ${ this . displayedTimeline } ` ) ;
console . log ( ` displayed Graph is: ${ this . displayedGraph } ` ) ;
console . log ( ` displayed ProjectChart is: ${ this . displayedProjectChart } ` ) ;
}
changeDisplayedProjectChart ( chartName : string ) {
this . displayedProjectChart = chartName ;
this . displayedProjectChartUrl = this . chartsUrlMap [ this . displayedProjectChart ] ;
console . log ( ` displayed ProjectChart is: ${ this . displayedProjectChart } ` ) ;
}
2018-03-13 06:19:06 +01:00
2018-03-01 12:45:37 +01:00
}