Skip to content

Conversation

@mfisher87
Copy link
Member

@mfisher87 mfisher87 commented Jan 16, 2025

Description

Implemens the 💃 GIS Bounce 🕺 in JupyterGIS.

This is a streamlined version of the QGIS Bounce workflow.

jupytergis-explore-demo.mp4

Exploring a dataframe (example notebook) is just one line of code (excluding imports, of course 😉):

from jupytergis import explore

explore(gdf)

This opens a side panel with JupyterGIS displaying the data with a basemap.

Still TODO, and I don't have time today:

  • Rebase and credit contributors from 4/16 hackathon (see https://github.com/mfisher87/jupytergis/tree/sidecar-experiment-bkp commits)
  • Add a video demo to this PR
  • Pass in dataframe directly
  • Support more file types and data types -- future PR?
  • BUG: The layers list is empty when the sidecar is first focused. Workaround: Load a different .jGIS file or open a notebook widget to trigger the layers list to populate; then focus back to the sidecar to update the layers list to show the layers in the sidecar.
  • Open the JGIS sidebars when displaying. This can be implemented using the docmanager approach, or we can find another way.

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--340.org.readthedocs.build/en/340/
💡 JupyterLite preview is available from the doc, by clicking on lite badge

@mfisher87 mfisher87 added the enhancement New feature or request label Jan 16, 2025
@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch mfisher87/jupytergis/sidecar-experiment

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2025

Integration tests report: appsharing.space

@mfisher87 mfisher87 changed the title Prototype of streamlined Graphical GIS <-> Notebook "bounce" workflow [WIP] Prototype of streamlined Graphical GIS <-> Notebook "bounce" workflow Jan 16, 2025
@mfisher87 mfisher87 force-pushed the sidecar-experiment branch 3 times, most recently from 9103433 to 5b96097 Compare January 28, 2025 02:03
@brichet
Copy link
Collaborator

brichet commented Feb 6, 2025

FYI @mfisher87 #419 has been merged, you can probably revive or remake this PR.

@mfisher87
Copy link
Member Author

Awesome work @brichet !! I hope to have some time to play with this tomorrow.

@mfisher87 mfisher87 linked an issue Mar 3, 2025 that may be closed by this pull request
@mfisher87 mfisher87 force-pushed the sidecar-experiment branch from 8cd5bbc to fe74cbf Compare March 25, 2025 23:11
@mfisher87 mfisher87 force-pushed the sidecar-experiment branch from 12fae9c to 44f805a Compare April 17, 2025 19:16
"""
return self._layerTree.to_py()

def save_as(self, path: str | Path) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This copies the document, whereas a "save as" operation would also change the current working document to alter the new file. We don't have the comms setup to do this yet. Restored the export_to_qgis public API function for now as well.

@mfisher87 mfisher87 changed the title [WIP] Prototype of streamlined Graphical GIS <-> Notebook "bounce" workflow [WIP] Streamlined Graphical GIS <-> Notebook "bounce" workflow Apr 17, 2025
@mfisher87
Copy link
Member Author

BUG: The layers list is empty even when the sidecar is focused. I need to load a .jGIS file or open a notebook widget to populate the layers list, then focus back to the sidecar, and then it works.

@mfisher87
Copy link
Member Author

mfisher87 commented Apr 18, 2025

All, we gave an internal demo of this feature today, and @fperez was over the moon to see it in action, even at this early stage. Couldn't have shown it today without your support. It will be even more impressive when we show it at the conference in a couple weeks :)

Thank you!! ❤️

@fperez
Copy link

fperez commented Apr 18, 2025

Indeed, while there's still work to do, this is already very impressive progress!! Thanks team and congrats!!! 🚀🎉

@SylvainCorlay
Copy link
Contributor

Hey @mfisher87 I extracted the CSS fix on output views in #643, so that it can be merged independently, cherry-picking your commit.

@mfisher87 mfisher87 force-pushed the sidecar-experiment branch from 29e7b31 to b47a01e Compare April 23, 2025 02:29
@mfisher87 mfisher87 changed the title [WIP] Add explore() function and GISDocument.sidecar() method Add explore() function and GISDocument.sidecar() method Apr 23, 2025
@mfisher87 mfisher87 requested a review from gjmooney April 23, 2025 03:16
@mfisher87
Copy link
Member Author

All, [WIP] tag removed; ready for review!

@arjxn-py
Copy link
Member

arjxn-py commented Apr 23, 2025

Just triggered the lite integration test again
As i don't see it failing with the latest lite deployment:
image

@mfisher87
Copy link
Member Author

https://jupytergis--340.org.readthedocs.build/en/340/lite/lab/

image

Oof. I'm not sure what's up here; jupyter-collaboration v4 is out which eliminates the RTC prefix, but we are pinned to <4.

# See: https://github.com/geojupyter/jupytergis/issues/585
- ../python/jupytergis_core
- ../python/jupytergis_lab
- ../python/jupytergis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the culprit for the failure in the docs. We can't have jupytergis installed in the lite deployment of the docs.

It needs to be jupytergis_lite or nothing.

Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @mfisher87 .
I added a few comments below.

@mfisher87 mfisher87 force-pushed the sidecar-experiment branch from 66c3cd6 to b84c701 Compare April 24, 2025 22:37
@mfisher87 mfisher87 force-pushed the sidecar-experiment branch from b84c701 to 1503af3 Compare April 24, 2025 22:38
mfisher87 and others added 2 commits April 24, 2025 16:50
@mfisher87
Copy link
Member Author

The Lite tests are still timing out 😖

@martinRenou
Copy link
Member

martinRenou commented Apr 25, 2025

@mfisher87 I tried the lite deployment in the docs, it looks like the import fails with:

Screenshot From 2025-04-25 08-01-34

I assume this is the reason for the timeout (waiting for the map that never shows up in the notebook cell output because of the import error)

I believe it's due to jupyterlite-xeus installing pip dependencies with --no-deps (that's another story...). Can you try adding the sidecar dependency here: https://github.com/geojupyter/jupytergis/blob/main/lite/environment.yml#L13

Also, we should export explore here like you did for the main metapackage https://github.com/geojupyter/jupytergis/blob/main/python/jupytergis_lite/jupytergis/__init__.py

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty to make the last remaining changes to get the lite deployment to work, I hope you don't mind! Thanks 🚀

@martinRenou martinRenou merged commit 8f2ff7f into geojupyter:main Apr 25, 2025
14 checks passed
@mfisher87
Copy link
Member Author

mfisher87 commented Apr 25, 2025

I took the liberty to make the last remaining changes to get the lite deployment to work, I hope you don't mind! Thanks 🚀

Not at all, that's greatly appreciated 🙇

__version__ = "0.4.4"

from jupytergis_lab import GISDocument # noqa
from jupytergis_lab import GISDocument, explore # noqa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, didn't know this was needed, thanks so much 🙇

@mfisher87 mfisher87 deleted the sidecar-experiment branch April 25, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a JGIS workflow to streamline the "QGIS bounce" pattern

7 participants