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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a23ba58903eb36d4c7b125ad54ed9cdef8d36d79f89daadd91c62941741aaf7 |
|
MD5 | 1eaa39c3325259becef588a23cdb7224 |
|
BLAKE2b-256 | 61c25329921c2eb4396e78c490669fd421d7c9f46c5959e72d1928da74f7efc8 |
Close
Hashes for streamlit_flow_node_graph-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d67016690f340d546aea23dc53a3cee0be58e00d86f1eb09a797e4447049cf95 |
|
MD5 | 62627a3c7abf1cb87068722f7b4eeeb4 |
|
BLAKE2b-256 | 42d94aa0f6d5ce96566c92fba8270a93b82246a6a6e2018cdcfe3bb6a782b6b9 |