-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add fallbacks for manual manipulation of slider/frames #1233
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
Conversation
// the join data that creates this slider. So if this slider still exists, | ||
// the group should be valid, *to the best of my knowledge.* If not, | ||
// we'd have to look it up by d3 data join index/key. | ||
var opts = gSlider.data()[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the same behavior happen for updatemenus
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. Need to investigate make a parallel PR for that. This is one is just of particular concern because of @bpostlethwaite's current project with the slider transform thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. No need to address updatemenus
in this PR.
Can you open an issue for that and for your This PR does not fix: point above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// steps have changed since this was initialized. The sliderGroup, | ||
// however, has not changed since that *is* the slider, so it must | ||
// be present to receive mouse events. | ||
function getSliderOpts() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the comment 📚
/* | ||
* Recompute the lookup table that maps frame name -> frame object. addFrames/ | ||
* deleteFrames already manages this data one at a time, so the only time this | ||
* is necessary is if you poke around manually in `gd._transitionData_frames` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo ⏰ gd._transitionData_frames
-> gd._transitionData._frames
@@ -209,6 +210,59 @@ describe('sliders initialization', function() { | |||
}); | |||
}); | |||
|
|||
describe('ugly internal manipulation of steps', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great test case name!
// The selected option no longer exists, so confirm it's | ||
// been fixed during the process of updating/drawing it: | ||
expect(gd._fullLayout.sliders[0].active).toEqual(0); | ||
}).catch(fail).then(done); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice test case.
@bpostlethwaite wanna try this branch out in the workspace? |
Yep will do |
Successfully used this in WS2 👍 from me |
@bpostlethwaite I'll release |
cc @bpostlethwaite @etpinard
This PR fixes two cases:
This PR does not fix:
This PR also sneaks in
Plot.recomputeFrameHash(gd)
which does what it says. I should add tests for that; it's just a small bonus to prevent @bpostlethwaite from needing to do it manually.