diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc857cd33..ee77c95ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: GKS_ENCODING: "utf8" GKSwstype: "nul" JULIA_CONDAPKG_BACKEND: "MicroMamba" + PLOTS_PLOTLYJS_UNSAFE_ELECTRON: "true" MPLBACKEND: "agg" name: Julia ${{ matrix.version }} - ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} diff --git a/src/backends.jl b/src/backends.jl index e88b25ae1..792ff18b8 100644 --- a/src/backends.jl +++ b/src/backends.jl @@ -848,6 +848,13 @@ const _pgfplots_scale = [:identity, :ln, :log2, :log10] # ------------------------------------------------------------------------------ # plotlyjs +_post_imports(::PlotlyJSBackend) = @eval begin + const PlotlyJS = Main.PlotlyJS + if Plots.bool_env("PLOTS_PLOTLYJS_UNSAFE_ELECTRON", "false") + (Sys.islinux() && isdefined(PlotlyJS, :unsafe_electron)) && + PlotlyJS.unsafe_electron() + end +end const _plotlyjs_attr = _plotly_attr const _plotlyjs_seriestype = _plotly_seriestype