views:

118

answers:

6

I need to visualize a graph of this kind. I don't know how to name it (by the way, if you know - I'll appreciate if you tell me). It would be ideal for graph elements to be clickable (so that when user clicks on a block, I can handle an event with the element id specified) but I can survive even without any interactivity. I may like to be able to focus on a particular node and layout all others to view from its perspective. Are there any components available good for this task? If no, what should I look for to help me to develop an algorithm for drawing such a graph with visually-comfortable layout?

Practical nature of this graph is pretty common: each block represents a derivation from 2 operands. Orange circles are references to 2 operands, green circles are connection points to consumers. It can be significant to distinguish an operand position (left or right), for example if a derivation represents a mathematical operation of difference or division (in this particular case a block can be triangular, but in other cases an operand itself can make use of being aware of for what blocks is it a left operand and for what blocks is it a right). Another common application is intersecting sets with complex relations.

+3  A: 

You could take a look at Graph#, but I'm not sure how well it'll handle composite nodes like that. It could be a good starting point though.

Will Vousden
+2  A: 

Well, you first need to represent it somehow in memory, there are many ways, like adjacency list. Then you need to draw it. While generally drawing a graph is simple, it's not that simple if you need to layout it. Looks like in your case, that's exactly what you need to do to come to that nice representation. It ain't going to be easy.

EDIT: Interesting, there seems to be a library made by Microsoft Research.

Ion Todirel
+2  A: 

I don't know how useful it will be in this particular scenario, but you might want to take a look at http://quickgraph.codeplex.com/

ICR
update: http://quickgraph.codeplex.com/
bob
@bob cheers, updated the URL
ICR
+1  A: 

I can not find this component and i decided writen my own control, line and head, and use them to visualization my graph's If the needed your i can give it's component and program to demonstrate him/ I writen component and program's in visual studio 2008 language C#

Andriy Mytroshyn
Thank you very much, Andriy. I'll be glad to try to apply and/or extend (sending my extensions back to you of course) your solution. Please send it to [email protected] (sorry for a scary address, it's real while temporary, just copypaste it as it is; unfortunately I've found neither a private messaging system on this site nor your contacts in your profile while I avoid publishing my e-mail on public web pages)
Ivan
+2  A: 

I also would like to point you to graphviz. It is not a .NET solution but you can feed it files that are easy enough to write in order to get graphs. I don't think layouting is a very simple thing to do, especially with increasing node count, so it should be a good thing to find some tool for that.

flq
There are some bindings for calling graphviz from C#. They all look a bit experimental to me.
High Performance Mark
+1  A: 

A quite good looking one is the Diagram tool from Nevron. But it's not for free!

I'm currently using the charts and user interfaces from them and they work quite good.

Oliver