如何自动生成MS Visio图表?

发布于 2024-08-16 17:44:08 字数 1536 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

本宫微胖 2024-08-23 17:44:08

graphviz 非常适合于此之类的事情。我假设您使用的是 Windows,因为您询问了 Visio,因此这里是Windows 二进制文件 为它。

graphviz is pretty much geared for this sort of thing. I assume you're on Windows since you asked about Visio, so here are the Windows binaries for it.

你曾走过我的故事 2024-08-23 17:44:08

如果您使用较新版本的 Visio (2003+),您应该使用数据库逆向工程工具来开始绘制图表。它将所有数据库表和关系吸收到您可以修改的形状中。

以下链接将引导您完成该功能:http://office.microsoft.com microsoft.com/en-us/visio/HA101154851033.aspx

If your using a newer version of Visio (2003+) you should use the Reverse engineer tool for databases to start your diagram. It will suck all the db tables and relationships into shapes that you can then modify.

Here is a link that will walk you thru the feature: http://office.microsoft.com/en-us/visio/HA101154851033.aspx

暖风昔人 2024-08-23 17:44:08

我编写了一个名为 VisioPS 的 PowerShell 模块,它可能会对您有所帮助(请参阅此处的下载部分:
* VisioPS 模块是我的 CodePlex 上的 VisioAutomation 库的一部分)

安装 VisioPS 后,您可以启动 PowerShell 实例并执行以下操作:

Import-Module VisioPS
New-VisioApplication
New-VisioDocument
$dg = Import-VisioDirectedGraph c:\foo.xml
Invoke-VisioDraw $dg

Direct Graph 是一个像这样的简单 XML 文档

<directedgraph>
  <page>
    <renderoptions
      usedynamicconnectors="true"
      scalingfactor="20"
    />
    <shapes>
      <shape id="n1" label="FOO1" stencil="server_u.vss" master="Server" url="http://microsoft.com" />
      <shape id="n2" label="FOO2" stencil="server_u.vss" master="Email Server" url="http://contoso.com"/>
      <shape id="n3" label="FOO3" stencil="server_u.vss" master="Proxy Server" url="\\isotope\public" />
      <shape id="n4" label="FOO4" stencil="server_u.vss" master="Web Server">
        <customprop name="prop1" value="value1"/>
        <customprop name="prop2" value="value2"/>

      </shape>
      <shape id="n5" label="FOO4" stencil="server_u.vss" master="Application Server" />
    </shapes>

    <connectors>
      <connector id="c1"  from="n1" to="n2" label="LABEL1" />
      <connector id="c2" from="n2" to="n3" label="LABEL2" color="#ff0000" weight="2" />
      <connector id="c3" from="n3" to="n4" label="LABEL1" color="#44ff00" />
      <connector id="c4" from="n4" to="n5" label="" color="#0000ff" weight="5"/>
      <connector id="c5" from="n4" to="n1" label="" />
      <connector id="c6" from="n4" to="n3" label="" weight="10"/>
    </connectors>

  </page>

</directedgraph>
  • VisioPS 使用 MSAGL 执行节点布局
  • 您可以轻松获取依赖项表并创建所需的 XML
  • 如果您仔细查看我的库中的代码,您可以还可以直接创建进行渲染所需的对象,而无需通过 XML。

I wrote a PowerShell module called VisioPS that may help you (See the downloads section here:
* The VisioPS module is part of my VisioAutomation library on CodePlex)

After installing VisioPS, you an launch an instance of PowerShell and do this:

Import-Module VisioPS
New-VisioApplication
New-VisioDocument
$dg = Import-VisioDirectedGraph c:\foo.xml
Invoke-VisioDraw $dg

The Direct Graph is a simple XML document like this

<directedgraph>
  <page>
    <renderoptions
      usedynamicconnectors="true"
      scalingfactor="20"
    />
    <shapes>
      <shape id="n1" label="FOO1" stencil="server_u.vss" master="Server" url="http://microsoft.com" />
      <shape id="n2" label="FOO2" stencil="server_u.vss" master="Email Server" url="http://contoso.com"/>
      <shape id="n3" label="FOO3" stencil="server_u.vss" master="Proxy Server" url="\\isotope\public" />
      <shape id="n4" label="FOO4" stencil="server_u.vss" master="Web Server">
        <customprop name="prop1" value="value1"/>
        <customprop name="prop2" value="value2"/>

      </shape>
      <shape id="n5" label="FOO4" stencil="server_u.vss" master="Application Server" />
    </shapes>

    <connectors>
      <connector id="c1"  from="n1" to="n2" label="LABEL1" />
      <connector id="c2" from="n2" to="n3" label="LABEL2" color="#ff0000" weight="2" />
      <connector id="c3" from="n3" to="n4" label="LABEL1" color="#44ff00" />
      <connector id="c4" from="n4" to="n5" label="" color="#0000ff" weight="5"/>
      <connector id="c5" from="n4" to="n1" label="" />
      <connector id="c6" from="n4" to="n3" label="" weight="10"/>
    </connectors>

  </page>

</directedgraph>
  • VisioPS uses MSAGL to perform the layout for the nodes
  • You could easily take your table of dependencies and create the XML needed
  • If you look closer at the code in my library, you can also directly create the objects necessary to do the rendering without having to go through the XML at all.
木有鱼丸 2024-08-23 17:44:08

Visio 专业版将从电子表格或数据库导入,但 Visio 似乎无法自动在形状之间绘制连接器。

Visio Professional edition will import from a spreadsheet or database, but it does not appear possible to have Visio automatically draw connectors between shapes.

执笏见 2024-08-23 17:44:08

Not sure if that helps, but ARIS Express (http://www.ariscommunity.com/aris-express) has a feature called smart design. You enter your data as a spreadsheet and it automatically generates the diagram. Works for process models, but also for data models or organisational charts.

丢了幸福的猪 2024-08-23 17:44:08

Graphvis 是一个以点格式导入 .gv 文件的插件。它将绘制可以定制的连接器和形状,并且有一些初始布局选项。

Graphvis is a plugin to import .gv files in dot format. It will draw the connectors and shapes can be customized, and there are a few initial layout options.

路弥 2024-08-23 17:44:08

Omnigraffle 可以作为替代方案。在 Omnigraffle 中,您将无法导入 csv,但您将能够以列表形式插入项目并对它们进行排序,从而在元素之间创建依赖关系。然后,有一个名为“动态图”的函数可以自动对图进行排序。 (您可以修改图表类型和连接器长度)

Omnigraffle can be an alternative. In Omnigraffle you won't be able to import a csv, but you will be able to insert items as a list and sort them very easily creating dependencies between elements. Then, there is a function call "Dynamic Diagram" that sorts the diagram automatically. (You can modify the type of diagram and length of connectors)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文