awacke1 commited on
Commit
0100187
·
1 Parent(s): b0d40a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -0
app.py CHANGED
@@ -28,3 +28,42 @@ with g.subgraph(name='cluster_MN') as c:
28
 
29
  # Render the graph using streamlit
30
  st.graphviz_chart(g)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  # Render the graph using streamlit
30
  st.graphviz_chart(g)
31
+
32
+
33
+ # Define the cluster relations graph using gvmap
34
+ g = Graph(format='svg')
35
+ g.graph_attr['bgcolor'] = '#FFFFFF'
36
+ g.graph_attr['outputorder'] = 'edgesfirst'
37
+ g.graph_attr['size'] = '10,10'
38
+ g.node_attr['style'] = 'filled'
39
+ g.node_attr['shape'] = 'box'
40
+ g.node_attr['fillcolor'] = '#FFDAB9'
41
+
42
+ with g.subgraph(name='cluster_MN') as c:
43
+ c.graph_attr['bgcolor'] = '#ADD8E6'
44
+ c.node_attr['color'] = '#000000'
45
+ c.node_attr['fontcolor'] = '#000000'
46
+ c.attr(label='Minnesota', fontsize='24')
47
+ for hospital in [('Allina Health', 'Abbott Northwestern Hospital', 'Beds: 627', 'Specialties: Cardiovascular care, neurosciences, cancer care'),
48
+ ('Fairview Health Services', 'University of Minnesota Medical Center', 'Beds: 914', 'Specialties: Cancer care, transplant services, orthopedics'),
49
+ ('HealthPartners', 'Regions Hospital', 'Beds: 454', 'Specialties: Level I Trauma Center, heart care, cancer care'),
50
+ ('Mayo Clinic', 'Saint Marys Hospital', 'Beds: 1,265', 'Specialties: Cardiology, neurology, gastroenterology'),
51
+ ('CentraCare', 'St. Cloud Hospital', 'Beds: 489', 'Specialties: Cancer care, heart care, neuroscience'),
52
+ ('Essentia Health', 'St. Mary’s Medical Center', 'Beds: 330', 'Specialties: Cancer care, heart care, orthopedics'),
53
+ ('Hennepin Healthcare', 'HCMC', 'Beds: 497', 'Specialties: Level I Trauma Center, burn center, cancer care'),
54
+ ("Children's Minnesota", "Children's Hospitals and Clinics of Minnesota", 'Beds: 381', 'Specialties: Pediatrics, heart care, neonatology'),
55
+ ('Sanford Health', 'Sanford Bemidji Medical Center', 'Beds: 161', 'Specialties: Cancer care, heart care, orthopedics'),
56
+ ("St. Luke's Hospital", "St. Luke's Hospital", 'Beds: 267', 'Specialties: Cancer care, heart care, orthopedics')]:
57
+ hospital_name, hospital_desc, bed_count, specialties = hospital
58
+ with c.subgraph(name=f'cluster_{hospital_name}') as s:
59
+ s.attr(label=hospital_name, fontsize='16')
60
+ s.node(hospital_desc, fontsize='12')
61
+ with s.subgraph(name=f'cluster_{hospital_desc}') as s1:
62
+ s1.attr(fontsize='10')
63
+ s1.node(bed_count)
64
+ s1.node(specialties)
65
+
66
+ # Render the graph using streamlit
67
+ st.graphviz_chart(g)
68
+
69
+