[Monitor Dashboard]

move sidebar in library
add 'hasAdminMenu' in routes
update sidebar using class MenuItems

StakeHolder:
	update generateIndicatorByChartUrl
		-parameterize default query
		-add stakeholder
		-add subtitle
	update colors in default stakeholder method


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57936 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Argiro Kokogiannaki 2019-12-23 13:54:37 +00:00
parent 70d965e115
commit a1cff21086
18 changed files with 367 additions and 509 deletions

View File

@ -26,69 +26,82 @@ const routes: Routes = [
{
path: 'admin',
loadChildren: './home/home.module#HomeModule',
resolve: {envSpecific: EnvironmentSpecificResolver}
resolve: {envSpecific: EnvironmentSpecificResolver},
data: {hasAdminMenu: true}
},
{
path: 'admin/:stakeholder',
loadChildren: './stakeholder/stakeholder.module#StakeholderModule',
resolve: {envSpecific: EnvironmentSpecificResolver}
resolve: {envSpecific: EnvironmentSpecificResolver},
data: {hasAdminMenu: false}
},
{
path: 'admin/:stakeholder/:topic',
loadChildren: './topic/topic.module#TopicModule',
resolve: {envSpecific: EnvironmentSpecificResolver}
resolve: {envSpecific: EnvironmentSpecificResolver},
data: {hasAdminMenu: false}
},
/* Library paths*/
{
path: 'portals',
loadChildren: './openaireLibrary/dashboard/portal/communities.module#CommunitiesModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'entities',
loadChildren: './openaireLibrary/dashboard/entity/entities.module#EntitiesModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'classes',
loadChildren: './openaireLibrary/dashboard/divId/divIds.module#DivIdsModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'classContents',
loadChildren: './openaireLibrary/dashboard/divhelpcontent/div-help-contents.module#DivHelpContentsModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'classContents/new',
loadChildren: './openaireLibrary/dashboard/divhelpcontent/new-div-help-content.module#NewDivHelpContentModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'classContents/edit',
loadChildren: './openaireLibrary/dashboard/divhelpcontent/edit-div-help-content.module#EditDivHelpContentModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'helptexts',
loadChildren: './openaireLibrary/dashboard/helpTexts/page-help-contents.module#PageHelpContentsModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'helptexts/new',
loadChildren: './openaireLibrary/dashboard/helpTexts/new-page-help-content.module#NewPageHelpContentModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'helptexts/edit',
loadChildren: './openaireLibrary/dashboard/helpTexts/edit-page-help-content.module#EditPageHelpContentModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
{
path: 'pages',
loadChildren: './openaireLibrary/dashboard/page/pages.module#PagesModule',
resolve: { envSpecific: EnvironmentSpecificResolver }
resolve: { envSpecific: EnvironmentSpecificResolver },
data: {hasAdminMenu: true}
},
/*{
path: 'pages',
@ -121,6 +134,8 @@ const routes: Routes = [
path: '',
loadChildren: './monitor/monitor.module#MonitorModule',
resolve: {envSpecific: EnvironmentSpecificResolver},
data: {hasAdminMenu: false, }
},
{
path: '**',

View File

@ -20,9 +20,10 @@
</li>
</ul>
</div>
</nav>
</div>
<dashboard-sidebar [items]="adminMenuItems"
<dashboard-sidebar *ngIf="hasAdminMenu" [items]="adminMenuItems"
></dashboard-sidebar>
<router-outlet></router-outlet>
</div>

View File

@ -6,9 +6,8 @@ import {Session, User} from './openaireLibrary/login/utils/helper.class';
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
import {StakeholderService} from "./services/stakeholder.service";
import {BehaviorSubject, Subscriber} from "rxjs";
import {LayoutService} from "./library/sharedComponents/sidebar/layout.service";
import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {MenuItem} from "./openaireLibrary/sharedComponents/menu";
import {Item} from "./utils/entities/sidebar";
@Component({
@ -21,8 +20,9 @@ export class AppComponent implements OnInit, OnDestroy {
params: BehaviorSubject<Params> = new BehaviorSubject<Params>(null);
hasSidebar: boolean = false;
hasHeader: boolean = false;
hasAdminMenu: boolean = false;
userMenuItems: MenuItem[] = [];
adminMenuItems: Item[] = [];
adminMenuItems: MenuItem[] = [];
private subscriptions: any[] = [];
constructor(private route: ActivatedRoute,
@ -53,6 +53,10 @@ export class AppComponent implements OnInit, OnDestroy {
this.hasHeader = hasHeader;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.hasAdminMenu.subscribe(hasAdminMenu => {
this.hasAdminMenu = hasAdminMenu;
this.cdr.detectChanges();
}));
this.propertiesService.loadEnvironment()
.then(properties => {
this.properties = properties;
@ -112,11 +116,24 @@ export class AppComponent implements OnInit, OnDestroy {
}
if (this.adminMenuItems.length == 0) {
//nstructor(id: string, name: string, route: string, items: Item[], icon, open: boolean) {
this.adminMenuItems.push(new Item("stakeholders", "Manage Stakeholders", "/admin", [], null, false));
this.adminMenuItems.push(new Item("pages", "Pages", "/pages", [], null, false));
this.adminMenuItems.push(new Item("monitor", "Monitor", "/portals", [], null, false));
this.adminMenuItems.push(new Item("entities", "Entities", "/entities", [], null, false));
this.adminMenuItems.push(new Item("helptexts", "Help texts", "/helptexts?communityId=openaire", [], null, false));
this.adminMenuItems.push(new MenuItem("stakeholders", "Manage Stakeholders", "", "/admin", false, [], [], {}));
let adminOptions = new MenuItem("adminOptions", "Admin Options", "", "", false, [], [], {})
adminOptions.items.push(new MenuItem("pages", "Pages", "", "/pages", false, [], [], {}));
adminOptions.items.push(new MenuItem("portals", "Portals", "", "/portals", false, [], [], {}));
adminOptions.items.push(new MenuItem("entities", "Entities", "", "/entities", false, [], [], {}));
adminOptions.items.push(new MenuItem("classes", "Class help texts", "", "/classes", false, [], [], {}));
this.adminMenuItems.push(adminOptions);
let monitorOptions = new MenuItem("monitorOptions", "Monitor Options", "", "", false, [], [], {})
monitorOptions.items.push(new MenuItem("pages", "Pages", "", "/pages", false, [], [], {communityId: 'openaire'}));
monitorOptions.items.push(new MenuItem("entities", "Entities", "", "/entities", false, [], [], {communityId: 'openaire'}));
monitorOptions.items.push(new MenuItem("classes", "Class help texts", "", "/classContents", false, [], [], {communityId: 'openaire'}));
monitorOptions.items.push(new MenuItem("helptexts", "Help texts", "", "/helptexts", false, [], [], {communityId: 'openaire'}));
this.adminMenuItems.push(monitorOptions);
// this.adminMenuItems.push(new Item("pages", "Pages", "/pages", [], null, false));
// this.adminMenuItems.push(new Item("monitor", "Monitor", "/portals", [], null, false));
// this.adminMenuItems.push(new Item("entities", "Entities", "/entities", [], null, false));
// this.adminMenuItems.push(new Item("helptexts", "Help texts", "/helptexts?communityId=openaire", [], null, false));
}
}
}

View File

@ -17,7 +17,7 @@ import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigation
import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
import {SubscribeModule} from './utils/subscribe/subscribe.module';
import {UserMiniModule} from "./openaireLibrary/login/userMiniModule.module";
import {SideBarModule} from "./library/sharedComponents/sidebar/sideBar.module";
import {SideBarModule} from "./openaireLibrary/dashboard/sharedComponents/sidebar/sideBar.module";
@NgModule({

View File

@ -8,7 +8,7 @@ import {Option, StakeholderUtils} from "../utils/indicator-utils";
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
import {StakeholderCreator} from "../utils/entities/stakeholderCreator";
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
@Component({
selector: 'home',

View File

@ -1,70 +0,0 @@
import {Injectable} from "@angular/core";
import {BehaviorSubject, Observable} from "rxjs";
import {ActivationStart, Router} from "@angular/router";
@Injectable({
providedIn: 'root'
})
export class LayoutService {
/**
* Set this to true when sidebar items are ready.
*/
private openSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
/**
* Add hasSidebar: false on data of route config, if sidebar is not needed.
*/
private hasSidebarSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
/**
* Add hasHeader: false on data of route config, if header is not needed.
*/
private hasHeaderSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
constructor(private router: Router) {
this.router.events.subscribe(event => {
if (event instanceof ActivationStart) {
let data = event.snapshot.data;
if (this.hasSidebarSubject.value === true &&
data['hasSidebar'] !== undefined &&
data['hasSidebar'] === false) {
this.setHasSidebar(false);
} else if (this.hasSidebarSubject.value === false) {
this.setHasSidebar(true);
}
if (this.hasHeaderSubject.value === true &&
data['hasHeader'] !== undefined &&
data['hasHeader'] === false) {
this.setHasHeader(false);
} else if (this.hasHeaderSubject.value === false) {
this.setHasHeader(true);
}
}
});
}
get open(): boolean {
return this.openSubject.getValue();
}
setOpen(value: boolean) {
this.openSubject.next(value);
}
get hasSidebar(): Observable<boolean> {
return this.hasSidebarSubject.asObservable();
}
setHasSidebar(value: boolean) {
this.hasSidebarSubject.next(value);
}
get hasHeader(): Observable<boolean> {
return this.hasHeaderSubject.asObservable();
}
setHasHeader(value: boolean) {
this.hasHeaderSubject.next(value);
}
}

View File

@ -1,40 +0,0 @@
<aside id="sidebar_main">
<div *ngIf= "showHeader" class="sidebar_main_header">
<div *ngIf="header" class="uk-padding-small">
<img *ngIf="header.logoUrl" [src]="header.logoUrl">
<div class="uk-text-bold uk-margin-top">{{header.name}}</div>
<div>{{header.dashboard}}</div>
</div>
</div>
<div class="menu_section uk-margin-top">
<ul>
<ng-template ngFor [ngForOf]="items" let-item let-i="index">
<li [class.current_section]="isTheActiveMenuItem(item)"
[class.act_section]="item.open"
[title]="item.name"
[class.submenu_trigger]="item.items.length > 1">
<a *ngIf="item.items.length <= 1" [routerLink]="(item.route && !isTheActiveMenuItem(item))?item.route:null">
<span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
<span class="menu_title">{{item.name}}</span>
</a>
<ng-template [ngIf]="item.items.length > 1">
<a (click)="item.open = !item.open">
<span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
<span class="menu_title">{{item.name}}</span>
</a>
<ul [style.display]="(item.open?'block':'none')">
<ng-template ngFor [ngForOf]="item.items" let-subItem let-j="index">
<li *ngIf="subItem.route" [class.act_item]="isTheActiveMenuItem(item, subItem)">
<a [routerLink]="!isTheActiveMenuItem(item, subItem)?subItem.route:null">
<span *ngIf="subItem.icon" class="menu_icon"><i class="material-icons">{{subItem.icon}}</i></span>
<span class="menu_title">{{subItem.name}}</span>
</a>
</li>
</ng-template>
</ul>
</ng-template>
</li>
</ng-template>
</ul>
</div>
</aside>

View File

@ -1,24 +0,0 @@
import {Component, Input, OnInit} from '@angular/core';
import {Header, Item} from "../../../utils/entities/sidebar";
@Component({
selector: 'dashboard-sidebar',
templateUrl: 'sideBar.component.html'
})
export class SideBarComponent implements OnInit {
@Input() items: Item[] = [];
@Input() header: Header = null;
@Input() showHeader: boolean = true;
@Input() activeItem: string = '';
@Input() activeSubItem: string = '';
constructor() {}
ngOnInit(): void {}
isTheActiveMenuItem(item: Item, subItem: Item = null): boolean {
return (!subItem && this.activeItem === item.id) ||
(subItem && this.activeItem === item.id && this.activeSubItem === subItem.id);
}
}

View File

@ -1,22 +0,0 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {RouterModule} from "@angular/router";
import {SideBarComponent} from './sideBar.component';
@NgModule({
imports: [
CommonModule,
RouterModule
],
declarations: [
SideBarComponent
],
providers: [],
exports: [
SideBarComponent
]
})
export class SideBarModule {
}

View File

@ -73,7 +73,7 @@
</div>
</nav>
</div>
<dashboard-sidebar *ngIf="sideBar && stakeholder" [items]="sideBar.items"
<dashboard-sidebar *ngIf="sideBarItems.length > 0 && stakeholder" [items]="sideBarItems"
[activeItem]="activeCategory?activeCategory.alias:null"
[activeSubItem]="activeSubCategory?activeSubCategory.alias:null" [showHeader]=false
></dashboard-sidebar>

View File

@ -13,10 +13,9 @@ import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {StakeholderService} from "../services/stakeholder.service";
import {Category, ChartHelper, IndicatorPath, Stakeholder, SubCategory, Topic} from "../utils/entities/stakeholder";
import {StatisticsService} from "../utils/services/statistics.service";
import {Item, Sidebar} from "../utils/entities/sidebar";
import {IndicatorUtils, StakeholderUtils} from "../utils/indicator-utils";
import {StakeholderCreator} from "../utils/entities/stakeholderCreator";
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {FormBuilder, FormControl} from "@angular/forms";
import {IDeactivateComponent} from "../openaireLibrary/utils/can-exit.guard";
import {Subscription} from "rxjs";
@ -46,7 +45,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
public activeTopic: Topic = null;
public activeCategory: Category = null;
public activeSubCategory: SubCategory = null;
public sideBar: Sidebar = null;
public sideBarItems:MenuItem[] = [];
public errorCodes: ErrorCodes;
public stakeholder: Stakeholder;
public numberResults: Map<number, number> = new Map<number, number>();
@ -223,9 +222,9 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
}
canExit() {
if (this.sideBar) {
if (this.sideBarItems.length > 0) {
let status = [];
this.sideBar.items.forEach(item => {
this.sideBarItems.forEach(item => {
status.push(item.open);
});
MonitorComponent.sidebarStatus = {
@ -333,30 +332,34 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
}
private setSideBar() {
let items: Item[] = [];
let items: MenuItem[] = [];
this.activeTopic.categories.forEach((category, index) => {
if (category.isPublic && category.isActive) {
let subItems: Item[] = [];
let subItems: MenuItem[] = [];
category.subCategories.forEach(subCategory => {
if (subCategory.isPublic && subCategory.isActive) {
subItems.push(new Item(subCategory.alias, subCategory.name, (
subItems.push(new MenuItem(subCategory.alias, subCategory.name,"", (
'/' + this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias + '/' + subCategory.alias),
null, null, false));
null, null, [],{}));
}
});
let open = this.activeCategory.alias === category.alias;
if (MonitorComponent.sidebarStatus && MonitorComponent.sidebarStatus.id === this.activeTopic.alias) {
open = MonitorComponent.sidebarStatus.status[index];
}
items.push(new Item(category.alias, category.name, (
// constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params) {
let categoryItem:MenuItem = new MenuItem(category.alias, category.name,"", (
'/' + this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias),
subItems, null, open));
null, [],[],{});
categoryItem.items = subItems;
categoryItem.open = open;
items.push(categoryItem);
}
});
if (items.length === 0) {
items.push(new Item('noCategories', 'No categories available yet', null, [], null, false));
items.push(new MenuItem('noCategories', 'No categories available yet', "", "",false,[], [], {}));
}
this.sideBar = new Sidebar(items, null);
this.sideBarItems = items;
}
private setIndicators() {

View File

@ -14,7 +14,7 @@ import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOServi
import {MonitorRoutingModule} from "./monitor-routing.module";
import {MonitorComponent} from "./monitor.component";
import {StatisticsService} from "../utils/services/statistics.service";
import {SideBarModule} from "../library/sharedComponents/sidebar/sideBar.module";
import {SideBarModule} from "../openaireLibrary/dashboard/sharedComponents/sidebar/sideBar.module";
import {InputModule} from "../library/sharedComponents/input/input.module";
import {UserMiniModule} from "../openaireLibrary/login/userMiniModule.module";
import {ClickModule} from "../openaireLibrary/utils/click/click.module";

View File

@ -11,7 +11,7 @@ import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
import {Subscriber} from "rxjs";
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {StakeholderUtils} from "../utils/indicator-utils";
declare var UIkit;

View File

@ -9,7 +9,7 @@ import {DomSanitizer} from "@angular/platform-browser";
import {StakeholderService} from "../services/stakeholder.service";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {Subscriber} from "rxjs";
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
declare var UIkit;
@ -276,7 +276,7 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV
let index = this.indicatorPaths.length - 1;
this.urlSubscriptions.push(this.indicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
if (this.indicatorPaths.at(index).get('url').valid) {
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value);
let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value, 'bar',this.stakeholder);
let parameters = this.getParametersAsFormArray(indicatorPath);
(this.indicatorPaths.at(index) as FormGroup).setControl('parameters', parameters);
if (!this.indicator.indicatorPaths[index]) {

View File

@ -1,39 +0,0 @@
export class Header {
name: string;
dashboard: string;
logoUrl: string;
constructor(name: string, dashboard: string, logoUrl: string = null) {
this.name = name;
this.dashboard = dashboard;
this.logoUrl = logoUrl
}
}
export class Item {
id: string;
name: string;
route: string;
items: Item[];
icon: string;
open: boolean;
constructor(id: string, name: string, route: string, items: Item[], icon, open: boolean) {
this.id = id;
this.name = name;
this.route = route;
this.items = items;
this.icon = icon;
this.open = open;
}
}
export class Sidebar {
items: Item[];
header: Header;
constructor(items: Item[], header: Header) {
this.items = items;
this.header = header;
}
}

View File

@ -40,246 +40,246 @@ export class Stakeholder {
this.isPublic = isPublic;
this.logoUrl = logoUrl;
}
static createECStakeholder(): Stakeholder {
let ec: Stakeholder = new Stakeholder(null, "funder", "ec__________::EC", "European Commission", "EC", false, "ec", true, true, null);
// new Stakeholder('wt','funder','wt__________::WT','Wellcome Trust','WT',false, 'wt',true,true);
ec.topics.push(ec.createOSTopic(ec));
ec.topics.push(ec.createImpactTopic());
ec.topics.push(ec.createCollaborationTopic());
return ec;
}
createOSTopic(stakeholder: Stakeholder): Topic {
let topic = new Topic("OpenScience", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "open-science", true, true);
/* let overview:Category = new Category("Overview","","overview",true,true);
topic.categories.push(overview);
let overviewDefSub = new SubCategory(null, null,null,true, true);
overview.subCategories.push(overviewDefSub);*/
let pubCategory: Category = new Category("Publications", "", "publications", true, true);
topic.categories.push(pubCategory);
let pubDefSub = new SubCategory(null, null, null, true, true);
pubCategory.subCategories.push(pubDefSub);
/* let pubOpenSub = new SubCategory("Openess","","openness",true,true);
pubCategory.subCategories.push(pubOpenSub);
let pubFundingSub = new SubCategory("Funding","","funding",true,true);
pubCategory.subCategories.push(pubFundingSub);
let pubDatasourceSub = new SubCategory("Content Providers","","content-providers",true,true);
pubCategory.subCategories.push(pubDatasourceSub);
let pubDocTypeSub = new SubCategory("Document Type","","doc-type",true,true);
pubCategory.subCategories.push(pubDocTypeSub);
let pubFindSub = new SubCategory("Findability","","dindability",true,true);
pubCategory.subCategories.push(pubFindSub);*/
let dataCategory: Category = new Category("Research data", "", "data", true, true);
topic.categories.push(dataCategory);
let dataDefSub = new SubCategory(null, null, null, true, true);
dataCategory.subCategories.push(dataDefSub);
let softwareCategory: Category = new Category("Software", "", "software", true, true);
topic.categories.push(softwareCategory);
let softDefSub = new SubCategory(null, null, null, true, true);
softwareCategory.subCategories.push(softDefSub);
let otherCategory: Category = new Category("Other research products", "", "other", true, true);
topic.categories.push(otherCategory);
let otherDefSub = new SubCategory(null, null, null, true, true);
otherCategory.subCategories.push(otherDefSub);
/* let datasourceCategory:Category = new Category("Content Providers","","content-providers",true,true);
topic.categories.push(datasourceCategory);
let datasourceDefSub = new SubCategory(null, null,null,true, true);
datasourceCategory.subCategories.push(datasourceDefSub);*/
let projectCategory: Category = new Category("Projects", "", "projects", true, true);
topic.categories.push(projectCategory);
let projectDefSub = new SubCategory(null, null, null, true, true);
projectCategory.subCategories.push(projectDefSub);
//Numbers
let n_total_pubs = new Indicator("Publications", 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "publications"])]);
let n_open_pubs = new Indicator("OA Publications", 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "open_access"])]);
let n_total_projects = new Indicator("Projects", null, "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "total_projects"])]);
let n_total_data = new Indicator("Reserach data", null, "number", "small", true, true, [new IndicatorPath(null, "search",
"/datasets/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
let n_total_soft = new Indicator("Software", null, "number", "small", true, true, [new IndicatorPath(null, "search",
"/software/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
let n_total_other = new Indicator("Other research products", null, "number", "small", true, true, [new IndicatorPath(null, "search",
"/other/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
/*overviewDefSub.numbers.push(n_total_pubs);
overviewDefSub.numbers.push(n_open_pubs);
overviewDefSub.numbers.push(n_total_projects);
overviewDefSub.numbers.push(n_total_data);
overviewDefSub.numbers.push(n_total_soft);
overviewDefSub.numbers.push(n_total_other);*/
pubDefSub.numbers.push(n_total_pubs);
pubDefSub.numbers.push(n_open_pubs);
softDefSub.numbers.push(n_total_soft);
dataDefSub.numbers.push(n_total_data);
otherDefSub.numbers.push(n_total_other);
projectDefSub.numbers.push(n_total_projects);
//Charts
let c_pubs_per_project = new Indicator("Which are the top " + stakeholder.index_shortName + " projects?", 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "chart", "large", true, true, [
new IndicatorPath("bar", "old", "chart.php?com=query&data=", '{"table":"result","fields":[{"fld":"number","agg":"count","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","yaxis":1,"c":false}],"xaxis":{"name":"result_projects-project-acronym","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"count-number","yaxisheaders":[""],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"result_projects-project-funder","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"}],"having":[],"xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"title":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '","subtitle":"","xaxistitle":"project","order":"d"}', null)]);
c_pubs_per_project.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, "Publications per project (top 30)", "bar");
pubDefSub.charts.push(c_pubs_per_project);
//TO check
/* let c_pubs_per_datasource = new Indicator("Which are the top repositories containing "+stakeholder.index_shortName+" research outputs?",null, "chart","small",false,
true, [new IndicatorPath("column", "old", "chart.php?com=query&data="+encodeURIComponent('{"table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"result_datasources-datasource-name","agg":"avg"},"group":"","color":"","type":"chart","size":"20","sort":"count-number","yaxisheaders":[""],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funder","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"],"to":"-1"},{"name":"result_datasources-datasource-type","exvalues":["Publication Catalogue"]}],"having":[],"xStyle":{"r":-90,"s":"-","l":"-","ft":10,"wt":"-"},"title":"Publications by content provider (top 20)","subtitle":"","xaxistitle":"content providers","order":"d"}'), null)]);
pubDefSub.charts.push(c_pubs_per_datasource);
let c_pubs_per_doc_type = new Indicator("In what type of documents do your researchers used to publish?",null, "chart","small",true, true,
[new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Data","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.classification","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.type","type":"=","values":["publication"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"publications"},"subtitle":{"text":"per document type"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Document Type"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_per_doc_type);
let c_pubs_funding_scheme = new Indicator("What is the percentage publications by funding scheme / programme?",null, "chart","small",true,
true, [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Open Access","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.project.funding level 0","type":"=","values":["H2020"]},{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}},{"name":"Total","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.type","type":"=","values":["publication"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications"},"subtitle":{"text":"by funding scheme"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Funding scheme"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_funding_scheme);
*/
/* //TODO check why doesn't load
let c_pubs_gg_funding_scheme = new Indicator("What is the percentage of green and gold publications by funding scheme / programme?",null, "chart","medium",true,
true, [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Gold","color":"#f8b500","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},,{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"result.datasource.type","type":"=","values":["Journal"]},{"field":"result.datasource.type","type":"=","values":["Journal Aggregator/Publisher"]}],"op":"OR"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}},{"name":"Green","color":"#239d60","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.project.funding level 0","type":"=","values":["H2020"]},{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"result.datasource.type","type":"=","values":["Institutional Repository"]},{"field":"result.datasource.type","type":"=","values":["Thematic Repository"]}],"op":"OR"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"H2020 green and gold publications"},"subtitle":{"text":"by funding scheme"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Funding scheme"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
//pubDefSub.charts.push(c_pubs_gg_funding_scheme);
*/
/* let c_pubs_open = new Indicator("Open Access publications timeline",null, "chart","small",true, true,
[new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Open Access Publications"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_open);
let c_pubs_access_modes = new Indicator("How your Open Access publications are shaped over the years?",null, "chart","medium",true, true,
[new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null},{"field":"publication.access mode","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by Access Mode"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_access_modes);
// let c_pubs_av_embargo = new Indicator("Average period of embargoed publications",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_pubs_av_embargo);
let c_pubs_OA_journals = new Indicator("Publications in OA Journals over time",null, "chart","medium",true, true,
[new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by OA Journals"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_OA_journals);
//from monitor
let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
[new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"contains","values":["repo"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by OA Journals"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_repo);
//
// let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
// [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('), null)]);
// pubDefSub.charts.push(c_pubs_repo);
// let c_pubs_green_year = new Indicator("How many OA publications have been submitted to repos per year?",null, "chart","medium",true, true,[new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_pubs_green_year);
let c_pubs_datasource_country = new Indicator("What is the percentage of OA pubs by repositories over the years?",null, "chart","medium",true, true,
[new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Gold OA","type":"column","color":"#b8c91fff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Green OA","type":"column","color":"#0d9637ff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"starts_with","values":["Institu"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"percent"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_datasource_country);
let c_pubs_funding_country = new Indicator("What is the percentage of OA pubs by projects over the years?",null, "chart","medium",true, true,
[new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Gold OA","type":"column","color":"#b8c91fff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Green OA","type":"column","color":"#0d9637ff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"starts_with","values":["Institu"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"percent"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
pubDefSub.charts.push(c_pubs_funding_country);
let c_data_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true,
[new IndicatorPath("column", "stats-tool",'/chart?json='+
encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Data","type":"column","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.type","type":"=","values":["dataset"]},{"field":"result.year","type":">=","values":["2014"]},{"field":"result.year","type":"<=","values":["2019"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+stakeholder.index_shortName+' research data over time"},"subtitle":{},"yAxis":{"title":{"text":"Research data"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
dataDefSub.charts.push(c_data_year);*/
// let c_other_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// otherDefSub.charts.push(c_other_year);
//
// let c_datasources_access_modes = new Indicator("What is the number of research data repositories by access mode?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_datasources_access_modes);
//
// let c_pub_nometa_year = new Indicator("How many publications lack of abstract per year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_pub_nometa_year);
//
// let c_pub_meta_linked_year = new Indicator("??",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_pub_meta_linked_year);
//
// let c_pub_colocated_year = new Indicator("How many publications are submitted to more than one repos per year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_pub_colocated_year);
// let c_pub_pids = new Indicator("What is the most common PIDs by year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_pub_pids);
//
// let c_oai_pmh_datasources = new Indicator("What is the most common PIDs by year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// pubDefSub.charts.push(c_oai_pmh_datasources);
return topic;
}
createImpactTopic(): Topic {
let topic = new Topic("Impact/Correlation", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "impact", true, true);
let pubCategory: Category = new Category("Publications", "", "publications", true, true);
topic.categories.push(pubCategory);
let pubDefSub = new SubCategory(null, null, null, true, true);
pubCategory.subCategories.push(pubDefSub);
let dataCategory: Category = new Category("Research data", "", "data", true, true);
topic.categories.push(dataCategory);
let dataDefSub = new SubCategory(null, null, null, true, true);
dataCategory.subCategories.push(dataDefSub);
let softwareCategory: Category = new Category("Software", "", "software", true, true);
topic.categories.push(softwareCategory);
let softDefSub = new SubCategory(null, null, null, true, true);
softwareCategory.subCategories.push(softDefSub);
/* let otherCategory:Category = new Category("Other research products","","other",true,true);
topic.categories.push(otherCategory);
let otherDefSub = new SubCategory(null, null,null,true, true);
otherCategory.subCategories.push(otherDefSub);*/
return topic;
}
createCollaborationTopic(): Topic {
let topic = new Topic("Demo Topic", "This is a demo topic", "demo-topic", true, true);
let category1: Category = new Category("Category 1", "This is ", "cat-1", true, true);
topic.categories.push(category1);
let subCat1 = new SubCategory("Sub-category 1", "", "sub-cat-1", true, true);
category1.subCategories.push(subCat1);
let subCat2 = new SubCategory("Sub-category 2", "", "sub-cat-2", true, true);
category1.subCategories.push(subCat2);
let category2: Category = new Category("Category 2 - no subcategories", "", "cat-2", true, true);
topic.categories.push(category2);
let defSub = new SubCategory(null, null, null, true, true);
category2.subCategories.push(defSub);
let chart1 = new Indicator(
"Chart title goes here", "Chart description goes here", "chart", "medium", true, true,
[new IndicatorPath("line", "image", "https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null, null)]);
let chart2 = new Indicator("Chart title goes here", "Chart description goes here", "chart", "medium", true, true, [new IndicatorPath("line", "image", "https://static.boredpanda.com/blog/wp-content/uuuploads/funny-graphs-2/funny-graphs-legs.jpg", null, null)]);
subCat1.charts.push(chart1);
subCat2.charts.push(chart2);
defSub.charts.push(chart1);
defSub.charts.push(chart2);
let utils = new IndicatorUtils();
let url = "https://beta.openaire.eu/stats/chart.php?com=query&data={%22table%22:%22result%22,%22fields%22:[{%22fld%22:%22number%22,%22agg%22:%22count%22,%22type%22:%22bar%22,%22yaxis%22:1,%22c%22:false}],%22xaxis%22:{%22name%22:%22result_datasources-datasource-name%22,%22agg%22:%22avg%22},%22group%22:%22%22,%22color%22:%22%22,%22type%22:%22chart%22,%22size%22:%2220%22,%22sort%22:%22count-number%22,%22yaxisheaders%22:[%22%22],%22fieldsheaders%22:[%22publications%22],%22in%22:[],%22filters%22:[{%22name%22:%22result_projects-project-funding_lvl0%22,%22values%22:[%22H2020%22],%22to%22:%22-1%22},{%22name%22:%22type%22,%22values%22:[%22publication%22],%22to%22:%22-1%22},{%22name%22:%22result_datasources-datasource-type%22,%22exvalues%22:[%22Publication%20Catalogue%22]}],%22having%22:[],%22xStyle%22:{%22r%22:%22-%22,%22s%22:%22-%22,%22l%22:%22-%22,%22ft%22:%22-%22,%22wt%22:%22-%22},%22title%22:%22H2020%20Publications%20by%20datasource%20%28top%2020%29%22,%22subtitle%22:%22%22,%22xaxistitle%22:%22datasource%22,%22order%22:%22d%22}&w=90%";
defSub.charts.push(new Indicator("Old tool graph", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("old", url, "bar")]))
url = "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%22Research%20data%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22select%22%3A%5B%7B%22field%22%3A%22dataset%22%2C%22aggregate%22%3A%22count%22%7D%2C%7B%22field%22%3A%22dataset.year%22%2C%22aggregate%22%3Anull%7D%5D%2C%22filters%22%3A%5B%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22dataset.project.funder%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22European%20Commission%22%5D%7D%5D%2C%22op%22%3A%22AND%22%7D%2C%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22dataset.year%22%2C%22type%22%3A%22%3E%3D%22%2C%22values%22%3A%5B%222008%22%5D%7D%2C%7B%22field%22%3A%22dataset.year%22%2C%22type%22%3A%22%3C%3D%22%2C%22values%22%3A%5B%222020%22%5D%7D%5D%2C%22op%22%3A%22AND%22%7D%5D%2C%22entity%22%3A%22dataset%22%2C%22profile%22%3A%22OpenAIRE%20All-inclusive%22%2C%22limit%22%3A%220%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%22Research%20data%20timeline%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22Research%20data%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%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%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";
defSub.charts.push(new Indicator("", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("stats-tool", url, "bar")]))
return topic;
}
//
// static createECStakeholder(): Stakeholder {
// let ec: Stakeholder = new Stakeholder(null, "funder", "ec__________::EC", "European Commission", "EC", false, "ec", true, true, null);
// // new Stakeholder('wt','funder','wt__________::WT','Wellcome Trust','WT',false, 'wt',true,true);
// ec.topics.push(ec.createOSTopic(ec));
// ec.topics.push(ec.createImpactTopic());
// ec.topics.push(ec.createCollaborationTopic());
// return ec;
// }
//
// createOSTopic(stakeholder: Stakeholder): Topic {
// let topic = new Topic("OpenScience", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "open-science", true, true);
//
// /* let overview:Category = new Category("Overview","","overview",true,true);
// topic.categories.push(overview);
// let overviewDefSub = new SubCategory(null, null,null,true, true);
// overview.subCategories.push(overviewDefSub);*/
//
//
// let pubCategory: Category = new Category("Publications", "", "publications", true, true);
// topic.categories.push(pubCategory);
// let pubDefSub = new SubCategory(null, null, null, true, true);
// pubCategory.subCategories.push(pubDefSub);
// /* let pubOpenSub = new SubCategory("Openess","","openness",true,true);
// pubCategory.subCategories.push(pubOpenSub);
// let pubFundingSub = new SubCategory("Funding","","funding",true,true);
// pubCategory.subCategories.push(pubFundingSub);
// let pubDatasourceSub = new SubCategory("Content Providers","","content-providers",true,true);
// pubCategory.subCategories.push(pubDatasourceSub);
// let pubDocTypeSub = new SubCategory("Document Type","","doc-type",true,true);
// pubCategory.subCategories.push(pubDocTypeSub);
// let pubFindSub = new SubCategory("Findability","","dindability",true,true);
// pubCategory.subCategories.push(pubFindSub);*/
//
//
// let dataCategory: Category = new Category("Research data", "", "data", true, true);
// topic.categories.push(dataCategory);
// let dataDefSub = new SubCategory(null, null, null, true, true);
// dataCategory.subCategories.push(dataDefSub);
//
// let softwareCategory: Category = new Category("Software", "", "software", true, true);
// topic.categories.push(softwareCategory);
// let softDefSub = new SubCategory(null, null, null, true, true);
// softwareCategory.subCategories.push(softDefSub);
//
// let otherCategory: Category = new Category("Other research products", "", "other", true, true);
// topic.categories.push(otherCategory);
// let otherDefSub = new SubCategory(null, null, null, true, true);
// otherCategory.subCategories.push(otherDefSub);
//
// /* let datasourceCategory:Category = new Category("Content Providers","","content-providers",true,true);
// topic.categories.push(datasourceCategory);
// let datasourceDefSub = new SubCategory(null, null,null,true, true);
// datasourceCategory.subCategories.push(datasourceDefSub);*/
//
// let projectCategory: Category = new Category("Projects", "", "projects", true, true);
// topic.categories.push(projectCategory);
// let projectDefSub = new SubCategory(null, null, null, true, true);
// projectCategory.subCategories.push(projectDefSub);
//
// //Numbers
//
// let n_total_pubs = new Indicator("Publications", 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "publications"])]);
// let n_open_pubs = new Indicator("OA Publications", 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "open_access"])]);
// let n_total_projects = new Indicator("Projects", null, "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "total_projects"])]);
// let n_total_data = new Indicator("Reserach data", null, "number", "small", true, true, [new IndicatorPath(null, "search",
// "/datasets/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
// let n_total_soft = new Indicator("Software", null, "number", "small", true, true, [new IndicatorPath(null, "search",
// "/software/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
// let n_total_other = new Indicator("Other research products", null, "number", "small", true, true, [new IndicatorPath(null, "search",
// "/other/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
//
// /*overviewDefSub.numbers.push(n_total_pubs);
// overviewDefSub.numbers.push(n_open_pubs);
// overviewDefSub.numbers.push(n_total_projects);
// overviewDefSub.numbers.push(n_total_data);
// overviewDefSub.numbers.push(n_total_soft);
// overviewDefSub.numbers.push(n_total_other);*/
//
// pubDefSub.numbers.push(n_total_pubs);
// pubDefSub.numbers.push(n_open_pubs);
// softDefSub.numbers.push(n_total_soft);
// dataDefSub.numbers.push(n_total_data);
// otherDefSub.numbers.push(n_total_other);
//
// projectDefSub.numbers.push(n_total_projects);
//
// //Charts
//
// let c_pubs_per_project = new Indicator("Which are the top " + stakeholder.index_shortName + " projects?", 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...', "chart", "large", true, true, [
// new IndicatorPath("bar", "old", "chart.php?com=query&data=", '{"table":"result","fields":[{"fld":"number","agg":"count","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","yaxis":1,"c":false}],"xaxis":{"name":"result_projects-project-acronym","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"count-number","yaxisheaders":[""],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"result_projects-project-funder","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"}],"having":[],"xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"title":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '","subtitle":"","xaxistitle":"project","order":"d"}', null)]);
// c_pubs_per_project.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, "Publications per project (top 30)", "bar");
// pubDefSub.charts.push(c_pubs_per_project);
//
// //TO check
// /* let c_pubs_per_datasource = new Indicator("Which are the top repositories containing "+stakeholder.index_shortName+" research outputs?",null, "chart","small",false,
// true, [new IndicatorPath("column", "old", "chart.php?com=query&data="+encodeURIComponent('{"table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"result_datasources-datasource-name","agg":"avg"},"group":"","color":"","type":"chart","size":"20","sort":"count-number","yaxisheaders":[""],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funder","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"],"to":"-1"},{"name":"result_datasources-datasource-type","exvalues":["Publication Catalogue"]}],"having":[],"xStyle":{"r":-90,"s":"-","l":"-","ft":10,"wt":"-"},"title":"Publications by content provider (top 20)","subtitle":"","xaxistitle":"content providers","order":"d"}'), null)]);
// pubDefSub.charts.push(c_pubs_per_datasource);
//
// let c_pubs_per_doc_type = new Indicator("In what type of documents do your researchers used to publish?",null, "chart","small",true, true,
// [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Data","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.classification","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.type","type":"=","values":["publication"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"publications"},"subtitle":{"text":"per document type"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Document Type"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_per_doc_type);
//
// let c_pubs_funding_scheme = new Indicator("What is the percentage publications by funding scheme / programme?",null, "chart","small",true,
// true, [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Open Access","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.project.funding level 0","type":"=","values":["H2020"]},{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}},{"name":"Total","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.type","type":"=","values":["publication"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications"},"subtitle":{"text":"by funding scheme"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Funding scheme"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_funding_scheme);
// */
// /* //TODO check why doesn't load
// let c_pubs_gg_funding_scheme = new Indicator("What is the percentage of green and gold publications by funding scheme / programme?",null, "chart","medium",true,
// true, [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Gold","color":"#f8b500","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},,{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"result.datasource.type","type":"=","values":["Journal"]},{"field":"result.datasource.type","type":"=","values":["Journal Aggregator/Publisher"]}],"op":"OR"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}},{"name":"Green","color":"#239d60","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.project.funding level 0","type":"=","values":["H2020"]},{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"result.datasource.type","type":"=","values":["Institutional Repository"]},{"field":"result.datasource.type","type":"=","values":["Thematic Repository"]}],"op":"OR"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"H2020 green and gold publications"},"subtitle":{"text":"by funding scheme"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Funding scheme"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// //pubDefSub.charts.push(c_pubs_gg_funding_scheme);
// */
//
// /* let c_pubs_open = new Indicator("Open Access publications timeline",null, "chart","small",true, true,
// [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Open Access Publications"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_open);
//
// let c_pubs_access_modes = new Indicator("How your Open Access publications are shaped over the years?",null, "chart","medium",true, true,
// [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null},{"field":"publication.access mode","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by Access Mode"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_access_modes);
//
// // let c_pubs_av_embargo = new Indicator("Average period of embargoed publications",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_pubs_av_embargo);
//
// let c_pubs_OA_journals = new Indicator("Publications in OA Journals over time",null, "chart","medium",true, true,
// [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by OA Journals"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_OA_journals);
//
// //from monitor
// let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
// [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"contains","values":["repo"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by OA Journals"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_repo);
// //
// // let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
// // [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('), null)]);
// // pubDefSub.charts.push(c_pubs_repo);
//
// // let c_pubs_green_year = new Indicator("How many OA publications have been submitted to repos per year?",null, "chart","medium",true, true,[new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_pubs_green_year);
//
// let c_pubs_datasource_country = new Indicator("What is the percentage of OA pubs by repositories over the years?",null, "chart","medium",true, true,
// [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Gold OA","type":"column","color":"#b8c91fff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Green OA","type":"column","color":"#0d9637ff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"starts_with","values":["Institu"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"percent"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_datasource_country);
//
// let c_pubs_funding_country = new Indicator("What is the percentage of OA pubs by projects over the years?",null, "chart","medium",true, true,
// [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Gold OA","type":"column","color":"#b8c91fff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Green OA","type":"column","color":"#0d9637ff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"starts_with","values":["Institu"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"percent"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// pubDefSub.charts.push(c_pubs_funding_country);
//
// let c_data_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true,
// [new IndicatorPath("column", "stats-tool",'/chart?json='+
// encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Data","type":"column","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]},{"field":"result.type","type":"=","values":["dataset"]},{"field":"result.year","type":">=","values":["2014"]},{"field":"result.year","type":"<=","values":["2019"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+stakeholder.index_shortName+' research data over time"},"subtitle":{},"yAxis":{"title":{"text":"Research data"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
// dataDefSub.charts.push(c_data_year);*/
//
// // let c_other_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // otherDefSub.charts.push(c_other_year);
// //
// // let c_datasources_access_modes = new Indicator("What is the number of research data repositories by access mode?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_datasources_access_modes);
// //
// // let c_pub_nometa_year = new Indicator("How many publications lack of abstract per year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_pub_nometa_year);
// //
// // let c_pub_meta_linked_year = new Indicator("??",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_pub_meta_linked_year);
// //
// // let c_pub_colocated_year = new Indicator("How many publications are submitted to more than one repos per year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_pub_colocated_year);
//
// // let c_pub_pids = new Indicator("What is the most common PIDs by year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_pub_pids);
// //
// // let c_oai_pmh_datasources = new Indicator("What is the most common PIDs by year?",null, "chart","medium",true, true, [new IndicatorPath("line", "image","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
// // pubDefSub.charts.push(c_oai_pmh_datasources);
//
// return topic;
// }
//
// createImpactTopic(): Topic {
// let topic = new Topic("Impact/Correlation", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "impact", true, true);
//
// let pubCategory: Category = new Category("Publications", "", "publications", true, true);
// topic.categories.push(pubCategory);
// let pubDefSub = new SubCategory(null, null, null, true, true);
// pubCategory.subCategories.push(pubDefSub);
//
// let dataCategory: Category = new Category("Research data", "", "data", true, true);
// topic.categories.push(dataCategory);
// let dataDefSub = new SubCategory(null, null, null, true, true);
// dataCategory.subCategories.push(dataDefSub);
//
// let softwareCategory: Category = new Category("Software", "", "software", true, true);
// topic.categories.push(softwareCategory);
// let softDefSub = new SubCategory(null, null, null, true, true);
// softwareCategory.subCategories.push(softDefSub);
//
// /* let otherCategory:Category = new Category("Other research products","","other",true,true);
// topic.categories.push(otherCategory);
// let otherDefSub = new SubCategory(null, null,null,true, true);
// otherCategory.subCategories.push(otherDefSub);*/
//
//
// return topic;
// }
//
// createCollaborationTopic(): Topic {
// let topic = new Topic("Demo Topic", "This is a demo topic", "demo-topic", true, true);
//
// let category1: Category = new Category("Category 1", "This is ", "cat-1", true, true);
// topic.categories.push(category1);
//
//
// let subCat1 = new SubCategory("Sub-category 1", "", "sub-cat-1", true, true);
// category1.subCategories.push(subCat1);
//
//
// let subCat2 = new SubCategory("Sub-category 2", "", "sub-cat-2", true, true);
// category1.subCategories.push(subCat2);
//
//
// let category2: Category = new Category("Category 2 - no subcategories", "", "cat-2", true, true);
// topic.categories.push(category2);
// let defSub = new SubCategory(null, null, null, true, true);
// category2.subCategories.push(defSub);
//
// let chart1 = new Indicator(
// "Chart title goes here", "Chart description goes here", "chart", "medium", true, true,
// [new IndicatorPath("line", "image", "https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null, null)]);
// let chart2 = new Indicator("Chart title goes here", "Chart description goes here", "chart", "medium", true, true, [new IndicatorPath("line", "image", "https://static.boredpanda.com/blog/wp-content/uuuploads/funny-graphs-2/funny-graphs-legs.jpg", null, null)]);
// subCat1.charts.push(chart1);
// subCat2.charts.push(chart2);
//
// defSub.charts.push(chart1);
// defSub.charts.push(chart2);
// let utils = new IndicatorUtils();
// let url = "https://beta.openaire.eu/stats/chart.php?com=query&data={%22table%22:%22result%22,%22fields%22:[{%22fld%22:%22number%22,%22agg%22:%22count%22,%22type%22:%22bar%22,%22yaxis%22:1,%22c%22:false}],%22xaxis%22:{%22name%22:%22result_datasources-datasource-name%22,%22agg%22:%22avg%22},%22group%22:%22%22,%22color%22:%22%22,%22type%22:%22chart%22,%22size%22:%2220%22,%22sort%22:%22count-number%22,%22yaxisheaders%22:[%22%22],%22fieldsheaders%22:[%22publications%22],%22in%22:[],%22filters%22:[{%22name%22:%22result_projects-project-funding_lvl0%22,%22values%22:[%22H2020%22],%22to%22:%22-1%22},{%22name%22:%22type%22,%22values%22:[%22publication%22],%22to%22:%22-1%22},{%22name%22:%22result_datasources-datasource-type%22,%22exvalues%22:[%22Publication%20Catalogue%22]}],%22having%22:[],%22xStyle%22:{%22r%22:%22-%22,%22s%22:%22-%22,%22l%22:%22-%22,%22ft%22:%22-%22,%22wt%22:%22-%22},%22title%22:%22H2020%20Publications%20by%20datasource%20%28top%2020%29%22,%22subtitle%22:%22%22,%22xaxistitle%22:%22datasource%22,%22order%22:%22d%22}&w=90%";
// defSub.charts.push(new Indicator("Old tool graph", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("old", url, "bar")]))
// url = "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%22Research%20data%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22select%22%3A%5B%7B%22field%22%3A%22dataset%22%2C%22aggregate%22%3A%22count%22%7D%2C%7B%22field%22%3A%22dataset.year%22%2C%22aggregate%22%3Anull%7D%5D%2C%22filters%22%3A%5B%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22dataset.project.funder%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22European%20Commission%22%5D%7D%5D%2C%22op%22%3A%22AND%22%7D%2C%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22dataset.year%22%2C%22type%22%3A%22%3E%3D%22%2C%22values%22%3A%5B%222008%22%5D%7D%2C%7B%22field%22%3A%22dataset.year%22%2C%22type%22%3A%22%3C%3D%22%2C%22values%22%3A%5B%222020%22%5D%7D%5D%2C%22op%22%3A%22AND%22%7D%5D%2C%22entity%22%3A%22dataset%22%2C%22profile%22%3A%22OpenAIRE%20All-inclusive%22%2C%22limit%22%3A%220%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%22Research%20data%20timeline%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22Research%20data%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%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%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";
// defSub.charts.push(new Indicator("", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("stats-tool", url, "bar")]))
// return topic;
// }
}
export class Topic {

View File

@ -209,7 +209,7 @@ export class StakeholderCreator {
let open_non_url = "http://88.197.53.71:8080/stats-api/chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Data","type":"pie","color":"#e62020ee","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural+'.oavsnonoa"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+chartTitle[index]+' Open Access vs Non Open Access"},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Data","type":"pie","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural+'.greenvsgold"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
let open_non_ind:Indicator = new Indicator(chartTitle[index]+" Overview", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_url, "pie")])
let open_non_ind:Indicator = new Indicator(chartTitle[index]+" Overview", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_url, "pie",stakeholder)])
open_non_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
if(index!=0){
open_non_ind.recommendedFor.push("ec__________::EC");
@ -218,14 +218,14 @@ export class StakeholderCreator {
if(dbType == "publication") {
let gold_vs_green_url = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Data","type":"column","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix + (index == 2 ? ".h2020" : (index == 1 ? ".fp7" : "")) + '.' + dbTypePlural + '.greenvsgold"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + ' Green vs Gold"},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
let gold_vs_green_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_url, "pie")]));
let gold_vs_green_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_url, "pie",stakeholder)]));
gold_vs_green_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
if (index != 0) {
gold_vs_green_ind.recommendedFor.push("ec__________::EC");
}
indicators.push(gold_vs_green_ind);
let gold_vs_green_time_url = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Green OA","type":"column","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix + (index == 2 ? ".h2020" : (index == 1 ? ".fp7" : "")) + '.' + dbTypePlural + '.green.year"}},{"name":"Gold OA","type":"column","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix + (index == 2 ? ".h2020" : (index == 1 ? ".fp7" : "")) + '.' + dbTypePlural + '.gold.year"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + ' Green vs Gold Open Access"},"subtitle":{"text":"by year"},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}'+greenAndGoldPalette+'}}');
let gold_vs_green_time_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_time_url, "column")]));
let gold_vs_green_time_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_time_url, "column",stakeholder)]));
gold_vs_green_time_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
if (index != 0) {
gold_vs_green_time_ind.recommendedFor.push("ec__________::EC");
@ -234,7 +234,7 @@ export class StakeholderCreator {
}
let top_project_url = "http://88.197.53.71:8080/stats-api/chart?json="+ encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Data","type":"bar","query":{"name":"monitor.'+ ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural+'.top10projects"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + 'Top 10 projects"},"subtitle":{"text":"by '+typePlural+'"},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
let top_project_ind:Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_project_url, "column")]));
let top_project_ind:Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_project_url, "column",stakeholder)]));
top_project_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
if(index!=0){
top_project_ind.recommendedFor.push("ec__________::EC");
@ -242,14 +242,14 @@ export class StakeholderCreator {
indicators.push(top_project_ind);
if(index == 0) {
let top_datasources_url = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Data","type":"bar","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix + '.' + dbTypePlural + '.top10datasources"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + 'Top 10 Datasources"},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
let top_datasources_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_datasources_url, "column")]));
let top_datasources_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_datasources_url, "column",stakeholder)]));
top_datasources_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
indicators.push(top_datasources_ind);
}
if(index != 0) {
let open_non_fl2 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
'{"library":"HighCharts","chartDescription":{"queries":[{"name":"Open Access","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 2","aggregate":null}],"filters":['+fundingFilter[index]+',{"groupFilters":[{"field":"' + dbType + '.access mode","type":"=","values":["Open Access"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Non Open Access","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 2","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.access mode","type":"!=","values":["Open Access"]}],"op":"AND"}'+(fundingFilter[index].length >0?', ':'')+fundingFilter[index]+'],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + 'Open Access vs Non Open Access"},"subtitle":{"text":"By Scientific area"},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
let open_non_fl2_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl2, "column")]));
let open_non_fl2_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl2, "column",stakeholder)]));
// open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
indicators.push(open_non_fl2_ind);
if (index != 0) {
@ -258,7 +258,7 @@ export class StakeholderCreator {
if(dbType == "publication") {
let gold_green__fl2 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
'{"library":"HighCharts","chartDescription":{"queries":[{"name":"Green OA","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 2","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["' + fieldValue[index] + '"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.datasource.type","type":"contains","values":["repo"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Gold OA","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 2","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["' + fieldValue[index] + '"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + 'Green vs Gold Open Access"},"subtitle":{"text":"By Scientific area"},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}'+greenAndGoldPalette+'}}');
let gold_green_ind_fl2: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl2, "column")]));
let gold_green_ind_fl2: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl2, "column",stakeholder)]));
// open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
indicators.push(gold_green_ind_fl2);
if (index != 0) {
@ -267,7 +267,7 @@ export class StakeholderCreator {
}
let open_non_fl1 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
'{"library":"HighCharts","chartDescription":{"queries":[{"name":"Open Access","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 1","aggregate":null}],"filters":['+fundingFilter[index]+',{"groupFilters":[{"field":"' + dbType + '.access mode","type":"=","values":["Open Access"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Non Open Access","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.access mode","type":"!=","values":["Open Access"]}],"op":"AND"}'+(fundingFilter[index].length >0?', ':'')+fundingFilter[index]+'],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + 'Open Access vs Non Open Access"},"subtitle":{"text":"By Programme"},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');
let open_non_fl1_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl1, "column")]));
let open_non_fl1_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl1, "column",stakeholder)]));
// open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
indicators.push(open_non_fl1_ind);
if (index != 0) {
@ -276,7 +276,7 @@ export class StakeholderCreator {
if(dbType == "publication") {
let gold_green__fl1 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
'{"library":"HighCharts","chartDescription":{"queries":[{"name":"Green OA","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["' + fieldValue[index] + '"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.datasource.type","type":"contains","values":["repo"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Gold OA","type":"bar","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["' + fieldValue[index] + '"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"}],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + chartTitle[index] + 'Green vs Gold Open Access"},"subtitle":{"text":"By Programme"},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}'+greenAndGoldPalette+'}}');
let gold_green_ind_fl1: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl1, "column")]));
let gold_green_ind_fl1: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl1, "column",stakeholder)]));
// open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
indicators.push(gold_green_ind_fl1);
if (index != 0) {

View File

@ -53,6 +53,8 @@ export class StakeholderUtils {
Object.keys(indicatorPath.parameters).forEach(key => {
if (indicatorPath.parameters[key].indexOf("_funder_name_") != -1) {
indicatorPath.parameters[key] = indicatorPath.parameters[key].replace("_funder_name_", funder.index_name);
} else if (indicatorPath.parameters[key].indexOf("_funder_id_") != -1) {
indicatorPath.parameters[key] = indicatorPath.parameters[key].replace("_funder_id_", funder.index_id);
} else if (indicatorPath.parameters[key].indexOf("_fsn_") != -1) {
indicatorPath.parameters[key] = indicatorPath.parameters[key].toString().replace("_fsn_", funder.index_shortName.toLowerCase());
}
@ -87,10 +89,10 @@ export class StakeholderUtils {
aliasValidator(elements: any[]): ValidatorFn {
return (control: AbstractControl): { [key: string]: boolean } | null => {
if(control.value && elements.find(element =>
element.alias === control.value
if (control.value && elements.find(element =>
element.alias === control.value
)) {
return { 'alias': true };
return {'alias': true};
}
return null;
}
@ -98,12 +100,12 @@ export class StakeholderUtils {
// TODO need to be fixed
generateAlias(name: string): string {
let alias = name.toLowerCase();
while (alias.includes(' / ') || alias.includes(' ')) {
alias = alias.replace(' / ', '-');
alias = alias.replace(' ', '-');
}
return alias;
let alias = name.toLowerCase();
while (alias.includes(' / ') || alias.includes(' ')) {
alias = alias.replace(' / ', '-');
alias = alias.replace(' ', '-');
}
return alias;
}
}
@ -172,7 +174,7 @@ export class IndicatorUtils {
replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
});
}
console.info("replacedUrl:"+replacedUrl)
console.info("replacedUrl:" + replacedUrl)
if (indicatorPath.chartObject) {
if (fundingL0 && indicatorPath.filters["fundingL0"]) {
let newJsonObject = JSON.parse(replacedUrl);
@ -204,7 +206,7 @@ export class IndicatorUtils {
return indicator;
}
generateIndicatorByChartUrl(source: string, url: string, type: string = null): IndicatorPath {
generateIndicatorByChartUrl(source: string, url: string, type: string = null, stakeholder:Stakeholder): IndicatorPath {
let indicatorPath = new IndicatorPath("", source, "", "", []);
if (source === 'stats-tool') {
indicatorPath.url = url.split("json=")[0] + "json=";
@ -212,11 +214,12 @@ export class IndicatorUtils {
indicatorPath.chartObject = decodeURIComponent(url.split("json=")[1]);
let chart = JSON.parse(indicatorPath.chartObject);
indicatorPath.type = this.extractType(chart, indicatorPath);
this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder);
this.extractTitle(chart, indicatorPath);
this.extractSubTitle(chart,indicatorPath);
this.extractSubTitle(chart, indicatorPath);
this.extractXTitle(chart, indicatorPath);
this.extractYTitle(chart, indicatorPath);
this.extractFunder(chart, indicatorPath);
this.extractFunder(chart, indicatorPath, stakeholder);
this.extractStartYear(chart, indicatorPath);
this.extractEndYear(chart, indicatorPath);
indicatorPath.chartObject = JSON.stringify(chart);
@ -249,7 +252,7 @@ export class IndicatorUtils {
return type;
}
private extractFunder(obj, indicatorPath: IndicatorPath) {
private extractFunder(obj, indicatorPath: IndicatorPath, stakeholder:Stakeholder) {
let funderName;
for (let query of obj["chartDescription"]["queries"]) {
if (!query["query"]["filters"]) {
@ -259,7 +262,7 @@ export class IndicatorUtils {
if (filter["groupFilters"][0]["field"].indexOf(".funder") != -1) {
funderName = filter["groupFilters"][0]["values"][0];
filter["groupFilters"][0]["values"][0] = ChartHelper.prefix + "funder_name" + ChartHelper.suffix;
indicatorPath.parameters["funder_name"] = funderName;
indicatorPath.parameters["funder_name"] = stakeholder.index_name;
}
}
}
@ -301,21 +304,35 @@ export class IndicatorUtils {
}
}
private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder:Stakeholder) {
let name = "";
for (let query of obj["chartDescription"]["queries"]) {
if (query["query"]["name"]) {
name = query["query"]["name"];
let stakeholderSN = name.split('.')[1];
console.log("Funder is:" + stakeholderSN);
query["query"]["name"] = name.split('.' + stakeholderSN + ".")[0] + "." + ChartHelper.prefix + "FSN" + ChartHelper.suffix +"." + name.split('.' + stakeholderSN + ".")[1];
indicatorPath.parameters["FSN"] = stakeholder.index_shortName.toLowerCase();
}
}
}
private extractTitle(obj, indicatorPath: IndicatorPath) {
let title = "";
if (obj["chartDescription"]["title"]) {
title = obj["chartDescription"]["title"]["text"];
obj["chartDescription"]["title"]["text"] = ChartHelper.prefix + "title" + ChartHelper.suffix;
indicatorPath.parameters["title"] = title?title:"";
indicatorPath.parameters["title"] = title ? title : "";
}
}
private extractSubTitle(obj, indicatorPath: IndicatorPath) {
let subtitle = "";
if (obj["chartDescription"]["subtitle"]) {
subtitle = obj["chartDescription"]["subtitle"]["text"];
obj["chartDescription"]["subtitle"]["text"]= ChartHelper.prefix + "subtitle" + ChartHelper.suffix;
indicatorPath.parameters["subtitle"] = subtitle?subtitle:"";
obj["chartDescription"]["subtitle"]["text"] = ChartHelper.prefix + "subtitle" + ChartHelper.suffix;
indicatorPath.parameters["subtitle"] = subtitle ? subtitle : "";
}
}
@ -324,7 +341,7 @@ export class IndicatorUtils {
if (obj["chartDescription"]["xAxis"]["title"]) {
title = obj["chartDescription"]["xAxis"]["title"]["text"];
obj["chartDescription"]["xAxis"]["title"]["text"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
indicatorPath.parameters["xAxisTitle"] = title?title:""
indicatorPath.parameters["xAxisTitle"] = title ? title : ""
}
}
@ -333,7 +350,7 @@ export class IndicatorUtils {
if (obj["chartDescription"]["yAxis"]["title"]) {
title = obj["chartDescription"]["yAxis"]["title"]["text"];
obj["chartDescription"]["yAxis"]["title"]["text"] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
indicatorPath.parameters["yAxisTitle"] = title?title:""
indicatorPath.parameters["yAxisTitle"] = title ? title : ""
}
}
@ -381,10 +398,10 @@ export class IndicatorUtils {
private extractOldToolYTitle(obj, indicatorPath: IndicatorPath) {
let title = "";
if (obj["fieldsheaders"]) {
title = Array.isArray(obj["fieldsheaders"])?obj["fieldsheaders"][0]:obj["fieldsheaders"];
if(Array.isArray(obj["fieldsheaders"])){
title = Array.isArray(obj["fieldsheaders"]) ? obj["fieldsheaders"][0] : obj["fieldsheaders"];
if (Array.isArray(obj["fieldsheaders"])) {
obj["fieldsheaders"][0] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
}else {
} else {
obj["fieldsheaders"] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
}
indicatorPath.parameters["yAxisTitle"] = title;