<commit_before>D3ModelLayout = function(p_htmlElement, p_cssClass) {
	var htmlElement = p_htmlElement;
	var cssClass = p_cssClass;

	//var padding = 35;
	var rightPanelWidth = parseInt($("." + cssClass).css("width"));
	var leftPanelWidth = window.innerWidth - rightPanelWidth;
	console.log("rightPanelWidth: " + rightPanelWidth + "  leftPanelWidth: " + leftPanelWidth);
	var windowWidth = rightPanelWidth;
	var maxXOfferset = 0;
	var width=0;           
	var height=0;
	var textHeight = 15;

	var linkClickListener = null;
	var nodeClickListener = null;
	
	var test = [];
	//var tableData = [];                            //store table data
	//var columnPos = [];                            //position for each column
	var anchorName = [];                           //store anchor name, include nested
	var anchorData = [];                           //store anchor nodes
	 nodesData = [];                            //store all nodes includes anchors
	 linksData = [];                            //links data
	var noCycleLinksData = [];                     //cycles are removed
	var cycles = [];                               //all cycles, each cycle contians all nodes in that cycle.
	 textData = [];                             //text nodes
	var textLinksData = [];                        //text links
	var layerMap = [];                             //store nodes'id in sequence of layers
	 nodesChildren = [];                        //store node's id and its children pair
	var SCCindex = 0;                              //strong connected component node's index
	var SCCNodes = [];                             //SCC nodes set
	var SCCtmpNodes = [];                          //the nodes stack of SCC
	var layerLabel = [];                           //layers are divided into sections based on its layer
	var cycleSet = [];                             //each element in the array is an arraylist, consist of edges of cycle. ex: {1->2, 2->3, 3->1}
	var myMap = function(){
		var data = [];
		this.entry = data;
		this.set = function(key, value){
			data[key] = value;
		}
		this.get = function(key){
			return data[key];
		}
		this.has = function(key){
			return (key in data);
		}
		this.delete = function(key){
			data.splice(data.indexOf(key), 1);
		}
		this.clear = function(){
			data = [];
		}
	}
	var ArrayList = function(){
		var data = [];
		this.contains = function(arg){			
			for (var i = 0; i < data.length; i++){
				if (data[i] == arg){
					return true;
				}
			};
			return false;
		}
		this.add = function(arg){
			data.push(arg);
		}
		this.removeByValue = function(arg){
			var index = data.indexOf(arg);
			if (index > -1){
				data.splice(index, 1);
				return true;
			}
			return false;
		}
		this.removeByIndex = function(arg){
			if (arg >= 0 && arg < data.length){
				data.splice(arg, 1);
				return true;
			}
			return false;
		}
		this.get = function(arg){
			if (arg >= 0 && arg < data.length){
				return data[arg];
			}
			return undefined;
		}
		this.print = function(){
			var output = "[";
			data.forEach(function(d, i){
				output += d;
				if (i < data.length - 1){
					output += ',';
				}
			});
			output += "]";
			console.log("ArrayList: " + output);
		}
	}
	var map = new myMap();
	var idMap = [];                                //map from label to id
	var edgeIdMap = [];                            //map of edge's id
	var nodePosMap = new myMap();                  //map of node's position


	var print = false;                             //whether or not print 
	var nodeRadius = 4;
	var unitLinkLength = 70;                       //difference between layers
	var outsideUnitLinkLength = 50;                //length for outside links
	var maxLayer = 0;                              //max layer number, base 0
	var reshuffleFrequency = 8;                    //pixel changes to excute scroll bar event
	var xOffset = 0;                               //x position offset
	var firstTime = true;                          //first time to load the force-layout
	var maxLabelLength = 0;    
	var tableHeight = 0;
	var cellWidth = $(".wk-header-cell").css("width");
	var cScale = d3.scale.category20();

	//create svg
	var svg = d3.select(htmlElement)                         
	    .append("svg")
	    .attr("id", p_htmlElement)
	    //.on("mousemove", mousemove);


	//svg to draw nodes and links
	var forceSVG = svg.append("g");

	//place to show mouse coordinate
	var pos = svg.append("text")
		.attr("fill", "black")
		.attr("font-size", 10);

	//coefficient of force move nodes to top
	var upperForceScale = d3.scale.linear()
		//.domain([0, height]) 
		.range([1, 0]);        

	 nodes = forceSVG.selectAll(".node");       //all nodes    
	 links = forceSVG.selectAll(".link");       //all links
	 labels = forceSVG.selectAll(".label");     //all labels
	 labelLinks = forceSVG.selectAll(".labelLinks"); //all label links.
	 linkArrow = forceSVG.selectAll(".linkArrow");   //little triangle of links<commit_msg>little change<commit_after>D3ModelLayout = function(p_htmlElement, p_cssClass) {
	var htmlElement = p_htmlElement;
	var cssClass = p_cssClass;

	//var padding = 35;
	var rightPanelWidth = parseInt($("." + cssClass).css("width"));
	var leftPanelWidth = window.innerWidth - rightPanelWidth;
	console.log("rightPanelWidth: " + rightPanelWidth + "  leftPanelWidth: " + leftPanelWidth);
	var windowWidth = rightPanelWidth;
	var maxXOfferset = 0;
	var width=0;           
	var height=0;
	var textHeight = 15;

	var linkClickListener = null;
	var nodeClickListener = null;
	
	var test = [];
	var anchorName = [];                           //store anchor name, include nested
	var anchorData = [];                           //store anchor nodes
	var nodesData = [];                            //store all nodes includes anchors
	var linksData = [];                            //links data
	var noCycleLinksData = [];                     //cycles are removed
	var cycles = [];                               //all cycles, each cycle contians all nodes in that cycle.
	var textData = [];                             //text nodes
	var textLinksData = [];                        //text links
	var layerMap = [];                             //store nodes'id in sequence of layers
	var nodesChildren = [];                        //store node's id and its children pair
	var SCCindex = 0;                              //strong connected component node's index
	var SCCNodes = [];                             //SCC nodes set
	var SCCtmpNodes = [];                          //the nodes stack of SCC
	var layerLabel = [];                           //layers are divided into sections based on its layer
	var cycleSet = [];                             //each element in the array is an arraylist, consist of edges of cycle. ex: {1->2, 2->3, 3->1}
	var myMap = function(){
		var data = [];
		this.entry = data;
		this.set = function(key, value){
			data[key] = value;
		}
		this.get = function(key){
			return data[key];
		}
		this.has = function(key){
			return (key in data);
		}
		this.delete = function(key){
			data.splice(data.indexOf(key), 1);
		}
		this.clear = function(){
			data = [];
		}
	}
	var ArrayList = function(){
		var data = [];
		this.contains = function(arg){			
			for (var i = 0; i < data.length; i++){
				if (data[i] == arg){
					return true;
				}
			};
			return false;
		}
		this.add = function(arg){
			data.push(arg);
		}
		this.removeByValue = function(arg){
			var index = data.indexOf(arg);
			if (index > -1){
				data.splice(index, 1);
				return true;
			}
			return false;
		}
		this.removeByIndex = function(arg){
			if (arg >= 0 && arg < data.length){
				data.splice(arg, 1);
				return true;
			}
			return false;
		}
		this.get = function(arg){
			if (arg >= 0 && arg < data.length){
				return data[arg];
			}
			return undefined;
		}
		this.print = function(){
			var output = "[";
			data.forEach(function(d, i){
				output += d;
				if (i < data.length - 1){
					output += ',';
				}
			});
			output += "]";
			console.log("ArrayList: " + output);
		}
	}
	var map = new myMap();
	var idMap = [];                                //map from label to id
	var edgeIdMap = [];                            //map of edge's id
	var nodePosMap = new myMap();                  //map of node's position


	var print = false;                             //whether or not print 
	var nodeRadius = 4;
	var unitLinkLength = 70;                       //difference between layers
	var outsideUnitLinkLength = 50;                //length for outside links
	var maxLayer = 0;                              //max layer number, base 0
	var reshuffleFrequency = 8;                    //pixel changes to excute scroll bar event
	var xOffset = 0;                               //x position offset
	var firstTime = true;                          //first time to load the force-layout
	var maxLabelLength = 0;    
	var tableHeight = 0;
	var cellWidth = $(".wk-header-cell").css("width");
	var cScale = d3.scale.category20();

	//create svg
	var svg = d3.select(htmlElement)                         
	    .append("svg")
	    .attr("id", p_htmlElement)
	    //.on("mousemove", mousemove);


	//svg to draw nodes and links
	var forceSVG = svg.append("g");

	//place to show mouse coordinate
	var pos = svg.append("text")
		.attr("fill", "black")
		.attr("font-size", 10);

	//coefficient of force move nodes to top
	var upperForceScale = d3.scale.linear()
		//.domain([0, height]) 
		.range([1, 0]);        

	var nodes = forceSVG.selectAll(".node");       //all nodes    
	var links = forceSVG.selectAll(".link");       //all links
	var labels = forceSVG.selectAll(".label");     //all labels
	var labelLinks = forceSVG.selectAll(".labelLinks"); //all label links.
	var linkArrow = forceSVG.selectAll(".linkArrow");   //little triangle of links
{'fraction_non_alphanumeric': 0.12733394551576369, 'fraction_numerical': 0.008978675645342313, 'mean_word_length': 1.8223437949899222, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2802771', 'n_tokens_mistral': 3187, 'n_tokens_neox': 2808, 'n_words': 868}