Clicks are sometimes missed with clickmode layout key
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 18.3k
- Forks
- 2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Description
Hi,
This is William Huang from the Streamlit Open Source team!
I am currently attempting to provide selection on charts for the Streamlit st.plotly_chart api. I noticed there are on_select and on_click callbacks that we can register to. The on_click callbacks always register and that seems fine.
However, when I try to use the clickmode: “event+select” in the layout of the graph, clicks are sometimes missed. This can be replicated here:
Plotly.js - JSFiddle - Code Playground
or here:
Plotly Playground - JSFiddle - Code Playground 1
Is there someone that can help me to understand why clicks are being missed? We are trying to release this feature within streamlit so any help would be appreciated!
I created a demo app here: https://chart-selections-demo.streamlit.app/ that uses this clickmode layout property. (FEEL FREE TO CHECK OUT 😉 )
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two linked JSFiddle reproductions and the clickmode: “event+select” behavior described in the issue. Trace the click and selection event handling in Plotly.js to identify why clicks are missed; done means the reproduction no longer drops clicks while preserving selection behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100