Streamlit component that allows you to do X
Project description
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
- Change version in
setup.py
twine upload dist/*
Developer
Deployment
https://docs.streamlit.io/library/components/publish
python setup.py sdist bdist_wheel
python -m twine upload dist/*
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
Built Distribution
Close
Hashes for streamlit-flow-node-graph-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460e41f8bba72ee94b7d8852a6a7fc45491c069187261a48520087364bc61633 |
|
MD5 | 62cd4882ba632855b6d975023c00e1f4 |
|
BLAKE2b-256 | 57832f3c7b5ccfea7c841db1caf79bea5434ff2ed4536141447144658296574c |
Close
Hashes for streamlit_flow_node_graph-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d0f81d0b77cffa5ec40eb030880ff95c7420694c7ac90e26018b28f7c82f39a |
|
MD5 | 0980e4c48556d25e0b2595aac1f8f364 |
|
BLAKE2b-256 | 7fb177d86af04b667b5f158f131a4ed9a2f1ce0eb8a78ab4d2aaf7bbf1247b4e |