Skip to content

Support installation of custom widgets. #498

Closed

Description

@blois

Currently Colab only supports the widgets included in the ipywidgets package and does not allow installing additional widgets.

Additional background is available at https://github.com/nteract/nes/tree/master/portable-widgets.

Activity

  1. korakot commented on Apr 27, 2019

    @korakot

    Qgrid would make it easier to work with pandas dataframe.

    Hope it will be supported in the future.

  2. cornhundred commented on May 7, 2019

    @cornhundred
  3. blois commented on May 7, 2019

    @blois
    Author
  4. cornhundred commented on May 7, 2019

    @cornhundred

    Thanks @blois for your help. In order to run the notebook you sent I had to add the Seasons_Stats.csv (from here https://www.kaggle.com/drgilermo/nba-players-stats) to the filesystem.

    However, I did not see the interactive visualization. Update: the heatmap did show up after a minute. I'll think about how to clean up the implementation. Thanks again!!

    Looking forward to custom widget support, but this definitely helps out in the interim.

    BTW @blois, how can I upload a dataset permanently into a shareable colab notebook (e.g. the sandbox link you sent)?

    Here is a link to a notebook that does not require an external dataset https://colab.research.google.com/gist/cornhundred/b7154ee964c71cec6a2378f9cbba8eeb/clustergrammer2_example.ipynb?authuser=1

    cc @manugarciaquismondo.

  5. blois commented on May 17, 2019

    @blois
    Author

    @korakot we recently added an interactive dataframe viewer that we've been using internally for ages.

    You can enable it by default with:

    %load_ext google.colab.data_table
    from vega_datasets import data
    data.cars()

    Or use it on a per-dataframe basis:

    from google.colab.data_table import DataTable
    from vega_datasets import data
    DataTable(data.cars())
  6. korakot commented on May 18, 2019

    @korakot

    @blois Thanks a lot. It will surely help.

    BTW, is there a widget to edit the dataframe as well?

    And what other %load_ext are available? Is there a list somewhere?

  7. Kreijstal commented on Jun 20, 2020

    @Kreijstal

    can you install custom widgets now? I'd like to have a variable previewer just like allefeld/ipyinspector#1

  8. Location-Artistry commented on Aug 13, 2020

    @Location-Artistry

    This problem still persists with Google Colab on August 13th, 2020.
    ArcGIS Python API maps will not display.
    All the other portions of the API seem to work great in Colab, and I am able to conduct ArcGIS Online Admin from Colab.
    Currently switching over to the AGOL Jupyter Notebook interface to view the map widget display.
    Perhaps there could be a clever workaround by exporting to html or viewing as JavaScript.

  9. giswqs commented on Sep 19, 2020

    @giswqs

    @blois Please add support for ipyleaflet, which would make visualizing and interacting Google Earth Engine tile layers much easier with the earthengine-api. @tylere @SylvainCorlay @martinRenou @davidbrochart

  10. jasonho-lynx commented on Jun 18, 2021

    @jasonho-lynx

    Hi, let me know if this isn't the right place - it would be great to have support for pymotif, which is a Jupyter widget for Motif, a no-code graph visualization platform. Thank you! @timlrx

  11. ucalyptus commented on Jul 10, 2021

    @ucalyptus

    @blois any updates on this?

  12. Berowne commented on Aug 31, 2021

    @Berowne

    Qgrid would make it easier to work with pandas dataframe.

    Hope it will be supported in the future.

    +1 for QGRID

  13. blois commented on Sep 1, 2021

    @blois
    Author

    We are working on this, some details of the proposal are in https://github.com/googlecolab/colab-cdn-widget-manager.

    Right now the support can be experimented with by adding to the cell displaying the widget:

    from IPython.display import Javascript
    
    display(Javascript('''
      google.colab.widgets.installCustomManager('https://ssl.gstatic.com/colaboratory-static/widgets/colab-cdn-widget-manager/6a14374f468a145a/manager.min.js');
    '''))

    This will remain opt-in but we plan to work on improving the mechanism.

    Some examples:

    This specific widget manager version is tied to @jupyter-widgets/base v5.0.0a so there may be some incompatibilities with with specific widget versions (https://github.com/bloomberg/ipydatagrid is known to be incompatible for example).

    Please feel free to open specific bugs in https://github.com/googlecolab/colab-cdn-widget-manager/issues.

  14. 24 remaining items

  15. kylebarron commented on Nov 29, 2021

    @kylebarron

    From my comment here #498 (comment)

    The Plotly FigureWidget subclasses from both BaseFigure and widgets.DOMWidget. The .show() comes from BaseFigure, so when you call .show it's rendering a static HTML output without touching the widget machinery at all.

    In order to render the widget and not the static HTML output mode, you need to render without .show. The below Colab notebook is a direct copy of this page in the Plotly docs, adding only the command to enable custom widgets.

    Open In Colab

    Here, the widget doesn't render, and I see this console error:
    image

  16. lukewys commented on Nov 30, 2021

    @lukewys

    Here's an example for qgrid: https://colab.research.google.com/gist/blois/3b36d0aa4c32d2ecc71e9208c32cf333/qgrid.ipynb

    For those who want to use qgrid in their Colab notebook but don't want to confuse people on colab force restart, I found a workaround for using qgrid without restarting the session. The question is about qgrid 1.1.1 not supporting pandas>1.0.0. You can fork qgrid to your own repo, roll back the version to 1.1.1, and change the code according to quantopian/qgrid#287. Then, you could pip install via git from your repo.

    For example, you can do pip install git+https://github.com/lukewys/qgrid.git (a fork of qgrid where I fixed this issue).

  17. tylere commented on Dec 20, 2021

    @tylere

    Please add support for the ipytree widget too: #2522

  18. cardinalgeo commented on Dec 20, 2021

    @cardinalgeo

    Here, the widget doesn't render, and I see this console error:

    @kylebarron thanks for the Plotly widget example! I can't find a way to view the console error (is it from terminal, which is only available with colab pro)? Do you have any sense of whether this issue can be resolved on the Colab side or if it will require work on the Plotly side?

  19. blois commented on Dec 20, 2021

    @blois
    Author

    @cardinalgeo Support for the plotly widgets was tracked in googlecolab/colab-cdn-widget-manager#19. There's a link to your example working in there.

  20. blois commented on Dec 20, 2021

    @blois
    Author

    At this point installation of custom widgets is supported. This requires opting in by using the code:

    from google.colab import output
    output.enable_custom_widget_manager()

    Specific widgets may need additional investigation or tweaks. It's easiest to open individual issues for these investigations. Most of the bugs have been tracked in https://github.com/googlecolab/colab-cdn-widget-manager/issues?q=is%3Aissue.

  21. cardinalgeo commented on Dec 21, 2021

    @cardinalgeo

    Hi @blois, thanks for the follow up! However, the example still seems to not work. I'll continue this thread in googlecolab/colab-cdn-widget-manager#19

  22. martinRenou commented on Dec 21, 2021

    @martinRenou

    Thanks a lot for your work on this @blois !

  23. cornhundred commented on Dec 21, 2021

    @cornhundred

    Thanks @blois!!! This is amazing!

  24. nulflux commented on Aug 19, 2022

    @nulflux

    Today ipywidgets Text will no longer work. There is a message about adding two lines to allow external widgets loading but that does not fix the problem.

  25. colaboratory-team commented on Aug 19, 2022

    @colaboratory-team
    Contributor

    @nulflux downgrading the ipywidgets version should work for you until we can get a fix out:

    !pip install ipywidgets==7.7.1 and then restart your runtime

  26. nulflux commented on Aug 19, 2022

    @nulflux
  27. blois commented on Aug 22, 2022

    @blois
    Author

    Added some details on the issue in #3020 (comment).

  28. ammarsaf commented on Mar 24, 2025

    @ammarsaf

    Already !pip install ipywidgets==7.7. but not working today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions