<commit_before>$(document).ready(function(){
  if ($('div.home').length) {

    const type = (d, _, columns) => {
      d.date = d3.timeParse("%Y%m%d")(d.date);
      for (let i = 1, n = columns.length, c; i < n; ++i) d[c = columns[i]] = +d[c];
      return d;
    }

    const protoChart = {
      width: 480,
      height: 320,
      margin: { top: 10, bottom: 10, left: 10, right: 10 },
    };

    const chartFactory = (opts, proto = protoChart) => {
      const chart = Object.assign({}, proto, opts);

      chart.svg = d3.select('svg')
        .attr('width', chart.width)
        .attr('height', chart.height);
        // .attr('width', chart.width - chart.margin.right)
        // .attr('height', chart.height - chart.margin.bottom);

      chart.container = chart.svg.append('g')
        .attr('id', 'container')
        .attr('transform', `translate(${chart.margin.left}, ${chart.margin.top})`);

      return chart;
    }

    const chart = chartFactory({
      width: parseInt($('div.home').width() * 0.9),
      height: parseInt(Math.min($('main').height() * 0.4, $('div.home').width() * 0.6)),
    })

    chart.loadData = (uri) => {
      d3.tsv(uri, type, (error, data) => {
        chart.data = data; // Object.assign({}, data)
        chart.cities = data.columns.slice(1).map((id) => {
          return {
            id: id,
            values: data.map((d) => {
              return {date: d.date, temperature: d[id]}
            })
          }
        });
        chart.render(chart.data)
      });
    }

    chart.loadData('data.tsv')

    chart.render = (data) => {
      const parseTime = d3.timeParse("%Y%m%d");
      const x = d3.scaleTime().range([0, chart.width - chart.margin.left - chart.margin.right]);
      const y = d3.scaleLinear().range([chart.height - chart.margin.top - chart.margin.bottom, 0]);
      const z = d3.scaleOrdinal(d3.schemeCategory10);

      const line = d3.line()
        .curve(d3.curveBasis)
        .x(function(d) { return x(d.date); })
        .y(function(d) { return y(d.temperature); });<commit_msg>Fix data.tsv path<commit_after>$(document).ready(function(){
  if ($('div.home').length) {

    const type = (d, _, columns) => {
      d.date = d3.timeParse("%Y%m%d")(d.date);
      for (let i = 1, n = columns.length, c; i < n; ++i) d[c = columns[i]] = +d[c];
      return d;
    }

    const protoChart = {
      width: 480,
      height: 320,
      margin: { top: 10, bottom: 10, left: 10, right: 10 },
    };

    const chartFactory = (opts, proto = protoChart) => {
      const chart = Object.assign({}, proto, opts);

      chart.svg = d3.select('svg')
        .attr('width', chart.width)
        .attr('height', chart.height);
        // .attr('width', chart.width - chart.margin.right)
        // .attr('height', chart.height - chart.margin.bottom);

      chart.container = chart.svg.append('g')
        .attr('id', 'container')
        .attr('transform', `translate(${chart.margin.left}, ${chart.margin.top})`);

      return chart;
    }

    const chart = chartFactory({
      width: parseInt($('div.home').width() * 0.9),
      height: parseInt(Math.min($('main').height() * 0.4, $('div.home').width() * 0.6)),
    })

    chart.loadData = (uri) => {
      d3.tsv(uri, type, (error, data) => {
        chart.data = data; // Object.assign({}, data)
        chart.cities = data.columns.slice(1).map((id) => {
          return {
            id: id,
            values: data.map((d) => {
              return {date: d.date, temperature: d[id]}
            })
          }
        });
        chart.render(chart.data)
      });
    }

    chart.loadData('/data/data.tsv')

    chart.render = (data) => {
      const parseTime = d3.timeParse("%Y%m%d");
      const x = d3.scaleTime().range([0, chart.width - chart.margin.left - chart.margin.right]);
      const y = d3.scaleLinear().range([chart.height - chart.margin.top - chart.margin.bottom, 0]);
      const z = d3.scaleOrdinal(d3.schemeCategory10);

      const line = d3.line()
        .curve(d3.curveBasis)
        .x(function(d) { return x(d.date); })
        .y(function(d) { return y(d.temperature); });
{'fraction_non_alphanumeric': 0.19888565891472867, 'fraction_numerical': 0.01744186046511628, 'mean_word_length': 2.2007751937984494, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2206609', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1377, 'n_words': 272}