diff --git a/Project.toml b/Project.toml index e74e8cc..6a24b8e 100644 --- a/Project.toml +++ b/Project.toml @@ -41,7 +41,7 @@ JSExpr = "0.5, 1" JSON = "0.20, 0.21" JSON3 = "1" PlotlyBase = "0.8.15" -PlotlyKaleido = "2" +PlotlyKaleido = "2.2.5" Reexport = "0.2, 1" Requires = "1.0" WebIO = "0.8" diff --git a/src/PlotlyJS.jl b/src/PlotlyJS.jl index 3f60e31..79eb7c5 100644 --- a/src/PlotlyJS.jl +++ b/src/PlotlyJS.jl @@ -99,15 +99,15 @@ function __init__() @warn("Warnings were generated during the last build of PlotlyJS: please check the build log at $_build_log") end - if ccall(:jl_generating_output, Cint, ()) != 1 - # ensure precompilation of packages depending on PlotlyJS finishes - PlotlyKaleido.start() - end - if !isfile(_js_path) - @info("plotly.js javascript libary not found -- downloading now") + @info("plotly.js javascript library not found -- downloading now") include(joinpath(_pkg_root, "deps", "build.jl")) end + + if ccall(:jl_generating_output, Cint, ()) != 1 + # ensure precompilation of packages depending on PlotlyJS finishes + PlotlyKaleido.start(plotlyjs=_js_path) + end # set default renderer # First check env var diff --git a/src/kaleido.jl b/src/kaleido.jl index 67fc288..49da826 100644 --- a/src/kaleido.jl +++ b/src/kaleido.jl @@ -121,7 +121,7 @@ function savefig( return fn end -_ensure_kaleido_running() = !is_running() && restart() +_ensure_kaleido_running(; kwargs...) = !is_running() && restart(; plotlyjs=_js_path, kwargs...) const _KALEIDO_MIMES = Dict( "application/pdf" => "pdf",