bonobo icon indicating copy to clipboard operation
bonobo copied to clipboard

Feature: Adds inspect graph visualization through web browser

Open TZubiri opened this issue 8 years ago • 7 comments

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.

TZubiri avatar Dec 10 '17 22:12 TZubiri

  • [ ] Documentation has not been added.

TZubiri avatar Dec 10 '17 22:12 TZubiri

  • [ ] Not tested in Mac
  • [ ] Not Tested in Linux

TZubiri avatar Dec 10 '17 23:12 TZubiri

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.

hartym avatar Dec 11 '17 06:12 hartym

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?

hartym avatar Dec 11 '17 06:12 hartym

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.

TZubiri avatar Dec 11 '17 17:12 TZubiri

FYI, there is already a method that retrieves the SVG output in develop, I think it's graph.graphviz._repr_svg_().

hartym avatar Dec 11 '17 20:12 hartym

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)

hartym avatar Dec 13 '17 18:12 hartym