<commit_before>$(document).ready(function(e) {
	  $("#legendToggle").click(function(){
		if ($("#legendDiv").css('display')=='none'){
		  $("#legTogText").html('MAP LEGEND ▲');
		}
		else{
		  $("#legTogText").html('MAP LEGEND ▼');
		}
		$("#legendDiv").slideToggle();
	  });
    });

var popupOpen = false,
	 j = 0,
    _storyData = [],
    selection,
    mapPoint;

var checkImg = function(obj){

	var img = new RegExp (/(?:.jpe?g|.gif|.png)/i);
	var url = new RegExp (/http/i);

	for (var prop in obj){
		if (typeof(obj[prop]) == 'string'){
			if (img.test((obj[prop])) == true && url.test((obj[prop])) == true){
				return(obj[prop]);
			}
		}
	}
};
var findTitle = function(obj){

	var udrScr = new RegExp (/"_"/i);
	var url = new RegExp (/http/i);

	var title = null;
	for (var prop in obj){
		if (typeof(obj[prop]) == 'string'){
			if (title == null && udrScr.test((obj[prop])) == false && (obj[prop]).length > 1 && url.test((obj[prop])) == false){
				title = obj[prop];
			}
		}
	}
	return (title);
};

function findLayers(layers,index){
	var csvLayers = [];
	dojo.forEach(layers,function(layer){
		if(layer.id.search("csv") == 0 && layer.visibility == true){
			dojo.forEach(layer.featureCollection.layers,function(lyr){
				csvLayers.push(lyr.layerObject);
			});
		}
		else if(layer.id.search("featColl") == 0 && layer.visibility == true){
			dojo.forEach(layer.featureCollection.layers,function(lyr){
				csvLayers.push(lyr.layerObject);
			});
		}
	});
	_csvLayers[index] = csvLayers;
	generateGraphics(index);
}

function generateGraphics(index){
	var shaded = true;
	dojo.forEach(_csvLayers[index],function(layer,i){
		if (i < 1){
			layer.hide();

			$("#story"+index).append("<div id='story"+index+"group"+i+"' class='group'></div>");

			var sp = new esri.layers.GraphicsLayer();
			map.addLayer(sp);
			_storyPoints[index] = sp;

			if (layer.graphics[0].attributes.order){
				layer.graphics.sort(function(a,b){
					return a.attributes.order - b.attributes.order;
				});
			}

			dojo.forEach(layer.graphics,function(graphic,j){
				if (j < 99){
					if (shaded == true){
						shaded = false;
						$("#story"+index+"group"+i).append("<div id='story"+index+"group"+i+"point"+j+"' class='storyPoint' title='Click for more information'></div>");
					}
					else{
						shaded = true;
						$("#story"+index+"group"+i).append("<div id='story"+index+"group"+i+"point"+j+"' class='storyPoint storyPointShaded' title='Click for more information '></div>");
					}

					$("#story"+index+"group"+i+"point"+j).data("attributes", graphic.attributes);
					$("#story"+index+"group"+i+"point"+j).data("geometry", graphic.geometry);
					$("#story"+index+"group"+i+"point"+j).data("infoWindow", layer.infoTemplate);

					var group;
					var fileChange;
					if(graphic.attributes.Color){
						if (graphic.attributes.Color.toLowerCase() == "B"){
							group = 'blue';
							fileChange = 'b';
						}
						else{
							group = 'red';
							fileChange = '';
						}
					}
					else{
						group = 'red';
						fileChange = '';
					}

					var pt = graphic.geometry;
					var attr = graphic.attributes;
					var sym = new esri.symbol.PictureMarkerSymbol("images/icons/"+group+"/NumberIcon"+fileChange+(j+1)+".png", 22, 28).setOffset(3,8);
					var info = layer.infoTemplate;

					if (graphic.attributes.order){
						$("#story"+index+"group"+i+"point"+j).append("<div id='story"+index+"group"+i+"indexCon"+j+"' class='indexCon "+group+"'><div id='story"+index+"group"+i+"pointIndex"+j+"' class='pointIndex'>"+graphic.attributes.order+"</div></div>");
					}<commit_msg>Fix icon color select<commit_after>$(document).ready(function(e) {
	  $("#legendToggle").click(function(){
		if ($("#legendDiv").css('display')=='none'){
		  $("#legTogText").html('MAP LEGEND ▲');
		}
		else{
		  $("#legTogText").html('MAP LEGEND ▼');
		}
		$("#legendDiv").slideToggle();
	  });
    });

var popupOpen = false,
	 j = 0,
    _storyData = [],
    selection,
    mapPoint;

var checkImg = function(obj){

	var img = new RegExp (/(?:.jpe?g|.gif|.png)/i);
	var url = new RegExp (/http/i);

	for (var prop in obj){
		if (typeof(obj[prop]) == 'string'){
			if (img.test((obj[prop])) == true && url.test((obj[prop])) == true){
				return(obj[prop]);
			}
		}
	}
};
var findTitle = function(obj){

	var udrScr = new RegExp (/"_"/i);
	var url = new RegExp (/http/i);

	var title = null;
	for (var prop in obj){
		if (typeof(obj[prop]) == 'string'){
			if (title == null && udrScr.test((obj[prop])) == false && (obj[prop]).length > 1 && url.test((obj[prop])) == false){
				title = obj[prop];
			}
		}
	}
	return (title);
};

function findLayers(layers,index){
	var csvLayers = [];
	dojo.forEach(layers,function(layer){
		if(layer.id.search("csv") == 0 && layer.visibility == true){
			dojo.forEach(layer.featureCollection.layers,function(lyr){
				csvLayers.push(lyr.layerObject);
			});
		}
		else if(layer.id.search("featColl") == 0 && layer.visibility == true){
			dojo.forEach(layer.featureCollection.layers,function(lyr){
				csvLayers.push(lyr.layerObject);
			});
		}
	});
	_csvLayers[index] = csvLayers;
	generateGraphics(index);
}

function generateGraphics(index){
	var shaded = true;
	dojo.forEach(_csvLayers[index],function(layer,i){
		if (i < 1){
			layer.hide();

			$("#story"+index).append("<div id='story"+index+"group"+i+"' class='group'></div>");

			var sp = new esri.layers.GraphicsLayer();
			map.addLayer(sp);
			_storyPoints[index] = sp;

			if (layer.graphics[0].attributes.order){
				layer.graphics.sort(function(a,b){
					return a.attributes.order - b.attributes.order;
				});
			}

			dojo.forEach(layer.graphics,function(graphic,j){
				if (j < 99){
					if (shaded == true){
						shaded = false;
						$("#story"+index+"group"+i).append("<div id='story"+index+"group"+i+"point"+j+"' class='storyPoint' title='Click for more information'></div>");
					}
					else{
						shaded = true;
						$("#story"+index+"group"+i).append("<div id='story"+index+"group"+i+"point"+j+"' class='storyPoint storyPointShaded' title='Click for more information '></div>");
					}

					$("#story"+index+"group"+i+"point"+j).data("attributes", graphic.attributes);
					$("#story"+index+"group"+i+"point"+j).data("geometry", graphic.geometry);
					$("#story"+index+"group"+i+"point"+j).data("infoWindow", layer.infoTemplate);

					var group;
					var fileChange;
					if(graphic.attributes.Color){
						if (graphic.attributes.Color.toLowerCase() == "b"){
							group = 'blue';
							fileChange = 'b';
						}
						else{
							group = 'red';
							fileChange = '';
						}
					}
					else{
						group = 'red';
						fileChange = '';
					}

					var pt = graphic.geometry;
					var attr = graphic.attributes;
					var sym = new esri.symbol.PictureMarkerSymbol("images/icons/"+group+"/NumberIcon"+fileChange+(j+1)+".png", 22, 28).setOffset(3,8);
					var info = layer.infoTemplate;

					if (graphic.attributes.order){
						$("#story"+index+"group"+i+"point"+j).append("<div id='story"+index+"group"+i+"indexCon"+j+"' class='indexCon "+group+"'><div id='story"+index+"group"+i+"pointIndex"+j+"' class='pointIndex'>"+graphic.attributes.order+"</div></div>");
					}
{'fraction_non_alphanumeric': 0.21804511278195488, 'fraction_numerical': 0.004177109440267335, 'mean_word_length': 3.8208053691275166, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, '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': '5354809', 'n_tokens_mistral': 2998, 'n_tokens_neox': 2464, 'n_words': 419}