[Haskell-cafe] ANN: diagrams 0.4
Brent Yorgey
byorgey at seas.upenn.edu
Mon Oct 24 19:41:18 CEST 2011
On Sun, Oct 23, 2011 at 11:06:19PM -0700, David Barbour wrote:
> Is there any way to `query` a diagram, i.e. associate data with each pixel
> for mouse clicks?
Yes. Every diagram has an associated 'query function', which
associates a monoidal value to every point. By default it just
returns True/False indicating whether the given point is in the
interior of any shape, but you can use any monoid you like. I believe
John Lato has been using this in conjunction with the support for
rendering directly to a gtk widget to develop some sort of interactive
graphical application (I don't know many details).
For more info see
http://projects.haskell.org/diagrams/manual/diagrams-manual.html#using-queries
-Brent
More information about the Haskell-Cafe
mailing list