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

Zooming range in noUISlider? #1281

Open
trueclou opened this issue Oct 31, 2024 · 2 comments
Open

Zooming range in noUISlider? #1281

trueclou opened this issue Oct 31, 2024 · 2 comments

Comments

@trueclou
Copy link

Hi,
thanks so much for a really great slider! I really appreciate it!

One question and suggestion: I wonder is there an easy way to zoom in to the slider range, so that the range margins are outside the visible slider area? If one then pulls a handle to the visible edge, the scale should then scroll until the actual margin is reached.
I have not yet found a way to achieve this. The zoom factor could be handled by another control (e.g. another slider).

I have to deal with timeline data with a precision down to milliseconds. One should be able to place the handle with this precision. Unfortunately, the whole data set may last up to several hours. When the visible range represents the whole timeline, it is impossible to drag the handle this precise.
It would be great if there were an easy way to zoom into the scale, place the handle precisely and then zoom out again.

The coolest feature would be if noUISlider simply supported a zoom Method that zooms in to a given factor.
Just a dream... ;-)

Best Christoph

@leongersen
Copy link
Owner

Hi! I'm glad the library is useful to you.

The zoom feature you describe isn't directly a part of noUiSlider, but I think you could implement it using the updateOptions method. When the external control changes your zoom, update the slider range to a smaller range around the current handle, and remove margins. When zooming back out, update again.

@trueclou
Copy link
Author

Well, I certainly considered this kind of solution. However, this won't provide scrolling when one reaches the visible margin.
Wouldn't this be an interesting feature for a lot of applications?

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

No branches or pull requests

2 participants