-
Notifications
You must be signed in to change notification settings - Fork 886
Updated colab_facets.ipynb to make the atlas_url and sprite feature work using base64 data url. #232
Updated colab_facets.ipynb to make the atlas_url and sprite feature work using base64 data url. #232
Conversation
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.
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 What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
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. |
… image url." This reverts commit 18581a8.
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.
@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. |
Thanks again @jsiddique . I also added a link to this notebook in the Facets Dive README |
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.