<commit_before>var CORSURLPrefix;

$(window).load(function() {
    if ($('.se-pre-load').is(':visible')) {
        $('.panel').hide();
    }
});

$(function() {
    var url;
    CORSURLPrefix = 'https://cors-anywhere.herokuapp.com/';
    url = 'https://api.coinmarketcap.com/v1/ticker?limit=100';
    $.getJSON(CORSURLPrefix + url, handleGetJSONResponseTickerAPI);
});

function handleGetJSONResponseTickerAPI(data) {
    var traceData, mkt_cap_threshold, day_vol_threshold;
    mkt_cap_threshold = Math.pow(10, 6);  // Only want mkt cap >= $1M
    day_vol_threshold = 5000;  // Only want trading vol >= $5K
    traceData = {
        'type': 'scatter', 'mode': 'markers', 'hoverinfo': 'text',
        'x': [], 'y': [], 'text': [], 'marker': {'size': []}
    };
    $.each(data, function (index, value) {
        if (value['market_cap_usd'] >= mkt_cap_threshold && 
            value['24h_volume_usd'] >= day_vol_threshold) {        
            traceData['x'].push(value['market_cap_usd']);
            traceData['y'].push((value['24h_volume_usd'] / value['market_cap_usd']) * 100);
            traceData['text'].push(value['name']);
            traceData['marker']['size'].push(Math.log(value['24h_volume_usd'] / 10)); // Why / 10? To better show relative size.
        };
    });
    $('.se-pre-load').hide();
    $('.panel').delay(1500).show();
    initiateChart([traceData]);
}

// Chart<commit_msg>Filter only on daily trade volume.<commit_after>var CORSURLPrefix;

$(window).load(function() {
    if ($('.se-pre-load').is(':visible')) {
        $('.panel').hide();
    }
});

$(function() {
    var url;
    CORSURLPrefix = 'https://cors-anywhere.herokuapp.com/';
    url = 'https://api.coinmarketcap.com/v1/ticker?limit=100';
    $.getJSON(CORSURLPrefix + url, handleGetJSONResponseTickerAPI);
});

function handleGetJSONResponseTickerAPI(data) {
    var traceData, mkt_cap_threshold, day_vol_threshold;
    day_vol_threshold = 5000;  // Only want trading vol >= $5K
    traceData = {
        'type': 'scatter', 'mode': 'markers', 'hoverinfo': 'text',
        'x': [], 'y': [], 'text': [], 'marker': {'size': []}
    };
    $.each(data, function (index, value) {
        if (value['24h_volume_usd'] >= day_vol_threshold) {
            traceData['x'].push(value['market_cap_usd']);
            traceData['y'].push((value['24h_volume_usd'] / value['market_cap_usd']) * 100);
            traceData['text'].push(value['name']);
            traceData['marker']['size'].push(Math.log(value['24h_volume_usd'] / 10)); // Why / 10? To better show relative size.
        };
    });
    $('.se-pre-load').hide();
    $('.panel').delay(1500).show();
    initiateChart([traceData]);
}

// Chart
{'fraction_non_alphanumeric': 0.20833333333333334, 'fraction_numerical': 0.020833333333333332, 'mean_word_length': 3.2213500784929354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 4, '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': '4299614', 'n_tokens_mistral': 947, 'n_tokens_neox': 905, 'n_words': 146}