I just upgraded my Streamlit package to 1.40.1 and since then my st.graphviz_chart isn’t rendering in my app… Worked fine with prior versions.
I have isolated the issue to the use_container_width parameter. If you include this parameter, the graph isn’t rendered, but it does without.
Anyone else having this issue?
import streamlit as st
import graphviz
from importlib.metadata import version
STREAMLIT_VERSION = version("streamlit")
g = graphviz.Digraph()
g.graph_attr["rankdir"] = "LR" # <-- Left to right order
## Add nodes and edges
for i in range(4):
g.node(str(i), label=f"Node {i}", pos=f"{i}, -{i}!")
if i < 3:
g.edge(f"{i}", f"{i+1}")
f"**Streamlit version: {STREAMLIT_VERSION}**"
with st.echo():
st.graphviz_chart(g, use_container_width=True)
with st.echo():
st.graphviz_chart(g)