<commit_before>import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { IRelease } from 'app/models/irelease';

@Component({
  selector: 'app-traffic-views',
  templateUrl: './views.component.html',
})
export class ViewsComponent implements OnInit {

  @Input()
  public set data(ds: IView[]) {
    if (ds) {
      const labels = [];
      const count = [];
      const unique = [];
      ds.forEach((e) => {
        labels.push(new Date(e.timestamp).toDateString());
        count.push(e.count);
        unique.push(e.uniques);
      });
      this.barChartLabels = [...labels];
      this.barChartData = [
        { data: [...count], label: 'Count' },
        { data: [...unique], label: 'Uniques' }
      ]
    }
  };
  @Input()
  public count;
  @Input()
  public uniques;

  public barChartOptions: any = {
    scaleShowVerticalLines: false,
    responsive: true
  };
  public barChartLabels: string[];
  public barChartType = 'bar';
  public barChartLegend = false;

  public barChartData: any[];

  constructor() {
  }
  ngOnInit() {

  }


}

interface IView {
  timestamp: string, count: number, uniques: number
}<commit_msg>removed year from label<commit_after>import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { IRelease } from 'app/models/irelease';

@Component({
  selector: 'app-traffic-views',
  templateUrl: './views.component.html',
})
export class ViewsComponent implements OnInit {

  @Input()
  public set data(ds: IView[]) {
    if (ds) {
      const labels = [];
      const count = [];
      const unique = [];
      ds.forEach((e) => {
        labels.push(new Date(e.timestamp).toDateString().split(/ \d{4}/)[0]);
        count.push(e.count);
        unique.push(e.uniques);
      });
      this.barChartLabels = [...labels];
      this.barChartData = [
        { data: [...count], label: 'Count' },
        { data: [...unique], label: 'Uniques' }
      ]
    }
  };
  @Input()
  public count;
  @Input()
  public uniques;

  public barChartOptions: any = {
    scaleShowVerticalLines: false,
    responsive: true
  };
  public barChartLabels: string[];
  public barChartType = 'bar';
  public barChartLegend = false;

  public barChartData: any[];

  constructor() {
  }
  ngOnInit() {

  }
}

interface IView {
  timestamp: string, count: number, uniques: number
}
{'fraction_non_alphanumeric': 0.15547415547415547, 'fraction_numerical': 0.000814000814000814, 'mean_word_length': 2.9077901430842608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4613555', 'n_tokens_mistral': 782, 'n_tokens_neox': 774, 'n_words': 182}