制作使用 JSON 作为标记的流程图库的建议
所以最近在工作中我的任务是创建一个流程图库。我只是想得到一些关于我应该如何处理这个问题的一般性建议。我们使用 mongodb 进行持久化,并使用 Tornado Web Server 作为后端。基本上我需要的是在 javascript 中创建一个库,该库具有导入 JSON 的方法以显示流程图。这个流程图绝对不会是微不足道的,我需要能够对循环、条件等进行建模。基本上,标准 UML 活动图需要建模的所有内容。我计划使用 Raphael 在屏幕上绘制连接每个节点的向量。我想我最大的问题是,如何在 JSON 中对循环和条件进行建模?是否有预先存在的开源库可以做我建议用作参考的事情?
So recently at work I have been tasked with creating a Flowchart library. I would just like to get some general suggestions on how I should approach this. We use mongodb for persistence, and Tornado Web Server as a backend. Basically what I need is to create a library in javascript that has a means of importing JSON in order to display a flow chart. This flowchart will definitely not be trivial, and I will require the ability to model loops, conditions, etc. Basically everything that a standard UML activity diagram would be required to model. I plan on using Raphael to draw the vectors connecting each node on screen. I guess my biggest question is, how would I model loops and conditions in JSON? Are there pre-existing open-source libraries that do what I am suggesting to use as reference?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在流程图中定义不同类型的节点,然后定义每个节点连接到哪些节点不是最简单的吗?
只需将每种类型显示为不同的节点,并且将简单地将连接绘制为它们之间的线。
为什么循环或条件需要与其他循环或条件有所不同?它们也只是与其他节点相连的节点。
Wouldn't it be easiest to just define different types of nodes in the flowchart, and then define which nodes each node is connected to?
Simply display each type as different looking node and connections would simply be drawn as lines between them.
Why do loops or conditions need to be any different from the rest? They too are just nodes which are connected to others.