Spaces:
Runtime error
Runtime error
import streamlit as st | |
import graphviz as gv | |
from graphviz import Graph | |
# Define the cluster relations graph using gvmap | |
g = Graph(format='svg') | |
g.graph_attr['bgcolor'] = '#FFFFFF' | |
g.graph_attr['outputorder'] = 'edgesfirst' | |
g.graph_attr['size'] = '10,10' | |
g.node_attr['style'] = 'filled' | |
g.node_attr['shape'] = 'box' | |
g.node_attr['fillcolor'] = '#FFDAB9' | |
with g.subgraph(name='cluster_WI') as c: | |
c.graph_attr['bgcolor'] = '#ADD8E6' | |
c.node_attr['color'] = '#000000' | |
c.node_attr['fontcolor'] = '#000000' | |
c.attr(label='Wisconsin', fontsize='24') | |
c.node('Aurora Health Care', URL='https://www.aurorahealthcare.org/', target='_blank', tooltip='Aurora Health Care: St. Luke\'s Medical Center') | |
c.node('Froedtert & the Medical College of Wisconsin', URL='https://www.froedtert.com/', target='_blank', tooltip='Froedtert & the Medical College of Wisconsin: Froedtert Hospital') | |
c.node('Ascension Wisconsin', URL='https://healthcare.ascension.org/', target='_blank', tooltip='Ascension Wisconsin: St. Vincent Hospital') | |
c.node('Gundersen Health System', URL='https://www.gundersenhealth.org/', target='_blank', tooltip='Gundersen Health System: Gundersen Lutheran Medical Center') | |
c.node('SSM Health', URL='https://www.ssmhealth.com/', target='_blank', tooltip='SSM Health: St. Mary\'s Hospital Medical Center') | |
c.node('UW Health', URL='https://www.uwhealth.org/', target='_blank', tooltip='UW Health: University of Wisconsin Hospital') | |
# Render the graph using streamlit | |
st.graphviz_chart(g) | |
import folium | |
from streamlit_folium import folium_static | |
# Define hospitals data | |
hospitals = [('Aurora Health Care', "St. Luke's Medical Center", 45.408882, -91.639479), | |
('Froedtert & the Medical College of Wisconsin', 'Froedtert Hospital', 43.038614, -88.231983), | |
('Ascension Wisconsin', 'St. Vincent Hospital', 44.461670, -88.074355), | |
('Gundersen Health System', 'Gundersen Lutheran Medical Center', 43.805459, -91.253002), | |
('SSM Health', "St. Mary's Hospital Medical Center", 44.477875, -88.045661), | |
('UW Health', 'University of Wisconsin Hospital', 43.076405, -89.414401)] | |
# Create a map centered on Wisconsin | |
m = folium.Map(location=[44.5, -89.5], zoom_start=7) | |
# Add markers for each hospital | |
for hospital in hospitals: | |
folium.Marker( | |
location=[hospital[2], hospital[3]], | |
popup=f'{hospital[1]}<br>{hospital[2]},{hospital[3]}' | |
).add_to(m) | |
# Display the map in Streamlit | |
folium_static(m) | |