utils.nf.graph-event Class
Event object for graph events
Item Index
Properties
Methods
identity
-
x
returns whatever you pass into it.
Parameters:
-
x
Any
Returns:
x
natualSort
-
arr
Sorts the array "naturally". Meaning taking into account both alphabetical and numeric sorting within strings.
Parameters:
-
arr
Arraythe array to sort
naturalCompare
-
a
-
b
A JavaScript sorting predicate for natural sorting.
Parameters:
-
a
Anythe value to compare to b
-
b
Anythe 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:
-
item
Stringthe 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:
-
arr
Arraythe sorted array to search.
-
val
Numberthe value to find the nearest index to.
-
mappingFn
Functionan 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