Update app.py
Browse files
app.py
CHANGED
@@ -92,6 +92,10 @@ import streamlit as st
|
|
92 |
import pandas as pd
|
93 |
import plotly.express as px
|
94 |
from datetime import datetime
|
|
|
|
|
|
|
|
|
95 |
|
96 |
# Load data
|
97 |
@st.cache_data
|
@@ -134,10 +138,16 @@ filtered_df = df[(df['date'] >= pd.Timestamp(date_range[0])) & (df['date'] <= pd
|
|
134 |
|
135 |
# Main content
|
136 |
st.header("Research Papers Timeline")
|
137 |
-
|
|
|
|
|
|
|
|
|
138 |
fig.update_yaxes(autorange="reversed")
|
139 |
st.plotly_chart(fig)
|
140 |
|
|
|
|
|
141 |
st.header("Paper Details")
|
142 |
selected_paper = st.selectbox("Select a paper", filtered_df['title'])
|
143 |
paper_details = filtered_df[filtered_df['title'] == selected_paper].iloc[0]
|
@@ -207,5 +217,4 @@ st.plotly_chart(fig)
|
|
207 |
# Footer
|
208 |
st.markdown("---")
|
209 |
st.write("Data last updated: March 2024")
|
210 |
-
|
211 |
|
|
|
92 |
import pandas as pd
|
93 |
import plotly.express as px
|
94 |
from datetime import datetime
|
95 |
+
import streamlit as st
|
96 |
+
import pandas as pd
|
97 |
+
import plotly.express as px
|
98 |
+
from datetime import datetime, timedelta
|
99 |
|
100 |
# Load data
|
101 |
@st.cache_data
|
|
|
138 |
|
139 |
# Main content
|
140 |
st.header("Research Papers Timeline")
|
141 |
+
|
142 |
+
# Add a day to the date to create an end date for the timeline
|
143 |
+
filtered_df['end_date'] = filtered_df['date'] + timedelta(days=1)
|
144 |
+
|
145 |
+
fig = px.timeline(filtered_df, x_start="date", x_end="end_date", y="title", color="authors", hover_name="title")
|
146 |
fig.update_yaxes(autorange="reversed")
|
147 |
st.plotly_chart(fig)
|
148 |
|
149 |
+
# Rest of the code remains the same...
|
150 |
+
|
151 |
st.header("Paper Details")
|
152 |
selected_paper = st.selectbox("Select a paper", filtered_df['title'])
|
153 |
paper_details = filtered_df[filtered_df['title'] == selected_paper].iloc[0]
|
|
|
217 |
# Footer
|
218 |
st.markdown("---")
|
219 |
st.write("Data last updated: March 2024")
|
|
|
220 |
|