Using the generate_dot() function, the output uses single quotes around every attribute value, which (as far as I can tell) isn't supported in the dot language. Writing the output of generate_dot() to a file and subsequently running dot from a command line on that file throws a syntax error.
and dot -Tpng test.dot -o test.png from a command line gives Error: test.dot: syntax error in line 3 near '''. However, replacing the single quotes with double quotes (e.g. with str_replace("'", "\"")) produces a file that does work with command-line dot.
It seems to me that generate_dot() should use double quotes by default since that's what dot expects.
Using the
generate_dot()
function, the output uses single quotes around every attribute value, which (as far as I can tell) isn't supported in thedot
language. Writing the output ofgenerate_dot()
to a file and subsequently runningdot
from a command line on that file throws a syntax error.For example:
produces
and
dot -Tpng test.dot -o test.png
from a command line givesError: test.dot: syntax error in line 3 near '''
. However, replacing the single quotes with double quotes (e.g. withstr_replace("'", "\"")
) produces a file that does work with command-linedot
.It seems to me that
generate_dot()
should use double quotes by default since that's whatdot
expects.