{-# LANGUAGE RankNTypes #-}
module GIS.Graphics.PlotSVG ( fileOptions
, mkMapSVG
, makeLensMapSVG
) where
import GIS.Graphics.Plot
import GIS.Graphics.Types hiding (title)
import GIS.Types
import Graphics.Rendering.Chart.Backend.Diagrams
import Graphics.Rendering.Chart.Easy hiding (lens)
fileOptions :: FileOptions
fileOptions = def { _fo_size = (1920, 1080) , _fo_format = SVG }
mkMapSVG :: FilePath -> Map -> IO ()
mkMapSVG path map' =
renderableToFile fileOptions path (mkMapR map') >>
putStrLn ("...output written to " <> path)
makeLensMapSVG :: (Show a) => String -> FilePath -> Lens' District a -> [District] -> IO ()
makeLensMapSVG title filepath lens districts =
renderableToFile fileOptions filepath (mkRenderableLens lens districts title) >>
putStrLn ("...output written to " <> filepath)