a react angle picker
git clone https://github.com/jrehm135/react-angle-range.git
import React, { Component } from 'react';
import AngleRange from 'react-angle-range';
class Example extends Component {
render() {
return (
<AngleRange
// required
value = {{ from: 0, to: 90 }}
onChange = {({ from = 0, to = 90 }) => {}}
// optional
isDisabled = {false}
radius = {150}
handlerRangeRadiusOffset = {30}
handlerRadius = {10}
min = {0}
max = {359}
isQuarterCircle = {false}
displayDashes = {false}
/>
)
91CA
}
}The value is the controlled range given by the parent components. Notice that the numbers will be considered as degrees (and not as radiants) and are between 0 to 360.
The function receives { from, to } as its arument as calculated from the picker.
Controls whether the controller is disabled or enabled. When the controller is disabled, handles are not draggable.
Radius of the full range.
Distance of the angle handler from the full range.
Radius of the angle handler.
Minimal value for the range (minimal value.from).
Maximal value for the range (minimal value.from).
Create a full range of only 0 until 90 degrees. The range will be the top-right range.
Displays 10px dash marks every 5 degrees
All the styles of the internal components are configurable via the next names.
- root
- rootBoundaries
- fullRange
- relativeAxis
- axisCenter
- centerAngleHandler
- offsetAngleHandler
- offsetsSegment
- offsetsSegmentRemove
MIT © jrehm135