Skip to content

Range slider second iteration (part 1) #962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 6, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/dragelement/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ function coverSlip() {
return cover;
}

dragElement.coverSlip = coverSlip;

function finishDrag(gd) {
gd._dragging = false;
if(gd._replotPending) Plotly.plot(gd);
Expand Down
11 changes: 9 additions & 2 deletions src/components/rangeslider/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ var attributes = require('./attributes');
module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxes) {
if(!layoutIn[axName].rangeslider) return;

var containerIn = Lib.isPlainObject(layoutIn[axName].rangeslider) ?
layoutIn[axName].rangeslider : {},
// not super proud of this (maybe store _ in axis object instead
if(!Lib.isPlainObject(layoutIn[axName].rangeslider)) {
layoutIn[axName].rangeslider = {};
}

var containerIn = layoutIn[axName].rangeslider,
containerOut = layoutOut[axName].rangeslider = {};

function coerce(attr, dflt) {
Expand Down Expand Up @@ -48,4 +52,7 @@ module.exports = function handleDefaults(layoutIn, layoutOut, axName, counterAxe
layoutOut[ax] = opposing;
});
}

// to map back range slider (auto) range
containerOut._input = containerIn;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to delete containerIn._input before this to avoid a loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what kind of loop are you referring to here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

containerOut._input = { 
  /* the containerIn */, 
  _input: { 
    /* the previous containerIn */, 
    _input: { 
      /* the previous conta...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_input is always linked to the layout as passed to Plotly.plot(gd, data, layout) - which doesn't know anything about containerOut.

};