Skip to content

Commit

Permalink
add mention to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
disberd committed Jan 3, 2025
1 parent af9946a commit 8a1cb1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ begin
import Pkg
Pkg.add(; name = "Kaleido_jll", version = "0.1")
end

The package will now default to using an explicitly provided version of Kaleido 0.1 on Windows systems without requiring to explicitly fix the version of `Kaleido_jll` in your project environment.

To disable this automatic fallback, you can set `PlotlyKaleido.USE_KALEIDO_FALLBACK[] = false`.
```
5 changes: 3 additions & 2 deletions src/PlotlyKaleido.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ else
""
end

should_try_fallback() = Sys.iswindows() && (get_kaleido_version() !== "0.1.0")
get_kaleido_version() = read(joinpath(Kaleido_jll.artifact_dir, "version"), String)
should_try_fallback() = Sys.iswindows() && (get_kaleido_version() !== "0.1.0")

const USE_KALEIDO_FALLBACK = Ref(should_try_fallback())

Expand Down Expand Up @@ -68,19 +68,20 @@ function readline_noblock(io; timeout = 10)
schedule(interrupter)
schedule(task)
wait(task)
kaleido_version = get_kaleido_version()
out = take!(msg)
if out === "Stopped"
warn_str = "It looks like the Kaleido process is not responding since $(timeout) seconds.
The unresponsive process will be killed, but this means that you will not be able to save figures using `savefig`."

if should_try_fallback() && !USE_KALEIDO_FALLBACK[]
warn_str *= "
You seem to be on Windows but have disabled the automatic fallback to version 0.1 of Kaleido. You may want to try enabling it by calling `PlotlyKaleido.USE_KALEIDO_FALLBACK[] = true`, as higher version of Kaleido are known to have issues on Windows.
Check the Package Readme at https://github.com/JuliaPlots/PlotlyKaleido.jl/tree/main#windows-note for more details."
end

warn_str *= "
Alternatively, you might try using a longer timeout to check if the process is not responding by passing the desired value in seconds using the `timeout` kwarg when calling `PlotlyKaleido.start` or `PlotlyKaleido.restart`"
warn_and_kill(warn_str)
end
Expand Down

0 comments on commit 8a1cb1b

Please sign in to comment.