<commit_before>'use strict';

$(document).ready(function() {
    //json data that we intend to update later on via on-screen controls
    var split_by_data;
    
    var torso = {};
    torso.width = 375;
    torso.height = 200;
    torso.right = 20;

    var trunk = {};
    trunk.width = 320;
    trunk.height = 150;
    trunk.left = 35;
    trunk.right = 10;
    trunk.xax_count = 5;

    var small = {};
    small.width = 240;
    small.height = 140;
    small.left = 20;
    small.right = 20;
    small.top = 20;
    small.xax_count = 5;

    assignEventListeners();


    //few observations
    d3.json('data/missing-y.json', function(data) {
        var fff = d3.time.format('%Y-%m-%d');
        for(var i=0;i<data.length;i++) {
            var d = data[i];
            d['date'] = fff.parse(d['date']);
        }

        //add a line chart that has a few observations
        moz_chart({
            title: "Few Observations",
            description: "We sometimes have only a few observations. By setting <i>missing_is_zero: true</i>, missing values for a time-series will be interpreted as zeros. In this example, we've override the rollover callback to show 'no date' for missing observations.",
            data: data,
            interpolate: 'basic',
            missing_is_zero: true,
            width: torso.width,
            height: torso.height,
            right: torso.right,
            target: '#missing-y',
            x_accessor: 'date',
            y_accessor: 'value',
            rollover_callback: function(d, i) {
                var df = d3.time.format('%b %d, %Y');
                var date = df(d['date']);
                var y_val = (d.value == 0) ? 'no data' : d.value;

                $('#missing-y svg .active_datapoint')
                    .html(date +  '   ' + y_val);
            }
        })
    });

    d3.json('data/small-range.json', function(data) {
        var fff = d3.time.format('%Y-%m-%d');
        for(var i=0;i<data.length;i++) {
            var d = data[i];
            d['date'] = fff.parse(d['date']);
        }

        //small range
        moz_chart({
            title: "Small Range of Ints",
            description: "When we have a data object of integers and a small range of values, the auto-generated set of y-axis ticks are filtered so that we don't include fractional values.",
            data: data,
            interpolate: 'basic',
            width: torso.width,
            height: torso.height,
            right: torso.right,
            target: '#small-range',
            x_accessor: 'date',
            y_accessor: 'value'
        })
    });

    d3.json('data/fake_users1.json', function(data) {
        var fff = d3.time.format('%Y-%m-%d');
        for(var i=0;i<data.length;i++) {
            var d = data[i];
            d['date'] = fff.parse(d['date']);
        }

        var fake_baselines = [{value:160000000, label:'a baseline'}]<commit_msg>Updated 'Small Range' chart's title<commit_after>'use strict';

$(document).ready(function() {
    //json data that we intend to update later on via on-screen controls
    var split_by_data;
    
    var torso = {};
    torso.width = 375;
    torso.height = 200;
    torso.right = 20;

    var trunk = {};
    trunk.width = 320;
    trunk.height = 150;
    trunk.left = 35;
    trunk.right = 10;
    trunk.xax_count = 5;

    var small = {};
    small.width = 240;
    small.height = 140;
    small.left = 20;
    small.right = 20;
    small.top = 20;
    small.xax_count = 5;

    assignEventListeners();


    //few observations
    d3.json('data/missing-y.json', function(data) {
        var fff = d3.time.format('%Y-%m-%d');
        for(var i=0;i<data.length;i++) {
            var d = data[i];
            d['date'] = fff.parse(d['date']);
        }

        //add a line chart that has a few observations
        moz_chart({
            title: "Few Observations",
            description: "We sometimes have only a few observations. By setting <i>missing_is_zero: true</i>, missing values for a time-series will be interpreted as zeros. In this example, we've override the rollover callback to show 'no date' for missing observations.",
            data: data,
            interpolate: 'basic',
            missing_is_zero: true,
            width: torso.width,
            height: torso.height,
            right: torso.right,
            target: '#missing-y',
            x_accessor: 'date',
            y_accessor: 'value',
            rollover_callback: function(d, i) {
                var df = d3.time.format('%b %d, %Y');
                var date = df(d['date']);
                var y_val = (d.value == 0) ? 'no data' : d.value;

                $('#missing-y svg .active_datapoint')
                    .html(date +  '   ' + y_val);
            }
        })
    });

    d3.json('data/small-range.json', function(data) {
        var fff = d3.time.format('%Y-%m-%d');
        for(var i=0;i<data.length;i++) {
            var d = data[i];
            d['date'] = fff.parse(d['date']);
        }

        //small range
        moz_chart({
            title: "Small Range of Integers",
            description: "When we have a data object of integers and a small range of values, the auto-generated set of y-axis ticks are filtered so that we don't include fractional values.",
            data: data,
            interpolate: 'basic',
            width: torso.width,
            height: torso.height,
            right: torso.right,
            target: '#small-range',
            x_accessor: 'date',
            y_accessor: 'value'
        })
    });

    d3.json('data/fake_users1.json', function(data) {
        var fff = d3.time.format('%Y-%m-%d');
        for(var i=0;i<data.length;i++) {
            var d = data[i];
            d['date'] = fff.parse(d['date']);
        }

        var fake_baselines = [{value:160000000, label:'a baseline'}]
{'fraction_non_alphanumeric': 0.13929419748897184, 'fraction_numerical': 0.017984390906006106, 'mean_word_length': 1.7872340425531914, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2514925', 'n_tokens_mistral': 1938, 'n_tokens_neox': 1803, 'n_words': 483}