What options are available for the layout of directed or undirected graphs in .NET?

后端 未结 14 2024
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 09:03

By graph here I mean something resembling these images:

相关标签:
14条回答
  • 2021-01-30 09:48

    I have used this http://www.codeproject.com/Articles/484616/MVVM-Diagram-Designer it's an open source one, really easy to use. the code is explained really well.

    0 讨论(0)
  • 2021-01-30 09:48

    Northwoods offers a pure .NET solution in their GoLayout product. They offer tree, force directed, and layered digraph (which is not quite a Sujiyama effect, but not too far off for many if not most data sets). At $1790/seat it's expensive. There are also some limitations: most importantly, their implementations are designed for "human readable" graphs. I've given it data sets of over 5,000 nodes and had no issue, but I can also generate data sets of less than 500 nodes that cause it to have a stack overflow (recursing too deep). Depending upon your domain, it may (or may not) be a good fit. If you need a general layout package that handles any data set, I'd suggest GraphViz over Northwoods.

    I have yet to use any of their WPF capabilities, but I know they have them. I've been using their stuff in WinForms land for a while.

    0 讨论(0)
  • 2021-01-30 09:50

    I am working in the NDepend team and I confirm: we switched from GraphViz to MsAgl in september 2008 and also the MsAgl license allows indeed commercial utilisation. Here are a few sample pictures of MsAgl graphs integrated in NDepend (everything is interactive, nodes are movable/selectable/removable/clickable, edges are editable/selectable/removable/clickable, the layout is zoomable, and also, while it could be cleaner the MsAgl API is clean enough to work with):

    enter image description here enter image description here enter image description here

    0 讨论(0)
  • 2021-01-30 09:53

    I have used MsAgl and it is pretty good. It also has viewers for both WinForms and WPF which may or may not be important to you. One does not have to use the viewers as they are quite loosely coupled to the graph layout engine.

    It does not support everything that Graphviz does (notably in terms of some shape types). Also the documentation could be better but it is pretty solid if not the most polished MS product ever.

    It does tick all of the items you mention as requirements, though the "on viewer" re-organization merely supports drag-moving nodes, re-routing edges and re-positioning labels. The graph does not respond to the movements of these elements by repositioning any other items.

    0 讨论(0)
  • 2021-01-30 09:54

    When I did some work involving graphs last summer I found the best option that wasn't overly expensive was to manually do it in SVG, i.e. write out an SVG file from a bunch of strings, and render that out to an image using Inkscape.

    This is not a quick and easy solution, but it does allow for near-infinite customisation, so it might be nice if you have to organise the graphs or do spatial organisation based on connections etc.

    0 讨论(0)
  • 2021-01-30 09:56

    Its not .NET, but an often referenced toolkit for rendering graphs is AT&T Graphviz. I've only used the free-standing applications myself, but the source code is available under something resembling an open source license.

    Graphviz is used by the popular code documentation tool doxygen to automatically draw various diagrams for its generated documentation.

    0 讨论(0)
提交回复
热议问题