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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request] Get the current/default locale definition when passing no argument to formatLocale #110
Many d3 functions use the presence of an argument to control their behavior -- if an argument is passed, it used to update the object, and if it's missing then the current value is returned. For instance d3.scaleLinear().domain([0,1]) vs d3.scaleLinear().domain().
It would be handy if d3.formatLocale could be used this same way in order to return the current locale settings (likely the defaults if the user hasn't called d3.formatDefaultLocale) so that the user could modify just one of them before passing the updated definition list back to d3.formatLocale. For instance,
const definition = d3.formatLocale();
definition.minus = "-" // Replace the default unicode minus character with a hyphen
// Leave everything else, such as commas and the decimal separator, as the en-US default
const formatter = d3.formatLocale(definition).format(",.2f")
Activity