<commit_before>import sparklineChart from 'britecharts/dist/umd/sparkline.min';
import {select} from 'd3-selection';
import {validateConfiguration, validateContainer} from '../helpers/validation';
import {applyConfiguration} from '../helpers/configuration';

//TODO: Implement the correct loading state(line, bar, and donut are the available options atm)
import { line as sparklineLoadingState } from 'britecharts/dist/umd/loading.min';

const sparkline = {};

sparkline.create = (el, data, configuration = {}) => {
    let container = select(el);
    let chart = sparklineChart();

    validateContainer(container);
    validateConfiguration(chart, configuration);

    // Calls the chart with the container and dataset
    container.datum(data).call(applyConfiguration(chart, configuration));

    return chart;
};

sparkline.update = (el, data, configuration = {}, chart) => {
    let container = select(el);

    validateContainer(container);
    validateConfiguration(chart, configuration);<commit_msg>removed todo comment<commit_after>import sparklineChart from 'britecharts/dist/umd/sparkline.min';
import {select} from 'd3-selection';
import {validateConfiguration, validateContainer} from '../helpers/validation';
import {applyConfiguration} from '../helpers/configuration';

import { line as sparklineLoadingState } from 'britecharts/dist/umd/loading.min';

const sparkline = {};

sparkline.create = (el, data, configuration = {}) => {
    let container = select(el);
    let chart = sparklineChart();

    validateContainer(container);
    validateConfiguration(chart, configuration);

    // Calls the chart with the container and dataset
    container.datum(data).call(applyConfiguration(chart, configuration));

    return chart;
};

sparkline.update = (el, data, configuration = {}, chart) => {
    let container = select(el);

    validateContainer(container);
    validateConfiguration(chart, configuration);
{'fraction_non_alphanumeric': 0.12207792207792208, 'fraction_numerical': 0.001038961038961039, 'mean_word_length': 5.037617554858934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5986657', 'n_tokens_mistral': 509, 'n_tokens_neox': 499, 'n_words': 137}