Object

Object

The namespace for all UF/Object utility functions, typically for static methods.

Source:

Methods

(static) add(arg0_object, arg1_value) → {Object}

Adds a value to an object, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to add to each variable in the object.

Returns:
Type:
Object

(static) addGetterSetter(arg0_object, arg1_variable_string, arg2_optionsopt) → {Proxy}

Adds a getter/setter to a given variable string with a root object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_variable_string string
arg2_options Object <optional>
Name Type Attributes Description
get_function function <optional>
set_function function <optional>
Returns:
Type:
Proxy

(static) addObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Adds values between two objects, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) changeRange(arg0_object, arg1_key, arg2_min_max_argumentopt, arg3_value) → {Object}

Changes object ranges, non-recursively, for a given key.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object

The object to pass.

arg1_key string

The key corresponding to the range to modify.

arg2_min_max_argument string <optional>
"both"

Either 'minimum'/'maximum'/'both'.

arg3_value number

The number to change these ranges by.

Returns:
Type:
Object

(static) clean(arg0_object, arg1_optionsopt) → {Object}

Removes both zero values and undefined/null values from an object by default.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
remove_falsey boolean <optional>
false

Whether to remove falsey values.

remove_zeroes boolean <optional>
false

Whether to remove zero values from the cleaned object.

Returns:
Type:
Object

(static) computeNegativeDiff(arg0_prev_obj, arg1_next_obj) → {Object}

Computes object-level diff. Returns only the keys of 'prev_obj' whose values differ from or are absent in 'next_obj'. This is what gets stored in every non-head keyframe.

Source:
Parameters:
Name Type Description
arg0_prev_obj Object
arg1_next_obj Object
Returns:
Type:
Object

(static) concat(arg0_object, arg1_object) → {Object}

Recursively merges two objects, but only on undefined keys.

Source:
Parameters:
Name Type Description
arg0_object
arg1_object
Returns:
Type:
Object

(static) createSearch(arg0_optionsopt) → {function}

Creates a function to search an object regularly using a substring. Similar to Object.createSmartSearch, but creates a 'relevancy index' for each potential entry and affixes them to a return object.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
exclude_zero_relevance boolean <optional>
true

Whether to exclude entries with zero or less relevance from the end result.

function_name string <optional>

The function name to define this search as in the global namespace.

priority_compounding string <optional>
"multiplicative"

Either 'linear'/'multiplicative'.

priority_order Array.<string> <optional>

The order in which to search, both soft/hard. The first is the most important, the last is the least important. 'key' defines the base key. Note that these values compound on top of each other.

Returns:
Type:
function

(static) createSmartSearch(arg0_optionsopt) → {function}

Defines a smart search function off of which various attributes are checked in a specific order, both soft and hard.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
function_name string <optional>

The function name to define this search as in the global namespace.

priority_order Array.<string> <optional>

The order in which to search, both soft/hard. The first is the most important, the last is the least important. 'key' defines the base key.

hard_search boolean <optional>
true
soft_search boolean <optional>
true
Returns:
Type:
function

(static) cubicSplineInterpolation(arg0_object, arg1_optionsopt) → {Object}

Performs a cubic spline interpolation operation on an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
all_years boolean <optional>
false

Whether to interpolate for every single year in the domain.

years Array.<number> <optional>

The years to interpolate over if possible.

Returns:
Type:
Object

(static) cubicSplineInterpolationDomain(arg0_object) → {Object}

Performs cubic spline interpolation over the entire Object domain.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) deleteSmartSearch(arg0_name)

Deletes a smart search function.

Source:
Parameters:
Name Type Description
arg0_name string

The .function_name of the smart search to delete.

(static) divide(arg0_object, arg1_value) → {Object}

Divides an object by a value, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to divide each variable in the object by.

Returns:
Type:
Object

(static) divideObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Divides two objects, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) expandValue(arg0_object, arg1_optionsopt)

Expands a target value to its natural [min, max] boundaries, i.e. zero-values.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object.<number>
arg1_options Object <optional>
Name Type Attributes Default Description
expand_max boolean <optional>
true
expand_min boolean <optional>
true
value number <optional>
0

The value to expand.

(static) flatten(arg0_object) → {Object}

Moves all keys into the 1st nesting.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) generateRandomID(arg0_object) → {string}

Generates and returns a random unique ID given a specific object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
string

(static) getAverageDeviationFromObject(arg0_object, arg1_object) → {number}

Calculates the average deviation of one object from another based on domain.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_object Object
Returns:
Type:
number

(static) getDepth(arg0_object, arg1_depthopt)

Returns object depth as a number.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object

The object to fetch depth for.

arg1_depth number <optional>
1

Optimisation parameter used as an internal helper.

(static) getDomain(arg0_object) → {Array.<number>}

Returns the Object domain with [min, max] numbers.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Array.<number>

(static) getList(arg0_object_list) → {Array.<any>}

Returns the Object as an array list.

Source:
Parameters:
Name Type Description
arg0_object_list Object
Returns:
Type:
Array.<any>

(static) getMaximum(arg0_object, arg1_optionsopt) → {number}

Fetches the maximum value within an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
include_ranges boolean <optional>
false

Whether to include ranges.

recursive boolean <optional>
true

Whether function is recursive.

Returns:
Type:
number

(static) getMinimum(arg0_object, arg1_optionsopt) → {number}

Fetches the minimum value within an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
include_ranges boolean <optional>
false

Whether to include ranges.

recursive boolean <optional>
true

Whether function is recursive.

Returns:
Type:
number

(static) getNearestNegativeNumberToValue(arg0_object, arg1_key) → {number}

Returns the nearest negative number in an Object from a given value.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_key string
Returns:
Type:
number

(static) getNearestPositiveNumberToValue(arg0_object, arg1_key) → {number}

Returns the nearest positive number in an Object from a given value.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_key string
Returns:
Type:
number

(static) getSubobject(arg0_object, arg1_key, arg2_restrict_search) → {Object}

Fetches a subobject.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_key string

The key to recursively look for to fetch the local subobject.

arg2_restrict_search boolean

Whether to restrict the search to the 1st layer.

Returns:
Type:
Object

(static) getSubobjectKeys(arg0_object, arg1_optionsopt) → {Array.<string>}

Fetches the keys in a subobject that match the given criteria.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
exclude_keys Array.<string> <optional>

A list of keys to exclude

include_objects boolean <optional>
false

Whether to include object keys.

only_objects boolean <optional>
false

Whether to only include objects.

Returns:
Type:
Array.<string>

(static) getSum(arg0_object, arg1_optionsopt) → {number}

Fetches the object sum, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether to sum recursively.

Returns:
Type:
number

(static) getValue(arg0_object, arg1_variable_string) → {string}

Fetches a given value with a root object and variable string.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_variable_string string
Returns:
Type:
string

(static) hasKeys(arg0_object, arg1_keys, arg2_optionsopt) → {boolean}

Determines whether an object has all the keys mentioned.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_keys Array.<string>
arg2_options Object <optional>
Name Type Attributes Default Description
mode string <optional>
"all"

Either 'all'/'any'.

Returns:
Type:
boolean

(static) interpolateGT(arg0_object, arg1_object)

Interpolates and normalises data given an absolute Ground Truth (GT) and an absolute, but relativistic rates map.

Source:
Parameters:
Name Type Description
arg0_object Object.<number>

The Ground Truth (GT) map

arg1_object Object.<number>

The Relativistic Rates (RR) map

(static) interpolateNegatives(arg0_object) → {Object}

Interpolates negative values by carrying over the last positive value found.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) invertFraction(arg0_object) → {Object}

Inverts a fraction object, fetching the reciprocal of percentage values (1 - n).

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

Returns:
Type:
Object

(static) iterate(arg0_object, arg1_function, arg2_optionsopt)

Iterates over an object, with similar conventions to other Object static methods.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_function function | function
arg2_options Object <optional>
Name Type Attributes Description
sort_mode Object | string <optional>

Either 'ascending'/'descending'. Sorts object keys.

Name Type Attributes Default Description
key string <optional>

Refers to a subobject key to iterate by.

type string <optional>
"descending"

Either 'ascending'/'descending'.

(static) linearInterpolation(arg0_object, arg1_optionsopt) → {Object}

linearInterpolationObject() - Performs a linear interpolation operation on an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to perform the linear interpolation on.

arg1_options Object <optional>
Name Type Attributes Default Description
all_years boolean <optional>
false

Optional. Whether to interpolate for every single year in the domain.

years Array.<number> <optional>

Optional. The years to interpolate over if possible.

Returns:
Type:
Object

(static) mergeObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Merges two objects together.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_object Object
arg2_options Object <optional>
Name Type Attributes Default Description
must_have_difference boolean <optional>
false

Whether values must be different before they can be added/subtracted from one another.

overwrite boolean <optional>
false

Whether to overwrite objects when merging.

recursive boolean <optional>
false

Whether merging is recursive.

Returns:
Type:
Object

(static) modifyRanges(arg0_object, arg1_value, arg2_optionsopt) → {Object}

Modifies ranges in an object recursively, by operating on objects.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_value number

The value to modify ranges by.

arg2_options Object <optional>
Name Type Attributes Default Description
include_numbers boolean <optional>
true

Whether to include single numbers.

Returns:
Type:
Object

(static) modifyValue(arg0_object, arg1_key, arg2_number, arg3_delete_negativeopt) → {number}

Modifies a given value in an object by a numeric value.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object
arg1_key string
arg2_number number | string
arg3_delete_negative boolean <optional>
false

Whether to delete negative values.

Returns:
Type:
number

(static) multiply(arg0_object, arg1_value) → {Object}

Multiplies an object by a value, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to multiply each variable by.

Returns:
Type:
Object

(static) multiplyObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Multiplies an object recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) operate(arg0_object, arg1_equation, arg2_optionsopt) → {Object}

Performs an operation on a single object, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_equation string

The string literal to use as an equation ('n' = current value).

arg2_options Object <optional>
Name Type Attributes Default Description
log_errors boolean <optional>
false

Whether to log errors.

only_numbers boolean <optional>
true

Whether only numbers can be operated on.

recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) operateObjects(arg0_object, arg1_object, arg2_equation, arg3_optionsopt) → {Object}

Performs an operation on two objects together, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_equation string

The string literal ('i' = 1st obj, 'x' = 2nd obj).

arg3_options Object <optional>
Name Type Attributes Default Description
log_errors boolean <optional>
false

Whether to log errors.

only_numbers boolean <optional>
true

Whether only numbers can be operated on.

recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) removeZeroes(arg0_object) → {Object}

Removes zero values from an object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) serialise(arg0_object) → {Object}

Serialises a given object into a compatible object for hydration (i.e. browser-side).

Source:
Parameters:
Name Type Description
arg0_object Array | Object
Returns:
Type:
Object

(static) setValue(arg0_object, arg1_variable_string, arg2_value) → {any}

Sets a given value with a root object and variable string.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_variable_string string
arg2_value any
Returns:
Type:
any

(static) sort(arg0_object, arg1_optionsopt)

Sorts an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
type string <optional>
"descending"

The order to sort the object in. 'ascending'/'descending'.

(static) sortKeys(arg0_object, arg1_optionsopt) → {Object}

Sorts an object by their key's numeric values.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
type string <optional>
"descending"

The order to sort the object in. 'ascending'/'descending'. 'descending by default.

Returns:
Type:
Object

(static) sortYearValues(arg0_object) → {Object}

Sorts values chronologically by their year (key) per object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) standardiseFraction(arg0_object) → {Object}

Standardises the object to maximum = 1, adjusting all other values proportionally.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

Returns:
Type:
Object

(static) standardisePercentage(arg0_object, arg1_totalopt, arg2_roundopt) → {Object}

Standardises the object to a given total.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object

The object to pass.

arg1_total number <optional>
1

The total figure to adjust the object to.

arg2_round boolean <optional>
false

Whether to force rounding.

Returns:
Type:
Object

(static) strictRemoveDuplicates(arg0_object) → {Object}

Removes values with duplicate values in an object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) subtract(arg0_object, arg1_value) → {Object}

Subtracts a value from an object, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to subtract.

Returns:
Type:
Object

(static) subtractObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Subtracts one object from another, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object.

arg1_object Object

The 2nd object.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether recursive.

Returns:
Type:
Object

(static) toArray(arg0_object) → {Array.<any>}

Casts an object to array.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Array.<any>

(static) trimValue(arg0_object, arg1_optionsopt)

Trims a specific value from the start and/or end of an object map.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object.<number>
arg1_options Object <optional>
Name Type Attributes Default Description
trim_start boolean <optional>
true

Remove leading target values.

trim_end boolean <optional>
true

Remove trailing target values.

value number <optional>
0

The value to trim.

Object

The namespace for all UF/Object utility functions, typically for static methods.

Source:

Methods

(static) add(arg0_object, arg1_value) → {Object}

Adds a value to an object, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to add to each variable in the object.

Returns:
Type:
Object

(static) addGetterSetter(arg0_object, arg1_variable_string, arg2_optionsopt) → {Proxy}

Adds a getter/setter to a given variable string with a root object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_variable_string string
arg2_options Object <optional>
Name Type Attributes Description
get_function function <optional>
set_function function <optional>
Returns:
Type:
Proxy

(static) addObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Adds values between two objects, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) changeRange(arg0_object, arg1_key, arg2_min_max_argumentopt, arg3_value) → {Object}

Changes object ranges, non-recursively, for a given key.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object

The object to pass.

arg1_key string

The key corresponding to the range to modify.

arg2_min_max_argument string <optional>
"both"

Either 'minimum'/'maximum'/'both'.

arg3_value number

The number to change these ranges by.

Returns:
Type:
Object

(static) clean(arg0_object, arg1_optionsopt) → {Object}

Removes both zero values and undefined/null values from an object by default.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
remove_falsey boolean <optional>
false

Whether to remove falsey values.

remove_zeroes boolean <optional>
false

Whether to remove zero values from the cleaned object.

Returns:
Type:
Object

(static) computeNegativeDiff(arg0_prev_obj, arg1_next_obj) → {Object}

Computes object-level diff. Returns only the keys of 'prev_obj' whose values differ from or are absent in 'next_obj'. This is what gets stored in every non-head keyframe.

Source:
Parameters:
Name Type Description
arg0_prev_obj Object
arg1_next_obj Object
Returns:
Type:
Object

(static) concat(arg0_object, arg1_object) → {Object}

Recursively merges two objects, but only on undefined keys.

Source:
Parameters:
Name Type Description
arg0_object
arg1_object
Returns:
Type:
Object

(static) createSearch(arg0_optionsopt) → {function}

Creates a function to search an object regularly using a substring. Similar to Object.createSmartSearch, but creates a 'relevancy index' for each potential entry and affixes them to a return object.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
exclude_zero_relevance boolean <optional>
true

Whether to exclude entries with zero or less relevance from the end result.

function_name string <optional>

The function name to define this search as in the global namespace.

priority_compounding string <optional>
"multiplicative"

Either 'linear'/'multiplicative'.

priority_order Array.<string> <optional>

The order in which to search, both soft/hard. The first is the most important, the last is the least important. 'key' defines the base key. Note that these values compound on top of each other.

Returns:
Type:
function

(static) createSmartSearch(arg0_optionsopt) → {function}

Defines a smart search function off of which various attributes are checked in a specific order, both soft and hard.

Source:
Parameters:
Name Type Attributes Description
arg0_options Object <optional>
Name Type Attributes Default Description
function_name string <optional>

The function name to define this search as in the global namespace.

priority_order Array.<string> <optional>

The order in which to search, both soft/hard. The first is the most important, the last is the least important. 'key' defines the base key.

hard_search boolean <optional>
true
soft_search boolean <optional>
true
Returns:
Type:
function

(static) cubicSplineInterpolation(arg0_object, arg1_optionsopt) → {Object}

Performs a cubic spline interpolation operation on an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
all_years boolean <optional>
false

Whether to interpolate for every single year in the domain.

years Array.<number> <optional>

The years to interpolate over if possible.

Returns:
Type:
Object

(static) cubicSplineInterpolationDomain(arg0_object) → {Object}

Performs cubic spline interpolation over the entire Object domain.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) deleteSmartSearch(arg0_name)

Deletes a smart search function.

Source:
Parameters:
Name Type Description
arg0_name string

The .function_name of the smart search to delete.

(static) divide(arg0_object, arg1_value) → {Object}

Divides an object by a value, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to divide each variable in the object by.

Returns:
Type:
Object

(static) divideObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Divides two objects, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) expandValue(arg0_object, arg1_optionsopt)

Expands a target value to its natural [min, max] boundaries, i.e. zero-values.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object.<number>
arg1_options Object <optional>
Name Type Attributes Default Description
expand_max boolean <optional>
true
expand_min boolean <optional>
true
value number <optional>
0

The value to expand.

(static) flatten(arg0_object) → {Object}

Moves all keys into the 1st nesting.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) generateRandomID(arg0_object) → {string}

Generates and returns a random unique ID given a specific object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
string

(static) getAverageDeviationFromObject(arg0_object, arg1_object) → {number}

Calculates the average deviation of one object from another based on domain.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_object Object
Returns:
Type:
number

(static) getDepth(arg0_object, arg1_depthopt)

Returns object depth as a number.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object

The object to fetch depth for.

arg1_depth number <optional>
1

Optimisation parameter used as an internal helper.

(static) getDomain(arg0_object) → {Array.<number>}

Returns the Object domain with [min, max] numbers.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Array.<number>

(static) getList(arg0_object_list) → {Array.<any>}

Returns the Object as an array list.

Source:
Parameters:
Name Type Description
arg0_object_list Object
Returns:
Type:
Array.<any>

(static) getMaximum(arg0_object, arg1_optionsopt) → {number}

Fetches the maximum value within an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
include_ranges boolean <optional>
false

Whether to include ranges.

recursive boolean <optional>
true

Whether function is recursive.

Returns:
Type:
number

(static) getMinimum(arg0_object, arg1_optionsopt) → {number}

Fetches the minimum value within an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
include_ranges boolean <optional>
false

Whether to include ranges.

recursive boolean <optional>
true

Whether function is recursive.

Returns:
Type:
number

(static) getNearestNegativeNumberToValue(arg0_object, arg1_key) → {number}

Returns the nearest negative number in an Object from a given value.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_key string
Returns:
Type:
number

(static) getNearestPositiveNumberToValue(arg0_object, arg1_key) → {number}

Returns the nearest positive number in an Object from a given value.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_key string
Returns:
Type:
number

(static) getSubobject(arg0_object, arg1_key, arg2_restrict_search) → {Object}

Fetches a subobject.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_key string

The key to recursively look for to fetch the local subobject.

arg2_restrict_search boolean

Whether to restrict the search to the 1st layer.

Returns:
Type:
Object

(static) getSubobjectKeys(arg0_object, arg1_optionsopt) → {Array.<string>}

Fetches the keys in a subobject that match the given criteria.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
exclude_keys Array.<string> <optional>

A list of keys to exclude

include_objects boolean <optional>
false

Whether to include object keys.

only_objects boolean <optional>
false

Whether to only include objects.

Returns:
Type:
Array.<string>

(static) getSum(arg0_object, arg1_optionsopt) → {number}

Fetches the object sum, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether to sum recursively.

Returns:
Type:
number

(static) getValue(arg0_object, arg1_variable_string) → {string}

Fetches a given value with a root object and variable string.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_variable_string string
Returns:
Type:
string

(static) hasKeys(arg0_object, arg1_keys, arg2_optionsopt) → {boolean}

Determines whether an object has all the keys mentioned.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_keys Array.<string>
arg2_options Object <optional>
Name Type Attributes Default Description
mode string <optional>
"all"

Either 'all'/'any'.

Returns:
Type:
boolean

(static) interpolateGT(arg0_object, arg1_object)

Interpolates and normalises data given an absolute Ground Truth (GT) and an absolute, but relativistic rates map.

Source:
Parameters:
Name Type Description
arg0_object Object.<number>

The Ground Truth (GT) map

arg1_object Object.<number>

The Relativistic Rates (RR) map

(static) interpolateNegatives(arg0_object) → {Object}

Interpolates negative values by carrying over the last positive value found.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) invertFraction(arg0_object) → {Object}

Inverts a fraction object, fetching the reciprocal of percentage values (1 - n).

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

Returns:
Type:
Object

(static) iterate(arg0_object, arg1_function, arg2_optionsopt)

Iterates over an object, with similar conventions to other Object static methods.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_function function | function
arg2_options Object <optional>
Name Type Attributes Description
sort_mode Object | string <optional>

Either 'ascending'/'descending'. Sorts object keys.

Name Type Attributes Default Description
key string <optional>

Refers to a subobject key to iterate by.

type string <optional>
"descending"

Either 'ascending'/'descending'.

(static) linearInterpolation(arg0_object, arg1_optionsopt) → {Object}

linearInterpolationObject() - Performs a linear interpolation operation on an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to perform the linear interpolation on.

arg1_options Object <optional>
Name Type Attributes Default Description
all_years boolean <optional>
false

Optional. Whether to interpolate for every single year in the domain.

years Array.<number> <optional>

Optional. The years to interpolate over if possible.

Returns:
Type:
Object

(static) mergeObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Merges two objects together.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_object Object
arg2_options Object <optional>
Name Type Attributes Default Description
must_have_difference boolean <optional>
false

Whether values must be different before they can be added/subtracted from one another.

overwrite boolean <optional>
false

Whether to overwrite objects when merging.

recursive boolean <optional>
false

Whether merging is recursive.

Returns:
Type:
Object

(static) modifyRanges(arg0_object, arg1_value, arg2_optionsopt) → {Object}

Modifies ranges in an object recursively, by operating on objects.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_value number

The value to modify ranges by.

arg2_options Object <optional>
Name Type Attributes Default Description
include_numbers boolean <optional>
true

Whether to include single numbers.

Returns:
Type:
Object

(static) modifyValue(arg0_object, arg1_key, arg2_number, arg3_delete_negativeopt) → {number}

Modifies a given value in an object by a numeric value.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object
arg1_key string
arg2_number number | string
arg3_delete_negative boolean <optional>
false

Whether to delete negative values.

Returns:
Type:
number

(static) multiply(arg0_object, arg1_value) → {Object}

Multiplies an object by a value, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to multiply each variable by.

Returns:
Type:
Object

(static) multiplyObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Multiplies an object recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) operate(arg0_object, arg1_equation, arg2_optionsopt) → {Object}

Performs an operation on a single object, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The object to pass.

arg1_equation string

The string literal to use as an equation ('n' = current value).

arg2_options Object <optional>
Name Type Attributes Default Description
log_errors boolean <optional>
false

Whether to log errors.

only_numbers boolean <optional>
true

Whether only numbers can be operated on.

recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) operateObjects(arg0_object, arg1_object, arg2_equation, arg3_optionsopt) → {Object}

Performs an operation on two objects together, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object to pass.

arg1_object Object

The 2nd object to pass.

arg2_equation string

The string literal ('i' = 1st obj, 'x' = 2nd obj).

arg3_options Object <optional>
Name Type Attributes Default Description
log_errors boolean <optional>
false

Whether to log errors.

only_numbers boolean <optional>
true

Whether only numbers can be operated on.

recursive boolean <optional>
true

Whether the operation is recursive.

Returns:
Type:
Object

(static) removeZeroes(arg0_object) → {Object}

Removes zero values from an object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) serialise(arg0_object) → {Object}

Serialises a given object into a compatible object for hydration (i.e. browser-side).

Source:
Parameters:
Name Type Description
arg0_object Array | Object
Returns:
Type:
Object

(static) setValue(arg0_object, arg1_variable_string, arg2_value) → {any}

Sets a given value with a root object and variable string.

Source:
Parameters:
Name Type Description
arg0_object Object
arg1_variable_string string
arg2_value any
Returns:
Type:
any

(static) sort(arg0_object, arg1_optionsopt)

Sorts an object.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
type string <optional>
"descending"

The order to sort the object in. 'ascending'/'descending'.

(static) sortKeys(arg0_object, arg1_optionsopt) → {Object}

Sorts an object by their key's numeric values.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object
arg1_options Object <optional>
Name Type Attributes Default Description
type string <optional>
"descending"

The order to sort the object in. 'ascending'/'descending'. 'descending by default.

Returns:
Type:
Object

(static) sortYearValues(arg0_object) → {Object}

Sorts values chronologically by their year (key) per object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) standardiseFraction(arg0_object) → {Object}

Standardises the object to maximum = 1, adjusting all other values proportionally.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

Returns:
Type:
Object

(static) standardisePercentage(arg0_object, arg1_totalopt, arg2_roundopt) → {Object}

Standardises the object to a given total.

Source:
Parameters:
Name Type Attributes Default Description
arg0_object Object

The object to pass.

arg1_total number <optional>
1

The total figure to adjust the object to.

arg2_round boolean <optional>
false

Whether to force rounding.

Returns:
Type:
Object

(static) strictRemoveDuplicates(arg0_object) → {Object}

Removes values with duplicate values in an object.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Object

(static) subtract(arg0_object, arg1_value) → {Object}

Subtracts a value from an object, recursively.

Source:
Parameters:
Name Type Description
arg0_object Object

The object to pass.

arg1_value number

The value to subtract.

Returns:
Type:
Object

(static) subtractObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}

Subtracts one object from another, recursively.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object

The 1st object.

arg1_object Object

The 2nd object.

arg2_options Object <optional>
Name Type Attributes Default Description
recursive boolean <optional>
true

Whether recursive.

Returns:
Type:
Object

(static) toArray(arg0_object) → {Array.<any>}

Casts an object to array.

Source:
Parameters:
Name Type Description
arg0_object Object
Returns:
Type:
Array.<any>

(static) trimValue(arg0_object, arg1_optionsopt)

Trims a specific value from the start and/or end of an object map.

Source:
Parameters:
Name Type Attributes Description
arg0_object Object.<number>
arg1_options Object <optional>
Name Type Attributes Default Description
trim_start boolean <optional>
true

Remove leading target values.

trim_end boolean <optional>
true

Remove trailing target values.

value number <optional>
0

The value to trim.