-
Notifications
You must be signed in to change notification settings - Fork 917
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
Render graphviz raw string in html #3696
Comments
https://github.com/mdaines/viz.js/wiki/Usage I took a quick glance at the docs and here's what I think you need to do (mostly copied from the link above): <html>
<head>
<script src="viz.js"></script>
<!--replace this with CDN-->
<script src="full.render.js"></script>
<!--replace this with CDN-->
<script type="application/javascript">
var graph = "%s"; // Inject your dot string here, fully escaped and everything.
</script>
<script>
var viz = new Viz();
viz.renderSVGElement(graph) // reading the global graph, or inject here.
.then(function(element) {
document.body.appendChild(element); // appends to document.
})
.catch(error => {
// Create a new Viz instance (@see Caveats page for more info)
viz = new Viz(); // I dont know what this is about?
// Possibly display the error
console.error(error);
});
</script>
</head>
<body>
</body>
</html> CDN hosted files are here: https://cdnjs.com/libraries/viz.js There are also examples here: https://github.com/mdaines/viz-examples |
Thanks so much for the context, here's an example dot string generated by the chain service handler:
|
Closed by @terencechain and #4108 |
This doesn't print the HTML rendering. I'll pick this up since it's simply plugging in the suggestions from my comment in october |
For #3690, I'm looking for help to use JS to render raw dot data.
For example the HTML can be:
http://viz-js.com/ <- Given such diagraph, the library can be rendered in browser. We'll need to fiure out how to plugin JS to the html template and understand how viz-js works.
The text was updated successfully, but these errors were encountered: