1.1.0 • Published 10 years ago

knob v1.1.0

Weekly downloads
1,039
License
MIT
Repository
github
Last release
10 years ago

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

1.1.0

10 years ago

1.0.0

10 years ago

0.3.0

13 years ago

0.2.0

13 years ago

0.1.0

13 years ago

0.0.0

13 years ago