diagrams-builder

hint-based build service for the diagrams graphics EDSL.

https://diagrams.github.io

Version on this page:0.8.0.6@rev:2
LTS Haskell 23.27:0.8.0.6@rev:3
Stackage Nightly 2025-07-13:0.8.0.6@rev:3
Latest on Hackage:0.8.0.6@rev:3

See all snapshotsdiagrams-builder appears in

BSD-3-Clause licensedbyBrent Yorgey
Maintained by[email protected]
This version can be pinned in stack with:diagrams-builder-0.8.0.6@sha256:442f4e4bd9acca43798e35aab35d254348f281342a78ca61dbbe576e32b07dd6,7979

Build Status

diagrams-builder provides backend-agnostic tools for dynamicallyturning code into rendereddiagrams, using thehint wrapper to the GHCAPI. It supports conditional recompilation using hashing of diagramssource code, to avoid recompiling code that has not changed. It isuseful for creating tools which compile diagrams code embedded inother documents. For example, it is used by theBlogLiterately-diagramspackage (a plugin forBlogLiterately)to compile diagrams embedded inMarkdown-formattedblog posts, and by thediagrams-latex.stypackage for embedding diagrams in LaTeX documents (see below).

Executables specific to thecairo,svg,postscript,rasterific, andPGF backends are included. Eachtakes an input file and an expression to render and outputs an imagefile using the appropriate backend. You must explicitly enablewhichever executables you want using flags like-fcairo,-fsvg,and so on.

A LaTeX package,diagrams-latex.sty, is also provided in thelatex/ directory of the source distribution, which renders diagramscode found withindiagram environments. It can make use of any ofthediagrams-builder-cairo,diagrams-builder-postscript, ordiagrams-builder-pgf executables, so if you want to usediagrams-latex.sty you should installdiagrams-builder with theappropriate option. Note thatdiagrams-latex.sty is licensed underthe GPL. For more information on usingdiagrams-latex.sty, seethis tutorial.

Changes

v0.8.0.6 (2023-07-10)

  • Bump upper bounds: allow
    • base-4.18
    • base-orphans-0.9
    • mtl-2.3
    • transformers-0.6
    • lens-5.2
    • diagrams-postscript-1.5
    • bytestring-0.11
  • Test on GHC 9.4 and 9.6
  • Drop support for GHC < 8.10

v0.8.0.5 (2020-01-21)

  • Bump upper bounds: allow

    • base-4.13 (GHC 8.8)
    • haskell-src-exts-1.22
    • haskell-src-exts-simple-1.22
    • lens-4.18
    • hashable-1.3
  • r1 (2021-08-09):

    • allowbase-4.15 (GHC 8.10 and 9.0)
    • allowhaskell-src-exts-1.23 andhaskell-src-exts-simple-1.23
    • allowlens-5.0
  • r2 (2021-08-19): update URL

  • r3 (2021-12-30):

    • allowbase-4.16 (GHC 9.2)
    • allowlens-5.1
    • allowhashable-1.4
  • r4 (2021-12-31):

    • allowlens-5.1 andbytestring-0.11 in executables

v0.8.0.4 (2019-02-08)

  • Bump upper bounds: allow
    • base-4.12
    • lens-4.17
    • hint-0.9
    • JuicyPixels-3.3
  • New options added todiagrams-latex.sty

v0.8.0.3 (2018-06-09)

  • Bump upper bounds: allowexceptions-0.10,lens-4.16,hint-0.8,base-4.11,base-orphans-0.7
  • Test with GHC 8.4
  • Drop GHC 7.8 support

v0.8.0.2 (2018-01-21)

  • Allowhaskell-src-exts-1.20 andhaskell-src-exts-simple-1.20
  • Bug fix for GHC 8.2: temp module generation now uses a valid name (#32)

v0.8.0.1 (2016-11-28)

  • Allowhaskell-src-exts-1.19 andhaskell-src-exts-simple-1.19

  • Allowhint-0.7 in Hackage revision 2.

  • Allowbase-4.10 in Hackage revision 3.

v0.8 (2016-10-26)

  • diagrams-builder-pgf: add catch-all case for file extension
  • Better defaults (#29):
    • default extension will be chosen based on backend
    • input option automatically selected when usingpgf backend
    • diagrams is now default output directory
  • Modulescan now be imported qualified
  • allowlens-4.15
  • Requirehaskell-src-exts-1.18 andhaskell-src-exts-simple
  • Requirediagrams-*-1.4

v0.7.2.4 (2016-09-05)

Update upper bounds, and build with GHC 8. Allow:

  • transformers-0.5
  • lens-4.14
  • base-4.9
  • hint-0.6

Now requiresdiagrams-svg-1.4 andsvg-builder.

v0.7.2.3 (2016-03-19)

  • allowhint-0.5

v0.7.2.2 (2016-01-16)

  • allowbase-orphans-0.5

v0.7.2.1 (2015-12-06)

  • allowhaskell-src-exts-1.17.*

v0.7.2.0 (2015-09-22)

  • allowlens-4.13
  • AddTypeFamilies andFlexibleContexts extensions automaticallyto diagrams code, so users do not have to add them manually whenbuilding with GHC 7.10

Full Changelog

v0.7.1.1 (2015-07-19)

Full Changelog

0.7.1 (16 June 2015)

  • allowbase-orphans-0.4
  • adddiagrams-pgf executable
  • add diagrams-latex option to use \input instead of \includegraphics,for use with diagrams-pgf

0.7.0.4 (1 June 2015)

  • diagrams-builder-svg now builds again (does not build in any other0.7.0.x releases)

0.7.0.3 (1 June 2015)

  • getTypeable Any instance frombase-orphans package

v0.7.0.2 (2015-05-26)

  • allowlens-4.11

0.7.0.1 (20 April 2015)

  • Fix compilation errors in diagrams-builder-rasterific executable

0.7 (19 April 2015)

  • Update todiagrams-lib-1.3.
  • Adddiagrams-rasterific support.
  • Add support forDIAGRAMS_SANDBOX environment variable.
  • Allowexceptions-0.8
  • Fixdiagrams-latex directory creation on Windows

0.6.0.4 (2 April 2015)

  • allowlens-4.9

0.6.0.3 (13 Jan 2015)

  • Allowlens-4.7

0.6.0.2 (20 November 2014)

  • Allowlens-4.6
  • Allow and requirehaskell-src-exts-1.16

0.6.0.1 (22 August 2014)

  • Allow lens-4.4

0.6 (5 June 2014)

  • Requirediagrams-lib-1.2
  • Change to the type ofbuildDiagram in0.5.0.11 actually required a majorversion bump.

0.5.0.11 (2 June 2014) (BROKEN)

  • Allowtransformers-0.4
  • Allowlens-4.2
  • Allowmtl-2.2

0.5.0.10 (21 May 2014)

  • Module parse error messages now include the error location(thanks to Yiding Jia)

0.5.0.9 (15 April 2014)

  • Fix bug introduced by 0.5.0.8 release (accidentally includedcommit meant for compatibility with unreleased versions of otherdiagrams packages)

0.5.0.8 (15 April 2014) (BROKEN)

  • Allowhaskell-src-exts-1.15

0.5.0.7 (7 April 2014)

  • Allowexceptions-0.5

0.5.0.6 (20 March 2014)

  • Allowlens-4.1 in executables also

0.5.0.5 (19 March 2014)

  • Allowlens-4.1

0.5.0.4 (15 March 2014)

- Update for `hint-0.4`- Allow `diagrams-lib-1.1` and `diagrams-cairo-1.1`- Allow `lens-4.0`

0.5.0.3 (8 March 2014)

- Allow `base-4.7`

0.5.0.2 (6 March 2014)

- Allow `diagrams-lib-1.1`- Allow `lens-4.0`

0.5.0.1 (27 January 2014)

- Allow hashable-1.1

0.5 (27 January 2014)

- Consolidate buildDiagram arguments into a single record of  arguments.- Add a `postProcess` argument, a function to be applied to the  interpreted diagram.

0.4.2 (26 November 2013)

- `buildDiagram` now accepts expressions of type `Diagram` or `IO  Diagram`: it just tries both.- Add dependency on `mtl`.

0.4.1 (24 November 2013)

- bug fix: avoid ambiguity errors when parsing unknown operators- update to work with diagrams-1.0

0.4.0.6 (2 October 2013)

- allow cryptohash-0.11

0.4.0.5 (11 September 2013)

- require diagrams-svg >= 0.8.0.1

0.4.0.4 (11 September 2013)

- fix compile error in diagrams-builder-svg executable- require diagrams-svg >= 0.8

0.4.0.3 (10 September 2013) [BROKEN]

- allow diagrams-svg-0.8

0.4.0.2 (31 August 2013)

- allow cryptohash-0.10

0.4.0.1 (22 August 2013)

- allow haskell-src-exts 1.14

0.4: 9 August 2013

  • Add hsenv compatibility.
  • Big improvements in the way rebuilding is handled:
    • Strip comments before deciding whether to rebuild, sochanging only comments does not trigger a rebuild
    • Take local imports into account: if a diagram has an importwhich corresponds to a local file, rebuild if that file haschanged
    • Rebuild when options (e.g. size) change

0.3.0.1 (3 April 2013)

  • depend on cryptohash >= 0.8 && < 0.10 (use new unified API)
  • remove base16-bytestring dependency

0.3: 3 Feburary 2013

  • newdiagrams-builder-postscript tool
  • miscellaneous improvements todiagrams-latex.sty

0.2.1.0: 11 December 2012

  • newdiagrams-builder-svg tool
  • deal properly with an empty list of sources (#2)
  • put cached diagrams in.diagrams_cache instead ofdiagrams by default
  • bug fix: cached files should use same extension as requested output, not “png”
  • bug fix: create output directory for cached images if it doesn’t exist
  • new moduleDiagrams.Builder.CmdLine; factor out common utilitiesfor command-line tools
  • depend on 0.6 versions of diagrams libs

0.2.0.0: 26 August 2012

Initial release