Skip to content

Plot does not appear in html output of Quarto notebook when using both PlotlyLight and PlotlyKaleido #55

@dpo

Description

@dpo

Thank you for making the fastest plotting package for Julia on both sides of the Mississippi!

I use PlotlyLight in Quarto notebooks, and all is well as long as you generate html output.
The following simple notebook illustrates the issue:

---
title: PlotlyLight and Quarto
engine: julia
---

```{julia}
#| output: false
using Pkg
Pkg.activate("quarto-plotlylight")
Pkg.add("PlotlyLight")
# Pkg.add("PlotlyKaleido")

using PlotlyLight
# using PlotlyKaleido
# PlotlyKaleido.start()
```

# A plot with PlotlyLight

```{julia}
p = plot(x=1:200, y=cumsum(randn(200)), type="scatter", mode="lines")
p.layout.title.text = "Your stocks"
display(p)

Rendering the notebook above to html produces the expected result: the plot is included in the html output.

Now I also use PlotlyKaleido because I need to render the same notebook to PDF. I didn't include above the commands to save the plot and subsequently include it in the report, but the issue is that if you uncomment the lines about PlotlyKaleido above and render to html again, the plot is no longer included in the html output.

I tried several versions of PlotlyLight, and the issue occurs for all of them. It seems like there is an interaction between PlotlyLight, PlotlyKaleido and (perhaps) Quarto that causes the plot to pop up in a browser tab instead of in the html output.

I'm using Julia 1.11 on Mac M1 and Quarto 1.7.30 installed via Homebrew (if that matters).

Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions