Ipysigma graph not loading

I want to visualize a graph with ipysigma. It seems the best way to do this is to write it to an html javascript. The resulting html displays properly in the browser but not in streamlit. There are no errors either. Any suggestions?

import streamlit as st
import streamlit.components.v1 as components

from ipysigma import Sigma
import networkx as nx

# Create an empty graph
G = nx.Graph()

# Add nodes "foo" and "bar"
G.add_node("foo")
G.add_node("bar")

# Add an edge between nodes "foo" and "bar"
G.add_edge("foo", "bar")

# Write the Sigma graph
Sigma.write_html(graph=G,
            background_color="white",
            path="./foobar_gr.html",
            fullscreen=True 
            )

st.markdown(
    """
    # Graph
    """
)

with open("foobar_gr.html", "r") as f: 
    html_data = f.read()

components.html(html_data, height=1000, width=1000)

your code is correctly displayed, try reinstalling the library.

I did reinstall and it still doesn’t work. Can you provide your version info?

My env:

OS: Windows
python 3.12.3

ipysigma==0.24.2
networkx==3.3
streamlit==1.33.0

I have your same libraries, see if it could be a browser problem.

ipysigma==0.24.2

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.