<commit_before><html>
<head>
	<link href="lib/c3.css" rel="stylesheet" type="text/css">
	<link href="lib/bootstrap.min.css" rel="stylesheet" type="text/css">

	<script src="peg-0.8.0.min.js" type="text/javascript"></script>
	<script src="parser.js" type="text/javascript"></script>

	<script type="text/javascript">
		function parse() {
			var text = document.getElementById("input").value;
			//console.log(text);
			var output = JSON.stringify(parser.parse(text), null, 4); 
			console.log(output);

			document.getElementById("tree").style.display = 'none';
			document.getElementById("code").innerHTML = output;
		}
	</script>	
</head>

<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-5 col-md-offset-1">
				<h3>Chart code</h3>
				<textarea id="input" name="input" class="form-control" rows="20"></textarea>
				<input class="btn btn-default" style="margin-top:10px" type="submit" value="Compile" onclick="parse()">
			</div>
		
			<div class="col-md-5 col-md-offset-0">
				<h3>Tree</h3>
				<p id="tree">Parse tree will appear here</p>
				<pre id="code"></pre>
				</div>
			</div>
	</div>
</body>
</html>



</head>
<body><commit_msg>PegJS-JSON output is now an input for c3js, working chart<commit_after><html>
<head>
	<link href="lib/c3.css" rel="stylesheet" type="text/css">
	<link href="lib/bootstrap.min.css" rel="stylesheet" type="text/css">

	<script src="lib/d3.min.js" charset="utf-8"></script>
	<script src="lib/c3.js" type="text/javascript"></script>
	<script src="peg-0.8.0.min.js" type="text/javascript"></script>
	<script src="parser.js" type="text/javascript"></script>

	<script type="text/javascript">
		function parse() {
			var text = document.getElementById("input").value;
			var parsed = parser.parse(text)
			var output = JSON.stringify(parsed, null, 4); 

			document.getElementById("tree").style.display = 'none';
			document.getElementById("code").innerHTML = output;

        	var modData = [];
        	var chartType = (parsed[1].value).toString()
         	var labels
         	var parsedJson = parsed

           	parsed[0].array.forEach(function(d, i) {
           		console.log(d)
             	var item = [d.type];
               	item.push(d.value);
             	modData.push(item);
			});


           	var chart = c3.generate({
            	data: {
             	json: modData, type: chartType,
             }
           });


		}
	</script>	
</head>

<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-5 col-md-offset-1">
				<h3>Chart code</h3>
				<textarea id="input" name="input" class="form-control" rows="20">
#data: 1,2,3
#type: bar
#color: red</textarea>
				<input class="btn btn-default" style="margin-top:10px" type="submit" value="Compile" onclick="parse()"><br/><br/>

			<div id="chart" class="col-md-12 col-md-offset-0" style="height:500px;">
					
				</div>


			</div>
		
			<div class="col-md-5 col-md-offset-0">
				<h3>Tree</h3>
				<p id="tree">Parse tree will appear here</p>
				<pre id="code"></pre>
			</div>

		</div>
	</div>
</body>
</html>



</head>
<body>
{'fraction_non_alphanumeric': 0.19903069466882067, 'fraction_numerical': 0.01615508885298869, 'mean_word_length': 3.2065217391304346, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, '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': '2422014', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1082, 'n_words': 209}