<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@essex/toolbox](./toolbox.md)

## toolbox package

## Classes

|  Class | Description |
|  --- | --- |
|  [EventEmitter](./toolbox.eventemitter.md) | A mixin that adds support for event emitting |

## Functions

|  Function | Description |
|  --- | --- |
|  [binarySearch(array, item, compare)](./toolbox.binarysearch.md) | Performs a binary search on the given array |
|  [DEFAULT\_COMPARE(item1, item2)](./toolbox.default_compare.md) | Performs numerical comparison |
|  [deferred()](./toolbox.deferred.md) | <p>Represents a deferred object, which can be resolved /\*</p><p>/\*\* Creates a new deferred promise</p> |
|  [delay(myDelay)](./toolbox.delay.md) | Returns a promise that will resolve after the given delay, useful for async/await i.e. await delay(100) execute() |
|  [flatMap(arr)](./toolbox.flatmap.md) | Flattens a multi dimensional array |
|  [parseRgbFromCssColor(colorInput)](./toolbox.parsergbfromcsscolor.md) | Creates RGB color object from HEX color string |
|  [throttle(func, wait, options)](./toolbox.throttle.md) | Debounces function based on options provided |

## Interfaces

|  Interface | Description |
|  --- | --- |
|  [Bin](./toolbox.bin.md) | The Bin holds an array of values that match the bounding criteria, along with an additional pair of properties indicating that bounding. |
|  [Deferred](./toolbox.deferred.md) |  |
|  [HashMap](./toolbox.hashmap.md) | A interface describing a hashmap |
|  [ThrottleOptions](./toolbox.throttleoptions.md) |  |

## Variables

|  Variable | Description |
|  --- | --- |
|  [eventEmitter](./toolbox.eventemitter.md) |  |
|  [histogram](./toolbox.histogram.md) | <p>Creates a histogram from an array of objects. The histogram will be populated with numeric values. If your input data is not numeric, supply an accessor function. By default, a standard equal-interval histogram will be created. If the quantize parameter is set, it will instead use quantiles (i.e., equal-length bins). If you are quantizing, you can also set a smooth parameter to indicate that breaks in the data should try to minimize variance.</p><p>Note on quantiles: the bin count and length are ideals, but not guaranteed. The way the quantiles are calculated, a precise number of bins can't be guaranteed unless you will accept empty bins. For example, if your dataset is \[1,1,1,1,1,2,2\], you will always only get back two bins. Depending on the data distribution, we also may not be able to assure each bin is the same length as the others. Using the same example dataset, here we would have one bin with 5 items, and the other with 2. We \_could\_ split them evenly and put some of the 1s in the 2 bin, but that seems less preferable.</p> |
|  [interpolate](./toolbox.interpolate.md) | Interpolates a data list, filling in the specified multiple. This returns a list of numberic values. The input does not have to be numeric, but if it isn't an accessor function should be supplied. Note that this just performs linear interpolation |

## Type Aliases

|  Type Alias | Description |
|  --- | --- |
|  [Dictionary](./toolbox.dictionary.md) | An alias to HashMap |
|  [Histogram](./toolbox.histogram.md) | A Histogram is just an array of Bins. This follows the d3 format, so these outputs can be used as drop-ins to any code that expects a d3-style histogram. |

