vega / vl-convert

Utilities for converting Vega-Lite specs from the command line and Python
BSD 3-Clause "New" or "Revised" License
84 stars 9 forks source link

Support formatLocale and timeFormatLocale #133

Closed jonmmease closed 7 months ago

jonmmease commented 8 months ago

See https://github.com/altair-viz/altair/issues/3261.

We should support locale objects and also named locales from the d3-format and d3-time-format packages. These probably become two additional arguments to the vega_to_* and vegalite_to_* functions. When Altair calls vl-convert, it would propagate these from alt.renderers.set_embed_options.

@mattijn @MarcoBaroncini, do we want Altair to support setting locales based on their d3-format/d3-time-format names (e.g. it-IT)? vl-convert could bundle d3-format and d3-time-format and provide a Python to return the format objects so that Altair could accept the format file names as arguments to alt.renderers.set_embed_options.

mattijn commented 8 months ago

I think it would be great if the locale name is recognized by its language-territory code set. It seems like a great option if that can be accomplished by bundling d3-format/d3-time-format). One question, would it still be possible to use a custom dict for other variants not included in the d3-format/d3-time-format packages?

jonmmease commented 8 months ago

One question, would it still be possible to use a custom dict for other variants not included in the d3-format/d3-time-format packages?

Yeah, an object could be provided as well

mattijn commented 8 months ago

Just wondering, is https://github.com/vega/vega-embed/issues/87 also of relevance here?