PAIR-code / facets

Visualizations for machine learning datasets
https://pair-code.github.io/facets/
Apache License 2.0
7.36k stars 886 forks source link

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

Closed jsiddique closed 4 years ago

jsiddique commented 4 years ago

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.

google-cla[bot] commented 4 years ago

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).

:memo: 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 commented 4 years ago

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 commented 4 years ago

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.

jsiddique commented 4 years ago

@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 commented 4 years ago

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