diff --git a/Project.toml b/Project.toml index 2314a56..85d467c 100644 --- a/Project.toml +++ b/Project.toml @@ -9,7 +9,6 @@ DefaultApplication = "3f0dd361-4fe0-5fc6-8523-80b14ec94d85" Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6" EasyConfig = "acab07b0-f158-46d4-8913-50acef6d41fe" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [compat] diff --git a/deps/build.jl b/deps/build.jl new file mode 100644 index 0000000..f23d7f2 --- /dev/null +++ b/deps/build.jl @@ -0,0 +1 @@ +download("https://cdn.plot.ly/plotly-2.8.3.min.js", joinpath(@__DIR__, "plotly-2.8.3.min.js")) diff --git a/src/PlotlyLight.jl b/src/PlotlyLight.jl index b48de29..fcaae68 100644 --- a/src/PlotlyLight.jl +++ b/src/PlotlyLight.jl @@ -9,22 +9,11 @@ using Downloads export Plot, Config -#-----------------------------------------------------------------------------# plotly.js artifact -plotlyjs = let - artifacts_toml = abspath(joinpath(@__DIR__, "..", "Artifacts.toml")) - plotlylatest_hash = artifact_hash("plotlylatest", artifacts_toml) - - if isnothing(plotlylatest_hash) || !artifact_exists(plotlylatest_hash) - plotlylatest_hash = create_artifact() do dir - Downloads.download("https://cdn.plot.ly/plotly-2.8.3.min.js", joinpath(dir, "plotly-latest.min.js")) - end - bind_artifact!(artifacts_toml, "plotlylatest", plotlylatest_hash; force=true) - end - joinpath(artifact_path(plotlylatest_hash), "plotly-latest.min.js") +function __init__() + global plotlyjs = joinpath(@__DIR__, "..", "deps", "plotly-2.8.3.min.js") + !(isfile(plotlyjs)) && @warn "Cannot find plotly.js. PlotlyLight should be built again." end - - #-----------------------------------------------------------------------------# src src_opts = [:cdn, :local, :standalone, :none] plotlysrc = Ref(:cdn) diff --git a/test/runtests.jl b/test/runtests.jl index 4d633ab..c5e81ea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,5 +20,5 @@ end @test length(repr("text/html", p)) > 1000 PlotlyLight.src!(:local) - @test occursin("artifact", repr("text/html", p)) + @test occursin("deps", repr("text/html", p)) end