<commit_before>import { select as d3select } from 'd3';

export default function makeTitle(d) {
  var rowDiv = d3select(this.parentNode.parentNode.parentNode);
  var chartDiv = rowDiv.select('.row-chart');
  var hiddenFlag = rowDiv.classed('hiddenChart');
  d3select(this)
    .append('div')
    .attr('class', 'row-toggle')
    .html(hiddenFlag ? '&#9660;' : '&#9658;')
    .classed('hidden', function(d) {
      return d.chartVisibility == 'hidden';
    })
    .on('click', function() {
      var rowDiv = d3select(this.parentNode.parentNode.parentNode);
      var chartDiv = rowDiv.select('.row-chart');
      var hiddenFlag = rowDiv.classed('hiddenChart');
      rowDiv.classed('hiddenChart', !hiddenFlag);
      d3select(this).html(hiddenFlag ? '&#9660;' : '&#9658;');
    });

  d3select(this)
    .append('span')
    .attr('class', 'title-span')
    .text(d => "'" + d.value_col + "'");

  if (d.value_col != d.label) {
    d3select(this)
      .append('span')
      .attr('class', 'label-span')
      .text(d => d.label);
  }
}<commit_msg>start layout refactor #187<commit_after>import { select as d3select } from 'd3';

export default function makeTitle(d) {
  console.log('making a title');
  var rowDiv = d3select(this.parentNode.parentNode.parentNode);
  var chartDiv = rowDiv.select('.row-chart');
  var hiddenFlag = rowDiv.classed('hiddenChart');
  d3select(this)
    .append('div')
    .attr('class', 'row-toggle')
    .html(hiddenFlag ? '&#9660;' : '&#9658;')
    .classed('hidden', function(d) {
      return d.chartVisibility == 'hidden';
    })
    .on('click', function() {
      var rowDiv = d3select(this.parentNode.parentNode.parentNode);
      var chartDiv = rowDiv.select('.row-chart');
      var hiddenFlag = rowDiv.classed('hiddenChart');
      rowDiv.classed('hiddenChart', !hiddenFlag);
      d3select(this).html(hiddenFlag ? '&#9660;' : '&#9658;');
    });

  d3select(this)
    .append('span')
    .attr('class', 'title-span')
    .text(d => "'" + d.value_col + "'");

  if (d.value_col != d.label) {
    d3select(this)
      .append('span')
      .attr('class', 'label-span')
      .text(d => d.label);
  }

  d3select(this)
    .append('span')
    .attr('class', 'type')
    .text(d => d.type);
}
{'fraction_non_alphanumeric': 0.19605204127411396, 'fraction_numerical': 0.02332884701659937, 'mean_word_length': 3.3385214007782102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '7313621', 'n_tokens_mistral': 795, 'n_tokens_neox': 782, 'n_words': 136}