<commit_before><?php

namespace ATPViz\Widget;

class DataTable extends \ATPViz\Widget\AbstractWidget
{
	public function __construct()
	{
		parent::__construct();
		
		$this->setTemplate('atp-viz/widget/dataTable.phtml');
	}

	public function getClasses($row)
	{
		$classes = array();
		if(isset($this->classFields))
		{
			foreach($this->classFields as $field)
			{
				$value = $row[$field];
				$method = "get{$field}Class";
				if(method_exists($this, $method)) $value = $this->$method($value);
				
				$classes[] = str_replace(" ", "-", "{$field}-{$value}");
			}
		}
		
		return implode(" ", $classes);
	}
	
	public function getSampleData()
	{
		return array(
			'columns' => array('First Column', 'Second Column', 'Third Column'),
			'data' => array(
				array(1, 2, 3),
				array(4, 5, 6),
				array(7, 8, 9)
			)
		);
	}
}<commit_msg>Clean up data table value-based row classes<commit_after><?php

namespace ATPViz\Widget;

class DataTable extends \ATPViz\Widget\AbstractWidget
{
	public function __construct()
	{
		parent::__construct();
		
		$this->setTemplate('atp-viz/widget/dataTable.phtml');
	}

	public function getClasses($row)
	{
		$classes = array();
		if(isset($this->classFields))
		{
			foreach($this->classFields as $field)
			{
				$value = $row[$field];
				$method = "get{$field}Class";
				if(method_exists($this, $method)) $value = $this->$method($value);
				
				$class = str_replace(array("/", " "), "-", trim("{$field}-{$value}"));
				while(strpos($class, "--") !== false) $class = str_replace("--", "-", $class);
				$classes[] = $class;
			}
		}
		
		return implode(" ", $classes);
	}
	
	public function getSampleData()
	{
		return array(
			'columns' => array('First Column', 'Second Column', 'Third Column'),
			'data' => array(
				array(1, 2, 3),
				array(4, 5, 6),
				array(7, 8, 9)
			)
		);
	}
}
{'fraction_non_alphanumeric': 0.20054347826086957, 'fraction_numerical': 0.009782608695652175, 'mean_word_length': 3.568238213399504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '2207610', 'n_tokens_mistral': 777, 'n_tokens_neox': 643, 'n_words': 129}