I am pleased to announce the release of version 0.6 of diagrams, a full-featured framework and embedded domain-specific language for declarative drawing. Check out the gallery for examples of what it can do!
Highlights of this release include:
Diagrams now comes with a native-Haskell SVG backend by default. If you were holding off on trying diagrams because you couldn’t install cairo, you no longer have an excuse!
Proper support for subdiagrams: previous versions of diagrams-core had a mechanism for associating names with a pair of a location and an envelope. Now, names are associated with actual subdiagrams (including their location and envelope, along with all the other information stored by a diagram). This enables cool techniques like constructing a diagram in order to position its subelements and then taking it apart again, or constructing animations via keyframing.
Traces: in addition to an envelope, each diagram now stores a “trace”, which is like an embedded raytracer: given any ray (represented by a base point and a vector), the trace computes the closest point of intersection with the diagram along the ray. This is useful for determining points on the boundary of a diagram, e.g. when drawing arrows between diagrams.
The core data structure underlying diagrams has been completely refactored and split out into its own separate package, dual-tree.
Support for GHC 7.6.
Many more new features, bug fixes, and improvements! See the release notes for complete details, and the diagrams wiki for help migrating from 0.5 to 0.6.
Try it out
For the truly impatient:
cabal install diagrams
Diagrams is supported under GHC 7.0 through 7.6, with the exception that the cairo and gtk backends do not build under GHC 7.0 (but the SVG backend does), and the gtk backend does not build under GHC 7.6.
To get started with diagrams, read the quick tutorial, which will introduce you to the fundamentals of the framework.
For those who are less impatient and want to really dig in and use the power features, read the user manual.
Subscribe to the project mailing list, and/or come hang out in the
#diagrams IRC channel on freenode.org for help and discussion. Make some diagrams. Fix some bugs. Submit your cool examples for inclusion in the gallery or your cool code for inclusion in the diagrams-contrib package!
Brought to you by the diagrams team:
- Michael Sloan
- Ryan Yates
- Brent Yorgey
with contributions from:
- Sam Griffin
- Niklas Haas
- Peter Hall
- Claude Heiland-Allen
- Deepak Jois
- John Lato
- Felipe Lessa
- Chris Mears
- Ian Ross
- Vilhelm Sjöberg
- Jim Snavely
- Luite Stegeman
- Kanchalai Suveepattananont
- Michael Thompson
- Scott Walck
I had that question about the cairo cmdline backend as well, but is there a reason why you don’t expose something like “paramMain :: Read a => (a -> Diagram SVG R2) -> IO ()”? You can somehow emulate it with multiMain in some cases, but not with Double or very big Integer parameters, which is something I’ve run into several times (I ended up doing some additional command-line parsing on top of defaultMain, but that’s just sad).
Hmm, great idea! Can you file a feature request so I don’t forget about it: https://github.com/diagrams/diagrams-svg/issues ?
You’ve got a typo in the link to the manual. It should point to http://projects.haskell.org/diagrams/manual/diagrams-manual.html not
The tutorial says “diagrams is just a wrapper package which pulls in the following three packages:” when it should be updated to four instead of three.
Right you are, thanks!