本文介绍了纯JavaScript Graphviz等效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道GraphViz能够生成的方向流图的纯粹的基于Javascript的实现吗?我对漂亮的视觉效果输出不感兴趣,但计算出每个节点的最大深度,以及优化贝塞尔线的布局,以便在处理图形而不是树时最小化相交边的数量信息。我想在浏览器中运行此代码;我知道我可以轻松地将Graphviz作为扩展名嵌入到我的节点服务器中,甚至 popen()它并在中流式传输图形信息。 dot format。

Is anyone aware of a pure, Javascript based implementation of the directional flow diagrams that GraphViz is capable of generating? I am NOT interested in pretty visuals output, but the computations to figure out the maximum depth of each node, along with the layout of bezier lines that are optimized to minimize the number of intersecting edges when you are dealing with a graph rather than a tree of information. I would like to run this code both within a browser; I am aware that I could easily embed Graphviz into my Node server as an extension, or even popen() it and stream over graph information in the .dot format.

作为参考,这是一个典型的GraphViz输出。注意元素是如何堆叠和间隔开的,以允许连接线在节点之间传播,而不会相交(经常)或通过节点。

For reference, here is a typical GraphViz output. Note how elements are stacked and spaced out to allow the connecting lines to travel between nodes, without intersecting (very often) or passing through nodes.

推荐答案

Take看看这个.dot画布渲染器的纯JavaScript实现:

Take a look at this pure JavaScript implementation of a .dot canvas renderer:

图书馆没有记录 - 作者肯定应该更多地宣传和记录它(我'请联系他,建议他把它放在github上,至少)。

The library is not documented -- the author definitely ought to publicize and document it more (I'll contact him to suggest he put it up on github, at the very least).

更新:代码已被推送到github:

Update: code has been pushed to github:https://github.com/gyuque/livizjs

更新(2013年2月14日):另一个竞争者出现了!任何对这个主题感兴趣的人都应该看看Viz.js的和。

Update (14/2/2013): another contender has arisen! anybody interested in the subject should definitely take a look at Viz.js's example page and github repo.

这篇关于纯JavaScript Graphviz等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 20:56