Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in support for graphviz diagrams #24

Closed
rich-iannone opened this issue Jan 10, 2015 · 5 comments
Closed

Add in support for graphviz diagrams #24

rich-iannone opened this issue Jan 10, 2015 · 5 comments

Comments

@rich-iannone
Copy link
Owner

This is possibly a big one, and I wanted to get some opinions on this. If we add the viz.js library, we can essentially have graphviz diagrams defined using one of several layout engines like "dot", "neato", "circo", or "twopi". Graphics would be rendered as SVG. The examples of the types of diagrams using dot alone look very nice. I think that getting this in early would set the package up for great things down the road. Then, a very strong focus on documentation and ease-of-use enhancements will be needed.

@timelyportfolio
Copy link
Contributor

Sorry, read this as vis.js, but thiking now you are saying viz.js. Only issue with viz.js is some concern over ongoing development / support.

In case you are referring to vis.js, I'll leave my original response below.

Trying to decide what would be best :

  1. provide vis.js as an option within DiagrammeR and just focus on the subset of networking libraries that enhance and also fit within the original intent
  2. build a htmlwidget package entirely focused on vis.js and ignore in DiagrammeR
  3. build a vis.js package and through Imports or something similar offer the subset of network diagram functions also in DiagrammeR

@rich-iannone, your decision, but those are the options I see as viable. Any I am forgetting?

@rich-iannone
Copy link
Owner Author

That is confusing but I did mean viz.js, with which ongoing development is likely abandoned. However, it does everything it needs to do and is pretty well documented as far as examples. Rationale for inclusion to DiagrammeR was a bit difficult at first. I thought that it could exist as a separate package, but, since there are several input code methods available in viz.js for GraphViz, I thought: why couldn't it exist alongside the mermaid engine?
Then the benefits of inclusion in DiagrammeR started to become clear: (1) people already know about DiagrammeR and what it is supposed to do (why not do more of it?), (2) DiagrammeR is in CRAN, so it's trivial to add in GraphViz support as an update, (3) with a push for more exhaustive documentation in DiagrammeR it would be great to also provide docs/examples for the GraphViz stuff where there is so little available (admit, I haven't searched too much but what I've found was scant).
Some disadvantages: (1) adds some complication to DiagrammeR (you'd have to select which engine to use), (2) might break any code that so far depends on DiagrammeR (but it's early days for this package, so, less worried about that), (3) might require a lot of work to document all of this (but, I'm willing to put in the hard work to get the docs looking good).

Alright! That is it. I think there is more positive than negative from including this. If during development it doesn't work out very well, the viz.js support could be dropped. I'm definitely okay with giving it a try. Could be very interesting.

@timelyportfolio
Copy link
Contributor

I am impressed with viz.js does, and since it used emscripten with graphviz should be nearly one-to-one for those acccustomed to graphviz. Wondering now though, do we specify type mermaid or graphviz/dot in the DiagrammeR(), try to use some auto-detection, or make a mermaid function and a graphviz function similar to networkD3.

On a separate note, we should be able to leverage Rgraphviz.

viz.js is a fairly hefty >2mb, so this will need to be considered especially for online publish.

@rich-iannone
Copy link
Owner Author

For simplicity's sake, I'm thinking that an auto-detection scheme will be less burdensome for the user. I have to look into Rgraphviz. I was a bit surprised that viz.js was at around 2.5 MB. It might not be that big a deal in the context of an htmlwidget though. We'll have to see.

@rich-iannone
Copy link
Owner Author

Great! It's in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants