projectmesa / mesa

Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors.
https://mesa.readthedocs.io
Apache License 2.0
2.43k stars 873 forks source link

SolaraViz: Fast option for dynamic plots #2255

Open EwoutH opened 1 month ago

EwoutH commented 1 month ago

It would be useful to have a fast, simple option for dynamic plot updating (streaming) capabilities in our Solara-based visualization module, allowing for the addition of data points each timestep without redrawing the entire plot, ideally with a fluent animation between.

Options

Some options I found:

  1. Matplotlib:

    • We currently use it, maybe it can be made faster.
    • Use FuncAnimation or similar methods to update plots.
  2. Altair:

  3. Plotly:

  4. Bokeh:

    • Leverage ColumnDataSource to stream data directly into plots.
    • Offers more control over the streaming process and seamless integration with Python backends.

Steps

EwoutH commented 3 weeks ago

@quaquel could you write up what you told me in the meeting today? The stuff about Altair and sending dataframes to it.