Project

General

Profile

1
import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewRef} from '@angular/core';
2
import {ActivatedRoute, Params, Router} from '@angular/router';
3
import {DomSanitizer, Meta, Title} from '@angular/platform-browser';
4
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
5

    
6
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
7
import {Dates, StringUtils} from '../openaireLibrary/utils/string-utils.class';
8
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
9
import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component';
10
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
11
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
12
import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service";
13
import {
14
  Category, Indicator,
15
  IndicatorPath, IndicatorSize,
16
  Stakeholder,
17
  SubCategory,
18
  Topic,
19
  Visibility
20
} from "../openaireLibrary/monitor/entities/stakeholder";
21
import {StatisticsService} from "../utils/services/statistics.service";
22
import {IndicatorUtils, StakeholderUtils} from "../utils/indicator-utils";
23
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
24
import {FormBuilder, FormControl} from "@angular/forms";
25
import {Subscriber, Subscription} from "rxjs";
26
import {User} from "../openaireLibrary/login/utils/helper.class";
27
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
28
import {RangeFilter} from "../openaireLibrary/utils/rangeFilter/rangeFilterHelperClasses.class";
29
import {Filter} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class";
30
import {Location} from "@angular/common";
31
import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class";
32
import {properties} from "../../environments/environment";
33
import {IndexInfoService} from "../openaireLibrary/utils/indexInfo.service";
34
import {ConfigurationService} from "../openaireLibrary/utils/configuration/configuration.service";
35

    
36
@Component({
37
  selector: 'monitor',
38
  templateUrl: 'monitor.component.html',
39
  styleUrls: ['monitor.component.css']
40
})
41
export class MonitorComponent implements OnInit, OnDestroy {
42
  public user: User;
43
  public subscriptions: any[] = [];
44
  piwikSiteId;
45
  title;
46
  description;
47
  public pageContents = null;
48
  public divContents = null;
49
  public status: number;
50
  public loading: boolean = true;
51
  public isViewPublic: boolean = false;
52
  public indicatorUtils: IndicatorUtils = new IndicatorUtils();
53
  public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
54
  public activeTopic: Topic = null;
55
  public activeCategory: Category = null;
56
  public activeSubCategory: SubCategory = null;
57
  public errorCodes: ErrorCodes;
58
  public stakeholder: Stakeholder;
59
  public numberResults: Map<string, number> = new Map<string, number>();
60
  public chartsActiveType: Map<string, IndicatorPath> = new Map<string, IndicatorPath>();
61
  private errorMessages: ErrorMessagesComponent;
62
  properties: EnvProperties = properties;
63
  filterToggle = false;
64
  public routerHelper: RouterHelper = new RouterHelper();
65
  filters: Filter[] = [];
66
  queryParams = {};
67
  public currentYear = new Date().getFullYear();
68
  periodFilter: RangeFilter = {
69
    title: "Time range",
70
    filterId: "year",
71
    originalFilterIdFrom: null,
72
    originalFilterIdTo: null,
73
    selectedFromValue: null,
74
    selectedToValue: null,
75
    selectedFromAndToValues: ""
76
  };
77
  privateStakeholder = false;
78
  public keyword: FormControl;
79
  public statsUpdateDate: Date;
80
  constructor(
81
    private route: ActivatedRoute,
82
    private _router: Router,
83
    private _meta: Meta,
84
    private _title: Title,
85
    private _piwikService: PiwikService,
86
    private helper: HelperService,
87
    private stakeholderService: StakeholderService,
88
    private userManagementService: UserManagementService,
89
    private statisticsService: StatisticsService,
90
    private layoutService: LayoutService,
91
    private seoService: SEOService,
92
    private cdr: ChangeDetectorRef,
93
    private indexInfoService: IndexInfoService,
94
    private sanitizer: DomSanitizer, private _fb: FormBuilder, private router: Router,
95
    private configurationService: ConfigurationService) {
96
    this.errorCodes = new ErrorCodes();
97
    this.errorMessages = new ErrorMessagesComponent();
98
    this.status = this.errorCodes.LOADING;
99
  }
100
  
101
  public ngOnInit() {
102
    if (typeof document !== 'undefined') {
103
      this.subscriptions.push(this.indexInfoService.getStatsLastDate(this.properties).subscribe(lastIndexUpdate => {
104
        if (lastIndexUpdate) {
105
          this.statsUpdateDate = new Date(lastIndexUpdate);
106
        }
107
      }));
108
    }
109
    this.keyword = this._fb.control('');
110
    this.subscriptions.push(this.keyword.valueChanges.subscribe(value => {
111
      console.log("Keyword Changed!");
112
      //TODO do a real action
113
    }));
114
    let subscription: Subscription;
115
    this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
116
      this.user = user;
117
      
118
      this.subscriptions.push(this.route.params.subscribe(params => {
119
        this.loading = true;
120
        this.activeTopic = null;
121
        this.activeCategory = null;
122
        this.activeSubCategory = null;
123
        this.filterToggle = false;
124
        if (subscription) {
125
          subscription.unsubscribe();
126
        }
127
        var url = properties.domain + properties.baseLink + this._router.url;
128
        this.subscriptions.push(this.route.queryParams.subscribe(params => {
129
          this.queryParams = Object.assign({}, params);
130
          this.isViewPublic = (params['view'] == 'public');
131
        }));
132
        if (!this.stakeholder || this.stakeholder.alias !== params['stakeholder']) {
133
          this.status = this.errorCodes.LOADING;
134
          this.numberResults = new Map<string, number>();
135
          this.chartsActiveType = new Map<string, IndicatorPath>();
136
          subscription = this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
137
            if (stakeholder) {
138
              this.stakeholder = stakeholder;
139
              // add fl0 filter only for EC
140
              if (this.stakeholder.index_id == "ec__________::EC") {
141
                this.filters.push({
142
                  title: "Funding Stream",
143
                  filterId: "relfundinglevel0_id",
144
                  originalFilterId: "relfundinglevel0_id",
145
                  countSelectedValues: 0,
146
                  values: [{name: "EC|FP7", id: "ec__________::EC::FP7", selected: false, number: 0}, {
147
                    name: "EC|H2020",
148
                    id: "ec__________::EC::H2020",
149
                    selected: false,
150
                    number: 0
151
                  }]
152
                  ,
153
                  filterOperator: "or",
154
                  valueIsExact: true,
155
                  filterType: "radio",
156
                  radioValue: ""
157
                });
158
              }
159
              if (this.stakeholder.type == "funder") {
160
                // this.filters.push({title: "Co-funded research outcomes",filterId: "co-funded",originalFilterId: "co-funded", countSelectedValues: 0,
161
                //   values:[{name: "true", id: "co-funded", selected:  false, number: 0}, {name: "false", id: "no-co-funded", selected:  false, number: 0}]
162
                //   ,filterOperator: "or", valueIsExact: true, filterType: "radio", radioValue:""});
163
                this.filters.push({
164
                  title: "Co-funded", filterId: "co-funded", originalFilterId: "co-funded", countSelectedValues: 0,
165
                  values: [{name: "Co-funded research output", id: "co-funded-results", selected: false, number: 0}]
166
                  , filterOperator: "or", valueIsExact: true, filterType: "checkbox", radioValue: ""
167
                });
168
              }
169
              this.initializeFilters();
170
              this.seoService.createLinkForCanonicalURL(url, false);
171
              this._meta.updateTag({content: url}, "property='og:url'");
172
              this.description = "Monitor Dashboard | " + this.stakeholder.name;
173
              this.title =  "Monitor Dashboard | " + this.stakeholder.name;
174
              this._meta.updateTag({content: this.description}, "name='description'");
175
              this._meta.updateTag({content: this.description}, "property='og:description'");
176
              this._meta.updateTag({content: this.title}, "property='og:title'");
177
              this._title.setTitle(this.title);
178
              if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
179
                this.subscriptions.push(this.configurationService.communityInformationState.subscribe(portal => {
180
                  if (portal && portal.piwik) {
181
                    console.debug(portal)
182
                    this.piwikSiteId = portal.piwik;
183
                    console.debug(this.piwikSiteId)
184
                    this.subscriptions.push(this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe());
185
                  }
186
                }));
187

    
188
              }
189
              if (this.isPublicOrIsMember(stakeholder.visibility)) {
190
                //this.getDivContents();
191
                // this.getPageContents();
192
                this.status = this.errorCodes.DONE;
193
                this.setView(params);
194
              } else {
195
                this.privateStakeholder = true;
196
                // this.navigateToError();
197
                if (subscription) {
198
                  subscription.unsubscribe();
199
                }
200
              }
201
            }else{
202
              this.navigateToError();
203
              if (subscription) {
204
                subscription.unsubscribe();
205
              }
206
            }
207
          });
208
          this.subscriptions.push(subscription);
209
        } else {
210
          if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
211
            if (this.piwikSiteId) {
212
              console.debug(this.piwikSiteId)
213
              this.subscriptions.push(this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe());
214
            }
215
          }
216
          this.initializeFilters();
217
          this.setView(params);
218
        }
219
      }));
220
    }));
221
    
222
  }
223
  
224
  private initializeFilters() {
225
    this.periodFilter.selectedFromValue = (this.queryParams['year'] && this.queryParams['year'].indexOf("range") == 0) ? this.queryParams['year'].split("range")[1].split(":")[0] : "";
226
    this.periodFilter.selectedToValue = (this.queryParams['year'] && this.queryParams['year'].indexOf("range") == 0) ? this.queryParams['year'].split("range")[1].split(":")[1] : "";
227
    this.validateYearRange(false);
228
    
229
    for (let filter of this.filters) {
230
      if (this.queryParams[filter.filterId]) {
231
        for (let value of filter.values) {
232
          if (value.id == StringUtils.URIDecode(StringUtils.unquote(this.queryParams[filter.filterId]))) {
233
            value.selected = true;
234
            filter.countSelectedValues = 1;
235
            break;
236
          }
237
        }
238
      } else {
239
        this.clearfFilter(filter);
240
      }
241
    }
242
    
243
  }
244
  
245
  private validateYearRange(navigateTo: boolean = false) {
246
    let validYears = true;
247
    
248
    if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, Dates.currentYear - 20, Dates.currentYear))) {
249
      this.periodFilter.selectedToValue = Dates.currentYear + "";
250
      validYears = false;
251
    }
252
    if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, Dates.currentYear - 20, Dates.currentYear))) {
253
      this.periodFilter.selectedFromValue = Dates.currentYear - 20 + "";
254
      validYears = false;
255
    }
256
    if (this.periodFilter.selectedFromValue && this.periodFilter.selectedFromValue.length && this.periodFilter.selectedToValue && this.periodFilter.selectedToValue.length > 0 && parseInt(this.periodFilter.selectedFromValue, 10) > parseInt(this.periodFilter.selectedToValue, 10)) {
257
      this.periodFilter.selectedFromValue = this.periodFilter.selectedToValue;
258
      validYears = false;
259
    }
260
    if (!validYears || navigateTo) {
261
      if (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue) {
262
        this.queryParams["year"] = 'range' + (this.periodFilter.selectedFromValue ? this.periodFilter.selectedFromValue : '') + ":" + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : "");
263
      } else {
264
        delete this.queryParams["year"];
265
      }
266
      // this.location.go(location.pathname, this.routerHelper.createQueryParamsString( Object.keys(this.queryParams), Object.values(this.queryParams)));
267
      this.router.navigate([], {queryParams: this.queryParams});
268
      this.setIndicators();
269
    }
270
  }
271
  
272
  clearAll() {
273
    for (let filter of this.filters) {
274
      this.clearfFilter(filter);
275
    }
276
    this.periodFilter.selectedFromValue = "";
277
    this.periodFilter.selectedToValue = "";
278
    this.validateYearRange(true)
279
  }
280
  
281
  clearfFilter(filter: Filter) {
282
    filter.countSelectedValues = 0;
283
    filter.radioValue = "";
284
    for (let value of filter.values) {
285
      if (value.selected) {
286
        value.selected = false;
287
      }
288
    }
289
    if (this.queryParams[filter.filterId]) {
290
      delete this.queryParams[filter.filterId];
291
    }
292
  }
293
  
294
  countSelectedFilters(): number {
295
    let count = 0;
296
    if (this.periodFilter.selectedFromAndToValues.length > 0) {
297
      count += 2;
298
    }
299
    for (let filter of this.filters) {
300
      count += filter.countSelectedValues;
301
    }
302
    return count;
303
  }
304
  
305
  public get isSmallScreen() {
306
    return this.layoutService.isSmallScreen;
307
  }
308
  
309
  public get open() {
310
    return this.layoutService.open;
311
  }
312
  
313
  private getPageContents() {
314
    this.subscriptions.push(this.helper.getPageHelpContents(this.properties, this.properties.adminToolsCommunity, this._router.url).subscribe(contents => {
315
      this.pageContents = contents;
316
    }));
317
  }
318
  
319
  private getDivContents() {
320
    this.subscriptions.push(this.helper.getDivHelpContents(this.properties, this.properties.adminToolsCommunity, this._router.url).subscribe(contents => {
321
      this.divContents = contents;
322
    }));
323
  }
324
  
325
  private setView(params: Params) {
326
    this.loading = false;
327
    if (params['topic']) {
328
      this.activeTopic = this.stakeholder.topics.find(topic => topic.alias === decodeURIComponent(params['topic']) && this.isPublicOrIsMember(topic.visibility));
329
      if (this.activeTopic) {
330
        if (params['category']) {
331
          this.activeCategory = this.activeTopic.categories.find(category =>
332
            (category.alias === params['category']) && this.isPublicOrIsMember(category.visibility));
333
          if (!this.activeCategory) {
334
            this.navigateToError();
335
            return;
336
          }
337
        } else {
338
          this.activeCategory = this.activeTopic.categories.find(category => this.isPublicOrIsMember(category.visibility));
339
          if (this.activeCategory) {
340
            this.activeSubCategory = this.activeCategory.subCategories.find(subCategory =>
341
              this.isPublicOrIsMember(subCategory.visibility));
342
            if (this.activeSubCategory) {
343
              this.setIndicators();
344
            }
345
          }
346
          return;
347
        }
348
        if (this.activeCategory) {
349
          if (params['subCategory']) {
350
            this.activeSubCategory = this.activeCategory.subCategories.find(subCategory =>
351
              (subCategory.alias === params['subCategory'] && this.isPublicOrIsMember(subCategory.visibility)));
352
            if (!this.activeSubCategory) {
353
              this.navigateToError();
354
              return;
355
            }
356
          } else {
357
            this.activeSubCategory = this.activeCategory.subCategories.find(subCategory =>
358
              this.isPublicOrIsMember(subCategory.visibility));
359
          }
360
          if (this.activeSubCategory) {
361
            this.setIndicators();
362
          } else {
363
            this.navigateToError();
364
          }
365
          return;
366
        } else {
367
          this.activeSubCategory = null;
368
        }
369
      } else {
370
        this.navigateToError();
371
        return;
372
      }
373
    } else {
374
      this.activeTopic = this.stakeholder.topics.find(topic => this.isPublicOrIsMember(topic.visibility));
375
      if (this.activeTopic) {
376
        this.activeCategory = this.activeTopic.categories.find(category => this.isPublicOrIsMember(category.visibility));
377
        if (this.activeCategory) {
378
          this.activeSubCategory = this.activeCategory.subCategories.find(subCategory => this.isPublicOrIsMember(subCategory.visibility));
379
          if (this.activeSubCategory) {
380
            this.setIndicators();
381
          }
382
        }
383
      }
384
    }
385
  }
386
  
387
  filter() {
388
    this.validateYearRange(true);
389
  }
390
  
391
  filterChanged($event, navigate: boolean = true) {
392
    let selected = "";
393
    for (let value of $event.value.values) {
394
      if (value.selected) {
395
        selected = value.id;
396
        break;
397
      }
398
    }
399
    if (selected) {
400
      this.queryParams[$event.value.filterId] = StringUtils.quote(StringUtils.URIEncode(selected));
401
    } else {
402
      delete this.queryParams[$event.value.filterId];
403
    }
404
    if (navigate) {
405
      this.router.navigate([], {queryParams: this.queryParams});
406
      this.setIndicators();
407
    }
408
    
409
  }
410
  
411
  private getfl0() {
412
    if (this.queryParams["relfundinglevel0_id"] && this.filters.length > 0) {
413
      let value = StringUtils.URIDecode(StringUtils.unquote(this.queryParams["relfundinglevel0_id"] ));
414
      return value.split("::")[value.split("::").length - 1];
415
    }
416
    return null;
417
  }
418
  
419
  private getCoFunded() {
420
    if (this.queryParams["co-funded"] && this.filters.length > 0) {
421
      return this.queryParams["co-funded"] && this.queryParams["co-funded"] == "co-funded-results";
422
    }
423
    return false;
424
  }
425
  
426
  clearPeriodFilter() {
427
    if (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue) {
428
      this.periodFilter.selectedFromValue = "";
429
      this.periodFilter.selectedToValue = "";
430
      this.filter();
431
    }
432
    
433
  }
434
  
435
  private setIndicators() {
436
    this.periodFilter.selectedFromAndToValues = (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue ? ((this.periodFilter.selectedFromValue && !this.periodFilter.selectedToValue ? "From " : "") + (!this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? "Until " : "") + (this.periodFilter.selectedFromValue ? this.periodFilter.selectedFromValue : "") +
437
      (this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? " - " : "") + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : "")) : "");
438
    //clear numbers when filters change
439
    this.numberResults.clear();
440
    let urls: Map<string, [number, number][]> = new Map<string, [number, number][]>();
441
    this.activeSubCategory.numbers.forEach((section, i) => {
442
      section.indicators.forEach((number, j) => {
443
        if (this.isPublicOrIsMember(number.visibility)) {
444
          let url = this.indicatorUtils.getFullUrlWithFilters(this.stakeholder, number.indicatorPaths[0], this.getfl0(), this.periodFilter.selectedFromValue, this.periodFilter.selectedToValue, this.getCoFunded());
445
          const pair = JSON.stringify([number.indicatorPaths[0].source, url]);
446
          const indexes = urls.get(pair) ? urls.get(pair) : [];
447
          indexes.push([i, j]);
448
          urls.set(pair, indexes);
449
        }
450
      });
451
    });
452
    urls.forEach((indexes, pair) => {
453
      pair = JSON.parse(pair);
454
      this.subscriptions.push(this.statisticsService.getNumbers(this.statisticsService.getSourceType(pair[0]), pair[1]).subscribe(response => {
455
        indexes.forEach(([i, j]) => {
456
          let result = JSON.parse(JSON.stringify(response));
457
          this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => {
458
            if (result) {
459
              result = result[jsonPath];
460
            }
461
          });
462
          if (typeof result === 'string' || typeof result === 'number') {
463
            result = Number(result);
464
            if (result === Number.NaN) {
465
              result = 0;
466
            }
467
          } else {
468
            result = 0;
469
          }
470
          this.numberResults.set(i + '-' + j, result);
471
        });
472
      }));
473
    });
474
    this.activeSubCategory.charts.forEach((section, i) => {
475
      section.indicators.forEach((indicator, j) => {
476
        if (indicator.indicatorPaths.length > 0) {
477
          indicator.indicatorPaths[0].safeResourceUrl = this.getUrlByStakeHolder(indicator.indicatorPaths[0]);
478
          this.chartsActiveType.set(i + '-' + j, indicator.indicatorPaths[0]);
479
        }
480
      });
481
    });
482
    if (this.cdr && !(this.cdr as ViewRef).destroyed) {
483
      this.cdr.detectChanges();
484
    }
485
  }
486
  
487
  public getUrlByStakeHolder(indicatorPath: IndicatorPath) {
488
    return this.sanitizer.bypassSecurityTrustResourceUrl(
489
      this.statisticsService.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrlWithFilters(this.stakeholder, indicatorPath, this.getfl0(), this.periodFilter.selectedFromValue, this.periodFilter.selectedToValue, this.getCoFunded())));
490
  }
491
  
492
  public setActiveChart(i: number, j: number, type: string) {
493
    let activeChart = this.activeSubCategory.charts[i].indicators[j].indicatorPaths.filter(indicatorPath => indicatorPath.type === type)[0];
494
    activeChart.safeResourceUrl = this.getUrlByStakeHolder(activeChart);
495
    this.chartsActiveType.set(i + '-' + j, activeChart);
496
  }
497
  
498
  private navigateToError() {
499
    this._router.navigate(['/error'], {queryParams: {'page': this._router.url}});
500
  }
501
  
502
  public navigateTo(stakeholder: string, topic: string, category: string = null, subcategory: string = null) {
503
    let url = stakeholder + '/' + topic + ((category) ? ('/'
504
      + category) : '') + ((subcategory) ? ('/' + subcategory) : '');
505
    return this._router.navigate([url], {queryParams: this.queryParams});
506
  }
507
  
508
  public quote(param: string): string {
509
    return StringUtils.quote(param);
510
  }
511
  
512
  public ngOnDestroy() {
513
    this.subscriptions.forEach(subscription => {
514
      if (subscription instanceof Subscriber) {
515
        subscription.unsubscribe();
516
      }
517
    });
518
  }
519
  
520
  public isPublicOrIsMember(visibility: Visibility): boolean {
521
    if (visibility == "PRIVATE" || (this.isViewPublic && visibility != "PUBLIC")) {
522
      return false;
523
    }
524
    return true;
525
  }
526
  
527
  public countSubCategoriesToShow(category: Category): number {
528
    let counter = 0;
529
    for (let sub of category.subCategories) {
530
      if (this.isPublicOrIsMember(sub.visibility)) {
531
        counter++;
532
      }
533
    }
534
    return counter;
535
  }
536
  
537
  public countIndicatorsToShow(indicators: Indicator[]): number {
538
    let counter = 0;
539
    for (let i of indicators) {
540
      if (this.isPublicOrIsMember(i.visibility)) {
541
        counter++;
542
      }
543
    }
544
    return counter;
545
  }
546
  
547
  /*
548
  Feedback mail
549
   */
550
  public get mailText() {
551
    return "mailto:" + this.properties.feedbackmail + "?subject=%5BOpenAIRE%20Monitor%5D%20" + (this.stakeholder ? this.stakeholder.name : "") + "%20dashboard%20feedback"
552
  }
553
  
554
  mailMe() {
555
    window.location.href = this.mailText;
556
  }
557
  
558
  public getNumberClassBySize(size: IndicatorSize) {
559
    if(size === 'small') {
560
      return 'uk-width-1-4@xl uk-width-1-3@l uk-width-1-2@m uk-width-1-1';
561
    } else if(size === 'medium') {
562
      return 'uk-width-1-3@l uk-width-1-2@m uk-width-1-1';
563
    } else {
564
      return 'uk-width-1-2@l uk-width-1-1@m uk-width-1-1';
565
    }
566
  }
567
  
568
  public getChartClassBySize(size: IndicatorSize) {
569
    if(size === 'small') {
570
      return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1';
571
    } else if(size === 'medium') {
572
      return 'uk-width-1-2@l uk-width-1-1';
573
    } else {
574
      return 'uk-width-1-1';
575
    }
576
  }
577
}
(4-4/5)