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
Thanks for this great plugin.
I don't know if it's a bug or just the normal behavior but it's possible to update the values of all sliders if users add more than two sliders.
I want to add more than two sliders on the axis, I add more than two default value like this slider.default([0.01, 0.011, 0.015]) . Through this code I can get 3 sliders in the webpage, but when I slide the slider, only the first two sliders update the value, the latter does not update the value.
I have read the source code, and I found that it only judged the value of the first two sliders here: updateValue().
Therefore, only when the first two sliders are updated will trigger the ‘onchange event’ and update the value.
My code here ( Modified from the example range):
var data = [0, 0.005, 0.01, 0.015, 0.02, 0.025];
// Range
var sliderRange = d3
.sliderBottom()
.min(d3.min(data))
.max(d3.max(data))
.width(300)
.tickFormat(d3.format('.2%'))
.ticks(5)
.default([0.01, 0.011, 0.015])
//.fill('#2196f3')
.on('onchange', val => {
console.log(val);
d3.select('p#value-range').text(val.map(d3.format('.2%')).join('-'));
});
When I change the function ’updateValue()‘ like this, it works:
function updateValue(newValue, notifyListener) {
if (
JSON.stringify(value) !== JSON.stringify(newValue)
)
Thanks again for your great plugin.
The text was updated successfully, but these errors were encountered:
Hi @jynwhey. I'm afraid it is intended behaviour. I'll take a look at what it would take to generalise to more than two handles when I next get the chance but it won't be for a week or two.
Thanks for this great plugin.
I don't know if it's a bug or just the normal behavior but it's possible to update the values of all sliders if users add more than two sliders.
I want to add more than two sliders on the axis, I add more than two default value like this
slider.default([0.01, 0.011, 0.015])
. Through this code I can get 3 sliders in the webpage, but when I slide the slider, only the first two sliders update the value, the latter does not update the value.I have read the source code, and I found that it only judged the value of the first two sliders
here: updateValue().
Therefore, only when the first two sliders are updated will trigger the ‘onchange event’ and update the value.
My code here ( Modified from the example range):
When I change the function ’updateValue()‘ like this, it works:
Thanks again for your great plugin.
The text was updated successfully, but these errors were encountered: