import dash
from dash import dcc, html
import plotly.express as px
import pandas as pd
# Sample data
df = pd.DataFrame({
'lat': [37.77, 40.71, 34.05, 51.51],
'lon': [-122.41, -74.00, -118.25, -0.12],
'city': ['San Francisco', 'New York', 'Los Angeles', 'London']
})
# Create a Plotly express scatter mapbox
fig = px.scatter_mapbox(df,
lat='lat',
lon='lon',
hover_name='city',
zoom=3,
height=600)
# Set Mapbox style
fig.update_layout(mapbox_style="open-street-map")
# Initialize the Dash app
app = dash.Dash(__name__)
# Define the layout of the app
app.layout = html.Div([
html.H1("Simple Dashboard with Mapbox"),
dcc.Graph(id='map', figure=fig)
])
# Run the app
if __name__ == '__main__':
app.run_server(debug=True)
I tested with Python 10, 11 & 12, with the latest available version of the involved packages, and the bug is present.
However, with one of my existing environment on Python 10, the bug was not present (see below).
I was not able to identify which different version of which package triggered the difference, I hope your expert eyes will see it. I'm using Chrome Version 126.0.6478.127 (Build officiel) (x86_64), on MacOS Sonoma 14.5. Both environment are defined below:
Python 10, working environment (that's one I used for a project, hence not the smallest possible one):
hi @rderollepot
I see that tooltip present in our Plotly docs as well. But that button inside the tooltip seems out of place and serving no purpse. Thanks for reporting.
I found out what looks like an aesthetic bug, and I did not find any reference to it.
Bug:
In the bottom right corner, in the attribution area, there is an empty button with "Toggle attribution" tooltip showing that I think should not.
The HMTL code of the button is:
Basic dashboard to reproduce the bug:
I tested with Python 10, 11 & 12, with the latest available version of the involved packages, and the bug is present. However, with one of my existing environment on Python 10, the bug was not present (see below).
I was not able to identify which different version of which package triggered the difference, I hope your expert eyes will see it. I'm using Chrome Version 126.0.6478.127 (Build officiel) (x86_64), on MacOS Sonoma 14.5. Both environment are defined below:
Python 10, working environment (that's one I used for a project, hence not the smallest possible one):
Python 10, buggy environment: