-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support evaluating Vega expessions in Python for experimenting and debugging #3365
Comments
I do think this would be helpful; I often find it hard to troublshoot when I get lost halfway through something. Although recently I have started becoming more acquainted with the additional functionality in the Vega Editor and I find the Signal viewer they have helpful for understanding what is going on with a value of a parameter. Would there be redundancy between that and what you suggest here, or are there additional use cases that this would support? |
The only use case I had in mind was for debugging signals, so teaching people to use the editor to do this would be a fine approach. A downside is that this forces the use of the Expression string syntax, but that might be fine. It also just occurred to me that, rather than using VegaFusion, vl-convert could perform the expression evaluation, this way the fully expression language would be supported. |
I'd find that very useful! 🥳 One use case would be that I no longer/less often would have to go to the Vega Editor to debug expressions and then port the changes back to Altair. Maybe the work on this could also lead to Javascript errors being raised in Python? See vega/vl-convert#47. I sometimes have chart specs which just do not display in a Jupyter notebook due to a JS error and I only see it in the Vega Editor. Sounds reasonable to me to use vl-convert to get full support for all language features! |
An idea came to mind while reviewing #3362. In order to help people understand expressions better, it might be nice to make it possible to evaluate them and see their results in Python (using VegaFusion)
Something like:
Here's a simple implementation using
transformed_data
and the calculate transformThere are a lot of expressions that VegaFusion doesn't support yet, but this might be good motivation to improve coverage. And the error message you get using the approach above is pretty poor, so I think I may want to do some work in VegaFusion to either improve that, or to have a dedicated entry point for expression evaluation.
Anyway, does this seem useful for teaching people how to use expressions in charts?
The text was updated successfully, but these errors were encountered: