Project

General

Profile

« Previous | Next » 

Revision 57936

[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

View differences:

modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/entities/sidebar.ts
1
export class Header {
2
  name: string;
3
  dashboard: string;
4
  logoUrl: string;
5

  
6
  constructor(name: string, dashboard: string, logoUrl: string = null) {
7
    this.name = name;
8
    this.dashboard = dashboard;
9
    this.logoUrl = logoUrl
10
  }
11
}
12

  
13
export class Item {
14
  id: string;
15
  name: string;
16
  route: string;
17
  items: Item[];
18
  icon: string;
19
  open: boolean;
20

  
21
  constructor(id: string, name: string, route: string, items: Item[], icon, open: boolean) {
22
    this.id = id;
23
    this.name = name;
24
    this.route = route;
25
    this.items = items;
26
    this.icon = icon;
27
    this.open = open;
28
  }
29
}
30

  
31
export class Sidebar {
32
  items: Item[];
33
  header: Header;
34

  
35
  constructor(items: Item[], header: Header) {
36
    this.items = items;
37
    this.header = header;
38
  }
39
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/sideBar.component.ts
1
import {Component, Input, OnInit} from '@angular/core';
2
import {Header, Item} from "../../../utils/entities/sidebar";
3

  
4
@Component({
5
  selector: 'dashboard-sidebar',
6
  templateUrl: 'sideBar.component.html'
7
})
8
export class SideBarComponent implements OnInit {
9
  @Input() items: Item[] = [];
10
  @Input() header: Header = null;
11
  @Input() showHeader: boolean = true;
12
  @Input() activeItem: string = '';
13
  @Input() activeSubItem: string = '';
14

  
15
  constructor() {}
16

  
17
  ngOnInit(): void {}
18

  
19

  
20
  isTheActiveMenuItem(item: Item, subItem: Item = null): boolean {
21
    return  (!subItem && this.activeItem === item.id) ||
22
        (subItem && this.activeItem === item.id && this.activeSubItem === subItem.id);
23
  }
24
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/layout.service.ts
1
import {Injectable} from "@angular/core";
2
import {BehaviorSubject, Observable} from "rxjs";
3
import {ActivationStart, Router} from "@angular/router";
4

  
5
@Injectable({
6
  providedIn: 'root'
7
})
8
export class LayoutService {
9

  
10
  /**
11
   * Set this to true when sidebar items are ready.
12
   */
13
  private openSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
14

  
15
  /**
16
   *  Add hasSidebar: false on data of route config, if sidebar is not needed.
17
   */
18
  private hasSidebarSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
19

  
20
  /**
21
   *  Add hasHeader: false on data of route config, if header is not needed.
22
   */
23
  private hasHeaderSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
24

  
25
  constructor(private router: Router) {
26
    this.router.events.subscribe(event => {
27
      if (event instanceof ActivationStart) {
28
        let data = event.snapshot.data;
29
        if (this.hasSidebarSubject.value === true &&
30
          data['hasSidebar'] !== undefined &&
31
          data['hasSidebar'] === false) {
32
          this.setHasSidebar(false);
33
        } else if (this.hasSidebarSubject.value === false) {
34
          this.setHasSidebar(true);
35
        }
36
        if (this.hasHeaderSubject.value === true &&
37
          data['hasHeader'] !== undefined &&
38
          data['hasHeader'] === false) {
39
          this.setHasHeader(false);
40
        } else if (this.hasHeaderSubject.value === false) {
41
          this.setHasHeader(true);
42
        }
43
      }
44
    });
45
  }
46

  
47
  get open(): boolean {
48
    return this.openSubject.getValue();
49
  }
50

  
51
  setOpen(value: boolean) {
52
    this.openSubject.next(value);
53
  }
54

  
55
  get hasSidebar(): Observable<boolean> {
56
    return this.hasSidebarSubject.asObservable();
57
  }
58

  
59
  setHasSidebar(value: boolean) {
60
    this.hasSidebarSubject.next(value);
61
  }
62

  
63
  get hasHeader(): Observable<boolean> {
64
    return this.hasHeaderSubject.asObservable();
65
  }
66

  
67
  setHasHeader(value: boolean) {
68
    this.hasHeaderSubject.next(value);
69
  }
70
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/sideBar.module.ts
1
import {NgModule} from '@angular/core';
2
import {CommonModule} from '@angular/common';
3

  
4
import {RouterModule} from "@angular/router";
5

  
6
import {SideBarComponent} from './sideBar.component';
7

  
8
@NgModule({
9
  imports: [
10
    CommonModule,
11
    RouterModule
12
  ],
13
  declarations: [
14
    SideBarComponent
15
  ],
16
  providers: [],
17
  exports: [
18
    SideBarComponent
19
  ]
20
})
21
export class SideBarModule {
22
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/library/sharedComponents/sidebar/sideBar.component.html
1
<aside id="sidebar_main">
2
  <div *ngIf= "showHeader" class="sidebar_main_header">
3
    <div *ngIf="header" class="uk-padding-small">
4
      <img *ngIf="header.logoUrl" [src]="header.logoUrl">
5
      <div class="uk-text-bold uk-margin-top">{{header.name}}</div>
6
      <div>{{header.dashboard}}</div>
7
    </div>
8
  </div>
9
  <div class="menu_section uk-margin-top">
10
    <ul>
11
      <ng-template ngFor [ngForOf]="items" let-item let-i="index">
12
        <li [class.current_section]="isTheActiveMenuItem(item)"
13
            [class.act_section]="item.open"
14
            [title]="item.name"
15
            [class.submenu_trigger]="item.items.length > 1">
16
          <a *ngIf="item.items.length <= 1" [routerLink]="(item.route && !isTheActiveMenuItem(item))?item.route:null">
17
            <span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
18
            <span class="menu_title">{{item.name}}</span>
19
          </a>
20
          <ng-template [ngIf]="item.items.length > 1">
21
            <a (click)="item.open = !item.open">
22
              <span *ngIf="item.icon" class="menu_icon"><i class="material-icons">{{item.icon}}</i></span>
23
              <span class="menu_title">{{item.name}}</span>
24
            </a>
25
            <ul [style.display]="(item.open?'block':'none')">
26
              <ng-template ngFor [ngForOf]="item.items" let-subItem let-j="index">
27
                <li *ngIf="subItem.route" [class.act_item]="isTheActiveMenuItem(item, subItem)">
28
                  <a [routerLink]="!isTheActiveMenuItem(item, subItem)?subItem.route:null">
29
                    <span *ngIf="subItem.icon" class="menu_icon"><i class="material-icons">{{subItem.icon}}</i></span>
30
                    <span class="menu_title">{{subItem.name}}</span>
31
                  </a>
32
                </li>
33
              </ng-template>
34
            </ul>
35
          </ng-template>
36
        </li>
37
      </ng-template>
38
    </ul>
39
  </div>
40
</aside>
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app.component.html
20 20
            </li>
21 21
          </ul>
22 22
        </div>
23

  
23 24
      </nav>
24 25
  </div>
25
  <dashboard-sidebar [items]="adminMenuItems"
26
  <dashboard-sidebar *ngIf="hasAdminMenu" [items]="adminMenuItems"
26 27
  ></dashboard-sidebar>
27 28
  <router-outlet></router-outlet>
28 29
</div>
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/monitor/monitor.module.ts
14 14
import {MonitorRoutingModule} from "./monitor-routing.module";
15 15
import {MonitorComponent} from "./monitor.component";
16 16
import {StatisticsService} from "../utils/services/statistics.service";
17
import {SideBarModule} from "../library/sharedComponents/sidebar/sideBar.module";
17
import {SideBarModule} from "../openaireLibrary/dashboard/sharedComponents/sidebar/sideBar.module";
18 18
import {InputModule} from "../library/sharedComponents/input/input.module";
19 19
import {UserMiniModule} from "../openaireLibrary/login/userMiniModule.module";
20 20
import {ClickModule} from "../openaireLibrary/utils/click/click.module";
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/monitor/monitor.component.html
73 73
        </div>
74 74
      </nav>
75 75
    </div>
76
    <dashboard-sidebar *ngIf="sideBar && stakeholder" [items]="sideBar.items"
76
    <dashboard-sidebar *ngIf="sideBarItems.length > 0 && stakeholder" [items]="sideBarItems"
77 77
                       [activeItem]="activeCategory?activeCategory.alias:null"
78 78
                       [activeSubItem]="activeSubCategory?activeSubCategory.alias:null" [showHeader]=false
79 79
    ></dashboard-sidebar>
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/monitor/monitor.component.ts
13 13
import {StakeholderService} from "../services/stakeholder.service";
14 14
import {Category, ChartHelper, IndicatorPath, Stakeholder, SubCategory, Topic} from "../utils/entities/stakeholder";
15 15
import {StatisticsService} from "../utils/services/statistics.service";
16
import {Item, Sidebar} from "../utils/entities/sidebar";
17 16
import {IndicatorUtils, StakeholderUtils} from "../utils/indicator-utils";
18 17
import {StakeholderCreator} from "../utils/entities/stakeholderCreator";
19
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
18
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
20 19
import {FormBuilder, FormControl} from "@angular/forms";
21 20
import {IDeactivateComponent} from "../openaireLibrary/utils/can-exit.guard";
22 21
import {Subscription} from "rxjs";
......
46 45
  public activeTopic: Topic = null;
47 46
  public activeCategory: Category = null;
48 47
  public activeSubCategory: SubCategory = null;
49
  public sideBar: Sidebar = null;
48
  public sideBarItems:MenuItem[] = [];
50 49
  public errorCodes: ErrorCodes;
51 50
  public stakeholder: Stakeholder;
52 51
  public numberResults: Map<number, number> = new Map<number, number>();
......
223 222
  }
224 223
  
225 224
  canExit() {
226
    if (this.sideBar) {
225
    if (this.sideBarItems.length > 0) {
227 226
      let status = [];
228
      this.sideBar.items.forEach(item => {
227
      this.sideBarItems.forEach(item => {
229 228
        status.push(item.open);
230 229
      });
231 230
      MonitorComponent.sidebarStatus = {
......
333 332
  }
334 333
  
335 334
  private setSideBar() {
336
    let items: Item[] = [];
335
    let items: MenuItem[] = [];
337 336
    this.activeTopic.categories.forEach((category, index) => {
338 337
      if (category.isPublic && category.isActive) {
339
        let subItems: Item[] = [];
338
        let subItems: MenuItem[] = [];
340 339
        category.subCategories.forEach(subCategory => {
341 340
          if (subCategory.isPublic && subCategory.isActive) {
342
            subItems.push(new Item(subCategory.alias, subCategory.name, (
341
            subItems.push(new MenuItem(subCategory.alias, subCategory.name,"", (
343 342
              '/' + this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias + '/' + subCategory.alias),
344
              null, null, false));
343
              null, null, [],{}));
345 344
          }
346 345
        });
347 346
        let open = this.activeCategory.alias === category.alias;
348 347
        if (MonitorComponent.sidebarStatus && MonitorComponent.sidebarStatus.id === this.activeTopic.alias) {
349 348
          open = MonitorComponent.sidebarStatus.status[index];
350 349
        }
351
        items.push(new Item(category.alias, category.name, (
350
        //  constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params) {
351
        let categoryItem:MenuItem = new MenuItem(category.alias, category.name,"", (
352 352
          '/' + this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias),
353
          subItems, null, open));
353
           null, [],[],{});
354
        categoryItem.items = subItems;
355
        categoryItem.open = open;
356
        items.push(categoryItem);
354 357
      }
355 358
    });
356 359
    if (items.length === 0) {
357
      items.push(new Item('noCategories', 'No categories available yet', null, [], null, false));
360
      items.push(new MenuItem('noCategories', 'No categories available yet', "", "",false,[], [], {}));
358 361
    }
359
    this.sideBar = new Sidebar(items, null);
362
    this.sideBarItems = items;
360 363
  }
361 364
  
362 365
  private setIndicators() {
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/home/home.component.ts
8 8
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
9 9
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
10 10
import {StakeholderCreator} from "../utils/entities/stakeholderCreator";
11
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
11
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
12 12

  
13 13
@Component({
14 14
    selector: 'home',
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app.module.ts
17 17
import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
18 18
import {SubscribeModule} from './utils/subscribe/subscribe.module';
19 19
import {UserMiniModule} from "./openaireLibrary/login/userMiniModule.module";
20
import {SideBarModule} from "./library/sharedComponents/sidebar/sideBar.module";
20
import {SideBarModule} from "./openaireLibrary/dashboard/sharedComponents/sidebar/sideBar.module";
21 21

  
22 22
@NgModule({
23 23

  
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/indicator-utils.ts
53 53
                Object.keys(indicatorPath.parameters).forEach(key => {
54 54
                  if (indicatorPath.parameters[key].indexOf("_funder_name_") != -1) {
55 55
                    indicatorPath.parameters[key] = indicatorPath.parameters[key].replace("_funder_name_", funder.index_name);
56
                  } else if (indicatorPath.parameters[key].indexOf("_funder_id_") != -1) {
57
                    indicatorPath.parameters[key] = indicatorPath.parameters[key].replace("_funder_id_", funder.index_id);
56 58
                  } else if (indicatorPath.parameters[key].indexOf("_fsn_") != -1) {
57 59
                    indicatorPath.parameters[key] = indicatorPath.parameters[key].toString().replace("_fsn_", funder.index_shortName.toLowerCase());
58 60
                  }
......
87 89

  
88 90
  aliasValidator(elements: any[]): ValidatorFn {
89 91
    return (control: AbstractControl): { [key: string]: boolean } | null => {
90
      if(control.value && elements.find(element =>
91
          element.alias === control.value
92
      if (control.value && elements.find(element =>
93
        element.alias === control.value
92 94
      )) {
93
        return { 'alias': true };
95
        return {'alias': true};
94 96
      }
95 97
      return null;
96 98
    }
......
98 100

  
99 101
  // TODO need to be fixed
100 102
  generateAlias(name: string): string {
101
   let alias = name.toLowerCase();
102
   while (alias.includes(' / ') || alias.includes(' ')) {
103
     alias = alias.replace(' / ', '-');
104
     alias = alias.replace(' ', '-');
105
   }
106
   return alias;
103
    let alias = name.toLowerCase();
104
    while (alias.includes(' / ') || alias.includes(' ')) {
105
      alias = alias.replace(' / ', '-');
106
      alias = alias.replace(' ', '-');
107
    }
108
    return alias;
107 109
  }
108 110
}
109 111

  
......
172 174
        replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
173 175
      });
174 176
    }
175
    console.info("replacedUrl:"+replacedUrl)
177
    console.info("replacedUrl:" + replacedUrl)
176 178
    if (indicatorPath.chartObject) {
177 179
      if (fundingL0 && indicatorPath.filters["fundingL0"]) {
178 180
        let newJsonObject = JSON.parse(replacedUrl);
......
204 206
    return indicator;
205 207
  }
206 208

  
207
  generateIndicatorByChartUrl(source: string, url: string, type: string = null): IndicatorPath {
209
  generateIndicatorByChartUrl(source: string, url: string, type: string = null, stakeholder:Stakeholder): IndicatorPath {
208 210
    let indicatorPath = new IndicatorPath("", source, "", "", []);
209 211
    if (source === 'stats-tool') {
210 212
      indicatorPath.url = url.split("json=")[0] + "json=";
......
212 214
      indicatorPath.chartObject = decodeURIComponent(url.split("json=")[1]);
213 215
      let chart = JSON.parse(indicatorPath.chartObject);
214 216
      indicatorPath.type = this.extractType(chart, indicatorPath);
217
      this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder);
215 218
      this.extractTitle(chart, indicatorPath);
216
      this.extractSubTitle(chart,indicatorPath);
219
      this.extractSubTitle(chart, indicatorPath);
217 220
      this.extractXTitle(chart, indicatorPath);
218 221
      this.extractYTitle(chart, indicatorPath);
219
      this.extractFunder(chart, indicatorPath);
222
      this.extractFunder(chart, indicatorPath, stakeholder);
220 223
      this.extractStartYear(chart, indicatorPath);
221 224
      this.extractEndYear(chart, indicatorPath);
222 225
      indicatorPath.chartObject = JSON.stringify(chart);
......
249 252
    return type;
250 253
  }
251 254

  
252
  private extractFunder(obj, indicatorPath: IndicatorPath) {
255
  private extractFunder(obj, indicatorPath: IndicatorPath, stakeholder:Stakeholder) {
253 256
    let funderName;
254 257
    for (let query of obj["chartDescription"]["queries"]) {
255 258
      if (!query["query"]["filters"]) {
......
259 262
        if (filter["groupFilters"][0]["field"].indexOf(".funder") != -1) {
260 263
          funderName = filter["groupFilters"][0]["values"][0];
261 264
          filter["groupFilters"][0]["values"][0] = ChartHelper.prefix + "funder_name" + ChartHelper.suffix;
262
          indicatorPath.parameters["funder_name"] = funderName;
265
          indicatorPath.parameters["funder_name"] = stakeholder.index_name;
263 266
        }
264 267
      }
265 268
    }
......
301 304
    }
302 305
  }
303 306

  
307
  private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder:Stakeholder) {
308
    let name = "";
309
    for (let query of obj["chartDescription"]["queries"]) {
310
      if (query["query"]["name"]) {
311
        name = query["query"]["name"];
312
        let stakeholderSN = name.split('.')[1];
313
        console.log("Funder is:" + stakeholderSN);
314
        query["query"]["name"] = name.split('.' + stakeholderSN + ".")[0] + "." + ChartHelper.prefix + "FSN" + ChartHelper.suffix +"." + name.split('.' + stakeholderSN + ".")[1];
315
        indicatorPath.parameters["FSN"] = stakeholder.index_shortName.toLowerCase();
316
      }
317
    }
318
  }
319

  
304 320
  private extractTitle(obj, indicatorPath: IndicatorPath) {
305 321
    let title = "";
306 322
    if (obj["chartDescription"]["title"]) {
307 323
      title = obj["chartDescription"]["title"]["text"];
308 324
      obj["chartDescription"]["title"]["text"] = ChartHelper.prefix + "title" + ChartHelper.suffix;
309
      indicatorPath.parameters["title"] = title?title:"";
325
      indicatorPath.parameters["title"] = title ? title : "";
310 326

  
311 327
    }
312 328
  }
329

  
313 330
  private extractSubTitle(obj, indicatorPath: IndicatorPath) {
314 331
    let subtitle = "";
315 332
    if (obj["chartDescription"]["subtitle"]) {
316 333
      subtitle = obj["chartDescription"]["subtitle"]["text"];
317
      obj["chartDescription"]["subtitle"]["text"]= ChartHelper.prefix + "subtitle" + ChartHelper.suffix;
318
      indicatorPath.parameters["subtitle"] = subtitle?subtitle:"";
334
      obj["chartDescription"]["subtitle"]["text"] = ChartHelper.prefix + "subtitle" + ChartHelper.suffix;
335
      indicatorPath.parameters["subtitle"] = subtitle ? subtitle : "";
319 336
    }
320 337
  }
321 338

  
......
324 341
    if (obj["chartDescription"]["xAxis"]["title"]) {
325 342
      title = obj["chartDescription"]["xAxis"]["title"]["text"];
326 343
      obj["chartDescription"]["xAxis"]["title"]["text"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
327
      indicatorPath.parameters["xAxisTitle"] = title?title:""
344
      indicatorPath.parameters["xAxisTitle"] = title ? title : ""
328 345
    }
329 346
  }
330 347

  
......
333 350
    if (obj["chartDescription"]["yAxis"]["title"]) {
334 351
      title = obj["chartDescription"]["yAxis"]["title"]["text"];
335 352
      obj["chartDescription"]["yAxis"]["title"]["text"] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
336
      indicatorPath.parameters["yAxisTitle"] = title?title:""
353
      indicatorPath.parameters["yAxisTitle"] = title ? title : ""
337 354
    }
338 355
  }
339 356

  
......
381 398
  private extractOldToolYTitle(obj, indicatorPath: IndicatorPath) {
382 399
    let title = "";
383 400
    if (obj["fieldsheaders"]) {
384
      title = Array.isArray(obj["fieldsheaders"])?obj["fieldsheaders"][0]:obj["fieldsheaders"];
385
      if(Array.isArray(obj["fieldsheaders"])){
401
      title = Array.isArray(obj["fieldsheaders"]) ? obj["fieldsheaders"][0] : obj["fieldsheaders"];
402
      if (Array.isArray(obj["fieldsheaders"])) {
386 403
        obj["fieldsheaders"][0] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
387
      }else {
404
      } else {
388 405
        obj["fieldsheaders"] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
389 406
      }
390 407
      indicatorPath.parameters["yAxisTitle"] = title;
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/entities/stakeholder.ts
40 40
    this.isPublic = isPublic;
41 41
    this.logoUrl = logoUrl;
42 42
  }
43

  
44
  static createECStakeholder(): Stakeholder {
45
    let ec: Stakeholder = new Stakeholder(null, "funder", "ec__________::EC", "European Commission", "EC", false, "ec", true, true, null);
46
    //  new Stakeholder('wt','funder','wt__________::WT','Wellcome Trust','WT',false, 'wt',true,true);
47
    ec.topics.push(ec.createOSTopic(ec));
48
    ec.topics.push(ec.createImpactTopic());
49
    ec.topics.push(ec.createCollaborationTopic());
50
    return ec;
51
  }
52

  
53
  createOSTopic(stakeholder: Stakeholder): Topic {
54
    let topic = new Topic("OpenScience", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "open-science", true, true);
55

  
56
    /*    let overview:Category =  new Category("Overview","","overview",true,true);
57
        topic.categories.push(overview);
58
        let overviewDefSub = new SubCategory(null, null,null,true, true);
59
        overview.subCategories.push(overviewDefSub);*/
60

  
61

  
62
    let pubCategory: Category = new Category("Publications", "", "publications", true, true);
63
    topic.categories.push(pubCategory);
64
    let pubDefSub = new SubCategory(null, null, null, true, true);
65
    pubCategory.subCategories.push(pubDefSub);
66
    /*    let pubOpenSub = new SubCategory("Openess","","openness",true,true);
67
        pubCategory.subCategories.push(pubOpenSub);
68
        let pubFundingSub = new SubCategory("Funding","","funding",true,true);
69
        pubCategory.subCategories.push(pubFundingSub);
70
        let pubDatasourceSub = new SubCategory("Content Providers","","content-providers",true,true);
71
        pubCategory.subCategories.push(pubDatasourceSub);
72
        let pubDocTypeSub = new SubCategory("Document Type","","doc-type",true,true);
73
        pubCategory.subCategories.push(pubDocTypeSub);
74
        let pubFindSub = new SubCategory("Findability","","dindability",true,true);
75
        pubCategory.subCategories.push(pubFindSub);*/
76

  
77

  
78
    let dataCategory: Category = new Category("Research data", "", "data", true, true);
79
    topic.categories.push(dataCategory);
80
    let dataDefSub = new SubCategory(null, null, null, true, true);
81
    dataCategory.subCategories.push(dataDefSub);
82

  
83
    let softwareCategory: Category = new Category("Software", "", "software", true, true);
84
    topic.categories.push(softwareCategory);
85
    let softDefSub = new SubCategory(null, null, null, true, true);
86
    softwareCategory.subCategories.push(softDefSub);
87

  
88
    let otherCategory: Category = new Category("Other research products", "", "other", true, true);
89
    topic.categories.push(otherCategory);
90
    let otherDefSub = new SubCategory(null, null, null, true, true);
91
    otherCategory.subCategories.push(otherDefSub);
92

  
93
    /*    let datasourceCategory:Category =  new Category("Content Providers","","content-providers",true,true);
94
        topic.categories.push(datasourceCategory);
95
        let datasourceDefSub = new SubCategory(null, null,null,true, true);
96
        datasourceCategory.subCategories.push(datasourceDefSub);*/
97

  
98
    let projectCategory: Category = new Category("Projects", "", "projects", true, true);
99
    topic.categories.push(projectCategory);
100
    let projectDefSub = new SubCategory(null, null, null, true, true);
101
    projectCategory.subCategories.push(projectDefSub);
102

  
103
    //Numbers
104

  
105
    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"])]);
106
    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"])]);
107
    let n_total_projects = new Indicator("Projects", null, "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "total_projects"])]);
108
    let n_total_data = new Indicator("Reserach data", null, "number", "small", true, true, [new IndicatorPath(null, "search",
109
      "/datasets/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
110
    let n_total_soft = new Indicator("Software", null, "number", "small", true, true, [new IndicatorPath(null, "search",
111
      "/software/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
112
    let n_total_other = new Indicator("Other research products", null, "number", "small", true, true, [new IndicatorPath(null, "search",
113
      "/other/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
114

  
115
    /*overviewDefSub.numbers.push(n_total_pubs);
116
    overviewDefSub.numbers.push(n_open_pubs);
117
    overviewDefSub.numbers.push(n_total_projects);
118
    overviewDefSub.numbers.push(n_total_data);
119
    overviewDefSub.numbers.push(n_total_soft);
120
    overviewDefSub.numbers.push(n_total_other);*/
121

  
122
    pubDefSub.numbers.push(n_total_pubs);
123
    pubDefSub.numbers.push(n_open_pubs);
124
    softDefSub.numbers.push(n_total_soft);
125
    dataDefSub.numbers.push(n_total_data);
126
    otherDefSub.numbers.push(n_total_other);
127

  
128
    projectDefSub.numbers.push(n_total_projects);
129

  
130
    //Charts
131

  
132
    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, [
133
      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)]);
134
    c_pubs_per_project.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, "Publications per project (top 30)", "bar");
135
    pubDefSub.charts.push(c_pubs_per_project);
136

  
137
//TO check
138
    /* let c_pubs_per_datasource = new Indicator("Which are the top repositories containing "+stakeholder.index_shortName+" research outputs?",null, "chart","small",false,
139
       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)]);
140
     pubDefSub.charts.push(c_pubs_per_datasource);
141

  
142
     let c_pubs_per_doc_type = new Indicator("In what type of documents do your researchers used to publish?",null, "chart","small",true, true,
143
       [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)]);
144
     pubDefSub.charts.push(c_pubs_per_doc_type);
145

  
146
     let c_pubs_funding_scheme = new Indicator("What is the percentage publications by funding scheme / programme?",null, "chart","small",true,
147
       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)]);
148
     pubDefSub.charts.push(c_pubs_funding_scheme);
149
*/
150
    /*    //TODO check why doesn't load
151
          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,
152
          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)]);
153
        //pubDefSub.charts.push(c_pubs_gg_funding_scheme);
154
    */
155

  
156
    /* let c_pubs_open = new Indicator("Open Access publications timeline",null, "chart","small",true, true,
157
       [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)]);
158
     pubDefSub.charts.push(c_pubs_open);
159

  
160
     let c_pubs_access_modes = new Indicator("How your Open Access publications are shaped over the years?",null, "chart","medium",true, true,
161
       [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)]);
162
     pubDefSub.charts.push(c_pubs_access_modes);
163

  
164
     // 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)]);
165
     // pubDefSub.charts.push(c_pubs_av_embargo);
166

  
167
     let c_pubs_OA_journals = new Indicator("Publications in OA Journals over time",null, "chart","medium",true, true,
168
       [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)]);
169
     pubDefSub.charts.push(c_pubs_OA_journals);
170

  
171
     //from monitor
172
     let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
173
       [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)]);
174
     pubDefSub.charts.push(c_pubs_repo);
175
     //
176
     // let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
177
     //   [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('), null)]);
178
     // pubDefSub.charts.push(c_pubs_repo);
179

  
180
     // 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)]);
181
     // pubDefSub.charts.push(c_pubs_green_year);
182

  
183
     let c_pubs_datasource_country = new Indicator("What is the percentage of OA pubs by repositories over the years?",null, "chart","medium",true, true,
184
       [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)]);
185
     pubDefSub.charts.push(c_pubs_datasource_country);
186

  
187
     let c_pubs_funding_country = new Indicator("What is the percentage of OA pubs by projects over the years?",null, "chart","medium",true, true,
188
       [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)]);
189
     pubDefSub.charts.push(c_pubs_funding_country);
190

  
191
     let c_data_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true,
192
       [new IndicatorPath("column", "stats-tool",'/chart?json='+
193
         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)]);
194
     dataDefSub.charts.push(c_data_year);*/
195

  
196
    // 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)]);
197
    // otherDefSub.charts.push(c_other_year);
198
    //
199
    // 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)]);
200
    // pubDefSub.charts.push(c_datasources_access_modes);
201
    //
202
    // 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)]);
203
    // pubDefSub.charts.push(c_pub_nometa_year);
204
    //
205
    // 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)]);
206
    // pubDefSub.charts.push(c_pub_meta_linked_year);
207
    //
208
    // 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)]);
209
    // pubDefSub.charts.push(c_pub_colocated_year);
210

  
211
    // 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)]);
212
    // pubDefSub.charts.push(c_pub_pids);
213
    //
214
    // 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)]);
215
    // pubDefSub.charts.push(c_oai_pmh_datasources);
216

  
217
    return topic;
218
  }
219

  
220
  createImpactTopic(): Topic {
221
    let topic = new Topic("Impact/Correlation", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "impact", true, true);
222

  
223
    let pubCategory: Category = new Category("Publications", "", "publications", true, true);
224
    topic.categories.push(pubCategory);
225
    let pubDefSub = new SubCategory(null, null, null, true, true);
226
    pubCategory.subCategories.push(pubDefSub);
227

  
228
    let dataCategory: Category = new Category("Research data", "", "data", true, true);
229
    topic.categories.push(dataCategory);
230
    let dataDefSub = new SubCategory(null, null, null, true, true);
231
    dataCategory.subCategories.push(dataDefSub);
232

  
233
    let softwareCategory: Category = new Category("Software", "", "software", true, true);
234
    topic.categories.push(softwareCategory);
235
    let softDefSub = new SubCategory(null, null, null, true, true);
236
    softwareCategory.subCategories.push(softDefSub);
237

  
238
    /*  let otherCategory:Category =  new Category("Other research products","","other",true,true);
239
      topic.categories.push(otherCategory);
240
      let otherDefSub = new SubCategory(null, null,null,true, true);
241
      otherCategory.subCategories.push(otherDefSub);*/
242

  
243

  
244
    return topic;
245
  }
246

  
247
  createCollaborationTopic(): Topic {
248
    let topic = new Topic("Demo Topic", "This is a demo topic", "demo-topic", true, true);
249

  
250
    let category1: Category = new Category("Category 1", "This is ", "cat-1", true, true);
251
    topic.categories.push(category1);
252

  
253

  
254
    let subCat1 = new SubCategory("Sub-category 1", "", "sub-cat-1", true, true);
255
    category1.subCategories.push(subCat1);
256

  
257

  
258
    let subCat2 = new SubCategory("Sub-category 2", "", "sub-cat-2", true, true);
259
    category1.subCategories.push(subCat2);
260

  
261

  
262
    let category2: Category = new Category("Category 2 - no subcategories", "", "cat-2", true, true);
263
    topic.categories.push(category2);
264
    let defSub = new SubCategory(null, null, null, true, true);
265
    category2.subCategories.push(defSub);
266

  
267
    let chart1 = new Indicator(
268
      "Chart title goes here", "Chart description goes here", "chart", "medium", true, true,
269
      [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)]);
270
    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)]);
271
    subCat1.charts.push(chart1);
272
    subCat2.charts.push(chart2);
273

  
274
    defSub.charts.push(chart1);
275
    defSub.charts.push(chart2);
276
    let utils = new IndicatorUtils();
277
    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%";
278
    defSub.charts.push(new Indicator("Old tool graph", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("old", url, "bar")]))
279
    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";
280
    defSub.charts.push(new Indicator("", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("stats-tool", url, "bar")]))
281
    return topic;
282
  }
43
  //
44
  // static createECStakeholder(): Stakeholder {
45
  //   let ec: Stakeholder = new Stakeholder(null, "funder", "ec__________::EC", "European Commission", "EC", false, "ec", true, true, null);
46
  //   //  new Stakeholder('wt','funder','wt__________::WT','Wellcome Trust','WT',false, 'wt',true,true);
47
  //   ec.topics.push(ec.createOSTopic(ec));
48
  //   ec.topics.push(ec.createImpactTopic());
49
  //   ec.topics.push(ec.createCollaborationTopic());
50
  //   return ec;
51
  // }
52
//
53
//   createOSTopic(stakeholder: Stakeholder): Topic {
54
//     let topic = new Topic("OpenScience", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "open-science", true, true);
55
//
56
//     /*    let overview:Category =  new Category("Overview","","overview",true,true);
57
//         topic.categories.push(overview);
58
//         let overviewDefSub = new SubCategory(null, null,null,true, true);
59
//         overview.subCategories.push(overviewDefSub);*/
60
//
61
//
62
//     let pubCategory: Category = new Category("Publications", "", "publications", true, true);
63
//     topic.categories.push(pubCategory);
64
//     let pubDefSub = new SubCategory(null, null, null, true, true);
65
//     pubCategory.subCategories.push(pubDefSub);
66
//     /*    let pubOpenSub = new SubCategory("Openess","","openness",true,true);
67
//         pubCategory.subCategories.push(pubOpenSub);
68
//         let pubFundingSub = new SubCategory("Funding","","funding",true,true);
69
//         pubCategory.subCategories.push(pubFundingSub);
70
//         let pubDatasourceSub = new SubCategory("Content Providers","","content-providers",true,true);
71
//         pubCategory.subCategories.push(pubDatasourceSub);
72
//         let pubDocTypeSub = new SubCategory("Document Type","","doc-type",true,true);
73
//         pubCategory.subCategories.push(pubDocTypeSub);
74
//         let pubFindSub = new SubCategory("Findability","","dindability",true,true);
75
//         pubCategory.subCategories.push(pubFindSub);*/
76
//
77
//
78
//     let dataCategory: Category = new Category("Research data", "", "data", true, true);
79
//     topic.categories.push(dataCategory);
80
//     let dataDefSub = new SubCategory(null, null, null, true, true);
81
//     dataCategory.subCategories.push(dataDefSub);
82
//
83
//     let softwareCategory: Category = new Category("Software", "", "software", true, true);
84
//     topic.categories.push(softwareCategory);
85
//     let softDefSub = new SubCategory(null, null, null, true, true);
86
//     softwareCategory.subCategories.push(softDefSub);
87
//
88
//     let otherCategory: Category = new Category("Other research products", "", "other", true, true);
89
//     topic.categories.push(otherCategory);
90
//     let otherDefSub = new SubCategory(null, null, null, true, true);
91
//     otherCategory.subCategories.push(otherDefSub);
92
//
93
//     /*    let datasourceCategory:Category =  new Category("Content Providers","","content-providers",true,true);
94
//         topic.categories.push(datasourceCategory);
95
//         let datasourceDefSub = new SubCategory(null, null,null,true, true);
96
//         datasourceCategory.subCategories.push(datasourceDefSub);*/
97
//
98
//     let projectCategory: Category = new Category("Projects", "", "projects", true, true);
99
//     topic.categories.push(projectCategory);
100
//     let projectDefSub = new SubCategory(null, null, null, true, true);
101
//     projectCategory.subCategories.push(projectDefSub);
102
//
103
//     //Numbers
104
//
105
//     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"])]);
106
//     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"])]);
107
//     let n_total_projects = new Indicator("Projects", null, "number", "small", true, true, [new IndicatorPath(null, "statistics", "/funders/" + stakeholder._id, null, ["statistics", "total_projects"])]);
108
//     let n_total_data = new Indicator("Reserach data", null, "number", "small", true, true, [new IndicatorPath(null, "search",
109
//       "/datasets/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
110
//     let n_total_soft = new Indicator("Software", null, "number", "small", true, true, [new IndicatorPath(null, "search",
111
//       "/software/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
112
//     let n_total_other = new Indicator("Other research products", null, "number", "small", true, true, [new IndicatorPath(null, "search",
113
//       "/other/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]);
114
//
115
//     /*overviewDefSub.numbers.push(n_total_pubs);
116
//     overviewDefSub.numbers.push(n_open_pubs);
117
//     overviewDefSub.numbers.push(n_total_projects);
118
//     overviewDefSub.numbers.push(n_total_data);
119
//     overviewDefSub.numbers.push(n_total_soft);
120
//     overviewDefSub.numbers.push(n_total_other);*/
121
//
122
//     pubDefSub.numbers.push(n_total_pubs);
123
//     pubDefSub.numbers.push(n_open_pubs);
124
//     softDefSub.numbers.push(n_total_soft);
125
//     dataDefSub.numbers.push(n_total_data);
126
//     otherDefSub.numbers.push(n_total_other);
127
//
128
//     projectDefSub.numbers.push(n_total_projects);
129
//
130
//     //Charts
131
//
132
//     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, [
133
//       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)]);
134
//     c_pubs_per_project.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, "Publications per project (top 30)", "bar");
135
//     pubDefSub.charts.push(c_pubs_per_project);
136
//
137
// //TO check
138
//     /* let c_pubs_per_datasource = new Indicator("Which are the top repositories containing "+stakeholder.index_shortName+" research outputs?",null, "chart","small",false,
139
//        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)]);
140
//      pubDefSub.charts.push(c_pubs_per_datasource);
141
//
142
//      let c_pubs_per_doc_type = new Indicator("In what type of documents do your researchers used to publish?",null, "chart","small",true, true,
143
//        [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)]);
144
//      pubDefSub.charts.push(c_pubs_per_doc_type);
145
//
146
//      let c_pubs_funding_scheme = new Indicator("What is the percentage publications by funding scheme / programme?",null, "chart","small",true,
147
//        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)]);
148
//      pubDefSub.charts.push(c_pubs_funding_scheme);
149
// */
150
//     /*    //TODO check why doesn't load
151
//           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,
152
//           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)]);
153
//         //pubDefSub.charts.push(c_pubs_gg_funding_scheme);
154
//     */
155
//
156
//     /* let c_pubs_open = new Indicator("Open Access publications timeline",null, "chart","small",true, true,
157
//        [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)]);
158
//      pubDefSub.charts.push(c_pubs_open);
159
//
160
//      let c_pubs_access_modes = new Indicator("How your Open Access publications are shaped over the years?",null, "chart","medium",true, true,
161
//        [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)]);
162
//      pubDefSub.charts.push(c_pubs_access_modes);
163
//
164
//      // 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)]);
165
//      // pubDefSub.charts.push(c_pubs_av_embargo);
166
//
167
//      let c_pubs_OA_journals = new Indicator("Publications in OA Journals over time",null, "chart","medium",true, true,
168
//        [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)]);
169
//      pubDefSub.charts.push(c_pubs_OA_journals);
170
//
171
//      //from monitor
172
//      let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
173
//        [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)]);
174
//      pubDefSub.charts.push(c_pubs_repo);
175
//      //
176
//      // let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
177
//      //   [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('), null)]);
178
//      // pubDefSub.charts.push(c_pubs_repo);
179
//
180
//      // 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)]);
181
//      // pubDefSub.charts.push(c_pubs_green_year);
182
//
183
//      let c_pubs_datasource_country = new Indicator("What is the percentage of OA pubs by repositories over the years?",null, "chart","medium",true, true,
184
//        [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)]);
185
//      pubDefSub.charts.push(c_pubs_datasource_country);
186
//
187
//      let c_pubs_funding_country = new Indicator("What is the percentage of OA pubs by projects over the years?",null, "chart","medium",true, true,
188
//        [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)]);
189
//      pubDefSub.charts.push(c_pubs_funding_country);
190
//
191
//      let c_data_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true,
192
//        [new IndicatorPath("column", "stats-tool",'/chart?json='+
193
//          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)]);
194
//      dataDefSub.charts.push(c_data_year);*/
195
//
196
//     // 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)]);
197
//     // otherDefSub.charts.push(c_other_year);
198
//     //
199
//     // 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)]);
200
//     // pubDefSub.charts.push(c_datasources_access_modes);
201
//     //
202
//     // 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)]);
203
//     // pubDefSub.charts.push(c_pub_nometa_year);
204
//     //
205
//     // 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)]);
206
//     // pubDefSub.charts.push(c_pub_meta_linked_year);
207
//     //
208
//     // 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)]);
209
//     // pubDefSub.charts.push(c_pub_colocated_year);
210
//
211
//     // 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)]);
212
//     // pubDefSub.charts.push(c_pub_pids);
213
//     //
214
//     // 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)]);
215
//     // pubDefSub.charts.push(c_oai_pmh_datasources);
216
//
217
//     return topic;
218
//   }
219
//
220
//   createImpactTopic(): Topic {
221
//     let topic = new Topic("Impact/Correlation", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "impact", true, true);
222
//
223
//     let pubCategory: Category = new Category("Publications", "", "publications", true, true);
224
//     topic.categories.push(pubCategory);
225
//     let pubDefSub = new SubCategory(null, null, null, true, true);
226
//     pubCategory.subCategories.push(pubDefSub);
227
//
228
//     let dataCategory: Category = new Category("Research data", "", "data", true, true);
229
//     topic.categories.push(dataCategory);
230
//     let dataDefSub = new SubCategory(null, null, null, true, true);
231
//     dataCategory.subCategories.push(dataDefSub);
232
//
233
//     let softwareCategory: Category = new Category("Software", "", "software", true, true);
234
//     topic.categories.push(softwareCategory);
235
//     let softDefSub = new SubCategory(null, null, null, true, true);
236
//     softwareCategory.subCategories.push(softDefSub);
237
//
238
//     /*  let otherCategory:Category =  new Category("Other research products","","other",true,true);
239
//       topic.categories.push(otherCategory);
240
//       let otherDefSub = new SubCategory(null, null,null,true, true);
241
//       otherCategory.subCategories.push(otherDefSub);*/
242
//
243
//
244
//     return topic;
245
//   }
246
//
247
//   createCollaborationTopic(): Topic {
248
//     let topic = new Topic("Demo Topic", "This is a demo topic", "demo-topic", true, true);
249
//
250
//     let category1: Category = new Category("Category 1", "This is ", "cat-1", true, true);
251
//     topic.categories.push(category1);
252
//
253
//
254
//     let subCat1 = new SubCategory("Sub-category 1", "", "sub-cat-1", true, true);
255
//     category1.subCategories.push(subCat1);
256
//
257
//
258
//     let subCat2 = new SubCategory("Sub-category 2", "", "sub-cat-2", true, true);
259
//     category1.subCategories.push(subCat2);
260
//
261
//
262
//     let category2: Category = new Category("Category 2 - no subcategories", "", "cat-2", true, true);
263
//     topic.categories.push(category2);
264
//     let defSub = new SubCategory(null, null, null, true, true);
265
//     category2.subCategories.push(defSub);
266
//
267
//     let chart1 = new Indicator(
268
//       "Chart title goes here", "Chart description goes here", "chart", "medium", true, true,
269
//       [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)]);
270
//     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)]);
271
//     subCat1.charts.push(chart1);
272
//     subCat2.charts.push(chart2);
273
//
274
//     defSub.charts.push(chart1);
275
//     defSub.charts.push(chart2);
276
//     let utils = new IndicatorUtils();
277
//     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%";
278
//     defSub.charts.push(new Indicator("Old tool graph", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("old", url, "bar")]))
279
//     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";
280
//     defSub.charts.push(new Indicator("", "", "chart", "large", true, true, [utils.generateIndicatorByChartUrl("stats-tool", url, "bar")]))
281
//     return topic;
282
//   }
283 283
}
284 284

  
285 285
export class Topic {
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/entities/stakeholderCreator.ts
209 209

  
210 210
    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"}}}');
211 211
      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"}}}');
212
    let open_non_ind:Indicator = new Indicator(chartTitle[index]+" Overview", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_url, "pie")])
212
    let open_non_ind:Indicator = new Indicator(chartTitle[index]+" Overview", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_url, "pie",stakeholder)])
213 213
    open_non_ind.indicatorPaths[0].parameters["id"] =  stakeholder.index_shortName.toLowerCase();
214 214
    if(index!=0){
215 215
      open_non_ind.recommendedFor.push("ec__________::EC");
......
218 218

  
219 219
    if(dbType == "publication") {
220 220
      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"}}}');
221
      let gold_vs_green_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_url, "pie")]));
221
      let gold_vs_green_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_url, "pie",stakeholder)]));
222 222
      gold_vs_green_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
223 223
      if (index != 0) {
224 224
        gold_vs_green_ind.recommendedFor.push("ec__________::EC");
225 225
      }
226 226
      indicators.push(gold_vs_green_ind);
227 227
      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+'}}');
228
      let gold_vs_green_time_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_time_url, "column")]));
228
      let gold_vs_green_time_ind: Indicator = (new Indicator("", "", "chart", "small", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_vs_green_time_url, "column",stakeholder)]));
229 229
      gold_vs_green_time_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
230 230
      if (index != 0) {
231 231
        gold_vs_green_time_ind.recommendedFor.push("ec__________::EC");
......
234 234
    }
235 235

  
236 236
    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"}}}');
237
    let top_project_ind:Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_project_url, "column")]));
237
    let top_project_ind:Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_project_url, "column",stakeholder)]));
238 238
    top_project_ind.indicatorPaths[0].parameters["id"] =  stakeholder.index_shortName.toLowerCase();
239 239
    if(index!=0){
240 240
      top_project_ind.recommendedFor.push("ec__________::EC");
......
242 242
    indicators.push(top_project_ind);
243 243
    if(index == 0) {
244 244
      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"}}}');
245
      let top_datasources_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_datasources_url, "column")]));
245
      let top_datasources_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", top_datasources_url, "column",stakeholder)]));
246 246
      top_datasources_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
247 247
      indicators.push(top_datasources_ind);
248 248
    }
249 249
    if(index != 0) {
250 250
      let open_non_fl2 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
251 251
        '{"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"}}}');
252
      let open_non_fl2_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl2, "column")]));
252
      let open_non_fl2_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl2, "column",stakeholder)]));
253 253
      // open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
254 254
      indicators.push(open_non_fl2_ind);
255 255
      if (index != 0) {
......
258 258
      if(dbType == "publication") {
259 259
        let gold_green__fl2 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
260 260
          '{"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+'}}');
261
        let gold_green_ind_fl2: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl2, "column")]));
261
        let gold_green_ind_fl2: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl2, "column",stakeholder)]));
262 262
        // open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
263 263
        indicators.push(gold_green_ind_fl2);
264 264
        if (index != 0) {
......
267 267
      }
268 268
      let open_non_fl1 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
269 269
        '{"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"}}}');
270
      let open_non_fl1_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl1, "column")]));
270
      let open_non_fl1_ind: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", open_non_fl1, "column",stakeholder)]));
271 271
      // open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
272 272
      indicators.push(open_non_fl1_ind);
273 273
      if (index != 0) {
......
276 276
      if(dbType == "publication") {
277 277
        let gold_green__fl1 = "http://88.197.53.71:8080/stats-api/chart?json=" + encodeURIComponent(
278 278
          '{"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+'}}');
279
        let gold_green_ind_fl1: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl1, "column")]));
279
        let gold_green_ind_fl1: Indicator = (new Indicator("", "", "chart", "medium", true, true, [utils.generateIndicatorByChartUrl("stats-tool", gold_green__fl1, "column",stakeholder)]));
280 280
        // open_non_fl2_ind.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase();
281 281
        indicators.push(gold_green_ind_fl1);
282 282
        if (index != 0) {
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/stakeholder/stakeholder.component.ts
11 11
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
12 12
import {Subscriber} from "rxjs";
13 13
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
14
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
14
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
15 15
import {StakeholderUtils} from "../utils/indicator-utils";
16 16

  
17 17
declare var UIkit;
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app.component.ts
6 6
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
7 7
import {StakeholderService} from "./services/stakeholder.service";
8 8
import {BehaviorSubject, Subscriber} from "rxjs";
9
import {LayoutService} from "./library/sharedComponents/sidebar/layout.service";
9
import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
10 10
import {MenuItem} from "./openaireLibrary/sharedComponents/menu";
11
import {Item} from "./utils/entities/sidebar";
12 11

  
13 12

  
14 13
@Component({
......
21 20
  params: BehaviorSubject<Params> = new BehaviorSubject<Params>(null);
22 21
  hasSidebar: boolean = false;
23 22
  hasHeader: boolean = false;
23
  hasAdminMenu: boolean = false;
24 24
  userMenuItems: MenuItem[] = [];
25
  adminMenuItems: Item[] = [];
25
  adminMenuItems: MenuItem[] = [];
26 26
  private subscriptions: any[] = [];
27 27
  
28 28
  constructor(private route: ActivatedRoute,
......
53 53
      this.hasHeader = hasHeader;
54 54
      this.cdr.detectChanges();
55 55
    }));
56
    this.subscriptions.push(this.layoutService.hasAdminMenu.subscribe(hasAdminMenu => {
57
      this.hasAdminMenu = hasAdminMenu;
58
      this.cdr.detectChanges();
59
    }));
56 60
    this.propertiesService.loadEnvironment()
57 61
      .then(properties => {
58 62
        this.properties = properties;
......
112 116
    }
113 117
    if (this.adminMenuItems.length == 0) {
114 118
      //nstructor(id: string, name: string, route: string, items: Item[], icon, open: boolean) {
115
      this.adminMenuItems.push(new Item("stakeholders", "Manage Stakeholders", "/admin", [], null, false));
116
      this.adminMenuItems.push(new Item("pages", "Pages", "/pages", [], null, false));
117
      this.adminMenuItems.push(new Item("monitor", "Monitor", "/portals", [], null, false));
118
      this.adminMenuItems.push(new Item("entities", "Entities", "/entities", [], null, false));
119
      this.adminMenuItems.push(new Item("helptexts", "Help texts", "/helptexts?communityId=openaire", [], null, false));
119
      this.adminMenuItems.push(new MenuItem("stakeholders", "Manage Stakeholders", "", "/admin", false, [], [], {}));
120
      let adminOptions = new MenuItem("adminOptions", "Admin Options", "", "", false, [], [], {})
121
      adminOptions.items.push(new MenuItem("pages", "Pages", "", "/pages", false, [], [], {}));
122
      adminOptions.items.push(new MenuItem("portals", "Portals", "", "/portals", false, [], [], {}));
123
      adminOptions.items.push(new MenuItem("entities", "Entities", "", "/entities", false, [], [], {}));
124
      adminOptions.items.push(new MenuItem("classes", "Class help texts", "", "/classes", false, [], [], {}));
125
      this.adminMenuItems.push(adminOptions);
126
      let monitorOptions = new MenuItem("monitorOptions", "Monitor Options", "", "", false, [], [], {})
127
      monitorOptions.items.push(new MenuItem("pages", "Pages", "", "/pages", false, [], [], {communityId: 'openaire'}));
128
      monitorOptions.items.push(new MenuItem("entities", "Entities", "", "/entities", false, [], [], {communityId: 'openaire'}));
129
      monitorOptions.items.push(new MenuItem("classes", "Class help texts", "", "/classContents", false, [], [], {communityId: 'openaire'}));
130
      monitorOptions.items.push(new MenuItem("helptexts", "Help texts", "", "/helptexts", false, [], [], {communityId: 'openaire'}));
131
      this.adminMenuItems.push(monitorOptions);
132

  
133
      // this.adminMenuItems.push(new Item("pages", "Pages", "/pages", [], null, false));
134
      // this.adminMenuItems.push(new Item("monitor", "Monitor", "/portals", [], null, false));
135
      // this.adminMenuItems.push(new Item("entities", "Entities", "/entities", [], null, false));
136
      // this.adminMenuItems.push(new Item("helptexts", "Help texts", "/helptexts?communityId=openaire", [], null, false));
120 137
    }
121 138
  }
122 139
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/indicators.component.ts
9 9
import {StakeholderService} from "../services/stakeholder.service";
10 10
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
11 11
import {Subscriber} from "rxjs";
12
import {LayoutService} from "../library/sharedComponents/sidebar/layout.service";
12
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
13 13

  
14 14
declare var UIkit;
15 15

  
......
276 276
    let index = this.indicatorPaths.length - 1;
277 277
    this.urlSubscriptions.push(this.indicatorPaths.at(index).get('url').valueChanges.subscribe(value => {
278 278
        if (this.indicatorPaths.at(index).get('url').valid) {
279
          let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value);
279
          let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.statisticsService.getChartSource(value), value, 'bar',this.stakeholder);
280 280
          let parameters = this.getParametersAsFormArray(indicatorPath);
281 281
          (this.indicatorPaths.at(index) as FormGroup).setControl('parameters', parameters);
282 282
          if (!this.indicator.indicatorPaths[index]) {
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app-routing.module.ts
26 26
  {
27 27
    path: 'admin',
28 28
    loadChildren: './home/home.module#HomeModule',
29
    resolve: {envSpecific: EnvironmentSpecificResolver}
29
    resolve: {envSpecific: EnvironmentSpecificResolver},
30
    data: {hasAdminMenu: true}
30 31
  },
31 32
  {
32 33
    path: 'admin/:stakeholder',
33 34
    loadChildren: './stakeholder/stakeholder.module#StakeholderModule',
34
    resolve: {envSpecific: EnvironmentSpecificResolver}
35
    resolve: {envSpecific: EnvironmentSpecificResolver},
36
    data: {hasAdminMenu: false}
35 37
  },
36 38
  {
37 39
    path: 'admin/:stakeholder/:topic',
38 40
    loadChildren: './topic/topic.module#TopicModule',
39
    resolve: {envSpecific: EnvironmentSpecificResolver}
41
    resolve: {envSpecific: EnvironmentSpecificResolver},
42
    data: {hasAdminMenu: false}
40 43
  },
41 44

  
42 45
  /* Library paths*/
43 46
  {
44 47
    path: 'portals',
45 48
    loadChildren: './openaireLibrary/dashboard/portal/communities.module#CommunitiesModule',
46
    resolve: { envSpecific: EnvironmentSpecificResolver  }
49
    resolve: { envSpecific: EnvironmentSpecificResolver  },
50
    data: {hasAdminMenu: true}
47 51
  },
48 52
  {
49 53
    path: 'entities',
50 54
    loadChildren: './openaireLibrary/dashboard/entity/entities.module#EntitiesModule',
51
    resolve: { envSpecific: EnvironmentSpecificResolver  }
55
    resolve: { envSpecific: EnvironmentSpecificResolver  },
56
    data: {hasAdminMenu: true}
52 57
  },
53 58
  {
54 59
    path: 'classes',
55 60
    loadChildren: './openaireLibrary/dashboard/divId/divIds.module#DivIdsModule',
56
    resolve: { envSpecific: EnvironmentSpecificResolver  }
61
    resolve: { envSpecific: EnvironmentSpecificResolver  },
62
    data: {hasAdminMenu: true}
57 63
  },
58 64
  {
59 65
    path: 'classContents',
60 66
    loadChildren: './openaireLibrary/dashboard/divhelpcontent/div-help-contents.module#DivHelpContentsModule',
61
    resolve: { envSpecific: EnvironmentSpecificResolver  }
67
    resolve: { envSpecific: EnvironmentSpecificResolver  },
68
    data: {hasAdminMenu: true}
62 69
  },
63 70
  {
64 71
    path: 'classContents/new',
65 72
    loadChildren: './openaireLibrary/dashboard/divhelpcontent/new-div-help-content.module#NewDivHelpContentModule',
66
    resolve: { envSpecific: EnvironmentSpecificResolver  }
73
    resolve: { envSpecific: EnvironmentSpecificResolver  },
74
    data: {hasAdminMenu: true}
67 75
  },
68 76
  {
69 77
    path: 'classContents/edit',
70 78
    loadChildren: './openaireLibrary/dashboard/divhelpcontent/edit-div-help-content.module#EditDivHelpContentModule',
71
    resolve: { envSpecific: EnvironmentSpecificResolver  }
79
    resolve: { envSpecific: EnvironmentSpecificResolver  },
80
    data: {hasAdminMenu: true}
72 81
  },
73 82
  {
74 83
    path: 'helptexts',
75 84
    loadChildren: './openaireLibrary/dashboard/helpTexts/page-help-contents.module#PageHelpContentsModule',
76
    resolve: { envSpecific: EnvironmentSpecificResolver  }
85
    resolve: { envSpecific: EnvironmentSpecificResolver  },
86
    data: {hasAdminMenu: true}
77 87
  },
78 88
  {
79 89
    path: 'helptexts/new',
80 90
    loadChildren: './openaireLibrary/dashboard/helpTexts/new-page-help-content.module#NewPageHelpContentModule',
81
    resolve: { envSpecific: EnvironmentSpecificResolver  }
91
    resolve: { envSpecific: EnvironmentSpecificResolver  },
92
    data: {hasAdminMenu: true}
82 93
  },
83 94
  {
84 95
    path: 'helptexts/edit',
85 96
    loadChildren: './openaireLibrary/dashboard/helpTexts/edit-page-help-content.module#EditPageHelpContentModule',
86
    resolve: { envSpecific: EnvironmentSpecificResolver  }
97
    resolve: { envSpecific: EnvironmentSpecificResolver  },
98
    data: {hasAdminMenu: true}
87 99
  },
88 100
  {
89 101
    path: 'pages',
90 102
    loadChildren: './openaireLibrary/dashboard/page/pages.module#PagesModule',
91
    resolve: { envSpecific: EnvironmentSpecificResolver  }
103
    resolve: { envSpecific: EnvironmentSpecificResolver  },
104
    data: {hasAdminMenu: true}
92 105
  },
93 106
  /*{
94 107
    path: 'pages',
......
121 134
    path: '',
122 135
    loadChildren: './monitor/monitor.module#MonitorModule',
123 136
    resolve: {envSpecific: EnvironmentSpecificResolver},
137
    data: {hasAdminMenu: false, }
138

  
124 139
  },
125 140
  {
126 141
    path: '**',

Also available in: Unified diff