enterprise-modules/grid-charts/dist/es6/charts/util/bisect.js
/**
 * A specialized version of `bisectLeft` that works with the arrays whose elements cannot be compared directly.
 * The map function is used instead to produce a comparable value for a given array element, then the values
 * returned by the map are compared using the `ascendingComparator`.
 * @param list
 * @param x
 * @param map
 * @param lo
 * @param hi
 */
A specialized version of `bisectLeft` that works with the arrays whose elements cannot be compared directly.
The map function is used instead to produce a comparable value for a given array element, then the values
returned by the map are compared using the `ascendingComparator`.
A specialized version of ` bisectLeft ` that works with the arrays whose elements cannot be compared directly . The map function is used instead to produce a comparable value for a given array element then the values returned by the map are compared using the ` ascendingComparator ` .
function complexBisectLeft(list, x, map, lo, hi) {
    if (lo === void 0) { lo = 0; }
    if (hi === void 0) { hi = list.length; }
    var comparator = ascendingComparator(map);
    while (lo < hi) {
        var mid = (lo + hi) >>> 1;
        if (comparator(list[mid], x) < 0) {
            lo = mid + 1;
        }
        else {
            hi = mid;
        }
    }
    return lo;
}
function complexBisectLeft ( list , x , map , lo , hi ) { if ( lo === void 0 ) { lo = 0 ; } if ( hi === void 0 ) { hi = list . length ; } var comparator = ascendingComparator ( map ) ; while ( lo < hi ) { var mid = ( lo + hi ) >>> 1 ; if ( comparator ( list [ mid ] , x ) < 0 ) { lo = mid + 1 ; } else { hi = mid ; } } return lo ; }
A specialized version of `bisectLeft` that works with the arrays whose elements cannot be compared directly.
A specialized version of ` bisectLeft ` that works with the arrays whose elements cannot be compared directly .