Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I display a dot or xdot layout file generated by GraphViz using d3.js?

I have created a web service which generates dot and xdot layout files for a graph using GraphViz on a server. Is there a way to visualise either dot or xdot files with d3.js on the clients browser?

If not, are there other JavaScript libraries which can visualise dot or xdot layouts?

like image 747
Alex King Avatar asked Sep 05 '25 19:09

Alex King


1 Answers

The GraphViz documentation says:

1 Basic Graph Drawing

dot draws directed graphs. It reads attributed graph text files and writes drawings, either as graph files or in a graphics format such as GIF, PNG, SVG, PDF, or PostScript.

If you can get your graph output as SVG, you can manipulate it with d3. This answer describes how to read an external SVG file as XML and insert it into your document.

like image 166
AmeliaBR Avatar answered Sep 08 '25 12:09

AmeliaBR