awacke1 commited on
Commit
db0a0f4
·
1 Parent(s): 1cb0f1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -31,10 +31,6 @@ with g.subgraph(name='cluster_MN') as c:
31
  st.graphviz_chart(g)
32
 
33
 
34
-
35
- import streamlit as st
36
- import graphviz as gv
37
-
38
  def render_hospital_graph(hospital):
39
  g = gv.Graph(format='svg')
40
  g.graph_attr['bgcolor'] = '#FFFFFF'
@@ -57,7 +53,7 @@ def render_hospital_graph(hospital):
57
  s1.node(hospital[3])
58
 
59
  svg_output = g.pipe(format='svg')
60
- st.image(svg_output, output_format='SVG')
61
 
62
  # Define hospitals data
63
  hospitals = [('Allina Health', 'Abbott Northwestern Hospital', 'Beds: 627', 'Specialties: Cardiovascular care, neurosciences, cancer care'),
@@ -73,9 +69,8 @@ hospitals = [('Allina Health', 'Abbott Northwestern Hospital', 'Beds: 627', 'Spe
73
 
74
  # Render a separate graph for each hospital
75
  for hospital in hospitals:
76
- render_hospital_graph(hospital)
77
-
78
-
79
 
80
 
81
 
 
31
  st.graphviz_chart(g)
32
 
33
 
 
 
 
 
34
  def render_hospital_graph(hospital):
35
  g = gv.Graph(format='svg')
36
  g.graph_attr['bgcolor'] = '#FFFFFF'
 
53
  s1.node(hospital[3])
54
 
55
  svg_output = g.pipe(format='svg')
56
+ return svg_output
57
 
58
  # Define hospitals data
59
  hospitals = [('Allina Health', 'Abbott Northwestern Hospital', 'Beds: 627', 'Specialties: Cardiovascular care, neurosciences, cancer care'),
 
69
 
70
  # Render a separate graph for each hospital
71
  for hospital in hospitals:
72
+ svg_output = render_hospital_graph(hospital)
73
+ st.write(svg_output, unsafe_allow_html=True)
 
74
 
75
 
76