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

In html export of Pluto notebook, only one WGLMakie plot is shown #123

Open
greimel opened this issue Apr 15, 2022 · 7 comments
Open

In html export of Pluto notebook, only one WGLMakie plot is shown #123

greimel opened this issue Apr 15, 2022 · 7 comments

Comments

@greimel
Copy link

greimel commented Apr 15, 2022

cross-post from fonsp/Pluto.jl#1822 and MakieOrg/Makie.jl#1343

Given your comment fonsp/Pluto.jl#1822 (comment) and the fact you are doing a big refactor right now, I thought I bring this up in this repo here as well.

@koehlerson
Copy link

Is this also the reason why I see in the new docs build of Ferrite-FEM/FerriteViz.jl#70 only one plot? https://ferrite-fem.github.io/FerriteViz.jl/previews/PR70/tutorial/

@termi-official
Copy link

termi-official commented May 22, 2023

I think this is an initialization order issue. In the PR linked by Max I could track down an error being thrown here https://github.com/SimonDanisch/JSServe.jl/blob/master/docs/javascript/JSServe.bundled.js#L3304-L3307 , because the session for the second plot assumes that some tracking only object is already present in the GLOBAL_OBJECT_CACHE, which should is loaded by the first plot. However, the second plot usually fetches the binary first and hence executes init_session before the first plot has been been able to fetch its binary. Which makes sense, because the binary of the first object is larger due to the some stuff being cached there.

I have tried to resolve this but can not come up with a good solution.

Edit 1: Note that adding barriers won't fix the issue, because modern browsers execute the individual scripts asynchronously... I.e.

<div data-jscall-id="1">
      <script type="module">
        var msgs = await JSServe.fetch_binary('../ac4bca5ca7a63a3c43a9f9ea20a15f7fdc1b0866-2501377904336721166.dist');
        JSServe.init_session('6478f46f-956e-43aa-89f8-bdb93696fa7d', msgs, 'sub');
      </script>
      <canvas data-jscall-id="2" tabindex="0"></canvas>
    </div>
<div data-jscall-id="3">
      <script type="module">
        var msgs = await JSServe.fetch_binary('../66b9681ba3555ad76ef7104ea0663387f8412de3-18296366943194903786.dist');
        JSServe.init_session('2b7f892c-dcc2-4e7a-ad98-c549d1e5d781', msgs, 'sub');
      </script>
      <canvas data-jscall-id="4" tabindex="0"></canvas>
    </div>

also does not fix the issue.

@termi-official
Copy link

The new JSServe release should fix the issue (at least it does for us). Can you take a look if you have time Fabian?

@greimel
Copy link
Author

greimel commented May 23, 2023

Unfortunately not. Now there is not even a single plot anymore :-(

image

@termi-official
Copy link

I think in the new version you have to remove exportable=true, offline=true and just call Page() - at least it is my understanding that JSServe handles the setup now more automatically.

@SimonDanisch
Copy link
Owner

Well, I dont think this was necessarily the same issue ... Pluto's export is doing quite a lot of things, so lots of ways to break ... I think we'll need to sit down and debug the issue in Pluto at some point, but it hasn't been a priority yet..

@termi-official
Copy link

I can not even reproduce this locally, because I am unable to install version 2.2.3. Weird.

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 a pull request may close this issue.

4 participants