2018-10-17 17:19:22 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {ActivatedRoute} from '@angular/router';
|
2019-09-11 11:45:54 +02:00
|
|
|
import {FetchResearchResults} from '../../utils/fetchEntitiesClasses/fetchResearchResults.class';
|
2018-10-17 17:19:22 +02:00
|
|
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
|
|
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'statisticsTab',
|
|
|
|
template: `
|
2018-10-17 17:19:22 +02:00
|
|
|
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-10-17 17:19:22 +02:00
|
|
|
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
|
2019-03-29 13:10:45 +01:00
|
|
|
<p class="uk-text-bold">Research Results Timeline</p>
|
2019-09-10 13:47:22 +02:00
|
|
|
<i-frame [url]=docsTimelineUrl ></i-frame>
|
2019-03-29 13:10:45 +01:00
|
|
|
<p class="uk-text-bold">Research Results Types</p>
|
2019-09-10 13:47:22 +02:00
|
|
|
<i-frame [url]=docsTypesUrl ></i-frame>
|
2017-12-19 13:53:46 +01:00
|
|
|
</div>
|
|
|
|
|
2018-10-17 17:19:22 +02:00
|
|
|
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)">
|
|
|
|
<p class="uk-text-bold">Funders in Research Results of content provider</p>
|
2019-09-10 13:47:22 +02:00
|
|
|
<i-frame [url]=docsFunderUrl ></i-frame>
|
2018-10-17 17:19:22 +02:00
|
|
|
</div>
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-10-17 17:19:22 +02:00
|
|
|
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 ">
|
|
|
|
<p class="uk-text-bold">Projects with most Publications</p>
|
2019-09-10 13:47:22 +02:00
|
|
|
<i-frame [url]=pubsProjectsUrl ></i-frame>
|
2017-12-19 13:53:46 +01:00
|
|
|
</div>
|
|
|
|
|
2018-10-17 17:19:22 +02:00
|
|
|
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
|
|
|
|
<div>
|
|
|
|
<p class="uk-text-bold">Projects with most Research Data</p>
|
2019-09-10 13:47:22 +02:00
|
|
|
<i-frame [url]=dataProjectsUrl></i-frame>
|
2018-10-17 17:19:22 +02:00
|
|
|
</div>
|
2017-12-19 13:53:46 +01:00
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class StatisticsTabComponent {
|
2018-10-17 17:19:22 +02:00
|
|
|
@Input() datasourceId;
|
2019-09-11 11:45:54 +02:00
|
|
|
@Input() fetchPublications : FetchResearchResults;
|
|
|
|
@Input() fetchDatasets : FetchResearchResults;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-10-17 17:19:22 +02:00
|
|
|
private docsTimelineUrl: string;
|
|
|
|
private docsTypesUrl:string;
|
|
|
|
private docsFunderUrl:string;
|
|
|
|
private dataProjectsUrl:string ;
|
|
|
|
private pubsProjectsUrl:string;
|
|
|
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2018-10-17 17:19:22 +02:00
|
|
|
constructor (private route: ActivatedRoute) {}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
ngOnInit() {
|
2018-10-17 17:19:22 +02:00
|
|
|
this.route.data
|
|
|
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
|
|
|
var properties = data.envSpecific;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-09-10 13:47:22 +02:00
|
|
|
this.docsTimelineUrl =properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"'+this.datasourceId+'","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": -30, "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "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=90%&h=90%';
|
|
|
|
this.docsTypesUrl = properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcPubs","dtsrcName":"'+this.datasourceId+'", "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": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
|
|
|
|
this.docsFunderUrl =properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcPubsFund","dtsrcName":"'+this.datasourceId+'", "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": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
|
|
|
|
this.dataProjectsUrl =properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"'+this.datasourceId+'", "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": ["Research Data"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=90%&h=90%';
|
|
|
|
this.pubsProjectsUrl =properties.statisticsFrameAPIURL+'chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"'+this.datasourceId+'", "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=90%&h=90%';
|
2018-10-17 17:19:22 +02:00
|
|
|
});
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnDestroy() {}
|
|
|
|
}
|