Open sadukie opened 10 months ago
Thanks for the report! It seems like there was a _timer
attribute in TimerBase
object in old matplotlib versions but it has been removed. So the TimerWasm
object would need to be updated to be compatible with newer matplotlib versions.
Currently, no Pyodide maintainers are actively maintaining matplotlib-pyodide
project, and AFAIK none of them have deep knowledge of matplotlib. Therefore, it would be great if people with knowledge of matplotlib could help resolve this issue.
Ah... I see....
self._timer
was set to None
as part of __init__
as late as v3.2.x: Backend Bases in Matplotlib v3.2.xThanks for the check. Maybe we can remove the self._timer
attribute from the TimerWasm
object, if it is not used in TimerBase
at all... but I think we don't have a test case so I am not sure what would be the side effect of it .
I managed to circumvent the immediate issue by adding
from matplotlib_pyodide.browser_backend import TimerWasm
class Timer(TimerWasm):
def __init__(self, interval=None):
self._timer = None
super().__init__(interval=interval)
and injecting that new implementation to FunctionAnimation
via the event_source=Timer(interval=30)
parameter. Unfortunately, only the axes and labels render, no animation! You can see the result on PyScript.com
@sadukie @ryanking13 any idea?
Problem
Another community member and I were trying to see if Matplotlib's
animation.FuncAnimation
would work in PyScript using this Matplotlib demo.We ran into the following error:
The code is available here on PyScript.com.
More Details
Here's the stack trace of the error: