Support alt.datum[signal_name]
in addition to "datum[signal_name]"
#3366
Labels
alt.datum[signal_name]
in addition to "datum[signal_name]"
#3366
Currently using
alt.datum
in altair does not support passing a signal/parameter whereas writing the expression string directly as JS-like string does (an example of dynamically passing fields via parameters here https://github.com/altair-viz/altair/pull/3357/files (both the chart title and calculate transform).Here is another example:
The reason it fails is that
alt.datum[xcol_param.name]
inserts additional quotation around the parameter name in the VL spec:whereas the VL spec for
f'datum[{xcol_param}]'
does not:Open the Chart in the Vega Editor
Personally I think the cleanest would be if we could support just using the variable name without the
.name
suffix when usingalt.datum
, as in this example from the docs:But even if that doesn't work, just supporting the use of the
.name
suffix without the quotes inserted would be great. Here are a few examples of how these datums and expressions get translated with differential quoting:The text was updated successfully, but these errors were encountered: