What Diagrams backends support animation?

237 Views Asked by At

In the diagrams tutorial the following text appears:

Some backends support rendering animations (typically as individually indexed files of frames).

> -- Animation
>
> a :: Animation Cairo V2 Double
> a = ...
>
> main = mainWith a

So from here I started working on a little animation. I found Diagrams.Animation and discovered that the Animation type is

type Animation b v n = Active (QDiagram b v n Any) 

From there I looked at Data.Active, and was able to build myself a little Animation.

At this point I attempted to compile but was told that my Animation was not Mainable. I supposed that this must mean that my backend Diagrams.Backend.SVG.CmdLine did not support animations. So I went and looked at some other backends, but none that I could find made Animations Mainable.

What backends is the tutorial talking about? That is, what backends support animation?

1

There are 1 best solutions below

0
On

diagrams-cairo and diagrams-rasterific can produce animated GIFs from an Animation. diagrams-postscript has a Mainable instance that saves one numbered file for each frame of the Animation.