packages/d3fc-sample/site/demo.js
function strategyInterceptor(strategy) {
    var interceptor = function(layout) {
        var start = new Date().getMilliseconds();
        var finalLayout = strategy(data);
        var time = new Date().getMilliseconds() - start;

        // record some statistics on this strategy
        if (!interceptor.time) {
            Object.defineProperty(interceptor, 'time', { enumerable: false, writable: true });
        }
        interceptor.time = time;
        return finalLayout;
    };

    interceptor.bucketSize = function() {
        return strategy.bucketSize.apply(this, arguments);
    };

    return interceptor;
}
function strategyInterceptor(strategy) {
    var interceptor = function(layout) {
        var start = new Date().getMilliseconds();
        var finalLayout = strategy(data);
        var time = new Date().getMilliseconds() - start;

        // record some statistics on this strategy
        if (!interceptor.time) {
            Object.defineProperty(interceptor, 'time', { enumerable: false, writable: true });
        }
        interceptor.time = time;
        return finalLayout;
    };

    interceptor.bucketSize = function() {
        return strategy.bucketSize.apply(this, arguments);
    };

    return interceptor;
}
function strategyInterceptor ( strategy ) { var interceptor = function ( layout ) { var start = new Date ( ) . getMilliseconds ( ) ; var finalLayout = strategy ( data ) ; var time = new Date ( ) . getMilliseconds ( ) - start ; // record some statistics on this strategy if ( ! interceptor . time ) { Object . defineProperty ( interceptor , 'time' , { enumerable : false , writable : true } ) ; } interceptor . time = time ; return finalLayout ; } ; interceptor . bucketSize = function ( ) { return strategy . bucketSize . apply ( this , arguments ) ; } ; return interceptor ; }
we intercept the strategy in order to capture the final layout and compute statistics
we intercept the strategy in order to capture the final layout and compute statistics