<commit_before>var stats;

!(function(){

  var module = {sel: d3.select('[data-module="toc"]')}
  addModule(module)

  stats = loadStats();
  var loadTime = new Date();
  var open = false;

  var pixelsToWords = d3.scale.linear()
    .domain([0,d3.select("body").node().getBoundingClientRect().height])
    .range([0,stats.wordCount]);
  
  var pixelsToPercentage = d3.scale.linear()
    .domain([0,d3.select("body").node().getBoundingClientRect().height])
    .range([0,100]);

  var wordsToPercentage = d3.scale.linear()
    .domain([0,stats.wordCount]);

  var histogram = d3.layout.histogram()
    .value(ƒ('scrollTop'))
    .bins(pixelsToWords.ticks(100));

  var logInterval = setInterval(function() {
    logScroll();
    if(open) {
      makeHistogram();
      renderHistogram();
      renderStats();
    }
  }, 1000);

  d3.select(window).on("scroll.toc", renderWindows);
  window.onunload = window.onbeforeunload = saveStats;
  renderTOC();

  d3.select("#toc-toggle").on("click", function() {
    open = !open;
    module.sel.classed("open", open);
    d3.select("article").classed("toc-open", open);
  });<commit_msg>adds click out of toc<commit_after>var stats;

!(function(){

  var module = {sel: d3.select('[data-module="toc"]')}
  addModule(module)

  stats = loadStats();
  var loadTime = new Date();
  var open = false;

  var pixelsToWords = d3.scale.linear()
    .domain([0,d3.select("body").node().getBoundingClientRect().height])
    .range([0,stats.wordCount]);
  
  var pixelsToPercentage = d3.scale.linear()
    .domain([0,d3.select("body").node().getBoundingClientRect().height])
    .range([0,100]);

  var wordsToPercentage = d3.scale.linear()
    .domain([0,stats.wordCount]);

  var histogram = d3.layout.histogram()
    .value(ƒ('scrollTop'))
    .bins(pixelsToWords.ticks(100));

  var logInterval = setInterval(function() {
    logScroll();
    if(open) {
      makeHistogram();
      renderHistogram();
      renderStats();
    }
  }, 1000);

  d3.select(window).on("scroll.toc", renderWindows);
  window.onunload = window.onbeforeunload = saveStats;
  renderTOC();

  d3.select("#toc-toggle").on("click", function() {
    open = !open;
    module.sel.classed("open", open);
    d3.select("article").classed("toc-open", open);
  });

  d3.selectAll(".code-section,.banner-container").on("click", function() {
    if (open == true) {
      open = false;
      module.sel.classed("open", open);
      d3.select("article").classed("toc-open", open);
    }
  });
{'fraction_non_alphanumeric': 0.19246190858059342, 'fraction_numerical': 0.020850040096230954, 'mean_word_length': 3.7433460076045626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7105627', 'n_tokens_mistral': 899, 'n_tokens_neox': 850, 'n_words': 133}