-
Notifications
You must be signed in to change notification settings - Fork 38
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
Show slider range #454
base: master
Are you sure you want to change the base?
Show slider range #454
Conversation
nengo_gui/static/slider.js
Outdated
@@ -297,7 +349,10 @@ Nengo.Slider.prototype.set_range = function() { | |||
for (var i in self.sliders) { | |||
self.sliders[i].set_range(min, max); | |||
} | |||
console.log('here') |
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.
Remove debug output?
|
nengo_gui/static/slider.js
Outdated
@@ -145,6 +192,8 @@ Nengo.Slider.prototype.on_resize = function(width, height) { | |||
this.group.style.height = height - this.ax_top - 2 * this.border_size; | |||
this.group.style.marginTop = this.ax_top; | |||
|
|||
this.bound_labels.style.height = height - (this.ax_top - 10) - this.border_size ; |
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.
It is unclear what the relevance of magic number 10
is in this line. This should be a named constant/variable. I wonder whether this height calculation is needed at all ...
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.
It is unclear what the relevance of magic number 10 is in this line. This should be a named constant/variable. I wonder whether this height calculation is needed at all ...
The height calculation here is used to have the numbers move up and down to correspond with vertical resizing. Agreed, on assigning this 10 somewhere.
Note that I refactored the sliders. |
Hmm, I was thinking that even if we had 5 sliders lined up, we should only have the min max labelled once so as to prevent it from getting to cluttered. |
Hover box disappears? Can you explain this one a bit more? |
True, as long as all sliders are required to have the same range. But it could still be a more flexible implementation to implement it in
If you move the mouse over the slider, you get this gray box around it. If you move the cursor away, that box disappears instantly whereas the range fades out. |
I agree that there should only be one min/max no matter how many sliders there are in the one Component. |
For positioning, Would it be preferred to have the range labels follow the first slider guideline left and right while the slider is being resized horizontally, or have the labels to always be on the left hand side of the slider component (current implementation)? I am in favour the latter option so the labels act as a sort of anchor while resizing horizontally, also moving more items makes resizing a more visually 'busy' operation. Keeping things simple this way. |
this is also the case with the border of all components currently. This should probably be addressed in it's own PR if we want to rectify this. |
If you want to do that as a separate PR, sure, but it's important enough to this PR that I'm pretty sure it'll have to be addressed before this PR is accepted. (Basically, this PR is making that hover effect do a lot more than it used to, so it makes that resize problem much more obvious) |
See issue #464 |
How do people feel about the look of these range indicators? I think the functionality is about right, but there's something wrong with the look to me. Perhaps the numbers could be shown in the same font as the numbers in the ranges shown on the graphs? Also, how do people feel about the numbers being underneath the sliders themselves? Here's what it looks like now: |
Would make sense to me. I don't like that the numbers get covered. That looks like a bug. |
By widening the component it can be made so that the range labels are no longer overlapped. |
How about rotating the labels by 90 degress to use the whitespace inbetween sliders more effectively? |
Definitely an option to try out. I'd also try out actually using the same D3 Axis thing so that there's both the axis labels and a line with three tick marks on the far left of all the sliders. |
All the sliders or just the left one? I could see the tick marks being on all, but only the range labels on the far left one? Since they all share a range, having it repeated would be redundant / cluttered. |
Sorry, that's me not being clear. I meant a single separate axis on the far left. So something like this, only with the numbers correct and everything lined up right: |
I think that separate axis would look good. Can we get rid of the tick to the right at 0? Ant the extension to the bottom of the axis? |
Definitely. Those just didn't get removed because I was making a mockup in a paint program I wasn't familiar with. :) |
Updated to demo this in 5be35ce , doesn't seem right to me. I will try out the axis idea next. |
In 6795a12 I reduced the left margin so the slider guidelines don't cover it unless the component is being squeezed extremely narrow. This seems to be a clean simple fix. |
I wonder if it's more convenient to quote commit IDs or should I set up different branches for testing ideas. |
Different branches is useaully preferred, I think -- that way it doesn't clutter up the history. |
Hmm... yeah, I agree that the rotation doesn't seem to look right |
That's definitely an improvement. I still find it odd that it's in a completely different font and size from all our other range labels, though. Are you planning on trying the single axis suggestion? |
see #526 |
LGTM. Is there any reason this still needs changes? Other than the fact that the commits need to be squashed together? |
I much prefer the look of what's being attempted in #526 . As it stands, I'm not sure this PR is an improvement over what we currently have, and I think #526 with some tweaks would work quite well. |
Showing the max and min slider values adjacent to the slider
Addresses #123 , #464