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

PerspectiveWidget HTML export support in Jupyter #2418

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

tomjakubowski
Copy link
Contributor

No description provided.

@texodus texodus changed the title WIP: PerspectiveWidget HTML export support in jupyter PerspectiveWidget HTML export support in Jupyter Nov 7, 2023
@tomjakubowski
Copy link
Contributor Author

As it is currently, rendering the HTML output is unconditional and this will add some bloat to all .ipynb using PerspectiveWidget. Every render of a PerspectiveJupyterWidget adds the HTML output to its cell's output in the .ipynb . This includes a base64-serialized arrow of every viewer's data, without deduplication, and a few lines of Javascript and HTML to glue it together.

We can make this configurable and/or optional in Perspective, for users who don't care to support exporting. Would a global setting or per-widget setting make sense?

@tomjakubowski tomjakubowski marked this pull request as ready for review November 8, 2023 03:16
@timkpaine
Copy link
Member

per-widget, what about if I stream data in and call update() a bunch of times, will it reflect the latest?

@tomjakubowski
Copy link
Contributor Author

I don't have very much experience doing streaming perspectives but I'll check. I think it reflects whatever was in the table at the time the cell first rendered, which is probably undesirable.

@tomjakubowski
Copy link
Contributor Author

tomjakubowski commented Nov 10, 2023

Added a class variable on PerspectiveWidget to gate this new feature behind an undocumented flag while we're tooling on it. Also fixed a bug in the HTML's reference to the datagrid js module

It can be set on the class to make all widgets render HTML output, or on an instance to make only that widget do it

Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

python/perspective/setup.py Outdated Show resolved Hide resolved
@tomjakubowski tomjakubowski force-pushed the feature/export branch 3 times, most recently from c8330a4 to d9f3e34 Compare November 15, 2023 19:53
Add `text/html` output to PerspectiveWidget's `_repr_mimebundle_`
method, which is read by nbconvert when exporting a notebook to
HTML.

Also bumps requirements, and adds sorting to the updater script
@texodus
Copy link
Member

texodus commented Nov 17, 2023

full build

Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good!

@texodus texodus merged commit cedadb8 into finos:master Nov 17, 2023
52 checks passed
@texodus texodus added the enhancement Feature requests or improvements label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants