plotly / plotly/plotly.js

Clicks are sometimes missed with clickmode layout key

Open
#6,898 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2 sev-2
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.