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!
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.
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)
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.