Skip to content
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

Refactor altair in line with matplotlib #2435

Open
quaquel opened this issue Oct 30, 2024 · 1 comment
Open

Refactor altair in line with matplotlib #2435

quaquel opened this issue Oct 30, 2024 · 1 comment

Comments

@quaquel
Copy link
Member

quaquel commented Oct 30, 2024

#2430 cleans up matplotlib space plotting. It would be great if the resulting cleaner API also works for altair space plotting.

@quaquel
Copy link
Member Author

quaquel commented Oct 31, 2024

Some quick updates of what needs doing:

  1. rename make_space_altair to something like make_altair_space_component
  2. add make_altair_plot_component
  3. Add support for all spaces. This means including the hexgrid and network transformation of the x and y coordinates.
  4. Have a generic get_agent_data method
  5. 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.
  6. Create the altair plot only once and only update the underlying data frame, See also SolaraViz: Fast option for dynamic plots #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant