Feature: Adds inspect graph visualization through web browser
The inspect command now shows a graphviz visualization in a web browser chosen by the Operating system (Either through a dialog, or through the default application for .html files). We are using viz.js to achieve this.
-
[ ] No tests were added, they would be kind of brittle anyway. Maybe a test could be added to check the .dot output is correct given some nodes.
-
[ ] No refactoring was done. Maybe the code dealing with html files and webbrowser could be extracted into it's own display_graph function. Possibly extracted into its own module so it can be reused in libraries like graphviz, python-graphviz, pygraphviz, and
-
[ ] Is the directory with the viz.js dependency well located? Maybe it should be relocated somewhere it makes more sense.
- [ ] Documentation has not been added.
- [ ] Not tested in Mac
- [ ] Not Tested in Linux
This must be done on branch develop, not master. The code to generate graphviz code in inc. 0.6 have been refactored to the Graph class, using python graphviz wrapper, so probably it change a bit how the code would look.
Once on develop, I can do the OSX tests. Not very sure about vis.js in bonobo core yet, but let's do it and see how it goes later.
I'm also wondering what value there is in vis.js versus the cost of having it in bonobo core. Afterall, graphviz binary generates a svg file which is already displayable by all browsers, what do you think about it?
There's no advantage on having vis.js as a dependency, I just didn't think of using Graphviz svg output. I'll be making another pull request on develop using graphviz to build the html. This one can be ignored.
FYI, there is already a method that retrieves the SVG output in develop, I think it's graph.graphviz._repr_svg_().
I updated the base to develop, but there are conflicts. Can you have a look? BTW, requirements conflicts can be easily fixed using make update-requirements (aka medikit update)