1.18.0 • Published 5 years ago

@pencil.js/knob v1.18.0

Weekly downloads
15
License
MIT
Repository
github
Last release
5 years ago

Knob

Rotating knob component.

Knob example

Installation

npm install @pencil.js/knob

Examples

import Knob from "@pencil.js/knob";

const position = [100, 200];
const options = {
    radius: 100, // radius in pixel
    min: 0, // Minimum value of the knob
    max: 10, // Maximum value of the knob
    value: 0, // initial value (from 0 to 1)
};
const knob = new Knob(position, options);
knob.value = 0.5; // set to 50%

KnobOptions

Inherit from ComponentOptions.

NameTypeDefaultComment
minNumber0Minimum value when the knob is at lowest
maxNumber10Maximum value when the knob is at highest
valueNumber0Initial value
radiusNumber100Radius of the knob