Open GeorgeFlorian opened 1 year ago
Yep, looks like we simply don't check whether the right edge of the slider is actually farther right than its left edge. This one doesn't need responsive
to make it happen, you can just set a small fixed width like 600
in that example.
So we could catch that, but there isn't much we could do at that point other than refuse to draw the slider. You already have the play and pause buttons taking up the space they take. All I can really suggest is to listen to the plotly_autosize
event and modify the layout - put the slider below the buttons perhaps - if the width is too narrow. And vice versa, if you've gone from narrow to wide. I've tweaked your codepen to show the new width in that event handler. https://codepen.io/alexcjohnson/pen/NWLdLaG?editors=0010
I have encountered a strange behavior where, no matter what chart or data I am using, when the range slider doesn't have any space on the y axis, (this can happen when the y axis labels are wide) it flips like in a mirror:
In the first image the Year 2000 is the white dot on the left In the second image the Year 2000 is the white dot on the right
I've modified the Adding Sliders to Animations in JavaScript example: https://codepen.io/bleah1/pen/dyqoaMQ and added
responsive: true
toconfig
and a big margin of 400 to the layout to better see the flipping in action.What now ? This obviously can't be used on narrow mobile screens.