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

jupyterviz agent space and measures flash on mesa 2.1.4 #1867

Closed
rlskoeser opened this issue Nov 7, 2023 · 2 comments · Fixed by #1869
Closed

jupyterviz agent space and measures flash on mesa 2.1.4 #1867

rlskoeser opened this issue Nov 7, 2023 · 2 comments · Fixed by #1869

Comments

@rlskoeser
Copy link
Contributor

Describe the bug
When I run my simulations on the latest release (v2.1.4), my agent space and charts flicker.

Expected behavior
In mesa 2.1.2 these render smoothly and update without any flickering.

To Reproduce
My code base is here if you want to try running solara apps yourself: https://github.com/Princeton-CDH/simulating-risk
If you check it out and install dependencies, you can run one of the models like this:

solara run --host localhost simulatingrisk/hawkdovevar/app.py

I'm going to pin mesa to version 2.1.2 for now, but I like the new layout and would like to update once this is resolved.

Additional context
I looked at the release notes and some of the PRs; I tried changing the play_interval in my code when I initialize JupyterViz for my model, but it didn't have any effect.

I'm using altair instead of matplotlib, in case that's relevant.

I made a couple of screen recordings so you can see what I'm describing.

Nice smooth updating on mesa 2.1.2:
https://github.com/projectmesa/mesa/assets/691231/22b676b9-d83c-4658-a93f-46ab343a8f9d

Jerky, flashing updating on mesa 2.1.4:
https://github.com/projectmesa/mesa/assets/691231/06adccee-8823-44c1-b029-ce3660256034

@rht
Copy link
Contributor

rht commented Nov 8, 2023

Upon investigating, it is due to the fact that the plot objects seem to be recreated from scratch for each step. This affects both the Matplotlib render as well. Removing

@solara.component
fixes the issue. A proper solution would be to ensure the ColorCard and subcomponent of ColorCard are rerendered only when necessary.

@rlskoeser
Copy link
Contributor Author

thanks for investigating and resolving so quickly!

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

Successfully merging a pull request may close this issue.

2 participants