plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Bug: config={'doubleClick': False} does not supress doubleClick for map figures

Open apberesford opened this issue 8 months ago • 1 comments

Some users use fig.show(config={'doubleClick': False}) to supress the default behaviour where double clicking on a figure returns to the default zoom level.

This behaviour is not supressed on map figures, tested on px.choropleth and choropleth_mapbox, plotly==6.0.1.

There does not appear to be a way to supress this behaviour for those maptypes, and there's no relevant error in the terminal to

Example:

ddk.Block(children=[
     ddk.Card(children=ddk.Graph(id='control'),),
     ddk.Card(children=ddk.Graph(id='map'),)
])
@callback(
    Output('control', 'figure'),
    Output('map', 'figure'),
    Input('species', 'value'),
)
def two_figures(species):
    control = px.scatter()
    control.show(config={'doubleClick': False})
    map = px.choropleth_map()
    map.show(config={'doubleClick': False})
    return control, map

returns the following behaviour

https://github.com/user-attachments/assets/b5e7cc0f-0b0f-425d-a6d8-6924b73fffc0

apberesford avatar May 21 '25 18:05 apberesford

Tested for Choropleth specifically because that's the client use case.

apberesford avatar May 21 '25 18:05 apberesford