<commit_before>import { Component, Input } from '@angular/core';
import { Observable } from 'rxjs';

@Component({
  selector: 'app-console-output-tile',
  templateUrl: './console-output-tile.component.html',
  styleUrls: ['./console-output-tile.component.scss']
})
export class ConsoleOutputTileComponent {
  @Input() logs:Observable<string>;

  constructor() {}
}<commit_msg>added autoscroll to console tile<commit_after>import { Component, Input, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { Observable, Subscription } from 'rxjs';

@Component({
  selector: 'app-console-output-tile',
  templateUrl: './console-output-tile.component.html',
  styleUrls: ['./console-output-tile.component.scss']
})
export class ConsoleOutputTileComponent {
  @Input() logs:Observable<string>;
  private sub:Subscription;

  constructor(private element:ElementRef) {}

  ngOnInit() {
    // handle auto scroll behavior (delay is necessary to synchronize better with log display in view)
    this.sub = this.logs
      .delay(0)
      .subscribe(() => {
        this.element.nativeElement.children[1].scrollTop = this.element.nativeElement.children[1].scrollHeight;
      });
  }

  ngOnDestroy() {
    this.sub.unsubscribe();
  }
}
{'fraction_non_alphanumeric': 0.1444805194805195, 'fraction_numerical': 0.002435064935064935, 'mean_word_length': 4.45575221238938, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '2564990', 'n_tokens_mistral': 366, 'n_tokens_neox': 363, 'n_words': 79}