src/data/DataProvider.js
function(data) {
        // Data indexing
        this._rtree = rbush(9);
        data = data || [];
        var array = [];
        var that = this;
        function index(d) {
            var bbox = that._getBoundingBox(d);
            if (bbox) {
                var key = that._toIndexKey(bbox);
                key.data = d;
                array.push(key);
            }
        }
        if (typeof data === 'function') {
            data = data();
        }
        if (typeof data.forEach === 'function') {
            data.forEach(index);
        } else if (data.length) {
            for (var i = 0; i < data.length; i++) {
                index(data[i]);
            }
        }
        this._rtree.load(array);
    }
function(data) {
        // Data indexing
        this._rtree = rbush(9);
        data = data || [];
        var array = [];
        var that = this;
        function index(d) {
            var bbox = that._getBoundingBox(d);
            if (bbox) {
                var key = that._toIndexKey(bbox);
                key.data = d;
                array.push(key);
            }
        }
        if (typeof data === 'function') {
            data = data();
        }
        if (typeof data.forEach === 'function') {
            data.forEach(index);
        } else if (data.length) {
            for (var i = 0; i < data.length; i++) {
                index(data[i]);
            }
        }
        this._rtree.load(array);
    }
function ( data ) { // Data indexing this . _rtree = rbush ( 9 ) ; data = data || [ ] ; var array = [ ] ; var that = this ; function index ( d ) { var bbox = that . _getBoundingBox ( d ) ; if ( bbox ) { var key = that . _toIndexKey ( bbox ) ; key . data = d ; array . push ( key ) ; } } if ( typeof data === 'function' ) { data = data ( ) ; } if ( typeof data . forEach === 'function' ) { data . forEach ( index ) ; } else if ( data . length ) { for ( var i = 0 ; i < data . length ; i ++ ) { index ( data [ i ] ) ; } } this . _rtree . load ( array ) ; }
Indexes the specified data array using a RTree index.
Indexes the specified data array using a RTree index .