I’m trying to draw a network graph in Ruby using Tk. I’ve figured out
how to create the canvas and draw the nodes and edges. I’m in the
process of implementing a spring graph layout algorithm, and I’m
wondering how I can redraw the nodes and edges at new coordinates when
the new coordinates are calculated using the spring algorithm. I had
planned on creating a new thread every half second or so to call the
spring algorithm and repaint the nodes and edges.
Can anyone tell me how to ‘move’ an existing TckOval in Ruby Tk?
I believe you can tag objects on the canvas, and designate x & y
positions for the tags. If you tag your ‘oval’ you should be able to
move it wherever you want. There are also two very good resources for
Tk development in Ruby. They are both groups on Google. The first
group is called “Ruby and the Tk Toolkit”. The other is called “Tk
Documentation and Resources”. You should be able to get considerable
help between these two groups.