17

我需要能够以编程方式生成依赖关系图。我希望它能够生成一堆带有标签和连接它们的连接器的盒子,理想情况下,组件会将它们自动定位到设计表面上,然后可以手动重新排列。

我正在使用 WinForms 和 C# 2.0 (VS2005)。

编辑:但是,由于它将是一个内部工具,如果在该领域有任何建议,我可能可以使用 3.5 SP1 和 WPF。

必须是免费或开源的。

有什么建议吗?

4

8 回答 8

12

Too late for the questioner but perhaps interesting for researchers:

NShape

NShape is an Open Source diagram designing framework for .NET WinForms. Software developers use NShape to integrate diagramming capabilities into their applications. Using NShape, applications let users view, annotate, modify and create diagrams like flow charts, wiring schemes or project charts. NShape is open source and has a dual license which allows it to be employed for free in open source projects and for a license fee in commercial projects.

于 2012-01-16T09:14:16.173 回答
10

您是否尝试过 Sukram 的 CodeProject 系列文章:

WPF 图表设计器

于 2010-01-05T10:49:17.710 回答
6

以下是一些您可能感兴趣的参考资料:

图表.NET

Diagram.NET是一个完全用 C# 编写的免费开源图表工具。将 Diagram.NET WinForm 控件放入您的表单中,就像 Microsoft Visio® 一样,用户可以绘制形状和链接。使用一些代码,您可以控制、更改、添加和删除这些元素。

微软图表控件

The samples environment for Microsoft Chart Controls for .NET Framework contains over 200 samples for both ASP.NET and Windows Forms. The samples cover every major feature in Chart Controls for .NET Framework. They enable you to see the Chart controls in action as well as use the code as templates for your own web and windows applications.

于 2010-01-05T11:24:28.933 回答
4

您可能想看看在CPL 下分发的GraphViz(即免费)。它不完全适用于 .NET/WinForms,但无论如何都很有用。该库的主要目的是可视化图形(依赖关系图实际上是一个 [方向] 图)。您可以使用它来获取图像(图形布局)或点数组(您的项目的坐标)。

于 2010-01-05T10:52:43.300 回答
3

OpenDiagram

Open Diagram is the definitive open source .net diagramming component library for the .Net framework winforms environment.

Use Open Diagram to add interactive data visualizations to your .net applications.

I have tried it with WinForms, works very well.

于 2015-09-11T20:50:33.777 回答
3

I have similar request as yours. Here's one open source solution for drawing diagrams. It's from Microsoft and samples written in C#.

https://github.com/Microsoft/automatic-graph-layout

于 2017-07-25T06:28:50.047 回答
0

Here's one that renders to HTML5 (You can easily extend to Visio) from GridWizard/Github Source code: https://github.com/gridwizard/SimpleFlowDiagram Wordpress doc: https://gridwizard.wordpress.com/2015/03/25/simple-c-library-to-render-graph-to-flowchart/

Downside is, you need a viewer to display HTML5. Alternatively, SimpleFlowDiagramLib already calculate Node.x and Node.y - you can render it to Winform/WPF yourself (but then you need to code rendering yourself)

于 2015-03-25T03:30:55.990 回答
-1

Vote for NShape. More or less it's fine.

于 2021-06-17T21:50:23.080 回答