File size: 2,048 Bytes
afd4085
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

# 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 -------------------------------------------------------------------------