<commit_before>(function ()
{
	'use strict';

	angular
		.module('PLMApp')
		.factory('DutchFlagView', DutchFlagView);

	function DutchFlagView()
	{
		var ctx;
		var canvasWidth;
		var canvasHeight;

		var service = {
			draw: draw,
		};

		return service;

		function initUtils(canvas, dutchFlagWorld)
		{
			ctx=canvas.getContext('2d');
			canvasWidth = canvas.width;
			canvasHeight = canvas.height;
		}

		function draw(canvas, dutchFlagWorld)
		{
			initUtils(canvas, dutchFlagWorld);
			ctx.beginPath();

			//draws egde of our drawArena
			ctx.strokeRect(0,0,canvasWidth,canvasHeight);
			ctx.closePath();

			
			drawRectangle(dutchFlagWorld);
			drawText(dutchFlagWorld);
			
		}


		function drawText(dutchFlagWorld)
		{
			ctx.beginPath();

			ctx.fillStyle = 'rgb(0,0,0)';
			ctx.font = '15px sans-serif';

			if(dutchFlagWorld.moveCount <= 1) {
				ctx.fillText(dutchFlagWorld.moveCount+' Move',5,25);
			}
			else {
				ctx.fillText(dutchFlagWorld.moveCount+ ' Moves',5,25);
			}
			ctx.closePath();
		}

		function drawRectangle(dutchFlagWorld)
		{
			//each rectangle has its height
			var heightUnit = canvasHeight / dutchFlagWorld.content.length;

			var width = canvasWidth;

			for(var i=0; i<dutchFlagWorld.content.length; i++)
			{
				//each rectangle takes place in the canvasHeight
				var y = heightUnit * i;

				ctx.beginPath();

				//to know the color of each rectangle, we are looking its value
				switch(dutchFlagWorld.content[i])
				{
					case 0 :
						ctx.fillStyle = '#0000FF';
						break;
					case 1 :
						ctx.fillStyle = '#FFFFFF';
						break;
					case 2 :
						ctx.fillStyle = '#FF0000';
						break;
				}

				//draws rectangles
				ctx.fillRect(0, y, width, heightUnit);
				ctx.closePath();

				ctx.beginPath();
				ctx.fillStyle = '#F00000';
				ctx.strokeRect(0,y,width,heightUnit);
				ctx.closePath();
			}
		}			
	}
})();<commit_msg>display the dutch flag in the right order (fix #127)<commit_after>(function ()
{
	'use strict';

	angular
		.module('PLMApp')
		.factory('DutchFlagView', DutchFlagView);

	function DutchFlagView()
	{
		var ctx;
		var canvasWidth;
		var canvasHeight;

		var service = {
			draw: draw,
		};

		return service;

		function initUtils(canvas, dutchFlagWorld)
		{
			ctx=canvas.getContext('2d');
			canvasWidth = canvas.width;
			canvasHeight = canvas.height;
		}

		function draw(canvas, dutchFlagWorld)
		{
			initUtils(canvas, dutchFlagWorld);
			ctx.beginPath();

			//draws egde of our drawArena
			ctx.strokeRect(0,0,canvasWidth,canvasHeight);
			ctx.closePath();

			
			drawRectangle(dutchFlagWorld);
			drawText(dutchFlagWorld);
			
		}


		function drawText(dutchFlagWorld)
		{
			ctx.beginPath();

			ctx.fillStyle = 'rgb(0,0,0)';
			ctx.font = '15px sans-serif';

			if(dutchFlagWorld.moveCount <= 1) {
				ctx.fillText(dutchFlagWorld.moveCount+' Move',5,25);
			}
			else {
				ctx.fillText(dutchFlagWorld.moveCount+ ' Moves',5,25);
			}
			ctx.closePath();
		}

		function drawRectangle(dutchFlagWorld)
		{
			//each rectangle has its height
			var heightUnit = canvasHeight / dutchFlagWorld.content.length;

			var width = canvasWidth;

			for(var i=0; i<dutchFlagWorld.content.length; i++)
			{
				//each rectangle takes place in the canvasHeight
				var y = heightUnit * (dutchFlagWorld.content.length- i-1);

				ctx.beginPath();

				//to know the color of each rectangle, we are looking its value
				switch(dutchFlagWorld.content[i])
				{
					case 0 :
						ctx.fillStyle = '#0000FF';
						break;
					case 1 :
						ctx.fillStyle = '#FFFFFF';
						break;
					case 2 :
						ctx.fillStyle = '#FF0000';
						break;
				}

				//draws rectangles
				ctx.fillRect(0, y, width, heightUnit);
				ctx.closePath();

				ctx.beginPath();
				ctx.fillStyle = '#F00000';
				ctx.strokeRect(0,y,width,heightUnit);
				ctx.closePath();
			}
		}			
	}
})();
{'fraction_non_alphanumeric': 0.13141524105754276, 'fraction_numerical': 0.01866251944012442, 'mean_word_length': 2.957948717948718, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4891414', 'n_tokens_mistral': 1730, 'n_tokens_neox': 1320, 'n_words': 270}