Barak, Ron wrote: > I want to use Christopher Barker's "Tree.py demo" from FloatCanvas to > display some SAN data (see example below). > I looked at the sources, but - being new to Python - am not able to find > the place where the placement of each levels' objects is done, relative > to higher objects. > Mainly, what I would like is to have all objects which are descended > from a common ancestor drawn together, without having connector lines > crossing (as happens in the example below). > > Could anyone point me to the place in the code that determine placement > on the canvas of "Tree.py demo" objects ?
Keep in mind that I whipped that out quick to demonstrate how to do movable nodes and connectors with FloatCanvas -- the actual layout code is very lame. I wrote it a while back, but from a quick perusal of the code, I see: class TreeNode -- there a dx and dy are defined that is used to place the nodes relative to their parent. the LayoutTree function assigned coordinates to all the nodes. It is called recursively. You can see the math there -- you'll need to make that a lot smarter, I'm sure, if you want this to be general. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
