用于绘制 UML 类图的 JavaScript 库

发布于 2024-12-02 07:43:41 字数 1539 浏览 3 评论 0原文

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

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

发布评论

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

评论(2

二货你真萌 2024-12-09 07:43:41

有许多工具可以将 uml 模型的文本描述转换为图形表示(请参阅此处 获取完整列表)。如果它需要是 JavaScript,除了您提到的之外,请检查 Joint,其中包括准备使用的UML符号

There are many tools that will transform a textual description of a uml model into a graphical representation (see here for a complete list). If it needs to be JavaScript, apart from the ones you mention check Joint, which includes ready to use UML symbols

美煞众生 2024-12-09 07:43:41

有几个库可以生成UML类图(不是在线的
服务、编辑器和 Web 应用程序)。主要问题是图形组件设计和图表的响应水平。

如果您想创建静态图组件,有很多库,但如果您想制作一个类似于运行时图形编辑器的工具,那么您的替代方案是有限的:

  • mxgraph 如果你想的话
    构建您自己的图形编辑器,例如 draw.io
    图表具有响应性和交互性,用户可以移动或调整图表大小
    阻止、修改文本、添加或删除关系。

有效 XHTML

  • gojs 是一个商业图书馆,它通过可用于学术目的的免费许可证提供。如果您想创建图表编辑器,这也是合适的选择。有大量现成的图表可用,可以交互式地移动块、修改文本和关系;以及其他不同图表的许多其他功能。

  • JointJs 核心库 是在 Mozilla 公共许可证下开源的,这意味着您必须包含版权,但您可以将其用于商业目的。它依赖于 jQuery 3.1.1、Lodash 3.10.1、Backbone 1.3.3。 (Rapppid 正在使用此库)
    它提供了许多现成的图表元素,这些元素具有响应性和
    交互的。用户可以移动块、添加和删除关系以及
    关节、放大和缩小。

  • Draw2D 是用于创建 Visio 的库,例如绘图、图表或工作流程。社区版差不多5欧元就能买到。它确实提供了类似 Visio 的块和图表,它们可以交互式地调整大小、移动块、修改文本和关系、对块进行分组、放大和缩小。这可能是构建图形编辑器工具的不错选择。
    Valid XHTML

  • UmlCanvas 由 Christophe VG 作为 js 库,它从文本信息提供 UML 图。这些图表具有响应性,您可以移动块;关系线很聪明,可以保持设计的美观。但仅此而已。
    Valid XHTML

  • PlantUML 是一个 UML 工具,可以通过 jQuery 库(也可以使用其他语言的库)从文本信息提供 UML 图,但图不响应。

  • Raphaël 是一个小型 JavaScript 库,可以简化您在 Web 上使用矢量图形的工作。这不是创建图形编辑器的最佳工具,但它为简单的用户交互(例如移动和弯曲)提供了闪亮且漂亮的图表

其他库,例如 D3FabricJSpaperJS, JsPlumbp5.js< /a>、Cytoscape.jsmermaid 也提供图表的基本组件,但它们没有内置编辑器。但这些库中提供了更多不同的图表和绘图组件。它们可能不是为用户(包括图形编辑器)创建完全交互式和可编辑图表的最佳选择。

There are several libraries to generate UML class diagrams (not online
services, editors and web applications). The main issues are the graphical component design and level of responsiveness of the diagrams.

If you want to create static diagram components there are plenty of libraries, but if you want to make a tool similar to run-time graph editor then your alternative are limited:

  • mxgraph is something if you want to
    build your own graph editor like draw.io.
    Graphs are responsive and interactive, and user can move or resize the
    block, modify the text, add or remove relationships.

Valid XHTML

  • gojs is a commercial library and it is provided by free licenses available for academic purposes. This is also suitable choice if you want to create a diagram editor. There are plenty of ready-made diagrams available, which are interactive to move the blocks, modify the text and the relationships; and many other features for different other diagrams.

  • JointJs core library is open source under Mozilla Public License, which mean you must include copyright, but you can use it for commercial purposes. It has dependency to jQuery 3.1.1, Lodash 3.10.1, Backbone 1.3.3. (Rapppid is using this library)
    It provides many ready-to-use diagram elements, which are responsive and
    interactive. User can move blocks, add and remove relationships and
    joints, zoom in and out.

  • Draw2D is library to create Visio like drawings, diagrams or workflows. The community version is almost 5 euro to buy. It indeed provides Visio like blocks and diagrams, which are interactive to resize, move blocks and modify the text and relationships, and grouping blocks, zooming in and out. This can be a good choice to build a graph editor tool.
    Valid XHTML

  • UmlCanvas by Christophe VG as js library which provides UML diagram from textual information. The diagrams are responsive in a way that you can move the blocks; and relationship lines are smart to keep the design pretty. But not more than that.
    Valid XHTML

  • PlantUML is a UML tool that can provide UML diagram from textual information by jQuery libraries (libraries in other languages are also available), however the diagrams are not responsive.

  • Raphaël is a small JavaScript library that can simplify your work with vector graphics on the web. This is not the best tool to create graph editor, but it provides shiny and beautiful diagrams for simple user interaction (such as movement and bending)

Other libraries such as D3, FabricJS, paperJS, JsPlumb, p5.js, Cytoscape.js and mermaid are also providing basic components for diagrams, but they don't have built-in editor. But there are more different chart and drawing components available in those libraries. They may not be the best option to create fully interactive and editable diagrams for the users (including graph editor).

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