Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Updated colab_facets.ipynb to make the atlas_url and sprite feature work using base64 data url. #232

Conversation

jsiddique
Copy link
Contributor

Problem:
The atlas and sprite feature is missing in the current Colab notebook example. The atlas_url feature in the current Colab example didn't work directly using local files and regular url. There is no easy way to pass the image using atlas_url from Colab.

Solution:
The solution is to read image from the file and convert it into base64 string. Then create a base64 image url from the string and pass the base64 image url directly into atlas_url.

Added new dive example showing the atlas_url and sprite feature. The notebook works in Colab and is able to show the visualizaiton properly.

Added new dive example showing the atlas feature.  This example works with Colab.  When I tried with regular image url I got 404 error.

The solution is to read image from the file and convert it into base64 string.  Then create a base64 image url from the string and embed it directly into the html and javascript code.
@google-cla
Copy link

google-cla bot commented Oct 27, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@jsiddique
Copy link
Contributor Author

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.

What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot I signed it!

@jameswex
Copy link
Contributor

Thanks for putting this together @jsiddique . Could you instead put this atlas example in a new ipynb file in the facets_dive directory? I think it makes sense to have it as a standalone Dive example notebook, separate from the simple one at the top-level directory.

After you do that, if its OK with you I might copy the two external files it depends on to our what-if-tool public cloud bucket so that the URLs they point to are connected to the project itself and update the notebook to point to those new URLs. Also perhaps you could add a comment in the notebook about how the atlas image file was created.

Problem:
The atlas and sprite feature is missing in the main Colab notebook example. The atlas_url feature in the current Colab example didn't work directly using local files and regular url. There is no easy way to pass the image using atlas_url from Colab.

Solution:
The solution is to read image from the file and convert it into base64 string. Then create a base64 image url from the string and pass the base64 image url directly into atlas_url.

Added new dive example showing the atlas_url and sprite feature. The notebook works in Colab and is able to show the visualizaiton properly.
Added description and useful information in a text cell.
Updated atlas image and meta data urls and point them to public what-if-tool bucket.
@jsiddique
Copy link
Contributor Author

@jameswex Thanks for the suggestions. Based on your comment I have reverted my previous commit and rolled back the changes I made to colab_facets.ipynb. I have created a new standalone colab Dive example notebook in facets_dive directory. The name of the file is colab_dive_atlas_demo.ipynb

Also added some comments in the notebook about how the atlas image file was created. Let me know if the changes are OK.

Definitely OK with me to copy the two external files in what-if-tool public cloud bucket. I have updated the notebook to point to those new URLs.

@jameswex jameswex merged commit 6912903 into PAIR-code:master Oct 27, 2020
@jameswex
Copy link
Contributor

Thanks again @jsiddique . I also added a link to this notebook in the Facets Dive README

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants