New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conical gradient support #41
Comments
Any luck on finding your conical gradient... I need that in a slider as well |
Yes I'm looking for something similar, I want to animate the colour of the fill. I can get it to work by removing the validation of |
@fdnhkj Cannonical gradients aren't supported in SVG. In my other component (https://github.com/bgryszko/react-native-circular-slider) I achieve exactly what you're looking for by splitting circle into segments and draw small linear gradients – in practice if gradient colors difference is subtle or there are enough "segments" it'll look as if it's cannonical gradient. Link to specific code: |
Indeed, I forgot to update this issue with my findings, I'll try to find back my repo & share it. Basically I switched to react-native-svg and as you mentioned splited the circle in multiple segments with attached linear gradients (see http://jsfiddle.net/Cy7ec/3/). The conical gradient was looking fine on both iOS & Android but I had quite some issues with the Android animations (lots of dropped fps). It's maybe worth trying with the latest versions of react-native & react-native-svg. |
That's great! In fact this library would need switch over to react-native-svg as well.
Bart
… On 8 Jan 2017, at 12:47 AM, Fidan Hakaj ***@***.***> wrote:
Indeed, I forgot to update this issue with my findings, I'll try to find back my repo & share it.
Basically I switched to react-native-svg and as you mentioned splited the circle in multiple segments with attached linear gradients (see http://jsfiddle.net/Cy7ec/3/).
The conical gradient was looking fine on both iOS & Android but I had quite some issues with the Android animations (lots of dropped fps).
It's maybe worth trying with the latest versions of react-native & react-native-svg.
I will give you updates ASAP.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Voilà, I published my findings after upgrading to latest It looks like there are some dropped fps. I don't really see how to improve it tho, suggestions are welcome 🙂 Fidan |
I'm happy to accept PR if anybody would be able to merge this into main lib. |
+1 |
2 similar comments
+1 |
+1 |
@fdnhkj |
@fdnhkj based on this research the only possible solution to improve FPS is using canvas instead of svg |
+1 |
@bartgryszko I can try add this feature, into react-native-circular-progress. |
@fdnhkj How to make it spin in the opposite direction? i.e clockwise instead of anticlockwise |
@hanishcodebrew you can wrap component into <View style={ { transform: [ { scaleX: -1 }] } }> or use similar code |
Thanks @MikePodgorniy for the instant reply. It works. I am facing a issue in Android. I have given 45 to fill but its showing complete circle. And also can we add image and text inside the circle ? |
@MikePodgorniy I'm not actively participating in developing this library as I'm not working on any RN project currently. That said, feel free to add PR, if not me, maybe @Jacse or @markusl would be able to review and merge it. |
@hanishcodebrew yes, you can 👍 use render callback to this. but you need to rescale your inner components again |
@fdnhkj,@GroupXTech,@morelazers,@bartgryszko,@fdnhkj,@NeXTs,@MikePodgorniy,@hanishcodebrew : @fdnhkj: Your module react-native-conical-gradient, I do not find it on npm you can upload it, can you also put an example code? @MikePodgorniy: Your module react-native-conical-gradient-progress, I do not find it on npm you can upload it, can you also put an example code? For both: An example that can also be tried on snack.expo.io, would be very ideal. |
@Angelk90 Try now, it is available as an npm-package: You can find an example here – https://github.com/MikePodgorniy/react-native-conical-gradient-progress/tree/master/example if you use clear react-native you should install react-native-svg. |
@MikePodgorniy : I do not understand why among the dependencies you did not put svg in the package.json? |
@MikePodgorniy : I tried to convert your module to try it on https://snack.expo.io/ |
@Angelk90 |
@MikePodgorniy : Do not allow me to create issues in the indicated project. |
@Angelk90 sorry, try again |
@MikePodgorniy : I answered you in your project, I look forward to your response. |
I have the same problem as well, the UI's fps is dropped to 2x. Any ideas on how to improve it? |
It would be nice to have support for conical gradient.
Has anyone an idea on how to implement it ?
The text was updated successfully, but these errors were encountered: