Skip to content

Convenience Functions

Hamilton Ulmer edited this page Feb 11, 2016 · 5 revisions

HomeConvenience Functions

# MG.convert.date(data, accessor[, format])

Converts the values in an array of objects, whose key is specified by accessor, from string to javascript Date object. The function parses %Y-%m-%d-styled timestamps by default. An optional third argument allows one to specify an alternative style, per the formats defined here: https://github.com/mbostock/d3/wiki/Time-Formatting.

# MG.convert.number(data, accessor)

Converts the values in an array of objects, whose key is specified by accessor, into numbers.

Clone this wiki locally