<commit_before>// Pulls the JSON data from csv-to-json.js and api-to-json.js and outputs them for ED3D

//Define Categories
var systemsData = {
	"categories": {
		"Points of Interest": {
			"100": {
				"name": "System",
				"color": "F7F7F7"
			},
			"101": {
				"name": "MegaShips",
				"color": "F7F7F7"
			}
		},
		"Barnacles": {
			"200": {
				"name": "Barnacle",
				"color": "F7F7F7"
			}
			// Disabled until output shows status
			/*			"200": {
			"name": "Ripe",
			"color": "F7F7F7"
			},
			"201": {
			"name": "Dead",
			"color": "F7F7F7"
			} */
		},
		"Brain Trees": {
			"300": {
				"name": "Brain Tree",
				"color": "F7F7F7"
			}
		},
		"Guardian Ruins": {
			"400": {
				"name": "Alpha",
				"color": "F7F7F7"
			},
			"401": {
				"name": "Beta",
				"color": "F7F7F7"
			},
			"402": {
				"name": "Gamma",
				"color": "F7F7F7"
			}
		},
		"Thargoid Structures": {
			"500": {
				"name": "Active",
				"color": "F7F7F7"
			},
			"501": {
				"name": "Inactive",
				"color": "F7F7F7"
			}
		}
	},
	"systems": [{
			"name": "Sol",
			"coords": {
				"x": "0",
				"y": "0",
				"z": "0"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Merope",
			"coords": {
				"x": "-78.59375",
				"y": "-149.625",
				"z": "-340.53125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "HIP 22460",
			"coords": {
				"x": "-41.3125",
				"y": "-58.96875",
				"z": "-354.78125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Col 173 Sector LJ-F C12-0 (The Cete)",
			"coords": {
				"x": "1202.125",
				"y": "-213.40625",
				"z": "-165.5625"
			},
			"cat": [
				"101"
			]
		},
	]
};

// Lets get data from CSV Files
function formatBN(data) {
	//Here you format BN JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var bnSite = {};
		bnSite["name"] = data[1];

		//Ripe or Dead Status not enabled yet, pending CSV fixes
		bnSite["cat"] = [200];
		bnSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(bnSite);

	}

}

function formatBT(data) {
	//Here you format BT JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var btSite = {};
		btSite["name"] = data[1];
		btSite["cat"] = [300];
		btSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(btSite);

	}

}

function formatTS(data) {
	//Here you format TS JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var tsSite = {};
		tsSite["name"] = data[1];

		//Check if Site is Active or Inactive, set Category to match
		if (data[8].toLowerCase() == "y") {
			tsSite["cat"] = [500];
		} else {
			tsSite["cat"] = [501];
		}
		tsSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(tsSite);

	}

}

function parseData(url, callBack, resolvePromise) {
    Papa.parse(url, {
        download: true,
        header: true,
        complete: function (results) {

            console.log(results);  // This is probably your data<commit_msg>Fixed .toLowercase()<commit_after>// Pulls the JSON data from csv-to-json.js and api-to-json.js and outputs them for ED3D

//Define Categories
var systemsData = {
	"categories": {
		"Points of Interest": {
			"100": {
				"name": "System",
				"color": "F7F7F7"
			},
			"101": {
				"name": "MegaShips",
				"color": "F7F7F7"
			}
		},
		"Barnacles": {
			"200": {
				"name": "Barnacle",
				"color": "F7F7F7"
			}
			// Disabled until output shows status
			/*			"200": {
			"name": "Ripe",
			"color": "F7F7F7"
			},
			"201": {
			"name": "Dead",
			"color": "F7F7F7"
			} */
		},
		"Brain Trees": {
			"300": {
				"name": "<NAME>",
				"color": "F7F7F7"
			}
		},
		"<NAME>": {
			"400": {
				"name": "Alpha",
				"color": "F7F7F7"
			},
			"401": {
				"name": "Beta",
				"color": "F7F7F7"
			},
			"402": {
				"name": "Gamma",
				"color": "F7F7F7"
			}
		},
		"Thargoid Structures": {
			"500": {
				"name": "Active",
				"color": "F7F7F7"
			},
			"501": {
				"name": "Inactive",
				"color": "F7F7F7"
			}
		}
	},
	"systems": [{
			"name": "Sol",
			"coords": {
				"x": "0",
				"y": "0",
				"z": "0"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Merope",
			"coords": {
				"x": "-78.59375",
				"y": "-149.625",
				"z": "-340.53125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "HIP 22460",
			"coords": {
				"x": "-41.3125",
				"y": "-58.96875",
				"z": "-354.78125"
			},
			"cat": [
				"100"
			]
		}, {
			"name": "Col 173 Sector LJ-F C12-0 (The Cete)",
			"coords": {
				"x": "1202.125",
				"y": "-213.40625",
				"z": "-165.5625"
			},
			"cat": [
				"101"
			]
		},
	]
};

// Lets get data from CSV Files
function formatBN(data) {
	//Here you format BN JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var bnSite = {};
		bnSite["name"] = data[1];

		//Ripe or Dead Status not enabled yet, pending CSV fixes
		bnSite["cat"] = [200];
		bnSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(bnSite);

	}

}

function formatBT(data) {
	//Here you format BT JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var btSite = {};
		btSite["name"] = data[1];
		btSite["cat"] = [300];
		btSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(btSite);

	}

}

function formatTS(data) {
	//Here you format TS JSON to ED3D acceptable object

	// this is assuming data is an array []
	for (var i = 0; i < data.length; i++) {
		var tsSite = {};
		tsSite["name"] = data[1];

		//Check if Site is Active or Inactive, set Category to match
		if (data[8].toString().toLowerCase() == "y") {
			tsSite["cat"] = [500];
		} else {
			tsSite["cat"] = [501];
		}
		tsSite["coords"] = {
			"x": data[5],
			"y": data[6],
			"z": data[7]
		};

		// We can then push the site to the object that stores all systems
		systemsData["systems"].push(tsSite);

	}

}

function parseData(url, callBack, resolvePromise) {
    Papa.parse(url, {
        download: true,
        header: true,
        complete: function (results) {

            console.log(results);  // This is probably your data
{'fraction_non_alphanumeric': 0.20971563981042654, 'fraction_numerical': 0.05568720379146919, 'mean_word_length': 2.349702380952381, 'pattern_counts': {'":': 146, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5179337', 'n_tokens_mistral': 3485, 'n_tokens_neox': 2742, 'n_words': 696}