knob
v1.1.0
Published
Canvas based knob widget for the browser
Downloads
2,378
Readme
Knob
Canvas knob widget for the browser (touch compatible). Based on jQuery Knob by Anthony Terrien.
Install
$ npm install knob
Example
var Knob = require('knob') // browserify require
var knob = Knob({
label: 'Test 123',
value: 100,
angleOffset: -125,
angleArc: 250,
min: 0,
max: 200,
width: 100
})
document.getElementById('container').appendChild(knob)
Run the included example:
$ npm run example
# then navigate to http://localhost:9966
All Supported Options and Default Values
- value (
50
) - min (
0
) - max (
100
) - step (
1
), - cursor (
false
), - thickness (
0.35
), - lineCap: (
'butt'
), - width (
200
), - height (
options.width || 200
) - bgColor (
'#EEEEEE'
) - fgColor (
'#87CEEB'
) - labelColor (
'#888'
) - angleOffset (
0
) - angleArc (
360
) - className (
null
) - activeClass (
null
) - readOnly (
false
)
License
MIT