-
Notifications
You must be signed in to change notification settings - Fork 7
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
Consolidate react-native MPChart libraries #1
Comments
Hi @mikemonteith, I was wondering if you were still working on merging your library with @Jpadilla1. Thanks! |
@Taakn That's the plan. Although getting the Android version as complete as possible is the priority for me at the moment. (pull requests welcome for anything ios based) |
@Taakn I'm on the same path as @mikemonteith to get the iOS version as complete as possible. Along the way, we could merge both libraries when we are happy enough with the completion. |
Ok thanks so much for your work on porting MPChart to React Native! |
Ok so thanks to you both, I managed to get your chart libraries working on React 0.19.0 on both iOS and Android. I have a wrapper that works as follows, so I don't think it really matters to have one repo for iOS, and one repo for Android:
It gets a little more complicated when I want to get a chart working on both, for instance:
It's almost the same basically, with the exception that @Jpadilla1 you wrap everything inside a So I don't know how you want to proceed in terms of interoperability. For me it's not a big deal given that I can write a wrapper for both, but it would be fantastic to have two components that are as similar as possible when you want to create a chart. Anyway I think you're both doing a fantastic job and I really want to thank you for everything that you're doing, but also for answering my questions when I was trying to get your libraries up and running. |
@Taakn you are very welcome and that's awesome that you got both of our libraries working! The reason why I only use 1 property for everything is that in my experience with iOS and the iOS-Charts library, every time I passed a new property it triggered a render. So let's say we have a BarChart component like this <BarChart data={...} pinchZoomEnabled={false} gridBackgrounColor='99000'/> That would trigger 3 renders. So to avoid that I use just 1 property If their is a better way I'm open ears :) |
@Jpadilla1 It doesn't sound like that would be standard React component behavior. Maybe because you're using native components? Were you able to measure a difference in performance? |
@Jpadilla1 is the 3x re-render happening in the React layer or native? I think the native layer should be able to handle props changing so as to only re-render when needed but code will need to be written to handle that. |
Hey @mikemonteith I'll re visit this issue and get back to this thread. Let's decide on how the properties are going to be passed over to iOS/Android. I think that since the libraries have a lot of properties that it's best to have a single configuration object with all the properties. That would make the JSX much cleaner and properties can be shared across multiple charts. Also, I want to finish supporting all the charts of ios-charts (only missing CombinedChart) and then I would like to focus on Android. Do you need help? |
No description provided.
The text was updated successfully, but these errors were encountered: