<commit_before>// get a new dataset


//
// for (var i = 0; i < n; i++) {
// 	var r = Math.round(Math.random()*250);
// 	numbers.push(r)
// }


// General setting of the enviroment
//   * create an SVG container
//   * prepare an axis
var svg = d3.select("#viz")
	.append("svg")
	.attr("width",600)
.attr("height",400);	

var xAxis = d3.svg.axis()
.orient("top");

svg.append("g")
	.attr("class","axis")
    .attr("transform","translate(10,40)")
.call(xAxis);

var gnumbers = svg.append("g")
    .attr("class","numbers")
.attr("transform","translate(10,60)");
	
    
// Random generator of integers
function generateNumbers(){
	var numbers = [];
	var n = 1+Math.round(Math.random()*15);
	
	numbers = d3.range(n).map(function(d){
		return Math.round(Math.random()*2500);
	});
	console.log("numbers",numbers);
	return numbers;
}


function visualizeNumbers(myNumbers){
	var gs = gnumbers.selectAll("g.number")
	.data(myNumbers);
	
	// exit
	var gsToRemove = gs.exit().remove();
	
	// append
	var gsToAdd = gs
		.enter()
		.append("g")
		.attr("class","number")
		.attr("transform",function(d,i){
			return "translate(10,"+(i*24+10)+")";
		});
	gsToAdd.append("line").attr("x2",0).attr("stroke","black");
	gsToAdd.append("text")
		.attr("text-anchor","end")
		.attr("dy",-2)
		.attr("x",0);	
		
	// update
	var scale = d3.scale.linear()
		.domain([0,d3.max(myNumbers)])
	.range([0,580]);
	
	xAxis.scale(scale);
    
    svg.select("g.axis")
    .call(xAxis);
	
	var cScale = d3.scale.linear()
		.domain([0,d3.max(myNumbers)])
	.range(["#fff", "#f00"]);
	
	
	gs.select("line")
		.transition()
		.attr("x2",scale)<commit_msg>Fixed alignment of lines to left marginx<commit_after>// get a new dataset


//
// for (var i = 0; i < n; i++) {
// 	var r = Math.round(Math.random()*250);
// 	numbers.push(r)
// }


// General setting of the enviroment
//   * create an SVG container
//   * prepare an axis
var svg = d3.select("#viz")
	.append("svg")
	.attr("width",600)
.attr("height",400);	

var xAxis = d3.svg.axis()
.orient("top");

svg.append("g")
	.attr("class","axis")
    .attr("transform","translate(10,40)")
.call(xAxis);

var gnumbers = svg.append("g")
    .attr("class","numbers")
.attr("transform","translate(10,60)");
	
    
// Random generator of integers
function generateNumbers(){
	var numbers = [];
	var n = 1+Math.round(Math.random()*15);
	
	numbers = d3.range(n).map(function(d){
		return Math.round(Math.random()*2500);
	});
	console.log("numbers",numbers);
	return numbers;
}


function visualizeNumbers(myNumbers){
	var gs = gnumbers.selectAll("g.number")
	.data(myNumbers);
	
	// exit
	var gsToRemove = gs.exit().remove();
	
	// append
	var gsToAdd = gs
		.enter()
		.append("g")
		.attr("class","number")
		.attr("transform",function(d,i){
			return "translate(0,"+(i*24+10)+")";
		});
	gsToAdd.append("line").attr("x2",0).attr("stroke","black");
	gsToAdd.append("text")
		.attr("text-anchor","end")
		.attr("dy",-2)
		.attr("x",0);	
		
	// update
	var scale = d3.scale.linear()
		.domain([0,d3.max(myNumbers)])
	.range([0,580]);
	
	xAxis.scale(scale);
    
    svg.select("g.axis")
    .call(xAxis);
	
	var cScale = d3.scale.linear()
		.domain([0,d3.max(myNumbers)])
	.range(["#fff", "#f00"]);
	
	
	gs.select("line")
		.transition()
		.attr("x2",scale)
{'fraction_non_alphanumeric': 0.2314758113900796, 'fraction_numerical': 0.030924678505817513, 'mean_word_length': 3.741654571843251, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1515508', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1266, 'n_words': 221}