Spaces:
Sleeping
Sleeping
Commit
·
cc9bf37
1
Parent(s):
4a989b6
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,6 @@ import math
|
|
| 8 |
|
| 9 |
st.set_page_config(layout="wide")
|
| 10 |
|
| 11 |
-
string1 = f"""<a href="https://www.nytimes.com/", target="_black">link</a>"""
|
| 12 |
-
|
| 13 |
g = Github(os.environ.get('github'))
|
| 14 |
|
| 15 |
inference_repo = g.get_repo("bigcode-project/bigcode-inference-benchmark")
|
|
@@ -51,24 +49,21 @@ fig.update_xaxes(ticks= "outside",
|
|
| 51 |
griddash='dot',
|
| 52 |
gridcolor='white')
|
| 53 |
)
|
| 54 |
-
# periods = pd.date_range(df[0]["Start"],df[0]["Finish"], freq='1D')
|
| 55 |
-
# center_pos = math.floor(len(periods) / 2)
|
| 56 |
-
# x_dates = periods[center_pos]
|
| 57 |
-
|
| 58 |
-
# fig.add_annotation({
|
| 59 |
-
# "x": x_dates,
|
| 60 |
-
# "y": 0,
|
| 61 |
-
# "text": string1,
|
| 62 |
-
# "align": "center",
|
| 63 |
-
# "showarrow":False,
|
| 64 |
-
# })
|
| 65 |
|
|
|
|
| 66 |
fig.update_layout(xaxis_range=[datetime.datetime(2022, 12, 30),
|
| 67 |
datetime.datetime(2023, 4, 2)])
|
| 68 |
-
fig.update_yaxes(automargin=True)
|
| 69 |
-
fig.layout.xaxis.rangeselector = None
|
| 70 |
-
|
| 71 |
-
fig.add_vline(x=datetime.datetime.now().strftime('%Y-%m-%d'), line_width=3, line_dash="dash", line_color="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
st.plotly_chart(fig, use_container_width=True)
|
| 74 |
-
|
|
|
|
| 8 |
|
| 9 |
st.set_page_config(layout="wide")
|
| 10 |
|
|
|
|
|
|
|
| 11 |
g = Github(os.environ.get('github'))
|
| 12 |
|
| 13 |
inference_repo = g.get_repo("bigcode-project/bigcode-inference-benchmark")
|
|
|
|
| 49 |
griddash='dot',
|
| 50 |
gridcolor='white')
|
| 51 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
+
# Set range
|
| 54 |
fig.update_layout(xaxis_range=[datetime.datetime(2022, 12, 30),
|
| 55 |
datetime.datetime(2023, 4, 2)])
|
| 56 |
+
fig.update_yaxes(automargin=True) # fix margins
|
| 57 |
+
fig.layout.xaxis.rangeselector = None # remove range selector on top
|
| 58 |
+
|
| 59 |
+
fig.add_vline(x=datetime.datetime.now().strftime('%Y-%m-%d'), line_width=3, line_dash="dash", line_color="black")
|
| 60 |
+
fig.add_annotation({
|
| 61 |
+
"x": datetime.datetime.now().strftime('%Y-%m-%d'),
|
| 62 |
+
"y": 2,
|
| 63 |
+
"text": "Today",
|
| 64 |
+
"align": "center",
|
| 65 |
+
"color": "black",
|
| 66 |
+
"showarrow":False,
|
| 67 |
+
})
|
| 68 |
|
| 69 |
+
st.plotly_chart(fig, use_container_width=True)
|
|
|