Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Show slider range #454

wants to merge 12 commits into from

Conversation

cchan987
Copy link
Contributor

Showing the max and min slider values adjacent to the slider
Addresses #123 , #464

@@ -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')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debug output?

@jgosmann
Copy link
Collaborator

  • The labels can randomly pop up and fade out again during resizing.
  • It might look better to have the labels closer to the vertical bar.
  • I like the fade out animation, but it is strange the the hover box instantly disappears.

@@ -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 ;
Copy link
Collaborator

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 ...

Copy link
Contributor Author

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.

@jgosmann
Copy link
Collaborator

Note that I refactored the sliders. slider.js is only a container which contains multiple SliderControl instances. I think, the appropriate place to implement those range labels would be slidercontrol.js and not slider.js.

@cchan987
Copy link
Contributor Author

Note that I refactored the sliders. slider.js is only a container which contains multiple SliderControl instances. I think, the appropriate place to implement those range labels would be slidercontrol.js and not slider.js.

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.

@cchan987
Copy link
Contributor Author

I like the fade out animation, but it is strange the the hover box instantly disappears.

Hover box disappears? Can you explain this one a bit more?

@jgosmann
Copy link
Collaborator

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.

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 slidercontrol.js and only display the range for the first SliderControl (either by having a flag in SliderControl whether to display the range on hover or having the mouse event in Slider and toggle the display of the range for the first slider in that event handler).

Hover box disappears? Can you explain this one a bit more?

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.

@tcstewar
Copy link
Collaborator

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.

I agree that there should only be one min/max no matter how many sliders there are in the one Component.

@cchan987
Copy link
Contributor Author

cchan987 commented Jul 6, 2015

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.

@cchan987
Copy link
Contributor Author

cchan987 commented Jul 6, 2015

The labels can randomly pop up and fade out again during resizing.

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.

@tcstewar
Copy link
Collaborator

tcstewar commented Jul 6, 2015

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)

@jgosmann
Copy link
Collaborator

jgosmann commented Jul 6, 2015

See issue #464

@tcstewar
Copy link
Collaborator

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:

image

@jgosmann
Copy link
Collaborator

Perhaps the numbers could be shown in the same font as the numbers in the ranges shown on the graphs?

Would make sense to me.

I don't like that the numbers get covered. That looks like a bug.

@cchan987
Copy link
Contributor Author

By widening the component it can be made so that the range labels are no longer overlapped.
The alternative could be to have the labels in their own column to the left of the sliders, however I feel that makes the labels disconnected.

@jgosmann
Copy link
Collaborator

How about rotating the labels by 90 degress to use the whitespace inbetween sliders more effectively?

@tcstewar
Copy link
Collaborator

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.

@tbekolay
Copy link
Member

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.

@tcstewar
Copy link
Collaborator

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:

image

@jgosmann
Copy link
Collaborator

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?

@tcstewar
Copy link
Collaborator

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. :)

@cchan987
Copy link
Contributor Author

How about rotating the labels by 90 degress to use the whitespace inbetween sliders more effectively?

Updated to demo this in 5be35ce , doesn't seem right to me. I will try out the axis idea next.

@cchan987
Copy link
Contributor Author

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.

@cchan987
Copy link
Contributor Author

I wonder if it's more convenient to quote commit IDs or should I set up different branches for testing ideas.

@tcstewar
Copy link
Collaborator

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.

@tcstewar
Copy link
Collaborator

Updated to demo this [rotation] in 5be35ce , doesn't seem right to me. I will try out the axis idea next.

Hmm... yeah, I agree that the rotation doesn't seem to look right

@tcstewar
Copy link
Collaborator

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.

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?

@cchan987
Copy link
Contributor Author

Are you planning on trying the single axis suggestion?

see #526

@Seanny123
Copy link
Collaborator

LGTM. Is there any reason this still needs changes? Other than the fact that the commits need to be squashed together?

@tcstewar
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants