Chart-diagrams-1.0: Diagrams backend for Charts.

Safe HaskellNone

Graphics.Rendering.Chart.Backend.Diagrams

Description

The backend to render charts with the diagrams library.

Synopsis

Documentation

runBackendSource

Arguments

:: (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.

runBackendRSource

Arguments

:: (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.

defaultEnvSource

Arguments

:: 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.

customFontEnvSource

Arguments

:: 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.

data DEnv Source

The diagrams backend environement.

Constructors

DEnv 

Fields

envAlignmentFns :: AlignmentFns

The used alignment functions.

envFontStyle :: FontStyle

The current/initial font style.

envSelectFont :: FontStyle -> DFont

The font selection function.

envOutputSize :: (Double, Double)

The size of the rendered output.

type DFont = (FontData, OutlineMap)Source

A font a delivered by SVGFonts.

renderableToEPSFile :: Renderable a -> Double -> Double -> FilePath -> IO (PickFn a)Source

Output the given renderable to a EPS file using the default environment.

renderableToEPSFile' :: Renderable a -> DEnv -> FilePath -> IO (PickFn a)Source

Output the given renderable to a EPS file using the given environment.

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.

renderableToSVGFile :: Renderable a -> Double -> Double -> FilePath -> IO (PickFn a)Source

Output the given renderable to a SVG file of the specifed size (in points), to the specified file using the default environment.

renderableToSVGFile' :: Renderable a -> DEnv -> FilePath -> IO (PickFn a)Source

Output the given renderable to a SVG file 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.