[Haskell-cafe] ANN: diagrams 0.4

Brent Yorgey byorgey at seas.upenn.edu
Tue Oct 25 18:25:30 CEST 2011

On Mon, Oct 24, 2011 at 11:55:53AM -0700, David Barbour wrote:
> Thanks.
> Diagrams package seems it could be promising for a declarative UI model -
> i.e. integration with functional reactive programming and similar models -
> so long as I'm willing to sacrifice `native` look and feel, which doesn't
> seem like a big problem.

Yes, I imagine it could.  Not one of the use cases I personally had in
mind -- but I've been hoping that people will find it useful for
things I had not thought of.

> A couple more questions:
> 1) Am I right in assuming that Diagrams does very little `occlusion` of its
> own - i.e. when rendering a soda-straw view of a complex diagram, or masking
> large areas with a rectangle or sphere? There won't be any competition or
> redundancy with an external index and backend (e.g. Cairo-GL layer)
> occlusion?

Right, diagrams currently doesn't do any sort of "culling", occlusion,
etc., that's all up to the backend.

> 2) Is there support for Cairo-like linear and radial gradients?

Not yet, but it's on the todo list.

> Also, it seems that for Cairo rendering, we cannot currently supply our own
> Cairo context.
> > renderDia Cairo (CairoOptions "foo.png" (PNG (100,100))) myDiagram
> This section of your manual is incomplete, I admit, but from browsing the
> code it seems you provide a simplified interface that fully encapsulates the
> Cairo rendering. Is there any way to render a diagram within the Cairo
> stack? or leverage Cairo's own experimental backends (like OpenGL)?

You're right, currently there's no way do these sorts of things.
However, there's no fundamental limitation here and adding this sort
of functionality should not be hard, and I'd be quite open to
extending the cairo backend in this direction.


More information about the Haskell-Cafe mailing list