File size: 3,200 Bytes
ff4b330
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import streamlit as st
import pandas as pd
import altair as alt

# Define list of largest hospitals with latitude and longitude
largest_hospitals = [
    {
        'name': 'Florida Hospital Orlando',
        'city': 'Orlando',
        'state': 'FL',
        'zip_code': '32803',
        'bed_count': 2411,
        'lat': 28.562229,
        'lng': -81.362976
    },
    {
        'name': 'Cleveland Clinic',
        'city': 'Cleveland',
        'state': 'OH',
        'zip_code': '44195',
        'bed_count': 1730,
        'lat': 41.501669,
        'lng': -81.621275
    },
    {
        'name': 'Mayo Clinic',
        'city': 'Rochester',
        'state': 'MN',
        'zip_code': '55905',
        'bed_count': 1372,
        'lat': 44.020634,
        'lng': -92.463476
    },
    {
        'name': 'NewYork-Presbyterian Hospital-Columbia and Cornell',
        'city': 'New York',
        'state': 'NY',
        'zip_code': '10032',
        'bed_count': 2332,
        'lat': 40.840886,
        'lng': -73.942184
    },
    {
        'name': 'UCHealth University of Colorado Hospital',
        'city': 'Aurora',
        'state': 'CO',
        'zip_code': '80045',
        'bed_count': 672,
        'lat': 39.742401,
        'lng': -104.834694
    },
    {
        'name': 'Houston Methodist Hospital',
        'city': 'Houston',
        'state': 'TX',
        'zip_code': '77030',
        'bed_count': 1063,
        'lat': 29.710292,
        'lng': -95.399262
    },
    {
        'name': 'Johns Hopkins Hospital',
        'city': 'Baltimore',
        'state': 'MD',
        'zip_code': '21287',
        'bed_count': 1293,
        'lat': 39.297082,
        'lng': -76.590726
    },
    {
        'name': 'Massachusetts General Hospital',
        'city': 'Boston',
        'state': 'MA',
        'zip_code': '02114',
        'bed_count': 1032,
        'lat': 42.363371,
        'lng': -71.068635
    },
    {
        'name': 'University of Michigan Hospitals-Michigan Medicine',
        'city': 'Ann Arbor',
        'state': 'MI',
        'zip_code': '48109',
        'bed_count': 1145,
        'lat': 42.282531,
        'lng': -83.728376
    },
    {
        'name': 'Mount Sinai Hospital',
        'city': 'New York',
        'state': 'NY',
        'zip_code': '10029',
        'bed_count': 1168,
        'lat': 40.789866,
        'lng': -73.952348
    }
]

# Convert list of largest hospitals to a Pandas DataFrame
largest_hospitals_df = pd.DataFrame(largest_hospitals)

# Define chart functions
def map_chart():
    chart = alt.Chart(largest_hospitals_df).mark_circle().encode(
        longitude='lng:Q',
        latitude='lat:Q',
        size=alt.Size('bed_count:Q', title='Bed Count'),
        color=alt.Color('state:N', legend=alt.Legend(title='State')),
        tooltip=['name', 'bed_count', 'city', 'state']
    ).properties(
        width=700,
        height=500,
        title='Location of Largest Hospitals in the US'
    )
    st.altair_chart(chart)

# Define chart buttons
st.sidebar.header('Select a Chart')
chart_options = ['Map Chart']
chart_choice = st.sidebar.selectbox('', chart_options)

# Call chart functions based on user input
if chart_choice == 'Map Chart':
    map_chart()