Metadata-Version: 2.1
Name: streamlit-flow-node-graph
Version: 0.0.7
Summary: Streamlit component that allows you to do X
Home-page: 
Author: John Smith
Author-email: john@example.com
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: streamlit >=0.63
Provides-Extra: devel
Requires-Dist: wheel ; extra == 'devel'
Requires-Dist: pytest ==7.4.0 ; extra == 'devel'
Requires-Dist: playwright ==1.39.0 ; extra == 'devel'
Requires-Dist: requests ==2.31.0 ; extra == 'devel'
Requires-Dist: pytest-playwright-snapshot ==1.0 ; extra == 'devel'
Requires-Dist: pytest-rerunfailures ==12.0 ; extra == 'devel'



# Usage

## Installation

`pip install streamlit-flow-node-graph`

## Create a graph element

```

# define items the user can use
item_types = [
        {"title":'Test 1',"color":"rgb(255,0, 192)", "port_selection" : 'out'},
        {"title":'Test 2',"color":"rgb(255, 0, 192)", "port_selection" : 'in'},
        {"title":'Test 3',"color":"rgb(0,255, 192)", "port_selection" : 'both'},
    ]

diagram = node_graph.node_graph(model=model, item_types=item_types, key='test' )
st.write(diagram.selected) # access currently selected node id
st.write(diagram.model) # access the underlysing model
```

## Features

 - specify a node icon with the icon property e.g. ` {"title":'Purchase',"color":"rgb(255,0, 192)", "port_selection" : 'out', "icon" : 'shopping-cart'}` (icons in the font-awesome collection can be used)
 - use diagram utils
 ```
diagram = node_graph.node_graph(model=model, item_types=item_types, key='`test`' )
digram.get_selected_node()
diagram.get_all_nodes_node_inputs()
formated_nodes, formated_links = diagram.process_diagram_output()
```

# Contribute

## Start dev 
`cd node_graph/frontend && npm install && npm run start`

uncomment `# _RELEASE = True` in `node_graph/__init__.py` and in another shell
`streamlit run node_graph/__init__.py `

## Build
`cd node_graph/frontend && npm build`
`cd../..`
`rm -rf dist/*`
`python setup.py sdist bdist_wheel`

## Upload
1. Change version in `setup.py`
2. `twine upload dist/*`

# Developer

## Deployment 

https://docs.streamlit.io/library/components/publish

python setup.py sdist bdist_wheel

python -m twine upload dist/*
