mesa
mesa copied to clipboard
Refactor altair in line with matplotlib
#2430 cleans up matplotlib space plotting. It would be great if the resulting cleaner API also works for altair space plotting.
Some quick updates of what needs doing:
- rename make_space_altair to something like make_altair_space_component
- add make_altair_plot_component
- Add support for all spaces. This means including the hexgrid and network transformation of the x and y coordinates.
- Have a generic get_agent_data method
- The current code does all visual encoding in a "matplotlib" style by adding "color" and "size" explicitly to the long-form data frame that is the basis of any Altair plot. This seems to be at odds with the philosophy behind Altair which cleanly separates the data to be visualized from the visual encoding given to this data. So, in my view, we should pass a dataframe with the relevant attributes to altair and handle 'marker', 'size', and 'color' explicitly via encoding.
- Create the altair plot only once and only update the underlying data frame, See also #2255 and e.g., this open altair issue. I have been able to make the discussed work arround work. It is not yet the fully streaming of data, but worth exploring.
can i work on this?
@quaquel @EwoutH should i include an example using altair plot?
Hey @nissu99, did you fish the issue or can i work on it?
@Edu92337 ,It is in progress.