Spaces:
Running
Running
Commit ·
0ea7c56
1
Parent(s): 5aeaeae
add jumps per day
Browse files
app.py
CHANGED
|
@@ -146,8 +146,16 @@ def full_report():
|
|
| 146 |
y='total_jumps',
|
| 147 |
color='continent',
|
| 148 |
template="plotly_dark")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
-
return f"## Total Jumps: {total_jumps:,}", total, avg, total_map, jumps_over_time, county_map
|
| 151 |
|
| 152 |
|
| 153 |
with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
@@ -157,6 +165,8 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
| 157 |
map_fig = gr.Plot(label="Map")
|
| 158 |
with gr.Row():
|
| 159 |
county_map = gr.Plot(label="US Map")
|
|
|
|
|
|
|
| 160 |
with gr.Row():
|
| 161 |
jumps_over_time = gr.Plot(label="Jumps Over Time")
|
| 162 |
with gr.Row():
|
|
@@ -164,7 +174,7 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
| 164 |
with gr.Row():
|
| 165 |
avg_plot = gr.Plot(label="Average Jumps per Day")
|
| 166 |
|
| 167 |
-
outputs = [total_jumps_label, total_plot, avg_plot, map_fig, jumps_over_time, county_map]
|
| 168 |
dep = demo.load(full_report, None, outputs)
|
| 169 |
|
| 170 |
if __name__ == "__main__":
|
|
|
|
| 146 |
y='total_jumps',
|
| 147 |
color='continent',
|
| 148 |
template="plotly_dark")
|
| 149 |
+
|
| 150 |
+
daily_df = df.groupby(['day']).sum().reset_index()
|
| 151 |
+
per_day_plot = px.scatter(daily_df, x='day', y='jumps',
|
| 152 |
+
trendline='rolling',
|
| 153 |
+
trendline_options=dict(window=7),
|
| 154 |
+
trendline_color_override="goldenrod",
|
| 155 |
+
trendline_scope='overall',
|
| 156 |
+
template="plotly_dark")
|
| 157 |
|
| 158 |
+
return f"## Total Jumps: {total_jumps:,}", total, avg, total_map, jumps_over_time, county_map, per_day_plot
|
| 159 |
|
| 160 |
|
| 161 |
with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
|
|
|
|
| 165 |
map_fig = gr.Plot(label="Map")
|
| 166 |
with gr.Row():
|
| 167 |
county_map = gr.Plot(label="US Map")
|
| 168 |
+
with gr.Row():
|
| 169 |
+
per_day_plot = gr.Plot(label="Jumps per Day")
|
| 170 |
with gr.Row():
|
| 171 |
jumps_over_time = gr.Plot(label="Jumps Over Time")
|
| 172 |
with gr.Row():
|
|
|
|
| 174 |
with gr.Row():
|
| 175 |
avg_plot = gr.Plot(label="Average Jumps per Day")
|
| 176 |
|
| 177 |
+
outputs = [total_jumps_label, total_plot, avg_plot, map_fig, jumps_over_time, county_map, per_day_plot]
|
| 178 |
dep = demo.load(full_report, None, outputs)
|
| 179 |
|
| 180 |
if __name__ == "__main__":
|