Giter Site home page Giter Site logo

netbeast / react-native-dial Goto Github PK

View Code? Open in Web Editor NEW
67.0 11.0 16.0 338 KB

A react native reusable and efficient dial knob element

Home Page: https://getyeti.co/

License: MIT License

JavaScript 65.93% Python 7.89% Java 6.01% Objective-C 20.17%
react-native component ui knob dial

react-native-dial's Introduction

react-native-dial

npm version

works with yeti

 This package powers Yeti Smart Home and is used in production.

A react native reusable and efficient dial knob element.

import { Dial } from 'react-native-dial'
// ...
<Dial 
   initialRadius={brightness * DIF_RADIUS / 100 + MIN_RADIUS}
   radiusMax={MAX_RADIUS}
   radiusMin={MIN_RADIUS}
   onPress={() => this.toggle()}
   responderStyle={styles.responderStyle}
   wrapperStyle={styles.wheelWrapper}
   onValueChange={(a, r) => this.changeBrightness(r)} />

demo screenshot

Some properties:

<Dial
 fixed // disallows angle updates
 elastic // allows scaling the element
 initialAngle={Number}
 initialRadius={Number}
 radiusMax={Number}
 radiusMin={Number}
 responderStyle={ReactNative.Styles}
 wrapperStyle={ReactNative.Styles}
 >
 {/* 
   Optionally you can pass children so it renders a different component of your choice as a Dial,
   that can change in scale and angle
 */}
   <YourCustomDial />
 </Dial>
 

More documentation is incoming, in the meanwhile please read the source code. It is a single file! PRs and issues are more than welcome.

Follow us in Github or https://twitter.com/netbeast_co.

react-native-dial's People

Contributors

franrios avatar jsdario avatar pablopi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-dial's Issues

Example

Great work guys.

Would you have an example of implementation to share? I saw in the root README this:

initialRadius={brightness * DIF_RADIUS / 100 + MIN_RADIUS}
radiusMax={MAX_RADIUS}
radiusMin={MIN_RADIUS}

but was wondering what would be brightness, DIF_RADIUS, MIN_RADIUS or MAX_RADIUS.

Thanks!

Odd behavior with precision

It seems like the precision prop that is used to configure how granular the turning of the knob is, is off. Not sure exactly what it is, I'll be investigating since it could be my usage of it, but I figured I'd post this in case someone else has a similar issue. It seems like every now and then the knob will completely disregard the precision prop and became super super sensitive again.

It seems like when you change the direction in which you're turning the knob, the knob becomes super sensitive in that direction but remains normal in the other direction.

this.props.onValueChange is not a function

this.props.onValueChange is not a function. (In 'this.props.onValueChange(deg,radius)', 'this.props.onValueChange' is undefined)

Did you manage to make this component work?

ColorWheel ?

Hello, thank you for the top project. In the example ColorWheel is used, unfortunately I can not find this in the project? Is this the ColorWheel that the Yeti App uses?

Many Thanks.

comonentWillMount deprecated

Hi
using expo 36.0.0 and there is such warning

Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Dial

according to official documentation https://en.reactjs.org/docs/react-component.html#unsafe_componentwillmount componentWillMount is deprecated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.