Methods
-
static addMouseScrollEventListener(query, func)
-
add a cross browser event listener on a mouse scroll
Parameters:
Name Type Description querystring DOM query of the element that the listener will be added to
funcfunction Function that will be called when the event occurs. The function takes as a parameter an event object.
-
static getJSONString(data, prettyopt, dataUriopt) → {string}
-
convert a data object to JSON string or to a data URI containing a JSON string
Parameters:
Name Type Attributes Default Description dataObject object that will be serialized into a JSON string
prettyBoolean <optional>
false if
true, the code will be proprerly indented, else a more compact syntax will be useddataUriBoolean <optional>
false return dataUri containing the JSON string instead of the pure JSON string
Returns:
string -
static manhattanDistance(a, b) → {number}
-
returns the Manhattan distance between the points a and b
Parameters:
Name Type Description aObject object containing numeric attributes
xandybObject object containing numeric attributes
xandyReturns:
number