Graphviz graph with different engine/layout (e.g., neato, circo) are not rendered correspondingly in the streamlit 0.78.0/0.79.0

When I try different layout/engine of the graphviz graph (e.g., neato, circo, see here: https://graphviz.org/), the streamlit seems not render the graph correspondingly. Any suggestions?

1 Like

Hey @Jiangang_Hao,

can you please provide a small example with minimum code to to reproduce the error?
Also some screenshots would be helpful. Thanks for your bug report.

Best regards
Chris

1 Like

Hi @chris_klose,

Sorry for the slow reply and I just saw this message. The issue is that there are different layout selection in graphviz (called engines), but when you choose different layout, the output from the streamlit side is the same. For example,

import graphviz

g = graphviz.Graph(‘G’, filename=‘process.gv’, engine=‘sfdp’)

g.edge(‘run’, ‘intr’)
g.edge(‘intr’, ‘runbl’)
g.edge(‘runbl’, ‘run’)
g.edge(‘run’, ‘kernel’)
g.edge(‘kernel’, ‘zombie’)
g.edge(‘kernel’, ‘sleep’)
g.edge(‘kernel’, ‘runmem’)
g.edge(‘sleep’, ‘swap’)
g.edge(‘swap’, ‘runswap’)
g.edge(‘runswap’, ‘new’)
g.edge(‘runswap’, ‘runmem’)
g.edge(‘new’, ‘runmem’)
g.edge(‘sleep’, ‘runmem’)
g.view()

if you change the engine from engine=‘sfdp’ to engine=‘neato’, streamlit rendered output is the same. More examples can be found at: Examples — graphviz 0.20.1 documentation

Thanks a lot.

-Jiangang