You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somehow the values supplied as an array to value() function are being replaced by the lowest value in the array.
For example if I supply [1,1,10] to the value() function, the return value of value() call is [1,1,1].
This happened in the version 1.7.1 of the d3-simple-slider and I spent over 10 hours trying to figure out why the application I am developing which relies on d3-simple-slider had changed behaviour.
I have since reverted to d3-simple-slider version 1.7.0 and all is well.
var sliderRange3=d3.sliderBottom().min(1).max(10);
...
sliderRange3.value([1,1,10]);
var val=sliderRange3.value();
console.log(val);
The value of val seems to be [1,1,1].
The text was updated successfully, but these errors were encountered:
allankamau
changed the title
some array values supplied to value() function being substituted by the lowest value in the array.
some array values supplied to value() function are being substituted by the lowest value in the array.
Jul 10, 2020
First up there is no explicit support for more than two handles on one slider (#124 is related).
That said, the library doesn't prevent you from specifying more than two values. I can see three ways forward:
Prevent the user creating a slider with more than two values
Fix it so that calling value() returns the result of calling value(value). There are other places which assume there are only two values which might still cause issues
Make it so the library supports an arbitrary number of handles
Number 1 feels unfair on existing users like yourself. Number 3 would be ideal but needs some planning and time to implement.
In the meantime I wonder if the change in #139 might address your immediate issue? If you get a chance to see if it helps that would be great. I also understand if you wish to stay on 1.7.0.
Thank you for your swift reply.
I would also like to thank you for your nice software. I am using the three handle slider as part of a timeline player control.
I am happy to continue using d3-simple-slider version 1.7.0.
I may look into the change in #139 a little later.
Somehow the values supplied as an array to value() function are being replaced by the lowest value in the array.
For example if I supply [1,1,10] to the value() function, the return value of value() call is [1,1,1].
This happened in the version 1.7.1 of the d3-simple-slider and I spent over 10 hours trying to figure out why the application I am developing which relies on d3-simple-slider had changed behaviour.
I have since reverted to d3-simple-slider version 1.7.0 and all is well.
var sliderRange3=d3.sliderBottom().min(1).max(10);
...
sliderRange3.value([1,1,10]);
var val=sliderRange3.value();
console.log(val);
The value of val seems to be [1,1,1].
The text was updated successfully, but these errors were encountered: