Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,6 @@ with g.subgraph(name='cluster_MN') as c:
|
|
30 |
# Render the graph using streamlit
|
31 |
st.graphviz_chart(g)
|
32 |
|
33 |
-
|
34 |
-
|
35 |
def render_hospital_graph(hospital):
|
36 |
g = gv.Graph(format='svg')
|
37 |
g.graph_attr['bgcolor'] = '#FFFFFF'
|
@@ -53,22 +51,5 @@ def render_hospital_graph(hospital):
|
|
53 |
s1.attr(fontsize='10')
|
54 |
s1.node(hospital[3])
|
55 |
|
56 |
-
g.
|
57 |
-
st.
|
58 |
-
|
59 |
-
# Define hospitals data
|
60 |
-
hospitals = [('Allina Health', 'Abbott Northwestern Hospital', 'Beds: 627', 'Specialties: Cardiovascular care, neurosciences, cancer care'),
|
61 |
-
('Fairview Health Services', 'University of Minnesota Medical Center', 'Beds: 914', 'Specialties: Cancer care, transplant services, orthopedics'),
|
62 |
-
('HealthPartners', 'Regions Hospital', 'Beds: 454', 'Specialties: Level I Trauma Center, heart care, cancer care'),
|
63 |
-
('Mayo Clinic', 'Saint Marys Hospital', 'Beds: 1,265', 'Specialties: Cardiology, neurology, gastroenterology'),
|
64 |
-
('CentraCare', 'St. Cloud Hospital', 'Beds: 489', 'Specialties: Cancer care, heart care, neuroscience'),
|
65 |
-
('Essentia Health', 'St. Mary’s Medical Center', 'Beds: 330', 'Specialties: Cancer care, heart care, orthopedics'),
|
66 |
-
('Hennepin Healthcare', 'HCMC', 'Beds: 497', 'Specialties: Level I Trauma Center, burn center, cancer care'),
|
67 |
-
("Children's Minnesota", "Children's Hospitals and Clinics of Minnesota", 'Beds: 381', 'Specialties: Pediatrics, heart care, neonatology'),
|
68 |
-
('Sanford Health', 'Sanford Bemidji Medical Center', 'Beds: 161', 'Specialties: Cancer care, heart care, orthopedics'),
|
69 |
-
("St. Luke's Hospital", "St. Luke's Hospital", 'Beds: 267', 'Specialties: Cancer care, heart care, orthopedics')]
|
70 |
-
|
71 |
-
# Render a separate graph for each hospital
|
72 |
-
for hospital in hospitals:
|
73 |
-
render_hospital_graph(hospital)
|
74 |
-
|
|
|
30 |
# Render the graph using streamlit
|
31 |
st.graphviz_chart(g)
|
32 |
|
|
|
|
|
33 |
def render_hospital_graph(hospital):
|
34 |
g = gv.Graph(format='svg')
|
35 |
g.graph_attr['bgcolor'] = '#FFFFFF'
|
|
|
51 |
s1.attr(fontsize='10')
|
52 |
s1.node(hospital[3])
|
53 |
|
54 |
+
svg_output = g.pipe(format='svg')
|
55 |
+
st.image(svg_output, output_format='SVG')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|