[Haskell-cafe] Library for creating interactive diagrams?

Andrew Gibiansky andrew.gibiansky at gmail.com
Mon Apr 7 23:56:31 UTC 2014


I am very interested in using this with IHaskell, but don't know of
something that exists already. I am currently working on using IPython
widgets with IHaskell in order to create a generic "event handling"
framework for *any* sort of displays. Code might look like this (just some
initial thoughts):

-- Uses a StateT of some sort. Reruns things every time
-- a dependent value changes, and shows the updated output.
interactive $ do
  -- Display a slider. The value changes every time the slider moves.
  width <- slider # name "Picture Width" # range 0.1 5

  -- Rerun this event every key press. It can modify the state.
  onEvent (keyPress 'c') $ do
    modifyState doSomething

  -- Make a diagram using the current state. Rerun every time a
  -- slider value changes or key press event happens.
  diagram <- makeDiagram

  -- Show the diagram. This is what will chance in the IHaskell display.
  display diagram

I have Diagrams already working with IHaskell, and interactivity already
working in another example (interactive parsers with Parsec, see error
messages etc as you type), so all that remains is combining them. I'm
hoping to get it working nicely sometime this summer when I have more time,
but if you're interested in this approach, feel free to contact me.

[0] IHaskell: https://github.com/gibiansky/IHaskell


On Mon, Apr 7, 2014 at 4:44 PM, Kai Zhang <kai at kzhang.org> wrote:

> Hi cafe,
>
> Is there any active project about creating interactive diagrams, like D3js
> http://d3js.org/ ? The Diagrams library has already done a good job of
> making static images. Would it be possible to extend this library to
> support declaring interactive diagrams and then use JS and HTML as backend
> to draw them?
>
> Example: circle 1 $ with & hover .~ (change style)
>
> PS: I don't want a D3js binding.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140407/6d74978a/attachment.html>


More information about the Haskell-Cafe mailing list