JuliaDynamics / InteractiveDynamics.jl

Fast, general-purpose interactive applications for complex systems
https://juliadynamics.github.io/InteractiveDynamics.jl/dev/
MIT License
174 stars 26 forks source link

abmvideo doesn't show the live animation while recording #103

Closed ehsanirani closed 2 years ago

ehsanirani commented 2 years ago

In case of using GLMakie, function abmvideo used to show live video of the simulation while recording it to a file. However after getting the latest version of the InteractiveDynamics, the live animation doesn't appear. Is there any setting to tune to get back the live video?

Maybe related: before the last version, abmplot used to show the plot by default but now I need to call the first value of its returned tuple, which is the desired figure.

Datseris commented 2 years ago

Both points happen because there is no display(fig) happening inside the abmplot function. Unfortunately (for you), this was a desision we had to make because within the Makie.jl ecosystem, this is the recommended way to handle plotting. Figures are only displayed when decided by the user. The only way to change this would be to open a feature request within Makie.jl and ask for ways to do what matplotlib does, where whenever you do fig = Figure() a new figure window is opened irrespectively of whether this figure is returned to be showed as a return value.

Datseris commented 2 years ago

p.s.: if you open this requesti n Makie tag me there, because I also prefer it this way, that figures are immadiatelly displayed upon creaation.

ehsanirani commented 2 years ago

Thanks for the explanation. But why not adding an option to abmplot (like a keyword) to add display(fig) to it? This way there is no need to change the Makie.jl default style, and displaying the figure would be a user decision. Maybe I am missing something here?