GeoDaCenter / data-and-lab

For CSDS: sample data, data cleaning, labs and miscellaneous
https://geodacenter.github.io/data-and-lab/
0 stars 3 forks source link

Replace leaflet with kepler.gl #40

Closed lixun910 closed 9 months ago

lixun910 commented 11 months ago

@dpeachpeach Hi David, for replacing leaflet with kepler.gl, I think you can try the following 2 solutions:

  1. use kepler.gl in UMD fashion, e.g. https://github.com/keplergl/kepler.gl/blob/master/examples/umd-client/index.html which will be the same as using leaflet but rendering the GeoJson data in kepler.gl
  2. add react component in Jekyll, and this component wraps kepler.gl component. See how to wrap kepler.gl component in a Next.js react project: https://github.com/keplergl/kepler.gl/blob/master/examples/umd-client/index.html

If you are already working on some solutions, please feel free to create a branch and PR, and I can help to review it. Thanks!

lixun910 commented 11 months ago

@dpeachpeach Hi David, here is a working code that uses next.js and kepler.gl https://codeload.github.com/GeoDaCenter/reactgeoda/zip/3c5fad39895912a96bcd8e4574ab159d70988f30 You can also check it at the commit: https://github.com/GeoDaCenter/reactgeoda/tree/3c5fad39895912a96bcd8e4574ab159d70988f30

You can add it in a directory e.g. react/ at the root level, and write the build output to src/js/bundler.js if possible -- you will need to manually configure the webpack to do so.

Let me know if this works. I also have a working code that uses webpack and kepler.gl. I can share with you if needed. Thanks!

dpeachpeach commented 11 months ago

@lixun910 Hey Xun, can you share the working code that utilizes webpack and kepler.gl? Thanks!

lixun910 commented 11 months ago

@dpeachpeach See my comment above: you can use https://codeload.github.com/GeoDaCenter/reactgeoda/zip/3c5fad39895912a96bcd8e4574ab159d70988f30

You can add it in a directory e.g. react/ at the root level, and write the build output to src/js/bundler.js if possible -- you will need to manually configure the webpack to do so.

Let me know any questions.

dpeachpeach commented 11 months ago

Hey @lixun910 , I'm working with the zip file you provided. (still integrating into the old website but I got curious, I know i don't need to touch it) I try to run npm i in the directory to install all of my dependencies, but I get this error, npm ERR! Could not resolve dependency: npm ERR! peer react@"0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0" from enzyme-adapter-utils@1.14.1 npm ERR! node_modules/enzyme-adapter-utils npm ERR! peer enzyme-adapter-utils@"^1.13.0" from react-palm@3.3.8 npm ERR! node_modules/react-palm npm ERR! react-palm@"^3.3.6" from the root project Implying that there is some issue with react-palm.

Did you get this error? I'm using the same package json and lock as you so I don't see why there should be issues.

Thanks!

lixun910 commented 11 months ago

@dpeachpeach I use yarn with node version 16 (you can use volta and just run volta pin node@16). Let me know if this solves the problem. Thanks!

dpeachpeach commented 11 months ago

@lixun910 Hi, I used nvm but I switched the node version to 16.0.0. I still haven't solved the problem :-(

Screenshot 2023-08-01 at 9 02 43 PM
dpeachpeach commented 11 months ago

@lixun910 Ok I seem to have gotten it to work with Node version 14. Still, I would like to use the latest version possible, do you have any suggestions for a fix?

lixun910 commented 11 months ago

Did you try yarn instead of npm? (delete the node_module folder first).

If node v14 works then we can pin to v14 for now. We can upgrade to latest later.

On Aug 1, 2023, at 7:08 PM, Wololo @.***> wrote:



@lixun910https://urldefense.com/v3/__https://github.com/lixun910__;!!BpyFHLRN4TMTrA!-F1iNq3VDQSk3JcoTmypm4ZePMwN61b_anZ9eWqagpQ21S8yqbEvnA90_GS0IhZlTUMPlfiv-sTuGWqnPFqz-kFPzg$ Ok I seem to have gotten it to work with Node version 14. Still, I would like to use the latest version possible, do you have any suggestions for a fix?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/GeoDaCenter/data-and-lab/issues/40*issuecomment-1661378931__;Iw!!BpyFHLRN4TMTrA!-F1iNq3VDQSk3JcoTmypm4ZePMwN61b_anZ9eWqagpQ21S8yqbEvnA90_GS0IhZlTUMPlfiv-sTuGWqnPFpzHJlMCQ$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AASPYT3FEWXRSYPUDP3P7H3XTGZBZANCNFSM6AAAAAAZZCWCZI__;!!BpyFHLRN4TMTrA!-F1iNq3VDQSk3JcoTmypm4ZePMwN61b_anZ9eWqagpQ21S8yqbEvnA90_GS0IhZlTUMPlfiv-sTuGWqnPFr3Q1mXSA$. You are receiving this because you were mentioned.Message ID: @.***>

dpeachpeach commented 11 months ago

Actually it doesn't work with v14 (For building, it just works in installing the modules) I'll wake up early and try it with yarn tomorrow morning and let you know what the results are.