packages feed

Chart-diagrams 1.9.2 → 1.9.3

raw patch · 2 files changed

+28/−4 lines, 2 filesdep ~diagrams-coredep ~diagrams-postscriptdep ~lensPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: diagrams-core, diagrams-postscript, lens

API changes (from Hackage documentation)

Files

Chart-diagrams.cabal view
@@ -1,5 +1,5 @@ Name: Chart-diagrams-Version: 1.9.2+Version: 1.9.3 License: BSD3 License-file: LICENSE Copyright: Jan Bracker, 2006-2014@@ -31,7 +31,7 @@                , diagrams-core >= 1.3 && < 1.5                , diagrams-lib >= 1.2 && < 1.5                , diagrams-svg >= 1.4 && < 1.5-               , diagrams-postscript >= 0.7 && < 1.5+               , diagrams-postscript >= 0.7 && < 1.6                , SVGFonts >= 1.4 && < 1.8                , colour >= 2.2.1 && < 2.4                , blaze-markup >= 0.7 && < 0.9@@ -40,7 +40,7 @@                , operational >= 0.2.2 && < 0.3                , containers >= 0.4 && < 0.7                , data-default-class < 0.2-               , lens >= 3.9 && < 4.18+               , lens >= 3.9 && < 4.19                , Chart >= 1.9 && < 1.10                , text   other-modules: Paths_Chart_diagrams
Graphics/Rendering/Chart/Backend/Diagrams.hs view
@@ -41,6 +41,11 @@ import qualified Data.ByteString.Lazy as BS import qualified Data.Text as T +#if MIN_VERSION_diagrams_postscript(1,5,0)+import qualified Data.ByteString.Builder     as B+import           System.IO                   (IOMode (..), hPutStr, withFile)+#endif+ import Control.Lens(makeLenses) import Control.Monad.Operational import Control.Monad.State.Lazy@@ -129,7 +134,13 @@     EPS -> do       let (d, a) = runBackend env cb           opts = DEPS.PostscriptOptions path (D2.dims2D w h) DEPS.EPS+#if MIN_VERSION_diagrams_postscript(1,5,0)+          eps = D.renderDia DEPS.Postscript opts d+      withFile (opts D.^. DEPS.psfileName) WriteMode $ \h ->+        B.hPutBuilder h eps+#else       D.renderDia DEPS.Postscript opts d+#endif       return a     SVG -> do       let (d, a) = runBackend env cb@@ -574,10 +585,23 @@ {-# DEPRECATED fontFromName "This function will be removed in the next release" #-}  #if MIN_VERSION_SVGFonts(1,7,0)-getPreparedFont  = unsafePerformIO+{-+  We need this `unsafePerformIO` to deal with breaking+  change in SVGFonts, which has changed the types of `F.lin` and `F.bit`+  from `F.PreparedFont n` to `IO F.PreparedFont n`.+  These functions simply read the files from `data-files`+  of `SVGFonts`.+-}+getPreparedFont = unsafePerformIO #else getPreparedFont = id #endif++{-+  The `fontFromName` function is not used inside this module.+  It is not exported either. So it is safe to remove it+  in the future release thus escaping use of `unsafePerformIO`.+-}  fontFromName :: (Read n, RealFloat n) => String -> F.PreparedFont n fontFromName name = case name of