plotly / plotly/plotly.R

crosstalk equality

Open
#1,167 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

I discovered this as I worked through an example of linking leaflet with DT and plotly through crosstalk (example). It seems plotly converts crosstalk keys to String and then uses exact equality match .indexOf (see lines). Thinking through how best to solve this, I came up with the following:

  1. Not convert crosstalk key to string in plotly, but I am guessing there was a reason to do the conversion for plotly traces.

  2. Perform match using something other than indexOf or ===. For the purposes of my example I used [].filter, but this is inefficient.

  3. Expect other htmlwidget authors to also convert to string, or add both the string and non-string forms to crosstalk select.

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

Reproduce the linked crosstalk example in experiments/select_crosstalk.R and inspect the matching logic referenced at plotly.js line 739. Compare the key representations used by leaflet, DT, and plotly, then establish which matching behavior should be consistent across the example before changing anything. Done means the linked widgets select the same keys reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.