From 1aaecbcac237c915ce3117527343dde209384831 Mon Sep 17 00:00:00 2001 From: Jks Liu Date: Sat, 27 Nov 2021 11:42:42 +0800 Subject: [PATCH] Upgrade plotly.js to version 2.6.3 --- src/Plots.jl | 2 +- src/backends/plotly.jl | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 4aff05a2..8add081e 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -203,7 +203,7 @@ import RecipesPipeline: # 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" +const _plotly_min_js_filename = "plotly-2.6.3.min.js" include("types.jl") include("utils.jl") diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index adf8adb7..fde4b80b 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -1078,10 +1078,10 @@ function plotly_html_body(plt, style = nothing) requirejs_prefix = """ requirejs.config({ paths: { - Plotly: '$(plotly_no_ext)' + Plotly2: '$(plotly_no_ext)' } }); - require(['Plotly'], function (Plotly) { + require(['Plotly2'], function (Plotly2) { """ requirejs_suffix = "});" end @@ -1100,8 +1100,7 @@ end function js_body(plt::Plot, uuid) js = """ - var PLOT = document.getElementById('$(uuid)'); - Plotly.plot(PLOT, $(plotly_series_json(plt)), $(plotly_layout_json(plt))); + Plotly2.newPlot('$(uuid)', $(plotly_series_json(plt)), $(plotly_layout_json(plt))); """ end