D3.js bisector() Function
The bisector() Function in D3.js is used to returns a new bisector using the specified accessor or comparator function. This method can be used to bisect arrays of objects instead of being limited to simple arrays of primitives.
Parameters: This function accepts only one parameter which is mentioned above and described below:
- accessor/comparator: This parameter is the can be accessor or comparator function.
Return value: This function returns the new bisector.
Below given are a few examples of the above function.
Example 1: This program illustrates the use of d3.bisector() using the accessor parameters.
Example 2: This program illustrates the use of d3.bisector() using the comparator function parameters.