<commit_before>var LINE_GAP = 1.5, // Degrees
		LINE_WIDTH = 6;

var LINE_OPACITY = 1.0,
		OTHERS_LINE_COLOUR = "rgba( 255, 255, 255, " + LINE_OPACITY + " )",
		NO_DATA_STYLE = "rgba( 0, 0, 1, 0.5 )",
		segColourPalette = [
	"rgba( 61, 232, 50, 1.0 )",
	"rgba( 0, 178, 255, 1.0 )",
	"rgba( 195, 98, 235, 1.0 )",
	"rgba( 0, 221, 245, 1.0 )",
	"rgba( 255, 72, 190, 1.0 )"
];

// Shadow contributes to this so it might be more opaque than expected if using shadow
var CIRCLE_OPACITY = 0.1;

// Warning: too much blur might lead to clipping at edges of canvas element
var SHADOW_BLUR = 10,
		SHADOW_OPACITY = 0.5;

//------------------------------------------------------------------------------

var canvas = document.getElementById( "circle-canvas" );
var ctx = canvas.getContext( "2d" );

ctx.shadowColor = "rgba( 0, 0, 0, " + SHADOW_OPACITY + " )";
ctx.shadowBlur = SHADOW_BLUR;

// different centre and radius to allow for buffer around circle for shadow etc
var c = canvas.width / 2,
		r = ( canvas.width - 60 ) / 2;

// Usage eg: var circle = $( "#circle-canvas" ).circle();
//           circle.drawLangaugeSegments( [30, 25, 20, 15, 10] );
$.fn.circle = function() {

	var $circle = this;

	$circle.drawLangaugeSegments = function( circlePortions, drawOthers ) {
		var ctx = canvas.getContext( "2d" );
		ctx.clearRect( 0, 0, canvas.width, canvas.height );

		ctx.beginPath();
		ctx.fillStyle = "rgba( 0, 0, 0, " + CIRCLE_OPACITY + " )";
		ctx.arc( c, c, r, 0, 2 * Math.PI );
		ctx.fill();

		ctx.save();
		ctx.translate( 0, c * 2 );
		ctx.rotate( 3 * Math.PI / 2 );
		ctx.lineWidth = LINE_WIDTH;
		var lastAngle = 0;
		var numOfSegs = circlePortions.length;
		var gap = LINE_GAP * 2 * Math.PI / 360;

		if ( true || circlePortions.length === 0 ) {
			ctx.strokeStyle = NO_DATA_STYLE;
			ctx.beginPath();
			ctx.arc( c, c, r, 0, 2 * Math.PI );
			ctx.stroke();
		} else {
			for ( var i = 0; i < numOfSegs; i++ ) {
				/*var shade = Math.floor( 255 * ( numOfSegs - i ) / numOfSegs );<commit_msg>Fixed Circle Bug.<commit_after>var LINE_GAP = 1.5, // Degrees
		LINE_WIDTH = 6;

var LINE_OPACITY = 1.0,
		OTHERS_LINE_COLOUR = "rgba( 255, 255, 255, " + LINE_OPACITY + " )",
		NO_DATA_STYLE = "rgba( 0, 0, 1, 0.5 )",
		segColourPalette = [
	"rgba( 61, 232, 50, 1.0 )",
	"rgba( 0, 178, 255, 1.0 )",
	"rgba( 195, 98, 235, 1.0 )",
	"rgba( 0, 221, 245, 1.0 )",
	"rgba( 255, 72, 190, 1.0 )"
];

// Shadow contributes to this so it might be more opaque than expected if using shadow
var CIRCLE_OPACITY = 0.1;

// Warning: too much blur might lead to clipping at edges of canvas element
var SHADOW_BLUR = 10,
		SHADOW_OPACITY = 0.5;

//------------------------------------------------------------------------------

var canvas = document.getElementById( "circle-canvas" );
var ctx = canvas.getContext( "2d" );

ctx.shadowColor = "rgba( 0, 0, 0, " + SHADOW_OPACITY + " )";
ctx.shadowBlur = SHADOW_BLUR;

// different centre and radius to allow for buffer around circle for shadow etc
var c = canvas.width / 2,
		r = ( canvas.width - 60 ) / 2;

// Usage eg: var circle = $( "#circle-canvas" ).circle();
//           circle.drawLangaugeSegments( [30, 25, 20, 15, 10] );
$.fn.circle = function() {

	var $circle = this;

	$circle.drawLangaugeSegments = function( circlePortions, drawOthers ) {
		var ctx = canvas.getContext( "2d" );
		ctx.clearRect( 0, 0, canvas.width, canvas.height );

		ctx.beginPath();
		ctx.fillStyle = "rgba( 0, 0, 0, " + CIRCLE_OPACITY + " )";
		ctx.arc( c, c, r, 0, 2 * Math.PI );
		ctx.fill();

		ctx.save();
		ctx.translate( 0, c * 2 );
		ctx.rotate( 3 * Math.PI / 2 );
		ctx.lineWidth = LINE_WIDTH;
		var lastAngle = 0;
		var numOfSegs = circlePortions.length;
		var gap = LINE_GAP * 2 * Math.PI / 360;

		if (circlePortions.length === 0 ) {
			ctx.strokeStyle = NO_DATA_STYLE;
			ctx.beginPath();
			ctx.arc( c, c, r, 0, 2 * Math.PI );
			ctx.stroke();
		} else {
			for ( var i = 0; i < numOfSegs; i++ ) {
				/*var shade = Math.floor( 255 * ( numOfSegs - i ) / numOfSegs );
{'fraction_non_alphanumeric': 0.19919819594086696, 'fraction_numerical': 0.057128539213229766, 'mean_word_length': 2.5931593159315933, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2054885', 'n_tokens_mistral': 1827, 'n_tokens_neox': 1508, 'n_words': 437}