-
-
Save isauravmanitripathi/f8cae51075e38ffec855d7454f322a3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PROCESSING & DISPLAY | |
def display(): | |
with st.container(): | |
st.write("#### Which cities and states have recorded the most accidents?") | |
res = computeQuery(query_8, graph) | |
fig = px.treemap(res, path=[px.Constant("U.S"), "state", "city"], values="count", hover_data=["state", "city","count"], | |
color="count", | |
color_continuous_scale='tealrose', | |
color_continuous_midpoint=np.average(res['count'], weights=res['count'])) | |
st.plotly_chart(fig, use_container_width=True) | |
with st.expander("Show query"): | |
st.code(query_8, language="sparql") | |
st.markdown("---") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment