Created the indicator tables for the open science tab of the europe page

This commit is contained in:
Stefania Martziou 2020-06-16 21:52:16 +00:00
parent 610ee4706f
commit 85b2f76db6
9 changed files with 642 additions and 52 deletions

View File

@ -61,6 +61,10 @@ export class CountryTableData {
repositories: number = null;
journals: number = null;
policies: number = null;
pid: Indicator;
licence: Indicator;
gold: Indicator;
green: Indicator;
}
export class CountryPageOverviewData {

View File

@ -129,7 +129,7 @@
<hr class="entitiesDivider">
<div class="uk-grid uk-child-width-1-4 uk-margin-large-top">
<div *ngIf="europeOverviewData" class="uk-grid uk-child-width-1-4 uk-margin-large-top">
<div class="entityLegendContent">
<div class="publicationsDot uk-inline"></div>
@ -543,7 +543,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -590,8 +590,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -638,8 +638,8 @@
</div>
</div>
<div class="goldIndicator uk-margin-medium-top">
<h3>Gold</h3>
<div class="goldIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Gold</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -686,8 +686,8 @@
</div>
</div>
<div class="greenIndicator uk-margin-medium-top">
<h3>Green</h3>
<div class="greenIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Green</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -734,8 +734,8 @@
</div>
</div>
<div class="greenVsGoldIndicator uk-margin-medium-top">
<h3>Green vs. Gold</h3>
<div class="greenVsGoldIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Green vs. Gold</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -749,6 +749,60 @@
</div>
</div>
<div class="indicatorsTable uk-visible@m uk-margin-large-top">
<h3 class="">More details for publications</h3>
<div class="uk-margin-top uk-margin-bottom">
<label class="uk-margin-right">Show: </label>
<select class="md-input" #selectContent (change)="getContent('publication', selectContent.value)" style="width: 230px; display: inline-block">
<option value="affiliated">affiliated</option>
<option value="affiliated_peer_reviewed">affiliated peer reviewed</option>
<option value="deposited">deposited</option>
<option value="deposited_peer_reviewed">deposited peer reviewed</option>
</select>
<!--<span class="md-input-bar"></span>-->
</div>
<div class="uk-grid uk-child-width-1-2@l uk-child-width-1-2@m">
<div class="absoluteTable">
<div class="md-card chartCard">
<div class="md-card-content">
<ul class="uk-subnav uk-subnav-pill dataView uk-flex uk-flex-center" data-uk-switcher="{connect:'#pubs-indicators-content-a-fade', animation: 'fade'}">
<li aria-expanded="true" class="uk-active">
<a href="#">
<i class="fas fa-hashtag"></i>
</a>
</li>
<li aria-expanded="false" class="">
<a href="#">
<i class="fas fa-percentage"></i>
</a>
</li>
</ul>
<ul id="pubs-indicators-content-a-fade" class="uk-switcher uk-margin" >
<li aria-hidden="false" class="uk-active" style="animation-duration: 200ms;">
<!--<div *ngIf="loadingPublicationsAbsoluteTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="publicationsAbsoluteTableData" [isPercentage]="false" [countries]="publicationsAbsoluteTableData" [view]="'openScience'" [entity]="'publication'"></app-countries-table>
</li>
<li aria-hidden="true" style="animation-duration: 200ms;" class="">
<!--<div *ngIf="loadingPublicationsPercentageTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="publicationsPercentageTableData" [isPercentage]="true" [countries]="publicationsPercentageTableData" [view]="'openScience'" [entity]="'publication'"></app-countries-table>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
@ -757,7 +811,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -804,8 +858,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -852,6 +906,60 @@
</div>
</div>
<div class="indicatorsTable uk-visible@m uk-margin-large-top">
<h3 class="">More details for datasets</h3>
<div class="uk-margin-top uk-margin-bottom">
<label class="uk-margin-right">Show: </label>
<select class="md-input" #selectContent (change)="getContent('dataset', selectContent.value)" style="width: 230px; display: inline-block">
<option value="affiliated">affiliated</option>
<option value="affiliated_peer_reviewed">affiliated peer reviewed</option>
<option value="deposited">deposited</option>
<option value="deposited_peer_reviewed">deposited peer reviewed</option>
</select>
<!--<span class="md-input-bar"></span>-->
</div>
<div class="uk-grid uk-child-width-1-2@l uk-child-width-1-2@m">
<div class="absoluteTable">
<div class="md-card chartCard">
<div class="md-card-content">
<ul class="uk-subnav uk-subnav-pill dataView uk-flex uk-flex-center" data-uk-switcher="{connect:'#data-indicators-content-a-fade', animation: 'fade'}">
<li aria-expanded="true" class="uk-active">
<a href="#">
<i class="fas fa-hashtag"></i>
</a>
</li>
<li aria-expanded="false" class="">
<a href="#">
<i class="fas fa-percentage"></i>
</a>
</li>
</ul>
<ul id="data-indicators-content-a-fade" class="uk-switcher uk-margin" >
<li aria-hidden="false" class="uk-active" style="animation-duration: 200ms;">
<!--<div *ngIf="loadingPublicationsAbsoluteTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="datasetsAbsoluteTableData" [isPercentage]="false" [countries]="datasetsAbsoluteTableData" [view]="'openScience'" [entity]="'dataset'"></app-countries-table>
</li>
<li aria-hidden="true" style="animation-duration: 200ms;" class="">
<!--<div *ngIf="loadingPublicationsPercentageTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="datasetsPercentageTableData" [isPercentage]="true" [countries]="datasetsPercentageTableData" [view]="'openScience'" [entity]="'dataset'"></app-countries-table>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
@ -860,7 +968,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -907,8 +1015,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -955,6 +1063,60 @@
</div>
</div>
<div class="indicatorsTable uk-visible@m uk-margin-large-top">
<h3 class="">More details for software</h3>
<div class="uk-margin-top uk-margin-bottom">
<label class="uk-margin-right">Show: </label>
<select class="md-input" #selectContent (change)="getContent('software', selectContent.value)" style="width: 230px; display: inline-block">
<option value="affiliated">affiliated</option>
<option value="affiliated_peer_reviewed">affiliated peer reviewed</option>
<option value="deposited">deposited</option>
<option value="deposited_peer_reviewed">deposited peer reviewed</option>
</select>
<!--<span class="md-input-bar"></span>-->
</div>
<div class="uk-grid uk-child-width-1-2@l uk-child-width-1-2@m">
<div class="absoluteTable">
<div class="md-card chartCard">
<div class="md-card-content">
<ul class="uk-subnav uk-subnav-pill dataView uk-flex uk-flex-center" data-uk-switcher="{connect:'#software-indicators-content-a-fade', animation: 'fade'}">
<li aria-expanded="true" class="uk-active">
<a href="#">
<i class="fas fa-hashtag"></i>
</a>
</li>
<li aria-expanded="false" class="">
<a href="#">
<i class="fas fa-percentage"></i>
</a>
</li>
</ul>
<ul id="software-indicators-content-a-fade" class="uk-switcher uk-margin" >
<li aria-hidden="false" class="uk-active" style="animation-duration: 200ms;">
<!--<div *ngIf="loadingPublicationsAbsoluteTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="softwareAbsoluteTableData" [isPercentage]="false" [countries]="softwareAbsoluteTableData" [view]="'openScience'" [entity]="'software'"></app-countries-table>
</li>
<li aria-hidden="true" style="animation-duration: 200ms;" class="">
<!--<div *ngIf="loadingPublicationsPercentageTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="softwarePercentageTableData" [isPercentage]="true" [countries]="softwarePercentageTableData" [view]="'openScience'" [entity]="'software'"></app-countries-table>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
@ -963,7 +1125,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -1010,8 +1172,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -1058,6 +1220,60 @@
</div>
</div>
<div class="indicatorsTable uk-visible@m uk-margin-large-top">
<h3 class="">More details for other research products</h3>
<div class="uk-margin-top uk-margin-bottom">
<label class="uk-margin-right">Show: </label>
<select class="md-input" #selectContent (change)="getContent('other', selectContent.value)" style="width: 230px; display: inline-block">
<option value="affiliated">affiliated</option>
<option value="affiliated_peer_reviewed">affiliated peer reviewed</option>
<option value="deposited">deposited</option>
<option value="deposited_peer_reviewed">deposited peer reviewed</option>
</select>
<!--<span class="md-input-bar"></span>-->
</div>
<div class="uk-grid uk-child-width-1-2@l uk-child-width-1-2@m">
<div class="absoluteTable">
<div class="md-card chartCard">
<div class="md-card-content">
<ul class="uk-subnav uk-subnav-pill dataView uk-flex uk-flex-center" data-uk-switcher="{connect:'#other-indicators-content-a-fade', animation: 'fade'}">
<li aria-expanded="true" class="uk-active">
<a href="#">
<i class="fas fa-hashtag"></i>
</a>
</li>
<li aria-expanded="false" class="">
<a href="#">
<i class="fas fa-percentage"></i>
</a>
</li>
</ul>
<ul id="other-indicators-content-a-fade" class="uk-switcher uk-margin" >
<li aria-hidden="false" class="uk-active" style="animation-duration: 200ms;">
<!--<div *ngIf="loadingPublicationsAbsoluteTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="otherAbsoluteTableData" [isPercentage]="false" [countries]="otherAbsoluteTableData" [view]="'openScience'" [entity]="'other'"></app-countries-table>
</li>
<li aria-hidden="true" style="animation-duration: 200ms;" class="">
<!--<div *ngIf="loadingPublicationsPercentageTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>-->
<app-countries-table *ngIf="otherPercentageTableData" [isPercentage]="true" [countries]="otherPercentageTableData" [view]="'openScience'" [entity]="'other'"></app-countries-table>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</li>

View File

@ -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;
}
);
}
}

View File

@ -759,7 +759,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -798,8 +798,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -838,8 +838,8 @@
</div>
</div>
<div class="goldIndicator uk-margin-medium-top">
<h3>Gold</h3>
<div class="goldIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Gold</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -878,8 +878,8 @@
</div>
</div>
<div class="greenIndicator uk-margin-medium-top">
<h3>Green</h3>
<div class="greenIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Green</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -918,8 +918,8 @@
</div>
</div>
<div class="greenVsGoldIndicator uk-margin-medium-top">
<h3>Green vs. Gold</h3>
<div class="greenVsGoldIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Green vs. Gold</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -941,7 +941,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -980,8 +980,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -1028,7 +1028,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -1067,8 +1067,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -1115,7 +1115,7 @@
<div>
<div class="pidIndicator">
<h3>PID</h3>
<h3 class="uk-margin-remove">PID</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">
@ -1154,8 +1154,8 @@
</div>
</div>
<div class="licenceIndicator uk-margin-medium-top">
<h3>Licence</h3>
<div class="licenceIndicator uk-margin-large-top">
<h3 class="uk-margin-remove">Licence</h3>
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-2@l uk-child-width-1-1@s">
<div class="uk-grid-margin">

View File

@ -1,5 +1,6 @@
<table *ngIf="countries" class="uk-table uk-table-hover uk-table-divider uk-table-small">
<thead>
<ng-container *ngIf="view==='overview'">
<table *ngIf="countries" class="uk-table uk-table-hover uk-table-divider uk-table-small">
<thead>
<tr>
<th width="12,5%" class="" (click)="sortBy('country')">
<span *ngIf="!isSortedBy || isSortedBy!='country'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>
@ -20,10 +21,10 @@
OA journals
</th>
<!--<th *ngIf="type=='overview'" class="uk-text-center" width="12,5%" (click)="sortBy('policies')">-->
<!--<span *ngIf="!isSortedBy || isSortedBy!='policies'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>-->
<!--<span *ngIf="isSortedBy && isSortedBy=='policies' && isDescending"><img src="../../../assets/img/icons/sort-descending.svg"></span>-->
<!--<span *ngIf="isSortedBy && isSortedBy=='policies' && !isDescending"><img src="../../../assets/img/icons/sort-ascending.svg"></span>-->
<!--OA policies-->
<!--<span *ngIf="!isSortedBy || isSortedBy!='policies'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>-->
<!--<span *ngIf="isSortedBy && isSortedBy=='policies' && isDescending"><img src="../../../assets/img/icons/sort-descending.svg"></span>-->
<!--<span *ngIf="isSortedBy && isSortedBy=='policies' && !isDescending"><img src="../../../assets/img/icons/sort-ascending.svg"></span>-->
<!--OA policies-->
<!--</th>-->
<th class="uk-text-center" width="12,5%" (click)="sortBy('publications')">
<span *ngIf="!isSortedBy || isSortedBy!='publications'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>
@ -50,8 +51,8 @@
OA other
</th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
<tr *ngFor="let countryOverview of countries">
<td class=""><a [routerLink]="['/countryDashboard', countryOverview.code]">{{countryOverview.name}}</a></td>
<td class="uk-text-center">
@ -109,5 +110,79 @@
</ng-container>
</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</ng-container>
<ng-container *ngIf="view==='openScience'">
<table *ngIf="countries" class="uk-table uk-table-hover uk-table-divider uk-table-small">
<thead>
<tr>
<th width="20%" class="" (click)="sortBy('country')">
<span *ngIf="!isSortedBy || isSortedBy!='country'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='country' && isDescending"><img src="../../../assets/img/icons/sort-descending.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='country' && !isDescending"><img src="../../../assets/img/icons/sort-ascending.svg"></span>
Country
</th>
<th class="uk-text-center" width="20%" (click)="sortBy('pid')">
<span *ngIf="!isSortedBy || isSortedBy!='pid'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='pid' && isDescending"><img src="../../../assets/img/icons/sort-descending.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='pid' && !isDescending"><img src="../../../assets/img/icons/sort-ascending.svg"></span>
PID
</th>
<th class="uk-text-center" width="20%" (click)="sortBy('licence')">
<span *ngIf="!isSortedBy || isSortedBy!='licence'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='licence' && isDescending"><img src="../../../assets/img/icons/sort-descending.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='licence' && !isDescending"><img src="../../../assets/img/icons/sort-ascending.svg"></span>
Licence
</th>
<th class="uk-text-center" width="20%" (click)="sortBy('gold')">
<span *ngIf="!isSortedBy || isSortedBy!='gold'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='gold' && isDescending"><img src="../../../assets/img/icons/sort-descending.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='gold' && !isDescending"><img src="../../../assets/img/icons/sort-ascending.svg"></span>
Gold
</th>
<th class="uk-text-center" width="20%" (click)="sortBy('green')">
<span *ngIf="!isSortedBy || isSortedBy!='green'" class="uk-margin-small-right"><img src="../../../assets/img/icons/sort.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='green' && isDescending"><img src="../../../assets/img/icons/sort-descending.svg"></span>
<span *ngIf="isSortedBy && isSortedBy=='green' && !isDescending"><img src="../../../assets/img/icons/sort-ascending.svg"></span>
Green
</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let countryOverview of countries">
<td class=""><a [routerLink]="['/countryDashboard', countryOverview.code]">{{countryOverview.name}}</a></td>
<td class="uk-text-center">
<ng-container *ngIf="countryOverview.pid===null">--</ng-container>
<ng-container *ngIf="countryOverview.pid!=null">
<ng-container *ngIf="isPercentage">{{countryOverview.pid.percentage | number :'1.0-1'}}%</ng-container>
<ng-container *ngIf="!isPercentage">{{countryOverview.pid.oa | number}}</ng-container>
</ng-container>
</td>
<td class="uk-text-center">
<ng-container *ngIf="countryOverview.licence===null">--</ng-container>
<ng-container *ngIf="countryOverview.licence!=null">
<ng-container *ngIf="isPercentage">{{countryOverview.licence.percentage | number :'1.0-1'}}%</ng-container>
<ng-container *ngIf="!isPercentage">{{countryOverview.licence.oa | number}}</ng-container>
</ng-container>
</td>
<td class="uk-text-center">
<ng-container *ngIf="countryOverview.gold===null">--</ng-container>
<ng-container *ngIf="countryOverview.gold!=null">
<ng-container *ngIf="isPercentage">{{countryOverview.gold.percentage | number :'1.0-1'}}%</ng-container>
<ng-container *ngIf="!isPercentage">{{countryOverview.gold.oa | number}}</ng-container>
</ng-container>
</td>
<td class="uk-text-center">
<ng-container *ngIf="countryOverview.green===null">--</ng-container>
<ng-container *ngIf="countryOverview.green!=null">
<ng-container *ngIf="isPercentage">{{countryOverview.green.percentage | number :'1.0-1'}}%</ng-container>
<ng-container *ngIf="!isPercentage">{{countryOverview.green.oa | number}}</ng-container>
</ng-container>
</td>
</tr>
</tbody>
</table>
</ng-container>

View File

@ -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 {

View File

@ -36,7 +36,7 @@
<!--<span class="md-input-bar"></span>-->
</div>
<div *ngIf="loadingAbsoluteTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>
<app-countries-table *ngIf="tableAbsoluteData" [isPercentage]="false" [countries]="tableAbsoluteData"></app-countries-table>
<app-countries-table *ngIf="tableAbsoluteData" [isPercentage]="false" [countries]="tableAbsoluteData" [view]="'overview'"></app-countries-table>
</div>
</li>
<li aria-hidden="true" style="animation-duration: 200ms;" class="">
@ -53,7 +53,7 @@
<!--<span class="md-input-bar"></span>-->
</div>
<div *ngIf="loadingPercentageTable" class="whiteFilm"><i class="fa fa-spinner fa-spin fa-2x loader" aria-hidden="true"></i></div>
<app-countries-table *ngIf="tablePercentageData" [isPercentage]="true" [countries]="tablePercentageData"></app-countries-table>
<app-countries-table *ngIf="tablePercentageData" [isPercentage]="true" [countries]="tablePercentageData" [view]="'overview'"></app-countries-table>
</div>
</li>
<li aria-hidden="true" style="animation-duration: 200ms;" class="">

View File

@ -595,6 +595,153 @@ export class DataHandlerService {
return tableData;
}
public convertRawDataToIndicatorsTableData(rawData: RawData) {
const mapTableData: Map<string, CountryTableData> = 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[] = [];

View File

@ -128,7 +128,19 @@ export class DataService {
return this.httpClient.get<RawData>(this.apiURL + fundersResultsByTypeForPIDForCountryQuery, headerOptions);
}
public getIndicatorsTableData(type: string, content: string): Observable<RawData> {
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<RawData>(this.apiURL + indicatorsTableDataQuery, headerOptions);
}
public getOverviewData(): Observable<OverviewData> {