5 Replies
HTML5 canvas from scratch. Sample input data: https://github.com/projectmesa/mesa/blob/65c5e6c28249c6e7e39595adce59761811dd81da/mesa/visualization/templates/js/GridDraw.js#L26-L37
GitHub
mesa/mesa/visualization/templates/js/GridDraw.js at 65c5e6c28249c6e...
Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors. - mesa/mesa/visualization/templates/js/GridDraw.js at 65c5e6c2...
ah, should be possible to use ipycanvas for this
but, it's not that simple to use from solara actually
some old code that might be useful
(this is using a deprecated api btw)
e.g. w.slider_float
I'd prefer the Matplotlib version if possible. It is so much easier for Mesa users to write their own custom visualization from scratch. But I can see that it is nearly impossible to adapt Matplotlib's update API to be reactive?
I think matplotlib needs to start from scratch always. So I guess the sub optimal performance is ok in your situation?
The visualization is mainly for small scale exploration on a laptop. People who run on the cloud with high-spec machine wouldn't need to visualize. So it is a trade-off I'm willing to accept.