<commit_before>
const valor = document.querySelector('div.valores');
const minimo = document.querySelector('div.minimo');
const maximo = document.querySelector('div.maximo');
const media = document.querySelector('div.media');
const amplitude = document.querySelector('div.amplitude');
const mediana = document.querySelector('div.mediana');
const desvio = document.querySelector('div.desvio');
const colunas = document.querySelector('div.colunas');
const escrever = document.querySelector('div.escrever');
const form1 = document.querySelector('form.vares');
const form2 = document.querySelector('form.classe');
const nc = document.querySelector('div.nc');
const Valores = {
  valores: [],
  classes: [],
  get organizar() {
    this.valores.sort(function (a, b) {
    return a - b;
    })
  },
  get mediana() {
    let vetor = this.valores;
    if (vetor.length % 2 === 1) {
      return vetor[parseInt(vetor.length / 2)];
    } else {
      let a = vetor[parseInt(vetor.length / 2)];
      let b = vetor[parseInt(vetor.length / 2) - 1];
      return (a + b) / 2;
    }
  },

  get amplitude() {
    return this.maximo - this.minimo;
  },
  get maximo() {
    return this.valores[this.valores.length - 1];
  },
  get minimo() {
    return this.valores[0];
  },
  get media() {
    let soma = 0;
    for (let valor of this.valores) soma += valor;
    return soma / this.valores.length;
  },
  get desvio(){
    let desvio = 0;
    for (var i = 0; i < this.valores.length; i++){
     desvio += Math.pow((this.valores[i] - this.media), 2);
   }
   return desvio / this.valores.length;
 },
  atualizaView: function () {
    let html = "";
    for (let valor of this.valores) {
        html += `<p>${valor}</p>`;
    }
    valor.innerHTML = html;
    media.textContent = this.media;
    maximo.textContent = this.maximo;
    minimo.textContent = this.minimo;
    amplitude.textContent = this.amplitude;
    mediana.textContent = this.mediana;
    desvio.textContent = this.desvio;

    let escala = 0;
    let total = 0;
    for (let c of this.classes) {
      c.zerar();
      for (let n of this.valores) c.conta(n);
      if (c.contagem > escala) escala = c.contagem;
      total += c.contagem;
    }
    for (let c of this.classes) c.desenha(escala);
    if(total === 0){
      tamanho = (Valores.valores.length - total) / Valores.valores.length * 100;
      nc.style.height = `${tamanho}%`;<commit_msg>Update script.js<commit_after>
const valor = document.querySelector('div.valores');
const minimo = document.querySelector('div.minimo');
const maximo = document.querySelector('div.maximo');
const media = document.querySelector('div.media');
const amplitude = document.querySelector('div.amplitude');
const mediana = document.querySelector('div.mediana');
const desvio = document.querySelector('div.desvio');
const colunas = document.querySelector('div.colunas');
const escrever = document.querySelector('div.escrever');
const form1 = document.querySelector('form.vares');
const form2 = document.querySelector('form.classe');
const nc = document.querySelector('div.nc');
const Valores = {
  valores: [],
  classes: [],
  get organizar() {
    this.valores.sort(function (a, b) {
    return a - b;
    })
  },
  get mediana() {
    let vetor = this.valores;
    if (vetor.length % 2 === 1) {
      return vetor[parseInt(vetor.length / 2)];
    } else {
      let a = vetor[parseInt(vetor.length / 2)];
      let b = vetor[parseInt(vetor.length / 2) - 1];
      return (a + b) / 2;
    }
  },

  get amplitude() {
    return this.maximo - this.minimo;
  },
  get maximo() {
    return this.valores[this.valores.length - 1];
  },
  get minimo() {
    return this.valores[0];
  },
  get media() {
    let soma = 0;
    for (let valor of this.valores) soma += valor;
    return soma / this.valores.length;
  },
  get desvio(){
    let desvio = 0;
    for (var i = 0; i < this.valores.length; i++){
     desvio += Math.pow((this.valores[i] - this.media), 2);
   }
   return desvio / this.valores.length;
 },
  atualizaView: function () {
    let html = "";
    for (let valor of this.valores) {
        html += `<p>${valor}</p>`;
    }
    valor.innerHTML = html;
    media.textContent = this.media;
    maximo.textContent = this.maximo;
    minimo.textContent = this.minimo;
    amplitude.textContent = this.amplitude;
    mediana.textContent = this.mediana;
    desvio.textContent = this.desvio;

    let escala = 0;
    total = 0;
    for (let c of this.classes) {
      c.zerar();
      total = 0;sss
      for (let n of this.valores) c.conta(n);
      if (c.contagem > escala) escala = c.contagem;
      total += c.contagem;
    }
    for (let c of this.classes) c.desenha(escala);
    if(total === 0){
      tamanho = (Valores.valores.length - total) / Valores.valores.length * 100;
      nc.style.height = `${tamanho}%`;
{'fraction_non_alphanumeric': 0.15619166148102054, 'fraction_numerical': 0.008919311346193736, 'mean_word_length': 2.975267930750206, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7337662', 'n_tokens_mistral': 1706, 'n_tokens_neox': 1693, 'n_words': 377}