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


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to