<commit_before>import { Component, Input, Output, EventEmitter, OnChanges  } from '@angular/core';
import { Element } from './element';

@Component({
  moduleId: module.id,
  selector: 'pt-element',
  templateUrl: 'element.component.html',
    styleUrls: ['element.component.css'] 

})

export class ElementComponent implements OnChanges {
  @Input() elementData: Element;
  // ^ exposes elementData property to parent component, listens for parent component to send data to child

  @Output() elementHovered: EventEmitter<Object> = new EventEmitter<Object>();
  // ^ exposes which element is being hovered on to the parent component, sends proper data to hoverReceived fxn

  elementStyle: Object = {};

  ngOnChanges(): void {
    console.log('this ran');
    if (this.elementData.highlight) {
      this.elementStyle = {'background-color': 'pink'};
    }
  }

  onHover(): void {
    console.log(this.elementData);
    this.elementHovered.emit(this.elementData);
  }
  // ^ sends data into emit channel to be picked up by parent component

}
<commit_msg>Add working transition metal highlight<commit_after>import { Component, Input, Output, EventEmitter, DoCheck  } from '@angular/core';
import { Element } from './element';

@Component({
  moduleId: module.id,
  selector: 'pt-element',
  templateUrl: 'element.component.html',
    styleUrls: ['element.component.css'] 

})

export class ElementComponent implements DoCheck {
  @Input() elementData: Element;
  // ^ exposes elementData property to parent component, listens for parent component to send data to child

  @Output() elementHovered: EventEmitter<Object> = new EventEmitter<Object>();
  // ^ exposes which element is being hovered on to the parent component, sends proper data to hoverReceived fxn

  elementStyle: Object = {};

  ngDoCheck() {
    if (this.elementData.highlight) {
      this.elementStyle = {'background-color': 'pink'};
    } else {
      this.elementStyle = {'background-color': 'transparent'};
    }
  }

  onHover(): void {
    this.elementHovered.emit(this.elementData);
  }
  // ^ sends data into emit channel to be picked up by parent component

}

{'fraction_non_alphanumeric': 0.11827956989247312, 'fraction_numerical': 0.0, 'mean_word_length': 4.0591016548463354, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '647943', 'n_tokens_mistral': 616, 'n_tokens_neox': 599, 'n_words': 190}