plotly / plotly/plotly.py

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

Open
#5,196 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with plotly==6.0.1 using the provided ddk.Graph example and compare px.scatter with px.choropleth_map and choropleth_mapbox. Trace how fig.show(config={'doubleClick': False}) is passed to map figures, then add coverage showing that double-click does not reset the map zoom when the option is disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.