-
Notifications
You must be signed in to change notification settings - Fork 624
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
Making it possible to debug and introspect data transformations #4134
Comments
Thank you Tom for writing up these challenges that users face when debugging Vega-Lite! The related issue on naming datasets is #3789. |
The Vega-Editor now has a data viewer, which addresses some of the points you mention. The next step should be more thorough documentation of how Vega-Lite is translated to Vega and a debugging guide. |
I'm struggling with this too. After seeing that I can name my data sources and after looking at generated vega specs, I was guessing that I could just name transforms in vega-lite too, like: {
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"values": [
{"key": "alpha", "foo": [1, 2], "bar": ["A", "B"]},
{"key": "beta", "foo": [3, 4, 5], "bar": ["C", "D"]}
]
},
"transform": [{"flatten": ["foo", "bar"], "name": "with_bar_flattened"}],
"mark": "circle",
"encoding": {
"x": {"field": "foo", "type": "quantitative"},
"y": {"field": "bar", "type": "nominal"},
"color": {"field": "key", "type": "nominal"}
}
} So in the vega editor, I would see I'm learning vega-lite through https://github.com/metasoarous/oz though, so I'm hoping I can figure out some way to conveniently debug from a REPL. I haven't looked into https://github.com/jsa-aerial/hanami yet; that looks promising too. |
Thank you for the feedback @onetom. Unfortunately, there is no one to one correspondence between transforms and Vega datasets. Multiple transforms can appear in a single Vega dataset. So naming datasets this way is not possible. |
It seems like the idea of transforms built into vega-lite is that you might be able to use a wider range of input data without writing custom JavaScript, by using the little transform functions. Which are cool, but - given that what you have then is something like
data → (transformed data) → visualization result
, afaict there's no way to take a peek at the in-between transformed data.Looking at the transformed data - as it stands - seems quite difficult, for a number of reasons. To get the viewpoint, you need to:
This is tricky because:
.data()
throws an error. The only way to get this to work, afaict, is to look at the intermediate compiled vega spec, which, if you've been living on the vega-lite abstraction level, might not be very familiar. The dataset names are also not guessable, one cannot run, for example,.data(0)
What might make this better:
The text was updated successfully, but these errors were encountered: