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

Plot height of plotly graph in html export is incorrect (Pluto 0.14.1 & chrome) #1088

Closed
holomorphism opened this issue Apr 13, 2021 · 7 comments
Assignees
Labels
frontend Concerning the HTML editor one day Closed because we won't work on it soon, will be opened again later.

Comments

@holomorphism
Copy link
Contributor

With the change from Pluto 0.14 to 0.14.1, when I export a notebook containing plotly (Plots.jl) graphs to html and open it locally in chrome, the height is no longer displayed correctly. (I am using google chrome 89 on Ubuntu 18.04. In firefox it is displayed correctly.)

Pluto 0.14:
image
plotly_minimal.jl.0.14.0.html.txt

Pluto 0.14.1:
image
plotly_minimal.jl.0.14.1.html.txt

The html by Pluto 0.14.1 had the following error in the chrome console.

image

I think this is due to a security restriction of chrome, and if you open the html uploaded to the web, the error will not occur. The above behavior of Pluto 0.14.1 may be normal, but I report it just in case. If this is not considered a problem, please close it.

@holomorphism
Copy link
Contributor Author

(I posted a comment that I think this issue is similar to #1087, but I'm still not sure, so I deleted that post)

@fonsp
Copy link
Owner

fonsp commented Apr 13, 2021

I think this might be "impossible to fix", @pankgeorg can you verify? Is it a Chrome bug?

This is not a major issue, iframe-embedded HTML output is not super common, and it works when served over HTTPS, which is our main focus. So if it takes too much time, we might not fix this.

@fonsp fonsp added the frontend Concerning the HTML editor label Apr 13, 2021
@pankgeorg
Copy link
Collaborator

pankgeorg commented Apr 13, 2021

It also works over HTTP, if, for example, you npx serve.
Indeed, the problem doesn't seem 'fixable' as the code is now. Maybe we can detect running in through local filesystem and skip iframes - or you can disable security: https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome

@fonsp fonsp closed this as completed Apr 13, 2021
@fonsp fonsp added the one day Closed because we won't work on it soon, will be opened again later. label Apr 13, 2021
@holomorphism
Copy link
Contributor Author

Thanks for the reply and the useful info!

@fonsp
Copy link
Owner

fonsp commented Jun 7, 2021

Some simple solutions:

  1. Put the html file in a github repository and use github pages to view the html
  2. Put the html file in a github repository or on gist.github.com and use https://htmlview.glitch.me/ to view it

@holomorphism
Copy link
Contributor Author

I noticed that this problem is solved in Pluto v0.14.8 and Plots v1.16.8.
Maybe it's because of this PR?
JuliaPlots/Plots.jl#3559
Thanks a lot!

@fonsp
Copy link
Owner

fonsp commented Jul 5, 2021

That's right! yayo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Concerning the HTML editor one day Closed because we won't work on it soon, will be opened again later.
Projects
None yet
Development

No branches or pull requests

3 participants