-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Draw updatemenus over sliders #1302
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
- so that their buttons are displayed above all other layout components
I'll add a jasmine test about it next week. I just wanted to make a quick PR so that I didn't forget about it. |
Ah, I thought it would be a complicated SVG layering thing. Changing the order seems much simpler. |
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.
Simple. Easy. 💃🏻
Registry.getComponentMethod('sliders', 'draw')(gd); | ||
Registry.getComponentMethod('updatemenus', 'draw')(gd); |
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.
Real simple. The fact that it's quite this simple is a little concerning though.
I guess that means it works. For some reason I thought the dropdown was drawn on a separate layer (should it be?). (Edit: Ohhhh, it's a separate layer for all updatemenus but still within the updatemenus container.) The only corner case I can think of:
- Draw plot with updatemenus and no sliders
- Add slider
- Somehow the slider is appended after the updatemenu and ends up on top of it
But I guess that's what containerClass is for. So perhaps this is adequate.
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.
Ignore this. Seems all good. Had to mentally work through the hierarchy once more, but yeah, this seems good. I'll only add a small note about long-term robustness of relying upon component ordering. I can imagine needing _upperinfolayer
or something to which expanded components are added. Not necessary now but might be a better solution if more cases arise.
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.
Not necessary now but might be a better solution if more cases arise.
Yeah. Maybe the best solution would have the dropdown buttons in a separate layer above <g class="infolayer">
.
My solution aims to fix the 99% cases for users ASAP.
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.
Yup. That fix is nicely future-aware, but unless I'm wrong there's not actually any difference in the present.
as pointed out by @jackparmer in https://plot.ly/~jackp/17246.embed
When a graph has both updatemenus and sliders, updatemenu buttons drop below sliders.
