Skip to content
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

[Fix] Problems to add data to maps through python code in kepler-jupyter #2901

Conversation

lixun910
Copy link
Collaborator

@lixun910 lixun910 commented Jan 9, 2025

Revert the changes (which is probably added accidentally) in add_data() function from https://github.com/keplergl/kepler.gl/pull/2565/files#diff-9ad9c902c565677c69bdfc9666ed0fbfd12155854bd4339663e09bd475366ca1L143

Update version to 0.3.6

@lixun910 lixun910 linked an issue Jan 9, 2025 that may be closed by this pull request
Copy link

netlify bot commented Jan 9, 2025

Deploy Preview for keplergl2 ready!

Name Link
🔨 Latest commit cb9b588
🔍 Latest deploy log https://app.netlify.com/sites/keplergl2/deploys/678042a95fbfdb0008e7cf64
😎 Deploy Preview https://deploy-preview-2901--keplergl2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lixun910 lixun910 requested a review from igorDykhta January 9, 2025 21:43
@rbavery
Copy link

rbavery commented Jan 9, 2025

thanks for the fix @lixun910. I've tested this PR, geodataframes can be added but now two geodataframes cannot be added to the same map and be visualized. Tested https://github.com/keplergl/kepler.gl/blob/master/bindings/kepler.gl-jupyter/notebooks/GeoDataFrame.ipynb and only one of points_gdf or zipcode_gdf can be added at a time.

Selection_242

@lixun910
Copy link
Collaborator Author

lixun910 commented Jan 9, 2025

Thanks @rbavery ! In my test, I see only one layer been created from the first dataset. Is it the same on your side?

@rbavery
Copy link

rbavery commented Jan 10, 2025

hmm you're right actually after a fresh jupyterlab restart I see the issue again on the first run. I'm trying to diagnose what causes me to successfully plot both layers and why on the first run after jupyterlab start this doesn't occur.

@rbavery
Copy link

rbavery commented Jan 10, 2025

@lixun910 I found the culprit but I'm not sure what is the root cause

There's a cell in that notebook that shows the map before any layers are added. If we show the map before layers are added, only the first added layer is shown even if two datas are added

import keplergl
w1 = keplergl.KeplerGl(height=500)
w1

If instead we only make the map but don't show it before adding a layer, then we can show both layers and after adding the second layer both layers are plotted as expected

import keplergl
w1 = keplergl.KeplerGl(height=500)

so I think somehow the first map instance w1 is interfering with the state of subsequent maps.

@lixun910
Copy link
Collaborator Author

Ah, I see. I think it is by design: one needs to render the map with the new dataset in a new cell after calling add_data(), and the map in previous cell can keep the original state.

Screenshot 2025-01-09 at 7 47 01 PM

@lixun910 lixun910 merged commit 073c585 into master Jan 10, 2025
14 checks passed
@lixun910 lixun910 deleted the 2893-kepler-jupyter-problems-to-add-data-to-maps-through-python-code branch January 10, 2025 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Kepler-Jupyter] Problems to add data to maps through python code
3 participants