nteract / semiotic

A data visualization framework combining React & D3
https://semioticv1.nteract.io/
Other
2.44k stars 133 forks source link

unable to resolve module 'os' #148

Closed sanealytics closed 6 years ago

sanealytics commented 6 years ago

Hi there,

I'm trying to use this module in react-native. And I am getting the following errors -

The package at "./node_modules/json2csv/lib/json2csv.js" attempted to import the Node standard library module "os". It failed because React Native does not include the Node standard library. Read more at https://docs.expo.io/versions/latest/introduction/faq.html#can-i-use-nodejs-packages-with-expo

I was going this way after reading your medium post

Is this the best way to get D3 working in react-native as you described in the post?

If so, how do I correct it? Sorry, I'm new to react so I lack the experience to debug this further myself.

Regards, S

emeeks commented 6 years ago

Hi @sanealytics I'm afraid there are a few bits in Semiotic that are going to make it hard to work in React Native. I really need to test it and make some changes so it doesn't include some of the dependencies that won't work with Native but I haven't gotten around to it. For now, I would say don't use Semiotic in React Native and I will leave this thread open and comment as I try to deal with that development area. It's a goal, but not one that I expect to have the time to deal with soon.

If you're familiar with D3, you can use VX to create individual data viz pieces in React that should be Native compatible, if you're looking for a charting framework, I believe Victory has the best React Native compatibility.

sanealytics commented 6 years ago

Thanks for the prompt response. I was not familiar with VX (only used D3 for internal demos).

Will look into these options. And thanks again for your work on D3 and visualization in general.

Regards, S