finished statistics pages

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51514 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
myrto.koukouli 2018-03-26 15:22:26 +00:00
parent 0027a05c4a
commit ae7c4d5c97
4 changed files with 105 additions and 60 deletions

View File

@ -8,7 +8,7 @@
], ],
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": " ng serve --disable-host-check --host 0.0.0.0", "start": " ng serve --disable-host-check --host 0.0.0.0 --port 5000",
"start:dynamic": "PORT=5000 npm run build:dynamic && npm run serve:dynamic", "start:dynamic": "PORT=5000 npm run build:dynamic && npm run serve:dynamic",
"start:static": "npm run build:static && npm run serve:static", "start:static": "npm run build:static && npm run serve:static",
"build": "ng build", "build": "ng build",

View File

@ -5,10 +5,10 @@
</div> </div>
<div> <div>
<div *ngFor="let entity of allowedEntities"> <div *ngFor="let entity of allowedEntities">
<div *ngIf="statisticsSum[entity].total"> <div *ngIf="statisticsSum[entity].total>0">
<div class="uk-text-uppercase uk-text-bold uk-heading-divider"> <div class="uk-text-uppercase uk-text-bold uk-heading-divider">
<h3>{{ entity == 'software' ? getCamelCaseString(entity) : (entity == 'dataset'? 'Research Data' : getCamelCaseString(entity) + 's') }}</h3> <h3>{{ entity == 'software' ? getCamelCaseString(entity) : (entity == 'dataset'? 'Research Data' : getCamelCaseString(entity) + 's') }}</h3>
<div class="uk-text-small"> <!-- <div class="uk-text-small">
<span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode]"> <span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode]">
{{statisticsSum[entity].total}} {{ entity + (entity == 'software' ? '' : 's') }} {{statisticsSum[entity].total}} {{ entity + (entity == 'software' ? '' : 's') }}
</span> </span>
@ -35,9 +35,9 @@
and {{statisticsSum[entity].embargo}} and {{statisticsSum[entity].embargo}}
{{statisticsSum[entity].embargo > 1 ? 'are' : 'is'}} still in embargo. {{statisticsSum[entity].embargo > 1 ? 'are' : 'is'}} still in embargo.
</span> </span>
</div> </div>-->
</div> </div>
<div class="uk-grid"> <div *ngIf="allowedCharts[entity]" class="uk-grid">
<div *ngFor="let chart of allowedCharts[entity]" class="uk-width-1-2 uk-first-column"> <div *ngFor="let chart of allowedCharts[entity]" class="uk-width-1-2 uk-first-column">
<iframe [src]=chartsUrlMap[chart] width="750" height="450"></iframe> <iframe [src]=chartsUrlMap[chart] width="750" height="450"></iframe>
</div> </div>

View File

@ -3,10 +3,10 @@
<div class="uk-container uk-margin-bottom"> <div class="uk-container uk-margin-bottom">
<article class="uk-article "> <article class="uk-article ">
<div *ngIf="!statisticsSum || !statisticsSum.total_projects" class="uk-alert uk-alert-info" style="margin-top:40px; padding-left:40px;"> <div *ngIf="!statisticsSum || (statisticsSum.total_projects==0)" class="uk-alert uk-alert-info" style="margin-top:40px; padding-left:40px;">
No statistics are available for {{ communityId.toUpperCase() }} No statistics are available for {{ communityId.toUpperCase() }}
</div> </div>
<div *ngIf="statisticsSum && statisticsSum.total_projects && statisticsDisplay && chartsUrlMap" class="uk-margin uk-margin-top"> <div *ngIf="statisticsSum && (statisticsSum.total_projects>0) && statisticsDisplay && chartsUrlMap" class="uk-margin uk-margin-top">
<div class="uk-grid"> <div class="uk-grid">
<ul class="uk-tab uk-tab-left uk-width-1-6 uk-margin-top" data-uk-tab="{connect:'#tabs'}"> <ul class="uk-tab uk-tab-left uk-width-1-6 uk-margin-top" data-uk-tab="{connect:'#tabs'}">
<li *ngFor="let entity of entitiesList" <li *ngFor="let entity of entitiesList"
@ -18,48 +18,69 @@
<ul id="tabs" class="uk-switcher uk-margin uk-width-5-6" style="min-height:450px; padding-left:40px;"> <ul id="tabs" class="uk-switcher uk-margin uk-width-5-6" style="min-height:450px; padding-left:40px;">
<li *ngFor="let entity of entitiesList"> <li *ngFor="let entity of entitiesList">
<div *ngIf="!statisticsSum[entity] ||
!statisticsDisplay.entities[entity]"
class="uk-alert uk-alert-info">
<div *ngIf="displayedEntity == entity && statisticsDisplay.entities[entity] && statisticsSum[entity]"> No {{ entity }}{{ entity == 'software' ? '' : 's' }} statistics available
</div>
<div *ngIf="(displayedEntity == entity) && statisticsSum[entity]">
<div class="uk-text-uppercase uk-text-bold uk-heading-divider"> <div class="uk-text-uppercase uk-text-bold uk-heading-divider">
<h2>{{ getCamelCaseString(entity) }}{{ entity == 'software' ? '' : 's' }} statistics</h2> <h2>{{ getCamelCaseString(entity) }}{{ entity == 'software' ? '' : 's' }} statistics</h2>
<div *ngIf="!statisticsSum[entity].total"
class="uk-alert uk-alert-info">
No {{ entity }}{{ entity == 'software' ? '' : 's' }} available <div *ngIf="statisticsDisplay.entities[entity]">
</div>
<div *ngIf="statisticsSum[entity].total"
class="uk-text-small">
<span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode]"> <span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode]">
{{statisticsSum[entity].total}} {{ entity + (entity == 'software' ? '' : 's') }} {{statisticsSum[entity].total}} {{ entity + ( (entity == 'software' || statisticsSum[entity].total == 1) ? '' : 's') }}
</span>
<span *ngIf="statisticsDisplay.entities[entity].numbers.map['total'][currentMode] &&
statisticsDisplay.entities[entity].numbers.map['project'][currentMode]">
from
</span> </span>
<span *ngIf="statisticsDisplay.entities[entity].numbers.map['project'][currentMode]"> <span *ngIf="statisticsDisplay.entities[entity].numbers.map['project'][currentMode]">
from {{statisticsSum[entity].projects}} projects. {{statisticsSum[entity].projects}} project{{ statisticsSum[entity].projects == 1 ? '' : 's' }}.
</span><br> </span><br>
<span *ngIf="statisticsSum[entity].open_access && <span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode]">
statisticsDisplay.entities[entity].numbers.map['open'][currentMode]">
{{statisticsSum[entity].open_access}} {{statisticsSum[entity].open_access}}
{{statisticsSum[entity].open_access > 1 ? 'are' : 'is'}} OA {{statisticsSum[entity].open_access == 1 ? 'is' : 'are'}} OA
</span> </span>
<span *ngIf="statisticsSum[entity].closed_access && <span *ngIf="statisticsDisplay.entities[entity].numbers.map['closed'][currentMode]">
statisticsDisplay.entities[entity].numbers.map['closed'][currentMode]">,
<span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode]">
,
</span>
{{statisticsSum[entity].closed_access}} {{statisticsSum[entity].closed_access}}
{{statisticsSum[entity].closed_access > 1 ? 'are' : 'is'}} closed {{statisticsSum[entity].closed_access == 1 ? 'is' : 'are'}} closed
</span> </span>
<span *ngIf="statisticsSum[entity].restricted && <span *ngIf="statisticsDisplay.entities[entity].numbers.map['restricted'][currentMode]">
statisticsDisplay.entities[entity].numbers.map['restricted'][currentMode]">,
<span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode] ||
statisticsDisplay.entities[entity].numbers.map['closed'][currentMode]">
,
</span>
{{statisticsSum[entity].restricted}} {{statisticsSum[entity].restricted}}
{{statisticsSum[entity].restricted > 1 ? 'are' : 'is'}} restricted {{statisticsSum[entity].restricted == 1 ? 'is' : 'are'}} restricted
</span> </span>
<span *ngIf="statisticsSum[entity].embargo && <span *ngIf="statisticsDisplay.entities[entity].numbers.map['embargo'][currentMode]">
statisticsDisplay.entities[entity].numbers.map['embargo'][currentMode]">
and {{statisticsSum[entity].embargo}} <span *ngIf="statisticsDisplay.entities[entity].numbers.map['open'][currentMode] ||
{{statisticsSum[entity].embargo > 1 ? 'are' : 'is'}} still in embargo. statisticsDisplay.entities[entity].numbers.map['closed'][currentMode] ||
statisticsDisplay.entities[entity].numbers.map['restricted'][currentMode]">
and
</span>
{{statisticsSum[entity].embargo}}
{{statisticsSum[entity].embargo == 1 ? 'is' : 'are'}} still in embargo.
</span> </span>
</div> </div>
</div> </div>
<div *ngIf="statisticsSum[entity].total"> <div *ngIf="statisticsSum[entity].total>0 && !allowedCharts[entity]"
class="uk-alert uk-alert-info">
No charts available
</div>
<div *ngIf="statisticsSum[entity].total>0 && allowedCharts[entity]">
<div class="uk-grid"> <div class="uk-grid">
<div *ngIf="statisticsDisplay.entities[entity].charts.map['timeline'] && <div *ngIf="statisticsDisplay.entities[entity].charts.map['timeline'] &&
statisticsDisplay.entities[entity].charts.map['timeline'][currentMode] && statisticsDisplay.entities[entity].charts.map['timeline'][currentMode] &&
@ -76,7 +97,7 @@
</div> </div>
<hr> <hr>
<div> <div>
<h4 class="uk-text-uppercase uk-text-bold">{{ communityId }} {{ entity }}{{ entity == 'software' ? '' : 's' }} per project</h4> <h4 class="uk-text-uppercase uk-text-bold">{{ getCamelCaseString(entity) }}{{ entity == 'software' ? '' : 's' }} per project</h4>
</div> </div>
<div> <div>
<ul class="uk-tab uk-margin-top" data-uk-tab="{connect: '#projectChartTabs'"> <ul class="uk-tab uk-margin-top" data-uk-tab="{connect: '#projectChartTabs'">
@ -103,17 +124,17 @@
</li> </li>
</ul> </ul>
<ul id="projectChartTabs" class="uk-switcher uk-margin"> <ul id="projectChartTabs" class="uk-switcher uk-margin">
<li> <li *ngIf="statisticsDisplay.entities[entity].charts.map['projectColumn'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projectcolumn')"> <div *ngIf="displayedProjectChart == (entity + 'Projectcolumn')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe> <iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div> </div>
</li> </li>
<li> <li *ngIf="statisticsDisplay.entities[entity].charts.map['projectPie'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projectpie')"> <div *ngIf="displayedProjectChart == (entity + 'Projectpie')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe> <iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div> </div>
</li> </li>
<li> <li *ngIf="statisticsDisplay.entities[entity].charts.map['projectTable'][currentMode]">
<div *ngIf="displayedProjectChart == (entity + 'Projecttable')"> <div *ngIf="displayedProjectChart == (entity + 'Projecttable')">
<iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe> <iframe [src]=displayedProjectChartUrl width="1000" height="450"></iframe>
</div> </div>

View File

@ -118,6 +118,7 @@ d
console.log(" Stats! "+ this.properties.statisticsAPIURL); console.log(" Stats! "+ this.properties.statisticsAPIURL);
this._statisticsService.getCommunityStatistics(this.properties.statisticsAPIURL,this.communityId).subscribe ( this._statisticsService.getCommunityStatistics(this.properties.statisticsAPIURL,this.communityId).subscribe (
res => { res => {
console.log('statisticsSum is:');
this.statisticsSum = res; this.statisticsSum = res;
}, },
error => { error => {
@ -149,8 +150,8 @@ d
let firstEntity: string; let firstEntity: string;
console.log(`my current mode is: ${this.currentMode}`); console.log(`my current mode is: ${this.currentMode}`);
for (let entity of this.entitiesList) { for (let entity of this.entitiesList) {
if (this.statisticsDisplay.entities[entity]) { if (this.statisticsDisplay.entities[entity] && this.statisticsSum[entity].total) {
console.log(`added ${entity} to allowedEntities`);
this.allowedEntities.push(entity); this.allowedEntities.push(entity);
this.allowedCharts[entity] = []; this.allowedCharts[entity] = [];
for (let chart of this.chartCatsList){ for (let chart of this.chartCatsList){
@ -160,6 +161,7 @@ d
this.chartsUrlMap[entity + this.getCamelCaseString(chart)]) { this.chartsUrlMap[entity + this.getCamelCaseString(chart)]) {
this.allowedCharts[entity].push(entity + this.getCamelCaseString(chart)); this.allowedCharts[entity].push(entity + this.getCamelCaseString(chart));
console.log(`added ${entity} - ${chart} to allowedCharts`);
} }
} }
if (!firstEntity){ if (!firstEntity){
@ -172,36 +174,58 @@ d
createChartUrlMap() { createChartUrlMap() {
this.chartsUrlMap = { 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%`), 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":"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=70%`), 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":"Publications by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
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%`), 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":"Publications per project","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%`), 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":"Publications per project","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%`), 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%`), 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":"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=70%`), 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":"Datasets by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
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":["datasets"],"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%`), 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":["datasets"],"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":"Datasets per project","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`),
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%`), 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":"Datasets per project","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":["Datasets"],"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%`), 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":["Datasets"],"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%`), 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":"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=70%`), 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":"Software by access mode","subtitle":"","xaxistitle":"","nulls":true}&w=70%&h=70%`),
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"}&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":"Software per project","subtitle":"","xaxistitle":"Project"}&w=70%&h=90%`),
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%`), 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":"Software per project","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":["Software"],"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%') 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":["Software"],"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) { onChangeEntity (entity: string) {
this.displayedTimeline = `${entity}Timeline`; this.displayedEntity = entity;
this.displayedTimelineUrl = this.chartsUrlMap[this.displayedTimeline]; console.log(`displayed entity is ${entity}`);
console.log(`displayed Timeline is: ${this.displayedTimeline}`); console.log(`statisticsSum[${entity}].total is ${this.statisticsSum[entity].total}`);
this.displayedGraph = `${entity}Graph`;
this.displayedGraphUrl = this.chartsUrlMap[this.displayedGraph]; if (this.statisticsSum[entity].total &&
console.log(`displayed Graph is: ${this.displayedGraph}`); this.allowedEntities.filter(x => x == entity).length ) {
let firstProjectChart = this.allowedCharts[entity].filter( x => x.includes(entity+'Project') );
this.changeDisplayedProjectChart(firstProjectChart.shift()); console.log(`found ${entity} in allowedEntities`);
this.displayedEntity = entity; this.displayedTimeline = `${entity}Timeline`;
console.log(`displayed entity is ${entity}`); this.displayedTimelineUrl = this.chartsUrlMap[this.displayedTimeline];
console.log(`displayed Timeline is: ${this.displayedTimeline}`);
this.displayedGraph = `${entity}Graph`;
this.displayedGraphUrl = this.chartsUrlMap[this.displayedGraph];
console.log(`displayed Graph is: ${this.displayedGraph}`);
if (this.allowedCharts[entity]) {
let firstProjectChart = this.allowedCharts[entity].filter( x => x.includes(entity+'Project') );
if (firstProjectChart[0]) {
this.changeDisplayedProjectChart(firstProjectChart[0]);
} else {
this.displayedProjectChart = '';
this.displayedProjectChartUrl = '';
console.log(`displayed ProjectChart is: ${this.displayedProjectChart}`);
}
}
} else {
this.displayedTimeline = '';
this.displayedTimelineUrl = '';
console.log(`displayed Timeline is: ${this.displayedTimeline}`);
this.displayedGraph = '';
this.displayedGraphUrl = '';
console.log(`displayed Graph is: ${this.displayedGraph}`);
}
} }
changeDisplayedProjectChart(chartName: string) { changeDisplayedProjectChart(chartName: string) {