hilbert 0 = mempty
hilbert n = hilbert' (n-1) # reflectY <> vrule 1
         <> hilbert  (n-1) <> hrule 1
         <> hilbert  (n-1) <> vrule (-1)
         <> hilbert' (n-1) # reflectX
  where
    hilbert' m = hilbert m # rotateBy (1/4)

diagram :: Diagram B
diagram = strokeT (hilbert 6) # lc silver
                              # opacity 0.3

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


Get started

Read the quick start tutorial or the user manual.

Get excited

Check out the gallery for example images and code.

Get connected

Drop by the #diagrams IRC channel with questions, or post them to the mailing list.

News

October 27, 2016

Diagrams 1.4 released! See the migration guide for help porting existing diagrams code to 1.4.

September 5, 2015

Ryan Yates and Brent Yorgey gave a presentation about diagrams at FARM 2015. The slides are available here.

April 19, 2015

Diagrams 1.3 released! Look for a blog post soon with a rundown of new features. In the meantime, see the migration guide for help porting existing diagrams code to 1.3.


Built with hakyll, pandoc, and, of course, diagrams.