Chart-cairo 1.2.4 → 1.3
raw patch · 2 files changed
+13/−48 lines, 2 filesdep ~ChartPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Chart
API changes (from Hackage documentation)
- Graphics.Rendering.Chart.Backend.Cairo: renderableToPDFFile :: Renderable a -> Int -> Int -> FilePath -> IO ()
- Graphics.Rendering.Chart.Backend.Cairo: renderableToPNGFile :: Renderable a -> Int -> Int -> FilePath -> IO (PickFn a)
- Graphics.Rendering.Chart.Backend.Cairo: renderableToPSFile :: Renderable a -> Int -> Int -> FilePath -> IO ()
- Graphics.Rendering.Chart.Backend.Cairo: renderableToSVGFile :: Renderable a -> Int -> Int -> FilePath -> IO ()
- Graphics.Rendering.Chart.Backend.Cairo: sparkLineToPDF :: FilePath -> SparkLine -> IO ()
- Graphics.Rendering.Chart.Backend.Cairo: sparkLineToPNG :: FilePath -> SparkLine -> IO (PickFn ())
+ Graphics.Rendering.Chart.Backend.Cairo: toFile :: (Default r, ToRenderable r) => FileOptions -> FilePath -> EC r () -> IO ()
- Graphics.Rendering.Chart.Backend.Cairo: renderableToFile :: FileOptions -> Renderable a -> FilePath -> IO (PickFn a)
+ Graphics.Rendering.Chart.Backend.Cairo: renderableToFile :: FileOptions -> FilePath -> Renderable a -> IO (PickFn a)
Files
Chart-cairo.cabal view
@@ -1,5 +1,5 @@ Name: Chart-cairo-Version: 1.2.4+Version: 1.3 License: BSD3 License-file: LICENSE Copyright: Tim Docker, 2006-2010@@ -21,7 +21,7 @@ , data-default-class < 0.1 , operational >= 0.2.2 && < 0.3 , lens >= 3.9 && < 4.4- , Chart >= 1.2 && < 1.3+ , Chart >= 1.3 && < 1.4 Exposed-modules: Graphics.Rendering.Chart.Backend.Cairo
Graphics/Rendering/Chart/Backend/Cairo.hs view
@@ -8,6 +8,7 @@ , FileOptions(..) , runBackend , renderableToFile+ , toFile , defaultEnv , fo_size@@ -15,13 +16,6 @@ , cBackendToFile - , renderableToPNGFile -- deprecated- , renderableToPDFFile -- deprecated- , renderableToPSFile -- deprecated- , renderableToSVGFile -- deprecated- - , sparkLineToPDF -- deprecated- , sparkLineToPNG -- deprecated ) where import Data.Default.Class@@ -45,6 +39,7 @@ import Graphics.Rendering.Chart.Geometry as G import Graphics.Rendering.Chart.Renderable import Graphics.Rendering.Chart.SparkLine+import Graphics.Rendering.Chart.State(EC, execEC) ----------------------------------------------------------------------- -- Rendering Backend Environment@@ -150,7 +145,7 @@ cWithFillStyle :: CEnv -> FillStyle -> ChartBackend a -> C.Render a cWithFillStyle env fs p = do- runBackend' env{ceFillColor=G._fill_colour fs} p+ runBackend' env{ceFillColor=G._fill_color fs} p cWithLineStyle :: CEnv -> LineStyle -> ChartBackend a -> C.Render a cWithLineStyle env ls p = preserveCState0 $ do@@ -184,12 +179,18 @@ -- | Generate an image file for the given renderable, at the specified path. Size and -- format are set through the `FileOptions` parameter.-renderableToFile :: FileOptions -> Renderable a -> FilePath -> IO (PickFn a)-renderableToFile fo r path = cBackendToFile fo cr path+renderableToFile :: FileOptions -> FilePath -> Renderable a -> IO (PickFn a)+renderableToFile fo path r = cBackendToFile fo cr path where cr = render r (fromIntegral width, fromIntegral height) (width,height) = _fo_size fo +-- | Generate an image file from from the state content of an EC+-- computation. The state may have any type that is an instance of+-- `ToRenderable`+toFile :: (Default r, ToRenderable r) => FileOptions -> FilePath -> EC r () -> IO ()+toFile fo path ec = void $ renderableToFile fo path (toRenderable (execEC ec))+ -- | Generate an image file for the given drawing instructions, at the specified path. Size and -- format are set through the `FileOptions` parameter. cBackendToFile :: FileOptions -> ChartBackend a -> FilePath -> IO a@@ -216,28 +217,6 @@ (width,height) = _fo_size fo -{-# DEPRECATED renderableToPNGFile "use renderableToFile" #-}-renderableToPNGFile :: Renderable a -> Int -> Int -> FilePath -> IO (PickFn a)-renderableToPNGFile r width height path = renderableToFile (FileOptions (width,height) PNG) r path---- | Output the given renderable to a PDF file of the specifed size--- (in points), to the specified file.-{-# DEPRECATED renderableToPDFFile "use renderableToFile" #-}-renderableToPDFFile :: Renderable a -> Int -> Int -> FilePath -> IO ()-renderableToPDFFile r width height path = void $ renderableToFile (FileOptions (width,height) PDF) r path---- | Output the given renderable to a postscript file of the specifed size--- (in points), to the specified file.-{-# DEPRECATED renderableToPSFile "use renderableToFile" #-}-renderableToPSFile :: Renderable a -> Int -> Int -> FilePath -> IO ()-renderableToPSFile r width height path = void $ renderableToFile (FileOptions (width,height) PS) r path---- | Output the given renderable to an SVG file of the specifed size--- (in points), to the specified file.-{-# DEPRECATED renderableToSVGFile "use renderableToFile" #-}-renderableToSVGFile :: Renderable a -> Int -> Int -> FilePath -> IO ()-renderableToSVGFile r width height path = void $ renderableToFile (FileOptions (width,height) SVG) r path- -- ----------------------------------------------------------------------- -- Type Conversions: Chart -> Cairo -- -----------------------------------------------------------------------@@ -317,19 +296,5 @@ cArcNegative :: Point -> Double -> Double -> Double -> C.Render () cArcNegative p r a1 a2 = C.arcNegative (p_x p) (p_y p) r a1 a2---- -------------------------------------------------------------------------- SparkLine Functions--- --------------------------------------------------------------------------- | Generate a PNG for the sparkline, using its natural size.-{-# DEPRECATED sparkLineToPNG "use renderableToFile" #-}-sparkLineToPNG :: FilePath -> SparkLine -> IO (PickFn ())-sparkLineToPNG fp sp = renderableToFile (FileOptions (sparkSize sp) PNG) (sparkLineToRenderable sp) fp---- | Generate a PDF for the sparkline, using its natural size.-{-# DEPRECATED sparkLineToPDF "use renderableToFile" #-}-sparkLineToPDF :: FilePath -> SparkLine -> IO ()-sparkLineToPDF fp sp = void $ renderableToFile (FileOptions (sparkSize sp) PDF) (sparkLineToRenderable sp) fp $( makeLenses ''FileOptions )