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
// This is not good because you need add to OBJ unnecessary variables.
var obj = {value:0,range:[-1,1]};
panel.addSlider(obj,'value','range');
// This is ok))
var obj = {value:0};
panel.addSlider(obj,'value',range:[-1,1,0.1]);
// Or this
var obj = {value:0};
panel.addSlider(obj,'value',{step:0.1, range:[-1,1]});
Sorry for my english(
The text was updated successfully, but these errors were encountered:
It depends on your scenario, having a dynamically updated range from obj settings is not possible with your current suggestion. Mixing step with range is not a good idea imho.
But i did already move the range to the config obj (current state https://github.com/automat/controlkit.js/blob/rewrite/src/component/Slider.js#L54 ,v 0.2 branch https://github.com/automat/controlkit.js/tree/rewrite) so it can be omitted (assuming a default mapping range from 0 to 1, or 0 to value if the mapped value is larger than one) as well as having the option to either pass an array directly or an object key to the config so its still possible to have a dynamic range eg. depending on other values of the settings obj which get manipulated using other input components.
// This is not good because you need add to OBJ unnecessary variables.
var obj = {value:0,range:[-1,1]};
panel.addSlider(obj,'value','range');
// This is ok))
var obj = {value:0};
panel.addSlider(obj,'value',range:[-1,1,0.1]);
// Or this
var obj = {value:0};
panel.addSlider(obj,'value',{step:0.1, range:[-1,1]});
Sorry for my english(
The text was updated successfully, but these errors were encountered: