<commit_before><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('img.chart.Chart');

  // Alignment
  define('CHART_HORIZONTAL',  0x0000);
  define('CHART_VERTICAL',    0x0001);
  
  // Distance
  define('DISTANCE_AUTO',     -1);
  
  // Ranges
  define('RANGE_AUTO',        -1);
  
  /**
   * Bar chart
   *
   * @see      xp://img.chart.Chart
   * @purpose  Chart
   */
  class BarChart extends Chart {
    var
      $alignment = CHART_HORIZONTAL,
      $barWidth  = 20,
      $distance  = DISTANCE_AUTO,
      $range     = array(RANGE_AUTO, RANGE_AUTO, RANGE_AUTO),
      $accumulated= FALSE;

    /**
     * Helper method which returns the largest value from all series
     *
     * @access  public
     * @return  float
     */
    function max() {
      if (!$this->getAccumulated()) return parent:: max();
      
      $max= array();
      for ($i= 0, $s= sizeof($this->series); $i < $s; $i++) {
        for ($j= 0, $c= sizeof($this->series[$i]->values); $j < $c; $j++) {
          $max[$j] += $this->series[$i]->values[$j];
        }
      }
      return max($max);
    }

    /**
     * Helper method which returns the smallest value from all series
     *
     * @access  public
     * @return  float
     */
    function min() {
      if ($this->getAccumulated()) return parent::min();

      $min= array();
      for ($i= 0, $s= sizeof($this->series); $i < $s; $i++) {
        for ($j= 0, $c= sizeof($this->series[$i]->values); $j < $c; $j++) {
          $min[$j] += $this->series[$i]->values[$j];
        }
      }
      return min($min) < 0 ? min($min) : 0;
    }

    /**<commit_msg>- removed space in "parent:: max()"<commit_after><?php
/* This class is part of the XP framework
 *
 * $Id$ 
 */

  uses('img.chart.Chart');

  // Alignment
  define('CHART_HORIZONTAL',  0x0000);
  define('CHART_VERTICAL',    0x0001);
  
  // Distance
  define('DISTANCE_AUTO',     -1);
  
  // Ranges
  define('RANGE_AUTO',        -1);
  
  /**
   * Bar chart
   *
   * @see      xp://img.chart.Chart
   * @purpose  Chart
   */
  class BarChart extends Chart {
    var
      $alignment = CHART_HORIZONTAL,
      $barWidth  = 20,
      $distance  = DISTANCE_AUTO,
      $range     = array(RANGE_AUTO, RANGE_AUTO, RANGE_AUTO),
      $accumulated= FALSE;

    /**
     * Helper method which returns the largest value from all series
     *
     * @access  public
     * @return  float
     */
    function max() {
      if (!$this->getAccumulated()) return parent::max();
      
      $max= array();
      for ($i= 0, $s= sizeof($this->series); $i < $s; $i++) {
        for ($j= 0, $c= sizeof($this->series[$i]->values); $j < $c; $j++) {
          $max[$j] += $this->series[$i]->values[$j];
        }
      }
      return max($max);
    }

    /**
     * Helper method which returns the smallest value from all series
     *
     * @access  public
     * @return  float
     */
    function min() {
      if ($this->getAccumulated()) return parent::min();

      $min= array();
      for ($i= 0, $s= sizeof($this->series); $i < $s; $i++) {
        for ($j= 0, $c= sizeof($this->series[$i]->values); $j < $c; $j++) {
          $min[$j] += $this->series[$i]->values[$j];
        }
      }
      return min($min) < 0 ? min($min) : 0;
    }

    /**
{'fraction_non_alphanumeric': 0.1883614088820827, 'fraction_numerical': 0.01225114854517611, 'mean_word_length': 2.0353159851301115, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, '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': '1351158', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1143, 'n_words': 270}