Project

General

Profile

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 { ErrorCodes} from '../../utils/properties/errorCodes';
5

    
6
@Component({
7
    selector: 'statisticsTab',
8
    template: `
9
    <div *ngIf="show">
10
      <errorMessages [status]="[searchPublicationsComponent.searchUtils.status, DatasetsComponent.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages>
11

    
12
      <div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.DONE || searchDatasetsComponent.searchUtils.status == errorCodes.DONE">
13
        <p class="uk-text-bold">Latest Documents Timeline</p>
14
        <i-frame  [url]=docsTimelineUrl width="800" height="350"></i-frame>
15
        <p class="uk-text-bold">Documents Types</p>
16
        <i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
17
      </div>
18

    
19

    
20
      <div *ngIf="(searchPublicationsComponent.searchUtils.totalResults > 0)">
21
          <div>
22
            <p class="uk-text-bold">Funders in content providers Publications</p>
23
            <i-frame  [url]=docsFunderUrl width="800" height="350"></i-frame>
24
            <p class="uk-text-bold">Projects with most Publications</p>
25
            <i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
26

    
27
      </div>
28
      <div *ngIf="(searchDatasetsComponent.searchUtils.totalResults > 0)">
29
          <div>
30
            <p class="uk-text-bold">Projects with most Research Data</p>
31
            <i-frame  [url]=dataProjectsUrl width="800" height="350"></i-frame>
32

    
33
          </div>
34
      </div>
35
    </div>
36
    </div>
37
    `
38
})
39

    
40
export class StatisticsTabComponent {
41

    
42
    @Input() statistics;
43
    @Input() id;
44
    @Input() searchDatasetsComponent : SearchDatasetsComponent;
45
    @Input() searchPublicationsComponent : SearchPublicationsComponent;
46
    @Input() show : boolean = false;
47

    
48
    private  docsTimelineUrl: string;
49
    private  docsTypesUrl:string;
50
    private  docsFunderUrl:string;
51
    private  dataProjectsUrl:string ;
52
    private  pubsProjectsUrl:string;
53
    public errorCodes:ErrorCodes = new ErrorCodes();
54

    
55
    constructor () {}
56

    
57
    ngOnInit() {
58

    
59
      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';
60
      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';
61
      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=600&h=250';
62
      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';
63
      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';
64
    }
65

    
66
    ngOnDestroy() {}
67
}
(13-13/13)