Slider Bar / Pins Algorithm

I have a slider with x number of bars, each representing a range of values. Each bar has an upper and lower handle that are used to control the range. Bars can be interconnected, so some of the handles will affect two lanes (that is, the handle is in the middle of two lanes), of which their movements can affect the movement of other lanes down the chain. Bars can have a maximum width and can still be pushed / pulled out while maintaining their maximum width. My question is, is there a documented algorithm for verifying movement when the user tries to move the handle to V, which in turn will either push or pull all connected lanes down the chain?

It's a little tricky to explain, so hopefully it made sense. I'm not looking for a real solution, just some algorithms that might help me arrive at a solution (i.e. Magic searches for this type of problem). Thanks for your help.

+1


a source to share


1 answer


It sounds like you are dealing with a special case of constraint programming. I think you could model the sliders as a series of constraints, i.e .:

slider range: (a, b), where a> = MIN, b <= MAX
slider2 range: (c, d) where c> a + x, d <= MAX
...



where x changes when the user moves the bottom range of slider 2?

It will take time, linear in the number of constraints, to simply evaluate all the equations affected when the user moves the slider, which is not too bad. I'm not sure what you can do better.

0


a source







All Articles