Forum: Ruby question about ruby graphics

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
zedenator (Guest)
on 2007-04-24 22:08
(Received via mailing list)
Hello Rubyists,

some background:
I am looking into using Ruby for my university project, the outcome of
which is an application capable of displaying tree-like structures
given a specific set of data and populated by an arbitrary number of
nodes at any level (something like http://tkhtml.tcl.tk/tree.gif). The
application needs to be interactive in a sense that clicking with a
mouse on any of the nodes would result in some action taken.

I experimented a little WxRuby and its my prefered toolkit for coding
the entire application in (cross-platform is a requirement), but its
drawing methods arent the most suitable for my case. Idealy I'd want
to describe the tree using something that looks and feels like Dot
language format used by Graphviz and feed that into some external
module to actually generate the graphics.

The question I have is is there anything that has such/similar
functionality in Ruby? All I seemed to find are various static
graphing tools, neither do I want to spend time writing code to
manually arrange a set of rectangles on the screen.

Any ideas are welcome. Thanks!


./zedenator
Brian C. (Guest)
on 2007-04-24 22:24
(Received via mailing list)
On Wed, Apr 25, 2007 at 03:08:09AM +0900, zedenator wrote:
> I am looking into using Ruby for my university project, the outcome of
> which is an application capable of displaying tree-like structures
> given a specific set of data and populated by an arbitrary number of
> nodes at any level (something like http://tkhtml.tcl.tk/tree.gif). The
> application needs to be interactive in a sense that clicking with a
> mouse on any of the nodes would result in some action taken.

Have a look at graphviz (www.graphviz.org). It can generate such trees
and
make them clickable as client-side imagemaps. I believe there is a Ruby
binding (google for it), but at worst you create a temporary file and
then
run the graphviz utility using system() or IO.popen.
This topic is locked and can not be replied to.