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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.