Skip to content

Commit

Permalink
Merge pull request #469 from Liozou/precompilationbackgroundtask
Browse files Browse the repository at this point in the history
Fix precompilation of packages depending on PlotlyJS
  • Loading branch information
BeastyBlacksmith authored Oct 9, 2023
2 parents 43d38e9 + f3896e5 commit f366cdc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/PlotlyJS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function __init__()
@warn("Warnings were generated during the last build of PlotlyJS: please check the build log at $_build_log")
end

@async _start_kaleido_process()
kaleido_task = Base.Threads.@spawn _start_kaleido_process()

if !isfile(_js_path)
@info("plotly.js javascript libary not found -- downloading now")
Expand Down Expand Up @@ -163,6 +163,16 @@ function __init__()
dataset(::Type{DataFrames.DataFrame}, name::String) = DataFrames.DataFrame(dataset(CSV.File, name))
end
end

wait(kaleido_task)

if ccall(:jl_generating_output, Cint, ()) == 1
# ensure precompilation of packages depending on PlotlyJS finishes
if isdefined(P, :proc)
close(P.stdin)
wait(P.proc)
end
end
end

# for methods that update the layout, first apply to the plot, then let plotly.js
Expand Down

0 comments on commit f366cdc

Please sign in to comment.