solid-knobs / ContinuousRange
The most common type of range that is used for continuous numerical values (e.g. frequency, volume, etc).
• type: Continuous
The type of a ContinuousRange is always RangeType.Continuous.
• start: number
The start value of the range.
• end: number
The end value of the range.
• Optional bipolar: boolean
Whether the range is a bipolar one.
• Optional stringToValue: (value: number, unit: string) => number
▸ (value, unit): number
A function for converting a value with a certain unit to a value in the range.
| Name | Type |
|---|---|
value |
number |
unit |
string |
number
• Optional valueToString: (value: number) => string
▸ (value): string
A function for formatting a value of this range as a string.
| Name | Type |
|---|---|
value |
number |
string
• Optional scale: { type: Exponential ; exp: number } | { type: Logarithmic } | { type: Linear }
The scaling of the range defines how the value is controlled in a UI. The default is Scale.Linear.
• Optional snap: number | number[]
The values to which the user-interface control should snap. Note! Always provide these values from smallest to largest.
• Optional step: number
The step between values. If you want a range that allows only integer values, set this to 1.
• Optional snapMargin: number
How far away a value has to be from a snap point for it to snap.