reanimate-0.2.0.2: Animation library based on SVGs.

Safe HaskellNone
LanguageHaskell2010

Reanimate.Svg

Synopsis

Documentation

withSubglyphs :: [Int] -> (Tree -> Tree) -> Tree -> Tree Source #

pathify :: Tree -> Tree Source #

Convert primitive SVG shapes (like those created by mkCircle, mkRect, mkLine or mkEllipse) into SVG path. This can be useful for creating animations of these shapes being drawn progressively with partialSvg.

Example:

pathifyExample :: Animation
pathifyExample = animate $ \t -> gridLayout
    [ [ partialSvg t $ pathify $ mkCircle 1
      , partialSvg t $ pathify $ mkRect 2 2
      ]
    , [ partialSvg t $ pathify $ mkEllipse 1 0.5
      , partialSvg t $ pathify $ mkLine (-1, -1) (1, 1)
      ]
    ]