<commit_before>var DinamicTable = function(settings) {
	self = this;
	var lastSync = 0;
	var rows = [];
	var tableElement;
	var tableIsFocused = false;
	var lastSortedAscending = false;
	var filters = [];

	var cellRenderer = function(value, row, column, rowData) {
		return value;
	}

	var headRenderer = function(columnData) {
		return '<th style="width: ' + columnData['width'] + '">' + columnData['name'] + '</th>';
	}

	var defaultSettings = {
		container: null,
		url: null,
		source: null,
		refreshInterval: 0,
		paginable: false,
		pageItemCount: null, 
		multipleSelect: false,
		manualOrder: false,
		columns: [],
		idColumn: 'id',
		onRowClick: null,
		onRowClicked: null,
		onRowDblClick: null,
		onRowDblClicked: null,
		onKeyPress: null,
		onKeyPressed: null,
		onRender: null,
		onRendered: null,
		onDataFetch: null,
		onDataFetched: null
	}

	var defaultColumnSettings = {
		name: '',
		source: '',
		type: 'string',
		active: true,
		sortable: false,
		width: 'auto',
		class: '',
		cellRenderer: cellRenderer,
		headRenderer: headRenderer,
	};

	//---------------------------------- Init ---------------------------------------------

	settings = _.extend({}, defaultSettings, settings);
	if (_.isArray(settings.columns)) {
	
		settings.columns.forEach(function (column, index) {
			settings.columns[index] = _.extend( {}, defaultColumnSettings, column);
		});
	}
console.log('settings', settings);
	init();
	refreshData();
<commit_msg>Add autorefresh table at interval<commit_after>var DinamicTable = function(settings) {
	self = this;
	var lastSync = 0;
	var rows = [];
	var tableElement;
	var tableIsFocused = false;
	var lastSortedAscending = false;
	var filters = [];

	var cellRenderer = function(value, row, column, rowData) {
		return value;
	}

	var headRenderer = function(columnData) {
		return '<th style="width: ' + columnData['width'] + '">' + columnData['name'] + '</th>';
	}

	var defaultSettings = {
		container: null,
		url: null,
		source: null,
		refreshInterval: 0,
		paginable: false,
		pageItemCount: null, 
		multipleSelect: false,
		manualOrder: false,
		columns: [],
		idColumn: 'id',
		onRowClick: null,
		onRowClicked: null,
		onRowDblClick: null,
		onRowDblClicked: null,
		onKeyPress: null,
		onKeyPressed: null,
		onRender: null,
		onRendered: null,
		onDataFetch: null,
		onDataFetched: null
	}

	var defaultColumnSettings = {
		name: '',
		source: '',
		type: 'string',
		active: true,
		sortable: false,
		width: 'auto',
		class: '',
		cellRenderer: cellRenderer,
		headRenderer: headRenderer,
	};

	var refreshFunctionHandler;
	//---------------------------------- Init ---------------------------------------------

	settings = _.extend({}, defaultSettings, settings);
	if (_.isArray(settings.columns)) {
	
		settings.columns.forEach(function (column, index) {
			settings.columns[index] = _.extend( {}, defaultColumnSettings, column);
		});
	}
console.log('settings', settings);
	init();
	refreshData();

	if (settings.refreshInterval > 0) {
		refreshFunctionHandler = setInterval(refreshData, settings.refreshInterval);
	}

{'fraction_non_alphanumeric': 0.18403115871470302, 'fraction_numerical': 0.0016228497241155468, 'mean_word_length': 3.3347398030942337, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '7513428', 'n_tokens_mistral': 1078, 'n_tokens_neox': 980, 'n_words': 238}