UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

63 lines (62 loc) 1.57 kB
/** * @module Knob */ /** * Knob class * <br><img src="./media/examples/knob.png" alt="knob demo"/> * @class * @extends Input */ export default class Knob extends Input { /** * @typedef {Object} KnobOptions * @prop {Number} [min=0] - Minimum value when the knob is at lowest * @prop {Number} [max=10] - Maximum value when the knob is at highest * @prop {Number} [value=0] - Initial value * @prop {Number} [radius=100] - Radius of the knob */ /** * @type {KnobOptions} */ static get defaultOptions(): KnobOptions; /** * Width of the rotation marker * @type {Number} */ static get NOTCH_SIZE(): number; /** * knob constructor * @param {PositionDefinition} positionDefinition - Position of the center * @param {KnobOptions} [options] - Specific options */ constructor(positionDefinition: any, options?: KnobOptions); /** * Set this knob's radius * @param {Number} value - Radius of the knob */ set radius(arg: number); /** * Get this knob's radius * @return {Number} */ get radius(): number; } export type KnobOptions = { /** * - Minimum value when the knob is at lowest */ min?: number; /** * - Maximum value when the knob is at highest */ max?: number; /** * - Initial value */ value?: number; /** * - Radius of the knob */ radius?: number; }; import Input from "@pencil.js/input";