Skip to content

Multiple range sliders #1355

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 15 commits into from
Feb 23, 2017
Merged

Multiple range sliders #1355

merged 15 commits into from
Feb 23, 2017

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Feb 6, 2017

resolves #1250

gifrecord_2017-02-06_153150

This PR also:

  • fixes various range-slider+data-update issues as Range slider data update fix #1350 but in a more robust way, see cebc31c for the details.
  • add attribute xaxis.rangeslider.autorange allowing users to turn on/off range slider autorange computations.

@etpinard etpinard added status: in progress bug something broken feature something new labels Feb 6, 2017
margin.t + graphSize.h * (1 - oppDomain[0]) +
tickHeight +
opts._offsetShift + constants.extraPad
);
Copy link
Contributor Author

@etpinard etpinard Feb 6, 2017

Choose a reason for hiding this comment

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

I think I got this right. I would appreciate having something take a second 👁️ at it though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess something in here is responsible for the small position differences in the mocks? I'm not bothered by the differences, except that some of the new ones look a little bit fuzzier than the old ones. Can you try and round it so that the outer edges of the range slider border are exactly on a pixel boundary, even if you have non-integers in layout.height, the margins, rangeslider.borderwidth and anything else that comes into the calculation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexcjohnson some improvements on:

multiple-rangesliders...rangeslider-crisp-round

I think the mocks look better to my 👀 , would you mind taking a look at them?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, this isn't new but I'm just noticing it now while we're here: should we switch handleStroke to be Color.defaultLineColor = '#444' instead of #666 as it is now? And to avoid duplication, handleFill = '#fff' is already available as Color.background - to explicitly match how we define zoombox corners

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

5a649f0 gives

image

is that what you had in mind?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The image you've pasted here is blown up (with browser zoom?), so the rounding isn't quite right and consequently there are still some odd 1-pixel effects at the corners. When I look at the rangeslider-crisp-round branch locally it looks almost perfect.
screen shot 2017-02-22 at 10 22 28 pm

I realize this is a borderline obsessive ask (which side of the border?) so I did it myself in 29a31d5 and b49ea77. I just tweaked it a tiny bit to get the symmetry right: both handles the slightest bit more on the dark side. I suppose we could bump the width either up or down 1px so it would be possible to have them each exactly symmetric across the dark/light line, but to my eye anyway symmetry between the two handles is more important. Also included rounding of everything that goes into the grabber position before offsetting, because sometimes we were still getting a non-integer starting point, making the half-pixel offset moot. Kind of annoying but I think now it's really truly guaranteed to be an honest rectangle.

screen shot 2017-02-22 at 10 32 16 pm

Seem reasonable?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Aaand in case you weren't 100% convinced I'm being obsessive - I've got a retina display on my laptop, and a non-retina external monitor. The retina display still rounds off all the corners, since it doubles the real number of pixels displayed. I'd say this looks fine, perhaps even better than the perfect sharp corners on a non-retina display - because it's a consistent look and the missing pixels are smaller than the line width so the line really looks rounded, not broken like it did on regular monitors before. Screen shot blown up so you can see the individual retina pixels:
screen shot 2017-02-22 at 11 13 49 pm

@etpinard etpinard added this to the 1.24.0 milestone Feb 15, 2017
etpinard and others added 4 commits February 23, 2017 10:56
Better looking range slider handles
@alexcjohnson
Copy link
Collaborator

💃

@etpinard etpinard merged commit 027d97f into master Feb 23, 2017
@etpinard etpinard deleted the multiple-rangesliders branch February 23, 2017 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken feature something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rangeslider only shows for the first x-axis in multiple subplots
2 participants