Pure-Knob how to set dial value from 100 to 0 instead of 0 to 100 which is interactive with mouse click and mouse scroll

169 Views Asked by At

Currently knob.setProperty('valMin',0); and knob.setProperty('valMax',100); is defined which creates a knob starting value from 0 to 100.But I want a knob which will start from 100 to 0 as following knob.setProperty('valMin',100); and knob.setProperty('valMax',0); Thanks in advance. Checking the GitHub link will be highly appreciated.

https://github.com/andrepxx/pure-knob

const knob = pureknob.createKnob(300, 300);


knob.setProperty('angleStart', -0.75 * Math.PI);
knob.setProperty('angleEnd', 0.75 * Math.PI);
knob.setProperty('colorFG', '#88ff88');
knob.setProperty('trackWidth', 0.4);
knob.setProperty('valMin', 0);
knob.setProperty('valMax', 100);


knob.setValue(50);

const listener = function(knob, value) {
    console.log(value);
};

knob.addListener(listener);


const node = knob.node();


const elem = document.getElementById('some_element');
elem.appendChild(node);
1

There are 1 best solutions below

0
sarvar-akbarov On

just change properties:

knob.setProperty('valMin', 0);
knob.setProperty('valMax', 1000);