Skip to content
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

Range slider second iteration (part 1) #962

Merged
merged 14 commits into from
Oct 6, 2016
Merged
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.

};