Function: relativeMapping()
function relativeMapping(__namedParameters?): DragValueMapping;
Defined in: dom/src/pointer/drag-value.ts:150
Move the value away from where it stood when the drag started, by the distance dragged. The pointer position itself carries no meaning, so the value can be adjusted from anywhere on the screen.
Parameters
| Parameter | Type | Description |
|---|---|---|
__namedParameters | { pixelRange?: number | readonly [number, number]; sensitivity?: (state) => number; } | - |
__namedParameters.pixelRange? | number | readonly [number, number] | Pixels of movement that span the whole range. Default 100 |
__namedParameters.sensitivity? | (state) => number | How much the movement counts, read on every move. 1 is pixelRange as given; 0.1 makes the same movement cover a tenth of the range, which is what a fine-adjustment modifier wants. Changing it mid-drag does not disturb the value: the travel so far is folded into the origin and measuring starts again from there. |