-
Notifications
You must be signed in to change notification settings - Fork 38
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
Responsive SVGs #6
Comments
Yeah this isn't the easiest thing to do at the moment.. If you have any ideas for what API would work well here, let me know! |
Ok cool, wasn't sure if I was missing something. I'll think this over. Thanks. |
@jbhatab FWIW, I looked into that too. I was using react-native-viewport and implemented it as you can see here: https://github.com/chroth7/react-native-svg/blob/master/Apps/Landing.js. I get the dimensions on mount and also add a listener to capture rotations. As you can see I had some minor issue with a race condition, so I set a small timeout, cheating. Also, I use a different setup to yours, but maybe you get something helpful out of my code... |
Nice one @chroth7! |
Thank you so much @chroth7! First thing I noticed was you aren't even using a style height and width which I think was adding even more confusion to my problem. I was just taking that from the demo though. I'll play with your code for sure. |
glad you guys like the idea - hope it helps. Let me know if you have some questions - and please do let me know if you find a smarter way to do that! |
Trying to get your setup going but I'm not enable to get the Viewport.getDimensions function to run for some reason. Any ideas? |
are you sure you |
Yup i installed it and it's there but it's just not doing anything. No error. |
note that |
My bad. Forgot to do all the xcode binary stuff. Gotta get used to that. I'm gonna play with it more and I'll post my findings. |
@chroth7 I installed your alpha-prototype version.. but got the following issue. |
@ColinUNCG to be honest, I haven't checked if my prototype is still running on the new react-native versions. But that sounds familiar, I think I had a similar issue with the node_modules directory at that time, I solved it with hint 1 in the installation notes (see readme): can you check if that helps? |
@chroth7 Hi Chris, Is there any chance that you have worked the same prototype with android If yes can you please share the details or share any idea to achieve the same results. |
@MuruganDurai sorry, I haven't been working on these things for a good while now and am not really up to speed anymore, especially in terms of Android. I hope to find time soon again to invest in ReactNative, but currently, I am afraid I cannot give a well-thought-through idea let alone solution for Android, sorry! |
@chroth7 No issues. Thanks. @brentvatne Can you please shed some light? |
I got D3 going and am making charts successfully, but the height width relationship is just crazy hard to understand. You set the height/width on the svg, in d3, and on the s3 container it seems. But getting it to responsively work with this relationship on every phone has not been working.
Here's the code.
Here's what it looks like on the iphone 4s, iphone 6, and iphone 6 plus.
The text was updated successfully, but these errors were encountered: