<commit_before>/**
 * Created by <NAME> on 05.09.2017.
 */
import Column from '../../model/Column';
import {IRankingHeaderContext, toFullTooltip} from '../engine/RenderColumn';
import createSummary from '../engine/summary';


export default class SidePanelEntryVis {
  readonly node: HTMLElement;

  constructor(public readonly column: Column, private ctx: IRankingHeaderContext, document: Document) {
    this.node = document.createElement('article');
    this.node.dataset.type = column.desc.type;

    this.column.on(`${Column.EVENT_FILTER_CHANGED}.panel, ${Column.EVENT_DIRTY_HEADER}.panel`, () => {
      this.update();
    });
    this.init();
    this.update();
  }

  private init() {
    this.node.innerHTML = `
      <header><h2></h2></header>
      <main class="lu-summary"></main>`;
  }

  update(ctx: IRankingHeaderContext = this.ctx) {
    this.ctx = ctx;
    this.node.querySelector('h2')!.textContent = this.column.label;
    this.node.title = toFullTooltip(this.column);

    createSummary(<HTMLElement>this.node.querySelector('main.lu-summary')!, this.column, this.ctx, true);
  }

  destroy() {
    this.column.on(`${Column.EVENT_FILTER_CHANGED}.panel, ${Column.EVENT_DIRTY_HEADER}.panel`, null);<commit_msg>add common classes<commit_after>/**
 * Created by <NAME> on 05.09.2017.
 */
import Column from '../../model/Column';
import {IRankingHeaderContext, toFullTooltip} from '../engine/RenderColumn';
import createSummary from '../engine/summary';
import {createToolbar} from '../engine/header';


export default class SidePanelEntryVis {
  readonly node: HTMLElement;

  constructor(public readonly column: Column, private ctx: IRankingHeaderContext, document: Document) {
    this.node = document.createElement('article');
    this.node.dataset.type = column.desc.type;

    this.column.on(`${Column.EVENT_FILTER_CHANGED}.panel, ${Column.EVENT_DIRTY_HEADER}.panel`, () => {
      this.update();
    });
    this.init();
    this.update();
  }

  private init() {
    this.node.innerHTML = `
      <header><i class="lu-sort"></i><h2 class="lu-label"></h2><div class="lu-toolbar"></div></header>
      <main class="lu-summary"></main>`;
    createToolbar(<HTMLElement>this.node.querySelector('.lu-toolbar'), this.column, this.ctx);
  }

  update(ctx: IRankingHeaderContext = this.ctx) {
    this.ctx = ctx;
    this.node.querySelector('.lu-label')!.textContent = this.column.label;
    this.node.title = toFullTooltip(this.column);

    createSummary(<HTMLElement>this.node.querySelector('.lu-summary')!, this.column, this.ctx, true);
  }

  destroy() {
    this.column.on(`${Column.EVENT_FILTER_CHANGED}.panel, ${Column.EVENT_DIRTY_HEADER}.panel`, null);
{'fraction_non_alphanumeric': 0.17121495327102804, 'fraction_numerical': 0.007850467289719627, 'mean_word_length': 4.126436781609195, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 26, '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': '2211453', 'n_tokens_mistral': 851, 'n_tokens_neox': 827, 'n_words': 145}