<commit_before>var selector = '#wordcloud';
var width = 1024;
var height = 768;

var filename = 'data/data.csv';

d3.csv(filename, function(data){
    data = data.splice(0, 1000);
    var wordcount = data.map(function(d) {
	return {
	    text: d.word,
	    size: d.count
	};
    });

    var fontSizeScale = d3.scale.pow()
	    // .domain([0, d3.max(wordcount, function(d) { return d.size; })])
	    .domain([0, 28])
	    .range([0, 128]);

    var svg = d3.select(selector).append("svg")
	    .attr("width", width)
	    .attr("height", height);
    var vis = svg.append("g")
	    .attr("transform", "translate(" + [width >> 1, height >> 1] + ")");

    var layout = d3.layout.cloud()
	    .size([width, height])
            .words(wordcount)
            .padding(5)
	    .rotate(function() { return 0;})
	    // .rotate(function() { return ~~(Math.random() * 2) * 90; })
            .font("Impact")
            .fontSize(function(d) { return fontSizeScale(d.size); })
	    .on("word", progress)
            .on("end", draw)
	    .start();


    function progress(data) {
	console.log(progress);
    }

    function draw(words) {
	var fill = d3.scale.category20();

        vis.selectAll("text")
            .data(words)
            .enter()
            .append("text")
            .style({
		"font-size": function(d) { return d.size + "px"; },
		"font-family": "Impact",
		"fill": function(d, i) { return fill(i); }
            })
            .attr({
		"text-anchor": "middle",
		"transform": function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; }
            })
            .text(function(d) { return d.text; });
    }
});
<commit_msg>Minor change<commit_after>var selector = '#wordcloud';
var width = 1024;
var height = 768;

var filename = 'data/data.csv';

d3.csv(filename, function(data){
    data = data.splice(0, 1000);
    var words = data.map(function(d) {
	return {
	    text: d.word,
	    size: d.count
	};
    });

    var fontSizeScale = d3.scale.pow()
	    // .domain([0, d3.max(words, function(d) { return d.size; })])
	    .domain([0, 28])
	    .range([0, 128]);

    var svg = d3.select(selector).append("svg")
	    .attr("width", width)
	    .attr("height", height);
    var vis = svg.append("g")
	    .attr("transform", "translate(" + [width >> 1, height >> 1] + ")");

    var layout = d3.layout.cloud()
	    .size([width, height])
            .words(words)
            .padding(5)
	    .rotate(function() { return 0;})
            .font("Impact")
            .fontSize(function(d) { return fontSizeScale(d.size); })
	    .on("word", progress)
            .on("end", draw)
	    .start();


    function progress(data) {
	console.log('progress');
    }

    function draw(words) {
	var fill = d3.scale.category20();

        vis.selectAll("text")
            .data(words)
            .enter()
            .append("text")
            .style({
		"font-size": function(d) { return d.size + "px"; },
		"font-family": "Impact",
		"fill": function(d, i) { return fill(i); }
            })
            .attr({
		"text-anchor": "middle",
		"transform": function(d) { return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; }
            })
            .text(function(d) { return d.text; });
    }
});

{'fraction_non_alphanumeric': 0.19993838570548367, 'fraction_numerical': 0.020640788662969808, 'mean_word_length': 2.1739980449657867, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 11, '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': '4028290', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1097, 'n_words': 228}