Interactive plots
Vega is a great tool for interactive 2D visualizations in front-ends, and Altair provides a clean mechanism for specifying what these visualizations should contain. However, often we need the Vega chart to communicate back to the server something meaningful (first case I've personally witnessed is needing to capture a selected area and send it's data back to the server).
I want to make this easier going forward, so I'd like to create a component that sits in front of vega.Figure that does the following:
- Creates a Trame trigger to listen to events triggered by Vega.
- Adds some JS (never seen by the developer) to the front-end that calls the trigger on each signal/event that the chart has registered.
- Allows the user to specify callbacks to each signal/event via parameters when creating the component (the Trame trigger would look for these parameters and forward event data). Planning to use the format "event_{event name}={my_event_handler}"/"signal_{signal name}={my signal handler}".