glejeune / node-graphviz

Node.js interface to the GraphViz graphing tool
http://algorithmique.net
MIT License
197 stars 58 forks source link

Long .dot strings are now supported #28

Closed daniel347x closed 5 years ago

daniel347x commented 6 years ago

Long .dot strings were causing multiple internal callbacks to the 'stdout' hander for the multiprocess communication, but the code assumed all output would occur in a single call to the 'stdout' handler. This caused a crash on long .dot strings because the final line in the first call to the stdout handler is typically cropped in the middle, causing a syntax error when that line is evaluated. The solution is to support multiple calls to the callback and append the data for all calls to a single variable, and only execute the command on the exit handler.

daniel347x commented 6 years ago

I redid the fixes on top of the merge you just put in there... this time in one commit :)

daniel347x commented 6 years ago

(Anyone who needs this fix can use my current fork - https://github.com/daniel347x/node-graphviz)