开发者

Is there a good tool for programmatically creating diagrams? [closed]

开发者 https://www.devze.com 2022-12-24 14:21 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_开发技巧

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

I would like a tool to create diagram in a programming language, maybe something like lua.

Is there any tool designed for that?


Yes, you can generate .dot files for Graphviz. Since these are text files, you can do it from any language. I wrote a post a while ago about auto-generating binary-tree diagrams from C code using Graphviz.


A little retro, perhaps, but there's always Pic. It outputs to .eps which can easily be converted to anything you want.

The input is a little old-school, but since it's all-text, it can be targetted by any language (even Lua) that has text output. Here's an example of a diagram of a data-structure.

.PS
boxwid = .5; boxht = .25
down
Base: box "base"
Used: box "used"
Max: box "max"

move to Base.e
move right

right
Mfile: box dashed wid 3 ht 5
move to Mfile.nw; move down .125

Mtab: right; box "nexttab"; box "nextent"
move to Mtab.sw; move down .25

Tab: right; box "adr0"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr1"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr2"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr3"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr4"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr5"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr6"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr7"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box "adr8"; box "mark"; box "sz"
move to Tab.sw; move down .25
Tab: right; box invis "..."; box invis "..."; box invis "..."
move to Tab.sw; move down .25
Tab: right; box "adrN"; box "mark"; box "sz"

arrow from Base.e to Mfile.nw
arrow from Used.e to Tab.sw down .125
arrow from Max.e to Mfile.sw

.PE

Is there a good tool for programmatically creating diagrams? [closed]

0

精彩评论

暂无评论...
验证码 换一张
取 消