I maintain information about relationships between research papers in a .org file. I would like to visualize these relationships as a graph, where each node (vertex) of the graph corresponds to a paper and each arc signifies a relationship between two papers. I know that I can do this using GraphViz DOT as described here. However, using that approach, the graph is just a picture. I would like this graph to have clickable nodes, whereby I would be able to open my notes about a paper (a .org file) by clicking on the node corresponding to that paper. Is there a tool I can use for creating such a graph with clickable nodes?


The visualization technique you describe would be killer! Some approaches come to mind:

1. Render using text rather than SVG

Plain text is very powerful- especially in Emacs. Render your diagram to text using something like Graph::Easy Perl library (it accepts the graphviz dot format), insert that, and then do some "post-processing" in-buffer. You can add text properties to stylize it or to add a keymap to make it clickable. I'm not sure how effectively the layout may scale for large numbers of papers/nodes, but might be worth trying. I would use placeholder text in the dot file to make post-processing easier.

2. Use Emacs' XWidget support to render a webpage

When compiled with xwidgets, Emacs can render a usable web page in a window. I have used this approach for a few personal projects and have found it to be very effective. I would recommend building a single HTML document with the generalized JavaScript logic for rendering your style of chart (sort of a "canvas" document). Once the page has loaded, provide the data via a JavaScript call (xwidget-webkit-execute-script). Some examples using d3.js. With the massive JavaScript ecosystem you can do all sorts of pretty things.

3. Get creative with existing SVG capabilities

A good demonstration of SVG functionality relevant for your purposes is here. It may not be feasible to work with an externally-generated SVG.

4. Expand SVG functionality in Emacs to support links

Since SVG supports external links, these could conceivably be used to represent your links to papers using URI's or URL's. I suspect that librsvg (the library Emacs uses for rendering SVG's) doesn't support this sort of anchor link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.