Giter Site home page Giter Site logo

Comments (3)

sghall avatar sghall commented on June 18, 2024

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.

PeterMK85 avatar PeterMK85 commented on June 18, 2024

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.

sghall avatar sghall commented on June 18, 2024

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

updateValue = this.pixelToStep.getValue(vertical ? e.clientY : e.pageX)

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.

this.pixelToStep.setDomain(

You interested in doing a PR on this?

from react-compound-slider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.