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

Fix precompilation of packages depending on PlotlyJS #469

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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