In a previous post I described Graphite for Silverlight which allows you to display diagrams inside a browser with automatic layout (the spring-embedder algorithm). In a swift move I converted the library to a WPF control, which at the same time allowed me to add some features which were less trivial in Silverlight because of the constraint Silverlight imposes in comparison to WPF.
To demonstrate Graphite for WPF I created some kind of ’star sky’ of science. Ideas, persons and standard nodes are all styled in the host application and you can experiment with the Graphite API and the visual representation (look into the App.Xaml file). When hovering over a node a custom tooltip appears which can also be customized, see the description of Graphite for Silverlight for more details. Zooming of the diagram is implemented through the mouse-wheel. The only restriction of the demo is the maximum amount of ten nodes.
Loading nodes accurs through some XML format which you can define yourself, it’s not part of the control and it allows in this way a wide variety of imports/exports. It would be quite easy, in particular, to attach the application to some web or WCF service and load/unload nodes accordingly (Google search results, social network visualization and so on). See also Microsoft’s .NetMap initiative in this context (it’s not WPF though).
Download the demo
(requires VS2008 and .Net 3.5sp1)






great cool stuff inded, congrats!
i am currently doing a solution in which i could use this, but how would i get this licensed, source code and how much costs?
cheers, Christoph
Hi there,
This looks very interesting, but I cant get the project to build. It seems to be some missing or wrong namespace info. I get the following message:
Error 1 The tag ‘DropShadowEffect’ does not exist in XML namespace ‘http://schemas.microsoft.com/winfx/2006/xaml/presentation’. Line 46 Position 12. C:\Documents and Settings\Administrator\Desktop\Graphite4WPF\App.xaml 46 12 Graphite.Demo
Any ideas?
You need .Net 3.5 SP1. There are some minor differences in the WPF API which allows you to actually run the diagram (in .Net 3.5) but it fails in the animation effects (without sp1).
Hi, The sample application looks great and behave very good.
I have checked what happen when I leave some nodes disconnected, without any links to other nodes. I thought it will drift apart from the cluster of connected node, like GoDiagram auto-layout algorithm do.
I want to say that the control behave perfectly in that situation! Much better than GoDiagram. The disconnected nodes stay close to the cluster of connected nodes, just beautiful.
Can’t wait for the final version!
Thanks Ido, the code as it stands now is production-ready and is in fact already in use by a few companies (i.e. reald-world applications).
I think there are many ways to apply the panel. For example, I created for myself a kind of blog/wiki graphic browser to visualize categories and postings. It’s a fun piece of code and not at all difficult to integrate or to extend.
Dag François,
Ik had Graphite graag gebruikt om een visuele voorstelling te maken van network topologie. Kan je uitleggen hoe de licensing werkt? Het is voor 1 development en 1 productiemachine, waarop kan gevolgd worden hoe de topologie (netwerkje van ongeveer 20 nodes) eruit ziet. Het gaat om een R&D projectje m.b.t. ad hoc routing.
Alvast bedankt en met vriendelijke groeten,
Benny
First, i wanted to congratulate you on the great work that is done here i always wanted to have something like this to use it in my graph applications
my Question though does it only support XML and Flat TXT Files?
i have SQLite applications i wanted to use Graphite with it but do not know if it will import the data from SQLite or not ?
Thank you
The API of Graphite is very simple and the XML or flat-file data repositories are just the most convenient ones to ship with a demo, there is no inherent restriction inside Graphite related to XML or flat file. If you can access your data through a data access layer of some kind you can add nodes and links with just one API call.
Hi there. I am very interested in Graphite and G2 for some commercial work. Firstly is it possible to show arrows on the edges in a directed graph? This would be very important for us. Is there a code snippet you could send me to show how this is done? When is G2 likely to be available commercially? Can you also send me pricing info on both products. Thanks, Paul.
Hello,
I checked the Graphite demo and it looks really awesome. I’m working on a project and I need to represent a large number of nodes (about 10000). Can you tell me how well will Graphite behave in such circumstances? Like I said, it looks great but my gut feeling is that performance will degrade a lot.
Alex, I don’t think anything based on WPF or Silverlight can handle a large amount of nodes and at the same time offer all the advantages of WPF/SL, simply because there is a lot of infrastructure underneath the control class (databinding, styling…). I suppose one could write a library specifically to scale into the thousands but it would amount to low-level approaches (overriding the OnRender of the FrameworkElement for instance) and sacrifice things like databinding. In any case, no, the Graphite library will not scale to 10k nodes from a rendering point of view and even if it would then the layout algorithm would crunch and not be responsive. I could write the library you are looking for but the demand is rather low and I’m sure there are excellent open source C++ or C libraries out there which scale to the million nodes.
HI,Francois Vanderseypen.I ‘m using your library in my project.It is so brilliant but the restriction that the maximun amount of 10 nodes stops me going ahead.Could you help me write the library supporting 100 nodes.Thanks for offering us these library and I’m looking fowards your reply.
my mail:mazhiyuan850126@gmail.com