Closed lsh closed 1 year ago
That's a cool idea! We should also add support for providing an explicit config file to the various conversion functions.
Do you think it should support everything in the options
parameter of vegaLite.compile
? Basically, what I'm trying to figure out is if a data structure like the following would be useful to add the following data structure as a parameter in InnerVlConverter::init_vl_version()
:
struct VLCompileOptions<'c, 'l, 'f> {
config: Option<&'c str>,
logger: Option<&'l str>,
field_title: Option<&'f str>
}
(using &'a str
because I'm assuming zero-copy-deserialization)
I only really feel strongly about the config
portion, but the above might be better forwards compatibility if we decide to support the latter two.
I think the config
values make sense, but not the others at this point (as they are pretty JavaScript specific).
I think I would picture making config
an argument to the vegalite_to_*
functions. It would be fine to pull default values from a config file, but I think it would be nice to be able to set it for individual conversions.
For what it's worth, the reason I'm suggesting config in the vegaLite.compile
is specifically because it has the semantics:
Note that configuration properties provided via the
config
property in the Vega-Lite specification, will override the configurations passed in through thecompile function
.
Should named themes be handled through the same config object? Or to you think we'll need a separate theme configuration setting?
Working on this as part of https://github.com/vega/vl-convert/pull/39
I could imagine some fun tools making use of
vl-convert
in a terminal context where having a general config file would be nice (with semantics like{ config: { ...userConfig, ...specConfig } }
). I would imagine that the config would just be a regularconfig
.