Git Product home page Git Product logo

diagrams-postscript's Introduction

Build Status

diagrams is a full-featured framework and domain-specific language (embedded in Haskell) for creating declarative vector graphics and animations.

This package is just a convenient wrapper around the diagrams-core, diagrams-lib, diagrams-svg, and diagrams-contrib packages, so they can be installed with a single cabal install --lib diagrams command.

The package also comes with flags to enable six different backends. The native SVG backend is enabled by the -fsvg flag and is enabled by default. If you don't want it, you must explicitly disable it with -f-svg.

The native postscript backend is disabled by default but can be enabled by the -fps flag.

The cairo backend is disabled by default but can be selected with the -fcairo flag. In addition, the GTK backend is based on the cairo backend (but split into a separate package to make installing the cairo backend easier). It can be selected with the fgtk flag.

The native rasterific backend which is disabled by default but can be selected with the -frasterific flag.

The native canvas backend which is disabled by default but can be selected with the -fcanvas flag.

Installation

cabal update && cabal install --lib diagrams

or, to get the postscript backend in addition to the SVG backend:

cabal update && cabal install --lib -fps diagrams

or, to get the cairo backend in addition to the SVG backend:

cabal update && cabal install gtk2hs-buildtools && cabal install --lib -fcairo diagrams

Reporting bugs

Issue trackers for all diagrams-related repositories are hosted under the diagrams organization on github. If you know the specific package containing the bug, report it in the issue tracker specific to that package (for example, diagrams-lib). Otherwise, just report the issue in the issue tracker for the general diagrams repository.

Further reading

For more information, including a gallery of examples, tutorial, and user manual, see the diagrams website. For help, join the #diagrams IRC channel on Freenode or the mailing list.

diagrams-postscript's People

Contributors

bergey avatar byorgey avatar cchalmers avatar finleymcilwaine avatar fryguybob avatar fumieval avatar jeffreyrosenbluth avatar mgsloan avatar phadej avatar ryanglscott avatar spl avatar timbod7 avatar vmchale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diagrams-postscript's Issues

Release 1.5

I see @byorgey updated and upload a lot of other diagrams packages, thanks for that! But this package seems to be forgotten?

Unicode text

I haven't really thought about this and I'm not sure what we can do, but if we have text with unicode characters postscript does not handle them correctly. We should also look into what happens on other backends with unicode.

cannot install with base-4.10

Requirements specify that <base-4.10.0.0 is required for this to work. The windows platform of haskell comes with base-4.10.0.0
Is this on purpose?

I am trying to get haskell-chart working. Failure occurs due to not being able to find Graphics.Rendering.Chart.Backend.Diagrams
Maybe this is the wrong place to report this

diagrams-postscript-1.5.1 requires diagrams-lib-1.4.5

src/Diagrams/Backend/Postscript.hs:144:21: error:
    • No instance for (Eq (SizeSpec V2 Double))
        arising from the second field of ‘PostscriptOptions’
          (type ‘SizeSpec V2 Double’)
      Possible fix:
        use a standalone 'deriving instance' declaration,
          so you can specify the instance context yourself
    • When deriving the instance for (Eq
                                        (Options Postscript V2 Double))
    |
144 |     deriving (Show, Eq)
    |                     ^^

Styles not applying correctly

I have noticed that styles are not applying correctly in Postscript. I imagine that this is due to the change to the rtree stuff, but I don't really know. An example of something going wrong:

arrowBetween a b # lc red

Gives a red arrow head and black line.

Opacity does not work

In this example all circles have the same opacity

import Diagrams.Prelude
import Diagrams.Backend.Postscript
import Diagrams.Backend.Postscript.CmdLine
import Data.Colour (withOpacity)

colors  = map (blue `withOpacity`) [0.1, 0.2 .. 1.0]
example = hcat' with { catMethod = Distrib, sep = 1 }
                (zipWith fcA colors (repeat (circle 1)))

main :: IO ()
main = defaultMain example

Support GHC 9.2

Currently, the lens constraint (<5.1) at first blocks the Cabal build with GHC 9.2.

No way to render to a ByteString in memory directly.

Right now I have to have a place on the file system to scribble a file. This precludes using diagrams-postscript in places like the School of Haskell, where I would like to just serve up a ByteString of generated content to show sexy diagrams to the user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.