Project

General

Profile

1
import {ChartHelper, Indicator, IndicatorPath} from "./entities/stakeholder";
2
import {Validators} from "@angular/forms";
3

    
4
export interface Option {
5
  icon?: string,
6
  iconClass?: string,
7
  value: any,
8
  label: string
9
}
10

    
11
export class IndicatorUtils {
12

    
13
  chartTypes: Option[] = [
14
    {value: 'pie', label: 'Pie'},
15
    {value: 'table', label: 'Table'},
16
    {value: 'line', label: 'Line'},
17
    {value: 'column', label: 'Column'},
18
    {value: 'bar', label: 'Bar'},
19
    {value: 'other', label: 'Other'}
20
  ];
21

    
22
  chartSizes: Option[] = [
23
    {value: 'small', label: 'Small'},
24
    {value: 'medium', label: 'Medium'},
25
    {value: 'large', label: 'Large'}
26
  ];
27

    
28
  isPublic: Option[]  = [
29
    {icon: 'public', value: true, label: 'Public'},
30
    {icon: 'lock', value: false, label: 'Private'},
31
  ];
32

    
33
  isActive: Option[]  = [
34
    {icon: 'brightness_1', iconClass: '', value: true, label: 'Active'},
35
    {icon: 'brightness_1', value: false, label: 'Inactive'},
36
  ];
37

    
38
  chartTypesIcons: Map<string, string> = new Map([
39
    ['pie', 'pie_chart'],
40
    ['table', 'table_chart'],
41
    ['line', 'show_chart'],
42
    ['column', 'bar_chart'],
43
    ['bar', 'bar_chart'],
44
    ['other', 'perm_media']
45
  ]);
46

    
47
  isPublicIcon: Map<boolean, string> = new Map([
48
    [true, 'public'],
49
    [false, 'lock']
50
  ]);
51

    
52
  isActiveIcon: string = 'brightness_1';
53

    
54
  ignoredParameters = ['funder_name'];
55

    
56
  parametersValidators: Map<string, any> = new Map<string, any>([
57
    ['start_year', [Validators.required, Validators.pattern('^\\d+$')]],
58
    ['end_year', [Validators.required, Validators.pattern('^\\d+$')]]
59
  ]);
60

    
61
  public getFullUrl(indicatorPath: IndicatorPath, fundingL0: string = null, startDate: string = null, endDate: string = null): string {
62

    
63
    let replacedUrl = indicatorPath.chartObject;
64
    if (indicatorPath.parameters) {
65
      Object.keys(indicatorPath.parameters).forEach(key => {
66
        let replacedValue = indicatorPath.parameters[key];
67
        if (startDate && key == "start_year" && indicatorPath.filters["start_year"]) {
68
          replacedValue = (replacedValue < startDate) ? startDate : replacedValue;
69
        }
70
        if (endDate && key == "end_year" && indicatorPath.filters["end_year"]) {
71
          replacedValue = (replacedValue > endDate) ? endDate : replacedValue;
72
        }
73
        replacedUrl = replacedUrl.replace(ChartHelper.prefix + key + ChartHelper.suffix, replacedValue);
74
      });
75
    }
76
    if (indicatorPath.chartObject) {
77
      if (fundingL0 && indicatorPath.filters["fundingL0"]) {
78
        let newJsonObject = JSON.parse(replacedUrl);
79
        for (let queries of newJsonObject["chartDescription"]["queries"]) {
80
          if (!queries["query"]["filters"] || queries["query"]["filters"].length == 0) {
81
            queries["query"]["filters"] = [];
82
          }
83
          //TODO check how it works if the query already has a filter
84
          queries["query"]["filters"].push(JSON.parse(indicatorPath.filters["fundingL0"].
85
          replace(ChartHelper.prefix + "fundingL0" + ChartHelper.suffix, fundingL0)));
86
        }
87
        replacedUrl = JSON.stringify(newJsonObject);
88
      }
89
    }
90
    return indicatorPath.url + encodeURIComponent(replacedUrl);
91
  }
92

    
93
  generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[]): Indicator {
94
    let indicator: Indicator = new Indicator(form.name, form.description, 'chart',
95
      form.width, form.isActive, form.isPublic, indicatorPaths);
96
    indicator._id = form.id;
97
    form.indicatorPaths.forEach((indicatorPath, index) => {
98
      indicatorPath.parameters.forEach(parameter => {
99
        indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value;
100
        if(parameter.key === 'type') {
101
          indicator.indicatorPaths[index].type = parameter.value;
102
        }
103
      });
104
    });
105
    return indicator;
106
  }
107

    
108
  generateIndicatorByChartUrl(source: string, url: string, type: string = null): IndicatorPath {
109
    let indicatorPath = new IndicatorPath("", source, "", "", []);
110
    if (source === 'stats-tool') {
111
      indicatorPath.url = url.split("json=")[0] + "json=";
112
      indicatorPath.url = indicatorPath.url.split("/")[indicatorPath.url.split("/").length - 1];
113
      indicatorPath.chartObject = decodeURIComponent(url.split("json=")[1]);
114
      let chart = JSON.parse(indicatorPath.chartObject);
115
      indicatorPath.type = this.extractType(chart, indicatorPath);
116
      this.extractTitle(chart, indicatorPath);
117
      this.extractXTitle(chart, indicatorPath);
118
      this.extractYTitle(chart, indicatorPath);
119
      this.extractFunder(chart, indicatorPath);
120
      this.extractStartYear(chart, indicatorPath);
121
      this.extractEndYear(chart, indicatorPath);
122
      indicatorPath.chartObject = JSON.stringify(chart);
123
      this.addResultFilters(chart, indicatorPath);
124
    } else if (source === 'old') {
125
      indicatorPath.url = url.split("data=")[0].split("/stats/")[1] + "data=";
126
      indicatorPath.chartObject = decodeURIComponent(url.split("data=")[1].split("&")[0]);
127
      let chart = JSON.parse(indicatorPath.chartObject);
128
      this.extractOldToolTitle(chart, indicatorPath);
129
      this.extractOldToolXTitle(chart, indicatorPath);
130
      this.extractOldToolYTitle(chart, indicatorPath);
131
      indicatorPath.chartObject = JSON.stringify(chart);
132
    } else {
133
      indicatorPath.url = url;
134
      indicatorPath.type = type;
135
    }
136
    return indicatorPath;
137
  }
138

    
139
  private extractType(obj, indicatorPath: IndicatorPath): string {
140
    let defaultTypes = ["column", "bar", "pie"];
141
    let type = obj["chartDescription"]["queries"][0]["type"];
142
    if (defaultTypes.indexOf(type) == -1) {
143
      type = defaultTypes [0];
144
    } else {
145
      obj["chartDescription"]["queries"][0]["type"] = ChartHelper.prefix + "type" + ChartHelper.suffix;
146
      indicatorPath.parameters['type'] = type;
147
    }
148
    return type;
149
  }
150

    
151
  private extractFunder(obj, indicatorPath: IndicatorPath) {
152
    let funderName;
153
    for (let query of obj["chartDescription"]["queries"]) {
154
      if (!query["query"]["filters"]) {
155
        return;
156
      }
157
      for (let filter of query["query"]["filters"]) {
158
        if (filter["groupFilters"][0]["field"].indexOf(".funder") != -1) {
159
          funderName = filter["groupFilters"][0]["values"][0];
160
          filter["groupFilters"][0]["values"][0] = ChartHelper.prefix + "funder_name" + ChartHelper.suffix;
161
          indicatorPath.parameters["funder_name"]  = funderName;
162
        }
163
      }
164
    }
165
  }
166

    
167
  private extractStartYear(obj, indicatorPath: IndicatorPath) {
168
    let start_year;
169
    for (let query of obj["chartDescription"]["queries"]) {
170
      if (!query["query"]["filters"]) {
171
        return;
172
      }
173
      for (let filter of query["query"]["filters"]) {
174
        for (let gfilter of filter["groupFilters"]) {
175
          if (gfilter["field"].indexOf(".year") != -1 && gfilter["type"].indexOf(">") != -1) {
176
            start_year = gfilter["values"][0];
177
            gfilter["values"][0] = ChartHelper.prefix + "start_year" + ChartHelper.suffix;
178
            indicatorPath.parameters["start_year"] =  start_year;
179
          }
180
        }
181
      }
182
    }
183
  }
184

    
185
  private extractEndYear(obj, indicatorPath: IndicatorPath) {
186
    let end_year;
187
    for (let query of obj["chartDescription"]["queries"]) {
188
      if (!query["query"]["filters"]) {
189
        return;
190
      }
191
      for (let filter of query["query"]["filters"]) {
192
        for (let gfilter of filter["groupFilters"]) {
193
          if (gfilter["field"].indexOf(".year") != -1 && gfilter["type"].indexOf("<") != -1) {
194
            end_year = gfilter["values"][0];
195
            gfilter["values"][0] = ChartHelper.prefix + "end_year" + ChartHelper.suffix;
196
            indicatorPath.parameters["end_year"] =  end_year;
197
          }
198
        }
199
      }
200
    }
201
  }
202

    
203
  private extractTitle(obj, indicatorPath: IndicatorPath) {
204
    let title = "";
205
    if (obj["chartDescription"]["title"]) {
206
      title = obj["chartDescription"]["title"]["text"];
207
      obj["chartDescription"]["title"]["text"] = ChartHelper.prefix + "title" + ChartHelper.suffix;
208
      indicatorPath.parameters["title"] =  title;
209

    
210
    }
211
  }
212

    
213
  private extractXTitle(obj, indicatorPath: IndicatorPath) {
214
    let title = "";
215
    if (obj["chartDescription"]["xAxis"]["title"]) {
216
      title = obj["chartDescription"]["xAxis"]["title"]["text"];
217
      obj["chartDescription"]["xAxis"]["title"]["text"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
218
      indicatorPath.parameters["xAxisTitle"] = title;
219
    }
220
  }
221

    
222
  private extractYTitle(obj, indicatorPath: IndicatorPath) {
223
    let title = "";
224
    if (obj["chartDescription"]["yAxis"]["title"]) {
225
      title = obj["chartDescription"]["yAxis"]["title"]["text"];
226
      obj["chartDescription"]["yAxis"]["title"]["text"] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
227
      indicatorPath.parameters["yAxisTitle"] = title;
228
    }
229
  }
230

    
231
  private addResultFilters(obj, indicatorPath: IndicatorPath) {
232
    let resultTypes = ["publication", "software", "dataset", "other"];
233
    let index = -1;
234
    for (let query of obj["chartDescription"]["queries"]) {
235
      if (!query["query"]["select"]) {
236
        return;
237
      }
238
      for (let select of query["query"]["select"]) {
239
        for (var i = 0; i < resultTypes.length; i++) {
240
          if (select.field.startsWith(resultTypes[i])) {
241
            index = i;
242
          }
243
        }
244
      }
245

    
246
    }
247
    if (index != -1) {
248
      indicatorPath.filters = IndicatorPath.createResultFilters(resultTypes[index]);
249
    }
250
  }
251

    
252

    
253
  private extractOldToolTitle(obj, indicatorPath: IndicatorPath) {
254
    let title = "";
255
    if (obj["title"]) {
256
      title = obj["title"];
257
      obj["title"] = ChartHelper.prefix + "title" + ChartHelper.suffix;
258
      indicatorPath.parameters["title"] = title;
259

    
260
    }
261
  }
262

    
263
  private extractOldToolXTitle(obj, indicatorPath: IndicatorPath) {
264
    let title = "";
265
    if (obj["xaxistitle"]) {
266
      title = obj["xaxistitle"];
267
      obj["xaxistitle"] = ChartHelper.prefix + "xAxisTitle" + ChartHelper.suffix;
268
      indicatorPath.parameters["xAxisTitle"] = title;
269
    }
270
  }
271

    
272
  private extractOldToolYTitle(obj, indicatorPath: IndicatorPath) {
273
    let title = "";
274
    if (obj["fieldsheaders"]) {
275
      title = obj["fieldsheaders"];
276
      obj["fieldsheaders"] = ChartHelper.prefix + "yAxisTitle" + ChartHelper.suffix;
277
      indicatorPath.parameters["yAxisTitle"] = title;
278
    }
279
  }
280

    
281
}
282

    
283
/*
284
custom query
285
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%22Publications%22%2C%22type%22%3A%22bar%22%2C%22query%22%3A%7B%22name%22%3A%22monitor.ec.publications.datasources%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%22Publication%20content%20provider%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22Publications%22%7D%7D%2C%22xAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22Content%20provider%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
286

    
287
query with year filters:
288
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%22Publications%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22select%22%3A%5B%7B%22field%22%3A%22publication%22%2C%22aggregate%22%3A%22count%22%7D%2C%7B%22field%22%3A%22publication.year%22%2C%22aggregate%22%3Anull%7D%5D%2C%22filters%22%3A%5B%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22publication.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%22publication.year%22%2C%22type%22%3A%22%3E%3D%22%2C%22values%22%3A%5B%222008%22%5D%7D%2C%7B%22field%22%3A%22publication.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%22publication%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%22Publications%20timeline%22%7D%2C%22subtitle%22%3A%7B%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22Publications%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
289

    
290
double query
291
http://88.197.53.71:8080/stats-api/chart?json=%7B%22library%22%3A%22HighCharts%22%2C%22chartDescription%22%3A%7B%22colors%22%3A%5B%22%2342a5f5%22%2C%22%2326a69a%22%2C%22%2390ed7d%22%2C%22%23607d8b%22%2C%22%2300838f%22%2C%22%23689f38%22%2C%22%23e4d354%22%2C%22%232b908f%22%2C%22%23546e7a%22%2C%22%2301579%22%5D%2C%22queries%22%3A%5B%7B%22name%22%3A%22Gold%22%2C%22color%22%3A%22%23f8b500%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22select%22%3A%5B%7B%22field%22%3A%22result%22%2C%22aggregate%22%3A%22count%22%7D%2C%7B%22field%22%3A%22result.year%22%2C%22aggregate%22%3Anull%7D%5D%2C%22filters%22%3A%5B%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22result.project.funder%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22European%20Commission%22%5D%7D%2C%7B%22field%22%3A%22result.project.funding%20level%200%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22H2020%22%5D%7D%2C%7B%22field%22%3A%22result.type%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22publication%22%5D%7D%2C%7B%22field%22%3A%22result.year%22%2C%22type%22%3A%22%3E%3D%22%2C%22values%22%3A%5B%222014%22%5D%7D%2C%7B%22field%22%3A%22result.year%22%2C%22type%22%3A%22%3C%3D%22%2C%22values%22%3A%5B%222019%22%5D%7D%2C%7B%22field%22%3A%22result.access%20mode%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22Open%20Access%22%5D%7D%5D%2C%22op%22%3A%22AND%22%7D%2C%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22result.datasource.type%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22Journal%22%5D%7D%2C%7B%22field%22%3A%22result.datasource.type%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22Journal%20Aggregator%2FPublisher%22%5D%7D%5D%2C%22op%22%3A%22OR%22%7D%5D%2C%22entity%22%3A%22result%22%2C%22profile%22%3A%22OpenAIRE%20original%22%2C%22limit%22%3A%220%22%7D%7D%2C%7B%22name%22%3A%22Green%22%2C%22color%22%3A%22%23239d60%22%2C%22type%22%3A%22column%22%2C%22query%22%3A%7B%22select%22%3A%5B%7B%22field%22%3A%22result%22%2C%22aggregate%22%3A%22count%22%7D%2C%7B%22field%22%3A%22result.year%22%2C%22aggregate%22%3Anull%7D%5D%2C%22filters%22%3A%5B%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22result.project.funder%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22European%20Commission%22%5D%7D%2C%7B%22field%22%3A%22result.project.funding%20level%200%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22H2020%22%5D%7D%2C%7B%22field%22%3A%22result.type%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22publication%22%5D%7D%2C%7B%22field%22%3A%22result.year%22%2C%22type%22%3A%22%3E%3D%22%2C%22values%22%3A%5B%222014%22%5D%7D%2C%7B%22field%22%3A%22result.year%22%2C%22type%22%3A%22%3C%3D%22%2C%22values%22%3A%5B%222019%22%5D%7D%2C%7B%22field%22%3A%22result.access%20mode%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22Open%20Access%22%5D%7D%5D%2C%22op%22%3A%22AND%22%7D%2C%7B%22groupFilters%22%3A%5B%7B%22field%22%3A%22result.datasource.type%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22Institutional%20Repository%22%5D%7D%2C%7B%22field%22%3A%22result.datasource.type%22%2C%22type%22%3A%22%3D%22%2C%22values%22%3A%5B%22Thematic%20Repository%22%5D%7D%5D%2C%22op%22%3A%22OR%22%7D%5D%2C%22entity%22%3A%22result%22%2C%22profile%22%3A%22OpenAIRE%20original%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%22H2020%20green%20and%20gold%20publications%22%7D%2C%22subtitle%22%3A%7B%22text%22%3A%22over%20time%22%7D%2C%22yAxis%22%3A%7B%22title%22%3A%7B%22text%22%3A%22Publications%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%3Afalse%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
292

    
293

    
294
//old tool
295
https://www.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%
296
 */
(1-1/2)