Ludvig commited on
Commit
448553b
·
1 Parent(s): b008d2a

Create "advanced" expander in design settings - much cleaner

Browse files
Files changed (2) hide show
  1. app.py +39 -37
  2. text_sections.py +1 -1
app.py CHANGED
@@ -333,49 +333,51 @@ if st.session_state["step"] >= 2:
333
  else:
334
  prob_of_class = None
335
 
336
- default_elements = [
337
- "Counts",
338
- "Normalized Counts (%)",
339
- "Zero Shading",
340
- "Arrows",
341
- ]
342
- if num_classes < 6:
343
- # Percentages clutter too much with many classes
344
- default_elements += [
345
- "Row Percentages",
346
- "Column Percentages",
347
- ]
348
- elements_to_add = st.multiselect(
349
- "Add the following elements",
350
- options=[
351
- "Sum Tiles",
352
  "Counts",
353
  "Normalized Counts (%)",
354
- "Row Percentages",
355
- "Column Percentages",
356
  "Zero Shading",
357
- "Zero Percentages",
358
- "Zero Text",
359
  "Arrows",
360
- ],
361
- default=default_elements,
362
- )
363
-
364
- col1, col2, col3 = st.columns(3)
365
- with col1:
366
- counts_on_top = st.checkbox(
367
- "Counts on top (not working)",
368
- help="Whether to switch the positions of the counts and normalized counts (%). "
369
- "That is, the counts become the big centralized numbers and the "
370
- "normalized counts go below with a smaller font size.",
371
- )
372
- with col2:
373
- diag_percentages_only = st.checkbox("Diagonal row/column percentages only")
374
- with col3:
375
- num_digits = st.number_input(
376
- "Digits", value=2, help="Number of digits to round percentages to."
 
 
 
 
377
  )
378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  element_flags = [
380
  key
381
  for key, val in {
 
333
  else:
334
  prob_of_class = None
335
 
336
+ with st.expander("Advanced"):
337
+
338
+ default_elements = [
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  "Counts",
340
  "Normalized Counts (%)",
 
 
341
  "Zero Shading",
 
 
342
  "Arrows",
343
+ ]
344
+ if num_classes < 6:
345
+ # Percentages clutter too much with many classes
346
+ default_elements += [
347
+ "Row Percentages",
348
+ "Column Percentages",
349
+ ]
350
+ elements_to_add = st.multiselect(
351
+ "Add the following elements",
352
+ options=[
353
+ "Sum Tiles",
354
+ "Counts",
355
+ "Normalized Counts (%)",
356
+ "Row Percentages",
357
+ "Column Percentages",
358
+ "Zero Shading",
359
+ "Zero Percentages",
360
+ "Zero Text",
361
+ "Arrows",
362
+ ],
363
+ default=default_elements,
364
  )
365
 
366
+ col1, col2, col3 = st.columns(3)
367
+ with col1:
368
+ counts_on_top = st.checkbox(
369
+ "Counts on top (not working)",
370
+ help="Whether to switch the positions of the counts and normalized counts (%). "
371
+ "That is, the counts become the big centralized numbers and the "
372
+ "normalized counts go below with a smaller font size.",
373
+ )
374
+ with col2:
375
+ diag_percentages_only = st.checkbox("Diagonal row/column percentages only")
376
+ with col3:
377
+ num_digits = st.number_input(
378
+ "Digits", value=2, help="Number of digits to round percentages to."
379
+ )
380
+
381
  element_flags = [
382
  key
383
  for key, val in {
text_sections.py CHANGED
@@ -51,7 +51,7 @@ def intro_text():
51
  st.markdown(
52
  "No worries! Either: \n\n"
53
  "C) **Input** your counts directly! \n\n"
54
- "D) **Generate* some data with **very** easy controls! \n\n"
55
  "--> Press **Generate plot**.\n\n"
56
  )
57
  st.markdown("""---""")
 
51
  st.markdown(
52
  "No worries! Either: \n\n"
53
  "C) **Input** your counts directly! \n\n"
54
+ "D) **Generate** some data with **very** easy controls! \n\n"
55
  "--> Press **Generate plot**.\n\n"
56
  )
57
  st.markdown("""---""")