<commit_before>d3.tsv('nyc_sample.tsv', function(error, data) {
    instagram_data = data;

    var width = 500;
    var height = 40;

    data.forEach(function(d){
        d.publishedDate = new Date(d.published);
    });


    var firstPublishedDate = instagram_data[0].publishedDate;
    var lastPublishedDate = instagram_data[instagram_data.length - 1].publishedDate;

    var timeScale = d3.scale.linear()
        .domain([firstPublishedDate, lastPublishedDate])
        .range([0, width]);


    d3.select('#timeseries').append('svg')
        .attr('width', width + 'px')
        .attr('height', '40px')
        .selectAll('.vline')
        .data(data)
        .enter()
        .append('line')
        .attr("x1", function(d) {
            return timeScale(d.publishedDate);
        })
        .attr("x2", function(d) {
            return timeScale(d.publishedDate);
        })
        .attr("y1", function(d) {
            return 0;
        })
        .attr("y2", height)
        .style("stroke", "#000");

});<commit_msg>Adds a time axis.<commit_after>d3.tsv('nyc_sample.tsv', function(error, data) {
    instagram_data = data;

    var margin = {top: 30, right: 30, bottom: 30, left: 60},
        width = 500 - margin.left - margin.right,
        height = 200 - margin.top - margin.bottom;

    data.forEach(function(d){
        d.publishedDate = new Date(d.published);
    });


    firstPublishedDate = instagram_data[0].publishedDate;
    lastPublishedDate = instagram_data[instagram_data.length - 1].publishedDate;

    var timeScale = d3.time.scale()
        .domain([firstPublishedDate, lastPublishedDate])
        .range([0, width]);

    var format = d3.time.format("%Y-%m-%d %H:%M");

    var timeAxis = d3.svg.axis()
        .scale(timeScale)
        .ticks(3)
        .tickFormat(format);

    var svg = d3.select('#timeseries').append('svg')
        .attr('width', width + margin.left + margin.right + 'px')
        .attr('height', height + margin.top + margin.bottom + 'px');

    svg.selectAll('.vline')
        .data(data)
        .enter()
        .append('line')
        .attr("x1", function(d) {
            return margin.left + timeScale(d.publishedDate);
        })
        .attr("x2", function(d) {
            return margin.left + timeScale(d.publishedDate);
        })
        .attr("y1", 0)
        .attr("y2", height)
        .style("stroke", "#000");

    svg.append("g")
        .attr("class", "x axis")
        .attr("transform", "translate(" + margin.left + "," + (height + margin.top) + ")")
        .call(timeAxis);

});
{'fraction_non_alphanumeric': 0.16966379984362784, 'fraction_numerical': 0.020328381548084442, 'mean_word_length': 2.297680412371134, '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': '3028183', 'n_tokens_mistral': 862, 'n_tokens_neox': 806, 'n_words': 150}