<commit_before>import FileResource from "../../../../../shared/resources/fileresource";
import SessionDataService from "../../sessiondata.service";
import Dataset from "../../../../../model/session/dataset";
import {Component, Input, Inject, ChangeDetectorRef} from "@angular/core";
import {Observable} from "rxjs";
import {Response, Http} from "@angular/http";

@Component({
  selector: 'ch-text-visualization',
  template: `
    <label *ngIf="!isCompleteFile()">Showing {{getSizeShown() | bytes}} of {{getSizeFull() | bytes}}</label>
    <p>{{data}}</p>
    <a href (click)="loadMore()" *ngIf="!isCompleteFile()">Show more</a>
  `
})
export class TextVisualizationComponent {

    @Input() datasetId: string;
    @Input() selectedDatasets: Array<Dataset>;
    private data: string;

    fileSizeLimit = 10 * 1024;

    constructor(
      private changeDetectorRef: ChangeDetectorRef,
    	@Inject('FileResource') private fileResource: FileResource,
      @Inject('SessionDataService') private sessionDataService: SessionDataService) {
    }<commit_msg>Use preformatted in text visualization<commit_after>import FileResource from "../../../../../shared/resources/fileresource";
import SessionDataService from "../../sessiondata.service";
import Dataset from "../../../../../model/session/dataset";
import {Component, Input, Inject, ChangeDetectorRef} from "@angular/core";
import {Observable} from "rxjs";
import {Response, Http} from "@angular/http";

@Component({
  selector: 'ch-text-visualization',
  template: `
    <label *ngIf="!isCompleteFile()">Showing {{getSizeShown() | bytes}} of {{getSizeFull() | bytes}}</label>
    <pre>{{data}}</pre>
    <a href (click)="loadMore()" *ngIf="!isCompleteFile()">Show more</a>
  `,
  styles: [`
    pre {
      background-color: white;
    }
  `],
})

export class TextVisualizationComponent {

    @Input() datasetId: string;
    @Input() selectedDatasets: Array<Dataset>;
    private data: string;

    fileSizeLimit = 10 * 1024;

    constructor(
      private changeDetectorRef: ChangeDetectorRef,
    	@Inject('FileResource') private fileResource: FileResource,
      @Inject('SessionDataService') private sessionDataService: SessionDataService) {
    }
{'fraction_non_alphanumeric': 0.16961451247165532, 'fraction_numerical': 0.005442176870748299, 'mean_word_length': 4.290167865707434, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4828588', 'n_tokens_mistral': 654, 'n_tokens_neox': 630, 'n_words': 152}