awacke1's picture
Create trees.py
afd4085 verified
raw
history blame
2.05 kB
# Trees -----------------------------------------------------------------------------------
# Trees for use in Claims and ServiceNow/NPS datasets filter and cluster:
# pip install streamlit-tree-select https://github.com/Schluca/streamlit_tree_select
# pip install streamlit-condition-tree https://github.com/cedricvlt/streamlit-condition-tree
# pip install st-ant-tree https://github.com/flucas96/st_ant_tree
from streamlit_tree_select import tree_select
from st_ant_tree import st_ant_tree
import pandas as pd
st.write("🐙 Streamlit-tree-select - A simple and elegant checkbox tree for Streamlit.")
nodes = [
{"label": "Folder A", "value": "folder_a"},
{
"label": "Folder B",
"value": "folder_b",
"children": [
{"label": "Sub-folder A", "value": "sub_a"},
{"label": "Sub-folder B", "value": "sub_b"},
{"label": "Sub-folder C", "value": "sub_c"},
],
},
{
"label": "Folder C",
"value": "folder_c",
"children": [
{"label": "Sub-folder D", "value": "sub_d"},
{
"label": "Sub-folder E",
"value": "sub_e",
"children": [
{"label": "Sub-sub-folder A", "value": "sub_sub_a"},
{"label": "Sub-sub-folder B", "value": "sub_sub_b"},
],
},
{"label": "Sub-folder F", "value": "sub_f"},
],
},
]
return_select = tree_select(nodes)
st.write(return_select)
st.write("🐙 st_ant_tree - A simple and elegant checkbox tree for Streamlit.")
tree_data = [
{
"value": "parent 1",
"title": "Parent 1",
"children":
[
{"value": "child 1",
"title": "Child 1"},
{"value": "child 2",
"title": "Child 2"},
]
},
{
"value": "parent 2",
"title": "Parent 2",
}
]
st_ant_tree(tree_data,allowClear = True)
# Trees -------------------------------------------------------------------------