Project

General

Profile

1
import { Component, OnInit } from '@angular/core';
2
import { DataService } from '../../services/data.service';
3
import { ActivatedRoute } from '@angular/router';
4
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
5
import { DataHandlerService } from '../../services/data-handler.service';
6
import { CountryPageOverviewData } from '../../domain/overview-map-data';
7
import { TreemapHighchartsData } from '../../domain/treemap-highcharts-data';
8
import { environment } from '../../../environments/environment';
9
import {
10
  datasetPalette,
11
  otherResearchProductsPalette,
12
  publicationPalette,
13
  softwarePalette,
14
  resultsPalette,
15
  datasetColor, publicationColor, otherResearchProductsColor, softwareColor
16
} from '../../chart-palettes';
17

    
18
@Component({
19
  selector: 'app-country-page',
20
  templateUrl: './country-page.component.html',
21
})
22

    
23
export class CountryPageComponent implements OnInit {
24

    
25
  private chartsURL = environment.API_ENDPOINT + 'chart?json=';
26
  private profileName = environment.profileName;
27

    
28
  private publicationPalette = publicationPalette;
29
  private datasetPalette = datasetPalette;
30
  private softwarePalette = softwarePalette;
31
  private otherResearchProductsPalette = otherResearchProductsPalette;
32
  private resultsPalette = resultsPalette;
33

    
34
  publicationColor = publicationColor;
35
  datasetColor = datasetColor;
36
  softwareColor = softwareColor;
37
  otherResearchProductsColor = otherResearchProductsColor;
38

    
39
  lastUpdateDate: string;
40

    
41
  countryCode: string;
42

    
43
  activeTopView: string = 'overview';
44
  activeInnerView: string = 'publications';
45

    
46
  linkToCountryInOpenAIRE: string;
47

    
48
  countryPageOverviewData: CountryPageOverviewData;
49

    
50
  // Overview Tab
51
  overviewTabIsInitialised: boolean = false;
52

    
53
  countryPageOAData: CountryPageOverviewData;
54

    
55
  resultsByTypeOANonOAChartURL: SafeResourceUrl;
56

    
57
  oaNonOAPublicationsTimelineChartURL: SafeResourceUrl;
58
  publicationsByDatasourceChartURL: SafeResourceUrl;
59
  publicationsByOrganizationChartURL: SafeResourceUrl;
60

    
61
  oaNonOADatasetsTimelineChartURL: SafeResourceUrl;
62
  datasetsByDatasourceChartURL: SafeResourceUrl;
63
  datasetsByOrganizationChartURL: SafeResourceUrl;
64

    
65
  oaNonOASoftwareTimelineChartURL: SafeResourceUrl;
66
  softwareByDatasourceChartURL: SafeResourceUrl;
67
  softwareByOrganizationChartURL: SafeResourceUrl;
68

    
69
  oaNonOAOtherTimelineChartURL: SafeResourceUrl;
70
  otherByDatasourceChartURL: SafeResourceUrl;
71
  otherByOrganizationChartURL: SafeResourceUrl;
72

    
73
  publicationsByFunderData: TreemapHighchartsData[];
74
  datasetsByFunderData: TreemapHighchartsData[];
75
  softwareByFunderData: TreemapHighchartsData[];
76
  otherByFunderData: TreemapHighchartsData[];
77

    
78
  // Open Science Tab
79
  // publications subtab
80
  openSciencePubsTabIsInitialised: boolean = false;
81

    
82
  publicationsWithPIDTimeline: SafeResourceUrl;
83
  publicationsWithLicenceTimeline: SafeResourceUrl;
84
  goldPublicationsTimeline: SafeResourceUrl;
85
  greenPublicationsTimeline: SafeResourceUrl;
86

    
87
  publicationsWithPIDByDatasourceChartURL: SafeResourceUrl;
88
  publicationsWithLicenceByDatasourceChartURL: SafeResourceUrl;
89
  goldPublicationsByDatasourceChartURL: SafeResourceUrl;
90
  greenPublicationsByDatasourceChartURL: SafeResourceUrl;
91

    
92
  publicationsWithPIDByOrganizationChartURL: SafeResourceUrl;
93
  publicationsWithLicenceByOrganizationChartURL: SafeResourceUrl;
94
  goldPublicationsByOrganizationChartURL: SafeResourceUrl;
95
  greenPublicationsByOrganizationChartURL: SafeResourceUrl;
96

    
97
  publicationsWithPIDByFunderData: TreemapHighchartsData[];
98
  publicationsWithLicenceByFunderData: TreemapHighchartsData[];
99
  goldPublicationsByFunderData: TreemapHighchartsData[];
100
  greenPublicationsByFunderData: TreemapHighchartsData[];
101

    
102
  greenVsGoldPublicationsChartURL: SafeResourceUrl;
103

    
104
  // Open Science Tab
105
  // datasets subtab
106
  openScienceDatasetsTabIsInitialised: boolean = false;
107

    
108
  datasetsWithPIDTimeline: SafeResourceUrl;
109
  datasetsWithLicenceTimeline: SafeResourceUrl;
110

    
111
  datasetsWithPIDByDatasourceChartURL: SafeResourceUrl;
112
  datasetsWithLicenceByDatasourceChartURL: SafeResourceUrl;
113

    
114
  datasetsWithPIDByOrganizationChartURL: SafeResourceUrl;
115
  datasetsWithLicenceByOrganizationChartURL: SafeResourceUrl;
116

    
117
  datasetsWithPIDByFunderData: TreemapHighchartsData[];
118
  datasetsWithLicenceByFunderData: TreemapHighchartsData[];
119

    
120
  // Open Science Tab
121
  // software subtab
122
  openScienceSoftwareTabIsInitialised: boolean = false;
123

    
124
  softwareWithPIDTimeline: SafeResourceUrl;
125
  softwareWithLicenceTimeline: SafeResourceUrl;
126

    
127
  softwareWithPIDByDatasourceChartURL: SafeResourceUrl;
128
  softwareWithLicenceByDatasourceChartURL: SafeResourceUrl;
129

    
130
  softwareWithPIDByOrganizationChartURL: SafeResourceUrl;
131
  softwareWithLicenceByOrganizationChartURL: SafeResourceUrl;
132

    
133
  softwareWithPIDByFunderData: TreemapHighchartsData[];
134
  softwareWithLicenceByFunderData: TreemapHighchartsData[];
135

    
136
  // Open Science Tab
137
  // other research products subtab
138
  openScienceOtherTabIsInitialised: boolean = false;
139

    
140
  otherWithLicenceTimeline: SafeResourceUrl;
141
  otherWithPIDTimeline: SafeResourceUrl;
142

    
143
  otherWithPIDByDatasourceChartURL: SafeResourceUrl;
144
  otherWithLicenceByDatasourceChartURL: SafeResourceUrl;
145

    
146
  otherWithPIDByOrganizationChartURL: SafeResourceUrl;
147
  otherWithLicenceByOrganizationChartURL: SafeResourceUrl;
148

    
149
  otherWithPIDByFunderData: TreemapHighchartsData[];
150
  otherWithLicenceByFunderData: TreemapHighchartsData[];
151

    
152
  constructor(private dataService: DataService,
153
              private dataHandlerService: DataHandlerService,
154
              private route: ActivatedRoute,
155
              private sanitizer: DomSanitizer) { }
156

    
157
  ngOnInit(): void {
158

    
159
    window.scroll(0, 0);
160

    
161
    this.dataService.getLastUpdateDate().subscribe(
162
      rawData => {
163
        this.lastUpdateDate = this.dataHandlerService.convertRawDataToLastUpdateDate(rawData);
164
      }, error => {
165
        console.log(error);
166
      }
167
    );
168

    
169
    this.route.params.subscribe(params => {
170

    
171
      this.countryCode = params['countryCode'];
172

    
173
      this.dataService.getCountryPageOverviewData(this.countryCode).subscribe(
174
        rawData => {
175
          this.countryPageOverviewData = this.dataHandlerService.convertRawDataToCountryPageOverviewData(rawData);
176
          if (this.countryPageOverviewData && this.countryPageOverviewData.name) {
177
            this.linkToCountryInOpenAIRE = 'https://www.openaire.eu/item/' + this.countryPageOverviewData.name.replace(' ', '-');
178
            // this.createChartURLs();
179
          }
180
        }, error => {
181
          console.log(error);
182
        }
183
      );
184

    
185
      this.createOverviewContent();
186
    });
187

    
188

    
189

    
190
  }
191

    
192
  changeTopView(view: string) {
193
    this.activeTopView = view;
194
    // console.log('top view: ', view);
195
    if (view === 'overview') {
196
      this.createOverviewContent();
197
    } else if (view === 'openScience') {
198
      this.createOpenScienceContent();
199
    }
200
  }
201

    
202
  changeInnerView(view: string) {
203
    this.activeInnerView = view;
204
    // console.log('view: ', view);
205
    if (view === 'publications') {
206
      this.createPublicationsViewForOpenScience();
207
    } else if (view === 'datasets') {
208
      this.createDatasetsViewForOpenScience();
209
    } else if (view === 'software') {
210
      this.createSoftwareViewForOpenScience();
211
    } else if (view === 'other') {
212
      this.createOtherViewForOpenScience();
213
    }
214
  }
215

    
216
  createOverviewContent() {
217

    
218
    if (!this.overviewTabIsInitialised) {
219

    
220
      this.dataService.getCountryOAData(this.countryCode).subscribe(
221
        rawData => {
222
          this.countryPageOAData = this.dataHandlerService.convertRawDataToCountryPageOAData(rawData);
223
        }, error => {
224
          console.log(error);
225
        }
226
      );
227

    
228
      this.oaNonOAPublicationsTimelineChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]},{"field":"publication.access mode","type":"=","values":["Open Source"]}],"op":"OR"},{"groupFilters":[{"field":"publication.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<=","values":["2020"]}],"op":"AND"}],"entity":"publication","profile":"${this.profileName}","limit":"30"}},{"name":"Non-OA","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.organization.country.code","type":"=","values":["${this.countryCode}"]}],"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"]},{"field":"publication.access mode","type":"!=","values":["Open Source"]}],"op":"AND"}],"entity":"publication","profile":"${this.profileName}","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"normal"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
229
      this.oaNonOADatasetsTimelineChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA","type":"column","query":{"select":[{"field":"dataset","aggregate":"count"},{"field":"dataset.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"dataset.access mode","type":"=","values":["Open Access"]},{"field":"dataset.access mode","type":"=","values":["Open Source"]}],"op":"OR"},{"groupFilters":[{"field":"dataset.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"},{"groupFilters":[{"field":"dataset.year","type":">","values":["2010"]},{"field":"dataset.year","type":"<=","values":["2020"]}],"op":"AND"}],"entity":"dataset","profile":"${this.profileName}","limit":"30"}},{"name":"Non-OA","type":"column","query":{"select":[{"field":"dataset","aggregate":"count"},{"field":"dataset.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"dataset.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"},{"groupFilters":[{"field":"dataset.year","type":">","values":["2010"]},{"field":"dataset.year","type":"<=","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"dataset.access mode","type":"!=","values":["Open Access"]},{"field":"dataset.access mode","type":"!=","values":["Open Source"]}],"op":"AND"}],"entity":"dataset","profile":"${this.profileName}","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Datasets","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"normal"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
230
      this.oaNonOASoftwareTimelineChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA","type":"column","query":{"select":[{"field":"software","aggregate":"count"},{"field":"software.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"software.access mode","type":"=","values":["Open Access"]},{"field":"software.access mode","type":"=","values":["Open Source"]}],"op":"OR"},{"groupFilters":[{"field":"software.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"},{"groupFilters":[{"field":"software.year","type":">","values":["2010"]},{"field":"software.year","type":"<=","values":["2020"]}],"op":"AND"}],"entity":"software","profile":"${this.profileName}","limit":"30"}},{"name":"Non-OA","type":"column","query":{"select":[{"field":"software","aggregate":"count"},{"field":"software.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"software.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"},{"groupFilters":[{"field":"software.year","type":">","values":["2010"]},{"field":"software.year","type":"<=","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"software.access mode","type":"!=","values":["Open Access"]},{"field":"software.access mode","type":"!=","values":["Open Source"]}],"op":"AND"}],"entity":"software","profile":"${this.profileName}","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Software","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"normal"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
231
      this.oaNonOAOtherTimelineChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA","type":"column","query":{"select":[{"field":"other","aggregate":"count"},{"field":"other.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"other.access mode","type":"=","values":["Open Access"]},{"field":"other.access mode","type":"=","values":["Open Source"]}],"op":"OR"},{"groupFilters":[{"field":"other.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"},{"groupFilters":[{"field":"other.year","type":">","values":["2010"]},{"field":"other.year","type":"<=","values":["2020"]}],"op":"AND"}],"entity":"other","profile":"${this.profileName}","limit":"30"}},{"name":"Non-OA","type":"column","query":{"select":[{"field":"other","aggregate":"count"},{"field":"other.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"other.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"},{"groupFilters":[{"field":"other.year","type":">","values":["2010"]},{"field":"other.year","type":"<=","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"other.access mode","type":"!=","values":["Open Access"]},{"field":"other.access mode","type":"!=","values":["Open Source"]}],"op":"AND"}],"entity":"other","profile":"${this.profileName}","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Other research products","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"normal"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
232

    
233
      this.publicationsByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.affiliated.bydatasource.country","parameters":["${this.countryCode}","publication"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Publications","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
234
      this.publicationsByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.affiliated.byorganization.country","parameters":["${this.countryCode}","publication"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Publications","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
235

    
236
      this.datasetsByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.affiliated.bydatasource.country","parameters":["${this.countryCode}","dataset"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
237
      this.datasetsByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"datasets","type":"bar","query":{"name":"new.oso.results.affiliated.byorganization.country","parameters":["${this.countryCode}","dataset"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
238

    
239
      this.softwareByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"software","type":"bar","query":{"name":"new.oso.results.affiliated.bydatasource.country","parameters":["${this.countryCode}","software"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
240
      this.softwareByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"software","type":"bar","query":{"name":"new.oso.results.affiliated.byorganization.country","parameters":["${this.countryCode}","software"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
241

    
242
      this.otherByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"other","type":"bar","query":{"name":"new.oso.results.affiliated.bydatasource.country","parameters":["${this.countryCode}","other"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
243
      this.otherByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"other","type":"bar","query":{"name":"new.oso.results.affiliated.byorganization.country","parameters":["${this.countryCode}","other"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
244

    
245
      // fixme use the profileName variable when this chart is available for the same profile as the rest (in 2 places)
246
      this.resultsByTypeOANonOAChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA","type":"column","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.type","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.access mode","type":"=","values":["Open Access"]},{"field":"result.access mode","type":"=","values":["Open Source"]}],"op":"OR"},{"groupFilters":[{"field":"result.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"30"}},{"name":"Non-OA","type":"column","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.type","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.access mode","type":"!=","values":["Open Access"]},{"field":"result.access mode","type":"!=","values":["Open Source"]}],"op":"AND"},{"groupFilters":[{"field":"result.organization.country.code","type":"=","values":["${this.countryCode}"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Research results by type","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"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":false},"colors":[\"${this.resultsPalette.join('","')}\"]}}`));
247

    
248
      this.dataService.getFundersResultsByTypeForCountry('publication', this.countryCode).subscribe(
249
        rawData => {
250
          this.publicationsByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
251
        }, error => {
252
          console.log(error);
253
        }
254
      );
255

    
256
      this.dataService.getFundersResultsByTypeForCountry('dataset', this.countryCode).subscribe(
257
        rawData => {
258
          this.datasetsByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
259
        }, error => {
260
          console.log(error);
261
        }
262
      );
263

    
264
      this.dataService.getFundersResultsByTypeForCountry('software', this.countryCode).subscribe(
265
        rawData => {
266
          this.softwareByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
267
        }, error => {
268
          console.log(error);
269
        }
270
      );
271

    
272
      this.dataService.getFundersResultsByTypeForCountry('other', this.countryCode).subscribe(
273
        rawData => {
274
          this.otherByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
275
        }, error => {
276
          console.log(error);
277
        }
278
      );
279

    
280
      this.overviewTabIsInitialised = true;
281
    }
282
  }
283

    
284
  createOpenScienceContent() {
285
    this.createPublicationsViewForOpenScience();
286
  }
287

    
288
  createPublicationsViewForOpenScience() {
289

    
290
    if (!this.openSciencePubsTabIsInitialised) {
291

    
292
      this.publicationsWithPIDTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.pid_timeline.affiliated.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Publications with PID","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
293
      this.publicationsWithLicenceTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.licence_timeline.affiliated.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Publications with licence","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
294
      this.goldPublicationsTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.gold_timeline.affiliated.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Gold OA Publications","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
295
      this.greenPublicationsTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.green_timeline.affiliated.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Green OA Publications","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
296

    
297
      this.publicationsWithPIDByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.bydatasource.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications with PID","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
298
      this.publicationsWithLicenceByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.bydatasource.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications with licence","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
299
      this.goldPublicationsByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.gold.affiliated.bydatasource.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Gold Publications","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
300
      this.greenPublicationsByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.green.affiliated.bydatasource.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Green Publications","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
301

    
302
      this.publicationsWithPIDByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.byorganization.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications with PID","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
303
      this.publicationsWithLicenceByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.byorganization.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications with licence","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
304
      this.goldPublicationsByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.gold.affiliated.byorganization.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Gold Publications","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
305
      this.greenPublicationsByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.green.affiliated.byorganization.country","parameters":["publication","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Green Publications","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
306

    
307
      this.greenVsGoldPublicationsChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.publications.greenvsgold.country","parameters":["${this.countryCode}","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Green vs Gold","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.publicationPalette.join('","')}\"]}}`));
308

    
309
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('publication', 'pid', this.countryCode).subscribe(
310
        rawData => {
311
          this.publicationsWithPIDByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
312
        }, error => {
313
          console.log(error);
314
        }
315
      );
316

    
317
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('publication', 'licence', this.countryCode).subscribe(
318
        rawData => {
319
          this.publicationsWithLicenceByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
320
        }, error => {
321
          console.log(error);
322
        }
323
      );
324

    
325
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('publication', 'gold', this.countryCode).subscribe(
326
        rawData => {
327
          this.goldPublicationsByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
328
        }, error => {
329
          console.log(error);
330
        }
331
      );
332

    
333
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('publication', 'green', this.countryCode).subscribe(
334
        rawData => {
335
          this.greenPublicationsByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
336
        }, error => {
337
          console.log(error);
338
        }
339
      );
340

    
341
      this.openSciencePubsTabIsInitialised = true;
342
    }
343
  }
344

    
345
  createDatasetsViewForOpenScience() {
346

    
347
    if (!this.openScienceDatasetsTabIsInitialised) {
348

    
349
      this.datasetsWithPIDTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.pid_timeline.affiliated.country","parameters":["dataset","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets with PID","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
350
      this.datasetsWithLicenceTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.licence_timeline.affiliated.country","parameters":["dataset","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets with licence","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
351

    
352
      this.datasetsWithPIDByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.bydatasource.country","parameters":["dataset","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets with PID","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
353
      this.datasetsWithLicenceByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.bydatasource.country","parameters":["dataset","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets with licence","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
354

    
355
      this.datasetsWithPIDByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.byorganization.country","parameters":["dataset","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets with PID","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
356
      this.datasetsWithLicenceByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.byorganization.country","parameters":["dataset","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Datasets with licence","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.datasetPalette.join('","')}\"]}}`));
357

    
358
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('dataset', 'pid', this.countryCode).subscribe(
359
        rawData => {
360
          this.datasetsWithPIDByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
361
        }, error => {
362
          console.log(error);
363
        }
364
      );
365

    
366
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('dataset', 'licence', this.countryCode).subscribe(
367
        rawData => {
368
          this.datasetsWithLicenceByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
369
        }, error => {
370
          console.log(error);
371
        }
372
      );
373

    
374
      this.openSciencePubsTabIsInitialised = true;
375
    }
376
  }
377

    
378
  createSoftwareViewForOpenScience() {
379

    
380
    if (!this.openScienceSoftwareTabIsInitialised) {
381

    
382
      this.softwareWithPIDTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.pid_timeline.affiliated.country","parameters":["software","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software with PID","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
383
      this.softwareWithLicenceTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.licence_timeline.affiliated.country","parameters":["software","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software with licence","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
384

    
385
      this.softwareWithPIDByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.bydatasource.country","parameters":["software","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software with PID","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
386
      this.softwareWithLicenceByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.bydatasource.country","parameters":["software","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software with licence","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
387

    
388
      this.softwareWithPIDByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.byorganization.country","parameters":["software","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software with PID","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
389
      this.softwareWithLicenceByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.byorganization.country","parameters":["software","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OS Software with licence","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.softwarePalette.join('","')}\"]}}`));
390

    
391
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('software', 'pid', this.countryCode).subscribe(
392
        rawData => {
393
          this.softwareWithPIDByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
394
        }, error => {
395
          console.log(error);
396
        }
397
      );
398

    
399
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('software', 'licence', this.countryCode).subscribe(
400
        rawData => {
401
          this.softwareWithLicenceByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
402
        }, error => {
403
          console.log(error);
404
        }
405
      );
406

    
407
      this.openScienceSoftwareTabIsInitialised = true;
408
    }
409
  }
410

    
411
  createOtherViewForOpenScience() {
412

    
413
    if (!this.openScienceOtherTabIsInitialised) {
414

    
415
      this.otherWithPIDTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.pid_timeline.affiliated.country","parameters":["other","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products with PID","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
416
      this.otherWithLicenceTimeline = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"name":"new.oso.results.licence_timeline.affiliated.country","parameters":["other","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products with licence","align":"left","margin":50},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
417

    
418
      this.otherWithPIDByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.bydatasource.country","parameters":["other","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products with PID","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
419
      this.otherWithLicenceByDatasourceChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.bydatasource.country","parameters":["other","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products with licence","align":"left","margin":50},"subtitle":{"text":"by datasource","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
420

    
421
      this.otherWithPIDByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.pid.affiliated.byorganization.country","parameters":["other","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products with PID","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
422
      this.otherWithLicenceByOrganizationChartURL = this.sanitizer.bypassSecurityTrustResourceUrl(this.chartsURL + encodeURIComponent(`{"library":"HighCharts","chartDescription":{"queries":[{"name":"publications","type":"bar","query":{"name":"new.oso.results.licence.affiliated.byorganization.country","parameters":["other","${this.countryCode}"],"profile":"${this.profileName}"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"OA Other research products with licence","align":"left","margin":50},"subtitle":{"text":"by organization","align":"left"},"yAxis":{"title":{"text":""}},"xAxis":{"title":{"text":""}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":false},"colors":[\"${this.otherResearchProductsPalette.join('","')}\"]}}`));
423

    
424
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('other', 'pid', this.countryCode).subscribe(
425
        rawData => {
426
          this.otherWithPIDByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
427
        }, error => {
428
          console.log(error);
429
        }
430
      );
431

    
432
      this.dataService.getFundersResultsByTypeForIndicatorForCountry('other', 'licence', this.countryCode).subscribe(
433
        rawData => {
434
          this.otherWithLicenceByFunderData = this.dataHandlerService.convertRawDataToTreemapHighchartsData(rawData);
435
        }, error => {
436
          console.log(error);
437
        }
438
      );
439

    
440
      this.openScienceOtherTabIsInitialised = true;
441
    }
442
  }
443
}
(4-4/4)