Revision 53512
Added by Konstantina Galouni over 5 years ago
statisticsTab.component.ts | ||
---|---|---|
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'; |
|
1 |
import {Component, Input} from '@angular/core'; |
|
2 |
import {ActivatedRoute} from '@angular/router'; |
|
3 |
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class'; |
|
4 |
import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class'; |
|
5 |
import {ErrorCodes} from '../../utils/properties/errorCodes'; |
|
6 |
import {EnvProperties} from '../../utils/properties/env-properties'; |
|
5 | 7 |
|
6 | 8 |
@Component({ |
7 | 9 |
selector: 'statisticsTab', |
8 | 10 |
template: ` |
9 |
<div *ngIf="show"> |
|
10 |
<errorMessages [status]="[searchPublicationsComponent.searchUtils.status, DatasetsComponent.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages> |
|
11 |
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages> |
|
11 | 12 |
|
12 |
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.DONE || searchDatasetsComponent.searchUtils.status == errorCodes.DONE">
|
|
13 |
<p class="uk-text-bold">Latest Documents Timeline</p>
|
|
13 |
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
|
|
14 |
<p class="uk-text-bold">Latest Research Result Timeline</p>
|
|
14 | 15 |
<i-frame [url]=docsTimelineUrl width="100%" height="350"></i-frame> |
15 |
<p class="uk-text-bold">Documents Types</p>
|
|
16 |
<p class="uk-text-bold">Research Result Types</p>
|
|
16 | 17 |
<i-frame [url]=docsTypesUrl width="100%" height="350"></i-frame> |
17 | 18 |
</div> |
18 | 19 |
|
20 |
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)"> |
|
21 |
<p class="uk-text-bold">Funders in Research Results of content provider</p> |
|
22 |
<i-frame [url]=docsFunderUrl width="100%" height="350"></i-frame> |
|
23 |
</div> |
|
19 | 24 |
|
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="100%" height="350"></i-frame> |
|
24 |
<p class="uk-text-bold">Projects with most Publications</p> |
|
25 |
<i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame> |
|
26 |
|
|
25 |
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 "> |
|
26 |
<p class="uk-text-bold">Projects with most Publications</p> |
|
27 |
<i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame> |
|
27 | 28 |
</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="100%" height="350"></i-frame> |
|
32 | 29 |
|
33 |
</div> |
|
30 |
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)"> |
|
31 |
<div> |
|
32 |
<p class="uk-text-bold">Projects with most Research Data</p> |
|
33 |
<i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame> |
|
34 |
</div> |
|
34 | 35 |
</div> |
35 |
</div> |
|
36 |
</div> |
|
37 | 36 |
` |
38 | 37 |
}) |
39 | 38 |
|
40 | 39 |
export class StatisticsTabComponent { |
40 |
@Input() datasourceId; |
|
41 |
@Input() fetchPublications : FetchPublications; |
|
42 |
@Input() fetchDatasets : FetchDatasets; |
|
41 | 43 |
|
42 |
@Input() statistics; |
|
43 |
@Input() id; |
|
44 |
@Input() searchDatasetsComponent : SearchDatasetsComponent; |
|
45 |
@Input() searchPublicationsComponent : SearchPublicationsComponent; |
|
46 |
@Input() show : boolean = false; |
|
44 |
private docsTimelineUrl: string; |
|
45 |
private docsTypesUrl:string; |
|
46 |
private docsFunderUrl:string; |
|
47 |
private dataProjectsUrl:string ; |
|
48 |
private pubsProjectsUrl:string; |
|
49 |
public errorCodes:ErrorCodes = new ErrorCodes(); |
|
47 | 50 |
|
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(); |
|
51 |
constructor (private route: ActivatedRoute) {} |
|
54 | 52 |
|
55 |
constructor () {} |
|
56 |
|
|
57 | 53 |
ngOnInit() { |
54 |
this.route.data |
|
55 |
.subscribe((data: { envSpecific: EnvProperties }) => { |
|
56 |
var properties = data.envSpecific; |
|
58 | 57 |
|
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=100%&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=100%&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=100%&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=100%&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=100%&h=250'; |
|
58 |
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=100%&h=250'; |
|
59 |
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=100%&h=250'; |
|
60 |
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=100%&h=250'; |
|
61 |
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=100%&h=250'; |
|
62 |
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=100%&h=250'; |
|
63 |
}); |
|
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
ngOnDestroy() {} |
Also available in: Unified diff
1. dataProvider.component & statisticsTab.component: Use statisticsTab in dataprovider component for landing page.
2. dataProvider.component: variable 'statsClicked' set to false when statistics tab closes (avoid requests).
3. #3690: datasetInfo.ts, dataset.component, dataset.service: Parse 'subtitle' field and display it in dataset landing page.
4. #3484: publicationInfo.ts, publication.component, publication.service: Parse 'essn' and 'iss' fields of 'journal' and change the way journal information is displayed in publication landing page.