# Graphviz Error

**URL:** <https://discuss.streamlit.io/t/graphviz-error/10403>\
**Category:** Using Streamlit\
**Created:** [March 2, 2021, 7:36pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403 "2021-03-02T19:36:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://discuss.streamlit.io/u/Bryan)\
**Post date:** [March 2, 2021, 7:36pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403/1 "2021-03-02T19:36:18Z")

</div>

Hi All,

I’m creating a graphviz plot of topic and subscriber nodes, similar to a ROS plot. At the end of my script I have st.graphviz\_chart(A), where A is a graphviz object. However, when I run the file using the streamlit run command, the web app opens and displays:  
original plot() function using pygraphviz and not graphviz

I’m using graphviz, not pygraphviz. Also, it literally worked yesterday, so I’m stumped. Any help would be greatly appreciated.

Also side question since I’m just starting out with streamlit, is it possible to make my graphviz plot interactive? For example, a user could move around the nodes, select various filters of information to display, can save an image of the plot, stuff like that? Thank you!

Bryan

---

<div class="post-metadata">

**Author:** ![chris\_klose](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/chris_klose/32/226_2.png) [@chris\_klose](https://discuss.streamlit.io/u/chris_klose)\
**Post date:** [March 2, 2021, 10:03pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403/2 "2021-03-02T22:03:53Z")

</div>

Hi @Bryan,

Welcome to the Streamlit Community! 🎈 🎉 🥳 🎉 🎈 🥳

You can check out the streamlit-agraph component:

> **[streamlit-agraph](https://pypi.org/project/streamlit-agraph/)**
>
> Interactive Graph Vis for Streamlit.

It allows you to do exactly that, do interactive charts.

Also pyvis is on the rise amongst the guys in the community:

> [@Interactive Networks (graphs) with Pyvis](https://discuss.streamlit.io/t/interactive-networks-graphs-with-pyvis/8344):
>
> Hi everyone, for those interested in showing graphs (@chris_klose, @Charly_Wargnier), I’ve found that with Pyvis is very easy to work out within streamlit. Here is an example of what can be done: [vid5\_2] You can play with the app here: [https://share.streamlit.io/napoles-uach/streamlit\_network/main/app.py](https://share.streamlit.io/napoles-uach/streamlit_network/main/app.py) and here is the repo: [https://github.com/napoles-uach/streamlit\_network](https://github.com/napoles-uach/streamlit_network)

Happy Streamlit-ing,  
Chris

---

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://discuss.streamlit.io/u/Bryan)\
**Post date:** [March 2, 2021, 10:20pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403/4 "2021-03-02T22:20:52Z")

</div>

Thanks! I’ll look into that. Also, do you have any advice for the issue I’m encountering?

Bryan

---

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://discuss.streamlit.io/u/Bryan)\
**Post date:** [March 3, 2021, 1:30am UTC](https://discuss.streamlit.io/t/graphviz-error/10403/5 "2021-03-03T01:30:29Z")

</div>

Also, can streamlit-agraph use graphviz objects?

---

<div class="post-metadata">

**Author:** ![napoles3d](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/napoles3d/32/47972_2.png) [@napoles3d](https://discuss.streamlit.io/u/napoles3d)\
**Post date:** [March 3, 2021, 1:55am UTC](https://discuss.streamlit.io/t/graphviz-error/10403/6 "2021-03-03T01:55:32Z")

</div>

Hi Bryan, could you provide a minimal snippet for that task??  
And welcome to the forum!!

---

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://discuss.streamlit.io/u/Bryan)\
**Post date:** [March 3, 2021, 8:48pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403/7 "2021-03-03T20:48:06Z")

</div>

Snippet of my code?

---

<div class="post-metadata">

**Author:** ![napoles3d](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/napoles3d/32/47972_2.png) [@napoles3d](https://discuss.streamlit.io/u/napoles3d)\
**Post date:** [March 3, 2021, 9:54pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403/8 "2021-03-03T21:54:08Z")

</div>

Yeah, to understand better what you want to do, you can write it here using triple backquotes (```)

---

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://discuss.streamlit.io/u/Bryan)\
**Post date:** [March 4, 2021, 6:47pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403/9 "2021-03-04T18:47:13Z")

</div>

Here’s a snippet of my code. It relies on some functions that parse a dictionary, where the dictionary contains information about nodes and their edges, but this is the code that generates the graphviz plot.

```auto
import graphviz as gv
A = gv.Graph()
topics_subscribers = edges()
pntr=0

for k in range(len(subscribers)):
    ProcID = y[list(y.keys())[k]]['procId']
    with A.subgraph(name='cluster'+str(ProcID)) as c:
        c.node(topics_subscribers[pntr][1])
        c.attr(label='Process ID ' + str(ProcID))
    pntr+=1

for j in range(len(x)):
    ProcID = x[j]['procId']
    machine = x[j]['machine']
    with A.subgraph(name='cluster'+str(ProcID)) as b:
        b.node(x[j]['topicName'])
        b.attr(label='Process ID ' + str(ProcID) + ' Machine '+ str(machine))
    
A.edges(topics_subscribers)
A.attr(overlap='false')  

A = apply_styles(A, styles)
A.render('test-output/round-table.gv', view=True)
```

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [May 13, 2022, 8:56pm UTC](https://discuss.streamlit.io/t/graphviz-error/10403/10 "2022-05-13T20:56:14Z")

</div>


