mfebrizio commited on
Commit
e425048
1 Parent(s): 7da65a3

adjust summary values

Browse files
Files changed (2) hide show
  1. app.py +61 -31
  2. www/style.css +6 -0
app.py CHANGED
@@ -5,7 +5,7 @@ import asyncio
5
  from datetime import datetime, date, time
6
  from pathlib import Path
7
 
8
- from faicons import icon_svg
9
  from pandas import DataFrame
10
  from numpy import array
11
 
@@ -91,40 +91,70 @@ 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
  # documentation note on significance data
123
- ui.markdown(
124
- f"""
125
- \* *Executive Order 12866 significance data last updated **{LAST_UPDATED}***.
126
- """
127
- )
128
 
129
  # main content
130
  with ui.navset_card_underline(title=""):
 
5
  from datetime import datetime, date, time
6
  from pathlib import Path
7
 
8
+ #from faicons import icon_svg
9
  from pandas import DataFrame
10
  from numpy import array
11
 
 
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"""
155
+ # \* *Executive Order 12866 significance data last updated **{LAST_UPDATED}***.
156
+ # """
157
+ # )
158
 
159
  # main content
160
  with ui.navset_card_underline(title=""):
www/style.css CHANGED
@@ -21,3 +21,9 @@
21
  color: #FFFFFF;
22
  background-color: #0190DB;
23
  }
 
 
 
 
 
 
 
21
  color: #FFFFFF;
22
  background-color: #0190DB;
23
  }
24
+
25
+ .summary-card {
26
+ font-size: medium;
27
+ color: #033C5A;
28
+ font-weight: bold;
29
+ }