<commit_before>package com.echo.holographlibrary;

/*
 * 	   Created by <NAME>
 * 	   <EMAIL>
 * 	   <EMAIL>
 * 
 * 		adapted by DroidsOnRoids
 * 
 * 	   Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
 */

import java.util.ArrayList;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.RectF;
import android.graphics.Region;
import android.util.AttributeSet;
import android.view.View;

public class PieGraph extends View
{

	private ArrayList< PieSlice > slices = new ArrayList< PieSlice >();
	private Paint paint = new Paint();
	private Path path = new Path();

	private int indexSelected = -1;
	private int thickness = 50;
	private OnSliceClickedListener listener;

	protected int valueUsed;
	protected int valueLimit;
	protected int color;
	protected final int colorUsed = Color.parseColor( "#d8d8d8" );
	protected final int colorOverused = Color.parseColor( "#b4b4b4" );
	protected boolean unlimited;
	protected boolean defaultChart;
	protected String defaultText;

	public PieGraph ( Context context )
	{
		super( context );
	}

	public PieGraph ( Context context, AttributeSet attrs )
	{
		super( context, attrs );
	}

	@Override
	public void onDraw ( Canvas canvas )
	{
		canvas.drawColor( Color.TRANSPARENT );
		paint.reset();
		paint.setAntiAlias( true );
		float midX, midY, radius, innerRadius;
		path.reset();

		float currentAngle = 270;
		float currentSweep = 0;
		int totalValue = 0;
		float padding = 0;//2;

		midX = getWidth() / 2;
		midY = getHeight() / 2;
		if ( midX < midY )
		{
			radius = midX;
		}
		else
		{
			radius = midY;
		}<commit_msg>fix for small chart values<commit_after>package com.echo.holographlibrary;

/*
 * 	   Created by <NAME>
 * 	   <EMAIL>
 * 	   <EMAIL>
 * 
 * 		adapted by DroidsOnRoids
 * 
 * 	   Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
 */

import java.util.ArrayList;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.RectF;
import android.graphics.Region;
import android.util.AttributeSet;
import android.view.View;

public class PieGraph extends View
{

	private ArrayList< PieSlice > slices = new ArrayList< PieSlice >();
	private Paint paint = new Paint();
	private Path path = new Path();

	private int indexSelected = -1;
	private int thickness = 50;
	private OnSliceClickedListener listener;

	protected int valueUsed;
	protected int valueLimit;
	protected int color;
	protected final int colorUsed = Color.parseColor( "#d8d8d8" );
	protected final int colorOverused = Color.parseColor( "#b4b4b4" );
	protected boolean unlimited;
	protected boolean defaultChart;
	protected String defaultText;

	public PieGraph ( Context context )
	{
		super( context );
	}

	public PieGraph ( Context context, AttributeSet attrs )
	{
		super( context, attrs );
	}

	@Override
	public void onDraw ( Canvas canvas )
	{
		canvas.drawColor( Color.TRANSPARENT );
		paint.reset();
		paint.setAntiAlias( true );
		float midX, midY, radius, innerRadius;
		path.reset();

		float currentAngle = 270;
		float currentSweep = 0;
		float totalValue = 0;
		float padding = 0;//2;

		midX = getWidth() / 2;
		midY = getHeight() / 2;
		if ( midX < midY )
		{
			radius = midX;
		}
		else
		{
			radius = midY;
		}
{'fraction_non_alphanumeric': 0.07987409010426913, 'fraction_numerical': 0.008656305331497147, 'mean_word_length': 3.4017316017316017, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3822432', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1433, 'n_words': 534}