-
Notifications
You must be signed in to change notification settings - Fork 122
Extract the render-to-string portion of to_html() into its own public method #14
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
Conversation
shahinrostami
commented
Jun 21, 2020
@Xymist I just found this whilst looking to introduce some improvements for DARN... I want to make some changes to reduce notebook sizes (sometimes 6-7MB) to 10-100KB. I'm torn between forking igiagkiozis/plotly and making these improvements directly or introducing them as a post-processing step in DARN.
Hi @Xymist, please re-direct the pull request to the dev branch.
@igiagkiozis - Done, thank you.
@Xymist I just found this whilst looking to introduce some improvements for DARN... I want to make some changes to reduce notebook sizes (sometimes 6-7MB) to 10-100KB. I'm torn between forking
igiagkiozis/plotlyand making these improvements directly or introducing them as a post-processing step inDARN.
@shahinrostami the size is due to every plot being self contained, which means that plotly.js is copied in every single plot. This is quite inefficient for this use case. I'm currently looking into alternative ways to better support this use case.
@Xymist, @shahinrostami I've pushed an implementation that works with inline html nicely without the extra js dependencies. You can try it out in the latest dev branch; this feature will be released in version 0.5.xx
Uh oh!
There was an error while loading. Please reload this page.
Add a
.to_inline_html()method toPlotwhich can then be sent elsewhere for rendering.For example, when using in Evcxr this turns this construction:
into this one-liner:
I debated adding a helper method for that wrapping - I'm happy to do so but I feel it would be presumptive without an OK from @igiagkiozis since they might not wish to officially support such usage, and interested parties probably are using DARN anyway which is a better place for it.
Closes #12 as long as people are happy to do their own root div or Evcxr content wrapping.