<commit_before>/// <reference path="../../typings/moment/moment.d.ts" />
/// <reference path="idatarow.ts" />

var start:moment.Moment;


// record the start of the visualization for performance analysis
start = moment();
console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: script starts');



function doit(data: IDataRow[]) {

    let hist1                 : OneDimensionalHistogram;
    let hist2                 : OneDimensionalHistogram;
    let map                   : Map;
    let punchcardDateCircle   : PunchcardDateCircle;
    let punchcardDateRect     : PunchcardDateRect;
    let punchcardWeekdayCircle: PunchcardWeekdayCircle;
    let punchcardWeekdayRect  : PunchcardWeekdayRect;
    let spiral                : Spiral;

    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: doit() starts');

    let cf:CrossFilter.CrossFilter<IDataRow> = crossfilter(data);
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: crossfilter object done');

    // draw the histogram using the crossfilter object and dc.js dc.barChart()
    hist1 = new OneDimensionalHistogram(cf, 'hist1-arrests-per-day');
    hist1.defineDimensions();
    hist1.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: oneDimensionalHistogram1 done');

    // draw the punchcard-weekday with svg circles using the crossfilter object and D3
    punchcardWeekdayCircle = new PunchcardWeekdayCircle(cf, 'punchcard-weekday-circle');
    punchcardWeekdayCircle.defineDimensions();
    punchcardWeekdayCircle.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardWeekdayCircle done');

    // draw the punchcard-weekday with svg rects using the crossfilter object and D3
    punchcardWeekdayRect = new PunchcardWeekdayRect(cf, 'punchcard-weekday-rect');
    punchcardWeekdayRect.defineDimensions();
    punchcardWeekdayRect.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardWeekdayRect done');

    // draw the punchcard-date with svg circles using the crossfilter object and D3
    punchcardDateCircle = new PunchcardDateCircle(cf, 'punchcard-date-circle');
    punchcardDateCircle.defineDimensions();
    punchcardDateCircle.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardDateCircle done');

    // draw the punchcard-date with svg rects using the crossfilter object and D3
    punchcardDateRect = new PunchcardDateRect(cf, 'punchcard-date-rect');
    punchcardDateRect.defineDimensions();
    punchcardDateRect.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardDateRect done');

    // spiral = new Spiral('spiral');
    // spiral.data = data;
    // spiral.render();
    // console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: spiral done');

    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: doit() done');

};




// make a new dataloader
let dataloader: DataLoader = new DataLoader();

// configure the dataloader
dataloader.limit = 5000;

// set the offset to a large value to get to the more recent records (the
// results are sorted by increasing date); the more recent records are more
// likely to have valid coordinates.
dataloader.offset = 5559000;

// load the data
dataloader.loadData(doit);<commit_msg>removed no longer needed stuff<commit_after>/// <reference path="../../typings/moment/moment.d.ts" />
/// <reference path="idatarow.ts" />

var start:moment.Moment;


// record the start of the visualization for performance analysis
start = moment();
console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: script starts');



function doit(data: IDataRow[]) {

    let punchcardDateCircle   : PunchcardDateCircle;
    let punchcardDateRect     : PunchcardDateRect;
    let punchcardWeekdayCircle: PunchcardWeekdayCircle;
    let punchcardWeekdayRect  : PunchcardWeekdayRect;

    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: doit() starts');

    let cf:CrossFilter.CrossFilter<IDataRow> = crossfilter(data);
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: crossfilter object done');

    // draw the punchcard-weekday with svg circles using the crossfilter object and D3
    punchcardWeekdayCircle = new PunchcardWeekdayCircle(cf, 'punchcard-weekday-circle');
    punchcardWeekdayCircle.defineDimensions();
    punchcardWeekdayCircle.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardWeekdayCircle done');

    // draw the punchcard-weekday with svg rects using the crossfilter object and D3
    punchcardWeekdayRect = new PunchcardWeekdayRect(cf, 'punchcard-weekday-rect');
    punchcardWeekdayRect.defineDimensions();
    punchcardWeekdayRect.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardWeekdayRect done');

    // draw the punchcard-date with svg circles using the crossfilter object and D3
    punchcardDateCircle = new PunchcardDateCircle(cf, 'punchcard-date-circle');
    punchcardDateCircle.defineDimensions();
    punchcardDateCircle.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardDateCircle done');

    // draw the punchcard-date with svg rects using the crossfilter object and D3
    punchcardDateRect = new PunchcardDateRect(cf, 'punchcard-date-rect');
    punchcardDateRect.defineDimensions();
    punchcardDateRect.draw();
    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: punchcardDateRect done');

    console.log('+' + moment().diff(start, 'second', true).toFixed(3) + ' s: doit() done');

};


// make a new dataloader
let dataloader: DataLoader = new DataLoader();

// configure the dataloader
dataloader.limit = 5000;

// set the offset to a large value to get to the more recent records (the
// results are sorted by increasing date); the more recent records are more
// likely to have valid coordinates.
dataloader.offset = 5559000;

// load the data
dataloader.loadData(doit);
{'fraction_non_alphanumeric': 0.1372867587327376, 'fraction_numerical': 0.008935824532900082, 'mean_word_length': 4.075020610057708, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6921397', 'n_tokens_mistral': 1934, 'n_tokens_neox': 1919, 'n_words': 485}