Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -145,15 +145,16 @@ def main():
|
|
145 |
|
146 |
if any(votes.values()):
|
147 |
with col1:
|
148 |
-
|
149 |
-
'
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
153 |
height=250,
|
154 |
title="Vote Counts",
|
155 |
toolbar_location=None)
|
156 |
-
p.vbar(x='
|
157 |
p.xaxis.major_label_orientation = 1.2
|
158 |
st.bokeh_chart(p)
|
159 |
|
|
|
145 |
|
146 |
if any(votes.values()):
|
147 |
with col1:
|
148 |
+
df = pd.DataFrame([
|
149 |
+
{'name': i["name"], 'votes': i["votes"]}
|
150 |
+
for i in items if votes[i["url"]] > 0
|
151 |
+
])
|
152 |
+
|
153 |
+
p = figure(x_range=df['name'].tolist(),
|
154 |
height=250,
|
155 |
title="Vote Counts",
|
156 |
toolbar_location=None)
|
157 |
+
p.vbar(x='name', top='votes', width=0.9, source=df)
|
158 |
p.xaxis.major_label_orientation = 1.2
|
159 |
st.bokeh_chart(p)
|
160 |
|