-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{-# LANGUAGE MultiParamTypeClasses #-} | ||
|
||
----------------------------------------------------------------------------- | ||
-- | | ||
-- Module : Diagrams.Builder.Class | ||
-- Copyright : (c) 2014 diagrams-lib team (see LICENSE) | ||
-- License : BSD-style (see LICENSE) | ||
-- Maintainer : [email protected] | ||
-- | ||
-- General class for building diagrams to files. | ||
-- | ||
----------------------------------------------------------------------------- | ||
module Diagrams.Backend.Build where | ||
|
||
import Diagrams.Core | ||
import Diagrams.Size | ||
import Data.Monoid (Any) | ||
import Linear.V2 | ||
import Control.Lens (Lens') | ||
|
||
-- | Generic class for building diagrams whose output is a file with a | ||
-- 2D size. | ||
class Backend b v n => BackendBuild b v n where | ||
-- | Lens onto the size of the output file. | ||
outputSize :: Lens' (Options b v n) (SizeSpec V2 n) | ||
|
||
-- | Build a diagram of the given format to the path using the | ||
-- backend's options. The @Maybe String@ returns any errors. | ||
saveDia :: FilePath -> Options b v n -> QDiagram b v n Any -> IO () | ||
|