<commit_before>{% extends "chart-editor.twig" %}

{% block content %}

{{ parent() }}

<script type="text/javascript">
$(function() {

    var chart = DW.currentChart;

    chart.onChange(reload);

    chart.sync('#has-horizontal-headers', 'metadata.data.horizontal-header');
    // vertical header setting will be synched after data has loaded
    chart.sync('#describe-source-name', 'metadata.describe.source-name');
    chart.sync('#describe-source-url', 'metadata.describe.source-url');
    chart.sync('input:radio[name=transpose]', 'metadata.data.transpose');

    chart.sync('#number-format', 'metadata.describe.number-format');
    chart.sync('#number-divisor', 'metadata.describe.number-divisor');
    chart.sync('#number-append', 'metadata.describe.number-append');
    chart.sync('#number-prepend', 'metadata.describe.number-prepend');

    // swap between currency and unit
    function swapUnitAndCurrency() {
        if ($('#number-format').val()[0] == 'c') {
            $('#number-currency').show();
            $('#number-unit').hide();
        } else {
            $('#number-currency').hide();
            $('#number-unit').show();
        }
       //$('#number-currency, #number-unit, #number-divisor').attr('disabled', $('#number-format').val() == '-');
    }
    $('#number-format').change(swapUnitAndCurrency);
    swapUnitAndCurrency();

    // update currency in number-format select
    function updateCurrencyInNumberFormat() {
        var curOpt = $('#number-format option[value=c], #number-format option[value=c0]');
        Globalize.culture("{{ chartLocale }}").numberFormat.currency.symbol = $('#number-currency option:selected').data('symbol');
        curOpt.each(function(i, el) {
            el = $(el);
            el.html(Globalize.format(1234.56, el.val()));
        });
    }
    updateCurrencyInNumberFormat();
    $('#number-currency').change(updateCurrencyInNumberFormat);

    // update data table after format changes
    $('.number-format').change(function() {
        updateTable(DW.dataView, chart);
    });

    function updateTable(dataset, chart) {

        function isNone(val) {
            return val === null || val === undefined || (_.isNumber(val) && isNaN(val));
        }<commit_msg>minor bugfix<commit_after>{% extends "chart-editor.twig" %}

{% block content %}

{{ parent() }}

<script type="text/javascript">
$(function() {

    var chart = DW.currentChart;

    chart.onChange(reload);

    chart.sync('#has-horizontal-headers', 'metadata.data.horizontal-header');
    // vertical header setting will be synched after data has loaded
    chart.sync('#describe-source-name', 'metadata.describe.source-name');
    chart.sync('#describe-source-url', 'metadata.describe.source-url');
    chart.sync('input:radio[name=transpose]', 'metadata.data.transpose');

    chart.sync('#number-format', 'metadata.describe.number-format');
    chart.sync('#number-divisor', 'metadata.describe.number-divisor');
    chart.sync('#number-append', 'metadata.describe.number-append');
    chart.sync('#number-prepend', 'metadata.describe.number-prepend');

    // swap between currency and unit
    function swapUnitAndCurrency() {
        if ($('#number-format').val()[0] == 'c') {
            $('#number-currency').show();
            $('#number-unit').hide();
        } else {
            $('#number-currency').hide();
            $('#number-unit').show();
        }
       //$('#number-currency, #number-unit, #number-divisor').attr('disabled', $('#number-format').val() == '-');
    }
    $('#number-format').change(swapUnitAndCurrency);
    swapUnitAndCurrency();

    // update currency in number-format select
    function updateCurrencyInNumberFormat() {
        var curOpt = $('#number-format option[value=c], #number-format option[value=c0]');
        Globalize.culture("{{ chartLocale }}").numberFormat.currency.symbol = $('#number-currency option:selected').data('symbol');
        curOpt.each(function(i, el) {
            el = $(el);
            el.html(Globalize.format(1234.567, el.val()));
        });
    }
    updateCurrencyInNumberFormat();
    $('#number-currency').change(updateCurrencyInNumberFormat);

    // update data table after format changes
    $('.number-format').change(function() {
        updateTable(DW.dataset, chart);
    });

    function updateTable(dataset, chart) {

        function isNone(val) {
            return val === null || val === undefined || (_.isNumber(val) && isNaN(val));
        }
{'fraction_non_alphanumeric': 0.1883508145503236, 'fraction_numerical': 0.0037937960276723946, 'mean_word_length': 3.2848948374760996, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6318984', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1254, 'n_words': 215}