it's for display purposes only, and just one tree at a time.
Main Topics
Browse All TopicsHi,
I need to dynamically draw (graphical) trees to represent simple prefix-notation maths sum, such as "+*xxx" [equal to (x*x)+x ], which would drawn as follows:
'+' at the root, '*' on the root's left branch (with an 'x' as both its leaves), and an 'x' on the root's right branch (a leaf).
(hope that makes sense, though hopefully it doesn't matter if it doesn't)
What I need is a plug-in that can draw these trees given just a string of the sum.
I assume I need free evaluation/demo software for the moment, because I only need to demonstrate the possibilities.
If there's some way of doing this using nothing extra that would be great, but I doubt it.
Any suggestions? Thanks in advance...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
well .. you can't really draw the real trees using the built in controls. you can create a control to owner draw this type of tree. but then you'd have to re-implement the "+" & "-" -- expand and collapse capabilities in addition to formatting .. etc.
so better stick to the Win Explorer format -- using Tree View.
checkout: http://www.seanet.com/user
very neat .. and should give you idea for drawing trees. in .net to draw graphics ... use this
System.Drawing.Graphics g=this.CreateGraphics();
g.DrawLine(new System.Drawing.Pen(Color.R
g.<MANY DRAWING FUNCTIONS ... e.g. drawarc, drawrectangle, drawcircle, et.c..>
There's a product that I had in mind (vaguely) because I remembered some graph layouts that impressed me. I had to do some searching to find it.
I don't know how much work this would take to use for your application, but it would be sure to create a visually appealing result. It does do automatic layout, though I don't know how closely that matches your application. See the diagrams and explanation near the top of the second link.
Tom Sawyer products
http://www.tomsawyer.com/p
...
Graph Layout Toolkit (C++) -- shows good diagrams of their technology
http://www.tomsawyer.com/g
...
The Graph Editor Toolkit for the Microsoft Development Community (.NET)
http://www.tomsawyer.com/g
Cool, huh?
--- --- ---
Other tools I found during my search. These are not very on-target, but might still be useful.
MetaDraw
http://www.bennet-tec.com/
AddFlow
http://www.lassalle.com/af
RFFlow
http://www.rff.com/
Process Chart
http://www.processchart.co
FlowChartX
http://mindfusion.org/down
http://mindfusion.org/gall
(By the way, don't waste a lot of time on those "not on-target" links. If they don't look right, just move on.)
Here's a couple more on-target that look very promising, though.
daVinci Presenter
http://www.b-novative.com/
http://www.b-novative.com/
(You could probably do simple text-processing to convert your input strings to their format.)
http://www.b-novative.com/
Brochure (with diagrams)
http://download.b-novative
Graphlet, Graphscript
http://www.infosun.fmi.uni
---
Great list of graph drawing tools (Some I've found, some new.)
http://i11www.informatik.u
---
You might find good info at http://graphdrawing.org
book list:
http://graphdrawing.org/li
---
Another aside -- this one you'll probably find interesting.
For math notation, not graphs.
MathML .NET Control 1.0
http://www.dnzone.net/Show
---
Hmmmm ... getting a bit carried away here!
Ok, one more ...
Graphviz -- open source graph drawing software
http://www.research.att.co
There seems to be a lot more available in Java, Unix, etc. rather than .NET.
Jazzle,
This is the last I'll have for this question, but feel free to contact me (via info in my profile). I'm a bit interested in your project. It would be cool if you could leave an update/status here sometime in the future -- particularly about the graphics/layout solution you finally implement, but also about the project in general.
I'm going to try using Netron (see below) for a project I'm just beginning. Looks promising. I just downloaded it, but haven't installed yet.
DRAWING
What have you determined about all the above posts for drawing solutions? Anything at all interesting?
I'm pretty sure you'll need to write something yourself for your particular application. You've got lots of choices for doing the graphics,m even just the System.Drawing namespace. Perhaps that would be the "simple way to draw lines and single chars given an input string" you mentioned way up top. If you do use System.Drawing you'll have to write-your-own layout code.
LAYOUT
If you need an algorithm to properly layout the tree, do a search on "layout algorithm" or "graph layout algorithm" or "tree layout algorithm". Or you could come up with your algorithm for this simple case: I guess every node would have 0, 1, or 2 children. You could start with a simple, naive implementation, with one child a bit to the left, and the other a bit to the right. That's result in overlap. Then you can tweak and tune the algorithm to avoid overlap. If you do the layout from the bottom upwards, each node should be able to look at the left-bound and right-bound of the left and right sub-trees, and determine how far left and right they need to be placed.
MORE DRAWING TOOLS
The Netron Project (includes some? layout, free, beta, see license)
http://sourceforge.net/pro
GoDiagram for Microsoft .NET ($$)
http://www.nwoods.com/GO/d
http://www.godotnetweb.com
The TreeApp and AutoLayout Demo samples may be close to what you need.
this is long overdue, but I thought I shold say what I did in the end.
I used that last suggestion, Northwoods, with a free educational license.
My diss is at http://www.jazzle.co.uk/GP
Business Accounts
Answer for Membership
by: malharonePosted on 2004-01-07 at 09:18:56ID: 10063454
Is this for display purpose only or for parsing and then computing ?
Look into INORDER trees/graph structures.