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
var slider = d3.slider().min(0).max(10);
d3.select("#slider").call(slider)
This creates a slider. Is there a way to update the position of the slider via javascript. For example, executing slider.value(5) should update the position of the slider.
The text was updated successfully, but these errors were encountered:
I experienced also a problem with the getter/setter function for the value.
When the value is not changed at creation (as in the example above), or when the value is set to 0, the setter doesn't work.
The problem (I think) in the code below is that the condition if (value) { will return false if the value is zero.
slider.value = function(_) {
if (!arguments.length) return value;
if (value) {
moveHandle(stepValue(_));
};
value = _;
return slider;
};
Therefore I would suggest to use another condition like:
man thank the lord i found this @VD17593 thanks for the spot.. confirmed same behavior for me trying to set a value to something other than zero... new to JS so a rude way to find out that 0 == false
Currently I can create a slider like this
This creates a slider. Is there a way to update the position of the slider via javascript. For example, executing
slider.value(5)
should update the position of the slider.The text was updated successfully, but these errors were encountered: