mfebrizio commited on
Commit
2858954
·
1 Parent(s): c2f252e

Update app.py

Browse files

switch back to value boxes instead of cards

Files changed (1) hide show
  1. app.py +47 -49
app.py CHANGED
@@ -91,64 +91,62 @@ with ui.sidebar(open={"desktop": "open", "mobile": "closed"}):
91
  ui.input_select("menu_significant", "Select rule significance", choices=["all", "3f1-significant", "other-significant"], selected="all", multiple=True)
92
 
93
  # value boxes with summary data
94
- #with ui.layout_column_wrap():
95
- # with ui.value_box():
96
- # "All final rules"
97
- # @render.text
98
- # def count_rules():
99
- # return f"{filtered_df()['document_number'].count()}"
100
- # #ui.input_action_button("filter_all", "Clear Filters", class_="btn-filter", icon=icon_svg("book"))
101
- #
102
- # with ui.value_box():
103
- # "Section 3(f)(1) Significant rules *"
104
- # @render.text
105
- # def count_3f1_significant():
106
- # output = "Not available"
107
- # if GET_SIGNIFICANT:
108
- # output = f"{filtered_df()['3f1_significant'].sum()}"
109
- # return output
110
- # #ui.input_action_button("filter_3f1", "Filter", class_="btn-filter", icon=icon_svg("book"))
111
- #
112
- # with ui.value_box():
113
- # "Other Significant rules *"
114
- # @render.text
115
- # def count_other_significant():
116
- # output = "Not available"
117
- # if GET_SIGNIFICANT:
118
- # output = f"{filtered_df()['other_significant'].sum()}"
119
- # return output
120
- # #ui.input_action_button("filter_other", "Filter", class_="btn-filter", icon=icon_svg("book"))
121
-
122
-
123
- #
124
  with ui.layout_column_wrap():
125
- with ui.card(class_="summary-card"):
126
- with ui.tooltip(placement="bottom", id="all_tooltip"):
127
- @render.text
128
- def count_rules():
129
- return f"All final rules: {filtered_df()['document_number'].count()}"
130
- f"Federal Register data last retrieved {date.today()}."
131
-
132
- with ui.card(class_="summary-card"):
133
- with ui.tooltip(placement="bottom", id="3f1_tooltip"):
134
- @render.text
135
- def count_3f1_significant():
136
- output = "Not available"
137
- if GET_SIGNIFICANT:
138
- output = f"Section 3(f)(1) Significant rules: {filtered_df()['3f1_significant'].sum()}"
139
- return output
140
- f"Executive Order 12866 significance data last updated {LAST_UPDATED}."
141
 
142
- with ui.card(class_="summary-card"):
143
- with ui.tooltip(placement="bottom", id="other_tooltip"):
 
 
 
 
 
 
 
 
 
 
144
  @render.text
145
  def count_other_significant():
146
  output = "Not available"
147
  if GET_SIGNIFICANT:
148
- output = f"Other Significant rules: {filtered_df()['other_significant'].sum()}"
149
  return output
150
  f"Executive Order 12866 significance data last updated {LAST_UPDATED}."
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  # documentation note on significance data
153
  #ui.markdown(
154
  # f"""
 
91
  ui.input_select("menu_significant", "Select rule significance", choices=["all", "3f1-significant", "other-significant"], selected="all", multiple=True)
92
 
93
  # value boxes with summary data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  with ui.layout_column_wrap():
95
+ with ui.value_box():
96
+ "All final rules"
97
+ @render.text
98
+ def count_rules():
99
+ return f"{filtered_df()['document_number'].count()}"
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ with ui.value_box():
102
+ "Section 3(f)(1) Significant rules *"
103
+ @render.text
104
+ def count_3f1_significant():
105
+ output = "Not available"
106
+ if GET_SIGNIFICANT:
107
+ output = f"{filtered_df()['3f1_significant'].sum()}"
108
+ return output
109
+
110
+ with ui.value_box():
111
+ "Other Significant rules"
112
+ with ui.tooltip(placement="bottom", id="other_tooltip"):
113
  @render.text
114
  def count_other_significant():
115
  output = "Not available"
116
  if GET_SIGNIFICANT:
117
+ output = f"{filtered_df()['other_significant'].sum()}"
118
  return output
119
  f"Executive Order 12866 significance data last updated {LAST_UPDATED}."
120
 
121
+
122
+ #with ui.layout_column_wrap():
123
+ # with ui.card(class_="summary-card"):
124
+ # with ui.tooltip(placement="bottom", id="all_tooltip"):
125
+ # @render.text
126
+ # def count_rules():
127
+ # return f"All final rules: {filtered_df()['document_number'].count()}"
128
+ # f"Federal Register data last retrieved {date.today()}."
129
+ #
130
+ # with ui.card(class_="summary-card"):
131
+ # with ui.tooltip(placement="bottom", id="3f1_tooltip"):
132
+ # @render.text
133
+ # def count_3f1_significant():
134
+ # output = "Not available"
135
+ # if GET_SIGNIFICANT:
136
+ # output = f"Section 3(f)(1) Significant rules: {filtered_df()['3f1_significant'].sum()}"
137
+ # return output
138
+ # f"Executive Order 12866 significance data last updated {LAST_UPDATED}."
139
+ #
140
+ # with ui.card(class_="summary-card"):
141
+ # with ui.tooltip(placement="bottom", id="other_tooltip"):
142
+ # @render.text
143
+ # def count_other_significant():
144
+ # output = "Not available"
145
+ # if GET_SIGNIFICANT:
146
+ # output = f"Other Significant rules: {filtered_df()['other_significant'].sum()}"
147
+ # return output
148
+ # f"Executive Order 12866 significance data last updated {LAST_UPDATED}."
149
+
150
  # documentation note on significance data
151
  #ui.markdown(
152
  # f"""