# Question about ruby graphics

**URL:** <https://www.ruby-forum.com/t/question-about-ruby-graphics/92832>\
**Category:** Ruby\
**Created:** [April 24, 2007, 8:08pm UTC](https://www.ruby-forum.com/t/question-about-ruby-graphics/92832 "2007-04-24T20:08:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zedenator](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a587f6/32.png) [@zedenator](https://www.ruby-forum.com/u/zedenator)\
**Post date:** [April 24, 2007, 8:08pm UTC](https://www.ruby-forum.com/t/question-about-ruby-graphics/92832/1 "2007-04-24T20:08:47Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![zedenator](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a587f6/32.png) [@zedenator](https://www.ruby-forum.com/u/zedenator)\
**Post date:** [April 24, 2007, 8:24pm UTC](https://www.ruby-forum.com/t/question-about-ruby-graphics/92832/2 "2007-04-24T20:24:48Z")

</div>

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](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](http://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.
