module Simulation.Aivika.Experiment.Chart.Backend.Diagrams
(DiagramsRenderer(..)) where
import System.FilePath
import Data.Map
import Graphics.Rendering.Chart
import Graphics.Rendering.Chart.Backend.Diagrams
import Simulation.Aivika.Experiment
import Simulation.Aivika.Experiment.Chart
data DiagramsRenderer =
DiagramsRenderer { rendererFileFormat :: FileFormat,
rendererCustomFonts :: IO (FontSelector Double)
}
instance ChartRendering DiagramsRenderer where
renderableChartExtension (DiagramsRenderer EPS _) = ".eps"
renderableChartExtension (DiagramsRenderer SVG _) = ".svg"
renderableChartExtension (DiagramsRenderer SVG_EMBEDDED _) = ".svg"
renderChart (DiagramsRenderer format fonts) (width, height) =
renderableToFile (FileOptions (fromIntegral width, fromIntegral height) format fonts)