从一组顶点和边创建 ASCII 图的工具?
是否有一种工具可以输入一系列顶点和边,并输出 ASCII/Unicode 格式的图形?
谢谢, 凯文
Is there a tool that takes as input a series of vertices and edges, and outputs a graph in ASCII/Unicode format?
Thanks,
Kevin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
是的! Perl 有
Graph::Easy
,如 此黑客新闻评论。以下是在线演示的一些输出:
Yes! Perl has
Graph::Easy
, as described in this Hacker News comment.Here's some output from the online demo:
除了 @nibot 提到的 Graph::Easy 之外,还有一些其他工具为此:
(免责声明:我我是后者的开发者)。
In addition to Graph::Easy mentioned by @nibot, there are a couple of other tools around for this:
(Disclaimer: I'm the developer of the latter).
对于 2022 年阅读这篇文章的人,请查看 Diagon。
有一个命令行工具
diagon
和一个网站。您可以从文本创建多个 ASCII 可视化,例如:
DAG 示例:
也值得一看: https://www.plantuml.com/
For whoever reading this post in 2022, check out Diagon.
There are both a command line tool
diagon
and a website.you can create multiple ASCII visualization from text such as :
DAG Example :
Also worth looking : https://www.plantuml.com/
我可能会推荐 graphviz ——我不知道它是否有 ascii-art 输出,但它确实支持一堆其他有用的格式,也许您可以找到从其中一种格式到 ASCII 艺术的转换器。
I might recommend graphviz -- I don't know if it has an ascii-art output, but it does support a heap of other useful formats, and perhaps you can find a converter to ascii art from one of those formats.
另一种选择: https://www.npmjs.com/package/ascii-seq
input.txt
npx ascii-seq input.txt
或cat input.txt | npx ascii-seq
Another option: https://www.npmjs.com/package/ascii-seq
input.txt
npx ascii-seq input.txt
orcat input.txt | npx ascii-seq
是的,它被称为 unix 目录和“tree”cmd。
输出示例:
yes, Its called unix directories and the 'tree' cmd.
Output example: