The diagrams-cairo package

[Tags:bsd3, library]

A full-featured backend for rendering diagrams using the cairo rendering engine.


[Skip to Readme]

Properties

Versions 0.1, 0.1.1, 0.1.2, 0.2, 0.3, 0.4, 0.5, 0.5.0.1, 0.5.0.2, 0.6, 0.7, 1.0, 1.0.1, 1.0.1.1, 1.0.1.2, 1.1, 1.1.0.1, 1.1.0.2, 1.2, 1.2.0.1, 1.2.0.2, 1.2.0.3, 1.2.0.4, 1.2.0.5, 1.2.0.6, 1.2.0.7, 1.3, 1.3.0.1, 1.3.0.2, 1.3.0.3, 1.3.0.4, 1.3.0.5, 1.3.0.6, 1.3.1
Change log CHANGES.markdown
Dependencies base (>=4.2 && <4.7), cairo (>=0.12.4 && <0.13), cmdargs (>=0.6 && <0.11), colour, diagrams-core (==0.6.*), diagrams-lib (==0.6.*), directory, filepath, mtl (>=2.0 && <2.2), old-time, process, split (>=0.1.2 && <0.3), time, unix (>=2.4 && <2.7) [details]
License BSD3
Author Brent Yorgey
Maintainer diagrams-discuss@googlegroups.com
Stability Unknown
Category Graphics
Home page http://projects.haskell.org/diagrams
Bug tracker http://github.com/diagrams/diagrams-cairo/issues
Source repository head: git clone http://github.com/diagrams/diagrams-cairo.git
Uploaded Wed Dec 12 02:52:16 UTC 2012 by BrentYorgey
Distributions Debian:1.3.0.5, LTSHaskell:1.3.1, NixOS:1.3.1
Downloads 8460 total (121 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for diagrams-cairo

Readme for diagrams-cairo-0.6

Build Status

diagrams-cairo is a rendering backend for diagrams, a powerful, flexible, declarative domain-specific language for creating vector graphics, using the Haskell programming language.

diagrams-cairo is implemented using the cairo rendering engine and is a fully-featured, officially supported backend for diagrams.

Installation

cabal update && cabal install gtk2hs-buildtools diagrams-cairo

Basic usage

A simple example that uses diagrams-cairo to draw a blue circle:

import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine

d = circle 1 # fc blue

main = defaultMain (pad 1.1 d)

Save this to file named Circle.hs and compile it:

ghc --make Circle.hs

This will generate an executable which, when run, outputs a blue circle to some file. Run the executable with the --help option to find out more about how to call it.

$ ./Circle --help
Command-line diagram generation.

Circle [OPTIONS]

Common flags:
  -w --width=INT    Desired width of the output image
  -h --height=INT   Desired height of the output image
  -o --output=FILE  Output file
  -? --help         Display help message
  -V --version      Print version information

The output type will be automatically determined from the file extension. Currently PNG, PDF, PS, and SVG are supported.

$ ./Circle -o circle.png -w 400

The command above generates a PNG file with a width of 400px.

Advanced usage

Instead of just creating a standalone executable, the cairo backend can also be called from within a larger program. For more information, see the Diagram.Backend.Cairo module.