From d0e01a8d882370d3244baf1d62ddbc66d038c1ea Mon Sep 17 00:00:00 2001 From: Jks Liu Date: Mon, 11 Jan 2021 22:48:04 +0800 Subject: [PATCH 1/2] Correct version string of plotly cache file name --- src/init.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.jl b/src/init.jl index 2a64844d..6673c220 100644 --- a/src/init.jl +++ b/src/init.jl @@ -79,7 +79,7 @@ function __init__() end if get(ENV, "PLOTS_HOST_DEPENDENCY_LOCAL", "false") == "true" - global plotly_local_file_path[] = joinpath(@get_scratch!("plotly"), "plotly-1.54.2.min.js") + global plotly_local_file_path[] = joinpath(@get_scratch!("plotly"), "plotly-1.57.1.min.js") if !isfile(plotly_local_file_path[]) download("https://cdn.plot.ly/plotly-1.57.1.min.js", plotly_local_file_path[]) end From 4bcafe3f5198542ddcc46e6e10299a5fb249561f Mon Sep 17 00:00:00 2001 From: Jks Liu Date: Tue, 12 Jan 2021 22:09:48 +0800 Subject: [PATCH 2/2] const variable for plotly JavaScript file name --- src/Plots.jl | 4 ++++ src/backends/plotly.jl | 2 +- src/init.jl | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 1ce8bf65..50b4205c 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -187,6 +187,10 @@ import RecipesPipeline: SliceIt, datetimeformatter, timeformatter +# Use fixed version of Plotly instead of the latest one for stable dependency +# Ref: https://github.com/JuliaPlots/Plots.jl/pull/2779 +const _plotly_min_js_filename = "plotly-1.57.1.min.js" + include("types.jl") include("utils.jl") include("axes.jl") diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 89c97e54..005ecead 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -887,7 +887,7 @@ const ijulia_initialized = Ref(false) function plotly_html_head(plt::Plot) plotly = - use_local_dependencies[] ? ("file:///" * plotly_local_file_path[]) : "https://cdn.plot.ly/plotly-1.57.1.min.js" + use_local_dependencies[] ? ("file:///" * plotly_local_file_path[]) : "https://cdn.plot.ly/$(_plotly_min_js_filename)" include_mathjax = get(plt[:extra_plot_kwargs], :include_mathjax, "") mathjax_file = include_mathjax != "cdn" ? ("file://" * include_mathjax) : "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML" diff --git a/src/init.jl b/src/init.jl index 6673c220..22bb4b51 100644 --- a/src/init.jl +++ b/src/init.jl @@ -79,9 +79,9 @@ function __init__() end if get(ENV, "PLOTS_HOST_DEPENDENCY_LOCAL", "false") == "true" - global plotly_local_file_path[] = joinpath(@get_scratch!("plotly"), "plotly-1.57.1.min.js") + global plotly_local_file_path[] = joinpath(@get_scratch!("plotly"), _plotly_min_js_filename) if !isfile(plotly_local_file_path[]) - download("https://cdn.plot.ly/plotly-1.57.1.min.js", plotly_local_file_path[]) + download("https://cdn.plot.ly/$(_plotly_min_js_filename)", plotly_local_file_path[]) end use_local_plotlyjs[] = true