2017-12-19 13:53:46 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import { SearchDatasetsComponent } from '../../searchPages/simple/searchDatasets.component';
|
|
|
|
import { SearchPublicationsComponent } from '../../searchPages/simple/searchPublications.component';
|
2018-02-15 11:36:12 +01:00
|
|
|
import { ErrorCodes} from '../../utils/properties/errorCodes';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'statisticsTab',
|
|
|
|
template: `
|
|
|
|
<div *ngIf="show">
|
2018-06-08 13:21:42 +02:00
|
|
|
<errorMessages [status]="[searchPublicationsComponent.searchUtils.status, DatasetsComponent.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-06-11 01:25:33 +02:00
|
|
|
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.DONE || searchDatasetsComponent.searchUtils.status == errorCodes.DONE">
|
2017-12-19 13:53:46 +01:00
|
|
|
<p class="uk-text-bold">Latest Documents Timeline</p>
|
2018-10-15 12:47:43 +02:00
|
|
|
<i-frame [url]=docsTimelineUrl width="100%" height="350"></i-frame>
|
2017-12-19 13:53:46 +01:00
|
|
|
<p class="uk-text-bold">Documents Types</p>
|
2018-10-15 12:47:43 +02:00
|
|
|
<i-frame [url]=docsTypesUrl width="100%" height="350"></i-frame>
|
2017-12-19 13:53:46 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div *ngIf="(searchPublicationsComponent.searchUtils.totalResults > 0)">
|
|
|
|
<div>
|
|
|
|
<p class="uk-text-bold">Funders in content providers Publications</p>
|
2018-10-15 12:47:43 +02:00
|
|
|
<i-frame [url]=docsFunderUrl width="100%" height="350"></i-frame>
|
2017-12-19 13:53:46 +01:00
|
|
|
<p class="uk-text-bold">Projects with most Publications</p>
|
2018-10-15 12:47:43 +02:00
|
|
|
<i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div *ngIf="(searchDatasetsComponent.searchUtils.totalResults > 0)">
|
|
|
|
<div>
|
|
|
|
<p class="uk-text-bold">Projects with most Research Data</p>
|
2018-10-15 12:47:43 +02:00
|
|
|
<i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class StatisticsTabComponent {
|
|
|
|
|
|
|
|
@Input() statistics;
|
|
|
|
@Input() id;
|
|
|
|
@Input() searchDatasetsComponent : SearchDatasetsComponent;
|
|
|
|
@Input() searchPublicationsComponent : SearchPublicationsComponent;
|
|
|
|
@Input() show : boolean = false;
|
|
|
|
|
|
|
|
private docsTimelineUrl: string;
|
|
|
|
private docsTypesUrl:string;
|
|
|
|
private docsFunderUrl:string;
|
|
|
|
private dataProjectsUrl:string ;
|
|
|
|
private pubsProjectsUrl:string;
|
|
|
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
|
|
|
|
|
|
|
constructor () {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
2018-10-15 12:47:43 +02:00
|
|
|
this.docsTimelineUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"'+this.id+'","table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "in": [{"f":0, "text": "Yearly"}], "filters": [{"name":"year","max":"2016","min":"1997"},{"name": "result_datasources-datasource-name", "values":[""], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "Year"}&w=100%&h=250';
|
|
|
|
this.docsTypesUrl = 'https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"'+this.id+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
|
|
|
|
this.docsFunderUrl =' https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"'+this.id+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Documents"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
|
|
|
|
this.dataProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"'+this.id+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Datasets"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
|
|
|
|
this.pubsProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"'+this.id+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=100%&h=250';
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {}
|
|
|
|
}
|