Metadata-Version: 2.1
Name: streamlit-flowsheet
Version: 0.1.0
Summary: A Streamlit component for rendering process flowsheet diagrams with interactive selection
Home-page: https://github.com/evertoncolling/streamlit-flowsheet
License: MIT
Keywords: streamlit,flowsheet,diagram,visualization,component
Author: Everton Colling
Author-email: evertoncolling@gmail.com
Requires-Python: >=3.9, !=2.7.*, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*, !=3.8.*
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: numpy (>=1.24.4,<2.0.0) ; python_version < "3.12"
Requires-Dist: numpy (>=1.26.0,<2.0.0) ; python_version >= "3.12"
Requires-Dist: streamlit (>=1.28.0,<2.0.0)
Project-URL: Repository, https://github.com/evertoncolling/streamlit-flowsheet
Description-Content-Type: text/markdown

# 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

```bash
pip install streamlit-flowsheet
```

## Usage

```python
import streamlit as st
from streamlit_flowsheet import render_flowsheet
import json

# Load your flowsheet data
with open("flowsheet_data.json", "r") as f:
    flowsheet_data = json.load(f)

# Render the flowsheet
selected_node = render_flowsheet(
    data=flowsheet_data,
    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 data in the CDF Simulator Model Revision Data [format](https://api-docs.cognite.com/20230101-alpha/tag/Simulator-Models/operation/get_simulator_model_revision_data_by_id)
- `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

```bash
cd streamlit-flowsheet
poetry install
cd streamlit_flowsheet/frontend
npm install
```

### Build Frontend

```bash
cd streamlit_flowsheet/frontend
npm run build
```

### Build Package

```bash
poetry build
```

## License

MIT
