Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -66,54 +66,3 @@ with g.subgraph(name='cluster_MN') as c:
|
|
66 |
# Render the graph using streamlit
|
67 |
st.graphviz_chart(g)
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
import streamlit as st
|
75 |
-
from graphviz import Graph
|
76 |
-
|
77 |
-
# Define the cluster relations graph using gvmap
|
78 |
-
g = Graph(format='svg')
|
79 |
-
g.graph_attr['bgcolor'] = '#FFFFFF'
|
80 |
-
g.graph_attr['outputorder'] = 'edgesfirst'
|
81 |
-
g.graph_attr['size'] = '10,10'
|
82 |
-
g.node_attr['style'] = 'filled'
|
83 |
-
g.node_attr['shape'] = 'box'
|
84 |
-
g.node_attr['fillcolor'] = '#FFDAB9'
|
85 |
-
|
86 |
-
hospitals = [('Allina Health', 'Abbott Northwestern Hospital', 'Beds: 627', 'Specialties: Cardiovascular care, neurosciences, cancer care'),
|
87 |
-
('Fairview Health Services', 'University of Minnesota Medical Center', 'Beds: 914', 'Specialties: Cancer care, transplant services, orthopedics'),
|
88 |
-
('HealthPartners', 'Regions Hospital', 'Beds: 454', 'Specialties: Level I Trauma Center, heart care, cancer care'),
|
89 |
-
('Mayo Clinic', 'Saint Marys Hospital', 'Beds: 1,265', 'Specialties: Cardiology, neurology, gastroenterology'),
|
90 |
-
('CentraCare', 'St. Cloud Hospital', 'Beds: 489', 'Specialties: Cancer care, heart care, neuroscience'),
|
91 |
-
('Essentia Health', 'St. Mary’s Medical Center', 'Beds: 330', 'Specialties: Cancer care, heart care, orthopedics'),
|
92 |
-
('Hennepin Healthcare', 'HCMC', 'Beds: 497', 'Specialties: Level I Trauma Center, burn center, cancer care'),
|
93 |
-
("Children's Minnesota", "Children's Hospitals and Clinics of Minnesota", 'Beds: 381', 'Specialties: Pediatrics, heart care, neonatology'),
|
94 |
-
('Sanford Health', 'Sanford Bemidji Medical Center', 'Beds: 161', 'Specialties: Cancer care, heart care, orthopedics'),
|
95 |
-
("St. Luke's Hospital", "St. Luke's Hospital", 'Beds: 267', 'Specialties: Cancer care, heart care, orthopedics')]
|
96 |
-
|
97 |
-
# Create subgraph for each hospital
|
98 |
-
for hospital in hospitals:
|
99 |
-
hospital_name, hospital_desc, bed_count, specialties = hospital
|
100 |
-
with g.subgraph(name=f'cluster_{hospital_name}') as s:
|
101 |
-
s.attr(label=hospital_name, fontsize='24')
|
102 |
-
s.node(hospital_desc, fontsize='14')
|
103 |
-
with s.subgraph(name=f'cluster_{hospital_desc}') as s1:
|
104 |
-
s1.attr(fontsize='12')
|
105 |
-
s1.node(bed_count)
|
106 |
-
s1.node(specialties)
|
107 |
-
|
108 |
-
# Render the graphs for each hospital separately
|
109 |
-
for hospital in hospitals:
|
110 |
-
hospital_name = hospital[0]
|
111 |
-
st.header(hospital_name)
|
112 |
-
subgraph = g.subgraph(f'cluster_{hospital_name}')
|
113 |
-
chart = st.graphviz_chart(subgraph.to_string())
|
114 |
-
chart.graphviz_chart_format = "svg"
|
115 |
-
st.write(chart, unsafe_allow_html=True)
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
66 |
# Render the graph using streamlit
|
67 |
st.graphviz_chart(g)
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|