mesa / mesa/mesa

SolaraViz: Fast option for dynamic plots

Open
#2,255 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

visualisation
Dominant language
Python
Stars
3.9k
Forks
1.3k
Avg merge
2d 12h
Merged PRs (30d)
20

Description

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**:
- Also currently already there.
- Update the chart data periodically and re-render using Solara.
- Limitation: Might involve partial re-drawing due to Altair's design.
- https://altair-viz.github.io/user_guide/interactions.html

3. **Plotly**:
- Utilize [`FigureWidget`](https://plotly.com/python/figurewidget/) for efficient updates without full re-rendering.
- Seems recommended for smoother updates and better performance with complex plots.
- Maybe https://dash.plotly.com/live-updates

4. **Bokeh**:
- Leverage [`ColumnDataSource`](https://docs.bokeh.org/en/latest/docs/user_guide/basic/data.html) to stream data directly into plots.
- Offers more control over the streaming process and seamless integration with Python backends.

### Steps
- Evaluate each library's performance and ease of integration with Solara.
- Implement the most suitable solution and ensure compatibility with existing modules.
- Update documentation with examples and usage guidelines.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Solara-based visualization module and the existing Matplotlib and Altair integrations. Benchmark the listed libraries for streaming updates and integration effort, then implement the selected approach with compatibility for existing modules. Done means the chosen solution supports incremental data points, includes an animation example, and has updated documentation with usage guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, plotly, python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.