The diagrams team is very pleased to announce the 1.0 release of diagrams, a framework and embedded domain-specific language for declarative drawing in Haskell. Check out the gallery for some examples of what it can do. Diagrams can be used for a wide range of purposes, from data visualization to illustration to art, and diagrams code can be seamlessly embedded in blog posts, LaTeX documents, and Haddock documentation, making it easy to incorporate diagrams into your documents with minimal extra work.
Brent recently gave a talk at the New York Haskell Users’ Group presenting the new release. You can find videos of the talk on vimeo: part 1 presents a basic introduction to the library, and part 2 talks about mathematical abstraction and DSL design. The slides are also available.
This release includes a number of significant new features and improvements. Highlights include:
Support for drawing arrows between given points or between diagrams, with many options for customization (tutorial, documentation, API).
A new framework for creating custom command-line-driven executables for diagram generation (tutorial, API).
Offsets of trails and paths, i.e. compute the trail or path lying a constant distance from the given one (documentation, API).
A new API, based on Metafont, for constructing cubic splines with control over things like tangents and “tension” (tutorial, API).
Tangent and normal vectors of segments and trails (API).
Alignment can now be done by trace in addition to envelope (API).
lenspackage is now used consistently for record fields throughout the library (documentation).
Across-the-board improvements in performance and size of generated files.
See the release notes for full details, and the migration guide for help porting your diagrams 0.7 code to work with diagrams 1.0.
Try it out
For the truly impatient:
cabal install diagrams
Diagrams is supported under GHC 7.4 and 7.6.
To get started, read the quick start tutorial, which will introduce you to the fundamentals of the framework and provide links for further reading.
For those who are less impatient and want to really dig in and use the power features, read the extensive user manual. There is also a growing collection of tutorials on specific topics.
Diagrams has a friendly and growing community of users and developers. To connect with the community, subscribe to the project mailing list, and/or come hang out in the
#diagrams IRC channel on freenode.org for help and discussion. Development continues stronger than ever, and there are a wide range of projects available for new contributors of all levels of Haskell skill. 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:
- Daniel Bergey
- Jeff Rosenbluth
- Ryan Yates
- Brent Yorgey
with contributions from:
- Jan Bracker
- Conal Elliott
- Daniil Frumin
- Sam Griffin
- Niklas Haas
- Peter Hall
- Claude Heiland-Allen
- Deepak Jois
- John Lato
- Felipe Lessa
- Chris Mears
- Ian Ross
- Carlos Scheidegger
- Vilhelm Sjöberg
- Michael Sloan
- Jim Snavely
- Luite Stegeman
- Kanchalai Suveepattananont
- Michael Thompson
- Scott Walck
I love the beauty of the diagrams library. Is there a story about in what situations diagrams could replace TikZ?
Hi Norman, thanks! One of our goals is to be able to answer “all of them”, though I think we’re not quite there yet. We do have a LaTeX package (https://github.com/diagrams/diagrams-builder/blob/master/latex/diagrams-latex.sty), allowing you to embed Haskell code describing diagrams directly in your LaTeX source and having them compiled and included automatically. One of the big missing pieces is a good-quality TikZ backend for diagrams (actually we have some work in this direction but it’s not production-quality yet), which would allow typeset equations to live in your diagrams.
I’m sure there are also lots of nice TikZ features which we don’t yet support. If you run across any such in particular we’d love to hear about them.