Skip to content

Commit

Permalink
Document a few consts (#4907)
Browse files Browse the repository at this point in the history
These expose some functionality useful for static exports,
and it is helpful to have some additional context for
search.
  • Loading branch information
sjkelly authored Mar 27, 2024
1 parent d0428d5 commit 610b0fc
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,36 @@ using Scratch
using REPL
import Base64

"""
Reference to hold path of local plotly temp file. Initialized to `nothing`.
"""
const _plotly_local_file_path = Ref{Union{Nothing,String}}(nothing)

"""
Reference to hold cached plotly data URL. Initialized to `nothing`.
"""
const _plotly_data_url_cached = Ref{Union{Nothing,String}}(nothing)

_plotly_data_url() =
if _plotly_data_url_cached[] === nothing
_plotly_data_url_cached[] = "data:text/javascript;base64,$(Base64.base64encode(read(_plotly_local_file_path)))"
else
_plotly_data_url_cached[]
end
# use fixed version of Plotly instead of the latest one for stable dependency
# see github.com/JuliaPlots/Plots.jl/pull/2779

"""
use fixed version of Plotly instead of the latest one for stable dependency
"""
const _plotly_min_js_filename = "plotly-2.6.3.min.js"

"""
Whether to use local embedded or local dependencies instead of CDN.
"""
const _use_local_dependencies = Ref(false)

"""
Whether to use local plotly.js files instead of CDN.
"""
const _use_local_plotlyjs = Ref(false)

_plots_defaults() =
Expand Down

0 comments on commit 610b0fc

Please sign in to comment.