<commit_before>/*globals d3*/

// Tool that generates SVG filters that can recolor images
// to whatever color we need.
// Usage: CSS styles should do something like this:
// -webkit-filter: url(#recolorImageToFFFFFF)
// filter: url(#recolorImageToFFFFFF)

window.shims = window.shims || {};
window.shims.recolorImageFilters = function (colorList) {
    var svgDefs = d3.select('body').append('svg')
        .attr('id', 'recolorImageFilters')
        .append('defs');

    // Collect all colors in use
    var allColors = {};
    Object.keys(colorList).forEach(function (colorName) {
        var color = colorList[colorName];
        if (!allColors.hasOwnProperty(color)) {
            allColors[color] = [];
        }
        allColors[color].push(colorName);
    });

    var recolorFilters = svgDefs.selectAll('filter.recolor')
        .data(Object.keys(allColors), function (d) {
            return d;
        });
    var recolorFiltersEnter = recolorFilters.enter().append('filter')
        .attr('class', 'recolor')
        .attr('id', function (d) {<commit_msg>Fix extra scrollable space on the image gallery<commit_after>/*globals d3*/

// Tool that generates SVG filters that can recolor images
// to whatever color we need.
// Usage: CSS styles should do something like this:
// -webkit-filter: url(#recolorImageToFFFFFF)
// filter: url(#recolorImageToFFFFFF)

window.shims = window.shims || {};
window.shims.recolorImageFilters = function (colorList) {
    var svgDefs = d3.select('body').append('svg')
        .attr('id', 'recolorImageFilters')
        .attr('width', '0')
        .attr('height', '0')
        .append('defs');
    // TODO: can svg element be hidden properly, not just made 0x0?

    // Collect all colors in use
    var allColors = {};
    Object.keys(colorList).forEach(function (colorName) {
        var color = colorList[colorName];
        if (!allColors.hasOwnProperty(color)) {
            allColors[color] = [];
        }
        allColors[color].push(colorName);
    });

    var recolorFilters = svgDefs.selectAll('filter.recolor')
        .data(Object.keys(allColors), function (d) {
            return d;
        });
    var recolorFiltersEnter = recolorFilters.enter().append('filter')
        .attr('class', 'recolor')
        .attr('id', function (d) {
{'fraction_non_alphanumeric': 0.14422657952069717, 'fraction_numerical': 0.003485838779956427, 'mean_word_length': 2.9180887372013653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5538200', 'n_tokens_mistral': 702, 'n_tokens_neox': 702, 'n_words': 164}