Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Canvas knob widget for the browser (touch compatible). Based on jQuery Knob by Anthony Terrien.
JavaScript
branch: master
Failed to load latest commit information.
example initial commit
.gitignore initial commit
LICENSE initial commit
README.md readme
handle_change.js onchange event
index.js fixed px handling
package.json 0.2.0

README.md

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)

License

MIT

Something went wrong with that request. Please try again.