<commit_before>var $, d3;

$(function() {
  'use strict';

  d3.json('/media', function(data) {
    var day = d3.select('#content')
      .selectAll('div')
      .data(data)
      .enter()
      .append('div')
    ;

    day.append('h2').text(function(d) { return d.date; });
    day.append('svg')
      .selectAll('g')
      .data(function(d) { return d.events; })
      .enter()
      .append('g')
      .append('text').text(function(d) { return d.filePrefix; })
      ;
  });

});<commit_msg>put images with links on the svg<commit_after>(function($, d3) {

  // from a date as 2015-05-30_21.22.29
  // return a number from 0 to 1 depending on the time, midnight to midnight
  function timeOfDay(dateString) {
    var time = dateString.match(/_(\d{2})\.(\d{2})\.(\d{2})/);
    return (time[1] * 3600 + time[2] * 60 + parseInt(time[3],10)) / 86400;
  }


  $(function() {
    'use strict';

    d3.json('/media', function(data) {
      var day = d3.select('#content')
        .selectAll('div')
        .data(data)
        .enter()
        .append('div')
      ;

      day.append('h2').text(function(d) { return d.date; });
      day.append('svg').attr('width', 1000).attr('height', 300)
        .selectAll('g')
        .data(function(d) { return d.events; })
        .enter()
        .append('a')
          .attr('xlink:href', function(d) { return d.href + '.jpg'; })
          .append('image')
            .attr('xlink:href', function(d) { return d.href + '.jpg'; })
            .attr('x', function(d) {
              return timeOfDay(d.filePrefix) * 1000;
            })
            .attr('y', 0)
            .attr('width', 50).attr('height', 50)
      ;
    });
  });
})($, d3);
{'fraction_non_alphanumeric': 0.21140142517814728, 'fraction_numerical': 0.035629453681710214, 'mean_word_length': 2.1436567164179103, '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': '922675', 'n_tokens_mistral': 626, 'n_tokens_neox': 582, 'n_words': 112}