Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do directed graph drawing in PHP?

I'm looking for a way to draw directed graphs in PHP. (as in http://upload.wikimedia.org/wikipedia/commons/0/08/Directed_acyclic_graph.png). I want it to create an image of the graph just like GD can output an image.

I've googled a lot on this, but I only can find a lot of libraries for drawing graphs in general (with bars etc), not directed graphs.

P.S. I've tried using dot (the linux program) via system(), but unfortunately I have no permission to do that on the server. Also, I have no rights to install PHP extensions and stuff like that on the server, so it should work with normal PHP (ideally just by including a file).

Thanks in advance.

like image 442
openbas2 Avatar asked May 11 '09 20:05

openbas2


2 Answers

I found a PEAR interface to GraphViz; I have not used it before so can't give you any personal recommendation whether it's good or bad. (but perhaps that doesn't solve your problem since you say you can't install applications)

like image 87
Jason S Avatar answered Nov 15 '22 09:11

Jason S


I'm not aware of any graph visualization implementation in php.

However I suggest you to consider drawing the graph with javascript, for instance with the canviz JS library which works on most browsers (yes, including IE 6 & 7, but not 8 currently).

like image 21
Elazar Leibovich Avatar answered Nov 15 '22 09:11

Elazar Leibovich