File size: 9,861 Bytes
0e1662c
1ba601f
ac0345f
1ba601f
957aadb
 
6283ef6
 
 
 
 
 
0e1662c
1ba601f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3b1655c
a7a4739
949894c
 
a7a4739
 
949894c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a7a4739
 
 
 
949894c
 
 
 
7ab32f6
 
 
 
 
 
 
a7a4739
7ab32f6
2232114
957aadb
 
 
 
 
 
 
 
7ab32f6
6283ef6
82efd8d
 
 
 
 
 
 
 
2232114
7ab32f6
1ba601f
6907b9a
1ba601f
 
814d3fc
1ba601f
 
 
aebb899
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1ba601f
aebb899
 
 
 
 
 
a20156e
 
 
 
6283ef6
a20156e
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import streamlit as st
import streamlit.components.v1 as components
import geopandas as gpd
import matplotlib.pyplot as plt
import plotly.express as px
import json
import geopandas as gpd
import matplotlib.pyplot as plt
import streamlit as st
import json
import plotly.express as px


# Function to generate HTML with textarea for speech synthesis
def generate_speech_textarea(text_to_speak):
    documentHTML5 = '''
    <!DOCTYPE html>
    <html>
    <head>
        <title>Read It Aloud</title>
        <script type="text/javascript">
            function readAloud() {{
                const text = document.getElementById("textArea").value;
                const speech = new SpeechSynthesisUtterance(text);
                window.speechSynthesis.speak(speech);
            }}
        </script>
    </head>
    <body>
        <h1>πŸ”Š Read It Aloud</h1>
        <textarea id="textArea" rows="10" cols="80" readonly>'''
    documentHTML5 = documentHTML5 + text_to_speak
    documentHTML5 = documentHTML5 + '''
        </textarea>
        <br>
        <button onclick="readAloud()">πŸ”Š Read Aloud</button>
    </body>
    </html>
    '''
    components.html(documentHTML5, width=1280, height=500)


import streamlit as st

def ListMaps():
    MapInfo = """
        ## 🌍 Map Techniques to Understand Various Aspects
        - **General Mapping Techniques**
          - πŸ—ΊοΈ [US States](https://huggingface.co/spaces/awacke1/USStates)
          - 🌐 [World Area PyDeck](https://huggingface.co/spaces/awacke1/StreamlitPydeckMapVisualViewStateForLatitudeLongitude)
          - πŸ“Š [US Corporation Map and CSV Location Data Loader](https://huggingface.co/spaces/awacke1/UnitedStatesMapAIandNLP)
          - πŸ“ˆ [US Taxonomy Datasets](https://huggingface.co/spaces/awacke1/NPI-Provider-Map-By-Taxonomy-Search)
          - πŸ” [City, State - Latitude and Longitude Search](https://huggingface.co/spaces/awacke1/Google-Maps-Web-Service-Py) (try Mound, MN)

        ## πŸ₯ Medical Centers and Hospitals in US States
        - **Minnesota**
          - πŸ₯ [State of MN Med Centers](https://huggingface.co/spaces/awacke1/Minnesota-Medical-Centers-Streamlit)
          - 🏨 [State of MN: Hospital Details](https://huggingface.co/spaces/awacke1/MN.Map.Hospitals.Top.Five)
        - **Massachusetts**
          - πŸ₯ [State of MA Medical Centers](https://huggingface.co/spaces/awacke1/Streamlit-Google-Maps-Massachusetts)
          - πŸš‘ [State of MA Reliant](https://huggingface.co/spaces/awacke1/Streamlit-Google-Maps-Reliant)
        - **California**
          - πŸ₯ [State of CA Medical Centers](https://huggingface.co/spaces/awacke1/Streamlit-Google-Maps-California)
          - 🏨 [State of CA Hospital Details](https://huggingface.co/spaces/awacke1/California-Medical-Centers-Streamlit)
          - 🏞️ [State of CA Attractions](https://huggingface.co/spaces/awacke1/Map-California-AI)
        - **Texas**
          - πŸ₯ [State of TX Medical Centers](https://huggingface.co/spaces/awacke1/Streamlit-Google-Maps-Texas)
        - **New Jersey**
          - πŸ₯ [State of NJ Hospitals](https://huggingface.co/spaces/awacke1/VizLib-TopLargeHospitalsNewJersey)

        ## 🌌 Mythical and Historical Locations
        - **Iceland**
          - 🏰 [Iceland Myth Places and Routes](https://huggingface.co/spaces/awacke1/Maps.Markers.Honor.Iceland)

        ## πŸ‡ΊπŸ‡Έ Specific US Data Searches
        - **NPI Registry Mental Health Provider Search**
          - 🧠 [NPI Registry Mental Health Provider Search and Cluster Map](https://huggingface.co/spaces/awacke1/Gradio-Maps-Latitude-Longitude)
        - **US City Specific Information**
          - πŸŒƒ [US City FIPS code, Location, Population](https://huggingface.co/spaces/awacke1/CityFipsLocationandPopulation)
    """
    st.markdown(MapInfo)
    return MapInfo

# Call the function to display the maps
ListMaps()


# States and Icons
states = ['MN', 'CA', 'WA', 'FL', 'TX', 'NY', 'NV']
icons = ['πŸ¦†', '🌴', '🍎', '🌞', '🀠', 'πŸ—½', '🎰']
state_names = {
    'MN': 'Minnesota', 'CA': 'California', 'WA': 'Washington',
    'FL': 'Florida', 'TX': 'Texas', 'NY': 'New York', 'NV': 'Nevada'
}  

# Plot a State
def plot_state_outline(state_code, us_states_geojson, state_names):
    state_name = state_names.get(state_code, 'Unknown')
    fig = px.choropleth(locations=[state_name], geojson=us_states_geojson,
                        featureidkey="properties.NAME",
                        projection="mercator")
    fig.update_geos(fitbounds="locations", visible=False)
    fig.update_layout(title=f"{state_name} State Outline")
    st.plotly_chart(fig)

# Plot a List of States
us_states_geojson = "" # Reuse as Property
def PlotOutlines():
    geojson_path = 'gz_2010_us_040_00_500k.json'
    with open(geojson_path, 'r') as file:
        us_states_geojson = json.load(file)
    for state, icon in zip(states, icons):
        st.write(f"{icon} {state}")
        plot_state_outline(state, us_states_geojson, state_names)
    return us_states_geojson

# Main
st.title('U.S. States Trivia πŸ—ΊοΈ')

for i, (state, icon) in enumerate(zip(states, icons)):
    st.markdown(f"{i + 1}. {state} {icon}")

    # Expanders for each state to outline fascinating facts
    with st.expander(f"See Fascinating Facts about {state}"):
        text_to_speak = ""
                
        if state == 'MN':
            text_to_speak = """πŸ¦† **Minnesota** 
                               🏞️ Known as the 'Land of 10,000 Lakes' 
                               🎣 Famous for its fishing 
                               πŸ›Ά Boundary Waters offers incredible canoeing 
                               πŸŽ“ Home to prestigious colleges 
                               ❄️ Cold winters but lovely summers
                               πŸŒ† Largest city: Minneapolis
                               🐟 Walleye: The state fish
                               🏈 Home to the Minnesota Vikings."""
        elif state == 'CA':
            text_to_speak = """🌴 **California** 
                               πŸŒ‰ Home to the Golden Gate Bridge 
                               🎬 Center of the American entertainment industry 
                               πŸ‡ Famous for Napa Valley's wine 
                               🌲 Home to Redwood National Park 
                               πŸ„β€β™€οΈ Excellent beaches and surf spots
                               🏞️ Yosemite National Park: A natural wonder
                               🌡 Death Valley: The hottest and driest area."""
        elif state == 'WA':
            text_to_speak = """🍎 **Washington** 
                               β˜• Known for its coffee culture 
                               πŸ—» Home to Mount Rainier 
                               🍏 Leading apple-producing state 
                               🐟 Rich in seafood, especially salmon 
                               🌧️ Known for its rainy weather
                               🌲 Olympic National Park: Diverse ecosystems
                               🌐 Seattle: A tech hub and major city."""
        elif state == 'FL':
            text_to_speak = """🌞 **Florida** 
                               🏝️ Famous for its beaches 
                               🎒 Home to various amusement parks like Disney World 
                               πŸš€ Space launches from Cape Canaveral 
                               🐊 Known for the Everglades and alligators 
                               🍊 Major orange producer
                               🌊 The Keys: A series of tropical islands
                               🏰 Miami: Known for its vibrant culture and nightlife."""
        elif state == 'TX':
            text_to_speak = """🀠 **Texas** 
                               πŸ›’οΈ Known for its oil and gas industry 
                               πŸ– Famous for its barbecue 
                               🎸 Rich musical heritage 
                               πŸ„ Home to many cattle ranches 
                               🌡 Includes part of the Chihuahuan Desert
                               🌌 Big Bend National Park: Stunning night skies
                               πŸŒƒ Houston: Home to NASA's Johnson Space Center."""
        elif state == 'NY':
            text_to_speak = """πŸ—½ **New York** 
                               πŸ™οΈ Home to New York City, the largest city in the U.S. 
                               🍎 Known as the Big Apple 
                               🎭 Major hub for arts and culture 
                               🏞️ Adirondack Mountains offer outdoor adventures 
                               πŸ• Famous for its style of pizza
                               🌊 Niagara Falls: A natural wonder
                               🏞️ Finger Lakes: Known for wineries and beautiful scenery."""
        elif state == 'NV':
            text_to_speak = """🎰 **Nevada** 
                               πŸŒ† Known for Las Vegas and its casinos 
                               🏜️ Includes part of the Mojave Desert 
                               πŸŽͺ Entertainment is a major industry 
                               πŸ’Ž Known for the Hoover Dam 
                               πŸ‘½ Area 51 is located here
                               🏞️ Lake Tahoe: A stunning freshwater lake
                               🌌 Great Basin National Park: Known for its ancient bristlecone pines."""
        
        st.markdown(text_to_speak)
        
        # plot_state_outline(state, us_states_geojson, state_names)
        
        if st.button(f"πŸ”Š Read {state}'s Facts Aloud"):
            generate_speech_textarea(text_to_speak)

# Display maps
MapInfo = ListMaps()
    
us_states_geojson = PlotOutlines()