-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Diagrams backend for Charts.
--   
--   Diagrams backend for Charts.
@package Chart-diagrams
@version 1.8.2


-- | The backend to render charts with the diagrams library.
module Graphics.Rendering.Chart.Backend.Diagrams

-- | Run this backends renderer.
runBackend :: (Backend b V2 (N b), Renderable (Path V2 (N b)) b, TypeableFloat (N b), Metric (V b)) => DEnv (N b) -> BackendProgram a -> (QDiagram b V2 (N b) Any, a)

-- | Run this backends renderer.
runBackendR :: (Backend b V2 (N b), Renderable (Path V2 (N b)) b, TypeableFloat (N b), Metric (V b)) => DEnv (N b) -> Renderable a -> (QDiagram b V2 (N b) Any, PickFn a)

-- | Run this backends renderer.
runBackendWithGlyphs :: (Backend b V2 (N b), Renderable (Path V2 (N b)) b, Renderable (Text (N b)) b, TypeableFloat (N b), Metric (V b)) => DEnv (N b) -> BackendProgram a -> (QDiagram b V2 (N b) Any, a, Map (String, FontSlant, FontWeight) (Set String))

-- | Produce a default environment with just the sans-serif fonts.
defaultEnv :: (Read n, RealFloat n) => AlignmentFns -> n -> n -> IO (DEnv n)

-- | Produce an environment with a custom set of fonts. The defult fonts
--   are still loaded as fall back.
createEnv :: (Read n, RealFloat n) => AlignmentFns -> n -> n -> FontSelector n -> DEnv n

-- | The diagrams backend environement.
data DEnv n
DEnv :: AlignmentFns -> FontStyle -> FontSelector n -> (n, n) -> Map (String, FontSlant, FontWeight) (Set String) -> DEnv n

-- | The used alignment functions.
[envAlignmentFns] :: DEnv n -> AlignmentFns

-- | The current/initial font style.
[envFontStyle] :: DEnv n -> FontStyle

-- | The font selection function.
[envSelectFont] :: DEnv n -> FontSelector n

-- | The size of the rendered output.
[envOutputSize] :: DEnv n -> (n, n)

-- | The map of all glyphs that are used from a specific font.
[envUsedGlyphs] :: DEnv n -> Map (String, FontSlant, FontWeight) (Set String)

-- | The file output format: EPS -&gt; Embedded Postscript SVG -&gt; SVG
--   with text rendered as stroked paths SVG -&gt; SVG with embedded font
--   information and text rendered as text operations
data FileFormat
EPS :: FileFormat
SVG :: FileFormat
SVG_EMBEDDED :: FileFormat
data FileOptions
FileOptions :: (Double, Double) -> FileFormat -> IO (FontSelector Double) -> FileOptions
[_fo_size] :: FileOptions -> (Double, Double)
[_fo_format] :: FileOptions -> FileFormat
[_fo_fonts] :: FileOptions -> IO (FontSelector Double)
fo_size :: Lens' FileOptions (Double, Double)
fo_format :: Lens' FileOptions FileFormat
fo_fonts :: Lens' FileOptions (IO (FontSelector Double))

-- | Generate an image file for the given renderable, at the specified
--   path. Size, format, and text rendering mode are all set through the
--   <a>FileOptions</a> parameter.
renderableToFile :: FileOptions -> FilePath -> Renderable a -> IO (PickFn a)

-- | Generate an image file from from the state content of an EC
--   computation. The state may have any type that is an instance of
--   <a>ToRenderable</a>
toFile :: (Default r, ToRenderable r) => FileOptions -> FilePath -> EC r () -> IO ()

-- | Generate an image file for the given drawing instructions, at the
--   specified path. Size and format are set through the <a>FileOptions</a>
--   parameter.
cBackendToFile :: FileOptions -> BackendProgram a -> FilePath -> IO a

-- | Load sans-serif fonts only
loadSansSerifFonts :: forall n. (RealFloat n, Read n) => IO (FontSelector n)

-- | Load serif, sans-serif and monospace fonts.
loadCommonFonts :: forall n. (RealFloat n, Read n) => IO (FontSelector n)
type FontSelector n = FontStyle -> PreparedFont n
instance Data.Default.Class.Default Graphics.Rendering.Chart.Backend.Diagrams.FileOptions
