コード例 #1
0
def main():
    sel_files, df = data_selector.select_file(
        'raw', default='unsw-nb15/17-02-2015/27_http.pcap')

    chart = st.line_chart()

    # v = st.slider('Test', min_value=1, max_value=10)
    # data = my_load(v, lambda x: chart.add_rows(x))

    # for d in data:
    # 	chart.add_rows(d)
    st.write('Done')
コード例 #2
0
def show_components() -> None:
    st.header("Demonstrate use of a custom component")

    st.markdown(
        "A component is just a collection of streamlit widgets and custom functions."
        "To use a custom components simply import it and call the required function"
    )

    st.write("This project has the following folder structure:")
    st.text("""
        .
        ├── app.py
        ├── data
        │   ├── external
        │   └── raw
        │       ├── data_1.csv
                ...
        │       └── web_1.json
        ...
        ├── ui
        │   ├── basics.py
        │   ├── components
        │   │   └── data_selector.py
        │   ├── extras.py
        │   ├── interactive.py
        ...  
    """)

    with st.echo():
        import ui.components.data_selector as file_selector

        file_selector.select_file("raw", st, [".csv", ".json"])

    st.markdown('-' * 6)
    st.write("Help for the custom component is available via `st.help`")
    with st.echo():
        st.help(file_selector.select_file)