Comments (3)
Hey there. Hmmmm...interesting question. I was messing around with this a bit. If it's a small number of discrete values you could do something like this.
https://codesandbox.io/s/rwjn53mkmn
You wouldn't show the grey on the tick boxes obviously. That's just there to show you what's going on. Needs some work.
Not sure if that's what you were looking for.
from react-compound-slider.
Hey @sghall
Thanks for the quick reply.
Yep its getting closer, but for my use case I have a large amount of values (for ex 500 or more), and a user should see each and every value on hover.
(I just presume, but the Ticks
approach won't be the best solution for me)
So probably a Rail
component on hover would be a better start for this no? (with passing the actual mouse position value to the onMouseEnter function)
WDYT?
from react-compound-slider.
I see. I think one way to support this is to give you access to a function that uses the scale that translates from the event location to the step. You can see how it gets used here...
react-compound-slider/src/Slider/Slider.js
Line 275 in 2e34a25
You could pass down the scale and expose a function in the Tracks and Rail components that would allow you to get the step value by passing in the x or y value (depending on if it's vertical or not). I wouldn't allow the user to actually get the scale itself.
One wrinkle here is I check the dimensions before using it in case the browser has resized. So need to think about that.
react-compound-slider/src/Slider/Slider.js
Line 265 in 2e34a25
You interested in doing a PR on this?
from react-compound-slider.
Related Issues (20)
- SVG Handle Example? HOT 1
- airbnb slider in pure js or in jquery
- Tutorial step generates TypeError: children is not a function
- Showing rail in varying color based on tick position HOT 2
- Rounding error with domain that contain decimals HOT 1
- Handle id being sorted
- Handling values and step HOT 2
- Cannot read property 'type' of null error in 3.1.0 HOT 2
- the name of Ticks is undefined HOT 2
- Change in step behavior HOT 4
- Step of 0.01 results in too many decimal places in some generated values HOT 2
- Removing the `d3-array` dependency? HOT 2
- Handle tooltips need number formatting HOT 1
- Make Range slider draggable HOT 7
- Custom mode = same min/max value? HOT 1
- Allow slider to work in popup window by registering event listener with Slider's ownerDocument
- Show track with linear gradient?
- Dragging works incorrectly on wide slider with scrolls HOT 1
- How to avoid "jumping" handles?
- GetEventData function return undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-compound-slider.