|
List Info
Thread: "ocaml_beginners"::[] real-time interactive graphviz ?
|
|
| "ocaml_beginners"::[]
real-time interactive graphviz ? |
  Norway |
2007-04-09 06:11:47 |
|
Hi list,
Recently, when programming an application in OCaml, I need to visualize the
topological structure of a network as directed graph. Since the network is
defined by user, the graphs can be arbitrary and won't be able to know
beforehand. Rather than diving into complicated graph theory by oneself, it
takes much less effort to make use of Graphviz which is dedicated to this
purpose.
However, I'm not sure whether I can do the following with Graphviz (and better
with some preexisted OCaml packages)
* Real-time
The topology structure of the network is static, but there are datum being
transmitted from one node to another. I need to show that also in the
graph. I can satisfied with updating the graphics with event.
* Interactive
I needs simple mechanics of interaction. For example, when the user press
"Ctrl-C", the graphics stop transmitting datums; then the user press
the space key once, the graphics takes a step forward, i.e. some datum
transmitted from a node to another. In short, like a graphic debugger.
I'd like to know the proper tech to implement this with least effort and the
libraries for doing that in OCaml.
Thanks for any suggestions!
-code17
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[]
real-time interactive graphviz ? |
  France |
2007-04-09 14:05:21 |
|
Hi
You could have a look at http://home.gna.org/cameleon/odot.en.html
Cheers
T
code17 wrote:
>
>
> Hi list,
>
> Recently, when programming an application in OCaml, I need to
> visualize the
> topological structure of a network as directed graph. Since the network is
> defined by user, the graphs can be arbitrary and won't be able to know
> beforehand. Rather than diving into complicated graph theory by
> oneself, it
> takes much less effort to make use of Graphviz which is dedicated to this
> purpose.
>
> However, I'm not sure whether I can do the following with Graphviz
> (and better
> with some preexisted OCaml packages)
>
> * Real-time
> The topology structure of the network is static, but there are datum being
> transmitted from one node to another. I need to show that also in the
> graph. I can satisfied with updating the graphics with event.
>
> * Interactive
> I needs simple mechanics of interaction. For example, when the user press
> "Ctrl-C", the graphics stop transmitting datums; then the user press
> the space key once, the graphics takes a step forward, i.e. some datum
> transmitted from a node to another. In short, like a graphic debugger.
>
> I'd like to know the proper tech to implement this with least effort
> and the
> libraries for doing that in OCaml.
>
> Thanks for any suggestions!
>
> -code17
>
>
> ----------------------------------------------------------
> Orange vous informe que cet e-mail a été contrôlé par l'anti-virus mail.
> Aucun virus connu à ce jour par nos services n'a été détecté.
>
>
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[]
real-time interactive graphviz ? |
  United Kingdom |
2007-04-09 13:25:33 |
|
On Mon, Apr 09, 2007 at 01:11:47PM +0200, code17 wrote:
> Recently, when programming an application in OCaml, I need to visualize the
> topological structure of a network as directed graph.
On what computer platform? Obviously Unix-like systems are going to
have more options available.
> Since the network is defined by user, the graphs can be arbitrary
> and won't be able to know beforehand. Rather than diving into
> complicated graph theory by oneself, it takes much less effort to
> make use of Graphviz which is dedicated to this purpose.
>
> However, I'm not sure whether I can do the following with Graphviz
> (and better with some preexisted OCaml packages)
>
> * Real-time
> The topology structure of the network is static, but there are
> datum being transmitted from one node to another. I need to show
> that also in the graph. I can satisfied with updating the
> graphics with event.
I'm no expert on graphviz, having just used it casually to do a few
graphs, but I'm not aware of it having any real-time or interactive
capabilities. However what's possible is to use the 'dot' command
line tool and have it output a plain format file ('dot -Tplain' [1])
which you can then read in, parse to get the position of the nodes,
edges, which you can then draw. Drawing using OpenGL is easy and
portable.
So generate your dot file describing the graph programmatically, pipe
it through dot -Tplain, parse in the result, and render using OpenGL.
Then animate the edges or nodes by redrawing using standard OpenGL
techniques[2].
> * Interactive
> I needs simple mechanics of interaction. For example, when the user press
> "Ctrl-C", the graphics stop transmitting datums; then the user press
> the space key once, the graphics takes a step forward, i.e. some datum
> transmitted from a node to another. In short, like a graphic debugger.
OpenGL gives you interactivity, eg. using SDL or GLUT.
Alternatives would include things like the Tk or Gtk canvas widgets.
Rich.
[1] http://www.graphviz.org/Documentation/dotguide.pdf - Appendix B.
[2] Recommend you read the OpenGL "Red Book" - it will save you a
world of pain understanding how OpenGL works.
http://www.opengl.org/documentation/red_book/
--
Richard Jones
Red Hat
__._,_.___
.
__,_._,___
|
| Re: "ocaml_beginners"::[] Re:
real-time interactive graphviz ? |
  United Kingdom |
2007-04-10 11:26:53 |
|
On Tue, Apr 10, 2007 at 01:21:06PM +0200, code wrote:
> Richard Jones < rich%40annexia.org">rich annexia.org> writes:
> > On what computer platform? Obviously Unix-like systems are going to
> > have more options available.
> I'm on Linux. However, it would be better to use some portable libraries. The
> graphviz and OpenGL recommended in the later part are both portable, aren't
> they?
OpenGL is very portable, despite Microsoft's best efforts to the
contrary.
> Besides, I find in Graphviz's website [1] that there are OCaml (and various
> other languages) bindings provided in RPM. What is that for? does anyone have
> experience with it? where is the source and doc of the this binding? is there
> any Debian package for that?
Well, I took a look and the bindings are made using SWIG, which is
definitely not the best way to create bindings for OCaml. I still
think the easiest way is going to be to use Unix.open_process_in and
parse the plain-format file.
Rich.
--
Richard Jones
Red Hat
__._,_.___
.
__,_._,___
|
[1-4]
|
|