From: Phlip Date: 2002-09-23T21:56:24+09:00 Subject: Re: rgl can't produce disconnected graphs Horst Duchene wrote: > There is one vertex: > > irb(main):073:0> dg.vertices > ["yo"] Sorry - I tried to imply I knew there was a no bug in RGL proper - just its path thru GraphViz's Dot system. > write_to_graphic_file has a bug. It only shows edges. I fixed it in the > latest CVS of rgl/dot.rb. By the way: Support for dot is rather > rudimentary. Debugging graph datastructures should better be done using > inspect or the graph accessors for vertices and edges. I'm not debugging graph accessors I'm writing a wrapper on Dot. Here's my outer intent: One can create a very powerful user interface treating 'dot' essentially as a geometry manager. Imagine if we had a "family tree" program. We could click on a node to upgrade that person's records, and we could use arrow keys to travel between family members. I can do this in <300 lines of code (plus test code, natch) using a TkCanvas and a utility to convert a subset of SVG format into objects on that canvas. Writing that utility test-first requires me to start with the simplest feature, which is one node. After posting the question I did this by starting at the Graphviz layer. So here's my product, with [optional components]: [RGL ->] GraphVis -> SVG format -> TkCanvas The result is a truly sweet UI framework. I'l deliver it to RubyGarden very soon; it's almost done. The only feature I could request is this: The TkCanvas layer works poorly if the nodes are not filled-in. This is not mission-critical, but it improves the odds an end-user programmer will opt to use the RGL layer above GraphViz. Formatting 'dot' files in memory will be a pain in the nads. The best feature for RGL (unless if I'm missing it) would be the ability to add a string that the RGL::Dot layer will pass-thru to the Dot file. To whit: aNode [label = "", style = filled, fillcolor = pink, color = green]; bNode [label = "", style = filled, fillcolor = pink, color = green]; If the above is indeed possible via Ruby's vaunted class extension mechanics, please feel free to categorize me as the drooling newbie who refuses to read the fine manual that I am, so long as source accompanies the admonition! -- Phlip http://www.greencheese.org/MayorZogg -- All sensors report Patti having a very good time --