knob

Canvas based knob widget for the browser

Knob

Canvas knob widget for the browser (touch compatible). Based on jQuery Knob by Anthony Terrien.

$ npm install knob
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 
  • 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)

MIT