Class: Util

Util()

Util contains static utility functions for CompGeo and functional calls

Constructor

new Util()

Source:

Methods

(static) bounding(r1, r2) → {Rectangle}

Return the larger bounding rectangle of two rectangles
Parameters:
Name Type Description
r1 Rectangle Rectangle 1
r2 Rectangle Rectangle 2
Source:
Returns:
The bounding rectangle containing both r1 and r2
Type
Rectangle

(static) debounce(func, wait) → {function}

Debounce a function. This means that the function can be called repeatedly during a timeout, but will only execute once after the timeout.
Parameters:
Name Type Description
func function The function to call
wait integer The time to wait in µs
Source:
Returns:
The debounced function
Type
function

(static) delay(func, wait, …args) → {integer}

Delay calling a function by a specific time in µs
Parameters:
Name Type Attributes Description
func function The function to call
wait integer The time to wait in µs
args args <repeatable>
The arguments to the function
Source:
Returns:
The setTimeout indentifier
Type
integer

(static) intersects(r1, r2) → {Boolean}

Return true if two rectangles intersect
Parameters:
Name Type Description
r1 Rectangle Rectangle 1
r2 Rectangle Rectangle 2
Source:
Returns:
True if the rectangles intersect
Type
Boolean

(static) sortBy(arr, p)

Sort an array of objects in order by a property
Parameters:
Name Type Description
arr Array.<Object> The array of objects
p String The property name
Source: