Plotly fixed version (#2779)

* Fixed version for plotly.js dependency

* Fixed version for plotly.js dependency - .gitignore update
This commit is contained in:
Fons van der Plas 2020-06-17 11:17:37 +02:00 committed by GitHub
parent e88654cca5
commit fb40ed1f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@
.DS_Store
examples/.ipynb_checkpoints/*
examples/meetup/.ipynb_checkpoints/*
deps/plotly-latest.min.js
deps/plotly-*
deps/build.log
deps/deps.jl
Manifest.toml

8
deps/build.jl vendored
View File

@ -1,12 +1,12 @@
#TODO: download https://cdn.plot.ly/plotly-latest.min.js to deps/ if it doesn't exist
#TODO: download https://cdn.plot.ly/plotly-1.54.2.min.js to deps/ if it doesn't exist
file_path = ""
if get(ENV, "PLOTS_HOST_DEPENDENCY_LOCAL", "false") == "true"
global file_path
local_fn = joinpath(dirname(@__FILE__), "plotly-latest.min.js")
local_fn = joinpath(dirname(@__FILE__), "plotly-1.54.2.min.js")
if !isfile(local_fn)
@info("Cannot find deps/plotly-latest.min.js... downloading latest version.")
download("https://cdn.plot.ly/plotly-latest.min.js", local_fn)
@info("Cannot find deps/plotly-1.54.2.min.js... downloading latest version.")
download("https://cdn.plot.ly/plotly-1.54.2.min.js", local_fn)
isfile(local_fn) && (file_path = local_fn)
else
file_path = local_fn

View File

@ -828,7 +828,7 @@ const ijulia_initialized = Ref(false)
function plotly_html_head(plt::Plot)
local_file = ("file:///" * plotly_local_file_path)
plotly =
use_local_dependencies[] ? local_file : "https://cdn.plot.ly/plotly-latest.min.js"
use_local_dependencies[] ? local_file : "https://cdn.plot.ly/plotly-1.54.2.min.js"
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"