plotly / plotly/plotly.js

Range slider emits relayout evt on mousemove, should be only on mouseup

Open
#2,216 12 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

I have had the need to do something after the rangeslider had changed (update the min/max somewhere else on the page). I did not find any event that fired only after the slider had been released (a.k.a. mouseup) so I changed the rangeslider/draw.js:

function mouseUp() {
            dragCover.removeEventListener('mousemove', mouseMove);
            dragCover.removeEventListener('mouseup', mouseUp);
            Lib.removeElement(dragCover);
// --> new code
            gd.emit('plotly_rangesliderend', {
                axis: axisOpts,
                opts: opts
// --> end new code
            });

Is this anything that would be merged? Should I do a PR?

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 in rangeslider/draw.js at mouseUp and compare it with the mousemove path that emits relayout events. Trace the existing rangeslider event handling and coverage before deciding whether the desired behavior is a changed relayout event or a new end event. Done means the event behavior matches the issue’s mouseup-only requirement.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.