diff --git a/package-lock.json b/package-lock.json index 8cf9342a7..c16314ab2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1081,6 +1081,11 @@ "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" }, + "angular-ng-autocomplete": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/angular-ng-autocomplete/-/angular-ng-autocomplete-2.0.1.tgz", + "integrity": "sha512-IlKrUeMM6V0/ipnlXF5WluiWmav7eiIlZWtEoch6eXUGylYCHGNdwRO4Kb2snMQuY/6Kv6tDbRFT51Tihd3JwQ==" + }, "ansi-colors": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", diff --git a/package.json b/package.json index d27923a59..a6a6ee24c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@angular/platform-browser-dynamic": "~7.0.0", "@angular/router": "~7.0.0", "@highcharts/map-collection": "^1.1.2", + "angular-ng-autocomplete": "^2.0.1", "core-js": "^2.5.4", "dom-to-image": "^2.6.0", "echarts": "^4.8.0", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2b8097022..30ec25817 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -20,6 +20,9 @@ import { DataHandlerService } from './services/data-handler.service'; import { NgxEchartsModule } from 'ngx-echarts'; import * as echarts from 'echarts'; +import { AutocompleteLibModule } from 'angular-ng-autocomplete'; +import { TopmenuComponent } from './shared/topmenu/top-menu.component'; +import { TreemapHighchartsComponent } from './chart-components/treemap-highcharts/treemap-highcharts.component'; @NgModule({ declarations: [ @@ -33,7 +36,9 @@ import * as echarts from 'echarts'; CountryPageComponent, CountryMapComponent, GaugeChartComponent, - MethodologyPageComponent + MethodologyPageComponent, + TopmenuComponent, + TreemapHighchartsComponent ], imports: [ BrowserModule, @@ -42,7 +47,8 @@ import * as echarts from 'echarts'; NgxEchartsModule.forRoot({ echarts }), - HighchartsChartModule + HighchartsChartModule, + AutocompleteLibModule ], providers: [ DataService, diff --git a/src/app/chart-components/treemap-highcharts/treemap-highcharts.component.html b/src/app/chart-components/treemap-highcharts/treemap-highcharts.component.html new file mode 100644 index 000000000..c7010b042 --- /dev/null +++ b/src/app/chart-components/treemap-highcharts/treemap-highcharts.component.html @@ -0,0 +1,7 @@ +
+ + +
+ diff --git a/src/app/chart-components/treemap-highcharts/treemap-highcharts.component.ts b/src/app/chart-components/treemap-highcharts/treemap-highcharts.component.ts new file mode 100644 index 000000000..a6b17ee1b --- /dev/null +++ b/src/app/chart-components/treemap-highcharts/treemap-highcharts.component.ts @@ -0,0 +1,59 @@ +import { Component, Input, OnInit } from '@angular/core'; + +import * as Highcharts from 'highcharts'; +import More from 'highcharts/highcharts-more'; +import Tree from 'highcharts/modules/treemap'; +import Heatmap from 'highcharts/modules/heatmap'; +import { TreemapHighchartsData } from '../../domain/treemap-highcharts-data'; + +More(Highcharts); +Tree(Highcharts); +Heatmap(Highcharts); + +@Component({ + selector: 'app-treemap-highchart', + templateUrl: './treemap-highcharts.component.html', +}) + +export class TreemapHighchartsComponent implements OnInit { + + @Input() chartTitle: string; + @Input() chartData: TreemapHighchartsData[]; + @Input() color: string; + + Highcharts: typeof Highcharts = Highcharts; + + treeMapChartOptions = {}; + + constructor() {} + + ngOnInit(): void { + this.treeMapChartOptions = { + chart: { + type: 'treemap' + }, + title: { + text: this.chartTitle + }, + tooltip: { + enabled: true + }, + credits: { + enabled: false + }, + colorAxis: { + minColor: '#FFFFFF', + maxColor: this.color, + // maxColor: Highcharts.getOptions().colors[0] + }, + series: [ + { + type: 'treemap', + layoutAlgorithm: 'squarified', + data: this.chartData + } + ] + }; + } + +} diff --git a/src/app/domain/countries.ts b/src/app/domain/countries.ts new file mode 100644 index 000000000..f7ff12113 --- /dev/null +++ b/src/app/domain/countries.ts @@ -0,0 +1,54 @@ +export const countries = [ + {id : 'AL', name : 'Albania'}, + {id : 'AD', name : 'Andorra'}, + {id : 'AT', name : 'Austria'}, + {id : 'BY', name : 'Belarus'}, + {id : 'BE', name : 'Belgium'}, + {id : 'BA', name : 'Bosnia and Herzegovina'}, + {id : 'BG', name : 'Bulgaria'}, + {id : 'HR', name : 'Croatia'}, + {id : 'CZ', name : 'Czech Republic'}, + {id : 'DK', name : 'Denmark'}, + {id : 'EE', name : 'Estonia'}, + // {id : 'FO', name : 'Faroe Islands'}, + {id : 'FI', name : 'Finland'}, + {id : 'FR', name : 'France'}, + {id : 'DE', name : 'Germany'}, + // {id : 'GI', name : 'Gibraltar'}, + {id : 'GR', name : 'Greece'}, + // {id : 'GG', name : 'Guernsey'}, + // {id : 'VA', name : 'Holy See (Vatican City State)'}, + {id : 'HU', name : 'Hungary'}, + {id : 'IS', name : 'Iceland'}, + {id : 'IE', name : 'Ireland'}, + // {id : 'IM', name : 'Isle of Man'}, + {id : 'IT', name : 'Italy'}, + // {id : 'JE', name : 'Jersey'}, + {id : 'LV', name : 'Latvia'}, + // {id : 'LI', name : 'Liechtenstein'}, + {id : 'LT', name : 'Lithuania'}, + {id : 'LU', name : 'Luxembourg'}, + {id : 'MT', name : 'Malta'}, + {id : 'MD', name : 'Moldova, Republic of'}, + // {id : 'MC', name : 'Monaco'}, + {id : 'ME', name : 'Montenegro'}, + {id : 'NL', name : 'Netherlands'}, + {id : 'MK', name : 'North Macedonia'}, + {id : 'NO', name : 'Norway'}, + {id : 'PL', name : 'Poland'}, + {id : 'PT', name : 'Portugal'}, + {id : 'RO', name : 'Romania'}, + {id : 'RU', name : 'Russian Federation'}, + // {id : 'SM', name : 'San Marino'}, + {id : 'RS', name : 'Serbia'}, + {id : 'SK', name : 'Slovakia'}, + {id : 'SI', name : 'Slovenia'}, + {id : 'ES', name : 'Spain'}, + // {id : 'SJ', name : 'Svalbard and Jan Mayen'}, + {id : 'SE', name : 'Sweden'}, + {id : 'CH', name : 'Switzerland'}, + {id : 'TR', name : 'Turkey'}, + {id : 'UA', name : 'Ukraine'}, + {id : 'GB', name : 'United Kingdom'}, + // {id : 'AX', name : 'Åland Islands'} + ]; diff --git a/src/app/domain/treemap-highcharts-data.ts b/src/app/domain/treemap-highcharts-data.ts new file mode 100644 index 000000000..b42caf192 --- /dev/null +++ b/src/app/domain/treemap-highcharts-data.ts @@ -0,0 +1,5 @@ +export class TreemapHighchartsData { + name: string; + value: number; + colorValue: number; +} diff --git a/src/app/pages/continentoverview/continent-overview.component.html b/src/app/pages/continentoverview/continent-overview.component.html index 4306eb0c6..55842dba7 100644 --- a/src/app/pages/continentoverview/continent-overview.component.html +++ b/src/app/pages/continentoverview/continent-overview.component.html @@ -6,7 +6,7 @@
@@ -312,8 +312,8 @@ diff --git a/src/app/pages/home/data-view.component.ts b/src/app/pages/home/data-view.component.ts index 13bb480ad..750512880 100644 --- a/src/app/pages/home/data-view.component.ts +++ b/src/app/pages/home/data-view.component.ts @@ -3,7 +3,9 @@ import { printPage } from '../../shared/reusablecomponents/print-function'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; import { DataService } from '../../services/data.service'; import { DataHandlerService } from '../../services/data-handler.service'; -import { CountryTableData } from '../../domain/overview-map-data'; +import {CountryTableData, EuropeData} from '../../domain/overview-map-data'; +import {environment} from '../../../environments/environment'; +import {TreemapHighchartsData} from '../../domain/treemap-highcharts-data'; @Component({ selector: 'app-data-view', @@ -15,6 +17,8 @@ export class DataViewComponent implements OnInit { // @Input() type: string; // @Input() countries: CountryOverview[]; + private chartsURL = environment.API_ENDPOINT + 'chart?json='; + activeView: string = 'absolute'; contentAbsoluteSelection: string = 'affiliated'; contentPercentageSelection: string = 'affiliated'; @@ -25,12 +29,21 @@ export class DataViewComponent implements OnInit { loadingAbsoluteTable: boolean = true; loadingPercentageTable: boolean = true; - oaPublicationsURL: SafeResourceUrl; - oaRepositoriesURL: SafeResourceUrl; - oaJournalsURL: SafeResourceUrl; - oaDatasetsURL: SafeResourceUrl; - oaSoftwareURL: SafeResourceUrl; - oaOtherURL: SafeResourceUrl; + europeOverviewData: EuropeData; + + oaNoaPublicationsTimelineURL: SafeResourceUrl; + oaNoaDatasetsTimelineURL: SafeResourceUrl; + oaNoaSoftwareTimelineURL: SafeResourceUrl; + oaNoaOtherTimelineURL: SafeResourceUrl; + + fundersResultsData: TreemapHighchartsData[]; + + // oaPublicationsURL: SafeResourceUrl; + // oaRepositoriesURL: SafeResourceUrl; + // oaJournalsURL: SafeResourceUrl; + // oaDatasetsURL: SafeResourceUrl; + // oaSoftwareURL: SafeResourceUrl; + // oaOtherURL: SafeResourceUrl; constructor(private sanitizer: DomSanitizer, private dataService: DataService, @@ -39,6 +52,8 @@ export class DataViewComponent implements OnInit { ngOnInit(): void { this.getAbsoluteData(); this.getPercentageData(); + this.getEuropeOverviewData(); + this.getFundersResults(); } getAbsoluteData() { @@ -67,6 +82,26 @@ export class DataViewComponent implements OnInit { ); } + getEuropeOverviewData() { + this.dataService.getEuropeOAPercentages().subscribe( + rawData => { + this.europeOverviewData = this.dataHandlerService.convertRawDataToEuropeOverviewData(rawData); + }, error => { + console.log(error); + } + ); + } + + getFundersResults() { + this.dataService.getFundersResults().subscribe( + rawData => { + this.fundersResultsData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData); + }, error => { + console.log(error); + } + ); + } + getContentAbsolute(contentSelection: string): void { this.contentAbsoluteSelection = contentSelection; this.getAbsoluteData(); @@ -80,29 +115,18 @@ export class DataViewComponent implements OnInit { changeView(view: string) { this.activeView = view; if (view === 'graph') { - if (!this.oaPublicationsURL) { - // publications: #19647E - this.oaPublicationsURL = this.sanitizer.bypassSecurityTrustResourceUrl(`http://88.197.53.71:8080/stats-api/chart?json=%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22Publications%22%2C%22type%22%3A%22bar%22%2C%22query%22%3A%7B%22name%22%3A%22oso.oapublications%22%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Open%20Access%20Publications%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Atrue%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Afalse%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%2C%22colors%22%3A%5B%22%2319647E%22%2C%22%232f7ed8%22%2C%22%230d233a%22%2C%22%238bbc21%22%2C%22%23910000%22%2C%22%231aadce%22%2C%22%23492970%22%2C%22%23f28f43%22%2C%22%2377a1e5%22%2C%22%23c42525%22%2C%22%23a6c96a%22%5D%7D%7D`); + + if (!this.oaNoaPublicationsTimelineURL) { + this.oaNoaPublicationsTimelineURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + `%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22OA%20Publications%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.oa%22%2C%22parameters%22%3A%5B%22publication%22%5D%7D%7D%2C%7B%22name%22%3A%22Non-OA%20Publications%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.non_oa%22%2C%22parameters%22%3A%5B%22publication%22%5D%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Publications%20over%20the%20years%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22publications%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22year%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Afalse%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Atrue%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%7D%7D`); } - if (!this.oaRepositoriesURL) { - // repositories: #A03245 - this.oaRepositoriesURL = this.sanitizer.bypassSecurityTrustResourceUrl(`http://88.197.53.71:8080/stats-api/chart?json=%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22Repositories%22%2C%22type%22%3A%22bar%22%2C%22query%22%3A%7B%22name%22%3A%22oso.oarepositories%22%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Open%20Access%20Repositories%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Atrue%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Afalse%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%2C%22colors%22%3A%5B%22%23A03245%22%2C%22%232f7ed8%22%2C%22%230d233a%22%2C%22%238bbc21%22%2C%22%23910000%22%2C%22%231aadce%22%2C%22%23492970%22%2C%22%23f28f43%22%2C%22%2377a1e5%22%2C%22%23c42525%22%2C%22%23a6c96a%22%5D%7D%7D`); + if (!this.oaNoaDatasetsTimelineURL) { + this.oaNoaDatasetsTimelineURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + `%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22OA%20Datasets%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.oa%22%2C%22parameters%22%3A%5B%22dataset%22%5D%7D%7D%2C%7B%22name%22%3A%22Non-OA%20Datasets%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.non_oa%22%2C%22parameters%22%3A%5B%22dataset%22%5D%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Datasets%20over%20the%20years%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22datasets%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22year%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Afalse%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Atrue%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%7D%7D`); } - if (!this.oaJournalsURL) { - // journals: #2B243C - this.oaJournalsURL = this.sanitizer.bypassSecurityTrustResourceUrl(`http://88.197.53.71:8080/stats-api/chart?json=%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22Publications%22%2C%22type%22%3A%22bar%22%2C%22query%22%3A%7B%22name%22%3A%22oso.oajournals%22%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Open%20Access%20Journals%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Atrue%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Afalse%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%2C%22colors%22%3A%5B%22%232B243C%22%2C%22%232f7ed8%22%2C%22%230d233a%22%2C%22%238bbc21%22%2C%22%23910000%22%2C%22%231aadce%22%2C%22%23492970%22%2C%22%23f28f43%22%2C%22%2377a1e5%22%2C%22%23c42525%22%2C%22%23a6c96a%22%5D%7D%7D`); + if (!this.oaNoaSoftwareTimelineURL) { + this.oaNoaSoftwareTimelineURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + `%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22OA%20Software%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.oa%22%2C%22parameters%22%3A%5B%22software%22%5D%7D%7D%2C%7B%22name%22%3A%22Non-OA%20Software%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.non_oa%22%2C%22parameters%22%3A%5B%22software%22%5D%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Software%20over%20the%20years%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22software%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22year%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Afalse%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Atrue%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%7D%7D`); } - if (!this.oaDatasetsURL) { - // datasets: #019A85 - this.oaDatasetsURL = this.sanitizer.bypassSecurityTrustResourceUrl(`http://88.197.53.71:8080/stats-api/chart?json=%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22Datasets%22%2C%22type%22%3A%22bar%22%2C%22query%22%3A%7B%22name%22%3A%22oso.oadatasets%22%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Open%20Access%20Datasets%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Atrue%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Afalse%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%2C%22colors%22%3A%5B%22%23019A85%22%2C%22%232f7ed8%22%2C%22%230d233a%22%2C%22%238bbc21%22%2C%22%23910000%22%2C%22%231aadce%22%2C%22%23492970%22%2C%22%23f28f43%22%2C%22%2377a1e5%22%2C%22%23c42525%22%2C%22%23a6c96a%22%5D%7D%7D`); - } - if (!this.oaSoftwareURL) { - // software: #99B2DD - this.oaSoftwareURL = this.sanitizer.bypassSecurityTrustResourceUrl(`http://88.197.53.71:8080/stats-api/chart?json=%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22Software%22%2C%22type%22%3A%22bar%22%2C%22query%22%3A%7B%22name%22%3A%22oso.oasoftware%22%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Open%20Access%20Software%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Atrue%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Afalse%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%2C%22colors%22%3A%5B%22%2399B2DD%22%2C%22%232f7ed8%22%2C%22%230d233a%22%2C%22%238bbc21%22%2C%22%23910000%22%2C%22%231aadce%22%2C%22%23492970%22%2C%22%23f28f43%22%2C%22%2377a1e5%22%2C%22%23c42525%22%2C%22%23a6c96a%22%5D%7D%7D`); - } - if (!this.oaOtherURL) { - // other reasearch products: #310A31 - this.oaOtherURL = this.sanitizer.bypassSecurityTrustResourceUrl(`http://88.197.53.71:8080/stats-api/chart?json=%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22Other%20Research%20Products%22%2C%22type%22%3A%22bar%22%2C%22query%22%3A%7B%22name%22%3A%22oso.oaother%22%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Open%20Access%20Other%20Research%20Products%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Atrue%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Afalse%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%2C%22colors%22%3A%5B%22%23310A31%22%2C%22%232f7ed8%22%2C%22%230d233a%22%2C%22%238bbc21%22%2C%22%23910000%22%2C%22%231aadce%22%2C%22%23492970%22%2C%22%23f28f43%22%2C%22%2377a1e5%22%2C%22%23c42525%22%2C%22%23a6c96a%22%5D%7D%7D`); + if (!this.oaNoaOtherTimelineURL) { + this.oaNoaOtherTimelineURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + `%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22queries%22%3A%5B%7B%22name%22%3A%22OA%20Other%20Research%20Products%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.oa%22%2C%22parameters%22%3A%5B%22other%22%5D%7D%7D%2C%7B%22name%22%3A%22Non-OA%20Other%20Research%20Products%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22name%22%3A%22new.oso.result_timeline.results.non_oa%22%2C%22parameters%22%3A%5B%22other%22%5D%7D%7D%5D%2C%22chart%22%3A%7B%22backgroundColor%22%3A%22%23FFFFFFFF%22%2C%22borderColor%22%3A%22%23335cadff%22%2C%22borderRadius%22%3A0%2C%22borderWidth%22%3A0%2C%22plotBorderColor%22%3A%22%23ccccccff%22%2C%22plotBorderWidth%22%3A0%7D%2C%22title%22%3A%7B%22text%22%3A%22Other%20Research%20Products%20over%20the%20years%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22other%20research%20products%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22year%22%7D%7D%2C%22lang%22%3A%7B%22noData%22%3A%22No%20Data%20available%20for%20the%20Query%22%7D%2C%22exporting%22%3A%7B%22enabled%22%3Afalse%7D%2C%22plotOptions%22%3A%7B%22series%22%3A%7B%22dataLabels%22%3A%7B%22enabled%22%3Afalse%7D%7D%7D%2C%22legend%22%3A%7B%22enabled%22%3Atrue%2C%22align%22%3A%22center%22%2C%22verticalAlign%22%3A%22bottom%22%2C%22layout%22%3A%22horizontal%22%7D%2C%22credits%22%3A%7B%22href%22%3Anull%2C%22enabled%22%3Atrue%2C%22text%22%3A%22Created%20by%20OpenAIRE%20via%20HighCharts%22%7D%7D%7D`); } } } diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html index 87a0e7bbc..d75e355da 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/pages/home/home.component.html @@ -121,9 +121,8 @@
- - - + +
@@ -308,11 +307,38 @@
- @@ -433,7 +459,7 @@
- +
@@ -463,7 +489,7 @@
diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index 51a5a953f..d6f4c883a 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -1,7 +1,9 @@ import { Component, OnInit } from '@angular/core'; import { DataService } from '../../services/data.service'; -import {CountryOverviewData, EuropeData, SelectedCountry} from '../../domain/overview-map-data'; -import {DataHandlerService} from '../../services/data-handler.service'; +import { CountryOverviewData, EuropeData, SelectedCountry } from '../../domain/overview-map-data'; +import { DataHandlerService } from '../../services/data-handler.service'; +import { countries } from '../../domain/countries'; +import { Router } from '@angular/router'; @Component({ selector: 'app-home', @@ -17,13 +19,21 @@ export class HomeComponent implements OnInit { leadingOpenScienceData: CountryOverviewData[]; + countriesCollection = countries; + keyword = 'name'; + constructor(private dataService: DataService, - private dataHandlerService: DataHandlerService) { } + private dataHandlerService: DataHandlerService, + private router: Router) { } ngOnInit(): void { window.scroll(0, 0); + // const searchIcon = document.getElementById('search-icon'); + // const inputContainer = document.getElementsByClassName('input-container')[0]; + // inputContainer.insertAdjacentElement('afterbegin', searchIcon); + this.dataService.getEuropeOverviewData().subscribe( rawData => { this.europeOverviewData = this.dataHandlerService.convertRawDataToEuropeOverviewData(rawData); @@ -58,4 +68,20 @@ export class HomeComponent implements OnInit { this.selectedCountry = null; this.selectedCountryData = null; } + + + selectCountryFromAutocompleteEvent(item) { + // do something with selected item + // console.log('country selected: ', item); + this.router.navigate([`/countryDashboard/${item.id}`]); + } + + onChangeSearch(search: string) { + // fetch remote data from here + // And reassign the 'data' which is binded to 'data' property. + } + + onFocused(e) { + // do something + } } diff --git a/src/app/pages/methodology/methodology.component.html b/src/app/pages/methodology/methodology.component.html index 26eadfb73..5e5d2f91c 100644 --- a/src/app/pages/methodology/methodology.component.html +++ b/src/app/pages/methodology/methodology.component.html @@ -2,341 +2,346 @@
- -
-

Introduction

- -
-
-

- This document describes the methodology , terms, and definitions of the indicators presented in Open Science Observatory. - The Open Science Observatory combines data gathered from OpenAIRE and other data sources to develop and operate an - interactive and dynamic portal, which informs users via rich visualizations and reports on different Open Science - aspects and facets in Europe. The Observatory is an extendable monitor portal with indicators on open science and - the framework uptake by national and sectoral set. -

-

- The dynamic Open Science Observatory leverages existing information collected by OpenAIRE and - at little additional cost or effort, produces and reports value added metrics regarding Open Science - trends and evolution for Horizon 2020 and other funding sources. The goal is to provide an EU Open Science Observatory - as key OpenAIRE product, and employing open metrics based on open data gathered by OpenAire to measure the openness - of publications and data on various aspects (e.g., gold/green/fair), the metadata completeness, the regional or - thematic distributions and will test out preliminary metrics for their FAIRness. This will ensure that research can - be evaluated at the right level (including article-level metrics and altmetrics), in an open and transparent - manner. Such services will deliver accurate metrics for European Research and enable informed recommendations - to high-level decision makers. -

-
-
- +
+

Coming soon....

- -
-

Methodological Approach and Indicators

-
-
-

- Monitoring and evaluating the advancements, trends and impact of OS in Europe is recognised as one of the most - important steps towards the realisation of the EOSC vision. The implementation of the Open Science Observatory - follows the guidelines and - methodological approach which was specified by the EOSCPilot project and more specifically the - EOSCpilot Open Science Monitor Framework (EOSCpilot OSMF). - It aimed to build a model and initial high-level specifications for providing useful analytics to researchers as well - as enabling research performing and funding organizations within EOSC to monitor and gain insights about the OS movement, - regardless of their service management systems and the technology behind them. The six core steps of the specified methodology are: -

-
    -
  • Step 1. Identification of the Open Science Activities;
  • -
  • Step 2. Policy-driven derivation of monitoring targets;
  • -
  • Step 3. Identification of the main Open Science Resources and Indicators;
  • -
  • Step 4. Design of monitoring processes, tasks and workflows;
  • -
  • Step 5. Modelling and implementation of the framework;
  • -
  • Step 6. Continuous validation of the monitoring targets;
  • -
+ + + -

- Step 1. Identification of the Open Science Activities: The first step addresses the need to identify - which parts of the OS lifecycle are of interest in the monitoring process. These can include the conceptualization - of a research task, the data and literature collection, the analysis and development of the research output, the - publication, the review and evaluation of the research result as well as the reuse and reproducibility of results - by the scientific community. These phases entail different open access practices and elements which are being considered - by the monitor, with a special focus on the policies that these elements fall under. -

-

- Step 2. Policy-driven derivation of monitoring targets: The proposed monitoring - framework adopts a policy-driven approach for deriving high level objectives, i.e., target dimensions to be measured - in the monitoring process. Policies on Open Access at different levels, such as the international, national and - regional levels, as well as micro policies are considered as primary sources for deriving more concrete measurable - targets (e.g., Openness, FAIRness, etc.) that should be monitored in the framework. Furthermore, monitoring targets - can be organised into more specialised sub-targets, to measure more specific aspects of OS. For example, a policy - recommendation stating that research data repositories should follow a data archiving plan indicates the monitoring - target for long-term preservation of OS artefacts monitored by a set of indicators, such as whether an organization - applies such a plan, or the period (e.g., months, years) for which preservation is guaranteed. -

-

- Step 3. Identification of the main Open Science Resources and Indicators: - In the next step, the monitoring targets are being mapped to OS elements they apply to, as well as to indicators - that quantify these targets. OS elements are well-defined artefacts of OS practices, such as publication in open - access journals, research data made available in open access repositories, open source software, open educational - material, etc. In the context of this framework, these elements are called OS resources to state the importance - of their contribution for the development of the “Open Science World”. -

-

- Step 4. Design of monitoring processes, tasks and workflows: Each indicator - must be associated with a set of processes, which are employed for the collection of data, the validation and - scoring of metrics (e.g., combination and aggregation of metrics for deriving an accumulated score for a target - dimension), the visualization of the results, and so on. These processes must be well documented in the form of - workflows and tasks, to be performed for the collection and quantification of the indicators. -

-

- Step 5. Modelling and implementation of the framework: The next step - involves the detailed design, implementation, and customization of the framework, which includes the design of - the functionality at its whole, as well as all added value services offered by the framework. -

-

- Step 6. Continuous validation of the monitoring targets: The last step - follows the operation of the OS monitoring framework and refers to the continuous validation and refinement of - the monitoring methodology (i.e., targets and indicators) and results in EOSC. Α monitoring process, to be effective, - must adapt to new OS practices and new policies, validating and readjusting its target goals as well as the indicators - for their evaluation. -

+ + + + + + + + + + + + + + + + + + + + + + -

- The Open Science Observatory of the OpenAIRE is the first implementation of these specifications - and it aspires to become a dynamic tool in the future, with benefits both to the organisations using it to measure - the OA levels of implementation and impact to their community and for the High Level Stakeholders which are the - European Union’s Legal Entities and Bodies, including the Member States and their respective Units. Gaps, implications - and new ways of performing OS are among the elements that could be identified through OA Open Science Observatory - which could then be easily incorporated within the stakeholders’ scope and strategic planning for OS. -

-
-
+ -
+ + + - -
-

Indicators

+ + + + + + + + + + + + + + + + + + + + -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
- + + + + + + + + + + -
    + - -
  • -
    + + + - -
    - -
    -
    Publication
    -
    a scientific publication
    + + -
    Repository
    -
    a repository of publications
    + + + + + + -
    Dataset
    -
    a dataset, usually associated with a publication
    + -
    Software
    -
    software (e.g., open source), usually associated with a publication/dataset
    + + + -
    Other Research Products
    -
    Other research outputs (e.g., dissemination or educational material) associated with a publication, dataset or software.
    + + + + + + -
    Journal
    -
    a scientific journal where authors publish their results in the form of publications
    + + -
    Policy
    -
    an Open Science mandate that organizations follow in order to engage in Open Science best practices
    + + -
    Organization
    -
    an academic institution, company, or any other legal entity with the context of OpenAIRE
    + + -
    Vocabularies
    -
    used in the Observatory are described in http://api.openaire.eu/vocabularies
    -
    -
    + + -
    -
  • + + - - + + + - -
-
+ + + + -
-
+ + -
+
diff --git a/src/app/services/data-handler.service.ts b/src/app/services/data-handler.service.ts index ed8e206c2..f91acd4fb 100644 --- a/src/app/services/data-handler.service.ts +++ b/src/app/services/data-handler.service.ts @@ -9,6 +9,7 @@ import { CountryPageOverviewData } from '../domain/overview-map-data'; import {Indicator} from '../domain/overview-data'; +import {TreemapHighchartsData} from '../domain/treemap-highcharts-data'; @Injectable () export class DataHandlerService { @@ -699,6 +700,32 @@ export class DataHandlerService { return countryPageOverviewData; } + public convertRawDataToTreemapHighchartsData(rawData: RawData) { + + const treeMapData: TreemapHighchartsData[] = []; + + for (const series of rawData.datasets) { + if (series.series.query.name === 'new.oso.funders.results') { + + // let index = 1; + for (const rowResult of series.series.result) { + + const treeMapItemData: TreemapHighchartsData = new TreemapHighchartsData(); + treeMapItemData.name = rowResult.row[1]; + treeMapItemData.value = Number(rowResult.row[0]); + treeMapItemData.colorValue = Number(rowResult.row[0]); + // treeMapItemData.colorValue = index; + + treeMapData.push(treeMapItemData); + + // index = index + 1; + } + } + } + + return treeMapData; + } + private rawResultToCountryMapData(result: Row[]) { const entityMapData: CountryMapData[] = []; diff --git a/src/app/services/data.service.ts b/src/app/services/data.service.ts index 74c79b88c..037460d17 100644 --- a/src/app/services/data.service.ts +++ b/src/app/services/data.service.ts @@ -78,6 +78,10 @@ export class DataService { return this.httpClient.get(this.apiURL + countryPageOverviewDataQuery, headerOptions); } + public getFundersResults(): Observable { + const fundersResultsQuery = '%7B%22series%22%3A%5B%7B%22query%22%3A%7B%22name%22%3A%22new.oso.funders.results%22%7D%7D%5D%2C%22verbose%22%3Atrue%7D'; + return this.httpClient.get(this.apiURL + fundersResultsQuery, headerOptions); + } diff --git a/src/app/shared/reusablecomponents/reusable-components.module.ts b/src/app/shared/reusablecomponents/reusable-components.module.ts index 8d5ee8c2e..195044e60 100755 --- a/src/app/shared/reusablecomponents/reusable-components.module.ts +++ b/src/app/shared/reusablecomponents/reusable-components.module.ts @@ -8,7 +8,6 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; import { AsideHelpContentComponent, HelpContentComponent } from './help-content.component'; import { HelpContentService } from '../../services/help-content.service'; -// import { ModalModule, TabsModule } from 'ngx-bootstrap'; import { FooterComponent } from '../footer/footer.component'; import { ReadMoreComponent, ReadMoreTextComponent } from './read-more.component'; import { TopmenuComponent } from '../topmenu/top-menu.component'; @@ -24,12 +23,12 @@ const myGroups = [ // ModalModule.forRoot(), FormsModule, ReactiveFormsModule, - HttpClientModule, + HttpClientModule ], declarations: [ HelpContentComponent, AsideHelpContentComponent, - TopmenuComponent, + // TopmenuComponent, FooterComponent, ReadMoreComponent, ReadMoreTextComponent, @@ -38,7 +37,7 @@ const myGroups = [ exports: [ HelpContentComponent, AsideHelpContentComponent, - TopmenuComponent, + // TopmenuComponent, FooterComponent, ...myGroups, ReadMoreComponent, diff --git a/src/app/shared/topmenu/top-menu.component.html b/src/app/shared/topmenu/top-menu.component.html index 0bd2755bc..2f127d84b 100644 --- a/src/app/shared/topmenu/top-menu.component.html +++ b/src/app/shared/topmenu/top-menu.component.html @@ -17,12 +17,12 @@ @@ -33,7 +33,7 @@