-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
Slider docs are unclear, SliderGrid
is unnecessary
#2923
Comments
When you have multiple sliders in a grid, you want all the value labels to be formatted to take as little space as possible while not jittering the layout back and forth when updating. That's the point of having |
Can this be closed? |
I just revisited the docs quickly on my phone, and I do not see any of the issues raised having been dealt with. The most pressing one is spesifically: |
It's not the best way, it just deals with the text jitter issue relatively intelligently. And this makes most sense in a grid. |
So the easiest wat to make a single labelled slider is using I guess my point is just that it feels weird to use SliderGrid to make a single slider, and that a more natural plularization of a LabeledSlider (e.g. an array of |
No that wouldn't work for what it does, the grid determines the largest label and uses that for the whole column. If you made multiple single |
Okay that makes sense. I am not sure what a good solution looks like here. If you can not see it either (or still do not think this is a problem), then this can be closed for me. |
If your confusion comes from SliderGrid being suitable also for a single labeled slider, we could just add that to the docstring |
That would not help the "naturalness" of the naming, but that seems tricky and is also less important. It WOULD remove the uncertainty a user might face, which is the main issue IMO. So yes, I would be more than happy just to have it mentioned in the docstring. Perhaps something to the effect of "constructing a |
I also ran into this confusion today. It says the older syntax is deprecated but the SliderGrid docs weren't very clear on just creating a single labelled slider. Maybe below should be a separate issue, but I'm here now anyway ;-): Perhaps the docs could show a simpler example with one labelled slider first, then also show vertical versions (if possible?) |
This PR implements the solution I proposed in [this comment](MakieOrg#2923 (comment)), which was a result of the discussion above.
The documentation for
Slider
states the following:This is unclear to me -
SliderGrid
has replacedlabelslider!
? Does that mean that one should make aSliderGrid
for a single labeled slider?If we jump to the link to
SliderGrid
, we meet the following:If the intention is for users to make a
SliderGrid
when they want a single labeled slider, the docs forSliderGrid
should state something more to the effect of "Make one or more labeled sliders". As it is, I am uncertain how I should make a single labled slider in the intended way.Furthermore, we see the docstring for
SliderGrid
start with "A grid of horizontal Sliders". Does that mean that it is impossible to create a verticalSliderGrid
? But if I should useSliderGrid
to create a single labeled slider, as indicated by the documentation stating that one should useSliderGrid
instead oflableslider!
, how do I create a single labled vertical slider? It feels like it has not actually replaced something likelabelslider!
(as the docs seems to suggest), but rather partially replaced it, and that the docs should be more clear on that the replacement is partial. Ideally, it would not feel like a partial replacement.Fortunatly, the docs for
Slider
clearly state that "You can create a label using a Label object, for example". So I know I can do it manually, by@lift
ing a label containing the variable name I want and value of the slider. But that seems a little manual, considering that there was alabelslider!
in the past, and the reference from it toSliderGrid
seems to indicate that there are more automatic ways to make a labeled slider.Before fixing this - Why do we need SliderGrid?
Before discussing how the docs should be, I want to know - why do we need
SliderGrid
? It seems to me likeSlider
can do everything we want - be vertical and slide. It is just missing thelabel
andformat
kwargs, which could be implemented just like for a single slider in aSliderGrid
. Why use different types for wanting one (Slider
) vs many (SliderGrid
), instead of just creating many directly? I imagine usage would look likeCompare this to the current syntax for making a
SliderGrid
, and I do not see the drawback. It is more or less identical:It seems just as easy to make many
Slider
s as aSliderGrid
. Why introduce the extra type?Furthermore, I find the syntax to access the values of a
SliderGrid
quite horrendus:This would, when just composing
Slider
s, becomeThe text was updated successfully, but these errors were encountered: