You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importmatplotlib.pyplotaspltfromipyleafletimportMap, Marker, PopupfromipywidgetsimportOutput# Sample datapoints= [
{'name': 'Point 1', 'location': [40.7128, -74.0060], 'data': [1, 2, 3, 4, 5]},
{'name': 'Point 2', 'location': [34.0522, -118.2437], 'data': [2, 3, 4, 5, 6]},
{'name': 'Point 3', 'location': [37.7749, -122.4194], 'data': [3, 4, 5, 6, 7]},
]
# Function to create the chartdefcreate_chart(data, title):
fig, ax=plt.subplots(figsize=(10, 6)) # Adjust the figure size hereax.plot(data)
ax.set_title(title)
ax.set_xlabel('Time')
ax.set_ylabel('Value')
output=Output(layout={'width': '400px', 'height': '300px'}) # Adjust the output widget size herewithoutput:
plt.show()
returnoutput# Create a mapm=Map(center=[39.8283, -98.5795], zoom=4)
# Define a callback function to create and show the popupdefcallback_with_popup_creation(point):
deff(**kwargs):
marker_center=kwargs['coordinates']
marker_name=point['name']
marker_data=point['data']
output=create_chart(marker_data, marker_name)
popup=Popup(
location=marker_center,
child=output,
min_width=400,
max_width=800# Adjust the max width here
)
m.add_layer(popup)
returnf# Add points to the mapforpointinpoints:
marker=Marker(location=point['location'], title=point['name'])
marker.on_click(callback_with_popup_creation(point))
m.add_layer(marker)
# Display the mapm.layout.height='600px'm
The text was updated successfully, but these errors were encountered:
giswqs
changed the title
Add support for display spectral profiles from in situ data
Add support for displaying spectral profiles from in situ data
Aug 5, 2024
A proof of concept.
The text was updated successfully, but these errors were encountered: