utils.nf.graph-event Class
Event object for graph events
Item Index
Properties
Methods
identity
-
x
returns whatever you pass into it.
Parameters:
-
xAny
Returns:
x
natualSort
-
arr
Sorts the array "naturally". Meaning taking into account both alphabetical and numeric sorting within strings.
Parameters:
-
arrArraythe array to sort
naturalCompare
-
a -
b
A JavaScript sorting predicate for natural sorting.
Parameters:
-
aAnythe value to compare to b
-
bAnythe value to compare to a
Returns:
-1, 0 or 1 if a is less than, equal to, or
greater than b, respectively.
naturalTokenize
-
item
breaks a string into an array of tokens in preparation for natural comparison and sorting.
Parameters:
-
itemStringthe value to tokenize
Returns:
an array of tokens found in the item
nearestIndexTo
-
arr -
val -
mappingFn
Performs a binary search on the array and finds the nearest index to the value passed.
Parameters:
-
arrArraythe sorted array to search.
-
valNumberthe value to find the nearest index to.
-
mappingFnFunctionan optional function for pulling values out of the array items.
Properties
data
Any
A data value passed with the event
Default: null
originalEvent
Event
The original event that triggered this event or action
Default: null
