Safe Haskell | None |
---|---|
Language | Haskell98 |
The backend to render charts with the diagrams library.
- runBackend :: (Backend b R2, Renderable (Path R2) b) => DEnv -> ChartBackend a -> (Diagram b R2, a)
- runBackendR :: (Backend b R2, Renderable (Path R2) b) => DEnv -> Renderable a -> (Diagram b R2, PickFn a)
- defaultEnv :: AlignmentFns -> Double -> Double -> IO DEnv
- customFontEnv :: AlignmentFns -> Double -> Double -> Map (String, FontSlant, FontWeight) FilePath -> IO DEnv
- data DEnv = DEnv {
- envAlignmentFns :: AlignmentFns
- envFontStyle :: FontStyle
- envSelectFont :: FontStyle -> DFont
- envOutputSize :: (Double, Double)
- envUsedGlyphs :: Map (String, FontSlant, FontWeight) (Set String)
- type DFont = (FontData, OutlineMap)
- data FileFormat
- = EPS
- | SVG
- | SVG_EMBEDDED
- data FileOptions = FileOptions {
- _fo_size :: (Double, Double)
- _fo_format :: FileFormat
- _fo_customFonts :: Map (String, FontSlant, FontWeight) FilePath
- fo_size :: Lens' FileOptions (Double, Double)
- fo_format :: Lens' FileOptions FileFormat
- fo_customFonts :: Lens' FileOptions (Map (String, FontSlant, FontWeight) FilePath)
- renderableToFile :: FileOptions -> FilePath -> Renderable a -> IO (PickFn a)
- toFile :: (Default r, ToRenderable r) => FileOptions -> FilePath -> EC r () -> IO ()
- cBackendToFile :: FileOptions -> ChartBackend a -> FilePath -> IO a
- cBackendToEPSFile :: ChartBackend a -> DEnv -> FilePath -> IO a
- cBackendToSVG :: ChartBackend a -> DEnv -> (Svg, a)
- cBackendToEmbeddedFontSVG :: ChartBackend a -> DEnv -> (Svg, a)
- renderableToSVG :: Renderable a -> Double -> Double -> IO (Svg, PickFn a)
- renderableToSVG' :: Renderable a -> DEnv -> (Svg, PickFn a)
- renderableToSVGString :: Renderable a -> Double -> Double -> IO (ByteString, PickFn a)
- renderableToSVGString' :: Renderable a -> DEnv -> (ByteString, PickFn a)
- renderableToEmbeddedFontSVG :: Renderable a -> Double -> Double -> IO (Svg, PickFn a)
- renderableToEmbeddedFontSVG' :: Renderable a -> DEnv -> (Svg, PickFn a)
Documentation
:: (Backend b R2, Renderable (Path R2) b) | |
=> DEnv | Environment to start rendering with. |
-> ChartBackend a | Chart render code. |
-> (Diagram b R2, a) | The diagram. |
Run this backends renderer.
:: (Backend b R2, Renderable (Path R2) b) | |
=> DEnv | Environment to start rendering with. |
-> Renderable a | Chart render code. |
-> (Diagram b R2, PickFn a) | The diagram. |
Run this backends renderer.
:: AlignmentFns | Alignment functions to use. |
-> Double | The output image width in backend coordinates. |
-> Double | The output image height in backend coordinates. |
-> IO DEnv |
Produce a default environment with the default fonts.
:: AlignmentFns | Alignment functions to use. |
-> Double | The output image width in backend coordinates. |
-> Double | The output image height in backend coordinates. |
-> Map (String, FontSlant, FontWeight) FilePath | |
-> IO DEnv |
Produce an environment with a custom set of fonts. The defult fonts are still loaded as fall back.
The diagrams backend environement.
DEnv | |
|
type DFont = (FontData, OutlineMap) Source
A font a delivered by SVGFonts.
File Output Functons
data FileFormat Source
The file output format: EPS -> Embedded Postscript SVG -> SVG with text rendered as stroked paths SVG -> SVG with embedded font information and text rendered as text operations
data FileOptions Source
FileOptions | |
|
renderableToFile :: FileOptions -> FilePath -> Renderable a -> IO (PickFn a) Source
Generate an image file for the given renderable, at the specified path. Size, format,
and text rendering mode are all set through the FileOptions
parameter.
toFile :: (Default r, ToRenderable r) => FileOptions -> FilePath -> EC r () -> IO () Source
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
cBackendToFile :: FileOptions -> ChartBackend a -> FilePath -> IO a Source
Generate an image file for the given drawing instructions, at the specified path. Size and
format are set through the FileOptions
parameter.
EPS Utility Functions
cBackendToEPSFile :: ChartBackend a -> DEnv -> FilePath -> IO a Source
SVG Utility Functions
cBackendToSVG :: ChartBackend a -> DEnv -> (Svg, a) Source
cBackendToEmbeddedFontSVG :: ChartBackend a -> DEnv -> (Svg, a) Source
renderableToSVG :: Renderable a -> Double -> Double -> IO (Svg, PickFn a) Source
Output the given renderable as a SVG of the specifed size (in points) using the default environment.
renderableToSVG' :: Renderable a -> DEnv -> (Svg, PickFn a) Source
Output the given renderable as a SVG using the given environment.
renderableToSVGString :: Renderable a -> Double -> Double -> IO (ByteString, PickFn a) Source
Output the given renderable to a string containing a SVG of the specifed size (in points) using the default environment.
renderableToSVGString' :: Renderable a -> DEnv -> (ByteString, PickFn a) Source
Output the given renderable to a string containing a SVG using the given environment.
SVG Embedded Font Utility Functions
renderableToEmbeddedFontSVG :: Renderable a -> Double -> Double -> IO (Svg, PickFn a) Source
Output the given renderable as a SVG of the specifed size (in points) using the default environment. Font are embedded to save space.
renderableToEmbeddedFontSVG' :: Renderable a -> DEnv -> (Svg, PickFn a) Source
Output the given renderable as a SVG using the given environment. Font are embedded to save space.