<commit_before>d3.selection.prototype.moveToFront = function() { 
  return this.each(function() { 
    this.parentNode.appendChild(this); 
  }); 
};

// Compile the analysis_id regexp once
var analysis_id_regexp = /^analysis_(\d+)/;

// draw_diagram incorporate the pipeline diagram into the DOM
// and set the "draggability" and "pannability" of the diagram
function draw_diagram(xmlStr) {
    // we first remove previous diagrams
    $("#pipeline_diagram").empty();

    var DOMParser = new window.DOMParser();
//    var xml = DOMParser.parseFromString(xmlStr,'img/svg+xml');
    var xml = DOMParser.parseFromString(xmlStr,'text/xml');
    var importedNode = document.importNode(xml.documentElement,true);

    // TODO: This is creating a nested svg structure. This is needed because Firefox will only use the
    // the width and height of the outer structure, so we need to give the width and height
    // of the inner svg (the real one).
    // I am not able to have zoom and panning capabilities without the outer svg
    var width = $("#pipeline_diagram").css("width");
    var height = $("#pipeline_diagram").css("height");

    var g = d3.select("#pipeline_diagram")
    	.append("svg")
    	.attr("width",width)
    	.attr("height",height)
    	.attr("pointer-events", "all")
    	.append("g")
    	.call(d3.behavior.zoom().on("zoom", function() { redraw(g) }))
    	.append("g");
    <commit_msg>rescaling the pipeline diagram at start up<commit_after>d3.selection.prototype.moveToFront = function() { 
  return this.each(function() { 
    this.parentNode.appendChild(this); 
  }); 
};

// Compile the analysis_id regexp once
var analysis_id_regexp = /^analysis_(\d+)/;

// draw_diagram incorporate the pipeline diagram into the DOM
// and set the "draggability" and "pannability" of the diagram
function draw_diagram(xmlStr) {
    // we first remove previous diagrams
    $("#pipeline_diagram").empty();

    var DOMParser = new window.DOMParser();
//    var xml = DOMParser.parseFromString(xmlStr,'img/svg+xml');
    var xml = DOMParser.parseFromString(xmlStr,'text/xml');
    var importedNode = document.importNode(xml.documentElement,true);

    // TODO: This is creating a nested svg structure. This is needed because Firefox will only use the
    // the width and height of the outer structure, so we need to give the width and height
    // of the inner svg (the real one).
    // I am not able to have zoom and panning capabilities without the outer svg
    var width = $("#pipeline_diagram").css("width");
    var height = $("#pipeline_diagram").css("height");

    d3.select(importedNode)
	.attr("width", width)
	.attr("height", height);

    var g = d3.select("#pipeline_diagram")
    	.append("svg")
    	.attr("width",width)
    	.attr("height",height)
    	.attr("pointer-events", "all")
    	.append("g")
    	.call(d3.behavior.zoom().on("zoom", function() { redraw(g) }))
    	.append("g");
    
{'fraction_non_alphanumeric': 0.13889839206294902, 'fraction_numerical': 0.0023947998631542937, 'mean_word_length': 3.58307210031348, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '4986645', 'n_tokens_mistral': 909, 'n_tokens_neox': 881, 'n_words': 261}