I’d like to include some external annotation data in a chart (and join it using a lookup, which also works OK in the Vega Lite editor), but I’m having trouble getting it working. I know the Vega Lite block binds the table data at runtime, but I’m not quite sure whether it’s able to make external requests or not.
It doesn’t throw an error when I do it, but on the other hand the error message when you put in a nonexistent field name says this:
The block cannot make external calls. But, I believe they provide access to the source in Github so you could create a branch that allows this. The other approach is to use automations, rollups, and the API to make the data viz-ready in a single flat table and then use Vega to plot the results.
(even though that JSON is in the GitHub code, it still breaks if you put something bogus in there, so I’m pretty sure it’s being loaded at runtime). From looking at the source here:
The other approach is to use automations, rollups, and the API to make the data viz-ready in a single flat table and then use Vega to plot the results.
Yeah, I think this is pretty much the workaround I’d come up with yesterday. I’m pushing data into the table via the API already, so I can put whatever I want in in whatever format I want it, but I’d like the users to be able to filter what’s in the plot by filtering a column in (a) table. Thing is, the data needs to be in ‘long’ format (as in one observation per row) to be plotted, and this makes filtering a bit less pleasant for users; so it would be nice if they could see it in ‘wide’ (crosstabulated, Excel-type) format, then choose the bits they want to appear on the plot.
Vega also has the ‘fold’ transform, which is very powerful and nearly makes this easy but it requires you to specify the names of all the fields you’re going to transform in advance, meaning I’d have to update the JSON every time a new field was added (& there’s no way to push that programmatically).