Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add screenshot provenance to notebooks #90

Merged
merged 2 commits into from
Mar 13, 2017

Conversation

danlamanna
Copy link
Contributor

Not sure if provenance is really the right word for it, but here it is.

Right now it's using a base64 image of a cat, but the logic is the same and will be replaced with a call to Map.screenshot when OpenGeoscience/geojs#665 is merged.

This essentially adds a screenshot of the map (hidden to the user) to the Jupyter notebook output each time a python cell is executed. The screenshot is stored in the .ipynb file which means that when an export to other formats (such as static HTML) is performed, the user can see step by step what happened to the GeoJS map as python commands were executed.

The only really hacky part about this (besides using _.wrap) is that we have to hide all PNG output by default with css to avoid our screenshot PNGs flashing on the screen for a second when the user loads the notebook. This means we have to "unhide" the other PNGs when they're rendered (and on load).

Integration test forthcoming.

@danlamanna danlamanna force-pushed the add-screenshots-for-html-export branch from 8dffaf3 to e2f2855 Compare February 9, 2017 13:50
@aashish24
Copy link
Member

@danlamanna are we expecting more code to be pushed onto this branch? Or is this ready for review. Perhaps you have to update it with master?

@danlamanna
Copy link
Contributor Author

@aashish24 More code will be pushed to this branch

@danlamanna danlamanna changed the title Add screenshot provenance to notebooks [WIP] Add screenshot provenance to notebooks Feb 27, 2017
@aashish24
Copy link
Member

@aashish24 More code will be pushed to this branch

ok thanks.

@danlamanna danlamanna force-pushed the add-screenshots-for-html-export branch 2 times, most recently from bfd6491 to be197d1 Compare March 8, 2017 20:39
@danlamanna danlamanna changed the title [WIP] Add screenshot provenance to notebooks Add screenshot provenance to notebooks Mar 8, 2017
@danlamanna
Copy link
Contributor Author

This has now been drastically scaled back due to issues with the asynchronous nature of the notebook. There's now a button to take screenshots which will be displayed (only when on a code cell) and endure exports to various formats. @kotfic

@danlamanna danlamanna force-pushed the add-screenshots-for-html-export branch from be197d1 to a6c631d Compare March 13, 2017 13:31
Copy link
Contributor

@kotfic kotfic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me once it passes CI. Thanks!

Due to various issues with how the notebook fundamentally
works (asynchronously). It was decided that it would be better for now
to allow the screenshotting of the map to be a manual process. This
commit adds a button which does just that.
@danlamanna danlamanna force-pushed the add-screenshots-for-html-export branch from a6c631d to a7e8d3e Compare March 13, 2017 17:33
@danlamanna danlamanna merged commit bd7d912 into master Mar 13, 2017
@danlamanna danlamanna deleted the add-screenshots-for-html-export branch March 13, 2017 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants