A Streamlit component for rendering process flowsheet diagrams with interactive selection
Project description
Streamlit Flowsheet Component
A Streamlit component for rendering interactive process flowsheet diagrams with node selection capabilities.
Features
- Interactive process flowsheet visualization with ReactFlow
- Node selection with detailed properties panel
- Collapsible navigation panel for easy node browsing
- Theme-aware (automatically adapts to Streamlit light/dark themes)
- Configurable display options (navigation panel, properties panel, node borders)
- Returns selected node data to Streamlit
Installation
pip install streamlit-flowsheet
Usage
import streamlit as st
from streamlit_flowsheet import render_flowsheet
import json
# Load model revision data (full CDF response)
with open("model_revision_data.json", "r") as f:
full_data = json.load(f)
# Extract the flowsheet
flowsheet = full_data["items"][0]["flowsheet"]
# Render the flowsheet
selected_node = render_flowsheet(
data=flowsheet,
show_navigation_panel=True,
show_properties=True,
show_border=True,
height=800
)
# Handle selection
if selected_node:
st.write(f"Selected: {selected_node[0]['name']}")
Parameters
data(dict): Flowsheet object containingsimulatorObjectNodesandsimulatorObjectEdges.show_navigation_panel(bool): Show/hide the left navigation panel (default: True)show_properties(bool): Show/hide the properties panel on node selection (default: True)show_border(bool): Show/hide node borders (default: True)height(int): Component height in pixels (default: 800)
Development
Setup
cd streamlit-flowsheet
uv sync --dev
cd streamlit_flowsheet/frontend
npm install
Build Frontend
cd streamlit_flowsheet/frontend
npm run build
Build Package
uv build
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit_flowsheet-0.1.15.tar.gz
(290.6 kB
view details)
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_flowsheet-0.1.15.tar.gz.
File metadata
- Download URL: streamlit_flowsheet-0.1.15.tar.gz
- Upload date:
- Size: 290.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5f1debfb86924dd5bc70df370e46ecf19967f366b359030f9121d90b06f79fa
|
|
| MD5 |
b3e12d49b33071c4c0503adb9a9bd6ac
|
|
| BLAKE2b-256 |
2e33dd08201100cf14f6080e8f47f2e1d2d23648de698c5f244928bdf06adbbc
|
File details
Details for the file streamlit_flowsheet-0.1.15-py3-none-any.whl.
File metadata
- Download URL: streamlit_flowsheet-0.1.15-py3-none-any.whl
- Upload date:
- Size: 325.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8c89b1a3346b1ec9d8953d2cca35c11984df224d7beff96e09174916ffc80f
|
|
| MD5 |
c86e6327350796610c6f09fd7c0b3d6d
|
|
| BLAKE2b-256 |
9fd584fdfb1001bb9b392b3144663e46b260df4f4b2afa05d78a92fca46c8f37
|