chaisty commited on
Commit
039581c
1 Parent(s): 824d556

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +96 -0
app.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Hugging Face's logo
2
+ Hugging Face
3
+ Search models, datasets, users...
4
+ Models
5
+ Datasets
6
+ Spaces
7
+ Docs
8
+ Solutions
9
+ Pricing
10
+
11
+
12
+
13
+ Spaces:
14
+
15
+ awacke1
16
+ /
17
+ VizLib-TopLargeHospitalsNewJersey-03-09-2023 Copied
18
+ like
19
+ 0
20
+ App
21
+ Files and versions
22
+ Community
23
+ VizLib-TopLargeHospitalsNewJersey-03-09-2023
24
+ /
25
+ app.py
26
+ awacke1's picture
27
+ awacke1
28
+ Upload 2 files
29
+ ffc8812
30
+ less than a minute ago
31
+ raw
32
+ history
33
+ blame
34
+ contribute
35
+ delete
36
+ No virus
37
+ 3.79 kB
38
+ import streamlit as st
39
+ import graphviz as gv
40
+ from graphviz import Graph
41
+ import folium
42
+ from streamlit_folium import folium_static
43
+
44
+ # Define the cluster relations graph using gvmap
45
+ g = Graph(format='svg')
46
+ g.graph_attr['bgcolor'] = '#FFFFFF'
47
+ g.graph_attr['outputorder'] = 'edgesfirst'
48
+ g.graph_attr['size'] = '10,10'
49
+ g.node_attr['style'] = 'filled'
50
+ g.node_attr['shape'] = 'box'
51
+ g.node_attr['fillcolor'] = '#FFDAB9'
52
+
53
+ with g.subgraph(name='cluster_NJ') as c:
54
+ c.graph_attr['bgcolor'] = '#ADD8E6'
55
+ c.node_attr['color'] = '#000000'
56
+ c.node_attr['fontcolor'] = '#000000'
57
+ c.attr(label='New Jersey', fontsize='24')
58
+ c.node('Hackensack Meridian Health', URL='https://www.hackensackmeridianhealth.org/', target='_blank', tooltip='Hackensack Meridian Health: Hackensack University Medical Center')
59
+ c.node('RWJBarnabas Health', URL='https://www.rwjbh.org/', target='_blank', tooltip='RWJBarnabas Health: Robert Wood Johnson University Hospital')
60
+ c.node('Atlantic Health System', URL='https://www.atlantichealth.org/', target='_blank', tooltip='Atlantic Health System: Morristown Medical Center')
61
+ c.node('Virtua Health', URL='https://www.virtua.org/', target='_blank', tooltip='Virtua Health: Virtua Memorial Hospital')
62
+ c.node('Inspira Health', URL='https://www.inspirahealthnetwork.org/', target='_blank', tooltip='Inspira Health: Inspira Medical Center Vineland')
63
+ c.node('Cooper University Health Care', URL='https://www.cooperhealth.org/', target='_blank', tooltip='Cooper University Health Care: Cooper University Hospital')
64
+ c.node('University Hospital', URL='https://www.uhnj.org/', target='_blank', tooltip='University Hospital: University Hospital')
65
+ c.node('Robert Wood Johnson University Hospital Hamilton', URL='https://www.rwjbh.org/robert-wood-johnson-university-hospital-hamilton/', target='_blank', tooltip='Robert Wood Johnson University Hospital Hamilton: Robert Wood Johnson University Hospital Hamilton')
66
+ c.node('Trinitas Regional Medical Center', URL='https://www.trinitasrmc.org/', target='_blank', tooltip='Trinitas Regional Medical Center: Trinitas Regional Medical Center')
67
+ c.node('Capital Health Regional Medical Center', URL='https://www.capitalhealth.org/', target='_blank', tooltip='Capital Health Regional Medical Center: Capital Health Regional Medical Center')
68
+
69
+ # Render the graph using streamlit
70
+ st.graphviz_chart(g)
71
+
72
+ # Define hospitals data
73
+ hospitals = [('Hackensack Meridian Health', 'Hackensack University Medical Center', 40.899886, -74.039179),
74
+ ('RWJBarnabas Health', 'Robert Wood Johnson University Hospital', 40.491301, -74.450611),
75
+ ('Atlantic Health System', 'Morristown Medical Center', 40.787231, -74.473851),
76
+ ('Virtua Health', 'Virtua Memorial Hospital', 39.931229, -75.025831),
77
+ ('Inspira Health', 'Inspira Medical Center Vineland', 39.460225, -75.035542),
78
+ ('Cooper University Health Care', 'Cooper University Hospital', 39.942743, -75.119090),
79
+ ('University Hospital', 'University Hospital', 40.742310, -74.177609),
80
+ ('Robert Wood Johnson University Hospital Hamilton', 'Robert Wood Johnson University Hospital Hamilton', 40.214008, -74.679619),
81
+ ('Trinitas Regional Medical Center', 'Trinitas Regional Medical Center', 40.661474, -74.215013),
82
+ ('Capital Health Regional Medical Center', 'Capital Health Regional Medical Center', 40.266778, -74.796452)]
83
+
84
+ #Create a map centered on New Jersey
85
+ m = folium.Map(location=[40.0583, -74.4057], zoom_start=8)
86
+
87
+ #Add markers for each hospital
88
+ for hospital in hospitals:
89
+ folium.Marker(
90
+ location=[hospital[2], hospital[3]],
91
+ popup=f'{hospital[1]}<br>{hospital[2]},{hospital[3]}'
92
+ ).add_to(m)
93
+
94
+ #Display the map in Streamlit
95
+ folium_static(m)
96
+