web/timeline.js
// Uses 'visits' array to efficiently render execution steps
Uses 'visits' array to efficiently render execution steps
Uses ' visits ' array to efficiently render execution steps
function render_dots(first_step, current_step, margin, line_height) {
    var d = 1, s = 1;
    for(l = 0; l < visits.length; l++){         
        var i = visits[l].bisect(first_step);
        var step = visits[l][i];
        while(screen_pos(step) < screen_pos(first_step) + 650){
            dots[d].x = screen_pos(step) - 4;
            dots[d].y = margin + l * line_height;
            if(step < current_step){
                dots[d].tint = (1 << 24) - 1;
            } else {
                dots[d].tint = (100 << 16) + (100 << 8) + 100;
            }
            while(true) {
                var gap = screen_pos(visits[l][i + s]) - screen_pos(visits[l][i]);
                var split = (visits[l][i] < current_step) != (visits[l][i + s] < current_step)
                if(!(gap < 8) || split) {
                    if(s == 1){
                        break;
                    } else {
                        s /= 2;
                    }
                } else {
                    i += s;
                    s *= 2;
                }
            }
            dots[d].scale.x = screen_pos(visits[l][i]) - screen_pos(step) + 8;
            step = visits[l][++i];
            if(++d >= 3000){
                return; 
            }
        }
    }
}
function render_dots ( first_step , current_step , margin , line_height ) { var d = 1 , s = 1 ; for ( l = 0 ; l < visits . length ; l ++ ) { var i = visits [ l ] . bisect ( first_step ) ; var step = visits [ l ] [ i ] ; while ( screen_pos ( step ) < screen_pos ( first_step ) + 650 ) { dots [ d ] . x = screen_pos ( step ) - 4 ; dots [ d ] . y = margin + l * line_height ; if ( step < current_step ) { dots [ d ] . tint = ( 1 << 24 ) - 1 ; } else { dots [ d ] . tint = ( 100 << 16 ) + ( 100 << 8 ) + 100 ; } while ( true ) { var gap = screen_pos ( visits [ l ] [ i + s ] ) - screen_pos ( visits [ l ] [ i ] ) ; var split = ( visits [ l ] [ i ] < current_step ) != ( visits [ l ] [ i + s ] < current_step ) if ( ! ( gap < 8 ) || split ) { if ( s == 1 ) { break ; } else { s /= 2 ; } } else { i += s ; s *= 2 ; } } dots [ d ] . scale . x = screen_pos ( visits [ l ] [ i ] ) - screen_pos ( step ) + 8 ; step = visits [ l ] [ ++ i ] ; if ( ++ d >= 3000 ) { return ; } } } }
Uses 'visits' array to efficiently render execution steps
Uses ' visits ' array to efficiently render execution steps
// Draw dots line by line // Ran out of dots!