Skip to content

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

Merged
merged 2 commits into from
Jan 16, 2017
Merged

Draw updatemenus over sliders #1302

merged 2 commits into from
Jan 16, 2017

Conversation

etpinard
Copy link
Contributor

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.
gifrecord_2017-01-13_174700

- so that their buttons are displayed above all other
  layout components
@etpinard etpinard added status: in progress bug something broken labels Jan 13, 2017
@etpinard
Copy link
Contributor Author

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.

@rreusser
Copy link
Contributor

Ah, I thought it would be a complicated SVG layering thing. Changing the order seems much simpler.

@etpinard etpinard added this to the v1.22.0 milestone Jan 16, 2017
Copy link
Contributor

@rreusser rreusser left a 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);
Copy link
Contributor

@rreusser rreusser Jan 16, 2017

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:

  1. Draw plot with updatemenus and no sliders
  2. Add slider
  3. 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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@etpinard etpinard merged commit bfc49fb into master Jan 16, 2017
@etpinard etpinard deleted the updatemenus-over-sliders branch January 16, 2017 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants