1
|
import {Component, Input} from '@angular/core';
|
2
|
import { SearchDatasetsComponent } from '../../searchPages/simple/searchDatasets.component';
|
3
|
import { SearchPublicationsComponent } from '../../searchPages/simple/searchPublications.component';
|
4
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'statisticsTab',
|
8
|
template: `
|
9
|
<div *ngIf="show">
|
10
|
<div *ngIf="searchPublicationsComponent.searchUtils.totalResults == 0 && searchDatasetsComponent.searchUtils.totalResults == 0" class = "uk-alert">
|
11
|
There are no statistics
|
12
|
</div>
|
13
|
<div *ngIf="(searchPublicationsComponent.searchUtils.totalResults != 0 || searchDatasetsComponent.searchUtils.totalResults != 0)">
|
14
|
<p>
|
15
|
The results below are discovered through our pilot algorithms.
|
16
|
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
17
|
</p>
|
18
|
<p class="uk-text-bold">Latest Documents Timeline</p>
|
19
|
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>
|
20
|
<p class="uk-text-bold">Documents Types</p>
|
21
|
<i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
|
22
|
</div>
|
23
|
|
24
|
|
25
|
<div *ngIf="(searchPublicationsComponent.searchUtils.totalResults > 0)">
|
26
|
<div>
|
27
|
<p class="uk-text-bold">Funders in Data Providers Publications</p>
|
28
|
<i-frame [url]=pubsFunderUrl width="800" height="350"></i-frame>
|
29
|
<p class="uk-text-bold">Projects with most Publications</p>
|
30
|
<i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
|
31
|
|
32
|
</div>
|
33
|
<div *ngIf="(searchDatasetsComponent.searchUtils.totalResults > 0)">
|
34
|
<div>
|
35
|
<p class="uk-text-bold">Projects with most Research Data</p>
|
36
|
<i-frame [url]=dataProjectsUrl width="800" height="350"></i-frame>
|
37
|
|
38
|
</div>
|
39
|
</div>
|
40
|
</div>
|
41
|
</div>
|
42
|
`
|
43
|
})
|
44
|
|
45
|
export class StatisticsTabComponent {
|
46
|
|
47
|
@Input() statistics;
|
48
|
@Input() id;
|
49
|
@Input() searchDatasetsComponent : SearchDatasetsComponent;
|
50
|
@Input() searchPublicationsComponent : SearchPublicationsComponent;
|
51
|
@Input() show : boolean = false;
|
52
|
|
53
|
private docsTimelineUrl: string;
|
54
|
private docsTypesUrl:string;
|
55
|
private pubsFunderUrl:string;
|
56
|
private dataProjectsUrl:string ;
|
57
|
private pubsProjectsUrl:string;
|
58
|
constructor () {}
|
59
|
|
60
|
ngOnInit() {
|
61
|
|
62
|
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=600&h=250';
|
63
|
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=600&h=250';
|
64
|
this.pubsFunderUrl =' 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=600&h=250';
|
65
|
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=600&h=250';
|
66
|
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=600&h=250';
|
67
|
}
|
68
|
|
69
|
ngOnDestroy() {}
|
70
|
}
|