streamlit-sigmajs
A Streamlit component for interactive property graph visualization, powered by Sigma.js.
Demo
Roadmap
- Basic graph visualization
- Node and edge styling
- In-component node and edge selection
- Python interaction callbacks
- Graph layouts
- Theming
Local Installation
Install the Python package and development dependencies:
uv sync --extra dev
To build your frontend code, run the following commands from the st_sigma/frontend directory:
npm ci
npm run build
To run in development mode with hot-reloading, in the st_sigma/frontend directory, run:
npm ci
npm run start
To start the bundled example app, run:
uv run --with neo4j streamlit run st_sigma/example.py
Install from PyPI
uv add streamlit-sigmajs
Build and publish to PyPI
- Update the version in
pyproject.toml. - Build the frontend and Python distributions:
cd st_sigma/frontend
npm ci
npm run build
cd ../..
uv build
- Validate the distributions locally:
uvx twine check dist/*
PyPI releases are published by the publish GitHub Actions workflow using
Trusted Publishing. Push a version
tag such as v0.1.2, or manually dispatch the workflow for an existing tag.
No PyPI API token is stored in GitHub.
Usage
The graph visualizer takes a customized graph dictionary in its graphData argument.
You can convert a Neo4j graph result to the required dictionary using the neo4jgraph_to_sigma utility function.
The neo4jgraph_to_sigma function takes a neo4j.Graph object as input, usually the results you get from driver.execute_query(..., result_transformer_=neo4j.Result.graph).
import streamlit as st
from st_sigma import st_sigmagraph, neo4jgraph_to_sigma
import neo4j
from neo4j import GraphDatabase
NEO4J_URI = "bolt://localhost:7677"
NEO4J_USER = "neo4j"
NEO4J_PASSWORD = "your_password"
def query_neo4j_graph(query):
with GraphDatabase.driver(NEO4J_URI, auth=(NEO4J_USER, NEO4J_PASSWORD)) as driver:
result = driver.execute_query( query, result_transformer_ = neo4j.Result.graph )
return result
query = st.text_area(
"Enter Cypher Query",
value="MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 4",
height=100
)
st.subheader("Component with variable args")
height = st.slider("Graph Height", min_value=200, max_value=800, value=600, step=50)
if st.button("Visualize Graph"):
try:
with st.spinner("Querying Neo4j..."):
result = query_neo4j_graph(query)
result = neo4jgraph_to_sigma(result)
if not result["nodes"]:
st.warning("No nodes found in the query result.")
else:
st.success(f"Found {len(result['nodes'])} nodes and {len(result['relationships'])} relationships")
st_sigmagraph(
graphData=result,
height=height,
key="neo4j_graph"
)
except Exception as e:
st.error(f"Error: {str(e)}")
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_sigmajs-0.1.2.tar.gz.
File metadata
- Download URL: streamlit_sigmajs-0.1.2.tar.gz
- Upload date:
- Size: 146.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61cddb22ec3b170403bbbc49042887c8e6deec3dcc0c0c4118b809847c3673e3
|
|
| MD5 |
0b6286ed351c696ba825d4c07d1dd516
|
|
| BLAKE2b-256 |
bed384db258087eebb77687fe6b61f8d479a6bd5425e0a00065bd34b88a9a0ea
|
Provenance
The following attestation bundles were made for streamlit_sigmajs-0.1.2.tar.gz:
Publisher:
publish.yml on gitkeniwo/streamlit-sigmajs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_sigmajs-0.1.2.tar.gz -
Subject digest:
61cddb22ec3b170403bbbc49042887c8e6deec3dcc0c0c4118b809847c3673e3 - Sigstore transparency entry: 2428831134
- Sigstore integration time:
-
Permalink:
gitkeniwo/streamlit-sigmajs@8baf4720a164f1745e81487f6f2895c535b12057 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gitkeniwo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8baf4720a164f1745e81487f6f2895c535b12057 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file streamlit_sigmajs-0.1.2-py3-none-any.whl.
File metadata
- Download URL: streamlit_sigmajs-0.1.2-py3-none-any.whl
- Upload date:
- Size: 146.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24ec2befcd1a1220857e977a30081bc8990345d08366307363b2e42e80ce9594
|
|
| MD5 |
ce63fb8d5b537269df987978514abc3f
|
|
| BLAKE2b-256 |
25c85a28d15bfa07e7eeaa731001a3c0a5c25da024a0c54458edb987aa1bf614
|
Provenance
The following attestation bundles were made for streamlit_sigmajs-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on gitkeniwo/streamlit-sigmajs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
streamlit_sigmajs-0.1.2-py3-none-any.whl -
Subject digest:
24ec2befcd1a1220857e977a30081bc8990345d08366307363b2e42e80ce9594 - Sigstore transparency entry: 2428831281
- Sigstore integration time:
-
Permalink:
gitkeniwo/streamlit-sigmajs@8baf4720a164f1745e81487f6f2895c535b12057 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gitkeniwo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8baf4720a164f1745e81487f6f2895c535b12057 -
Trigger Event:
workflow_dispatch
-
Statement type: