如何替代方式(!pic2plot)从某些声明性文本形式生成序列图?
UMLGraph 有 pic2plot 组件来绘制序列图(sequence.pic)。
输入格式如下:
.PS
copy "/usr/local/lib/sequence.pic";
object(N0,"0");
object(N1,"1");
step();
message(N0,N0,"doSomething()");
message(N0,N1,"callFunction()");
step();
.PE
主要缺点是它基于 pic2plot,看起来被废弃了,无法处理 UTF-8 并且很难找到文档(甚至 man plotutils 也没有全套有用的手册页)。
是否有其他方法可以在没有 GUI 的情况下从简单的基于文本的输入绘制序列图?
注意:现在使用此技巧:
cat mpiseq.pic | u8h | pic2plot -T svg | pic2plot -T svg | pic2plot -T svg | pic2plot xml2 | perl -pe 's!/svg/\@height=8in!/svg/\@height=32in!; s!/svg/\@viewBox=0 0 1 1!/svg/\@viewBox=0 -0.2 1 3.8!' | 2xml | h8u | svg
u8h/h8u 将 UTF-8 字符屏蔽/取消屏蔽为十六进制序列数字(受签名保护)
There is pic2plot component from UMLGraph to draw sequence diagrams (sequence.pic).
Input format is like:
.PS
copy "/usr/local/lib/sequence.pic";
object(N0,"0");
object(N1,"1");
step();
message(N0,N0,"doSomething()");
message(N0,N1,"callFunction()");
step();
.PE
The main disadvantage is that it is based on pic2plot which looks abandoned, fails to handle UTF-8 and have hard-to-find documentation (even man plotutils does not have a full set of useful man pages
).
Is there alternatives draw sequence diagrams from simple text-based input without GUI?
Note: Now using this hack:
cat mpiseq.pic | u8h | pic2plot -T svg | xml2 | perl -pe 's!/svg/\@height=8in!/svg/\@height=32in!; s!/svg/\@viewBox=0 0 1 1!/svg/\@viewBox=0 -0.2 1 3.8!' | 2xml | h8u | svg
u8h/h8u masks/unmasks UTF-8 characters as sequence of hex digits (protected by signatures)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实上,有几种选择。查看文本 UML 工具列表
In fact, there are several alternatives. Take a look at this list of textual UML tools
我尝试过 sdedit,它甚至无法处理自己的示例!
在众多工具中,plantuml 在我的书中脱颖而出:可以使用清晰的语法处理相当复杂的功能。
I've tried
sdedit
, which couldn't even process its own example!Among the myriad of tools, plantuml stands out in my book: can handle pretty complex features with crisp clear syntax.