googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.2k stars 722 forks source link

Add ipytree support (Jupyter widget for tree-structured data) #2522

Closed tylere closed 2 years ago

tylere commented 2 years ago

Add support for the ipytree within Colab.

Screen Shot 2021-12-20 at 11 50 14 AM

Is your feature request related to a problem? Please describe. When working with geospatial data, there is often a need to inspect layers of information (often nested) for a region of interest. With the addition of Colab support for ipyleaflet, there is a way to display and interact with spatial data, but there is a related need to display layer data.

Describe the solution you'd like Provide a way to install and use the third-oarty jupyter widget ipytree. A good test case would be the ability to run the ipytree_ileaflet example.

Describe alternatives you've considered I have considered manually building simple trees using the standard jupyter widgets, but that seems like reinventing the wheel...

Additional context When trying to display an ipytree widget in Colab, Chrome developer tools reports a 404 error accessing the following:

manager.min.js:1654` GET https://cdn.jsdelivr.net/npm/ipytree@0.2.1/dist/index.js 404

I confirmed that the file is not accessible from the CDN, however, there are other related CDN files for ipytree@0.2.1 https://www.jsdelivr.com/package/npm/ipytree

giswqs commented 2 years ago

I second the support for ipytree @martinRenou. I have a Python package for geospatial analysis called whiteboxgui, which is used by geemap and leafmap. I implemented it using both ipywidgets and ipytree. Currently, only the ipywdigets version works in Google Colab. Here is a notebook example image image

Implemented using ipywidgets image

Implemented using ipytree image

Demo tutorial

blois commented 2 years ago

The ipytree_ipyleaflet.ipynb example appears to work using ipytree==0.2.0:

https://colab.research.google.com/gist/blois/1af162473872445cbece540ffe6830c4/untitled1200.ipynb

The dist/ folder does not appear in the 0.2.1 release.

tylere commented 2 years ago

Closing since Colab support is working as intended... just need to get the CDN copy corrected.