<commit_before>
(function(){

    var MAX_LABEL_WIDTH = 160;

    dw.visualization.register('bar-chart', 'raphael-chart', {

        render: function(el) {
            this.setRoot(el);

            var me = this, row = 0,
                dataset = me.dataset,
                sortBars = me.get('sort-values', false),
                reverse = me.get('reverse-order');
                // useNegativeColor = me.get('negative-color', false),
                // filterMissing = me.get('filter-missing-values', true);

            me.axesDef = me.axes();
            if (!me.axesDef) return;  // stop rendering here

            if (!_.isUndefined(me.get('selected-row'))) {
                row = me.get('selected-row', 0);
                row = row > me.axesDef.bars.length ? 0 : row;
            }
            me.__lastRow = row;
            if (!me.getBarColumn()) return;

            var sliceColumns = _.map(me.axesDef.bars, function(i) { return dataset.column(i); }),
                filter = dw.utils.filter(dw.utils.columnNameColumn(sliceColumns), row),
                filterUI = filter.ui(me);

            if (filterUI) {
                $('#header').append(filterUI);
                filter.change(function(val, i) {
                    me.__lastRow = i;
                    me.update(i);
                });
            }

            var c = me.initCanvas({
                h: Math.max(
                    dw.utils.getMaxChartHeight(el)+5,
                    18 * 1.35 * me.getMaxNumberOfBars() + 5
                )
            });
<commit_msg>fixed bar chart scrollbar bug<commit_after>
(function(){

    var MAX_LABEL_WIDTH = 160;

    dw.visualization.register('bar-chart', 'raphael-chart', {

        render: function(el) {
            this.setRoot(el);

            var me = this, row = 0,
                dataset = me.dataset,
                sortBars = me.get('sort-values', false),
                reverse = me.get('reverse-order');
                // useNegativeColor = me.get('negative-color', false),
                // filterMissing = me.get('filter-missing-values', true);

            me.axesDef = me.axes();
            if (!me.axesDef) return;  // stop rendering here

            if (!_.isUndefined(me.get('selected-row'))) {
                row = me.get('selected-row', 0);
                row = row > me.axesDef.bars.length ? 0 : row;
            }
            me.__lastRow = row;
            if (!me.getBarColumn()) return;

            var sliceColumns = _.map(me.axesDef.bars, function(i) { return dataset.column(i); }),
                filter = dw.utils.filter(dw.utils.columnNameColumn(sliceColumns), row),
                filterUI = filter.ui(me);

            if (filterUI) {
                $('#header').append(filterUI);
                filter.change(function(val, i) {
                    me.__lastRow = i;
                    me.update(i);
                });
            }

            var c = me.initCanvas({
                h: Math.max(
                    dw.utils.getMaxChartHeight(el)-5,
                    18 * 1.35 * me.getMaxNumberOfBars() + 5
                )
            });

{'fraction_non_alphanumeric': 0.13793103448275862, 'fraction_numerical': 0.008301404853128991, 'mean_word_length': 1.3734848484848485, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3221048', 'n_tokens_mistral': 938, 'n_tokens_neox': 855, 'n_words': 164}