库在Google App Engine上呈现定向图形(类似于graphviz) [英] Library to render Directed Graphs (similar to graphviz) on Google App Engine
问题描述
我正在寻找一个Java或Python库,可以将Dot语言中的图形呈现为图像文件。问题是我需要一个可以在Google App Engine上使用的库。基本上,我正在寻找一个库,可以将有向图的文本描述转换为图的图像。
例如:
隐藏这个边界列表:
[A,B]
[B,C]
[A,C]
[C,D]
:
我在这个例子中使用了 Graphviz ,但我知道这是不可能的使用Google App Engine。
/rel =noreferrer> Canviz 是您正在寻找的东西:它是一个用于将Graphviz图形绘制到Web浏览器画布的JavaScript库。它适用于大多数浏览器。
使用Canviz为您的Web应用程序在生成位图图像和图像映射到浏览器上方面具有优势:
- 服务器只需要Graphviz生成xdot文本;这比生成位图图像要快。
- 只有xdot文本需要传输到浏览器;这比二进制图像数据小,并且,如果浏览器支持它(大多数情况下),文本可以是gzip或bzip2压缩的。
- Web浏览器执行绘图,不是服务器;这可以减少服务器负载。
- 用户可以调整图表的大小,而无需涉及服务器;这比服务器绘制并以不同大小发送图形要快。
要查看它在行动中,看这里。
I am looking for a Java or Python library that can render graphs in the Dot language as image file. The problem is that I need a library that I can use on Google App Engine. Basically I am looking for a library that can convert the text description of a directed graph into an image of the graph.
For example:
Covert this edge list:
[A,B]
[B,C]
[A,C]
[C,D]
Into this image:
I used Graphviz for this example, but I know it is not possible for me to use it with Google App Engine.
Canviz is what you are looking for: it is a JavaScript library for drawing Graphviz graphs to a web browser canvas. It works with most browsers.
Using Canviz has advantages for your web application over generating and sending bitmapped images and imagemaps to the browser:
- The server only needs to have Graphviz generate xdot text; this is faster than generating bitmapped images.
- Only the xdot text needs to be transferred to the browser; this is smaller than binary image data, and, if the browser supports it (which most do), the text can be gzip- or bzip2-compressed.
- The web browser performs the drawing, not the server; this reduces server load.
- The user can resize the graph without needing to involve the server; this is faster than having the server draw and send the graph in a different size.
To see it in action, look here.
这篇关于库在Google App Engine上呈现定向图形(类似于graphviz)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!