A rendering backend for drawing diagrams in wxWidgets (using wxHaskell), built on top of the diagrams-cairo backend.
See the Haddock page for the Diagrams.Backend.WX module.
Everything necessary to build wxHaskell
and diagrams-cairo is necessary
to build diagrams-wx
. Please see their respective documentation.
On Ubuntu, the setup instructions for these packages can be condensed down to the following:
-
Install required external libraries:
sudo apt-get install libwxgtk3.0-dev libwxgtk-media3.0-dev libcairo2-dev libpango1.0-dev
-
Ensure
happy
andalex
are installed:# for Cabal cabal install happy cabal install alex # for stack stack install happy stack install alex
-
Ensure
gtk2hs-buildtools
is installed:# for Cabal cabal install gtk2hs-buildtools # for stack stack install gtk2hs-buildtools
Once all dependencies are set up, the diagrams-wx
package can be built in the
usual way, via cabal build
or stack build
depending on your setup.
A simple demo is available in the demo/
directory. It can be built and run as
follows:
# for Cabal
cabal configure -fbuildExample
cabal build
cabal run diagrams-wx-demo
# for stack
stack build --flag diagrams-wx:buildExample
stack exec diagrams-wx-demo
Copyright (C) 2016 Michael Smith.
diagrams-wx
is licensed under the BSD 3-clause license.