fschwartzer commited on
Commit
0aa34d7
1 Parent(s): 88484cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -4
app.py CHANGED
@@ -11,6 +11,7 @@ from branca.colormap import LinearColormap
11
  import base64
12
  from io import BytesIO
13
  import sys
 
14
 
15
  # Print the Python version
16
  print("Python version")
@@ -154,7 +155,7 @@ evo_html = """
154
  </style>
155
  <a href='https://huggingface.co/spaces/DavidSB/avalia.EVO' target='_blank' style='text-decoration: none; color: inherit;'>
156
  <span style='color: gray; font-size: 20px;'>aval</span>
157
- <span style='color: white; font-size: 20px;'>ia</span>
158
  <span style='color: gray; font-size: 20px;'>.EVO</span>
159
  """
160
 
@@ -233,8 +234,8 @@ with st.sidebar:
233
  (data_tipo['Apriv'].between(apriv_min, apriv_max))]
234
 
235
  # Links to other apps at the bottom of the sidebar
236
- st.sidebar.markdown(factor_html, unsafe_allow_html=True)
237
- st.sidebar.markdown(evo_html, unsafe_allow_html=True)
238
 
239
  filtered_data = data_tipo[data_tipo.apply(lambda x: calculate_distance(x['latitude'], x['longitude'], custom_lat, custom_lon), axis=1) <= radius_in_meters]
240
  filtered_data = filtered_data.dropna() # Drop rows with NaN values
@@ -261,7 +262,23 @@ filtered_data['Predicted_target'] = predicted_target
261
 
262
 
263
  with st.container():
264
- st.map(filtered_data, zoom=zoom_level, use_container_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  st.write("Dados:", filtered_data) # Debug: Print filtered_data
266
 
267
  if st.button('Baixar planilha'):
 
11
  import base64
12
  from io import BytesIO
13
  import sys
14
+ import pydeck as pdk
15
 
16
  # Print the Python version
17
  print("Python version")
 
155
  </style>
156
  <a href='https://huggingface.co/spaces/DavidSB/avalia.EVO' target='_blank' style='text-decoration: none; color: inherit;'>
157
  <span style='color: gray; font-size: 20px;'>aval</span>
158
+ <span style='color: #FFAC1C; font-size: 20px;'>ia</span>
159
  <span style='color: gray; font-size: 20px;'>.EVO</span>
160
  """
161
 
 
234
  (data_tipo['Apriv'].between(apriv_min, apriv_max))]
235
 
236
  # Links to other apps at the bottom of the sidebar
237
+ #st.sidebar.markdown(factor_html, unsafe_allow_html=True)
238
+ #st.sidebar.markdown(evo_html, unsafe_allow_html=True)
239
 
240
  filtered_data = data_tipo[data_tipo.apply(lambda x: calculate_distance(x['latitude'], x['longitude'], custom_lat, custom_lon), axis=1) <= radius_in_meters]
241
  filtered_data = filtered_data.dropna() # Drop rows with NaN values
 
262
 
263
 
264
  with st.container():
265
+ # Define a PyDeck view state for the initial map view
266
+ view_state = pdk.ViewState(latitude=filtered_data['latitude'].mean(), longitude=filtered_data['longitude'].mean(), zoom=zoom_level)
267
+
268
+ # Define a PyDeck layer for plotting
269
+ layer = pdk.Layer(
270
+ "ScatterplotLayer",
271
+ filtered_data,
272
+ get_position=["longitude", "latitude"],
273
+ get_color="[255, 172, 28, 100]", # RGBA color for light orange, adjust opacity with the last number
274
+ get_radius=100, # Adjust dot size as needed)
275
+
276
+ # Create a PyDeck map using the defined layer and view state
277
+ deck_map = pdk.Deck(layers=[layer], initial_view_state=view_state, map_style="mapbox://styles/mapbox/light-v9")
278
+
279
+ # Display the map in Streamlit
280
+ st.pydeck_chart(deck_map)
281
+ #st.map(filtered_data, zoom=zoom_level, use_container_width=True)
282
  st.write("Dados:", filtered_data) # Debug: Print filtered_data
283
 
284
  if st.button('Baixar planilha'):