Library for creating interactive diagrams?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Library for creating interactive diagrams?

Kai Zhang
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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Library for creating interactive diagrams?

Andrew Gibiansky
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.



On Mon, Apr 7, 2014 at 4:44 PM, Kai Zhang <[hidden email]> 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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Library for creating interactive diagrams?

Kai Zhang
Looks like you are going to add some "control bars" to diagrams. This is definitely a nice feature to have. But how would you be able to do something like changing the color of a circle when you place the mouse on it? I want control bars as well as some interactivity built directly into the SVG.


On Mon, Apr 7, 2014 at 4:56 PM, Andrew Gibiansky <[hidden email]> wrote:
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.



On Mon, Apr 7, 2014 at 4:44 PM, Kai Zhang <[hidden email]> 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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Library for creating interactive diagrams?

Andrew Gibiansky
All of this would rely on the IHaskell interface, and would not work with any other interface or work with raw SVG/HTML/JS/etc. 

I'd love to have a different approach though, in case anyone knows of one :)


On Mon, Apr 7, 2014 at 5:55 PM, Kai Zhang <[hidden email]> wrote:
Looks like you are going to add some "control bars" to diagrams. This is definitely a nice feature to have. But how would you be able to do something like changing the color of a circle when you place the mouse on it? I want control bars as well as some interactivity built directly into the SVG.


On Mon, Apr 7, 2014 at 4:56 PM, Andrew Gibiansky <[hidden email]> wrote:
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.



On Mon, Apr 7, 2014 at 4:44 PM, Kai Zhang <[hidden email]> 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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe





_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Library for creating interactive diagrams?

Andrey Chudnov
In reply to this post by Kai Zhang
Have you looked at interactive-diagrams [1]?

[1] https://github.com/co-dan/interactive-diagrams

On 04/07/2014 07:44 PM, Kai Zhang 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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Library for creating interactive diagrams?

Kai Zhang
Pretty nice. I'll definite take a look into it. But currently the documentation is poor. Thanks!


On Mon, Apr 7, 2014 at 6:30 PM, Andrey Chudnov <[hidden email]> wrote:
Have you looked at interactive-diagrams [1]?

[1] https://github.com/co-dan/interactive-diagrams


On 04/07/2014 07:44 PM, Kai Zhang 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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Library for creating interactive diagrams?

Daniil Frumin
Hi! interactive-diagrams developer here

The documentation is indeed lacking, but the "interactive" part is
located in the display-src library. The interactivity is achieved by
compiling Diagrams code to Javascript via GHCJS (see eval-api
library). Right now it is not possible to write something like the
color-changing circle in your example, but you can have something like
this: http://paste.hskll.org/get/1385

Cheers

- Dan

On Tue, Apr 8, 2014 at 5:46 AM, Kai Zhang <[hidden email]> wrote:

> Pretty nice. I'll definite take a look into it. But currently the
> documentation is poor. Thanks!
>
>
> On Mon, Apr 7, 2014 at 6:30 PM, Andrey Chudnov <[hidden email]> wrote:
>>
>> Have you looked at interactive-diagrams [1]?
>>
>> [1] https://github.com/co-dan/interactive-diagrams
>>
>>
>> On 04/07/2014 07:44 PM, Kai Zhang 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
>> [hidden email]
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



--
Sincerely yours,
-- Daniil
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe