Docs ▸ API Reference ▸ helper
These functions were originally collected from multiple places (jQuery, lodash, ...) for usage in d3Kit core library. Since they are also useful for building visualizations in general, we also expose them to the API.
- helper.debounce(func, delay) - returns a debounced function with given delay.
- helper.deepExtend(dest, src1, src2, ...) - Recursively merge the contents of two or more objects together into the first object. Works similarly to
jQuery.extend(true, target, obj1, obj2, ...) - helper.extend(dest, src1, src2, ...) - Merge the contents of two or more objects together into the first object. Works similarly to
jQuery.extend(target, obj1, obj2, ...) - helper.functor(valueOrFunc) - If value is not a function, returns a function that returns the value. Otherwise returns the function.
- helper.isObject(value) - returns
trueif value is an object. - helper.isFunction(value) - returns
trueif value is a function. - helper.kebabCase(string) - converts any string into
kebab-case - helper.throttle(func, delay) - returns a throttled function with given delay.