Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -319,19 +319,19 @@ def main():
|
|
| 319 |
st.plotly_chart(trend_fig, use_container_width=True)
|
| 320 |
|
| 321 |
with tab4:
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
|
| 336 |
|
| 337 |
if __name__ == "__main__":
|
|
|
|
| 319 |
st.plotly_chart(trend_fig, use_container_width=True)
|
| 320 |
|
| 321 |
with tab4:
|
| 322 |
+
# Dropdown for Unit Type selection
|
| 323 |
+
unit_type_pairs = set()
|
| 324 |
+
for _, row in df[['Unittype_One', 'Unittype_Two']].dropna().iterrows():
|
| 325 |
+
if row['Unittype_One'] != 'Driverless' or row['Unittype_Two'] != 'Driverless':
|
| 326 |
+
pair = ' vs '.join(sorted([row['Unittype_One'], row['Unittype_Two']]))
|
| 327 |
+
unit_type_pairs.add(pair)
|
| 328 |
+
unit_type_pairs = sorted(list(unit_type_pairs))
|
| 329 |
+
unit_type = st.selectbox("Select Unit Type Pair", options=['Total'] + unit_type_pairs)
|
| 330 |
+
|
| 331 |
+
# Create 5th Visualization: Injuries and fatalities chart
|
| 332 |
+
injuries_fatalities_chart = create_injuries_fatalities_chart(df, unit_type)
|
| 333 |
+
st.altair_chart(injuries_fatalities_chart, use_container_width=True)
|
| 334 |
+
st.markdown("#### TODO: add write-up for this 5th chart.")
|
| 335 |
|
| 336 |
|
| 337 |
if __name__ == "__main__":
|