How do I trap errors in the DOT?
See original GitHub issueHow do I trap errors in the DOT; that is, the data
that I pass to d3.select("#graph").graphviz().renderDot(data, myRenderDOTEndFunction)
?
I’ve read the the following in the viz.js readme:
If Graphviz encounters an error, Viz will throw an Error object with the error message.
and I’ve looked at the d3-graphviz code that calls Viz, but I can’t yet figure out how to trap errors in the input DOT that I pass to d3-graphviz.
I see that the Graphviz object returned by d3.select("#graph").graphviz().renderDot(data, myRenderDOTEndFunction)
contains a _worker
property, and _worker
contains an onerror
property that has the value null
. I suspect I need to set that property.
I could burn time trying to figure out what to do next—I’m enjoying improving my JavaScript coding skills—but I need to crack on with other work.
P.S. I really like d3-graphviz. Thank you so much for this. I’m using d3-graphviz for what is, so far, a small internal-use-only project, but I hope to get management approval to publish my project as a GitHub repo, which will, effectively, be a showcase for d3-graphviz.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
.onerror()
(in v1.3.0) works for me, thank you! (And thank you for the new release.)Thanks @GrahamHannington. I’ve updated the README.