Skip to main content

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 containing simulatorObjectNodes and simulatorObjectEdges.
  • 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


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.2.6.tar.gz (152.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_flowsheet-0.2.6-py3-none-any.whl (152.5 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_flowsheet-0.2.6.tar.gz.

File metadata

  • Download URL: streamlit_flowsheet-0.2.6.tar.gz
  • Upload date:
  • Size: 152.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for streamlit_flowsheet-0.2.6.tar.gz
Algorithm Hash digest
SHA256 5054dbc1da1d1f360a0e84b7df7772163db27ce5642d445c7c1a97840b36f3df
MD5 153868cd77a028ad82ce90e366c8fced
BLAKE2b-256 71c6e9cefd00757430f1750790004887f893d5449e84a6a525bf2c47a82e3d9f

See more details on using hashes here.

File details

Details for the file streamlit_flowsheet-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: streamlit_flowsheet-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 152.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for streamlit_flowsheet-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bd066419d5cd00c25d66b4bf0bd862d0ff5fc573cc5caf25ae2c2140ebc2c1dd
MD5 51a91a453a81279adf9fbd5ffc0bc361
BLAKE2b-256 60f07e580692d43db155faebd3eece4228515de0a2bd97e965c384a0edcc0dc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page