The diagrams-cairo package

[ Tags: bsd3, graphics, library ] [ Propose Tags ]

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, 1.3.1.1, 1.3.1.2, 1.4
Change log CHANGES.markdown
Dependencies base (>=4.2 && <4.8), bytestring (>=0.9 && <0.11), cairo (>=0.12.4 && <0.14), colour, containers (>=0.3 && <0.6), data-default-class (>=0.0.1 && <0.1), diagrams-core (==1.2.*), diagrams-lib (==1.2.*), directory, filepath, ghc-prim, hashable (>=1.1 && <1.3), JuicyPixels (>=3.1.3.2 && <3.2), lens (>=3.8 && <4.4), mtl (>=2.0 && <2.3), old-time, optparse-applicative (>=0.7 && <0.10), pango (>=0.12.5 && <0.14), process, split (>=0.1.2 && <0.3), statestack (==0.2.*), time, transformers (>=0.3 && <0.5), unix (>=2.4 && <2.8), vector (>=0.10.0 && <0.11) [details]
License BSD3
Author Brent Yorgey
Maintainer diagrams-discuss@googlegroups.com
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 Mon Jun 2 17:55:37 UTC 2014 by jeffreyrosenbluth
Updated Sun Aug 10 02:03:44 UTC 2014 by BrentYorgey to revision 2   [What is this?]
Distributions Debian:1.3.0.5, LTSHaskell:1.4, NixOS:1.4, Tumbleweed:1.4
Downloads 10644 total (180 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for diagrams-cairo-1.2

[back to package description]

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 = mainWith (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
./Circle

Usage: ./Circle [-w|--width WIDTH] [-h|--height HEIGHT] [-o|--output OUTPUT]
                [--loop] [-s|--src ARG] [-i|--interval INTERVAL]
  Command-line diagram generation.

Available options:
  -?,--help                Show this help text
  -w,--width WIDTH         Desired WIDTH of the output image
  -h,--height HEIGHT       Desired HEIGHT of the output image
  -o,--output OUTPUT       OUTPUT file
  -l,--loop                Run in a self-recompiling loop
  -s,--src ARG             Source file to watch
  -i,--interval INTERVAL   When running in a loop, check for changes every INTERVAL seconds.
ommand-line diagram generation.

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.