restruct/dot-static

静态编译的Graphviz dot

1.3 2017-10-04 14:39 UTC

This package is auto-updated.

Last update: 2024-09-13 00:27:30 UTC


README

这是一个非常基础的版本,没有任何附加选项,它支持SVG输出(无PNG),并且只有纯文本节点标签(无HTML)。

Graphviz

图可视化是将结构信息表示为抽象图和网络图的图表。它在网络、生物信息学、软件工程、数据库和网络设计、机器学习以及其他技术领域的可视化界面中具有重要的应用。

Graphviz布局程序接受简单文本语言中图的描述,并以有用的格式生成图表,如图像和SVG(用于网页)、PDF或Postscript(用于其他文档)或交互式图浏览器中的显示。

所以;

digraph G {

	subgraph cluster_0 {
		style=filled;
		color=lightgrey;
		node [style=filled,color=white];
		a0 -> a1 -> a2 -> a3;
		label = "process #1";
	}

	subgraph cluster_1 {
		node [style=filled];
		b0 -> b1 -> b2 -> b3;
		label = "process #2";
		color=blue
	}
	start -> a0;
	start -> b0;
	a1 -> b3;
	b2 -> a3;
	a3 -> a0;
	a3 -> end;
	b3 -> end;

	start [shape=Mdiamond];
	end [shape=Msquare];
}

...变成

Graph example

dot命令

dot可用于创建“分层”或分层结构的有向图。如果边具有方向性,则这是默认的工具。dot将具有相同方向的边(从上到下或从左到右)并尝试避免边交叉并减少边长。

本软件包包含dot的静态编译版本(自包含版本,不依赖于其他系统库)。可以将这些版本简单地上传到Web服务器,以便无需root/安装权限即可使用dot。

安装

  • 只需使用composer(composer require restruct/dot-static)进行安装,上传到您的服务器,并确保您调用正确的架构的dot_static(希望是x64/Linux 64位,这是唯一包含的版本)
  • 确保vendor/restruct/dot-static/x64/dot_static可执行文件具有可执行权限(chmod +x / 744)。此权限在存储库中的文件上已设置,但似乎在通过FTP上传时并不总是正确传输。
  • 对于在OSX上的本地开发,只需使用Homebrew(brew install graphviz)安装dot,并使用它代替。

附加说明/致谢

将deb-src源添加到/etc/apt/sources.list,并运行apt-get update

使用apt-get build-dep graphviz安装依赖项

然后以Life in plain text为参考,了解如何编译dot_static,此处重复命令以供参考(修改了configure --enable-static=yes --enable-shared=no

$ wget https://graphviz.cn/pub/graphviz/stable/SOURCES/graphviz-2.40.1.tar.gz
$ tar -xvf graphviz-2.40.1.tar.gz 
$ // cd into the directory
$ ./configure --enable-static=yes --enable-shared=no
$ // install missing dependencies if there is any 
$ make 
$ cd cmd/dot
$ make dot_static

编译更完整的版本

我未能编译带有更多选项/库/插件的dot的静态版本。我的尝试总是导致动态链接库,因此在Web服务器上运行时发生崩溃。最重要的是,我想编译一个包括PNG输出(libpng)和HTML标签(libexpat)支持的版本。

检查库依赖项并获得静态版本:https://gist.github.com/stain/8335322 http://jurjenbokma.com/ApprenticesNotes/getting_statlinked_binaries_on_debian.xhtml

其他参考资料:https://graphviz.cn/Download_source.php http://genomewiki.ucsc.edu/index.php/Graphviz_static_build

使用Debian预编译版本在homedir中设置LD_LIBRARY_PATH:https://stackoverflow.com/questions/8835108/how-to-specify-non-default-shared-library-path-in-gcc-linux-getting-error-whil#answer-8835402

JavaScript版本

使用Emscripten,此项目将dot转换为JavaScript,使其能够在浏览器中运行,从而完全无需在服务器上安装它: https://github.com/mdaines/viz.js

许可证

  • 此“目标代码”:MIT
  • 源代码:Eclipse公共许可证 - v 1.0