-
Notifications
You must be signed in to change notification settings - Fork 55
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
Version 1.7.0 #225
Version 1.7.0 #225
Conversation
mwouts
commented
Feb 4, 2024
•
edited
Loading
edited
- Closes Add Quarto to supported editors #179
- Closes VSCode Loading #216
- Closes Itables fails to display tables in a copy of a notebook when the original notebook is already opened in Jupyter Lab #222
- Closes FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas #223
</script> | ||
<style>dt_css</style> | ||
<script>jquery_src</script> | ||
<script>window._datatables_src_for_itables = "dt_src"</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works and looks much simpler to me than the previous promise. Now window._datatables_src_for_itables
is set when itables.init_notebook_mode
is called, and its value is the base64 encoding of the datatables.net
library.
Then for every table in the HTML document we do
const dt = (await import(window._datatables_src_for_itables)).default;
which might cause some redundancy (unless import has a cache?).
IMO that's worth the simplification, and in practice I don't notice any performance difference. I also have hopes that this can solve an intermittent issue in VS Code (#216 ).
@fwouts may I ask if you see any problem with repeating the import like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is likely cached and so would be fine! You could try adding a simple console.log("Hello, World!")
statement in the base64-encoded window. _datatables_src_for_itables
to make sure it's only logged once for multiple tables.
Don't activate datatables twice
to avoid a `pandas==2.2.0` warning: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas.
7daaf71
to
118cfb2
Compare
Add data-quarto-disable-processing="true" to the tables that are not generated with to_html
Remove unnecessary dom arguments