|
4 | 4 | import streamlit as st |
5 | 5 | df_index = 1 |
6 | 6 |
|
7 | | -st.markdown('''<h3 style='text-align: center; color: #023558;'>All Formats</h3>''', unsafe_allow_html=True) |
8 | | -st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Phyla Correlation Network Csv</h4>''', unsafe_allow_html=True) |
| 7 | + |
| 8 | +st.markdown( |
| 9 | + ( |
| 10 | + "<h3 style='text-align: center; " |
| 11 | + "color: #023558;'>All Formats</h3>" |
| 12 | + ), |
| 13 | + unsafe_allow_html=True) |
| 14 | + |
| 15 | + |
| 16 | +st.markdown( |
| 17 | + ( |
| 18 | + "<h4 style='text-align: center; " |
| 19 | + "color: #2b8cbe;'>Phyla Correlation Network Csv</h4>" |
| 20 | + ), |
| 21 | + unsafe_allow_html=True) |
| 22 | + |
9 | 23 | df = pd.read_csv('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/1_phyla_correlation_network_csv.csv') |
10 | 24 |
|
11 | 25 |
|
12 | 26 | # Displays a DataFrame using AgGrid with configurable options. |
13 | 27 | grid_builder = GridOptionsBuilder.from_dataframe(df) |
14 | | -grid_builder.configure_default_column(editable=True, groupable=True, filter=True) |
15 | | -grid_builder.configure_side_bar(filters_panel=True, columns_panel=True) |
| 28 | +grid_builder.configure_default_column(editable=True, |
| 29 | + groupable=True, |
| 30 | + filter=True, |
| 31 | +) |
| 32 | +grid_builder.configure_side_bar(filters_panel=True, |
| 33 | + columns_panel=True) |
16 | 34 | grid_builder.configure_selection(selection_mode="multiple") |
17 | | -grid_builder.configure_pagination(enabled=True, paginationAutoPageSize=False, paginationPageSize=20) |
| 35 | +grid_builder.configure_pagination(enabled=True, |
| 36 | + paginationAutoPageSize=False, |
| 37 | + paginationPageSize=20, |
| 38 | +) |
18 | 39 | grid_options = grid_builder.build() |
19 | 40 |
|
20 | 41 | AgGrid(df, gridOptions=grid_options, enable_enterprise_modules=True) |
|
28 | 49 | mime='text/csv', |
29 | 50 | key=f"download_button_{df_index}") |
30 | 51 | df_index += 1 |
31 | | -st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Abundance Table Example Xls</h4>''', unsafe_allow_html=True) |
| 52 | + |
| 53 | +st.markdown( |
| 54 | + ( |
| 55 | + "<h4 style='text-align: center; " |
| 56 | + "color: #2b8cbe;'>Abundance Table Example Xls</h4>" |
| 57 | + ), |
| 58 | + unsafe_allow_html=True) |
| 59 | + |
32 | 60 | selected_sheet = 0 |
33 | 61 | sheet_names = table_utils.get_sheet_names("docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/2_abundance_table_example_xls.xls") |
34 | 62 | selected_sheet = st.selectbox("Select a sheet to display", options=sheet_names) |
|
38 | 66 |
|
39 | 67 | # Displays a DataFrame using AgGrid with configurable options. |
40 | 68 | grid_builder = GridOptionsBuilder.from_dataframe(df) |
41 | | -grid_builder.configure_default_column(editable=True, groupable=True, filter=True) |
42 | | -grid_builder.configure_side_bar(filters_panel=True, columns_panel=True) |
| 69 | +grid_builder.configure_default_column(editable=True, |
| 70 | + groupable=True, |
| 71 | + filter=True, |
| 72 | +) |
| 73 | +grid_builder.configure_side_bar(filters_panel=True, |
| 74 | + columns_panel=True) |
43 | 75 | grid_builder.configure_selection(selection_mode="multiple") |
44 | | -grid_builder.configure_pagination(enabled=True, paginationAutoPageSize=False, paginationPageSize=20) |
| 76 | +grid_builder.configure_pagination(enabled=True, |
| 77 | + paginationAutoPageSize=False, |
| 78 | + paginationPageSize=20, |
| 79 | +) |
45 | 80 | grid_options = grid_builder.build() |
46 | 81 |
|
47 | 82 | AgGrid(df, gridOptions=grid_options, enable_enterprise_modules=True) |
|
55 | 90 | mime='text/csv', |
56 | 91 | key=f"download_button_{df_index}") |
57 | 92 | df_index += 1 |
58 | | -st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Sample Info Example Txt</h4>''', unsafe_allow_html=True) |
| 93 | + |
| 94 | +st.markdown( |
| 95 | + ( |
| 96 | + "<h4 style='text-align: center; " |
| 97 | + "color: #2b8cbe;'>Sample Info Example Txt</h4>" |
| 98 | + ), |
| 99 | + unsafe_allow_html=True) |
| 100 | + |
59 | 101 | df = pd.read_table('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/3_sample_info_example_txt.txt') |
60 | 102 |
|
61 | 103 |
|
62 | 104 | # Displays a DataFrame using AgGrid with configurable options. |
63 | 105 | grid_builder = GridOptionsBuilder.from_dataframe(df) |
64 | | -grid_builder.configure_default_column(editable=True, groupable=True, filter=True) |
65 | | -grid_builder.configure_side_bar(filters_panel=True, columns_panel=True) |
| 106 | +grid_builder.configure_default_column(editable=True, |
| 107 | + groupable=True, |
| 108 | + filter=True, |
| 109 | +) |
| 110 | +grid_builder.configure_side_bar(filters_panel=True, |
| 111 | + columns_panel=True) |
66 | 112 | grid_builder.configure_selection(selection_mode="multiple") |
67 | | -grid_builder.configure_pagination(enabled=True, paginationAutoPageSize=False, paginationPageSize=20) |
| 113 | +grid_builder.configure_pagination(enabled=True, |
| 114 | + paginationAutoPageSize=False, |
| 115 | + paginationPageSize=20, |
| 116 | +) |
68 | 117 | grid_options = grid_builder.build() |
69 | 118 |
|
70 | 119 | AgGrid(df, gridOptions=grid_options, enable_enterprise_modules=True) |
|
78 | 127 | mime='text/csv', |
79 | 128 | key=f"download_button_{df_index}") |
80 | 129 | df_index += 1 |
81 | | -st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Sample Info Example Parquet</h4>''', unsafe_allow_html=True) |
| 130 | + |
| 131 | +st.markdown( |
| 132 | + ( |
| 133 | + "<h4 style='text-align: center; " |
| 134 | + "color: #2b8cbe;'>Sample Info Example Parquet</h4>" |
| 135 | + ), |
| 136 | + unsafe_allow_html=True) |
| 137 | + |
82 | 138 | df = pd.read_parquet('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/4_sample_info_example_parquet.parquet') |
83 | 139 |
|
84 | 140 |
|
85 | 141 | # Displays a DataFrame using AgGrid with configurable options. |
86 | 142 | grid_builder = GridOptionsBuilder.from_dataframe(df) |
87 | | -grid_builder.configure_default_column(editable=True, groupable=True, filter=True) |
88 | | -grid_builder.configure_side_bar(filters_panel=True, columns_panel=True) |
| 143 | +grid_builder.configure_default_column(editable=True, |
| 144 | + groupable=True, |
| 145 | + filter=True, |
| 146 | +) |
| 147 | +grid_builder.configure_side_bar(filters_panel=True, |
| 148 | + columns_panel=True) |
89 | 149 | grid_builder.configure_selection(selection_mode="multiple") |
90 | | -grid_builder.configure_pagination(enabled=True, paginationAutoPageSize=False, paginationPageSize=20) |
| 150 | +grid_builder.configure_pagination(enabled=True, |
| 151 | + paginationAutoPageSize=False, |
| 152 | + paginationPageSize=20, |
| 153 | +) |
91 | 154 | grid_options = grid_builder.build() |
92 | 155 |
|
93 | 156 | AgGrid(df, gridOptions=grid_options, enable_enterprise_modules=True) |
|
101 | 164 | mime='text/csv', |
102 | 165 | key=f"download_button_{df_index}") |
103 | 166 | df_index += 1 |
104 | | -st.markdown('''<h4 style='text-align: center; color: #2b8cbe;'>Example Xlsx</h4>''', unsafe_allow_html=True) |
| 167 | + |
| 168 | +st.markdown( |
| 169 | + ( |
| 170 | + "<h4 style='text-align: center; " |
| 171 | + "color: #2b8cbe;'>Example Xlsx</h4>" |
| 172 | + ), |
| 173 | + unsafe_allow_html=True) |
| 174 | + |
105 | 175 | selected_sheet = 0 |
106 | 176 | df = pd.read_excel('docs/example_data/Basic_example_vuegen_demo_notebook/2_Dataframes/1_All_formats/5_example_xlsx.xlsx', sheet_name=selected_sheet) |
107 | 177 |
|
108 | 178 |
|
109 | 179 | # Displays a DataFrame using AgGrid with configurable options. |
110 | 180 | grid_builder = GridOptionsBuilder.from_dataframe(df) |
111 | | -grid_builder.configure_default_column(editable=True, groupable=True, filter=True) |
112 | | -grid_builder.configure_side_bar(filters_panel=True, columns_panel=True) |
| 181 | +grid_builder.configure_default_column(editable=True, |
| 182 | + groupable=True, |
| 183 | + filter=True, |
| 184 | +) |
| 185 | +grid_builder.configure_side_bar(filters_panel=True, |
| 186 | + columns_panel=True) |
113 | 187 | grid_builder.configure_selection(selection_mode="multiple") |
114 | | -grid_builder.configure_pagination(enabled=True, paginationAutoPageSize=False, paginationPageSize=20) |
| 188 | +grid_builder.configure_pagination(enabled=True, |
| 189 | + paginationAutoPageSize=False, |
| 190 | + paginationPageSize=20, |
| 191 | +) |
115 | 192 | grid_options = grid_builder.build() |
116 | 193 |
|
117 | 194 | AgGrid(df, gridOptions=grid_options, enable_enterprise_modules=True) |
|
0 commit comments