-
Licence
+
+
Licence
+
+
+
More details for other research products
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/pages/continentoverview/continent-overview.component.ts b/src/app/pages/continentoverview/continent-overview.component.ts
index c35a980ab..4ad188faf 100644
--- a/src/app/pages/continentoverview/continent-overview.component.ts
+++ b/src/app/pages/continentoverview/continent-overview.component.ts
@@ -3,9 +3,10 @@ import { ActivatedRoute } from '@angular/router';
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { DataService } from '../../services/data.service';
import { DataHandlerService } from '../../services/data-handler.service';
-import { EuropeData } 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';
+import {Observable} from 'rxjs';
@Component({
selector: 'app-continent-overview',
@@ -82,6 +83,12 @@ export class ContinentOverviewComponent implements OnInit {
greenVsGoldPublicationsChartURL: SafeResourceUrl;
+ loadingPublicationsAbsoluteTable: boolean = true;
+ loadingPublicationsPercentageTable: boolean = true;
+ publicationsTableContentSelection: string = 'affiliated';
+ publicationsAbsoluteTableData: CountryTableData[];
+ publicationsPercentageTableData: CountryTableData[];
+
// Open Science Tab
// datasets subtab
openScienceDatasetsTabIsInitialised: boolean = false;
@@ -101,6 +108,12 @@ export class ContinentOverviewComponent implements OnInit {
datasetsWithPIDByFunderData: TreemapHighchartsData[];
datasetsWithLicenceByFunderData: TreemapHighchartsData[];
+ loadingDatasetsAbsoluteTable: boolean = true;
+ loadingDatasetsPercentageTable: boolean = true;
+ datasetsTableContentSelection: string = 'affiliated';
+ datasetsAbsoluteTableData: CountryTableData[];
+ datasetsPercentageTableData: CountryTableData[];
+
// Open Science Tab
// software subtab
openScienceSoftwareTabIsInitialised: boolean = false;
@@ -120,6 +133,12 @@ export class ContinentOverviewComponent implements OnInit {
softwareWithPIDByFunderData: TreemapHighchartsData[];
softwareWithLicenceByFunderData: TreemapHighchartsData[];
+ loadingSoftwareAbsoluteTable: boolean = true;
+ loadingSoftwarePercentageTable: boolean = true;
+ softwareTableContentSelection: string = 'affiliated';
+ softwareAbsoluteTableData: CountryTableData[];
+ softwarePercentageTableData: CountryTableData[];
+
// Open Science Tab
// other research products subtab
openScienceOtherTabIsInitialised: boolean = false;
@@ -139,6 +158,12 @@ export class ContinentOverviewComponent implements OnInit {
otherWithPIDByFunderData: TreemapHighchartsData[];
otherWithLicenceByFunderData: TreemapHighchartsData[];
+ loadingOtherAbsoluteTable: boolean = true;
+ loadingOtherPercentageTable: boolean = true;
+ otherTableContentSelection: string = 'affiliated';
+ otherAbsoluteTableData: CountryTableData[];
+ otherPercentageTableData: CountryTableData[];
+
constructor(private dataService: DataService,
private dataHandlerService: DataHandlerService,
private route: ActivatedRoute,
@@ -368,6 +393,8 @@ export class ContinentOverviewComponent implements OnInit {
}
);
+ this.getPublicationsTableData(this.publicationsTableContentSelection);
+
this.openSciencePubsTabIsInitialised = true;
}
}
@@ -404,6 +431,8 @@ export class ContinentOverviewComponent implements OnInit {
}
);
+ this.getDatasetsTableData(this.datasetsTableContentSelection);
+
this.openSciencePubsTabIsInitialised = true;
}
}
@@ -440,6 +469,8 @@ export class ContinentOverviewComponent implements OnInit {
}
);
+ this.getSoftwareTableData(this.softwareTableContentSelection);
+
this.openScienceSoftwareTabIsInitialised = true;
}
}
@@ -476,7 +507,95 @@ export class ContinentOverviewComponent implements OnInit {
}
);
+ this.getOtherTableData(this.otherTableContentSelection);
+
this.openScienceOtherTabIsInitialised = true;
}
}
+
+ getContent(type: string, contentSelection: string): void {
+
+ if (type === 'publication') {
+ this.publicationsTableContentSelection = contentSelection;
+ this.getPublicationsTableData(this.publicationsTableContentSelection);
+ } else if (type === 'dataset') {
+ this.datasetsTableContentSelection = contentSelection;
+ this.getDatasetsTableData(this.datasetsTableContentSelection);
+ } else if (type === 'software') {
+ this.softwareTableContentSelection = contentSelection;
+ this.getSoftwareTableData(this.softwareTableContentSelection);
+ } else if (type === 'other') {
+ this.otherTableContentSelection = contentSelection;
+ this.getOtherTableData(this.otherTableContentSelection);
+ }
+ }
+
+ getPublicationsTableData(contentSelection: string) {
+ this.loadingPublicationsAbsoluteTable = true;
+ this.loadingPublicationsPercentageTable = true;
+ this.dataService.getIndicatorsTableData('publication', contentSelection).subscribe(
+ rawData => {
+ this.publicationsAbsoluteTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.publicationsPercentageTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.loadingPublicationsAbsoluteTable = false;
+ this.loadingPublicationsPercentageTable = false;
+ }, error => {
+ console.log(error);
+ this.loadingPublicationsAbsoluteTable = false;
+ this.loadingPublicationsPercentageTable = false;
+ }
+ );
+ }
+
+ getDatasetsTableData(contentSelection: string) {
+ this.loadingDatasetsAbsoluteTable = true;
+ this.loadingDatasetsPercentageTable = true;
+ this.dataService.getIndicatorsTableData('dataset', contentSelection).subscribe(
+ rawData => {
+ this.datasetsAbsoluteTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.datasetsPercentageTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.loadingDatasetsAbsoluteTable = false;
+ this.loadingDatasetsPercentageTable = false;
+ }, error => {
+ console.log(error);
+ this.loadingDatasetsAbsoluteTable = false;
+ this.loadingDatasetsPercentageTable = false;
+ }
+ );
+ }
+
+ getSoftwareTableData(contentSelection: string) {
+ this.loadingSoftwareAbsoluteTable = true;
+ this.loadingSoftwarePercentageTable = true;
+ this.dataService.getIndicatorsTableData('software', contentSelection).subscribe(
+ rawData => {
+ this.softwareAbsoluteTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.softwarePercentageTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.loadingSoftwareAbsoluteTable = false;
+ this.loadingSoftwarePercentageTable = false;
+ }, error => {
+ console.log(error);
+ this.loadingSoftwareAbsoluteTable = false;
+ this.loadingSoftwarePercentageTable = false;
+ }
+ );
+ }
+
+ getOtherTableData(contentSelection: string) {
+ this.loadingOtherAbsoluteTable = true;
+ this.loadingOtherPercentageTable = true;
+ this.dataService.getIndicatorsTableData('other', contentSelection).subscribe(
+ rawData => {
+ this.otherAbsoluteTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.otherPercentageTableData = this.dataHandlerService.convertRawDataToIndicatorsTableData(rawData);
+ this.loadingOtherAbsoluteTable = false;
+ this.loadingOtherPercentageTable = false;
+ }, error => {
+ console.log(error);
+ this.loadingOtherAbsoluteTable = false;
+ this.loadingOtherPercentageTable = false;
+ }
+ );
+ }
+
}
diff --git a/src/app/pages/countrypage/country-page.component.html b/src/app/pages/countrypage/country-page.component.html
index 99c3b6a02..ec99d3580 100644
--- a/src/app/pages/countrypage/country-page.component.html
+++ b/src/app/pages/countrypage/country-page.component.html
@@ -759,7 +759,7 @@
-
PID
+
PID
-
-
Licence
+
+
Licence
-
-
Gold
+
+
Gold
-
-
Green
+
+
Green
-
-
Green vs. Gold
+
+
Green vs. Gold
@@ -941,7 +941,7 @@
-
PID
+
PID
-
-
Licence
+
+
Licence
@@ -1028,7 +1028,7 @@
-
PID
+
PID
-
-
Licence
+
+
Licence
@@ -1115,7 +1115,7 @@
-
PID
+
PID
-
-
Licence
+
+
Licence
diff --git a/src/app/pages/home/countries-table.component.html b/src/app/pages/home/countries-table.component.html
index 6a7776614..13e38014a 100644
--- a/src/app/pages/home/countries-table.component.html
+++ b/src/app/pages/home/countries-table.component.html
@@ -1,5 +1,6 @@
-
-
+
+
+
@@ -20,10 +21,10 @@
OA journals
|
-
-
-
-
+
+
+
+
@@ -50,8 +51,8 @@
OA other
|
-
-
+
+
{{countryOverview.name}} |
@@ -109,5 +110,79 @@
|
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Country
+ |
+
+
+
+
+ PID
+ |
+
+
+
+
+ Licence
+ |
+
+
+
+
+ Gold
+ |
+
+
+
+
+ Green
+ |
+
+
+
+
+ {{countryOverview.name}} |
+
+ --
+
+ {{countryOverview.pid.percentage | number :'1.0-1'}}%
+ {{countryOverview.pid.oa | number}}
+
+ |
+
+ --
+
+ {{countryOverview.licence.percentage | number :'1.0-1'}}%
+ {{countryOverview.licence.oa | number}}
+
+ |
+
+ --
+
+ {{countryOverview.gold.percentage | number :'1.0-1'}}%
+ {{countryOverview.gold.oa | number}}
+
+ |
+
+ --
+
+ {{countryOverview.green.percentage | number :'1.0-1'}}%
+ {{countryOverview.green.oa | number}}
+
+ |
+
+
+
+
+
diff --git a/src/app/pages/home/countries-table.component.ts b/src/app/pages/home/countries-table.component.ts
index dbffdafaf..5be77a540 100644
--- a/src/app/pages/home/countries-table.component.ts
+++ b/src/app/pages/home/countries-table.component.ts
@@ -11,6 +11,9 @@ export class CountriesTableComponent implements OnChanges {
@Input() isPercentage: boolean;
@Input() countries: CountryTableData[];
+ @Input() view: string;
+ @Input() entity: string;
+
isSortedBy: string;
isDescending: boolean = true;
@@ -30,7 +33,21 @@ export class CountriesTableComponent implements OnChanges {
this.isSortedBy = field;
- if (field !== 'country') {
+ if (field === 'pid' || field === 'licence' || field === 'gold' || field === 'green') {
+ if (this.isDescending) {
+ if (this.isPercentage) {
+ this.countries.sort((a, b) => b[field].percentage - a[field].percentage);
+ } else {
+ this.countries.sort((a, b) => b[field].oa - a[field].oa);
+ }
+ } else {
+ if (this.isPercentage) {
+ this.countries.sort((a, b) => a[field].percentage - b[field].percentage);
+ } else {
+ this.countries.sort((a, b) => a[field].oa - b[field].oa);
+ }
+ }
+ } else if (field !== 'country') {
if (this.isDescending) {
this.countries.sort((a, b) => b[field] - a[field]);
} else {
diff --git a/src/app/pages/home/data-view.component.html b/src/app/pages/home/data-view.component.html
index 389dfb8e0..80518f1d1 100644
--- a/src/app/pages/home/data-view.component.html
+++ b/src/app/pages/home/data-view.component.html
@@ -36,7 +36,7 @@
-
+
@@ -53,7 +53,7 @@
-
+
diff --git a/src/app/services/data-handler.service.ts b/src/app/services/data-handler.service.ts
index 1fac04f11..abae91e62 100644
--- a/src/app/services/data-handler.service.ts
+++ b/src/app/services/data-handler.service.ts
@@ -595,6 +595,153 @@ export class DataHandlerService {
return tableData;
}
+ public convertRawDataToIndicatorsTableData(rawData: RawData) {
+
+ const mapTableData: Map = new Map();
+
+ for (const series of rawData.datasets) {
+
+ if (series.series.query.name.includes('new.oso.results.pid_percentage')) {
+ for (const rowResult of series.series.result) {
+
+ const pidIndicator = new Indicator();
+
+ // remove unwanted countries
+ if (this.isCountryToBeRemoved(rowResult.row[3])) {
+ continue;
+ }
+
+ if (mapTableData.has(rowResult.row[3])) {
+ const countryTableData = mapTableData.get(rowResult.row[3]);
+ if (rowResult.row[0] !== 'NaN') {
+ pidIndicator.total = Number(rowResult.row[2]);
+ pidIndicator.oa = Number(rowResult.row[1]);
+ pidIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.pid = pidIndicator;
+ }
+ } else {
+ const countryTableData: CountryTableData = new CountryTableData();
+ if (rowResult.row[0] !== 'NaN') {
+ pidIndicator.total = Number(rowResult.row[2]);
+ pidIndicator.oa = Number(rowResult.row[1]);
+ pidIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.pid = pidIndicator;
+ }
+ countryTableData.name = rowResult.row[4];
+ countryTableData.code = rowResult.row[3];
+ mapTableData.set(rowResult.row[3], countryTableData);
+ }
+ }
+
+ } else if (series.series.query.name.includes('new.oso.results.licence_percentage')) {
+
+ for (const rowResult of series.series.result) {
+
+ const licenceIndicator = new Indicator();
+
+ // remove unwanted countries
+ if (this.isCountryToBeRemoved(rowResult.row[3])) {
+ continue;
+ }
+
+ if (mapTableData.has(rowResult.row[3])) {
+ const countryTableData = mapTableData.get(rowResult.row[3]);
+ if (rowResult.row[0] !== 'NaN') {
+ licenceIndicator.total = Number(rowResult.row[2]);
+ licenceIndicator.oa = Number(rowResult.row[1]);
+ licenceIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.licence = licenceIndicator;
+ }
+ } else {
+ const countryTableData: CountryTableData = new CountryTableData();
+ if (rowResult.row[0] !== 'NaN') {
+ licenceIndicator.total = Number(rowResult.row[2]);
+ licenceIndicator.oa = Number(rowResult.row[1]);
+ licenceIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.licence = licenceIndicator;
+ }
+ countryTableData.name = rowResult.row[4];
+ countryTableData.code = rowResult.row[3];
+ mapTableData.set(rowResult.row[3], countryTableData);
+ }
+ }
+ } else if (series.series.query.name.includes('new.oso.results.green_percentage')) {
+
+ for (const rowResult of series.series.result) {
+
+ const greenIndicator = new Indicator();
+
+ // remove unwanted countries
+ if (this.isCountryToBeRemoved(rowResult.row[3])) {
+ continue;
+ }
+
+ if (mapTableData.has(rowResult.row[3])) {
+ const countryTableData = mapTableData.get(rowResult.row[3]);
+ if (rowResult.row[0] !== 'NaN') {
+ greenIndicator.total = Number(rowResult.row[2]);
+ greenIndicator.oa = Number(rowResult.row[1]);
+ greenIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.green = greenIndicator;
+ }
+ } else {
+ const countryTableData: CountryTableData = new CountryTableData();
+ if (rowResult.row[0] !== 'NaN') {
+ greenIndicator.total = Number(rowResult.row[2]);
+ greenIndicator.oa = Number(rowResult.row[1]);
+ greenIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.green = greenIndicator;
+ }
+ countryTableData.name = rowResult.row[4];
+ countryTableData.code = rowResult.row[3];
+ mapTableData.set(rowResult.row[3], countryTableData);
+ }
+ }
+ } else if (series.series.query.name.includes('new.oso.results.gold_percentage')) {
+
+ for (const rowResult of series.series.result) {
+
+ const goldIndicator = new Indicator();
+
+ // remove unwanted countries
+ if (this.isCountryToBeRemoved(rowResult.row[3])) {
+ continue;
+ }
+
+ if (mapTableData.has(rowResult.row[3])) {
+ const countryTableData = mapTableData.get(rowResult.row[3]);
+ if (rowResult.row[0] !== 'NaN') {
+ goldIndicator.total = Number(rowResult.row[2]);
+ goldIndicator.oa = Number(rowResult.row[1]);
+ goldIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.gold = goldIndicator;
+ }
+ } else {
+ const countryTableData: CountryTableData = new CountryTableData();
+ if (rowResult.row[0] !== 'NaN') {
+ goldIndicator.total = Number(rowResult.row[2]);
+ goldIndicator.oa = Number(rowResult.row[1]);
+ goldIndicator.percentage = Number(rowResult.row[0]);
+ countryTableData.gold = goldIndicator;
+ }
+ countryTableData.name = rowResult.row[4];
+ countryTableData.code = rowResult.row[3];
+ mapTableData.set(rowResult.row[3], countryTableData);
+ }
+ }
+ }
+ }
+
+ const tableData: CountryTableData[] = [];
+
+ mapTableData.forEach((value: CountryTableData, key: string) => {
+ // console.log(key, value);
+ tableData.push(value);
+ });
+
+ return tableData;
+ }
+
public convertRawDataToLeadingOpenScienceData(rawData: RawData) {
const leadingOpenScienceData: CountryOverviewData[] = [];
diff --git a/src/app/services/data.service.ts b/src/app/services/data.service.ts
index 9b2071c96..ef9b33b32 100644
--- a/src/app/services/data.service.ts
+++ b/src/app/services/data.service.ts
@@ -128,7 +128,19 @@ export class DataService {
return this.httpClient.get(this.apiURL + fundersResultsByTypeForPIDForCountryQuery, headerOptions);
}
-
+ public getIndicatorsTableData(type: string, content: string): Observable {
+ let indicatorsTableDataQuery = '';
+ if (content === 'affiliated') {
+ indicatorsTableDataQuery = '%7B%22series%22%3A%5B%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.pid_percentage.affiliated.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.licence_percentage.affiliated.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.green_percentage.affiliated.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.gold_percentage.affiliated.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%5D%2C%22verbose%22%3Atrue%7D';
+ } else if (content === 'affiliated_peer_reviewed') {
+ indicatorsTableDataQuery = '%7B%22series%22%3A%5B%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.pid_percentage.affiliated.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.licence_percentage.affiliated.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.green_percentage.affiliated.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.gold_percentage.affiliated.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%5D%2C%22verbose%22%3Atrue%7D';
+ } else if (content === 'deposited') {
+ indicatorsTableDataQuery = '%7B%22series%22%3A%5B%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.pid_percentage.deposited.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.licence_percentage.deposited.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.green_percentage.deposited.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.gold_percentage.deposited.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%5D%2C%22verbose%22%3Atrue%7D';
+ } else if (content === 'deposited_peer_reviewed') {
+ indicatorsTableDataQuery = '%7B%22series%22%3A%5B%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.pid_percentage.deposited.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.licence_percentage.deposited.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.green_percentage.deposited.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%2C%7B%22query%22%3A%7B%22name%22%3A%22new.oso.results.gold_percentage.deposited.peer_reviewed.bycountry%22%2C%22parameters%22%3A%5B%22' + type + '%22%2C%22' + type + '%22%5D%7D%7D%5D%2C%22verbose%22%3Atrue%7D';
+ }
+ return this.httpClient.get(this.apiURL + indicatorsTableDataQuery, headerOptions);
+ }
public getOverviewData(): Observable {