observablehq / graphviz

A convenience method for using Graphviz.
https://beta.observablehq.com/@mbostock/graphviz
Other
39 stars 8 forks source link

support for other rendering engines #4

Open drom opened 5 years ago

drom commented 5 years ago

I can't get neato or circo working with this package.

dot.options({engine: 'neato'})`digraph g {}`;

Any idea why?

https://observablehq.com/@drom/graphviz-test

mbostock commented 5 years ago

The neato engine isn’t included in the “lite” build of Viz.js, which is used by this package. (It might be the same for circo; I’m not sure.)

https://github.com/mdaines/viz.js/wiki/Usage

You can find an example of using Viz.js directly here:

https://observablehq.com/@mbostock/hello-viz-js

But you’ll need to edit the code to support options. Perhaps we could change the dot tagged template literal in this library to load the correct build of Viz.js lazily based on the requested engine.